@cloudpdf/sdk 3.0.0-next.1 → 3.0.0-next.3
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/README.md +23 -46
- package/dist/cjs/BaseClient.js +2 -2
- package/dist/cjs/Client.d.ts +3 -0
- package/dist/cjs/Client.js +9 -4
- package/dist/cjs/CloudPDFClient.d.ts +20 -0
- package/dist/cjs/CloudPDFClient.js +39 -0
- package/dist/cjs/api/errors/ConflictError.d.ts +7 -0
- package/dist/cjs/api/errors/ConflictError.js +54 -0
- package/dist/cjs/api/errors/GoneError.d.ts +7 -0
- package/dist/cjs/api/errors/GoneError.js +54 -0
- package/dist/cjs/api/errors/UnprocessableEntityError.d.ts +7 -0
- package/dist/cjs/api/errors/UnprocessableEntityError.js +54 -0
- package/dist/cjs/api/errors/index.d.ts +3 -0
- package/dist/cjs/api/errors/index.js +3 -0
- package/dist/cjs/api/resources/documents/client/Client.d.ts +14 -5
- package/dist/cjs/api/resources/documents/client/Client.js +26 -14
- package/dist/cjs/api/resources/documents/client/requests/DocumentsInitRequest.d.ts +7 -0
- package/dist/cjs/api/resources/documents/client/requests/DocumentsInitRequest.js +5 -0
- package/dist/cjs/api/resources/documents/client/requests/UploadProxyDocumentsRequest.d.ts +14 -0
- package/dist/cjs/api/resources/documents/client/requests/index.d.ts +1 -0
- package/dist/cjs/api/resources/index.d.ts +2 -0
- package/dist/cjs/api/resources/index.js +3 -1
- package/dist/cjs/api/resources/shares/client/Client.d.ts +119 -0
- package/dist/cjs/api/resources/shares/client/Client.js +422 -0
- package/dist/cjs/api/resources/shares/client/index.d.ts +1 -0
- package/dist/cjs/api/resources/shares/client/index.js +17 -0
- package/dist/cjs/api/resources/shares/client/requests/DeleteSharesRequest.d.ts +11 -0
- package/dist/cjs/api/resources/shares/client/requests/GetSharesRequest.d.ts +11 -0
- package/dist/cjs/api/resources/shares/client/requests/GetSharesRequest.js +3 -0
- package/dist/cjs/api/resources/shares/client/requests/ListSharesRequest.d.ts +12 -0
- package/dist/cjs/api/resources/shares/client/requests/ListSharesRequest.js +3 -0
- package/dist/cjs/api/resources/shares/client/requests/SharesCreateRequest.d.ts +18 -0
- package/dist/cjs/api/resources/shares/client/requests/SharesCreateRequest.js +3 -0
- package/dist/cjs/api/resources/shares/client/requests/SharesExchangeRequest.d.ts +10 -0
- package/dist/cjs/api/resources/shares/client/requests/SharesExchangeRequest.js +3 -0
- package/dist/cjs/api/resources/shares/client/requests/SharesUpdateRequest.d.ts +17 -0
- package/dist/cjs/api/resources/shares/client/requests/SharesUpdateRequest.js +3 -0
- package/dist/cjs/api/resources/shares/client/requests/index.d.ts +6 -0
- package/dist/cjs/api/resources/shares/client/requests/index.js +2 -0
- package/dist/cjs/api/resources/shares/exports.d.ts +2 -0
- package/dist/cjs/api/resources/shares/exports.js +21 -0
- package/dist/cjs/api/resources/shares/index.d.ts +1 -0
- package/dist/cjs/api/resources/shares/index.js +17 -0
- package/dist/cjs/api/resources/tenants/client/Client.d.ts +50 -0
- package/dist/cjs/api/resources/tenants/client/Client.js +181 -0
- package/dist/cjs/api/resources/tenants/client/requests/ResumeTenantsRequest.d.ts +9 -0
- package/dist/cjs/api/resources/tenants/client/requests/ResumeTenantsRequest.js +3 -0
- package/dist/cjs/api/resources/tenants/client/requests/TenantsSuspendRequest.d.ts +10 -0
- package/dist/cjs/api/resources/tenants/client/requests/TenantsSuspendRequest.js +3 -0
- package/dist/cjs/api/resources/tenants/client/requests/UsageTenantsRequest.d.ts +10 -0
- package/dist/cjs/api/resources/tenants/client/requests/UsageTenantsRequest.js +3 -0
- package/dist/cjs/api/resources/tenants/client/requests/index.d.ts +3 -0
- package/dist/cjs/api/types/DocumentsInit200ResponseCreatedUpload.d.ts +3 -3
- package/dist/cjs/api/types/DocumentsInit200ResponseResumedUpload.d.ts +3 -3
- package/dist/cjs/api/types/DocumentsUploadProxy200Response.d.ts +3 -0
- package/dist/cjs/api/types/DocumentsUploadProxy200Response.js +3 -0
- package/dist/cjs/api/types/DocumentsUploadProxy400Response.d.ts +9 -0
- package/dist/cjs/api/types/DocumentsUploadProxy400Response.js +3 -0
- package/dist/cjs/api/types/DocumentsUploadProxy409Response.d.ts +9 -0
- package/dist/cjs/api/types/DocumentsUploadProxy409Response.js +3 -0
- package/dist/cjs/api/types/SharesCreate200Response.d.ts +22 -0
- package/dist/cjs/api/types/SharesCreate200Response.js +3 -0
- package/dist/cjs/api/types/SharesCreate400Response.d.ts +9 -0
- package/dist/cjs/api/types/SharesCreate400Response.js +3 -0
- package/dist/cjs/api/types/SharesCreate403Response.d.ts +9 -0
- package/dist/cjs/api/types/SharesCreate403Response.js +3 -0
- package/dist/cjs/api/types/SharesCreate404Response.d.ts +9 -0
- package/dist/cjs/api/types/SharesCreate404Response.js +3 -0
- package/dist/cjs/api/types/SharesDeleteResponse.d.ts +9 -0
- package/dist/cjs/api/types/SharesDeleteResponse.js +3 -0
- package/dist/cjs/api/types/SharesExchange200Response.d.ts +6 -0
- package/dist/cjs/api/types/SharesExchange200Response.js +3 -0
- package/dist/cjs/api/types/SharesExchange400Response.d.ts +9 -0
- package/dist/cjs/api/types/SharesExchange400Response.js +3 -0
- package/dist/cjs/api/types/SharesExchange403Response.d.ts +9 -0
- package/dist/cjs/api/types/SharesExchange403Response.js +3 -0
- package/dist/cjs/api/types/SharesExchange404Response.d.ts +9 -0
- package/dist/cjs/api/types/SharesExchange404Response.js +3 -0
- package/dist/cjs/api/types/SharesExchange410Response.d.ts +9 -0
- package/dist/cjs/api/types/SharesExchange410Response.js +3 -0
- package/dist/cjs/api/types/SharesExchange422Response.d.ts +9 -0
- package/dist/cjs/api/types/SharesExchange422Response.js +3 -0
- package/dist/cjs/api/types/SharesGet200Response.d.ts +22 -0
- package/dist/cjs/api/types/SharesGet200Response.js +3 -0
- package/dist/cjs/api/types/SharesGet404Response.d.ts +9 -0
- package/dist/cjs/api/types/SharesGet404Response.js +3 -0
- package/dist/cjs/api/types/SharesList200Response.d.ts +26 -0
- package/dist/cjs/api/types/SharesList200Response.js +3 -0
- package/dist/cjs/api/types/SharesList400Response.d.ts +9 -0
- package/dist/cjs/api/types/SharesList400Response.js +3 -0
- package/dist/cjs/api/types/SharesUpdate200Response.d.ts +22 -0
- package/dist/cjs/api/types/SharesUpdate200Response.js +3 -0
- package/dist/cjs/api/types/SharesUpdate400Response.d.ts +9 -0
- package/dist/cjs/api/types/SharesUpdate400Response.js +3 -0
- package/dist/cjs/api/types/SharesUpdate404Response.d.ts +9 -0
- package/dist/cjs/api/types/SharesUpdate404Response.js +3 -0
- package/dist/cjs/api/types/TenantsCreate200Response.d.ts +8 -0
- package/dist/cjs/api/types/TenantsCreate200Response.js +11 -0
- package/dist/cjs/api/types/TenantsGet200Response.d.ts +8 -0
- package/dist/cjs/api/types/TenantsGet200Response.js +11 -0
- package/dist/cjs/api/types/TenantsList200Response.d.ts +8 -0
- package/dist/cjs/api/types/TenantsList200Response.js +14 -0
- package/dist/cjs/api/types/TenantsResumeResponse.d.ts +9 -0
- package/dist/cjs/api/types/TenantsResumeResponse.js +3 -0
- package/dist/cjs/api/types/TenantsSuspendResponse.d.ts +9 -0
- package/dist/cjs/api/types/TenantsSuspendResponse.js +3 -0
- package/dist/cjs/api/types/TenantsUsage200Response.d.ts +13 -0
- package/dist/cjs/api/types/TenantsUsage200Response.js +3 -0
- package/dist/cjs/api/types/TenantsUsage400Response.d.ts +9 -0
- package/dist/cjs/api/types/TenantsUsage400Response.js +3 -0
- package/dist/cjs/api/types/TenantsUsage404Response.d.ts +9 -0
- package/dist/cjs/api/types/TenantsUsage404Response.js +3 -0
- package/dist/cjs/api/types/TokensIssueRequest.d.ts +2 -1
- package/dist/cjs/api/types/index.d.ts +26 -2
- package/dist/cjs/api/types/index.js +26 -2
- package/dist/cjs/auth/BearerAuthProvider.d.ts +1 -1
- package/dist/cjs/core/form-data-utils/FormDataWrapper.d.ts +15 -0
- package/dist/cjs/core/form-data-utils/FormDataWrapper.js +188 -0
- package/dist/cjs/core/form-data-utils/encodeAsFormParameter.d.ts +1 -0
- package/dist/cjs/core/form-data-utils/encodeAsFormParameter.js +12 -0
- package/dist/cjs/core/form-data-utils/index.d.ts +2 -0
- package/dist/cjs/core/form-data-utils/index.js +20 -0
- package/dist/cjs/core/index.d.ts +1 -0
- package/dist/cjs/core/index.js +1 -0
- package/dist/cjs/index.d.ts +3 -1
- package/dist/cjs/index.js +5 -2
- package/dist/cjs/uploads/Uploads.d.ts +7 -0
- package/dist/cjs/uploads/Uploads.js +78 -0
- package/dist/cjs/uploads/index.d.ts +2 -0
- package/dist/cjs/uploads/index.js +5 -0
- package/dist/cjs/uploads/source.d.ts +10 -0
- package/dist/cjs/uploads/source.js +155 -0
- package/dist/cjs/uploads/types.d.ts +46 -0
- package/dist/cjs/uploads/types.js +2 -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/Client.d.mts +3 -0
- package/dist/esm/Client.mjs +5 -0
- package/dist/esm/CloudPDFClient.d.mts +20 -0
- package/dist/esm/CloudPDFClient.mjs +35 -0
- package/dist/esm/api/errors/ConflictError.d.mts +7 -0
- package/dist/esm/api/errors/ConflictError.mjs +17 -0
- package/dist/esm/api/errors/GoneError.d.mts +7 -0
- package/dist/esm/api/errors/GoneError.mjs +17 -0
- package/dist/esm/api/errors/UnprocessableEntityError.d.mts +7 -0
- package/dist/esm/api/errors/UnprocessableEntityError.mjs +17 -0
- package/dist/esm/api/errors/index.d.mts +3 -0
- package/dist/esm/api/errors/index.mjs +3 -0
- package/dist/esm/api/resources/documents/client/Client.d.mts +14 -5
- package/dist/esm/api/resources/documents/client/Client.mjs +27 -15
- package/dist/esm/api/resources/documents/client/requests/DocumentsInitRequest.d.mts +7 -0
- package/dist/esm/api/resources/documents/client/requests/DocumentsInitRequest.mjs +5 -0
- package/dist/esm/api/resources/documents/client/requests/UploadProxyDocumentsRequest.d.mts +14 -0
- package/dist/esm/api/resources/documents/client/requests/index.d.mts +1 -0
- package/dist/esm/api/resources/index.d.mts +2 -0
- package/dist/esm/api/resources/index.mjs +2 -0
- package/dist/esm/api/resources/shares/client/Client.d.mts +119 -0
- package/dist/esm/api/resources/shares/client/Client.mjs +385 -0
- package/dist/esm/api/resources/shares/client/index.d.mts +1 -0
- package/dist/esm/api/resources/shares/client/index.mjs +1 -0
- package/dist/esm/api/resources/shares/client/requests/DeleteSharesRequest.d.mts +11 -0
- package/dist/esm/api/resources/shares/client/requests/GetSharesRequest.d.mts +11 -0
- package/dist/esm/api/resources/shares/client/requests/GetSharesRequest.mjs +2 -0
- package/dist/esm/api/resources/shares/client/requests/ListSharesRequest.d.mts +12 -0
- package/dist/esm/api/resources/shares/client/requests/ListSharesRequest.mjs +2 -0
- package/dist/esm/api/resources/shares/client/requests/SharesCreateRequest.d.mts +18 -0
- package/dist/esm/api/resources/shares/client/requests/SharesCreateRequest.mjs +2 -0
- package/dist/esm/api/resources/shares/client/requests/SharesExchangeRequest.d.mts +10 -0
- package/dist/esm/api/resources/shares/client/requests/SharesExchangeRequest.mjs +2 -0
- package/dist/esm/api/resources/shares/client/requests/SharesUpdateRequest.d.mts +17 -0
- package/dist/esm/api/resources/shares/client/requests/SharesUpdateRequest.mjs +2 -0
- package/dist/esm/api/resources/shares/client/requests/index.d.mts +6 -0
- package/dist/esm/api/resources/shares/client/requests/index.mjs +1 -0
- package/dist/esm/api/resources/shares/exports.d.mts +2 -0
- package/dist/esm/api/resources/shares/exports.mjs +3 -0
- package/dist/esm/api/resources/shares/index.d.mts +1 -0
- package/dist/esm/api/resources/shares/index.mjs +1 -0
- package/dist/esm/api/resources/tenants/client/Client.d.mts +50 -0
- package/dist/esm/api/resources/tenants/client/Client.mjs +181 -0
- package/dist/esm/api/resources/tenants/client/requests/ResumeTenantsRequest.d.mts +9 -0
- package/dist/esm/api/resources/tenants/client/requests/ResumeTenantsRequest.mjs +2 -0
- package/dist/esm/api/resources/tenants/client/requests/TenantsSuspendRequest.d.mts +10 -0
- package/dist/esm/api/resources/tenants/client/requests/TenantsSuspendRequest.mjs +2 -0
- package/dist/esm/api/resources/tenants/client/requests/UsageTenantsRequest.d.mts +10 -0
- package/dist/esm/api/resources/tenants/client/requests/UsageTenantsRequest.mjs +2 -0
- package/dist/esm/api/resources/tenants/client/requests/index.d.mts +3 -0
- package/dist/esm/api/types/DocumentsInit200ResponseCreatedUpload.d.mts +3 -3
- package/dist/esm/api/types/DocumentsInit200ResponseResumedUpload.d.mts +3 -3
- package/dist/esm/api/types/DocumentsUploadProxy200Response.d.mts +3 -0
- package/dist/esm/api/types/DocumentsUploadProxy200Response.mjs +2 -0
- package/dist/esm/api/types/DocumentsUploadProxy400Response.d.mts +9 -0
- package/dist/esm/api/types/DocumentsUploadProxy400Response.mjs +2 -0
- package/dist/esm/api/types/DocumentsUploadProxy409Response.d.mts +9 -0
- package/dist/esm/api/types/DocumentsUploadProxy409Response.mjs +2 -0
- package/dist/esm/api/types/SharesCreate200Response.d.mts +22 -0
- package/dist/esm/api/types/SharesCreate200Response.mjs +2 -0
- package/dist/esm/api/types/SharesCreate400Response.d.mts +9 -0
- package/dist/esm/api/types/SharesCreate400Response.mjs +2 -0
- package/dist/esm/api/types/SharesCreate403Response.d.mts +9 -0
- package/dist/esm/api/types/SharesCreate403Response.mjs +2 -0
- package/dist/esm/api/types/SharesCreate404Response.d.mts +9 -0
- package/dist/esm/api/types/SharesCreate404Response.mjs +2 -0
- package/dist/esm/api/types/SharesDeleteResponse.d.mts +9 -0
- package/dist/esm/api/types/SharesDeleteResponse.mjs +2 -0
- package/dist/esm/api/types/SharesExchange200Response.d.mts +6 -0
- package/dist/esm/api/types/SharesExchange200Response.mjs +2 -0
- package/dist/esm/api/types/SharesExchange400Response.d.mts +9 -0
- package/dist/esm/api/types/SharesExchange400Response.mjs +2 -0
- package/dist/esm/api/types/SharesExchange403Response.d.mts +9 -0
- package/dist/esm/api/types/SharesExchange403Response.mjs +2 -0
- package/dist/esm/api/types/SharesExchange404Response.d.mts +9 -0
- package/dist/esm/api/types/SharesExchange404Response.mjs +2 -0
- package/dist/esm/api/types/SharesExchange410Response.d.mts +9 -0
- package/dist/esm/api/types/SharesExchange410Response.mjs +2 -0
- package/dist/esm/api/types/SharesExchange422Response.d.mts +9 -0
- package/dist/esm/api/types/SharesExchange422Response.mjs +2 -0
- package/dist/esm/api/types/SharesGet200Response.d.mts +22 -0
- package/dist/esm/api/types/SharesGet200Response.mjs +2 -0
- package/dist/esm/api/types/SharesGet404Response.d.mts +9 -0
- package/dist/esm/api/types/SharesGet404Response.mjs +2 -0
- package/dist/esm/api/types/SharesList200Response.d.mts +26 -0
- package/dist/esm/api/types/SharesList200Response.mjs +2 -0
- package/dist/esm/api/types/SharesList400Response.d.mts +9 -0
- package/dist/esm/api/types/SharesList400Response.mjs +2 -0
- package/dist/esm/api/types/SharesUpdate200Response.d.mts +22 -0
- package/dist/esm/api/types/SharesUpdate200Response.mjs +2 -0
- package/dist/esm/api/types/SharesUpdate400Response.d.mts +9 -0
- package/dist/esm/api/types/SharesUpdate400Response.mjs +2 -0
- package/dist/esm/api/types/SharesUpdate404Response.d.mts +9 -0
- package/dist/esm/api/types/SharesUpdate404Response.mjs +2 -0
- package/dist/esm/api/types/TenantsCreate200Response.d.mts +8 -0
- package/dist/esm/api/types/TenantsCreate200Response.mjs +10 -1
- package/dist/esm/api/types/TenantsGet200Response.d.mts +8 -0
- package/dist/esm/api/types/TenantsGet200Response.mjs +10 -1
- package/dist/esm/api/types/TenantsList200Response.d.mts +8 -0
- package/dist/esm/api/types/TenantsList200Response.mjs +13 -1
- package/dist/esm/api/types/TenantsResumeResponse.d.mts +9 -0
- package/dist/esm/api/types/TenantsResumeResponse.mjs +2 -0
- package/dist/esm/api/types/TenantsSuspendResponse.d.mts +9 -0
- package/dist/esm/api/types/TenantsSuspendResponse.mjs +2 -0
- package/dist/esm/api/types/TenantsUsage200Response.d.mts +13 -0
- package/dist/esm/api/types/TenantsUsage200Response.mjs +2 -0
- package/dist/esm/api/types/TenantsUsage400Response.d.mts +9 -0
- package/dist/esm/api/types/TenantsUsage400Response.mjs +2 -0
- package/dist/esm/api/types/TenantsUsage404Response.d.mts +9 -0
- package/dist/esm/api/types/TenantsUsage404Response.mjs +2 -0
- package/dist/esm/api/types/TokensIssueRequest.d.mts +2 -1
- package/dist/esm/api/types/index.d.mts +26 -2
- package/dist/esm/api/types/index.mjs +26 -2
- package/dist/esm/auth/BearerAuthProvider.d.mts +1 -1
- package/dist/esm/core/form-data-utils/FormDataWrapper.d.mts +15 -0
- package/dist/esm/core/form-data-utils/FormDataWrapper.mjs +150 -0
- package/dist/esm/core/form-data-utils/encodeAsFormParameter.d.mts +1 -0
- package/dist/esm/core/form-data-utils/encodeAsFormParameter.mjs +9 -0
- package/dist/esm/core/form-data-utils/index.d.mts +2 -0
- package/dist/esm/core/form-data-utils/index.mjs +2 -0
- package/dist/esm/core/index.d.mts +1 -0
- package/dist/esm/core/index.mjs +1 -0
- package/dist/esm/index.d.mts +3 -1
- package/dist/esm/index.mjs +3 -1
- package/dist/esm/uploads/Uploads.d.mts +7 -0
- package/dist/esm/uploads/Uploads.mjs +74 -0
- package/dist/esm/uploads/index.d.mts +2 -0
- package/dist/esm/uploads/index.mjs +1 -0
- package/dist/esm/uploads/source.d.mts +10 -0
- package/dist/esm/uploads/source.mjs +119 -0
- package/dist/esm/uploads/types.d.mts +46 -0
- package/dist/esm/uploads/types.mjs +1 -0
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +188 -177
- package/reference.md +588 -0
- package/dist/cjs/api/types/DocumentsUploadDirect200Response.d.ts +0 -3
- package/dist/cjs/api/types/DocumentsUploadDirect400Response.d.ts +0 -9
- package/dist/esm/api/types/DocumentsUploadDirect200Response.d.mts +0 -3
- package/dist/esm/api/types/DocumentsUploadDirect400Response.d.mts +0 -9
- /package/dist/cjs/api/{types/DocumentsUploadDirect200Response.js → resources/documents/client/requests/UploadProxyDocumentsRequest.js} +0 -0
- /package/dist/cjs/api/{types/DocumentsUploadDirect400Response.js → resources/shares/client/requests/DeleteSharesRequest.js} +0 -0
- /package/dist/esm/api/{types/DocumentsUploadDirect200Response.mjs → resources/documents/client/requests/UploadProxyDocumentsRequest.mjs} +0 -0
- /package/dist/esm/api/{types/DocumentsUploadDirect400Response.mjs → resources/shares/client/requests/DeleteSharesRequest.mjs} +0 -0
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
var __asyncValues = (this && this.__asyncValues) || function (o) {
|
|
11
|
+
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
12
|
+
var m = o[Symbol.asyncIterator], i;
|
|
13
|
+
return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
|
|
14
|
+
function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
|
|
15
|
+
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
|
|
16
|
+
};
|
|
17
|
+
export function prepareUploadSource(source) {
|
|
18
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
19
|
+
var _a, _b;
|
|
20
|
+
if (isReopenable(source)) {
|
|
21
|
+
return {
|
|
22
|
+
size: source.size,
|
|
23
|
+
sha256: normalizeSha(source.sha256),
|
|
24
|
+
filename: (_a = source.filename) !== null && _a !== void 0 ? _a : "document.pdf",
|
|
25
|
+
contentType: (_b = source.contentType) !== null && _b !== void 0 ? _b : "application/pdf",
|
|
26
|
+
open: () => __awaiter(this, void 0, void 0, function* () { return source.open(); }),
|
|
27
|
+
openProxyBlob: () => __awaiter(this, void 0, void 0, function* () {
|
|
28
|
+
if (!source.openProxyBlob) {
|
|
29
|
+
throw new Error("the server selected proxy upload, but this reopenable source does not provide openProxyBlob()");
|
|
30
|
+
}
|
|
31
|
+
return source.openProxyBlob();
|
|
32
|
+
}),
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
if (isPathSource(source))
|
|
36
|
+
return preparePath(source.path);
|
|
37
|
+
const blob = toBlob(source);
|
|
38
|
+
return {
|
|
39
|
+
size: blob.size,
|
|
40
|
+
sha256: yield sha256Bytes(new Uint8Array(yield blob.arrayBuffer())),
|
|
41
|
+
filename: "document.pdf",
|
|
42
|
+
contentType: blob.type || "application/pdf",
|
|
43
|
+
open: () => __awaiter(this, void 0, void 0, function* () { return blob; }),
|
|
44
|
+
openProxyBlob: () => __awaiter(this, void 0, void 0, function* () { return blob; }),
|
|
45
|
+
};
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
function preparePath(path) {
|
|
49
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
50
|
+
var _a, e_1, _b, _c;
|
|
51
|
+
const [{ createReadStream }, { readFile, stat }, { createHash }] = yield Promise.all([
|
|
52
|
+
import("node:fs"),
|
|
53
|
+
import("node:fs/promises"),
|
|
54
|
+
import("node:crypto"),
|
|
55
|
+
]);
|
|
56
|
+
const info = yield stat(path);
|
|
57
|
+
if (!info.isFile())
|
|
58
|
+
throw new Error(`upload source is not a file: ${path}`);
|
|
59
|
+
const hash = createHash("sha256");
|
|
60
|
+
try {
|
|
61
|
+
for (var _d = true, _e = __asyncValues(createReadStream(path)), _f; _f = yield _e.next(), _a = _f.done, !_a; _d = true) {
|
|
62
|
+
_c = _f.value;
|
|
63
|
+
_d = false;
|
|
64
|
+
const chunk = _c;
|
|
65
|
+
hash.update(chunk);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
69
|
+
finally {
|
|
70
|
+
try {
|
|
71
|
+
if (!_d && !_a && (_b = _e.return)) yield _b.call(_e);
|
|
72
|
+
}
|
|
73
|
+
finally { if (e_1) throw e_1.error; }
|
|
74
|
+
}
|
|
75
|
+
return {
|
|
76
|
+
size: info.size,
|
|
77
|
+
sha256: hash.digest("hex"),
|
|
78
|
+
filename: path.split(/[\\/]/).pop() || "document.pdf",
|
|
79
|
+
contentType: "application/pdf",
|
|
80
|
+
open: () => __awaiter(this, void 0, void 0, function* () { return createReadStream(path); }),
|
|
81
|
+
// The proxy route is deliberately bounded. Presigned mode remains
|
|
82
|
+
// streaming; the uncommon filesystem fallback materializes one Blob.
|
|
83
|
+
openProxyBlob: () => __awaiter(this, void 0, void 0, function* () { return new Blob([new Uint8Array(yield readFile(path))], { type: "application/pdf" }); }),
|
|
84
|
+
};
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
function sha256Bytes(bytes) {
|
|
88
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
89
|
+
var _a;
|
|
90
|
+
if ((_a = globalThis.crypto) === null || _a === void 0 ? void 0 : _a.subtle) {
|
|
91
|
+
const digest = yield globalThis.crypto.subtle.digest("SHA-256", new Uint8Array(bytes));
|
|
92
|
+
return hex(new Uint8Array(digest));
|
|
93
|
+
}
|
|
94
|
+
const { createHash } = yield import("node:crypto");
|
|
95
|
+
return createHash("sha256").update(bytes).digest("hex");
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
function toBlob(source) {
|
|
99
|
+
if (source instanceof Blob)
|
|
100
|
+
return source;
|
|
101
|
+
const bytes = source instanceof Uint8Array ? new Uint8Array(source) : new Uint8Array(source.slice(0));
|
|
102
|
+
return new Blob([bytes], { type: "application/pdf" });
|
|
103
|
+
}
|
|
104
|
+
function isPathSource(source) {
|
|
105
|
+
return typeof source === "object" && source !== null && "path" in source;
|
|
106
|
+
}
|
|
107
|
+
function isReopenable(source) {
|
|
108
|
+
return typeof source === "object" && source !== null && "open" in source && "size" in source && "sha256" in source;
|
|
109
|
+
}
|
|
110
|
+
function normalizeSha(value) {
|
|
111
|
+
const normalized = value.toLowerCase();
|
|
112
|
+
if (!/^[a-f0-9]{64}$/.test(normalized)) {
|
|
113
|
+
throw new Error("reopenable upload source sha256 must be 64 lowercase or uppercase hex characters");
|
|
114
|
+
}
|
|
115
|
+
return normalized;
|
|
116
|
+
}
|
|
117
|
+
function hex(bytes) {
|
|
118
|
+
return Array.from(bytes, (byte) => byte.toString(16).padStart(2, "0")).join("");
|
|
119
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
export type UploadPreference = "auto" | "presigned" | "proxy";
|
|
2
|
+
export type DedupMode = "always-create" | "reuse-existing";
|
|
3
|
+
/**
|
|
4
|
+
* A source that can be opened again after its hash is known. This is the
|
|
5
|
+
* escape hatch for streams: init needs the final SHA before transfer starts,
|
|
6
|
+
* so a one-shot unknown stream cannot implement the protocol safely.
|
|
7
|
+
*/
|
|
8
|
+
export interface ReopenableUploadSource {
|
|
9
|
+
size: number;
|
|
10
|
+
sha256: string;
|
|
11
|
+
filename?: string;
|
|
12
|
+
contentType?: string;
|
|
13
|
+
open(): BodyInit | Promise<BodyInit>;
|
|
14
|
+
/** Required only if the server selects the multipart proxy fallback. */
|
|
15
|
+
openProxyBlob?(): Blob | Promise<Blob>;
|
|
16
|
+
}
|
|
17
|
+
export type UploadSource = Uint8Array | ArrayBuffer | Blob | {
|
|
18
|
+
path: string;
|
|
19
|
+
} | ReopenableUploadSource;
|
|
20
|
+
export interface UploadCreateInput {
|
|
21
|
+
tenantId: string;
|
|
22
|
+
source: UploadSource;
|
|
23
|
+
metadata?: Record<string, unknown>;
|
|
24
|
+
idempotencyKey?: string;
|
|
25
|
+
dedupMode?: DedupMode;
|
|
26
|
+
docId?: string;
|
|
27
|
+
uploadTtlSec?: number;
|
|
28
|
+
/** `auto` prefers a presigned object-store PUT and is recommended. */
|
|
29
|
+
uploadPreference?: UploadPreference;
|
|
30
|
+
signal?: AbortSignal;
|
|
31
|
+
onProgress?: (loaded: number, total: number) => void;
|
|
32
|
+
}
|
|
33
|
+
export interface UploadCreateResult<Document = unknown> {
|
|
34
|
+
tag: "created" | "resumed" | "deduped";
|
|
35
|
+
document: Document;
|
|
36
|
+
}
|
|
37
|
+
export interface UploadRequestOptions {
|
|
38
|
+
abortSignal?: AbortSignal;
|
|
39
|
+
maxRetries?: number;
|
|
40
|
+
}
|
|
41
|
+
export interface UploadProtocol {
|
|
42
|
+
init(request: Record<string, unknown>, options: UploadRequestOptions): Promise<unknown>;
|
|
43
|
+
commit(request: Record<string, unknown>, options: UploadRequestOptions): Promise<unknown>;
|
|
44
|
+
proxy(url: string, form: FormData, options: UploadRequestOptions): Promise<Response>;
|
|
45
|
+
presigned(url: string, init: RequestInit): Promise<Response>;
|
|
46
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
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.3";
|
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.3";
|
package/package.json
CHANGED
|
@@ -1,184 +1,195 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
},
|
|
22
|
-
"./deployment": {
|
|
23
|
-
"import": {
|
|
24
|
-
"types": "./dist/esm/api/resources/deployment/exports.d.mts",
|
|
25
|
-
"default": "./dist/esm/api/resources/deployment/exports.mjs"
|
|
26
|
-
},
|
|
27
|
-
"require": {
|
|
28
|
-
"types": "./dist/cjs/api/resources/deployment/exports.d.ts",
|
|
29
|
-
"default": "./dist/cjs/api/resources/deployment/exports.js"
|
|
30
|
-
},
|
|
31
|
-
"default": "./dist/cjs/api/resources/deployment/exports.js"
|
|
32
|
-
},
|
|
33
|
-
"./doc": {
|
|
34
|
-
"import": {
|
|
35
|
-
"types": "./dist/esm/api/resources/doc/exports.d.mts",
|
|
36
|
-
"default": "./dist/esm/api/resources/doc/exports.mjs"
|
|
37
|
-
},
|
|
38
|
-
"require": {
|
|
39
|
-
"types": "./dist/cjs/api/resources/doc/exports.d.ts",
|
|
40
|
-
"default": "./dist/cjs/api/resources/doc/exports.js"
|
|
41
|
-
},
|
|
42
|
-
"default": "./dist/cjs/api/resources/doc/exports.js"
|
|
43
|
-
},
|
|
44
|
-
"./tenants": {
|
|
45
|
-
"import": {
|
|
46
|
-
"types": "./dist/esm/api/resources/tenants/exports.d.mts",
|
|
47
|
-
"default": "./dist/esm/api/resources/tenants/exports.mjs"
|
|
48
|
-
},
|
|
49
|
-
"require": {
|
|
50
|
-
"types": "./dist/cjs/api/resources/tenants/exports.d.ts",
|
|
51
|
-
"default": "./dist/cjs/api/resources/tenants/exports.js"
|
|
52
|
-
},
|
|
53
|
-
"default": "./dist/cjs/api/resources/tenants/exports.js"
|
|
54
|
-
},
|
|
55
|
-
"./documents": {
|
|
56
|
-
"import": {
|
|
57
|
-
"types": "./dist/esm/api/resources/documents/exports.d.mts",
|
|
58
|
-
"default": "./dist/esm/api/resources/documents/exports.mjs"
|
|
59
|
-
},
|
|
60
|
-
"require": {
|
|
61
|
-
"types": "./dist/cjs/api/resources/documents/exports.d.ts",
|
|
62
|
-
"default": "./dist/cjs/api/resources/documents/exports.js"
|
|
63
|
-
},
|
|
64
|
-
"default": "./dist/cjs/api/resources/documents/exports.js"
|
|
65
|
-
},
|
|
66
|
-
"./tokens": {
|
|
67
|
-
"import": {
|
|
68
|
-
"types": "./dist/esm/api/resources/tokens/exports.d.mts",
|
|
69
|
-
"default": "./dist/esm/api/resources/tokens/exports.mjs"
|
|
70
|
-
},
|
|
71
|
-
"require": {
|
|
72
|
-
"types": "./dist/cjs/api/resources/tokens/exports.d.ts",
|
|
73
|
-
"default": "./dist/cjs/api/resources/tokens/exports.js"
|
|
74
|
-
},
|
|
75
|
-
"default": "./dist/cjs/api/resources/tokens/exports.js"
|
|
76
|
-
},
|
|
77
|
-
"./doc/annotations": {
|
|
78
|
-
"import": {
|
|
79
|
-
"types": "./dist/esm/api/resources/doc/resources/annotations/exports.d.mts",
|
|
80
|
-
"default": "./dist/esm/api/resources/doc/resources/annotations/exports.mjs"
|
|
81
|
-
},
|
|
82
|
-
"require": {
|
|
83
|
-
"types": "./dist/cjs/api/resources/doc/resources/annotations/exports.d.ts",
|
|
84
|
-
"default": "./dist/cjs/api/resources/doc/resources/annotations/exports.js"
|
|
85
|
-
},
|
|
86
|
-
"default": "./dist/cjs/api/resources/doc/resources/annotations/exports.js"
|
|
87
|
-
},
|
|
88
|
-
"./doc/forms": {
|
|
89
|
-
"import": {
|
|
90
|
-
"types": "./dist/esm/api/resources/doc/resources/forms/exports.d.mts",
|
|
91
|
-
"default": "./dist/esm/api/resources/doc/resources/forms/exports.mjs"
|
|
92
|
-
},
|
|
93
|
-
"require": {
|
|
94
|
-
"types": "./dist/cjs/api/resources/doc/resources/forms/exports.d.ts",
|
|
95
|
-
"default": "./dist/cjs/api/resources/doc/resources/forms/exports.js"
|
|
96
|
-
},
|
|
97
|
-
"default": "./dist/cjs/api/resources/doc/resources/forms/exports.js"
|
|
98
|
-
},
|
|
99
|
-
"./doc/metadata": {
|
|
100
|
-
"import": {
|
|
101
|
-
"types": "./dist/esm/api/resources/doc/resources/metadata/exports.d.mts",
|
|
102
|
-
"default": "./dist/esm/api/resources/doc/resources/metadata/exports.mjs"
|
|
103
|
-
},
|
|
104
|
-
"require": {
|
|
105
|
-
"types": "./dist/cjs/api/resources/doc/resources/metadata/exports.d.ts",
|
|
106
|
-
"default": "./dist/cjs/api/resources/doc/resources/metadata/exports.js"
|
|
107
|
-
},
|
|
108
|
-
"default": "./dist/cjs/api/resources/doc/resources/metadata/exports.js"
|
|
109
|
-
},
|
|
110
|
-
"./doc/pages": {
|
|
111
|
-
"import": {
|
|
112
|
-
"types": "./dist/esm/api/resources/doc/resources/pages/exports.d.mts",
|
|
113
|
-
"default": "./dist/esm/api/resources/doc/resources/pages/exports.mjs"
|
|
114
|
-
},
|
|
115
|
-
"require": {
|
|
116
|
-
"types": "./dist/cjs/api/resources/doc/resources/pages/exports.d.ts",
|
|
117
|
-
"default": "./dist/cjs/api/resources/doc/resources/pages/exports.js"
|
|
118
|
-
},
|
|
119
|
-
"default": "./dist/cjs/api/resources/doc/resources/pages/exports.js"
|
|
120
|
-
},
|
|
121
|
-
"./doc/redactions": {
|
|
122
|
-
"import": {
|
|
123
|
-
"types": "./dist/esm/api/resources/doc/resources/redactions/exports.d.mts",
|
|
124
|
-
"default": "./dist/esm/api/resources/doc/resources/redactions/exports.mjs"
|
|
125
|
-
},
|
|
126
|
-
"require": {
|
|
127
|
-
"types": "./dist/cjs/api/resources/doc/resources/redactions/exports.d.ts",
|
|
128
|
-
"default": "./dist/cjs/api/resources/doc/resources/redactions/exports.js"
|
|
129
|
-
},
|
|
130
|
-
"default": "./dist/cjs/api/resources/doc/resources/redactions/exports.js"
|
|
131
|
-
},
|
|
132
|
-
"./package.json": "./package.json"
|
|
2
|
+
"name": "@cloudpdf/sdk",
|
|
3
|
+
"version": "3.0.0-next.3",
|
|
4
|
+
"private": false,
|
|
5
|
+
"license": "Apache-2.0",
|
|
6
|
+
"type": "commonjs",
|
|
7
|
+
"main": "./dist/cjs/index.js",
|
|
8
|
+
"module": "./dist/esm/index.mjs",
|
|
9
|
+
"types": "./dist/cjs/index.d.ts",
|
|
10
|
+
"exports": {
|
|
11
|
+
".": {
|
|
12
|
+
"import": {
|
|
13
|
+
"types": "./dist/esm/index.d.mts",
|
|
14
|
+
"default": "./dist/esm/index.mjs"
|
|
15
|
+
},
|
|
16
|
+
"require": {
|
|
17
|
+
"types": "./dist/cjs/index.d.ts",
|
|
18
|
+
"default": "./dist/cjs/index.js"
|
|
19
|
+
},
|
|
20
|
+
"default": "./dist/cjs/index.js"
|
|
133
21
|
},
|
|
134
|
-
"
|
|
135
|
-
|
|
136
|
-
"
|
|
137
|
-
"
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
"
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
"lint:fix": "biome lint --fix --unsafe --skip-parse-errors --no-errors-on-unmatched --max-diagnostics=none",
|
|
145
|
-
"check": "biome check --skip-parse-errors --no-errors-on-unmatched --max-diagnostics=none",
|
|
146
|
-
"check:fix": "biome check --fix --unsafe --skip-parse-errors --no-errors-on-unmatched --max-diagnostics=none",
|
|
147
|
-
"build": "pnpm build:cjs && pnpm build:esm",
|
|
148
|
-
"build:cjs": "tsc --project ./tsconfig.cjs.json",
|
|
149
|
-
"build:esm": "tsc --project ./tsconfig.esm.json && node scripts/rename-to-esm-files.js dist/esm",
|
|
150
|
-
"test": "vitest",
|
|
151
|
-
"test:unit": "vitest --project unit",
|
|
152
|
-
"test:wire": "vitest --project wire"
|
|
22
|
+
"./deployment": {
|
|
23
|
+
"import": {
|
|
24
|
+
"types": "./dist/esm/api/resources/deployment/exports.d.mts",
|
|
25
|
+
"default": "./dist/esm/api/resources/deployment/exports.mjs"
|
|
26
|
+
},
|
|
27
|
+
"require": {
|
|
28
|
+
"types": "./dist/cjs/api/resources/deployment/exports.d.ts",
|
|
29
|
+
"default": "./dist/cjs/api/resources/deployment/exports.js"
|
|
30
|
+
},
|
|
31
|
+
"default": "./dist/cjs/api/resources/deployment/exports.js"
|
|
153
32
|
},
|
|
154
|
-
"
|
|
155
|
-
|
|
156
|
-
"
|
|
157
|
-
"
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
"
|
|
161
|
-
"
|
|
162
|
-
|
|
33
|
+
"./doc": {
|
|
34
|
+
"import": {
|
|
35
|
+
"types": "./dist/esm/api/resources/doc/exports.d.mts",
|
|
36
|
+
"default": "./dist/esm/api/resources/doc/exports.mjs"
|
|
37
|
+
},
|
|
38
|
+
"require": {
|
|
39
|
+
"types": "./dist/cjs/api/resources/doc/exports.d.ts",
|
|
40
|
+
"default": "./dist/cjs/api/resources/doc/exports.js"
|
|
41
|
+
},
|
|
42
|
+
"default": "./dist/cjs/api/resources/doc/exports.js"
|
|
163
43
|
},
|
|
164
|
-
"
|
|
165
|
-
|
|
166
|
-
"
|
|
167
|
-
"
|
|
168
|
-
|
|
169
|
-
|
|
44
|
+
"./shares": {
|
|
45
|
+
"import": {
|
|
46
|
+
"types": "./dist/esm/api/resources/shares/exports.d.mts",
|
|
47
|
+
"default": "./dist/esm/api/resources/shares/exports.mjs"
|
|
48
|
+
},
|
|
49
|
+
"require": {
|
|
50
|
+
"types": "./dist/cjs/api/resources/shares/exports.d.ts",
|
|
51
|
+
"default": "./dist/cjs/api/resources/shares/exports.js"
|
|
52
|
+
},
|
|
53
|
+
"default": "./dist/cjs/api/resources/shares/exports.js"
|
|
170
54
|
},
|
|
171
|
-
"
|
|
172
|
-
|
|
173
|
-
"
|
|
55
|
+
"./tenants": {
|
|
56
|
+
"import": {
|
|
57
|
+
"types": "./dist/esm/api/resources/tenants/exports.d.mts",
|
|
58
|
+
"default": "./dist/esm/api/resources/tenants/exports.mjs"
|
|
59
|
+
},
|
|
60
|
+
"require": {
|
|
61
|
+
"types": "./dist/cjs/api/resources/tenants/exports.d.ts",
|
|
62
|
+
"default": "./dist/cjs/api/resources/tenants/exports.js"
|
|
63
|
+
},
|
|
64
|
+
"default": "./dist/cjs/api/resources/tenants/exports.js"
|
|
174
65
|
},
|
|
175
|
-
"
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
"
|
|
179
|
-
|
|
66
|
+
"./documents": {
|
|
67
|
+
"import": {
|
|
68
|
+
"types": "./dist/esm/api/resources/documents/exports.d.mts",
|
|
69
|
+
"default": "./dist/esm/api/resources/documents/exports.mjs"
|
|
70
|
+
},
|
|
71
|
+
"require": {
|
|
72
|
+
"types": "./dist/cjs/api/resources/documents/exports.d.ts",
|
|
73
|
+
"default": "./dist/cjs/api/resources/documents/exports.js"
|
|
74
|
+
},
|
|
75
|
+
"default": "./dist/cjs/api/resources/documents/exports.js"
|
|
180
76
|
},
|
|
181
|
-
"
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
77
|
+
"./tokens": {
|
|
78
|
+
"import": {
|
|
79
|
+
"types": "./dist/esm/api/resources/tokens/exports.d.mts",
|
|
80
|
+
"default": "./dist/esm/api/resources/tokens/exports.mjs"
|
|
81
|
+
},
|
|
82
|
+
"require": {
|
|
83
|
+
"types": "./dist/cjs/api/resources/tokens/exports.d.ts",
|
|
84
|
+
"default": "./dist/cjs/api/resources/tokens/exports.js"
|
|
85
|
+
},
|
|
86
|
+
"default": "./dist/cjs/api/resources/tokens/exports.js"
|
|
87
|
+
},
|
|
88
|
+
"./doc/annotations": {
|
|
89
|
+
"import": {
|
|
90
|
+
"types": "./dist/esm/api/resources/doc/resources/annotations/exports.d.mts",
|
|
91
|
+
"default": "./dist/esm/api/resources/doc/resources/annotations/exports.mjs"
|
|
92
|
+
},
|
|
93
|
+
"require": {
|
|
94
|
+
"types": "./dist/cjs/api/resources/doc/resources/annotations/exports.d.ts",
|
|
95
|
+
"default": "./dist/cjs/api/resources/doc/resources/annotations/exports.js"
|
|
96
|
+
},
|
|
97
|
+
"default": "./dist/cjs/api/resources/doc/resources/annotations/exports.js"
|
|
98
|
+
},
|
|
99
|
+
"./doc/forms": {
|
|
100
|
+
"import": {
|
|
101
|
+
"types": "./dist/esm/api/resources/doc/resources/forms/exports.d.mts",
|
|
102
|
+
"default": "./dist/esm/api/resources/doc/resources/forms/exports.mjs"
|
|
103
|
+
},
|
|
104
|
+
"require": {
|
|
105
|
+
"types": "./dist/cjs/api/resources/doc/resources/forms/exports.d.ts",
|
|
106
|
+
"default": "./dist/cjs/api/resources/doc/resources/forms/exports.js"
|
|
107
|
+
},
|
|
108
|
+
"default": "./dist/cjs/api/resources/doc/resources/forms/exports.js"
|
|
109
|
+
},
|
|
110
|
+
"./doc/metadata": {
|
|
111
|
+
"import": {
|
|
112
|
+
"types": "./dist/esm/api/resources/doc/resources/metadata/exports.d.mts",
|
|
113
|
+
"default": "./dist/esm/api/resources/doc/resources/metadata/exports.mjs"
|
|
114
|
+
},
|
|
115
|
+
"require": {
|
|
116
|
+
"types": "./dist/cjs/api/resources/doc/resources/metadata/exports.d.ts",
|
|
117
|
+
"default": "./dist/cjs/api/resources/doc/resources/metadata/exports.js"
|
|
118
|
+
},
|
|
119
|
+
"default": "./dist/cjs/api/resources/doc/resources/metadata/exports.js"
|
|
120
|
+
},
|
|
121
|
+
"./doc/pages": {
|
|
122
|
+
"import": {
|
|
123
|
+
"types": "./dist/esm/api/resources/doc/resources/pages/exports.d.mts",
|
|
124
|
+
"default": "./dist/esm/api/resources/doc/resources/pages/exports.mjs"
|
|
125
|
+
},
|
|
126
|
+
"require": {
|
|
127
|
+
"types": "./dist/cjs/api/resources/doc/resources/pages/exports.d.ts",
|
|
128
|
+
"default": "./dist/cjs/api/resources/doc/resources/pages/exports.js"
|
|
129
|
+
},
|
|
130
|
+
"default": "./dist/cjs/api/resources/doc/resources/pages/exports.js"
|
|
131
|
+
},
|
|
132
|
+
"./doc/redactions": {
|
|
133
|
+
"import": {
|
|
134
|
+
"types": "./dist/esm/api/resources/doc/resources/redactions/exports.d.mts",
|
|
135
|
+
"default": "./dist/esm/api/resources/doc/resources/redactions/exports.mjs"
|
|
136
|
+
},
|
|
137
|
+
"require": {
|
|
138
|
+
"types": "./dist/cjs/api/resources/doc/resources/redactions/exports.d.ts",
|
|
139
|
+
"default": "./dist/cjs/api/resources/doc/resources/redactions/exports.js"
|
|
140
|
+
},
|
|
141
|
+
"default": "./dist/cjs/api/resources/doc/resources/redactions/exports.js"
|
|
142
|
+
},
|
|
143
|
+
"./package.json": "./package.json"
|
|
144
|
+
},
|
|
145
|
+
"files": [
|
|
146
|
+
"dist",
|
|
147
|
+
"reference.md",
|
|
148
|
+
"README.md",
|
|
149
|
+
"LICENSE"
|
|
150
|
+
],
|
|
151
|
+
"dependencies": {},
|
|
152
|
+
"devDependencies": {
|
|
153
|
+
"webpack": "^5.105.4",
|
|
154
|
+
"ts-loader": "^9.5.4",
|
|
155
|
+
"vitest": "^4.1.1",
|
|
156
|
+
"msw": "2.11.2",
|
|
157
|
+
"@types/node": "^20.0.0",
|
|
158
|
+
"typescript": "~5.9.3",
|
|
159
|
+
"@biomejs/biome": "2.4.10"
|
|
160
|
+
},
|
|
161
|
+
"browser": {
|
|
162
|
+
"fs": false,
|
|
163
|
+
"os": false,
|
|
164
|
+
"path": false,
|
|
165
|
+
"stream": false,
|
|
166
|
+
"crypto": false
|
|
167
|
+
},
|
|
168
|
+
"engines": {
|
|
169
|
+
"node": ">=18.0.0"
|
|
170
|
+
},
|
|
171
|
+
"sideEffects": false,
|
|
172
|
+
"description": "The official TypeScript SDK for the CloudPDF API.",
|
|
173
|
+
"repository": {
|
|
174
|
+
"type": "git",
|
|
175
|
+
"url": "git+https://github.com/embedpdf/embed-pdf-viewer.git",
|
|
176
|
+
"directory": "cloudpdf/sdk"
|
|
177
|
+
},
|
|
178
|
+
"publishConfig": {
|
|
179
|
+
"access": "public"
|
|
180
|
+
},
|
|
181
|
+
"scripts": {
|
|
182
|
+
"format": "biome format --write --skip-parse-errors --no-errors-on-unmatched --max-diagnostics=none",
|
|
183
|
+
"format:check": "biome format --skip-parse-errors --no-errors-on-unmatched --max-diagnostics=none",
|
|
184
|
+
"lint": "biome lint --skip-parse-errors --no-errors-on-unmatched --max-diagnostics=none",
|
|
185
|
+
"lint:fix": "biome lint --fix --unsafe --skip-parse-errors --no-errors-on-unmatched --max-diagnostics=none",
|
|
186
|
+
"check": "biome check --skip-parse-errors --no-errors-on-unmatched --max-diagnostics=none",
|
|
187
|
+
"check:fix": "biome check --fix --unsafe --skip-parse-errors --no-errors-on-unmatched --max-diagnostics=none",
|
|
188
|
+
"build": "pnpm build:cjs && pnpm build:esm",
|
|
189
|
+
"build:cjs": "tsc --project ./tsconfig.cjs.json",
|
|
190
|
+
"build:esm": "tsc --project ./tsconfig.esm.json && node scripts/rename-to-esm-files.js dist/esm",
|
|
191
|
+
"test": "vitest run",
|
|
192
|
+
"test:unit": "vitest run --project unit",
|
|
193
|
+
"test:wire": "vitest run --project wire"
|
|
194
|
+
}
|
|
195
|
+
}
|