auth0 4.14.0 → 4.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (30) hide show
  1. package/README.md +1 -1
  2. package/dist/cjs/auth/backchannel.d.ts +139 -0
  3. package/dist/cjs/auth/backchannel.js +110 -0
  4. package/dist/cjs/auth/backchannel.js.map +1 -0
  5. package/dist/cjs/auth/index.d.ts +2 -0
  6. package/dist/cjs/auth/index.js +2 -0
  7. package/dist/cjs/auth/index.js.map +1 -1
  8. package/dist/cjs/management/__generated/managers/prompts-manager.d.ts +15 -1
  9. package/dist/cjs/management/__generated/managers/prompts-manager.js +36 -0
  10. package/dist/cjs/management/__generated/managers/prompts-manager.js.map +1 -1
  11. package/dist/cjs/management/__generated/models/index.d.ts +362 -0
  12. package/dist/cjs/management/__generated/models/index.js +261 -5
  13. package/dist/cjs/management/__generated/models/index.js.map +1 -1
  14. package/dist/cjs/version.d.ts +1 -1
  15. package/dist/cjs/version.js +1 -1
  16. package/dist/esm/auth/backchannel.d.ts +139 -0
  17. package/dist/esm/auth/backchannel.js +106 -0
  18. package/dist/esm/auth/backchannel.js.map +1 -0
  19. package/dist/esm/auth/index.d.ts +2 -0
  20. package/dist/esm/auth/index.js +2 -0
  21. package/dist/esm/auth/index.js.map +1 -1
  22. package/dist/esm/management/__generated/managers/prompts-manager.d.ts +15 -1
  23. package/dist/esm/management/__generated/managers/prompts-manager.js +36 -0
  24. package/dist/esm/management/__generated/managers/prompts-manager.js.map +1 -1
  25. package/dist/esm/management/__generated/models/index.d.ts +362 -0
  26. package/dist/esm/management/__generated/models/index.js +256 -0
  27. package/dist/esm/management/__generated/models/index.js.map +1 -1
  28. package/dist/esm/version.d.ts +1 -1
  29. package/dist/esm/version.js +1 -1
  30. package/package.json +1 -1
package/README.md CHANGED
@@ -37,7 +37,7 @@ This client can be used to access Auth0's [Authentication API](https://auth0.com
37
37
  import { AuthenticationClient } from 'auth0';
38
38
 
39
39
  const auth0 = new AuthenticationClient({
40
- domain: '{YOUR_ACCOUNT}.auth0.com',
40
+ domain: '{YOUR_TENANT_AND REGION}.auth0.com',
41
41
  clientId: '{OPTIONAL_CLIENT_ID}',
42
42
  clientSecret: '{OPTIONAL_CLIENT_SECRET}',
43
43
  });
