@microsoft/agents-a365-runtime 0.1.0-preview.64 → 0.1.0-preview.83
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/environment-utils.d.ts +8 -1
- package/dist/cjs/environment-utils.d.ts.map +1 -1
- package/dist/cjs/environment-utils.js +12 -2
- package/dist/cjs/environment-utils.js.map +1 -1
- package/dist/cjs/index.d.ts +2 -0
- package/dist/cjs/index.d.ts.map +1 -1
- package/dist/cjs/index.js +2 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/operation-error.d.ts +24 -0
- package/dist/cjs/operation-error.d.ts.map +1 -0
- package/dist/cjs/operation-error.js +35 -0
- package/dist/cjs/operation-error.js.map +1 -0
- package/dist/cjs/operation-result.d.ts +41 -0
- package/dist/cjs/operation-result.d.ts.map +1 -0
- package/dist/cjs/operation-result.js +56 -0
- package/dist/cjs/operation-result.js.map +1 -0
- package/dist/cjs/utility.d.ts.map +1 -1
- package/dist/cjs/utility.js +1 -1
- package/dist/cjs/utility.js.map +1 -1
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/environment-utils.d.ts +8 -1
- package/dist/esm/environment-utils.d.ts.map +1 -1
- package/dist/esm/environment-utils.js +12 -2
- package/dist/esm/environment-utils.js.map +1 -1
- package/dist/esm/index.d.ts +2 -0
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +2 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/operation-error.d.ts +24 -0
- package/dist/esm/operation-error.d.ts.map +1 -0
- package/dist/esm/operation-error.js +31 -0
- package/dist/esm/operation-error.js.map +1 -0
- package/dist/esm/operation-result.d.ts +41 -0
- package/dist/esm/operation-result.d.ts.map +1 -0
- package/dist/esm/operation-result.js +52 -0
- package/dist/esm/operation-result.js.map +1 -0
- package/dist/esm/utility.d.ts.map +1 -1
- package/dist/esm/utility.js +1 -1
- package/dist/esm/utility.js.map +1 -1
- package/dist/esm/version.d.ts +1 -1
- package/dist/esm/version.js +1 -1
- package/package.json +1 -1
|
@@ -9,7 +9,14 @@ export declare const DEVELOPMENT_ENVIRONMENT_NAME = "Development";
|
|
|
9
9
|
/**
|
|
10
10
|
* Returns the scope for authenticating to the observability service
|
|
11
11
|
*
|
|
12
|
-
*
|
|
12
|
+
* The default is the production observability scope, but this can be overridden
|
|
13
|
+
* for internal development and testing scenarios using the
|
|
14
|
+
* `A365_OBSERVABILITY_SCOPES_OVERRIDE` environment variable.
|
|
15
|
+
*
|
|
16
|
+
* When the override is set to a non-empty string, it is split on whitespace
|
|
17
|
+
* into individual scopes.
|
|
18
|
+
*
|
|
19
|
+
* @returns The authentication scopes for the current environment.
|
|
13
20
|
*/
|
|
14
21
|
export declare function getObservabilityAuthenticationScope(): string[];
|
|
15
22
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"environment-utils.d.ts","sourceRoot":"","sources":["../../src/environment-utils.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,eAAO,MAAM,wBAAwB,2CAA2C,CAAC;AACjF,eAAO,MAAM,sCAAsC,kDAAkD,CAAC;AACtG,eAAO,MAAM,mCAAmC,SAAS,CAAC;AAG1D,eAAO,MAAM,2BAA2B,eAAe,CAAC;AACxD,eAAO,MAAM,4BAA4B,gBAAgB,CAAC;AAE1D
|
|
1
|
+
{"version":3,"file":"environment-utils.d.ts","sourceRoot":"","sources":["../../src/environment-utils.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,eAAO,MAAM,wBAAwB,2CAA2C,CAAC;AACjF,eAAO,MAAM,sCAAsC,kDAAkD,CAAC;AACtG,eAAO,MAAM,mCAAmC,SAAS,CAAC;AAG1D,eAAO,MAAM,2BAA2B,eAAe,CAAC;AACxD,eAAO,MAAM,4BAA4B,gBAAgB,CAAC;AAE1D;;;;;;;;;;;GAWG;AACH,wBAAgB,mCAAmC,IAAI,MAAM,EAAE,CAQ9D;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,IAAI,MAAM,CAQ3C;AAED;;;;GAIG;AACH,wBAAgB,wBAAwB,IAAI,OAAO,CAGlD;AAED;;;;GAIG;AACH,wBAAgB,iCAAiC,IAAI,MAAM,CAE1D"}
|
|
@@ -20,10 +20,20 @@ exports.DEVELOPMENT_ENVIRONMENT_NAME = 'Development';
|
|
|
20
20
|
/**
|
|
21
21
|
* Returns the scope for authenticating to the observability service
|
|
22
22
|
*
|
|
23
|
-
*
|
|
23
|
+
* The default is the production observability scope, but this can be overridden
|
|
24
|
+
* for internal development and testing scenarios using the
|
|
25
|
+
* `A365_OBSERVABILITY_SCOPES_OVERRIDE` environment variable.
|
|
26
|
+
*
|
|
27
|
+
* When the override is set to a non-empty string, it is split on whitespace
|
|
28
|
+
* into individual scopes.
|
|
29
|
+
*
|
|
30
|
+
* @returns The authentication scopes for the current environment.
|
|
24
31
|
*/
|
|
25
32
|
function getObservabilityAuthenticationScope() {
|
|
26
|
-
|
|
33
|
+
const override = process.env.A365_OBSERVABILITY_SCOPES_OVERRIDE;
|
|
34
|
+
if (override && override.trim().length > 0) {
|
|
35
|
+
return override.trim().split(/\s+/);
|
|
36
|
+
}
|
|
27
37
|
return [exports.PROD_OBSERVABILITY_SCOPE];
|
|
28
38
|
}
|
|
29
39
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"environment-utils.js","sourceRoot":"","sources":["../../src/environment-utils.ts"],"names":[],"mappings":";AAAA,iFAAiF;AACjF,4DAA4D;AAC5D,iFAAiF;;;
|
|
1
|
+
{"version":3,"file":"environment-utils.js","sourceRoot":"","sources":["../../src/environment-utils.ts"],"names":[],"mappings":";AAAA,iFAAiF;AACjF,4DAA4D;AAC5D,iFAAiF;;;AA0BjF,kFAQC;AAOD,gDAQC;AAOD,4DAGC;AAOD,8EAEC;AAlED;;GAEG;AAEU,QAAA,wBAAwB,GAAG,wCAAwC,CAAC;AACpE,QAAA,sCAAsC,GAAG,+CAA+C,CAAC;AACzF,QAAA,mCAAmC,GAAG,MAAM,CAAC;AAE1D,4BAA4B;AACf,QAAA,2BAA2B,GAAG,YAAY,CAAC;AAC3C,QAAA,4BAA4B,GAAG,aAAa,CAAC;AAE1D;;;;;;;;;;;GAWG;AACH,SAAgB,mCAAmC;IACjD,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,kCAAkC,CAAC;IAEhE,IAAI,QAAQ,IAAI,QAAQ,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC3C,OAAO,QAAQ,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IACtC,CAAC;IAED,OAAO,CAAC,gCAAwB,CAAC,CAAC;AACpC,CAAC;AAED;;;;GAIG;AACH,SAAgB,kBAAkB;IAChC,MAAM,eAAe,GAAG,OAAO,CAAC,GAAG,CAAC,gBAAgB,CAAC;IAErD,IAAI,CAAC,eAAe,EAAE,CAAC;QACrB,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,OAAO,eAAe,CAAC,WAAW,EAAE,CAAC;AACvC,CAAC;AAED;;;;GAIG;AACH,SAAgB,wBAAwB;IACtC,MAAM,eAAe,GAAG,kBAAkB,EAAE,CAAC;IAC7C,OAAO,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,QAAQ,CAAC,eAAe,CAAC,CAAC;AACpD,CAAC;AAED;;;;GAIG;AACH,SAAgB,iCAAiC;IAC/C,OAAO,OAAO,CAAC,GAAG,CAAC,iCAAiC,IAAI,8CAAsC,CAAC;AACjG,CAAC"}
|
package/dist/cjs/index.d.ts
CHANGED
|
@@ -2,4 +2,6 @@ export * from './power-platform-api-discovery';
|
|
|
2
2
|
export * from './agentic-authorization-service';
|
|
3
3
|
export * from './environment-utils';
|
|
4
4
|
export * from './utility';
|
|
5
|
+
export * from './operation-error';
|
|
6
|
+
export * from './operation-result';
|
|
5
7
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/cjs/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gCAAgC,CAAC;AAC/C,cAAc,iCAAiC,CAAC;AAChD,cAAc,qBAAqB,CAAC;AACpC,cAAc,WAAW,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gCAAgC,CAAC;AAC/C,cAAc,iCAAiC,CAAC;AAChD,cAAc,qBAAqB,CAAC;AACpC,cAAc,WAAW,CAAC;AAC1B,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC"}
|
package/dist/cjs/index.js
CHANGED
|
@@ -18,4 +18,6 @@ __exportStar(require("./power-platform-api-discovery"), exports);
|
|
|
18
18
|
__exportStar(require("./agentic-authorization-service"), exports);
|
|
19
19
|
__exportStar(require("./environment-utils"), exports);
|
|
20
20
|
__exportStar(require("./utility"), exports);
|
|
21
|
+
__exportStar(require("./operation-error"), exports);
|
|
22
|
+
__exportStar(require("./operation-result"), exports);
|
|
21
23
|
//# sourceMappingURL=index.js.map
|
package/dist/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,iEAA+C;AAC/C,kEAAgD;AAChD,sDAAoC;AACpC,4CAA0B"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,iEAA+C;AAC/C,kEAAgD;AAChD,sDAAoC;AACpC,4CAA0B;AAC1B,oDAAkC;AAClC,qDAAmC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Encapsulates an error from an operation.
|
|
3
|
+
*/
|
|
4
|
+
export declare class OperationError {
|
|
5
|
+
/**
|
|
6
|
+
* Gets the exception associated with the error.
|
|
7
|
+
*/
|
|
8
|
+
readonly exception: Error;
|
|
9
|
+
/**
|
|
10
|
+
* Gets the message associated with the error.
|
|
11
|
+
*/
|
|
12
|
+
get message(): string;
|
|
13
|
+
/**
|
|
14
|
+
* Initializes a new instance of the OperationError class.
|
|
15
|
+
* @param exception The exception associated with the error.
|
|
16
|
+
*/
|
|
17
|
+
constructor(exception: Error);
|
|
18
|
+
/**
|
|
19
|
+
* Returns a string representation of the error.
|
|
20
|
+
* @returns A string representation of the error.
|
|
21
|
+
*/
|
|
22
|
+
toString(): string;
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=operation-error.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operation-error.d.ts","sourceRoot":"","sources":["../../src/operation-error.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,qBAAa,cAAc;IACzB;;OAEG;IACH,SAAgB,SAAS,EAAE,KAAK,CAAC;IAEjC;;OAEG;IACH,IAAW,OAAO,IAAI,MAAM,CAE3B;IAED;;;OAGG;gBACS,SAAS,EAAE,KAAK;IAO5B;;;OAGG;IACI,QAAQ,IAAI,MAAM;CAG1B"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright (c) Microsoft Corporation.
|
|
3
|
+
// Licensed under the MIT License.
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.OperationError = void 0;
|
|
6
|
+
/**
|
|
7
|
+
* Encapsulates an error from an operation.
|
|
8
|
+
*/
|
|
9
|
+
class OperationError {
|
|
10
|
+
/**
|
|
11
|
+
* Gets the message associated with the error.
|
|
12
|
+
*/
|
|
13
|
+
get message() {
|
|
14
|
+
return this.exception.message;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Initializes a new instance of the OperationError class.
|
|
18
|
+
* @param exception The exception associated with the error.
|
|
19
|
+
*/
|
|
20
|
+
constructor(exception) {
|
|
21
|
+
if (!exception) {
|
|
22
|
+
throw new Error('exception is required');
|
|
23
|
+
}
|
|
24
|
+
this.exception = exception;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Returns a string representation of the error.
|
|
28
|
+
* @returns A string representation of the error.
|
|
29
|
+
*/
|
|
30
|
+
toString() {
|
|
31
|
+
return this.exception.toString();
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
exports.OperationError = OperationError;
|
|
35
|
+
//# sourceMappingURL=operation-error.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operation-error.js","sourceRoot":"","sources":["../../src/operation-error.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAElC;;GAEG;AACH,MAAa,cAAc;IAMzB;;OAEG;IACH,IAAW,OAAO;QAChB,OAAO,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC;IAChC,CAAC;IAED;;;OAGG;IACH,YAAY,SAAgB;QAC1B,IAAI,CAAC,SAAS,EAAE,CAAC;YACf,MAAM,IAAI,KAAK,CAAC,uBAAuB,CAAC,CAAC;QAC3C,CAAC;QACD,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;IAC7B,CAAC;IAED;;;OAGG;IACI,QAAQ;QACb,OAAO,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,CAAC;IACnC,CAAC;CACF;AA/BD,wCA+BC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { OperationError } from './operation-error';
|
|
2
|
+
/**
|
|
3
|
+
* Represents the result of an operation.
|
|
4
|
+
*/
|
|
5
|
+
export declare class OperationResult {
|
|
6
|
+
private static readonly _success;
|
|
7
|
+
private readonly _errors;
|
|
8
|
+
/**
|
|
9
|
+
* Gets a flag indicating whether the operation succeeded.
|
|
10
|
+
*/
|
|
11
|
+
readonly succeeded: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Gets an array of OperationError instances indicating errors that occurred during the operation.
|
|
14
|
+
*/
|
|
15
|
+
get errors(): OperationError[];
|
|
16
|
+
/**
|
|
17
|
+
* Private constructor for OperationResult.
|
|
18
|
+
* @param succeeded Whether the operation succeeded.
|
|
19
|
+
* @param errors Optional array of errors.
|
|
20
|
+
*/
|
|
21
|
+
private constructor();
|
|
22
|
+
/**
|
|
23
|
+
* Returns an OperationResult indicating a successful operation.
|
|
24
|
+
*/
|
|
25
|
+
static get success(): OperationResult;
|
|
26
|
+
/**
|
|
27
|
+
* Creates an OperationResult indicating a failed operation, with a list of errors if applicable.
|
|
28
|
+
* @param errors An optional array of OperationError which caused the operation to fail.
|
|
29
|
+
* @returns An OperationResult indicating a failed operation, with a list of errors if applicable.
|
|
30
|
+
*/
|
|
31
|
+
static failed(...errors: OperationError[]): OperationResult;
|
|
32
|
+
/**
|
|
33
|
+
* Converts the value of the current OperationResult object to its equivalent string representation.
|
|
34
|
+
* @returns A string representation of the current OperationResult object.
|
|
35
|
+
* @remarks
|
|
36
|
+
* If the operation was successful the toString() will return "Succeeded" otherwise it will return
|
|
37
|
+
* "Failed : " followed by a comma delimited list of error messages from its errors collection, if any.
|
|
38
|
+
*/
|
|
39
|
+
toString(): string;
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=operation-result.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operation-result.d.ts","sourceRoot":"","sources":["../../src/operation-result.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEnD;;GAEG;AACH,qBAAa,eAAe;IAC1B,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAA6B;IAC7D,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAmB;IAE3C;;OAEG;IACH,SAAgB,SAAS,EAAE,OAAO,CAAC;IAEnC;;OAEG;IACH,IAAW,MAAM,IAAI,cAAc,EAAE,CAEpC;IAED;;;;OAIG;IACH,OAAO;IAKP;;OAEG;IACH,WAAkB,OAAO,IAAI,eAAe,CAE3C;IAED;;;;OAIG;WACW,MAAM,CAAC,GAAG,MAAM,EAAE,cAAc,EAAE,GAAG,eAAe;IAIlE;;;;;;OAMG;IACI,QAAQ,IAAI,MAAM;CAQ1B"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright (c) Microsoft Corporation.
|
|
3
|
+
// Licensed under the MIT License.
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.OperationResult = void 0;
|
|
6
|
+
/**
|
|
7
|
+
* Represents the result of an operation.
|
|
8
|
+
*/
|
|
9
|
+
class OperationResult {
|
|
10
|
+
/**
|
|
11
|
+
* Gets an array of OperationError instances indicating errors that occurred during the operation.
|
|
12
|
+
*/
|
|
13
|
+
get errors() {
|
|
14
|
+
return this._errors || [];
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Private constructor for OperationResult.
|
|
18
|
+
* @param succeeded Whether the operation succeeded.
|
|
19
|
+
* @param errors Optional array of errors.
|
|
20
|
+
*/
|
|
21
|
+
constructor(succeeded, errors) {
|
|
22
|
+
this.succeeded = succeeded;
|
|
23
|
+
this._errors = errors || [];
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Returns an OperationResult indicating a successful operation.
|
|
27
|
+
*/
|
|
28
|
+
static get success() {
|
|
29
|
+
return OperationResult._success;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Creates an OperationResult indicating a failed operation, with a list of errors if applicable.
|
|
33
|
+
* @param errors An optional array of OperationError which caused the operation to fail.
|
|
34
|
+
* @returns An OperationResult indicating a failed operation, with a list of errors if applicable.
|
|
35
|
+
*/
|
|
36
|
+
static failed(...errors) {
|
|
37
|
+
return new OperationResult(false, errors.length > 0 ? errors : []);
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Converts the value of the current OperationResult object to its equivalent string representation.
|
|
41
|
+
* @returns A string representation of the current OperationResult object.
|
|
42
|
+
* @remarks
|
|
43
|
+
* If the operation was successful the toString() will return "Succeeded" otherwise it will return
|
|
44
|
+
* "Failed : " followed by a comma delimited list of error messages from its errors collection, if any.
|
|
45
|
+
*/
|
|
46
|
+
toString() {
|
|
47
|
+
if (this.succeeded) {
|
|
48
|
+
return 'Succeeded';
|
|
49
|
+
}
|
|
50
|
+
const errorMessages = this.errors.map(e => e.message).join(', ');
|
|
51
|
+
return `Failed : ${errorMessages}`;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
exports.OperationResult = OperationResult;
|
|
55
|
+
OperationResult._success = new OperationResult(true);
|
|
56
|
+
//# sourceMappingURL=operation-result.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operation-result.js","sourceRoot":"","sources":["../../src/operation-result.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAIlC;;GAEG;AACH,MAAa,eAAe;IAS1B;;OAEG;IACH,IAAW,MAAM;QACf,OAAO,IAAI,CAAC,OAAO,IAAI,EAAE,CAAC;IAC5B,CAAC;IAED;;;;OAIG;IACH,YAAoB,SAAkB,EAAE,MAAyB;QAC/D,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,OAAO,GAAG,MAAM,IAAI,EAAE,CAAC;IAC9B,CAAC;IAED;;OAEG;IACI,MAAM,KAAK,OAAO;QACvB,OAAO,eAAe,CAAC,QAAQ,CAAC;IAClC,CAAC;IAED;;;;OAIG;IACI,MAAM,CAAC,MAAM,CAAC,GAAG,MAAwB;QAC9C,OAAO,IAAI,eAAe,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;IACrE,CAAC;IAED;;;;;;OAMG;IACI,QAAQ;QACb,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;YACnB,OAAO,WAAW,CAAC;QACrB,CAAC;QAED,MAAM,aAAa,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACjE,OAAO,YAAY,aAAa,EAAE,CAAC;IACrC,CAAC;;AAxDH,0CAyDC;AAxDyB,wBAAQ,GAAG,IAAI,eAAe,CAAC,IAAI,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utility.d.ts","sourceRoot":"","sources":["../../src/utility.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAMxD;;GAEG;AACH,qBAAa,OAAO;IAClB;;;;OAIG;WACW,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;IAoBtD;;;;;OAKG;WACW,oBAAoB,CAAC,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM;IASnF;;;;OAIG;WACW,kBAAkB,CAAC,YAAY,
|
|
1
|
+
{"version":3,"file":"utility.d.ts","sourceRoot":"","sources":["../../src/utility.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAMxD;;GAEG;AACH,qBAAa,OAAO;IAClB;;;;OAIG;WACW,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;IAoBtD;;;;;OAKG;WACW,oBAAoB,CAAC,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM;IASnF;;;;OAIG;WACW,kBAAkB,CAAC,YAAY,CAAC,EAAE,MAAM,GAAG,MAAM;CAKhE"}
|
package/dist/cjs/utility.js
CHANGED
|
@@ -87,7 +87,7 @@ class Utility {
|
|
|
87
87
|
* @param orchestrator Optional orchestrator identifier to include in the User-Agent string.
|
|
88
88
|
* @returns Formatted User-Agent header string.
|
|
89
89
|
*/
|
|
90
|
-
static GetUserAgentHeader(orchestrator
|
|
90
|
+
static GetUserAgentHeader(orchestrator) {
|
|
91
91
|
const osType = os_1.default.type();
|
|
92
92
|
const orchestratorPart = orchestrator ? `; ${orchestrator}` : '';
|
|
93
93
|
return `Agent365SDK/${version_1.LIB_VERSION} (${osType}; Node.js ${process.version}${orchestratorPart})`;
|
package/dist/cjs/utility.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utility.js","sourceRoot":"","sources":["../../src/utility.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGlC,kDAAoC;AACpC,4CAAoB;AAEpB,uCAAwC;AAExC;;GAEG;AACH,MAAa,OAAO;IAClB;;;;OAIG;IACI,MAAM,CAAC,iBAAiB,CAAC,KAAa;QAC3C,IAAI,CAAC,KAAK,IAAI,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC;YAClC,OAAO,sCAAsC,CAAC;QAChD,CAAC;QAED,IAAI,CAAC;YACH,MAAM,OAAO,GAAG,GAAG,CAAC,MAAM,CAAC,KAAK,CAAmB,CAAC;YACpD,IAAI,CAAC,OAAO,EAAE,CAAC;gBACb,OAAO,EAAE,CAAC;YACZ,CAAC;YAED,yDAAyD;YACzD,MAAM,UAAU,GAAG,OAAO,CAAC,OAAO,CAAC,IAAI,OAAO,CAAC,KAAK,CAAC,CAAC;YACtD,OAAO,UAAU,IAAI,EAAE,CAAC;QAC1B,CAAC;QAAC,OAAO,MAAM,EAAE,CAAC;YAChB,gEAAgE;YAChE,OAAO,EAAE,CAAC;QACZ,CAAC;IACH,CAAC;IAED;;;;;OAKG;IACI,MAAM,CAAC,oBAAoB,CAAC,OAAoB,EAAE,SAAiB;QACxE,gDAAgD;QAChD,MAAM,YAAY,GAAG,OAAO,CAAC,QAAQ,CAAC,gBAAgB,EAAE;YACtD,CAAC,CAAC,OAAO,CAAC,QAAQ,CA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CAAC,CAAC;QAEtC,OAAO,YAAY,CAAC;IACtB,CAAC;IAED;;;;OAIG;IACI,MAAM,CAAC,kBAAkB,CAAC,YAAqB;QACpD,MAAM,MAAM,GAAG,YAAE,CAAC,IAAI,EAAE,CAAC;QACzB,MAAM,gBAAgB,GAAG,YAAY,CAAC,CAAC,CAAC,KAAK,YAAY,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACjE,OAAO,eAAe,qBAAW,KAAK,MAAM,aAAa,OAAO,CAAC,OAAO,GAAG,gBAAgB,GAAG,CAAC;IACjG,CAAC;CACF;AAnDD,0BAmDC"}
|
package/dist/cjs/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const LIB_VERSION = "0.1.0-preview.
|
|
1
|
+
export declare const LIB_VERSION = "0.1.0-preview.83";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/dist/cjs/version.js
CHANGED
|
@@ -9,7 +9,14 @@ export declare const DEVELOPMENT_ENVIRONMENT_NAME = "Development";
|
|
|
9
9
|
/**
|
|
10
10
|
* Returns the scope for authenticating to the observability service
|
|
11
11
|
*
|
|
12
|
-
*
|
|
12
|
+
* The default is the production observability scope, but this can be overridden
|
|
13
|
+
* for internal development and testing scenarios using the
|
|
14
|
+
* `A365_OBSERVABILITY_SCOPES_OVERRIDE` environment variable.
|
|
15
|
+
*
|
|
16
|
+
* When the override is set to a non-empty string, it is split on whitespace
|
|
17
|
+
* into individual scopes.
|
|
18
|
+
*
|
|
19
|
+
* @returns The authentication scopes for the current environment.
|
|
13
20
|
*/
|
|
14
21
|
export declare function getObservabilityAuthenticationScope(): string[];
|
|
15
22
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"environment-utils.d.ts","sourceRoot":"","sources":["../../src/environment-utils.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,eAAO,MAAM,wBAAwB,2CAA2C,CAAC;AACjF,eAAO,MAAM,sCAAsC,kDAAkD,CAAC;AACtG,eAAO,MAAM,mCAAmC,SAAS,CAAC;AAG1D,eAAO,MAAM,2BAA2B,eAAe,CAAC;AACxD,eAAO,MAAM,4BAA4B,gBAAgB,CAAC;AAE1D
|
|
1
|
+
{"version":3,"file":"environment-utils.d.ts","sourceRoot":"","sources":["../../src/environment-utils.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,eAAO,MAAM,wBAAwB,2CAA2C,CAAC;AACjF,eAAO,MAAM,sCAAsC,kDAAkD,CAAC;AACtG,eAAO,MAAM,mCAAmC,SAAS,CAAC;AAG1D,eAAO,MAAM,2BAA2B,eAAe,CAAC;AACxD,eAAO,MAAM,4BAA4B,gBAAgB,CAAC;AAE1D;;;;;;;;;;;GAWG;AACH,wBAAgB,mCAAmC,IAAI,MAAM,EAAE,CAQ9D;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,IAAI,MAAM,CAQ3C;AAED;;;;GAIG;AACH,wBAAgB,wBAAwB,IAAI,OAAO,CAGlD;AAED;;;;GAIG;AACH,wBAAgB,iCAAiC,IAAI,MAAM,CAE1D"}
|
|
@@ -13,10 +13,20 @@ export const DEVELOPMENT_ENVIRONMENT_NAME = 'Development';
|
|
|
13
13
|
/**
|
|
14
14
|
* Returns the scope for authenticating to the observability service
|
|
15
15
|
*
|
|
16
|
-
*
|
|
16
|
+
* The default is the production observability scope, but this can be overridden
|
|
17
|
+
* for internal development and testing scenarios using the
|
|
18
|
+
* `A365_OBSERVABILITY_SCOPES_OVERRIDE` environment variable.
|
|
19
|
+
*
|
|
20
|
+
* When the override is set to a non-empty string, it is split on whitespace
|
|
21
|
+
* into individual scopes.
|
|
22
|
+
*
|
|
23
|
+
* @returns The authentication scopes for the current environment.
|
|
17
24
|
*/
|
|
18
25
|
export function getObservabilityAuthenticationScope() {
|
|
19
|
-
|
|
26
|
+
const override = process.env.A365_OBSERVABILITY_SCOPES_OVERRIDE;
|
|
27
|
+
if (override && override.trim().length > 0) {
|
|
28
|
+
return override.trim().split(/\s+/);
|
|
29
|
+
}
|
|
20
30
|
return [PROD_OBSERVABILITY_SCOPE];
|
|
21
31
|
}
|
|
22
32
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"environment-utils.js","sourceRoot":"","sources":["../../src/environment-utils.ts"],"names":[],"mappings":"AAAA,iFAAiF;AACjF,4DAA4D;AAC5D,iFAAiF;AAEjF;;GAEG;AAEH,MAAM,CAAC,MAAM,wBAAwB,GAAG,wCAAwC,CAAC;AACjF,MAAM,CAAC,MAAM,sCAAsC,GAAG,+CAA+C,CAAC;AACtG,MAAM,CAAC,MAAM,mCAAmC,GAAG,MAAM,CAAC;AAE1D,4BAA4B;AAC5B,MAAM,CAAC,MAAM,2BAA2B,GAAG,YAAY,CAAC;AACxD,MAAM,CAAC,MAAM,4BAA4B,GAAG,aAAa,CAAC;AAE1D
|
|
1
|
+
{"version":3,"file":"environment-utils.js","sourceRoot":"","sources":["../../src/environment-utils.ts"],"names":[],"mappings":"AAAA,iFAAiF;AACjF,4DAA4D;AAC5D,iFAAiF;AAEjF;;GAEG;AAEH,MAAM,CAAC,MAAM,wBAAwB,GAAG,wCAAwC,CAAC;AACjF,MAAM,CAAC,MAAM,sCAAsC,GAAG,+CAA+C,CAAC;AACtG,MAAM,CAAC,MAAM,mCAAmC,GAAG,MAAM,CAAC;AAE1D,4BAA4B;AAC5B,MAAM,CAAC,MAAM,2BAA2B,GAAG,YAAY,CAAC;AACxD,MAAM,CAAC,MAAM,4BAA4B,GAAG,aAAa,CAAC;AAE1D;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,mCAAmC;IACjD,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,kCAAkC,CAAC;IAEhE,IAAI,QAAQ,IAAI,QAAQ,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC3C,OAAO,QAAQ,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IACtC,CAAC;IAED,OAAO,CAAC,wBAAwB,CAAC,CAAC;AACpC,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,kBAAkB;IAChC,MAAM,eAAe,GAAG,OAAO,CAAC,GAAG,CAAC,gBAAgB,CAAC;IAErD,IAAI,CAAC,eAAe,EAAE,CAAC;QACrB,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,OAAO,eAAe,CAAC,WAAW,EAAE,CAAC;AACvC,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,wBAAwB;IACtC,MAAM,eAAe,GAAG,kBAAkB,EAAE,CAAC;IAC7C,OAAO,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,QAAQ,CAAC,eAAe,CAAC,CAAC;AACpD,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,iCAAiC;IAC/C,OAAO,OAAO,CAAC,GAAG,CAAC,iCAAiC,IAAI,sCAAsC,CAAC;AACjG,CAAC"}
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -2,4 +2,6 @@ export * from './power-platform-api-discovery';
|
|
|
2
2
|
export * from './agentic-authorization-service';
|
|
3
3
|
export * from './environment-utils';
|
|
4
4
|
export * from './utility';
|
|
5
|
+
export * from './operation-error';
|
|
6
|
+
export * from './operation-result';
|
|
5
7
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/esm/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gCAAgC,CAAC;AAC/C,cAAc,iCAAiC,CAAC;AAChD,cAAc,qBAAqB,CAAC;AACpC,cAAc,WAAW,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gCAAgC,CAAC;AAC/C,cAAc,iCAAiC,CAAC;AAChD,cAAc,qBAAqB,CAAC;AACpC,cAAc,WAAW,CAAC;AAC1B,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC"}
|
package/dist/esm/index.js
CHANGED
|
@@ -2,4 +2,6 @@ export * from './power-platform-api-discovery';
|
|
|
2
2
|
export * from './agentic-authorization-service';
|
|
3
3
|
export * from './environment-utils';
|
|
4
4
|
export * from './utility';
|
|
5
|
+
export * from './operation-error';
|
|
6
|
+
export * from './operation-result';
|
|
5
7
|
//# sourceMappingURL=index.js.map
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gCAAgC,CAAC;AAC/C,cAAc,iCAAiC,CAAC;AAChD,cAAc,qBAAqB,CAAC;AACpC,cAAc,WAAW,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gCAAgC,CAAC;AAC/C,cAAc,iCAAiC,CAAC;AAChD,cAAc,qBAAqB,CAAC;AACpC,cAAc,WAAW,CAAC;AAC1B,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Encapsulates an error from an operation.
|
|
3
|
+
*/
|
|
4
|
+
export declare class OperationError {
|
|
5
|
+
/**
|
|
6
|
+
* Gets the exception associated with the error.
|
|
7
|
+
*/
|
|
8
|
+
readonly exception: Error;
|
|
9
|
+
/**
|
|
10
|
+
* Gets the message associated with the error.
|
|
11
|
+
*/
|
|
12
|
+
get message(): string;
|
|
13
|
+
/**
|
|
14
|
+
* Initializes a new instance of the OperationError class.
|
|
15
|
+
* @param exception The exception associated with the error.
|
|
16
|
+
*/
|
|
17
|
+
constructor(exception: Error);
|
|
18
|
+
/**
|
|
19
|
+
* Returns a string representation of the error.
|
|
20
|
+
* @returns A string representation of the error.
|
|
21
|
+
*/
|
|
22
|
+
toString(): string;
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=operation-error.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operation-error.d.ts","sourceRoot":"","sources":["../../src/operation-error.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,qBAAa,cAAc;IACzB;;OAEG;IACH,SAAgB,SAAS,EAAE,KAAK,CAAC;IAEjC;;OAEG;IACH,IAAW,OAAO,IAAI,MAAM,CAE3B;IAED;;;OAGG;gBACS,SAAS,EAAE,KAAK;IAO5B;;;OAGG;IACI,QAAQ,IAAI,MAAM;CAG1B"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
|
2
|
+
// Licensed under the MIT License.
|
|
3
|
+
/**
|
|
4
|
+
* Encapsulates an error from an operation.
|
|
5
|
+
*/
|
|
6
|
+
export class OperationError {
|
|
7
|
+
/**
|
|
8
|
+
* Gets the message associated with the error.
|
|
9
|
+
*/
|
|
10
|
+
get message() {
|
|
11
|
+
return this.exception.message;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Initializes a new instance of the OperationError class.
|
|
15
|
+
* @param exception The exception associated with the error.
|
|
16
|
+
*/
|
|
17
|
+
constructor(exception) {
|
|
18
|
+
if (!exception) {
|
|
19
|
+
throw new Error('exception is required');
|
|
20
|
+
}
|
|
21
|
+
this.exception = exception;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Returns a string representation of the error.
|
|
25
|
+
* @returns A string representation of the error.
|
|
26
|
+
*/
|
|
27
|
+
toString() {
|
|
28
|
+
return this.exception.toString();
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=operation-error.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operation-error.js","sourceRoot":"","sources":["../../src/operation-error.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC;;GAEG;AACH,MAAM,OAAO,cAAc;IAMzB;;OAEG;IACH,IAAW,OAAO;QAChB,OAAO,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC;IAChC,CAAC;IAED;;;OAGG;IACH,YAAY,SAAgB;QAC1B,IAAI,CAAC,SAAS,EAAE,CAAC;YACf,MAAM,IAAI,KAAK,CAAC,uBAAuB,CAAC,CAAC;QAC3C,CAAC;QACD,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;IAC7B,CAAC;IAED;;;OAGG;IACI,QAAQ;QACb,OAAO,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,CAAC;IACnC,CAAC;CACF"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { OperationError } from './operation-error';
|
|
2
|
+
/**
|
|
3
|
+
* Represents the result of an operation.
|
|
4
|
+
*/
|
|
5
|
+
export declare class OperationResult {
|
|
6
|
+
private static readonly _success;
|
|
7
|
+
private readonly _errors;
|
|
8
|
+
/**
|
|
9
|
+
* Gets a flag indicating whether the operation succeeded.
|
|
10
|
+
*/
|
|
11
|
+
readonly succeeded: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Gets an array of OperationError instances indicating errors that occurred during the operation.
|
|
14
|
+
*/
|
|
15
|
+
get errors(): OperationError[];
|
|
16
|
+
/**
|
|
17
|
+
* Private constructor for OperationResult.
|
|
18
|
+
* @param succeeded Whether the operation succeeded.
|
|
19
|
+
* @param errors Optional array of errors.
|
|
20
|
+
*/
|
|
21
|
+
private constructor();
|
|
22
|
+
/**
|
|
23
|
+
* Returns an OperationResult indicating a successful operation.
|
|
24
|
+
*/
|
|
25
|
+
static get success(): OperationResult;
|
|
26
|
+
/**
|
|
27
|
+
* Creates an OperationResult indicating a failed operation, with a list of errors if applicable.
|
|
28
|
+
* @param errors An optional array of OperationError which caused the operation to fail.
|
|
29
|
+
* @returns An OperationResult indicating a failed operation, with a list of errors if applicable.
|
|
30
|
+
*/
|
|
31
|
+
static failed(...errors: OperationError[]): OperationResult;
|
|
32
|
+
/**
|
|
33
|
+
* Converts the value of the current OperationResult object to its equivalent string representation.
|
|
34
|
+
* @returns A string representation of the current OperationResult object.
|
|
35
|
+
* @remarks
|
|
36
|
+
* If the operation was successful the toString() will return "Succeeded" otherwise it will return
|
|
37
|
+
* "Failed : " followed by a comma delimited list of error messages from its errors collection, if any.
|
|
38
|
+
*/
|
|
39
|
+
toString(): string;
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=operation-result.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operation-result.d.ts","sourceRoot":"","sources":["../../src/operation-result.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEnD;;GAEG;AACH,qBAAa,eAAe;IAC1B,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAA6B;IAC7D,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAmB;IAE3C;;OAEG;IACH,SAAgB,SAAS,EAAE,OAAO,CAAC;IAEnC;;OAEG;IACH,IAAW,MAAM,IAAI,cAAc,EAAE,CAEpC;IAED;;;;OAIG;IACH,OAAO;IAKP;;OAEG;IACH,WAAkB,OAAO,IAAI,eAAe,CAE3C;IAED;;;;OAIG;WACW,MAAM,CAAC,GAAG,MAAM,EAAE,cAAc,EAAE,GAAG,eAAe;IAIlE;;;;;;OAMG;IACI,QAAQ,IAAI,MAAM;CAQ1B"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
|
2
|
+
// Licensed under the MIT License.
|
|
3
|
+
/**
|
|
4
|
+
* Represents the result of an operation.
|
|
5
|
+
*/
|
|
6
|
+
export class OperationResult {
|
|
7
|
+
/**
|
|
8
|
+
* Gets an array of OperationError instances indicating errors that occurred during the operation.
|
|
9
|
+
*/
|
|
10
|
+
get errors() {
|
|
11
|
+
return this._errors || [];
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Private constructor for OperationResult.
|
|
15
|
+
* @param succeeded Whether the operation succeeded.
|
|
16
|
+
* @param errors Optional array of errors.
|
|
17
|
+
*/
|
|
18
|
+
constructor(succeeded, errors) {
|
|
19
|
+
this.succeeded = succeeded;
|
|
20
|
+
this._errors = errors || [];
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Returns an OperationResult indicating a successful operation.
|
|
24
|
+
*/
|
|
25
|
+
static get success() {
|
|
26
|
+
return OperationResult._success;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Creates an OperationResult indicating a failed operation, with a list of errors if applicable.
|
|
30
|
+
* @param errors An optional array of OperationError which caused the operation to fail.
|
|
31
|
+
* @returns An OperationResult indicating a failed operation, with a list of errors if applicable.
|
|
32
|
+
*/
|
|
33
|
+
static failed(...errors) {
|
|
34
|
+
return new OperationResult(false, errors.length > 0 ? errors : []);
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Converts the value of the current OperationResult object to its equivalent string representation.
|
|
38
|
+
* @returns A string representation of the current OperationResult object.
|
|
39
|
+
* @remarks
|
|
40
|
+
* If the operation was successful the toString() will return "Succeeded" otherwise it will return
|
|
41
|
+
* "Failed : " followed by a comma delimited list of error messages from its errors collection, if any.
|
|
42
|
+
*/
|
|
43
|
+
toString() {
|
|
44
|
+
if (this.succeeded) {
|
|
45
|
+
return 'Succeeded';
|
|
46
|
+
}
|
|
47
|
+
const errorMessages = this.errors.map(e => e.message).join(', ');
|
|
48
|
+
return `Failed : ${errorMessages}`;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
OperationResult._success = new OperationResult(true);
|
|
52
|
+
//# sourceMappingURL=operation-result.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operation-result.js","sourceRoot":"","sources":["../../src/operation-result.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAIlC;;GAEG;AACH,MAAM,OAAO,eAAe;IAS1B;;OAEG;IACH,IAAW,MAAM;QACf,OA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AAY,
|
|
1
|
+
{"version":3,"file":"utility.d.ts","sourceRoot":"","sources":["../../src/utility.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAMxD;;GAEG;AACH,qBAAa,OAAO;IAClB;;;;OAIG;WACW,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;IAoBtD;;;;;OAKG;WACW,oBAAoB,CAAC,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM;IASnF;;;;OAIG;WACW,kBAAkB,CAAC,YAAY,CAAC,EAAE,MAAM,GAAG,MAAM;CAKhE"}
|
package/dist/esm/utility.js
CHANGED
|
@@ -48,7 +48,7 @@ export class Utility {
|
|
|
48
48
|
* @param orchestrator Optional orchestrator identifier to include in the User-Agent string.
|
|
49
49
|
* @returns Formatted User-Agent header string.
|
|
50
50
|
*/
|
|
51
|
-
static GetUserAgentHeader(orchestrator
|
|
51
|
+
static GetUserAgentHeader(orchestrator) {
|
|
52
52
|
const osType = os.type();
|
|
53
53
|
const orchestratorPart = orchestrator ? `; ${orchestrator}` : '';
|
|
54
54
|
return `Agent365SDK/${LIB_VERSION} (${osType}; Node.js ${process.version}${orchestratorPart})`;
|
package/dist/esm/utility.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utility.js","sourceRoot":"","sources":["../../src/utility.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,KAAK,GAAG,MAAM,cAAc,CAAC;AACpC,OAAO,EAAE,MAAM,IAAI,CAAC;AAEpB,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAExC;;GAEG;AACH,MAAM,OAAO,OAAO;IAClB;;;;OAIG;IACI,MAAM,CAAC,iBAAiB,CAAC,KAAa;QAC3C,IAAI,CAAC,KAAK,IAAI,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC;YAClC,OAAO,sCAA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YACH,MAAM,OAAO,GAAG,GAAG,CAAC,MAAM,CAAC,KAAK,CAAmB,CAAC;YACpD,IAAI,CAAC,OAAO,EAAE,CAAC;gBACb,OAAO,EAAE,CAAC;YACZ,CAAC;YAED,yDAAyD;YACzD,MAAM,UAAU,GAAG,OAAO,CAAC,OAAO,CAAC,IAAI,OAAO,CAAC,KAAK,CAAC,CAAC;YACtD,OAAO,UAAU,IAAI,EAAE,CAAC;QAC1B,CAAC;QAAC,OAAO,MAAM,EAAE,CAAC;YAChB,gEAAgE;YAChE,OAAO,EAAE,CAAC;QACZ,CAAC;IACH,CAAC;IAED;;;;;OAKG;IACI,MAAM,CAAC,oBAAoB,CAAC,OAAoB,EAAE,SAAiB;QACxE,gDAAgD;QAChD,MAAM,YAAY,GAAG,OAAO,CAAC,QAAQ,CAAC,gBAAgB,EAAE;YACtD,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,oBAAoB,EAAE,IAAI,EAAE;YAC/C,CAAC,CAAC,IAAI,CAAC,iBAAiB,CAAC,SAAS,CAAC,CAAC;QAEtC,OAAO,YAAY,CAAC;IACtB,CAAC;IAED;;;;OAIG;IACI,MAAM,CAAC,kBAAkB,CAAC,YAAqB;QACpD,MAAM,MAAM,GAAG,EAAE,CAAC,IAAI,EAAE,CAAC;QACzB,MAAM,gBAAgB,GAAG,YAAY,CAAC,CAAC,CAAC,KAAK,YAAY,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACjE,OAAO,eAAe,WAAW,KAAK,MAAM,aAAa,OAAO,CAAC,OAAO,GAAG,gBAAgB,GAAG,CAAC;IACjG,CAAC;CACF"}
|
package/dist/esm/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const LIB_VERSION = "0.1.0-preview.
|
|
1
|
+
export declare const LIB_VERSION = "0.1.0-preview.83";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/dist/esm/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const LIB_VERSION = "0.1.0-preview.
|
|
1
|
+
export const LIB_VERSION = "0.1.0-preview.83";
|
|
2
2
|
//# sourceMappingURL=version.js.map
|
package/package.json
CHANGED