@indorania/contracts 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.
Files changed (106) hide show
  1. package/README.md +117 -0
  2. package/dist/common.d.ts +144 -0
  3. package/dist/common.d.ts.map +1 -0
  4. package/dist/common.js +162 -0
  5. package/dist/common.js.map +1 -0
  6. package/dist/constitution/index.d.ts +9 -0
  7. package/dist/constitution/index.d.ts.map +1 -0
  8. package/dist/constitution/index.js +9 -0
  9. package/dist/constitution/index.js.map +1 -0
  10. package/dist/constitution/openapi.d.ts +23 -0
  11. package/dist/constitution/openapi.d.ts.map +1 -0
  12. package/dist/constitution/openapi.js +375 -0
  13. package/dist/constitution/openapi.js.map +1 -0
  14. package/dist/constitution/report.d.ts +63 -0
  15. package/dist/constitution/report.d.ts.map +1 -0
  16. package/dist/constitution/report.js +73 -0
  17. package/dist/constitution/report.js.map +1 -0
  18. package/dist/constitution/tables.d.ts +53 -0
  19. package/dist/constitution/tables.d.ts.map +1 -0
  20. package/dist/constitution/tables.js +96 -0
  21. package/dist/constitution/tables.js.map +1 -0
  22. package/dist/constitution/words.d.ts +39 -0
  23. package/dist/constitution/words.d.ts.map +1 -0
  24. package/dist/constitution/words.js +126 -0
  25. package/dist/constitution/words.js.map +1 -0
  26. package/dist/document.d.ts +12 -0
  27. package/dist/document.d.ts.map +1 -0
  28. package/dist/document.js +106 -0
  29. package/dist/document.js.map +1 -0
  30. package/dist/domain-error.d.ts +14 -0
  31. package/dist/domain-error.d.ts.map +1 -0
  32. package/dist/domain-error.js +23 -0
  33. package/dist/domain-error.js.map +1 -0
  34. package/dist/index.d.ts +24 -0
  35. package/dist/index.d.ts.map +1 -0
  36. package/dist/index.js +24 -0
  37. package/dist/index.js.map +1 -0
  38. package/dist/op.d.ts +92 -0
  39. package/dist/op.d.ts.map +1 -0
  40. package/dist/op.js +113 -0
  41. package/dist/op.js.map +1 -0
  42. package/dist/routes/asks.d.ts +77 -0
  43. package/dist/routes/asks.d.ts.map +1 -0
  44. package/dist/routes/asks.js +182 -0
  45. package/dist/routes/asks.js.map +1 -0
  46. package/dist/routes/backup.d.ts +12 -0
  47. package/dist/routes/backup.d.ts.map +1 -0
  48. package/dist/routes/backup.js +63 -0
  49. package/dist/routes/backup.js.map +1 -0
  50. package/dist/routes/capabilities.d.ts +67 -0
  51. package/dist/routes/capabilities.d.ts.map +1 -0
  52. package/dist/routes/capabilities.js +88 -0
  53. package/dist/routes/capabilities.js.map +1 -0
  54. package/dist/routes/entitlements.d.ts +137 -0
  55. package/dist/routes/entitlements.d.ts.map +1 -0
  56. package/dist/routes/entitlements.js +101 -0
  57. package/dist/routes/entitlements.js.map +1 -0
  58. package/dist/routes/guest.d.ts +57 -0
  59. package/dist/routes/guest.d.ts.map +1 -0
  60. package/dist/routes/guest.js +140 -0
  61. package/dist/routes/guest.js.map +1 -0
  62. package/dist/routes/integration.d.ts +187 -0
  63. package/dist/routes/integration.d.ts.map +1 -0
  64. package/dist/routes/integration.js +243 -0
  65. package/dist/routes/integration.js.map +1 -0
  66. package/dist/routes/meta.d.ts +50 -0
  67. package/dist/routes/meta.d.ts.map +1 -0
  68. package/dist/routes/meta.js +90 -0
  69. package/dist/routes/meta.js.map +1 -0
  70. package/dist/routes/organisations.d.ts +121 -0
  71. package/dist/routes/organisations.d.ts.map +1 -0
  72. package/dist/routes/organisations.js +175 -0
  73. package/dist/routes/organisations.js.map +1 -0
  74. package/dist/routes/presentations.d.ts +95 -0
  75. package/dist/routes/presentations.d.ts.map +1 -0
  76. package/dist/routes/presentations.js +121 -0
  77. package/dist/routes/presentations.js.map +1 -0
  78. package/dist/routes/sessions.d.ts +180 -0
  79. package/dist/routes/sessions.d.ts.map +1 -0
  80. package/dist/routes/sessions.js +240 -0
  81. package/dist/routes/sessions.js.map +1 -0
  82. package/dist/routes/standing.d.ts +24 -0
  83. package/dist/routes/standing.d.ts.map +1 -0
  84. package/dist/routes/standing.js +74 -0
  85. package/dist/routes/standing.js.map +1 -0
  86. package/dist/routes/thank-yous.d.ts +30 -0
  87. package/dist/routes/thank-yous.d.ts.map +1 -0
  88. package/dist/routes/thank-yous.js +139 -0
  89. package/dist/routes/thank-yous.js.map +1 -0
  90. package/dist/versions.d.ts +46 -0
  91. package/dist/versions.d.ts.map +1 -0
  92. package/dist/versions.js +54 -0
  93. package/dist/versions.js.map +1 -0
  94. package/dist/webhooks.d.ts +55 -0
  95. package/dist/webhooks.d.ts.map +1 -0
  96. package/dist/webhooks.js +76 -0
  97. package/dist/webhooks.js.map +1 -0
  98. package/dist/zod.d.ts +3 -0
  99. package/dist/zod.d.ts.map +1 -0
  100. package/dist/zod.js +7 -0
  101. package/dist/zod.js.map +1 -0
  102. package/node/kernel-esm.mjs +27 -0
  103. package/node/register.mjs +5 -0
  104. package/openapi/2026-09-25.json +6959 -0
  105. package/openapi/versions.json +10 -0
  106. package/package.json +49 -0