@@ -0,0 +1,139 @@
1
+ import { BaseAuthAPI } from './base-auth-api.js';
2
+ /**
3
+ * The response from the authorize endpoint.
4
+ */
5
+ export type AuthorizeResponse = {
6
+ /**
7
+ * The authorization request ID.
8
+ */
9
+ auth_req_id: string;
10
+ /**
11
+ * The duration in seconds until the authentication request expires.
12
+ */
13
+ expires_in: number;
14
+ /**
15
+ * The interval in seconds to wait between poll requests.
16
+ */
17
+ interval: number;
18
+ };
19
+ /**
20
+ * Options for the authorize request.
21
+ */
22
+ export type AuthorizeOptions = {
23
+ /**
24
+ * A human-readable string intended to be displayed on both the device calling /bc-authorize and the user’s authentication device.
25
+ */
26
+ binding_message: string;
27
+ /**
28
+ * A space-separated list of OIDC and custom API scopes.
29
+ */
30
+ scope: string;
31
+ /**
32
+ * Unique identifier of the audience for an issued token.
33
+ */
34
+ audience?: string;
35
+ /**
36
+ * Custom expiry time in seconds for this request.
37
+ */
38
+ request_expiry?: string;
39
+ /**
40
+ * The user ID.
41
+ */
42
+ userId: string;
43
+ /**
44
+ * Optional parameter for subject issuer context.
45
+ */
46
+ subjectIssuerContext?: string;
47
+ };
48
+ /**
49
+ * The response from the token endpoint.
50
+ */
51
+ export type TokenResponse = {
52
+ /**
53
+ * The access token.
54
+ */
55
+ access_token: string;
56
+ /**
57
+ * The refresh token, available with the `offline_access` scope.
58
+ */
59
+ refresh_token?: string;
60
+ /**
61
+ * The user's ID Token.
62
+ */
63
+ id_token: string;
64
+ /**
65
+ * The token type of the access token.
66
+ */
67
+ token_type?: string;
68
+ /**
69
+ * The duration in seconds that the access token is valid.
70
+ */
71
+ expires_in: number;
72
+ /**
73
+ * The scopes associated with the token.
74
+ */
75
+ scope: string;
76
+ };
77
+ /**
78
+ * Options for the token request.
79
+ */
80
+ export type TokenOptions = {
81
+ /**
82
+ * The authorization request ID.
83
+ */
84
+ auth_req_id: string;
85
+ };
86
+ /**
87
+ * Interface for the backchannel authentication.
88
+ */
89
+ export interface IBackchannel {
90
+ authorize: (options: AuthorizeOptions) => Promise<AuthorizeResponse>;
91
+ backchannelGrant: (options: TokenOptions) => Promise<TokenResponse>;
92
+ }
93
+ /**
94
+ * Class implementing the backchannel authentication flow.
95
+ */
96
+ export declare class Backchannel extends BaseAuthAPI implements IBackchannel {
97
+ /**
98
+ * Initiates a CIBA authorization request.
99
+ *
100
+ * @param {AuthorizeOptions} options - The options for the request.
101
+ * @returns {Promise<AuthorizeResponse>} - The authorization response.
102
+ *
103
+ * @throws {Error} - If the request fails.
104
+ */
105
+ authorize({ userId, ...options }: AuthorizeOptions): Promise<AuthorizeResponse>;
106
+ /**
107
+ * Handles the backchannel grant flow for authentication. Client can poll this method at regular intervals to check if the backchannel auth request has been approved.
108
+ *
109
+ * @param {string} auth_req_id - The authorization request ID. This value is returned from the call to /bc-authorize. Once you have exchanged an auth_req_id for an ID and access token, it is no longer usable.
110
+ * @returns {Promise<TokenResponse>} - A promise that resolves to the token response.
111
+ *
112
+ * @throws {Error} - Throws an error if the request fails.
113
+ *
114
+ * If the authorizing user has not yet approved or rejected the request, you will receive a response like this:
115
+ * ```json
116
+ * {
117
+ * "error": "authorization_pending",
118
+ * "error_description": "The end-user authorization is pending"
119
+ * }
120
+ * ```
121
+ *
122
+ * If the authorizing user rejects the request, you will receive a response like this:
123
+ * ```json
124
+ * {
125
+ * "error": "access_denied",
126
+ * "error_description": "The end-user denied the authorization request or it has been expired"
127
+ * }
128
+ * ```
129
+ *
130
+ * If you are polling too quickly (faster than the interval value returned from /bc-authorize), you will receive a response like this:
131
+ * ```json
132
+ * {
133
+ * "error": "slow_down",
134
+ * "error_description": "You are polling faster than allowed. Try again in 10 seconds."
135
+ * }
136
+ * ```
137
+ */
138
+ backchannelGrant({ auth_req_id }: TokenOptions): Promise<TokenResponse>;
139
+ }
@@ -0,0 +1,110 @@
1
+ "use strict";
2
+ // Wednesday, 8 January, 2025
3
+ // Client Initiated Backchannel Authentication (CIBA)
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.Backchannel = void 0;
6
+ // CIBA is an OpenID Foundation standard for a decoupled authentication flow. It enables
7
+ // solution developers to build authentication flows where the user logging in does not do so
8
+ // directly on the device that receives the ID or access tokens (the “Consumption Device”), but
9
+ // instead on a separate “Authorization Device”.
10
+ const models_js_1 = require("../lib/models.js");
11
+ const base_auth_api_js_1 = require("./base-auth-api.js");
12
+ /**
13
+ * Generates the login hint for the user.
14
+ *
15
+ * @param {string} userId - The user ID.
16
+ * @param {string} domain - The tenant domain.
17
+ * @returns {string} - The login hint as a JSON string.
18
+ */
19
+ const getLoginHint = (userId, domain) => {
20
+ // remove trailing '/' from domain, added later for uniformity
21
+ const trimmedDomain = domain.endsWith('/') ? domain.slice(0, -1) : domain;
22
+ const loginHint = {
23
+ format: 'iss_sub',
24
+ iss: `https://${trimmedDomain}/`,
25
+ sub: `${userId}`,
26
+ };
27
+ return JSON.stringify(loginHint);
28
+ };
29
+ const CIBA_GRANT_TYPE = 'urn:openid:params:grant-type:ciba';
30
+ const CIBA_AUTHORIZE_URL = '/bc-authorize';
31
+ const CIBA_TOKEN_URL = '/oauth/token';
32
+ /**
33
+ * Class implementing the backchannel authentication flow.
34
+ */
35
+ class Backchannel extends base_auth_api_js_1.BaseAuthAPI {
36
+ /**
37
+ * Initiates a CIBA authorization request.
38
+ *
39
+ * @param {AuthorizeOptions} options - The options for the request.
40
+ * @returns {Promise<AuthorizeResponse>} - The authorization response.
41
+ *
42
+ * @throws {Error} - If the request fails.
43
+ */
44
+ async authorize({ userId, ...options }) {
45
+ const body = {
46
+ ...options,
47
+ login_hint: getLoginHint(userId, this.domain),
48
+ client_id: this.clientId,
49
+ };
50
+ await this.addClientAuthentication(body);
51
+ const response = await this.request.bind(this)({
52
+ path: CIBA_AUTHORIZE_URL,
53
+ method: 'POST',
54
+ headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
55
+ body: new URLSearchParams(body),
56
+ }, {});
57
+ const r = await models_js_1.JSONApiResponse.fromResponse(response);
58
+ return r.data;
59
+ }
60
+ /**
61
+ * Handles the backchannel grant flow for authentication. Client can poll this method at regular intervals to check if the backchannel auth request has been approved.
62
+ *
63
+ * @param {string} auth_req_id - The authorization request ID. This value is returned from the call to /bc-authorize. Once you have exchanged an auth_req_id for an ID and access token, it is no longer usable.
64
+ * @returns {Promise<TokenResponse>} - A promise that resolves to the token response.
65
+ *
66
+ * @throws {Error} - Throws an error if the request fails.
67
+ *
68
+ * If the authorizing user has not yet approved or rejected the request, you will receive a response like this:
69
+ * ```json
70
+ * {
71
+ * "error": "authorization_pending",
72
+ * "error_description": "The end-user authorization is pending"
73
+ * }
74
+ * ```
75
+ *
76
+ * If the authorizing user rejects the request, you will receive a response like this:
77
+ * ```json
78
+ * {
79
+ * "error": "access_denied",
80
+ * "error_description": "The end-user denied the authorization request or it has been expired"
81
+ * }
82
+ * ```
83
+ *
84
+ * If you are polling too quickly (faster than the interval value returned from /bc-authorize), you will receive a response like this:
85
+ * ```json
86
+ * {
87
+ * "error": "slow_down",
88
+ * "error_description": "You are polling faster than allowed. Try again in 10 seconds."
89
+ * }
90
+ * ```
91
+ */
92
+ async backchannelGrant({ auth_req_id }) {
93
+ const body = {
94
+ client_id: this.clientId,
95
+ auth_req_id,
96
+ grant_type: CIBA_GRANT_TYPE,
97
+ };
98
+ await this.addClientAuthentication(body);
99
+ const response = await this.request.bind(this)({
100
+ path: CIBA_TOKEN_URL,
101
+ method: 'POST',
102
+ headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
103
+ body: new URLSearchParams(body),
104
+ }, {});
105
+ const r = await models_js_1.JSONApiResponse.fromResponse(response);
106
+ return r.data;
107
+ }
108
+ }
109
+ exports.Backchannel = Backchannel;
110
+ //# sourceMappingURL=backchannel.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AC5C;YACE,IAAI,EAAE,kBAAkB;YACxB,MAAM,EAAE,MAAM;YACd,OAAO,EAAE,EAAE,cAAc,EAAE,mCAAmC,EAAE;YAChE,IAAI,EAAE,IAAI,eAAe,CAAC,IAAI,CAAC;SAChC,EACD,EAAE,CACH,CAAC;QAEF,MAAM,CAAC,GAAuC,MAAM,2BAAe,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC;QAC3F,OAAO,CAAC,CAAC,IAAI,CAAC;IAChB,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA+BG;IACH,KAAK,CAAC,gBAAgB,CAAC,EAAE,WAAW,EAAgB;QAClD,MAAM,IAAI,GAAqB;YAC7B,SAAS,EAAE,IAAI,CAAC,QAAQ;YACxB,WAAW;YACX,UAAU,EAAE,eAAe;SAC5B,CAAC;QAEF,MAAM,IAAI,CAAC,uBAAuB,CAAC,IAAI,CAAC,CAAC;QAEzC,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAC5C;YACE,IAAI,EAAE,cAAc;YACpB,MAAM,EAAE,MAAM;YACd,OAAO,EAAE,EAAE,cAAc,EAAE,mCAAmC,EAAE;YAChE,IAAI,EAAE,IAAI,eAAe,CAAC,IAAI,CAAC;SAChC,EACD,EAAE,CACH,CAAC;QAEF,MAAM,CAAC,GAAmC,MAAM,2BAAe,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC;QACvF,OAAO,CAAC,CAAC,IAAI,CAAC;IAChB,CAAC;CACF;AAtFD,kCAsFC"}
@@ -1,3 +1,4 @@
1
+ import { Backchannel } from './backchannel.js';
1
2
  import { AuthenticationClientOptions } from './base-auth-api.js';
