@microsoft/agents-a365-runtime 0.1.0-preview.93 → 0.2.0-preview.1

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 (89) hide show
  1. package/dist/cjs/agentic-authorization-service.d.ts +23 -0
  2. package/dist/cjs/agentic-authorization-service.d.ts.map +1 -1
  3. package/dist/cjs/agentic-authorization-service.js +7 -3
  4. package/dist/cjs/agentic-authorization-service.js.map +1 -1
  5. package/dist/cjs/configuration/DefaultConfigurationProvider.d.ts +39 -0
  6. package/dist/cjs/configuration/DefaultConfigurationProvider.d.ts.map +1 -0
  7. package/dist/cjs/configuration/DefaultConfigurationProvider.js +47 -0
  8. package/dist/cjs/configuration/DefaultConfigurationProvider.js.map +1 -0
  9. package/dist/cjs/configuration/IConfigurationProvider.d.ts +8 -0
  10. package/dist/cjs/configuration/IConfigurationProvider.d.ts.map +1 -0
  11. package/dist/cjs/configuration/IConfigurationProvider.js +5 -0
  12. package/dist/cjs/configuration/IConfigurationProvider.js.map +1 -0
  13. package/dist/cjs/configuration/RuntimeConfiguration.d.ts +35 -0
  14. package/dist/cjs/configuration/RuntimeConfiguration.d.ts.map +1 -0
  15. package/dist/cjs/configuration/RuntimeConfiguration.js +71 -0
  16. package/dist/cjs/configuration/RuntimeConfiguration.js.map +1 -0
  17. package/dist/cjs/configuration/RuntimeConfigurationOptions.d.ts +35 -0
  18. package/dist/cjs/configuration/RuntimeConfigurationOptions.d.ts.map +1 -0
  19. package/dist/cjs/configuration/RuntimeConfigurationOptions.js +5 -0
  20. package/dist/cjs/configuration/RuntimeConfigurationOptions.js.map +1 -0
  21. package/dist/cjs/configuration/index.d.ts +5 -0
  22. package/dist/cjs/configuration/index.d.ts.map +1 -0
  23. package/dist/cjs/configuration/index.js +23 -0
  24. package/dist/cjs/configuration/index.js.map +1 -0
  25. package/dist/cjs/environment-utils.d.ts +69 -11
  26. package/dist/cjs/environment-utils.d.ts.map +1 -1
  27. package/dist/cjs/environment-utils.js +79 -26
  28. package/dist/cjs/environment-utils.js.map +1 -1
  29. package/dist/cjs/index.d.ts +2 -1
  30. package/dist/cjs/index.d.ts.map +1 -1
  31. package/dist/cjs/index.js +4 -1
  32. package/dist/cjs/index.js.map +1 -1
  33. package/dist/cjs/power-platform-api-discovery.d.ts +18 -1
  34. package/dist/cjs/power-platform-api-discovery.d.ts.map +1 -1
  35. package/dist/cjs/power-platform-api-discovery.js +22 -3
  36. package/dist/cjs/power-platform-api-discovery.js.map +1 -1
  37. package/dist/cjs/utility.d.ts +48 -1
  38. package/dist/cjs/utility.d.ts.map +1 -1
  39. package/dist/cjs/utility.js +91 -1
  40. package/dist/cjs/utility.js.map +1 -1
  41. package/dist/cjs/version.d.ts +1 -1
  42. package/dist/cjs/version.d.ts.map +1 -1
  43. package/dist/cjs/version.js +1 -1
  44. package/dist/cjs/version.js.map +1 -1
  45. package/dist/esm/agentic-authorization-service.d.ts +23 -0
  46. package/dist/esm/agentic-authorization-service.d.ts.map +1 -1
  47. package/dist/esm/agentic-authorization-service.js +8 -4
  48. package/dist/esm/agentic-authorization-service.js.map +1 -1
  49. package/dist/esm/configuration/DefaultConfigurationProvider.d.ts +39 -0
  50. package/dist/esm/configuration/DefaultConfigurationProvider.d.ts.map +1 -0
  51. package/dist/esm/configuration/DefaultConfigurationProvider.js +43 -0
  52. package/dist/esm/configuration/DefaultConfigurationProvider.js.map +1 -0
  53. package/dist/esm/configuration/IConfigurationProvider.d.ts +8 -0
  54. package/dist/esm/configuration/IConfigurationProvider.d.ts.map +1 -0
  55. package/dist/esm/configuration/IConfigurationProvider.js +4 -0
  56. package/dist/esm/configuration/IConfigurationProvider.js.map +1 -0
  57. package/dist/esm/configuration/RuntimeConfiguration.d.ts +35 -0
  58. package/dist/esm/configuration/RuntimeConfiguration.d.ts.map +1 -0
  59. package/dist/esm/configuration/RuntimeConfiguration.js +67 -0
  60. package/dist/esm/configuration/RuntimeConfiguration.js.map +1 -0
  61. package/dist/esm/configuration/RuntimeConfigurationOptions.d.ts +35 -0
  62. package/dist/esm/configuration/RuntimeConfigurationOptions.d.ts.map +1 -0
  63. package/dist/esm/configuration/RuntimeConfigurationOptions.js +4 -0
  64. package/dist/esm/configuration/RuntimeConfigurationOptions.js.map +1 -0
  65. package/dist/esm/configuration/index.d.ts +5 -0
  66. package/dist/esm/configuration/index.d.ts.map +1 -0
  67. package/dist/esm/configuration/index.js +7 -0
  68. package/dist/esm/configuration/index.js.map +1 -0
  69. package/dist/esm/environment-utils.d.ts +69 -11
  70. package/dist/esm/environment-utils.d.ts.map +1 -1
  71. package/dist/esm/environment-utils.js +79 -26
  72. package/dist/esm/environment-utils.js.map +1 -1
  73. package/dist/esm/index.d.ts +2 -1
  74. package/dist/esm/index.d.ts.map +1 -1
  75. package/dist/esm/index.js +4 -1
  76. package/dist/esm/index.js.map +1 -1
  77. package/dist/esm/power-platform-api-discovery.d.ts +18 -1
  78. package/dist/esm/power-platform-api-discovery.d.ts.map +1 -1
  79. package/dist/esm/power-platform-api-discovery.js +21 -2
  80. package/dist/esm/power-platform-api-discovery.js.map +1 -1
  81. package/dist/esm/utility.d.ts +48 -1
  82. package/dist/esm/utility.d.ts.map +1 -1
  83. package/dist/esm/utility.js +91 -1
  84. package/dist/esm/utility.js.map +1 -1
  85. package/dist/esm/version.d.ts +1 -1
  86. package/dist/esm/version.d.ts.map +1 -1
  87. package/dist/esm/version.js +1 -1
  88. package/dist/esm/version.js.map +1 -1
  89. package/package.json +2 -2
