@tearleads/client-sdk 0.1.42 → 0.1.44
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/client/containerDocumentDiscovery.js +71 -29
- package/client/containerDocumentDiscovery.js.map +1 -1
- package/client/deviceFirst.js +4 -5
- package/client/deviceFirst.js.map +1 -1
- package/data/blobs/transferPool.js +35 -8
- package/data/blobs/transferPool.js.map +1 -1
- package/data/containers/shared/projection.js +12 -0
- package/data/containers/shared/projection.js.map +1 -1
- package/data/documents/blob/shared/types.d.ts +2 -3
- package/data/documents/blob/shared/types.js.map +1 -1
- package/data/documents/shared/events.js +0 -1
- package/data/documents/shared/events.js.map +1 -1
- package/data/persistence/container-contents/containerContentsPersistence.js +6 -22
- package/data/persistence/container-contents/containerContentsPersistence.js.map +1 -1
- package/data/persistence/container-contents/containerMetadataMutationPersistence.js +5 -15
- package/data/persistence/container-contents/containerMetadataMutationPersistence.js.map +1 -1
- package/data/persistence/container-contents/containerPendingUpdatePersistence.js +6 -15
- package/data/persistence/container-contents/containerPendingUpdatePersistence.js.map +1 -1
- package/data/persistence/container-contents/containerRecoveryPersistence.js +3 -4
- package/data/persistence/container-contents/containerRecoveryPersistence.js.map +1 -1
- package/data/persistence/container-contents/containerRemovalWork.js +3 -5
- package/data/persistence/container-contents/containerRemovalWork.js.map +1 -1
- package/data/persistence/container-contents/dormantContainerMetadata.js +1 -5
- package/data/persistence/container-contents/dormantContainerMetadata.js.map +1 -1
- package/data/persistence/containers/containerSyncWatermarkPersistence.d.ts +11 -3
- package/data/persistence/containers/containerSyncWatermarkPersistence.js +46 -58
- package/data/persistence/containers/containerSyncWatermarkPersistence.js.map +1 -1
- package/data/persistence/documents/documentsPersistence.js +4 -9
- package/data/persistence/documents/documentsPersistence.js.map +1 -1
- package/data/persistence/documents/internal/discardDocument.js +1 -2
- package/data/persistence/documents/internal/discardDocument.js.map +1 -1
- package/data/persistence/documents/internal/documentDeletionPersistence.js +1 -2
- package/data/persistence/documents/internal/documentDeletionPersistence.js.map +1 -1
- package/data/persistence/documents/internal/documentMutationPersistence.js +17 -25
- package/data/persistence/documents/internal/documentMutationPersistence.js.map +1 -1
- package/data/persistence/documents/internal/orphanSideRows.js +2 -14
- package/data/persistence/documents/internal/orphanSideRows.js.map +1 -1
- package/data/persistence/documents/internal/syncQueuePersistence.js +3 -3
- package/data/persistence/documents/internal/syncQueuePersistence.js.map +1 -1
- package/data/sqlite/documentHistoryPersistence.d.ts +9 -3
- package/data/sqlite/documentHistoryPersistence.js +31 -8
- package/data/sqlite/documentHistoryPersistence.js.map +1 -1
- package/data/sqlite/documentPendingUpdatePersistence.d.ts +58 -11
- package/data/sqlite/documentPendingUpdatePersistence.js +137 -63
- package/data/sqlite/documentPendingUpdatePersistence.js.map +1 -1
- package/data/sqlite/documentPersistence.d.ts +1 -1
- package/data/sqlite/documentPersistence.js +1 -1
- package/data/sqlite/documentPersistence.js.map +1 -1
- package/data/sqlite/documentPersistenceTypes.d.ts +2 -2
- package/data/sqlite/documentPersistenceTypes.js.map +1 -1
- package/data/sqlite/documentRecordPersistence.js +5 -4
- package/data/sqlite/documentRecordPersistence.js.map +1 -1
- package/data/sqlite/schema.d.ts +167 -517
- package/data/sqlite/schema.js +68 -82
- package/data/sqlite/schema.js.map +1 -1
- package/internal/api-client/ApiClient.d.ts +18 -41
- package/internal/api-client/ApiClient.js +9 -14
- package/internal/api-client/ApiClient.js.map +1 -1
- package/internal/api-client/apiRequestRuntime.d.ts +2 -0
- package/internal/api-client/apiRequestRuntime.js +4 -0
- package/internal/api-client/apiRequestRuntime.js.map +1 -1
- package/internal/api-client/binaryRequestOperationTransport.d.ts +18 -0
- package/internal/api-client/index.d.ts +1 -0
- package/internal/api-client/index.js +1 -0
- package/internal/api-client/index.js.map +1 -1
- package/internal/api-client/operationTransportFactory.d.ts +6 -0
- package/internal/api-client/requestInternals.js +7 -7
- package/internal/api-client/requestInternals.js.map +1 -1
- package/internal/api-client/routes/blobs/get.d.ts +7 -0
- package/internal/api-client/routes/blobs/get.js.map +1 -1
- package/internal/api-client/routes/blobs/multipart.js +1 -11
- package/internal/api-client/routes/blobs/multipart.js.map +1 -1
- package/internal/api-client/routes/blobs/multipartUpload.d.ts +14 -0
- package/internal/api-client/routes/blobs/multipartUpload.js +94 -43
- package/internal/api-client/routes/blobs/multipartUpload.js.map +1 -1
- package/internal/api-client/routes/containers/reads.d.ts +13 -7
- package/internal/api-client/routes/containers/reads.js +36 -15
- package/internal/api-client/routes/containers/reads.js.map +1 -1
- package/internal/api-client/types.d.ts +1 -5
- package/internal/api-client/types.js.map +1 -1
- package/internal/validators/containerReadRefinements.js +15 -5
- package/internal/validators/containerReadRefinements.js.map +1 -1
- package/internal/validators/containerReadSchemas.d.ts +36 -0
- package/internal/validators/containerReadSchemas.js +64 -1
- package/internal/validators/containerReadSchemas.js.map +1 -1
- package/internal/validators/operation/attachments.d.ts +80 -160
- package/internal/validators/operation/auth.d.ts +760 -1664
- package/internal/validators/operation/blobDownloads.js +1 -1
- package/internal/validators/operation/blobDownloads.js.map +1 -1
- package/internal/validators/operation/containerMutations.d.ts +416 -856
- package/internal/validators/operation/containerReads.d.ts +118 -182
- package/internal/validators/operation/containerReads.js +20 -54
- package/internal/validators/operation/containerReads.js.map +1 -1
- package/internal/validators/operation/documentMutations.d.ts +120 -264
- package/internal/validators/operation/documentSync.d.ts +40 -80
- package/internal/validators/operation/index.d.ts +2 -2
- package/internal/validators/operation/index.js +2 -2
- package/internal/validators/operation/index.js.map +1 -1
- package/internal/validators/operation/multipartBlobs.d.ts +70 -190
- package/internal/validators/operation/multipartBlobs.js +2 -24
- package/internal/validators/operation/multipartBlobs.js.map +1 -1
- package/internal/validators/operation/multipartPartUploads.d.ts +5 -5
- package/internal/validators/operation/multipartPartUploads.js +6 -20
- package/internal/validators/operation/multipartPartUploads.js.map +1 -1
- package/internal/validators/operation/organizations.d.ts +882 -1906
- package/internal/validators/operation/principals.d.ts +120 -240
- package/internal/validators/operation/registry.d.ts +3 -4
- package/internal/validators/operation/registry.js +3 -4
- package/internal/validators/operation/registry.js.map +1 -1
- package/internal/validators/request/blob.d.ts +100 -201
- package/internal/validators/request/blob.js +6 -13
- package/internal/validators/request/blob.js.map +1 -1
- package/internal/validators/request/container.d.ts +136 -272
- package/internal/validators/request/container.js +16 -10
- package/internal/validators/request/container.js.map +1 -1
- package/internal/validators/request/containerDocumentLanes.d.ts +23 -0
- package/internal/validators/request/containerDocumentLanes.js +23 -0
- package/internal/validators/request/containerDocumentLanes.js.map +1 -0
- package/internal/validators/request/containerManifestRef.d.ts +54 -0
- package/internal/validators/request/containerManifestRef.js +28 -0
- package/internal/validators/request/containerManifestRef.js.map +1 -0
- package/internal/validators/request/containerMetadata.d.ts +160 -368
- package/internal/validators/request/containerParentLanes.js +5 -35
- package/internal/validators/request/containerParentLanes.js.map +1 -1
- package/internal/validators/request/document.d.ts +100 -245
- package/internal/validators/request/document.js +1 -2
- package/internal/validators/request/document.js.map +1 -1
- package/internal/validators/request/documentSyncSchema.d.ts +42 -109
- package/internal/validators/request/documentSyncSchema.js +8 -25
- package/internal/validators/request/documentSyncSchema.js.map +1 -1
- package/internal/validators/request/index.d.ts +2 -1
- package/internal/validators/request/index.js +2 -1
- package/internal/validators/request/index.js.map +1 -1
- package/internal/validators/request/organization.d.ts +160 -320
- package/internal/validators/request/organizationProvisioning.d.ts +2424 -5312
- package/internal/validators/request/principal.d.ts +160 -320
- package/internal/validators/request/registration.d.ts +760 -1664
- package/internal/validators/response/blob.d.ts +48 -27
- package/internal/validators/response/blob.js +3 -10
- package/internal/validators/response/blob.js.map +1 -1
- package/internal/validators/response/containerDocumentLanes.d.ts +82 -0
- package/internal/validators/response/containerDocumentLanes.js +35 -0
- package/internal/validators/response/containerDocumentLanes.js.map +1 -0
- package/internal/validators/response/containerParentLanes.js +3 -15
- package/internal/validators/response/containerParentLanes.js.map +1 -1
- package/internal/validators/response/index.d.ts +3 -2
- package/internal/validators/response/index.js +2 -2
- package/internal/validators/response/index.js.map +1 -1
- package/internal/validators/util/blob.d.ts +7 -0
- package/internal/validators/util/blob.js +7 -0
- package/internal/validators/util/blob.js.map +1 -1
- package/internal/validators/util/blobTransferSchemas.d.ts +41 -0
- package/internal/validators/util/blobTransferSchemas.js +39 -0
- package/internal/validators/util/blobTransferSchemas.js.map +1 -0
- package/internal/validators/util/containerLimits.d.ts +7 -0
- package/internal/validators/util/containerLimits.js +7 -0
- package/internal/validators/util/containerLimits.js.map +1 -1
- package/internal/validators/util/index.d.ts +2 -1
- package/internal/validators/util/index.js +2 -1
- package/internal/validators/util/index.js.map +1 -1
- package/package.json +1 -1
- package/sync/reconciliation/knownContainerSweep.js +57 -54
- package/sync/reconciliation/knownContainerSweep.js.map +1 -1
- package/sync/reconciliation/reconcileContainer.js +49 -17
- package/sync/reconciliation/reconcileContainer.js.map +1 -1
- package/sync/reconciliation/service.js +44 -16
- package/sync/reconciliation/service.js.map +1 -1
- package/sync/reconciliation/serviceTypes.d.ts +23 -2
- package/sync/reconciliation/serviceTypes.js.map +1 -1
- package/workflows/blobs/multipartFirstParts.js +82 -0
- package/workflows/blobs/multipartFirstParts.js.map +1 -0
- package/workflows/blobs/multipartStageResolution.js +83 -0
- package/workflows/blobs/multipartStageResolution.js.map +1 -0
- package/workflows/blobs/multipartUpload.js +45 -89
- package/workflows/blobs/multipartUpload.js.map +1 -1
- package/workflows/container-contents/containerDocumentListing.js +92 -38
- package/workflows/container-contents/containerDocumentListing.js.map +1 -1
- package/workflows/container-contents/containerPersistence.d.ts +8 -2
- package/workflows/container-contents/containerPersistence.js +6 -7
- package/workflows/container-contents/containerPersistence.js.map +1 -1
- package/workflows/container-contents/documentDiscovery.d.ts +3 -3
- package/workflows/container-contents/documentDiscovery.js +24 -96
- package/workflows/container-contents/documentDiscovery.js.map +1 -1
- package/workflows/container-contents/documentDiscoveryApply.js +65 -0
- package/workflows/container-contents/documentDiscoveryApply.js.map +1 -0
- package/workflows/container-contents/documentDiscoveryLanes.js +53 -0
- package/workflows/container-contents/documentDiscoveryLanes.js.map +1 -0
- package/workflows/container-contents/documentDiscoveryTypes.d.ts +25 -19
- package/workflows/container-contents/documentDiscoveryTypes.js.map +1 -1
- package/workflows/container-contents/documentPriming.js +2 -1
- package/workflows/container-contents/documentPriming.js.map +1 -1
- package/workflows/container-contents/documentQueries/sql.js +4 -4
- package/workflows/container-contents/documentQueries/sql.js.map +1 -1
- package/workflows/container-contents/pendingWrites/deferredTails.js +6 -3
- package/workflows/container-contents/pendingWrites/deferredTails.js.map +1 -1
- package/workflows/container-contents/pendingWrites/sources.js +2 -1
- package/workflows/container-contents/pendingWrites/sources.js.map +1 -1
- package/workflows/container-contents/pendingWrites.js +2 -1
- package/workflows/container-contents/pendingWrites.js.map +1 -1
- package/workflows/container-contents/remoteHydration/laneFetchMarkers.js +11 -17
- package/workflows/container-contents/remoteHydration/laneFetchMarkers.js.map +1 -1
- package/workflows/containers/child/create.js +3 -3
- package/workflows/containers/child/create.js.map +1 -1
- package/workflows/containers/child/move.js +2 -2
- package/workflows/containers/child/move.js.map +1 -1
- package/workflows/containers/child/mutationRequestCore.js +5 -4
- package/workflows/containers/child/mutationRequestCore.js.map +1 -1
- package/workflows/containers/child/recitePlan.js +3 -2
- package/workflows/containers/child/recitePlan.js.map +1 -1
- package/workflows/containers/child/sharePlanCore.js +2 -2
- package/workflows/containers/child/sharePlanCore.js.map +1 -1
- package/workflows/containers/root/create.js +2 -2
- package/workflows/containers/root/create.js.map +1 -1
- package/workflows/registration/provisioningBootstrapBuilders.d.ts +20 -46
- package/workflows/sync/remoteReset.js +9 -9
- package/workflows/sync/remoteReset.js.map +1 -1
- package/workflows/sync/remoteResetCursorScope.js +10 -18
- package/workflows/sync/remoteResetCursorScope.js.map +1 -1
- package/workflows/sync/remoteResetPlans.js +6 -3
- package/workflows/sync/remoteResetPlans.js.map +1 -1
- package/workflows/sync/remoteResetScope.js +4 -11
- package/workflows/sync/remoteResetScope.js.map +1 -1
- package/internal/validators/operation/blobTransferSchemas.js +0 -11
- package/internal/validators/operation/blobTransferSchemas.js.map +0 -1
|
@@ -1,23 +1,29 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { registerJsonSchemaView } from "../jsonSchema.js";
|
|
3
|
-
import { arraySchema,
|
|
4
|
-
import {
|
|
5
|
-
|
|
3
|
+
import { arraySchema, loosePlainObject, nonEmptyStringSchema, plainObjectSchema, requiredUnknownSchema, } from "../schema.js";
|
|
4
|
+
import { ContainerKekKeyringWireRecordSchema, MAX_INLINE_CONTAINER_REKEYS, MAX_ROTATION_CONTAINER_REKEYS, } from "../util/index.js";
|
|
5
|
+
import { ContainerManifestPathSchema, ContainerManifestRefListSchema, ContainerManifestRefSchema, OptionalContainerManifestPathSchema, } from "./containerManifestRef.js";
|
|
6
6
|
const ContainerMutationKeyringSchema = registerJsonSchemaView(z.custom((value) => ContainerKekKeyringWireRecordSchema.safeParse(value).success), ContainerKekKeyringWireRecordSchema);
|
|
7
|
+
// Every manifest a mutation cites that the server already stores travels as a
|
|
8
|
+
// {containerId, manifestHash} reference. The server resolves each one from its
|
|
9
|
+
// own verified store (or from an earlier mutation of the same batch) and pins
|
|
10
|
+
// paths and the previous manifest to current heads; the signed event binds the
|
|
11
|
+
// same hashes as its dependencies, so no request copy of a stored bundle is
|
|
12
|
+
// ever needed. Only the new manifest this mutation commits travels in full.
|
|
7
13
|
const containerMutationRequestShape = {
|
|
8
14
|
body: requiredUnknownSchema,
|
|
9
|
-
|
|
10
|
-
|
|
15
|
+
containerManifestHistoryRefs: ContainerManifestRefListSchema.optional(),
|
|
16
|
+
destinationParentContainerPathRefs: OptionalContainerManifestPathSchema.optional(),
|
|
11
17
|
event: plainObjectSchema,
|
|
12
18
|
expectedManifestHash: nonEmptyStringSchema,
|
|
13
19
|
keyEpoch: plainObjectSchema,
|
|
14
20
|
keyring: ContainerMutationKeyringSchema.nullable(),
|
|
15
21
|
manifest: plainObjectSchema,
|
|
16
|
-
|
|
22
|
+
parentContainerPathRefs: OptionalContainerManifestPathSchema.optional(),
|
|
17
23
|
parentKekState: plainObjectSchema.nullable().optional(),
|
|
18
24
|
predecessorBridge: plainObjectSchema.nullable(),
|
|
19
|
-
|
|
20
|
-
|
|
25
|
+
previousContainerPathRefs: OptionalContainerManifestPathSchema.optional(),
|
|
26
|
+
previousManifestRef: ContainerManifestRefSchema.nullable().optional(),
|
|
21
27
|
principalPolicies: arraySchema(plainObjectSchema),
|
|
22
28
|
userRecipientKeys: arraySchema(plainObjectSchema).optional(),
|
|
23
29
|
wraps: arraySchema(plainObjectSchema),
|
|
@@ -39,8 +45,8 @@ export const ContainerReciteRequestSchema = loosePlainObject({
|
|
|
39
45
|
event: plainObjectSchema,
|
|
40
46
|
expectedManifestHash: nonEmptyStringSchema,
|
|
41
47
|
manifest: plainObjectSchema,
|
|
42
|
-
|
|
43
|
-
|
|
48
|
+
previousContainerPathRefs: ContainerManifestPathSchema,
|
|
49
|
+
previousManifestRef: ContainerManifestRefSchema,
|
|
44
50
|
principalPolicies: arraySchema(plainObjectSchema),
|
|
45
51
|
});
|
|
46
52
|
export function isContainerReciteRequest(value) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"container.js","sourceRoot":"","sources":["container.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EACL,WAAW,EACX,
|
|
1
|
+
{"version":3,"file":"container.js","sourceRoot":"","sources":["container.ts"],"names":[],"mappings":"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","sourcesContent":["import { z } from \"zod\";\nimport { registerJsonSchemaView } from \"../jsonSchema\";\nimport {\n arraySchema,\n loosePlainObject,\n nonEmptyStringSchema,\n plainObjectSchema,\n requiredUnknownSchema,\n} from \"../schema\";\nimport {\n ContainerKekKeyringWireRecordSchema,\n MAX_INLINE_CONTAINER_REKEYS,\n MAX_ROTATION_CONTAINER_REKEYS,\n} from \"../util\";\nimport {\n ContainerManifestPathSchema,\n ContainerManifestRefListSchema,\n ContainerManifestRefSchema,\n OptionalContainerManifestPathSchema,\n} from \"./containerManifestRef\";\n\nconst ContainerMutationKeyringSchema = registerJsonSchemaView(\n z.custom<Record<string, unknown>>(\n (value) => ContainerKekKeyringWireRecordSchema.safeParse(value).success,\n ),\n ContainerKekKeyringWireRecordSchema,\n);\n\n// Every manifest a mutation cites that the server already stores travels as a\n// {containerId, manifestHash} reference. The server resolves each one from its\n// own verified store (or from an earlier mutation of the same batch) and pins\n// paths and the previous manifest to current heads; the signed event binds the\n// same hashes as its dependencies, so no request copy of a stored bundle is\n// ever needed. Only the new manifest this mutation commits travels in full.\nconst containerMutationRequestShape = {\n body: requiredUnknownSchema,\n containerManifestHistoryRefs: ContainerManifestRefListSchema.optional(),\n destinationParentContainerPathRefs:\n OptionalContainerManifestPathSchema.optional(),\n event: plainObjectSchema,\n expectedManifestHash: nonEmptyStringSchema,\n keyEpoch: plainObjectSchema,\n keyring: ContainerMutationKeyringSchema.nullable(),\n manifest: plainObjectSchema,\n parentContainerPathRefs: OptionalContainerManifestPathSchema.optional(),\n parentKekState: plainObjectSchema.nullable().optional(),\n predecessorBridge: plainObjectSchema.nullable(),\n previousContainerPathRefs: OptionalContainerManifestPathSchema.optional(),\n previousManifestRef: ContainerManifestRefSchema.nullable().optional(),\n principalPolicies: arraySchema(plainObjectSchema),\n userRecipientKeys: arraySchema(plainObjectSchema).optional(),\n wraps: arraySchema(plainObjectSchema),\n};\n\nexport const ContainerMutationRequestSchema = loosePlainObject(\n containerMutationRequestShape,\n);\n\nexport type ContainerMutationRequest = z.infer<\n typeof ContainerMutationRequestSchema\n>;\n\n/**\n * A rekey, revoke, or move: the rotation plus the descendant rekeys it must\n * commit with. `containerRekeys` names, parent-first, the descendants above a\n * directly granted container; they commit with the rotation or not at all.\n * Only these three routes take it, so the carriers that already hold a flat\n * rekey list (document and blob writes) stay as they are.\n */\nexport const ContainerRotationRequestSchema = loosePlainObject({\n ...containerMutationRequestShape,\n containerRekeys: arraySchema(\n ContainerMutationRequestSchema,\n MAX_ROTATION_CONTAINER_REKEYS,\n ).optional(),\n});\n\nexport type ContainerRotationRequest = z.infer<\n typeof ContainerRotationRequestSchema\n>;\n\nexport const ContainerReciteRequestSchema = loosePlainObject({\n body: requiredUnknownSchema,\n event: plainObjectSchema,\n expectedManifestHash: nonEmptyStringSchema,\n manifest: plainObjectSchema,\n previousContainerPathRefs: ContainerManifestPathSchema,\n previousManifestRef: ContainerManifestRefSchema,\n principalPolicies: arraySchema(plainObjectSchema),\n});\n\nexport type ContainerReciteRequest = z.infer<\n typeof ContainerReciteRequestSchema\n>;\n\nexport function isContainerReciteRequest(\n value: unknown,\n): value is ContainerReciteRequest {\n return ContainerReciteRequestSchema.safeParse(value).success;\n}\n\nexport function isContainerRotationRequest(\n value: unknown,\n): value is ContainerRotationRequest {\n return ContainerRotationRequestSchema.safeParse(value).success;\n}\n\nexport function isContainerMutationRequest(\n value: unknown,\n): value is ContainerMutationRequest {\n return ContainerMutationRequestSchema.safeParse(value).success;\n}\n\nexport function isOptionalContainerMutationRequestArray(\n value: unknown,\n): value is ContainerMutationRequest[] | undefined {\n return arraySchema(\n ContainerMutationRequestSchema,\n MAX_INLINE_CONTAINER_REKEYS,\n )\n .optional()\n .safeParse(value).success;\n}\n"]}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export { DEFAULT_CONTAINER_READ_LANE_PAGE_LIMIT as DEFAULT_CONTAINER_DOCUMENT_LANE_PAGE_LIMIT, MAX_CONTAINER_DOCUMENT_LANES, MAX_CONTAINER_READ_LANE_BATCH_PAGE_TOTAL as MAX_CONTAINER_DOCUMENT_LANE_PAGE_TOTAL, } from "../containerReadSchemas.js";
|
|
3
|
+
export declare const ListContainerDocumentLanesRequestSchema: z.ZodObject<{
|
|
4
|
+
lanes: z.ZodCustom<{
|
|
5
|
+
containerId: string;
|
|
6
|
+
laneId: string;
|
|
7
|
+
watermark: {
|
|
8
|
+
id: string;
|
|
9
|
+
updatedAt: string;
|
|
10
|
+
} | null;
|
|
11
|
+
limit?: number | undefined;
|
|
12
|
+
}[], {
|
|
13
|
+
containerId: string;
|
|
14
|
+
laneId: string;
|
|
15
|
+
watermark: {
|
|
16
|
+
id: string;
|
|
17
|
+
updatedAt: string;
|
|
18
|
+
} | null;
|
|
19
|
+
limit?: number | undefined;
|
|
20
|
+
}[]>;
|
|
21
|
+
}, z.core.$strict>;
|
|
22
|
+
export type ListContainerDocumentLanesRequest = z.infer<typeof ListContainerDocumentLanesRequestSchema>;
|
|
23
|
+
export declare function isListContainerDocumentLanesRequest(value: unknown): value is ListContainerDocumentLanesRequest;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { containerDocumentLaneRequestPageTotalRefinement, containerDocumentLaneRequestUniqueIdsRefinement, } from "../containerReadRefinements.js";
|
|
3
|
+
import { ContainerReadLaneIdSchema, ContainerReadLaneWatermarkSchema, MAX_CONTAINER_DOCUMENT_LANES, MAX_CONTAINER_READ_LANE_BATCH_PAGE_TOTAL, refineContainerReadLaneRequests, } from "../containerReadSchemas.js";
|
|
4
|
+
import { registerJsonSchemaRuntimeRefinements, registerJsonSchemaView, } from "../jsonSchema.js";
|
|
5
|
+
import { boundedNonEmptyArraySchema, boundedPositiveIntegerSchema, uuidV4StringSchema, } from "../schema.js";
|
|
6
|
+
export { DEFAULT_CONTAINER_READ_LANE_PAGE_LIMIT as DEFAULT_CONTAINER_DOCUMENT_LANE_PAGE_LIMIT, MAX_CONTAINER_DOCUMENT_LANES, MAX_CONTAINER_READ_LANE_BATCH_PAGE_TOTAL as MAX_CONTAINER_DOCUMENT_LANE_PAGE_TOTAL, } from "../containerReadSchemas.js";
|
|
7
|
+
const ContainerDocumentLaneRequestSchema = z.strictObject({
|
|
8
|
+
containerId: uuidV4StringSchema,
|
|
9
|
+
laneId: ContainerReadLaneIdSchema,
|
|
10
|
+
limit: boundedPositiveIntegerSchema(MAX_CONTAINER_READ_LANE_BATCH_PAGE_TOTAL).optional(),
|
|
11
|
+
watermark: ContainerReadLaneWatermarkSchema.nullable(),
|
|
12
|
+
});
|
|
13
|
+
const ListContainerDocumentLanesRequestViewSchema = z.strictObject({
|
|
14
|
+
lanes: boundedNonEmptyArraySchema(ContainerDocumentLaneRequestSchema, MAX_CONTAINER_DOCUMENT_LANES),
|
|
15
|
+
});
|
|
16
|
+
export const ListContainerDocumentLanesRequestSchema = registerJsonSchemaRuntimeRefinements(registerJsonSchemaView(ListContainerDocumentLanesRequestViewSchema.superRefine(refineContainerReadLaneRequests("Container document lane")), ListContainerDocumentLanesRequestViewSchema), [
|
|
17
|
+
containerDocumentLaneRequestUniqueIdsRefinement,
|
|
18
|
+
containerDocumentLaneRequestPageTotalRefinement,
|
|
19
|
+
]);
|
|
20
|
+
export function isListContainerDocumentLanesRequest(value) {
|
|
21
|
+
return ListContainerDocumentLanesRequestSchema.safeParse(value).success;
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=containerDocumentLanes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"containerDocumentLanes.js","sourceRoot":"","sources":["containerDocumentLanes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,+CAA+C,EAC/C,+CAA+C,GAChD,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACL,yBAAyB,EACzB,gCAAgC,EAChC,4BAA4B,EAC5B,wCAAwC,EACxC,+BAA+B,GAChC,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,oCAAoC,EACpC,sBAAsB,GACvB,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,0BAA0B,EAC1B,4BAA4B,EAC5B,kBAAkB,GACnB,MAAM,WAAW,CAAC;AAEnB,OAAO,EACL,sCAAsC,IAAI,0CAA0C,EACpF,4BAA4B,EAC5B,wCAAwC,IAAI,sCAAsC,GACnF,MAAM,yBAAyB,CAAC;AAEjC,MAAM,kCAAkC,GAAG,CAAC,CAAC,YAAY,CAAC;IACxD,WAAW,EAAE,kBAAkB;IAC/B,MAAM,EAAE,yBAAyB;IACjC,KAAK,EAAE,4BAA4B,CACjC,wCAAwC,CACzC,CAAC,QAAQ,EAAE;IACZ,SAAS,EAAE,gCAAgC,CAAC,QAAQ,EAAE;CACvD,CAAC,CAAC;AAEH,MAAM,2CAA2C,GAAG,CAAC,CAAC,YAAY,CAAC;IACjE,KAAK,EAAE,0BAA0B,CAC/B,kCAAkC,EAClC,4BAA4B,CAC7B;CACF,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,uCAAuC,GAClD,oCAAoC,CAClC,sBAAsB,CACpB,2CAA2C,CAAC,WAAW,CACrD,+BAA+B,CAAC,yBAAyB,CAAC,CAC3D,EACD,2CAA2C,CAC5C,EACD;IACE,+CAA+C;IAC/C,+CAA+C;CAChD,CACF,CAAC;AAMJ,MAAM,UAAU,mCAAmC,CACjD,KAAc;IAEd,OAAO,uCAAuC,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC;AAC1E,CAAC","sourcesContent":["import { z } from \"zod\";\nimport {\n containerDocumentLaneRequestPageTotalRefinement,\n containerDocumentLaneRequestUniqueIdsRefinement,\n} from \"../containerReadRefinements\";\nimport {\n ContainerReadLaneIdSchema,\n ContainerReadLaneWatermarkSchema,\n MAX_CONTAINER_DOCUMENT_LANES,\n MAX_CONTAINER_READ_LANE_BATCH_PAGE_TOTAL,\n refineContainerReadLaneRequests,\n} from \"../containerReadSchemas\";\nimport {\n registerJsonSchemaRuntimeRefinements,\n registerJsonSchemaView,\n} from \"../jsonSchema\";\nimport {\n boundedNonEmptyArraySchema,\n boundedPositiveIntegerSchema,\n uuidV4StringSchema,\n} from \"../schema\";\n\nexport {\n DEFAULT_CONTAINER_READ_LANE_PAGE_LIMIT as DEFAULT_CONTAINER_DOCUMENT_LANE_PAGE_LIMIT,\n MAX_CONTAINER_DOCUMENT_LANES,\n MAX_CONTAINER_READ_LANE_BATCH_PAGE_TOTAL as MAX_CONTAINER_DOCUMENT_LANE_PAGE_TOTAL,\n} from \"../containerReadSchemas\";\n\nconst ContainerDocumentLaneRequestSchema = z.strictObject({\n containerId: uuidV4StringSchema,\n laneId: ContainerReadLaneIdSchema,\n limit: boundedPositiveIntegerSchema(\n MAX_CONTAINER_READ_LANE_BATCH_PAGE_TOTAL,\n ).optional(),\n watermark: ContainerReadLaneWatermarkSchema.nullable(),\n});\n\nconst ListContainerDocumentLanesRequestViewSchema = z.strictObject({\n lanes: boundedNonEmptyArraySchema(\n ContainerDocumentLaneRequestSchema,\n MAX_CONTAINER_DOCUMENT_LANES,\n ),\n});\n\nexport const ListContainerDocumentLanesRequestSchema =\n registerJsonSchemaRuntimeRefinements(\n registerJsonSchemaView(\n ListContainerDocumentLanesRequestViewSchema.superRefine(\n refineContainerReadLaneRequests(\"Container document lane\"),\n ),\n ListContainerDocumentLanesRequestViewSchema,\n ),\n [\n containerDocumentLaneRequestUniqueIdsRefinement,\n containerDocumentLaneRequestPageTotalRefinement,\n ],\n );\n\nexport type ListContainerDocumentLanesRequest = z.infer<\n typeof ListContainerDocumentLanesRequestSchema\n>;\n\nexport function isListContainerDocumentLanesRequest(\n value: unknown,\n): value is ListContainerDocumentLanesRequest {\n return ListContainerDocumentLanesRequestSchema.safeParse(value).success;\n}\n"]}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type { z } from "zod";
|
|
2
|
+
/**
|
|
3
|
+
* A reference to a container access manifest the server already stores, in lieu
|
|
4
|
+
* of re-embedding the full signed manifest bundle. The server resolves the full
|
|
5
|
+
* manifest from its own store by `manifestHash` and pins it to the container's
|
|
6
|
+
* current head, so the reference carries the same authority as the full bundle
|
|
7
|
+
* without the multi-KB signature. `containerId` is advisory: the server keys the
|
|
8
|
+
* head lookup off the resolved bundle's own containerId and rejects a mismatch.
|
|
9
|
+
*/
|
|
10
|
+
export declare const ContainerManifestRefSchema: z.ZodType<{
|
|
11
|
+
containerId: string;
|
|
12
|
+
manifestHash: string;
|
|
13
|
+
}, {
|
|
14
|
+
containerId: string;
|
|
15
|
+
manifestHash: string;
|
|
16
|
+
}, z.core.$ZodTypeInternals<{
|
|
17
|
+
containerId: string;
|
|
18
|
+
manifestHash: string;
|
|
19
|
+
}, {
|
|
20
|
+
containerId: string;
|
|
21
|
+
manifestHash: string;
|
|
22
|
+
}>>;
|
|
23
|
+
export type ContainerManifestRef = z.infer<typeof ContainerManifestRefSchema>;
|
|
24
|
+
/** A root→leaf container path, cited by manifest reference. */
|
|
25
|
+
export declare const ContainerManifestPathSchema: z.ZodCustom<{
|
|
26
|
+
containerId: string;
|
|
27
|
+
manifestHash: string;
|
|
28
|
+
}[], {
|
|
29
|
+
containerId: string;
|
|
30
|
+
manifestHash: string;
|
|
31
|
+
}[]>;
|
|
32
|
+
/**
|
|
33
|
+
* A path that may be empty: a root container create cites no parent. Bounded
|
|
34
|
+
* by the same depth ceiling as a non-empty path.
|
|
35
|
+
*/
|
|
36
|
+
export declare const OptionalContainerManifestPathSchema: z.ZodCustom<{
|
|
37
|
+
containerId: string;
|
|
38
|
+
manifestHash: string;
|
|
39
|
+
}[], {
|
|
40
|
+
containerId: string;
|
|
41
|
+
manifestHash: string;
|
|
42
|
+
}[]>;
|
|
43
|
+
/**
|
|
44
|
+
* Stored manifests of one container, cited by reference. A container's lineage
|
|
45
|
+
* has no fixed length; the ceiling keeps the capacity inline bundles had under
|
|
46
|
+
* the request-body bound (see `MAX_CONTAINER_MANIFEST_HISTORY_REFS`).
|
|
47
|
+
*/
|
|
48
|
+
export declare const ContainerManifestRefListSchema: z.ZodCustom<{
|
|
49
|
+
containerId: string;
|
|
50
|
+
manifestHash: string;
|
|
51
|
+
}[], {
|
|
52
|
+
containerId: string;
|
|
53
|
+
manifestHash: string;
|
|
54
|
+
}[]>;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { arraySchema, boundedNonEmptyArraySchema, loosePlainObject, nonEmptyStringSchema, } from "../schema.js";
|
|
2
|
+
import { MAX_CONTAINER_MANIFEST_HISTORY_REFS, MAX_CONTAINER_PATH_LENGTH, } from "../util/containerLimits.js";
|
|
3
|
+
/**
|
|
4
|
+
* A reference to a container access manifest the server already stores, in lieu
|
|
5
|
+
* of re-embedding the full signed manifest bundle. The server resolves the full
|
|
6
|
+
* manifest from its own store by `manifestHash` and pins it to the container's
|
|
7
|
+
* current head, so the reference carries the same authority as the full bundle
|
|
8
|
+
* without the multi-KB signature. `containerId` is advisory: the server keys the
|
|
9
|
+
* head lookup off the resolved bundle's own containerId and rejects a mismatch.
|
|
10
|
+
*/
|
|
11
|
+
export const ContainerManifestRefSchema = loosePlainObject({
|
|
12
|
+
containerId: nonEmptyStringSchema,
|
|
13
|
+
manifestHash: nonEmptyStringSchema,
|
|
14
|
+
});
|
|
15
|
+
/** A root→leaf container path, cited by manifest reference. */
|
|
16
|
+
export const ContainerManifestPathSchema = boundedNonEmptyArraySchema(ContainerManifestRefSchema, MAX_CONTAINER_PATH_LENGTH);
|
|
17
|
+
/**
|
|
18
|
+
* A path that may be empty: a root container create cites no parent. Bounded
|
|
19
|
+
* by the same depth ceiling as a non-empty path.
|
|
20
|
+
*/
|
|
21
|
+
export const OptionalContainerManifestPathSchema = arraySchema(ContainerManifestRefSchema, MAX_CONTAINER_PATH_LENGTH);
|
|
22
|
+
/**
|
|
23
|
+
* Stored manifests of one container, cited by reference. A container's lineage
|
|
24
|
+
* has no fixed length; the ceiling keeps the capacity inline bundles had under
|
|
25
|
+
* the request-body bound (see `MAX_CONTAINER_MANIFEST_HISTORY_REFS`).
|
|
26
|
+
*/
|
|
27
|
+
export const ContainerManifestRefListSchema = arraySchema(ContainerManifestRefSchema, MAX_CONTAINER_MANIFEST_HISTORY_REFS);
|
|
28
|
+
//# sourceMappingURL=containerManifestRef.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"containerManifestRef.js","sourceRoot":"","sources":["containerManifestRef.ts"],"names":[],"mappings":"AACA,OAAO,EACL,WAAW,EACX,0BAA0B,EAC1B,gBAAgB,EAChB,oBAAoB,GACrB,MAAM,WAAW,CAAC;AACnB,OAAO,EACL,mCAAmC,EACnC,yBAAyB,GAC1B,MAAM,yBAAyB,CAAC;AAEjC;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,gBAAgB,CAAC;IACzD,WAAW,EAAE,oBAAoB;IACjC,YAAY,EAAE,oBAAoB;CACnC,CAAC,CAAC;AAIH,+DAA+D;AAC/D,MAAM,CAAC,MAAM,2BAA2B,GAAG,0BAA0B,CACnE,0BAA0B,EAC1B,yBAAyB,CAC1B,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,MAAM,mCAAmC,GAAG,WAAW,CAC5D,0BAA0B,EAC1B,yBAAyB,CAC1B,CAAC;AAEF;;;;GAIG;AACH,MAAM,CAAC,MAAM,8BAA8B,GAAG,WAAW,CACvD,0BAA0B,EAC1B,mCAAmC,CACpC,CAAC","sourcesContent":["import type { z } from \"zod\";\nimport {\n arraySchema,\n boundedNonEmptyArraySchema,\n loosePlainObject,\n nonEmptyStringSchema,\n} from \"../schema\";\nimport {\n MAX_CONTAINER_MANIFEST_HISTORY_REFS,\n MAX_CONTAINER_PATH_LENGTH,\n} from \"../util/containerLimits\";\n\n/**\n * A reference to a container access manifest the server already stores, in lieu\n * of re-embedding the full signed manifest bundle. The server resolves the full\n * manifest from its own store by `manifestHash` and pins it to the container's\n * current head, so the reference carries the same authority as the full bundle\n * without the multi-KB signature. `containerId` is advisory: the server keys the\n * head lookup off the resolved bundle's own containerId and rejects a mismatch.\n */\nexport const ContainerManifestRefSchema = loosePlainObject({\n containerId: nonEmptyStringSchema,\n manifestHash: nonEmptyStringSchema,\n});\n\nexport type ContainerManifestRef = z.infer<typeof ContainerManifestRefSchema>;\n\n/** A root→leaf container path, cited by manifest reference. */\nexport const ContainerManifestPathSchema = boundedNonEmptyArraySchema(\n ContainerManifestRefSchema,\n MAX_CONTAINER_PATH_LENGTH,\n);\n\n/**\n * A path that may be empty: a root container create cites no parent. Bounded\n * by the same depth ceiling as a non-empty path.\n */\nexport const OptionalContainerManifestPathSchema = arraySchema(\n ContainerManifestRefSchema,\n MAX_CONTAINER_PATH_LENGTH,\n);\n\n/**\n * Stored manifests of one container, cited by reference. A container's lineage\n * has no fixed length; the ceiling keeps the capacity inline bundles had under\n * the request-body bound (see `MAX_CONTAINER_MANIFEST_HISTORY_REFS`).\n */\nexport const ContainerManifestRefListSchema = arraySchema(\n ContainerManifestRefSchema,\n MAX_CONTAINER_MANIFEST_HISTORY_REFS,\n);\n"]}
|