@cloudpdf/contract 3.0.0-next.6 → 3.0.0-next.8
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/index.js +35 -13
- package/dist/index.js.map +1 -1
- package/dist/openapi.js +35 -13
- package/dist/openapi.js.map +1 -1
- package/openapi.json +29 -15
- package/package.json +2 -2
package/dist/openapi.js
CHANGED
|
@@ -55,7 +55,9 @@ var adminWirePaths = {
|
|
|
55
55
|
/** Deployment-global singletons: API-token only, no tenant context. */
|
|
56
56
|
deploymentLicenseStatus: "/v1/deployment/license/status"
|
|
57
57
|
};
|
|
58
|
-
var DedupModeSchema = z.enum(["always-create", "reuse-existing"])
|
|
58
|
+
var DedupModeSchema = z.enum(["always-create", "reuse-existing"]).describe(
|
|
59
|
+
"always-create (default) creates a new document every time. reuse-existing returns a document that already holds the same content instead of storing it twice."
|
|
60
|
+
);
|
|
59
61
|
var UploadPreferenceSchema = z.enum(["auto", "presigned", "proxy"]);
|
|
60
62
|
var DocumentStateSchema = z.enum(["pending", "ready", "failed", "deleting"]);
|
|
61
63
|
var AdminDocumentRecordSchema = z.object({
|
|
@@ -128,15 +130,27 @@ var utf8ByteLength = (s) => new TextEncoder().encode(s).length;
|
|
|
128
130
|
var AdminImportSourceSchema = z.discriminatedUnion("kind", [
|
|
129
131
|
z.object({
|
|
130
132
|
kind: z.literal("url"),
|
|
131
|
-
url: z.string().url().max(8192)
|
|
132
|
-
|
|
133
|
+
url: z.string().url().max(8192).describe(
|
|
134
|
+
"The URL to fetch. Must be allowed by the deployment import policy (scheme, network range, size) and must declare a length."
|
|
135
|
+
)
|
|
136
|
+
}).describe(
|
|
137
|
+
"The caller supplies the authority: a presigned S3/GCS/Azure/R2/MinIO GET, or any HTTPS endpoint the deployment import policy allows. The URL is a capability \u2014 treat it as a secret. CloudPDF never echoes its query string back in errors, logs, or stored failure reasons."
|
|
138
|
+
),
|
|
133
139
|
z.object({
|
|
134
140
|
kind: z.literal("connection"),
|
|
135
|
-
connectionId: z.string().min(1).max(128),
|
|
136
|
-
key: z.string().min(1).refine((k) => !k.includes("\0"), "key must not contain NUL").refine((k) => utf8ByteLength(k) <= 1024, "key must be at most 1024 UTF-8 bytes")
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
141
|
+
connectionId: z.string().min(1).max(128).describe("The operator-registered storage connection to read from."),
|
|
142
|
+
key: z.string().min(1).refine((k) => !k.includes("\0"), "key must not contain NUL").refine((k) => utf8ByteLength(k) <= 1024, "key must be at most 1024 UTF-8 bytes").describe(
|
|
143
|
+
"The object key to read, inside the connection's configured scope. At most 1024 UTF-8 bytes."
|
|
144
|
+
),
|
|
145
|
+
revision: z.string().min(1).max(1024).optional().describe(
|
|
146
|
+
"Pins a specific version of the object. Provider-interpreted (S3 VersionId, GCS generation, Azure version id); providers without versioning reject it."
|
|
147
|
+
)
|
|
148
|
+
}).describe(
|
|
149
|
+
"The operator pre-registered the authority: the request names a connection and a key inside it. Which provider backs the connection (S3, GCS, Azure Blob, filesystem, ...) is deployment configuration, never wire surface."
|
|
150
|
+
)
|
|
151
|
+
]).describe(
|
|
152
|
+
"Where CloudPDF pulls the bytes from. The two shapes differ in WHO supplies the authority to read, not in which storage vendor holds the file."
|
|
153
|
+
);
|
|
140
154
|
var AdminDocumentImportRequestSchema = z.object({
|
|
141
155
|
source: AdminImportSourceSchema,
|
|
142
156
|
/**
|
|
@@ -148,11 +162,17 @@ var AdminDocumentImportRequestSchema = z.object({
|
|
|
148
162
|
* hash the server cannot know what content to reuse.
|
|
149
163
|
*/
|
|
150
164
|
expected: z.object({
|
|
151
|
-
sizeBytes: z.number().int().min(1).optional(),
|
|
152
|
-
sha256: z.string().regex(sha256Hex).optional()
|
|
153
|
-
|
|
165
|
+
sizeBytes: z.number().int().min(1).optional().describe("Checked against the source's declared Content-Length before the transfer."),
|
|
166
|
+
sha256: z.string().regex(sha256Hex).optional().describe(
|
|
167
|
+
"Checked against the server-observed digest after the transfer. Required when dedupMode is reuse-existing."
|
|
168
|
+
)
|
|
169
|
+
}).optional().describe(
|
|
170
|
+
"Integrity pins, enforced when present. When absent, the server-observed values become authoritative."
|
|
171
|
+
),
|
|
154
172
|
metadata: z.record(z.string(), z.unknown()).optional(),
|
|
155
|
-
idempotencyKey: z.string().optional()
|
|
173
|
+
idempotencyKey: z.string().optional().describe(
|
|
174
|
+
"Retrying with the same key resumes the same document rather than importing a second copy \u2014 including after a 502."
|
|
175
|
+
),
|
|
156
176
|
dedupMode: DedupModeSchema.optional(),
|
|
157
177
|
docId: z.string().regex(docIdPattern).optional(),
|
|
158
178
|
/**
|
|
@@ -164,7 +184,9 @@ var AdminDocumentImportRequestSchema = z.object({
|
|
|
164
184
|
* additionally require `expected.sha256`, since they have no
|
|
165
185
|
* revisions to pin retries to.
|
|
166
186
|
*/
|
|
167
|
-
mode: z.enum(["sync", "async"]).optional()
|
|
187
|
+
mode: z.enum(["sync", "async"]).optional().describe(
|
|
188
|
+
"sync (default) holds the response open for the whole transfer. async answers 202 with the document pending and transfers in the background; it requires a connection source, and filesystem connections additionally require expected.sha256."
|
|
189
|
+
)
|
|
168
190
|
});
|
|
169
191
|
var AdminDocumentImportResponseSchema = z.object({
|
|
170
192
|
/**
|