@@ -0,0 +1,43 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT License.
3
+ import { RuntimeConfiguration } from './RuntimeConfiguration';
4
+ /**
5
+ * Default provider that returns environment-based configuration.
6
+ *
7
+ * **Multi-tenant considerations:**
8
+ * This provider creates a single configuration instance at construction time,
9
+ * shared across all requests in a process. The default module-level providers
10
+ * (e.g., `defaultRuntimeConfigurationProvider`) are singletons.
11
+ *
12
+ * For multi-tenant scenarios, two approaches are supported:
13
+ *
14
+ * 1. **Dynamic override functions (recommended):** Pass override functions that
15
+ * read from async context (e.g., OpenTelemetry baggage) at runtime. The same
16
+ * Configuration instance returns different values per request.
17
+ * ```typescript
18
+ * const config = new ToolingConfiguration({
19
+ * mcpPlatformEndpoint: () => {
20
+ * const tenantConfig = context.active().getValue(TENANT_KEY);
21
+ * return tenantConfig?.endpoint ?? 'https://default.endpoint';
22
+ * }
23
+ * });
24
+ * ```
25
+ *
26
+ * 2. **Per-tenant providers:** Create separate provider instances for each tenant
27
+ * when different tenants need different override functions entirely.
28
+ */
29
+ export class DefaultConfigurationProvider {
30
+ constructor(factory) {
31
+ this._configuration = factory();
32
+ }
33
+ getConfiguration() {
34
+ return this._configuration;
35
+ }
36
+ }
37
+ /**
38
+ * Shared default provider for RuntimeConfiguration.
39
+ * Uses environment variables with no overrides - suitable for single-tenant
40
+ * deployments or when using dynamic override functions for multi-tenancy.
41
+ */
42
+ export const defaultRuntimeConfigurationProvider = new DefaultConfigurationProvider(() => new RuntimeConfiguration());
43
+ //# sourceMappingURL=DefaultConfigurationProvider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DefaultConfigurationProvider.js","sourceRoot":"","sources":["../../../src/configuration/DefaultConfigurationProvider.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAE9D;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,OAAO,4BAA4B;IAKvC,YAAY,OAAgB;QAC1B,IAAI,CAAC,cAAc,GAAG,OAAO,EAAE,CAAC;IAClC,CAAC;IAED,gBAAgB;QACd,OAAO,IAAI,CAAC,cAAc,CAAC;IAC7B,CAAC;CACF;AAED;;;;GAIG;AACH,MAAM,CAAC,MAAM,mCAAmC,GAC9C,IAAI,4BAA4B,CAAC,GAAG,EAAE,CAAC,IAAI,oBAAoB,EAAE,CAAC,CAAC"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Generic interface for providing configuration.
3
+ * Each package defines its own configuration type T.
4
+ */
5
+ export interface IConfigurationProvider<T> {
6
+ getConfiguration(): T;
7
+ }
8
+ //# sourceMappingURL=IConfigurationProvider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IConfigurationProvider.d.ts","sourceRoot":"","sources":["../../../src/configuration/IConfigurationProvider.ts"],"names":[],"mappings":"AAGA;;;GAGG;AACH,MAAM,WAAW,sBAAsB,CAAC,CAAC;IACvC,gBAAgB,IAAI,CAAC,CAAC;CACvB"}
@@ -0,0 +1,4 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT License.
3
+ export {};
4
+ //# sourceMappingURL=IConfigurationProvider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IConfigurationProvider.js","sourceRoot":"","sources":["../../../src/configuration/IConfigurationProvider.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC"}
@@ -0,0 +1,35 @@
1
+ import { ClusterCategory } from '../power-platform-api-discovery';
2
+ import { RuntimeConfigurationOptions } from './RuntimeConfigurationOptions';
3
+ /**
4
+ * Base configuration class for Agent365 SDK.
5
+ * Other packages extend this to add their own settings.
6
+ *
7
+ * Override functions are called on each property access, enabling dynamic
8
+ * resolution from async context (e.g., OpenTelemetry baggage) per-request.
9
+ */
10
+ export declare class RuntimeConfiguration {
11
+ protected readonly overrides: RuntimeConfigurationOptions;
12
+ /**
13
+ * Parse an environment variable as a boolean.
14
+ * Recognizes 'true', '1', 'yes', 'on' (case-insensitive) as true; all other values as false.
15
+ */
16
+ static parseEnvBoolean(envValue: string | undefined): boolean;
17
+ /**
18
+ * Parse an environment variable as an integer, returning fallback if invalid or not set.
19
+ */
20
+ static parseEnvInt(envValue: string | undefined, fallback: number): number;
21
+ constructor(overrides?: RuntimeConfigurationOptions);
22
+ get clusterCategory(): ClusterCategory;
23
+ /**
24
+ * Whether the cluster is a development environment (local or dev).
25
+ * Based on clusterCategory.
26
+ */
27
+ get isDevelopmentEnvironment(): boolean;
28
+ /**
29
+ * Whether NODE_ENV indicates development mode.
30
+ * Returns true when NODE_ENV is 'development' (case-insensitive).
31
+ * This is the standard Node.js way of indicating development mode.
32
+ */
33
+ get isNodeEnvDevelopment(): boolean;
34
+ }
35
+ //# sourceMappingURL=RuntimeConfiguration.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RuntimeConfiguration.d.ts","sourceRoot":"","sources":["../../../src/configuration/RuntimeConfiguration.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAClE,OAAO,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AAE5E;;;;;;GAMG;AACH,qBAAa,oBAAoB;IAC/B,SAAS,CAAC,QAAQ,CAAC,SAAS,EAAE,2BAA2B,CAAC;IAE1D;;;OAGG;WACW,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO;IAKpE;;OAEG;WACW,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM;gBAMrE,SAAS,CAAC,EAAE,2BAA2B;IAInD,IAAI,eAAe,IAAI,eAAe,CAarC;IAED;;;OAGG;IACH,IAAI,wBAAwB,IAAI,OAAO,CAEtC;IAED;;;;OAIG;IACH,IAAI,oBAAoB,IAAI,OAAO,CAMlC;CACF"}
@@ -0,0 +1,67 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT License.
3
+ import { ClusterCategory } from '../power-platform-api-discovery';
4
+ /**
5
+ * Base configuration class for Agent365 SDK.
6
+ * Other packages extend this to add their own settings.
7
+ *
8
+ * Override functions are called on each property access, enabling dynamic
9
+ * resolution from async context (e.g., OpenTelemetry baggage) per-request.
10
+ */
11
+ export class RuntimeConfiguration {
12
+ /**
13
+ * Parse an environment variable as a boolean.
14
+ * Recognizes 'true', '1', 'yes', 'on' (case-insensitive) as true; all other values as false.
15
+ */
16
+ static parseEnvBoolean(envValue) {
17
+ if (!envValue)
18
+ return false;
19
+ return ['true', '1', 'yes', 'on'].includes(envValue.toLowerCase());
20
+ }
21
+ /**
22
+ * Parse an environment variable as an integer, returning fallback if invalid or not set.
23
+ */
24
+ static parseEnvInt(envValue, fallback) {
25
+ if (!envValue)
26
+ return fallback;
27
+ const parsed = parseInt(envValue, 10);
28
+ return Number.isFinite(parsed) ? parsed : fallback;
29
+ }
30
+ constructor(overrides) {
31
+ this.overrides = overrides ?? {};
32
+ }
33
+ get clusterCategory() {
34
+ if (this.overrides.clusterCategory) {
35
+ return this.overrides.clusterCategory();
36
+ }
37
+ const envValue = process.env.CLUSTER_CATEGORY;
38
+ if (envValue) {
39
+ const normalized = envValue.toLowerCase();
40
+ if (Object.values(ClusterCategory).includes(normalized)) {
41
+ return normalized;
42
+ }
43
+ // Invalid value - fall through to default
44
+ }
45
+ return ClusterCategory.prod;
46
+ }
47
+ /**
48
+ * Whether the cluster is a development environment (local or dev).
49
+ * Based on clusterCategory.
50
+ */
51
+ get isDevelopmentEnvironment() {
52
+ return [ClusterCategory.local, ClusterCategory.dev].includes(this.clusterCategory);
53
+ }
54
+ /**
55
+ * Whether NODE_ENV indicates development mode.
56
+ * Returns true when NODE_ENV is 'development' (case-insensitive).
57
+ * This is the standard Node.js way of indicating development mode.
58
+ */
59
+ get isNodeEnvDevelopment() {
60
+ const override = this.overrides.isNodeEnvDevelopment?.();
61
+ if (override !== undefined)
62
+ return override;
63
+ const nodeEnv = process.env.NODE_ENV ?? '';
64
+ return nodeEnv.toLowerCase() === 'development';
65
+ }
66
+ }
67
+ //# sourceMappingURL=RuntimeConfiguration.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RuntimeConfiguration.js","sourceRoot":"","sources":["../../../src/configuration/RuntimeConfiguration.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAGlE;;;;;;GAMG;AACH,MAAM,OAAO,oBAAoB;IAG/B;;;OAGG;IACI,MAAM,CAAC,eAAe,CAAC,QAA4B;QACxD,IAAI,CAAC,QAAQ;YAAE,OAAO,KAAK,CAAC;QAC5B,OAAO,CAAC,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,WAAW,EAAE,CAAC,CAAC;IACrE,CAAC;IAED;;OAEG;IACI,MAAM,CAAC,WAAW,CAAC,QAA4B,EAAE,QAAgB;QACtE,IAAI,CAAC,QAAQ;YAAE,OAAO,QAAQ,CAAC;QAC/B,MAAM,MAAM,GAAG,QAAQ,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;QACtC,OAAO,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC;IACrD,CAAC;IAED,YAAY,SAAuC;QACjD,IAAI,CAAC,SAAS,GAAG,SAAS,IAAI,EAAE,CAAC;IACnC,CAAC;IAED,IAAI,eAAe;QACjB,IAAI,IAAI,CAAC,SAAS,CAAC,eAAe,EAAE,CAAC;YACnC,OAAO,IAAI,CAAC,SAAS,CAAC,eAAe,EAAE,CAAC;QAC1C,CAAC;QACD,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,gBAAgB,CAAC;QAC9C,IAAI,QAAQ,EAAE,CAAC;YACb,MAAM,UAAU,GAAG,QAAQ,CAAC,WAAW,EAAE,CAAC;YAC1C,IAAI,MAAM,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC,QAAQ,CAAC,UAA6B,CAAC,EAAE,CAAC;gBAC3E,OAAO,UAA6B,CAAC;YACvC,CAAC;YACD,0CAA0C;QAC5C,CAAC;QACD,OAAO,eAAe,CAAC,IAAI,CAAC;IAC9B,CAAC;IAED;;;OAGG;IACH,IAAI,wBAAwB;QAC1B,OAAO,CAAC,eAAe,CAAC,KAAK,EAAE,eAAe,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;IACrF,CAAC;IAED;;;;OAIG;IACH,IAAI,oBAAoB;QACtB,MAAM,QAAQ,GAAG,IAAI,CAAC,SAAS,CAAC,oBAAoB,EAAE,EAAE,CAAC;QACzD,IAAI,QAAQ,KAAK,SAAS;YAAE,OAAO,QAAQ,CAAC;QAE5C,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,IAAI,EAAE,CAAC;QAC3C,OAAO,OAAO,CAAC,WAAW,EAAE,KAAK,aAAa,CAAC;IACjD,CAAC;CACF"}
@@ -0,0 +1,35 @@
1
+ import { ClusterCategory } from '../power-platform-api-discovery';
2
+ /**
3
+ * Runtime configuration options - all optional functions.
4
+ * Functions are called on each property access, enabling dynamic resolution.
5
+ * Unset values fall back to environment variables.
6
+ */
7
+ export type RuntimeConfigurationOptions = {
8
+ /**
9
+ * Override function for cluster category.
10
+ * Called on each property access to enable dynamic per-request resolution.
11
+ * Falls back to CLUSTER_CATEGORY env var, then 'prod'.
12
+ *
13
+ * @example
14
+ * // Static override
15
+ * { clusterCategory: () => ClusterCategory.gov }
16
+ *
17
+ * // Dynamic per-tenant override using async context
18
+ * { clusterCategory: () => context.active().getValue(TENANT_CONFIG_KEY)?.cluster ?? ClusterCategory.prod }
19
+ */
20
+ clusterCategory?: () => ClusterCategory;
21
+ /**
22
+ * Override for NODE_ENV-based development mode detection.
23
+ * Called on each property access to enable dynamic per-request resolution.
24
+ * Falls back to NODE_ENV === 'development' check.
25
+ *
26
+ * @example
27
+ * // Static override
28
+ * { isNodeEnvDevelopment: () => true }
29
+ *
30
+ * // Dynamic override based on request context
31
+ * { isNodeEnvDevelopment: () => context.active().getValue(DEBUG_KEY) === true }
32
+ */
33
+ isNodeEnvDevelopment?: () => boolean;
34
+ };
35
+ //# sourceMappingURL=RuntimeConfigurationOptions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RuntimeConfigurationOptions.d.ts","sourceRoot":"","sources":["../../../src/configuration/RuntimeConfigurationOptions.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAElE;;;;GAIG;AACH,MAAM,MAAM,2BAA2B,GAAG;IACxC;;;;;;;;;;;OAWG;IACH,eAAe,CAAC,EAAE,MAAM,eAAe,CAAC;IACxC;;;;;;;;;;;OAWG;IACH,oBAAoB,CAAC,EAAE,MAAM,OAAO,CAAC;CACtC,CAAC"}
@@ -0,0 +1,4 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT License.
3
+ export {};
4
+ //# sourceMappingURL=RuntimeConfigurationOptions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RuntimeConfigurationOptions.js","sourceRoot":"","sources":["../../../src/configuration/RuntimeConfigurationOptions.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC"}
@@ -0,0 +1,5 @@
1
+ export * from './IConfigurationProvider';
2
+ export * from './RuntimeConfigurationOptions';
3
+ export * from './RuntimeConfiguration';
4
+ export * from './DefaultConfigurationProvider';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/configuration/index.ts"],"names":[],"mappings":"AAGA,cAAc,0BAA0B,CAAC;AACzC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,wBAAwB,CAAC;AACvC,cAAc,gCAAgC,CAAC"}
@@ -0,0 +1,7 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT License.
3
+ export * from './IConfigurationProvider';
4
+ export * from './RuntimeConfigurationOptions';
5
+ export * from './RuntimeConfiguration';
6
+ export * from './DefaultConfigurationProvider';
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/configuration/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,cAAc,0BAA0B,CAAC;AACzC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,wBAAwB,CAAC;AACvC,cAAc,gCAAgC,CAAC"}
@@ -1,40 +1,98 @@
1
1
  /**
2
2
  * Utility logic for environment-related operations.
3
+ *
4
+ * Note: These utility functions are maintained for backward compatibility.
5
+ * For new code, prefer using the configuration classes directly:
6
+ * - RuntimeConfiguration for clusterCategory, isDevelopmentEnvironment, isNodeEnvDevelopment
7
+ * - ToolingConfiguration for mcpPlatformAuthenticationScope
8
+ * - ObservabilityConfiguration for observabilityAuthenticationScopes
9
+ */
10
+ import { RuntimeConfiguration } from './configuration';
11
+ import { IConfigurationProvider } from './configuration/IConfigurationProvider';
12
+ /**
13
+ * Production observability authentication scope.
14
+ * @deprecated This constant is exported for backward compatibility only.
15
+ * For new code, use `ObservabilityConfiguration.observabilityAuthenticationScopes` instead.
3
16
  */
