@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.
Files changed (64) hide show
  1. package/dist/cjs/BaseClient.js +2 -2
  2. package/dist/cjs/api/errors/BadGatewayError.d.ts +7 -0
  3. package/dist/cjs/api/errors/BadGatewayError.js +54 -0
  4. package/dist/cjs/api/errors/index.d.ts +1 -0
  5. package/dist/cjs/api/errors/index.js +1 -0
  6. package/dist/cjs/api/resources/documents/client/Client.d.ts +23 -0
  7. package/dist/cjs/api/resources/documents/client/Client.js +69 -0
  8. package/dist/cjs/api/resources/documents/client/requests/DocumentsImportFromRequest.d.ts +49 -0
  9. package/dist/cjs/api/resources/documents/client/requests/DocumentsImportFromRequest.js +17 -0
  10. package/dist/cjs/api/resources/documents/client/requests/DocumentsInitRequest.d.ts +2 -0
  11. package/dist/cjs/api/resources/documents/client/requests/DocumentsInitRequest.js +1 -0
  12. package/dist/cjs/api/resources/documents/client/requests/index.d.ts +1 -0
  13. package/dist/cjs/api/resources/documents/client/requests/index.js +3 -1
  14. package/dist/cjs/api/resources/documents/types/DocumentsImportFromRequestSource.d.ts +27 -0
  15. package/dist/cjs/api/resources/documents/types/DocumentsImportFromRequestSource.js +3 -0
  16. package/dist/cjs/api/resources/documents/types/index.d.ts +1 -0
  17. package/dist/cjs/api/resources/documents/types/index.js +1 -0
  18. package/dist/cjs/api/types/DocumentsImportFrom200Response.d.ts +43 -0
  19. package/dist/cjs/api/types/DocumentsImportFrom200Response.js +27 -0
  20. package/dist/cjs/api/types/DocumentsImportFrom202Response.d.ts +43 -0
  21. package/dist/cjs/api/types/DocumentsImportFrom202Response.js +27 -0
  22. package/dist/cjs/api/types/DocumentsImportFrom400Response.d.ts +9 -0
  23. package/dist/cjs/api/types/DocumentsImportFrom400Response.js +3 -0
  24. package/dist/cjs/api/types/DocumentsImportFrom403Response.d.ts +9 -0
  25. package/dist/cjs/api/types/DocumentsImportFrom403Response.js +3 -0
  26. package/dist/cjs/api/types/DocumentsImportFrom502Response.d.ts +9 -0
  27. package/dist/cjs/api/types/DocumentsImportFrom502Response.js +3 -0
  28. package/dist/cjs/api/types/index.d.ts +5 -0
  29. package/dist/cjs/api/types/index.js +5 -0
  30. package/dist/cjs/version.d.ts +1 -1
  31. package/dist/cjs/version.js +1 -1
  32. package/dist/esm/BaseClient.mjs +2 -2
  33. package/dist/esm/api/errors/BadGatewayError.d.mts +7 -0
  34. package/dist/esm/api/errors/BadGatewayError.mjs +17 -0
  35. package/dist/esm/api/errors/index.d.mts +1 -0
  36. package/dist/esm/api/errors/index.mjs +1 -0
  37. package/dist/esm/api/resources/documents/client/Client.d.mts +23 -0
  38. package/dist/esm/api/resources/documents/client/Client.mjs +69 -0
  39. package/dist/esm/api/resources/documents/client/requests/DocumentsImportFromRequest.d.mts +49 -0
  40. package/dist/esm/api/resources/documents/client/requests/DocumentsImportFromRequest.mjs +14 -0
  41. package/dist/esm/api/resources/documents/client/requests/DocumentsInitRequest.d.mts +2 -0
  42. package/dist/esm/api/resources/documents/client/requests/DocumentsInitRequest.mjs +1 -0
  43. package/dist/esm/api/resources/documents/client/requests/index.d.mts +1 -0
  44. package/dist/esm/api/resources/documents/client/requests/index.mjs +1 -0
  45. package/dist/esm/api/resources/documents/types/DocumentsImportFromRequestSource.d.mts +27 -0
  46. package/dist/esm/api/resources/documents/types/DocumentsImportFromRequestSource.mjs +2 -0
  47. package/dist/esm/api/resources/documents/types/index.d.mts +1 -0
  48. package/dist/esm/api/resources/documents/types/index.mjs +1 -0
  49. package/dist/esm/api/types/DocumentsImportFrom200Response.d.mts +43 -0
  50. package/dist/esm/api/types/DocumentsImportFrom200Response.mjs +24 -0
  51. package/dist/esm/api/types/DocumentsImportFrom202Response.d.mts +43 -0
  52. package/dist/esm/api/types/DocumentsImportFrom202Response.mjs +24 -0
  53. package/dist/esm/api/types/DocumentsImportFrom400Response.d.mts +9 -0
  54. package/dist/esm/api/types/DocumentsImportFrom400Response.mjs +2 -0
  55. package/dist/esm/api/types/DocumentsImportFrom403Response.d.mts +9 -0
  56. package/dist/esm/api/types/DocumentsImportFrom403Response.mjs +2 -0
  57. package/dist/esm/api/types/DocumentsImportFrom502Response.d.mts +9 -0
  58. package/dist/esm/api/types/DocumentsImportFrom502Response.mjs +2 -0
  59. package/dist/esm/api/types/index.d.mts +5 -0
  60. package/dist/esm/api/types/index.mjs +5 -0
  61. package/dist/esm/version.d.mts +1 -1
  62. package/dist/esm/version.mjs +1 -1
  63. package/package.json +1 -1
  64. package/reference.md +69 -0
