service status on atproto

feat!: improve the lexicon

ptr.pet 8974b29d 6cc4ad1e

verified
+46 -44
+1 -4
lexicon/check.json
··· 7 7 "key": "tid", 8 8 "record": { 9 9 "type": "object", 10 - "required": ["id", "name", "forService"], 10 + "required": ["name", "forService"], 11 11 "properties": { 12 - "id": { 13 - "type": "string" 14 - }, 15 12 "name": { 16 13 "type": "string" 17 14 },
+2 -2
lexicon/service.json
··· 4 4 "defs": { 5 5 "main": { 6 6 "type": "record", 7 - "key": "any", 7 + "key": "tid", 8 8 "record": { 9 9 "type": "object", 10 - "required": ["name", "hostedBy"], 10 + "required": ["name"], 11 11 "properties": { 12 12 "name": { 13 13 "type": "string"
+9 -5
lexicon/state.json
··· 7 7 "key": "tid", 8 8 "record": { 9 9 "type": "object", 10 - "required": ["from", "to", "changedAt", "generatedBy"], 10 + "required": ["from", "to", "changedAt", "forService"], 11 11 "properties": { 12 12 "from": { 13 13 "type": "string", 14 14 "enum": [ 15 - "systems.gaze.barometer.status.passed", 16 - "systems.gaze.barometer.status.failed", 15 + "systems.gaze.barometer.status.healthy", 16 + "systems.gaze.barometer.status.degraded", 17 17 "systems.gaze.barometer.status.unknown" 18 18 ] 19 19 }, 20 20 "to": { 21 21 "type": "string", 22 22 "enum": [ 23 - "systems.gaze.barometer.status.passed", 24 - "systems.gaze.barometer.status.failed" 23 + "systems.gaze.barometer.status.healthy", 24 + "systems.gaze.barometer.status.degraded" 25 25 ] 26 26 }, 27 27 "reason": { ··· 30 30 "changedAt": { 31 31 "type": "string", 32 32 "format": "datetime" 33 + }, 34 + "forService": { 35 + "type": "string", 36 + "format": "at-uri" 33 37 }, 34 38 "generatedBy": { 35 39 "type": "string",
+10
lexicon/status/degraded.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "systems.gaze.barometer.status.degraded", 4 + "defs": { 5 + "main": { 6 + "type": "token", 7 + "description": "represents that a service / check is not working as it should" 8 + } 9 + } 10 + }
-10
lexicon/status/failed.json
··· 1 - { 2 - "lexicon": 1, 3 - "id": "systems.gaze.barometer.status.failed", 4 - "defs": { 5 - "main": { 6 - "type": "token", 7 - "description": "Token representing a failed state in the barometer system" 8 - } 9 - } 10 - }
+10
lexicon/status/healthy.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "systems.gaze.barometer.status.healthy", 4 + "defs": { 5 + "main": { 6 + "type": "token", 7 + "description": "represents that a service / check is working properly" 8 + } 9 + } 10 + }
-10
lexicon/status/passed.json
··· 1 - { 2 - "lexicon": 1, 3 - "id": "systems.gaze.barometer.status.passed", 4 - "defs": { 5 - "main": { 6 - "type": "token", 7 - "description": "Token representing a passed state in the barometer system" 8 - } 9 - } 10 - }
+1 -1
lexicon/status/unknown.json
··· 4 4 "defs": { 5 5 "main": { 6 6 "type": "token", 7 - "description": "Token representing an unknown state in the barometer system" 7 + "description": "represents that the state of the service / check is unknown (only used for first from field in a state record)" 8 8 } 9 9 } 10 10 }
+2 -2
lib/src/lexicons/index.ts
··· 2 2 export * as SystemsGazeBarometerHost from "./types/systems/gaze/barometer/host.js"; 3 3 export * as SystemsGazeBarometerService from "./types/systems/gaze/barometer/service.js"; 4 4 export * as SystemsGazeBarometerState from "./types/systems/gaze/barometer/state.js"; 5 - export * as SystemsGazeBarometerStatusFailed from "./types/systems/gaze/barometer/status/failed.js"; 6 - export * as SystemsGazeBarometerStatusPassed from "./types/systems/gaze/barometer/status/passed.js"; 5 + export * as SystemsGazeBarometerStatusDegraded from "./types/systems/gaze/barometer/status/degraded.js"; 6 + export * as SystemsGazeBarometerStatusHealthy from "./types/systems/gaze/barometer/status/healthy.js"; 7 7 export * as SystemsGazeBarometerStatusUnknown from "./types/systems/gaze/barometer/status/unknown.js";
+1 -1
lib/src/lexicons/types/systems/gaze/barometer/check.ts
··· 3 3 import type {} from "@atcute/lexicons/ambient"; 4 4 5 5 const _mainSchema = /*#__PURE__*/ v.record( 6 - /*#__PURE__*/ v.string(), 6 + /*#__PURE__*/ v.tidString(), 7 7 /*#__PURE__*/ v.object({ 8 8 $type: /*#__PURE__*/ v.literal("systems.gaze.barometer.check"), 9 9 description: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.string()),
+2 -2
lib/src/lexicons/types/systems/gaze/barometer/service.ts
··· 3 3 import type {} from "@atcute/lexicons/ambient"; 4 4 5 5 const _mainSchema = /*#__PURE__*/ v.record( 6 - /*#__PURE__*/ v.string(), 6 + /*#__PURE__*/ v.tidString(), 7 7 /*#__PURE__*/ v.object({ 8 8 $type: /*#__PURE__*/ v.literal("systems.gaze.barometer.service"), 9 9 appUri: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.genericUriString()), 10 10 description: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.string()), 11 - hostedBy: /*#__PURE__*/ v.resourceUriString(), 11 + hostedBy: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.resourceUriString()), 12 12 name: /*#__PURE__*/ v.string(), 13 13 }), 14 14 );
+6 -5
lib/src/lexicons/types/systems/gaze/barometer/state.ts
··· 7 7 /*#__PURE__*/ v.object({ 8 8 $type: /*#__PURE__*/ v.literal("systems.gaze.barometer.state"), 9 9 changedAt: /*#__PURE__*/ v.datetimeString(), 10 + forService: /*#__PURE__*/ v.resourceUriString(), 10 11 from: /*#__PURE__*/ v.literalEnum([ 11 - "systems.gaze.barometer.status.failed", 12 - "systems.gaze.barometer.status.passed", 12 + "systems.gaze.barometer.status.degraded", 13 + "systems.gaze.barometer.status.healthy", 13 14 "systems.gaze.barometer.status.unknown", 14 15 ]), 15 - generatedBy: /*#__PURE__*/ v.resourceUriString(), 16 + generatedBy: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.resourceUriString()), 16 17 reason: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.string()), 17 18 to: /*#__PURE__*/ v.literalEnum([ 18 - "systems.gaze.barometer.status.failed", 19 - "systems.gaze.barometer.status.passed", 19 + "systems.gaze.barometer.status.degraded", 20 + "systems.gaze.barometer.status.healthy", 20 21 ]), 21 22 }), 22 23 );
+1 -1
lib/src/lexicons/types/systems/gaze/barometer/status/failed.ts lib/src/lexicons/types/systems/gaze/barometer/status/degraded.ts
··· 2 2 import * as v from "@atcute/lexicons/validations"; 3 3 4 4 const _mainSchema = /*#__PURE__*/ v.literal( 5 - "systems.gaze.barometer.status.failed", 5 + "systems.gaze.barometer.status.degraded", 6 6 ); 7 7 8 8 type main$schematype = typeof _mainSchema;
+1 -1
lib/src/lexicons/types/systems/gaze/barometer/status/passed.ts lib/src/lexicons/types/systems/gaze/barometer/status/healthy.ts
··· 2 2 import * as v from "@atcute/lexicons/validations"; 3 3 4 4 const _mainSchema = /*#__PURE__*/ v.literal( 5 - "systems.gaze.barometer.status.passed", 5 + "systems.gaze.barometer.status.healthy", 6 6 ); 7 7 8 8 type main$schematype = typeof _mainSchema;