microsoft-graph 2.7.8 → 2.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/graphApi.d.ts.map +1 -1
- package/dist/cjs/graphApi.js +45 -25
- package/dist/cjs/operations/driveItem/getDriveItemContent.d.ts.map +1 -1
- package/dist/cjs/operations/driveItem/getDriveItemContent.js +17 -6
- package/dist/cjs/operations/workbookRange/autoFitWorkbookRangeColumns.d.ts +11 -0
- package/dist/cjs/operations/workbookRange/autoFitWorkbookRangeColumns.d.ts.map +1 -0
- package/dist/cjs/operations/workbookRange/autoFitWorkbookRangeColumns.js +24 -0
- package/dist/cjs/operations/workbookRange/getWorkbookRangeFill.d.ts +12 -0
- package/dist/cjs/operations/workbookRange/getWorkbookRangeFill.d.ts.map +1 -0
- package/dist/cjs/operations/workbookRange/getWorkbookRangeFill.js +31 -0
- package/dist/cjs/operations/workbookRange/getWorkbookRangeFont.d.ts +12 -0
- package/dist/cjs/operations/workbookRange/getWorkbookRangeFont.d.ts.map +1 -0
- package/dist/cjs/operations/workbookRange/getWorkbookRangeFont.js +31 -0
- package/dist/cjs/operations/workbookRange/setWorkbookRangeFill.d.ts +12 -0
- package/dist/cjs/operations/workbookRange/setWorkbookRangeFill.d.ts.map +1 -0
- package/dist/cjs/operations/workbookRange/setWorkbookRangeFill.js +25 -0
- package/dist/cjs/operations/workbookRange/setWorkbookRangeFont.d.ts +12 -0
- package/dist/cjs/operations/workbookRange/setWorkbookRangeFont.d.ts.map +1 -0
- package/dist/cjs/operations/workbookRange/setWorkbookRangeFont.js +25 -0
- package/dist/cjs/operations/workbookRange/setWorkbookRangeFormat.d.ts +12 -0
- package/dist/cjs/operations/workbookRange/setWorkbookRangeFormat.d.ts.map +1 -0
- package/dist/cjs/operations/workbookRange/setWorkbookRangeFormat.js +28 -0
- package/dist/esm/graphApi.d.ts.map +1 -1
- package/dist/esm/graphApi.js +45 -25
- package/dist/esm/operations/driveItem/getDriveItemContent.d.ts.map +1 -1
- package/dist/esm/operations/driveItem/getDriveItemContent.js +17 -6
- package/dist/esm/operations/workbookRange/autoFitWorkbookRangeColumns.d.ts +11 -0
- package/dist/esm/operations/workbookRange/autoFitWorkbookRangeColumns.d.ts.map +1 -0
- package/dist/esm/operations/workbookRange/autoFitWorkbookRangeColumns.js +21 -0
- package/dist/esm/operations/workbookRange/getWorkbookRangeFill.d.ts +12 -0
- package/dist/esm/operations/workbookRange/getWorkbookRangeFill.d.ts.map +1 -0
- package/dist/esm/operations/workbookRange/getWorkbookRangeFill.js +28 -0
- package/dist/esm/operations/workbookRange/getWorkbookRangeFont.d.ts +12 -0
- package/dist/esm/operations/workbookRange/getWorkbookRangeFont.d.ts.map +1 -0
- package/dist/esm/operations/workbookRange/getWorkbookRangeFont.js +28 -0
- package/dist/esm/operations/workbookRange/setWorkbookRangeFill.d.ts +12 -0
- package/dist/esm/operations/workbookRange/setWorkbookRangeFill.d.ts.map +1 -0
- package/dist/esm/operations/workbookRange/setWorkbookRangeFill.js +22 -0
- package/dist/esm/operations/workbookRange/setWorkbookRangeFont.d.ts +12 -0
- package/dist/esm/operations/workbookRange/setWorkbookRangeFont.d.ts.map +1 -0
- package/dist/esm/operations/workbookRange/setWorkbookRangeFont.js +22 -0
- package/dist/esm/operations/workbookRange/setWorkbookRangeFormat.d.ts +12 -0
- package/dist/esm/operations/workbookRange/setWorkbookRangeFormat.d.ts.map +1 -0
- package/dist/esm/operations/workbookRange/setWorkbookRangeFormat.js +25 -0
- package/package.json +63 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graphApi.d.ts","sourceRoot":"","sources":["../../src/graphApi.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"graphApi.d.ts","sourceRoot":"","sources":["../../src/graphApi.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAgB,cAAc,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AACzG,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAQ/C,eAAO,MAAM,mBAAmB,EAA6C,KAAK,CAAC;AACnF,eAAO,MAAM,QAAQ,qCAAqC,CAAC;AAC3D,eAAO,MAAM,aAAa,4CAAuB,CAAC;AAElD,8KAA8K;AAC9K,wBAAgB,SAAS,CAAC,CAAC,EAAE,UAAU,EAAE,wBAAwB,CAAC,CAAC,CAAC,GAAG,cAAc,CAAC,CAAC,CAAC,CAQvF;AAED,6LAA6L;AAC7L,wBAAsB,QAAQ,CAAC,CAAC,SAAS,cAAc,CAAC,OAAO,CAAC,EAAE,EAAE,GAAG,UAAU,EAAE,CAAC,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,CAInH;AAED,2DAA2D;AAC3D,wBAAsB,UAAU,CAAC,CAAC,SAAS,cAAc,CAAC,OAAO,CAAC,EAAE,EAAE,GAAG,UAAU,EAAE,CAAC,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,CAOrH;AAoBD,KAAK,iBAAiB,CAAC,CAAC,IAAI;KAC1B,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,cAAc,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,KAAK;CAChE,CAAC"}
|
package/dist/cjs/graphApi.js
CHANGED
|
@@ -7,7 +7,7 @@ exports.batchEndpoint = exports.endpoint = exports.authenticationScope = void 0;
|
|
|
7
7
|
exports.operation = operation;
|
|
8
8
|
exports.parallel = parallel;
|
|
9
9
|
exports.sequential = sequential;
|
|
10
|
-
const
|
|
10
|
+
const axios_1 = __importDefault(require("axios"));
|
|
11
11
|
const InconsistentContextError_ts_1 = __importDefault(require("./errors/InconsistentContextError.js"));
|
|
12
12
|
const InvalidArgumentError_ts_1 = __importDefault(require("./errors/InvalidArgumentError.js"));
|
|
13
13
|
const NeverError_ts_1 = __importDefault(require("./errors/NeverError.js"));
|
|
@@ -51,7 +51,7 @@ const consecutiveRetryDelayMultiplier = 2;
|
|
|
51
51
|
async function executeSingle(definition) {
|
|
52
52
|
const context = (0, context_ts_1.getContext)(definition.contextId);
|
|
53
53
|
const accessToken = await (0, accessToken_ts_1.getCurrentAccessToken)(context.tenantId, context.clientId, context.clientSecret, exports.authenticationScope);
|
|
54
|
-
const
|
|
54
|
+
const httpAgent = (0, httpAgent_ts_1.tryGetHttpAgent)(context.httpProxy);
|
|
55
55
|
const response = await innerFetch({
|
|
56
56
|
url: `${exports.endpoint}${definition.path}`,
|
|
57
57
|
method: definition.method,
|
|
@@ -59,8 +59,8 @@ async function executeSingle(definition) {
|
|
|
59
59
|
authorization: createAuthorizationHeader(accessToken),
|
|
60
60
|
...headersToObject(definition.headers),
|
|
61
61
|
},
|
|
62
|
-
|
|
63
|
-
|
|
62
|
+
data: definition.body === null ? null : definition.body,
|
|
63
|
+
httpAgent,
|
|
64
64
|
});
|
|
65
65
|
return definition.responseTransform(response);
|
|
66
66
|
}
|
|
@@ -79,7 +79,7 @@ async function executeBatch(...ops) {
|
|
|
79
79
|
}
|
|
80
80
|
const context = (0, context_ts_1.getContext)(contextId);
|
|
81
81
|
const accessToken = await (0, accessToken_ts_1.getCurrentAccessToken)(context.tenantId, context.clientId, context.clientSecret, exports.authenticationScope);
|
|
82
|
-
const
|
|
82
|
+
const httpAgent = (0, httpAgent_ts_1.tryGetHttpAgent)(context.httpProxy);
|
|
83
83
|
const body = await innerFetch({
|
|
84
84
|
url: exports.batchEndpoint,
|
|
85
85
|
method: "POST",
|
|
@@ -88,7 +88,7 @@ async function executeBatch(...ops) {
|
|
|
88
88
|
accept: "application/json",
|
|
89
89
|
"content-type": "application/json",
|
|
90
90
|
},
|
|
91
|
-
|
|
91
|
+
data: {
|
|
92
92
|
requests: ops.map((op, index) => ({
|
|
93
93
|
id: (0, operationId_ts_1.operationIndexToId)(index),
|
|
94
94
|
method: op.method,
|
|
@@ -97,8 +97,8 @@ async function executeBatch(...ops) {
|
|
|
97
97
|
body: op.body === null ? undefined : op.body,
|
|
98
98
|
dependsOn: op.dependsOn?.map((id) => id.toString()),
|
|
99
99
|
})),
|
|
100
|
-
}
|
|
101
|
-
|
|
100
|
+
},
|
|
101
|
+
httpAgent,
|
|
102
102
|
});
|
|
103
103
|
const responses = [];
|
|
104
104
|
for (const r of body.responses) {
|
|
@@ -123,27 +123,49 @@ async function executeBatch(...ops) {
|
|
|
123
123
|
return responses; // TODO: Is there a neater way to massage the types correctly? This is functionally correct, but I do want to avoid using `unknown` here if possible.
|
|
124
124
|
}
|
|
125
125
|
/** Execute request, supporting GraphAPI retry logic */
|
|
126
|
+
// biome-ignore lint/complexity/noExcessiveCognitiveComplexity: This function does need to be simplified, though it is a TODO for another day
|
|
126
127
|
async function innerFetch(args) {
|
|
127
128
|
const { url, ...options } = args;
|
|
129
|
+
if (!url) {
|
|
130
|
+
throw new Error("URL is required for request");
|
|
131
|
+
}
|
|
128
132
|
let retryAfterMilliseconds = defaultRetryDelayMilliseconds;
|
|
129
133
|
let response = null;
|
|
130
134
|
let attempts = 0; // Track the number of attempts
|
|
135
|
+
const instance = axios_1.default.create({
|
|
136
|
+
httpsAgent: options.httpAgent,
|
|
137
|
+
});
|
|
131
138
|
while (attempts < maxRetries) {
|
|
132
139
|
// Retry at most 3 times
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
140
|
+
try {
|
|
141
|
+
response = await instance({
|
|
142
|
+
url,
|
|
143
|
+
...options,
|
|
144
|
+
});
|
|
145
|
+
break; // If successful, exit the loop
|
|
136
146
|
}
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
147
|
+
catch (error) {
|
|
148
|
+
if (axios_1.default.isAxiosError(error) && error.response) {
|
|
149
|
+
response = error.response;
|
|
150
|
+
if (!((0, httpStatus_ts_1.isHttpTooManyRequests)(response.status) || (0, httpStatus_ts_1.isServiceUnavailable)(response.status))) {
|
|
151
|
+
throw error; // Don't retry for other error codes
|
|
152
|
+
}
|
|
153
|
+
const requestedRetryAfterSeconds = Number.parseInt(response.headers["retry-after"] ?? "0", 10);
|
|
154
|
+
if (requestedRetryAfterSeconds) {
|
|
155
|
+
retryAfterMilliseconds = requestedRetryAfterSeconds * 1000;
|
|
156
|
+
}
|
|
157
|
+
await (0, sleep_ts_1.sleep)(retryAfterMilliseconds);
|
|
158
|
+
retryAfterMilliseconds *= consecutiveRetryDelayMultiplier;
|
|
159
|
+
attempts++; // Increment the attempt counter
|
|
160
|
+
if (attempts >= maxRetries) {
|
|
161
|
+
RequestFailedError_ts_1.default.throw(`GraphAPI fetch exceed retry limit of ${maxRetries} attempts.`, args);
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
else {
|
|
165
|
+
// For non-Axios errors or errors without response, just throw
|
|
166
|
+
throw error;
|
|
167
|
+
}
|
|
140
168
|
}
|
|
141
|
-
await (0, sleep_ts_1.sleep)(retryAfterMilliseconds);
|
|
142
|
-
retryAfterMilliseconds *= consecutiveRetryDelayMultiplier;
|
|
143
|
-
attempts++; // Increment the attempt counter
|
|
144
|
-
}
|
|
145
|
-
if (attempts >= maxRetries) {
|
|
146
|
-
RequestFailedError_ts_1.default.throw(`GraphAPI fetch exceed retry limit of ${maxRetries} attempts.`, args);
|
|
147
169
|
}
|
|
148
170
|
if (!response) {
|
|
149
171
|
throw new NeverError_ts_1.default("Response is null. Should be impossible");
|
|
@@ -151,17 +173,15 @@ async function innerFetch(args) {
|
|
|
151
173
|
if ((0, httpStatus_ts_1.isHttpTooManyRequests)(response.status)) {
|
|
152
174
|
RequestFailedError_ts_1.default.throw("GraphAPI fetch failed after 3 retries due to too many requests.", args);
|
|
153
175
|
}
|
|
154
|
-
const replyContentType = response.headers.get("content-type")?.toLowerCase();
|
|
155
|
-
const body = replyContentType?.startsWith("application/json") ? await response.json() : null;
|
|
156
176
|
if (!(0, httpStatus_ts_1.isHttpOk)(response.status)) {
|
|
157
|
-
const bodyError =
|
|
177
|
+
const bodyError = response.data;
|
|
158
178
|
let errorMessage = `${response.status} '${response.statusText}'`;
|
|
159
179
|
if (bodyError?.error) {
|
|
160
180
|
errorMessage += `: [${bodyError.error.code}] '${bodyError.error.message}'`;
|
|
161
181
|
}
|
|
162
|
-
RequestFailedError_ts_1.default.throw(`GraphAPI fetch failed: ${errorMessage}`, args,
|
|
182
|
+
RequestFailedError_ts_1.default.throw(`GraphAPI fetch failed: ${errorMessage}`, args, response.data);
|
|
163
183
|
}
|
|
164
|
-
return
|
|
184
|
+
return response.data;
|
|
165
185
|
}
|
|
166
186
|
function normalizeBatchBody(contentType, body) {
|
|
167
187
|
if (contentType?.startsWith("application/json") && typeof body === "string") {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getDriveItemContent.d.ts","sourceRoot":"","sources":["../../../../src/operations/driveItem/getDriveItemContent.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"getDriveItemContent.d.ts","sourceRoot":"","sources":["../../../../src/operations/driveItem/getDriveItemContent.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAOjE;;;;;;;GAOG;AACH,wBAA8B,mBAAmB,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,WAAW,CAAC,CAgC7F"}
|
|
@@ -4,11 +4,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.default = getDriveItemContent;
|
|
7
|
-
const
|
|
7
|
+
const axios_1 = __importDefault(require("axios"));
|
|
8
8
|
const graphApi_ts_1 = require("../../graphApi.js");
|
|
9
9
|
const accessToken_ts_1 = require("../../services/accessToken.js");
|
|
10
10
|
const context_ts_1 = require("../../services/context.js");
|
|
11
11
|
const httpAgent_ts_1 = require("../../services/httpAgent.js");
|
|
12
|
+
const httpStatus_ts_1 = require("../../services/httpStatus.js");
|
|
12
13
|
const templatedPaths_ts_1 = require("../../services/templatedPaths.js");
|
|
13
14
|
/**
|
|
14
15
|
* Download the content of a drive item.
|
|
@@ -23,15 +24,25 @@ async function getDriveItemContent(itemRef) {
|
|
|
23
24
|
const url = `${graphApi_ts_1.endpoint}${(0, templatedPaths_ts_1.generatePath)("/sites/{site-id}/drives/{drive-id}/items/{item-id}/content", itemRef)}`;
|
|
24
25
|
const context = (0, context_ts_1.getContext)(itemRef.contextId);
|
|
25
26
|
const accessToken = await (0, accessToken_ts_1.getCurrentAccessToken)(context.tenantId, context.clientId, context.clientSecret, graphApi_ts_1.authenticationScope);
|
|
26
|
-
const
|
|
27
|
-
const response = await (0,
|
|
27
|
+
const httpAgent = (0, httpAgent_ts_1.tryGetHttpAgent)(context.httpProxy);
|
|
28
|
+
const response = await (0, axios_1.default)({
|
|
29
|
+
url,
|
|
30
|
+
method: "GET",
|
|
28
31
|
headers: {
|
|
29
32
|
authorization: `Bearer ${accessToken}`,
|
|
30
33
|
},
|
|
31
|
-
|
|
34
|
+
responseType: "arraybuffer",
|
|
35
|
+
httpsAgent: httpAgent,
|
|
32
36
|
});
|
|
33
|
-
if (!response.
|
|
37
|
+
if (!(0, httpStatus_ts_1.isHttpOk)(response.status)) {
|
|
34
38
|
throw new Error(`Failed to download file: ${response.status} ${response.statusText}`);
|
|
35
39
|
}
|
|
36
|
-
|
|
40
|
+
if (!Buffer.isBuffer(response.data)) {
|
|
41
|
+
throw new Error(`Unexpected response type: ${typeof response.data}`);
|
|
42
|
+
}
|
|
43
|
+
const buffer = response.data.buffer.slice(response.data.byteOffset, response.data.byteOffset + response.data.byteLength);
|
|
44
|
+
if (!(buffer instanceof ArrayBuffer)) {
|
|
45
|
+
throw new Error("Failed to convert Buffer to ArrayBuffer");
|
|
46
|
+
}
|
|
47
|
+
return buffer;
|
|
37
48
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { GraphOperation } from "../../models/GraphOperation.ts";
|
|
2
|
+
import type { WorkbookRangeRef } from "../../models/WorkbookRangeRef.ts";
|
|
3
|
+
/**
|
|
4
|
+
* Auto-fit the columns in a range.
|
|
5
|
+
*
|
|
6
|
+
* @param rangeRef - A reference to the range, optionally including session information.
|
|
7
|
+
* @returns Nothing.
|
|
8
|
+
* @see https://learn.microsoft.com/en-us/graph/api/rangeformat-autofitcolumns
|
|
9
|
+
*/
|
|
10
|
+
export default function autoFitWorkbookRangeColumns(rangeRef: WorkbookRangeRef): GraphOperation<void>;
|
|
11
|
+
//# sourceMappingURL=autoFitWorkbookRangeColumns.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"autoFitWorkbookRangeColumns.d.ts","sourceRoot":"","sources":["../../../../src/operations/workbookRange/autoFitWorkbookRangeColumns.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AAGzE;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,UAAU,2BAA2B,CAAC,QAAQ,EAAE,gBAAgB,GAAG,cAAc,CAAC,IAAI,CAAC,CAWpG"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = autoFitWorkbookRangeColumns;
|
|
4
|
+
const graphApi_ts_1 = require("../../graphApi.js");
|
|
5
|
+
const templatedPaths_ts_1 = require("../../services/templatedPaths.js");
|
|
6
|
+
/**
|
|
7
|
+
* Auto-fit the columns in a range.
|
|
8
|
+
*
|
|
9
|
+
* @param rangeRef - A reference to the range, optionally including session information.
|
|
10
|
+
* @returns Nothing.
|
|
11
|
+
* @see https://learn.microsoft.com/en-us/graph/api/rangeformat-autofitcolumns
|
|
12
|
+
*/
|
|
13
|
+
function autoFitWorkbookRangeColumns(rangeRef) {
|
|
14
|
+
return (0, graphApi_ts_1.operation)({
|
|
15
|
+
contextId: rangeRef.contextId,
|
|
16
|
+
method: "POST",
|
|
17
|
+
path: (0, templatedPaths_ts_1.generatePath)("/sites/{site-id}/drives/{drive-id}/items/{item-id}/workbook/worksheets/{worksheet-id}/range(address='{address}')/format/autofitcolumns", rangeRef),
|
|
18
|
+
headers: {
|
|
19
|
+
"workbook-session-id": rangeRef.sessionId,
|
|
20
|
+
},
|
|
21
|
+
body: null,
|
|
22
|
+
responseTransform: () => undefined,
|
|
23
|
+
});
|
|
24
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { WorkbookRangeFill } from "@microsoft/microsoft-graph-types";
|
|
2
|
+
import type { GraphOperation } from "../../models/GraphOperation.ts";
|
|
3
|
+
import type { WorkbookRangeRef } from "../../models/WorkbookRangeRef.ts";
|
|
4
|
+
/**
|
|
5
|
+
* Retrieve the fill format of a workbook range.
|
|
6
|
+
*
|
|
7
|
+
* @param rangeRef - A reference to the range, optionally including session information.
|
|
8
|
+
* @returns The fill format of the specified range, including its metadata and reference information.
|
|
9
|
+
* @see https://learn.microsoft.com/en-us/graph/api/rangefill-get
|
|
10
|
+
*/
|
|
11
|
+
export default function getWorkbookRangeFill(rangeRef: WorkbookRangeRef): GraphOperation<WorkbookRangeFill & WorkbookRangeRef>;
|
|
12
|
+
//# sourceMappingURL=getWorkbookRangeFill.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getWorkbookRangeFill.d.ts","sourceRoot":"","sources":["../../../../src/operations/workbookRange/getWorkbookRangeFill.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AAE1E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AAGzE;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,UAAU,oBAAoB,CAAC,QAAQ,EAAE,gBAAgB,GAAG,cAAc,CAAC,iBAAiB,GAAG,gBAAgB,CAAC,CAiB7H"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// https://learn.microsoft.com/en-us/graph/api/rangefill-get
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.default = getWorkbookRangeFill;
|
|
5
|
+
const graphApi_ts_1 = require("../../graphApi.js");
|
|
6
|
+
const templatedPaths_ts_1 = require("../../services/templatedPaths.js");
|
|
7
|
+
/**
|
|
8
|
+
* Retrieve the fill format of a workbook range.
|
|
9
|
+
*
|
|
10
|
+
* @param rangeRef - A reference to the range, optionally including session information.
|
|
11
|
+
* @returns The fill format of the specified range, including its metadata and reference information.
|
|
12
|
+
* @see https://learn.microsoft.com/en-us/graph/api/rangefill-get
|
|
13
|
+
*/
|
|
14
|
+
function getWorkbookRangeFill(rangeRef) {
|
|
15
|
+
return (0, graphApi_ts_1.operation)({
|
|
16
|
+
contextId: rangeRef.contextId,
|
|
17
|
+
method: "GET",
|
|
18
|
+
path: (0, templatedPaths_ts_1.generatePath)(`/sites/{site-id}/drives/{drive-id}/items/{item-id}/workbook/worksheets/{worksheet-id}/range(address='${rangeRef.address}')/format/fill`, rangeRef),
|
|
19
|
+
headers: {
|
|
20
|
+
"workbook-session-id": rangeRef.sessionId,
|
|
21
|
+
},
|
|
22
|
+
body: null,
|
|
23
|
+
responseTransform: (response) => {
|
|
24
|
+
const fill = response;
|
|
25
|
+
return {
|
|
26
|
+
...fill,
|
|
27
|
+
...rangeRef,
|
|
28
|
+
};
|
|
29
|
+
},
|
|
30
|
+
});
|
|
31
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { WorkbookRangeFont } from "@microsoft/microsoft-graph-types";
|
|
2
|
+
import type { GraphOperation } from "../../models/GraphOperation.ts";
|
|
3
|
+
import type { WorkbookRangeRef } from "../../models/WorkbookRangeRef.ts";
|
|
4
|
+
/**
|
|
5
|
+
* Retrieve the font format of a workbook range.
|
|
6
|
+
*
|
|
7
|
+
* @param rangeRef - A reference to the range, optionally including session information.
|
|
8
|
+
* @returns The font format of the specified range, including its metadata and reference information.
|
|
9
|
+
* @see https://learn.microsoft.com/en-us/graph/api/rangefont-get
|
|
10
|
+
*/
|
|
11
|
+
export default function getWorkbookRangeFont(rangeRef: WorkbookRangeRef): GraphOperation<WorkbookRangeFont & WorkbookRangeRef>;
|
|
12
|
+
//# sourceMappingURL=getWorkbookRangeFont.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getWorkbookRangeFont.d.ts","sourceRoot":"","sources":["../../../../src/operations/workbookRange/getWorkbookRangeFont.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AAE1E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AAGzE;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,UAAU,oBAAoB,CAAC,QAAQ,EAAE,gBAAgB,GAAG,cAAc,CAAC,iBAAiB,GAAG,gBAAgB,CAAC,CAiB7H"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// https://learn.microsoft.com/en-us/graph/api/rangefont-get
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.default = getWorkbookRangeFont;
|
|
5
|
+
const graphApi_ts_1 = require("../../graphApi.js");
|
|
6
|
+
const templatedPaths_ts_1 = require("../../services/templatedPaths.js");
|
|
7
|
+
/**
|
|
8
|
+
* Retrieve the font format of a workbook range.
|
|
9
|
+
*
|
|
10
|
+
* @param rangeRef - A reference to the range, optionally including session information.
|
|
11
|
+
* @returns The font format of the specified range, including its metadata and reference information.
|
|
12
|
+
* @see https://learn.microsoft.com/en-us/graph/api/rangefont-get
|
|
13
|
+
*/
|
|
14
|
+
function getWorkbookRangeFont(rangeRef) {
|
|
15
|
+
return (0, graphApi_ts_1.operation)({
|
|
16
|
+
contextId: rangeRef.contextId,
|
|
17
|
+
method: "GET",
|
|
18
|
+
path: (0, templatedPaths_ts_1.generatePath)(`/sites/{site-id}/drives/{drive-id}/items/{item-id}/workbook/worksheets/{worksheet-id}/range(address='${rangeRef.address}')/format/font`, rangeRef),
|
|
19
|
+
headers: {
|
|
20
|
+
"workbook-session-id": rangeRef.sessionId,
|
|
21
|
+
},
|
|
22
|
+
body: null,
|
|
23
|
+
responseTransform: (response) => {
|
|
24
|
+
const font = response;
|
|
25
|
+
return {
|
|
26
|
+
...font,
|
|
27
|
+
...rangeRef,
|
|
28
|
+
};
|
|
29
|
+
},
|
|
30
|
+
});
|
|
31
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { WorkbookRangeFill } from "@microsoft/microsoft-graph-types";
|
|
2
|
+
import type { GraphOperation } from "../../models/GraphOperation.ts";
|
|
3
|
+
import type { WorkbookRangeRef } from "../../models/WorkbookRangeRef.ts";
|
|
4
|
+
/**
|
|
5
|
+
* Update the fill format of a workbook range.
|
|
6
|
+
*
|
|
7
|
+
* @param rangeRef - A reference to the range to be formatted, optionally including session information.
|
|
8
|
+
* @param format - The fill format properties to apply to the range.
|
|
9
|
+
* @see https://learn.microsoft.com/en-us/graph/api/rangefill-update
|
|
10
|
+
*/
|
|
11
|
+
export default function setWorkbookRangeFill(rangeRef: WorkbookRangeRef, format: WorkbookRangeFill): GraphOperation<void>;
|
|
12
|
+
//# sourceMappingURL=setWorkbookRangeFill.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setWorkbookRangeFill.d.ts","sourceRoot":"","sources":["../../../../src/operations/workbookRange/setWorkbookRangeFill.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AAE1E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AAGzE;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,UAAU,oBAAoB,CAAC,QAAQ,EAAE,gBAAgB,EAAE,MAAM,EAAE,iBAAiB,GAAG,cAAc,CAAC,IAAI,CAAC,CAYxH"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = setWorkbookRangeFill;
|
|
4
|
+
const graphApi_ts_1 = require("../../graphApi.js");
|
|
5
|
+
const templatedPaths_ts_1 = require("../../services/templatedPaths.js");
|
|
6
|
+
/**
|
|
7
|
+
* Update the fill format of a workbook range.
|
|
8
|
+
*
|
|
9
|
+
* @param rangeRef - A reference to the range to be formatted, optionally including session information.
|
|
10
|
+
* @param format - The fill format properties to apply to the range.
|
|
11
|
+
* @see https://learn.microsoft.com/en-us/graph/api/rangefill-update
|
|
12
|
+
*/
|
|
13
|
+
function setWorkbookRangeFill(rangeRef, format) {
|
|
14
|
+
return (0, graphApi_ts_1.operation)({
|
|
15
|
+
contextId: rangeRef.contextId,
|
|
16
|
+
method: "PATCH",
|
|
17
|
+
path: (0, templatedPaths_ts_1.generatePath)("/sites/{site-id}/drives/{drive-id}/items/{item-id}/workbook/worksheets/{worksheet-id}/range(address='{address}')/format/fill", rangeRef),
|
|
18
|
+
headers: {
|
|
19
|
+
"workbook-session-id": rangeRef.sessionId,
|
|
20
|
+
"content-type": "application/json",
|
|
21
|
+
},
|
|
22
|
+
body: format,
|
|
23
|
+
responseTransform: () => undefined,
|
|
24
|
+
});
|
|
25
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { WorkbookRangeFont } from "@microsoft/microsoft-graph-types";
|
|
2
|
+
import type { GraphOperation } from "../../models/GraphOperation.ts";
|
|
3
|
+
import type { WorkbookRangeRef } from "../../models/WorkbookRangeRef.ts";
|
|
4
|
+
/**
|
|
5
|
+
* Update the font format of a workbook range.
|
|
6
|
+
*
|
|
7
|
+
* @param rangeRef - A reference to the range to be formatted, optionally including session information.
|
|
8
|
+
* @param format - The font format properties to apply to the range.
|
|
9
|
+
* @see https://learn.microsoft.com/en-us/graph/api/rangefont-update
|
|
10
|
+
*/
|
|
11
|
+
export default function setWorkbookRangeFont(rangeRef: WorkbookRangeRef, format: WorkbookRangeFont): GraphOperation<void>;
|
|
12
|
+
//# sourceMappingURL=setWorkbookRangeFont.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setWorkbookRangeFont.d.ts","sourceRoot":"","sources":["../../../../src/operations/workbookRange/setWorkbookRangeFont.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AAE1E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AAGzE;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,UAAU,oBAAoB,CAAC,QAAQ,EAAE,gBAAgB,EAAE,MAAM,EAAE,iBAAiB,GAAG,cAAc,CAAC,IAAI,CAAC,CAYxH"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = setWorkbookRangeFont;
|
|
4
|
+
const graphApi_ts_1 = require("../../graphApi.js");
|
|
5
|
+
const templatedPaths_ts_1 = require("../../services/templatedPaths.js");
|
|
6
|
+
/**
|
|
7
|
+
* Update the font format of a workbook range.
|
|
8
|
+
*
|
|
9
|
+
* @param rangeRef - A reference to the range to be formatted, optionally including session information.
|
|
10
|
+
* @param format - The font format properties to apply to the range.
|
|
11
|
+
* @see https://learn.microsoft.com/en-us/graph/api/rangefont-update
|
|
12
|
+
*/
|
|
13
|
+
function setWorkbookRangeFont(rangeRef, format) {
|
|
14
|
+
return (0, graphApi_ts_1.operation)({
|
|
15
|
+
contextId: rangeRef.contextId,
|
|
16
|
+
method: "PATCH",
|
|
17
|
+
path: (0, templatedPaths_ts_1.generatePath)("/sites/{site-id}/drives/{drive-id}/items/{item-id}/workbook/worksheets/{worksheet-id}/range(address='{address}')/format/font", rangeRef),
|
|
18
|
+
headers: {
|
|
19
|
+
"workbook-session-id": rangeRef.sessionId,
|
|
20
|
+
"content-type": "application/json",
|
|
21
|
+
},
|
|
22
|
+
body: format,
|
|
23
|
+
responseTransform: () => undefined,
|
|
24
|
+
});
|
|
25
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { WorkbookRangeFormat } from "@microsoft/microsoft-graph-types";
|
|
2
|
+
import type { GraphOperation } from "../../models/GraphOperation.ts";
|
|
3
|
+
import type { WorkbookRangeRef } from "../../models/WorkbookRangeRef.ts";
|
|
4
|
+
/**
|
|
5
|
+
* Update the general format of a workbook range.
|
|
6
|
+
*
|
|
7
|
+
* @param rangeRef - A reference to the range to be formatted, optionally including session information.
|
|
8
|
+
* @param format - The general format properties to apply to the range.
|
|
9
|
+
* @see https://learn.microsoft.com/en-us/graph/api/rangeformat-update
|
|
10
|
+
*/
|
|
11
|
+
export default function setWorkbookRangeFormat(rangeRef: WorkbookRangeRef, format: WorkbookRangeFormat): GraphOperation<void>;
|
|
12
|
+
//# sourceMappingURL=setWorkbookRangeFormat.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setWorkbookRangeFormat.d.ts","sourceRoot":"","sources":["../../../../src/operations/workbookRange/setWorkbookRangeFormat.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AAE5E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AAGzE;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,UAAU,sBAAsB,CAAC,QAAQ,EAAE,gBAAgB,EAAE,MAAM,EAAE,mBAAmB,GAAG,cAAc,CAAC,IAAI,CAAC,CAY5H"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// PATCH /sites/{site-id}/drives/{drive-id}/items/{item-id}/workbook/worksheets/{worksheet-id}/range(address='{address}')/format
|
|
3
|
+
// https://learn.microsoft.com/en-us/graph/api/rangeformat-update
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.default = setWorkbookRangeFormat;
|
|
6
|
+
const graphApi_ts_1 = require("../../graphApi.js");
|
|
7
|
+
const templatedPaths_ts_1 = require("../../services/templatedPaths.js");
|
|
8
|
+
/**
|
|
9
|
+
* Update the general format of a workbook range.
|
|
10
|
+
*
|
|
11
|
+
* @param rangeRef - A reference to the range to be formatted, optionally including session information.
|
|
12
|
+
* @param format - The general format properties to apply to the range.
|
|
13
|
+
* @see https://learn.microsoft.com/en-us/graph/api/rangeformat-update
|
|
14
|
+
*/
|
|
15
|
+
function setWorkbookRangeFormat(rangeRef, format) {
|
|
16
|
+
return (0, graphApi_ts_1.operation)({
|
|
17
|
+
contextId: rangeRef.contextId,
|
|
18
|
+
method: "PATCH",
|
|
19
|
+
path: (0, templatedPaths_ts_1.generatePath)("/sites/{site-id}/drives/{drive-id}/items/{item-id}/workbook/worksheets/{worksheet-id}/range(address='{address}')/format", rangeRef),
|
|
20
|
+
headers: {
|
|
21
|
+
"workbook-session-id": rangeRef.sessionId,
|
|
22
|
+
"content-type": "application/json",
|
|
23
|
+
},
|
|
24
|
+
body: format,
|
|
25
|
+
responseTransform: () => undefined,
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
// /format/font > WorkbookChartFont
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graphApi.d.ts","sourceRoot":"","sources":["../../src/graphApi.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"graphApi.d.ts","sourceRoot":"","sources":["../../src/graphApi.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAgB,cAAc,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AACzG,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAQ/C,eAAO,MAAM,mBAAmB,EAA6C,KAAK,CAAC;AACnF,eAAO,MAAM,QAAQ,qCAAqC,CAAC;AAC3D,eAAO,MAAM,aAAa,4CAAuB,CAAC;AAElD,8KAA8K;AAC9K,wBAAgB,SAAS,CAAC,CAAC,EAAE,UAAU,EAAE,wBAAwB,CAAC,CAAC,CAAC,GAAG,cAAc,CAAC,CAAC,CAAC,CAQvF;AAED,6LAA6L;AAC7L,wBAAsB,QAAQ,CAAC,CAAC,SAAS,cAAc,CAAC,OAAO,CAAC,EAAE,EAAE,GAAG,UAAU,EAAE,CAAC,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,CAInH;AAED,2DAA2D;AAC3D,wBAAsB,UAAU,CAAC,CAAC,SAAS,cAAc,CAAC,OAAO,CAAC,EAAE,EAAE,GAAG,UAAU,EAAE,CAAC,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,CAOrH;AAoBD,KAAK,iBAAiB,CAAC,CAAC,IAAI;KAC1B,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,cAAc,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,KAAK;CAChE,CAAC"}
|
package/dist/esm/graphApi.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import axios from "axios";
|
|
2
2
|
import InconsistentContextError from "./errors/InconsistentContextError.js";
|
|
3
3
|
import InvalidArgumentError from "./errors/InvalidArgumentError.js";
|
|
4
4
|
import NeverError from "./errors/NeverError.js";
|
|
@@ -42,7 +42,7 @@ const consecutiveRetryDelayMultiplier = 2;
|
|
|
42
42
|
async function executeSingle(definition) {
|
|
43
43
|
const context = getContext(definition.contextId);
|
|
44
44
|
const accessToken = await getCurrentAccessToken(context.tenantId, context.clientId, context.clientSecret, authenticationScope);
|
|
45
|
-
const
|
|
45
|
+
const httpAgent = tryGetHttpAgent(context.httpProxy);
|
|
46
46
|
const response = await innerFetch({
|
|
47
47
|
url: `${endpoint}${definition.path}`,
|
|
48
48
|
method: definition.method,
|
|
@@ -50,8 +50,8 @@ async function executeSingle(definition) {
|
|
|
50
50
|
authorization: createAuthorizationHeader(accessToken),
|
|
51
51
|
...headersToObject(definition.headers),
|
|
52
52
|
},
|
|
53
|
-
|
|
54
|
-
|
|
53
|
+
data: definition.body === null ? null : definition.body,
|
|
54
|
+
httpAgent,
|
|
55
55
|
});
|
|
56
56
|
return definition.responseTransform(response);
|
|
57
57
|
}
|
|
@@ -70,7 +70,7 @@ async function executeBatch(...ops) {
|
|
|
70
70
|
}
|
|
71
71
|
const context = getContext(contextId);
|
|
72
72
|
const accessToken = await getCurrentAccessToken(context.tenantId, context.clientId, context.clientSecret, authenticationScope);
|
|
73
|
-
const
|
|
73
|
+
const httpAgent = tryGetHttpAgent(context.httpProxy);
|
|
74
74
|
const body = await innerFetch({
|
|
75
75
|
url: batchEndpoint,
|
|
76
76
|
method: "POST",
|
|
@@ -79,7 +79,7 @@ async function executeBatch(...ops) {
|
|
|
79
79
|
accept: "application/json",
|
|
80
80
|
"content-type": "application/json",
|
|
81
81
|
},
|
|
82
|
-
|
|
82
|
+
data: {
|
|
83
83
|
requests: ops.map((op, index) => ({
|
|
84
84
|
id: operationIndexToId(index),
|
|
85
85
|
method: op.method,
|
|
@@ -88,8 +88,8 @@ async function executeBatch(...ops) {
|
|
|
88
88
|
body: op.body === null ? undefined : op.body,
|
|
89
89
|
dependsOn: op.dependsOn?.map((id) => id.toString()),
|
|
90
90
|
})),
|
|
91
|
-
}
|
|
92
|
-
|
|
91
|
+
},
|
|
92
|
+
httpAgent,
|
|
93
93
|
});
|
|
94
94
|
const responses = [];
|
|
95
95
|
for (const r of body.responses) {
|
|
@@ -114,27 +114,49 @@ async function executeBatch(...ops) {
|
|
|
114
114
|
return responses; // TODO: Is there a neater way to massage the types correctly? This is functionally correct, but I do want to avoid using `unknown` here if possible.
|
|
115
115
|
}
|
|
116
116
|
/** Execute request, supporting GraphAPI retry logic */
|
|
117
|
+
// biome-ignore lint/complexity/noExcessiveCognitiveComplexity: This function does need to be simplified, though it is a TODO for another day
|
|
117
118
|
async function innerFetch(args) {
|
|
118
119
|
const { url, ...options } = args;
|
|
120
|
+
if (!url) {
|
|
121
|
+
throw new Error("URL is required for request");
|
|
122
|
+
}
|
|
119
123
|
let retryAfterMilliseconds = defaultRetryDelayMilliseconds;
|
|
120
124
|
let response = null;
|
|
121
125
|
let attempts = 0; // Track the number of attempts
|
|
126
|
+
const instance = axios.create({
|
|
127
|
+
httpsAgent: options.httpAgent,
|
|
128
|
+
});
|
|
122
129
|
while (attempts < maxRetries) {
|
|
123
130
|
// Retry at most 3 times
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
131
|
+
try {
|
|
132
|
+
response = await instance({
|
|
133
|
+
url,
|
|
134
|
+
...options,
|
|
135
|
+
});
|
|
136
|
+
break; // If successful, exit the loop
|
|
127
137
|
}
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
138
|
+
catch (error) {
|
|
139
|
+
if (axios.isAxiosError(error) && error.response) {
|
|
140
|
+
response = error.response;
|
|
141
|
+
if (!(isHttpTooManyRequests(response.status) || isServiceUnavailable(response.status))) {
|
|
142
|
+
throw error; // Don't retry for other error codes
|
|
143
|
+
}
|
|
144
|
+
const requestedRetryAfterSeconds = Number.parseInt(response.headers["retry-after"] ?? "0", 10);
|
|
145
|
+
if (requestedRetryAfterSeconds) {
|
|
146
|
+
retryAfterMilliseconds = requestedRetryAfterSeconds * 1000;
|
|
147
|
+
}
|
|
148
|
+
await sleep(retryAfterMilliseconds);
|
|
149
|
+
retryAfterMilliseconds *= consecutiveRetryDelayMultiplier;
|
|
150
|
+
attempts++; // Increment the attempt counter
|
|
151
|
+
if (attempts >= maxRetries) {
|
|
152
|
+
RequestFailedError.throw(`GraphAPI fetch exceed retry limit of ${maxRetries} attempts.`, args);
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
else {
|
|
156
|
+
// For non-Axios errors or errors without response, just throw
|
|
157
|
+
throw error;
|
|
158
|
+
}
|
|
131
159
|
}
|
|
132
|
-
await sleep(retryAfterMilliseconds);
|
|
133
|
-
retryAfterMilliseconds *= consecutiveRetryDelayMultiplier;
|
|
134
|
-
attempts++; // Increment the attempt counter
|
|
135
|
-
}
|
|
136
|
-
if (attempts >= maxRetries) {
|
|
137
|
-
RequestFailedError.throw(`GraphAPI fetch exceed retry limit of ${maxRetries} attempts.`, args);
|
|
138
160
|
}
|
|
139
161
|
if (!response) {
|
|
140
162
|
throw new NeverError("Response is null. Should be impossible");
|
|
@@ -142,17 +164,15 @@ async function innerFetch(args) {
|
|
|
142
164
|
if (isHttpTooManyRequests(response.status)) {
|
|
143
165
|
RequestFailedError.throw("GraphAPI fetch failed after 3 retries due to too many requests.", args);
|
|
144
166
|
}
|
|
145
|
-
const replyContentType = response.headers.get("content-type")?.toLowerCase();
|
|
146
|
-
const body = replyContentType?.startsWith("application/json") ? await response.json() : null;
|
|
147
167
|
if (!isHttpOk(response.status)) {
|
|
148
|
-
const bodyError =
|
|
168
|
+
const bodyError = response.data;
|
|
149
169
|
let errorMessage = `${response.status} '${response.statusText}'`;
|
|
150
170
|
if (bodyError?.error) {
|
|
151
171
|
errorMessage += `: [${bodyError.error.code}] '${bodyError.error.message}'`;
|
|
152
172
|
}
|
|
153
|
-
RequestFailedError.throw(`GraphAPI fetch failed: ${errorMessage}`, args,
|
|
173
|
+
RequestFailedError.throw(`GraphAPI fetch failed: ${errorMessage}`, args, response.data);
|
|
154
174
|
}
|
|
155
|
-
return
|
|
175
|
+
return response.data;
|
|
156
176
|
}
|
|
157
177
|
function normalizeBatchBody(contentType, body) {
|
|
158
178
|
if (contentType?.startsWith("application/json") && typeof body === "string") {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getDriveItemContent.d.ts","sourceRoot":"","sources":["../../../../src/operations/driveItem/getDriveItemContent.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"getDriveItemContent.d.ts","sourceRoot":"","sources":["../../../../src/operations/driveItem/getDriveItemContent.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAOjE;;;;;;;GAOG;AACH,wBAA8B,mBAAmB,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,WAAW,CAAC,CAgC7F"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import axios from "axios";
|
|
2
2
|
import { authenticationScope, endpoint } from "../../graphApi.js";
|
|
3
3
|
import { getCurrentAccessToken } from "../../services/accessToken.js";
|
|
4
4
|
import { getContext } from "../../services/context.js";
|
|
5
5
|
import { tryGetHttpAgent } from "../../services/httpAgent.js";
|
|
6
|
+
import { isHttpOk } from "../../services/httpStatus.js";
|
|
6
7
|
import { generatePath } from "../../services/templatedPaths.js";
|
|
7
8
|
/**
|
|
8
9
|
* Download the content of a drive item.
|
|
@@ -17,15 +18,25 @@ export default async function getDriveItemContent(itemRef) {
|
|
|
17
18
|
const url = `${endpoint}${generatePath("/sites/{site-id}/drives/{drive-id}/items/{item-id}/content", itemRef)}`;
|
|
18
19
|
const context = getContext(itemRef.contextId);
|
|
19
20
|
const accessToken = await getCurrentAccessToken(context.tenantId, context.clientId, context.clientSecret, authenticationScope);
|
|
20
|
-
const
|
|
21
|
-
const response = await
|
|
21
|
+
const httpAgent = tryGetHttpAgent(context.httpProxy);
|
|
22
|
+
const response = await axios({
|
|
23
|
+
url,
|
|
24
|
+
method: "GET",
|
|
22
25
|
headers: {
|
|
23
26
|
authorization: `Bearer ${accessToken}`,
|
|
24
27
|
},
|
|
25
|
-
|
|
28
|
+
responseType: "arraybuffer",
|
|
29
|
+
httpsAgent: httpAgent,
|
|
26
30
|
});
|
|
27
|
-
if (!response.
|
|
31
|
+
if (!isHttpOk(response.status)) {
|
|
28
32
|
throw new Error(`Failed to download file: ${response.status} ${response.statusText}`);
|
|
29
33
|
}
|
|
30
|
-
|
|
34
|
+
if (!Buffer.isBuffer(response.data)) {
|
|
35
|
+
throw new Error(`Unexpected response type: ${typeof response.data}`);
|
|
36
|
+
}
|
|
37
|
+
const buffer = response.data.buffer.slice(response.data.byteOffset, response.data.byteOffset + response.data.byteLength);
|
|
38
|
+
if (!(buffer instanceof ArrayBuffer)) {
|
|
39
|
+
throw new Error("Failed to convert Buffer to ArrayBuffer");
|
|
40
|
+
}
|
|
41
|
+
return buffer;
|
|
31
42
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { GraphOperation } from "../../models/GraphOperation.ts";
|
|
2
|
+
import type { WorkbookRangeRef } from "../../models/WorkbookRangeRef.ts";
|
|
3
|
+
/**
|
|
4
|
+
* Auto-fit the columns in a range.
|
|
5
|
+
*
|
|
6
|
+
* @param rangeRef - A reference to the range, optionally including session information.
|
|
7
|
+
* @returns Nothing.
|
|
8
|
+
* @see https://learn.microsoft.com/en-us/graph/api/rangeformat-autofitcolumns
|
|
9
|
+
*/
|
|
10
|
+
export default function autoFitWorkbookRangeColumns(rangeRef: WorkbookRangeRef): GraphOperation<void>;
|
|
11
|
+
//# sourceMappingURL=autoFitWorkbookRangeColumns.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"autoFitWorkbookRangeColumns.d.ts","sourceRoot":"","sources":["../../../../src/operations/workbookRange/autoFitWorkbookRangeColumns.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AAGzE;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,UAAU,2BAA2B,CAAC,QAAQ,EAAE,gBAAgB,GAAG,cAAc,CAAC,IAAI,CAAC,CAWpG"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { operation } from "../../graphApi.js";
|
|
2
|
+
import { generatePath } from "../../services/templatedPaths.js";
|
|
3
|
+
/**
|
|
4
|
+
* Auto-fit the columns in a range.
|
|
5
|
+
*
|
|
6
|
+
* @param rangeRef - A reference to the range, optionally including session information.
|
|
7
|
+
* @returns Nothing.
|
|
8
|
+
* @see https://learn.microsoft.com/en-us/graph/api/rangeformat-autofitcolumns
|
|
9
|
+
*/
|
|
10
|
+
export default function autoFitWorkbookRangeColumns(rangeRef) {
|
|
11
|
+
return operation({
|
|
12
|
+
contextId: rangeRef.contextId,
|
|
13
|
+
method: "POST",
|
|
14
|
+
path: generatePath("/sites/{site-id}/drives/{drive-id}/items/{item-id}/workbook/worksheets/{worksheet-id}/range(address='{address}')/format/autofitcolumns", rangeRef),
|
|
15
|
+
headers: {
|
|
16
|
+
"workbook-session-id": rangeRef.sessionId,
|
|
17
|
+
},
|
|
18
|
+
body: null,
|
|
19
|
+
responseTransform: () => undefined,
|
|
20
|
+
});
|
|
21
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { WorkbookRangeFill } from "@microsoft/microsoft-graph-types";
|
|
2
|
+
import type { GraphOperation } from "../../models/GraphOperation.ts";
|
|
3
|
+
import type { WorkbookRangeRef } from "../../models/WorkbookRangeRef.ts";
|
|
4
|
+
/**
|
|
5
|
+
* Retrieve the fill format of a workbook range.
|
|
6
|
+
*
|
|
7
|
+
* @param rangeRef - A reference to the range, optionally including session information.
|
|
8
|
+
* @returns The fill format of the specified range, including its metadata and reference information.
|
|
9
|
+
* @see https://learn.microsoft.com/en-us/graph/api/rangefill-get
|
|
10
|
+
*/
|
|
11
|
+
export default function getWorkbookRangeFill(rangeRef: WorkbookRangeRef): GraphOperation<WorkbookRangeFill & WorkbookRangeRef>;
|
|
12
|
+
//# sourceMappingURL=getWorkbookRangeFill.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getWorkbookRangeFill.d.ts","sourceRoot":"","sources":["../../../../src/operations/workbookRange/getWorkbookRangeFill.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AAE1E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AAGzE;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,UAAU,oBAAoB,CAAC,QAAQ,EAAE,gBAAgB,GAAG,cAAc,CAAC,iBAAiB,GAAG,gBAAgB,CAAC,CAiB7H"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
// https://learn.microsoft.com/en-us/graph/api/rangefill-get
|
|
2
|
+
import { operation } from "../../graphApi.js";
|
|
3
|
+
import { generatePath } from "../../services/templatedPaths.js";
|
|
4
|
+
/**
|
|
5
|
+
* Retrieve the fill format of a workbook range.
|
|
6
|
+
*
|
|
7
|
+
* @param rangeRef - A reference to the range, optionally including session information.
|
|
8
|
+
* @returns The fill format of the specified range, including its metadata and reference information.
|
|
9
|
+
* @see https://learn.microsoft.com/en-us/graph/api/rangefill-get
|
|
10
|
+
*/
|
|
11
|
+
export default function getWorkbookRangeFill(rangeRef) {
|
|
12
|
+
return operation({
|
|
13
|
+
contextId: rangeRef.contextId,
|
|
14
|
+
method: "GET",
|
|
15
|
+
path: generatePath(`/sites/{site-id}/drives/{drive-id}/items/{item-id}/workbook/worksheets/{worksheet-id}/range(address='${rangeRef.address}')/format/fill`, rangeRef),
|
|
16
|
+
headers: {
|
|
17
|
+
"workbook-session-id": rangeRef.sessionId,
|
|
18
|
+
},
|
|
19
|
+
body: null,
|
|
20
|
+
responseTransform: (response) => {
|
|
21
|
+
const fill = response;
|
|
22
|
+
return {
|
|
23
|
+
...fill,
|
|
24
|
+
...rangeRef,
|
|
25
|
+
};
|
|
26
|
+
},
|
|
27
|
+
});
|
|
28
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { WorkbookRangeFont } from "@microsoft/microsoft-graph-types";
|
|
2
|
+
import type { GraphOperation } from "../../models/GraphOperation.ts";
|
|
3
|
+
import type { WorkbookRangeRef } from "../../models/WorkbookRangeRef.ts";
|
|
4
|
+
/**
|
|
5
|
+
* Retrieve the font format of a workbook range.
|
|
6
|
+
*
|
|
7
|
+
* @param rangeRef - A reference to the range, optionally including session information.
|
|
8
|
+
* @returns The font format of the specified range, including its metadata and reference information.
|
|
9
|
+
* @see https://learn.microsoft.com/en-us/graph/api/rangefont-get
|
|
10
|
+
*/
|
|
11
|
+
export default function getWorkbookRangeFont(rangeRef: WorkbookRangeRef): GraphOperation<WorkbookRangeFont & WorkbookRangeRef>;
|
|
12
|
+
//# sourceMappingURL=getWorkbookRangeFont.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getWorkbookRangeFont.d.ts","sourceRoot":"","sources":["../../../../src/operations/workbookRange/getWorkbookRangeFont.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AAE1E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AAGzE;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,UAAU,oBAAoB,CAAC,QAAQ,EAAE,gBAAgB,GAAG,cAAc,CAAC,iBAAiB,GAAG,gBAAgB,CAAC,CAiB7H"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
// https://learn.microsoft.com/en-us/graph/api/rangefont-get
|
|
2
|
+
import { operation } from "../../graphApi.js";
|
|
3
|
+
import { generatePath } from "../../services/templatedPaths.js";
|
|
4
|
+
/**
|
|
5
|
+
* Retrieve the font format of a workbook range.
|
|
6
|
+
*
|
|
7
|
+
* @param rangeRef - A reference to the range, optionally including session information.
|
|
8
|
+
* @returns The font format of the specified range, including its metadata and reference information.
|
|
9
|
+
* @see https://learn.microsoft.com/en-us/graph/api/rangefont-get
|
|
10
|
+
*/
|
|
11
|
+
export default function getWorkbookRangeFont(rangeRef) {
|
|
12
|
+
return operation({
|
|
13
|
+
contextId: rangeRef.contextId,
|
|
14
|
+
method: "GET",
|
|
15
|
+
path: generatePath(`/sites/{site-id}/drives/{drive-id}/items/{item-id}/workbook/worksheets/{worksheet-id}/range(address='${rangeRef.address}')/format/font`, rangeRef),
|
|
16
|
+
headers: {
|
|
17
|
+
"workbook-session-id": rangeRef.sessionId,
|
|
18
|
+
},
|
|
19
|
+
body: null,
|
|
20
|
+
responseTransform: (response) => {
|
|
21
|
+
const font = response;
|
|
22
|
+
return {
|
|
23
|
+
...font,
|
|
24
|
+
...rangeRef,
|
|
25
|
+
};
|
|
26
|
+
},
|
|
27
|
+
});
|
|
28
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { WorkbookRangeFill } from "@microsoft/microsoft-graph-types";
|
|
2
|
+
import type { GraphOperation } from "../../models/GraphOperation.ts";
|
|
3
|
+
import type { WorkbookRangeRef } from "../../models/WorkbookRangeRef.ts";
|
|
4
|
+
/**
|
|
5
|
+
* Update the fill format of a workbook range.
|
|
6
|
+
*
|
|
7
|
+
* @param rangeRef - A reference to the range to be formatted, optionally including session information.
|
|
8
|
+
* @param format - The fill format properties to apply to the range.
|
|
9
|
+
* @see https://learn.microsoft.com/en-us/graph/api/rangefill-update
|
|
10
|
+
*/
|
|
11
|
+
export default function setWorkbookRangeFill(rangeRef: WorkbookRangeRef, format: WorkbookRangeFill): GraphOperation<void>;
|
|
12
|
+
//# sourceMappingURL=setWorkbookRangeFill.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setWorkbookRangeFill.d.ts","sourceRoot":"","sources":["../../../../src/operations/workbookRange/setWorkbookRangeFill.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AAE1E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AAGzE;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,UAAU,oBAAoB,CAAC,QAAQ,EAAE,gBAAgB,EAAE,MAAM,EAAE,iBAAiB,GAAG,cAAc,CAAC,IAAI,CAAC,CAYxH"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { operation } from "../../graphApi.js";
|
|
2
|
+
import { generatePath } from "../../services/templatedPaths.js";
|
|
3
|
+
/**
|
|
4
|
+
* Update the fill format of a workbook range.
|
|
5
|
+
*
|
|
6
|
+
* @param rangeRef - A reference to the range to be formatted, optionally including session information.
|
|
7
|
+
* @param format - The fill format properties to apply to the range.
|
|
8
|
+
* @see https://learn.microsoft.com/en-us/graph/api/rangefill-update
|
|
9
|
+
*/
|
|
10
|
+
export default function setWorkbookRangeFill(rangeRef, format) {
|
|
11
|
+
return operation({
|
|
12
|
+
contextId: rangeRef.contextId,
|
|
13
|
+
method: "PATCH",
|
|
14
|
+
path: generatePath("/sites/{site-id}/drives/{drive-id}/items/{item-id}/workbook/worksheets/{worksheet-id}/range(address='{address}')/format/fill", rangeRef),
|
|
15
|
+
headers: {
|
|
16
|
+
"workbook-session-id": rangeRef.sessionId,
|
|
17
|
+
"content-type": "application/json",
|
|
18
|
+
},
|
|
19
|
+
body: format,
|
|
20
|
+
responseTransform: () => undefined,
|
|
21
|
+
});
|
|
22
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { WorkbookRangeFont } from "@microsoft/microsoft-graph-types";
|
|
2
|
+
import type { GraphOperation } from "../../models/GraphOperation.ts";
|
|
3
|
+
import type { WorkbookRangeRef } from "../../models/WorkbookRangeRef.ts";
|
|
4
|
+
/**
|
|
5
|
+
* Update the font format of a workbook range.
|
|
6
|
+
*
|
|
7
|
+
* @param rangeRef - A reference to the range to be formatted, optionally including session information.
|
|
8
|
+
* @param format - The font format properties to apply to the range.
|
|
9
|
+
* @see https://learn.microsoft.com/en-us/graph/api/rangefont-update
|
|
10
|
+
*/
|
|
11
|
+
export default function setWorkbookRangeFont(rangeRef: WorkbookRangeRef, format: WorkbookRangeFont): GraphOperation<void>;
|
|
12
|
+
//# sourceMappingURL=setWorkbookRangeFont.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setWorkbookRangeFont.d.ts","sourceRoot":"","sources":["../../../../src/operations/workbookRange/setWorkbookRangeFont.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AAE1E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AAGzE;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,UAAU,oBAAoB,CAAC,QAAQ,EAAE,gBAAgB,EAAE,MAAM,EAAE,iBAAiB,GAAG,cAAc,CAAC,IAAI,CAAC,CAYxH"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { operation } from "../../graphApi.js";
|
|
2
|
+
import { generatePath } from "../../services/templatedPaths.js";
|
|
3
|
+
/**
|
|
4
|
+
* Update the font format of a workbook range.
|
|
5
|
+
*
|
|
6
|
+
* @param rangeRef - A reference to the range to be formatted, optionally including session information.
|
|
7
|
+
* @param format - The font format properties to apply to the range.
|
|
8
|
+
* @see https://learn.microsoft.com/en-us/graph/api/rangefont-update
|
|
9
|
+
*/
|
|
10
|
+
export default function setWorkbookRangeFont(rangeRef, format) {
|
|
11
|
+
return operation({
|
|
12
|
+
contextId: rangeRef.contextId,
|
|
13
|
+
method: "PATCH",
|
|
14
|
+
path: generatePath("/sites/{site-id}/drives/{drive-id}/items/{item-id}/workbook/worksheets/{worksheet-id}/range(address='{address}')/format/font", rangeRef),
|
|
15
|
+
headers: {
|
|
16
|
+
"workbook-session-id": rangeRef.sessionId,
|
|
17
|
+
"content-type": "application/json",
|
|
18
|
+
},
|
|
19
|
+
body: format,
|
|
20
|
+
responseTransform: () => undefined,
|
|
21
|
+
});
|
|
22
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { WorkbookRangeFormat } from "@microsoft/microsoft-graph-types";
|
|
2
|
+
import type { GraphOperation } from "../../models/GraphOperation.ts";
|
|
3
|
+
import type { WorkbookRangeRef } from "../../models/WorkbookRangeRef.ts";
|
|
4
|
+
/**
|
|
5
|
+
* Update the general format of a workbook range.
|
|
6
|
+
*
|
|
7
|
+
* @param rangeRef - A reference to the range to be formatted, optionally including session information.
|
|
8
|
+
* @param format - The general format properties to apply to the range.
|
|
9
|
+
* @see https://learn.microsoft.com/en-us/graph/api/rangeformat-update
|
|
10
|
+
*/
|
|
11
|
+
export default function setWorkbookRangeFormat(rangeRef: WorkbookRangeRef, format: WorkbookRangeFormat): GraphOperation<void>;
|
|
12
|
+
//# sourceMappingURL=setWorkbookRangeFormat.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setWorkbookRangeFormat.d.ts","sourceRoot":"","sources":["../../../../src/operations/workbookRange/setWorkbookRangeFormat.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AAE5E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AAGzE;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,UAAU,sBAAsB,CAAC,QAAQ,EAAE,gBAAgB,EAAE,MAAM,EAAE,mBAAmB,GAAG,cAAc,CAAC,IAAI,CAAC,CAY5H"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// PATCH /sites/{site-id}/drives/{drive-id}/items/{item-id}/workbook/worksheets/{worksheet-id}/range(address='{address}')/format
|
|
2
|
+
// https://learn.microsoft.com/en-us/graph/api/rangeformat-update
|
|
3
|
+
import { operation } from "../../graphApi.js";
|
|
4
|
+
import { generatePath } from "../../services/templatedPaths.js";
|
|
5
|
+
/**
|
|
6
|
+
* Update the general format of a workbook range.
|
|
7
|
+
*
|
|
8
|
+
* @param rangeRef - A reference to the range to be formatted, optionally including session information.
|
|
9
|
+
* @param format - The general format properties to apply to the range.
|
|
10
|
+
* @see https://learn.microsoft.com/en-us/graph/api/rangeformat-update
|
|
11
|
+
*/
|
|
12
|
+
export default function setWorkbookRangeFormat(rangeRef, format) {
|
|
13
|
+
return operation({
|
|
14
|
+
contextId: rangeRef.contextId,
|
|
15
|
+
method: "PATCH",
|
|
16
|
+
path: generatePath("/sites/{site-id}/drives/{drive-id}/items/{item-id}/workbook/worksheets/{worksheet-id}/range(address='{address}')/format", rangeRef),
|
|
17
|
+
headers: {
|
|
18
|
+
"workbook-session-id": rangeRef.sessionId,
|
|
19
|
+
"content-type": "application/json",
|
|
20
|
+
},
|
|
21
|
+
body: format,
|
|
22
|
+
responseTransform: () => undefined,
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
// /format/font > WorkbookChartFont
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "microsoft-graph",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.9.0",
|
|
4
4
|
"description": "Microsoft GraphAPI SDK for NodeJS",
|
|
5
5
|
"main": "./dist/cjs/index.js",
|
|
6
6
|
"module": "./dist/esm/index.js",
|
|
@@ -38,8 +38,8 @@
|
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
40
|
"@azure/identity": "^4.8.0",
|
|
41
|
-
"
|
|
42
|
-
"
|
|
41
|
+
"axios": "^1.7.9",
|
|
42
|
+
"https-proxy-agent": "^7.0.6"
|
|
43
43
|
},
|
|
44
44
|
"exports": {
|
|
45
45
|
".": {
|
|
@@ -382,6 +382,11 @@
|
|
|
382
382
|
"require": "./dist/cjs/operations/workbook/deleteWorkbook.js",
|
|
383
383
|
"types": "./dist/esm/operations/workbook/deleteWorkbook.d.ts"
|
|
384
384
|
},
|
|
385
|
+
"./operations/workbookRange/autoFitWorkbookRangeColumns": {
|
|
386
|
+
"import": "./dist/esm/operations/workbookRange/autoFitWorkbookRangeColumns.js",
|
|
387
|
+
"require": "./dist/cjs/operations/workbookRange/autoFitWorkbookRangeColumns.js",
|
|
388
|
+
"types": "./dist/esm/operations/workbookRange/autoFitWorkbookRangeColumns.d.ts"
|
|
389
|
+
},
|
|
385
390
|
"./operations/workbookRange/clearWorkbookRange": {
|
|
386
391
|
"import": "./dist/esm/operations/workbookRange/clearWorkbookRange.js",
|
|
387
392
|
"require": "./dist/cjs/operations/workbookRange/clearWorkbookRange.js",
|
|
@@ -397,6 +402,16 @@
|
|
|
397
402
|
"require": "./dist/cjs/operations/workbookRange/getWorkbookNamedRange.js",
|
|
398
403
|
"types": "./dist/esm/operations/workbookRange/getWorkbookNamedRange.d.ts"
|
|
399
404
|
},
|
|
405
|
+
"./operations/workbookRange/getWorkbookRangeFill": {
|
|
406
|
+
"import": "./dist/esm/operations/workbookRange/getWorkbookRangeFill.js",
|
|
407
|
+
"require": "./dist/cjs/operations/workbookRange/getWorkbookRangeFill.js",
|
|
408
|
+
"types": "./dist/esm/operations/workbookRange/getWorkbookRangeFill.d.ts"
|
|
409
|
+
},
|
|
410
|
+
"./operations/workbookRange/getWorkbookRangeFont": {
|
|
411
|
+
"import": "./dist/esm/operations/workbookRange/getWorkbookRangeFont.js",
|
|
412
|
+
"require": "./dist/cjs/operations/workbookRange/getWorkbookRangeFont.js",
|
|
413
|
+
"types": "./dist/esm/operations/workbookRange/getWorkbookRangeFont.d.ts"
|
|
414
|
+
},
|
|
400
415
|
"./operations/workbookRange/getWorkbookRangeFormat": {
|
|
401
416
|
"import": "./dist/esm/operations/workbookRange/getWorkbookRangeFormat.js",
|
|
402
417
|
"require": "./dist/cjs/operations/workbookRange/getWorkbookRangeFormat.js",
|
|
@@ -422,6 +437,21 @@
|
|
|
422
437
|
"require": "./dist/cjs/operations/workbookRange/insertWorkbookCells.js",
|
|
423
438
|
"types": "./dist/esm/operations/workbookRange/insertWorkbookCells.d.ts"
|
|
424
439
|
},
|
|
440
|
+
"./operations/workbookRange/setWorkbookRangeFill": {
|
|
441
|
+
"import": "./dist/esm/operations/workbookRange/setWorkbookRangeFill.js",
|
|
442
|
+
"require": "./dist/cjs/operations/workbookRange/setWorkbookRangeFill.js",
|
|
443
|
+
"types": "./dist/esm/operations/workbookRange/setWorkbookRangeFill.d.ts"
|
|
444
|
+
},
|
|
445
|
+
"./operations/workbookRange/setWorkbookRangeFont": {
|
|
446
|
+
"import": "./dist/esm/operations/workbookRange/setWorkbookRangeFont.js",
|
|
447
|
+
"require": "./dist/cjs/operations/workbookRange/setWorkbookRangeFont.js",
|
|
448
|
+
"types": "./dist/esm/operations/workbookRange/setWorkbookRangeFont.d.ts"
|
|
449
|
+
},
|
|
450
|
+
"./operations/workbookRange/setWorkbookRangeFormat": {
|
|
451
|
+
"import": "./dist/esm/operations/workbookRange/setWorkbookRangeFormat.js",
|
|
452
|
+
"require": "./dist/cjs/operations/workbookRange/setWorkbookRangeFormat.js",
|
|
453
|
+
"types": "./dist/esm/operations/workbookRange/setWorkbookRangeFormat.d.ts"
|
|
454
|
+
},
|
|
425
455
|
"./operations/workbookRange/updateWorkbookNamedRange": {
|
|
426
456
|
"import": "./dist/esm/operations/workbookRange/updateWorkbookNamedRange.js",
|
|
427
457
|
"require": "./dist/cjs/operations/workbookRange/updateWorkbookNamedRange.js",
|
|
@@ -1052,6 +1082,11 @@
|
|
|
1052
1082
|
"import": "./dist/esm/operations/workbook/deleteWorkbook.js",
|
|
1053
1083
|
"types": "./dist/esm/operations/workbook/deleteWorkbook.d.ts"
|
|
1054
1084
|
},
|
|
1085
|
+
"./dist/cjs/operations/workbookRange/autoFitWorkbookRangeColumns.js": {
|
|
1086
|
+
"require": "./dist/cjs/operations/workbookRange/autoFitWorkbookRangeColumns.js",
|
|
1087
|
+
"import": "./dist/esm/operations/workbookRange/autoFitWorkbookRangeColumns.js",
|
|
1088
|
+
"types": "./dist/esm/operations/workbookRange/autoFitWorkbookRangeColumns.d.ts"
|
|
1089
|
+
},
|
|
1055
1090
|
"./dist/cjs/operations/workbookRange/clearWorkbookRange.js": {
|
|
1056
1091
|
"require": "./dist/cjs/operations/workbookRange/clearWorkbookRange.js",
|
|
1057
1092
|
"import": "./dist/esm/operations/workbookRange/clearWorkbookRange.js",
|
|
@@ -1067,6 +1102,16 @@
|
|
|
1067
1102
|
"import": "./dist/esm/operations/workbookRange/getWorkbookNamedRange.js",
|
|
1068
1103
|
"types": "./dist/esm/operations/workbookRange/getWorkbookNamedRange.d.ts"
|
|
1069
1104
|
},
|
|
1105
|
+
"./dist/cjs/operations/workbookRange/getWorkbookRangeFill.js": {
|
|
1106
|
+
"require": "./dist/cjs/operations/workbookRange/getWorkbookRangeFill.js",
|
|
1107
|
+
"import": "./dist/esm/operations/workbookRange/getWorkbookRangeFill.js",
|
|
1108
|
+
"types": "./dist/esm/operations/workbookRange/getWorkbookRangeFill.d.ts"
|
|
1109
|
+
},
|
|
1110
|
+
"./dist/cjs/operations/workbookRange/getWorkbookRangeFont.js": {
|
|
1111
|
+
"require": "./dist/cjs/operations/workbookRange/getWorkbookRangeFont.js",
|
|
1112
|
+
"import": "./dist/esm/operations/workbookRange/getWorkbookRangeFont.js",
|
|
1113
|
+
"types": "./dist/esm/operations/workbookRange/getWorkbookRangeFont.d.ts"
|
|
1114
|
+
},
|
|
1070
1115
|
"./dist/cjs/operations/workbookRange/getWorkbookRangeFormat.js": {
|
|
1071
1116
|
"require": "./dist/cjs/operations/workbookRange/getWorkbookRangeFormat.js",
|
|
1072
1117
|
"import": "./dist/esm/operations/workbookRange/getWorkbookRangeFormat.js",
|
|
@@ -1092,6 +1137,21 @@
|
|
|
1092
1137
|
"import": "./dist/esm/operations/workbookRange/insertWorkbookCells.js",
|
|
1093
1138
|
"types": "./dist/esm/operations/workbookRange/insertWorkbookCells.d.ts"
|
|
1094
1139
|
},
|
|
1140
|
+
"./dist/cjs/operations/workbookRange/setWorkbookRangeFill.js": {
|
|
1141
|
+
"require": "./dist/cjs/operations/workbookRange/setWorkbookRangeFill.js",
|
|
1142
|
+
"import": "./dist/esm/operations/workbookRange/setWorkbookRangeFill.js",
|
|
1143
|
+
"types": "./dist/esm/operations/workbookRange/setWorkbookRangeFill.d.ts"
|
|
1144
|
+
},
|
|
1145
|
+
"./dist/cjs/operations/workbookRange/setWorkbookRangeFont.js": {
|
|
1146
|
+
"require": "./dist/cjs/operations/workbookRange/setWorkbookRangeFont.js",
|
|
1147
|
+
"import": "./dist/esm/operations/workbookRange/setWorkbookRangeFont.js",
|
|
1148
|
+
"types": "./dist/esm/operations/workbookRange/setWorkbookRangeFont.d.ts"
|
|
1149
|
+
},
|
|
1150
|
+
"./dist/cjs/operations/workbookRange/setWorkbookRangeFormat.js": {
|
|
1151
|
+
"require": "./dist/cjs/operations/workbookRange/setWorkbookRangeFormat.js",
|
|
1152
|
+
"import": "./dist/esm/operations/workbookRange/setWorkbookRangeFormat.js",
|
|
1153
|
+
"types": "./dist/esm/operations/workbookRange/setWorkbookRangeFormat.d.ts"
|
|
1154
|
+
},
|
|
1095
1155
|
"./dist/cjs/operations/workbookRange/updateWorkbookNamedRange.js": {
|
|
1096
1156
|
"require": "./dist/cjs/operations/workbookRange/updateWorkbookNamedRange.js",
|
|
1097
1157
|
"import": "./dist/esm/operations/workbookRange/updateWorkbookNamedRange.js",
|