@finueva/drive 0.8.0 → 0.10.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.
@@ -223,6 +223,70 @@ interface operations {
223
223
  };
224
224
  };
225
225
  };
226
+ listIncomingShares: {
227
+ parameters: {
228
+ query?: {
229
+ limit?: number;
230
+ cursor?: string;
231
+ };
232
+ header?: never;
233
+ path?: never;
234
+ cookie?: never;
235
+ };
236
+ requestBody?: never;
237
+ responses: {
238
+ /** @description Exact opaque item contexts; no owner root or membership. */
239
+ 200: {
240
+ headers: {
241
+ [name: string]: unknown;
242
+ };
243
+ content: {
244
+ "application/json": {
245
+ items: {
246
+ itemId: string;
247
+ workspaceId: string;
248
+ }[];
249
+ nextCursor: string | null;
250
+ };
251
+ };
252
+ };
253
+ /** @description Authentication required. */
254
+ 401: {
255
+ headers: {
256
+ [name: string]: unknown;
257
+ };
258
+ content?: never;
259
+ };
260
+ /** @description Personal workspace not found. */
261
+ 404: {
262
+ headers: {
263
+ [name: string]: unknown;
264
+ };
265
+ content?: never;
266
+ };
267
+ /** @description Authority changed. */
268
+ 409: {
269
+ headers: {
270
+ [name: string]: unknown;
271
+ };
272
+ content?: never;
273
+ };
274
+ /** @description Invalid request or cursor. */
275
+ 422: {
276
+ headers: {
277
+ [name: string]: unknown;
278
+ };
279
+ content?: never;
280
+ };
281
+ /** @description Service unavailable. */
282
+ 503: {
283
+ headers: {
284
+ [name: string]: unknown;
285
+ };
286
+ content?: never;
287
+ };
288
+ };
289
+ };
226
290
  getCurrentWorkspace: {
227
291
  parameters: {
228
292
  query?: never;
@@ -2972,6 +3036,439 @@ interface operations {
2972
3036
  };
2973
3037
  };
2974
3038
  };
