@arcforges/api-client 1.0.0-ci.31.1 → 1.0.0-ci.311.1

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 (100) hide show
  1. package/NOTICE +57 -5
  2. package/README.md +9 -2
  3. package/build-identity.json +270 -0
  4. package/contracts.binpb +0 -0
  5. package/dist/gen/http.d.ts +31 -0
  6. package/dist/gen/http.js +34 -0
  7. package/dist/index.d.ts +10 -1
  8. package/dist/index.js +20 -2
  9. package/dist/shapes/gen/AndroidUpdate.d.ts +41 -0
  10. package/dist/shapes/gen/AndroidUpdate.js +620 -0
  11. package/dist/shapes/gen/BrowserAuthChallenge.d.ts +35 -0
  12. package/dist/shapes/gen/BrowserAuthChallenge.js +531 -0
  13. package/dist/shapes/gen/BrowserBeginAuthenticationRequest.d.ts +28 -0
  14. package/dist/shapes/gen/BrowserBeginAuthenticationRequest.js +384 -0
  15. package/dist/shapes/gen/BrowserBeginRecoveryRequest.d.ts +22 -0
  16. package/dist/shapes/gen/BrowserBeginRecoveryRequest.js +370 -0
  17. package/dist/shapes/gen/BrowserBeginStepUpRequest.d.ts +20 -0
  18. package/dist/shapes/gen/BrowserBeginStepUpRequest.js +279 -0
  19. package/dist/shapes/gen/BrowserBootstrapResponse.d.ts +37 -0
  20. package/dist/shapes/gen/BrowserBootstrapResponse.js +534 -0
  21. package/dist/shapes/gen/BrowserCompleteAuthenticationRequest.d.ts +45 -0
  22. package/dist/shapes/gen/BrowserCompleteAuthenticationRequest.js +564 -0
  23. package/dist/shapes/gen/BrowserCompleteEnrollmentRequest.d.ts +90 -0
  24. package/dist/shapes/gen/BrowserCompleteEnrollmentRequest.js +1145 -0
  25. package/dist/shapes/gen/BrowserCompleteRecoveryRequest.d.ts +22 -0
  26. package/dist/shapes/gen/BrowserCompleteRecoveryRequest.js +733 -0
  27. package/dist/shapes/gen/BrowserCompleteStepUpRequest.d.ts +20 -0
  28. package/dist/shapes/gen/BrowserCompleteStepUpRequest.js +564 -0
  29. package/dist/shapes/gen/BrowserOidcCallbackFailure.d.ts +20 -0
  30. package/dist/shapes/gen/BrowserOidcCallbackFailure.js +200 -0
  31. package/dist/shapes/gen/BrowserOidcCallbackSuccess.d.ts +19 -0
  32. package/dist/shapes/gen/BrowserOidcCallbackSuccess.js +185 -0
  33. package/dist/shapes/gen/BrowserReceipt.d.ts +20 -0
  34. package/dist/shapes/gen/BrowserReceipt.js +285 -0
  35. package/dist/shapes/gen/BrowserSessionRoutes.d.ts +17 -0
  36. package/dist/shapes/gen/BrowserSessionRoutes.js +13 -0
  37. package/dist/shapes/gen/BrowserSessionView.d.ts +25 -0
  38. package/dist/shapes/gen/BrowserSessionView.js +388 -0
  39. package/dist/shapes/gen/BrowserStepUpEvidence.d.ts +19 -0
  40. package/dist/shapes/gen/BrowserStepUpEvidence.js +266 -0
  41. package/dist/shapes/gen/CatalogIndex.d.ts +49 -0
  42. package/dist/shapes/gen/CatalogIndex.js +703 -0
  43. package/dist/shapes/gen/CatalogRevocations.d.ts +46 -0
  44. package/dist/shapes/gen/CatalogRevocations.js +647 -0
  45. package/dist/shapes/gen/DeclarativePanel.d.ts +154 -0
  46. package/dist/shapes/gen/DeclarativePanel.js +2988 -0
  47. package/dist/shapes/gen/ExtensionManifest.d.ts +278 -0
  48. package/dist/shapes/gen/ExtensionManifest.js +3974 -0
  49. package/dist/shapes/gen/ExtensionWorkflow.d.ts +151 -0
  50. package/dist/shapes/gen/ExtensionWorkflow.js +2251 -0
  51. package/dist/shapes/gen/NativeAuthRoutes.d.ts +17 -0
  52. package/dist/shapes/gen/NativeAuthRoutes.js +5 -0
  53. package/dist/shapes/gen/NativeAuthorizeCallbackFailure.d.ts +19 -0
  54. package/dist/shapes/gen/NativeAuthorizeCallbackFailure.js +185 -0
  55. package/dist/shapes/gen/NativeAuthorizeCallbackSuccess.d.ts +19 -0
  56. package/dist/shapes/gen/NativeAuthorizeCallbackSuccess.js +185 -0
  57. package/dist/shapes/gen/NativeAuthorizeRequest.d.ts +24 -0
  58. package/dist/shapes/gen/NativeAuthorizeRequest.js +271 -0
  59. package/dist/shapes/gen/NativeTokenRequest.d.ts +23 -0
  60. package/dist/shapes/gen/NativeTokenRequest.js +258 -0
  61. package/dist/shapes/gen/NativeTokenResponse.d.ts +40 -0
  62. package/dist/shapes/gen/NativeTokenResponse.js +572 -0
  63. package/dist/shapes/gen/PackageInventory.d.ts +24 -0
  64. package/dist/shapes/gen/PackageInventory.js +327 -0
  65. package/dist/shapes/gen/PartReceipt.d.ts +21 -0
  66. package/dist/shapes/gen/PartReceipt.js +290 -0
  67. package/dist/shapes/gen/PolicyBody.d.ts +269 -0
  68. package/dist/shapes/gen/PolicyBody.js +4188 -0
  69. package/dist/shapes/gen/RealmDescriptor.d.ts +39 -0
  70. package/dist/shapes/gen/RealmDescriptor.js +627 -0
  71. package/package.json +15 -7
  72. package/sbom.cdx.json +17 -17
  73. package/schemas/public/http/v1/browser.schema.json +1300 -0
  74. package/schemas/public/http/v1/inventory.schema.json +49 -0
  75. package/schemas/public/http/v1/manifest.schema.json +1459 -0
  76. package/schemas/public/http/v1/native-auth.schema.json +341 -0
  77. package/schemas/public/http/v1/panel.schema.json +963 -0
  78. package/schemas/public/http/v1/policy-body.schema.json +1376 -0
  79. package/schemas/public/http/v1/schema.json +30 -0
  80. package/schemas/public/http/v1/signed-formats.schema.json +748 -0
  81. package/schemas/public/http/v1/workflow.schema.json +715 -0
  82. package/schemas/public/proto/arcforges/catalog/v1/catalog.proto +204 -0
  83. package/schemas/public/proto/arcforges/events/v1/events.proto +343 -0
  84. package/schemas/public/proto/arcforges/foundation/v1/foundation.proto +384 -0
  85. package/schemas/public/proto/arcforges/hello/v1/hello.proto +23 -0
  86. package/schemas/public/proto/arcforges/publicapi/v1/application.proto +297 -0
  87. package/schemas/public/proto/arcforges/publicapi/v1/chat.proto +1507 -0
  88. package/schemas/public/proto/arcforges/publicapi/v1/commerce.proto +542 -0
  89. package/schemas/public/proto/arcforges/publicapi/v1/connector.proto +172 -0
  90. package/schemas/public/proto/arcforges/publicapi/v1/content.proto +813 -0
  91. package/schemas/public/proto/arcforges/publicapi/v1/descriptors.proto +27 -0
  92. package/schemas/public/proto/arcforges/publicapi/v1/export.proto +112 -0
  93. package/schemas/public/proto/arcforges/publicapi/v1/identity.proto +1350 -0
  94. package/schemas/public/proto/arcforges/publicapi/v1/inprocess-values.proto +134 -0
  95. package/schemas/public/proto/arcforges/publicapi/v1/scope.proto +81 -0
  96. package/schemas/public/proto/arcforges/publicapi/v1/support.proto +242 -0
  97. package/schemas/public/proto/arcforges/publicapi/v1/sync.proto +459 -0
  98. package/schemas/public/proto/arcforges/publicapi/v1/transfer.proto +190 -0
  99. package/schemas/public/proto/arcforges/simulation/v1/simulation.proto +457 -0
  100. package/source.json +50 -11
