@finueva/drive 0.18.0 → 0.20.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.
@@ -1952,6 +1952,171 @@ interface operations {
1952
1952
  };
1953
1953
  };
1954
1954
  };
1955
+ archiveItem: {
1956
+ parameters: {
1957
+ query?: never;
1958
+ header: {
1959
+ "Idempotency-Key": string;
1960
+ "If-Match": string;
1961
+ };
1962
+ path: {
1963
+ workspaceId: string;
1964
+ itemId: string;
1965
+ };
1966
+ cookie?: never;
1967
+ };
1968
+ requestBody?: never;
1969
+ responses: {
1970
+ /** @description The item was archived or the exact result was replayed. */
1971
+ 200: {
1972
+ headers: {
1973
+ /** @description Strong precondition for the next item mutation. */
1974
+ ETag?: string;
1975
+ [name: string]: unknown;
1976
+ };
1977
+ content: {
1978
+ "application/json": {
1979
+ itemId: string;
1980
+ /** @enum {string} */
1981
+ kind: "file" | "folder";
1982
+ name: string;
1983
+ parentItemId: string;
1984
+ purgeAfterEpochMilliseconds: number;
1985
+ /** @enum {boolean} */
1986
+ retentionHold: true;
1987
+ revision: number;
1988
+ /** @enum {string} */
1989
+ state: "trashed";
1990
+ trashedAtEpochMilliseconds: number;
1991
+ volumeId: string;
1992
+ workspaceId: string;
1993
+ };
1994
+ };
1995
+ };
1996
+ /** @description A valid Drive user bearer credential is required. */
1997
+ 401: {
1998
+ headers: {
1999
+ [name: string]: unknown;
2000
+ };
2001
+ content: {
2002
+ "application/json": {
2003
+ error: {
2004
+ /** @enum {string} */
2005
+ code: "authentication_required";
2006
+ details: Record<string, never>;
2007
+ message: string;
2008
+ requestId: string;
2009
+ };
2010
+ };
2011
+ };
2012
+ };
2013
+ /** @description The caller is not an owner or administrator of this organization workspace, or managed storage is disabled. */
2014
+ 403: {
2015
+ headers: {
2016
+ [name: string]: unknown;
2017
+ };
2018
+ content: {
2019
+ "application/json": {
2020
+ error: {
2021
+ /** @enum {string} */
2022
+ code: "permission_denied";
2023
+ details: Record<string, never>;
2024
+ message: string;
2025
+ requestId: string;
2026
+ };
2027
+ };
2028
+ };
2029
+ };
2030
+ /** @description The workspace or item is absent or undiscoverable. */
2031
+ 404: {
2032
+ headers: {
2033
+ [name: string]: unknown;
2034
+ };
2035
+ content: {
2036
+ "application/json": {
2037
+ error: {
2038
+ /** @enum {string} */
2039
+ code: "resource_not_found";
2040
+ details: Record<string, never>;
2041
+ message: string;
2042
+ requestId: string;
2043
+ };
2044
+ };
2045
+ };
2046
+ };
2047
+ /** @description The key conflicts, the precondition is stale, or the transfer was refused with a reason. */
2048
+ 409: {
2049
+ headers: {
2050
+ [name: string]: unknown;
2051
+ };
2052
+ content: {
2053
+ "application/json": {
2054
+ error: {
2055
+ /** @enum {string} */
2056
+ code: "idempotency_conflict" | "precondition_failed";
2057
+ details: {
2058
+ /** @enum {string} */
2059
+ reason?: "ownership_unchanged" | "ownership_successor_not_member" | "ownership_restricted_items" | "ownership_subtree_too_large";
2060
+ };
2061
+ message: string;
2062
+ requestId: string;
2063
+ };
2064
+ };
2065
+ };
2066
+ };
2067
+ /** @description The path, query, headers, key or strict body is invalid. */
2068
+ 422: {
2069
+ headers: {
2070
+ [name: string]: unknown;
2071
+ };
2072
+ content: {
2073
+ "application/json": {
2074
+ error: {
2075
+ /** @enum {string} */
2076
+ code: "invalid_request" | "invalid_idempotency_key";
2077
+ details: Record<string, never>;
2078
+ message: string;
2079
+ requestId: string;
2080
+ };
2081
+ };
2082
+ };
2083
+ };
2084
+ /** @description Auth membership resolution is temporarily limited; retry after the indicated delay. */
2085
+ 429: {
2086
+ headers: {
2087
+ [name: string]: unknown;
2088
+ };
2089
+ content: {
2090
+ "application/json": {
2091
+ error: {
2092
+ /** @enum {string} */
2093
+ code: "rate_limited";
2094
+ details: Record<string, never>;
2095
+ message: string;
2096
+ requestId: string;
2097
+ };
2098
+ };
2099
+ };
2100
+ };
2101
+ /** @description Identity, Auth membership, D1, authorization or capacity authority is unavailable. */
2102
+ 503: {
2103
+ headers: {
2104
+ [name: string]: unknown;
2105
+ };
2106
+ content: {
2107
+ "application/json": {
2108
+ error: {
2109
+ /** @enum {string} */
2110
+ code: "identity_authority_unavailable" | "service_unavailable";
2111
+ details: Record<string, never>;
2112
+ message: string;
2113
+ requestId: string;
2114
+ };
2115
+ };
2116
+ };
2117
+ };
2118
+ };
2119
+ };
1955
2120
  listFolderChildren: {
1956
2121
  parameters: {
1957
2122
  query?: {
@@ -2651,6 +2816,175 @@ interface operations {
2651
2816
  };
2652
2817
  };
2653
2818
  };
2819
+ transferItemOwnership: {
2820
+ parameters: {
2821
+ query?: never;
2822
+ header: {
2823
+ "Idempotency-Key": string;
2824
+ "If-Match": string;
2825
+ };
2826
+ path: {
2827
+ workspaceId: string;
2828
+ itemId: string;
2829
+ };
2830
+ cookie?: never;
2831
+ };
2832
+ requestBody: {
2833
+ content: {
2834
+ "application/json": {
2835
+ includeDescendants: boolean;
2836
+ ownerUserId: string;
2837
+ revokeVisitorGrants: boolean;
2838
+ };
2839
+ };
2840
+ };
2841
+ responses: {
2842
+ /** @description Ownership was transferred or the exact result was replayed. */
2843
+ 200: {
2844
+ headers: {
2845
+ /** @description Strong precondition for the next item mutation. */
2846
+ ETag?: string;
2847
+ [name: string]: unknown;
2848
+ };
2849
+ content: {
2850
+ "application/json": {
2851
+ itemId: string;
2852
+ /** @enum {string} */
2853
+ kind: "file" | "folder";
2854
+ ownerUserId: string;
2855
+ previousOwnerUserId: string | null;
2856
+ revision: number;
2857
+ revokedVisitorGrantCount: number;
2858
+ transferredItemCount: number;
2859
+ volumeId: string;
2860
+ workspaceId: string;
2861
+ };
2862
+ };
2863
+ };
2864
+ /** @description A valid Drive user bearer credential is required. */
2865
+ 401: {
2866
+ headers: {
2867
+ [name: string]: unknown;
2868
+ };
2869
+ content: {
2870
+ "application/json": {
2871
+ error: {
2872
+ /** @enum {string} */
2873
+ code: "authentication_required";
2874
+ details: Record<string, never>;
2875
+ message: string;
2876
+ requestId: string;
2877
+ };
2878
+ };
2879
+ };
2880
+ };
2881
+ /** @description The caller is not an owner or administrator of this organization workspace, or managed storage is disabled. */
2882
+ 403: {
2883
+ headers: {
2884
+ [name: string]: unknown;
2885
+ };
2886
+ content: {
2887
+ "application/json": {
2888
+ error: {
2889
+ /** @enum {string} */
2890
+ code: "permission_denied";
2891
+ details: Record<string, never>;
2892
+ message: string;
2893
+ requestId: string;
2894
+ };
2895
+ };
2896
+ };
2897
+ };
2898
+ /** @description The workspace or item is absent or undiscoverable. */
2899
+ 404: {
2900
+ headers: {
2901
+ [name: string]: unknown;
2902
+ };
2903
+ content: {
2904
+ "application/json": {
2905
+ error: {
2906
+ /** @enum {string} */
2907
+ code: "resource_not_found";
2908
+ details: Record<string, never>;
2909
+ message: string;
2910
+ requestId: string;
2911
+ };
2912
+ };
2913
+ };
2914
+ };
2915
+ /** @description The key conflicts, the precondition is stale, or the transfer was refused with a reason. */
2916
+ 409: {
2917
+ headers: {
2918
+ [name: string]: unknown;
2919
+ };
2920
+ content: {
2921
+ "application/json": {
2922
+ error: {
2923
+ /** @enum {string} */
2924
+ code: "idempotency_conflict" | "precondition_failed";
2925
+ details: {
2926
+ /** @enum {string} */
2927
+ reason?: "ownership_unchanged" | "ownership_successor_not_member" | "ownership_restricted_items" | "ownership_subtree_too_large";
2928
+ };
2929
+ message: string;
2930
+ requestId: string;
2931
+ };
2932
+ };
2933
+ };
2934
+ };
2935
+ /** @description The path, query, headers, key or strict body is invalid. */
2936
+ 422: {
2937
+ headers: {
2938
+ [name: string]: unknown;
2939
+ };
2940
+ content: {
2941
+ "application/json": {
2942
+ error: {
2943
+ /** @enum {string} */
2944
+ code: "invalid_request" | "invalid_idempotency_key";
2945
+ details: Record<string, never>;
2946
+ message: string;
2947
+ requestId: string;
2948
+ };
2949
+ };
2950
+ };
2951
+ };
2952
+ /** @description Auth membership resolution is temporarily limited; retry after the indicated delay. */
2953
+ 429: {
2954
+ headers: {
2955
+ [name: string]: unknown;
2956
+ };
2957
+ content: {
2958
+ "application/json": {
2959
+ error: {
2960
+ /** @enum {string} */
2961
+ code: "rate_limited";
2962
+ details: Record<string, never>;
2963
+ message: string;
2964
+ requestId: string;
2965
+ };
2966
+ };
2967
+ };
2968
+ };
2969
+ /** @description Identity, Auth membership, D1, authorization or capacity authority is unavailable. */
2970
+ 503: {
2971
+ headers: {
2972
+ [name: string]: unknown;
2973
+ };
2974
+ content: {
2975
+ "application/json": {
2976
+ error: {
2977
+ /** @enum {string} */
2978
+ code: "identity_authority_unavailable" | "service_unavailable";
2979
+ details: Record<string, never>;
2980
+ message: string;
2981
+ requestId: string;
2982
+ };
2983
+ };
2984
+ };
2985
+ };
2986
+ };
2987
+ };
2654
2988
  listItemPermissions: {
2655
2989
  parameters: {
2656
2990
  query?: {
@@ -5436,6 +5770,174 @@ interface operations {
5436
5770
  };
5437
5771
  };
5438
5772
  };
5773
+ listOwnedItems: {
5774
+ parameters: {
5775
+ query?: {
5776
+ lifecycle?: "active" | "trashed";
5777
+ rootsOnly?: "true" | "false";
5778
+ limit?: number;
5779
+ cursor?: string;
5780
+ };
5781
+ header?: never;
5782
+ path: {
5783
+ workspaceId: string;
5784
+ ownerUserId: string;
5785
+ };
5786
+ cookie?: never;
5787
+ };
5788
+ requestBody?: never;
5789
+ responses: {
5790
+ /** @description Owned items in item-ID order with an authenticated 15-minute continuation; no total count. */
5791
+ 200: {
5792
+ headers: {
5793
+ [name: string]: unknown;
5794
+ };
5795
+ content: {
5796
+ "application/json": {
5797
+ items: {
5798
+ activeVisitorGrantCount: number;
5799
+ archived: boolean;
5800
+ createdAtEpochMilliseconds: number | null;
5801
+ creatorUserId: string | null;
5802
+ currentVersion: {
5803
+ byteLength: number;
5804
+ mediaType: string;
5805
+ /** @enum {string} */
5806
+ protectionClassification: "ordinary" | "opaque-encrypted";
5807
+ /** @enum {string} */
5808
+ state: "current";
5809
+ versionId: string;
5810
+ } | null;
5811
+ etag: string;
5812
+ itemId: string;
5813
+ /** @enum {string} */
5814
+ lifecycleState: "active" | "trashed";
5815
+ modifiedAtEpochMilliseconds: number | null;
5816
+ name: string;
5817
+ ownerUserId: string;
5818
+ /** @enum {string} */
5819
+ ownership: "assigned" | "creator";
5820
+ parentId: string | null;
5821
+ /** @enum {string} */
5822
+ provider: "managed";
5823
+ purgeAfterEpochMilliseconds: number | null;
5824
+ revision: number;
5825
+ trashedAtEpochMilliseconds: number | null;
5826
+ /** @enum {string} */
5827
+ type: "file" | "folder";
5828
+ /** @enum {string} */
5829
+ visibility: "workspace" | "restricted";
5830
+ volumeId: string;
5831
+ workspaceId: string;
5832
+ }[];
5833
+ nextCursor: string | null;
5834
+ };
5835
+ };
5836
+ };
5837
+ /** @description A valid Drive user bearer credential is required. */
5838
+ 401: {
5839
+ headers: {
5840
+ [name: string]: unknown;
5841
+ };
5842
+ content: {
5843
+ "application/json": {
5844
+ error: {
5845
+ /** @enum {string} */
5846
+ code: "authentication_required";
5847
+ details: Record<string, never>;
5848
+ message: string;
5849
+ requestId: string;
5850
+ };
5851
+ };
5852
+ };
5853
+ };
5854
+ /** @description The caller is not an owner or administrator of this organization workspace, or managed storage is disabled. */
5855
+ 403: {
5856
+ headers: {
5857
+ [name: string]: unknown;
5858
+ };
5859
+ content: {
5860
+ "application/json": {
5861
+ error: {
5862
+ /** @enum {string} */
5863
+ code: "permission_denied";
5864
+ details: Record<string, never>;
5865
+ message: string;
5866
+ requestId: string;
5867
+ };
5868
+ };
5869
+ };
5870
+ };
5871
+ /** @description The workspace or item is absent or undiscoverable. */
5872
+ 404: {
5873
+ headers: {
5874
+ [name: string]: unknown;
5875
+ };
5876
+ content: {
5877
+ "application/json": {
5878
+ error: {
5879
+ /** @enum {string} */
5880
+ code: "resource_not_found";
5881
+ details: Record<string, never>;
5882
+ message: string;
5883
+ requestId: string;
5884
+ };
5885
+ };
5886
+ };
5887
+ };
5888
+ /** @description The selected authority or page changed; restart the query. */
5889
+ 409: {
5890
+ headers: {
5891
+ [name: string]: unknown;
5892
+ };
5893
+ content: {
5894
+ "application/json": {
5895
+ error: {
5896
+ /** @enum {string} */
5897
+ code: "precondition_failed";
5898
+ details: Record<string, never>;
5899
+ message: string;
5900
+ requestId: string;
5901
+ };
5902
+ };
5903
+ };
5904
+ };
5905
+ /** @description The path, query, cursor or unexpected body is invalid. */
5906
+ 422: {
5907
+ headers: {
5908
+ [name: string]: unknown;
5909
+ };
5910
+ content: {
5911
+ "application/json": {
5912
+ error: {
5913
+ /** @enum {string} */
5914
+ code: "invalid_request" | "invalid_pagination_cursor";
5915
+ details: Record<string, never>;
5916
+ message: string;
5917
+ requestId: string;
5918
+ };
5919
+ };
5920
+ };
5921
+ };
5922
+ /** @description Identity, Auth membership, D1, authorization or capacity authority is unavailable. */
5923
+ 503: {
5924
+ headers: {
5925
+ [name: string]: unknown;
5926
+ };
5927
+ content: {
5928
+ "application/json": {
5929
+ error: {
5930
+ /** @enum {string} */
5931
+ code: "identity_authority_unavailable" | "service_unavailable";
5932
+ details: Record<string, never>;
5933
+ message: string;
5934
+ requestId: string;
5935
+ };
5936
+ };
5937
+ };
5938
+ };
5939
+ };
5940
+ };
5439
5941
  searchWorkspaceItems: {
5440
5942
  parameters: {
5441
5943
  query: {
@@ -5865,7 +6367,7 @@ interface operations {
5865
6367
  code: "service_unavailable";
5866
6368
  details: {
5867
6369
  /** @enum {string} */
5868
- reason?: "upload_admission_saturated" | "upload_admission_stalled" | "unspecified";
6370
+ reason?: "upload_admission_saturated" | "upload_admission_stalled" | "ownership_unchanged" | "ownership_successor_not_member" | "ownership_restricted_items" | "ownership_subtree_too_large" | "unspecified";
5869
6371
  };
5870
6372
  /** @enum {string} */
5871
6373
  message: "The service is temporarily unavailable.";
@@ -6191,7 +6693,9 @@ interface operations {
6191
6693
  };
6192
6694
  completeUpload: {
6193
6695
  parameters: {
6194
- query?: never;
6696
+ query?: {
6697
+ verification?: string;
6698
+ };
6195
6699
  header: {
6196
6700
  "Idempotency-Key": string;
6197
6701
  };
@@ -7093,6 +7597,52 @@ interface ListWorkspaceItemsInput extends GetWorkspaceUsageInput {
7093
7597
  readonly limit?: number;
7094
7598
  readonly cursor?: string;
7095
7599
  }
7600
+ type GeneratedOwnedItemPage = JsonResponse<"listOwnedItems", 200>;
7601
+ /** One item a member effectively owns: an assigned owner, otherwise its recorded creator. */
7602
+ type OwnedItem = Readonly<Omit<GeneratedOwnedItemPage["items"][number], "currentVersion"> & {
7603
+ readonly currentVersion: ManagedItemMetadata["currentVersion"];
7604
+ }>;
7605
+ type OwnedItemPage = Readonly<{
7606
+ items: readonly OwnedItem[];
7607
+ nextCursor: string | null;
7608
+ }>;
7609
+ interface ListOwnedItemsInput {
7610
+ readonly workspaceId: string;
7611
+ /** The Auth User ID whose effectively owned items to list. */
7612
+ readonly ownerUserId: string;
7613
+ /** `active` (default) lists live items; `trashed` lists trash roots, including archived items. */
7614
+ readonly lifecycle?: "active" | "trashed";
7615
+ /** Only items whose parent the same user does not own, so each owned subtree appears once. */
7616
+ readonly rootsOnly?: boolean;
7617
+ readonly limit?: number;
7618
+ readonly cursor?: string;
7619
+ readonly signal?: AbortSignal;
7620
+ }
7621
+ interface CollectOwnedItemsInput extends Omit<ListOwnedItemsInput, "cursor" | "limit"> {
7622
+ /** Upper bound on collected items, from 1 to 500; defaults to 500. */
7623
+ readonly maxItems?: number;
7624
+ }
7625
+ type CollectedOwnedItems = Readonly<{
7626
+ items: readonly OwnedItem[];
7627
+ /** False when `maxItems` was reached before the listing ended; continue with `nextCursor`. */
7628
+ complete: boolean;
7629
+ nextCursor: string | null;
7630
+ }>;
7631
+ type ItemOwnershipTransfer = Readonly<JsonResponse<"transferItemOwnership", 200>>;
7632
+ interface TransferItemOwnershipInput {
7633
+ readonly workspaceId: string;
7634
+ readonly itemId: string;
7635
+ /** The Auth User ID of a current member of the workspace organization. */
7636
+ readonly ownerUserId: string;
7637
+ /** Also transfer active descendants that answer to the same previous owner (at most 500 walked items). */
7638
+ readonly includeDescendants: boolean;
7639
+ /** Revoke active visitor links the previous owner created on the transferred items. */
7640
+ readonly revokeVisitorGrants: boolean;
7641
+ readonly idempotencyKey: operations["transferItemOwnership"]["parameters"]["header"]["Idempotency-Key"];
7642
+ readonly ifMatch: operations["transferItemOwnership"]["parameters"]["header"]["If-Match"];
7643
+ readonly signal?: AbortSignal;
7644
+ }
7645
+ type ArchivedItem = Readonly<JsonResponse<"archiveItem", 200>>;
7096
7646
  type GeneratedCurrentWorkspaceSources = JsonResponse<"getCurrentWorkspaceSources", 200>;
7097
7647
  type CurrentWorkspaceSources = Readonly<Omit<GeneratedCurrentWorkspaceSources, "workspace" | "volumes" | "knownProviders"> & {
7098
7648
  readonly workspace: CurrentWorkspace;
@@ -7240,8 +7790,14 @@ type RecordUploadPartInput = Readonly<Omit<RecordUploadPartPath, "partNumber">>
7240
7790
  readonly partNumber: number;
7241
7791
  readonly signal?: AbortSignal;
7242
7792
  };
7793
+ /**
7794
+ * `deferred` (the default) answers `202` with a `verifying` upload as soon as Drive has the object and can
7795
+ * hash it on its queue; `inline` waits for that hash and publishes inside the same request.
7796
+ */
7797
+ type UploadVerificationMode = "deferred" | "inline";
7243
7798
  type CompleteUploadInput = Readonly<UploadPath> & {
7244
7799
  readonly idempotencyKey: CompleteUploadHeaders["Idempotency-Key"];
7800
+ readonly verification?: UploadVerificationMode;
7245
7801
  readonly signal?: AbortSignal;
7246
7802
  };
7247
7803
  type AbortUploadInput = Readonly<AbortUploadPath> & {
@@ -7252,7 +7808,7 @@ type UpdateItemInput = Readonly<UpdateItemPath> & Readonly<UpdateItemBody> & {
7252
7808
  readonly ifMatch: UpdateItemHeaders["If-Match"];
7253
7809
  readonly signal?: AbortSignal;
7254
7810
  };
7255
- type LifecycleMutationInput<Name extends "trashItem" | "restoreItem" | "deleteItem"> = Readonly<operations[Name]["parameters"]["path"]> & {
7811
+ type LifecycleMutationInput<Name extends "trashItem" | "restoreItem" | "deleteItem" | "archiveItem"> = Readonly<operations[Name]["parameters"]["path"]> & {
7256
7812
  readonly idempotencyKey: operations[Name]["parameters"]["header"]["Idempotency-Key"];
7257
7813
  readonly ifMatch: operations[Name]["parameters"]["header"]["If-Match"];
7258
7814
  readonly signal?: AbortSignal;
@@ -7260,6 +7816,7 @@ type LifecycleMutationInput<Name extends "trashItem" | "restoreItem" | "deleteIt
7260
7816
  type TrashItemInput = LifecycleMutationInput<"trashItem">;
7261
7817
  type RestoreItemInput = LifecycleMutationInput<"restoreItem">;
7262
7818
  type DeleteItemInput = LifecycleMutationInput<"deleteItem">;
7819
+ type ArchiveItemInput = LifecycleMutationInput<"archiveItem">;
7263
7820
  type ListItemVersionsInput = Readonly<ListItemVersionsPath> & Readonly<ListItemVersionsQuery> & {
7264
7821
  readonly signal?: AbortSignal;
7265
7822
  };
@@ -7299,6 +7856,8 @@ interface UploadFileInput {
7299
7856
  readonly protectionClassification?: ProtectionClassification;
7300
7857
  readonly idempotencyKey: string;
7301
7858
  readonly completionIdempotencyKey: string;
7859
+ /** Defaults to `deferred`: `uploadFile` then resolves with a `verifying` completion the caller settles later. */
7860
+ readonly verification?: UploadVerificationMode;
7302
7861
  readonly signal?: AbortSignal;
7303
7862
  readonly onProgress?: UploadFileProgressCallback;
7304
7863
  }
@@ -7332,6 +7891,9 @@ interface DriveOperations {
7332
7891
  listIncomingShares(input?: ListIncomingSharesInput): Promise<DriveOperationResult<IncomingSharePage, 200>>;
7333
7892
  listWorkspaceItems(input: ListWorkspaceItemsInput): Promise<DriveOperationResult<WorkspaceDiscoveryPage, 200>>;
7334
7893
  getWorkspaceUsage(input: GetWorkspaceUsageInput): Promise<DriveOperationResult<WorkspaceUsage, 200>>;
7894
+ listOwnedItems(input: ListOwnedItemsInput): Promise<DriveOperationResult<OwnedItemPage, 200>>;
7895
+ transferItemOwnership(input: TransferItemOwnershipInput): Promise<DriveOperationResult<ItemOwnershipTransfer, 200>>;
7896
+ archiveItem(input: ArchiveItemInput): Promise<DriveOperationResult<ArchivedItem, 200>>;
7335
7897
  getCurrentWorkspaceSources(input?: GetCurrentWorkspaceInput): Promise<DriveOperationResult<CurrentWorkspaceSources, 200>>;
7336
7898
  getCurrentWorkspace(input?: GetCurrentWorkspaceInput): Promise<DriveOperationResult<CurrentWorkspace, 200>>;
7337
7899
  ensureOrganizationWorkspaceAccess(input?: GetCurrentWorkspaceInput): Promise<DriveOperationResult<CurrentWorkspace, 200>>;
@@ -7412,4 +7974,4 @@ interface DriveClient extends DriveOperations {
7412
7974
  uploadFile(input: UploadFileInput): Promise<DriveOperationResult<UploadCompletion, 200 | 202>>;
7413
7975
  }
7414
7976
  //#endregion
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 };
7977
+ export { ItemOwnershipTransfer as $, VisitorDownloadInput as $t, DriveOperations as A, RestoreItemInput as At, EffectivePermissionAction as B, UploadConfirmedPart as Bt, DriveClientConfig as C, PermissionPage as Ct, DriveEditingClientConfig as D, RecordUploadPartInput as Dt, DriveEditingClient as E, ReadyUpload as Et, DriveVisitorClientConfig as F, TransferItemOwnershipInput as Ft, GetCurrentWorkspaceInput as G, UploadFileVersionInput as Gt, FileAccessContext as H, UploadFilePhase as Ht, EditingFileMetadata as I, TrashItemInput as It, GetUploadStatusInput as J, UploadSession as Jt, GetItemInput as K, UploadPartDescriptor as Kt, EditingFileVersionInput as L, UpdateItemInput as Lt, DriveServerClient as M, RevokeItemPermissionInput as Mt, DriveServerClientConfig as N, RevokeVisitorGrantInput as Nt, DriveEditingServerClient as O, RegisterItemRecipientInput as Ot, DriveVisitorClient as P, SearchWorkspaceItemsInput as Pt, IncomingSharePage as Q, VisitorChildrenInput as Qt, EditingSession as R, UpdateItemPermissionInput as Rt, DriveClient as S, PermissionMutation as St, DriveCredentialProvider as T, ReadEffectiveItemPermissionsInput as Tt, FolderItem as U, UploadFileProgress as Ut, EffectivePermissionResponse as V, UploadFileInput as Vt, FolderPage as W, UploadFileProgressCallback as Wt, GetWorkspaceUsageInput as X, UploadVerificationMode as Xt, GetVisitorGrantInput as Y, UploadStatus as Yt, IncomingShareContext as Z, VisitorChildren as Zt, CreateVisitorGrantInput as _, OwnedItemPage as _t, CollectOwnedItemsInput as a, VisitorReadInput as an, ListItemVersionsInput as at, DeleteItemInput as b, PermissionGrant as bt, CompleteUploadInput as c, WorkspaceDiscoveryPage as cn, ManagedDownloadDescriptor as ct, CreateFileVersionUploadInput as d, WorkspaceUsage as dn, ManagedItemVersion as dt, VisitorEditingSession as en, ItemSharingPeoplePage as et, CreateFolderInput as f, operations as fn, ManagedItemVersionPage as ft, CreateVisitorEditingSessionInput as g, OwnedItem as gt, CreateUploadPartDescriptorInput as h, ManagedLifecycleItem as ht, ChangeEditingSessionInput as i, VisitorItem as in, ListItemSharingPeopleInput as it, DriveResponseValidators as j, RestoreItemVersionInput as jt, DriveOperationResult as k, RegisteredRecipientDisplay as kt, CreateDownloadInput as l, WorkspaceItemSearchItem as ln, ManagedDownloadRestorePending as lt, CreateUploadInput as m, ManagedItemVersionRestoreResult as mt, ArchiveItemInput as n, VisitorGrantCreation as nn, ListIncomingSharesInput as nt, CollectedOwnedItems as o, VisitorSession as on, ListOwnedItemsInput as ot, CreateItemPermissionInput as p, ManagedItemVersionResource as pt, GetItemVersionInput as q, UploadPartResult as qt, ArchivedItem as r, VisitorGrantPage as rn, ListItemPermissionsInput as rt, CommitFileVersionInput as s, WorkspaceDiscoveryItem as sn, ListWorkspaceItemsInput as st, AbortUploadInput as t, VisitorGrant as tn, ListFolderChildrenInput as tt, CreateEditingSessionInput as u, WorkspaceItemSearchPage as un, ManagedItemMetadata as ut, CurrentWorkspace as v, PendingUpload as vt, DriveCredentialContext as w, ProtectionClassification as wt, DownloadItemResult as x, PermissionGrantee as xt, CurrentWorkspaceSources as y, PermissionAction as yt, EditingSessionCreation as z, UploadCompletion as zt };
@@ -1,6 +1,13 @@
1
- import { A as DriveVisitorClient, j as DriveVisitorClientConfig } from "./contract.js";
1
+ import { A as DriveOperations, F as DriveVisitorClientConfig, P as DriveVisitorClient, a as CollectOwnedItemsInput, o as CollectedOwnedItems } 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;
5
5
  //#endregion
6
- export { createVisitorSessionToken as n, createDriveVisitorClient as t };
6
+ //#region src/internal/client/ownership.d.ts
7
+ /**
8
+ * Follows `listOwnedItems` continuations until the listing ends or `maxItems` (at most 500) is reached.
9
+ * Each page is one ordinary authorized request; a stale page fails the whole collection so the caller restarts.
10
+ */
11
+ declare function collectOwnedItems(operations: Pick<DriveOperations, "listOwnedItems">, input: CollectOwnedItemsInput): Promise<CollectedOwnedItems>;
12
+ //#endregion
13
+ export { createDriveVisitorClient as n, createVisitorSessionToken as r, collectOwnedItems as t };
package/dist/core.d.ts CHANGED
@@ -9,7 +9,7 @@ type DriveErrorCode = DriveApiErrorCode | DriveSdkErrorCode;
9
9
  * A reason narrows an operational refusal the caller can act on. It never carries record identifiers,
10
10
  * counts, or state outside the caller's own workspace, and an unknown value is never surfaced.
11
11
  */
12
- declare const DRIVE_API_ERROR_REASONS: readonly ["upload_admission_saturated", "upload_admission_stalled", "unspecified"];
12
+ declare const DRIVE_API_ERROR_REASONS: readonly ["upload_admission_saturated", "upload_admission_stalled", "ownership_unchanged", "ownership_successor_not_member", "ownership_restricted_items", "ownership_subtree_too_large", "unspecified"];
13
13
  type DriveErrorReason = (typeof DRIVE_API_ERROR_REASONS)[number];
14
14
  type DriveErrorDetails = Readonly<{
15
15
  reason?: DriveErrorReason;