2
3
  import { Database } from './database.js';
3
4
  import { OAuth } from './oauth.js';
@@ -11,5 +12,6 @@ export declare class AuthenticationClient {
11
12
  database: Database;
12
13
  oauth: OAuth;
13
14
  passwordless: Passwordless;
15
+ backchannel: Backchannel;
14
16
  constructor(options: AuthenticationClientOptions);
15
17
  }
@@ -15,6 +15,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  exports.AuthenticationClient = exports.AuthApiError = exports.IdTokenValidatorError = void 0;
18
+ const backchannel_js_1 = require("./backchannel.js");
18
19
  const database_js_1 = require("./database.js");
19
20
  const oauth_js_1 = require("./oauth.js");
20
21
  const passwordless_js_1 = require("./passwordless.js");
@@ -30,6 +31,7 @@ class AuthenticationClient {
30
31
  this.database = new database_js_1.Database(options);
31
32
  this.oauth = new oauth_js_1.OAuth(options);
32
33
  this.passwordless = new passwordless_js_1.Passwordless(options);
34
+ this.backchannel = new backchannel_js_1.Backchannel(options);
33
35
  }
34
36
  }
35
37
  exports.AuthenticationClient = AuthenticationClient;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/auth/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AACA,+CAAyC;AACzC,yCAAmC;AACnC,uDAAiD;AAEjD,gDAA8B;AAC9B,6CAA2B;AAC3B,oDAAkC;AAClC,iEAAwF;AAAvD,8HAAA,qBAAqB,OAAA;AACtD,uDAA+E;AAAtE,gHAAA,YAAY,OAAA;AAErB,MAAa,oBAAoB;IAK/B,YAAY,OAAoC;QAC9C,IAAI,CAAC,QAAQ,GAAG,IAAI,sBAAQ,CAAC,OAAO,CAAC,CAAC;QACtC,IAAI,CAAC,KAAK,GAAG,IAAI,gBAAK,CAAC,OAAO,CAAC,CAAC;QAChC,IAAI,CAAC,YAAY,GAAG,IAAI,8BAAY,CAAC,OAAO,CAAC,CAAC;IAChD,CAAC;CACF;AAVD,oDAUC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/auth/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,qDAA+C;AAE/C,+CAAyC;AACzC,yCAAmC;AACnC,uDAAiD;AAEjD,gDAA8B;AAC9B,6CAA2B;AAC3B,oDAAkC;AAClC,iEAAwF;AAAvD,8HAAA,qBAAqB,OAAA;AACtD,uDAA+E;AAAtE,gHAAA,YAAY,OAAA;AAErB,MAAa,oBAAoB;IAM/B,YAAY,OAAoC;QAC9C,IAAI,CAAC,QAAQ,GAAG,IAAI,sBAAQ,CAAC,OAAO,CAAC,CAAC;QACtC,IAAI,CAAC,KAAK,GAAG,IAAI,gBAAK,CAAC,OAAO,CAAC,CAAC;QAChC,IAAI,CAAC,YAAY,GAAG,IAAI,8BAAY,CAAC,OAAO,CAAC,CAAC;QAC9C,IAAI,CAAC,WAAW,GAAG,IAAI,4BAAW,CAAC,OAAO,CAAC,CAAC;IAC9C,CAAC;CACF;AAZD,oDAYC"}
