@structured-id/ids 0.0.0-stage → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/errors.ts","../src/validate.ts","../src/ids.ts","../src/generated/sid/v1/ids/ids.ts","../src/index.ts"],"names":["BindingId","MachineUserId","PasswordOperationId","ProvisioningConnectorId","ProvisioningCredentialId","ResourceId","MessageType"],"mappings":";;;;;;;;;;;AAwBA,SAAS,SAAS,MAAA,EAA+B;AAC/C,EAAA,QAAQ,OAAO,IAAA;AAAM,IACnB,KAAK,WAAA;AACH,MAAA,OAAO,YAAA;AAAA,IACT,KAAK,QAAA;AACH,MAAA,OAAO,CAAA,EAAG,OAAO,MAAM,CAAA,mBAAA,CAAA;AAAA,IACzB,KAAK,KAAA;AACH,MAAA,OAAO,cAAA;AAAA,IACT,KAAK,KAAA;AACH,MAAA,OAAO,cAAA;AAAA,IACT,KAAK,SAAA;AACH,MAAA,OAAO,sBAAA;AAAA,IACT,KAAK,SAAA;AACH,MAAA,OAAO,CAAA,aAAA,EAAgB,OAAO,OAAO,CAAA,oBAAA,CAAA;AAAA;AAE3C;AAMO,IAAM,OAAA,GAAN,cAAsB,KAAA,CAAM;AAAA,EAGjC,WAAA,CACW,MACA,MAAA,EACT;AACA,IAAA,KAAA,CAAM,WAAW,IAAI,CAAA,EAAA,EAAK,QAAA,CAAS,MAAM,CAAC,CAAA,CAAE,CAAA;AAHnC,IAAA,IAAA,CAAA,IAAA,GAAA,IAAA;AACA,IAAA,IAAA,CAAA,MAAA,GAAA,MAAA;AAAA,EAGX;AAAA,EAJW,IAAA;AAAA,EACA,MAAA;AAAA,EAJO,IAAA,GAAO,SAAA;AAQ3B;AAGO,IAAM,cAAA,GAAN,cAA6B,KAAA,CAAM;AAAA,EAGxC,YAAqB,IAAA,EAAc;AACjC,IAAA,KAAA,CAAM,CAAA,QAAA,EAAW,IAAI,CAAA,CAAE,C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E,EAAA,EAAI,CAAA;AAAA,QAAG,IAAA,EAAM,OAAA;AAAA,QAAS,IAAA,EAAM,QAAA;AAAA,QAAU,CAAA,EAAG;AAAA;AAAA;AAAwB,KACtE,CAAA;AAAA,EACL;AACJ,CAAA;AAIO,IAAMF,yBAAAA,GAA2B,IAAI,6BAAA,EAA8B;;;ACxJnE,IAAM,UAAA,GAAa","file":"index.cjs","sourcesContent":["/** The identifier kinds this package delivers: one per `sid.v1.ids` message. */\nexport type IdKind =\n | \"BindingId\"\n | \"MachineUserId\"\n | \"PasswordOperationId\"\n | \"ProvisioningConnectorId\"\n | \"ProvisioningCredentialId\"\n | \"ResourceId\";\n\n/** Why a value is not a valid identifier. */\nexport type IdErrorReason =\n /** The text is not a UUID in any accepted textual form. */\n | { readonly type: \"malformed\" }\n /** Binary form of a length other than 16 bytes. */\n | { readonly type: \"length\"; readonly length: number }\n /** The nil UUID (all zero bits). */\n | { readonly type: \"nil\" }\n /** The max UUID (all one bits). */\n | { readonly type: \"max\" }\n /** The variant bits are not those of RFC 9562. */\n | { readonly type: \"variant\" }\n /** An RFC 9562 UUID of a version other than 7. */\n | { readonly type: \"version\"; readonly version: number };\n\nfunction describe(reason: IdErrorReason): string {\n switch (reason.type) {\n case \"malformed\":\n return \"not a UUID\";\n case \"length\":\n return `${reason.length} bytes, expected 16`;\n case \"nil\":\n return \"the nil UUID\";\n case \"max\":\n return \"the max UUID\";\n case \"variant\":\n return \"not an RFC 4122 UUID\";\n case \"version\":\n return `UUID version ${reason.version}, expected version 7`;\n }\n}\n\n/**\n * A value that is not a valid identifier of the requested kind. Carries the\n * kind and the reason, never the value, so it can be logged freely.\n */\nexport class IdError extends Error {\n override readonly name = \"IdError\";\n\n constructor(\n readonly kind: IdKind,\n readonly reason: IdErrorReason,\n ) {\n super(`invalid ${kind}: ${describe(reason)}`);\n }\n}\n\n/** A required identifier message was absent. Absence is never a default. */\nexport class MissingIdError extends Error {\n override readonly name = \"MissingIdError\";\n\n constructor(readonly kind: IdKind) {\n super(`missing ${kind}`);\n }\n}\n","import { IdError, type IdKind } from \"./errors\";\n\n/**\n * The only accepted shape: exactly 16 bytes of a non-nil, non-max UUID of\n * the RFC 9562 variant and version 7 (RFC 9562 sections 4.1, 4.2, 5.7, 5.9,\n * 5.10). Returns a copy, so later changes to the input cannot reach it.\n */\nexport function validate(bytes: Uint8Array, kind: IdKind): Uint8Array {\n if (bytes.length !== 16) {\n throw new IdError(kind, { type: \"length\", length: bytes.length });\n }\n let zero = true;\n let ones = true;\n for (const byte of bytes) {\n zero &&= byte === 0x00;\n ones &&= byte === 0xff;\n }\n if (zero) throw new IdError(kind, { type: \"nil\" });\n if (ones) throw new IdError(kind, { type: \"max\" });\n // RFC 9562 4.1: the variant is the top bits of octet 8; this one is 10.\n if (((bytes[8] as number) & 0xc0) !== 0x80) {\n throw new IdError(kind, { type: \"variant\" });\n }\n // RFC 9562 4.2: the version is the high nibble of octet 6.\n const version = (bytes[6] as number) >> 4;\n if (version !== 7) throw new IdError(kind, { type: \"version\", version });\n return bytes.slice();\n}\n\nconst HEX = /^[0-9a-fA-F]{32}$/;\n\n/**\n * The 16 bytes of a textual UUID: hyphenated, simple (32 hex digits), braced\n * hyphenated or `urn:uuid:` hyphenated (RFC 9562 section 4), the forms the\n * Rust `sid-ids` parser accepts. Text is a presentation form; the wire\n * carries bytes.\n */\nexport function parseText(text: string, kind: IdKind): Uint8Array {\n let body = text;\n if (body.length === 45 && body.startsWith(\"urn:uuid:\")) {\n body = body.slice(9);\n } else if (body.length === 38 && body.startsWith(\"{\") && body.endsWith(\"}\")) {\n body = body.slice(1, 37);\n }\n let hex: string;\n if (body.length === 36) {\n if (body[8] !== \"-\" || body[13] !== \"-\" || body[18] !== \"-\" || body[23] !== \"-\") {\n throw new IdError(kind, { type: \"malformed\" });\n }\n hex =\n body.slice(0, 8) +\n body.slice(9, 13) +\n body.slice(14, 18) +\n body.slice(19, 23) +\n body.slice(24);\n } else if (body.length === 32 && text.length === 32) {\n hex = body;\n } else {\n throw new IdError(kind, { type: \"malformed\" });\n }\n if (!HEX.test(hex)) throw new IdError(kind, { type: \"malformed\" });\n const bytes = new Uint8Array(16);\n for (let i = 0; i < 16; i++) {\n bytes[i] = Number.parseInt(hex.slice(2 * i, 2 * i + 2), 16);\n }\n return bytes;\n}\n\n/** Lowercase hyphenated form (RFC 9562 section 4). */\nexport function formatText(bytes: Uint8Array): string {\n let hex = \"\";\n for (const byte of bytes) hex += byte.toString(16).padStart(2, \"0\");\n return `${hex.slice(0, 8)}-${hex.slice(8, 12)}-${hex.slice(12, 16)}-${hex.slice(16, 20)}-${hex.slice(20)}`;\n}\n","import type { IdKind } from \"./errors\";\nimport { MissingIdError } from \"./errors\";\nimport type * as wire from \"./generated/sid/v1/ids/ids\";\nimport { formatText, parseText, validate } from \"./validate\";\n\n/**\n * The common behaviour of every identifier. A value is always a valid UUIDv7:\n * it is built only through validation and its bytes are private. Each kind is\n * its own class with a literal `kind`, so values of different kinds are\n * different types even when their bytes are equal.\n *\n * A valid identifier proves only its shape. It does not prove that the entity\n * exists, whom it belongs to, or that the caller may act on it.\n */\nabstract class Identifier {\n abstract readonly kind: IdKind;\n readonly #bytes: Uint8Array;\n\n protected constructor(bytes: Uint8Array) {\n this.#bytes = bytes;\n }\n\n /** A copy of the 16 bytes in network order: the wire value. */\n toBytes(): Uint8Array {\n return this.#bytes.slice();\n }\n\n /** Lowercase hyphenated text, for display only; the wire carries bytes. */\n toString(): string {\n return formatText(this.#bytes);\n }\n\n /** The same text as `toString`, so JSON logs show a readable value. */\n toJSON(): string {\n return this.toString();\n }\n\n /** True for an identifier of the same kind with the same bytes. */\n equals(other: unknown): boolean {\n if (!(other instanceof Identifier) || other.kind !== this.kind) return false;\n const theirs = other.#bytes;\n return this.#bytes.every((byte, i) => byte === theirs[i]);\n }\n}\n\n/**\n * A Profile's identity at one organization: the pairwise subject that\n * organization's services see. Opaque and unlinkable across organizations.\n */\nexport class BindingId extends Identifier {\n static readonly kind = \"BindingId\";\n readonly kind = \"BindingId\";\n\n private constructor(bytes: Uint8Array) {\n super(bytes);\n }\n\n /** Accept 16 bytes as this identifier, or throw `IdError` saying why not. */\n static fromBytes(bytes: Uint8Array): BindingId {\n return new BindingId(validate(bytes, BindingId.kind));\n }\n\n /** Accept a textual UUID as this identifier, or throw `IdError`. */\n static parse(text: string): BindingId {\n return BindingId.fromBytes(parseText(text, BindingId.kind));\n }\n\n /** Validate a decoded wire message; throws `IdError`. */\n static fromWire(message: wire.BindingId): BindingId {\n return BindingId.fromBytes(message.value);\n }\n\n /** The wire message carrying this identifier's bytes. */\n toWire(): wire.BindingId {\n return { value: this.toBytes() };\n }\n}\n\n/**\n * A non-human actor (a service, bot or agent) with its own credentials. Not a\n * Binding, a Profile or a device, whatever its bytes.\n */\nexport class MachineUserId extends Identifier {\n static readonly kind = \"MachineUserId\";\n readonly kind = \"MachineUserId\";\n\n private constructor(bytes: Uint8Array) {\n super(bytes);\n }\n\n /** Accept 16 bytes as this identifier, or throw `IdError` saying why not. */\n static fromBytes(bytes: Uint8Array): MachineUserId {\n return new MachineUserId(validate(bytes, MachineUserId.kind));\n }\n\n /** Accept a textual UUID as this identifier, or throw `IdError`. */\n static parse(text: string): MachineUserId {\n return MachineUserId.fromBytes(parseText(text, MachineUserId.kind));\n }\n\n /** Validate a decoded wire message; throws `IdError`. */\n static fromWire(message: wire.MachineUserId): MachineUserId {\n return MachineUserId.fromBytes(message.value);\n }\n\n /** The wire message carrying this identifier's bytes. */\n toWire(): wire.MachineUserId {\n return { value: this.toBytes() };\n }\n}\n\n/**\n * One password-installing operation (a registration, change or authorized\n * reset) from its preparation to its commit. Every retry carries it, so a lost\n * response resolves to the operation's one outcome.\n */\nexport class PasswordOperationId extends Identifier {\n static readonly kind = \"PasswordOperationId\";\n readonly kind = \"PasswordOperationId\";\n\n private constructor(bytes: Uint8Array) {\n super(bytes);\n }\n\n /** Accept 16 bytes as this identifier, or throw `IdError` saying why not. */\n static fromBytes(bytes: Uint8Array): PasswordOperationId {\n return new PasswordOperationId(validate(bytes, PasswordOperationId.kind));\n }\n\n /** Accept a textual UUID as this identifier, or throw `IdError`. */\n static parse(text: string): PasswordOperationId {\n return PasswordOperationId.fromBytes(parseText(text, PasswordOperationId.kind));\n }\n\n /** Validate a decoded wire message; throws `IdError`. */\n static fromWire(message: wire.PasswordOperationId): PasswordOperationId {\n return PasswordOperationId.fromBytes(message.value);\n }\n\n /** The wire message carrying this identifier's bytes. */\n toWire(): wire.PasswordOperationId {\n return { value: this.toBytes() };\n }\n}\n\n/**\n * A provisioning connector: one directory source or target acting as its own\n * actor with its own credentials and grants. Not a machine user or a Profile.\n */\nexport class ProvisioningConnectorId extends Identifier {\n static readonly kind = \"ProvisioningConnectorId\";\n readonly kind = \"ProvisioningConnectorId\";\n\n private constructor(bytes: Uint8Array) {\n super(bytes);\n }\n\n /** Accept 16 bytes as this identifier, or throw `IdError` saying why not. */\n static fromBytes(bytes: Uint8Array): ProvisioningConnectorId {\n return new ProvisioningConnectorId(validate(bytes, ProvisioningConnectorId.kind));\n }\n\n /** Accept a textual UUID as this identifier, or throw `IdError`. */\n static parse(text: string): ProvisioningConnectorId {\n return ProvisioningConnectorId.fromBytes(parseText(text, ProvisioningConnectorId.kind));\n }\n\n /** Validate a decoded wire message; throws `IdError`. */\n static fromWire(message: wire.ProvisioningConnectorId): ProvisioningConnectorId {\n return ProvisioningConnectorId.fromBytes(message.value);\n }\n\n /** The wire message carrying this identifier's bytes. */\n toWire(): wire.ProvisioningConnectorId {\n return { value: this.toBytes() };\n }\n}\n\n/**\n * One credential of a provisioning connector: the reference listings,\n * rotations, revocations and audit records name. Never the secret itself.\n */\nexport class ProvisioningCredentialId extends Identifier {\n static readonly kind = \"ProvisioningCredentialId\";\n readonly kind = \"ProvisioningCredentialId\";\n\n private constructor(bytes: Uint8Array) {\n super(bytes);\n }\n\n /** Accept 16 bytes as this identifier, or throw `IdError` saying why not. */\n static fromBytes(bytes: Uint8Array): ProvisioningCredentialId {\n return new ProvisioningCredentialId(validate(bytes, ProvisioningCredentialId.kind));\n }\n\n /** Accept a textual UUID as this identifier, or throw `IdError`. */\n static parse(text: string): ProvisioningCredentialId {\n return ProvisioningCredentialId.fromBytes(parseText(text, ProvisioningCredentialId.kind));\n }\n\n /** Validate a decoded wire message; throws `IdError`. */\n static fromWire(message: wire.ProvisioningCredentialId): ProvisioningCredentialId {\n return ProvisioningCredentialId.fromBytes(message.value);\n }\n\n /** The wire message carrying this identifier's bytes. */\n toWire(): wire.ProvisioningCredentialId {\n return { value: this.toBytes() };\n }\n}\n\n/**\n * A registered protected resource: the application or API at which access is\n * enforced, in its issuer's context. Not an OAuth client or an audience string.\n */\nexport class ResourceId extends Identifier {\n static readonly kind = \"ResourceId\";\n readonly kind = \"ResourceId\";\n\n private constructor(bytes: Uint8Array) {\n super(bytes);\n }\n\n /** Accept 16 bytes as this identifier, or throw `IdError` saying why not. */\n static fromBytes(bytes: Uint8Array): ResourceId {\n return new ResourceId(validate(bytes, ResourceId.kind));\n }\n\n /** Accept a textual UUID as this identifier, or throw `IdError`. */\n static parse(text: string): ResourceId {\n return ResourceId.fromBytes(parseText(text, ResourceId.kind));\n }\n\n /** Validate a decoded wire message; throws `IdError`. */\n static fromWire(message: wire.ResourceId): ResourceId {\n return ResourceId.fromBytes(message.value);\n }\n\n /** The wire message carrying this identifier's bytes. */\n toWire(): wire.ResourceId {\n return { value: this.toBytes() };\n }\n}\n\n/** An identifier class: its kind and its checked wire conversion. */\nexport interface IdType<T, W> {\n readonly kind: IdKind;\n fromWire(message: W): T;\n}\n\n/**\n * The identifier in a required message field: absence throws\n * `MissingIdError`, an invalid value throws `IdError`.\n */\nexport function required<T, W>(type: IdType<T, W>, message: W | undefined): T {\n if (message === undefined) throw new MissingIdError(type.kind);\n return type.fromWire(message);\n}\n\n/**\n * The identifier in an optional message field: absence stays `undefined`, a\n * present but invalid value throws `IdError` (an empty message is invalid,\n * not absent).\n */\nexport function optional<T, W>(type: IdType<T, W>, message: W | undefined): T | undefined {\n return message === undefined ? undefined : type.fromWire(message);\n}\n","// @generated by protobuf-ts 2.11.1 with parameter force_optimize_code_size\n// @generated from protobuf file \"sid/v1/ids/ids.proto\" (package \"sid.v1.ids\", syntax proto3)\n// tslint:disable\nimport { MessageType } from \"@protobuf-ts/runtime\";\n/**\n * A Profile's identity at one organization: the pairwise subject that\n * organization's services see. Opaque and unlinkable across organizations;\n * it never carries or reveals a ProfileId.\n *\n * @generated from protobuf message sid.v1.ids.BindingId\n */\nexport interface BindingId {\n /**\n * Exactly 16 bytes: an RFC 9562 UUID of version 7 and the RFC 9562 variant,\n * in network byte order. Nil, max, other lengths, versions and variants are\n * invalid. Issued by SID; compared by exact byte equality.\n *\n * @generated from protobuf field: bytes value = 1\n */\n value: Uint8Array;\n}\n/**\n * One password-installing operation (a registration, change or authorized\n * reset) from its preparation to its commit. Every step and retry of the\n * operation carries it, so a lost response resolves to the operation's one\n * outcome instead of starting another.\n *\n * @generated from protobuf message sid.v1.ids.PasswordOperationId\n */\nexport interface PasswordOperationId {\n /**\n * Exactly 16 bytes: an RFC 9562 UUID of version 7 and the RFC 9562 variant,\n * in network byte order. Nil, max, other lengths, versions and variants are\n * invalid. Issued by SID; compared by exact byte equality.\n *\n * @generated from protobuf field: bytes value = 1\n */\n value: Uint8Array;\n}\n/**\n * A non-human actor (a service, bot or agent) with its own SID credentials.\n * Not a Binding, a Profile or a device, whatever its bytes.\n *\n * @generated from protobuf message sid.v1.ids.MachineUserId\n */\nexport interface MachineUserId {\n /**\n * Exactly 16 bytes: an RFC 9562 UUID of version 7 and the RFC 9562 variant,\n * in network byte order. Nil, max, other lengths, versions and variants are\n * invalid. Issued by SID; compared by exact byte equality.\n *\n * @generated from protobuf field: bytes value = 1\n */\n value: Uint8Array;\n}\n/**\n * A provisioning connector: one directory source sending SCIM to an\n * organization, or one target the organization provisions, acting as its own\n * actor with its own credentials and grants. Not a machine user or a Profile.\n *\n * @generated from protobuf message sid.v1.ids.ProvisioningConnectorId\n */\nexport interface ProvisioningConnectorId {\n /**\n * Exactly 16 bytes: an RFC 9562 UUID of version 7 and the RFC 9562 variant,\n * in network byte order. Nil, max, other lengths, versions and variants are\n * invalid. Issued by SID; compared by exact byte equality.\n *\n * @generated from protobuf field: bytes value = 1\n */\n value: Uint8Array;\n}\n/**\n * A registered protected resource: the application or API at which access is\n * enforced, in its issuer's context. Not an OAuth client and not an audience\n * string; its indicator and issuer come from its registration.\n *\n * @generated from protobuf message sid.v1.ids.ResourceId\n */\nexport interface ResourceId {\n /**\n * Exactly 16 bytes: an RFC 9562 UUID of version 7 and the RFC 9562 variant,\n * in network byte order. Nil, max, other lengths, versions and variants are\n * invalid. Issued by SID; compared by exact byte equality.\n *\n * @generated from protobuf field: bytes value = 1\n */\n value: Uint8Array;\n}\n/**\n * One credential of a provisioning connector: the reference listings,\n * rotations, revocations and audit records name. Never the secret itself.\n *\n * @generated from protobuf message sid.v1.ids.ProvisioningCredentialId\n */\nexport interface ProvisioningCredentialId {\n /**\n * Exactly 16 bytes: an RFC 9562 UUID of version 7 and the RFC 9562 variant,\n * in network byte order. Nil, max, other lengths, versions and variants are\n * invalid. Issued by SID; compared by exact byte equality.\n *\n * @generated from protobuf field: bytes value = 1\n */\n value: Uint8Array;\n}\n// @generated message type with reflection information, may provide speed optimized methods\nclass BindingId$Type extends MessageType<BindingId> {\n constructor() {\n super(\"sid.v1.ids.BindingId\", [\n { no: 1, name: \"value\", kind: \"scalar\", T: 12 /*ScalarType.BYTES*/ }\n ]);\n }\n}\n/**\n * @generated MessageType for protobuf message sid.v1.ids.BindingId\n */\nexport const BindingId = new BindingId$Type();\n// @generated message type with reflection information, may provide speed optimized methods\nclass PasswordOperationId$Type extends MessageType<PasswordOperationId> {\n constructor() {\n super(\"sid.v1.ids.PasswordOperationId\", [\n { no: 1, name: \"value\", kind: \"scalar\", T: 12 /*ScalarType.BYTES*/ }\n ]);\n }\n}\n/**\n * @generated MessageType for protobuf message sid.v1.ids.PasswordOperationId\n */\nexport const PasswordOperationId = new PasswordOperationId$Type();\n// @generated message type with reflection information, may provide speed optimized methods\nclass MachineUserId$Type extends MessageType<MachineUserId> {\n constructor() {\n super(\"sid.v1.ids.MachineUserId\", [\n { no: 1, name: \"value\", kind: \"scalar\", T: 12 /*ScalarType.BYTES*/ }\n ]);\n }\n}\n/**\n * @generated MessageType for protobuf message sid.v1.ids.MachineUserId\n */\nexport const MachineUserId = new MachineUserId$Type();\n// @generated message type with reflection information, may provide speed optimized methods\nclass ProvisioningConnectorId$Type extends MessageType<ProvisioningConnectorId> {\n constructor() {\n super(\"sid.v1.ids.ProvisioningConnectorId\", [\n { no: 1, name: \"value\", kind: \"scalar\", T: 12 /*ScalarType.BYTES*/ }\n ]);\n }\n}\n/**\n * @generated MessageType for protobuf message sid.v1.ids.ProvisioningConnectorId\n */\nexport const ProvisioningConnectorId = new ProvisioningConnectorId$Type();\n// @generated message type with reflection information, may provide speed optimized methods\nclass ResourceId$Type extends MessageType<ResourceId> {\n constructor() {\n super(\"sid.v1.ids.ResourceId\", [\n { no: 1, name: \"value\", kind: \"scalar\", T: 12 /*ScalarType.BYTES*/ }\n ]);\n }\n}\n/**\n * @generated MessageType for protobuf message sid.v1.ids.ResourceId\n */\nexport const ResourceId = new ResourceId$Type();\n// @generated message type with reflection information, may provide speed optimized methods\nclass ProvisioningCredentialId$Type extends MessageType<ProvisioningCredentialId> {\n constructor() {\n super(\"sid.v1.ids.ProvisioningCredentialId\", [\n { no: 1, name: \"value\", kind: \"scalar\", T: 12 /*ScalarType.BYTES*/ }\n ]);\n }\n}\n/**\n * @generated MessageType for protobuf message sid.v1.ids.ProvisioningCredentialId\n */\nexport const ProvisioningCredentialId = new ProvisioningCredentialId$Type();\n","/**\n * StructuredID identifiers for TypeScript.\n *\n * Each identifier kind is its own class (`BindingId`, `MachineUserId`, ...),\n * built only through validation: exactly 16 bytes of an RFC 9562 UUIDv7, not\n * nil or max. `wire` holds the generated `sid.v1.ids` messages with their\n * binary and standard ProtoJSON codecs; decoding one proves nothing, and the\n * checked conversion (`fromWire`, `required`, `optional`) validates it.\n */\nexport { IdError, MissingIdError, type IdErrorReason, type IdKind } from \"./errors\";\nexport {\n BindingId,\n MachineUserId,\n PasswordOperationId,\n ProvisioningConnectorId,\n ProvisioningCredentialId,\n ResourceId,\n optional,\n required,\n type IdType,\n} from \"./ids\";\nexport * as wire from \"./generated/sid/v1/ids/ids\";\n\n/** The include-relative path of the identifier schema this package carries. */\nexport const PROTO_PATH = \"sid/v1/ids/ids.proto\";\n"]}
@@ -0,0 +1,353 @@
1
+ import { MessageType } from '@protobuf-ts/runtime';
2
+
3
+ /** The identifier kinds this package delivers: one per `sid.v1.ids` message. */
4
+ type IdKind = "BindingId" | "MachineUserId" | "PasswordOperationId" | "ProvisioningConnectorId" | "ProvisioningCredentialId" | "ResourceId";
5
+ /** Why a value is not a valid identifier. */
6
+ type IdErrorReason =
7
+ /** The text is not a UUID in any accepted textual form. */
8
+ {
9
+ readonly type: "malformed";
10
+ }
11
+ /** Binary form of a length other than 16 bytes. */
12
+ | {
13
+ readonly type: "length";
14
+ readonly length: number;
15
+ }
16
+ /** The nil UUID (all zero bits). */
17
+ | {
18
+ readonly type: "nil";
19
+ }
20
+ /** The max UUID (all one bits). */
21
+ | {
22
+ readonly type: "max";
23
+ }
24
+ /** The variant bits are not those of RFC 9562. */
25
+ | {
26
+ readonly type: "variant";
27
+ }
28
+ /** An RFC 9562 UUID of a version other than 7. */
29
+ | {
30
+ readonly type: "version";
31
+ readonly version: number;
32
+ };
33
+ /**
34
+ * A value that is not a valid identifier of the requested kind. Carries the
35
+ * kind and the reason, never the value, so it can be logged freely.
36
+ */
37
+ declare class IdError extends Error {
38
+ readonly kind: IdKind;
39
+ readonly reason: IdErrorReason;
40
+ readonly name = "IdError";
41
+ constructor(kind: IdKind, reason: IdErrorReason);
42
+ }
43
+ /** A required identifier message was absent. Absence is never a default. */
44
+ declare class MissingIdError extends Error {
45
+ readonly kind: IdKind;
46
+ readonly name = "MissingIdError";
47
+ constructor(kind: IdKind);
48
+ }
49
+
50
+ declare class BindingId$Type extends MessageType<BindingId$1> {
51
+ constructor();
52
+ }
53
+ /**
54
+ * A Profile's identity at one organization: the pairwise subject that
55
+ * organization's services see. Opaque and unlinkable across organizations;
56
+ * it never carries or reveals a ProfileId.
57
+ *
58
+ * @generated from protobuf message sid.v1.ids.BindingId
59
+ */
60
+ interface BindingId$1 {
61
+ /**
62
+ * Exactly 16 bytes: an RFC 9562 UUID of version 7 and the RFC 9562 variant,
63
+ * in network byte order. Nil, max, other lengths, versions and variants are
64
+ * invalid. Issued by SID; compared by exact byte equality.
65
+ *
66
+ * @generated from protobuf field: bytes value = 1
67
+ */
68
+ value: Uint8Array;
69
+ }
70
+ /**
71
+ * @generated MessageType for protobuf message sid.v1.ids.BindingId
72
+ */
73
+ declare const BindingId$1: BindingId$Type;
74
+ declare class PasswordOperationId$Type extends MessageType<PasswordOperationId$1> {
75
+ constructor();
76
+ }
77
+ /**
78
+ * One password-installing operation (a registration, change or authorized
79
+ * reset) from its preparation to its commit. Every step and retry of the
80
+ * operation carries it, so a lost response resolves to the operation's one
81
+ * outcome instead of starting another.
82
+ *
83
+ * @generated from protobuf message sid.v1.ids.PasswordOperationId
84
+ */
85
+ interface PasswordOperationId$1 {
86
+ /**
87
+ * Exactly 16 bytes: an RFC 9562 UUID of version 7 and the RFC 9562 variant,
88
+ * in network byte order. Nil, max, other lengths, versions and variants are
89
+ * invalid. Issued by SID; compared by exact byte equality.
90
+ *
91
+ * @generated from protobuf field: bytes value = 1
92
+ */
93
+ value: Uint8Array;
94
+ }
95
+ /**
96
+ * @generated MessageType for protobuf message sid.v1.ids.PasswordOperationId
97
+ */
98
+ declare const PasswordOperationId$1: PasswordOperationId$Type;
99
+ declare class MachineUserId$Type extends MessageType<MachineUserId$1> {
100
+ constructor();
101
+ }
102
+ /**
103
+ * A non-human actor (a service, bot or agent) with its own SID credentials.
104
+ * Not a Binding, a Profile or a device, whatever its bytes.
105
+ *
106
+ * @generated from protobuf message sid.v1.ids.MachineUserId
107
+ */
108
+ interface MachineUserId$1 {
109
+ /**
110
+ * Exactly 16 bytes: an RFC 9562 UUID of version 7 and the RFC 9562 variant,
111
+ * in network byte order. Nil, max, other lengths, versions and variants are
112
+ * invalid. Issued by SID; compared by exact byte equality.
113
+ *
114
+ * @generated from protobuf field: bytes value = 1
115
+ */
116
+ value: Uint8Array;
117
+ }
118
+ /**
119
+ * @generated MessageType for protobuf message sid.v1.ids.MachineUserId
120
+ */
121
+ declare const MachineUserId$1: MachineUserId$Type;
122
+ declare class ProvisioningConnectorId$Type extends MessageType<ProvisioningConnectorId$1> {
123
+ constructor();
124
+ }
125
+ /**
126
+ * A provisioning connector: one directory source sending SCIM to an
127
+ * organization, or one target the organization provisions, acting as its own
128
+ * actor with its own credentials and grants. Not a machine user or a Profile.
129
+ *
130
+ * @generated from protobuf message sid.v1.ids.ProvisioningConnectorId
131
+ */
132
+ interface ProvisioningConnectorId$1 {
133
+ /**
134
+ * Exactly 16 bytes: an RFC 9562 UUID of version 7 and the RFC 9562 variant,
135
+ * in network byte order. Nil, max, other lengths, versions and variants are
136
+ * invalid. Issued by SID; compared by exact byte equality.
137
+ *
138
+ * @generated from protobuf field: bytes value = 1
139
+ */
140
+ value: Uint8Array;
141
+ }
142
+ /**
143
+ * @generated MessageType for protobuf message sid.v1.ids.ProvisioningConnectorId
144
+ */
145
+ declare const ProvisioningConnectorId$1: ProvisioningConnectorId$Type;
146
+ declare class ResourceId$Type extends MessageType<ResourceId$1> {
147
+ constructor();
148
+ }
149
+ /**
150
+ * A registered protected resource: the application or API at which access is
151
+ * enforced, in its issuer's context. Not an OAuth client and not an audience
152
+ * string; its indicator and issuer come from its registration.
153
+ *
154
+ * @generated from protobuf message sid.v1.ids.ResourceId
155
+ */
156
+ interface ResourceId$1 {
157
+ /**
158
+ * Exactly 16 bytes: an RFC 9562 UUID of version 7 and the RFC 9562 variant,
159
+ * in network byte order. Nil, max, other lengths, versions and variants are
160
+ * invalid. Issued by SID; compared by exact byte equality.
161
+ *
162
+ * @generated from protobuf field: bytes value = 1
163
+ */
164
+ value: Uint8Array;
165
+ }
166
+ /**
167
+ * @generated MessageType for protobuf message sid.v1.ids.ResourceId
168
+ */
169
+ declare const ResourceId$1: ResourceId$Type;
170
+ declare class ProvisioningCredentialId$Type extends MessageType<ProvisioningCredentialId$1> {
171
+ constructor();
172
+ }
173
+ /**
174
+ * One credential of a provisioning connector: the reference listings,
175
+ * rotations, revocations and audit records name. Never the secret itself.
176
+ *
177
+ * @generated from protobuf message sid.v1.ids.ProvisioningCredentialId
178
+ */
179
+ interface ProvisioningCredentialId$1 {
180
+ /**
181
+ * Exactly 16 bytes: an RFC 9562 UUID of version 7 and the RFC 9562 variant,
182
+ * in network byte order. Nil, max, other lengths, versions and variants are
183
+ * invalid. Issued by SID; compared by exact byte equality.
184
+ *
185
+ * @generated from protobuf field: bytes value = 1
186
+ */
187
+ value: Uint8Array;
188
+ }
189
+ /**
190
+ * @generated MessageType for protobuf message sid.v1.ids.ProvisioningCredentialId
191
+ */
192
+ declare const ProvisioningCredentialId$1: ProvisioningCredentialId$Type;
193
+
194
+ declare namespace ids {
195
+ export { BindingId$1 as BindingId, MachineUserId$1 as MachineUserId, PasswordOperationId$1 as PasswordOperationId, ProvisioningConnectorId$1 as ProvisioningConnectorId, ProvisioningCredentialId$1 as ProvisioningCredentialId, ResourceId$1 as ResourceId };
196
+ }
197
+
198
+ /**
199
+ * The common behaviour of every identifier. A value is always a valid UUIDv7:
200
+ * it is built only through validation and its bytes are private. Each kind is
201
+ * its own class with a literal `kind`, so values of different kinds are
202
+ * different types even when their bytes are equal.
203
+ *
204
+ * A valid identifier proves only its shape. It does not prove that the entity
205
+ * exists, whom it belongs to, or that the caller may act on it.
206
+ */
207
+ declare abstract class Identifier {
208
+ #private;
209
+ abstract readonly kind: IdKind;
210
+ protected constructor(bytes: Uint8Array);
211
+ /** A copy of the 16 bytes in network order: the wire value. */
212
+ toBytes(): Uint8Array;
213
+ /** Lowercase hyphenated text, for display only; the wire carries bytes. */
214
+ toString(): string;
215
+ /** The same text as `toString`, so JSON logs show a readable value. */
216
+ toJSON(): string;
217
+ /** True for an identifier of the same kind with the same bytes. */
218
+ equals(other: unknown): boolean;
219
+ }
220
+ /**
221
+ * A Profile's identity at one organization: the pairwise subject that
222
+ * organization's services see. Opaque and unlinkable across organizations.
223
+ */
224
+ declare class BindingId extends Identifier {
225
+ static readonly kind = "BindingId";
226
+ readonly kind = "BindingId";
227
+ private constructor();
228
+ /** Accept 16 bytes as this identifier, or throw `IdError` saying why not. */
229
+ static fromBytes(bytes: Uint8Array): BindingId;
230
+ /** Accept a textual UUID as this identifier, or throw `IdError`. */
231
+ static parse(text: string): BindingId;
232
+ /** Validate a decoded wire message; throws `IdError`. */
233
+ static fromWire(message: BindingId$1): BindingId;
234
+ /** The wire message carrying this identifier's bytes. */
235
+ toWire(): BindingId$1;
236
+ }
237
+ /**
238
+ * A non-human actor (a service, bot or agent) with its own credentials. Not a
239
+ * Binding, a Profile or a device, whatever its bytes.
240
+ */
241
+ declare class MachineUserId extends Identifier {
242
+ static readonly kind = "MachineUserId";
243
+ readonly kind = "MachineUserId";
244
+ private constructor();
245
+ /** Accept 16 bytes as this identifier, or throw `IdError` saying why not. */
246
+ static fromBytes(bytes: Uint8Array): MachineUserId;
247
+ /** Accept a textual UUID as this identifier, or throw `IdError`. */
248
+ static parse(text: string): MachineUserId;
249
+ /** Validate a decoded wire message; throws `IdError`. */
250
+ static fromWire(message: MachineUserId$1): MachineUserId;
251
+ /** The wire message carrying this identifier's bytes. */
252
+ toWire(): MachineUserId$1;
253
+ }
254
+ /**
255
+ * One password-installing operation (a registration, change or authorized
256
+ * reset) from its preparation to its commit. Every retry carries it, so a lost
257
+ * response resolves to the operation's one outcome.
258
+ */
259
+ declare class PasswordOperationId extends Identifier {
260
+ static readonly kind = "PasswordOperationId";
261
+ readonly kind = "PasswordOperationId";
262
+ private constructor();
263
+ /** Accept 16 bytes as this identifier, or throw `IdError` saying why not. */
264
+ static fromBytes(bytes: Uint8Array): PasswordOperationId;
265
+ /** Accept a textual UUID as this identifier, or throw `IdError`. */
266
+ static parse(text: string): PasswordOperationId;
267
+ /** Validate a decoded wire message; throws `IdError`. */
268
+ static fromWire(message: PasswordOperationId$1): PasswordOperationId;
269
+ /** The wire message carrying this identifier's bytes. */
270
+ toWire(): PasswordOperationId$1;
271
+ }
272
+ /**
273
+ * A provisioning connector: one directory source or target acting as its own
274
+ * actor with its own credentials and grants. Not a machine user or a Profile.
275
+ */
276
+ declare class ProvisioningConnectorId extends Identifier {
277
+ static readonly kind = "ProvisioningConnectorId";
278
+ readonly kind = "ProvisioningConnectorId";
279
+ private constructor();
280
+ /** Accept 16 bytes as this identifier, or throw `IdError` saying why not. */
281
+ static fromBytes(bytes: Uint8Array): ProvisioningConnectorId;
282
+ /** Accept a textual UUID as this identifier, or throw `IdError`. */
283
+ static parse(text: string): ProvisioningConnectorId;
284
+ /** Validate a decoded wire message; throws `IdError`. */
285
+ static fromWire(message: ProvisioningConnectorId$1): ProvisioningConnectorId;
286
+ /** The wire message carrying this identifier's bytes. */
287
+ toWire(): ProvisioningConnectorId$1;
288
+ }
289
+ /**
290
+ * One credential of a provisioning connector: the reference listings,
291
+ * rotations, revocations and audit records name. Never the secret itself.
292
+ */
293
+ declare class ProvisioningCredentialId extends Identifier {
294
+ static readonly kind = "ProvisioningCredentialId";
295
+ readonly kind = "ProvisioningCredentialId";
296
+ private constructor();
297
+ /** Accept 16 bytes as this identifier, or throw `IdError` saying why not. */
298
+ static fromBytes(bytes: Uint8Array): ProvisioningCredentialId;
299
+ /** Accept a textual UUID as this identifier, or throw `IdError`. */
300
+ static parse(text: string): ProvisioningCredentialId;
301
+ /** Validate a decoded wire message; throws `IdError`. */
302
+ static fromWire(message: ProvisioningCredentialId$1): ProvisioningCredentialId;
303
+ /** The wire message carrying this identifier's bytes. */
304
+ toWire(): ProvisioningCredentialId$1;
305
+ }
306
+ /**
307
+ * A registered protected resource: the application or API at which access is
308
+ * enforced, in its issuer's context. Not an OAuth client or an audience string.
309
+ */
310
+ declare class ResourceId extends Identifier {
311
+ static readonly kind = "ResourceId";
312
+ readonly kind = "ResourceId";
313
+ private constructor();
314
+ /** Accept 16 bytes as this identifier, or throw `IdError` saying why not. */
315
+ static fromBytes(bytes: Uint8Array): ResourceId;
316
+ /** Accept a textual UUID as this identifier, or throw `IdError`. */
317
+ static parse(text: string): ResourceId;
318
+ /** Validate a decoded wire message; throws `IdError`. */
319
+ static fromWire(message: ResourceId$1): ResourceId;
320
+ /** The wire message carrying this identifier's bytes. */
321
+ toWire(): ResourceId$1;
322
+ }
323
+ /** An identifier class: its kind and its checked wire conversion. */
324
+ interface IdType<T, W> {
325
+ readonly kind: IdKind;
326
+ fromWire(message: W): T;
327
+ }
328
+ /**
329
+ * The identifier in a required message field: absence throws
330
+ * `MissingIdError`, an invalid value throws `IdError`.
331
+ */
332
+ declare function required<T, W>(type: IdType<T, W>, message: W | undefined): T;
333
+ /**
334
+ * The identifier in an optional message field: absence stays `undefined`, a
335
+ * present but invalid value throws `IdError` (an empty message is invalid,
336
+ * not absent).
337
+ */
338
+ declare function optional<T, W>(type: IdType<T, W>, message: W | undefined): T | undefined;
339
+
340
+ /**
341
+ * StructuredID identifiers for TypeScript.
342
+ *
343
+ * Each identifier kind is its own class (`BindingId`, `MachineUserId`, ...),
344
+ * built only through validation: exactly 16 bytes of an RFC 9562 UUIDv7, not
345
+ * nil or max. `wire` holds the generated `sid.v1.ids` messages with their
346
+ * binary and standard ProtoJSON codecs; decoding one proves nothing, and the
347
+ * checked conversion (`fromWire`, `required`, `optional`) validates it.
348
+ */
349
+
350
+ /** The include-relative path of the identifier schema this package carries. */
351
+ declare const PROTO_PATH = "sid/v1/ids/ids.proto";
352
+
353
+ export { BindingId, IdError, type IdErrorReason, type IdKind, type IdType, MachineUserId, MissingIdError, PROTO_PATH, PasswordOperationId, ProvisioningConnectorId, ProvisioningCredentialId, ResourceId, optional, required, ids as wire };