@@ -43,8 +43,8 @@ function normalizeClientOptions(options) {
43
43
  const headers = (0, headers_js_1.mergeHeaders)({
44
44
  "X-Fern-Language": "JavaScript",
45
45
  "X-Fern-SDK-Name": "@cloudpdf/sdk",
46
- "X-Fern-SDK-Version": "3.0.0-next.5",
47
- "User-Agent": "@cloudpdf/sdk/3.0.0-next.5",
46
+ "X-Fern-SDK-Version": "3.0.0-next.7",
47
+ "User-Agent": "@cloudpdf/sdk/3.0.0-next.7",
48
48
  "X-Fern-Runtime": core.RUNTIME.type,
49
49
  "X-Fern-Runtime-Version": core.RUNTIME.version,
50
50
  }, options === null || options === void 0 ? void 0 : options.headers);
@@ -0,0 +1,7 @@
1
+ import type * as core from "../../core/index.js";
2
+ import * as errors from "../../errors/index.js";
3
+ import type * as CloudPDF from "../index.js";
4
+ export declare class BadGatewayError extends errors.CloudPDFError {
5
+ readonly body: CloudPDF.DocumentsImportFrom502Response;
6
+ constructor(body: CloudPDF.DocumentsImportFrom502Response, rawResponse?: core.RawResponse);
7
+ }
@@ -0,0 +1,54 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4
+ if (k2 === undefined) k2 = k;
5
+ var desc = Object.getOwnPropertyDescriptor(m, k);
6
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
7
+ desc = { enumerable: true, get: function() { return m[k]; } };
8
+ }
9
+ Object.defineProperty(o, k2, desc);
10
+ }) : (function(o, m, k, k2) {
11
+ if (k2 === undefined) k2 = k;
12
+ o[k2] = m[k];
13
+ }));
14
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
15
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
16
+ }) : function(o, v) {
17
+ o["default"] = v;
18
+ });
19
+ var __importStar = (this && this.__importStar) || (function () {
20
+ var ownKeys = function(o) {
21
+ ownKeys = Object.getOwnPropertyNames || function (o) {
22
+ var ar = [];
23
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
24
+ return ar;
25
+ };
26
+ return ownKeys(o);
27
+ };
28
+ return function (mod) {
29
+ if (mod && mod.__esModule) return mod;
30
+ var result = {};
31
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
32
+ __setModuleDefault(result, mod);
33
+ return result;
34
+ };
35
+ })();
36
+ Object.defineProperty(exports, "__esModule", { value: true });
37
+ exports.BadGatewayError = void 0;
38
+ const errors = __importStar(require("../../errors/index.js"));
39
+ class BadGatewayError extends errors.CloudPDFError {
40
+ constructor(body, rawResponse) {
41
+ super({
42
+ message: "BadGatewayError",
43
+ statusCode: 502,
44
+ body: body,
45
+ rawResponse: rawResponse,
46
+ });
47
+ Object.setPrototypeOf(this, new.target.prototype);
48
+ if (Error.captureStackTrace) {
49
+ Error.captureStackTrace(this, this.constructor);
50
+ }
51
+ this.name = "BadGatewayError";
52
+ }
53
+ }
54
+ exports.BadGatewayError = BadGatewayError;
@@ -1,3 +1,4 @@
1
+ export * from "./BadGatewayError.js";
1
2
  export * from "./BadRequestError.js";
2
3
  export * from "./ConflictError.js";
3
4
  export * from "./ForbiddenError.js";
@@ -14,6 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./BadGatewayError.js"), exports);
17
18
  __exportStar(require("./BadRequestError.js"), exports);