@@ -1,6 +1,6 @@
1
1
  import * as runtime from '../../../lib/runtime.js';
2
2
  import type { InitOverride, ApiResponse } from '../../../lib/runtime.js';
3
- import type { PromptsSettings, PromptsSettingsUpdate, GetCustomTextByLanguageRequest, GetPartialsRequest, PutCustomTextByLanguageRequest, PutPartialsRequest } from '../models/index.js';
3
+ import type { GetRendering200Response, PatchRenderingRequest, PromptsSettings, PromptsSettingsUpdate, GetCustomTextByLanguageRequest, GetPartialsRequest, GetRenderingRequest, PatchRenderingOperationRequest, PutCustomTextByLanguageRequest, PutPartialsRequest } from '../models/index.js';
4
4
  declare const BaseAPI: typeof runtime.BaseAPI;
5
5
  /**
6
6
  *
@@ -31,6 +31,13 @@ export declare class PromptsManager extends BaseAPI {
31
31
  * @throws {RequiredError}
32
32
  */
33
33
  get(initOverrides?: InitOverride): Promise<ApiResponse<PromptsSettings>>;
34
+ /**
35
+ * View the render settings for a specific screen
36
+ * Get render settings for a prompt
37
+ *
38
+ * @throws {RequiredError}
39
+ */
40
+ getRendering(requestParameters: GetRenderingRequest, initOverrides?: InitOverride): Promise<ApiResponse<GetRendering200Response>>;
34
41
  /**
35
42
  * Update the Universal Login configuration of your tenant. This includes the <a href="https://auth0.com/docs/authenticate/login/auth0-universal-login/identifier-first">Identifier First Authentication</a> and <a href="https://auth0.com/docs/secure/multi-factor-authentication/fido-authentication-with-webauthn/configure-webauthn-device-biometrics-for-mfa">WebAuthn with Device Biometrics for MFA</a> features.
36
43
  * Update prompt settings
@@ -38,6 +45,13 @@ export declare class PromptsManager extends BaseAPI {
38
45
  * @throws {RequiredError}
39
46
  */
