microsoft-graph 3.11.21 → 3.12.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -6,17 +6,6 @@ This is an extensible library that allows access to Microsoft's GraphAPI, includ
6
6
 
7
7
  ℹ️ This is a THIRD PARTY library and not associated with Microsoft.
8
8
 
9
- ## Breaking changes
10
- Version 2.25.0 has a few breaking changes:
11
- * **Signature change for `insertWorkbookCells` from `insertWorkbookCells(worksheetRef, address, shift)` to `insertWorkbookCells(rangeRef, shift)`**
12
- * `graphApi.ts` has moved to `services/operationInvoker.ts`
13
- * `NumberFormat` renamed to `CellFormat`
14
- * `Cell.numberFormat` renamed to `Cell.format`
15
- * `services/numberFormat.ts` moved to `services/cellFormat.ts`
16
- * Merged a number of files in `models` to reduce import count.
17
- * Removed return value from `setColumnHidden` and `setRowHidden`
18
- * `services/listDriveItems` now returns async iterable. Wrap this with `iterateToArray` if an array is actually desired.
19
-
20
9
  ## TLDR
21
10
  Install the NPM package `npm i microsoft-graph`, then:
22
11
 
@@ -0,0 +1,43 @@
1
+ /**
2
+ * Create a sharing link for a drive item.
3
+ * @module createDriveItemLink
4
+ * @category Operations
5
+ * @see https://learn.microsoft.com/en-us/graph/api/driveitem-createlink
6
+ */
7
+ import type { Permission } from "@microsoft/microsoft-graph-types";
8
+ import type { DriveItemRef } from "../../models/DriveItem.ts";
9
+ import type { GraphOperation } from "../../models/GraphOperation.ts";
10
+ /**
11
+ * The type of sharing link to create.
12
+ * Corresponds to the Microsoft Graph link 'type' parameter.
13
+ * @remarks See Microsoft Graph docs for supported values. Common types: view, edit, embed, blocksDownload, createOnly
14
+ */
15
+ export type DriveItemLinkType = "view" | "edit" | "embed" | "blocksDownload" | "createOnly" | string;
16
+ /**
17
+ * The scope of the sharing link.
18
+ * @remarks Supported scopes include: anonymous, organization, users (when specifying recipients)
19
+ */
20
+ export type DriveItemLinkScope = "anonymous" | "organization" | "users" | string;
21
+ /**
22
+ * Options when creating a sharing link for a drive item.
23
+ * Mirrors the Microsoft Graph createLink request body fields.
24
+ */
25
+ export interface CreateDriveItemLinkOptions {
26
+ /** The type of link to create (e.g., view, edit). */
27
+ type: DriveItemLinkType;
28
+ /** The scope of the link (e.g., anonymous, organization, users). */
29
+ scope?: DriveItemLinkScope;
30
+ /** Password to set on the link (only for certain link types/scopes). */
31
+ password?: string;
32
+ /** Expiration date/time in ISO 8601 format. */
33
+ expirationDateTime?: string;
34
+ }
35
+ /**
36
+ * Create a sharing link for a drive item.
37
+ * @param itemRef Reference to the drive item.
38
+ * @param options Options specifying the desired link characteristics.
39
+ * @returns A Permission object describing the created link (including its webUrl and link properties).
40
+ * @see https://learn.microsoft.com/en-us/graph/api/driveitem-createlink
41
+ */
42
+ export default function createDriveItemLink(itemRef: DriveItemRef, options: CreateDriveItemLinkOptions): GraphOperation<Permission>;
43
+ //# sourceMappingURL=createDriveItemLink.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createDriveItemLink.d.ts","sourceRoot":"","sources":["../../../../src/operations/driveItem/createDriveItemLink.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAC;AACnE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAIrE;;;;GAIG;AACH,MAAM,MAAM,iBAAiB,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,gBAAgB,GAAG,YAAY,GAAG,MAAM,CAAC;AAErG;;;GAGG;AACH,MAAM,MAAM,kBAAkB,GAAG,WAAW,GAAG,cAAc,GAAG,OAAO,GAAG,MAAM,CAAC;AAEjF;;;GAGG;AACH,MAAM,WAAW,0BAA0B;IAC1C,qDAAqD;IACrD,IAAI,EAAE,iBAAiB,CAAC;IACxB,oEAAoE;IACpE,KAAK,CAAC,EAAE,kBAAkB,CAAC;IAC3B,wEAAwE;IACxE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,+CAA+C;IAC/C,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,UAAU,mBAAmB,CAAC,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,0BAA0B,GAAG,cAAc,CAAC,UAAU,CAAC,CAmBlI"}
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+ /**
3
+ * Create a sharing link for a drive item.
4
+ * @module createDriveItemLink
5
+ * @category Operations
6
+ * @see https://learn.microsoft.com/en-us/graph/api/driveitem-createlink
7
+ */
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.default = createDriveItemLink;
10
+ const operationInvoker_ts_1 = require("../../services/operationInvoker.js");
11
+ const templatedPaths_ts_1 = require("../../services/templatedPaths.js");
12
+ /**
13
+ * Create a sharing link for a drive item.
14
+ * @param itemRef Reference to the drive item.
15
+ * @param options Options specifying the desired link characteristics.
16
+ * @returns A Permission object describing the created link (including its webUrl and link properties).
17
+ * @see https://learn.microsoft.com/en-us/graph/api/driveitem-createlink
18
+ */
19
+ function createDriveItemLink(itemRef, options) {
20
+ const { type, scope, password, expirationDateTime } = options;
21
+ const body = { type };
22
+ // biome-ignore lint/complexity/useLiteralKeys: Literal keys are needed
23
+ if (scope)
24
+ body["scope"] = scope;
25
+ if (password)
26
+ body["password"] = password;
27
+ if (expirationDateTime)
28
+ body["expirationDateTime"] = expirationDateTime;
29
+ return (0, operationInvoker_ts_1.operation)({
30
+ context: itemRef.context,
31
+ method: "POST",
32
+ path: (0, templatedPaths_ts_1.generatePath)("/sites/{site-id}/drives/{drive-id}/items/{item-id}/createLink", itemRef),
33
+ headers: {
34
+ "content-type": "application/json",
35
+ },
36
+ body,
37
+ responseTransform: (response) => response,
38
+ });
39
+ }
@@ -0,0 +1,43 @@
1
+ /**
2
+ * Create a sharing link for a drive item.
3
+ * @module createDriveItemLink
4
+ * @category Operations
5
+ * @see https://learn.microsoft.com/en-us/graph/api/driveitem-createlink
6
+ */
7
+ import type { Permission } from "@microsoft/microsoft-graph-types";
8
+ import type { DriveItemRef } from "../../models/DriveItem.ts";
9
+ import type { GraphOperation } from "../../models/GraphOperation.ts";
10
+ /**
11
+ * The type of sharing link to create.
12
+ * Corresponds to the Microsoft Graph link 'type' parameter.
13
+ * @remarks See Microsoft Graph docs for supported values. Common types: view, edit, embed, blocksDownload, createOnly
14
+ */
15
+ export type DriveItemLinkType = "view" | "edit" | "embed" | "blocksDownload" | "createOnly" | string;
16
+ /**
17
+ * The scope of the sharing link.
18
+ * @remarks Supported scopes include: anonymous, organization, users (when specifying recipients)
19
+ */
20
+ export type DriveItemLinkScope = "anonymous" | "organization" | "users" | string;
21
+ /**
22
+ * Options when creating a sharing link for a drive item.
23
+ * Mirrors the Microsoft Graph createLink request body fields.
24
+ */
25
+ export interface CreateDriveItemLinkOptions {
26
+ /** The type of link to create (e.g., view, edit). */
27
+ type: DriveItemLinkType;
28
+ /** The scope of the link (e.g., anonymous, organization, users). */
29
+ scope?: DriveItemLinkScope;
30
+ /** Password to set on the link (only for certain link types/scopes). */
31
+ password?: string;
32
+ /** Expiration date/time in ISO 8601 format. */
33
+ expirationDateTime?: string;
34
+ }
35
+ /**
36
+ * Create a sharing link for a drive item.
37
+ * @param itemRef Reference to the drive item.
38
+ * @param options Options specifying the desired link characteristics.
39
+ * @returns A Permission object describing the created link (including its webUrl and link properties).
40
+ * @see https://learn.microsoft.com/en-us/graph/api/driveitem-createlink
41
+ */
42
+ export default function createDriveItemLink(itemRef: DriveItemRef, options: CreateDriveItemLinkOptions): GraphOperation<Permission>;
43
+ //# sourceMappingURL=createDriveItemLink.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createDriveItemLink.d.ts","sourceRoot":"","sources":["../../../../src/operations/driveItem/createDriveItemLink.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAC;AACnE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAIrE;;;;GAIG;AACH,MAAM,MAAM,iBAAiB,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,gBAAgB,GAAG,YAAY,GAAG,MAAM,CAAC;AAErG;;;GAGG;AACH,MAAM,MAAM,kBAAkB,GAAG,WAAW,GAAG,cAAc,GAAG,OAAO,GAAG,MAAM,CAAC;AAEjF;;;GAGG;AACH,MAAM,WAAW,0BAA0B;IAC1C,qDAAqD;IACrD,IAAI,EAAE,iBAAiB,CAAC;IACxB,oEAAoE;IACpE,KAAK,CAAC,EAAE,kBAAkB,CAAC;IAC3B,wEAAwE;IACxE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,+CAA+C;IAC/C,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,UAAU,mBAAmB,CAAC,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,0BAA0B,GAAG,cAAc,CAAC,UAAU,CAAC,CAmBlI"}
@@ -0,0 +1,36 @@
1
+ /**
2
+ * Create a sharing link for a drive item.
3
+ * @module createDriveItemLink
4
+ * @category Operations
5
+ * @see https://learn.microsoft.com/en-us/graph/api/driveitem-createlink
6
+ */
7
+ import { operation } from "../../services/operationInvoker.js";
8
+ import { generatePath } from "../../services/templatedPaths.js";
9
+ /**
10
+ * Create a sharing link for a drive item.
11
+ * @param itemRef Reference to the drive item.
12
+ * @param options Options specifying the desired link characteristics.
13
+ * @returns A Permission object describing the created link (including its webUrl and link properties).
14
+ * @see https://learn.microsoft.com/en-us/graph/api/driveitem-createlink
15
+ */
16
+ export default function createDriveItemLink(itemRef, options) {
17
+ const { type, scope, password, expirationDateTime } = options;
18
+ const body = { type };
19
+ // biome-ignore lint/complexity/useLiteralKeys: Literal keys are needed
20
+ if (scope)
21
+ body["scope"] = scope;
22
+ if (password)
23
+ body["password"] = password;
24
+ if (expirationDateTime)
25
+ body["expirationDateTime"] = expirationDateTime;
26
+ return operation({
27
+ context: itemRef.context,
28
+ method: "POST",
29
+ path: generatePath("/sites/{site-id}/drives/{drive-id}/items/{item-id}/createLink", itemRef),
30
+ headers: {
31
+ "content-type": "application/json",
32
+ },
33
+ body,
34
+ responseTransform: (response) => response,
35
+ });
36
+ }
@@ -81,6 +81,7 @@
81
81
  | [closeWorkbookSession](closeWorkbookSession.md) | Close an existing workbook session. |