18
19
  __exportStar(require("./ConflictError.js"), exports);
19
20
  __exportStar(require("./ForbiddenError.js"), exports);
@@ -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.
@@ -453,6 +453,75 @@ class DocumentsClient {
453
453
  return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/v1/tenants/{tenantId}/documents/{id}/upload-proxy");
454
454
  });
455
455
  }
456
+ /**
457
+ * 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).
458
+ *
459
+ * @param {CloudPDF.DocumentsImportFromRequest} request
460
+ * @param {DocumentsClient.RequestOptions} requestOptions - Request-specific configuration.
461
+ *
462
+ * @throws {@link CloudPDF.BadRequestError}
463
+ * @throws {@link CloudPDF.ForbiddenError}
464
+ * @throws {@link CloudPDF.BadGatewayError}
465
+ * @throws {@link errors.CloudPDFError}
466
+ * @throws {@link errors.CloudPDFTimeoutError}
467
+ *
468
+ * @example
469
+ * await client.documents.importFrom({
470
+ * tenantId: "tenantId",
471
+ * source: {
472
+ * kind: "url",
473
+ * url: "url"
474
+ * }
475
+ * })
476
+ */
477
+ importFrom(request, requestOptions) {
478
+ return core.HttpResponsePromise.fromPromise(this.__importFrom(request, requestOptions));
479
+ }
480
+ __importFrom(request, requestOptions) {
481
+ return __awaiter(this, void 0, void 0, function* () {
482
+ var _a, _b, _c, _d, _e, _f, _g, _h;
483
+ const { tenantId } = request, _body = __rest(request, ["tenantId"]);
484
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
485
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
486
+ const _response = yield core.fetcher({
487
+ 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`),
488
+ method: "POST",
489
+ headers: _headers,
490
+ contentType: "application/json",
491
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
492
+ requestType: "json",
493
+ body: (0, requestBody_js_1.mergeAdditionalBodyParameters)(_body, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.additionalBodyParameters),
494
+ 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,
495
+ 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,
496
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
497
+ fetchFn: (_h = this._options) === null || _h === void 0 ? void 0 : _h.fetch,
498
+ logging: this._options.logging,
499
+ });
500
+ if (_response.ok) {
501
+ return {
502
+ data: _response.body,
503
+ rawResponse: _response.rawResponse,
504
+ };
505
+ }
506
+ if (_response.error.reason === "status-code") {
507
+ switch (_response.error.statusCode) {
508
+ case 400:
509
+ throw new CloudPDF.BadRequestError(_response.error.body, _response.rawResponse);
510
+ case 403:
511
+ throw new CloudPDF.ForbiddenError(_response.error.body, _response.rawResponse);
512
+ case 502:
513
+ throw new CloudPDF.BadGatewayError(_response.error.body, _response.rawResponse);
514
+ default:
515
+ throw new errors.CloudPDFError({
516
+ statusCode: _response.error.statusCode,
517
+ body: _response.error.body,
518
+ rawResponse: _response.rawResponse,
519
+ });
520
+ }
521
+ }
522
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/v1/tenants/{tenantId}/documents/import");
523
+ });
524
+ }
456
525
  /**
457
526
  * @param {CloudPDF.DocumentsInitRequest} request
458
527
  * @param {DocumentsClient.RequestOptions} requestOptions - Request-specific configuration.
@@ -0,0 +1,49 @@
1
+ import type * as CloudPDF from "../../../../index.js";
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,17 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.DocumentsImportFromRequest = void 0;
5
+ var DocumentsImportFromRequest;
6
+ (function (DocumentsImportFromRequest) {
7
+ /** 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. */
8
+ DocumentsImportFromRequest.DedupMode = {
9
+ AlwaysCreate: "always-create",
10
+ ReuseExisting: "reuse-existing",
11
+ };
12
+ /** 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. */
13
+ DocumentsImportFromRequest.Mode = {
14
+ Sync: "sync",
15
+ Async: "async",
16
+ };
17
+ })(DocumentsImportFromRequest || (exports.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";
@@ -4,6 +4,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
4
4
  exports.DocumentsInitRequest = void 0;
5
5
  var DocumentsInitRequest;
6
6
  (function (DocumentsInitRequest) {
7
+ /** 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. */
7
8
  DocumentsInitRequest.DedupMode = {
8
9
  AlwaysCreate: "always-create",
9
10
  ReuseExisting: "reuse-existing",
@@ -1,5 +1,6 @@
1
1
  export type { DeleteDocumentsRequest } from "./DeleteDocumentsRequest.js";
2
2
  export type { DocumentsCommitRequest } from "./DocumentsCommitRequest.js";
3
+ export { DocumentsImportFromRequest } from "./DocumentsImportFromRequest.js";
3
4
  export { DocumentsInitRequest } from "./DocumentsInitRequest.js";
4
5
  export type { DownloadDocumentsRequest } from "./DownloadDocumentsRequest.js";
5
6
  export type { GetDocumentsRequest } from "./GetDocumentsRequest.js";
@@ -1,5 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DocumentsInitRequest = void 0;
3
+ exports.DocumentsInitRequest = exports.DocumentsImportFromRequest = void 0;
4
+ var DocumentsImportFromRequest_js_1 = require("./DocumentsImportFromRequest.js");
5
+ Object.defineProperty(exports, "DocumentsImportFromRequest", { enumerable: true, get: function () { return DocumentsImportFromRequest_js_1.DocumentsImportFromRequest; } });
4
6
  var DocumentsInitRequest_js_1 = require("./DocumentsInitRequest.js");
5
7
  Object.defineProperty(exports, "DocumentsInitRequest", { enumerable: true, get: function () { return DocumentsInitRequest_js_1.DocumentsInitRequest; } });
@@ -0,0 +1,27 @@
1
+ import type * as CloudPDF from "../../../index.js";
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,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1 +1,2 @@
1
+ export * from "./DocumentsImportFromRequestSource.js";
1
2
  export * from "./ListDocumentsRequestState.js";
@@ -14,4 +14,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./DocumentsImportFromRequestSource.js"), exports);
17
18
  __exportStar(require("./ListDocumentsRequestState.js"), exports);
@@ -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,27 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.DocumentsImportFrom200Response = void 0;
5
+ var DocumentsImportFrom200Response;
6
+ (function (DocumentsImportFrom200Response) {
7
+ DocumentsImportFrom200Response.Tag = {
8
+ Imported: "imported",
9
+ Deduped: "deduped",
10
+ Accepted: "accepted",
11
+ };
12
+ let Document;
13
+ (function (Document) {
14
+ Document.State = {
15
+ Pending: "pending",
16
+ Ready: "ready",
17
+ Failed: "failed",
18
+ Deleting: "deleting",
19
+ };
20
+ Document.ThumbnailState = {
21
+ Pending: "pending",
22
+ Ready: "ready",
23
+ Locked: "locked",
24
+ Failed: "failed",
25
+ };
26
+ })(Document = DocumentsImportFrom200Response.Document || (DocumentsImportFrom200Response.Document = {}));
27
+ })(DocumentsImportFrom200Response || (exports.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,27 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.DocumentsImportFrom202Response = void 0;
5
+ var DocumentsImportFrom202Response;
6
+ (function (DocumentsImportFrom202Response) {
7
+ DocumentsImportFrom202Response.Tag = {
8
+ Imported: "imported",
9
+ Deduped: "deduped",
10
+ Accepted: "accepted",
11
+ };
12
+ let Document;
13
+ (function (Document) {
14
+ Document.State = {
15
+ Pending: "pending",
16
+ Ready: "ready",
17
+ Failed: "failed",
18
+ Deleting: "deleting",
19
+ };
20
+ Document.ThumbnailState = {
21
+ Pending: "pending",
22
+ Ready: "ready",
23
+ Locked: "locked",
24
+ Failed: "failed",
25
+ };
26
+ })(Document = DocumentsImportFrom202Response.Document || (DocumentsImportFrom202Response.Document = {}));
27
+ })(DocumentsImportFrom202Response || (exports.DocumentsImportFrom202Response = DocumentsImportFrom202Response = {}));
@@ -0,0 +1,9 @@
1
+ export interface DocumentsImportFrom400Response {
2
+ error: DocumentsImportFrom400Response.Error_;
3
+ }
4
+ export declare namespace DocumentsImportFrom400Response {
5
+ interface Error_ {
6
+ code: string;
7
+ message: string;
8
+ }
9
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,9 @@
1
+ export interface DocumentsImportFrom403Response {
2
+ error: DocumentsImportFrom403Response.Error_;
3
+ }
4
+ export declare namespace DocumentsImportFrom403Response {
5
+ interface Error_ {
6
+ code: string;
7
+ message: string;
8
+ }
9
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,9 @@
1
+ export interface DocumentsImportFrom502Response {
2
+ error: DocumentsImportFrom502Response.Error_;
3
+ }
4
+ export declare namespace DocumentsImportFrom502Response {
5
+ interface Error_ {
6
+ code: string;
7
+ message: string;
8
+ }
9
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -145,6 +145,11 @@ export * from "./DocumentsDownload404Response.js";
145
145
  export * from "./DocumentsGet200Response.js";
146
146
  export * from "./DocumentsGet403Response.js";
147
147
  export * from "./DocumentsGet404Response.js";
148
+ export * from "./DocumentsImportFrom200Response.js";
149
+ export * from "./DocumentsImportFrom202Response.js";
150
+ export * from "./DocumentsImportFrom400Response.js";
151
+ export * from "./DocumentsImportFrom403Response.js";
152
+ export * from "./DocumentsImportFrom502Response.js";
148
153
  export * from "./DocumentsInit200Response.js";
149
154
  export * from "./DocumentsInit200ResponseCreatedUpload.js";
150
155
  export * from "./DocumentsInit200ResponseResumedUpload.js";
@@ -161,6 +161,11 @@ __exportStar(require("./DocumentsDownload404Response.js"), exports);
161
161
  __exportStar(require("./DocumentsGet200Response.js"), exports);
162
162
  __exportStar(require("./DocumentsGet403Response.js"), exports);
163
163
  __exportStar(require("./DocumentsGet404Response.js"), exports);
164
+ __exportStar(require("./DocumentsImportFrom200Response.js"), exports);
165
+ __exportStar(require("./DocumentsImportFrom202Response.js"), exports);
166
+ __exportStar(require("./DocumentsImportFrom400Response.js"), exports);
167
+ __exportStar(require("./DocumentsImportFrom403Response.js"), exports);
168
+ __exportStar(require("./DocumentsImportFrom502Response.js"), exports);
164
169
  __exportStar(require("./DocumentsInit200Response.js"), exports);
165
170
  __exportStar(require("./DocumentsInit200ResponseCreatedUpload.js"), exports);
166
171
  __exportStar(require("./DocumentsInit200ResponseResumedUpload.js"), exports);
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "3.0.0-next.5";
1
+ export declare const SDK_VERSION = "3.0.0-next.7";
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SDK_VERSION = void 0;
4
- exports.SDK_VERSION = "3.0.0-next.5";
4
+ exports.SDK_VERSION = "3.0.0-next.7";
@@ -6,8 +6,8 @@ export function normalizeClientOptions(options) {
6
6
  const headers = mergeHeaders({
7
7
  "X-Fern-Language": "JavaScript",
8
8
  "X-Fern-SDK-Name": "@cloudpdf/sdk",
9
- "X-Fern-SDK-Version": "3.0.0-next.5",
10
- "User-Agent": "@cloudpdf/sdk/3.0.0-next.5",
9
+ "X-Fern-SDK-Version": "3.0.0-next.7",
10
+ "User-Agent": "@cloudpdf/sdk/3.0.0-next.7",
11
11
  "X-Fern-Runtime": core.RUNTIME.type,
12
12
  "X-Fern-Runtime-Version": core.RUNTIME.version,
13
13
  }, options === null || options === void 0 ? void 0 : options.headers);
@@ -0,0 +1,7 @@
1
+ import type * as core from "../../core/index.mjs";
2
+ import * as errors from "../../errors/index.mjs";
3
+ import type * as CloudPDF from "../index.mjs";
4
+ export declare class BadGatewayError extends errors.CloudPDFError {
5
+ readonly body: CloudPDF.DocumentsImportFrom502Response;
6
+ constructor(body: CloudPDF.DocumentsImportFrom502Response, rawResponse?: core.RawResponse);
7
+ }
@@ -0,0 +1,17 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ import * as errors from "../../errors/index.mjs";
3
+ export class BadGatewayError extends errors.CloudPDFError {
4
+ constructor(body, rawResponse) {
5
+ super({
6
+ message: "BadGatewayError",
7
+ statusCode: 502,
8
+ body: body,
9
+ rawResponse: rawResponse,
10
+ });
11
+ Object.setPrototypeOf(this, new.target.prototype);
12
+ if (Error.captureStackTrace) {
13
+ Error.captureStackTrace(this, this.constructor);
14
+ }
15
+ this.name = "BadGatewayError";
16
+ }
17
+ }
@@ -1,3 +1,4 @@
1
+ export * from "./BadGatewayError.mjs";
1
2
  export * from "./BadRequestError.mjs";
2
3
  export * from "./ConflictError.mjs";
3
4
  export * from "./ForbiddenError.mjs";
@@ -1,3 +1,4 @@
1
+ export * from "./BadGatewayError.mjs";
1
2
  export * from "./BadRequestError.mjs";
2
3
  export * from "./ConflictError.mjs";
3
4
  export * from "./ForbiddenError.mjs";