40
47
  update(bodyParameters: PromptsSettingsUpdate, initOverrides?: InitOverride): Promise<ApiResponse<PromptsSettings>>;
48
+ /**
49
+ * Configure the render settings for a specific screen
50
+ * Configure render settings for a prompt
51
+ *
52
+ * @throws {RequiredError}
53
+ */
54
+ updateRendering(requestParameters: PatchRenderingOperationRequest, bodyParameters: PatchRenderingRequest, initOverrides?: InitOverride): Promise<ApiResponse<void>>;
41
55
  /**
42
56
  * Set custom text for a specific prompt. Existing texts will be overwritten.
43
57
  * Set custom text for a specific prompt
@@ -73,6 +73,22 @@ class PromptsManager extends BaseAPI {
73
73
  }, initOverrides);
74
74
  return runtime.JSONApiResponse.fromResponse(response);
75
75
  }
76
+ /**
77
+ * View the render settings for a specific screen
78
+ * Get render settings for a prompt
79
+ *
80
+ * @throws {RequiredError}
81
+ */
82
+ async getRendering(requestParameters, initOverrides) {
83
+ runtime.validateRequiredRequestParams(requestParameters, ['prompt', 'screen']);
84
+ const response = await this.request({
85
+ path: `/prompts/{prompt}/screen/{screen}/rendering`
86
+ .replace('{prompt}', encodeURIComponent(String(requestParameters.prompt)))
87
+ .replace('{screen}', encodeURIComponent(String(requestParameters.screen))),
88
+ method: 'GET',
89
+ }, initOverrides);
90
+ return runtime.JSONApiResponse.fromResponse(response);
91
+ }
76
92
  /**
77
93
  * Update the Universal Login configuration of your tenant. This includes the <a href="https://auth0.com/docs/authenticate/login/auth0-universal-login/identifier-first">Identifier First Authentication</a> and <a href="https://auth0.com/docs/secure/multi-factor-authentication/fido-authentication-with-webauthn/configure-webauthn-device-biometrics-for-mfa">WebAuthn with Device Biometrics for MFA</a> features.
78
94
  * Update prompt settings
@@ -90,6 +106,26 @@ class PromptsManager extends BaseAPI {
90
106
  }, initOverrides);
91
107
  return runtime.JSONApiResponse.fromResponse(response);
92
108
  }
109
+ /**
110
+ * Configure the render settings for a specific screen
111
+ * Configure render settings for a prompt
112
+ *
113
+ * @throws {RequiredError}
114
+ */
115
+ async updateRendering(requestParameters, bodyParameters, initOverrides) {
116
+ runtime.validateRequiredRequestParams(requestParameters, ['prompt', 'screen']);
117
+ const headerParameters = {};
118
+ headerParameters['Content-Type'] = 'application/json';
119
+ const response = await this.request({
120
+ path: `/prompts/{prompt}/screen/{screen}/rendering`
121
+ .replace('{prompt}', encodeURIComponent(String(requestParameters.prompt)))
122
+ .replace('{screen}', encodeURIComponent(String(requestParameters.screen))),
123
+ method: 'PATCH',
124
+ headers: headerParameters,
125
+ body: bodyParameters,
126
+ }, initOverrides);
127
+ return runtime.VoidApiResponse.fromResponse(response);
128
+ }
93
129
  /**
94
130
  * Set custom text for a specific prompt. Existing texts will be overwritten.
95
131
  * Set custom text for a specific prompt
@@ -1 +1 @@
1
- {"version":3,"file":"prompts-manager.js","sourceRoot":"","sources":["../../../../../src/management/__generated/managers/prompts-manager.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iEAAmD;AAWnD,MAAM,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC;AAE5B;;GAEG;AACH,MAAa,cAAe,SAAQ,OAAO;IACzC;;;;;OAKG;IACH,KAAK,CAAC,uBAAuB,CAC3B,iBAAiD,EACjD,aAA4B;QAE5B,OAAO,CAAC,6BAA6B,CAAC,iBAAiB,EAAE,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC,CAAC;QAEjF,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,OAAO,CACjC;YACE,IAAI,EAAE,0CAA0C;iBAC7C,OAAO,CAAC,UAAU,EAAE,kBAAkB,CAAC,MAAM,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAC,CAAC;iBACzE,OAAO,CAAC,YAAY,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AM,CAAC,CAAC,CACrD;YACD,MAAM,EAAE,KAAK;YACb,OAAO,EAAE,gBAAgB;YACzB,IAAI,EAAE,cAAc;SACrB,EACD,aAAa,CACd,CAAC;QAEF,OAAO,OAAO,CAAC,eAAe,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC;IACxD,CAAC;CACF;AAjKD,wCAiKC"}
1
+ {"version":3,"file":"prompts-manager.js","sourceRoot":"","sources":["../../../../../src/management/__generated/managers/prompts-manager.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iEAAmD;AAenD,MAAM,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC;AAE5B;;GAEG;AACH,MAAa,cAAe,SAAQ,OAAO;IACzC;;;;;OAKG;IACH,KAAK,CAAC,uBAAuB,CAC3B,iBAAiD,EACjD,aAA4B;QAE5B,OAAO,CAAC,6BAA6B,CAAC,iBAAiB,EAAE,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC,CAAC;QAEjF,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,OAAO,CACjC;YACE,IAAI,EAAE,0CAA0C;iBAC7C,OAAO,CAAC,UAAU,EAAE,kBAAkB,CAAC,MAAM,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAC,CAAC;iBACzE,OAAO,CAAC,YAAY,EAAE,kBAAkB,CAAC,MAAM,CAAC,iBAAiB,CAAC,QAAQ,CAAC,CAAC,CAAC;YAChF,MAAM,EAAE,KAAK;SACd,EACD,aAAa,CACd,CAAC;QAEF,OAAO,OAAO,CAAC,eAAe,CAAC,YAAY,CAAM,QAAQ,CAAC,CAAC;IAC7D,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,WAAW,CACf,iBAAqC,EACrC,aAA4B;QAE5B,OAAO,CAAC,6BAA6B,CAAC,iBAAiB,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC;QAErE,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,OAAO,CACjC;YACE,IAAI,E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