4
17
  export declare const PROD_OBSERVABILITY_SCOPE = "https://api.powerplatform.com/.default";
18
+ /**
19
+ * Production MCP platform authentication scope.
20
+ * @deprecated This constant is exported for backward compatibility only.
21
+ * For new code, use `ToolingConfiguration.mcpPlatformAuthenticationScope` instead.
22
+ */
5
23
  export declare const PROD_MCP_PLATFORM_AUTHENTICATION_SCOPE = "ea9ffc3e-8a23-4a7d-836d-234d7c7565c1/.default";
24
+ /**
25
+ * Default cluster category for production environments.
26
+ * @deprecated This constant is exported for backward compatibility only.
27
+ * For new code, use `RuntimeConfiguration.clusterCategory` instead.
28
+ */
6
29
  export declare const PROD_OBSERVABILITY_CLUSTER_CATEGORY = "prod";
7
30
  export declare const PRODUCTION_ENVIRONMENT_NAME = "production";
8
31
  export declare const DEVELOPMENT_ENVIRONMENT_NAME = "Development";
9
32
  /**
10
- * Returns the scope for authenticating to the observability service
33
+ * Returns the scope for authenticating to the observability service.
11
34
  *
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.
35
+ * @returns The authentication scopes for the current environment.
36
+ * @deprecated Use ObservabilityConfiguration.observabilityAuthenticationScopes instead.
15
37
  *
16
- * When the override is set to a non-empty string, it is split on whitespace
17
- * into individual scopes.
38
+ * @example
39
+ * // Before:
40
+ * import { getObservabilityAuthenticationScope } from '@microsoft/agents-a365-runtime';
41
+ * const scopes = getObservabilityAuthenticationScope();
18
42
  *
19
- * @returns The authentication scopes for the current environment.
43
+ * // After:
44
+ * import { defaultObservabilityConfigurationProvider } from '@microsoft/agents-a365-observability';
45
+ * const scopes = [...defaultObservabilityConfigurationProvider.getConfiguration().observabilityAuthenticationScopes];
20
46
  */