@@ -0,0 +1,20 @@
1
+ import type { BrowserAuthProof } from "./BrowserCompleteAuthenticationRequest.js";
2
+ export interface BrowserCompleteStepUpRequest {
3
+ flowId: string;
4
+ proof: BrowserAuthProof;
5
+ }
6
+ export declare function isBrowserCompleteStepUpRequest(value: unknown): value is BrowserCompleteStepUpRequest;
7
+ /** The schema's declared UTF-8 document bound in bytes. */
8
+ export declare const browserCompleteStepUpRequestJsonMaxBytes = 131072;
9
+ /** Parses one strict BrowserCompleteStepUpRequest document; refusal kinds match the C# codec. */
10
+ export declare function tryParseBrowserCompleteStepUpRequestJson(input: Uint8Array | string): {
11
+ ok: true;
12
+ value: BrowserCompleteStepUpRequest;
13
+ } | {
14
+ ok: false;
15
+ failure: "tooLarge" | "malformed" | "invalid";
16
+ };
17
+ /** Parses one strict BrowserCompleteStepUpRequest document or throws an error carrying the refusal kind. */
18
+ export declare function parseBrowserCompleteStepUpRequestJson(input: Uint8Array | string): BrowserCompleteStepUpRequest;
19
+ /** Writes compact UTF-8 in schema property order and refuses output the schema rejects. */
20
+ export declare function serializeBrowserCompleteStepUpRequestJson(value: BrowserCompleteStepUpRequest): Uint8Array;
@@ -0,0 +1,564 @@
1
+ export function isBrowserCompleteStepUpRequest(value) { return check0(value); }
2
+ /** The schema's declared UTF-8 document bound in bytes. */
3
+ export const browserCompleteStepUpRequestJsonMaxBytes = 131072;
4
+ /** Parses one strict BrowserCompleteStepUpRequest document; refusal kinds match the C# codec. */
5
+ export function tryParseBrowserCompleteStepUpRequestJson(input) {
6
+ const parsed = strictJson(input, 131072);
7
+ if (!parsed.ok)
8
+ return parsed;
9
+ return isBrowserCompleteStepUpRequest(parsed.value) ? { ok: true, value: parsed.value } : { ok: false, failure: "invalid" };
10
+ }
11
+ /** Parses one strict BrowserCompleteStepUpRequest document or throws an error carrying the refusal kind. */
12
+ export function parseBrowserCompleteStepUpRequestJson(input) {
13
+ const result = tryParseBrowserCompleteStepUpRequestJson(input);
14
+ if (!result.ok)
15
+ throw Object.assign(new Error(`BrowserCompleteStepUpRequest JSON refused: ${result.failure}.`), { failure: result.failure });
16
+ return result.value;
17
+ }
18
+ /** Writes compact UTF-8 in schema property order and refuses output the schema rejects. */
19
+ export function serializeBrowserCompleteStepUpRequestJson(value) {
20
+ const bytes = new TextEncoder().encode(JSON.stringify(orderBrowserCompleteStepUpRequest(value)));
21
+ const result = tryParseBrowserCompleteStepUpRequestJson(bytes);
22
+ if (!result.ok)
23
+ throw Object.assign(new Error(`BrowserCompleteStepUpRequest JSON refused: ${result.failure}.`), { failure: result.failure });
24
+ return bytes;
25
+ }
26
+ function orderBrowserAuthProof(value) {
27
+ if (check3(value))
28
+ return orderBrowserAuthProofPasskey(value);
29
+ if (check10(value))
30
+ return orderBrowserAuthProofEmailCode(value);
31
+ if (check12(value))
32
+ return orderBrowserAuthProofRecoveryCode(value);
33
+ if (check14(value))
34
+ return orderBrowserAuthProofPassword(value);
35
+ if (check16(value))
36
+ return orderBrowserAuthProofProviderReceipt(value);
37
+ if (check18(value))
38
+ return orderBrowserAuthProofAdminGrant(value);
39
+ throw new TypeError('Invalid closed union');
40
+ }
41
+ function orderBrowserAuthProofAdminGrant(value) {
42
+ const out = {};
43
+ out["adminGrant"] = value["adminGrant"];
44
+ return out;
45
+ }
46
+ function orderBrowserAuthProofEmailCode(value) {
47
+ const out = {};
48
+ out["emailCode"] = value["emailCode"];
49
+ return out;
50
+ }
51
+ function orderBrowserAuthProofPasskey(value) {
52
+ const out = {};
53
+ out["passkey"] = orderBrowserWebAuthnAssertion(value["passkey"]);
54
+ return out;
55
+ }
56
+ function orderBrowserAuthProofPassword(value) {
57
+ const out = {};
58
+ out["password"] = value["password"];
59
+ return out;
60
+ }
61
+ function orderBrowserAuthProofProviderReceipt(value) {
62
+ const out = {};
63
+ out["providerReceipt"] = value["providerReceipt"];
64
+ return out;
65
+ }
66
+ function orderBrowserAuthProofRecoveryCode(value) {
67
+ const out = {};
68
+ out["recoveryCode"] = value["recoveryCode"];
69
+ return out;
70
+ }
71
+ function orderBrowserCompleteStepUpRequest(value) {
72
+ const out = {};
73
+ out["flowId"] = value["flowId"];
74
+ out["proof"] = orderBrowserAuthProof(value["proof"]);
75
+ return out;
76
+ }
77
+ function orderBrowserWebAuthnAssertion(value) {
78
+ const out = {};
79
+ out["credentialId"] = value["credentialId"];
80
+ out["clientDataJson"] = value["clientDataJson"];
81
+ out["authenticatorData"] = value["authenticatorData"];
82
+ out["signature"] = value["signature"];
83
+ if (value["userHandle"] !== undefined)
84
+ out["userHandle"] = value["userHandle"];
85
+ return out;
86
+ }
87
+ function check0(value) {
88
+ if (typeof value !== 'object' || value === null || Array.isArray(value))
89
+ return false;
90
+ const object = value;
91
+ for (const key of Object.keys(object)) {
92
+ switch (key) {
93
+ case "flowId":
94
+ if (!check1(object[key]))
95
+ return false;
96
+ break;
97
+ case "proof":
98
+ if (!check2(object[key]))
99
+ return false;
100
+ break;
101
+ default: return false;
102
+ }
103
+ }
104
+ if (!Object.prototype.hasOwnProperty.call(object, "flowId"))
105
+ return false;
106
+ if (!Object.prototype.hasOwnProperty.call(object, "proof"))
107
+ return false;
108
+ return true;
109
+ }
110
+ function check1(value) {
111
+ if (typeof value !== 'string' || !validText(value))
112
+ return false;
113
+ if ([...value].length < 36)
114
+ return false;
115
+ if ([...value].length > 36)
116
+ return false;
117
+ if ((new RegExp("^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$", 'u')).exec(value)?.[0] !== value)
118
+ return false;
119
+ if (value === '00000000-0000-0000-0000-000000000000')
120
+ return false;
121
+ return true;
122
+ }
123
+ function check2(value) {
124
+ if ((check3(value) ? 1 : 0) + (check10(value) ? 1 : 0) + (check12(value) ? 1 : 0) + (check14(value) ? 1 : 0) + (check16(value) ? 1 : 0) + (check18(value) ? 1 : 0) !== 1)
125
+ return false;
126
+ return true;
127
+ }
128
+ function check3(value) {
129
+ if (typeof value !== 'object' || value === null || Array.isArray(value))
130
+ return false;
131
+ const object = value;
132
+ for (const key of Object.keys(object)) {
133
+ switch (key) {
134
+ case "passkey":
135
+ if (!check4(object[key]))
136
+ return false;
137
+ break;
138
+ default: return false;
139
+ }
140
+ }
141
+ if (!Object.prototype.hasOwnProperty.call(object, "passkey"))
142
+ return false;
143
+ return true;
144
+ }
145
+ function check4(value) {
146
+ if (typeof value !== 'object' || value === null || Array.isArray(value))
147
+ return false;
148
+ const object = value;
149
+ for (const key of Object.keys(object)) {
150
+ switch (key) {
151
+ case "credentialId":
152
+ if (!check5(object[key]))
153
+ return false;
154
+ break;
155
+ case "clientDataJson":
156
+ if (!check6(object[key]))
157
+ return false;
158
+ break;
159
+ case "authenticatorData":
160
+ if (!check7(object[key]))
161
+ return false;
162
+ break;
163
+ case "signature":
164
+ if (!check8(object[key]))
165
+ return false;
166
+ break;
167
+ case "userHandle":
168
+ if (!check9(object[key]))
169
+ return false;
170
+ break;
171
+ default: return false;
172
+ }
173
+ }
174
+ if (!Object.prototype.hasOwnProperty.call(object, "credentialId"))
175
+ return false;
176
+ if (!Object.prototype.hasOwnProperty.call(object, "clientDataJson"))
177
+ return false;
178
+ if (!Object.prototype.hasOwnProperty.call(object, "authenticatorData"))
179
+ return false;
180
+ if (!Object.prototype.hasOwnProperty.call(object, "signature"))
181
+ return false;
182
+ return true;
183
+ }
184
+ function check5(value) {
185
+ if (typeof value !== 'string' || !validText(value))
186
+ return false;
187
+ if ([...value].length < 2)
188
+ return false;
189
+ if ([...value].length > 1364)
190
+ return false;
191
+ if ((new RegExp("^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$", 'u')).exec(value)?.[0] !== value)
192
+ return false;
193
+ return true;
194
+ }
195
+ function check6(value) {
196
+ if (typeof value !== 'string' || !validText(value))
197
+ return false;
198
+ if ([...value].length < 2)
199
+ return false;
200
+ if ([...value].length > 21846)
201
+ return false;
202
+ if ((new RegExp("^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$", 'u')).exec(value)?.[0] !== value)
203
+ return false;
204
+ return true;
205
+ }
206
+ function check7(value) {
207
+ if (typeof value !== 'string' || !validText(value))
208
+ return false;
209
+ if ([...value].length < 2)
210
+ return false;
211
+ if ([...value].length > 21846)
212
+ return false;
213
+ if ((new RegExp("^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$", 'u')).exec(value)?.[0] !== value)
214
+ return false;
215
+ return true;
216
+ }
217
+ function check8(value) {
218
+ if (typeof value !== 'string' || !validText(value))
219
+ return false;
220
+ if ([...value].length < 2)
221
+ return false;
222
+ if ([...value].length > 342)
223
+ return false;
224
+ if ((new RegExp("^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$", 'u')).exec(value)?.[0] !== value)
225
+ return false;
226
+ return true;
227
+ }
228
+ function check9(value) {
229
+ if (typeof value !== 'string' || !validText(value))
230
+ return false;
231
+ if ([...value].length < 2)
232
+ return false;
233
+ if ([...value].length > 86)
234
+ return false;
235
+ if ((new RegExp("^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$", 'u')).exec(value)?.[0] !== value)
236
+ return false;
237
+ return true;
238
+ }
239
+ function check10(value) {
240
+ if (typeof value !== 'object' || value === null || Array.isArray(value))
241
+ return false;
242
+ const object = value;
243
+ for (const key of Object.keys(object)) {
244
+ switch (key) {
245
+ case "emailCode":
246
+ if (!check11(object[key]))
247
+ return false;
248
+ break;
249
+ default: return false;
250
+ }
251
+ }
252
+ if (!Object.prototype.hasOwnProperty.call(object, "emailCode"))
253
+ return false;
254
+ return true;
255
+ }
256
+ function check11(value) {
257
+ if (typeof value !== 'string' || !validText(value))
258
+ return false;
259
+ if ([...value].length < 1)
260
+ return false;
261
+ if ([...value].length > 128)
262
+ return false;
263
+ if (new TextEncoder().encode(value).byteLength > 8192)
264
+ return false;
265
+ return true;
266
+ }
267
+ function check12(value) {
268
+ if (typeof value !== 'object' || value === null || Array.isArray(value))
269
+ return false;
270
+ const object = value;
271
+ for (const key of Object.keys(object)) {
272
+ switch (key) {
273
+ case "recoveryCode":
274
+ if (!check13(object[key]))
275
+ return false;
276
+ break;
277
+ default: return false;
278
+ }
279
+ }
280
+ if (!Object.prototype.hasOwnProperty.call(object, "recoveryCode"))
281
+ return false;
282
+ return true;
283
+ }
284
+ function check13(value) {
285
+ if (typeof value !== 'string' || !validText(value))
286
+ return false;
287
+ if ([...value].length < 1)
288
+ return false;
289
+ if ([...value].length > 128)
290
+ return false;
291
+ if (new TextEncoder().encode(value).byteLength > 8192)
292
+ return false;
293
+ return true;
294
+ }
295
+ function check14(value) {
296
+ if (typeof value !== 'object' || value === null || Array.isArray(value))
297
+ return false;
298
+ const object = value;
299
+ for (const key of Object.keys(object)) {
300
+ switch (key) {
301
+ case "password":
302
+ if (!check15(object[key]))
303
+ return false;
304
+ break;
305
+ default: return false;
306
+ }
307
+ }
308
+ if (!Object.prototype.hasOwnProperty.call(object, "password"))
309
+ return false;
310
+ return true;
311
+ }
312
+ function check15(value) {
313
+ if (typeof value !== 'string' || !validText(value))
314
+ return false;
315
+ if ([...value].length < 1)
316
+ return false;
317
+ if ([...value].length > 128)
318
+ return false;
319
+ if (new TextEncoder().encode(value).byteLength > 8192)
320
+ return false;
321
+ return true;
322
+ }
323
+ function check16(value) {
324
+ if (typeof value !== 'object' || value === null || Array.isArray(value))
325
+ return false;
326
+ const object = value;
327
+ for (const key of Object.keys(object)) {
328
+ switch (key) {
329
+ case "providerReceipt":
330
+ if (!check17(object[key]))
331
+ return false;
332
+ break;
333
+ default: return false;
334
+ }
335
+ }
336
+ if (!Object.prototype.hasOwnProperty.call(object, "providerReceipt"))
337
+ return false;
338
+ return true;
339
+ }
340
+ function check17(value) {
341
+ if (typeof value !== 'string' || !validText(value))
342
+ return false;
343
+ if ([...value].length < 1)
344
+ return false;
345
+ if (new TextEncoder().encode(value).byteLength > 8192)
346
+ return false;
347
+ return true;
348
+ }
349
+ function check18(value) {
350
+ if (typeof value !== 'object' || value === null || Array.isArray(value))
351
+ return false;
352
+ const object = value;
353
+ for (const key of Object.keys(object)) {
354
+ switch (key) {
355
+ case "adminGrant":
356
+ if (!check19(object[key]))
357
+ return false;
358
+ break;
359
+ default: return false;
360
+ }
361
+ }
362
+ if (!Object.prototype.hasOwnProperty.call(object, "adminGrant"))
363
+ return false;
364
+ return true;
365
+ }
366
+ function check19(value) {
367
+ if (typeof value !== 'string' || !validText(value))
368
+ return false;
369
+ if ([...value].length < 1)
370
+ return false;
371
+ if (new TextEncoder().encode(value).byteLength > 8192)
372
+ return false;
373
+ return true;
374
+ }
375
+ /** Strict UTF-8 JSON: no BOM, comments, trailing commas or duplicate properties; depth <= 32; integer lexemes only. */
376
+ function strictJson(input, maxBytes) {
377
+ let text;
378
+ if (typeof input === "string") {
379
+ if (!validText(input))
380
+ return { ok: false, failure: "malformed" };
381
+ if (new TextEncoder().encode(input).byteLength > maxBytes)
382
+ return { ok: false, failure: "tooLarge" };
383
+ text = input;
384
+ }
385
+ else {
386
+ if (input.byteLength > maxBytes)
387
+ return { ok: false, failure: "tooLarge" };
388
+ try {
389
+ text = new TextDecoder("utf-8", { fatal: true, ignoreBOM: true }).decode(input);
390
+ }
391
+ catch {
392
+ return { ok: false, failure: "malformed" };
393
+ }
394
+ }
395
+ try {
396
+ return { ok: true, value: new StrictJsonReader(text).document() };
397
+ }
398
+ catch {
399
+ return { ok: false, failure: "malformed" };
400
+ }
401
+ }
402
+ class StrictJsonReader {
403
+ text;
404
+ index = 0;
405
+ constructor(text) {
406
+ this.text = text;
407
+ }
408
+ document() {
409
+ this.space();
410
+ const value = this.value(0);
411
+ this.space();
412
+ if (this.index !== this.text.length)
413
+ throw new SyntaxError("Trailing JSON content");
414
+ return value;
415
+ }
416
+ value(depth) {
417
+ switch (this.text[this.index]) {
418
+ case "{": return this.object(depth + 1);
419
+ case "[": return this.array(depth + 1);
420
+ case '"': return this.string();
421
+ case "t": return this.literal("true", true);
422
+ case "f": return this.literal("false", false);
423
+ case "n": return this.literal("null", null);
424
+ default: return this.number();
425
+ }
426
+ }
427
+ object(depth) {
428
+ if (depth > 32)
429
+ throw new SyntaxError("JSON depth exceeded");
430
+ this.index++;
431
+ const out = {};
432
+ const keys = new Set();
433
+ this.space();
434
+ if (this.text[this.index] === "}") {
435
+ this.index++;
436
+ return out;
437
+ }
438
+ for (;;) {
439
+ this.space();
440
+ if (this.text[this.index] !== '"')
441
+ throw new SyntaxError("Expected property name");
442
+ const key = this.string();
443
+ if (keys.has(key))
444
+ throw new SyntaxError("Duplicate JSON property");
445
+ keys.add(key);
446
+ this.space();
447
+ if (this.text[this.index++] !== ":")
448
+ throw new SyntaxError("Expected colon");
449
+ this.space();
450
+ // defineProperty keeps names such as __proto__ as ordinary own properties.
451
+ Object.defineProperty(out, key, { value: this.value(depth), enumerable: true, writable: true, configurable: true });
452
+ this.space();
453
+ const next = this.text[this.index++];
454
+ if (next === "}")
455
+ return out;
456
+ if (next !== ",")
457
+ throw new SyntaxError("Expected comma");
458
+ }
459
+ }
460
+ array(depth) {
461
+ if (depth > 32)
462
+ throw new SyntaxError("JSON depth exceeded");
463
+ this.index++;
464
+ const out = [];
465
+ this.space();
466
+ if (this.text[this.index] === "]") {
467
+ this.index++;
468
+ return out;
469
+ }
470
+ for (;;) {
471
+ this.space();
472
+ out.push(this.value(depth));
473
+ this.space();
474
+ const next = this.text[this.index++];
475
+ if (next === "]")
476
+ return out;
477
+ if (next !== ",")
478
+ throw new SyntaxError("Expected comma");
479
+ }
480
+ }
481
+ string() {
482
+ this.index++;
483
+ let out = "";
484
+ for (;;) {
485
+ const c = this.text[this.index++];
486
+ if (c === undefined)
487
+ throw new SyntaxError("Unterminated string");
488
+ if (c === '"')
489
+ break;
490
+ if (c < " ")
491
+ throw new SyntaxError("Unescaped control character");
492
+ if (c !== "\\") {
493
+ out += c;
494
+ continue;
495
+ }
496
+ const e = this.text[this.index++];
497
+ const simple = { '"': '"', "\\": "\\", "/": "/", b: "\b", f: "\f", n: "\n", r: "\r", t: "\t" };
498
+ if (e !== undefined && e in simple) {
499
+ out += simple[e];
500
+ continue;
501
+ }
502
+ if (e !== "u" || !/^[0-9a-fA-F]{4}$/.test(this.text.slice(this.index, this.index + 4)))
503
+ throw new SyntaxError("Invalid escape");
504
+ out += String.fromCharCode(parseInt(this.text.slice(this.index, this.index + 4), 16));
505
+ this.index += 4;
506
+ }
507
+ if (!validText(out))
508
+ throw new SyntaxError("Lone surrogate escape");
509
+ return out;
510
+ }
511
+ number() {
512
+ const match = /-?(?:0|[1-9][0-9]*)(\.[0-9]+)?([eE][+-]?[0-9]+)?/y;
513
+ match.lastIndex = this.index;
514
+ const found = match.exec(this.text);
515
+ if (found === null)
516
+ throw new SyntaxError("Invalid JSON value");
517
+ this.index = match.lastIndex;
518
+ // Selected schemas have no fractional numbers; fraction/exponent lexemes never satisfy an integer.
519
+ return found[1] !== undefined || found[2] !== undefined ? Number.NaN : Number(found[0]);
520
+ }
521
+ literal(word, value) {
522
+ if (this.text.slice(this.index, this.index + word.length) !== word)
523
+ throw new SyntaxError("Invalid JSON literal");
524
+ this.index += word.length;
525
+ return value;
526
+ }
527
+ space() {
528
+ while (this.text[this.index] === " " || this.text[this.index] === "\t" || this.text[this.index] === "\n" || this.text[this.index] === "\r")
529
+ this.index++;
530
+ }
531
+ }
532
+ function validText(value) {
533
+ for (const scalar of value) {
534
+ const point = scalar.codePointAt(0);
535
+ if (point >= 0xd800 && point <= 0xdfff)
536
+ return false;
537
+ }
538
+ return true;
539
+ }
540
+ function inventoryRules(value) {
541
+ const files = value.files;
542
+ const seen = new Set();
543
+ let previous;
544
+ let total = 0n;
545
+ for (const file of files) {
546
+ const path = file.path;
547
+ const folded = path.toUpperCase();
548
+ if (path.length === 0 || folded === 'INVENTORY.JSON' || folded === 'SIGNATURE.JSON' || seen.has(folded) || (previous !== undefined && previous >= path))
549
+ return false;
550
+ for (const segment of path.split('/')) {
551
+ if (!/^[A-Za-z0-9_.-]+$/.test(segment) || segment === '.' || segment === '..' || segment.endsWith('.') || /^(CON|PRN|AUX|NUL|COM[1-9]|LPT[1-9])(?:\.|$)/i.test(segment))
552
+ return false;
553
+ }
554
+ const size = BigInt(file.size);
555
+ if (size > 134217728n)
556
+ return false;
557
+ total += size;
558
+ if (total > 1073741824n)
559
+ return false;
560
+ seen.add(folded);
561
+ previous = path;
562
+ }
563
+ return files.some(file => file.path === 'manifest.json');
564
+ }
@@ -0,0 +1,20 @@
1
+ export interface BrowserOidcCallbackFailure {
2
+ error: string;
3
+ error_description?: string;
4
+ state: string;
5
+ }
6
+ export declare function isBrowserOidcCallbackFailure(value: unknown): value is BrowserOidcCallbackFailure;
7
+ /** The schema's declared form-urlencoded document bound in bytes. */
8
+ export declare const browserOidcCallbackFailureFormMaxBytes = 16384;
9
+ /** Parses one strict BrowserOidcCallbackFailure form; refusal kinds match the C# codec. */
10
+ export declare function tryParseBrowserOidcCallbackFailureForm(input: Uint8Array | string): {
11
+ ok: true;
12
+ value: BrowserOidcCallbackFailure;
13
+ } | {
14
+ ok: false;
15
+ failure: "tooLarge" | "malformed" | "invalid";
16
+ };
17
+ /** Parses one strict BrowserOidcCallbackFailure form or throws an error carrying the refusal kind. */
18
+ export declare function parseBrowserOidcCallbackFailureForm(input: Uint8Array | string): BrowserOidcCallbackFailure;
19
+ /** Writes schema-order name=value pairs with only RFC 3986 unreserved characters unescaped and refuses output the schema rejects. */
20
+ export declare function serializeBrowserOidcCallbackFailureForm(value: BrowserOidcCallbackFailure): Uint8Array;