microsoft-graph 2.35.0 → 2.36.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/.vscode/settings.json +8 -1
- package/dist/cjs/errors/BadRequestError.d.ts +9 -0
- package/dist/cjs/errors/BadRequestError.d.ts.map +1 -0
- package/dist/cjs/errors/BadRequestError.js +14 -0
- package/dist/cjs/errors/BandwidthLimitExceededError.d.ts +9 -0
- package/dist/cjs/errors/BandwidthLimitExceededError.d.ts.map +1 -0
- package/dist/cjs/errors/BandwidthLimitExceededError.js +14 -0
- package/dist/cjs/errors/ConflictError.d.ts +10 -0
- package/dist/cjs/errors/ConflictError.d.ts.map +1 -0
- package/dist/cjs/errors/ConflictError.js +15 -0
- package/dist/cjs/errors/ForbiddenError.d.ts +11 -0
- package/dist/cjs/errors/ForbiddenError.d.ts.map +1 -0
- package/dist/cjs/errors/ForbiddenError.js +16 -0
- package/dist/cjs/errors/GatewayTimeoutError.d.ts +9 -0
- package/dist/cjs/errors/GatewayTimeoutError.d.ts.map +1 -0
- package/dist/cjs/errors/GatewayTimeoutError.js +14 -0
- package/dist/cjs/errors/GoneError.d.ts +9 -0
- package/dist/cjs/errors/GoneError.d.ts.map +1 -0
- package/dist/cjs/errors/GoneError.js +14 -0
- package/dist/cjs/errors/InsufficientStorageError.d.ts +9 -0
- package/dist/cjs/errors/InsufficientStorageError.d.ts.map +1 -0
- package/dist/cjs/errors/InsufficientStorageError.js +14 -0
- package/dist/cjs/errors/InternalServerError.d.ts +9 -0
- package/dist/cjs/errors/InternalServerError.d.ts.map +1 -0
- package/dist/cjs/errors/InternalServerError.js +14 -0
- package/dist/cjs/errors/LengthRequiredError.d.ts +9 -0
- package/dist/cjs/errors/LengthRequiredError.d.ts.map +1 -0
- package/dist/cjs/errors/LengthRequiredError.js +14 -0
- package/dist/cjs/errors/LockedError.d.ts +9 -0
- package/dist/cjs/errors/LockedError.d.ts.map +1 -0
- package/dist/cjs/errors/LockedError.js +14 -0
- package/dist/cjs/errors/MethodNotAllowedError.d.ts +9 -0
- package/dist/cjs/errors/MethodNotAllowedError.d.ts.map +1 -0
- package/dist/cjs/errors/MethodNotAllowedError.js +14 -0
- package/dist/cjs/errors/NotAcceptableError.d.ts +9 -0
- package/dist/cjs/errors/NotAcceptableError.d.ts.map +1 -0
- package/dist/cjs/errors/NotAcceptableError.js +14 -0
- package/dist/cjs/errors/PaymentRequiredError.d.ts +9 -0
- package/dist/cjs/errors/PaymentRequiredError.d.ts.map +1 -0
- package/dist/cjs/errors/PaymentRequiredError.js +14 -0
- package/dist/cjs/errors/PreconditionFailedError.d.ts +9 -0
- package/dist/cjs/errors/PreconditionFailedError.d.ts.map +1 -0
- package/dist/cjs/errors/PreconditionFailedError.js +14 -0
- package/dist/cjs/errors/RequestEntityTooLargeError.d.ts +9 -0
- package/dist/cjs/errors/RequestEntityTooLargeError.d.ts.map +1 -0
- package/dist/cjs/errors/RequestEntityTooLargeError.js +14 -0
- package/dist/cjs/errors/RequestFailedError.d.ts +1 -2
- package/dist/cjs/errors/RequestFailedError.d.ts.map +1 -1
- package/dist/cjs/errors/RequestFailedError.js +1 -8
- package/dist/cjs/errors/RequestedRangeNotSatisfiableError.d.ts +9 -0
- package/dist/cjs/errors/RequestedRangeNotSatisfiableError.d.ts.map +1 -0
- package/dist/cjs/errors/RequestedRangeNotSatisfiableError.js +14 -0
- package/dist/cjs/errors/ServiceUnavailableError.d.ts +9 -0
- package/dist/cjs/errors/ServiceUnavailableError.d.ts.map +1 -0
- package/dist/cjs/errors/ServiceUnavailableError.js +14 -0
- package/dist/cjs/errors/TooManyRequestsError.d.ts +9 -0
- package/dist/cjs/errors/TooManyRequestsError.d.ts.map +1 -0
- package/dist/cjs/errors/TooManyRequestsError.js +14 -0
- package/dist/cjs/errors/UnauthorizedError.d.ts +9 -0
- package/dist/cjs/errors/UnauthorizedError.d.ts.map +1 -0
- package/dist/cjs/errors/UnauthorizedError.js +14 -0
- package/dist/cjs/errors/UnprocessableEntityError.d.ts +9 -0
- package/dist/cjs/errors/UnprocessableEntityError.d.ts.map +1 -0
- package/dist/cjs/errors/UnprocessableEntityError.js +14 -0
- package/dist/cjs/errors/UnsupportedMediaTypeError.d.ts +9 -0
- package/dist/cjs/errors/UnsupportedMediaTypeError.d.ts.map +1 -0
- package/dist/cjs/errors/UnsupportedMediaTypeError.js +14 -0
- package/dist/cjs/operations/driveItem/getDriveItemByPath.d.ts.map +1 -1
- package/dist/cjs/operations/driveItem/getDriveItemByPath.js +7 -0
- package/dist/cjs/operations/driveItem/getDriveItemContent.js +1 -1
- package/dist/cjs/operations/driveItem/streamDriveItemContent.d.ts.map +1 -1
- package/dist/cjs/operations/driveItem/streamDriveItemContent.js +4 -0
- package/dist/cjs/services/drive.d.ts +0 -2
- package/dist/cjs/services/drive.d.ts.map +1 -1
- package/dist/cjs/services/drive.js +3 -8
- package/dist/cjs/services/httpStatus.d.ts +130 -3
- package/dist/cjs/services/httpStatus.d.ts.map +1 -1
- package/dist/cjs/services/httpStatus.js +206 -6
- package/dist/cjs/services/operationInvoker.d.ts +20 -3
- package/dist/cjs/services/operationInvoker.d.ts.map +1 -1
- package/dist/cjs/services/operationInvoker.js +192 -57
- package/dist/esm/errors/BadRequestError.d.ts +9 -0
- package/dist/esm/errors/BadRequestError.d.ts.map +1 -0
- package/dist/esm/errors/BadRequestError.js +11 -0
- package/dist/esm/errors/BandwidthLimitExceededError.d.ts +9 -0
- package/dist/esm/errors/BandwidthLimitExceededError.d.ts.map +1 -0
- package/dist/esm/errors/BandwidthLimitExceededError.js +11 -0
- package/dist/esm/errors/ConflictError.d.ts +10 -0
- package/dist/esm/errors/ConflictError.d.ts.map +1 -0
- package/dist/esm/errors/ConflictError.js +12 -0
- package/dist/esm/errors/ForbiddenError.d.ts +11 -0
- package/dist/esm/errors/ForbiddenError.d.ts.map +1 -0
- package/dist/esm/errors/ForbiddenError.js +13 -0
- package/dist/esm/errors/GatewayTimeoutError.d.ts +9 -0
- package/dist/esm/errors/GatewayTimeoutError.d.ts.map +1 -0
- package/dist/esm/errors/GatewayTimeoutError.js +11 -0
- package/dist/esm/errors/GoneError.d.ts +9 -0
- package/dist/esm/errors/GoneError.d.ts.map +1 -0
- package/dist/esm/errors/GoneError.js +11 -0
- package/dist/esm/errors/InsufficientStorageError.d.ts +9 -0
- package/dist/esm/errors/InsufficientStorageError.d.ts.map +1 -0
- package/dist/esm/errors/InsufficientStorageError.js +11 -0
- package/dist/esm/errors/InternalServerError.d.ts +9 -0
- package/dist/esm/errors/InternalServerError.d.ts.map +1 -0
- package/dist/esm/errors/InternalServerError.js +11 -0
- package/dist/esm/errors/LengthRequiredError.d.ts +9 -0
- package/dist/esm/errors/LengthRequiredError.d.ts.map +1 -0
- package/dist/esm/errors/LengthRequiredError.js +11 -0
- package/dist/esm/errors/LockedError.d.ts +9 -0
- package/dist/esm/errors/LockedError.d.ts.map +1 -0
- package/dist/esm/errors/LockedError.js +11 -0
- package/dist/esm/errors/MethodNotAllowedError.d.ts +9 -0
- package/dist/esm/errors/MethodNotAllowedError.d.ts.map +1 -0
- package/dist/esm/errors/MethodNotAllowedError.js +11 -0
- package/dist/esm/errors/NotAcceptableError.d.ts +9 -0
- package/dist/esm/errors/NotAcceptableError.d.ts.map +1 -0
- package/dist/esm/errors/NotAcceptableError.js +11 -0
- package/dist/esm/errors/PaymentRequiredError.d.ts +9 -0
- package/dist/esm/errors/PaymentRequiredError.d.ts.map +1 -0
- package/dist/esm/errors/PaymentRequiredError.js +11 -0
- package/dist/esm/errors/PreconditionFailedError.d.ts +9 -0
- package/dist/esm/errors/PreconditionFailedError.d.ts.map +1 -0
- package/dist/esm/errors/PreconditionFailedError.js +11 -0
- package/dist/esm/errors/RequestEntityTooLargeError.d.ts +9 -0
- package/dist/esm/errors/RequestEntityTooLargeError.d.ts.map +1 -0
- package/dist/esm/errors/RequestEntityTooLargeError.js +11 -0
- package/dist/esm/errors/RequestFailedError.d.ts +1 -2
- package/dist/esm/errors/RequestFailedError.d.ts.map +1 -1
- package/dist/esm/errors/RequestFailedError.js +1 -8
- package/dist/esm/errors/RequestedRangeNotSatisfiableError.d.ts +9 -0
- package/dist/esm/errors/RequestedRangeNotSatisfiableError.d.ts.map +1 -0
- package/dist/esm/errors/RequestedRangeNotSatisfiableError.js +11 -0
- package/dist/esm/errors/ServiceUnavailableError.d.ts +9 -0
- package/dist/esm/errors/ServiceUnavailableError.d.ts.map +1 -0
- package/dist/esm/errors/ServiceUnavailableError.js +11 -0
- package/dist/esm/errors/TooManyRequestsError.d.ts +9 -0
- package/dist/esm/errors/TooManyRequestsError.d.ts.map +1 -0
- package/dist/esm/errors/TooManyRequestsError.js +11 -0
- package/dist/esm/errors/UnauthorizedError.d.ts +9 -0
- package/dist/esm/errors/UnauthorizedError.d.ts.map +1 -0
- package/dist/esm/errors/UnauthorizedError.js +11 -0
- package/dist/esm/errors/UnprocessableEntityError.d.ts +9 -0
- package/dist/esm/errors/UnprocessableEntityError.d.ts.map +1 -0
- package/dist/esm/errors/UnprocessableEntityError.js +11 -0
- package/dist/esm/errors/UnsupportedMediaTypeError.d.ts +9 -0
- package/dist/esm/errors/UnsupportedMediaTypeError.d.ts.map +1 -0
- package/dist/esm/errors/UnsupportedMediaTypeError.js +11 -0
- package/dist/esm/operations/driveItem/getDriveItemByPath.d.ts.map +1 -1
- package/dist/esm/operations/driveItem/getDriveItemByPath.js +4 -0
- package/dist/esm/operations/driveItem/getDriveItemContent.js +2 -2
- package/dist/esm/operations/driveItem/streamDriveItemContent.d.ts.map +1 -1
- package/dist/esm/operations/driveItem/streamDriveItemContent.js +5 -1
- package/dist/esm/services/drive.d.ts +0 -2
- package/dist/esm/services/drive.d.ts.map +1 -1
- package/dist/esm/services/drive.js +4 -9
- package/dist/esm/services/httpStatus.d.ts +130 -3
- package/dist/esm/services/httpStatus.d.ts.map +1 -1
- package/dist/esm/services/httpStatus.js +182 -3
- package/dist/esm/services/operationInvoker.d.ts +20 -3
- package/dist/esm/services/operationInvoker.d.ts.map +1 -1
- package/dist/esm/services/operationInvoker.js +192 -58
- package/docs/api/BadRequestError.md +191 -0
- package/docs/api/BandwidthLimitExceededError.md +191 -0
- package/docs/api/ConflictError.md +195 -0
- package/docs/api/ForbiddenError.md +193 -0
- package/docs/api/GatewayTimeoutError.md +191 -0
- package/docs/api/GoneError.md +191 -0
- package/docs/api/InsufficientStorageError.md +191 -0
- package/docs/api/InternalServerError.md +191 -0
- package/docs/api/LengthRequiredError.md +191 -0
- package/docs/api/LockedError.md +191 -0
- package/docs/api/MethodNotAllowedError.md +191 -0
- package/docs/api/NotAcceptableError.md +191 -0
- package/docs/api/PaymentRequiredError.md +191 -0
- package/docs/api/PreconditionFailedError.md +191 -0
- package/docs/api/README.md +22 -1
- package/docs/api/RequestEntityTooLargeError.md +191 -0
- package/docs/api/RequestFailedError.md +1 -19
- package/docs/api/RequestedRangeNotSatisfiableError.md +191 -0
- package/docs/api/ServiceUnavailableError.md +191 -0
- package/docs/api/TooManyRequestsError.md +191 -0
- package/docs/api/UnauthorizedError.md +191 -0
- package/docs/api/UnprocessableEntityError.md +191 -0
- package/docs/api/UnsupportedMediaTypeError.md +191 -0
- package/docs/api/drive.md +20 -0
- package/docs/api/getDriveItemByPath.md +1 -1
- package/docs/api/httpStatus.md +475 -12
- package/docs/api/operationInvoker.md +50 -27
- package/docs/api/streamDriveItemContent.md +1 -1
- package/package.json +526 -1
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Can't process the request because it is semantically incorrect.
|
|
3
|
+
* @module UnprocessableEntityError
|
|
4
|
+
* @category Errors
|
|
5
|
+
*/
|
|
6
|
+
export default class UnprocessableEntityError extends Error {
|
|
7
|
+
constructor(message: string);
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=UnprocessableEntityError.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UnprocessableEntityError.d.ts","sourceRoot":"","sources":["../../../src/errors/UnprocessableEntityError.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,CAAC,OAAO,OAAO,wBAAyB,SAAQ,KAAK;gBACvC,OAAO,EAAE,MAAM;CAIlC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
/**
|
|
4
|
+
* Can't process the request because it is semantically incorrect.
|
|
5
|
+
* @module UnprocessableEntityError
|
|
6
|
+
* @category Errors
|
|
7
|
+
*/
|
|
8
|
+
class UnprocessableEntityError extends Error {
|
|
9
|
+
constructor(message) {
|
|
10
|
+
super(message);
|
|
11
|
+
this.name = "UnprocessableEntityError";
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
exports.default = UnprocessableEntityError;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The content type of the request is a format that isn't supported by the service.
|
|
3
|
+
* @module UnsupportedMediaTypeError
|
|
4
|
+
* @category Errors
|
|
5
|
+
*/
|
|
6
|
+
export default class UnsupportedMediaTypeError extends Error {
|
|
7
|
+
constructor(message: string);
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=UnsupportedMediaTypeError.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UnsupportedMediaTypeError.d.ts","sourceRoot":"","sources":["../../../src/errors/UnsupportedMediaTypeError.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,CAAC,OAAO,OAAO,yBAA0B,SAAQ,KAAK;gBACxC,OAAO,EAAE,MAAM;CAIlC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
/**
|
|
4
|
+
* The content type of the request is a format that isn't supported by the service.
|
|
5
|
+
* @module UnsupportedMediaTypeError
|
|
6
|
+
* @category Errors
|
|
7
|
+
*/
|
|
8
|
+
class UnsupportedMediaTypeError extends Error {
|
|
9
|
+
constructor(message) {
|
|
10
|
+
super(message);
|
|
11
|
+
this.name = "UnsupportedMediaTypeError";
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
exports.default = UnsupportedMediaTypeError;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getDriveItemByPath.d.ts","sourceRoot":"","sources":["../../../../src/operations/driveItem/getDriveItemByPath.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kCAAkC,CAAC;
|
|
1
|
+
{"version":3,"file":"getDriveItemByPath.d.ts","sourceRoot":"","sources":["../../../../src/operations/driveItem/getDriveItemByPath.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kCAAkC,CAAC;AAElE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,KAAK,EAAe,aAAa,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAC1F,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAKrE;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,UAAU,kBAAkB,CAAC,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,aAAa,GAAG,cAAc,CAAC,SAAS,GAAG,YAAY,CAAC,CAqBhI"}
|
|
@@ -4,8 +4,12 @@
|
|
|
4
4
|
* @module getDriveItemByPath
|
|
5
5
|
* @category Operations
|
|
6
6
|
*/
|
|
7
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
8
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
9
|
+
};
|
|
7
10
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
11
|
exports.default = getDriveItemByPath;
|
|
12
|
+
const InvalidArgumentError_ts_1 = __importDefault(require("../../errors/InvalidArgumentError.js"));
|
|
9
13
|
const driveItem_ts_1 = require("../../services/driveItem.js");
|
|
10
14
|
const operationInvoker_ts_1 = require("../../services/operationInvoker.js");
|
|
11
15
|
const templatedPaths_ts_1 = require("../../services/templatedPaths.js");
|
|
@@ -17,6 +21,9 @@ const templatedPaths_ts_1 = require("../../services/templatedPaths.js");
|
|
|
17
21
|
* @see https://learn.microsoft.com/en-us/graph/api/driveitem-get
|
|
18
22
|
*/
|
|
19
23
|
function getDriveItemByPath(driveRef, itemPath) {
|
|
24
|
+
if (!itemPath.startsWith("/")) {
|
|
25
|
+
throw new InvalidArgumentError_ts_1.default("itemPath must start with a forward slash (/)");
|
|
26
|
+
}
|
|
20
27
|
return (0, operationInvoker_ts_1.operation)({
|
|
21
28
|
context: driveRef.context,
|
|
22
29
|
method: "GET",
|
|
@@ -34,7 +34,7 @@ async function getDriveItemContent(itemRef) {
|
|
|
34
34
|
responseType: "arraybuffer",
|
|
35
35
|
});
|
|
36
36
|
if (!(0, httpStatus_ts_1.isHttpSuccess)(response.status)) {
|
|
37
|
-
|
|
37
|
+
(0, operationInvoker_ts_1.throwException)(response.status, "Failed to get content");
|
|
38
38
|
}
|
|
39
39
|
if (!Buffer.isBuffer(response.data)) {
|
|
40
40
|
throw new Error(`Unexpected response type: ${typeof response.data}`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"streamDriveItemContent.d.ts","sourceRoot":"","sources":["../../../../src/operations/driveItem/streamDriveItemContent.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"streamDriveItemContent.d.ts","sourceRoot":"","sources":["../../../../src/operations/driveItem/streamDriveItemContent.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAM9D;;;;;;;GAOG;AACH,wBAA8B,sBAAsB,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,MAAM,CAAC,cAAc,CAAC,CAsB1G"}
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
8
|
exports.default = streamDriveItemContent;
|
|
9
9
|
const http_ts_1 = require("../../services/http.js");
|
|
10
|
+
const httpStatus_ts_1 = require("../../services/httpStatus.js");
|
|
10
11
|
const operationInvoker_ts_1 = require("../../services/operationInvoker.js");
|
|
11
12
|
const templatedPaths_ts_1 = require("../../services/templatedPaths.js");
|
|
12
13
|
/**
|
|
@@ -28,6 +29,9 @@ async function streamDriveItemContent(itemRef) {
|
|
|
28
29
|
},
|
|
29
30
|
responseType: "stream",
|
|
30
31
|
});
|
|
32
|
+
if (!(0, httpStatus_ts_1.isHttpSuccess)(response.status)) {
|
|
33
|
+
(0, operationInvoker_ts_1.throwException)(response.status, "Failed to stream content");
|
|
34
|
+
}
|
|
31
35
|
if (!response || typeof response.data?.pipe !== "function") {
|
|
32
36
|
throw new Error("Failed to get a streamable response");
|
|
33
37
|
}
|
|
@@ -20,8 +20,6 @@ export declare function createClientSecretContextWithDriveRef(tenantId: AzureTen
|
|
|
20
20
|
* Retrieves the opinionated default drive reference. NOT RECOMMENDED FOR PRODUCTION USE.
|
|
21
21
|
* @returns A reference to the default drive.
|
|
22
22
|
* @remarks This method is opinionated and not recommended for production use.
|
|
23
|
-
* @deprecated Use `createClientSecretContextWithDriveRef()` instead.
|
|
24
|
-
* @hidden
|
|
25
23
|
*/
|
|
26
24
|
export declare function getDefaultDriveRef(): DriveRef;
|
|
27
25
|
//# sourceMappingURL=drive.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"drive.d.ts","sourceRoot":"","sources":["../../../src/services/drive.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,aAAa,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,0CAA0C,CAAC;AAChH,OAAO,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAKzD;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,GAAG,SAAS,GAAG,QAAQ,CAUvF;AAED,qDAAqD;AACrD,wBAAgB,qCAAqC,CAAC,QAAQ,EAAE,aAAa,EAAE,QAAQ,EAAE,aAAa,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,QAAQ,CAKnL;AAED
|
|
1
|
+
{"version":3,"file":"drive.d.ts","sourceRoot":"","sources":["../../../src/services/drive.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,aAAa,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,0CAA0C,CAAC;AAChH,OAAO,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAKzD;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,GAAG,SAAS,GAAG,QAAQ,CAUvF;AAED,qDAAqD;AACrD,wBAAgB,qCAAqC,CAAC,QAAQ,EAAE,aAAa,EAAE,QAAQ,EAAE,aAAa,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,QAAQ,CAKnL;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,IAAI,QAAQ,CAS7C"}
|
|
@@ -43,16 +43,11 @@ function createClientSecretContextWithDriveRef(tenantId, clientId, clientSecret,
|
|
|
43
43
|
* Retrieves the opinionated default drive reference. NOT RECOMMENDED FOR PRODUCTION USE.
|
|
44
44
|
* @returns A reference to the default drive.
|
|
45
45
|
* @remarks This method is opinionated and not recommended for production use.
|
|
46
|
-
* @deprecated Use `createClientSecretContextWithDriveRef()` instead.
|
|
47
|
-
* @hidden
|
|
48
46
|
*/
|
|
49
47
|
function getDefaultDriveRef() {
|
|
50
|
-
const
|
|
51
|
-
const
|
|
52
|
-
const
|
|
53
|
-
const siteId = (0, environmentVariable_ts_1.getEnvironmentVariable)("SHAREPOINT_DEFAULT_SITE_ID");
|
|
54
|
-
const driveId = (0, environmentVariable_ts_1.getEnvironmentVariable)("SHAREPOINT_DEFAULT_DRIVE_ID");
|
|
55
|
-
const contextRef = (0, context_ts_1.register)(tenantId, clientId, clientSecret);
|
|
48
|
+
const contextRef = (0, context_ts_1.createDefaultClientSecretContext)();
|
|
49
|
+
const siteId = (0, environmentVariable_ts_1.getEnvironmentVariable)("SHAREPOINT_SITE_ID");
|
|
50
|
+
const driveId = (0, environmentVariable_ts_1.getEnvironmentVariable)("SHAREPOINT_DRIVE_ID");
|
|
56
51
|
const siteRef = (0, site_ts_1.createSiteRef)(contextRef, siteId);
|
|
57
52
|
const driveRef = createDriveRef(siteRef, driveId);
|
|
58
53
|
return driveRef;
|
|
@@ -32,17 +32,144 @@ export declare function isHttpTooManyRequests(status: number): boolean;
|
|
|
32
32
|
* @param status - The HTTP status code.
|
|
33
33
|
* @returns True if the status code is 503, otherwise false.
|
|
34
34
|
*/
|
|
35
|
-
export declare function
|
|
35
|
+
export declare function isHttpServiceUnavailable(status: number): boolean;
|
|
36
36
|
/**
|
|
37
37
|
* Checks if the HTTP status code indicates a gateway has timed out.
|
|
38
38
|
* @param status - The HTTP status code.
|
|
39
39
|
* @returns True if the status code is 504, otherwise false.
|
|
40
40
|
*/
|
|
41
|
-
export declare function
|
|
41
|
+
export declare function isHttpGatewayTimeout(status: number): boolean;
|
|
42
42
|
/**
|
|
43
43
|
* Checks if the HTTP status code indicates the resource is locked
|
|
44
44
|
* @param status - The HTTP status code.
|
|
45
45
|
* @returns True if the status code is 423, otherwise false.
|
|
46
46
|
*/
|
|
47
|
-
export declare function
|
|
47
|
+
export declare function isHttpLocked(status: number): boolean;
|
|
48
|
+
/**
|
|
49
|
+
* Checks if the HTTP status code indicates a bad request.
|
|
50
|
+
* @param status - The HTTP status code.
|
|
51
|
+
* @returns True if the status code is 400, otherwise false.
|
|
52
|
+
*/
|
|
53
|
+
export declare function isHttpBadRequest(status: number): boolean;
|
|
54
|
+
/**
|
|
55
|
+
* Checks if the HTTP status code indicates unauthorized access.
|
|
56
|
+
* @param status - The HTTP status code.
|
|
57
|
+
* @returns True if the status code is 401, otherwise false.
|
|
58
|
+
*/
|
|
59
|
+
export declare function isHttpUnauthorized(status: number): boolean;
|
|
60
|
+
/**
|
|
61
|
+
* Checks if the HTTP status code indicates payment required.
|
|
62
|
+
* @param status - The HTTP status code.
|
|
63
|
+
* @returns True if the status code is 402, otherwise false.
|
|
64
|
+
*/
|
|
65
|
+
export declare function isHttpPaymentRequired(status: number): boolean;
|
|
66
|
+
/**
|
|
67
|
+
* Checks if the HTTP status code indicates forbidden access.
|
|
68
|
+
* @param status - The HTTP status code.
|
|
69
|
+
* @returns True if the status code is 403, otherwise false.
|
|
70
|
+
*/
|
|
71
|
+
export declare function isHttpForbidden(status: number): boolean;
|
|
72
|
+
/**
|
|
73
|
+
* Checks if the HTTP status code indicates method not allowed.
|
|
74
|
+
* @param status - The HTTP status code.
|
|
75
|
+
* @returns True if the status code is 405, otherwise false.
|
|
76
|
+
*/
|
|
77
|
+
export declare function isHttpMethodNotAllowed(status: number): boolean;
|
|
78
|
+
/**
|
|
79
|
+
* Checks if the HTTP status code indicates not acceptable.
|
|
80
|
+
* @param status - The HTTP status code.
|
|
81
|
+
* @returns True if the status code is 406, otherwise false.
|
|
82
|
+
*/
|
|
83
|
+
export declare function isHttpNotAcceptable(status: number): boolean;
|
|
84
|
+
/**
|
|
85
|
+
* Checks if the HTTP status code indicates a conflict.
|
|
86
|
+
* @param status - The HTTP status code.
|
|
87
|
+
* @returns True if the status code is 409, otherwise false.
|
|
88
|
+
*/
|
|
89
|
+
export declare function isHttpConflict(status: number): boolean;
|
|
90
|
+
/**
|
|
91
|
+
* Checks if the HTTP status code indicates gone.
|
|
92
|
+
* @param status - The HTTP status code.
|
|
93
|
+
* @returns True if the status code is 410, otherwise false.
|
|
94
|
+
*/
|
|
95
|
+
export declare function isHttpGone(status: number): boolean;
|
|
96
|
+
/**
|
|
97
|
+
* Checks if the HTTP status code indicates length required.
|
|
98
|
+
* @param status - The HTTP status code.
|
|
99
|
+
* @returns True if the status code is 411, otherwise false.
|
|
100
|
+
*/
|
|
101
|
+
export declare function isHttpLengthRequired(status: number): boolean;
|
|
102
|
+
/**
|
|
103
|
+
* Checks if the HTTP status code indicates precondition failed.
|
|
104
|
+
* @param status - The HTTP status code.
|
|
105
|
+
* @returns True if the status code is 412, otherwise false.
|
|
106
|
+
*/
|
|
107
|
+
export declare function isHttpPreconditionFailed(status: number): boolean;
|
|
108
|
+
/**
|
|
109
|
+
* Checks if the HTTP status code indicates request entity too large.
|
|
110
|
+
* @param status - The HTTP status code.
|
|
111
|
+
* @returns True if the status code is 413, otherwise false.
|
|
112
|
+
*/
|
|
113
|
+
export declare function isHttpRequestEntityTooLarge(status: number): boolean;
|
|
114
|
+
/**
|
|
115
|
+
* Checks if the HTTP status code indicates unsupported media type.
|
|
116
|
+
* @param status - The HTTP status code.
|
|
117
|
+
* @returns True if the status code is 415, otherwise false.
|
|
118
|
+
*/
|
|
119
|
+
export declare function isHttpUnsupportedMediaType(status: number): boolean;
|
|
120
|
+
/**
|
|
121
|
+
* Checks if the HTTP status code indicates requested range not satisfiable.
|
|
122
|
+
* @param status - The HTTP status code.
|
|
123
|
+
* @returns True if the status code is 416, otherwise false.
|
|
124
|
+
*/
|
|
125
|
+
export declare function isHttpRequestedRangeNotSatisfiable(status: number): boolean;
|
|
126
|
+
/**
|
|
127
|
+
* Checks if the HTTP status code indicates unprocessable entity.
|
|
128
|
+
* @param status - The HTTP status code.
|
|
129
|
+
* @returns True if the status code is 422, otherwise false.
|
|
130
|
+
*/
|
|
131
|
+
export declare function isHttpUnprocessableEntity(status: number): boolean;
|
|
132
|
+
/**
|
|
133
|
+
* Checks if the HTTP status code indicates insufficient storage.
|
|
134
|
+
* @param status - The HTTP status code.
|
|
135
|
+
* @returns True if the status code is 507, otherwise false.
|
|
136
|
+
*/
|
|
137
|
+
export declare function isHttpInsufficientStorage(status: number): boolean;
|
|
138
|
+
/**
|
|
139
|
+
* Checks if the HTTP status code indicates bandwidth limit exceeded.
|
|
140
|
+
* @param status - The HTTP status code.
|
|
141
|
+
* @returns True if the status code is 509, otherwise false.
|
|
142
|
+
*/
|
|
143
|
+
export declare function isHttpBandwidthLimitExceeded(status: number): boolean;
|
|
144
|
+
/**
|
|
145
|
+
* Checks if the HTTP status code indicates internal server error.
|
|
146
|
+
* @param status - The HTTP status code.
|
|
147
|
+
* @returns True if the status code is 500, otherwise false.
|
|
148
|
+
*/
|
|
149
|
+
export declare function isHttpInternalServerError(status: number): boolean;
|
|
150
|
+
/**
|
|
151
|
+
* Checks if the HTTP status code indicates not implemented.
|
|
152
|
+
* @param status - The HTTP status code.
|
|
153
|
+
* @returns True if the status code is 501, otherwise false.
|
|
154
|
+
*/
|
|
155
|
+
export declare function isHttpNotImplemented(status: number): boolean;
|
|
156
|
+
/**
|
|
157
|
+
* Checks if the HTTP status code indicates a request timeout.
|
|
158
|
+
* @param status - The HTTP status code.
|
|
159
|
+
* @returns True if the status code is 408, otherwise false.
|
|
160
|
+
*/
|
|
161
|
+
export declare function isHttpRequestTimeout(status: number): boolean;
|
|
162
|
+
/**
|
|
163
|
+
* Checks if the HTTP status code indicates a bad gateway.
|
|
164
|
+
* @param status - The HTTP status code.
|
|
165
|
+
* @returns True if the status code is 502, otherwise false.
|
|
166
|
+
*/
|
|
167
|
+
export declare function isHttpBadGateway(status: number): boolean;
|
|
168
|
+
/**
|
|
169
|
+
* Checks if the HTTP status code is considered retryable.
|
|
170
|
+
* Retryable status codes typically indicate a temporary condition.
|
|
171
|
+
* @param status - The HTTP status code.
|
|
172
|
+
* @returns True if the status code is retryable, otherwise false.
|
|
173
|
+
*/
|
|
174
|
+
export declare function isRetryable(status: number): boolean;
|
|
48
175
|
//# sourceMappingURL=httpStatus.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"httpStatus.d.ts","sourceRoot":"","sources":["../../../src/services/httpStatus.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAErD;AAED;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAEhD;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAEtD;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAE7D;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAE5D;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAExD;AAED;;;;GAIG;AACH,wBAAgB,
|
|
1
|
+
{"version":3,"file":"httpStatus.d.ts","sourceRoot":"","sources":["../../../src/services/httpStatus.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAErD;AAED;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAEhD;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAEtD;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAE7D;AAED;;;;GAIG;AACH,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAEhE;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAE5D;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAEpD;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAExD;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAE1D;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAE7D;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAEvD;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAE9D;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAE3D;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAEtD;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAElD;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAE5D;AAED;;;;GAIG;AACH,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAEhE;AAED;;;;GAIG;AACH,wBAAgB,2BAA2B,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAEnE;AAED;;;;GAIG;AACH,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAElE;AAED;;;;GAIG;AACH,wBAAgB,kCAAkC,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAE1E;AAED;;;;GAIG;AACH,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAEjE;AAED;;;;GAIG;AACH,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAEjE;AAED;;;;GAIG;AACH,wBAAgB,4BAA4B,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAEpE;AAED;;;;GAIG;AACH,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAEjE;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAE5D;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAE5D;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAExD;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAcnD"}
|
|
@@ -9,9 +9,30 @@ exports.isHttpSuccess = isHttpSuccess;
|
|
|
9
9
|
exports.isHttpOk = isHttpOk;
|
|
10
10
|
exports.isHttpNotFound = isHttpNotFound;
|
|
11
11
|
exports.isHttpTooManyRequests = isHttpTooManyRequests;
|
|
12
|
-
exports.
|
|
13
|
-
exports.
|
|
14
|
-
exports.
|
|
12
|
+
exports.isHttpServiceUnavailable = isHttpServiceUnavailable;
|
|
13
|
+
exports.isHttpGatewayTimeout = isHttpGatewayTimeout;
|
|
14
|
+
exports.isHttpLocked = isHttpLocked;
|
|
15
|
+
exports.isHttpBadRequest = isHttpBadRequest;
|
|
16
|
+
exports.isHttpUnauthorized = isHttpUnauthorized;
|
|
17
|
+
exports.isHttpPaymentRequired = isHttpPaymentRequired;
|
|
18
|
+
exports.isHttpForbidden = isHttpForbidden;
|
|
19
|
+
exports.isHttpMethodNotAllowed = isHttpMethodNotAllowed;
|
|
20
|
+
exports.isHttpNotAcceptable = isHttpNotAcceptable;
|
|
21
|
+
exports.isHttpConflict = isHttpConflict;
|
|
22
|
+
exports.isHttpGone = isHttpGone;
|
|
23
|
+
exports.isHttpLengthRequired = isHttpLengthRequired;
|
|
24
|
+
exports.isHttpPreconditionFailed = isHttpPreconditionFailed;
|
|
25
|
+
exports.isHttpRequestEntityTooLarge = isHttpRequestEntityTooLarge;
|
|
26
|
+
exports.isHttpUnsupportedMediaType = isHttpUnsupportedMediaType;
|
|
27
|
+
exports.isHttpRequestedRangeNotSatisfiable = isHttpRequestedRangeNotSatisfiable;
|
|
28
|
+
exports.isHttpUnprocessableEntity = isHttpUnprocessableEntity;
|
|
29
|
+
exports.isHttpInsufficientStorage = isHttpInsufficientStorage;
|
|
30
|
+
exports.isHttpBandwidthLimitExceeded = isHttpBandwidthLimitExceeded;
|
|
31
|
+
exports.isHttpInternalServerError = isHttpInternalServerError;
|
|
32
|
+
exports.isHttpNotImplemented = isHttpNotImplemented;
|
|
33
|
+
exports.isHttpRequestTimeout = isHttpRequestTimeout;
|
|
34
|
+
exports.isHttpBadGateway = isHttpBadGateway;
|
|
35
|
+
exports.isRetryable = isRetryable;
|
|
15
36
|
/**
|
|
16
37
|
* Checks if the HTTP status code indicates a successful response.
|
|
17
38
|
* @param status - The HTTP status code.
|
|
@@ -49,7 +70,7 @@ function isHttpTooManyRequests(status) {
|
|
|
49
70
|
* @param status - The HTTP status code.
|
|
50
71
|
* @returns True if the status code is 503, otherwise false.
|
|
51
72
|
*/
|
|
52
|
-
function
|
|
73
|
+
function isHttpServiceUnavailable(status) {
|
|
53
74
|
return status === 503;
|
|
54
75
|
}
|
|
55
76
|
/**
|
|
@@ -57,7 +78,7 @@ function isServiceUnavailable(status) {
|
|
|
57
78
|
* @param status - The HTTP status code.
|
|
58
79
|
* @returns True if the status code is 504, otherwise false.
|
|
59
80
|
*/
|
|
60
|
-
function
|
|
81
|
+
function isHttpGatewayTimeout(status) {
|
|
61
82
|
return status === 504;
|
|
62
83
|
}
|
|
63
84
|
/**
|
|
@@ -65,6 +86,185 @@ function isGatewayTimeout(status) {
|
|
|
65
86
|
* @param status - The HTTP status code.
|
|
66
87
|
* @returns True if the status code is 423, otherwise false.
|
|
67
88
|
*/
|
|
68
|
-
function
|
|
89
|
+
function isHttpLocked(status) {
|
|
69
90
|
return status === 423;
|
|
70
91
|
}
|
|
92
|
+
/**
|
|
93
|
+
* Checks if the HTTP status code indicates a bad request.
|
|
94
|
+
* @param status - The HTTP status code.
|
|
95
|
+
* @returns True if the status code is 400, otherwise false.
|
|
96
|
+
*/
|
|
97
|
+
function isHttpBadRequest(status) {
|
|
98
|
+
return status === 400;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Checks if the HTTP status code indicates unauthorized access.
|
|
102
|
+
* @param status - The HTTP status code.
|
|
103
|
+
* @returns True if the status code is 401, otherwise false.
|
|
104
|
+
*/
|
|
105
|
+
function isHttpUnauthorized(status) {
|
|
106
|
+
return status === 401;
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Checks if the HTTP status code indicates payment required.
|
|
110
|
+
* @param status - The HTTP status code.
|
|
111
|
+
* @returns True if the status code is 402, otherwise false.
|
|
112
|
+
*/
|
|
113
|
+
function isHttpPaymentRequired(status) {
|
|
114
|
+
return status === 402;
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Checks if the HTTP status code indicates forbidden access.
|
|
118
|
+
* @param status - The HTTP status code.
|
|
119
|
+
* @returns True if the status code is 403, otherwise false.
|
|
120
|
+
*/
|
|
121
|
+
function isHttpForbidden(status) {
|
|
122
|
+
return status === 403;
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Checks if the HTTP status code indicates method not allowed.
|
|
126
|
+
* @param status - The HTTP status code.
|
|
127
|
+
* @returns True if the status code is 405, otherwise false.
|
|
128
|
+
*/
|
|
129
|
+
function isHttpMethodNotAllowed(status) {
|
|
130
|
+
return status === 405;
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Checks if the HTTP status code indicates not acceptable.
|
|
134
|
+
* @param status - The HTTP status code.
|
|
135
|
+
* @returns True if the status code is 406, otherwise false.
|
|
136
|
+
*/
|
|
137
|
+
function isHttpNotAcceptable(status) {
|
|
138
|
+
return status === 406;
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* Checks if the HTTP status code indicates a conflict.
|
|
142
|
+
* @param status - The HTTP status code.
|
|
143
|
+
* @returns True if the status code is 409, otherwise false.
|
|
144
|
+
*/
|
|
145
|
+
function isHttpConflict(status) {
|
|
146
|
+
return status === 409;
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* Checks if the HTTP status code indicates gone.
|
|
150
|
+
* @param status - The HTTP status code.
|
|
151
|
+
* @returns True if the status code is 410, otherwise false.
|
|
152
|
+
*/
|
|
153
|
+
function isHttpGone(status) {
|
|
154
|
+
return status === 410;
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* Checks if the HTTP status code indicates length required.
|
|
158
|
+
* @param status - The HTTP status code.
|
|
159
|
+
* @returns True if the status code is 411, otherwise false.
|
|
160
|
+
*/
|
|
161
|
+
function isHttpLengthRequired(status) {
|
|
162
|
+
return status === 411;
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* Checks if the HTTP status code indicates precondition failed.
|
|
166
|
+
* @param status - The HTTP status code.
|
|
167
|
+
* @returns True if the status code is 412, otherwise false.
|
|
168
|
+
*/
|
|
169
|
+
function isHttpPreconditionFailed(status) {
|
|
170
|
+
return status === 412;
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* Checks if the HTTP status code indicates request entity too large.
|
|
174
|
+
* @param status - The HTTP status code.
|
|
175
|
+
* @returns True if the status code is 413, otherwise false.
|
|
176
|
+
*/
|
|
177
|
+
function isHttpRequestEntityTooLarge(status) {
|
|
178
|
+
return status === 413;
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* Checks if the HTTP status code indicates unsupported media type.
|
|
182
|
+
* @param status - The HTTP status code.
|
|
183
|
+
* @returns True if the status code is 415, otherwise false.
|
|
184
|
+
*/
|
|
185
|
+
function isHttpUnsupportedMediaType(status) {
|
|
186
|
+
return status === 415;
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* Checks if the HTTP status code indicates requested range not satisfiable.
|
|
190
|
+
* @param status - The HTTP status code.
|
|
191
|
+
* @returns True if the status code is 416, otherwise false.
|
|
192
|
+
*/
|
|
193
|
+
function isHttpRequestedRangeNotSatisfiable(status) {
|
|
194
|
+
return status === 416;
|
|
195
|
+
}
|
|
196
|
+
/**
|
|
197
|
+
* Checks if the HTTP status code indicates unprocessable entity.
|
|
198
|
+
* @param status - The HTTP status code.
|
|
199
|
+
* @returns True if the status code is 422, otherwise false.
|
|
200
|
+
*/
|
|
201
|
+
function isHttpUnprocessableEntity(status) {
|
|
202
|
+
return status === 422;
|
|
203
|
+
}
|
|
204
|
+
/**
|
|
205
|
+
* Checks if the HTTP status code indicates insufficient storage.
|
|
206
|
+
* @param status - The HTTP status code.
|
|
207
|
+
* @returns True if the status code is 507, otherwise false.
|
|
208
|
+
*/
|
|
209
|
+
function isHttpInsufficientStorage(status) {
|
|
210
|
+
return status === 507;
|
|
211
|
+
}
|
|
212
|
+
/**
|
|
213
|
+
* Checks if the HTTP status code indicates bandwidth limit exceeded.
|
|
214
|
+
* @param status - The HTTP status code.
|
|
215
|
+
* @returns True if the status code is 509, otherwise false.
|
|
216
|
+
*/
|
|
217
|
+
function isHttpBandwidthLimitExceeded(status) {
|
|
218
|
+
return status === 509;
|
|
219
|
+
}
|
|
220
|
+
/**
|
|
221
|
+
* Checks if the HTTP status code indicates internal server error.
|
|
222
|
+
* @param status - The HTTP status code.
|
|
223
|
+
* @returns True if the status code is 500, otherwise false.
|
|
224
|
+
*/
|
|
225
|
+
function isHttpInternalServerError(status) {
|
|
226
|
+
return status === 500;
|
|
227
|
+
}
|
|
228
|
+
/**
|
|
229
|
+
* Checks if the HTTP status code indicates not implemented.
|
|
230
|
+
* @param status - The HTTP status code.
|
|
231
|
+
* @returns True if the status code is 501, otherwise false.
|
|
232
|
+
*/
|
|
233
|
+
function isHttpNotImplemented(status) {
|
|
234
|
+
return status === 501;
|
|
235
|
+
}
|
|
236
|
+
/**
|
|
237
|
+
* Checks if the HTTP status code indicates a request timeout.
|
|
238
|
+
* @param status - The HTTP status code.
|
|
239
|
+
* @returns True if the status code is 408, otherwise false.
|
|
240
|
+
*/
|
|
241
|
+
function isHttpRequestTimeout(status) {
|
|
242
|
+
return status === 408;
|
|
243
|
+
}
|
|
244
|
+
/**
|
|
245
|
+
* Checks if the HTTP status code indicates a bad gateway.
|
|
246
|
+
* @param status - The HTTP status code.
|
|
247
|
+
* @returns True if the status code is 502, otherwise false.
|
|
248
|
+
*/
|
|
249
|
+
function isHttpBadGateway(status) {
|
|
250
|
+
return status === 502;
|
|
251
|
+
}
|
|
252
|
+
/**
|
|
253
|
+
* Checks if the HTTP status code is considered retryable.
|
|
254
|
+
* Retryable status codes typically indicate a temporary condition.
|
|
255
|
+
* @param status - The HTTP status code.
|
|
256
|
+
* @returns True if the status code is retryable, otherwise false.
|
|
257
|
+
*/
|
|
258
|
+
function isRetryable(status) {
|
|
259
|
+
return (isHttpNotFound(status) ||
|
|
260
|
+
isHttpConflict(status) ||
|
|
261
|
+
isHttpLocked(status) ||
|
|
262
|
+
isHttpTooManyRequests(status) ||
|
|
263
|
+
isHttpInternalServerError(status) ||
|
|
264
|
+
isHttpServiceUnavailable(status) ||
|
|
265
|
+
isHttpGatewayTimeout(status) ||
|
|
266
|
+
isHttpInsufficientStorage(status) ||
|
|
267
|
+
isHttpBandwidthLimitExceeded(status) ||
|
|
268
|
+
isHttpRequestTimeout(status) ||
|
|
269
|
+
isHttpBadGateway(status));
|
|
270
|
+
}
|
|
@@ -10,17 +10,34 @@ export declare const endpoint = "https://graph.microsoft.com/v1.0";
|
|
|
10
10
|
*/
|
|
11
11
|
export declare const batchEndpoint = "https://graph.microsoft.com/v1.0/$batch";
|
|
12
12
|
/**
|
|
13
|
-
*
|
|
14
|
-
*
|
|
13
|
+
* Defines a Graph operation.
|
|
14
|
+
*
|
|
15
|
+
* Operations can be awaited to execute independently, or passed with others as arguments to {@link parallel} or {@link sequential} to execute as part of a batch.
|
|
16
|
+
*
|
|
17
|
+
* @typeParam T - The response type of the operation.
|
|
18
|
+
* @param definition Definition of the Graph operation.
|
|
19
|
+
* @returns GraphOperation instance.
|
|
15
20
|
*/
|
|
16
21
|
export declare function operation<T>(definition: GraphOperationDefinition<T>): GraphOperation<T>;
|
|
17
22
|
/**
|
|
18
23
|
* Execute a batch of GraphAPI operations in parallel.
|
|
19
|
-
*
|
|
24
|
+
*
|
|
25
|
+
* Provides the best performance for batch operations, however only useful if operations can logically be performed at the same time.
|
|
26
|
+
*
|
|
27
|
+
* @typeParam T - Tuple of GraphOperation types.
|
|
28
|
+
* @param operations Operations to execute in parallel.
|
|
29
|
+
* @returns The responses for each operation, in the same order.
|
|
20
30
|
*/
|
|
21
31
|
export declare function parallel<T extends GraphOperation<unknown>[]>(...operations: T): Promise<OperationResponse<T>>;
|
|
22
32
|
/**
|
|
23
33
|
* Execute a batch of GraphAPI operations sequentially.
|
|
34
|
+
*
|
|
35
|
+
* Each operation is dependent on the previous operation in the batch.
|
|
36
|
+
*
|
|
37
|
+
* @typeParam T - Tuple of GraphOperation types.
|
|
38
|
+
* @param operations Operations to execute sequentially.
|
|
39
|
+
* @returns The responses for each operation, in the same order.
|
|
24
40
|
*/
|
|
25
41
|
export declare function sequential<T extends GraphOperation<unknown>[]>(...operations: T): Promise<OperationResponse<T>>;
|
|
42
|
+
export declare function throwException(responseCode: number, message: string): never;
|
|
26
43
|
//# sourceMappingURL=operationInvoker.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"operationInvoker.d.ts","sourceRoot":"","sources":["../../../src/services/operationInvoker.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"operationInvoker.d.ts","sourceRoot":"","sources":["../../../src/services/operationInvoker.ts"],"names":[],"mappings":"AAmCA,OAAO,KAAK,EAAE,cAAc,EAAE,wBAAwB,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAiC/G;;;GAGG;AACH,eAAO,MAAM,QAAQ,qCAAqC,CAAC;AAE3D;;;GAGG;AACH,eAAO,MAAM,aAAa,4CAAuB,CAAC;AAElD;;;;;;;;GAQG;AACH,wBAAgB,SAAS,CAAC,CAAC,EAAE,UAAU,EAAE,wBAAwB,CAAC,CAAC,CAAC,GAAG,cAAc,CAAC,CAAC,CAAC,CAQvF;AAED;;;;;;;;GAQG;AACH,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;;;;;;;;GAQG;AACH,wBAAsB,UAAU,CAAC,CAAC,SAAS,cAAc,CAAC,OAAO,CAAC,EAAE,EAAE,GAAG,UAAU,EAAE,CAAC,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,CAOrH;AAsMD,wBAAgB,cAAc,CAAC,YAAY,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,KAAK,CAwE3E"}
|