@cloudpdf/sdk 3.0.0-next.5 → 3.0.0-next.7
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/cjs/BaseClient.js +2 -2
- package/dist/cjs/api/errors/BadGatewayError.d.ts +7 -0
- package/dist/cjs/api/errors/BadGatewayError.js +54 -0
- package/dist/cjs/api/errors/index.d.ts +1 -0
- package/dist/cjs/api/errors/index.js +1 -0
- package/dist/cjs/api/resources/documents/client/Client.d.ts +23 -0
- package/dist/cjs/api/resources/documents/client/Client.js +69 -0
- package/dist/cjs/api/resources/documents/client/requests/DocumentsImportFromRequest.d.ts +49 -0
- package/dist/cjs/api/resources/documents/client/requests/DocumentsImportFromRequest.js +17 -0
- package/dist/cjs/api/resources/documents/client/requests/DocumentsInitRequest.d.ts +2 -0
- package/dist/cjs/api/resources/documents/client/requests/DocumentsInitRequest.js +1 -0
- package/dist/cjs/api/resources/documents/client/requests/index.d.ts +1 -0
- package/dist/cjs/api/resources/documents/client/requests/index.js +3 -1
- package/dist/cjs/api/resources/documents/types/DocumentsImportFromRequestSource.d.ts +27 -0
- package/dist/cjs/api/resources/documents/types/DocumentsImportFromRequestSource.js +3 -0
- package/dist/cjs/api/resources/documents/types/index.d.ts +1 -0
- package/dist/cjs/api/resources/documents/types/index.js +1 -0
- package/dist/cjs/api/types/DocumentsImportFrom200Response.d.ts +43 -0
- package/dist/cjs/api/types/DocumentsImportFrom200Response.js +27 -0
- package/dist/cjs/api/types/DocumentsImportFrom202Response.d.ts +43 -0
- package/dist/cjs/api/types/DocumentsImportFrom202Response.js +27 -0
- package/dist/cjs/api/types/DocumentsImportFrom400Response.d.ts +9 -0
- package/dist/cjs/api/types/DocumentsImportFrom400Response.js +3 -0
- package/dist/cjs/api/types/DocumentsImportFrom403Response.d.ts +9 -0
- package/dist/cjs/api/types/DocumentsImportFrom403Response.js +3 -0
- package/dist/cjs/api/types/DocumentsImportFrom502Response.d.ts +9 -0
- package/dist/cjs/api/types/DocumentsImportFrom502Response.js +3 -0
- package/dist/cjs/api/types/index.d.ts +5 -0
- package/dist/cjs/api/types/index.js +5 -0
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/BaseClient.mjs +2 -2
- package/dist/esm/api/errors/BadGatewayError.d.mts +7 -0
- package/dist/esm/api/errors/BadGatewayError.mjs +17 -0
- package/dist/esm/api/errors/index.d.mts +1 -0
- package/dist/esm/api/errors/index.mjs +1 -0
- package/dist/esm/api/resources/documents/client/Client.d.mts +23 -0
- package/dist/esm/api/resources/documents/client/Client.mjs +69 -0
- package/dist/esm/api/resources/documents/client/requests/DocumentsImportFromRequest.d.mts +49 -0
- package/dist/esm/api/resources/documents/client/requests/DocumentsImportFromRequest.mjs +14 -0
- package/dist/esm/api/resources/documents/client/requests/DocumentsInitRequest.d.mts +2 -0
- package/dist/esm/api/resources/documents/client/requests/DocumentsInitRequest.mjs +1 -0
- package/dist/esm/api/resources/documents/client/requests/index.d.mts +1 -0
- package/dist/esm/api/resources/documents/client/requests/index.mjs +1 -0
- package/dist/esm/api/resources/documents/types/DocumentsImportFromRequestSource.d.mts +27 -0
- package/dist/esm/api/resources/documents/types/DocumentsImportFromRequestSource.mjs +2 -0
- package/dist/esm/api/resources/documents/types/index.d.mts +1 -0
- package/dist/esm/api/resources/documents/types/index.mjs +1 -0
- package/dist/esm/api/types/DocumentsImportFrom200Response.d.mts +43 -0
- package/dist/esm/api/types/DocumentsImportFrom200Response.mjs +24 -0
- package/dist/esm/api/types/DocumentsImportFrom202Response.d.mts +43 -0
- package/dist/esm/api/types/DocumentsImportFrom202Response.mjs +24 -0
- package/dist/esm/api/types/DocumentsImportFrom400Response.d.mts +9 -0
- package/dist/esm/api/types/DocumentsImportFrom400Response.mjs +2 -0
- package/dist/esm/api/types/DocumentsImportFrom403Response.d.mts +9 -0
- package/dist/esm/api/types/DocumentsImportFrom403Response.mjs +2 -0
- package/dist/esm/api/types/DocumentsImportFrom502Response.d.mts +9 -0
- package/dist/esm/api/types/DocumentsImportFrom502Response.mjs +2 -0
- package/dist/esm/api/types/index.d.mts +5 -0
- package/dist/esm/api/types/index.mjs +5 -0
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
- package/reference.md +69 -0
|
@@ -113,6 +113,29 @@ export declare class DocumentsClient {
|
|
|
113
113
|
*/
|
|
114
114
|
uploadProxy(request: CloudPDF.UploadProxyDocumentsRequest, requestOptions?: DocumentsClient.RequestOptions): core.HttpResponsePromise<CloudPDF.DocumentsUploadProxy200Response>;
|
|
115
115
|
private __uploadProxy;
|
|
116
|
+
/**
|
|
117
|
+
* Default mode is synchronous and bounded: the response returns only after the transfer verified and committed (or failed). mode=async (connection sources only) answers 202 immediately and an in-process worker performs the transfer with leased, fenced retries; poll the document until ready/failed. The deployment import policy gates scheme, network range, and size; sources must declare a length. CloudPDF copies and owns the bytes — the source is never referenced in place. A 502 marks a retryable upstream failure: retry with the same idempotencyKey to resume the same document. URL sources are capabilities and never echoed back. Connection sources name operator-registered storage (bucket/prefix scope, allowed credential classes, and tenant bindings are deployment configuration); `revision` is provider-interpreted (S3 VersionId, GCS generation, Azure version id).
|
|
118
|
+
*
|
|
119
|
+
* @param {CloudPDF.DocumentsImportFromRequest} request
|
|
120
|
+
* @param {DocumentsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
121
|
+
*
|
|
122
|
+
* @throws {@link CloudPDF.BadRequestError}
|
|
123
|
+
* @throws {@link CloudPDF.ForbiddenError}
|
|
124
|
+
* @throws {@link CloudPDF.BadGatewayError}
|
|
125
|
+
* @throws {@link errors.CloudPDFError}
|
|
126
|
+
* @throws {@link errors.CloudPDFTimeoutError}
|
|
127
|
+
*
|
|
128
|
+
* @example
|
|
129
|
+
* await client.documents.importFrom({
|
|
130
|
+
* tenantId: "tenantId",
|
|
131
|
+
* source: {
|
|
132
|
+
* kind: "url",
|
|
133
|
+
* url: "url"
|
|
134
|
+
* }
|
|
135
|
+
* })
|
|
136
|
+
*/
|
|
137
|
+
importFrom(request: CloudPDF.DocumentsImportFromRequest, requestOptions?: DocumentsClient.RequestOptions): core.HttpResponsePromise<CloudPDF.DocumentsImportFrom200Response>;
|
|
138
|
+
private __importFrom;
|
|
116
139
|
/**
|
|
117
140
|
* @param {CloudPDF.DocumentsInitRequest} request
|
|
118
141
|
* @param {DocumentsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -417,6 +417,75 @@ export class DocumentsClient {
|
|
|
417
417
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v1/tenants/{tenantId}/documents/{id}/upload-proxy");
|
|
418
418
|
});
|
|
419
419
|
}
|
|
420
|
+
/**
|
|
421
|
+
* Default mode is synchronous and bounded: the response returns only after the transfer verified and committed (or failed). mode=async (connection sources only) answers 202 immediately and an in-process worker performs the transfer with leased, fenced retries; poll the document until ready/failed. The deployment import policy gates scheme, network range, and size; sources must declare a length. CloudPDF copies and owns the bytes — the source is never referenced in place. A 502 marks a retryable upstream failure: retry with the same idempotencyKey to resume the same document. URL sources are capabilities and never echoed back. Connection sources name operator-registered storage (bucket/prefix scope, allowed credential classes, and tenant bindings are deployment configuration); `revision` is provider-interpreted (S3 VersionId, GCS generation, Azure version id).
|
|
422
|
+
*
|
|
423
|
+
* @param {CloudPDF.DocumentsImportFromRequest} request
|
|
424
|
+
* @param {DocumentsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
425
|
+
*
|
|
426
|
+
* @throws {@link CloudPDF.BadRequestError}
|
|
427
|
+
* @throws {@link CloudPDF.ForbiddenError}
|
|
428
|
+
* @throws {@link CloudPDF.BadGatewayError}
|
|
429
|
+
* @throws {@link errors.CloudPDFError}
|
|
430
|
+
* @throws {@link errors.CloudPDFTimeoutError}
|
|
431
|
+
*
|
|
432
|
+
* @example
|
|
433
|
+
* await client.documents.importFrom({
|
|
434
|
+
* tenantId: "tenantId",
|
|
435
|
+
* source: {
|
|
436
|
+
* kind: "url",
|
|
437
|
+
* url: "url"
|
|
438
|
+
* }
|
|
439
|
+
* })
|
|
440
|
+
*/
|
|
441
|
+
importFrom(request, requestOptions) {
|
|
442
|
+
return core.HttpResponsePromise.fromPromise(this.__importFrom(request, requestOptions));
|
|
443
|
+
}
|
|
444
|
+
__importFrom(request, requestOptions) {
|
|
445
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
446
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
447
|
+
const { tenantId } = request, _body = __rest(request, ["tenantId"]);
|
|
448
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
449
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
450
|
+
const _response = yield core.fetcher({
|
|
451
|
+
url: core.url.join((_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment)), `v1/tenants/${core.url.encodePathParam(tenantId)}/documents/import`),
|
|
452
|
+
method: "POST",
|
|
453
|
+
headers: _headers,
|
|
454
|
+
contentType: "application/json",
|
|
455
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
456
|
+
requestType: "json",
|
|
457
|
+
body: mergeAdditionalBodyParameters(_body, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.additionalBodyParameters),
|
|
458
|
+
timeoutMs: ((_e = (_c = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _c !== void 0 ? _c : (_d = this._options) === null || _d === void 0 ? void 0 : _d.timeoutInSeconds) !== null && _e !== void 0 ? _e : 60) * 1000,
|
|
459
|
+
maxRetries: (_f = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _f !== void 0 ? _f : (_g = this._options) === null || _g === void 0 ? void 0 : _g.maxRetries,
|
|
460
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
461
|
+
fetchFn: (_h = this._options) === null || _h === void 0 ? void 0 : _h.fetch,
|
|
462
|
+
logging: this._options.logging,
|
|
463
|
+
});
|
|
464
|
+
if (_response.ok) {
|
|
465
|
+
return {
|
|
466
|
+
data: _response.body,
|
|
467
|
+
rawResponse: _response.rawResponse,
|
|
468
|
+
};
|
|
469
|
+
}
|
|
470
|
+
if (_response.error.reason === "status-code") {
|
|
471
|
+
switch (_response.error.statusCode) {
|
|
472
|
+
case 400:
|
|
473
|
+
throw new CloudPDF.BadRequestError(_response.error.body, _response.rawResponse);
|
|
474
|
+
case 403:
|
|
475
|
+
throw new CloudPDF.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
476
|
+
case 502:
|
|
477
|
+
throw new CloudPDF.BadGatewayError(_response.error.body, _response.rawResponse);
|
|
478
|
+
default:
|
|
479
|
+
throw new errors.CloudPDFError({
|
|
480
|
+
statusCode: _response.error.statusCode,
|
|
481
|
+
body: _response.error.body,
|
|
482
|
+
rawResponse: _response.rawResponse,
|
|
483
|
+
});
|
|
484
|
+
}
|
|
485
|
+
}
|
|
486
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v1/tenants/{tenantId}/documents/import");
|
|
487
|
+
});
|
|
488
|
+
}
|
|
420
489
|
/**
|
|
421
490
|
* @param {CloudPDF.DocumentsInitRequest} request
|
|
422
491
|
* @param {DocumentsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type * as CloudPDF from "../../../../index.mjs";
|
|
2
|
+
/**
|
|
3
|
+
* @example
|
|
4
|
+
* {
|
|
5
|
+
* tenantId: "tenantId",
|
|
6
|
+
* source: {
|
|
7
|
+
* kind: "url",
|
|
8
|
+
* url: "url"
|
|
9
|
+
* }
|
|
10
|
+
* }
|
|
11
|
+
*/
|
|
12
|
+
export interface DocumentsImportFromRequest {
|
|
13
|
+
tenantId: string;
|
|
14
|
+
/** 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. */
|
|
15
|
+
source: CloudPDF.DocumentsImportFromRequestSource;
|
|
16
|
+
/** Integrity pins, enforced when present. When absent, the server-observed values become authoritative. */
|
|
17
|
+
expected?: DocumentsImportFromRequest.Expected;
|
|
18
|
+
metadata?: Record<string, unknown>;
|
|
19
|
+
/** Retrying with the same key resumes the same document rather than importing a second copy — including after a 502. */
|
|
20
|
+
idempotencyKey?: string;
|
|
21
|
+
/** 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. */
|
|
22
|
+
dedupMode?: DocumentsImportFromRequest.DedupMode;
|
|
23
|
+
docId?: string;
|
|
24
|
+
/** 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. */
|
|
25
|
+
mode?: DocumentsImportFromRequest.Mode;
|
|
26
|
+
}
|
|
27
|
+
export declare namespace DocumentsImportFromRequest {
|
|
28
|
+
/**
|
|
29
|
+
* Integrity pins, enforced when present. When absent, the server-observed values become authoritative.
|
|
30
|
+
*/
|
|
31
|
+
interface Expected {
|
|
32
|
+
/** Checked against the source's declared Content-Length before the transfer. */
|
|
33
|
+
sizeBytes?: number | undefined;
|
|
34
|
+
/** Checked against the server-observed digest after the transfer. Required when dedupMode is reuse-existing. */
|
|
35
|
+
sha256?: string | undefined;
|
|
36
|
+
}
|
|
37
|
+
/** 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. */
|
|
38
|
+
const DedupMode: {
|
|
39
|
+
readonly AlwaysCreate: "always-create";
|
|
40
|
+
readonly ReuseExisting: "reuse-existing";
|
|
41
|
+
};
|
|
42
|
+
type DedupMode = (typeof DedupMode)[keyof typeof DedupMode];
|
|
43
|
+
/** 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. */
|
|
44
|
+
const Mode: {
|
|
45
|
+
readonly Sync: "sync";
|
|
46
|
+
readonly Async: "async";
|
|
47
|
+
};
|
|
48
|
+
type Mode = (typeof Mode)[keyof typeof Mode];
|
|
49
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
export var DocumentsImportFromRequest;
|
|
3
|
+
(function (DocumentsImportFromRequest) {
|
|
4
|
+
/** 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. */
|
|
5
|
+
DocumentsImportFromRequest.DedupMode = {
|
|
6
|
+
AlwaysCreate: "always-create",
|
|
7
|
+
ReuseExisting: "reuse-existing",
|
|
8
|
+
};
|
|
9
|
+
/** 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. */
|
|
10
|
+
DocumentsImportFromRequest.Mode = {
|
|
11
|
+
Sync: "sync",
|
|
12
|
+
Async: "async",
|
|
13
|
+
};
|
|
14
|
+
})(DocumentsImportFromRequest || (DocumentsImportFromRequest = {}));
|
|
@@ -12,12 +12,14 @@ export interface DocumentsInitRequest {
|
|
|
12
12
|
contentSha256: string;
|
|
13
13
|
metadata?: Record<string, unknown>;
|
|
14
14
|
idempotencyKey?: string;
|
|
15
|
+
/** 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. */
|
|
15
16
|
dedupMode?: DocumentsInitRequest.DedupMode;
|
|
16
17
|
docId?: string;
|
|
17
18
|
uploadTtlSec?: number;
|
|
18
19
|
uploadPreference?: DocumentsInitRequest.UploadPreference;
|
|
19
20
|
}
|
|
20
21
|
export declare namespace DocumentsInitRequest {
|
|
22
|
+
/** 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. */
|
|
21
23
|
const DedupMode: {
|
|
22
24
|
readonly AlwaysCreate: "always-create";
|
|
23
25
|
readonly ReuseExisting: "reuse-existing";
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// This file was auto-generated by Fern from our API Definition.
|
|
2
2
|
export var DocumentsInitRequest;
|
|
3
3
|
(function (DocumentsInitRequest) {
|
|
4
|
+
/** 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. */
|
|
4
5
|
DocumentsInitRequest.DedupMode = {
|
|
5
6
|
AlwaysCreate: "always-create",
|
|
6
7
|
ReuseExisting: "reuse-existing",
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export type { DeleteDocumentsRequest } from "./DeleteDocumentsRequest.mjs";
|
|
2
2
|
export type { DocumentsCommitRequest } from "./DocumentsCommitRequest.mjs";
|
|
3
|
+
export { DocumentsImportFromRequest } from "./DocumentsImportFromRequest.mjs";
|
|
3
4
|
export { DocumentsInitRequest } from "./DocumentsInitRequest.mjs";
|
|
4
5
|
export type { DownloadDocumentsRequest } from "./DownloadDocumentsRequest.mjs";
|
|
5
6
|
export type { GetDocumentsRequest } from "./GetDocumentsRequest.mjs";
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type * as CloudPDF from "../../../index.mjs";
|
|
2
|
+
/**
|
|
3
|
+
* 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.
|
|
4
|
+
*/
|
|
5
|
+
export type DocumentsImportFromRequestSource =
|
|
6
|
+
/**
|
|
7
|
+
* 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 — treat it as a secret. CloudPDF never echoes its query string back in errors, logs, or stored failure reasons. */
|
|
8
|
+
CloudPDF.DocumentsImportFromRequestSource.Url
|
|
9
|
+
/**
|
|
10
|
+
* 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. */
|
|
11
|
+
| CloudPDF.DocumentsImportFromRequestSource.Connection;
|
|
12
|
+
export declare namespace DocumentsImportFromRequestSource {
|
|
13
|
+
interface Url {
|
|
14
|
+
kind: "url";
|
|
15
|
+
/** The URL to fetch. Must be allowed by the deployment import policy (scheme, network range, size) and must declare a length. */
|
|
16
|
+
url: string;
|
|
17
|
+
}
|
|
18
|
+
interface Connection {
|
|
19
|
+
kind: "connection";
|
|
20
|
+
/** The operator-registered storage connection to read from. */
|
|
21
|
+
connectionId: string;
|
|
22
|
+
/** The object key to read, inside the connection's configured scope. At most 1024 UTF-8 bytes. */
|
|
23
|
+
key: string;
|
|
24
|
+
/** Pins a specific version of the object. Provider-interpreted (S3 VersionId, GCS generation, Azure version id); providers without versioning reject it. */
|
|
25
|
+
revision?: string | undefined;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
export interface DocumentsImportFrom200Response {
|
|
2
|
+
tag: DocumentsImportFrom200Response.Tag;
|
|
3
|
+
document: DocumentsImportFrom200Response.Document;
|
|
4
|
+
}
|
|
5
|
+
export declare namespace DocumentsImportFrom200Response {
|
|
6
|
+
const Tag: {
|
|
7
|
+
readonly Imported: "imported";
|
|
8
|
+
readonly Deduped: "deduped";
|
|
9
|
+
readonly Accepted: "accepted";
|
|
10
|
+
};
|
|
11
|
+
type Tag = (typeof Tag)[keyof typeof Tag];
|
|
12
|
+
interface Document {
|
|
13
|
+
id: string;
|
|
14
|
+
tenantId: string;
|
|
15
|
+
state: Document.State;
|
|
16
|
+
baseSha: string | null;
|
|
17
|
+
storageSizeBytes: number | null;
|
|
18
|
+
metadata: Record<string, unknown> | null;
|
|
19
|
+
idempotencyKey: string | null;
|
|
20
|
+
failureReason: string | null;
|
|
21
|
+
thumbnailState?: Document.ThumbnailState | undefined;
|
|
22
|
+
thumbnailUrl?: (string | null) | undefined;
|
|
23
|
+
createdAt: number;
|
|
24
|
+
updatedAt: number;
|
|
25
|
+
createdBy: string | null;
|
|
26
|
+
}
|
|
27
|
+
namespace Document {
|
|
28
|
+
const State: {
|
|
29
|
+
readonly Pending: "pending";
|
|
30
|
+
readonly Ready: "ready";
|
|
31
|
+
readonly Failed: "failed";
|
|
32
|
+
readonly Deleting: "deleting";
|
|
33
|
+
};
|
|
34
|
+
type State = (typeof State)[keyof typeof State];
|
|
35
|
+
const ThumbnailState: {
|
|
36
|
+
readonly Pending: "pending";
|
|
37
|
+
readonly Ready: "ready";
|
|
38
|
+
readonly Locked: "locked";
|
|
39
|
+
readonly Failed: "failed";
|
|
40
|
+
};
|
|
41
|
+
type ThumbnailState = (typeof ThumbnailState)[keyof typeof ThumbnailState];
|
|
42
|
+
}
|
|
43
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
export var DocumentsImportFrom200Response;
|
|
3
|
+
(function (DocumentsImportFrom200Response) {
|
|
4
|
+
DocumentsImportFrom200Response.Tag = {
|
|
5
|
+
Imported: "imported",
|
|
6
|
+
Deduped: "deduped",
|
|
7
|
+
Accepted: "accepted",
|
|
8
|
+
};
|
|
9
|
+
let Document;
|
|
10
|
+
(function (Document) {
|
|
11
|
+
Document.State = {
|
|
12
|
+
Pending: "pending",
|
|
13
|
+
Ready: "ready",
|
|
14
|
+
Failed: "failed",
|
|
15
|
+
Deleting: "deleting",
|
|
16
|
+
};
|
|
17
|
+
Document.ThumbnailState = {
|
|
18
|
+
Pending: "pending",
|
|
19
|
+
Ready: "ready",
|
|
20
|
+
Locked: "locked",
|
|
21
|
+
Failed: "failed",
|
|
22
|
+
};
|
|
23
|
+
})(Document = DocumentsImportFrom200Response.Document || (DocumentsImportFrom200Response.Document = {}));
|
|
24
|
+
})(DocumentsImportFrom200Response || (DocumentsImportFrom200Response = {}));
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
export interface DocumentsImportFrom202Response {
|
|
2
|
+
tag: DocumentsImportFrom202Response.Tag;
|
|
3
|
+
document: DocumentsImportFrom202Response.Document;
|
|
4
|
+
}
|
|
5
|
+
export declare namespace DocumentsImportFrom202Response {
|
|
6
|
+
const Tag: {
|
|
7
|
+
readonly Imported: "imported";
|
|
8
|
+
readonly Deduped: "deduped";
|
|
9
|
+
readonly Accepted: "accepted";
|
|
10
|
+
};
|
|
11
|
+
type Tag = (typeof Tag)[keyof typeof Tag];
|
|
12
|
+
interface Document {
|
|
13
|
+
id: string;
|
|
14
|
+
tenantId: string;
|
|
15
|
+
state: Document.State;
|
|
16
|
+
baseSha: string | null;
|
|
17
|
+
storageSizeBytes: number | null;
|
|
18
|
+
metadata: Record<string, unknown> | null;
|
|
19
|
+
idempotencyKey: string | null;
|
|
20
|
+
failureReason: string | null;
|
|
21
|
+
thumbnailState?: Document.ThumbnailState | undefined;
|
|
22
|
+
thumbnailUrl?: (string | null) | undefined;
|
|
23
|
+
createdAt: number;
|
|
24
|
+
updatedAt: number;
|
|
25
|
+
createdBy: string | null;
|
|
26
|
+
}
|
|
27
|
+
namespace Document {
|
|
28
|
+
const State: {
|
|
29
|
+
readonly Pending: "pending";
|
|
30
|
+
readonly Ready: "ready";
|
|
31
|
+
readonly Failed: "failed";
|
|
32
|
+
readonly Deleting: "deleting";
|
|
33
|
+
};
|
|
34
|
+
type State = (typeof State)[keyof typeof State];
|
|
35
|
+
const ThumbnailState: {
|
|
36
|
+
readonly Pending: "pending";
|
|
37
|
+
readonly Ready: "ready";
|
|
38
|
+
readonly Locked: "locked";
|
|
39
|
+
readonly Failed: "failed";
|
|
40
|
+
};
|
|
41
|
+
type ThumbnailState = (typeof ThumbnailState)[keyof typeof ThumbnailState];
|
|
42
|
+
}
|
|
43
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
export var DocumentsImportFrom202Response;
|
|
3
|
+
(function (DocumentsImportFrom202Response) {
|
|
4
|
+
DocumentsImportFrom202Response.Tag = {
|
|
5
|
+
Imported: "imported",
|
|
6
|
+
Deduped: "deduped",
|
|
7
|
+
Accepted: "accepted",
|
|
8
|
+
};
|
|
9
|
+
let Document;
|
|
10
|
+
(function (Document) {
|
|
11
|
+
Document.State = {
|
|
12
|
+
Pending: "pending",
|
|
13
|
+
Ready: "ready",
|
|
14
|
+
Failed: "failed",
|
|
15
|
+
Deleting: "deleting",
|
|
16
|
+
};
|
|
17
|
+
Document.ThumbnailState = {
|
|
18
|
+
Pending: "pending",
|
|
19
|
+
Ready: "ready",
|
|
20
|
+
Locked: "locked",
|
|
21
|
+
Failed: "failed",
|
|
22
|
+
};
|
|
23
|
+
})(Document = DocumentsImportFrom202Response.Document || (DocumentsImportFrom202Response.Document = {}));
|
|
24
|
+
})(DocumentsImportFrom202Response || (DocumentsImportFrom202Response = {}));
|
|
@@ -145,6 +145,11 @@ export * from "./DocumentsDownload404Response.mjs";
|
|
|
145
145
|
export * from "./DocumentsGet200Response.mjs";
|
|
146
146
|
export * from "./DocumentsGet403Response.mjs";
|
|
147
147
|
export * from "./DocumentsGet404Response.mjs";
|
|
148
|
+
export * from "./DocumentsImportFrom200Response.mjs";
|
|
149
|
+
export * from "./DocumentsImportFrom202Response.mjs";
|
|
150
|
+
export * from "./DocumentsImportFrom400Response.mjs";
|
|
151
|
+
export * from "./DocumentsImportFrom403Response.mjs";
|
|
152
|
+
export * from "./DocumentsImportFrom502Response.mjs";
|
|
148
153
|
export * from "./DocumentsInit200Response.mjs";
|
|
149
154
|
export * from "./DocumentsInit200ResponseCreatedUpload.mjs";
|
|
150
155
|
export * from "./DocumentsInit200ResponseResumedUpload.mjs";
|
|
@@ -145,6 +145,11 @@ export * from "./DocumentsDownload404Response.mjs";
|
|
|
145
145
|
export * from "./DocumentsGet200Response.mjs";
|
|
146
146
|
export * from "./DocumentsGet403Response.mjs";
|
|
147
147
|
export * from "./DocumentsGet404Response.mjs";
|
|
148
|
+
export * from "./DocumentsImportFrom200Response.mjs";
|
|
149
|
+
export * from "./DocumentsImportFrom202Response.mjs";
|
|
150
|
+
export * from "./DocumentsImportFrom400Response.mjs";
|
|
151
|
+
export * from "./DocumentsImportFrom403Response.mjs";
|
|
152
|
+
export * from "./DocumentsImportFrom502Response.mjs";
|
|
148
153
|
export * from "./DocumentsInit200Response.mjs";
|
|
149
154
|
export * from "./DocumentsInit200ResponseCreatedUpload.mjs";
|
|
150
155
|
export * from "./DocumentsInit200ResponseResumedUpload.mjs";
|
package/dist/esm/version.d.mts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "3.0.0-next.
|
|
1
|
+
export declare const SDK_VERSION = "3.0.0-next.7";
|
package/dist/esm/version.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const SDK_VERSION = "3.0.0-next.
|
|
1
|
+
export const SDK_VERSION = "3.0.0-next.7";
|
package/package.json
CHANGED
package/reference.md
CHANGED
|
@@ -1431,6 +1431,75 @@ await client.documents.uploadProxy({
|
|
|
1431
1431
|
</dl>
|
|
1432
1432
|
|
|
1433
1433
|
|
|
1434
|
+
</dd>
|
|
1435
|
+
</dl>
|
|
1436
|
+
</details>
|
|
1437
|
+
|
|
1438
|
+
<details><summary><code>client.documents.<a href="/src/api/resources/documents/client/Client.ts">importFrom</a>({ ...params }) -> CloudPDF.DocumentsImportFrom200Response</code></summary>
|
|
1439
|
+
<dl>
|
|
1440
|
+
<dd>
|
|
1441
|
+
|
|
1442
|
+
#### 📝 Description
|
|
1443
|
+
|
|
1444
|
+
<dl>
|
|
1445
|
+
<dd>
|
|
1446
|
+
|
|
1447
|
+
<dl>
|
|
1448
|
+
<dd>
|
|
1449
|
+
|
|
1450
|
+
Default mode is synchronous and bounded: the response returns only after the transfer verified and committed (or failed). mode=async (connection sources only) answers 202 immediately and an in-process worker performs the transfer with leased, fenced retries; poll the document until ready/failed. The deployment import policy gates scheme, network range, and size; sources must declare a length. CloudPDF copies and owns the bytes — the source is never referenced in place. A 502 marks a retryable upstream failure: retry with the same idempotencyKey to resume the same document. URL sources are capabilities and never echoed back. Connection sources name operator-registered storage (bucket/prefix scope, allowed credential classes, and tenant bindings are deployment configuration); `revision` is provider-interpreted (S3 VersionId, GCS generation, Azure version id).
|
|
1451
|
+
</dd>
|
|
1452
|
+
</dl>
|
|
1453
|
+
</dd>
|
|
1454
|
+
</dl>
|
|
1455
|
+
|
|
1456
|
+
#### 🔌 Usage
|
|
1457
|
+
|
|
1458
|
+
<dl>
|
|
1459
|
+
<dd>
|
|
1460
|
+
|
|
1461
|
+
<dl>
|
|
1462
|
+
<dd>
|
|
1463
|
+
|
|
1464
|
+
```typescript
|
|
1465
|
+
await client.documents.importFrom({
|
|
1466
|
+
tenantId: "tenantId",
|
|
1467
|
+
source: {
|
|
1468
|
+
kind: "url",
|
|
1469
|
+
url: "url"
|
|
1470
|
+
}
|
|
1471
|
+
});
|
|
1472
|
+
|
|
1473
|
+
```
|
|
1474
|
+
</dd>
|
|
1475
|
+
</dl>
|
|
1476
|
+
</dd>
|
|
1477
|
+
</dl>
|
|
1478
|
+
|
|
1479
|
+
#### ⚙️ Parameters
|
|
1480
|
+
|
|
1481
|
+
<dl>
|
|
1482
|
+
<dd>
|
|
1483
|
+
|
|
1484
|
+
<dl>
|
|
1485
|
+
<dd>
|
|
1486
|
+
|
|
1487
|
+
**request:** `CloudPDF.DocumentsImportFromRequest`
|
|
1488
|
+
|
|
1489
|
+
</dd>
|
|
1490
|
+
</dl>
|
|
1491
|
+
|
|
1492
|
+
<dl>
|
|
1493
|
+
<dd>
|
|
1494
|
+
|
|
1495
|
+
**requestOptions:** `DocumentsClient.RequestOptions`
|
|
1496
|
+
|
|
1497
|
+
</dd>
|
|
1498
|
+
</dl>
|
|
1499
|
+
</dd>
|
|
1500
|
+
</dl>
|
|
1501
|
+
|
|
1502
|
+
|
|
1434
1503
|
</dd>
|
|
1435
1504
|
</dl>
|
|
1436
1505
|
</details>
|