service status on atproto

feat!: improve the lexicon

ptr.pet 8974b29d 6cc4ad1e

verified
Changed files
+46 -44
lexicon
lib
src
lexicons
types
systems
+1 -4
lexicon/check.json
···
"key": "tid",
"record": {
"type": "object",
-
"required": ["id", "name", "forService"],
"properties": {
-
"id": {
-
"type": "string"
-
},
"name": {
"type": "string"
},
···
"key": "tid",
"record": {
"type": "object",
+
"required": ["name", "forService"],
"properties": {
"name": {
"type": "string"
},
+2 -2
lexicon/service.json
···
"defs": {
"main": {
"type": "record",
-
"key": "any",
"record": {
"type": "object",
-
"required": ["name", "hostedBy"],
"properties": {
"name": {
"type": "string"
···
"defs": {
"main": {
"type": "record",
+
"key": "tid",
"record": {
"type": "object",
+
"required": ["name"],
"properties": {
"name": {
"type": "string"
+9 -5
lexicon/state.json
···
"key": "tid",
"record": {
"type": "object",
-
"required": ["from", "to", "changedAt", "generatedBy"],
"properties": {
"from": {
"type": "string",
"enum": [
-
"systems.gaze.barometer.status.passed",
-
"systems.gaze.barometer.status.failed",
"systems.gaze.barometer.status.unknown"
]
},
"to": {
"type": "string",
"enum": [
-
"systems.gaze.barometer.status.passed",
-
"systems.gaze.barometer.status.failed"
]
},
"reason": {
···
"changedAt": {
"type": "string",
"format": "datetime"
},
"generatedBy": {
"type": "string",
···
"key": "tid",
"record": {
"type": "object",
+
"required": ["from", "to", "changedAt", "forService"],
"properties": {
"from": {
"type": "string",
"enum": [
+
"systems.gaze.barometer.status.healthy",
+
"systems.gaze.barometer.status.degraded",
"systems.gaze.barometer.status.unknown"
]
},
"to": {
"type": "string",
"enum": [
+
"systems.gaze.barometer.status.healthy",
+
"systems.gaze.barometer.status.degraded"
]
},
"reason": {
···
"changedAt": {
"type": "string",
"format": "datetime"
+
},
+
"forService": {
+
"type": "string",
+
"format": "at-uri"
},
"generatedBy": {
"type": "string",
+10
lexicon/status/degraded.json
···
···
+
{
+
"lexicon": 1,
+
"id": "systems.gaze.barometer.status.degraded",
+
"defs": {
+
"main": {
+
"type": "token",
+
"description": "represents that a service / check is not working as it should"
+
}
+
}
+
}
-10
lexicon/status/failed.json
···
-
{
-
"lexicon": 1,
-
"id": "systems.gaze.barometer.status.failed",
-
"defs": {
-
"main": {
-
"type": "token",
-
"description": "Token representing a failed state in the barometer system"
-
}
-
}
-
}
···
+10
lexicon/status/healthy.json
···
···
+
{
+
"lexicon": 1,
+
"id": "systems.gaze.barometer.status.healthy",
+
"defs": {
+
"main": {
+
"type": "token",
+
"description": "represents that a service / check is working properly"
+
}
+
}
+
}
-10
lexicon/status/passed.json
···
-
{
-
"lexicon": 1,
-
"id": "systems.gaze.barometer.status.passed",
-
"defs": {
-
"main": {
-
"type": "token",
-
"description": "Token representing a passed state in the barometer system"
-
}
-
}
-
}
···
+1 -1
lexicon/status/unknown.json
···
"defs": {
"main": {
"type": "token",
-
"description": "Token representing an unknown state in the barometer system"
}
}
}
···
"defs": {
"main": {
"type": "token",
+
"description": "represents that the state of the service / check is unknown (only used for first from field in a state record)"
}
}
}
+2 -2
lib/src/lexicons/index.ts
···
export * as SystemsGazeBarometerHost from "./types/systems/gaze/barometer/host.js";
export * as SystemsGazeBarometerService from "./types/systems/gaze/barometer/service.js";
export * as SystemsGazeBarometerState from "./types/systems/gaze/barometer/state.js";
-
export * as SystemsGazeBarometerStatusFailed from "./types/systems/gaze/barometer/status/failed.js";
-
export * as SystemsGazeBarometerStatusPassed from "./types/systems/gaze/barometer/status/passed.js";
export * as SystemsGazeBarometerStatusUnknown from "./types/systems/gaze/barometer/status/unknown.js";
···
export * as SystemsGazeBarometerHost from "./types/systems/gaze/barometer/host.js";
export * as SystemsGazeBarometerService from "./types/systems/gaze/barometer/service.js";
export * as SystemsGazeBarometerState from "./types/systems/gaze/barometer/state.js";
+
export * as SystemsGazeBarometerStatusDegraded from "./types/systems/gaze/barometer/status/degraded.js";
+
export * as SystemsGazeBarometerStatusHealthy from "./types/systems/gaze/barometer/status/healthy.js";
export * as SystemsGazeBarometerStatusUnknown from "./types/systems/gaze/barometer/status/unknown.js";
+1 -1
lib/src/lexicons/types/systems/gaze/barometer/check.ts
···
import type {} from "@atcute/lexicons/ambient";
const _mainSchema = /*#__PURE__*/ v.record(
-
/*#__PURE__*/ v.string(),
/*#__PURE__*/ v.object({
$type: /*#__PURE__*/ v.literal("systems.gaze.barometer.check"),
description: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.string()),
···
import type {} from "@atcute/lexicons/ambient";
const _mainSchema = /*#__PURE__*/ v.record(
+
/*#__PURE__*/ v.tidString(),
/*#__PURE__*/ v.object({
$type: /*#__PURE__*/ v.literal("systems.gaze.barometer.check"),
description: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.string()),
+2 -2
lib/src/lexicons/types/systems/gaze/barometer/service.ts
···
import type {} from "@atcute/lexicons/ambient";
const _mainSchema = /*#__PURE__*/ v.record(
-
/*#__PURE__*/ v.string(),
/*#__PURE__*/ v.object({
$type: /*#__PURE__*/ v.literal("systems.gaze.barometer.service"),
appUri: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.genericUriString()),
description: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.string()),
-
hostedBy: /*#__PURE__*/ v.resourceUriString(),
name: /*#__PURE__*/ v.string(),
}),
);
···
import type {} from "@atcute/lexicons/ambient";
const _mainSchema = /*#__PURE__*/ v.record(
+
/*#__PURE__*/ v.tidString(),
/*#__PURE__*/ v.object({
$type: /*#__PURE__*/ v.literal("systems.gaze.barometer.service"),
appUri: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.genericUriString()),
description: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.string()),
+
hostedBy: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.resourceUriString()),
name: /*#__PURE__*/ v.string(),
}),
);
+6 -5
lib/src/lexicons/types/systems/gaze/barometer/state.ts
···
/*#__PURE__*/ v.object({
$type: /*#__PURE__*/ v.literal("systems.gaze.barometer.state"),
changedAt: /*#__PURE__*/ v.datetimeString(),
from: /*#__PURE__*/ v.literalEnum([
-
"systems.gaze.barometer.status.failed",
-
"systems.gaze.barometer.status.passed",
"systems.gaze.barometer.status.unknown",
]),
-
generatedBy: /*#__PURE__*/ v.resourceUriString(),
reason: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.string()),
to: /*#__PURE__*/ v.literalEnum([
-
"systems.gaze.barometer.status.failed",
-
"systems.gaze.barometer.status.passed",
]),
}),
);
···
/*#__PURE__*/ v.object({
$type: /*#__PURE__*/ v.literal("systems.gaze.barometer.state"),
changedAt: /*#__PURE__*/ v.datetimeString(),
+
forService: /*#__PURE__*/ v.resourceUriString(),
from: /*#__PURE__*/ v.literalEnum([
+
"systems.gaze.barometer.status.degraded",
+
"systems.gaze.barometer.status.healthy",
"systems.gaze.barometer.status.unknown",
]),
+
generatedBy: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.resourceUriString()),
reason: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.string()),
to: /*#__PURE__*/ v.literalEnum([
+
"systems.gaze.barometer.status.degraded",
+
"systems.gaze.barometer.status.healthy",
]),
}),
);
+1 -1
lib/src/lexicons/types/systems/gaze/barometer/status/failed.ts lib/src/lexicons/types/systems/gaze/barometer/status/healthy.ts
···
import * as v from "@atcute/lexicons/validations";
const _mainSchema = /*#__PURE__*/ v.literal(
-
"systems.gaze.barometer.status.failed",
);
type main$schematype = typeof _mainSchema;
···
import * as v from "@atcute/lexicons/validations";
const _mainSchema = /*#__PURE__*/ v.literal(
+
"systems.gaze.barometer.status.healthy",
);
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/degraded.ts
···
import * as v from "@atcute/lexicons/validations";
const _mainSchema = /*#__PURE__*/ v.literal(
-
"systems.gaze.barometer.status.passed",
);
type main$schematype = typeof _mainSchema;
···
import * as v from "@atcute/lexicons/validations";
const _mainSchema = /*#__PURE__*/ v.literal(
+
"systems.gaze.barometer.status.degraded",
);
type main$schematype = typeof _mainSchema;