21
47
  export declare function getObservabilityAuthenticationScope(): string[];
22
48
  /**
23
49
  * Gets the cluster category from environment variables.
24
50
  *
51
+ * @param configProvider Optional configuration provider. Defaults to defaultRuntimeConfigurationProvider if not specified.
25
52
  * @returns The cluster category from CLUSTER_CATEGORY env var, defaults to 'prod'.
53
+ * @deprecated Use RuntimeConfiguration.clusterCategory instead.
54
+ *
55
+ * @example
56
+ * // Before:
57
+ * import { getClusterCategory } from '@microsoft/agents-a365-runtime';
58
+ * const cluster = getClusterCategory();
59
+ *
60
+ * // After:
61
+ * import { defaultRuntimeConfigurationProvider } from '@microsoft/agents-a365-runtime';
62
+ * const cluster = defaultRuntimeConfigurationProvider.getConfiguration().clusterCategory;
26
63
  */
27
- export declare function getClusterCategory(): string;
64
+ export declare function getClusterCategory(configProvider?: IConfigurationProvider<RuntimeConfiguration>): string;
28
65
  /**
29
66
  * Returns true if the current environment is a development environment.
30
67
  *
68
+ * @param configProvider Optional configuration provider. Defaults to defaultRuntimeConfigurationProvider if not specified.
31
69
  * @returns True if the current environment is development, false otherwise.
70
+ * @deprecated Use RuntimeConfiguration.isDevelopmentEnvironment instead.
71
+ *
72
+ * @example
73
+ * // Before:
74
+ * import { isDevelopmentEnvironment } from '@microsoft/agents-a365-runtime';
75
+ * if (isDevelopmentEnvironment()) { ... }
76
+ *
77
+ * // After:
78
+ * import { defaultRuntimeConfigurationProvider } from '@microsoft/agents-a365-runtime';
79
+ * if (defaultRuntimeConfigurationProvider.getConfiguration().isDevelopmentEnvironment) { ... }
32
80
  */