3039
+ registerItemRecipient: {
3040
+ parameters: {
3041
+ query?: never;
3042
+ header: {
3043
+ "Idempotency-Key": string;
3044
+ "If-Match": string;
3045
+ };
3046
+ path: {
3047
+ workspaceId: string;
3048
+ itemId: string;
3049
+ };
3050
+ cookie?: never;
3051
+ };
3052
+ requestBody: {
3053
+ content: {
3054
+ "application/json": {
3055
+ /** @description Normalized email, at most 320 UTF-8 bytes. */
3056
+ email: string;
3057
+ /** @enum {string} */
3058
+ role: "viewer" | "editor";
3059
+ };
3060
+ };
3061
+ };
3062
+ responses: {
3063
+ /** @description Exact grant replay. */
3064
+ 200: {
3065
+ headers: {
3066
+ [name: string]: unknown;
3067
+ };
3068
+ content: {
3069
+ "application/json": {
3070
+ collectionRevision: number;
3071
+ grant: {
3072
+ actions: ("items:content:read" | "items:create" | "items:delete" | "items:metadata:read" | "items:permissions:read" | "items:update")[];
3073
+ /** @enum {string} */
3074
+ availability: "active" | "expired" | "revoked";
3075
+ expiresAtEpochMilliseconds: number | null;
3076
+ grantId: string;
3077
+ grantee: {
3078
+ /** @enum {string} */
3079
+ type: "user";
3080
+ userId: string;
3081
+ } | {
3082
+ teamId: string;
3083
+ /** @enum {string} */
3084
+ type: "team";
3085
+ };
3086
+ revision: number;
3087
+ /** @enum {string} */
3088
+ source: "direct";
3089
+ sourceItemId: string;
3090
+ };
3091
+ /** @enum {string} */
3092
+ outcome: "committed" | "replayed";
3093
+ };
3094
+ };
3095
+ };
3096
+ /** @description Registered recipient grant created. */
3097
+ 201: {
3098
+ headers: {
3099
+ [name: string]: unknown;
3100
+ };
3101
+ content: {
3102
+ "application/json": {
3103
+ collectionRevision: number;
3104
+ grant: {
3105
+ actions: ("items:content:read" | "items:create" | "items:delete" | "items:metadata:read" | "items:permissions:read" | "items:update")[];
3106
+ /** @enum {string} */
3107
+ availability: "active" | "expired" | "revoked";
3108
+ expiresAtEpochMilliseconds: number | null;
3109
+ grantId: string;
3110
+ grantee: {
3111
+ /** @enum {string} */
3112
+ type: "user";
3113
+ userId: string;
3114
+ } | {
3115
+ teamId: string;
3116
+ /** @enum {string} */
3117
+ type: "team";
3118
+ };
3119
+ revision: number;
3120
+ /** @enum {string} */
3121
+ source: "direct";
3122
+ sourceItemId: string;
3123
+ };
3124
+ /** @enum {string} */
3125
+ outcome: "committed" | "replayed";
3126
+ };
3127
+ };
3128
+ };
3129
+ /** @description A valid Drive user bearer credential is required. */
3130
+ 401: {
3131
+ headers: {
3132
+ [name: string]: unknown;
3133
+ };
3134
+ content: {
3135
+ "application/json": {
3136
+ error: {
3137
+ /** @enum {string} */
3138
+ code: "authentication_required";
3139
+ details: Record<string, never>;
3140
+ /** @enum {string} */
3141
+ message: "Authentication is required.";
3142
+ requestId: string;
3143
+ };
3144
+ };
3145
+ };
3146
+ };
3147
+ /** @description The discoverable item does not permit this permission operation. */
3148
+ 403: {
3149
+ headers: {
3150
+ [name: string]: unknown;
3151
+ };
3152
+ content: {
3153
+ "application/json": {
3154
+ error: {
3155
+ /** @enum {string} */
3156
+ code: "permission_denied";
3157
+ details: Record<string, never>;
3158
+ /** @enum {string} */
3159
+ message: "The requested action is not permitted.";
3160
+ requestId: string;
3161
+ };
3162
+ };
3163
+ };
3164
+ };
3165
+ /** @description The item or registered recipient is unavailable. */
3166
+ 404: {
3167
+ headers: {
3168
+ [name: string]: unknown;
3169
+ };
3170
+ content?: never;
3171
+ };
3172
+ /** @description The idempotency key was reused for a different semantic request. */
3173
+ 409: {
3174
+ headers: {
3175
+ [name: string]: unknown;
3176
+ };
3177
+ content: {
3178
+ "application/json": {
3179
+ error: {
3180
+ /** @enum {string} */
3181
+ code: "idempotency_conflict";
3182
+ details: Record<string, never>;
3183
+ /** @enum {string} */
3184
+ message: "The idempotency key conflicts with an earlier request.";
3185
+ requestId: string;
3186
+ };
3187
+ };
3188
+ };
3189
+ };
3190
+ /** @description The supplied revision or post-preflight authority is stale. */
3191
+ 412: {
3192
+ headers: {
3193
+ [name: string]: unknown;
3194
+ };
3195
+ content: {
3196
+ "application/json": {
3197
+ error: {
3198
+ /** @enum {string} */
3199
+ code: "precondition_failed";
3200
+ details: Record<string, never>;
3201
+ /** @enum {string} */
3202
+ message: "The request precondition failed.";
3203
+ requestId: string;
3204
+ };
3205
+ };
3206
+ };
3207
+ };
3208
+ /** @description The path, query, headers, idempotency key, or body are invalid. */
3209
+ 422: {
3210
+ headers: {
3211
+ [name: string]: unknown;
3212
+ };
3213
+ content: {
3214
+ "application/json": {
3215
+ error: {
3216
+ /** @enum {string} */
3217
+ code: "invalid_request";
3218
+ details: Record<string, never>;
3219
+ /** @enum {string} */
3220
+ message: "The request is invalid.";
3221
+ requestId: string;
3222
+ };
3223
+ } | {
3224
+ error: {
3225
+ /** @enum {string} */
3226
+ code: "invalid_idempotency_key";
3227
+ details: Record<string, never>;
3228
+ /** @enum {string} */
3229
+ message: "The idempotency key is invalid.";
3230
+ requestId: string;
3231
+ };
3232
+ };
3233
+ };
3234
+ };
3235
+ /** @description Recipient resolution rate limit exceeded. */
3236
+ 429: {
3237
+ headers: {
3238
+ [name: string]: unknown;
3239
+ };
3240
+ content?: never;
3241
+ };
3242
+ /** @description Identity, D1, authorization, audit, cursor, or capacity authority is unavailable. */
3243
+ 503: {
3244
+ headers: {
3245
+ [name: string]: unknown;
3246
+ };
3247
+ content: {
3248
+ "application/json": {
3249
+ error: {
3250
+ /** @enum {string} */
3251
+ code: "identity_authority_unavailable";
3252
+ details: Record<string, never>;
3253
+ /** @enum {string} */
3254
+ message: "Authentication is temporarily unavailable.";
3255
+ requestId: string;
3256
+ };
3257
+ } | {
3258
+ error: {
3259
+ /** @enum {string} */
3260
+ code: "service_unavailable";
3261
+ details: Record<string, never>;
3262
+ /** @enum {string} */
3263
+ message: "The service is temporarily unavailable.";
3264
+ requestId: string;
3265
+ };
3266
+ };
3267
+ };
3268
+ };
3269
+ };
3270
+ };
3271
+ listItemSharingPeople: {
3272
+ parameters: {
3273
+ query?: {
3274
+ limit?: number;
3275
+ cursor?: string;
3276
+ };
3277
+ header?: never;
3278
+ path: {
3279
+ workspaceId: string;
3280
+ itemId: string;
3281
+ };
3282
+ cookie?: never;
3283
+ };
3284
+ requestBody?: never;
3285
+ responses: {
3286
+ /** @description Canonical grant page; unavailable display is null and never authority. */
3287
+ 200: {
3288
+ headers: {
3289
+ [name: string]: unknown;
3290
+ };
3291
+ content: {
3292
+ "application/json": {
3293
+ collectionEtag: string;
3294
+ collectionRevision: number;
3295
+ items: ({
3296
+ actions: ("items:content:read" | "items:create" | "items:delete" | "items:metadata:read" | "items:permissions:read" | "items:update")[];
3297
+ /** @enum {string} */
3298
+ availability: "active" | "expired" | "revoked";
3299
+ etag: string;
3300
+ expiresAtEpochMilliseconds: number | null;
3301
+ grantId: string;
3302
+ grantee: {
3303
+ /** @enum {string} */
3304
+ type: "user";
3305
+ userId: string;
3306
+ } | {
3307
+ teamId: string;
3308
+ /** @enum {string} */
3309
+ type: "team";
3310
+ };
3311
+ revision: number;
3312
+ /** @enum {string} */
3313
+ source: "direct" | "inherited";
3314
+ sourceItemId: string;
3315
+ } & {
3316
+ recipient: {
3317
+ /** @description At most 320 UTF-8 bytes. */
3318
+ email: string;
3319
+ expiresAt: number;
3320
+ /** @description At most 1024 UTF-8 bytes. */
3321
+ name: string;
3322
+ resolvedAt: number;
3323
+ userId: string;
3324
+ } | null;
3325
+ })[];
3326
+ nextCursor: string | null;
3327
+ };
3328
+ };
3329
+ };
3330
+ /** @description A valid Drive user bearer credential is required. */
3331
+ 401: {
3332
+ headers: {
3333
+ [name: string]: unknown;
3334
+ };
3335
+ content: {
3336
+ "application/json": {
3337
+ error: {
3338
+ /** @enum {string} */
3339
+ code: "authentication_required";
3340
+ details: Record<string, never>;
3341
+ /** @enum {string} */
3342
+ message: "Authentication is required.";
3343
+ requestId: string;
3344
+ };
3345
+ };
3346
+ };
3347
+ };
3348
+ /** @description The discoverable item does not permit this permission operation. */
3349
+ 403: {
3350
+ headers: {
3351
+ [name: string]: unknown;
3352
+ };
3353
+ content: {
3354
+ "application/json": {
3355
+ error: {
3356
+ /** @enum {string} */
3357
+ code: "permission_denied";
3358
+ details: Record<string, never>;
3359
+ /** @enum {string} */
3360
+ message: "The requested action is not permitted.";
3361
+ requestId: string;
3362
+ };
3363
+ };
3364
+ };
3365
+ };
3366
+ /** @description The item or registered recipient is unavailable. */
3367
+ 404: {
3368
+ headers: {
3369
+ [name: string]: unknown;
3370
+ };
3371
+ content?: never;
3372
+ };
3373
+ /** @description The idempotency key was reused for a different semantic request. */
3374
+ 409: {
3375
+ headers: {
3376
+ [name: string]: unknown;
3377
+ };
3378
+ content: {
3379
+ "application/json": {
3380
+ error: {
3381
+ /** @enum {string} */
3382
+ code: "idempotency_conflict";
3383
+ details: Record<string, never>;
3384
+ /** @enum {string} */
3385
+ message: "The idempotency key conflicts with an earlier request.";
3386
+ requestId: string;
3387
+ };
3388
+ };
3389
+ };
3390
+ };
3391
+ /** @description The supplied revision or post-preflight authority is stale. */
3392
+ 412: {
3393
+ headers: {
3394
+ [name: string]: unknown;
3395
+ };
3396
+ content: {
3397
+ "application/json": {
3398
+ error: {
3399
+ /** @enum {string} */
3400
+ code: "precondition_failed";
3401
+ details: Record<string, never>;
3402
+ /** @enum {string} */
3403
+ message: "The request precondition failed.";
3404
+ requestId: string;
3405
+ };
3406
+ };
3407
+ };
3408
+ };
3409
+ /** @description The path, query, headers, idempotency key, or body are invalid. */
3410
+ 422: {
3411
+ headers: {
3412
+ [name: string]: unknown;
3413
+ };
3414
+ content: {
3415
+ "application/json": {
3416
+ error: {
3417
+ /** @enum {string} */
3418
+ code: "invalid_request";
3419
+ details: Record<string, never>;
3420
+ /** @enum {string} */
3421
+ message: "The request is invalid.";
3422
+ requestId: string;
3423
+ };
3424
+ } | {
3425
+ error: {
3426
+ /** @enum {string} */
3427
+ code: "invalid_idempotency_key";
3428
+ details: Record<string, never>;
3429
+ /** @enum {string} */
3430
+ message: "The idempotency key is invalid.";
3431
+ requestId: string;
3432
+ };
3433
+ };
3434
+ };
3435
+ };
3436
+ /** @description Recipient resolution rate limit exceeded. */
3437
+ 429: {
3438
+ headers: {
3439
+ [name: string]: unknown;
3440
+ };
3441
+ content?: never;
3442
+ };
3443
+ /** @description Identity, D1, authorization, audit, cursor, or capacity authority is unavailable. */
3444
+ 503: {
3445
+ headers: {
3446
+ [name: string]: unknown;
3447
+ };
3448
+ content: {
3449
+ "application/json": {
3450
+ error: {
3451
+ /** @enum {string} */
3452
+ code: "identity_authority_unavailable";
3453
+ details: Record<string, never>;
3454
+ /** @enum {string} */
3455
+ message: "Authentication is temporarily unavailable.";
3456
+ requestId: string;
3457
+ };
3458
+ } | {
3459
+ error: {
3460
+ /** @enum {string} */
3461
+ code: "service_unavailable";
3462
+ details: Record<string, never>;
3463
+ /** @enum {string} */
3464
+ message: "The service is temporarily unavailable.";
3465
+ requestId: string;
3466
+ };
3467
+ };
3468
+ };
3469
+ };
3470
+ };
3471
+ };
2975
3472
  trashItem: {
2976
3473
  parameters: {
2977
3474
  query?: never;
@@ -5054,6 +5551,33 @@ type CreateDownloadPath = operations["createDownload"]["parameters"]["path"];
5054
5551
  type CreateDownloadQuery = NonNullable<operations["createDownload"]["parameters"]["query"]>;
5055
5552
  type CreateDownloadHeaders = operations["createDownload"]["parameters"]["header"];
5056
5553
  type GeneratedCurrentWorkspace = JsonResponse<"getCurrentWorkspace", 200>;
5554
+ type RegisteredRecipientDisplay = Readonly<NonNullable<JsonResponse<"listItemSharingPeople", 200>["items"][number]["recipient"]>>;
5555
+ type ItemSharingPeoplePage = Readonly<Omit<JsonResponse<"listItemSharingPeople", 200>, "items"> & {
5556
+ items: readonly (PermissionGrant & {
5557
+ readonly recipient: RegisteredRecipientDisplay | null;
5558
+ })[];
5559
+ }>;
5560
+ interface RegisterItemRecipientInput {
5561
+ readonly workspaceId: string;
5562
+ readonly itemId: string;
5563
+ readonly email: string;
5564
+ readonly role: "viewer" | "editor";
5565
+ readonly ifMatch: string;
5566
+ readonly idempotencyKey: string;
5567
+ readonly signal?: AbortSignal;
5568
+ }
5569
+ type ListItemSharingPeopleInput = ListItemPermissionsInput;
5570
+ type GeneratedIncomingPage = JsonResponse<"listIncomingShares", 200>;
5571
+ type IncomingShareContext = Readonly<GeneratedIncomingPage["items"][number]>;
5572
+ type IncomingSharePage = Readonly<{
5573
+ items: readonly IncomingShareContext[];
5574
+ nextCursor: string | null;
5575
+ }>;
5576
+ interface ListIncomingSharesInput {
5577
+ readonly limit?: number;
5578
+ readonly cursor?: string;
5579
+ readonly signal?: AbortSignal;
5580
+ }
5057
5581
  type GeneratedDiscoveryPage = JsonResponse<"listWorkspaceItems", 200>;
5058
5582
  type WorkspaceDiscoveryItem = Readonly<Omit<GeneratedDiscoveryPage["items"][number], "currentVersion"> & {
5059
5583
  readonly currentVersion: ManagedItemMetadata["currentVersion"];
@@ -5290,6 +5814,9 @@ interface GetCurrentWorkspaceInput {
5290
5814
  readonly signal?: AbortSignal;
5291
5815
  }
5292
5816
  interface DriveOperations {
5817
+ registerItemRecipient(input: RegisterItemRecipientInput): Promise<DriveOperationResult<PermissionMutation, 200 | 201>>;
5818
+ listItemSharingPeople(input: ListItemSharingPeopleInput): Promise<DriveOperationResult<ItemSharingPeoplePage, 200>>;
5819
+ listIncomingShares(input?: ListIncomingSharesInput): Promise<DriveOperationResult<IncomingSharePage, 200>>;
5293
5820
  listWorkspaceItems(input: ListWorkspaceItemsInput): Promise<DriveOperationResult<WorkspaceDiscoveryPage, 200>>;
5294
5821
  getWorkspaceUsage(input: GetWorkspaceUsageInput): Promise<DriveOperationResult<WorkspaceUsage, 200>>;
5295
5822
  getCurrentWorkspaceSources(input?: GetCurrentWorkspaceInput): Promise<DriveOperationResult<CurrentWorkspaceSources, 200>>;
@@ -5324,4 +5851,4 @@ interface DriveClient extends DriveOperations {
5324
5851
  uploadFile(input: UploadFileInput): Promise<DriveOperationResult<UploadCompletion, 200 | 202>>;
5325
5852
  }
5326
5853
  //#endregion
5327
- export { RestoreItemVersionInput as $, ListFolderChildrenInput as A, ManagedItemVersionRestoreResult as B, FolderItem as C, GetItemVersionInput as D, GetItemInput as E, ManagedDownloadRestorePending as F, PermissionGrantee as G, PendingUpload as H, ManagedItemMetadata as I, ProtectionClassification as J, PermissionMutation as K, ManagedItemVersion as L, ListItemVersionsInput as M, ListWorkspaceItemsInput as N, GetUploadStatusInput as O, ManagedDownloadDescriptor as P, RestoreItemInput as Q, ManagedItemVersionPage as R, EffectivePermissionResponse as S, GetCurrentWorkspaceInput as T, PermissionAction as U, ManagedLifecycleItem as V, PermissionGrant as W, ReadyUpload as X, ReadEffectiveItemPermissionsInput as Y, RecordUploadPartInput as Z, DriveOperations as _, WorkspaceItemSearchItem as _t, CreateItemPermissionInput as a, UploadCompletion as at, DriveServerClientConfig as b, operations as bt, CurrentWorkspace as c, UploadFilePhase as ct, DownloadItemResult as d, UploadPartDescriptor as dt, RevokeItemPermissionInput as et, DriveClient as f, UploadPartResult as ft, DriveOperationResult as g, WorkspaceDiscoveryPage as gt, DriveCredentialProvider as h, WorkspaceDiscoveryItem as ht, CreateFolderInput as i, UpdateItemPermissionInput as it, ListItemPermissionsInput as j, GetWorkspaceUsageInput as k, CurrentWorkspaceSources as l, UploadFileProgress as lt, DriveCredentialContext as m, UploadStatus as mt, CompleteUploadInput as n, TrashItemInput as nt, CreateUploadInput as o, UploadConfirmedPart as ot, DriveClientConfig as p, UploadSession as pt, PermissionPage as q, CreateDownloadInput as r, UpdateItemInput as rt, CreateUploadPartDescriptorInput as s, UploadFileInput as st, AbortUploadInput as t, SearchWorkspaceItemsInput as tt, DeleteItemInput as u, UploadFileProgressCallback as ut, DriveResponseValidators as v, WorkspaceItemSearchPage as vt, FolderPage as w, EffectivePermissionAction as x, DriveServerClient as y, WorkspaceUsage as yt, ManagedItemVersionResource as z };
5854
+ export { ProtectionClassification as $, IncomingShareContext as A, ManagedDownloadRestorePending as B, FolderItem as C, WorkspaceDiscoveryPage as Ct, GetItemVersionInput as D, operations as Dt, GetItemInput as E, WorkspaceUsage as Et, ListItemPermissionsInput as F, ManagedItemVersionRestoreResult as G, ManagedItemVersion as H, ListItemSharingPeopleInput as I, PermissionAction as J, ManagedLifecycleItem as K, ListItemVersionsInput as L, ItemSharingPeoplePage as M, ListFolderChildrenInput as N, GetUploadStatusInput as O, ListIncomingSharesInput as P, PermissionPage as Q, ListWorkspaceItemsInput as R, EffectivePermissionResponse as S, WorkspaceDiscoveryItem as St, GetCurrentWorkspaceInput as T, WorkspaceItemSearchPage as Tt, ManagedItemVersionPage as U, ManagedItemMetadata as V, ManagedItemVersionResource as W, PermissionGrantee as X, PermissionGrant as Y, PermissionMutation as Z, DriveOperations as _, UploadFileProgressCallback as _t, CreateItemPermissionInput as a, RestoreItemInput as at, DriveServerClientConfig as b, UploadSession as bt, CurrentWorkspace as c, SearchWorkspaceItemsInput as ct, DownloadItemResult as d, UpdateItemPermissionInput as dt, ReadEffectiveItemPermissionsInput as et, DriveClient as f, UploadCompletion as ft, DriveOperationResult as g, UploadFileProgress as gt, DriveCredentialProvider as h, UploadFilePhase as ht, CreateFolderInput as i, RegisteredRecipientDisplay as it, IncomingSharePage as j, GetWorkspaceUsageInput as k, CurrentWorkspaceSources as l, TrashItemInput as lt, DriveCredentialContext as m, UploadFileInput as mt, CompleteUploadInput as n, RecordUploadPartInput as nt, CreateUploadInput as o, RestoreItemVersionInput as ot, DriveClientConfig as p, UploadConfirmedPart as pt, PendingUpload as q, CreateDownloadInput as r, RegisterItemRecipientInput as rt, CreateUploadPartDescriptorInput as s, RevokeItemPermissionInput as st, AbortUploadInput as t, ReadyUpload as tt, DeleteItemInput as u, UpdateItemInput as ut, DriveResponseValidators as v, UploadPartDescriptor as vt, FolderPage as w, WorkspaceItemSearchItem as wt, EffectivePermissionAction as x, UploadStatus as xt, DriveServerClient as y, UploadPartResult as yt, ManagedDownloadDescriptor as z };
package/dist/core.d.ts CHANGED
@@ -1,11 +1,13 @@
1
1
  //#region src/core.d.ts
2
- declare const DRIVE_API_ERROR_CODES: readonly ["authentication_required", "identity_authority_unavailable", "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"];
2
+ declare const DRIVE_API_ERROR_CODES: readonly ["authentication_required", "identity_authority_unavailable", "recipient_unavailable", "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"];
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
6
  declare const DRIVE_API_ERROR_MESSAGES: Readonly<{
7
7
  readonly authentication_required: "Authentication is required.";
8
8
  readonly identity_authority_unavailable: "Authentication is temporarily unavailable.";
9
+ readonly recipient_unavailable: "The recipient is unavailable.";
10
+ readonly rate_limited: "Too many requests.";
9
11
  readonly permission_denied: "The requested action is not permitted.";
10
12
  readonly resource_not_found: "The requested resource was not found.";
11
13
  readonly invalid_request: "The request is invalid.";
package/dist/core.js CHANGED
@@ -1,57 +1 @@
1
- //#region src/core.ts
2
- const DRIVE_API_ERROR_CODES = Object.freeze([
3
- "authentication_required",
4
- "identity_authority_unavailable",
5
- "permission_denied",
6
- "resource_not_found",
7
- "invalid_request",
8
- "invalid_pagination_cursor",
9
- "invalid_idempotency_key",
10
- "precondition_failed",
11
- "range_not_satisfiable",
12
- "idempotency_conflict",
13
- "quota_exceeded",
14
- "upload_recovery_required",
15
- "service_unavailable",
16
- "internal_error"
17
- ]);
18
- const DRIVE_API_ERROR_MESSAGES = Object.freeze({
19
- authentication_required: "Authentication is required.",
20
- identity_authority_unavailable: "Authentication is temporarily unavailable.",
21
- permission_denied: "The requested action is not permitted.",
22
- resource_not_found: "The requested resource was not found.",
23
- invalid_request: "The request is invalid.",
24
- invalid_pagination_cursor: "The pagination cursor is invalid.",
25
- invalid_idempotency_key: "The idempotency key is invalid.",
26
- precondition_failed: "The request precondition failed.",
27
- range_not_satisfiable: "The requested byte range is not satisfiable.",
28
- idempotency_conflict: "The idempotency key conflicts with an earlier request.",
29
- quota_exceeded: "The workspace storage quota would be exceeded.",
30
- upload_recovery_required: "The upload requires recovery before it can continue.",
31
- service_unavailable: "The service is temporarily unavailable.",
32
- internal_error: "The request could not be completed."
33
- });
34
- const SDK_MESSAGES = Object.freeze({
35
- invalid_input: "The Drive SDK input is invalid.",
36
- credential_unavailable: "A Drive credential could not be obtained.",
37
- network_error: "The Drive request could not reach the service.",
38
- timeout: "The Drive request timed out.",
39
- aborted: "The Drive request was aborted.",
40
- invalid_response: "Drive returned an invalid response."
41
- });
42
- var DriveError = class extends Error {
43
- code;
44
- status;
45
- requestId;
46
- details;
47
- constructor(code, options = {}) {
48
- super(code in DRIVE_API_ERROR_MESSAGES ? DRIVE_API_ERROR_MESSAGES[code] : SDK_MESSAGES[code]);
49
- this.name = "DriveError";
50
- this.code = code;
51
- this.status = options.status ?? null;
52
- this.requestId = options.requestId ?? null;
53
- this.details = Object.freeze({});
54
- }
55
- };
56
- //#endregion
57
- export { DRIVE_API_ERROR_CODES, DRIVE_API_ERROR_MESSAGES, DriveError };
1
+ const e=Object.freeze([`authentication_required`,`identity_authority_unavailable`,`recipient_unavailable`,`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.`,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.`}),n=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 r=class extends Error{code;status;requestId;details;constructor(e,r={}){super(e in t?t[e]:n[e]),this.name=`DriveError`,this.code=e,this.status=r.status??null,this.requestId=r.requestId??null,this.details=Object.freeze({})}};export{e as DRIVE_API_ERROR_CODES,t as DRIVE_API_ERROR_MESSAGES,r as DriveError};
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { $ as RestoreItemVersionInput, A as ListFolderChildrenInput, B as ManagedItemVersionRestoreResult, C as FolderItem, D as GetItemVersionInput, E as GetItemInput, F as ManagedDownloadRestorePending, G as PermissionGrantee, H as PendingUpload, I as ManagedItemMetadata, J as ProtectionClassification, K as PermissionMutation, L as ManagedItemVersion, M as ListItemVersionsInput, N as ListWorkspaceItemsInput, O as GetUploadStatusInput, P as ManagedDownloadDescriptor, Q as RestoreItemInput, R as ManagedItemVersionPage, T as GetCurrentWorkspaceInput, U as PermissionAction, V as ManagedLifecycleItem, W as PermissionGrant, X as ReadyUpload, Y as ReadEffectiveItemPermissionsInput, Z as RecordUploadPartInput, _ as DriveOperations, _t as WorkspaceItemSearchItem, a as CreateItemPermissionInput, at as UploadCompletion, c as CurrentWorkspace, ct as UploadFilePhase, d as DownloadItemResult, dt as UploadPartDescriptor, et as RevokeItemPermissionInput, f as DriveClient, ft as UploadPartResult, g as DriveOperationResult, gt as WorkspaceDiscoveryPage, h as DriveCredentialProvider, ht as WorkspaceDiscoveryItem, i as CreateFolderInput, it as UpdateItemPermissionInput, j as ListItemPermissionsInput, k as GetWorkspaceUsageInput, l as CurrentWorkspaceSources, lt as UploadFileProgress, mt as UploadStatus, n as CompleteUploadInput, nt as TrashItemInput, o as CreateUploadInput, ot as UploadConfirmedPart, p as DriveClientConfig, pt as UploadSession, r as CreateDownloadInput, rt as UpdateItemInput, s as CreateUploadPartDescriptorInput, st as UploadFileInput, t as AbortUploadInput, tt as SearchWorkspaceItemsInput, u as DeleteItemInput, ut as UploadFileProgressCallback, v as DriveResponseValidators, vt as WorkspaceItemSearchPage, w as FolderPage, x as EffectivePermissionAction, yt as WorkspaceUsage, z as ManagedItemVersionResource } from "./contract.js";
1
+ import { $ as ProtectionClassification, B as ManagedDownloadRestorePending, C as FolderItem, Ct as WorkspaceDiscoveryPage, D as GetItemVersionInput, E as GetItemInput, Et as WorkspaceUsage, F as ListItemPermissionsInput, G as ManagedItemVersionRestoreResult, H as ManagedItemVersion, J as PermissionAction, K as ManagedLifecycleItem, L as ListItemVersionsInput, N as ListFolderChildrenInput, O as GetUploadStatusInput, R as ListWorkspaceItemsInput, St as WorkspaceDiscoveryItem, T as GetCurrentWorkspaceInput, Tt as WorkspaceItemSearchPage, U as ManagedItemVersionPage, V as ManagedItemMetadata, W as ManagedItemVersionResource, X as PermissionGrantee, Y as PermissionGrant, Z as PermissionMutation, _ as DriveOperations, _t as UploadFileProgressCallback, a as CreateItemPermissionInput, at as RestoreItemInput, bt as UploadSession, c as CurrentWorkspace, ct as SearchWorkspaceItemsInput, d as DownloadItemResult, dt as UpdateItemPermissionInput, et as ReadEffectiveItemPermissionsInput, f as DriveClient, ft as UploadCompletion, g as DriveOperationResult, gt as UploadFileProgress, h as DriveCredentialProvider, ht as UploadFilePhase, i as CreateFolderInput, k as GetWorkspaceUsageInput, l as CurrentWorkspaceSources, lt as TrashItemInput, mt as UploadFileInput, n as CompleteUploadInput, nt as RecordUploadPartInput, o as CreateUploadInput, ot as RestoreItemVersionInput, p as DriveClientConfig, pt as UploadConfirmedPart, q as PendingUpload, r as CreateDownloadInput, s as CreateUploadPartDescriptorInput, st as RevokeItemPermissionInput, t as AbortUploadInput, tt as ReadyUpload, u as DeleteItemInput, ut as UpdateItemInput, v as DriveResponseValidators, vt as UploadPartDescriptor, w as FolderPage, wt as WorkspaceItemSearchItem, x as EffectivePermissionAction, xt as UploadStatus, yt as UploadPartResult, z as ManagedDownloadDescriptor } from "./contract.js";
2
2
  import { createDriveClient } from "./client.js";
3
3
  import { DRIVE_API_ERROR_CODES, DRIVE_API_ERROR_MESSAGES, DriveApiErrorCode, DriveError, DriveErrorCode, DriveSdkErrorCode } from "./core.js";
4
4
  export { type AbortUploadInput, type CompleteUploadInput, type CreateDownloadInput, type CreateFolderInput, type CreateItemPermissionInput, type CreateUploadInput, type CreateUploadPartDescriptorInput, type CurrentWorkspace, type CurrentWorkspaceSources, DRIVE_API_ERROR_CODES, DRIVE_API_ERROR_MESSAGES, type DeleteItemInput, type DownloadItemResult, type DriveApiErrorCode, type DriveClient, type DriveClientConfig, type DriveCredentialProvider, DriveError, type DriveErrorCode, type DriveOperationResult, type DriveOperations, type DriveResponseValidators, type DriveSdkErrorCode, type EffectivePermissionAction, type FolderItem, type FolderPage, type GetCurrentWorkspaceInput, type GetItemInput, type GetItemVersionInput, type GetUploadStatusInput, 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 SearchWorkspaceItemsInput, type TrashItemInput, type UpdateItemInput, type UpdateItemPermissionInput, type UploadCompletion, type UploadConfirmedPart, type UploadFileInput, type UploadFilePhase, type UploadFileProgress, type UploadFileProgressCallback, type UploadPartDescriptor, type UploadPartResult, type UploadSession, type UploadStatus, type WorkspaceDiscoveryItem, type WorkspaceDiscoveryPage, type WorkspaceItemSearchItem, type WorkspaceItemSearchPage, type WorkspaceUsage, createDriveClient };