@@ -0,0 +1,243 @@
1
+ /**
2
+ * How a system joins — a member's, or an outside issuer's; the contract is the same for both
3
+ * (d47(a)). An integration authenticates as itself and is known by what it offers, never by name.
4
+ *
5
+ * - The handoff registration registers an **issuer**: its OpenID4VCI credential issuer and the
6
+ * records it offers. Individual offers never pass through the platform: the wallet talks to the
7
+ * issuer directly, so no third party learns the relationship key (holder contract §1).
8
+ * - The predicate-answer webhook is how the platform asks the book that holds an organisation's
9
+ * records to answer an ask. The session-event webhook keeps the integration's copy of a session.
10
+ * - Webhooks are signed both ways: Standard Webhooks 1.0.0, v1a (Ed25519).
11
+ */
12
+ import { isRegisteredDst } from "@kashscript/attest/dst";
13
+ import { AnswerId, BookRef, DsseEnvelope, HttpsUrl, IntegrationId, OrgDid, OrganisationId, SessionId, words } from "../common.js";
14
+ import { MEMBER_NAME_PATTERN } from "../constitution/words.js";
15
+ import { operation } from "../op.js";
16
+ import { VERSION_PATTERN } from "../versions.js";
17
+ import { z } from "../zod.js";
18
+ import { AskKey, AskNeed, PredicateKind } from "./asks.js";
19
+ import { Capability } from "./capabilities.js";
20
+ import { Ed25519Jwk } from "./meta.js";
21
+ import { LineState } from "./sessions.js";
22
+ const Label = words(60).refine((s) => !MEMBER_NAME_PATTERN.test(s), {
23
+ message: "Named for what it is, never for who issues it (PL-4 edge 7).",
24
+ params: { rule: "NO-MEMBER-NAME" },
25
+ });
26
+ const ConfigurationId = z.string().regex(/^[a-z0-9][a-z0-9._-]{0,63}$/);
27
+ export const IssuerConfiguration = z
28
+ .discriminatedUnion("format", [
29
+ z
30
+ .object({
31
+ id: ConfigurationId,
32
+ format: z.literal("kash-artifact"),
33
+ dst: z.string().refine(isRegisteredDst, { message: "not in @kashscript/attest's DST registry", params: { rule: "UNREGISTERED_DST" } }),
34
+ label: Label,
35
+ })
36
+ .strict()
37
+ .meta({ description: "A record handed over unmodified, under the holder contract's `kash-artifact` profile. The DST must be registered in attest first." }),
38
+ z
39
+ .object({
40
+ id: ConfigurationId,
41
+ format: z.literal("dc+sd-jwt"),
42
+ vct: z.string().min(1),
43
+ label: Label,
44
+ })
45
+ .strict()
46
+ .meta({ description: "An SD-JWT VC, such as a predicate credential." }),
47
+ ])
48
+ .meta({ id: "IssuerConfiguration" });
49
+ export const IssuerRegistration = z
50
+ .object({
51
+ credentialIssuer: HttpsUrl.meta({ description: "Your OpenID4VCI Credential Issuer identifier. Wallets redeem your offers there, directly." }),
52
+ configurations: z.array(IssuerConfiguration).min(1),
53
+ signers: z.array(OrgDid).min(1).meta({ description: "The DIDs your records are signed with. The trust list lists these, for exactly these DSTs." }),
54
+ })
55
+ .strict()
56
+ .meta({
57
+ id: "IssuerRegistration",
58
+ description: "The handoff registration: what you issue into wallets, and with which keys. Never an individual offer.",
59
+ });
60
+ export const IssuerRegistrationState = z
61
+ .object({
62
+ registration: IssuerRegistration,
63
+ trustList: z.enum(["pending-review", "listed", "not-listed"]).meta({
64
+ description: "Listing is a policy decision, reviewed by the trust list's publisher (d47(e)). An unlisted issuer's records stay holdable by choice, and show as unlisted.",
65
+ }),
66
+ })
67
+ .strict()
68
+ .meta({ id: "IssuerRegistrationState" });
69
+ export const PredicateAnswerWebhook = z
70
+ .object({
71
+ url: HttpsUrl,
72
+ predicates: z
73
+ .array(z
74
+ .object({
75
+ kind: PredicateKind,
76
+ rule: z.object({ id: z.string().min(1), version: z.string().min(1) }).strict().meta({ description: "The rule version this kind is judged against (d43)." }),
77
+ })
78
+ .strict())
79
+ .min(1)
80
+ .meta({ description: "The predicate kinds you answer. The improvement item is never one: no ask may require it (d43)." }),
81
+ })
82
+ .strict()
83
+ .meta({ id: "PredicateAnswerWebhook" });
84
+ export const SessionEventWebhook = z.object({ url: HttpsUrl }).strict().meta({ id: "SessionEventWebhook" });
85
+ export const Integration = z
86
+ .object({
87
+ id: IntegrationId,
88
+ clientId: z.string().min(1).max(128).meta({ description: "Your OAuth client id: with your own private key you ask the token endpoint for an access token (client_credentials, private_key_jwt). No shared secret exists." }),
89
+ capability: Capability,
90
+ apiVersion: z.string().regex(new RegExp(VERSION_PATTERN)).meta({ description: "Your pinned version: your webhooks speak it." }),
91
+ keys: z.array(Ed25519Jwk).meta({ description: "Your public keys: they verify your webhooks and your client assertions." }),
92
+ issuer: IssuerRegistrationState.nullable(),
93
+ webhooks: z.object({ predicateAnswer: PredicateAnswerWebhook.nullable(), sessionEvent: SessionEventWebhook.nullable() }).strict(),
94
+ })
95
+ .strict()
96
+ .meta({ id: "Integration" });
97
+ const Timestamp = z.iso.datetime().meta({ description: "ISO 8601, as Standard Webhooks' payload structure has it." });
98
+ const PredicateAnswerResult = z
99
+ .discriminatedUnion("result", [
100
+ z.object({ answer: AnswerId, result: z.literal("holds"), predicate: z.string().min(1).meta({ description: "The signed predicate, naming its rule version." }) }).strict(),
101
+ z.object({ answer: AnswerId, result: z.literal("does-not-hold") }).strict().meta({ description: "Returned to the answering organisation alone; never forwarded, never kept." }),
102
+ ])
103
+ .meta({ id: "PredicateAnswerResult" });
104
+ export const PredicateAnswered = z
105
+ .object({ type: z.literal("predicate.answered"), timestamp: Timestamp, data: PredicateAnswerResult })
106
+ .strict()
107
+ .meta({ id: "PredicateAnswered", description: "An answer you finish later, after replying 202 to predicate.answer-requested." });
108
+ export const PredicateAnswerRequested = z
109
+ .object({
110
+ type: z.literal("predicate.answer-requested"),
111
+ timestamp: Timestamp,
112
+ data: z
113
+ .object({
114
+ answer: AnswerId,
115
+ ask: z.object({ key: AskKey, version: z.number().int().min(1), sha256: z.string().regex(/^[0-9a-f]{64}$/) }).strict(),
116
+ need: AskNeed,
117
+ book: BookRef,
118
+ })
119
+ .strict(),
120
+ })
121
+ .strict()
122
+ .meta({ id: "PredicateAnswerRequested" });
123
+ export const SessionLineEvent = z
124
+ .object({
125
+ type: z.literal("session.line"),
126
+ timestamp: Timestamp,
127
+ data: z.object({ session: SessionId, seq: z.number().int().min(0), line: DsseEnvelope, state: LineState }).strict(),
128
+ })
129
+ .strict()
130
+ .meta({ id: "SessionLineEvent", description: "A line was added or countersigned in a session your capability takes part in." });
131
+ export const IntegrationCreate = z
132
+ .object({
133
+ capability: Capability,
134
+ keys: z.array(Ed25519Jwk).min(1).max(4).meta({ description: "Public keys only. You prove yourself by signing an assertion with the private half, which never comes here." }),
135
+ })
136
+ .strict()
137
+ .meta({ id: "IntegrationCreate", description: "An organisation makes its own integration, for one capability." });
138
+ export const integrationOperations = [
139
+ operation({
140
+ operationId: "createIntegration",
141
+ method: "post",
142
+ path: "/v1/organisations/{orgId}/integrations",
143
+ tag: "integration",
144
+ summary: "Make an integration for one of your organisation's capabilities",
145
+ description: "The system on the other side then signs in as itself, with the key you gave, and never as a person.",
146
+ auth: ["seat"],
147
+ pending: null,
148
+ idempotency: "key",
149
+ params: z.object({ orgId: OrganisationId }).strict(),
150
+ body: { schema: IntegrationCreate },
151
+ responses: { 201: { description: "Created.", schema: Integration } },
152
+ }),
153
+ operation({
154
+ operationId: "getIntegration",
155
+ method: "get",
156
+ path: "/v1/integration",
157
+ tag: "integration",
158
+ summary: "Your integration: its capability, pin, keys and registrations",
159
+ auth: ["integration"],
160
+ pending: null,
161
+ responses: { 200: { description: "Your integration.", schema: Integration } },
162
+ }),
163
+ operation({
164
+ operationId: "putIssuer",
165
+ method: "put",
166
+ path: "/v1/integration/issuer",
167
+ tag: "integration",
168
+ summary: "Register what you issue into wallets (the handoff registration)",
169
+ auth: ["integration"],
170
+ pending: null,
171
+ idempotency: "key",
172
+ body: { schema: IssuerRegistration },
173
+ responses: { 200: { description: "Registered, with its trust-list state.", schema: IssuerRegistrationState } },
174
+ }),
175
+ operation({
176
+ operationId: "putPredicateAnswerWebhook",
177
+ method: "put",
178
+ path: "/v1/integration/webhooks/predicate-answer",
179
+ tag: "integration",
180
+ summary: "Register where the platform asks you to answer asks, and which predicates you answer",
181
+ auth: ["integration"],
182
+ pending: "PL-8",
183
+ idempotency: "key",
184
+ body: { schema: PredicateAnswerWebhook },
185
+ responses: { 200: { description: "Registered.", schema: PredicateAnswerWebhook } },
186
+ }),
187
+ operation({
188
+ operationId: "putSessionEventWebhook",
189
+ method: "put",
190
+ path: "/v1/integration/webhooks/session-event",
191
+ tag: "integration",
192
+ summary: "Register where session lines reach you",
193
+ auth: ["integration"],
194
+ pending: "PL-8",
195
+ idempotency: "key",
196
+ body: { schema: SessionEventWebhook },
197
+ responses: { 200: { description: "Registered.", schema: SessionEventWebhook } },
198
+ }),
199
+ operation({
200
+ operationId: "receivePredicateAnswer",
201
+ method: "post",
202
+ path: "/v1/integration/predicate-answers",
203
+ tag: "integration",
204
+ summary: "Deliver an answer you accepted with 202 (a signed webhook to the platform)",
205
+ auth: ["webhookSignature"],
206
+ pending: "PL-8",
207
+ idempotency: "webhook-id",
208
+ body: { schema: PredicateAnswered },
209
+ responses: { 202: { description: "Received." } },
210
+ }),
211
+ ];
212
+ /** What the platform sends: registered in the document's `webhooks` section. */
213
+ export const integrationWebhooks = [
214
+ operation({
215
+ operationId: "predicateAnswerRequested",
216
+ method: "post",
217
+ path: "predicate.answer-requested",
218
+ tag: "integration",
219
+ summary: "Answer this need from the book you hold for this organisation",
220
+ description: "Sent to your predicate-answer URL after the organisation chose to answer in its portal. Reply 200 with the result, or 202 and deliver it later to /v1/integration/predicate-answers.",
221
+ auth: ["webhookSignature"],
222
+ pending: "PL-8",
223
+ idempotency: "webhook-id",
224
+ body: { schema: PredicateAnswerRequested },
225
+ responses: {
226
+ 200: { description: "Answered now.", schema: PredicateAnswerResult },
227
+ 202: { description: "Answered later." },
228
+ },
229
+ }),
230
+ operation({
231
+ operationId: "sessionLineEvent",
232
+ method: "post",
233
+ path: "session.line",
234
+ tag: "integration",
235
+ summary: "A session line was added or countersigned",
236
+ auth: ["webhookSignature"],
237
+ pending: "PL-8",
238
+ idempotency: "webhook-id",
239
+ body: { schema: SessionLineEvent },
240
+ responses: { 200: { description: "Received." } },
241
+ }),
242
+ ];
243
+ //# sourceMappingURL=integration.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"integration.js","sourceRoot":"","sources":["../../src/routes/integration.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,EAAE,cAAc,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAClI,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AACrC,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EAAE,CAAC,EAAE,MAAM,WAAW,CAAC;AAC9B,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACvC,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,C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GAAG;IACjC,SAAS,CAAC;QACR,WAAW,EAAE,0BAA0B;QACvC,MAAM,EAAE,MAAM;QACd,IAAI,EAAE,4BAA4B;QAClC,GAAG,EAAE,aAAa;QAClB,OAAO,EAAE,+DAA+D;QACxE,WAAW,EACT,sLAAsL;QACxL,IAAI,EAAE,CAAC,kBAAkB,CAAC;QAC1B,OAAO,EAAE,MAAM;QACf,WAAW,EAAE,YAAY;QACzB,IAAI,EAAE,EAAE,MAAM,EAAE,wBAAwB,EAAE;QAC1C,SAAS,EAAE;YACT,GAAG,EAAE,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,EAAE,qBAAqB,EAAE;YACpE,GAAG,EAAE,EAAE,WAAW,EAAE,iBAAiB,EAAE;SACxC;KACF,CAAC;IACF,SAAS,CAAC;QACR,WAAW,EAAE,kBAAkB;QAC/B,MAAM,EAAE,MAAM;QACd,IAAI,EAAE,cAAc;QACpB,GAAG,EAAE,aAAa;QAClB,OAAO,EAAE,2CAA2C;QACpD,IAAI,EAAE,CAAC,kBAAkB,CAAC;QAC1B,OAAO,EAAE,MAAM;QACf,WAAW,EAAE,YAAY;QACzB,IAAI,EAAE,EAAE,MAAM,EAAE,gBAAgB,EAAE;QAClC,SAAS,EAAE,EAAE,GAAG,EAAE,EAAE,WAAW,EAAE,WAAW,EAAE,EAAE;KACjD,CAAC;CACH,CAAC"}
@@ -0,0 +1,50 @@
1
+ import { z } from "../zod.ts";
2
+ export declare const ApiVersionEntry: z.ZodObject<{
3
+ id: z.ZodString;
4
+ status: z.ZodEnum<{
5
+ preview: "preview";
6
+ released: "released";
7
+ }>;
8
+ sha256: z.ZodString;
9
+ document: z.ZodString;
10
+ }, z.core.$strict>;
11
+ export declare const ApiVersionList: z.ZodObject<{
12
+ versions: z.ZodArray<z.ZodObject<{
13
+ id: z.ZodString;
14
+ status: z.ZodEnum<{
15
+ preview: "preview";
16
+ released: "released";
17
+ }>;
18
+ sha256: z.ZodString;
19
+ document: z.ZodString;
20
+ }, z.core.$strict>>;
21
+ }, z.core.$strict>;
22
+ export declare const OpenApiDocument: z.ZodRecord<z.ZodString, z.ZodUnknown>;
23
+ export declare const Ed25519Jwk: z.ZodObject<{
24
+ kty: z.ZodLiteral<"OKP">;
25
+ crv: z.ZodLiteral<"Ed25519">;
26
+ x: z.ZodString;
27
+ kid: z.ZodString;
28
+ use: z.ZodOptional<z.ZodLiteral<"sig">>;
29
+ alg: z.ZodOptional<z.ZodLiteral<"EdDSA">>;
30
+ }, z.core.$strict>;
31
+ export declare const Jwks: z.ZodObject<{
32
+ keys: z.ZodArray<z.ZodObject<{
33
+ kty: z.ZodLiteral<"OKP">;
34
+ crv: z.ZodLiteral<"Ed25519">;
35
+ x: z.ZodString;
36
+ kid: z.ZodString;
37
+ use: z.ZodOptional<z.ZodLiteral<"sig">>;
38
+ alg: z.ZodOptional<z.ZodLiteral<"EdDSA">>;
39
+ }, z.core.$strict>>;
40
+ }, z.core.$strict>;
41
+ export declare const TrustListEnvelope: z.ZodObject<{
42
+ payload: z.ZodString;
43
+ signatures: z.ZodArray<z.ZodObject<{
44
+ keyid: z.ZodString;
45
+ sig: z.ZodString;
46
+ }, z.core.$strict>>;
47
+ payloadType: z.ZodLiteral<"application/vnd.kash.trust-list+json">;
48
+ }, z.core.$strict>;
49
+ export declare const metaOperations: import("../op.ts").Operation[];
50
+ //# sourceMappingURL=meta.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"meta.d.ts","sourceRoot":"","sources":["../../src/routes/meta.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,CAAC,EAAE,MAAM,WAAW,CAAC;AAE9B,eAAO,MAAM,eAAe;;;;;;;;kBAYM,CAAC;AAEnC,eAAO,MAAM,cAAc;;;;;;;;;;kBAA2F,CAAC;AAEvH,eAAO,MAAM,eAAe,wCAA6G,CAAC;AAE1I,eAAO,MAAM,UAAU;;;;;;;kBAU4E,CAAC;AAEpG,eAAO,MAAM,IAAI;;;;;;;;;kBAAuH,CAAC;AAEzI,eAAO,MAAM,iBAAiB;;;;;;;kBAI5B,CAAC;AAIH,eAAO,MAAM,cAAc,gCAmD1B,CAAC"}
@@ -0,0 +1,90 @@
1
+ /** The contract describing itself, the keys Indorania signs webhooks with, and the trust list. */
2
+ import { DST_TRUST_LIST } from "@kashscript/attest/holder";
3
+ import { DsseEnvelope } from "../common.js";
4
+ import { operation } from "../op.js";
5
+ import { VERSION_PATTERN } from "../versions.js";
6
+ import { z } from "../zod.js";
7
+ export const ApiVersionEntry = z
8
+ .object({
9
+ id: z.string().regex(new RegExp(VERSION_PATTERN)),
10
+ status: z.enum(["preview", "released"]).meta({
11
+ description: "A preview may still be corrected in place. A released version changes by addition only (PL-4 founder decision, 2026-09-25).",
12
+ }),
13
+ sha256: z.string().regex(/^[0-9a-f]{64}$/).meta({
14
+ description: "SHA-256 of this version's OpenAPI document, byte for byte. A member that vendors the document pins this hash.",
15
+ }),
16
+ document: z.string().meta({ description: "Where this API serves the document: /v1/openapi/<id>." }),
17
+ })
18
+ .strict()
19
+ .meta({ id: "ApiVersionEntry" });
20
+ export const ApiVersionList = z.object({ versions: z.array(ApiVersionEntry) }).strict().meta({ id: "ApiVersionList" });
21
+ export const OpenApiDocument = z.record(z.string(), z.unknown()).meta({ id: "OpenApiDocument", description: "An OpenAPI 3.1 document." });
22
+ export const Ed25519Jwk = z
23
+ .object({
24
+ kty: z.literal("OKP"),
25
+ crv: z.literal("Ed25519"),
26
+ x: z.string().regex(/^[A-Za-z0-9_-]{43}$/),
27
+ kid: z.string().min(1).max(128),
28
+ use: z.literal("sig").optional(),
29
+ alg: z.literal("EdDSA").optional(),
30
+ })
31
+ .strict()
32
+ .meta({ id: "Ed25519Jwk", description: "A public Ed25519 key (RFC 8037). Never a private one." });
33
+ export const Jwks = z.object({ keys: z.array(Ed25519Jwk) }).strict().meta({ id: "Jwks", description: "A JSON Web Key Set (RFC 7517)." });
34
+ export const TrustListEnvelope = DsseEnvelope.extend({ payloadType: z.literal(DST_TRUST_LIST) }).meta({
35
+ id: "TrustListEnvelope",
36
+ description: "The current trust list as its publisher signed it (holder contract §3). It lists issuers for exact registered DSTs. It is a policy, never the format: a holder may keep a record from an unlisted issuer by choice (d47(e)).",
37
+ });
38
+ const VersionParam = z.object({ version: z.string().regex(new RegExp(VERSION_PATTERN)) }).strict();
39
+ export const metaOperations = [
40
+ operation({
41
+ operationId: "listVersions",
42
+ method: "get",
43
+ path: "/v1/versions",
44
+ tag: "meta",
45
+ summary: "The dated API versions, their status and the hash of each document",
46
+ auth: [],
47
+ pending: null,
48
+ versioning: "exempt",
49
+ collection: "The contract's own versions: public metadata about the contract, never people or records.",
50
+ responses: { 200: { description: "Every version, oldest first.", schema: ApiVersionList } },
51
+ }),
52
+ operation({
53
+ operationId: "getOpenApiDocument",
54
+ method: "get",
55
+ path: "/v1/openapi/{version}",
56
+ tag: "meta",
57
+ summary: "One version's OpenAPI document, byte for byte as committed",
58
+ auth: [],
59
+ pending: null,
60
+ versioning: "exempt",
61
+ params: VersionParam,
62
+ responses: { 200: { description: "The document.", schema: OpenApiDocument } },
63
+ }),
64
+ operation({
65
+ operationId: "getWebhookKeys",
66
+ method: "get",
67
+ path: "/v1/webhook-keys",
68
+ tag: "meta",
69
+ summary: "The public keys Indorania signs webhooks with",
70
+ description: "Standard Webhooks 1.0.0, v1a (Ed25519). During a rotation two keys are listed, and a webhook carries a signature from each.",
71
+ auth: [],
72
+ pending: null,
73
+ versioning: "exempt",
74
+ collection: "Indorania's own public signing keys.",
75
+ responses: { 200: { description: "The keys.", schema: Jwks } },
76
+ }),
77
+ operation({
78
+ operationId: "getTrustList",
79
+ method: "get",
80
+ path: "/v1/trust-list",
81
+ tag: "trust",
82
+ summary: "The current signed trust list",
83
+ description: "Offline-cacheable and self-describing: its payload carries `kashscript-trust-list/1` and a monotonic version, so it is exempt from dated API versions. Verify it with @kashscript/attest against a publisher key you pinned out of band.",
84
+ auth: [],
85
+ pending: null,
86
+ versioning: "exempt",
87
+ responses: { 200: { description: "The trust list.", schema: TrustListEnvelope } },
88
+ }),
89
+ ];
90
+ //# sourceMappingURL=meta.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"meta.js","sourceRoot":"","sources":["../../src/routes/meta.ts"],"names":[],"mappings":"AAAA,kGAAkG;AAClG,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AACrC,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EAAE,CAAC,EAAE,MAAM,WAAW,CAAC;AAE9B,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC;KAC7B,MAAM,CAAC;IACN,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,IAAI,MAAM,CAAC,eAAe,CAAC,CAAC;IACjD,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC;QAC3C,WAAW,EAAE,6HAA6H;KAC3I,CAAC;IACF,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC,IAAI,CAAC;QAC9C,WAAW,EAAE,+GAA+G;KAC7H,CAAC;IACF,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,EAAE,WAAW,EAAE,uDAAuD,EAAE,CAAC;CACpG,CAAC;KACD,MAAM,EAAE;KACR,IAAI,CAAC,EAAE,EAAE,EAAE,iBAAiB,EAAE,CAAC,CAAC;AAEnC,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC,KAAK,CAAC,eAAe,CAAC,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,EAAE,EAAE,EAAE,gBAAgB,EAAE,CAAC,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AAS,EAAE,EAAE,GAAG,EAAE,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE;KAC/D,CAAC;IACF,SAAS,CAAC;QACR,WAAW,EAAE,cAAc;QAC3B,MAAM,EAAE,KAAK;QACb,IAAI,EAAE,gBAAgB;QACtB,GAAG,EAAE,OAAO;QACZ,OAAO,EAAE,+BAA+B;QACxC,WAAW,EACT,0OAA0O;QAC5O,IAAI,EAAE,EAAE;QACR,OAAO,EAAE,IAAI;QACb,UAAU,EAAE,QAAQ;QACpB,SAAS,EAAE,EAAE,GAAG,EAAE,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,EAAE,iBAAiB,EAAE,EAAE;KAClF,CAAC;CACH,CAAC"}
@@ -0,0 +1,121 @@
1
+ import { z } from "../zod.ts";
2
+ export declare const ORGANISATION_TYPES: readonly ["business", "institute", "house"];
3
+ export declare const HOUSE_RULE_BASES: readonly ["place", "craft", "goal"];
4
+ export declare const ROLES: readonly ["owner", "admin", "staff"];
5
+ /**
6
+ * The open door (d47(c)): a house is joined by place, craft or goal. A rule based on birth,
7
+ * descent, ethnicity, sect or caste cannot be written — there is no such basis — and a statement
8
+ * that reaches for one is refused. This is a floor; human review sits above it (PL-7).
9
+ */
10
+ export declare const HouseJoinRule: z.ZodObject<{
11
+ basis: z.ZodEnum<{
12
+ place: "place";
13
+ craft: "craft";
14
+ goal: "goal";
15
+ }>;
16
+ statement: z.ZodString;
17
+ }, z.core.$strict>;
18
+ export declare const Organisation: z.ZodObject<{
19
+ id: z.ZodString;
20
+ type: z.ZodEnum<{
21
+ business: "business";
22
+ institute: "institute";
23
+ house: "house";
24
+ }>;
25
+ name: z.ZodString;
26
+ apiVersion: z.ZodString;
27
+ joinRule: z.ZodNullable<z.ZodObject<{
28
+ basis: z.ZodEnum<{
29
+ place: "place";
30
+ craft: "craft";
31
+ goal: "goal";
32
+ }>;
33
+ statement: z.ZodString;
34
+ }, z.core.$strict>>;
35
+ did: z.ZodString;
36
+ review: z.ZodNullable<z.ZodEnum<{
37
+ pending: "pending";
38
+ approved: "approved";
39
+ held: "held";
40
+ }>>;
41
+ createdAtUnix: z.ZodNumber;
42
+ }, z.core.$strict>;
43
+ export declare const OrganisationCreate: z.ZodDiscriminatedUnion<[z.ZodObject<{
44
+ type: z.ZodLiteral<"business">;
45
+ name: z.ZodString;
46
+ }, z.core.$strict>, z.ZodObject<{
47
+ type: z.ZodLiteral<"institute">;
48
+ name: z.ZodString;
49
+ }, z.core.$strict>, z.ZodObject<{
50
+ type: z.ZodLiteral<"house">;
51
+ name: z.ZodString;
52
+ joinRule: z.ZodObject<{
53
+ basis: z.ZodEnum<{
54
+ place: "place";
55
+ craft: "craft";
56
+ goal: "goal";
57
+ }>;
58
+ statement: z.ZodString;
59
+ }, z.core.$strict>;
60
+ }, z.core.$strict>], "type">;
61
+ export declare const OrganisationUpdate: z.ZodObject<{
62
+ name: z.ZodOptional<z.ZodString>;
63
+ joinRule: z.ZodOptional<z.ZodObject<{
64
+ basis: z.ZodEnum<{
65
+ place: "place";
66
+ craft: "craft";
67
+ goal: "goal";
68
+ }>;
69
+ statement: z.ZodString;
70
+ }, z.core.$strict>>;
71
+ apiVersion: z.ZodOptional<z.ZodString>;
72
+ }, z.core.$strict>;
73
+ export declare const Role: z.ZodEnum<{
74
+ owner: "owner";
75
+ admin: "admin";
76
+ staff: "staff";
77
+ }>;
78
+ export declare const Seat: z.ZodObject<{
79
+ id: z.ZodString;
80
+ organisation: z.ZodString;
81
+ role: z.ZodEnum<{
82
+ owner: "owner";
83
+ admin: "admin";
84
+ staff: "staff";
85
+ }>;
86
+ label: z.ZodNullable<z.ZodString>;
87
+ createdAtUnix: z.ZodNumber;
88
+ }, z.core.$strict>;
89
+ export declare const SeatInvite: z.ZodObject<{
90
+ role: z.ZodEnum<{
91
+ owner: "owner";
92
+ admin: "admin";
93
+ staff: "staff";
94
+ }>;
95
+ label: z.ZodOptional<z.ZodString>;
96
+ }, z.core.$strict>;
97
+ export declare const SeatInvitation: z.ZodObject<{
98
+ seat: z.ZodObject<{
99
+ id: z.ZodString;
100
+ organisation: z.ZodString;
101
+ role: z.ZodEnum<{
102
+ owner: "owner";
103
+ admin: "admin";
104
+ staff: "staff";
105
+ }>;
106
+ label: z.ZodNullable<z.ZodString>;
107
+ createdAtUnix: z.ZodNumber;
108
+ }, z.core.$strict>;
109
+ inviteLink: z.ZodURL;
110
+ expiresAtUnix: z.ZodNumber;
111
+ }, z.core.$strict>;
112
+ export declare const SeatUpdate: z.ZodObject<{
113
+ role: z.ZodOptional<z.ZodEnum<{
114
+ owner: "owner";
115
+ admin: "admin";
116
+ staff: "staff";
117
+ }>>;
118
+ label: z.ZodOptional<z.ZodNullable<z.ZodString>>;
119
+ }, z.core.$strict>;
120
+ export declare const organisationOperations: import("../op.ts").Operation[];
121
+ //# sourceMappingURL=organisations.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"organisations.d.ts","sourceRoot":"","sources":["../../src/routes/organisations.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,CAAC,EAAE,MAAM,WAAW,CAAC;AAE9B,eAAO,MAAM,kBAAkB,6CAA8C,CAAC;AAC9E,eAAO,MAAM,gBAAgB,qCAAsC,CAAC;AACpE,eAAO,MAAM,KAAK,sCAAuC,CAAC;AAE1D;;;;GAIG;AACH,eAAO,MAAM,aAAa;;;;;;;kBAYM,CAAC;AAIjC,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;kBAc8F,CAAC;AAExH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;4BAMyF,CAAC;AAEzH,eAAO,MAAM,kBAAkB;;;;;;;;;;;kBAOyF,CAAC;AAEzH,eAAO,MAAM,IAAI;;;;EAA+G,CAAC;AAEjI,eAAO,MAAM,IAAI;;;;;;;;;;kBASoH,CAAC;AAEtI,eAAO,MAAM,UAAU;;;;;;;kBAA4F,CAAC;AAEpH,eAAO,MAAM,cAAc;;;;;;;;;;;;;;kBAOM,CAAC;AAElC,eAAO,MAAM,UAAU;;;;;;;kBAGM,CAAC;AAK9B,eAAO,MAAM,sBAAsB,gCAyFlC,CAAC"}