33
- export declare function isDevelopmentEnvironment(): boolean;
81
+ export declare function isDevelopmentEnvironment(configProvider?: IConfigurationProvider<RuntimeConfiguration>): boolean;
34
82
  /**
35
- * Gets the MCP platform authentication scope from environment variables.
83
+ * Gets the MCP platform authentication scope.
84
+ *
85
+ * @returns The MCP platform authentication scope.
86
+ * @deprecated Use ToolingConfiguration.mcpPlatformAuthenticationScope instead.
87
+ *
88
+ * @example
89
+ * // Before:
90
+ * import { getMcpPlatformAuthenticationScope } from '@microsoft/agents-a365-runtime';
91
+ * const scope = getMcpPlatformAuthenticationScope();
36
92
  *
37
- * @returns The MCP platform authentication scope from MCP_PLATFORM_AUTHENTICATION_SCOPE env var, defaults to production scope.
93
+ * // After:
94
+ * import { defaultToolingConfigurationProvider } from '@microsoft/agents-a365-tooling';
95
+ * const scope = defaultToolingConfigurationProvider.getConfiguration().mcpPlatformAuthenticationScope;
38
96
  */
39
97
  export declare function getMcpPlatformAuthenticationScope(): string;
40
98
  //# sourceMappingURL=environment-utils.d.ts.map
