@microsoft/agents-a365-runtime 0.1.0-preview.63 → 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.
Files changed (44) hide show
  1. package/LICENSE.md +21 -0
  2. package/dist/cjs/environment-utils.d.ts +8 -1
  3. package/dist/cjs/environment-utils.d.ts.map +1 -1
  4. package/dist/cjs/environment-utils.js +12 -2
  5. package/dist/cjs/environment-utils.js.map +1 -1
  6. package/dist/cjs/index.d.ts +2 -0
  7. package/dist/cjs/index.d.ts.map +1 -1
  8. package/dist/cjs/index.js +2 -0
  9. package/dist/cjs/index.js.map +1 -1
  10. package/dist/cjs/operation-error.d.ts +24 -0
  11. package/dist/cjs/operation-error.d.ts.map +1 -0
  12. package/dist/cjs/operation-error.js +35 -0
  13. package/dist/cjs/operation-error.js.map +1 -0
  14. package/dist/cjs/operation-result.d.ts +41 -0
  15. package/dist/cjs/operation-result.d.ts.map +1 -0
  16. package/dist/cjs/operation-result.js +56 -0
  17. package/dist/cjs/operation-result.js.map +1 -0
  18. package/dist/cjs/utility.d.ts.map +1 -1
  19. package/dist/cjs/utility.js +1 -1
  20. package/dist/cjs/utility.js.map +1 -1
  21. package/dist/cjs/version.d.ts +1 -1
  22. package/dist/cjs/version.js +1 -1
  23. package/dist/esm/environment-utils.d.ts +8 -1
  24. package/dist/esm/environment-utils.d.ts.map +1 -1
  25. package/dist/esm/environment-utils.js +12 -2
  26. package/dist/esm/environment-utils.js.map +1 -1
  27. package/dist/esm/index.d.ts +2 -0
  28. package/dist/esm/index.d.ts.map +1 -1
  29. package/dist/esm/index.js +2 -0
  30. package/dist/esm/index.js.map +1 -1
  31. package/dist/esm/operation-error.d.ts +24 -0
  32. package/dist/esm/operation-error.d.ts.map +1 -0
  33. package/dist/esm/operation-error.js +31 -0
  34. package/dist/esm/operation-error.js.map +1 -0
  35. package/dist/esm/operation-result.d.ts +41 -0
  36. package/dist/esm/operation-result.d.ts.map +1 -0
  37. package/dist/esm/operation-result.js +52 -0
  38. package/dist/esm/operation-result.js.map +1 -0
  39. package/dist/esm/utility.d.ts.map +1 -1
  40. package/dist/esm/utility.js +1 -1
  41. package/dist/esm/utility.js.map +1 -1
  42. package/dist/esm/version.d.ts +1 -1
  43. package/dist/esm/version.js +1 -1
  44. package/package.json +32 -33
package/LICENSE.md ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Microsoft
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -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
- * @returns The authentication scope for the current environment.
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;;;;GAIG;AACH,wBAAgB,mCAAmC,IAAI,MAAM,EAAE,CAG9D;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,IAAI,MAAM,CAQ3C;AAED;;;;GAIG;AACH,wBAAgB,wBAAwB,IAAI,OAAO,CAGlD;AAED;;;;GAIG;AACH,wBAAgB,iCAAiC,IAAI,MAAM,CAE1D"}
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
- * @returns The authentication scope for the current environment.
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
- // Always return production scope
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;;;AAmBjF,kFAGC;AAOD,gDAQC;AAOD,4DAGC;AAOD,8EAEC;AAtDD;;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;;;;GAIG;AACH,SAAgB,mCAAmC;IACjD,iCAAiC;IACjC,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,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AAwB;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"}
@@ -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
@@ -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
@@ -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,GAAE,MAAW,GAAG,MAAM;CAKpE"}
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"}
@@ -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})`;
@@ -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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C,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,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"}
@@ -1,2 +1,2 @@
1
- export declare const LIB_VERSION = "0.1.0-preview.63";
1
+ export declare const LIB_VERSION = "0.1.0-preview.83";
2
2
  //# sourceMappingURL=version.d.ts.map
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.LIB_VERSION = void 0;
4
- exports.LIB_VERSION = "0.1.0-preview.63";
4
+ exports.LIB_VERSION = "0.1.0-preview.83";
5
5
  //# sourceMappingURL=version.js.map
@@ -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
- * @returns The authentication scope for the current environment.
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;;;;GAIG;AACH,wBAAgB,mCAAmC,IAAI,MAAM,EAAE,CAG9D;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,IAAI,MAAM,CAQ3C;AAED;;;;GAIG;AACH,wBAAgB,wBAAwB,IAAI,OAAO,CAGlD;AAED;;;;GAIG;AACH,wBAAgB,iCAAiC,IAAI,MAAM,CAE1D"}
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
- * @returns The authentication scope for the current environment.
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
- // Always return production scope
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;;;;GAIG;AACH,MAAM,UAAU,mCAAmC;IACjD,iCAAiC;IACjC,OAAO,CAAC,wBAAwB,CAAC,CAAC;AACpC,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,kBAAkB;IAChC,MAAM,eAAe,GAAG,OAAO,CAAC,GAAG,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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"}
@@ -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
@@ -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
@@ -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,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;;AAvDuB,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,GAAE,MAAW,GAAG,MAAM;CAKpE"}
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"}
@@ -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})`;
@@ -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,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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BACb,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"}
@@ -1,2 +1,2 @@
1
- export declare const LIB_VERSION = "0.1.0-preview.63";
1
+ export declare const LIB_VERSION = "0.1.0-preview.83";
2
2
  //# sourceMappingURL=version.d.ts.map