82
82
  | [createBinaryWorkbook](createBinaryWorkbook.md) | Create a new blank binary workbook (XLSB). |
83
83
  | [createDriveItemContent](createDriveItemContent.md) | Creates a new drive item in the specified parent drive or folder using a stream as content. |
84
+ | [createDriveItemLink](createDriveItemLink.md) | Create a sharing link for a drive item. |
84
85
  | [createFolder](createFolder.md) | Create a folder in the root of a drive, or in a folder. If it already exists do nothing. |
85
86
  | [createWorkbook](createWorkbook.md) | Create a new blank workbook (XLSX). |
86
87
  | [createWorkbookSession](createWorkbookSession.md) | Create a new workbook session. |
@@ -0,0 +1,108 @@
1
+ [Microsoft Graph SDK](README.md) / createDriveItemLink
2
+
3
+ # createDriveItemLink
4
+
5
+ Create a sharing link for a drive item.
6
+
7
+ ## See
8
+
9
+ https://learn.microsoft.com/en-us/graph/api/driveitem-createlink
10
+
11
+ ## Interfaces
12
+
13
+ ### CreateDriveItemLinkOptions
14
+
15
+ Defined in: [src/operations/driveItem/createDriveItemLink.ts:31](https://github.com/Future-Secure-AI/microsoft-graph/blob/main/src/operations/driveItem/createDriveItemLink.ts#L31)
16
+
17
+ Options when creating a sharing link for a drive item.
18
+ Mirrors the Microsoft Graph createLink request body fields.
19
+
20
+ #### Properties
21
+
22
+ ##### expirationDateTime?
23
+
24
+ > `optional` **expirationDateTime**: `string`
25
+
26
+ Defined in: [src/operations/driveItem/createDriveItemLink.ts:39](https://github.com/Future-Secure-AI/microsoft-graph/blob/main/src/operations/driveItem/createDriveItemLink.ts#L39)
27
+
28
+ Expiration date/time in ISO 8601 format.
29
+
30
+ ##### password?
31
+
32
+ > `optional` **password**: `string`
33
+
34
+ Defined in: [src/operations/driveItem/createDriveItemLink.ts:37](https://github.com/Future-Secure-AI/microsoft-graph/blob/main/src/operations/driveItem/createDriveItemLink.ts#L37)
35
+
36
+ Password to set on the link (only for certain link types/scopes).
37
+
38
+ ##### scope?
39
+
40
+ > `optional` **scope**: `string`
41
+
42
+ Defined in: [src/operations/driveItem/createDriveItemLink.ts:35](https://github.com/Future-Secure-AI/microsoft-graph/blob/main/src/operations/driveItem/createDriveItemLink.ts#L35)
43
+
44
+ The scope of the link (e.g., anonymous, organization, users).
45
+
46
+ ##### type
47
+
48
+ > **type**: `string`
49
+
50
+ Defined in: [src/operations/driveItem/createDriveItemLink.ts:33](https://github.com/Future-Secure-AI/microsoft-graph/blob/main/src/operations/driveItem/createDriveItemLink.ts#L33)
51
+
52
+ The type of link to create (e.g., view, edit).
53
+
54
+ ## Type Aliases
55
+
56
+ ### DriveItemLinkScope
57
+
58
+ > **DriveItemLinkScope** = `"anonymous"` \| `"organization"` \| `"users"` \| `string`
59
+
60
+ Defined in: [src/operations/driveItem/createDriveItemLink.ts:25](https://github.com/Future-Secure-AI/microsoft-graph/blob/main/src/operations/driveItem/createDriveItemLink.ts#L25)
61
+
62
+ The scope of the sharing link.
63
+
64
+ #### Remarks
65
+
66
+ Supported scopes include: anonymous, organization, users (when specifying recipients)
67
+
68
+ ***
69
+
70
+ ### DriveItemLinkType
71
+
72
+ > **DriveItemLinkType** = `"view"` \| `"edit"` \| `"embed"` \| `"blocksDownload"` \| `"createOnly"` \| `string`
73
+
74
+ Defined in: [src/operations/driveItem/createDriveItemLink.ts:19](https://github.com/Future-Secure-AI/microsoft-graph/blob/main/src/operations/driveItem/createDriveItemLink.ts#L19)
75
+
76
+ The type of sharing link to create.
77
+ Corresponds to the Microsoft Graph link 'type' parameter.
78
+
79
+ #### Remarks
80
+
81
+ See Microsoft Graph docs for supported values. Common types: view, edit, embed, blocksDownload, createOnly
82
+
83
+ ## Functions
84
+
85
+ ### createDriveItemLink()
86
+
87
+ > **createDriveItemLink**(`itemRef`, `options`): [`GraphOperation`](GraphOperation.md#graphoperation)\<`Permission`\>
88
+
89
+ Defined in: [src/operations/driveItem/createDriveItemLink.ts:49](https://github.com/Future-Secure-AI/microsoft-graph/blob/main/src/operations/driveItem/createDriveItemLink.ts#L49)
90
+
91
+ Create a sharing link for a drive item.
92
+
93
+ #### Parameters
94
+
95
+ | Parameter | Type | Description |
96
+ | ------ | ------ | ------ |
97
+ | `itemRef` | [`DriveItemRef`](DriveItem-1.md#driveitemref) | Reference to the drive item. |
98
+ | `options` | [`CreateDriveItemLinkOptions`](#createdriveitemlinkoptions) | Options specifying the desired link characteristics. |
99
+
100
+ #### Returns
101
+
102
+ [`GraphOperation`](GraphOperation.md#graphoperation)\<`Permission`\>
103
+
104
+ A Permission object describing the created link (including its webUrl and link properties).
105
+
106
+ #### See
107
+
108
+ https://learn.microsoft.com/en-us/graph/api/driveitem-createlink
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "microsoft-graph",
3
- "version": "3.11.21",
3
+ "version": "3.12.23",
4
4
  "description": "Microsoft GraphAPI SDK for NodeJS",
5
5
  "main": "./dist/cjs/index.js",
6
6
  "module": "./dist/esm/index.js",
@@ -686,6 +686,16 @@
686
686
  "require": "./dist/cjs/operations/driveItem/createDriveItemContent.js",
687
687
  "types": "./dist/esm/operations/driveItem/createDriveItemContent.d.ts"
688
688
  },
689
+ "./createDriveItemLink": {
690
+ "import": "./dist/esm/operations/driveItem/createDriveItemLink.js",
691
+ "require": "./dist/cjs/operations/driveItem/createDriveItemLink.js",
692
+ "types": "./dist/esm/operations/driveItem/createDriveItemLink.d.ts"
693
+ },
694
+ "./dist/cjs/operations/driveItem/createDriveItemLink": {
695
+ "import": "./dist/esm/operations/driveItem/createDriveItemLink.js",
696
+ "require": "./dist/cjs/operations/driveItem/createDriveItemLink.js",
697
+ "types": "./dist/esm/operations/driveItem/createDriveItemLink.d.ts"
698
+ },
689
699
  "./deleteDriveItem": {
690
700
  "import": "./dist/esm/operations/driveItem/deleteDriveItem.js",
691
701
  "require": "./dist/cjs/operations/driveItem/deleteDriveItem.js",