@@ -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;;;;;;;;;;;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"}
1
+ {"version":3,"file":"environment-utils.d.ts","sourceRoot":"","sources":["../../src/environment-utils.ts"],"names":[],"mappings":"AAGA;;;;;;;;GAQG;AAEH,OAAO,EAAE,oBAAoB,EAAuC,MAAM,iBAAiB,CAAC;AAC5F,OAAO,EAAE,sBAAsB,EAAE,MAAM,wCAAwC,CAAC;AAEhF;;;;GAIG;AACH,eAAO,MAAM,wBAAwB,2CAA2C,CAAC;AAEjF;;;;GAIG;AACH,eAAO,MAAM,sCAAsC,kDAAkD,CAAC;AAEtG;;;;GAIG;AACH,eAAO,MAAM,mCAAmC,SAAS,CAAC;AAG1D,eAAO,MAAM,2BAA2B,eAAe,CAAC;AACxD,eAAO,MAAM,4BAA4B,gBAAgB,CAAC;AAE1D;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,mCAAmC,IAAI,MAAM,EAAE,CAI9D;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,kBAAkB,CAChC,cAAc,CAAC,EAAE,sBAAsB,CAAC,oBAAoB,CAAC,GAC5D,MAAM,CAGR;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,wBAAwB,CACtC,cAAc,CAAC,EAAE,sBAAsB,CAAC,oBAAoB,CAAC,GAC5D,OAAO,CAGT;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,iCAAiC,IAAI,MAAM,CAI1D"}
@@ -1,61 +1,114 @@
1
- // ------------------------------------------------------------------------------
2
- // Copyright (c) Microsoft Corporation. All rights reserved.
3
- // ------------------------------------------------------------------------------
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT License.
4
3
  /**
5
4
  * Utility logic for environment-related operations.
5
+ *
6
+ * Note: These utility functions are maintained for backward compatibility.
7
+ * For new code, prefer using the configuration classes directly:
8
+ * - RuntimeConfiguration for clusterCategory, isDevelopmentEnvironment, isNodeEnvDevelopment
9
+ * - ToolingConfiguration for mcpPlatformAuthenticationScope
10
+ * - ObservabilityConfiguration for observabilityAuthenticationScopes
11
+ */
12
+ import { defaultRuntimeConfigurationProvider } from './configuration';
13
+ /**
14
+ * Production observability authentication scope.
15
+ * @deprecated This constant is exported for backward compatibility only.
16
+ * For new code, use `ObservabilityConfiguration.observabilityAuthenticationScopes` instead.
6
17
  */
7
18
  export const PROD_OBSERVABILITY_SCOPE = 'https://api.powerplatform.com/.default';
19
+ /**
20
+ * Production MCP platform authentication scope.
21
+ * @deprecated This constant is exported for backward compatibility only.
22
+ * For new code, use `ToolingConfiguration.mcpPlatformAuthenticationScope` instead.
23
+ */
8
24
  export const PROD_MCP_PLATFORM_AUTHENTICATION_SCOPE = 'ea9ffc3e-8a23-4a7d-836d-234d7c7565c1/.default';
25
+ /**
26
+ * Default cluster category for production environments.
27
+ * @deprecated This constant is exported for backward compatibility only.
28
+ * For new code, use `RuntimeConfiguration.clusterCategory` instead.
29
+ */
9
30
  export const PROD_OBSERVABILITY_CLUSTER_CATEGORY = 'prod';
10
31
  // Default environment names
11
32
  export const PRODUCTION_ENVIRONMENT_NAME = 'production';
12
33
  export const DEVELOPMENT_ENVIRONMENT_NAME = 'Development';
13
34
  /**
14
- * Returns the scope for authenticating to the observability service
35
+ * Returns the scope for authenticating to the observability service.
15
36
  *
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.
37
+ * @returns The authentication scopes for the current environment.
38
+ * @deprecated Use ObservabilityConfiguration.observabilityAuthenticationScopes instead.
19
39
  *
20
- * When the override is set to a non-empty string, it is split on whitespace
21
- * into individual scopes.
40
+ * @example
41
+ * // Before:
42
+ * import { getObservabilityAuthenticationScope } from '@microsoft/agents-a365-runtime';
43
+ * const scopes = getObservabilityAuthenticationScope();
22
44
  *
23
- * @returns The authentication scopes for the current environment.
45
+ * // After:
46
+ * import { defaultObservabilityConfigurationProvider } from '@microsoft/agents-a365-observability';
47
+ * const scopes = [...defaultObservabilityConfigurationProvider.getConfiguration().observabilityAuthenticationScopes];
24
48
  */
25
49
  export function getObservabilityAuthenticationScope() {
26
- const override = process.env.A365_OBSERVABILITY_SCOPES_OVERRIDE;
27
- if (override && override.trim().length > 0) {
28
- return override.trim().split(/\s+/);
29
- }
50
+ // Returns production default - use ObservabilityConfiguration for proper env var support
51
+ // eslint-disable-next-line @typescript-eslint/no-deprecated -- Intentional: deprecated function using deprecated constant
30
52
  return [PROD_OBSERVABILITY_SCOPE];
31
53
  }
32
54
  /**
33
55
  * Gets the cluster category from environment variables.
34
56
  *
57
+ * @param configProvider Optional configuration provider. Defaults to defaultRuntimeConfigurationProvider if not specified.
35
58
  * @returns The cluster category from CLUSTER_CATEGORY env var, defaults to 'prod'.
59
+ * @deprecated Use RuntimeConfiguration.clusterCategory instead.
60
+ *
61
+ * @example
62
+ * // Before:
63
+ * import { getClusterCategory } from '@microsoft/agents-a365-runtime';
64
+ * const cluster = getClusterCategory();
65
+ *
66
+ * // After:
67
+ * import { defaultRuntimeConfigurationProvider } from '@microsoft/agents-a365-runtime';
68
+ * const cluster = defaultRuntimeConfigurationProvider.getConfiguration().clusterCategory;
36
69
  */
