@finueva/drive 0.16.0 → 0.18.0
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/CHANGELOG.md +28 -0
- package/README.md +1 -1
- package/dist/client.d.ts +1 -1
- package/dist/client.js +1 -1
- package/dist/contract.d.ts +112 -21
- package/dist/contract2.d.ts +1 -1
- package/dist/core.d.ts +15 -2
- package/dist/core.js +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.js +1 -1
- package/dist/server.d.ts +1 -1
- package/dist/server.js +1 -1
- package/dist/types.d.ts +2 -2
- package/package.json +1 -1
package/dist/contract.d.ts
CHANGED
|
@@ -335,7 +335,7 @@ interface operations {
|
|
|
335
335
|
};
|
|
336
336
|
content?: never;
|
|
337
337
|
};
|
|
338
|
-
/** @description Invalid request;
|
|
338
|
+
/** @description Invalid request; an editor grant is one file for at most 24 hours. */
|
|
339
339
|
422: {
|
|
340
340
|
headers: {
|
|
341
341
|
[name: string]: unknown;
|
|
@@ -439,7 +439,92 @@ interface operations {
|
|
|
439
439
|
};
|
|
440
440
|
content?: never;
|
|
441
441
|
};
|
|
442
|
-
/** @description Invalid request;
|
|
442
|
+
/** @description Invalid request; an editor grant is one file for at most 24 hours. */
|
|
443
|
+
422: {
|
|
444
|
+
headers: {
|
|
445
|
+
[name: string]: unknown;
|
|
446
|
+
};
|
|
447
|
+
content?: never;
|
|
448
|
+
};
|
|
449
|
+
/** @description Bounded admission exhausted; retry after one minute. */
|
|
450
|
+
429: {
|
|
451
|
+
headers: {
|
|
452
|
+
[name: string]: unknown;
|
|
453
|
+
};
|
|
454
|
+
content?: never;
|
|
455
|
+
};
|
|
456
|
+
/** @description Service unavailable. */
|
|
457
|
+
503: {
|
|
458
|
+
headers: {
|
|
459
|
+
[name: string]: unknown;
|
|
460
|
+
};
|
|
461
|
+
content?: never;
|
|
462
|
+
};
|
|
463
|
+
};
|
|
464
|
+
};
|
|
465
|
+
createVisitorEditingSession: {
|
|
466
|
+
parameters: {
|
|
467
|
+
query?: {
|
|
468
|
+
itemId?: string;
|
|
469
|
+
};
|
|
470
|
+
header: {
|
|
471
|
+
/** @description DriveVisitor followed by a space and the capability. Never place tokens in URLs. */
|
|
472
|
+
Authorization: string;
|
|
473
|
+
};
|
|
474
|
+
path?: never;
|
|
475
|
+
cookie?: never;
|
|
476
|
+
};
|
|
477
|
+
requestBody: {
|
|
478
|
+
content: {
|
|
479
|
+
"application/json": {
|
|
480
|
+
audience: string;
|
|
481
|
+
sourceVersionId?: string;
|
|
482
|
+
writable: boolean;
|
|
483
|
+
};
|
|
484
|
+
};
|
|
485
|
+
};
|
|
486
|
+
responses: {
|
|
487
|
+
/** @description Scoped capability attributed to the visitor grant; the token is returned once. */
|
|
488
|
+
201: {
|
|
489
|
+
headers: {
|
|
490
|
+
[name: string]: unknown;
|
|
491
|
+
};
|
|
492
|
+
content: {
|
|
493
|
+
"application/json": {
|
|
494
|
+
audience: string;
|
|
495
|
+
/** Format: uuid */
|
|
496
|
+
contentGeneration: string;
|
|
497
|
+
expectedVersionId: string;
|
|
498
|
+
expiresAt: number;
|
|
499
|
+
/** Format: uuid */
|
|
500
|
+
grantId: string;
|
|
501
|
+
itemId: string;
|
|
502
|
+
leaseUntil: number;
|
|
503
|
+
revoked: boolean;
|
|
504
|
+
/** Format: uuid */
|
|
505
|
+
sessionId: string;
|
|
506
|
+
sourceVersionId: string;
|
|
507
|
+
token: string;
|
|
508
|
+
workspaceId: string;
|
|
509
|
+
writable: boolean;
|
|
510
|
+
};
|
|
511
|
+
};
|
|
512
|
+
};
|
|
513
|
+
/** @description Capability or resource unavailable. */
|
|
514
|
+
404: {
|
|
515
|
+
headers: {
|
|
516
|
+
[name: string]: unknown;
|
|
517
|
+
};
|
|
518
|
+
content?: never;
|
|
519
|
+
};
|
|
520
|
+
/** @description Conflicting request identity. */
|
|
521
|
+
409: {
|
|
522
|
+
headers: {
|
|
523
|
+
[name: string]: unknown;
|
|
524
|
+
};
|
|
525
|
+
content?: never;
|
|
526
|
+
};
|
|
527
|
+
/** @description Invalid request; an editor grant is one file for at most 24 hours. */
|
|
443
528
|
422: {
|
|
444
529
|
headers: {
|
|
445
530
|
[name: string]: unknown;
|
|
@@ -488,7 +573,7 @@ interface operations {
|
|
|
488
573
|
kind: "file" | "folder";
|
|
489
574
|
name: string | null;
|
|
490
575
|
/** @enum {string} */
|
|
491
|
-
role: "viewer";
|
|
576
|
+
role: "viewer" | "editor";
|
|
492
577
|
rootItemId: string;
|
|
493
578
|
};
|
|
494
579
|
};
|
|
@@ -507,7 +592,7 @@ interface operations {
|
|
|
507
592
|
};
|
|
508
593
|
content?: never;
|
|
509
594
|
};
|
|
510
|
-
/** @description Invalid request;
|
|
595
|
+
/** @description Invalid request; an editor grant is one file for at most 24 hours. */
|
|
511
596
|
422: {
|
|
512
597
|
headers: {
|
|
513
598
|
[name: string]: unknown;
|
|
@@ -558,7 +643,7 @@ interface operations {
|
|
|
558
643
|
expiresAt: number;
|
|
559
644
|
grantId: string;
|
|
560
645
|
/** @enum {string} */
|
|
561
|
-
role: "viewer";
|
|
646
|
+
role: "viewer" | "editor";
|
|
562
647
|
};
|
|
563
648
|
};
|
|
564
649
|
};
|
|
@@ -576,7 +661,7 @@ interface operations {
|
|
|
576
661
|
};
|
|
577
662
|
content?: never;
|
|
578
663
|
};
|
|
579
|
-
/** @description Invalid request;
|
|
664
|
+
/** @description Invalid request; an editor grant is one file for at most 24 hours. */
|
|
580
665
|
422: {
|
|
581
666
|
headers: {
|
|
582
667
|
[name: string]: unknown;
|
|
@@ -5007,7 +5092,7 @@ interface operations {
|
|
|
5007
5092
|
/** @enum {string} */
|
|
5008
5093
|
mode: "anyone" | "email";
|
|
5009
5094
|
/** @enum {string} */
|
|
5010
|
-
role: "viewer";
|
|
5095
|
+
role: "viewer" | "editor";
|
|
5011
5096
|
/** @enum {string} */
|
|
5012
5097
|
source: "direct" | "inherited";
|
|
5013
5098
|
sourceItemId: string;
|
|
@@ -5045,7 +5130,7 @@ interface operations {
|
|
|
5045
5130
|
};
|
|
5046
5131
|
content?: never;
|
|
5047
5132
|
};
|
|
5048
|
-
/** @description Invalid request;
|
|
5133
|
+
/** @description Invalid request; an editor grant is one file for at most 24 hours. */
|
|
5049
5134
|
422: {
|
|
5050
5135
|
headers: {
|
|
5051
5136
|
[name: string]: unknown;
|
|
@@ -5086,15 +5171,15 @@ interface operations {
|
|
|
5086
5171
|
expiresAt: number;
|
|
5087
5172
|
/** @constant */
|
|
5088
5173
|
mode: "anyone";
|
|
5089
|
-
/** @
|
|
5090
|
-
role: "viewer";
|
|
5174
|
+
/** @enum {string} */
|
|
5175
|
+
role: "viewer" | "editor";
|
|
5091
5176
|
} | {
|
|
5092
5177
|
email: string;
|
|
5093
5178
|
expiresAt: number;
|
|
5094
5179
|
/** @constant */
|
|
5095
5180
|
mode: "email";
|
|
5096
|
-
/** @
|
|
5097
|
-
role: "viewer";
|
|
5181
|
+
/** @enum {string} */
|
|
5182
|
+
role: "viewer" | "editor";
|
|
5098
5183
|
};
|
|
5099
5184
|
};
|
|
5100
5185
|
};
|
|
@@ -5115,7 +5200,7 @@ interface operations {
|
|
|
5115
5200
|
/** @enum {string} */
|
|
5116
5201
|
mode: "anyone" | "email";
|
|
5117
5202
|
/** @enum {string} */
|
|
5118
|
-
role: "viewer";
|
|
5203
|
+
role: "viewer" | "editor";
|
|
5119
5204
|
/** @enum {string} */
|
|
5120
5205
|
status: "pending" | "active" | "expired" | "revoked";
|
|
5121
5206
|
};
|
|
@@ -5153,7 +5238,7 @@ interface operations {
|
|
|
5153
5238
|
};
|
|
5154
5239
|
content?: never;
|
|
5155
5240
|
};
|
|
5156
|
-
/** @description Invalid request;
|
|
5241
|
+
/** @description Invalid request; an editor grant is one file for at most 24 hours. */
|
|
5157
5242
|
422: {
|
|
5158
5243
|
headers: {
|
|
5159
5244
|
[name: string]: unknown;
|
|
@@ -5205,7 +5290,7 @@ interface operations {
|
|
|
5205
5290
|
/** @enum {string} */
|
|
5206
5291
|
mode: "anyone" | "email";
|
|
5207
5292
|
/** @enum {string} */
|
|
5208
|
-
role: "viewer";
|
|
5293
|
+
role: "viewer" | "editor";
|
|
5209
5294
|
/** @enum {string} */
|
|
5210
5295
|
status: "pending" | "active" | "expired" | "revoked";
|
|
5211
5296
|
};
|
|
@@ -5243,7 +5328,7 @@ interface operations {
|
|
|
5243
5328
|
};
|
|
5244
5329
|
content?: never;
|
|
5245
5330
|
};
|
|
5246
|
-
/** @description Invalid request;
|
|
5331
|
+
/** @description Invalid request; an editor grant is one file for at most 24 hours. */
|
|
5247
5332
|
422: {
|
|
5248
5333
|
headers: {
|
|
5249
5334
|
[name: string]: unknown;
|
|
@@ -5294,7 +5379,7 @@ interface operations {
|
|
|
5294
5379
|
/** @enum {string} */
|
|
5295
5380
|
mode: "anyone" | "email";
|
|
5296
5381
|
/** @enum {string} */
|
|
5297
|
-
role: "viewer";
|
|
5382
|
+
role: "viewer" | "editor";
|
|
5298
5383
|
/** @enum {string} */
|
|
5299
5384
|
status: "pending" | "active" | "expired" | "revoked";
|
|
5300
5385
|
};
|
|
@@ -5328,7 +5413,7 @@ interface operations {
|
|
|
5328
5413
|
};
|
|
5329
5414
|
content?: never;
|
|
5330
5415
|
};
|
|
5331
|
-
/** @description Invalid request;
|
|
5416
|
+
/** @description Invalid request; an editor grant is one file for at most 24 hours. */
|
|
5332
5417
|
422: {
|
|
5333
5418
|
headers: {
|
|
5334
5419
|
[name: string]: unknown;
|
|
@@ -5759,7 +5844,7 @@ interface operations {
|
|
|
5759
5844
|
};
|
|
5760
5845
|
};
|
|
5761
5846
|
};
|
|
5762
|
-
/** @description Identity, D1, authorization, entitlement, or trusted capacity authority is unavailable. */
|
|
5847
|
+
/** @description Identity, D1, authorization, entitlement, or trusted capacity authority is unavailable. An admission refusal carries the caller-facing reason. */
|
|
5763
5848
|
503: {
|
|
5764
5849
|
headers: {
|
|
5765
5850
|
[name: string]: unknown;
|
|
@@ -5778,7 +5863,10 @@ interface operations {
|
|
|
5778
5863
|
error: {
|
|
5779
5864
|
/** @enum {string} */
|
|
5780
5865
|
code: "service_unavailable";
|
|
5781
|
-
details:
|
|
5866
|
+
details: {
|
|
5867
|
+
/** @enum {string} */
|
|
5868
|
+
reason?: "upload_admission_saturated" | "upload_admission_stalled" | "unspecified";
|
|
5869
|
+
};
|
|
5782
5870
|
/** @enum {string} */
|
|
5783
5871
|
message: "The service is temporarily unavailable.";
|
|
5784
5872
|
requestId: string;
|
|
@@ -7278,6 +7366,8 @@ type VisitorGrantPage = JsonResponse<"listVisitorGrants", 200>;
|
|
|
7278
7366
|
type VisitorItem = JsonResponse<"readVisitorItem", 200>;
|
|
7279
7367
|
type VisitorChildren = JsonResponse<"listVisitorChildren", 200>;
|
|
7280
7368
|
type VisitorSession = JsonResponse<"redeemVisitorInvitation", 200>;
|
|
7369
|
+
type VisitorEditingSession = JsonResponse<"createVisitorEditingSession", 201>;
|
|
7370
|
+
type CreateVisitorEditingSessionInput = VisitorReadInput & JsonRequest<"createVisitorEditingSession">;
|
|
7281
7371
|
type CreateVisitorGrantInput = GetItemInput & {
|
|
7282
7372
|
readonly command: JsonRequest<"createVisitorGrant">;
|
|
7283
7373
|
readonly idempotencyKey: string;
|
|
@@ -7314,6 +7404,7 @@ interface DriveVisitorClient {
|
|
|
7314
7404
|
readonly sessionToken: string;
|
|
7315
7405
|
readonly signal?: AbortSignal;
|
|
7316
7406
|
}): Promise<DriveOperationResult<VisitorSession, 200>>;
|
|
7407
|
+
createEditingSession(input: CreateVisitorEditingSessionInput): Promise<DriveOperationResult<VisitorEditingSession, 201>>;
|
|
7317
7408
|
}
|
|
7318
7409
|
interface DriveServerClient extends DriveOperations {}
|
|
7319
7410
|
interface DriveClient extends DriveOperations {
|
|
@@ -7321,4 +7412,4 @@ interface DriveClient extends DriveOperations {
|
|
|
7321
7412
|
uploadFile(input: UploadFileInput): Promise<DriveOperationResult<UploadCompletion, 200 | 202>>;
|
|
7322
7413
|
}
|
|
7323
7414
|
//#endregion
|
|
7324
|
-
export {
|
|
7415
|
+
export { ListItemSharingPeopleInput as $, WorkspaceItemSearchItem as $t, DriveVisitorClient as A, UploadCompletion as At, FolderPage as B, UploadStatus as Bt, DriveEditingClientConfig as C, RestoreItemVersionInput as Ct, DriveResponseValidators as D, TrashItemInput as Dt, DriveOperations as E, SearchWorkspaceItemsInput as Et, EditingSessionCreation as F, UploadFileProgressCallback as Ft, GetVisitorGrantInput as G, VisitorGrant as Gt, GetItemInput as H, VisitorChildrenInput as Ht, EffectivePermissionAction as I, UploadFileVersionInput as It, IncomingSharePage as J, VisitorItem as Jt, GetWorkspaceUsageInput as K, VisitorGrantCreation as Kt, EffectivePermissionResponse as L, UploadPartDescriptor as Lt, EditingFileMetadata as M, UploadFileInput as Mt, EditingFileVersionInput as N, UploadFilePhase as Nt, DriveServerClient as O, UpdateItemInput as Ot, EditingSession as P, UploadFileProgress as Pt, ListItemPermissionsInput as Q, WorkspaceDiscoveryPage as Qt, FileAccessContext as R, UploadPartResult as Rt, DriveEditingClient as S, RestoreItemInput as St, DriveOperationResult as T, RevokeVisitorGrantInput as Tt, GetItemVersionInput as U, VisitorDownloadInput as Ut, GetCurrentWorkspaceInput as V, VisitorChildren as Vt, GetUploadStatusInput as W, VisitorEditingSession as Wt, ListFolderChildrenInput as X, VisitorSession as Xt, ItemSharingPeoplePage as Y, VisitorReadInput as Yt, ListIncomingSharesInput as Z, WorkspaceDiscoveryItem as Zt, DownloadItemResult as _, ReadEffectiveItemPermissionsInput as _t, CreateDownloadInput as a, ManagedItemVersion as at, DriveCredentialContext as b, RegisterItemRecipientInput as bt, CreateFolderInput as c, ManagedItemVersionRestoreResult as ct, CreateUploadPartDescriptorInput as d, PermissionAction as dt, WorkspaceItemSearchPage as en, ListItemVersionsInput as et, CreateVisitorEditingSessionInput as f, PermissionGrant as ft, DeleteItemInput as g, ProtectionClassification as gt, CurrentWorkspaceSources as h, PermissionPage as ht, CompleteUploadInput as i, ManagedItemMetadata as it, DriveVisitorClientConfig as j, UploadConfirmedPart as jt, DriveServerClientConfig as k, UpdateItemPermissionInput as kt, CreateItemPermissionInput as l, ManagedLifecycleItem as lt, CurrentWorkspace as m, PermissionMutation as mt, ChangeEditingSessionInput as n, operations as nn, ManagedDownloadDescriptor as nt, CreateEditingSessionInput as o, ManagedItemVersionPage as ot, CreateVisitorGrantInput as p, PermissionGrantee as pt, IncomingShareContext as q, VisitorGrantPage as qt, CommitFileVersionInput as r, ManagedDownloadRestorePending as rt, CreateFileVersionUploadInput as s, ManagedItemVersionResource as st, AbortUploadInput as t, WorkspaceUsage as tn, ListWorkspaceItemsInput as tt, CreateUploadInput as u, PendingUpload as ut, DriveClient as v, ReadyUpload as vt, DriveEditingServerClient as w, RevokeItemPermissionInput as wt, DriveCredentialProvider as x, RegisteredRecipientDisplay as xt, DriveClientConfig as y, RecordUploadPartInput as yt, FolderItem as z, UploadSession as zt };
|
package/dist/contract2.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as
|
|
1
|
+
import { A as DriveVisitorClient, j as DriveVisitorClientConfig } from "./contract.js";
|
|
2
2
|
//#region src/internal/client/visitors.d.ts
|
|
3
3
|
declare function createDriveVisitorClient(config: DriveVisitorClientConfig): DriveVisitorClient;
|
|
4
4
|
declare function createVisitorSessionToken(): string;
|
package/dist/core.d.ts
CHANGED
|
@@ -3,6 +3,18 @@ declare const DRIVE_API_ERROR_CODES: readonly ["authentication_required", "ident
|
|
|
3
3
|
type DriveApiErrorCode = (typeof DRIVE_API_ERROR_CODES)[number];
|
|
4
4
|
type DriveSdkErrorCode = "invalid_input" | "credential_unavailable" | "network_error" | "timeout" | "aborted" | "invalid_response";
|
|
5
5
|
type DriveErrorCode = DriveApiErrorCode | DriveSdkErrorCode;
|
|
6
|
+
/**
|
|
7
|
+
* The closed public vocabulary Drive may place on `DriveError.details.reason`.
|
|
8
|
+
*
|
|
9
|
+
* A reason narrows an operational refusal the caller can act on. It never carries record identifiers,
|
|
10
|
+
* counts, or state outside the caller's own workspace, and an unknown value is never surfaced.
|
|
11
|
+
*/
|
|
12
|
+
declare const DRIVE_API_ERROR_REASONS: readonly ["upload_admission_saturated", "upload_admission_stalled", "unspecified"];
|
|
13
|
+
type DriveErrorReason = (typeof DRIVE_API_ERROR_REASONS)[number];
|
|
14
|
+
type DriveErrorDetails = Readonly<{
|
|
15
|
+
reason?: DriveErrorReason;
|
|
16
|
+
}>;
|
|
17
|
+
declare function isDriveErrorReason(value: unknown): value is DriveErrorReason;
|
|
6
18
|
declare const DRIVE_API_ERROR_MESSAGES: Readonly<{
|
|
7
19
|
readonly authentication_required: "Authentication is required.";
|
|
8
20
|
readonly identity_authority_unavailable: "Authentication is temporarily unavailable.";
|
|
@@ -26,11 +38,12 @@ declare class DriveError extends Error {
|
|
|
26
38
|
readonly code: DriveErrorCode;
|
|
27
39
|
readonly status: number | null;
|
|
28
40
|
readonly requestId: string | null;
|
|
29
|
-
readonly details:
|
|
41
|
+
readonly details: DriveErrorDetails;
|
|
30
42
|
constructor(code: DriveErrorCode, options?: {
|
|
31
43
|
status?: number;
|
|
32
44
|
requestId?: string | null;
|
|
45
|
+
reason?: DriveErrorReason;
|
|
33
46
|
});
|
|
34
47
|
}
|
|
35
48
|
//#endregion
|
|
36
|
-
export { DRIVE_API_ERROR_CODES, DRIVE_API_ERROR_MESSAGES, DriveApiErrorCode, DriveError, DriveErrorCode, DriveSdkErrorCode };
|
|
49
|
+
export { DRIVE_API_ERROR_CODES, DRIVE_API_ERROR_MESSAGES, DRIVE_API_ERROR_REASONS, DriveApiErrorCode, DriveError, DriveErrorCode, DriveErrorDetails, DriveErrorReason, DriveSdkErrorCode, isDriveErrorReason };
|
package/dist/core.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=Object.freeze([`authentication_required`,`identity_authority_unavailable`,`recipient_unavailable`,`registration_conflict`,`rate_limited`,`permission_denied`,`resource_not_found`,`invalid_request`,`invalid_pagination_cursor`,`invalid_idempotency_key`,`precondition_failed`,`range_not_satisfiable`,`idempotency_conflict`,`quota_exceeded`,`upload_recovery_required`,`service_unavailable`,`internal_error`]),t=Object.freeze({authentication_required:`Authentication is required.`,identity_authority_unavailable:`Authentication is temporarily unavailable.`,recipient_unavailable:`The recipient is unavailable.`,registration_conflict:`The recipient could not be confirmed.`,rate_limited:`Too many requests.`,permission_denied:`The requested action is not permitted.`,resource_not_found:`The requested resource was not found.`,invalid_request:`The request is invalid.`,invalid_pagination_cursor:`The pagination cursor is invalid.`,invalid_idempotency_key:`The idempotency key is invalid.`,precondition_failed:`The request precondition failed.`,range_not_satisfiable:`The requested byte range is not satisfiable.`,idempotency_conflict:`The idempotency key conflicts with an earlier request.`,quota_exceeded:`The workspace storage quota would be exceeded.`,upload_recovery_required:`The upload requires recovery before it can continue.`,service_unavailable:`The service is temporarily unavailable.`,internal_error:`The request could not be completed.`}),
|
|
1
|
+
const e=Object.freeze([`authentication_required`,`identity_authority_unavailable`,`recipient_unavailable`,`registration_conflict`,`rate_limited`,`permission_denied`,`resource_not_found`,`invalid_request`,`invalid_pagination_cursor`,`invalid_idempotency_key`,`precondition_failed`,`range_not_satisfiable`,`idempotency_conflict`,`quota_exceeded`,`upload_recovery_required`,`service_unavailable`,`internal_error`]),t=Object.freeze([`upload_admission_saturated`,`upload_admission_stalled`,`unspecified`]);function n(e){return typeof e==`string`&&t.includes(e)}const r=Object.freeze({authentication_required:`Authentication is required.`,identity_authority_unavailable:`Authentication is temporarily unavailable.`,recipient_unavailable:`The recipient is unavailable.`,registration_conflict:`The recipient could not be confirmed.`,rate_limited:`Too many requests.`,permission_denied:`The requested action is not permitted.`,resource_not_found:`The requested resource was not found.`,invalid_request:`The request is invalid.`,invalid_pagination_cursor:`The pagination cursor is invalid.`,invalid_idempotency_key:`The idempotency key is invalid.`,precondition_failed:`The request precondition failed.`,range_not_satisfiable:`The requested byte range is not satisfiable.`,idempotency_conflict:`The idempotency key conflicts with an earlier request.`,quota_exceeded:`The workspace storage quota would be exceeded.`,upload_recovery_required:`The upload requires recovery before it can continue.`,service_unavailable:`The service is temporarily unavailable.`,internal_error:`The request could not be completed.`}),i=Object.freeze({invalid_input:`The Drive SDK input is invalid.`,credential_unavailable:`A Drive credential could not be obtained.`,network_error:`The Drive request could not reach the service.`,timeout:`The Drive request timed out.`,aborted:`The Drive request was aborted.`,invalid_response:`Drive returned an invalid response.`});var a=class extends Error{code;status;requestId;details;constructor(e,t={}){super(e in r?r[e]:i[e]),this.name=`DriveError`,this.code=e,this.status=t.status??null,this.requestId=t.requestId??null,this.details=Object.freeze(n(t.reason)?{reason:t.reason}:{})}};export{e as DRIVE_API_ERROR_CODES,r as DRIVE_API_ERROR_MESSAGES,t as DRIVE_API_ERROR_REASONS,a as DriveError,n as isDriveErrorReason};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { $
|
|
2
|
-
import { DRIVE_API_ERROR_CODES, DRIVE_API_ERROR_MESSAGES, DriveApiErrorCode, DriveError, DriveErrorCode, DriveSdkErrorCode } from "./core.js";
|
|
1
|
+
import { $t as WorkspaceItemSearchItem, A as DriveVisitorClient, At as UploadCompletion, B as FolderPage, Bt as UploadStatus, C as DriveEditingClientConfig, Ct as RestoreItemVersionInput, D as DriveResponseValidators, Dt as TrashItemInput, E as DriveOperations, Et as SearchWorkspaceItemsInput, F as EditingSessionCreation, Ft as UploadFileProgressCallback, G as GetVisitorGrantInput, Gt as VisitorGrant, H as GetItemInput, Ht as VisitorChildrenInput, I as EffectivePermissionAction, It as UploadFileVersionInput, Jt as VisitorItem, K as GetWorkspaceUsageInput, Kt as VisitorGrantCreation, Lt as UploadPartDescriptor, M as EditingFileMetadata, Mt as UploadFileInput, N as EditingFileVersionInput, Nt as UploadFilePhase, Ot as UpdateItemInput, P as EditingSession, Pt as UploadFileProgress, Q as ListItemPermissionsInput, Qt as WorkspaceDiscoveryPage, R as FileAccessContext, Rt as UploadPartResult, S as DriveEditingClient, St as RestoreItemInput, T as DriveOperationResult, Tt as RevokeVisitorGrantInput, U as GetItemVersionInput, Ut as VisitorDownloadInput, V as GetCurrentWorkspaceInput, Vt as VisitorChildren, W as GetUploadStatusInput, X as ListFolderChildrenInput, Xt as VisitorSession, Yt as VisitorReadInput, Zt as WorkspaceDiscoveryItem, _ as DownloadItemResult, _t as ReadEffectiveItemPermissionsInput, a as CreateDownloadInput, at as ManagedItemVersion, c as CreateFolderInput, ct as ManagedItemVersionRestoreResult, d as CreateUploadPartDescriptorInput, dt as PermissionAction, en as WorkspaceItemSearchPage, et as ListItemVersionsInput, ft as PermissionGrant, g as DeleteItemInput, gt as ProtectionClassification, h as CurrentWorkspaceSources, i as CompleteUploadInput, it as ManagedItemMetadata, j as DriveVisitorClientConfig, jt as UploadConfirmedPart, kt as UpdateItemPermissionInput, l as CreateItemPermissionInput, lt as ManagedLifecycleItem, m as CurrentWorkspace, mt as PermissionMutation, n as ChangeEditingSessionInput, nt as ManagedDownloadDescriptor, o as CreateEditingSessionInput, ot as ManagedItemVersionPage, p as CreateVisitorGrantInput, pt as PermissionGrantee, qt as VisitorGrantPage, r as CommitFileVersionInput, rt as ManagedDownloadRestorePending, s as CreateFileVersionUploadInput, st as ManagedItemVersionResource, t as AbortUploadInput, tn as WorkspaceUsage, tt as ListWorkspaceItemsInput, u as CreateUploadInput, ut as PendingUpload, v as DriveClient, vt as ReadyUpload, wt as RevokeItemPermissionInput, x as DriveCredentialProvider, y as DriveClientConfig, yt as RecordUploadPartInput, z as FolderItem, zt as UploadSession } from "./contract.js";
|
|
2
|
+
import { DRIVE_API_ERROR_CODES, DRIVE_API_ERROR_MESSAGES, DRIVE_API_ERROR_REASONS, DriveApiErrorCode, DriveError, DriveErrorCode, DriveErrorDetails, DriveErrorReason, DriveSdkErrorCode } from "./core.js";
|
|
3
3
|
import { n as createVisitorSessionToken, t as createDriveVisitorClient } from "./contract2.js";
|
|
4
4
|
import { createDriveClient, createDriveEditingClient } from "./client.js";
|
|
5
|
-
export { type AbortUploadInput, type ChangeEditingSessionInput, type CommitFileVersionInput, type CompleteUploadInput, type CreateDownloadInput, type CreateEditingSessionInput, type CreateFileVersionUploadInput, type CreateFolderInput, type CreateItemPermissionInput, type CreateUploadInput, type CreateUploadPartDescriptorInput, type CreateVisitorGrantInput, type CurrentWorkspace, type CurrentWorkspaceSources, DRIVE_API_ERROR_CODES, DRIVE_API_ERROR_MESSAGES, type DeleteItemInput, type DownloadItemResult, type DriveApiErrorCode, type DriveClient, type DriveClientConfig, type DriveCredentialProvider, type DriveEditingClient, type DriveEditingClientConfig, DriveError, type DriveErrorCode, type DriveOperationResult, type DriveOperations, type DriveResponseValidators, type DriveSdkErrorCode, type DriveVisitorClient, type DriveVisitorClientConfig, type EditingFileMetadata, type EditingFileVersionInput, type EditingSession, type EditingSessionCreation, type EffectivePermissionAction, type FileAccessContext, type FolderItem, type FolderPage, type GetCurrentWorkspaceInput, type GetItemInput, type GetItemVersionInput, type GetUploadStatusInput, type GetVisitorGrantInput, type GetWorkspaceUsageInput, type ListFolderChildrenInput, type ListItemPermissionsInput, type ListItemVersionsInput, type ListWorkspaceItemsInput, type ManagedDownloadDescriptor, type ManagedDownloadRestorePending, type ManagedItemMetadata, type ManagedItemVersion, type ManagedItemVersionPage, type ManagedItemVersionResource, type ManagedItemVersionRestoreResult, type ManagedLifecycleItem, type PendingUpload, type PermissionAction, type PermissionGrant, type PermissionGrantee, type PermissionMutation, type ProtectionClassification, type ReadEffectiveItemPermissionsInput, type ReadyUpload, type RecordUploadPartInput, type RestoreItemInput, type RestoreItemVersionInput, type RevokeItemPermissionInput, type RevokeVisitorGrantInput, type SearchWorkspaceItemsInput, type TrashItemInput, type UpdateItemInput, type UpdateItemPermissionInput, type UploadCompletion, type UploadConfirmedPart, type UploadFileInput, type UploadFilePhase, type UploadFileProgress, type UploadFileProgressCallback, type UploadFileVersionInput, type UploadPartDescriptor, type UploadPartResult, type UploadSession, type UploadStatus, type VisitorChildren, type VisitorChildrenInput, type VisitorDownloadInput, type VisitorGrant, type VisitorGrantCreation, type VisitorGrantPage, type VisitorItem, type VisitorReadInput, type VisitorSession, type WorkspaceDiscoveryItem, type WorkspaceDiscoveryPage, type WorkspaceItemSearchItem, type WorkspaceItemSearchPage, type WorkspaceUsage, createDriveClient, createDriveEditingClient, createDriveVisitorClient, createVisitorSessionToken };
|
|
5
|
+
export { type AbortUploadInput, type ChangeEditingSessionInput, type CommitFileVersionInput, type CompleteUploadInput, type CreateDownloadInput, type CreateEditingSessionInput, type CreateFileVersionUploadInput, type CreateFolderInput, type CreateItemPermissionInput, type CreateUploadInput, type CreateUploadPartDescriptorInput, type CreateVisitorGrantInput, type CurrentWorkspace, type CurrentWorkspaceSources, DRIVE_API_ERROR_CODES, DRIVE_API_ERROR_MESSAGES, DRIVE_API_ERROR_REASONS, type DeleteItemInput, type DownloadItemResult, type DriveApiErrorCode, type DriveClient, type DriveClientConfig, type DriveCredentialProvider, type DriveEditingClient, type DriveEditingClientConfig, DriveError, type DriveErrorCode, type DriveErrorDetails, type DriveErrorReason, type DriveOperationResult, type DriveOperations, type DriveResponseValidators, type DriveSdkErrorCode, type DriveVisitorClient, type DriveVisitorClientConfig, type EditingFileMetadata, type EditingFileVersionInput, type EditingSession, type EditingSessionCreation, type EffectivePermissionAction, type FileAccessContext, type FolderItem, type FolderPage, type GetCurrentWorkspaceInput, type GetItemInput, type GetItemVersionInput, type GetUploadStatusInput, type GetVisitorGrantInput, type GetWorkspaceUsageInput, type ListFolderChildrenInput, type ListItemPermissionsInput, type ListItemVersionsInput, type ListWorkspaceItemsInput, type ManagedDownloadDescriptor, type ManagedDownloadRestorePending, type ManagedItemMetadata, type ManagedItemVersion, type ManagedItemVersionPage, type ManagedItemVersionResource, type ManagedItemVersionRestoreResult, type ManagedLifecycleItem, type PendingUpload, type PermissionAction, type PermissionGrant, type PermissionGrantee, type PermissionMutation, type ProtectionClassification, type ReadEffectiveItemPermissionsInput, type ReadyUpload, type RecordUploadPartInput, type RestoreItemInput, type RestoreItemVersionInput, type RevokeItemPermissionInput, type RevokeVisitorGrantInput, type SearchWorkspaceItemsInput, type TrashItemInput, type UpdateItemInput, type UpdateItemPermissionInput, type UploadCompletion, type UploadConfirmedPart, type UploadFileInput, type UploadFilePhase, type UploadFileProgress, type UploadFileProgressCallback, type UploadFileVersionInput, type UploadPartDescriptor, type UploadPartResult, type UploadSession, type UploadStatus, type VisitorChildren, type VisitorChildrenInput, type VisitorDownloadInput, type VisitorGrant, type VisitorGrantCreation, type VisitorGrantPage, type VisitorItem, type VisitorReadInput, type VisitorSession, type WorkspaceDiscoveryItem, type WorkspaceDiscoveryPage, type WorkspaceItemSearchItem, type WorkspaceItemSearchPage, type WorkspaceUsage, createDriveClient, createDriveEditingClient, createDriveVisitorClient, createVisitorSessionToken };
|