microsoft-graph 1.0.4 → 1.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (145) hide show
  1. package/dist/errors/BadTemplateError.d.ts +4 -0
  2. package/dist/errors/EnvironmentVariableMissingError.d.ts +4 -0
  3. package/dist/errors/InvalidArgumentError.d.ts +7 -0
  4. package/dist/errors/ProtocolError.d.ts +5 -0
  5. package/dist/errors/RequestFailedError.d.ts +6 -0
  6. package/dist/graphApi.d.ts +15 -0
  7. package/dist/index.d.ts +2 -0
  8. package/dist/models/AccessToken.d.ts +4 -0
  9. package/dist/models/DriveId.d.ts +4 -0
  10. package/dist/models/DriveItemId.d.ts +4 -0
  11. package/dist/models/DriveItemPath.d.ts +4 -0
  12. package/dist/models/DriveItemRef.d.ts +6 -0
  13. package/dist/models/DriveRef.d.ts +6 -0
  14. package/dist/models/GraphOperation.d.ts +25 -0
  15. package/dist/models/GraphOperationDefinition.d.ts +20 -0
  16. package/dist/models/HostName.d.ts +4 -0
  17. package/dist/models/Scope.d.ts +4 -0
  18. package/dist/models/SiteId.d.ts +4 -0
  19. package/dist/models/SiteName.d.ts +4 -0
  20. package/dist/models/SiteRef.d.ts +5 -0
  21. package/dist/models/WorkbookNamedRangeRef.d.ts +6 -0
  22. package/dist/models/WorkbookRangeAddress.d.ts +10 -0
  23. package/dist/models/WorkbookRangeName.d.ts +4 -0
  24. package/dist/models/WorkbookRangeRef.d.ts +6 -0
  25. package/dist/models/WorkbookRef.d.ts +6 -0
  26. package/dist/models/WorkbookSessionId.d.ts +4 -0
  27. package/dist/models/WorkbookTableId.d.ts +4 -0
  28. package/dist/models/WorkbookTableRef.d.ts +6 -0
  29. package/dist/models/WorkbookWorksheetId.d.ts +4 -0
  30. package/dist/models/WorkbookWorksheetName.d.ts +4 -0
  31. package/dist/models/WorkbookWorksheetRef.d.ts +6 -0
  32. package/dist/operations/drive/createFolder.d.ts +7 -0
  33. package/dist/operations/drive/createFolder.test.d.ts +2 -0
  34. package/dist/operations/drive/listDrives.d.ts +7 -0
  35. package/dist/operations/drive/listDrives.test.d.ts +2 -0
  36. package/dist/operations/driveItem/copyDriveItem.d.ts +5 -0
  37. package/dist/operations/driveItem/copyDriveItem.test.d.ts +2 -0
  38. package/dist/operations/driveItem/deleteDriveItem.d.ts +5 -0
  39. package/dist/operations/driveItem/deleteDriveItem.test.d.ts +2 -0
  40. package/dist/operations/driveItem/getDriveItem.d.ts +6 -0
  41. package/dist/operations/driveItem/getDriveItem.test.d.ts +2 -0
  42. package/dist/operations/driveItem/getDriveItemByPath.d.ts +8 -0
  43. package/dist/operations/driveItem/getDriveItemByPath.test.d.ts +2 -0
  44. package/dist/operations/driveItem/getDriveItemContent.d.ts +4 -0
  45. package/dist/operations/driveItem/getDriveItemContent.test.d.ts +2 -0
  46. package/dist/operations/driveItem/initiateCopyDriveItem.d.ts +5 -0
  47. package/dist/operations/driveItem/initiateCopyDriveItem.d.ts.map +1 -0
  48. package/dist/operations/driveItem/initiateCopyDriveItem.js +21 -0
  49. package/dist/operations/driveItem/initiateCopyDriveItem.test.d.ts +2 -0
  50. package/dist/operations/driveItem/initiateCopyDriveItem.test.d.ts.map +1 -0
  51. package/dist/operations/driveItem/initiateCopyDriveItem.test.js +28 -0
  52. package/dist/operations/driveItem/listDriveItems.d.ts +12 -0
  53. package/dist/operations/driveItem/listDriveItems.test.d.ts +2 -0
  54. package/dist/operations/site/getSite.d.ts +6 -0
  55. package/dist/operations/site/getSite.test.d.ts +2 -0
  56. package/dist/operations/site/getSiteByName.d.ts +8 -0
  57. package/dist/operations/site/getSiteByName.test.d.ts +2 -0
  58. package/dist/operations/site/listSites.d.ts +6 -0
  59. package/dist/operations/site/listSites.test.d.ts +2 -0
  60. package/dist/operations/site/searchSites.d.ts +6 -0
  61. package/dist/operations/site/searchSites.test.d.ts +2 -0
  62. package/dist/operations/workbook/calculateWorkbook.d.ts +7 -0
  63. package/dist/operations/workbook/calculateWorkbook.test.d.ts +2 -0
  64. package/dist/operations/workbook/createWorkbook.d.ts +8 -0
  65. package/dist/operations/workbook/createWorkbook.test.d.ts +2 -0
  66. package/dist/operations/workbook/deleteWorkbook.d.ts +5 -0
  67. package/dist/operations/workbookRange/clearWorkbookRange.d.ts +5 -0
  68. package/dist/operations/workbookRange/clearWorkbookRange.test.d.ts +2 -0
  69. package/dist/operations/workbookRange/deleteWorkbookRange.d.ts +5 -0
  70. package/dist/operations/workbookRange/deleteWorkbookRange.test.d.ts +2 -0
  71. package/dist/operations/workbookRange/getWorkbookNamedRange.d.ts +6 -0
  72. package/dist/operations/workbookRange/getWorkbookUsedRange.d.ts +7 -0
  73. package/dist/operations/workbookRange/getWorkbookUsedRange.test.d.ts +2 -0
  74. package/dist/operations/workbookRange/getWorkbookVisibleRange.d.ts +6 -0
  75. package/dist/operations/workbookRange/getWorkbookVisibleRange.test.d.ts +2 -0
  76. package/dist/operations/workbookRange/insertWorkbookCells.d.ts +8 -0
  77. package/dist/operations/workbookRange/insertWorkbookCells.test.d.ts +2 -0
  78. package/dist/operations/workbookRange/updateWorkbookNamedRange.d.ts +6 -0
  79. package/dist/operations/workbookRange/updateWorkbookRange.d.ts +6 -0
  80. package/dist/operations/workbookRange/updateWorkbookRange.test.d.ts +2 -0
  81. package/dist/operations/workbookSession/closeWorkbookSession.d.ts +5 -0
  82. package/dist/operations/workbookSession/createWorkbookSession.d.ts +6 -0
  83. package/dist/operations/workbookSession/refreshWorkbookSession.d.ts +5 -0
  84. package/dist/operations/workbookTable/createWorkbookTable.d.ts +7 -0
  85. package/dist/operations/workbookTable/createWorkbookTable.test.d.ts +2 -0
  86. package/dist/operations/workbookTable/getWorkbookTable.d.ts +6 -0
  87. package/dist/operations/workbookTable/getWorkbookTable.test.d.ts +2 -0
  88. package/dist/operations/workbookTable/getWorkbookTableBodyRange.d.ts +7 -0
  89. package/dist/operations/workbookTable/getWorkbookTableBodyRange.test.d.ts +2 -0
  90. package/dist/operations/workbookTable/getWorkbookTableHeaderRange.d.ts +7 -0
  91. package/dist/operations/workbookTable/getWorkbookTableHeaderRange.test.d.ts +2 -0
  92. package/dist/operations/workbookTable/listWorkbookTableColumns.d.ts +6 -0
  93. package/dist/operations/workbookTable/listWorkbookTableColumns.test.d.ts +2 -0
  94. package/dist/operations/workbookTable/listWorkbookTableRows.d.ts +6 -0
  95. package/dist/operations/workbookTable/listWorkbookTableRows.test.d.ts +2 -0
  96. package/dist/operations/workbookTable/listWorkbookTables.d.ts +7 -0
  97. package/dist/operations/workbookTable/listWorkbookTables.test.d.ts +2 -0
  98. package/dist/operations/workbookWorksheet/createWorkbookWorksheet.d.ts +8 -0
  99. package/dist/operations/workbookWorksheet/createWorkbookWorksheet.test.d.ts +2 -0
  100. package/dist/operations/workbookWorksheet/deleteWorkbookWorksheet.d.ts +5 -0
  101. package/dist/operations/workbookWorksheet/deleteWorkbookWorksheet.test.d.ts +2 -0
  102. package/dist/operations/workbookWorksheet/getWorkbookWorksheetRange.d.ts +6 -0
  103. package/dist/operations/workbookWorksheet/getWorkbookWorksheetRange.test.d.ts +2 -0
  104. package/dist/operations/workbookWorksheet/listWorkbookWorksheets.d.ts +7 -0
  105. package/dist/operations/workbookWorksheet/listWorkbookWorksheets.test.d.ts +2 -0
  106. package/dist/operations/workbookWorksheet/updateWorkbookWorksheet.d.ts +10 -0
  107. package/dist/operations/workbookWorksheet/updateWorkbookWorksheet.test.d.ts +2 -0
  108. package/dist/services/accessToken.d.ts +5 -0
  109. package/dist/services/address.d.ts +2 -0
  110. package/dist/services/configuration.d.ts +7 -0
  111. package/dist/services/drive.d.ts +6 -0
  112. package/dist/services/driveItem.d.ts +10 -0
  113. package/dist/services/driveItem.test.d.ts +2 -0
  114. package/dist/services/httpAgent.d.ts +3 -0
  115. package/dist/services/httpStatus.d.ts +2 -0
  116. package/dist/services/operationId.d.ts +3 -0
  117. package/dist/services/sharepointUrl.d.ts +10 -0
  118. package/dist/services/sharepointUrl.test.d.ts +2 -0
  119. package/dist/services/site.d.ts +5 -0
  120. package/dist/services/sleep.d.ts +2 -0
  121. package/dist/services/stringCaseConversion.d.ts +2 -0
  122. package/dist/services/stringCaseConversion.test.d.ts +2 -0
  123. package/dist/services/templatedPaths.d.ts +4 -0
  124. package/dist/services/templatedPaths.test.d.ts +2 -0
  125. package/dist/services/temporaryFiles.d.ts +3 -0
  126. package/dist/services/workbookRange.d.ts +5 -0
  127. package/dist/services/workbookRangeAddress.d.ts +3 -0
  128. package/dist/services/workbookTable.d.ts +5 -0
  129. package/dist/services/workbookWorksheet.d.ts +6 -0
  130. package/dist/tasks/createWorkbookAndStartSession.d.ts +6 -0
  131. package/dist/tasks/deleteDriveItemWithRetry.d.ts +3 -0
  132. package/dist/tasks/downloadDriveItemContent.d.ts +3 -0
  133. package/dist/tasks/endSessionAndDeleteWorkbook.d.ts +3 -0
  134. package/dist/tasks/getRangeLastUsedCell.d.ts +8 -0
  135. package/dist/tasks/getRangeLastUsedCell.test.d.ts +2 -0
  136. package/dist/tasks/getWorkbookTableVisibleBody.d.ts +4 -0
  137. package/dist/tasks/getWorkbookTableVisibleBody.test.d.ts +2 -0
  138. package/dist/tasks/getWorkbookWorksheetRefByName.d.ts +5 -0
  139. package/dist/tasks/setColumnHidden.d.ts +3 -0
  140. package/dist/tasks/setColumnHidden.test.d.ts +2 -0
  141. package/dist/tasks/setRowHidden.d.ts +3 -0
  142. package/dist/tasks/setRowHidden.test.d.ts +2 -0
  143. package/package.json +5 -1
  144. package/update-exports.ts +58 -0
  145. package/vitest.config.ts +20 -0