@@ -1,2 +1,2 @@
1
- export const LIB_VERSION = "0.1.0-preview.63";
1
+ export const LIB_VERSION = "0.1.0-preview.83";
2
2
  //# sourceMappingURL=version.js.map
package/package.json CHANGED
@@ -1,25 +1,10 @@
1
1
  {
2
2
  "name": "@microsoft/agents-a365-runtime",
3
- "version": "0.1.0-preview.63",
3
+ "version": "0.1.0-preview.83",
4
4
  "description": "Agent 365 Runtime SDK for AI agents built with TypeScript/Node.js",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
7
7
  "types": "dist/esm/index.d.ts",
8
- "scripts": {
9
- "prebuild": "node -p \"'export const LIB_VERSION = ' + JSON.stringify(require('./package.json').version) + ';'\" > src/version.ts",
10
- "build:cjs": "npx tsc --project tsconfig.cjs.json",
11
- "build:esm": "npx tsc --project tsconfig.esm.json",
12
- "build": "npm run build:cjs && npm run build:esm",
13
- "build:watch": "npx tsc --watch",
14
- "clean": "npx rimraf dist",
15
- "test": "jest --passWithNoTests",
16
- "test:watch": "jest --watch",
17
- "lint": "eslint src/**/*.ts",
18
- "lint:fix": "eslint src/**/*.ts --fix",
19
- "prepublishOnly": "npm run clean && npm run build",
20
- "ci": "npm ci",
21
- "pack": "node ../../copyFiles.js . && pnpm pack --pack-destination=../"
22
- },
23
8
  "keywords": [
24
9
  "ai",
25
10
  "agents",
@@ -34,23 +19,23 @@
34
19
  "directory": "packages/agents-a365-runtime"
35
20
  },
36
21
  "dependencies": {
37
- "@azure/identity": "catalog:",
38
- "@microsoft/agents-hosting": "catalog:",
39
- "jsonwebtoken": "catalog:"
22
+ "@azure/identity": "^4.12.1",
23
+ "@microsoft/agents-hosting": "^1.1.0-alpha.85",
24
+ "jsonwebtoken": "^9.0.3"
40
25
  },
41
26
  "devDependencies": {
42
- "@eslint/js": "catalog:",
43
- "@types/jest": "catalog:",
44
- "@types/jsonwebtoken": "catalog:",
45
- "@types/node": "catalog:",
46
- "@typescript-eslint/eslint-plugin": "catalog:",
47
- "@typescript-eslint/parser": "catalog:",
48
- "eslint": "catalog:",
49
- "jest": "catalog:",
50
- "rimraf": "catalog:",
51
- "ts-jest": "catalog:",
52
- "typescript": "catalog:",
53
- "typescript-eslint": "catalog:"
27
+ "@eslint/js": "^9.39.1",
28
+ "@types/jest": "^30.0.0",
29
+ "@types/jsonwebtoken": "^9.0.10",
30
+ "@types/node": "^20.17.0",
31
+ "@typescript-eslint/eslint-plugin": "^8.47.0",
32
+ "@typescript-eslint/parser": "^8.47.0",
33
+ "eslint": "^9.39.1",
34
+ "jest": "^30.2.0",
35
+ "rimraf": "^6.0.0",
36
+ "ts-jest": "^29.4.5",
37
+ "typescript": "^5.9.3",
38
+ "typescript-eslint": "^8.47.0"
54
39
  },
55
40
  "engines": {
56
41
  "node": ">=18.0.0"
@@ -60,5 +45,19 @@
60
45
  "README.md",
61
46
  "CHANGELOG.md",
62
47
  "LICENSE.md"
63
- ]
64
- }
48
+ ],
49
+ "scripts": {
50
+ "prebuild": "node -p \"'export const LIB_VERSION = ' + JSON.stringify(require('./package.json').version) + ';'\" > src/version.ts",
51
+ "build:cjs": "npx tsc --project tsconfig.cjs.json",
52
+ "build:esm": "npx tsc --project tsconfig.esm.json",
53
+ "build": "npm run build:cjs && npm run build:esm",
54
+ "build:watch": "npx tsc --watch",
55
+ "clean": "npx rimraf dist",
56
+ "test": "jest --passWithNoTests",
57
+ "test:watch": "jest --watch",
58
+ "lint": "eslint src/**/*.ts",
59
+ "lint:fix": "eslint src/**/*.ts --fix",
60
+ "ci": "npm ci",
61
+ "pack": "node ../../copyFiles.js . && pnpm pack --pack-destination=../"
62
+ }
63
+ }