@pithy-sh/core 0.6.0 → 0.6.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.
- package/dist/capability/manifest.d.ts +13 -2
- package/dist/capability/manifest.d.ts.map +1 -1
- package/dist/capability/manifest.js +15 -6
- package/dist/error/http.d.ts +84 -0
- package/dist/error/http.d.ts.map +1 -1
- package/dist/error/payload.d.ts +168 -0
- package/dist/error/payload.d.ts.map +1 -1
- package/dist/error/payload.js +56 -0
- package/dist/image/storedImage.d.ts +150 -0
- package/dist/image/storedImage.d.ts.map +1 -0
- package/dist/image/storedImage.js +181 -0
- package/dist/logger/record.d.ts +49 -0
- package/dist/logger/record.d.ts.map +1 -1
- package/dist/seed/devLogin.d.ts +16 -9
- package/dist/seed/devLogin.d.ts.map +1 -1
- package/dist/seed/devLogin.js +21 -14
- package/dist/version.generated.d.ts +1 -1
- package/dist/version.generated.js +1 -1
- package/package.json +1 -1
- package/src/version.generated.ts +1 -1
|
@@ -252,9 +252,16 @@ export declare const CONFIG_SEAMS: {
|
|
|
252
252
|
readonly specifier: "./src/billing/subject";
|
|
253
253
|
readonly describe: "Which organization this caller is acting for. Scaffolded unimplemented — this Worker refuses to boot until src/billing/subject.ts answers it.";
|
|
254
254
|
};
|
|
255
|
+
readonly organizationRoles: {
|
|
256
|
+
readonly binding: "roles";
|
|
257
|
+
readonly module: "src/organization/roles.ts";
|
|
258
|
+
readonly specifier: "./src/organization/roles";
|
|
259
|
+
readonly describe: "Who may do what here. Scaffolded with a starter matrix — the role names and the powers they hold are this product's, and only this project's code can state them.";
|
|
260
|
+
};
|
|
255
261
|
};
|
|
256
262
|
/** Which scaffolded seam a choice needs, by key. */
|
|
257
263
|
export declare const ConfigSeam: z.ZodEnum<{
|
|
264
|
+
organizationRoles: "organizationRoles";
|
|
258
265
|
paymentsSubject: "paymentsSubject";
|
|
259
266
|
}>;
|
|
260
267
|
export type ConfigSeam = z.infer<typeof ConfigSeam>;
|
|
@@ -263,7 +270,7 @@ export declare const ConfigOption: z.ZodObject<{
|
|
|
263
270
|
default: z.ZodOptional<z.ZodType<ConfigOptionValue, unknown, z.core.$ZodTypeInternals<ConfigOptionValue, unknown>>>;
|
|
264
271
|
choices: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
265
272
|
choicesNeedingCode: z.ZodOptional<z.ZodPipe<z.ZodCustom<Record<string, string>, Record<string, string>>, z.ZodType<Record<string, string>, Record<string, string>, z.core.$ZodTypeInternals<Record<string, string>, Record<string, string>>>>>;
|
|
266
|
-
choicesNeedingSeam: z.ZodOptional<z.ZodPipe<z.ZodCustom<Record<string, "paymentsSubject">, Record<string, "paymentsSubject">>, z.ZodType<Record<string, "paymentsSubject">, Record<string, "paymentsSubject">, z.core.$ZodTypeInternals<Record<string, "paymentsSubject">, Record<string, "paymentsSubject">>>>>;
|
|
273
|
+
choicesNeedingSeam: z.ZodOptional<z.ZodPipe<z.ZodCustom<Record<string, "organizationRoles" | "paymentsSubject">, Record<string, "organizationRoles" | "paymentsSubject">>, z.ZodType<Record<string, "organizationRoles" | "paymentsSubject">, Record<string, "organizationRoles" | "paymentsSubject">, z.core.$ZodTypeInternals<Record<string, "organizationRoles" | "paymentsSubject">, Record<string, "organizationRoles" | "paymentsSubject">>>>>;
|
|
267
274
|
constant: z.ZodOptional<z.ZodEnum<{
|
|
268
275
|
publicOrigin: "publicOrigin";
|
|
269
276
|
}>>;
|
|
@@ -348,13 +355,17 @@ export declare const CapabilityManifest: z.ZodObject<{
|
|
|
348
355
|
documentation: z.ZodURL;
|
|
349
356
|
}, z.core.$strip>], "kind">;
|
|
350
357
|
}, z.core.$strip>>>;
|
|
358
|
+
seams: z.ZodDefault<z.ZodArray<z.ZodEnum<{
|
|
359
|
+
organizationRoles: "organizationRoles";
|
|
360
|
+
paymentsSubject: "paymentsSubject";
|
|
361
|
+
}>>>;
|
|
351
362
|
scaffold: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
352
363
|
configOptions: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
353
364
|
key: z.ZodString;
|
|
354
365
|
default: z.ZodOptional<z.ZodType<ConfigOptionValue, unknown, z.core.$ZodTypeInternals<ConfigOptionValue, unknown>>>;
|
|
355
366
|
choices: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
356
367
|
choicesNeedingCode: z.ZodOptional<z.ZodPipe<z.ZodCustom<Record<string, string>, Record<string, string>>, z.ZodType<Record<string, string>, Record<string, string>, z.core.$ZodTypeInternals<Record<string, string>, Record<string, string>>>>>;
|
|
357
|
-
choicesNeedingSeam: z.ZodOptional<z.ZodPipe<z.ZodCustom<Record<string, "paymentsSubject">, Record<string, "paymentsSubject">>, z.ZodType<Record<string, "paymentsSubject">, Record<string, "paymentsSubject">, z.core.$ZodTypeInternals<Record<string, "paymentsSubject">, Record<string, "paymentsSubject">>>>>;
|
|
368
|
+
choicesNeedingSeam: z.ZodOptional<z.ZodPipe<z.ZodCustom<Record<string, "organizationRoles" | "paymentsSubject">, Record<string, "organizationRoles" | "paymentsSubject">>, z.ZodType<Record<string, "organizationRoles" | "paymentsSubject">, Record<string, "organizationRoles" | "paymentsSubject">, z.core.$ZodTypeInternals<Record<string, "organizationRoles" | "paymentsSubject">, Record<string, "organizationRoles" | "paymentsSubject">>>>>;
|
|
358
369
|
constant: z.ZodOptional<z.ZodEnum<{
|
|
359
370
|
publicOrigin: "publicOrigin";
|
|
360
371
|
}>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manifest.d.ts","sourceRoot":"","sources":["../../src/capability/manifest.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAgDxB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,MAAM,MAAM,iBAAiB,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,iBAAiB,EAAE,GAAG;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,iBA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AC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC"}
|
|
@@ -336,12 +336,20 @@ const ConfigConstant = z.enum(Object.keys(CONFIG_CONSTANTS)).describe("A constan
|
|
|
336
336
|
* One entry today. Every string in it is this package's, because all four of them reach the adopter's
|
|
337
337
|
* repository unquoted: an identifier, a path, an import specifier, a comment.
|
|
338
338
|
*/
|
|
339
|
-
const CONFIG_SEAMS = {
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
339
|
+
const CONFIG_SEAMS = {
|
|
340
|
+
paymentsSubject: {
|
|
341
|
+
binding: "resolveSubject",
|
|
342
|
+
module: "src/billing/subject.ts",
|
|
343
|
+
specifier: "./src/billing/subject",
|
|
344
|
+
describe: "Which organization this caller is acting for. Scaffolded unimplemented — this Worker refuses to boot until src/billing/subject.ts answers it."
|
|
345
|
+
},
|
|
346
|
+
organizationRoles: {
|
|
347
|
+
binding: "roles",
|
|
348
|
+
module: "src/organization/roles.ts",
|
|
349
|
+
specifier: "./src/organization/roles",
|
|
350
|
+
describe: "Who may do what here. Scaffolded with a starter matrix — the role names and the powers they hold are this product's, and only this project's code can state them."
|
|
351
|
+
}
|
|
352
|
+
};
|
|
345
353
|
/** Which scaffolded seam a choice needs, by key. */
|
|
346
354
|
const ConfigSeam = z.enum(Object.keys(CONFIG_SEAMS)).describe("A seam pithy add knows how to scaffold, named from a closed set rather than described.");
|
|
347
355
|
const ConfigOption = z.object({
|
|
@@ -410,6 +418,7 @@ const CapabilityManifest = z.object({
|
|
|
410
418
|
migrationNamespace: z.string().regex(NAMESPACE_PATTERN).optional().describe("Namespace prefix for this capability's migrations — must match the registry's format (e.g. \"auth\")."),
|
|
411
419
|
devSecrets: z.array(DevSecret).default([]).describe("Secrets from this capability's registry whose dev value `pithy add` mints into `.dev.vars`."),
|
|
412
420
|
secrets: z.array(DeclaredSecret).default([]).describe("Every secret from this capability's registry that declares how it comes to exist and how it is replaced. The route `devSecrets` proved: a client reads it without executing the package, so `pithy doctor` says *not set — run this* or *not set — get it here*, and no client keeps its own table of names. A secret declaring neither axis is absent, which reads as *nothing is known*, not as *nothing can help*."),
|
|
421
|
+
seams: z.array(ConfigSeam).default([]).describe("Seams this capability needs **always**, rather than under one choice of one option. `pithy add` writes each module into the Worker, imports it, and passes it to the factory beside the config values — the same machinery `choicesNeedingSeam` drives, without the condition. `organization`'s role catalog is the one: a tenancy capability has no answer to *who may do what* that is not the adopter's, so there is no configuration under which the module is unnecessary and nothing to make it conditional on. Named from `CONFIG_SEAMS`, so nothing a manifest states is written into generated source unquoted (#183)."),
|
|
413
422
|
scaffold: z.array(z.string()).default([]).describe("Human-readable scaffold steps the CLI performs or explains."),
|
|
414
423
|
configOptions: z.array(ConfigOption).default([]).describe("Config options the capability exposes; `pithy add` renders each as `cap({ key: default })`."),
|
|
415
424
|
whenToEnable: z.string().optional().describe("Self-documenting rationale the CLI surfaces when offering this capability.")
|
package/dist/error/http.d.ts
CHANGED
|
@@ -561,6 +561,41 @@ export declare const HttpError: z.ZodCodec<z.ZodUnion<readonly [z.ZodDiscriminat
|
|
|
561
561
|
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
562
562
|
code: z.ZodLiteral<"controlplane/key_conflict">;
|
|
563
563
|
status: z.ZodLiteral<409>;
|
|
564
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
565
|
+
message: z.ZodString;
|
|
566
|
+
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
567
|
+
code: z.ZodLiteral<"organization/not_found">;
|
|
568
|
+
status: z.ZodLiteral<404>;
|
|
569
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
570
|
+
message: z.ZodString;
|
|
571
|
+
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
572
|
+
code: z.ZodLiteral<"organization/forbidden">;
|
|
573
|
+
status: z.ZodLiteral<403>;
|
|
574
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
575
|
+
message: z.ZodString;
|
|
576
|
+
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
577
|
+
code: z.ZodLiteral<"organization/invalid_role_catalog">;
|
|
578
|
+
status: z.ZodLiteral<400>;
|
|
579
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
580
|
+
message: z.ZodString;
|
|
581
|
+
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
582
|
+
code: z.ZodLiteral<"organization/invitation_invalid">;
|
|
583
|
+
status: z.ZodLiteral<400>;
|
|
584
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
585
|
+
message: z.ZodString;
|
|
586
|
+
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
587
|
+
code: z.ZodLiteral<"organization/last_administrator">;
|
|
588
|
+
status: z.ZodLiteral<409>;
|
|
589
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
590
|
+
message: z.ZodString;
|
|
591
|
+
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
592
|
+
code: z.ZodLiteral<"organization/slug_taken">;
|
|
593
|
+
status: z.ZodLiteral<409>;
|
|
594
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
595
|
+
message: z.ZodString;
|
|
596
|
+
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
597
|
+
code: z.ZodLiteral<"organization/nomination_invalid">;
|
|
598
|
+
status: z.ZodLiteral<400>;
|
|
564
599
|
}, z.core.$strip>, z.ZodObject<{
|
|
565
600
|
message: z.ZodString;
|
|
566
601
|
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
@@ -1400,6 +1435,55 @@ export declare const HttpError: z.ZodCodec<z.ZodUnion<readonly [z.ZodDiscriminat
|
|
|
1400
1435
|
detail: z.ZodOptional<z.ZodString>;
|
|
1401
1436
|
code: z.ZodLiteral<"controlplane/key_conflict">;
|
|
1402
1437
|
status: z.ZodLiteral<409>;
|
|
1438
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1439
|
+
message: z.ZodString;
|
|
1440
|
+
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
1441
|
+
action: z.ZodOptional<z.ZodString>;
|
|
1442
|
+
detail: z.ZodOptional<z.ZodString>;
|
|
1443
|
+
code: z.ZodLiteral<"organization/not_found">;
|
|
1444
|
+
status: z.ZodLiteral<404>;
|
|
1445
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1446
|
+
message: z.ZodString;
|
|
1447
|
+
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
1448
|
+
action: z.ZodOptional<z.ZodString>;
|
|
1449
|
+
detail: z.ZodOptional<z.ZodString>;
|
|
1450
|
+
code: z.ZodLiteral<"organization/forbidden">;
|
|
1451
|
+
status: z.ZodLiteral<403>;
|
|
1452
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1453
|
+
message: z.ZodString;
|
|
1454
|
+
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
1455
|
+
action: z.ZodOptional<z.ZodString>;
|
|
1456
|
+
detail: z.ZodOptional<z.ZodString>;
|
|
1457
|
+
code: z.ZodLiteral<"organization/invalid_role_catalog">;
|
|
1458
|
+
status: z.ZodLiteral<400>;
|
|
1459
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1460
|
+
message: z.ZodString;
|
|
1461
|
+
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
1462
|
+
action: z.ZodOptional<z.ZodString>;
|
|
1463
|
+
detail: z.ZodOptional<z.ZodString>;
|
|
1464
|
+
code: z.ZodLiteral<"organization/invitation_invalid">;
|
|
1465
|
+
status: z.ZodLiteral<400>;
|
|
1466
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1467
|
+
message: z.ZodString;
|
|
1468
|
+
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
1469
|
+
action: z.ZodOptional<z.ZodString>;
|
|
1470
|
+
detail: z.ZodOptional<z.ZodString>;
|
|
1471
|
+
code: z.ZodLiteral<"organization/last_administrator">;
|
|
1472
|
+
status: z.ZodLiteral<409>;
|
|
1473
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1474
|
+
message: z.ZodString;
|
|
1475
|
+
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
1476
|
+
action: z.ZodOptional<z.ZodString>;
|
|
1477
|
+
detail: z.ZodOptional<z.ZodString>;
|
|
1478
|
+
code: z.ZodLiteral<"organization/slug_taken">;
|
|
1479
|
+
status: z.ZodLiteral<409>;
|
|
1480
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1481
|
+
message: z.ZodString;
|
|
1482
|
+
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
1483
|
+
action: z.ZodOptional<z.ZodString>;
|
|
1484
|
+
detail: z.ZodOptional<z.ZodString>;
|
|
1485
|
+
code: z.ZodLiteral<"organization/nomination_invalid">;
|
|
1486
|
+
status: z.ZodLiteral<400>;
|
|
1403
1487
|
}, z.core.$strip>, z.ZodObject<{
|
|
1404
1488
|
message: z.ZodString;
|
|
1405
1489
|
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
package/dist/error/http.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../../src/error/http.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAGpC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAA4B,UAAU,EAAmB,MAAM,cAAc,CAAC;AAErF;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,SAAS
|
|
1
|
+
{"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../../src/error/http.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAGpC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAA4B,UAAU,EAAmB,MAAM,cAAc,CAAC;AAErF;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oBA8BpB,CAAC;AAeH;;;;;;;;;;;;GAYG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,KAAK,GAAG,UAAU,CAInD;AAED,gGAAgG;AAChG,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,UAAU,EAAE,CAAC,EAAE,OAAO,GAAG,QAAQ,CAKxE;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,KAAK,EAAE,CAAC,EAAE,OAAO,GAAG,QAAQ,CAElE"}
|
package/dist/error/payload.d.ts
CHANGED
|
@@ -563,6 +563,41 @@ export declare const KitPublicErrorPayload: z.ZodDiscriminatedUnion<[z.ZodObject
|
|
|
563
563
|
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
564
564
|
code: z.ZodLiteral<"controlplane/key_conflict">;
|
|
565
565
|
status: z.ZodLiteral<409>;
|
|
566
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
567
|
+
message: z.ZodString;
|
|
568
|
+
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
569
|
+
code: z.ZodLiteral<"organization/not_found">;
|
|
570
|
+
status: z.ZodLiteral<404>;
|
|
571
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
572
|
+
message: z.ZodString;
|
|
573
|
+
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
574
|
+
code: z.ZodLiteral<"organization/forbidden">;
|
|
575
|
+
status: z.ZodLiteral<403>;
|
|
576
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
577
|
+
message: z.ZodString;
|
|
578
|
+
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
579
|
+
code: z.ZodLiteral<"organization/invalid_role_catalog">;
|
|
580
|
+
status: z.ZodLiteral<400>;
|
|
581
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
582
|
+
message: z.ZodString;
|
|
583
|
+
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
584
|
+
code: z.ZodLiteral<"organization/invitation_invalid">;
|
|
585
|
+
status: z.ZodLiteral<400>;
|
|
586
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
587
|
+
message: z.ZodString;
|
|
588
|
+
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
589
|
+
code: z.ZodLiteral<"organization/last_administrator">;
|
|
590
|
+
status: z.ZodLiteral<409>;
|
|
591
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
592
|
+
message: z.ZodString;
|
|
593
|
+
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
594
|
+
code: z.ZodLiteral<"organization/slug_taken">;
|
|
595
|
+
status: z.ZodLiteral<409>;
|
|
596
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
597
|
+
message: z.ZodString;
|
|
598
|
+
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
599
|
+
code: z.ZodLiteral<"organization/nomination_invalid">;
|
|
600
|
+
status: z.ZodLiteral<400>;
|
|
566
601
|
}, z.core.$strip>, z.ZodObject<{
|
|
567
602
|
message: z.ZodString;
|
|
568
603
|
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
@@ -1403,6 +1438,55 @@ export declare const KitErrorPayload: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
1403
1438
|
detail: z.ZodOptional<z.ZodString>;
|
|
1404
1439
|
code: z.ZodLiteral<"controlplane/key_conflict">;
|
|
1405
1440
|
status: z.ZodLiteral<409>;
|
|
1441
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1442
|
+
message: z.ZodString;
|
|
1443
|
+
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
1444
|
+
action: z.ZodOptional<z.ZodString>;
|
|
1445
|
+
detail: z.ZodOptional<z.ZodString>;
|
|
1446
|
+
code: z.ZodLiteral<"organization/not_found">;
|
|
1447
|
+
status: z.ZodLiteral<404>;
|
|
1448
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1449
|
+
message: z.ZodString;
|
|
1450
|
+
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
1451
|
+
action: z.ZodOptional<z.ZodString>;
|
|
1452
|
+
detail: z.ZodOptional<z.ZodString>;
|
|
1453
|
+
code: z.ZodLiteral<"organization/forbidden">;
|
|
1454
|
+
status: z.ZodLiteral<403>;
|
|
1455
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1456
|
+
message: z.ZodString;
|
|
1457
|
+
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
1458
|
+
action: z.ZodOptional<z.ZodString>;
|
|
1459
|
+
detail: z.ZodOptional<z.ZodString>;
|
|
1460
|
+
code: z.ZodLiteral<"organization/invalid_role_catalog">;
|
|
1461
|
+
status: z.ZodLiteral<400>;
|
|
1462
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1463
|
+
message: z.ZodString;
|
|
1464
|
+
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
1465
|
+
action: z.ZodOptional<z.ZodString>;
|
|
1466
|
+
detail: z.ZodOptional<z.ZodString>;
|
|
1467
|
+
code: z.ZodLiteral<"organization/invitation_invalid">;
|
|
1468
|
+
status: z.ZodLiteral<400>;
|
|
1469
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1470
|
+
message: z.ZodString;
|
|
1471
|
+
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
1472
|
+
action: z.ZodOptional<z.ZodString>;
|
|
1473
|
+
detail: z.ZodOptional<z.ZodString>;
|
|
1474
|
+
code: z.ZodLiteral<"organization/last_administrator">;
|
|
1475
|
+
status: z.ZodLiteral<409>;
|
|
1476
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1477
|
+
message: z.ZodString;
|
|
1478
|
+
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
1479
|
+
action: z.ZodOptional<z.ZodString>;
|
|
1480
|
+
detail: z.ZodOptional<z.ZodString>;
|
|
1481
|
+
code: z.ZodLiteral<"organization/slug_taken">;
|
|
1482
|
+
status: z.ZodLiteral<409>;
|
|
1483
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1484
|
+
message: z.ZodString;
|
|
1485
|
+
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
1486
|
+
action: z.ZodOptional<z.ZodString>;
|
|
1487
|
+
detail: z.ZodOptional<z.ZodString>;
|
|
1488
|
+
code: z.ZodLiteral<"organization/nomination_invalid">;
|
|
1489
|
+
status: z.ZodLiteral<400>;
|
|
1406
1490
|
}, z.core.$strip>, z.ZodObject<{
|
|
1407
1491
|
message: z.ZodString;
|
|
1408
1492
|
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
@@ -2078,6 +2162,41 @@ export declare const PublicErrorPayload: z.ZodUnion<readonly [z.ZodDiscriminated
|
|
|
2078
2162
|
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
2079
2163
|
code: z.ZodLiteral<"controlplane/key_conflict">;
|
|
2080
2164
|
status: z.ZodLiteral<409>;
|
|
2165
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
2166
|
+
message: z.ZodString;
|
|
2167
|
+
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
2168
|
+
code: z.ZodLiteral<"organization/not_found">;
|
|
2169
|
+
status: z.ZodLiteral<404>;
|
|
2170
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
2171
|
+
message: z.ZodString;
|
|
2172
|
+
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
2173
|
+
code: z.ZodLiteral<"organization/forbidden">;
|
|
2174
|
+
status: z.ZodLiteral<403>;
|
|
2175
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
2176
|
+
message: z.ZodString;
|
|
2177
|
+
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
2178
|
+
code: z.ZodLiteral<"organization/invalid_role_catalog">;
|
|
2179
|
+
status: z.ZodLiteral<400>;
|
|
2180
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
2181
|
+
message: z.ZodString;
|
|
2182
|
+
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
2183
|
+
code: z.ZodLiteral<"organization/invitation_invalid">;
|
|
2184
|
+
status: z.ZodLiteral<400>;
|
|
2185
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
2186
|
+
message: z.ZodString;
|
|
2187
|
+
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
2188
|
+
code: z.ZodLiteral<"organization/last_administrator">;
|
|
2189
|
+
status: z.ZodLiteral<409>;
|
|
2190
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
2191
|
+
message: z.ZodString;
|
|
2192
|
+
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
2193
|
+
code: z.ZodLiteral<"organization/slug_taken">;
|
|
2194
|
+
status: z.ZodLiteral<409>;
|
|
2195
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
2196
|
+
message: z.ZodString;
|
|
2197
|
+
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
2198
|
+
code: z.ZodLiteral<"organization/nomination_invalid">;
|
|
2199
|
+
status: z.ZodLiteral<400>;
|
|
2081
2200
|
}, z.core.$strip>, z.ZodObject<{
|
|
2082
2201
|
message: z.ZodString;
|
|
2083
2202
|
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
@@ -2934,6 +3053,55 @@ export declare const ErrorPayload: z.ZodUnion<readonly [z.ZodDiscriminatedUnion<
|
|
|
2934
3053
|
detail: z.ZodOptional<z.ZodString>;
|
|
2935
3054
|
code: z.ZodLiteral<"controlplane/key_conflict">;
|
|
2936
3055
|
status: z.ZodLiteral<409>;
|
|
3056
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
3057
|
+
message: z.ZodString;
|
|
3058
|
+
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
3059
|
+
action: z.ZodOptional<z.ZodString>;
|
|
3060
|
+
detail: z.ZodOptional<z.ZodString>;
|
|
3061
|
+
code: z.ZodLiteral<"organization/not_found">;
|
|
3062
|
+
status: z.ZodLiteral<404>;
|
|
3063
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
3064
|
+
message: z.ZodString;
|
|
3065
|
+
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
3066
|
+
action: z.ZodOptional<z.ZodString>;
|
|
3067
|
+
detail: z.ZodOptional<z.ZodString>;
|
|
3068
|
+
code: z.ZodLiteral<"organization/forbidden">;
|
|
3069
|
+
status: z.ZodLiteral<403>;
|
|
3070
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
3071
|
+
message: z.ZodString;
|
|
3072
|
+
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
3073
|
+
action: z.ZodOptional<z.ZodString>;
|
|
3074
|
+
detail: z.ZodOptional<z.ZodString>;
|
|
3075
|
+
code: z.ZodLiteral<"organization/invalid_role_catalog">;
|
|
3076
|
+
status: z.ZodLiteral<400>;
|
|
3077
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
3078
|
+
message: z.ZodString;
|
|
3079
|
+
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
3080
|
+
action: z.ZodOptional<z.ZodString>;
|
|
3081
|
+
detail: z.ZodOptional<z.ZodString>;
|
|
3082
|
+
code: z.ZodLiteral<"organization/invitation_invalid">;
|
|
3083
|
+
status: z.ZodLiteral<400>;
|
|
3084
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
3085
|
+
message: z.ZodString;
|
|
3086
|
+
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
3087
|
+
action: z.ZodOptional<z.ZodString>;
|
|
3088
|
+
detail: z.ZodOptional<z.ZodString>;
|
|
3089
|
+
code: z.ZodLiteral<"organization/last_administrator">;
|
|
3090
|
+
status: z.ZodLiteral<409>;
|
|
3091
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
3092
|
+
message: z.ZodString;
|
|
3093
|
+
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
3094
|
+
action: z.ZodOptional<z.ZodString>;
|
|
3095
|
+
detail: z.ZodOptional<z.ZodString>;
|
|
3096
|
+
code: z.ZodLiteral<"organization/slug_taken">;
|
|
3097
|
+
status: z.ZodLiteral<409>;
|
|
3098
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
3099
|
+
message: z.ZodString;
|
|
3100
|
+
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
3101
|
+
action: z.ZodOptional<z.ZodString>;
|
|
3102
|
+
detail: z.ZodOptional<z.ZodString>;
|
|
3103
|
+
code: z.ZodLiteral<"organization/nomination_invalid">;
|
|
3104
|
+
status: z.ZodLiteral<400>;
|
|
2937
3105
|
}, z.core.$strip>, z.ZodObject<{
|
|
2938
3106
|
message: z.ZodString;
|
|
2939
3107
|
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"payload.d.ts","sourceRoot":"","sources":["../../src/error/payload.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB;;;;;;;;GAQG;AAEH,uFAAuF;AACvF,eAAO,MAAM,eAAe;;;;iBAQqD,CAAC;AAClF,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"payload.d.ts","sourceRoot":"","sources":["../../src/error/payload.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB;;;;;;;;GAQG;AAEH,uFAAuF;AACvF,eAAO,MAAM,eAAe;;;;iBAQqD,CAAC;AAClF,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAk/C9D;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mBAItB,CAAC;AACJ,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;AAExD,mGAAmG;AACnG,MAAM,MAAM,SAAS,GAAG,YAAY,CAAC,MAAM,CAAC,CAAC"}
|
package/dist/error/payload.js
CHANGED
|
@@ -590,6 +590,41 @@ const ControlPlaneKeyConflictPublic = z.object({
|
|
|
590
590
|
status: z.literal(409).describe("Conflict."),
|
|
591
591
|
...publicFields
|
|
592
592
|
}).describe("A key operation conflicts with the connection's current state (409).");
|
|
593
|
+
const OrganizationNotFoundPublic = z.object({
|
|
594
|
+
code: z.literal("organization/not_found").describe("The named organization does not exist, **or** the caller is not a member of it. One code for two facts, deliberately: a distinguishable refusal is an existence oracle, and iterating it produces the customer list. Which of the two it was survives in `detail`, which the HTTP codec strips and the log keeps."),
|
|
595
|
+
status: z.literal(404).describe("Not Found."),
|
|
596
|
+
...publicFields
|
|
597
|
+
}).describe("No such organization, or none this caller belongs to — the same answer for both (404).");
|
|
598
|
+
const OrganizationForbiddenPublic = z.object({
|
|
599
|
+
code: z.literal("organization/forbidden").describe("The caller is a proved member whose role does not hold the power the route asked for. A 403 rather than the 404 above, and the difference is earned: by the time this is raised they already know the organization exists, because they belong to it."),
|
|
600
|
+
status: z.literal(403).describe("Forbidden — a member, but not one who may do this."),
|
|
601
|
+
...publicFields
|
|
602
|
+
}).describe("A member's role does not hold the required power (403).");
|
|
603
|
+
const OrganizationInvalidRoleCatalogPublic = z.object({
|
|
604
|
+
code: z.literal("organization/invalid_role_catalog").describe("A role catalog failed validation. Raised by `defineRoles` at author time — a redeclared kit power, an `administrativePower` nobody holds, a kit power no role holds, or a claimed nesting that does not hold — so a mistake fails where the catalog is written rather than the first time somebody is refused by it."),
|
|
605
|
+
status: z.literal(400).describe("Bad Request — the catalog declaration is malformed."),
|
|
606
|
+
...publicFields
|
|
607
|
+
}).describe("A role catalog declaration is invalid (400).");
|
|
608
|
+
const OrganizationInvitationInvalidPublic = z.object({
|
|
609
|
+
code: z.literal("organization/invitation_invalid").describe("An invitation cannot be redeemed: no such token, already used, withdrawn, past its date, or presented by a session whose own address is not the one invited. One code for all five, because telling somebody which it was tells whoever forwarded the link the same thing."),
|
|
610
|
+
status: z.literal(400).describe("Bad Request — the offer is not redeemable by this caller."),
|
|
611
|
+
...publicFields
|
|
612
|
+
}).describe("An invitation is not redeemable (400).");
|
|
613
|
+
const OrganizationLastAdministratorPublic = z.object({
|
|
614
|
+
code: z.literal("organization/last_administrator").describe("The write would leave the account with nobody holding `administrativePower`. Counted over the power rather than over a role spelled `admin`, so a catalog where an owner also administers does not become unadministrable when its one admin leaves."),
|
|
615
|
+
status: z.literal(409).describe("Conflict — an account nobody can administer is not a state to arrive at."),
|
|
616
|
+
...publicFields
|
|
617
|
+
}).describe("The last administrator cannot be demoted, removed, or leave (409).");
|
|
618
|
+
const OrganizationSlugTakenPublic = z.object({
|
|
619
|
+
code: z.literal("organization/slug_taken").describe("Another organization already holds that slug. A slug addresses one account, so it is unique."),
|
|
620
|
+
status: z.literal(409).describe("Conflict."),
|
|
621
|
+
...publicFields
|
|
622
|
+
}).describe("That slug is already in use (409).");
|
|
623
|
+
const OrganizationNominationInvalidPublic = z.object({
|
|
624
|
+
code: z.literal("organization/nomination_invalid").describe("An ownership offer cannot be accepted: none stands, it was replaced, it has expired, or it was made to somebody else. Ownership moves only by offer and acceptance, so a refusal here is the transfer declining to happen rather than a permission being short."),
|
|
625
|
+
status: z.literal(400).describe("Bad Request — no offer this caller may accept."),
|
|
626
|
+
...publicFields
|
|
627
|
+
}).describe("No standing ownership offer this caller may accept (400).");
|
|
593
628
|
const SupportNotFoundPublic = z.object({
|
|
594
629
|
code: z.literal("support/not_found").describe("A requested support thread, message, or attachment does not exist."),
|
|
595
630
|
status: z.literal(404).describe("Not Found."),
|
|
@@ -784,6 +819,13 @@ const KitPublicErrorPayload = z.discriminatedUnion("code", [
|
|
|
784
819
|
ControlPlaneInsufficientScopePublic,
|
|
785
820
|
ControlPlaneKeyNotFoundPublic,
|
|
786
821
|
ControlPlaneKeyConflictPublic,
|
|
822
|
+
OrganizationNotFoundPublic,
|
|
823
|
+
OrganizationForbiddenPublic,
|
|
824
|
+
OrganizationInvalidRoleCatalogPublic,
|
|
825
|
+
OrganizationInvitationInvalidPublic,
|
|
826
|
+
OrganizationLastAdministratorPublic,
|
|
827
|
+
OrganizationSlugTakenPublic,
|
|
828
|
+
OrganizationNominationInvalidPublic,
|
|
787
829
|
SupportNotFoundPublic,
|
|
788
830
|
SupportInvalidCategoryPublic,
|
|
789
831
|
SupportUnparseableMessagePublic,
|
|
@@ -918,6 +960,13 @@ const TestersAlreadyOnRoster = TestersAlreadyOnRosterPublic.extend(internalField
|
|
|
918
960
|
const TestersNudgeCooldown = TestersNudgeCooldownPublic.extend(internalFields).describe(TestersNudgeCooldownPublic.description ?? "");
|
|
919
961
|
const TestersCopyNotAllowed = TestersCopyNotAllowedPublic.extend(internalFields).describe(TestersCopyNotAllowedPublic.description ?? "");
|
|
920
962
|
const TestersNotConfigured = TestersNotConfiguredPublic.extend(internalFields).describe(TestersNotConfiguredPublic.description ?? "");
|
|
963
|
+
const OrganizationNotFound = OrganizationNotFoundPublic.extend(internalFields).describe(OrganizationNotFoundPublic.description ?? "");
|
|
964
|
+
const OrganizationForbidden = OrganizationForbiddenPublic.extend(internalFields).describe(OrganizationForbiddenPublic.description ?? "");
|
|
965
|
+
const OrganizationInvalidRoleCatalog = OrganizationInvalidRoleCatalogPublic.extend(internalFields).describe(OrganizationInvalidRoleCatalogPublic.description ?? "");
|
|
966
|
+
const OrganizationInvitationInvalid = OrganizationInvitationInvalidPublic.extend(internalFields).describe(OrganizationInvitationInvalidPublic.description ?? "");
|
|
967
|
+
const OrganizationLastAdministrator = OrganizationLastAdministratorPublic.extend(internalFields).describe(OrganizationLastAdministratorPublic.description ?? "");
|
|
968
|
+
const OrganizationSlugTaken = OrganizationSlugTakenPublic.extend(internalFields).describe(OrganizationSlugTakenPublic.description ?? "");
|
|
969
|
+
const OrganizationNominationInvalid = OrganizationNominationInvalidPublic.extend(internalFields).describe(OrganizationNominationInvalidPublic.description ?? "");
|
|
921
970
|
const SupportNotFound = SupportNotFoundPublic.extend(internalFields).describe(SupportNotFoundPublic.description ?? "");
|
|
922
971
|
const SupportInvalidCategory = SupportInvalidCategoryPublic.extend(internalFields).describe(SupportInvalidCategoryPublic.description ?? "");
|
|
923
972
|
const SupportUnparseableMessage = SupportUnparseableMessagePublic.extend(internalFields).describe(SupportUnparseableMessagePublic.description ?? "");
|
|
@@ -1037,6 +1086,13 @@ const KitErrorPayload = z.discriminatedUnion("code", [
|
|
|
1037
1086
|
ControlPlaneInsufficientScope,
|
|
1038
1087
|
ControlPlaneKeyNotFound,
|
|
1039
1088
|
ControlPlaneKeyConflict,
|
|
1089
|
+
OrganizationNotFound,
|
|
1090
|
+
OrganizationForbidden,
|
|
1091
|
+
OrganizationInvalidRoleCatalog,
|
|
1092
|
+
OrganizationInvitationInvalid,
|
|
1093
|
+
OrganizationLastAdministrator,
|
|
1094
|
+
OrganizationSlugTaken,
|
|
1095
|
+
OrganizationNominationInvalid,
|
|
1040
1096
|
SupportNotFound,
|
|
1041
1097
|
SupportInvalidCategory,
|
|
1042
1098
|
SupportUnparseableMessage,
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
// SPDX-FileCopyrightText: 2026 Pithy
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
import { z } from "zod";
|
|
4
|
+
/**
|
|
5
|
+
* What may be stored as an image, and how it is served — stated once, for every capability that holds
|
|
6
|
+
* a small picture in a column.
|
|
7
|
+
*
|
|
8
|
+
* Two capabilities hold one: `@pithy-sh/auth` keeps a person's face, `@pithy-sh/organization` keeps an
|
|
9
|
+
* account's mark. They are the same object at different scales, and **two answers to *what may be
|
|
10
|
+
* stored as an image* is one of them being wrong.** So the allowlist, the ceiling, the derived byte
|
|
11
|
+
* figure and the serving split live here and are imported, exactly as `normalizeAddress` moved here in
|
|
12
|
+
* `#280`.
|
|
13
|
+
*
|
|
14
|
+
* ## Stored, not linked
|
|
15
|
+
*
|
|
16
|
+
* A remote URL means the page fetching an attacker-chosen host from a screen listing people, leaking
|
|
17
|
+
* the viewer's IP and referrer before they had done anything, and it needs a CSP hole to render at all.
|
|
18
|
+
* A bounded `data:` URL in a column has no third party in it.
|
|
19
|
+
*
|
|
20
|
+
* ## Rendered through `<img>`, never inlined
|
|
21
|
+
*
|
|
22
|
+
* A browser disables scripting inside an `<img>` by specification, and that is the entire basis for
|
|
23
|
+
* accepting SVG here at all. Nothing in the kit writes one of these values into a document.
|
|
24
|
+
*
|
|
25
|
+
* ## Rasters get a URL, vectors never do — and that is the security answer, not a mitigation
|
|
26
|
+
*
|
|
27
|
+
* A `data:` URL has one property it cannot have: **it cannot be cached.** It is inline in the response
|
|
28
|
+
* body, so a roster of twenty faces re-sends twenty images on every read, forever. Serving from the
|
|
29
|
+
* app's own origin fixes that and costs one real hazard — **an SVG fetched by *navigation* runs script
|
|
30
|
+
* in the origin that served it.** An `<img src>` is inert; a URL is navigable.
|
|
31
|
+
*
|
|
32
|
+
* So a vector never gets a URL. {@link storedImageBytes} answers null for one, the serving route 404s
|
|
33
|
+
* on null, and there is no arrangement of ids and versions that makes the origin return an SVG. The
|
|
34
|
+
* class of attack is removed rather than managed with headers, and there is no header anybody has to
|
|
35
|
+
* keep right.
|
|
36
|
+
*/
|
|
37
|
+
/**
|
|
38
|
+
* The image types a stored picture may be.
|
|
39
|
+
*
|
|
40
|
+
* Three rasters and one vector. The vector is here because `<img>` renders it inertly and a mark drawn
|
|
41
|
+
* as one is a few hundred bytes; every rule below that treats it differently is treating *navigability*
|
|
42
|
+
* differently, not the format.
|
|
43
|
+
*/
|
|
44
|
+
export declare const STORED_IMAGE_TYPES: readonly ["image/png", "image/jpeg", "image/webp", "image/svg+xml"];
|
|
45
|
+
/** One of {@link STORED_IMAGE_TYPES}. */
|
|
46
|
+
export type StoredImageType = (typeof STORED_IMAGE_TYPES)[number];
|
|
47
|
+
/**
|
|
48
|
+
* The types that stay inline whatever else happens.
|
|
49
|
+
*
|
|
50
|
+
* One entry, and the module note argues it at length. Written as a list rather than as a comparison so
|
|
51
|
+
* that a second scriptable format added to {@link STORED_IMAGE_TYPES} one day is added here too, next
|
|
52
|
+
* to the reason.
|
|
53
|
+
*/
|
|
54
|
+
export declare const INLINE_IMAGE_TYPES: readonly string[];
|
|
55
|
+
/**
|
|
56
|
+
* The ceiling on a stored image, in characters of `data:` URL.
|
|
57
|
+
*
|
|
58
|
+
* 32KB of base64, which is about 24KB of image. A face drawn at 34px does not need more, and the
|
|
59
|
+
* ceiling is what stops one row making every read expensive: the record, the account menu and the
|
|
60
|
+
* chooser all carry it.
|
|
61
|
+
*/
|
|
62
|
+
export declare const MAX_STORED_IMAGE_CHARS: number;
|
|
63
|
+
/**
|
|
64
|
+
* The longest `data:<type>;base64,` a stored image can begin with, in characters.
|
|
65
|
+
*
|
|
66
|
+
* Derived from the allowlist rather than written down, so a longer type name added above cannot leave a
|
|
67
|
+
* ceiling below it stale. `image/svg+xml` is the long one today, at 26 characters.
|
|
68
|
+
*/
|
|
69
|
+
export declare const LONGEST_STORED_IMAGE_PREFIX: number;
|
|
70
|
+
/**
|
|
71
|
+
* The largest file a browser may encode into that ceiling, in bytes of image.
|
|
72
|
+
*
|
|
73
|
+
* **Not `MAX_STORED_IMAGE_CHARS * 3 / 4`, and the difference is a bug that shipped once.** That is the
|
|
74
|
+
* base64 inverse, and it silently assumes the stored string is base64 and nothing else. It is not: it
|
|
75
|
+
* is `data:<type>;base64,` and *then* the base64. A file at the plain inverse encodes to 22–26
|
|
76
|
+
* characters more than the column will take, so it passes a picker's own check and is refused by Zod —
|
|
77
|
+
* the person gets a validator's sentence where the product had written them one of its own.
|
|
78
|
+
*
|
|
79
|
+
* Base64 is four characters per three bytes and rounds up to a whole group, so the arithmetic runs
|
|
80
|
+
* backwards from the characters left after the prefix: `floor((chars - prefix) / 4)` groups, three
|
|
81
|
+
* bytes each. Derived from the *longest* prefix, because one ceiling has to hold for every type a
|
|
82
|
+
* picker offers and the tightest constraint is the one that binds.
|
|
83
|
+
*
|
|
84
|
+
* **This is the figure a client-side picker checks a file against before encoding it.** The column
|
|
85
|
+
* enforces {@link MAX_STORED_IMAGE_CHARS} on the whole string, which is the bound that matters; this is
|
|
86
|
+
* the same fact stated as bytes of image, so a picker and a column cannot disagree.
|
|
87
|
+
*/
|
|
88
|
+
export declare const MAX_STORED_IMAGE_BYTES: number;
|
|
89
|
+
/**
|
|
90
|
+
* A stored image, validated at the column and therefore at every boundary that decodes a row.
|
|
91
|
+
*
|
|
92
|
+
* **The pattern is an allowlist of types, not a check that the string starts with `data:`.**
|
|
93
|
+
* `data:text/html` is a `data:` URL too, and the difference between the two is the whole of what makes
|
|
94
|
+
* this column safe to render. Anchored at both ends, so nothing follows the payload.
|
|
95
|
+
*/
|
|
96
|
+
export declare const StoredImage: z.ZodString;
|
|
97
|
+
export type StoredImage = z.output<typeof StoredImage>;
|
|
98
|
+
/** The type a stored image declares, or null when it is not a value this rule accepts. */
|
|
99
|
+
export declare function typeOfStoredImage(stored: string): StoredImageType | null;
|
|
100
|
+
/**
|
|
101
|
+
* What a screen should draw this image from.
|
|
102
|
+
*
|
|
103
|
+
* A URL for a raster, the stored value itself for a vector, and null for nothing. The caller renders
|
|
104
|
+
* whichever it gets through the same `<img src>`, so no screen has to know which it was handed.
|
|
105
|
+
*
|
|
106
|
+
* `path` is the route the owning capability serves bytes from, already carrying whatever identifies the
|
|
107
|
+
* subject — this function appends only the version, because the version is the half that has to be
|
|
108
|
+
* right for `immutable` to be honest.
|
|
109
|
+
*
|
|
110
|
+
* The version is the owning row's `updatedAt`: the URL changes whenever the image can have changed, so
|
|
111
|
+
* the response may be `immutable` and a browser never revalidates. It over-invalidates slightly — a
|
|
112
|
+
* rename busts a picture that did not change — which is one wasted fetch on a rare action, against a
|
|
113
|
+
* hash column and a migration to carry it.
|
|
114
|
+
*/
|
|
115
|
+
export declare function storedImageSource(stored: string | null, path: string, version: Date | number): string | null;
|
|
116
|
+
/** A stored image decoded into what a response body needs. */
|
|
117
|
+
export interface StoredImageBytes {
|
|
118
|
+
/** The `Content-Type` to serve it as. Always one of {@link STORED_IMAGE_TYPES}, never sniffed. */
|
|
119
|
+
readonly type: StoredImageType;
|
|
120
|
+
/** The image itself. */
|
|
121
|
+
readonly body: Uint8Array;
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Decode a stored image for serving, or null when it must not be served.
|
|
125
|
+
*
|
|
126
|
+
* **Null for a vector, and that is the gate rather than a caution.** The route asks this and answers
|
|
127
|
+
* 404 when it gets null, so there is no arrangement of ids and versions that makes the origin return an
|
|
128
|
+
* SVG. The module note gives the reason.
|
|
129
|
+
*
|
|
130
|
+
* Null too for anything the allowlist does not match, which the column should have refused on the way
|
|
131
|
+
* in — this is the second place that is true, and a value that reached the column past a bug does not
|
|
132
|
+
* get served out of it.
|
|
133
|
+
*/
|
|
134
|
+
export declare function storedImageBytes(stored: string | null): StoredImageBytes | null;
|
|
135
|
+
/**
|
|
136
|
+
* The headers a served image carries.
|
|
137
|
+
*
|
|
138
|
+
* **`immutable`, which is only honest because the URL carries a version.** {@link storedImageSource}
|
|
139
|
+
* puts the owning row's `updatedAt` in the query, so a changed image is a different URL and a browser
|
|
140
|
+
* that never revalidates can never show a stale one.
|
|
141
|
+
*
|
|
142
|
+
* **`private`, because the fetch is authorized against a session.** A shared cache holding this would
|
|
143
|
+
* be one person's face served to whoever asked next.
|
|
144
|
+
*
|
|
145
|
+
* **`nosniff`, because the type is the allowlist's and must not be re-guessed.** Content sniffing is
|
|
146
|
+
* how a file served as an image gets treated as something else, and the whole safety of this route is
|
|
147
|
+
* that the type is one of three rasters.
|
|
148
|
+
*/
|
|
149
|
+
export declare const STORED_IMAGE_HEADERS: Readonly<Record<string, string>>;
|
|
150
|
+
//# sourceMappingURL=storedImage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"storedImage.d.ts","sourceRoot":"","sources":["../../src/image/storedImage.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAEH;;;;;;GAMG;AACH,eAAO,MAAM,kBAAkB,YAAI,WAAW,EAAE,YAAY,EAAE,YAAY,EAAE,eAAe,CAAU,CAAC;AAEtG,yCAAyC;AACzC,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,kBAAkB,CAAC,CAAC,MAAM,CAAC,CAAC;AAElE;;;;;;GAMG;AACH,eAAO,MAAM,kBAAkB,EAAE,SAAS,MAAM,EAAsB,CAAC;AAEvE;;;;;;GAMG;AACH,eAAO,MAAM,sBAAsB,QAAY,CAAC;AAEhD;;;;;GAKG;AACH,eAAO,MAAM,2BAA2B,QAA+E,CAAC;AAExH;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,sBAAsB,QAA6E,CAAC;AAOjH;;;;;;GAMG;AACH,eAAO,MAAM,WAAW,aAMrB,CAAC;AACJ,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,WAAW,CAAC,CAAC;AAOvD,0FAA0F;AAC1F,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,eAAe,GAAG,IAAI,CAExE;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,GAAG,MAAM,GAAG,MAAM,GAAG,IAAI,CAU5G;AAED,8DAA8D;AAC9D,MAAM,WAAW,gBAAgB;IAC/B,kGAAkG;IAClG,QAAQ,CAAC,IAAI,EAAE,eAAe,CAAC;IAC/B,wBAAwB;IACxB,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;CAC3B;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,gBAAgB,GAAG,IAAI,CAe/E;AAED;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,oBAAoB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAGjE,CAAC"}
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
// SPDX-FileCopyrightText: 2026 Pithy
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
import { z } from "zod";
|
|
4
|
+
//#region src/image/storedImage.ts
|
|
5
|
+
/**
|
|
6
|
+
* What may be stored as an image, and how it is served — stated once, for every capability that holds
|
|
7
|
+
* a small picture in a column.
|
|
8
|
+
*
|
|
9
|
+
* Two capabilities hold one: `@pithy-sh/auth` keeps a person's face, `@pithy-sh/organization` keeps an
|
|
10
|
+
* account's mark. They are the same object at different scales, and **two answers to *what may be
|
|
11
|
+
* stored as an image* is one of them being wrong.** So the allowlist, the ceiling, the derived byte
|
|
12
|
+
* figure and the serving split live here and are imported, exactly as `normalizeAddress` moved here in
|
|
13
|
+
* `#280`.
|
|
14
|
+
*
|
|
15
|
+
* ## Stored, not linked
|
|
16
|
+
*
|
|
17
|
+
* A remote URL means the page fetching an attacker-chosen host from a screen listing people, leaking
|
|
18
|
+
* the viewer's IP and referrer before they had done anything, and it needs a CSP hole to render at all.
|
|
19
|
+
* A bounded `data:` URL in a column has no third party in it.
|
|
20
|
+
*
|
|
21
|
+
* ## Rendered through `<img>`, never inlined
|
|
22
|
+
*
|
|
23
|
+
* A browser disables scripting inside an `<img>` by specification, and that is the entire basis for
|
|
24
|
+
* accepting SVG here at all. Nothing in the kit writes one of these values into a document.
|
|
25
|
+
*
|
|
26
|
+
* ## Rasters get a URL, vectors never do — and that is the security answer, not a mitigation
|
|
27
|
+
*
|
|
28
|
+
* A `data:` URL has one property it cannot have: **it cannot be cached.** It is inline in the response
|
|
29
|
+
* body, so a roster of twenty faces re-sends twenty images on every read, forever. Serving from the
|
|
30
|
+
* app's own origin fixes that and costs one real hazard — **an SVG fetched by *navigation* runs script
|
|
31
|
+
* in the origin that served it.** An `<img src>` is inert; a URL is navigable.
|
|
32
|
+
*
|
|
33
|
+
* So a vector never gets a URL. {@link storedImageBytes} answers null for one, the serving route 404s
|
|
34
|
+
* on null, and there is no arrangement of ids and versions that makes the origin return an SVG. The
|
|
35
|
+
* class of attack is removed rather than managed with headers, and there is no header anybody has to
|
|
36
|
+
* keep right.
|
|
37
|
+
*/
|
|
38
|
+
/**
|
|
39
|
+
* The image types a stored picture may be.
|
|
40
|
+
*
|
|
41
|
+
* Three rasters and one vector. The vector is here because `<img>` renders it inertly and a mark drawn
|
|
42
|
+
* as one is a few hundred bytes; every rule below that treats it differently is treating *navigability*
|
|
43
|
+
* differently, not the format.
|
|
44
|
+
*/
|
|
45
|
+
const STORED_IMAGE_TYPES = [
|
|
46
|
+
"image/png",
|
|
47
|
+
"image/jpeg",
|
|
48
|
+
"image/webp",
|
|
49
|
+
"image/svg+xml"
|
|
50
|
+
];
|
|
51
|
+
/**
|
|
52
|
+
* The types that stay inline whatever else happens.
|
|
53
|
+
*
|
|
54
|
+
* One entry, and the module note argues it at length. Written as a list rather than as a comparison so
|
|
55
|
+
* that a second scriptable format added to {@link STORED_IMAGE_TYPES} one day is added here too, next
|
|
56
|
+
* to the reason.
|
|
57
|
+
*/
|
|
58
|
+
const INLINE_IMAGE_TYPES = ["image/svg+xml"];
|
|
59
|
+
/**
|
|
60
|
+
* The ceiling on a stored image, in characters of `data:` URL.
|
|
61
|
+
*
|
|
62
|
+
* 32KB of base64, which is about 24KB of image. A face drawn at 34px does not need more, and the
|
|
63
|
+
* ceiling is what stops one row making every read expensive: the record, the account menu and the
|
|
64
|
+
* chooser all carry it.
|
|
65
|
+
*/
|
|
66
|
+
const MAX_STORED_IMAGE_CHARS = 32768;
|
|
67
|
+
/**
|
|
68
|
+
* The longest `data:<type>;base64,` a stored image can begin with, in characters.
|
|
69
|
+
*
|
|
70
|
+
* Derived from the allowlist rather than written down, so a longer type name added above cannot leave a
|
|
71
|
+
* ceiling below it stale. `image/svg+xml` is the long one today, at 26 characters.
|
|
72
|
+
*/
|
|
73
|
+
const LONGEST_STORED_IMAGE_PREFIX = Math.max(...STORED_IMAGE_TYPES.map((type) => `data:${type};base64,`.length));
|
|
74
|
+
/**
|
|
75
|
+
* The largest file a browser may encode into that ceiling, in bytes of image.
|
|
76
|
+
*
|
|
77
|
+
* **Not `MAX_STORED_IMAGE_CHARS * 3 / 4`, and the difference is a bug that shipped once.** That is the
|
|
78
|
+
* base64 inverse, and it silently assumes the stored string is base64 and nothing else. It is not: it
|
|
79
|
+
* is `data:<type>;base64,` and *then* the base64. A file at the plain inverse encodes to 22–26
|
|
80
|
+
* characters more than the column will take, so it passes a picker's own check and is refused by Zod —
|
|
81
|
+
* the person gets a validator's sentence where the product had written them one of its own.
|
|
82
|
+
*
|
|
83
|
+
* Base64 is four characters per three bytes and rounds up to a whole group, so the arithmetic runs
|
|
84
|
+
* backwards from the characters left after the prefix: `floor((chars - prefix) / 4)` groups, three
|
|
85
|
+
* bytes each. Derived from the *longest* prefix, because one ceiling has to hold for every type a
|
|
86
|
+
* picker offers and the tightest constraint is the one that binds.
|
|
87
|
+
*
|
|
88
|
+
* **This is the figure a client-side picker checks a file against before encoding it.** The column
|
|
89
|
+
* enforces {@link MAX_STORED_IMAGE_CHARS} on the whole string, which is the bound that matters; this is
|
|
90
|
+
* the same fact stated as bytes of image, so a picker and a column cannot disagree.
|
|
91
|
+
*/
|
|
92
|
+
const MAX_STORED_IMAGE_BYTES = 3 * Math.floor((MAX_STORED_IMAGE_CHARS - LONGEST_STORED_IMAGE_PREFIX) / 4);
|
|
93
|
+
/** `data:<type>;base64,<payload>` and nothing else — no bare URL, no `data:text/html`, no charset games. */
|
|
94
|
+
const STORED_IMAGE_PATTERN = new RegExp(`^data:(?:${STORED_IMAGE_TYPES.join("|").replace(/\+/g, "\\+")});base64,[A-Za-z0-9+/]+=*$`);
|
|
95
|
+
/**
|
|
96
|
+
* A stored image, validated at the column and therefore at every boundary that decodes a row.
|
|
97
|
+
*
|
|
98
|
+
* **The pattern is an allowlist of types, not a check that the string starts with `data:`.**
|
|
99
|
+
* `data:text/html` is a `data:` URL too, and the difference between the two is the whole of what makes
|
|
100
|
+
* this column safe to render. Anchored at both ends, so nothing follows the payload.
|
|
101
|
+
*/
|
|
102
|
+
const StoredImage = z.string().max(MAX_STORED_IMAGE_CHARS).regex(STORED_IMAGE_PATTERN).describe("An image held as a base64 `data:` URL of an allowed type, bounded to 32KB. Stored rather than linked, and rendered only through `<img>` — see `@pithy-sh/core/src/image/storedImage`.");
|
|
103
|
+
/** The `data:` prefix a stored image of `type` begins with. */
|
|
104
|
+
function prefixOf(type) {
|
|
105
|
+
return `data:${type};base64,`;
|
|
106
|
+
}
|
|
107
|
+
/** The type a stored image declares, or null when it is not a value this rule accepts. */
|
|
108
|
+
function typeOfStoredImage(stored) {
|
|
109
|
+
return STORED_IMAGE_TYPES.find((type) => stored.startsWith(prefixOf(type))) ?? null;
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* What a screen should draw this image from.
|
|
113
|
+
*
|
|
114
|
+
* A URL for a raster, the stored value itself for a vector, and null for nothing. The caller renders
|
|
115
|
+
* whichever it gets through the same `<img src>`, so no screen has to know which it was handed.
|
|
116
|
+
*
|
|
117
|
+
* `path` is the route the owning capability serves bytes from, already carrying whatever identifies the
|
|
118
|
+
* subject — this function appends only the version, because the version is the half that has to be
|
|
119
|
+
* right for `immutable` to be honest.
|
|
120
|
+
*
|
|
121
|
+
* The version is the owning row's `updatedAt`: the URL changes whenever the image can have changed, so
|
|
122
|
+
* the response may be `immutable` and a browser never revalidates. It over-invalidates slightly — a
|
|
123
|
+
* rename busts a picture that did not change — which is one wasted fetch on a rare action, against a
|
|
124
|
+
* hash column and a migration to carry it.
|
|
125
|
+
*/
|
|
126
|
+
function storedImageSource(stored, path, version) {
|
|
127
|
+
if (stored === null) return null;
|
|
128
|
+
const type = typeOfStoredImage(stored);
|
|
129
|
+
if (type === null) return null;
|
|
130
|
+
if (INLINE_IMAGE_TYPES.includes(type)) return stored;
|
|
131
|
+
return `${path}?v=${version instanceof Date ? version.getTime() : version}`;
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* Decode a stored image for serving, or null when it must not be served.
|
|
135
|
+
*
|
|
136
|
+
* **Null for a vector, and that is the gate rather than a caution.** The route asks this and answers
|
|
137
|
+
* 404 when it gets null, so there is no arrangement of ids and versions that makes the origin return an
|
|
138
|
+
* SVG. The module note gives the reason.
|
|
139
|
+
*
|
|
140
|
+
* Null too for anything the allowlist does not match, which the column should have refused on the way
|
|
141
|
+
* in — this is the second place that is true, and a value that reached the column past a bug does not
|
|
142
|
+
* get served out of it.
|
|
143
|
+
*/
|
|
144
|
+
function storedImageBytes(stored) {
|
|
145
|
+
if (stored === null) return null;
|
|
146
|
+
const type = typeOfStoredImage(stored);
|
|
147
|
+
if (type === null || INLINE_IMAGE_TYPES.includes(type)) return null;
|
|
148
|
+
const payload = stored.slice(prefixOf(type).length);
|
|
149
|
+
let binary;
|
|
150
|
+
try {
|
|
151
|
+
binary = atob(payload);
|
|
152
|
+
} catch {
|
|
153
|
+
return null;
|
|
154
|
+
}
|
|
155
|
+
const body = new Uint8Array(binary.length);
|
|
156
|
+
for (let at = 0; at < binary.length; at += 1) body[at] = binary.charCodeAt(at);
|
|
157
|
+
return {
|
|
158
|
+
type,
|
|
159
|
+
body
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* The headers a served image carries.
|
|
164
|
+
*
|
|
165
|
+
* **`immutable`, which is only honest because the URL carries a version.** {@link storedImageSource}
|
|
166
|
+
* puts the owning row's `updatedAt` in the query, so a changed image is a different URL and a browser
|
|
167
|
+
* that never revalidates can never show a stale one.
|
|
168
|
+
*
|
|
169
|
+
* **`private`, because the fetch is authorized against a session.** A shared cache holding this would
|
|
170
|
+
* be one person's face served to whoever asked next.
|
|
171
|
+
*
|
|
172
|
+
* **`nosniff`, because the type is the allowlist's and must not be re-guessed.** Content sniffing is
|
|
173
|
+
* how a file served as an image gets treated as something else, and the whole safety of this route is
|
|
174
|
+
* that the type is one of three rasters.
|
|
175
|
+
*/
|
|
176
|
+
const STORED_IMAGE_HEADERS = {
|
|
177
|
+
"cache-control": "private, max-age=31536000, immutable",
|
|
178
|
+
"x-content-type-options": "nosniff"
|
|
179
|
+
};
|
|
180
|
+
//#endregion
|
|
181
|
+
export { INLINE_IMAGE_TYPES, LONGEST_STORED_IMAGE_PREFIX, MAX_STORED_IMAGE_BYTES, MAX_STORED_IMAGE_CHARS, STORED_IMAGE_HEADERS, STORED_IMAGE_TYPES, StoredImage, storedImageBytes, storedImageSource, typeOfStoredImage };
|
package/dist/logger/record.d.ts
CHANGED
|
@@ -798,6 +798,55 @@ export declare const LogRecord: z.ZodObject<{
|
|
|
798
798
|
detail: z.ZodOptional<z.ZodString>;
|
|
799
799
|
code: z.ZodLiteral<"controlplane/key_conflict">;
|
|
800
800
|
status: z.ZodLiteral<409>;
|
|
801
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
802
|
+
message: z.ZodString;
|
|
803
|
+
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
804
|
+
action: z.ZodOptional<z.ZodString>;
|
|
805
|
+
detail: z.ZodOptional<z.ZodString>;
|
|
806
|
+
code: z.ZodLiteral<"organization/not_found">;
|
|
807
|
+
status: z.ZodLiteral<404>;
|
|
808
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
809
|
+
message: z.ZodString;
|
|
810
|
+
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
811
|
+
action: z.ZodOptional<z.ZodString>;
|
|
812
|
+
detail: z.ZodOptional<z.ZodString>;
|
|
813
|
+
code: z.ZodLiteral<"organization/forbidden">;
|
|
814
|
+
status: z.ZodLiteral<403>;
|
|
815
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
816
|
+
message: z.ZodString;
|
|
817
|
+
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
818
|
+
action: z.ZodOptional<z.ZodString>;
|
|
819
|
+
detail: z.ZodOptional<z.ZodString>;
|
|
820
|
+
code: z.ZodLiteral<"organization/invalid_role_catalog">;
|
|
821
|
+
status: z.ZodLiteral<400>;
|
|
822
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
823
|
+
message: z.ZodString;
|
|
824
|
+
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
825
|
+
action: z.ZodOptional<z.ZodString>;
|
|
826
|
+
detail: z.ZodOptional<z.ZodString>;
|
|
827
|
+
code: z.ZodLiteral<"organization/invitation_invalid">;
|
|
828
|
+
status: z.ZodLiteral<400>;
|
|
829
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
830
|
+
message: z.ZodString;
|
|
831
|
+
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
832
|
+
action: z.ZodOptional<z.ZodString>;
|
|
833
|
+
detail: z.ZodOptional<z.ZodString>;
|
|
834
|
+
code: z.ZodLiteral<"organization/last_administrator">;
|
|
835
|
+
status: z.ZodLiteral<409>;
|
|
836
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
837
|
+
message: z.ZodString;
|
|
838
|
+
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
839
|
+
action: z.ZodOptional<z.ZodString>;
|
|
840
|
+
detail: z.ZodOptional<z.ZodString>;
|
|
841
|
+
code: z.ZodLiteral<"organization/slug_taken">;
|
|
842
|
+
status: z.ZodLiteral<409>;
|
|
843
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
844
|
+
message: z.ZodString;
|
|
845
|
+
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
846
|
+
action: z.ZodOptional<z.ZodString>;
|
|
847
|
+
detail: z.ZodOptional<z.ZodString>;
|
|
848
|
+
code: z.ZodLiteral<"organization/nomination_invalid">;
|
|
849
|
+
status: z.ZodLiteral<400>;
|
|
801
850
|
}, z.core.$strip>, z.ZodObject<{
|
|
802
851
|
message: z.ZodString;
|
|
803
852
|
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"record.d.ts","sourceRoot":"","sources":["../../src/logger/record.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB;;;;;GAKG;AAEH,4GAA4G;AAC5G,eAAO,MAAM,QAAQ;;;;;EAE4F,CAAC;AAClH,MAAM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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAW+E,CAAC;AACtG,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,SAAS,CAAC,CAAC;AAmBnD;;;GAGG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,SAAS,GAAG,MAAM,CAMzD"}
|
package/dist/seed/devLogin.d.ts
CHANGED
|
@@ -9,10 +9,16 @@ import { z } from "zod";
|
|
|
9
9
|
* the seam they already share, so the shape is stated once instead of being duplicated (and drifting) at
|
|
10
10
|
* both ends.
|
|
11
11
|
*
|
|
12
|
-
* **The file holds a live credential.** A signed
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
12
|
+
* **The file holds a live credential.** A signed claim for a local database is a way in for anyone who
|
|
13
|
+
* can read it, which is why it is written under `logs/` — gitignored by the starter template, so it can
|
|
14
|
+
* never be committed — and why nothing here is ever put in a `PithyError` (the payload reaches logs
|
|
15
|
+
* verbatim).
|
|
16
|
+
*
|
|
17
|
+
* **It used to hold a session cookie, and now it holds a claim — `#572`.** The difference is what
|
|
18
|
+
* survives: a cookie names a row in `pithy_auth_sessions`, so signing out of the app revoked it and the
|
|
19
|
+
* dev login 404'd until somebody reseeded. A claim names a *user*, signed with the session secret, and
|
|
20
|
+
* the route exchanges it for a fresh session on every open. Sign-out then revokes the session it should
|
|
21
|
+
* revoke and leaves the way back in alone.
|
|
16
22
|
*/
|
|
17
23
|
/** The directory seed artifacts are written to, relative to the project root. Gitignored, so transient. */
|
|
18
24
|
export declare const SEED_ARTIFACT_DIR = "logs";
|
|
@@ -32,11 +38,13 @@ export declare const DEV_LOGIN_PATH = "logs/dev-login.json";
|
|
|
32
38
|
* anything the kit serves that is not part of a capability's public surface lives under this prefix, so
|
|
33
39
|
* a route added here can never collide with an application path someone already shipped.
|
|
34
40
|
*
|
|
35
|
-
* Registered **only** in a `dev` composition, and never under CI. It mints an authenticated session
|
|
36
|
-
*
|
|
37
|
-
* registration rather than inside the handler.
|
|
41
|
+
* Registered **only** in a `dev` composition, and never under CI. It mints an authenticated session for
|
|
42
|
+
* whoever presents a claim this project's own secret signed, which is the whole risk of the feature and
|
|
43
|
+
* the reason its gates live at registration rather than inside the handler.
|
|
38
44
|
*/
|
|
39
45
|
export declare const DEV_LOGIN_ROUTE = "/__pithy/dev-login";
|
|
46
|
+
/** The query parameter {@link DEV_LOGIN_ROUTE} takes the claim in. Spelled once, read by both ends. */
|
|
47
|
+
export declare const DEV_LOGIN_CLAIM_PARAM = "t";
|
|
40
48
|
/**
|
|
41
49
|
* A seeded dev login — everything a browser needs to be signed in as a seeded user, and nothing else.
|
|
42
50
|
* `z.input` is the JSON on disk (dates as ISO-8601 strings); `z.output` is the app shape.
|
|
@@ -44,8 +52,7 @@ export declare const DEV_LOGIN_ROUTE = "/__pithy/dev-login";
|
|
|
44
52
|
export declare const DevLogin: z.ZodObject<{
|
|
45
53
|
email: z.ZodString;
|
|
46
54
|
userId: z.ZodString;
|
|
47
|
-
|
|
48
|
-
cookieValue: z.ZodString;
|
|
55
|
+
claim: z.ZodString;
|
|
49
56
|
expiresAt: z.ZodCodec<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodDate]>, z.ZodDate>;
|
|
50
57
|
}, z.core.$strip>;
|
|
51
58
|
export type DevLogin = z.output<typeof DevLogin>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"devLogin.d.ts","sourceRoot":"","sources":["../../src/seed/devLogin.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB
|
|
1
|
+
{"version":3,"file":"devLogin.d.ts","sourceRoot":"","sources":["../../src/seed/devLogin.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB;;;;;;;;;;;;;;;;;;GAkBG;AAEH,2GAA2G;AAC3G,eAAO,MAAM,iBAAiB,SAAS,CAAC;AAExC,gHAAgH;AAChH,eAAO,MAAM,cAAc,mBAAmB,CAAC;AAE/C,uGAAuG;AACvG,eAAO,MAAM,cAAc,wBAA2C,CAAC;AAEvE;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,eAAe,uBAAuB,CAAC;AAEpD,uGAAuG;AACvG,eAAO,MAAM,qBAAqB,MAAM,CAAC;AAEzC;;;GAGG;AACH,eAAO,MAAM,QAAQ;;;;;iBAWqF,CAAC;AAC3G,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,QAAQ,CAAC,CAAC"}
|
package/dist/seed/devLogin.js
CHANGED
|
@@ -11,10 +11,16 @@ import { z } from "zod";
|
|
|
11
11
|
* the seam they already share, so the shape is stated once instead of being duplicated (and drifting) at
|
|
12
12
|
* both ends.
|
|
13
13
|
*
|
|
14
|
-
* **The file holds a live credential.** A signed
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
14
|
+
* **The file holds a live credential.** A signed claim for a local database is a way in for anyone who
|
|
15
|
+
* can read it, which is why it is written under `logs/` — gitignored by the starter template, so it can
|
|
16
|
+
* never be committed — and why nothing here is ever put in a `PithyError` (the payload reaches logs
|
|
17
|
+
* verbatim).
|
|
18
|
+
*
|
|
19
|
+
* **It used to hold a session cookie, and now it holds a claim — `#572`.** The difference is what
|
|
20
|
+
* survives: a cookie names a row in `pithy_auth_sessions`, so signing out of the app revoked it and the
|
|
21
|
+
* dev login 404'd until somebody reseeded. A claim names a *user*, signed with the session secret, and
|
|
22
|
+
* the route exchanges it for a fresh session on every open. Sign-out then revokes the session it should
|
|
23
|
+
* revoke and leaves the way back in alone.
|
|
18
24
|
*/
|
|
19
25
|
/** The directory seed artifacts are written to, relative to the project root. Gitignored, so transient. */
|
|
20
26
|
const SEED_ARTIFACT_DIR = "logs";
|
|
@@ -34,21 +40,22 @@ const DEV_LOGIN_PATH = `${SEED_ARTIFACT_DIR}/${DEV_LOGIN_FILE}`;
|
|
|
34
40
|
* anything the kit serves that is not part of a capability's public surface lives under this prefix, so
|
|
35
41
|
* a route added here can never collide with an application path someone already shipped.
|
|
36
42
|
*
|
|
37
|
-
* Registered **only** in a `dev` composition, and never under CI. It mints an authenticated session
|
|
38
|
-
*
|
|
39
|
-
* registration rather than inside the handler.
|
|
43
|
+
* Registered **only** in a `dev` composition, and never under CI. It mints an authenticated session for
|
|
44
|
+
* whoever presents a claim this project's own secret signed, which is the whole risk of the feature and
|
|
45
|
+
* the reason its gates live at registration rather than inside the handler.
|
|
40
46
|
*/
|
|
41
47
|
const DEV_LOGIN_ROUTE = "/__pithy/dev-login";
|
|
48
|
+
/** The query parameter {@link DEV_LOGIN_ROUTE} takes the claim in. Spelled once, read by both ends. */
|
|
49
|
+
const DEV_LOGIN_CLAIM_PARAM = "t";
|
|
42
50
|
/**
|
|
43
51
|
* A seeded dev login — everything a browser needs to be signed in as a seeded user, and nothing else.
|
|
44
52
|
* `z.input` is the JSON on disk (dates as ISO-8601 strings); `z.output` is the app shape.
|
|
45
53
|
*/
|
|
46
54
|
const DevLogin = z.object({
|
|
47
|
-
email: z.string().describe("The seeded user this
|
|
48
|
-
userId: z.string().describe("The seeded user's id, so a tool can correlate the
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
}).describe("A seeded dev login: the signed session cookie for one seeded user, written to `logs/dev-login.json`.");
|
|
55
|
+
email: z.string().describe("The seeded user this claim signs in as. Shown on the `pithy dev` ready banner."),
|
|
56
|
+
userId: z.string().describe("The seeded user's id, so a tool can correlate the login with the seeded rows."),
|
|
57
|
+
claim: z.string().describe("The signed, URI-encoded claim naming the user to sign in as. A live credential for the local database — never logged, never committed, never in an error payload. **Not a session:** it names a user and the route mints a session against it, so revoking a session leaves it working."),
|
|
58
|
+
expiresAt: JsonDate.describe("When the claim stops being accepted. ISO-8601 text on disk; a `Date` in app code.")
|
|
59
|
+
}).describe("A seeded dev login: the signed claim for one seeded user, written to `logs/dev-login.json`.");
|
|
53
60
|
//#endregion
|
|
54
|
-
export { DEV_LOGIN_FILE, DEV_LOGIN_PATH, DEV_LOGIN_ROUTE, DevLogin, SEED_ARTIFACT_DIR };
|
|
61
|
+
export { DEV_LOGIN_CLAIM_PARAM, DEV_LOGIN_FILE, DEV_LOGIN_PATH, DEV_LOGIN_ROUTE, DevLogin, SEED_ARTIFACT_DIR };
|
|
@@ -3,5 +3,5 @@
|
|
|
3
3
|
/** This package's npm name — the join key against a release feed. */
|
|
4
4
|
export declare const PACKAGE_NAME = "@pithy-sh/core";
|
|
5
5
|
/** This package's version, stamped from its own package.json at generation time. */
|
|
6
|
-
export declare const PACKAGE_VERSION = "0.
|
|
6
|
+
export declare const PACKAGE_VERSION = "0.6.1";
|
|
7
7
|
//# sourceMappingURL=version.generated.d.ts.map
|
|
@@ -4,6 +4,6 @@
|
|
|
4
4
|
/** This package's npm name — the join key against a release feed. */
|
|
5
5
|
const PACKAGE_NAME = "@pithy-sh/core";
|
|
6
6
|
/** This package's version, stamped from its own package.json at generation time. */
|
|
7
|
-
const PACKAGE_VERSION = "0.
|
|
7
|
+
const PACKAGE_VERSION = "0.6.1";
|
|
8
8
|
//#endregion
|
|
9
9
|
export { PACKAGE_NAME, PACKAGE_VERSION };
|
package/package.json
CHANGED
package/src/version.generated.ts
CHANGED