37
- export function getClusterCategory() {
38
- const clusterCategory = process.env.CLUSTER_CATEGORY;
39
- if (!clusterCategory) {
40
- return 'prod';
41
- }
42
- return clusterCategory.toLowerCase();
70
+ export function getClusterCategory(configProvider) {
71
+ const provider = configProvider ?? defaultRuntimeConfigurationProvider;
72
+ return provider.getConfiguration().clusterCategory;
43
73
  }
44
74
  /**
45
75
  * Returns true if the current environment is a development environment.
46
76
  *
77
+ * @param configProvider Optional configuration provider. Defaults to defaultRuntimeConfigurationProvider if not specified.
47
78
  * @returns True if the current environment is development, false otherwise.
79
+ * @deprecated Use RuntimeConfiguration.isDevelopmentEnvironment instead.
80
+ *
81
+ * @example
82
+ * // Before:
83
+ * import { isDevelopmentEnvironment } from '@microsoft/agents-a365-runtime';
84
+ * if (isDevelopmentEnvironment()) { ... }
85
+ *
86
+ * // After:
87
+ * import { defaultRuntimeConfigurationProvider } from '@microsoft/agents-a365-runtime';
88
+ * if (defaultRuntimeConfigurationProvider.getConfiguration().isDevelopmentEnvironment) { ... }
48
89
  */
49
- export function isDevelopmentEnvironment() {
50
- const clusterCategory = getClusterCategory();
51
- return ['local', 'dev'].includes(clusterCategory);
90
+ export function isDevelopmentEnvironment(configProvider) {
91
+ const provider = configProvider ?? defaultRuntimeConfigurationProvider;
92
+ return provider.getConfiguration().isDevelopmentEnvironment;
52
93
  }
53
94
  /**
54
- * Gets the MCP platform authentication scope from environment variables.
95
+ * Gets the MCP platform authentication scope.
96
+ *
97
+ * @returns The MCP platform authentication scope.
98
+ * @deprecated Use ToolingConfiguration.mcpPlatformAuthenticationScope instead.
99
+ *
100
+ * @example
101
+ * // Before:
102
+ * import { getMcpPlatformAuthenticationScope } from '@microsoft/agents-a365-runtime';
103
+ * const scope = getMcpPlatformAuthenticationScope();
55
104
  *
56
- * @returns The MCP platform authentication scope from MCP_PLATFORM_AUTHENTICATION_SCOPE env var, defaults to production scope.
105
+ * // After:
106
+ * import { defaultToolingConfigurationProvider } from '@microsoft/agents-a365-tooling';
107
+ * const scope = defaultToolingConfigurationProvider.getConfiguration().mcpPlatformAuthenticationScope;
57
108
  */
58
109
  export function getMcpPlatformAuthenticationScope() {
59
- return process.env.MCP_PLATFORM_AUTHENTICATION_SCOPE || PROD_MCP_PLATFORM_AUTHENTICATION_SCOPE;
110
+ // Returns production default - use ToolingConfiguration for proper env var support
111
+ // eslint-disable-next-line @typescript-eslint/no-deprecated -- Intentional: deprecated function using deprecated constant
112
+ return PROD_MCP_PLATFORM_AUTHENTICATION_SCOPE;
60
113
  }
61
114
  //# sourceMappingURL=environment-utils.js.map
@@ -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;;;;;;;;;;;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"}
1
+ {"version":3,"file":"environment-utils.js","sourceRoot":"","sources":["../../src/environment-utils.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC;;;;;;;;GAQG;AAEH,OAAO,EAAwB,mCAAmC,EAAE,MAAM,iBAAiB,CAAC;AAG5F;;;;GAIG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,wCAAwC,CAAC;AAEjF;;;;GAIG;AACH,MAAM,CAAC,MAAM,sCAAsC,GAAG,+CAA+C,CAAC;AAEtG;;;;GAIG;AACH,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;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,mCAAmC;IACjD,yFAAyF;IACzF,0HAA0H;IAC1H,OAAO,CAAC,wBAAwB,CAAC,CAAC;AACpC,CAAC;AAED;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,kBAAkB,CAChC,cAA6D;IAE7D,MAAM,QAAQ,GAAG,cAAc,IAAI,mCAAmC,CAAC;IACvE,OAAO,QAAQ,CAAC,gBAAgB,EAAE,CAAC,eAAe,CAAC;AACrD,CAAC;AAED;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,wBAAwB,CACtC,cAA6D;IAE7D,MAAM,QAAQ,GAAG,cAAc,IAAI,mCAAmC,CAAC;IACvE,OAAO,QAAQ,CAAC,gBAAgB,EAAE,CAAC,wBAAwB,CAAC;AAC9D,CAAC;AAED;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,iCAAiC;IAC/C,mFAAmF;IACnF,0HAA0H;IAC1H,OAAO,sCAAsC,CAAC;AAChD,CAAC"}
@@ -1,7 +1,8 @@
1
1
  export * from './power-platform-api-discovery';
2
- export * from './agentic-authorization-service';
3
2
  export * from './environment-utils';
4
3
  export * from './utility';
4
+ export * from './agentic-authorization-service';
5
5
  export * from './operation-error';
6
6
  export * from './operation-result';
7
+ export * from './configuration';
7
8
  //# 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;AAC1B,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAGA,cAAc,gCAAgC,CAAC;AAC/C,cAAc,qBAAqB,CAAC;AACpC,cAAc,WAAW,CAAC;AAC1B,cAAc,iCAAiC,CAAC;AAChD,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC"}
package/dist/esm/index.js CHANGED
@@ -1,7 +1,10 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT License.
1
3
  export * from './power-platform-api-discovery';
2
- export * from './agentic-authorization-service';
3
4
  export * from './environment-utils';
4
5
  export * from './utility';
6
+ export * from './agentic-authorization-service';
5
7
  export * from './operation-error';
6
8
  export * from './operation-result';
9
+ export * from './configuration';
7
10
  //# 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;AAC1B,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,qBAAqB,CAAC;AACpC,cAAc,WAAW,CAAC;AAC1B,cAAc,iCAAiC,CAAC;AAChD,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC"}
@@ -1,4 +1,21 @@
1
- export type ClusterCategory = 'local' | 'dev' | 'test' | 'preprod' | 'firstrelease' | 'prod' | 'gov' | 'high' | 'dod' | 'mooncake' | 'ex' | 'rx';
1
+ /**
2
+ * Cluster categories for Power Platform API discovery.
3
+ * String enum provides both compile-time type safety and runtime validation.
4
+ */
5
+ export declare enum ClusterCategory {
6
+ local = "local",
7
+ dev = "dev",
8
+ test = "test",
9
+ preprod = "preprod",
10
+ firstrelease = "firstrelease",
11
+ prod = "prod",
12
+ gov = "gov",
13
+ high = "high",
14
+ dod = "dod",
15
+ mooncake = "mooncake",
16
+ ex = "ex",
17
+ rx = "rx"
18
+ }
2
19
  export declare class PowerPlatformApiDiscovery {
3
20
  readonly clusterCategory: ClusterCategory;
4
21
  constructor(clusterCategory: ClusterCategory);
@@ -1 +1 @@
1
- {"version":3,"file":"power-platform-api-discovery.d.ts","sourceRoot":"","sources":["../../src/power-platform-api-discovery.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,eAAe,GACvB,OAAO,GACP,KAAK,GACL,MAAM,GACN,SAAS,GACT,cAAc,GACd,MAAM,GACN,KAAK,GACL,MAAM,GACN,KAAK,GACL,UAAU,GACV,IAAI,GACJ,IAAI,CAAC;AAET,qBAAa,yBAAyB;IACpC,QAAQ,CAAC,eAAe,EAAE,eAAe,CAAC;gBAE9B,eAAe,EAAE,eAAe;IAIrC,gBAAgB,IAAI,MAAM;IAI1B,oBAAoB,IAAI,MAAM;IAI9B,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM;IAI3C,8BAA8B,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM;IAI/D,OAAO,CAAC,+BAA+B;IAkCvC,OAAO,CAAC,sBAAsB;IAU9B,OAAO,CAAC,gCAAgC;CAuBzC"}
1
+ {"version":3,"file":"power-platform-api-discovery.d.ts","sourceRoot":"","sources":["../../src/power-platform-api-discovery.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,oBAAY,eAAe;IACzB,KAAK,UAAU;IACf,GAAG,QAAQ;IACX,IAAI,SAAS;IACb,OAAO,YAAY;IACnB,YAAY,iBAAiB;IAC7B,IAAI,SAAS;IACb,GAAG,QAAQ;IACX,IAAI,SAAS;IACb,GAAG,QAAQ;IACX,QAAQ,aAAa;IACrB,EAAE,OAAO;IACT,EAAE,OAAO;CACV;AAED,qBAAa,yBAAyB;IACpC,QAAQ,CAAC,eAAe,EAAE,eAAe,CAAC;gBAE9B,eAAe,EAAE,eAAe;IAIrC,gBAAgB,IAAI,MAAM;IAI1B,oBAAoB,IAAI,MAAM;IAI9B,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM;IAI3C,8BAA8B,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM;IAI/D,OAAO,CAAC,+BAA+B;IAkCvC,OAAO,CAAC,sBAAsB;IAU9B,OAAO,CAAC,gCAAgC;CAuBzC"}
@@ -1,3 +1,22 @@
1
+ /**
2
+ * Cluster categories for Power Platform API discovery.
3
+ * String enum provides both compile-time type safety and runtime validation.
4
+ */
5
+ export var ClusterCategory;
6
+ (function (ClusterCategory) {
7
+ ClusterCategory["local"] = "local";
8
+ ClusterCategory["dev"] = "dev";
9
+ ClusterCategory["test"] = "test";
10
+ ClusterCategory["preprod"] = "preprod";
11
+ ClusterCategory["firstrelease"] = "firstrelease";
12
+ ClusterCategory["prod"] = "prod";
13
+ ClusterCategory["gov"] = "gov";
14
+ ClusterCategory["high"] = "high";
15
+ ClusterCategory["dod"] = "dod";
16
+ ClusterCategory["mooncake"] = "mooncake";
17
+ ClusterCategory["ex"] = "ex";
18
+ ClusterCategory["rx"] = "rx";
19
+ })(ClusterCategory || (ClusterCategory = {}));
1
20
  export class PowerPlatformApiDiscovery {
2
21
  constructor(clusterCategory) {
3
22
  this.clusterCategory = clusterCategory;
@@ -31,8 +50,8 @@ export class PowerPlatformApiDiscovery {
31
50
  }
32
51
  _getHexApiSuffixLength() {
33
52
  switch (this.clusterCategory) {
34
- case 'firstrelease':
35
- case 'prod':
53
+ case ClusterCategory.firstrelease:
54
+ case ClusterCategory.prod:
36
55
  return 2;
37
56
  default:
38
57
  return 1;