@@ -0,0 +1,4 @@
1
+ export default class BadTemplateError extends Error {
2
+ constructor(message: string);
3
+ }
4
+ //# sourceMappingURL=BadTemplateError.d.ts.map
@@ -0,0 +1,4 @@
1
+ export default class EnvironmentVariableMissingError extends Error {
2
+ constructor(env: string);
3
+ }
4
+ //# sourceMappingURL=EnvironmentVariableMissingError.d.ts.map
@@ -0,0 +1,7 @@
1
+ export default class InvalidArgumentError extends Error {
2
+ constructor(message: string);
3
+ static throwIfOutside(value: number, min: number, max: number, message: string): void;
4
+ static throwIfGreater(value: number, max: number, message: string): void;
5
+ static throwIfFalsy(value: unknown, message: string): void;
6
+ }
7
+ //# sourceMappingURL=InvalidArgumentError.d.ts.map
@@ -0,0 +1,5 @@
1
+ export default class ProtocolError extends Error {
2
+ constructor(message: string);
3
+ static throwIfFalsy(value: unknown, message: string): void;
4
+ }
5
+ //# sourceMappingURL=ProtocolError.d.ts.map
@@ -0,0 +1,6 @@
1
+ export default class RequestFailedError extends Error {
2
+ constructor(message: string);
3
+ static throwIfNotOkBatch(status: number, ops: unknown, error: unknown): void;
4
+ static throwIfNotOkOperation(status: number, index: number, op: unknown, error: unknown): void;
5
+ }
6
+ //# sourceMappingURL=RequestFailedError.d.ts.map
@@ -0,0 +1,15 @@
1
+ import type { GraphOperation, GraphOperationDefinition } from "./models/GraphOperation.ts";
2
+ import type { Scope } from "./models/Scope.ts";
3
+ export declare const authenticationScope: Scope;
4
+ export declare const endpoint = "https://graph.microsoft.com/v1.0";
5
+ export declare const batchEndpoint = "https://graph.microsoft.com/v1.0/$batch";
6
+ type ExecutionResults<T> = {
7
+ [K in keyof T]: T[K] extends GraphOperation<infer R> ? R : never;
8
+ };
9
+ export declare function operation<T>(definition: GraphOperationDefinition<T>): GraphOperation<T>;
10
+ /** Execute a batch of GraphAPI operations in parallel. Provides the best performance for batch operations, however only useful if operations can logically be performed at the same time. */
11
+ export declare function parallel<T extends GraphOperation<unknown>[]>(...ops: T): Promise<ExecutionResults<T>>;
12
+ /** Execute a batch of GraphAPI operations sequentially. */
13
+ export declare function sequential<T extends GraphOperation<unknown>[]>(...ops: T): Promise<ExecutionResults<T>>;
14
+ export {};
15
+ //# sourceMappingURL=graphApi.d.ts.map
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,4 @@
1
+ export type AccessToken = string & {
2
+ __brand: "AccessToken";
3
+ };
4
+ //# sourceMappingURL=AccessToken.d.ts.map
@@ -0,0 +1,4 @@
1
+ export type DriveId = string & {
2
+ __brand: "DriveId";
3
+ };
4
+ //# sourceMappingURL=DriveId.d.ts.map
@@ -0,0 +1,4 @@
1
+ export type DriveItemId = string & {
2
+ __brand: "DriveItemId";
3
+ };
4
+ //# sourceMappingURL=DriveItemId.d.ts.map
@@ -0,0 +1,4 @@
1
+ export type DriveItemPath = string & {
2
+ __brand: "DriveItemPath";
3
+ };
4
+ //# sourceMappingURL=DriveItemPath.d.ts.map
@@ -0,0 +1,6 @@
1
+ import type { DriveItemId } from "./DriveItemId.ts";
2
+ import type { DriveRef } from "./DriveRef.ts";
3
+ export type DriveItemRef = DriveRef & {
4
+ itemId: DriveItemId;
5
+ };
6
+ //# sourceMappingURL=DriveItemRef.d.ts.map
@@ -0,0 +1,6 @@
1
+ import type { DriveId } from "./DriveId.ts";
2
+ import type { SiteRef } from "./SiteRef.ts";
3
+ export type DriveRef = SiteRef & {
4
+ driveId: DriveId;
5
+ };
6
+ //# sourceMappingURL=DriveRef.d.ts.map
@@ -0,0 +1,25 @@
1
+ import type { WorkbookSessionId } from "./WorkbookSessionId.ts";
2
+ export type GraphMethod = "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
3
+ export type GraphPath = string & {
4
+ __brand: "Path";
5
+ };
6
+ export type GraphHeaders = {
7
+ "workbook-session-id"?: WorkbookSessionId | undefined;
8
+ "content-type"?: "application/json" | "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" | undefined;
9
+ };
10
+ export type GraphOperationDefinition<T> = {
11
+ /** HTTP method to be used. */
12
+ method: GraphMethod;
13
+ /** Relative resource URL for the individual request. Ie, if the absolute URL is `https://graph.microsoft.com/v1.0/users`, this path is `/users`. */
14
+ path: GraphPath;
15
+ /** HTTP headers to be used. When the body is supplied, a Content-Type header must be included. */
16
+ headers: GraphHeaders;
17
+ /** JSON object or a base64 URL-encoded value, for example, when the body is an image. When a body is included with the request, the headers object must contain a value for Content-Type. */
18
+ body: unknown;
19
+ /** Translate the server response into a usable model */
20
+ responseTransform: (response: unknown) => T;
21
+ };
22
+ export type GraphOperation<T> = Promise<T> & {
23
+ definition: GraphOperationDefinition<T>;
24
+ };
25
+ //# sourceMappingURL=GraphOperation.d.ts.map
@@ -0,0 +1,20 @@
1
+ import type { WorkbookSessionId } from "./WorkbookSessionId.ts";
2
+ export type GraphMethod = "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
3
+ export type GraphPath = string & {
4
+ __brand: "Path";
5
+ };
6
+ export type GraphHeaders = {
7
+ "workbook-session-id"?: WorkbookSessionId | undefined;
8
+ "content-type"?: "application/json" | "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" | undefined;
9
+ };
10
+ export type GraphOperationDefinition<T> = {
11
+ /** HTTP method to be used. */
12
+ method: GraphMethod;
13
+ /** Relative resource URL for the individual request. Ie, if the absolute URL is `https://graph.microsoft.com/v1.0/users`, this path is `/users`. */
14
+ path: GraphPath;
15
+ /** HTTP headers to be used. When the body is supplied, a Content-Type header must be included. */
16
+ headers: GraphHeaders;
17
+ /** JSON object or a base64 URL-encoded value, for example, when the body is an image. When a body is included with the request, the headers object must contain a value for Content-Type. */
18
+ body: unknown;
19
+ };
20
+ //# sourceMappingURL=GraphOperationDefinition.d.ts.map
@@ -0,0 +1,4 @@
1
+ export type HostName = string & {
2
+ __brand: "Hostname";
3
+ };
4
+ //# sourceMappingURL=HostName.d.ts.map
@@ -0,0 +1,4 @@
1
+ export type Scope = string & {
2
+ __brand: "Scope";
3
+ };
4
+ //# sourceMappingURL=Scope.d.ts.map
@@ -0,0 +1,4 @@
1
+ export type SiteId = string & {
2
+ __brand: "SiteId";
3
+ };
4
+ //# sourceMappingURL=SiteId.d.ts.map
@@ -0,0 +1,4 @@
1
+ export type SiteName = string & {
2
+ __brand: "SiteName";
3
+ };
4
+ //# sourceMappingURL=SiteName.d.ts.map
@@ -0,0 +1,5 @@
1
+ import type { SiteId } from "./SiteId.ts";
2
+ export type SiteRef = {
3
+ siteId: SiteId;
4
+ };
5
+ //# sourceMappingURL=SiteRef.d.ts.map
@@ -0,0 +1,6 @@
1
+ import type { WorkbookRangeName } from "./WorkbookRangeName.ts";
2
+ import type { WorkbookRef } from "./WorkbookRef.ts";
3
+ export type WorkbookNamedRangeRef = WorkbookRef & {
4
+ rangeName: WorkbookRangeName;
5
+ };
6
+ //# sourceMappingURL=WorkbookNamedRangeRef.d.ts.map
@@ -0,0 +1,10 @@
1
+ type Column = `${Uppercase<string>}`;
2
+ type Row = `${number}`;
3
+ type Cell = `${Column}${Row}`;
4
+ type Box = `${Cell}:${Cell}` | `${Column}:${Column}` | `${Row}:${Row}`;
5
+ export type WorkbookRangeAddressUnderlying = Cell | Box;
6
+ export type WorkbookRangeAddress = WorkbookRangeAddressUnderlying & {
7
+ __brand: "WorkbookRangeAddress";
8
+ };
9
+ export {};
10
+ //# sourceMappingURL=WorkbookRangeAddress.d.ts.map
@@ -0,0 +1,4 @@
1
+ export type WorkbookRangeName = string & {
2
+ __brand: "WorkbookRangeName";
3
+ };
4
+ //# sourceMappingURL=WorkbookRangeName.d.ts.map
@@ -0,0 +1,6 @@
1
+ import type { WorkbookRangeAddress as WorkbookWorksheetRangeAddress } from "./WorkbookRangeAddress.ts";
2
+ import type { WorkbookWorksheetRef } from "./WorkbookWorksheetRef.ts";
3
+ export type WorkbookRangeRef = WorkbookWorksheetRef & {
4
+ address: WorkbookWorksheetRangeAddress;
5
+ };
6
+ //# sourceMappingURL=WorkbookRangeRef.d.ts.map
@@ -0,0 +1,6 @@
1
+ import type { DriveItemRef } from "./DriveItemRef.ts";
2
+ import type { WorkbookSessionId } from "./WorkbookSessionId.ts";
3
+ export type WorkbookRef = DriveItemRef & {
4
+ sessionId?: WorkbookSessionId | undefined;
5
+ };
6
+ //# sourceMappingURL=WorkbookRef.d.ts.map
@@ -0,0 +1,4 @@
1
+ export type WorkbookSessionId = string & {
2
+ __brand: "WorkbookSessionId";
3
+ };
4
+ //# sourceMappingURL=WorkbookSessionId.d.ts.map
@@ -0,0 +1,4 @@
1
+ export type WorkbookTableId = string & {
2
+ __brand: "WorkbookTableId";
3
+ };
4
+ //# sourceMappingURL=WorkbookTableId.d.ts.map
@@ -0,0 +1,6 @@
1
+ import type { WorkbookTableId } from "./WorkbookTableId.ts";
2
+ import type { WorkbookWorksheetRef } from "./WorkbookWorksheetRef.ts";
3
+ export type WorkbookTableRef = WorkbookWorksheetRef & {
4
+ tableId: WorkbookTableId;
5
+ };
6
+ //# sourceMappingURL=WorkbookTableRef.d.ts.map
@@ -0,0 +1,4 @@
1
+ export type WorkbookWorksheetId = string & {
2
+ __brand: "WorkbookWorksheetId";
3
+ };
4
+ //# sourceMappingURL=WorkbookWorksheetId.d.ts.map
@@ -0,0 +1,4 @@
1
+ export type WorkbookWorksheetName = string & {
2
+ __brand: "WorkbookWorksheetName";
3
+ };
4
+ //# sourceMappingURL=WorkbookWorksheetName.d.ts.map
@@ -0,0 +1,6 @@
1
+ import type { WorkbookRef } from "./WorkbookRef.ts";
2
+ import type { WorkbookWorksheetId } from "./WorkbookWorksheetId.ts";
3
+ export type WorkbookWorksheetRef = WorkbookRef & {
4
+ worksheetId: WorkbookWorksheetId;
5
+ };
6
+ //# sourceMappingURL=WorkbookWorksheetRef.d.ts.map
@@ -0,0 +1,7 @@
1
+ import type { DriveItem } from "@microsoft/microsoft-graph-types";
2
+ import type { DriveItemRef } from "../../models/DriveItemRef.ts";
3
+ import type { DriveRef } from "../../models/DriveRef.ts";
4
+ import type { GraphOperation } from "../../models/GraphOperation.ts";
5
+ /** Create folder if it doesn't exist, and return the folder. Use a `DriveRef` to create in root or `DriveItemRef` to create in a subfolder. @see https://learn.microsoft.com/en-us/graph/api/driveitem-post-children */
6
+ export default function createFolder(parentRef: DriveRef | DriveItemRef, folderName: string): GraphOperation<DriveItem & DriveItemRef>;
7
+ //# sourceMappingURL=createFolder.d.ts.map
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=createFolder.test.d.ts.map
@@ -0,0 +1,7 @@
1
+ import type { DriveItem } from "@microsoft/microsoft-graph-types";
2
+ import type { DriveRef } from "../../models/DriveRef.ts";
3
+ import type { GraphOperation } from "../../models/GraphOperation.ts";
4
+ import type { SiteRef } from "../../models/SiteRef.ts";
5
+ /** Retrieve the list of Drive resources available for a Site. @see https://learn.microsoft.com/en-us/graph/api/drive-list */
6
+ export default function listDrives(siteRef?: SiteRef): GraphOperation<(DriveItem & DriveRef)[]>;
7
+ //# sourceMappingURL=listDrives.d.ts.map
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=listDrives.test.d.ts.map
@@ -0,0 +1,5 @@
1
+ import type { DriveItemRef } from "../../models/DriveItemRef.ts";
2
+ import type { GraphOperation } from "../../models/GraphOperation.ts";
3
+ /** Initiate an asynchronous copy of an item. NOTE: The copied file may not be immediately available and polling is required. @see https://learn.microsoft.com/en-us/graph/api/driveitem-copy */
4
+ export default function copyDriveItem(srcFileRef: DriveItemRef, dstFolderRef: DriveItemRef, dstFileName: string): GraphOperation<void>;
5
+ //# sourceMappingURL=copyDriveItem.d.ts.map
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=copyDriveItem.test.d.ts.map
@@ -0,0 +1,5 @@
1
+ import type { DriveItemRef } from "../../models/DriveItemRef.ts";
2
+ import type { GraphOperation } from "../../models/GraphOperation.ts";
3
+ /** Delete an item. @see https://learn.microsoft.com/en-us/graph/api/driveitem-delete */
4
+ export default function deleteDriveItem(itemRef: DriveItemRef): GraphOperation<void>;
5
+ //# sourceMappingURL=deleteDriveItem.d.ts.map
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=deleteDriveItem.test.d.ts.map
@@ -0,0 +1,6 @@
1
+ import type { DriveItem } from "@microsoft/microsoft-graph-types";
2
+ import type { DriveItemRef } from "../../models/DriveItemRef.ts";
3
+ import type { GraphOperation } from "../../models/GraphOperation.ts";
4
+ /** Retrieve the metadata for an item in a drive. @see https://learn.microsoft.com/en-us/graph/api/driveitem-get */
5
+ export default function getDriveItem(itemRef: DriveItemRef): GraphOperation<DriveItem & DriveItemRef>;
6
+ //# sourceMappingURL=getDriveItem.d.ts.map
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=getDriveItem.test.d.ts.map
@@ -0,0 +1,8 @@
1
+ import type { DriveItem } from "@microsoft/microsoft-graph-types";
2
+ import type { DriveItemPath } from "../../models/DriveItemPath.ts";
3
+ import type { DriveItemRef } from "../../models/DriveItemRef.ts";
4
+ import type { DriveRef } from "../../models/DriveRef.ts";
5
+ import type { GraphOperation } from "../../models/GraphOperation.ts";
6
+ /** Retrieve the metadata for an item in a drive by file path. If the target file is moved this will cease working. @see https://learn.microsoft.com/en-us/graph/api/driveitem-get */
7
+ export default function getDriveItemByPath(driveRef: DriveRef, itemPath: DriveItemPath): GraphOperation<DriveItem & DriveItemRef>;
8
+ //# sourceMappingURL=getDriveItemByPath.d.ts.map
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=getDriveItemByPath.test.d.ts.map
@@ -0,0 +1,4 @@
1
+ import type { DriveItemRef } from "../../models/DriveItemRef.ts";
2
+ /** Download drive item. @see https://learn.microsoft.com/en-us/graph/api/driveitem-get-content */
3
+ export default function getDriveItemContent(itemRef: DriveItemRef): Promise<ArrayBuffer>;
4
+ //# sourceMappingURL=getDriveItemContent.d.ts.map
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=getDriveItemContent.test.d.ts.map
@@ -0,0 +1,5 @@
1
+ import type { DriveItemRef } from "../../models/DriveItemRef.ts";
2
+ import type { GraphOperation } from "../../models/GraphOperation.ts";
3
+ /** Initiate an asynchronous copy of an item. NOTE: The copied file may not be immediately available and polling is required. @see https://learn.microsoft.com/en-us/graph/api/driveitem-copy */
4
+ export default function initiateCopyDriveItem(srcFileRef: DriveItemRef, dstFolderRef: DriveItemRef, dstFileName: string): GraphOperation<void>;
5
+ //# sourceMappingURL=initiateCopyDriveItem.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"initiateCopyDriveItem.d.ts","sourceRoot":"","sources":["../../../src/operations/driveItem/initiateCopyDriveItem.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAGrE,gMAAgM;AAChM,MAAM,CAAC,OAAO,UAAU,qBAAqB,CAAC,UAAU,EAAE,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,GAAG,cAAc,CAAC,IAAI,CAAC,CAiB7I"}
@@ -0,0 +1,21 @@
1
+ import { operation } from "../../graphApi.js";
2
+ import { generatePath } from "../../services/templatedPaths.js";
3
+ /** Initiate an asynchronous copy of an item. NOTE: The copied file may not be immediately available and polling is required. @see https://learn.microsoft.com/en-us/graph/api/driveitem-copy */
4
+ export default function initiateCopyDriveItem(srcFileRef, dstFolderRef, dstFileName) {
5
+ return operation({
6
+ method: "POST",
7
+ path: generatePath("/sites/{site-id}/drives/{drive-id}/items/{item-id}/copy", srcFileRef),
8
+ headers: {
9
+ "content-type": "application/json",
10
+ },
11
+ body: {
12
+ name: dstFileName,
13
+ parentReference: {
14
+ siteId: dstFolderRef.siteId,
15
+ driveId: dstFolderRef.driveId,
16
+ id: dstFolderRef.itemId,
17
+ },
18
+ },
19
+ responseTransform: () => undefined
20
+ });
21
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=initiateCopyDriveItem.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"initiateCopyDriveItem.test.d.ts","sourceRoot":"","sources":["../../../src/operations/driveItem/initiateCopyDriveItem.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,28 @@
1
+ import { describe, expect, it } from "vitest";
2
+ import { getDefaultDriveRef } from "../../services/drive.js";
3
+ import { driveItemPath, } from "../../services/driveItem.js";
4
+ import { generateTempFileName } from "../../services/temporaryFiles.js";
5
+ import deleteDriveItemWithRetry from "../../tasks/deleteDriveItemWithRetry.js";
6
+ import createFolder from "../drive/createFolder.js";
7
+ import getDriveItemByPath from "./getDriveItemByPath.js";
8
+ import initiateCopyDriveItem from "./initiateCopyDriveItem.js";
9
+ describe("initiateCopyDriveItem", () => {
10
+ it("can copy an item to a new folder", { timeout: 10000 }, async () => {
11
+ const driveRef = getDefaultDriveRef();
12
+ const srcFolderName = generateTempFileName();
13
+ const srcFolder = await createFolder(driveRef, srcFolderName);
14
+ const dstFolderName = generateTempFileName();
15
+ const dstFolder = await createFolder(driveRef, dstFolderName);
16
+ try {
17
+ const copiedItemName = `${srcFolderName}-copy`;
18
+ await initiateCopyDriveItem(srcFolder, dstFolder, copiedItemName);
19
+ const copyPath = driveItemPath(dstFolderName, copiedItemName);
20
+ const copyFolder = await getDriveItemByPath(driveRef, copyPath);
21
+ expect(copyFolder.webUrl?.endsWith(copyPath)).toBeTruthy();
22
+ }
23
+ finally {
24
+ await deleteDriveItemWithRetry(srcFolder);
25
+ await deleteDriveItemWithRetry(dstFolder);
26
+ }
27
+ });
28
+ });
@@ -0,0 +1,12 @@
1
+ import type { DriveItem } from "@microsoft/microsoft-graph-types";
2
+ import type { DriveItemRef } from "../../models/DriveItemRef.ts";
3
+ import type { DriveRef } from "../../models/DriveRef.ts";
4
+ import type { GraphOperation } from "../../models/GraphOperation.ts";
5
+ export type ListDriveItemResponse = {
6
+ "@odata.context": string;
7
+ value: DriveItem[];
8
+ "@odata.nextLink"?: string;
9
+ };
10
+ /** Retrieve the metadata for items in a drive by file path. Use a `DriveRef` to reference a drive root or `DriveItemRef` for a subfolder. @see https://learn.microsoft.com/en-us/graph/api/driveitem-list-children */
11
+ export default function listDriveItems(parentRef?: DriveRef | DriveItemRef): GraphOperation<(DriveItem & DriveItemRef)[]>;
12
+ //# sourceMappingURL=listDriveItems.d.ts.map
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=listDriveItems.test.d.ts.map
@@ -0,0 +1,6 @@
1
+ import type { Site } from "@microsoft/microsoft-graph-types";
2
+ import type { GraphOperation } from "../../models/GraphOperation.ts";
3
+ import type { SiteRef } from "../../models/SiteRef.ts";
4
+ /** Retrieve properties for a site resource. @see https://learn.microsoft.com/en-us/graph/api/site-get */
5
+ export default function getSite(siteRef: SiteRef): GraphOperation<Site & SiteRef>;
6
+ //# sourceMappingURL=getSite.d.ts.map
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=getSite.test.d.ts.map
@@ -0,0 +1,8 @@
1
+ import type { Site } from "@microsoft/microsoft-graph-types";
2
+ import type { GraphOperation } from "../../models/GraphOperation.ts";
3
+ import type { HostName } from "../../models/HostName.ts";
4
+ import type { SiteName } from "../../models/SiteName.ts";
5
+ import type { SiteRef } from "../../models/SiteRef.ts";
6
+ /** Get site by name. @see https://learn.microsoft.com/en-us/graph/api/site-getbypath */
7
+ export default function getSiteByName(hostName: HostName, siteName: SiteName): GraphOperation<Site & SiteRef>;
8
+ //# sourceMappingURL=getSiteByName.d.ts.map
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=getSiteByName.test.d.ts.map
@@ -0,0 +1,6 @@
1
+ import type { Site } from "@microsoft/microsoft-graph-types";
2
+ import type { GraphOperation } from "../../models/GraphOperation.ts";
3
+ import type { SiteRef } from "../../models/SiteRef.ts";
4
+ /** List sites that are available. @see https://learn.microsoft.com/en-us/graph/api/site-list */
5
+ export default function listSites(): GraphOperation<(Site & SiteRef)[]>;
6
+ //# sourceMappingURL=listSites.d.ts.map
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=listSites.test.d.ts.map
@@ -0,0 +1,6 @@
1
+ import type { Site } from "@microsoft/microsoft-graph-types";
2
+ import type { GraphOperation } from "../../models/GraphOperation.ts";
3
+ import type { SiteRef } from "../../models/SiteRef.ts";
4
+ /** Find accessible sites that match keywords provided. @see https://learn.microsoft.com/en-us/graph/api/site-search */
5
+ export default function searchSites(search: string): GraphOperation<(Site & SiteRef)[]>;
6
+ //# sourceMappingURL=searchSites.d.ts.map
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=searchSites.test.d.ts.map
@@ -0,0 +1,7 @@
1
+ import type { GraphOperation } from "../../models/GraphOperation.ts";
2
+ import type { WorkbookRef } from "../../models/WorkbookRef.ts";
3
+ /** Recalculate a workbook. @see https://learn.microsoft.com/en-us/graph/api/workbookapplication-calculate */
4
+ export default function calculateWorkbook(workbookRef: WorkbookRef, calculationType?: "Recalculate" | "Full" | "FullRebuild"): GraphOperation<void>;
5
+ /** @deprecated Use calculateWorkbook instead. */
6
+ export declare function recalculateWorkbook(workbookRef: WorkbookRef): GraphOperation<void>;
7
+ //# sourceMappingURL=calculateWorkbook.d.ts.map
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=calculateWorkbook.test.d.ts.map
@@ -0,0 +1,8 @@
1
+ import type { DriveItem } from "@microsoft/microsoft-graph-types";
2
+ import type { DriveItemPath } from "../../models/DriveItemPath.ts";
3
+ import type { DriveRef } from "../../models/DriveRef.ts";
4
+ import type { GraphOperation } from "../../models/GraphOperation.ts";
5
+ import type { WorkbookRef } from "../../models/WorkbookRef.ts";
6
+ /** Create a new blank workbook. */
7
+ export default function createWorkbook(driveRef: DriveRef, itemPath: DriveItemPath): GraphOperation<DriveItem & WorkbookRef>;
8
+ //# sourceMappingURL=createWorkbook.d.ts.map
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=createWorkbook.test.d.ts.map
@@ -0,0 +1,5 @@
1
+ import type { GraphOperation } from "../../models/GraphOperation.ts";
2
+ import type { WorkbookRef } from "../../models/WorkbookRef.ts";
3
+ /** Delete a workbook. @see https://learn.microsoft.com/en-us/graph/api/driveitem-delete */
4
+ export default function deleteWorkbook(workbookRef: WorkbookRef): GraphOperation<void>;
5
+ //# sourceMappingURL=deleteWorkbook.d.ts.map
@@ -0,0 +1,5 @@
1
+ import type { GraphOperation } from "../../models/GraphOperation.ts";
2
+ import type { WorkbookRangeRef } from "../../models/WorkbookRangeRef.ts";
3
+ /** Clear a range - content, formatting or both. @see https://learn.microsoft.com/en-us/graph/api/range-delete */
4
+ export default function clearWorkbookRange(rangeRef: WorkbookRangeRef, applyTo?: "All" | "Formats" | "Contents"): GraphOperation<void>;
5
+ //# sourceMappingURL=clearWorkbookRange.d.ts.map
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=clearWorkbookRange.test.d.ts.map
@@ -0,0 +1,5 @@
1
+ import type { GraphOperation } from "../../models/GraphOperation.ts";
2
+ import type { WorkbookRangeRef } from "../../models/WorkbookRangeRef.ts";
3
+ /** Delete a range. @see https://learn.microsoft.com/en-us/graph/api/range-clear */
4
+ export default function deleteWorkbookRange(rangeRef: WorkbookRangeRef, shift: "Up" | "Left"): GraphOperation<void>;
5
+ //# sourceMappingURL=deleteWorkbookRange.d.ts.map
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=deleteWorkbookRange.test.d.ts.map
@@ -0,0 +1,6 @@
1
+ import type { WorkbookRange } from "@microsoft/microsoft-graph-types";
2
+ import type { GraphOperation } from "../../models/GraphOperation.ts";
3
+ import type { WorkbookNamedRangeRef } from "../../models/WorkbookNamedRangeRef.ts";
4
+ /** Retrieve range that has been defined using the "named range" functionality. @see https://learn.microsoft.com/en-us/graph/api/range-get */
5
+ export default function getWorkbookNamedRange(rangeRef: WorkbookNamedRangeRef): GraphOperation<WorkbookRange & WorkbookNamedRangeRef>;
6
+ //# sourceMappingURL=getWorkbookNamedRange.d.ts.map
@@ -0,0 +1,7 @@
1
+ import type { WorkbookRange } from "@microsoft/microsoft-graph-types";
2
+ import type { GraphOperation } from "../../models/GraphOperation.ts";
3
+ import type { WorkbookRangeRef } from "../../models/WorkbookRangeRef.ts";
4
+ import type { WorkbookWorksheetRef } from "../../models/WorkbookWorksheetRef.ts";
5
+ /** Retrieve the used range in a worksheet, ignoring trailing rows and columns that are blank. @see https://learn.microsoft.com/en-us/graph/api/range-usedrange */
6
+ export default function getWorkbookUsedRange(worksheetRef: WorkbookWorksheetRef): GraphOperation<WorkbookRange & WorkbookRangeRef>;
7
+ //# sourceMappingURL=getWorkbookUsedRange.d.ts.map
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=getWorkbookUsedRange.test.d.ts.map
@@ -0,0 +1,6 @@
1
+ import type { WorkbookRangeView } from "@microsoft/microsoft-graph-types";
2
+ import type { GraphOperation } from "../../models/GraphOperation.ts";
3
+ import type { WorkbookRangeRef } from "../../models/WorkbookRangeRef.ts";
4
+ /** Retrieve the visible view of a range. @see https://learn.microsoft.com/en-us/graph/api/workbookrange-visibleview */
5
+ export default function getWorkbookVisibleRange(rangeRef: WorkbookRangeRef): GraphOperation<WorkbookRangeView & WorkbookRangeRef>;
6
+ //# sourceMappingURL=getWorkbookVisibleRange.d.ts.map
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=getWorkbookVisibleRange.test.d.ts.map
@@ -0,0 +1,8 @@
1
+ import type { WorkbookRange } from "@microsoft/microsoft-graph-types";
2
+ import type { GraphOperation } from "../../models/GraphOperation.ts";
3
+ import type { WorkbookRangeAddress } from "../../models/WorkbookRangeAddress.ts";
4
+ import type { WorkbookRangeRef } from "../../models/WorkbookRangeRef.ts";
5
+ import type { WorkbookWorksheetRef } from "../../models/WorkbookWorksheetRef.ts";
6
+ /** Insert a new blank range at a specified address, shifting existing cells. Use `updateRange` after to set content. @see https://learn.microsoft.com/en-us/graph/api/range-insert */
7
+ export default function insertWorkbookCells(worksheetRef: WorkbookWorksheetRef, address: WorkbookRangeAddress, shift: "Down" | "Right"): GraphOperation<WorkbookRange & WorkbookRangeRef>;
8
+ //# sourceMappingURL=insertWorkbookCells.d.ts.map
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=insertWorkbookCells.test.d.ts.map