@contember/cli 2.2.0-alpha.20 → 2.2.0-alpha.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/development/src/lib/tenant/clients/TenantProjectClient.cjs +11 -4
- package/dist/development/src/lib/tenant/clients/TenantProjectClient.cjs.map +1 -1
- package/dist/development/src/lib/tenant/clients/TenantProjectClient.js +11 -4
- package/dist/development/src/lib/tenant/clients/TenantProjectClient.js.map +1 -1
- package/dist/production/src/lib/tenant/clients/TenantProjectClient.cjs +11 -4
- package/dist/production/src/lib/tenant/clients/TenantProjectClient.cjs.map +1 -1
- package/dist/production/src/lib/tenant/clients/TenantProjectClient.js +11 -4
- package/dist/production/src/lib/tenant/clients/TenantProjectClient.js.map +1 -1
- package/dist/types/lib/tenant/clients/TenantProjectClient.d.ts +5 -0
- package/dist/types/lib/tenant/clients/TenantProjectClient.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +14 -14
- package/src/lib/tenant/clients/TenantProjectClient.ts +13 -3
- package/tests/cases/unit/tenant-apply-command.test.ts +51 -0
- package/tests/cases/unit/tenant-project.test.ts +19 -5
|
@@ -107,11 +107,15 @@ class TenantProjectClient {
|
|
|
107
107
|
const config = result.configuration;
|
|
108
108
|
return {
|
|
109
109
|
signup: { requireEmailVerification: config.signup.requireEmailVerification },
|
|
110
|
-
emailChange: {
|
|
110
|
+
emailChange: {
|
|
111
|
+
requireVerification: config.emailChange.requireVerification,
|
|
112
|
+
requireReauthentication: config.emailChange.requireReauthentication
|
|
113
|
+
},
|
|
111
114
|
passwordless: {
|
|
112
115
|
enabled: config.passwordless.enabled,
|
|
113
116
|
url: config.passwordless.url ?? null,
|
|
114
|
-
expiration: config.passwordless.expiration
|
|
117
|
+
expiration: config.passwordless.expiration,
|
|
118
|
+
uniformResponse: config.passwordless.uniformResponse
|
|
115
119
|
},
|
|
116
120
|
password: {
|
|
117
121
|
minLength: config.password.minLength,
|
|
@@ -121,7 +125,8 @@ class TenantProjectClient {
|
|
|
121
125
|
requireSpecial: config.password.requireSpecial,
|
|
122
126
|
pattern: config.password.pattern ?? null,
|
|
123
127
|
checkBlacklist: config.password.checkBlacklist,
|
|
124
|
-
checkHibp: config.password.checkHibp
|
|
128
|
+
checkHibp: config.password.checkHibp,
|
|
129
|
+
revokeSessionsOnChange: config.password.revokeSessionsOnChange
|
|
125
130
|
},
|
|
126
131
|
login: {
|
|
127
132
|
baseBackoff: config.login.baseBackoff,
|
|
@@ -132,11 +137,13 @@ class TenantProjectClient {
|
|
|
132
137
|
defaultTokenExpiration: config.login.defaultTokenExpiration,
|
|
133
138
|
maxTokenExpiration: config.login.maxTokenExpiration ?? null,
|
|
134
139
|
mfaGraceDuration: config.login.mfaGraceDuration,
|
|
140
|
+
mfaChangeRequiresReauthentication: config.login.mfaChangeRequiresReauthentication,
|
|
135
141
|
anomalyDetection: {
|
|
136
142
|
enabled: config.login.anomalyDetection.enabled,
|
|
137
143
|
historySize: config.login.anomalyDetection.historySize,
|
|
138
144
|
emailThreshold: config.login.anomalyDetection.emailThreshold,
|
|
139
|
-
stepUpThreshold: config.login.anomalyDetection.stepUpThreshold
|
|
145
|
+
stepUpThreshold: config.login.anomalyDetection.stepUpThreshold,
|
|
146
|
+
missingSignalIsNew: config.login.anomalyDetection.missingSignalIsNew
|
|
140
147
|
}
|
|
141
148
|
},
|
|
142
149
|
captcha: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TenantProjectClient.cjs","sources":["../../../../../../../packages/cli/src/lib/tenant/clients/TenantProjectClient.ts"],"sourcesContent":["import {\n\taddIDPError$$,\n\taddIDPResponse$$,\n\tapiKeyWithToken$$,\n\ttype CaptchaProvider,\n\tconfig$,\n\tconfigCaptcha$$,\n\tconfigCaptchaProtect$$,\n\tconfigEmailChange$$,\n\tconfigLogin$$,\n\tconfigLoginAnomalyDetection$$,\n\tconfigPassword$$,\n\tconfigPasswordless$$,\n\ttype ConfigPolicy,\n\tconfigRateLimits$,\n\tconfigRateLimitWindow$$,\n\tconfigSignup$$,\n\tconfigureError$$,\n\tconfigureResponse$$,\n\tcreateProjectResponse$$,\n\tcreateProjectResponseError$$,\n\tcreateProjectResult$,\n\tdisableIDPError$$,\n\tdisableIDPResponse$$,\n\tenableIDPError$$,\n\tenableIDPResponse$$,\n\tidentity$$,\n\tidentityGlobalPermissions$$,\n\tidentityProjectRelation$,\n\tidentityProvider$,\n\tmembership$$,\n\tmutation$,\n\tproject$,\n\tprojectSecretInfo$$,\n\tquery$,\n\troleConditionVariableDefinition$$,\n\troleDefinition$,\n\troleEntityVariableDefinition$$,\n\trolePredefinedVariableDefinition$$,\n\troleVariableDefinition$$,\n\tsetProjectSecretError$$,\n\tsetProjectSecretResponse$$,\n\tupdateIDPError$$,\n\tupdateIDPResponse$$,\n\tupdateProjectError$$,\n\tupdateProjectResponse$$,\n} from '@contember/graphql-client-tenant'\nimport { CliError, ExitCode } from '@contember/cli-common'\nimport type { ModelType } from 'graphql-ts-client-api'\nimport { TenantApiTransport } from '../TenantApiTransport.js'\nimport { TenantGlobalConfig, TenantIdpOptions } from '../tenantConfig.js'\n\nexport interface RemoteIdentityProvider {\n\tslug: string\n\ttype: string\n\tdisabledAt: string | null\n}\n\nexport interface TenantProjectSummary {\n\tid: string\n\tname: string\n\tslug: string\n}\n\nexport interface TenantProjectRole {\n\tname: string\n\t/** Variable names the role expects, retained for compatibility. */\n\tvariables: string[]\n\tvariableDefinitions: TenantProjectRoleVariableDefinition[]\n}\n\nexport type TenantProjectRoleVariableDefinition =\n\t| { type: 'entity'; name: string; entityName: string }\n\t| { type: 'predefined'; name: string; value: string }\n\t| { type: 'condition'; name: string }\n\nexport interface TenantProjectSecret {\n\tkey: string\n\tcreatedAt: string\n\tupdatedAt: string\n}\n\nexport interface TenantProjectDetail {\n\tid: string\n\tname: string\n\tslug: string\n\tconfig: unknown\n\troles: TenantProjectRole[]\n\tsecrets: TenantProjectSecret[]\n}\n\nexport interface TenantCreateProjectDetails {\n\tname?: string\n\tconfig?: unknown\n\t/** Skip issuing a deploy API key for the project. */\n\tnoDeployToken?: boolean\n}\n\nexport interface TenantCreateProjectResult {\n\t/** Null when {@link TenantCreateProjectDetails.noDeployToken} was requested. */\n\tdeployerApiKey: { id: string; token: string | null } | null\n}\n\nexport interface TenantUpdateProjectChanges {\n\tname?: string\n\tconfig?: unknown\n\tmergeConfig?: boolean\n}\n\nexport interface TenantRateLimitWindowState {\n\tlimit: number\n\twindow: string\n}\n\n/** The tenant-wide configuration returned by `Query.configuration` — the read side of {@link TenantGlobalConfig}. */\nexport interface TenantConfigState {\n\tsignup: { requireEmailVerification: boolean }\n\temailChange: { requireVerification: boolean }\n\tpasswordless: { enabled: ConfigPolicy; url: string | null; expiration: string }\n\tpassword: {\n\t\tminLength: number\n\t\trequireUppercase: number\n\t\trequireLowercase: number\n\t\trequireDigit: number\n\t\trequireSpecial: number\n\t\tpattern: string | null\n\t\tcheckBlacklist: boolean\n\t\tcheckHibp: boolean\n\t}\n\tlogin: {\n\t\tbaseBackoff: string\n\t\tmaxBackoff: string\n\t\tattemptWindow: string\n\t\trevealUserExists: boolean\n\t\trevealLoginMethod: boolean\n\t\tdefaultTokenExpiration: string\n\t\tmaxTokenExpiration: string | null\n\t\tmfaGraceDuration: string\n\t\tanomalyDetection: {\n\t\t\tenabled: boolean\n\t\t\thistorySize: number\n\t\t\temailThreshold: number\n\t\t\tstepUpThreshold: number\n\t\t}\n\t}\n\tcaptcha: {\n\t\tprovider: CaptchaProvider | null\n\t\tthreshold: number | null\n\t\tprotect: {\n\t\t\tsignUp: boolean\n\t\t\tpasswordReset: boolean\n\t\t\tpasswordlessInit: boolean\n\t\t\temailVerification: boolean\n\t\t}\n\t}\n\trateLimits: {\n\t\tsignUpPerIp: TenantRateLimitWindowState\n\t\tloginPerIp: TenantRateLimitWindowState\n\t\tpasswordResetPerIp: TenantRateLimitWindowState\n\t\tpasswordlessInitPerIp: TenantRateLimitWindowState\n\t\temailOtpPerPerson: TenantRateLimitWindowState\n\t\temailVerificationPerIp: TenantRateLimitWindowState\n\t}\n}\n\nexport interface TenantWhoAmIProject {\n\tslug: string\n\tname: string\n\troles: string[]\n}\n\n/** `Query.me` — the identity behind the token the CLI is using. */\nexport interface TenantWhoAmI {\n\tid: string\n\tdescription: string | null\n\t/** Global (tenant-wide) roles — empty for an identity whose access is entirely project-scoped. */\n\troles: string[]\n\tpermissions: { canCreateProject: boolean; canDeployEntrypoint: boolean } | null\n\tprojects: TenantWhoAmIProject[]\n}\n\n// Fetchers are immutable and reusable, so they are built once at module load.\nconst createProjectFetcher = mutation$.createProject(\n\tcreateProjectResponse$$.error(createProjectResponseError$$).result(createProjectResult$.deployerApiKey(apiKeyWithToken$$)),\n)\nconst setProjectSecretFetcher = mutation$.setProjectSecret(setProjectSecretResponse$$.error(setProjectSecretError$$))\nconst updateProjectFetcher = mutation$.updateProject(updateProjectResponse$$.error(updateProjectError$$))\nconst configureFetcher = mutation$.configure(configureResponse$$.error(configureError$$))\nconst configurationFetcher = query$.configuration(\n\tconfig$\n\t\t.signup(configSignup$$)\n\t\t.emailChange(configEmailChange$$)\n\t\t.passwordless(configPasswordless$$)\n\t\t.password(configPassword$$)\n\t\t.login(configLogin$$.anomalyDetection(configLoginAnomalyDetection$$))\n\t\t.captcha(configCaptcha$$.protect(configCaptchaProtect$$))\n\t\t.rateLimits(\n\t\t\tconfigRateLimits$\n\t\t\t\t.signUpPerIp(configRateLimitWindow$$)\n\t\t\t\t.loginPerIp(configRateLimitWindow$$)\n\t\t\t\t.passwordResetPerIp(configRateLimitWindow$$)\n\t\t\t\t.passwordlessInitPerIp(configRateLimitWindow$$)\n\t\t\t\t.emailOtpPerPerson(configRateLimitWindow$$)\n\t\t\t\t.emailVerificationPerIp(configRateLimitWindow$$),\n\t\t),\n)\nconst projectsFetcher = query$.projects(project$.id.name.slug)\nconst roleVariableFetcher = roleVariableDefinition$$\n\t.on(roleConditionVariableDefinition$$)\n\t.on(roleEntityVariableDefinition$$)\n\t.on(rolePredefinedVariableDefinition$$)\nconst toRoleVariableDefinition = (variable: ModelType<typeof roleVariableFetcher>): TenantProjectRoleVariableDefinition => {\n\tswitch (variable.__typename) {\n\t\tcase 'RoleEntityVariableDefinition':\n\t\t\treturn { type: 'entity', name: variable.name, entityName: variable.entityName }\n\t\tcase 'RolePredefinedVariableDefinition':\n\t\t\treturn { type: 'predefined', name: variable.name, value: variable.value }\n\t\tcase 'RoleConditionVariableDefinition':\n\t\t\treturn { type: 'condition', name: variable.name }\n\t\tcase 'RoleVariableDefinition':\n\t\t\tthrow new CliError(`Tenant API returned an abstract role variable definition for \"${variable.name}\".`, {\n\t\t\t\tcode: 'TENANT_API_INVALID_RESPONSE',\n\t\t\t\texitCode: ExitCode.InternalError,\n\t\t\t})\n\t}\n}\nconst projectBySlugFetcher = query$.projectBySlug(\n\tproject$\n\t\t.id.name.slug.config\n\t\t.roles(roleDefinition$.name.variables(roleVariableFetcher))\n\t\t.secrets(projectSecretInfo$$),\n)\nconst identityProvidersFetcher = query$.identityProviders(identityProvider$.slug.type.disabledAt)\nconst addIdpFetcher = mutation$.addIDP(addIDPResponse$$.error(addIDPError$$))\nconst updateIdpFetcher = mutation$.updateIDP(updateIDPResponse$$.error(updateIDPError$$))\nconst enableIdpFetcher = mutation$.enableIDP(enableIDPResponse$$.error(enableIDPError$$))\nconst disableIdpFetcher = mutation$.disableIDP(disableIDPResponse$$.error(disableIDPError$$))\nconst meFetcher = query$.me(\n\tidentity$$\n\t\t.permissions(identityGlobalPermissions$$)\n\t\t.projects(identityProjectRelation$.project(project$.slug.name).memberships(membership$$)),\n)\n\nconst toRateLimitWindow = (it: { limit: number; window: string }): TenantRateLimitWindowState => ({ limit: it.limit, window: it.window })\n\n/** Projects, project secrets, global tenant configuration, identity providers and `me`. */\nexport class TenantProjectClient {\n\tconstructor(\n\t\tprivate readonly transport: TenantApiTransport,\n\t) {\n\t}\n\n\tpublic async listProjects(): Promise<TenantProjectSummary[]> {\n\t\tconst result = await this.transport.exec(projectsFetcher, {})\n\t\treturn result.projects.map(it => ({ id: it.id, name: it.name, slug: it.slug }))\n\t}\n\n\t/** Null both when the project does not exist and when the caller may not see it — the API does not distinguish. */\n\tpublic async getProjectBySlug(slug: string): Promise<TenantProjectDetail | null> {\n\t\tconst result = await this.transport.exec(projectBySlugFetcher, { slug })\n\t\tconst project = result.projectBySlug\n\t\tif (!project) {\n\t\t\treturn null\n\t\t}\n\t\treturn {\n\t\t\tid: project.id,\n\t\t\tname: project.name,\n\t\t\tslug: project.slug,\n\t\t\tconfig: project.config,\n\t\t\troles: project.roles.map(role => ({\n\t\t\t\tname: role.name,\n\t\t\t\tvariables: role.variables.map(it => it.name),\n\t\t\t\tvariableDefinitions: role.variables.map(toRoleVariableDefinition),\n\t\t\t})),\n\t\t\tsecrets: project.secrets.map(it => ({ key: it.key, createdAt: it.createdAt, updatedAt: it.updatedAt })),\n\t\t}\n\t}\n\n\t/** Returns `null` (nothing created) when `ignoreExisting` swallowed an `ALREADY_EXISTS`. */\n\tpublic async createProject(slug: string, ignoreExisting = false, details?: TenantCreateProjectDetails): Promise<TenantCreateProjectResult | null> {\n\t\tconst result = await this.transport.exec(createProjectFetcher, {\n\t\t\tprojectSlug: slug,\n\t\t\tname: details?.name,\n\t\t\tconfig: details?.config,\n\t\t\toptions: details?.noDeployToken ? { noDeployToken: true } : undefined,\n\t\t})\n\t\tif (ignoreExisting && result.createProject?.error?.code === 'ALREADY_EXISTS') {\n\t\t\treturn null\n\t\t}\n\t\tthis.transport.assertOk(result.createProject, `createProject(${slug})`)\n\t\tconst deployerApiKey = result.createProject?.result?.deployerApiKey\n\t\treturn { deployerApiKey: deployerApiKey ? { id: deployerApiKey.id, token: deployerApiKey.token ?? null } : null }\n\t}\n\n\tpublic async updateProject(slug: string, changes: TenantUpdateProjectChanges): Promise<void> {\n\t\tconst result = await this.transport.exec(updateProjectFetcher, {\n\t\t\tprojectSlug: slug,\n\t\t\tname: changes.name,\n\t\t\tconfig: changes.config,\n\t\t\tmergeConfig: changes.mergeConfig,\n\t\t})\n\t\tthis.transport.assertOk(result.updateProject, `updateProject(${slug})`)\n\t}\n\n\tpublic async setProjectSecret(slug: string, key: string, value: string): Promise<void> {\n\t\tconst result = await this.transport.exec(setProjectSecretFetcher, { projectSlug: slug, key, value })\n\t\tthis.transport.assertOk(result.setProjectSecret, `setProjectSecret(${slug}/${key})`)\n\t}\n\n\tpublic async configure(config: TenantGlobalConfig): Promise<void> {\n\t\tconst result = await this.transport.exec(configureFetcher, { config })\n\t\tthis.transport.assertOk(result.configure, 'configure')\n\t}\n\n\tpublic async configuration(): Promise<TenantConfigState> {\n\t\tconst result = await this.transport.exec(configurationFetcher, {})\n\t\tconst config = result.configuration\n\t\treturn {\n\t\t\tsignup: { requireEmailVerification: config.signup.requireEmailVerification },\n\t\t\temailChange: { requireVerification: config.emailChange.requireVerification },\n\t\t\tpasswordless: {\n\t\t\t\tenabled: config.passwordless.enabled,\n\t\t\t\turl: config.passwordless.url ?? null,\n\t\t\t\texpiration: config.passwordless.expiration,\n\t\t\t},\n\t\t\tpassword: {\n\t\t\t\tminLength: config.password.minLength,\n\t\t\t\trequireUppercase: config.password.requireUppercase,\n\t\t\t\trequireLowercase: config.password.requireLowercase,\n\t\t\t\trequireDigit: config.password.requireDigit,\n\t\t\t\trequireSpecial: config.password.requireSpecial,\n\t\t\t\tpattern: config.password.pattern ?? null,\n\t\t\t\tcheckBlacklist: config.password.checkBlacklist,\n\t\t\t\tcheckHibp: config.password.checkHibp,\n\t\t\t},\n\t\t\tlogin: {\n\t\t\t\tbaseBackoff: config.login.baseBackoff,\n\t\t\t\tmaxBackoff: config.login.maxBackoff,\n\t\t\t\tattemptWindow: config.login.attemptWindow,\n\t\t\t\trevealUserExists: config.login.revealUserExists,\n\t\t\t\trevealLoginMethod: config.login.revealLoginMethod,\n\t\t\t\tdefaultTokenExpiration: config.login.defaultTokenExpiration,\n\t\t\t\tmaxTokenExpiration: config.login.maxTokenExpiration ?? null,\n\t\t\t\tmfaGraceDuration: config.login.mfaGraceDuration,\n\t\t\t\tanomalyDetection: {\n\t\t\t\t\tenabled: config.login.anomalyDetection.enabled,\n\t\t\t\t\thistorySize: config.login.anomalyDetection.historySize,\n\t\t\t\t\temailThreshold: config.login.anomalyDetection.emailThreshold,\n\t\t\t\t\tstepUpThreshold: config.login.anomalyDetection.stepUpThreshold,\n\t\t\t\t},\n\t\t\t},\n\t\t\tcaptcha: {\n\t\t\t\tprovider: config.captcha.provider ?? null,\n\t\t\t\tthreshold: config.captcha.threshold ?? null,\n\t\t\t\tprotect: {\n\t\t\t\t\tsignUp: config.captcha.protect.signUp,\n\t\t\t\t\tpasswordReset: config.captcha.protect.passwordReset,\n\t\t\t\t\tpasswordlessInit: config.captcha.protect.passwordlessInit,\n\t\t\t\t\temailVerification: config.captcha.protect.emailVerification,\n\t\t\t\t},\n\t\t\t},\n\t\t\trateLimits: {\n\t\t\t\tsignUpPerIp: toRateLimitWindow(config.rateLimits.signUpPerIp),\n\t\t\t\tloginPerIp: toRateLimitWindow(config.rateLimits.loginPerIp),\n\t\t\t\tpasswordResetPerIp: toRateLimitWindow(config.rateLimits.passwordResetPerIp),\n\t\t\t\tpasswordlessInitPerIp: toRateLimitWindow(config.rateLimits.passwordlessInitPerIp),\n\t\t\t\temailOtpPerPerson: toRateLimitWindow(config.rateLimits.emailOtpPerPerson),\n\t\t\t\temailVerificationPerIp: toRateLimitWindow(config.rateLimits.emailVerificationPerIp),\n\t\t\t},\n\t\t}\n\t}\n\n\tpublic async listIdentityProviders(): Promise<RemoteIdentityProvider[]> {\n\t\tconst result = await this.transport.exec(identityProvidersFetcher, {})\n\t\treturn result.identityProviders.map(it => ({\n\t\t\tslug: it.slug,\n\t\t\ttype: it.type,\n\t\t\tdisabledAt: it.disabledAt ?? null,\n\t\t}))\n\t}\n\n\tpublic async addIdp(slug: string, type: string, configuration: unknown, options?: TenantIdpOptions): Promise<void> {\n\t\tconst result = await this.transport.exec(addIdpFetcher, { identityProvider: slug, type, configuration, options })\n\t\tthis.transport.assertOk(result.addIDP, `addIDP(${slug})`)\n\t}\n\n\tpublic async updateIdp(slug: string, type: string, configuration: unknown, options?: TenantIdpOptions): Promise<void> {\n\t\tconst result = await this.transport.exec(updateIdpFetcher, {\n\t\t\tidentityProvider: slug,\n\t\t\ttype,\n\t\t\tconfiguration,\n\t\t\toptions,\n\t\t\tmergeConfiguration: false,\n\t\t})\n\t\tthis.transport.assertOk(result.updateIDP, `updateIDP(${slug})`)\n\t}\n\n\tpublic async enableIdp(slug: string): Promise<void> {\n\t\tconst result = await this.transport.exec(enableIdpFetcher, { identityProvider: slug })\n\t\tthis.transport.assertOk(result.enableIDP, `enableIDP(${slug})`)\n\t}\n\n\tpublic async disableIdp(slug: string): Promise<void> {\n\t\tconst result = await this.transport.exec(disableIdpFetcher, { identityProvider: slug })\n\t\tthis.transport.assertOk(result.disableIDP, `disableIDP(${slug})`)\n\t}\n\n\tpublic async whoAmI(): Promise<TenantWhoAmI> {\n\t\tconst result = await this.transport.exec(meFetcher, {})\n\t\tconst me = result.me\n\t\treturn {\n\t\t\tid: me.id,\n\t\t\tdescription: me.description ?? null,\n\t\t\troles: me.roles ? [...me.roles] : [],\n\t\t\tpermissions: me.permissions\n\t\t\t\t? { canCreateProject: me.permissions.canCreateProject, canDeployEntrypoint: me.permissions.canDeployEntrypoint }\n\t\t\t\t: null,\n\t\t\tprojects: me.projects.map(it => ({\n\t\t\t\tslug: it.project.slug,\n\t\t\t\tname: it.project.name,\n\t\t\t\troles: it.memberships.map(m => m.role),\n\t\t\t})),\n\t\t}\n\t}\n}\n"],"names":["mutation$","createProjectResponse$$","createProjectResponseError$$","createProjectResult$","apiKeyWithToken$$","setProjectSecretResponse$$","setProjectSecretError$$","updateProjectResponse$$","updateProjectError$$","configureResponse$$","configureError$$","query$","config$","configSignup$$","configEmailChange$$","configPasswordless$$","configPassword$$","configLogin$$","configLoginAnomalyDetection$$","configCaptcha$$","configCaptchaProtect$$","configRateLimits$","configRateLimitWindow$$","project$","roleVariableDefinition$$","roleConditionVariableDefinition$$","roleEntityVariableDefinition$$","rolePredefinedVariableDefinition$$","CliError","ExitCode","roleDefinition$","projectSecretInfo$$","identityProvider$","addIDPResponse$$","addIDPError$$","updateIDPResponse$$","updateIDPError$$","enableIDPResponse$$","enableIDPError$$","disableIDPResponse$$","disableIDPError$$","identity$$","identityGlobalPermissions$$","identityProjectRelation$","membership$$"],"mappings":";;;;AAsLA,MAAM,uBAAuBA,UAAAA,UAAU;AAAA,EACtCC,UAAAA,wBAAwB,MAAMC,sCAA4B,EAAE,OAAOC,UAAAA,qBAAqB,eAAeC,2BAAiB,CAAC;AAC1H;AACA,MAAM,0BAA0BJ,UAAAA,UAAU,iBAAiBK,UAAAA,2BAA2B,MAAMC,UAAAA,uBAAuB,CAAC;AACpH,MAAM,uBAAuBN,UAAAA,UAAU,cAAcO,UAAAA,wBAAwB,MAAMC,UAAAA,oBAAoB,CAAC;AACxG,MAAM,mBAAmBR,UAAAA,UAAU,UAAUS,UAAAA,oBAAoB,MAAMC,UAAAA,gBAAgB,CAAC;AACxF,MAAM,uBAAuBC,UAAAA,OAAO;AAAA,EACnCC,kBACE,OAAOC,UAAAA,cAAc,EACrB,YAAYC,6BAAmB,EAC/B,aAAaC,UAAAA,oBAAoB,EACjC,SAASC,UAAAA,gBAAgB,EACzB,MAAMC,UAAAA,cAAc,iBAAiBC,UAAAA,6BAA6B,CAAC,EACnE,QAAQC,UAAAA,gBAAgB,QAAQC,gCAAsB,CAAC,EACvD;AAAA,IACAC,UAAAA,kBACE,YAAYC,UAAAA,uBAAuB,EACnC,WAAWA,UAAAA,uBAAuB,EAClC,mBAAmBA,UAAAA,uBAAuB,EAC1C,sBAAsBA,UAAAA,uBAAuB,EAC7C,kBAAkBA,UAAAA,uBAAuB,EACzC,uBAAuBA,UAAAA,uBAAuB;AAAA,EAAA;AAEnD;AACA,MAAM,kBAAkBX,UAAAA,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AW,MAA6B;AACpD,UAAM,SAAS,MAAM,KAAK,UAAU,KAAK,mBAAmB,EAAE,kBAAkB,MAAM;AACtF,SAAK,UAAU,SAAS,OAAO,YAAY,cAAc,IAAI,GAAG;AAAA,EACjE;AAAA,EAEA,MAAa,SAAgC;AAC5C,UAAM,SAAS,MAAM,KAAK,UAAU,KAAK,WAAW,EAAE;AACtD,UAAM,KAAK,OAAO;AAClB,WAAO;AAAA,MACN,IAAI,GAAG;AAAA,MACP,aAAa,GAAG,eAAe;AAAA,MAC/B,OAAO,GAAG,QAAQ,CAAC,GAAG,GAAG,KAAK,IAAI,CAAA;AAAA,MAClC,aAAa,GAAG,cACb,EAAE,kBAAkB,GAAG,YAAY,kBAAkB,qBAAqB,GAAG,YAAY,oBAAA,IACzF;AAAA,MACH,UAAU,GAAG,SAAS,IAAI,CAAA,QAAO;AAAA,QAChC,MAAM,GAAG,QAAQ;AAAA,QACjB,MAAM,GAAG,QAAQ;AAAA,QACjB,OAAO,GAAG,YAAY,IAAI,CAAA,MAAK,EAAE,IAAI;AAAA,MAAA,EACpC;AAAA,IAAA;AAAA,EAEJ;AACD;;"}
|
|
1
|
+
{"version":3,"file":"TenantProjectClient.cjs","sources":["../../../../../../../packages/cli/src/lib/tenant/clients/TenantProjectClient.ts"],"sourcesContent":["import {\n\taddIDPError$$,\n\taddIDPResponse$$,\n\tapiKeyWithToken$$,\n\ttype CaptchaProvider,\n\tconfig$,\n\tconfigCaptcha$$,\n\tconfigCaptchaProtect$$,\n\tconfigEmailChange$$,\n\tconfigLogin$$,\n\tconfigLoginAnomalyDetection$$,\n\tconfigPassword$$,\n\tconfigPasswordless$$,\n\ttype ConfigPolicy,\n\tconfigRateLimits$,\n\tconfigRateLimitWindow$$,\n\tconfigSignup$$,\n\tconfigureError$$,\n\tconfigureResponse$$,\n\tcreateProjectResponse$$,\n\tcreateProjectResponseError$$,\n\tcreateProjectResult$,\n\tdisableIDPError$$,\n\tdisableIDPResponse$$,\n\tenableIDPError$$,\n\tenableIDPResponse$$,\n\tidentity$$,\n\tidentityGlobalPermissions$$,\n\tidentityProjectRelation$,\n\tidentityProvider$,\n\tmembership$$,\n\tmutation$,\n\tproject$,\n\tprojectSecretInfo$$,\n\tquery$,\n\troleConditionVariableDefinition$$,\n\troleDefinition$,\n\troleEntityVariableDefinition$$,\n\trolePredefinedVariableDefinition$$,\n\troleVariableDefinition$$,\n\tsetProjectSecretError$$,\n\tsetProjectSecretResponse$$,\n\tupdateIDPError$$,\n\tupdateIDPResponse$$,\n\tupdateProjectError$$,\n\tupdateProjectResponse$$,\n} from '@contember/graphql-client-tenant'\nimport { CliError, ExitCode } from '@contember/cli-common'\nimport type { ModelType } from 'graphql-ts-client-api'\nimport { TenantApiTransport } from '../TenantApiTransport.js'\nimport { TenantGlobalConfig, TenantIdpOptions } from '../tenantConfig.js'\n\nexport interface RemoteIdentityProvider {\n\tslug: string\n\ttype: string\n\tdisabledAt: string | null\n}\n\nexport interface TenantProjectSummary {\n\tid: string\n\tname: string\n\tslug: string\n}\n\nexport interface TenantProjectRole {\n\tname: string\n\t/** Variable names the role expects, retained for compatibility. */\n\tvariables: string[]\n\tvariableDefinitions: TenantProjectRoleVariableDefinition[]\n}\n\nexport type TenantProjectRoleVariableDefinition =\n\t| { type: 'entity'; name: string; entityName: string }\n\t| { type: 'predefined'; name: string; value: string }\n\t| { type: 'condition'; name: string }\n\nexport interface TenantProjectSecret {\n\tkey: string\n\tcreatedAt: string\n\tupdatedAt: string\n}\n\nexport interface TenantProjectDetail {\n\tid: string\n\tname: string\n\tslug: string\n\tconfig: unknown\n\troles: TenantProjectRole[]\n\tsecrets: TenantProjectSecret[]\n}\n\nexport interface TenantCreateProjectDetails {\n\tname?: string\n\tconfig?: unknown\n\t/** Skip issuing a deploy API key for the project. */\n\tnoDeployToken?: boolean\n}\n\nexport interface TenantCreateProjectResult {\n\t/** Null when {@link TenantCreateProjectDetails.noDeployToken} was requested. */\n\tdeployerApiKey: { id: string; token: string | null } | null\n}\n\nexport interface TenantUpdateProjectChanges {\n\tname?: string\n\tconfig?: unknown\n\tmergeConfig?: boolean\n}\n\nexport interface TenantRateLimitWindowState {\n\tlimit: number\n\twindow: string\n}\n\n/** The tenant-wide configuration returned by `Query.configuration` — the read side of {@link TenantGlobalConfig}. */\nexport interface TenantConfigState {\n\tsignup: { requireEmailVerification: boolean }\n\temailChange: { requireVerification: boolean; requireReauthentication: boolean }\n\tpasswordless: { enabled: ConfigPolicy; url: string | null; expiration: string; uniformResponse: boolean }\n\tpassword: {\n\t\tminLength: number\n\t\trequireUppercase: number\n\t\trequireLowercase: number\n\t\trequireDigit: number\n\t\trequireSpecial: number\n\t\tpattern: string | null\n\t\tcheckBlacklist: boolean\n\t\tcheckHibp: boolean\n\t\trevokeSessionsOnChange: boolean\n\t}\n\tlogin: {\n\t\tbaseBackoff: string\n\t\tmaxBackoff: string\n\t\tattemptWindow: string\n\t\trevealUserExists: boolean\n\t\trevealLoginMethod: boolean\n\t\tdefaultTokenExpiration: string\n\t\tmaxTokenExpiration: string | null\n\t\tmfaGraceDuration: string\n\t\tmfaChangeRequiresReauthentication: boolean\n\t\tanomalyDetection: {\n\t\t\tenabled: boolean\n\t\t\thistorySize: number\n\t\t\temailThreshold: number\n\t\t\tstepUpThreshold: number\n\t\t\tmissingSignalIsNew: boolean\n\t\t}\n\t}\n\tcaptcha: {\n\t\tprovider: CaptchaProvider | null\n\t\tthreshold: number | null\n\t\tprotect: {\n\t\t\tsignUp: boolean\n\t\t\tpasswordReset: boolean\n\t\t\tpasswordlessInit: boolean\n\t\t\temailVerification: boolean\n\t\t}\n\t}\n\trateLimits: {\n\t\tsignUpPerIp: TenantRateLimitWindowState\n\t\tloginPerIp: TenantRateLimitWindowState\n\t\tpasswordResetPerIp: TenantRateLimitWindowState\n\t\tpasswordlessInitPerIp: TenantRateLimitWindowState\n\t\temailOtpPerPerson: TenantRateLimitWindowState\n\t\temailVerificationPerIp: TenantRateLimitWindowState\n\t}\n}\n\nexport interface TenantWhoAmIProject {\n\tslug: string\n\tname: string\n\troles: string[]\n}\n\n/** `Query.me` — the identity behind the token the CLI is using. */\nexport interface TenantWhoAmI {\n\tid: string\n\tdescription: string | null\n\t/** Global (tenant-wide) roles — empty for an identity whose access is entirely project-scoped. */\n\troles: string[]\n\tpermissions: { canCreateProject: boolean; canDeployEntrypoint: boolean } | null\n\tprojects: TenantWhoAmIProject[]\n}\n\n// Fetchers are immutable and reusable, so they are built once at module load.\nconst createProjectFetcher = mutation$.createProject(\n\tcreateProjectResponse$$.error(createProjectResponseError$$).result(createProjectResult$.deployerApiKey(apiKeyWithToken$$)),\n)\nconst setProjectSecretFetcher = mutation$.setProjectSecret(setProjectSecretResponse$$.error(setProjectSecretError$$))\nconst updateProjectFetcher = mutation$.updateProject(updateProjectResponse$$.error(updateProjectError$$))\nconst configureFetcher = mutation$.configure(configureResponse$$.error(configureError$$))\nconst configurationFetcher = query$.configuration(\n\tconfig$\n\t\t.signup(configSignup$$)\n\t\t.emailChange(configEmailChange$$)\n\t\t.passwordless(configPasswordless$$)\n\t\t.password(configPassword$$)\n\t\t.login(configLogin$$.anomalyDetection(configLoginAnomalyDetection$$))\n\t\t.captcha(configCaptcha$$.protect(configCaptchaProtect$$))\n\t\t.rateLimits(\n\t\t\tconfigRateLimits$\n\t\t\t\t.signUpPerIp(configRateLimitWindow$$)\n\t\t\t\t.loginPerIp(configRateLimitWindow$$)\n\t\t\t\t.passwordResetPerIp(configRateLimitWindow$$)\n\t\t\t\t.passwordlessInitPerIp(configRateLimitWindow$$)\n\t\t\t\t.emailOtpPerPerson(configRateLimitWindow$$)\n\t\t\t\t.emailVerificationPerIp(configRateLimitWindow$$),\n\t\t),\n)\nconst projectsFetcher = query$.projects(project$.id.name.slug)\nconst roleVariableFetcher = roleVariableDefinition$$\n\t.on(roleConditionVariableDefinition$$)\n\t.on(roleEntityVariableDefinition$$)\n\t.on(rolePredefinedVariableDefinition$$)\nconst toRoleVariableDefinition = (variable: ModelType<typeof roleVariableFetcher>): TenantProjectRoleVariableDefinition => {\n\tswitch (variable.__typename) {\n\t\tcase 'RoleEntityVariableDefinition':\n\t\t\treturn { type: 'entity', name: variable.name, entityName: variable.entityName }\n\t\tcase 'RolePredefinedVariableDefinition':\n\t\t\treturn { type: 'predefined', name: variable.name, value: variable.value }\n\t\tcase 'RoleConditionVariableDefinition':\n\t\t\treturn { type: 'condition', name: variable.name }\n\t\tcase 'RoleVariableDefinition':\n\t\t\tthrow new CliError(`Tenant API returned an abstract role variable definition for \"${variable.name}\".`, {\n\t\t\t\tcode: 'TENANT_API_INVALID_RESPONSE',\n\t\t\t\texitCode: ExitCode.InternalError,\n\t\t\t})\n\t}\n}\nconst projectBySlugFetcher = query$.projectBySlug(\n\tproject$\n\t\t.id.name.slug.config\n\t\t.roles(roleDefinition$.name.variables(roleVariableFetcher))\n\t\t.secrets(projectSecretInfo$$),\n)\nconst identityProvidersFetcher = query$.identityProviders(identityProvider$.slug.type.disabledAt)\nconst addIdpFetcher = mutation$.addIDP(addIDPResponse$$.error(addIDPError$$))\nconst updateIdpFetcher = mutation$.updateIDP(updateIDPResponse$$.error(updateIDPError$$))\nconst enableIdpFetcher = mutation$.enableIDP(enableIDPResponse$$.error(enableIDPError$$))\nconst disableIdpFetcher = mutation$.disableIDP(disableIDPResponse$$.error(disableIDPError$$))\nconst meFetcher = query$.me(\n\tidentity$$\n\t\t.permissions(identityGlobalPermissions$$)\n\t\t.projects(identityProjectRelation$.project(project$.slug.name).memberships(membership$$)),\n)\n\nconst toRateLimitWindow = (it: { limit: number; window: string }): TenantRateLimitWindowState => ({ limit: it.limit, window: it.window })\n\n/** Projects, project secrets, global tenant configuration, identity providers and `me`. */\nexport class TenantProjectClient {\n\tconstructor(\n\t\tprivate readonly transport: TenantApiTransport,\n\t) {\n\t}\n\n\tpublic async listProjects(): Promise<TenantProjectSummary[]> {\n\t\tconst result = await this.transport.exec(projectsFetcher, {})\n\t\treturn result.projects.map(it => ({ id: it.id, name: it.name, slug: it.slug }))\n\t}\n\n\t/** Null both when the project does not exist and when the caller may not see it — the API does not distinguish. */\n\tpublic async getProjectBySlug(slug: string): Promise<TenantProjectDetail | null> {\n\t\tconst result = await this.transport.exec(projectBySlugFetcher, { slug })\n\t\tconst project = result.projectBySlug\n\t\tif (!project) {\n\t\t\treturn null\n\t\t}\n\t\treturn {\n\t\t\tid: project.id,\n\t\t\tname: project.name,\n\t\t\tslug: project.slug,\n\t\t\tconfig: project.config,\n\t\t\troles: project.roles.map(role => ({\n\t\t\t\tname: role.name,\n\t\t\t\tvariables: role.variables.map(it => it.name),\n\t\t\t\tvariableDefinitions: role.variables.map(toRoleVariableDefinition),\n\t\t\t})),\n\t\t\tsecrets: project.secrets.map(it => ({ key: it.key, createdAt: it.createdAt, updatedAt: it.updatedAt })),\n\t\t}\n\t}\n\n\t/** Returns `null` (nothing created) when `ignoreExisting` swallowed an `ALREADY_EXISTS`. */\n\tpublic async createProject(slug: string, ignoreExisting = false, details?: TenantCreateProjectDetails): Promise<TenantCreateProjectResult | null> {\n\t\tconst result = await this.transport.exec(createProjectFetcher, {\n\t\t\tprojectSlug: slug,\n\t\t\tname: details?.name,\n\t\t\tconfig: details?.config,\n\t\t\toptions: details?.noDeployToken ? { noDeployToken: true } : undefined,\n\t\t})\n\t\tif (ignoreExisting && result.createProject?.error?.code === 'ALREADY_EXISTS') {\n\t\t\treturn null\n\t\t}\n\t\tthis.transport.assertOk(result.createProject, `createProject(${slug})`)\n\t\tconst deployerApiKey = result.createProject?.result?.deployerApiKey\n\t\treturn { deployerApiKey: deployerApiKey ? { id: deployerApiKey.id, token: deployerApiKey.token ?? null } : null }\n\t}\n\n\tpublic async updateProject(slug: string, changes: TenantUpdateProjectChanges): Promise<void> {\n\t\tconst result = await this.transport.exec(updateProjectFetcher, {\n\t\t\tprojectSlug: slug,\n\t\t\tname: changes.name,\n\t\t\tconfig: changes.config,\n\t\t\tmergeConfig: changes.mergeConfig,\n\t\t})\n\t\tthis.transport.assertOk(result.updateProject, `updateProject(${slug})`)\n\t}\n\n\tpublic async setProjectSecret(slug: string, key: string, value: string): Promise<void> {\n\t\tconst result = await this.transport.exec(setProjectSecretFetcher, { projectSlug: slug, key, value })\n\t\tthis.transport.assertOk(result.setProjectSecret, `setProjectSecret(${slug}/${key})`)\n\t}\n\n\tpublic async configure(config: TenantGlobalConfig): Promise<void> {\n\t\tconst result = await this.transport.exec(configureFetcher, { config })\n\t\tthis.transport.assertOk(result.configure, 'configure')\n\t}\n\n\tpublic async configuration(): Promise<TenantConfigState> {\n\t\tconst result = await this.transport.exec(configurationFetcher, {})\n\t\tconst config = result.configuration\n\t\treturn {\n\t\t\tsignup: { requireEmailVerification: config.signup.requireEmailVerification },\n\t\t\temailChange: {\n\t\t\t\trequireVerification: config.emailChange.requireVerification,\n\t\t\t\trequireReauthentication: config.emailChange.requireReauthentication,\n\t\t\t},\n\t\t\tpasswordless: {\n\t\t\t\tenabled: config.passwordless.enabled,\n\t\t\t\turl: config.passwordless.url ?? null,\n\t\t\t\texpiration: config.passwordless.expiration,\n\t\t\t\tuniformResponse: config.passwordless.uniformResponse,\n\t\t\t},\n\t\t\tpassword: {\n\t\t\t\tminLength: config.password.minLength,\n\t\t\t\trequireUppercase: config.password.requireUppercase,\n\t\t\t\trequireLowercase: config.password.requireLowercase,\n\t\t\t\trequireDigit: config.password.requireDigit,\n\t\t\t\trequireSpecial: config.password.requireSpecial,\n\t\t\t\tpattern: config.password.pattern ?? null,\n\t\t\t\tcheckBlacklist: config.password.checkBlacklist,\n\t\t\t\tcheckHibp: config.password.checkHibp,\n\t\t\t\trevokeSessionsOnChange: config.password.revokeSessionsOnChange,\n\t\t\t},\n\t\t\tlogin: {\n\t\t\t\tbaseBackoff: config.login.baseBackoff,\n\t\t\t\tmaxBackoff: config.login.maxBackoff,\n\t\t\t\tattemptWindow: config.login.attemptWindow,\n\t\t\t\trevealUserExists: config.login.revealUserExists,\n\t\t\t\trevealLoginMethod: config.login.revealLoginMethod,\n\t\t\t\tdefaultTokenExpiration: config.login.defaultTokenExpiration,\n\t\t\t\tmaxTokenExpiration: config.login.maxTokenExpiration ?? null,\n\t\t\t\tmfaGraceDuration: config.login.mfaGraceDuration,\n\t\t\t\tmfaChangeRequiresReauthentication: config.login.mfaChangeRequiresReauthentication,\n\t\t\t\tanomalyDetection: {\n\t\t\t\t\tenabled: config.login.anomalyDetection.enabled,\n\t\t\t\t\thistorySize: config.login.anomalyDetection.historySize,\n\t\t\t\t\temailThreshold: config.login.anomalyDetection.emailThreshold,\n\t\t\t\t\tstepUpThreshold: config.login.anomalyDetection.stepUpThreshold,\n\t\t\t\t\tmissingSignalIsNew: config.login.anomalyDetection.missingSignalIsNew,\n\t\t\t\t},\n\t\t\t},\n\t\t\tcaptcha: {\n\t\t\t\tprovider: config.captcha.provider ?? null,\n\t\t\t\tthreshold: config.captcha.threshold ?? null,\n\t\t\t\tprotect: {\n\t\t\t\t\tsignUp: config.captcha.protect.signUp,\n\t\t\t\t\tpasswordReset: config.captcha.protect.passwordReset,\n\t\t\t\t\tpasswordlessInit: config.captcha.protect.passwordlessInit,\n\t\t\t\t\temailVerification: config.captcha.protect.emailVerification,\n\t\t\t\t},\n\t\t\t},\n\t\t\trateLimits: {\n\t\t\t\tsignUpPerIp: toRateLimitWindow(config.rateLimits.signUpPerIp),\n\t\t\t\tloginPerIp: toRateLimitWindow(config.rateLimits.loginPerIp),\n\t\t\t\tpasswordResetPerIp: toRateLimitWindow(config.rateLimits.passwordResetPerIp),\n\t\t\t\tpasswordlessInitPerIp: toRateLimitWindow(config.rateLimits.passwordlessInitPerIp),\n\t\t\t\temailOtpPerPerson: toRateLimitWindow(config.rateLimits.emailOtpPerPerson),\n\t\t\t\temailVerificationPerIp: toRateLimitWindow(config.rateLimits.emailVerificationPerIp),\n\t\t\t},\n\t\t}\n\t}\n\n\tpublic async listIdentityProviders(): Promise<RemoteIdentityProvider[]> {\n\t\tconst result = await this.transport.exec(identityProvidersFetcher, {})\n\t\treturn result.identityProviders.map(it => ({\n\t\t\tslug: it.slug,\n\t\t\ttype: it.type,\n\t\t\tdisabledAt: it.disabledAt ?? null,\n\t\t}))\n\t}\n\n\tpublic async addIdp(slug: string, type: string, configuration: unknown, options?: TenantIdpOptions): Promise<void> {\n\t\tconst result = await this.transport.exec(addIdpFetcher, { identityProvider: slug, type, configuration, options })\n\t\tthis.transport.assertOk(result.addIDP, `addIDP(${slug})`)\n\t}\n\n\tpublic async updateIdp(slug: string, type: string, configuration: unknown, options?: TenantIdpOptions): Promise<void> {\n\t\tconst result = await this.transport.exec(updateIdpFetcher, {\n\t\t\tidentityProvider: slug,\n\t\t\ttype,\n\t\t\tconfiguration,\n\t\t\toptions,\n\t\t\tmergeConfiguration: false,\n\t\t})\n\t\tthis.transport.assertOk(result.updateIDP, `updateIDP(${slug})`)\n\t}\n\n\tpublic async enableIdp(slug: string): Promise<void> {\n\t\tconst result = await this.transport.exec(enableIdpFetcher, { identityProvider: slug })\n\t\tthis.transport.assertOk(result.enableIDP, `enableIDP(${slug})`)\n\t}\n\n\tpublic async disableIdp(slug: string): Promise<void> {\n\t\tconst result = await this.transport.exec(disableIdpFetcher, { identityProvider: slug })\n\t\tthis.transport.assertOk(result.disableIDP, `disableIDP(${slug})`)\n\t}\n\n\tpublic async whoAmI(): Promise<TenantWhoAmI> {\n\t\tconst result = await this.transport.exec(meFetcher, {})\n\t\tconst me = result.me\n\t\treturn {\n\t\t\tid: me.id,\n\t\t\tdescription: me.description ?? null,\n\t\t\troles: me.roles ? [...me.roles] : [],\n\t\t\tpermissions: me.permissions\n\t\t\t\t? { canCreateProject: me.permissions.canCreateProject, canDeployEntrypoint: me.permissions.canDeployEntrypoint }\n\t\t\t\t: null,\n\t\t\tprojects: me.projects.map(it => ({\n\t\t\t\tslug: it.project.slug,\n\t\t\t\tname: it.project.name,\n\t\t\t\troles: it.memberships.map(m => m.role),\n\t\t\t})),\n\t\t}\n\t}\n}\n"],"names":["mutation$","createProjectResponse$$","createProjectResponseError$$","createProjectResult$","apiKeyWithToken$$","setProjectSecretResponse$$","setProjectSecretError$$","updateProjectResponse$$","updateProjectError$$","configureResponse$$","configureError$$","query$","config$","configSignup$$","configEmailChange$$","configPasswordless$$","configPassword$$","configLogin$$","configLoginAnomalyDetection$$","configCaptcha$$","configCaptchaProtect$$","configRateLimits$","configRateLimitWindow$$","project$","roleVariableDefinition$$","roleConditionVariableDefinition$$","roleEntityVariableDefinition$$","rolePredefinedVariableDefinition$$","CliError","ExitCode","roleDefinition$","projectSecretInfo$$","identityProvider$","addIDPResponse$$","addIDPError$$","updateIDPResponse$$","updateIDPError$$","enableIDPResponse$$","enableIDPError$$","disableIDPResponse$$","disableIDPError$$","identity$$","identityGlobalPermissions$$","identityProjectRelation$","membership$$"],"mappings":";;;;AAyLA,MAAM,uBAAuBA,UAAAA,UAAU;AAAA,EACtCC,UAAAA,wBAAwB,MAAMC,sCAA4B,EAAE,OAAOC,UAAAA,qBAAqB,eAAeC,2BAAiB,CAAC;AAC1H;AACA,MAAM,0BAA0BJ,UAAAA,UAAU,iBAAiBK,UAAAA,2BAA2B,MAAMC,UAAAA,uBAAuB,CAAC;AACpH,MAAM,uBAAuBN,UAAAA,UAAU,cAAcO,UAAAA,wBAAwB,MAAMC,UAAAA,oBAAoB,CAAC;AACxG,MAAM,mBAAmBR,UAAAA,UAAU,UAAUS,UAAAA,oBAAoB,MAAMC,UAAAA,gBAAgB,CAAC;AACxF,MAAM,uBAAuBC,UAAAA,OAAO;AAAA,EACnCC,kBACE,OAAOC,UAAAA,cAAc,EACrB,YAAYC,6BAAmB,EAC/B,aAAaC,UAAAA,oBAAoB,EACjC,SAASC,UAAAA,gBAAgB,EACzB,MAAMC,UAAAA,cAAc,iBAAiBC,UAAAA,6BAA6B,CAAC,EACnE,QAAQC,UAAAA,gBAAgB,QAAQC,gCAAsB,CAAC,EACvD;AAAA,IACAC,UAAAA,kBACE,YAAYC,UAAAA,uBAAuB,EACnC,WAAWA,UAAAA,uBAAuB,EAClC,mBAAmBA,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,MAC1D,kBAAkB;AAAA,MAClB;AAAA,MACA;AAAA,MACA;AAAA,MACA,oBAAoB;AAAA,IAAA,CACpB;AACD,SAAK,UAAU,SAAS,OAAO,WAAW,aAAa,IAAI,GAAG;AAAA,EAC/D;AAAA,EAEA,MAAa,UAAU,MAA6B;AACnD,UAAM,SAAS,MAAM,KAAK,UAAU,KAAK,kBAAkB,EAAE,kBAAkB,MAAM;AACrF,SAAK,UAAU,SAAS,OAAO,WAAW,aAAa,IAAI,GAAG;AAAA,EAC/D;AAAA,EAEA,MAAa,WAAW,MAA6B;AACpD,UAAM,SAAS,MAAM,KAAK,UAAU,KAAK,mBAAmB,EAAE,kBAAkB,MAAM;AACtF,SAAK,UAAU,SAAS,OAAO,YAAY,cAAc,IAAI,GAAG;AAAA,EACjE;AAAA,EAEA,MAAa,SAAgC;AAC5C,UAAM,SAAS,MAAM,KAAK,UAAU,KAAK,WAAW,EAAE;AACtD,UAAM,KAAK,OAAO;AAClB,WAAO;AAAA,MACN,IAAI,GAAG;AAAA,MACP,aAAa,GAAG,eAAe;AAAA,MAC/B,OAAO,GAAG,QAAQ,CAAC,GAAG,GAAG,KAAK,IAAI,CAAA;AAAA,MAClC,aAAa,GAAG,cACb,EAAE,kBAAkB,GAAG,YAAY,kBAAkB,qBAAqB,GAAG,YAAY,oBAAA,IACzF;AAAA,MACH,UAAU,GAAG,SAAS,IAAI,CAAA,QAAO;AAAA,QAChC,MAAM,GAAG,QAAQ;AAAA,QACjB,MAAM,GAAG,QAAQ;AAAA,QACjB,OAAO,GAAG,YAAY,IAAI,CAAA,MAAK,EAAE,IAAI;AAAA,MAAA,EACpC;AAAA,IAAA;AAAA,EAEJ;AACD;;"}
|
|
@@ -105,11 +105,15 @@ class TenantProjectClient {
|
|
|
105
105
|
const config = result.configuration;
|
|
106
106
|
return {
|
|
107
107
|
signup: { requireEmailVerification: config.signup.requireEmailVerification },
|
|
108
|
-
emailChange: {
|
|
108
|
+
emailChange: {
|
|
109
|
+
requireVerification: config.emailChange.requireVerification,
|
|
110
|
+
requireReauthentication: config.emailChange.requireReauthentication
|
|
111
|
+
},
|
|
109
112
|
passwordless: {
|
|
110
113
|
enabled: config.passwordless.enabled,
|
|
111
114
|
url: config.passwordless.url ?? null,
|
|
112
|
-
expiration: config.passwordless.expiration
|
|
115
|
+
expiration: config.passwordless.expiration,
|
|
116
|
+
uniformResponse: config.passwordless.uniformResponse
|
|
113
117
|
},
|
|
114
118
|
password: {
|
|
115
119
|
minLength: config.password.minLength,
|
|
@@ -119,7 +123,8 @@ class TenantProjectClient {
|
|
|
119
123
|
requireSpecial: config.password.requireSpecial,
|
|
120
124
|
pattern: config.password.pattern ?? null,
|
|
121
125
|
checkBlacklist: config.password.checkBlacklist,
|
|
122
|
-
checkHibp: config.password.checkHibp
|
|
126
|
+
checkHibp: config.password.checkHibp,
|
|
127
|
+
revokeSessionsOnChange: config.password.revokeSessionsOnChange
|
|
123
128
|
},
|
|
124
129
|
login: {
|
|
125
130
|
baseBackoff: config.login.baseBackoff,
|
|
@@ -130,11 +135,13 @@ class TenantProjectClient {
|
|
|
130
135
|
defaultTokenExpiration: config.login.defaultTokenExpiration,
|
|
131
136
|
maxTokenExpiration: config.login.maxTokenExpiration ?? null,
|
|
132
137
|
mfaGraceDuration: config.login.mfaGraceDuration,
|
|
138
|
+
mfaChangeRequiresReauthentication: config.login.mfaChangeRequiresReauthentication,
|
|
133
139
|
anomalyDetection: {
|
|
134
140
|
enabled: config.login.anomalyDetection.enabled,
|
|
135
141
|
historySize: config.login.anomalyDetection.historySize,
|
|
136
142
|
emailThreshold: config.login.anomalyDetection.emailThreshold,
|
|
137
|
-
stepUpThreshold: config.login.anomalyDetection.stepUpThreshold
|
|
143
|
+
stepUpThreshold: config.login.anomalyDetection.stepUpThreshold,
|
|
144
|
+
missingSignalIsNew: config.login.anomalyDetection.missingSignalIsNew
|
|
138
145
|
}
|
|
139
146
|
},
|
|
140
147
|
captcha: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TenantProjectClient.js","sources":["../../../../../../../packages/cli/src/lib/tenant/clients/TenantProjectClient.ts"],"sourcesContent":["import {\n\taddIDPError$$,\n\taddIDPResponse$$,\n\tapiKeyWithToken$$,\n\ttype CaptchaProvider,\n\tconfig$,\n\tconfigCaptcha$$,\n\tconfigCaptchaProtect$$,\n\tconfigEmailChange$$,\n\tconfigLogin$$,\n\tconfigLoginAnomalyDetection$$,\n\tconfigPassword$$,\n\tconfigPasswordless$$,\n\ttype ConfigPolicy,\n\tconfigRateLimits$,\n\tconfigRateLimitWindow$$,\n\tconfigSignup$$,\n\tconfigureError$$,\n\tconfigureResponse$$,\n\tcreateProjectResponse$$,\n\tcreateProjectResponseError$$,\n\tcreateProjectResult$,\n\tdisableIDPError$$,\n\tdisableIDPResponse$$,\n\tenableIDPError$$,\n\tenableIDPResponse$$,\n\tidentity$$,\n\tidentityGlobalPermissions$$,\n\tidentityProjectRelation$,\n\tidentityProvider$,\n\tmembership$$,\n\tmutation$,\n\tproject$,\n\tprojectSecretInfo$$,\n\tquery$,\n\troleConditionVariableDefinition$$,\n\troleDefinition$,\n\troleEntityVariableDefinition$$,\n\trolePredefinedVariableDefinition$$,\n\troleVariableDefinition$$,\n\tsetProjectSecretError$$,\n\tsetProjectSecretResponse$$,\n\tupdateIDPError$$,\n\tupdateIDPResponse$$,\n\tupdateProjectError$$,\n\tupdateProjectResponse$$,\n} from '@contember/graphql-client-tenant'\nimport { CliError, ExitCode } from '@contember/cli-common'\nimport type { ModelType } from 'graphql-ts-client-api'\nimport { TenantApiTransport } from '../TenantApiTransport.js'\nimport { TenantGlobalConfig, TenantIdpOptions } from '../tenantConfig.js'\n\nexport interface RemoteIdentityProvider {\n\tslug: string\n\ttype: string\n\tdisabledAt: string | null\n}\n\nexport interface TenantProjectSummary {\n\tid: string\n\tname: string\n\tslug: string\n}\n\nexport interface TenantProjectRole {\n\tname: string\n\t/** Variable names the role expects, retained for compatibility. */\n\tvariables: string[]\n\tvariableDefinitions: TenantProjectRoleVariableDefinition[]\n}\n\nexport type TenantProjectRoleVariableDefinition =\n\t| { type: 'entity'; name: string; entityName: string }\n\t| { type: 'predefined'; name: string; value: string }\n\t| { type: 'condition'; name: string }\n\nexport interface TenantProjectSecret {\n\tkey: string\n\tcreatedAt: string\n\tupdatedAt: string\n}\n\nexport interface TenantProjectDetail {\n\tid: string\n\tname: string\n\tslug: string\n\tconfig: unknown\n\troles: TenantProjectRole[]\n\tsecrets: TenantProjectSecret[]\n}\n\nexport interface TenantCreateProjectDetails {\n\tname?: string\n\tconfig?: unknown\n\t/** Skip issuing a deploy API key for the project. */\n\tnoDeployToken?: boolean\n}\n\nexport interface TenantCreateProjectResult {\n\t/** Null when {@link TenantCreateProjectDetails.noDeployToken} was requested. */\n\tdeployerApiKey: { id: string; token: string | null } | null\n}\n\nexport interface TenantUpdateProjectChanges {\n\tname?: string\n\tconfig?: unknown\n\tmergeConfig?: boolean\n}\n\nexport interface TenantRateLimitWindowState {\n\tlimit: number\n\twindow: string\n}\n\n/** The tenant-wide configuration returned by `Query.configuration` — the read side of {@link TenantGlobalConfig}. */\nexport interface TenantConfigState {\n\tsignup: { requireEmailVerification: boolean }\n\temailChange: { requireVerification: boolean }\n\tpasswordless: { enabled: ConfigPolicy; url: string | null; expiration: string }\n\tpassword: {\n\t\tminLength: number\n\t\trequireUppercase: number\n\t\trequireLowercase: number\n\t\trequireDigit: number\n\t\trequireSpecial: number\n\t\tpattern: string | null\n\t\tcheckBlacklist: boolean\n\t\tcheckHibp: boolean\n\t}\n\tlogin: {\n\t\tbaseBackoff: string\n\t\tmaxBackoff: string\n\t\tattemptWindow: string\n\t\trevealUserExists: boolean\n\t\trevealLoginMethod: boolean\n\t\tdefaultTokenExpiration: string\n\t\tmaxTokenExpiration: string | null\n\t\tmfaGraceDuration: string\n\t\tanomalyDetection: {\n\t\t\tenabled: boolean\n\t\t\thistorySize: number\n\t\t\temailThreshold: number\n\t\t\tstepUpThreshold: number\n\t\t}\n\t}\n\tcaptcha: {\n\t\tprovider: CaptchaProvider | null\n\t\tthreshold: number | null\n\t\tprotect: {\n\t\t\tsignUp: boolean\n\t\t\tpasswordReset: boolean\n\t\t\tpasswordlessInit: boolean\n\t\t\temailVerification: boolean\n\t\t}\n\t}\n\trateLimits: {\n\t\tsignUpPerIp: TenantRateLimitWindowState\n\t\tloginPerIp: TenantRateLimitWindowState\n\t\tpasswordResetPerIp: TenantRateLimitWindowState\n\t\tpasswordlessInitPerIp: TenantRateLimitWindowState\n\t\temailOtpPerPerson: TenantRateLimitWindowState\n\t\temailVerificationPerIp: TenantRateLimitWindowState\n\t}\n}\n\nexport interface TenantWhoAmIProject {\n\tslug: string\n\tname: string\n\troles: string[]\n}\n\n/** `Query.me` — the identity behind the token the CLI is using. */\nexport interface TenantWhoAmI {\n\tid: string\n\tdescription: string | null\n\t/** Global (tenant-wide) roles — empty for an identity whose access is entirely project-scoped. */\n\troles: string[]\n\tpermissions: { canCreateProject: boolean; canDeployEntrypoint: boolean } | null\n\tprojects: TenantWhoAmIProject[]\n}\n\n// Fetchers are immutable and reusable, so they are built once at module load.\nconst createProjectFetcher = mutation$.createProject(\n\tcreateProjectResponse$$.error(createProjectResponseError$$).result(createProjectResult$.deployerApiKey(apiKeyWithToken$$)),\n)\nconst setProjectSecretFetcher = mutation$.setProjectSecret(setProjectSecretResponse$$.error(setProjectSecretError$$))\nconst updateProjectFetcher = mutation$.updateProject(updateProjectResponse$$.error(updateProjectError$$))\nconst configureFetcher = mutation$.configure(configureResponse$$.error(configureError$$))\nconst configurationFetcher = query$.configuration(\n\tconfig$\n\t\t.signup(configSignup$$)\n\t\t.emailChange(configEmailChange$$)\n\t\t.passwordless(configPasswordless$$)\n\t\t.password(configPassword$$)\n\t\t.login(configLogin$$.anomalyDetection(configLoginAnomalyDetection$$))\n\t\t.captcha(configCaptcha$$.protect(configCaptchaProtect$$))\n\t\t.rateLimits(\n\t\t\tconfigRateLimits$\n\t\t\t\t.signUpPerIp(configRateLimitWindow$$)\n\t\t\t\t.loginPerIp(configRateLimitWindow$$)\n\t\t\t\t.passwordResetPerIp(configRateLimitWindow$$)\n\t\t\t\t.passwordlessInitPerIp(configRateLimitWindow$$)\n\t\t\t\t.emailOtpPerPerson(configRateLimitWindow$$)\n\t\t\t\t.emailVerificationPerIp(configRateLimitWindow$$),\n\t\t),\n)\nconst projectsFetcher = query$.projects(project$.id.name.slug)\nconst roleVariableFetcher = roleVariableDefinition$$\n\t.on(roleConditionVariableDefinition$$)\n\t.on(roleEntityVariableDefinition$$)\n\t.on(rolePredefinedVariableDefinition$$)\nconst toRoleVariableDefinition = (variable: ModelType<typeof roleVariableFetcher>): TenantProjectRoleVariableDefinition => {\n\tswitch (variable.__typename) {\n\t\tcase 'RoleEntityVariableDefinition':\n\t\t\treturn { type: 'entity', name: variable.name, entityName: variable.entityName }\n\t\tcase 'RolePredefinedVariableDefinition':\n\t\t\treturn { type: 'predefined', name: variable.name, value: variable.value }\n\t\tcase 'RoleConditionVariableDefinition':\n\t\t\treturn { type: 'condition', name: variable.name }\n\t\tcase 'RoleVariableDefinition':\n\t\t\tthrow new CliError(`Tenant API returned an abstract role variable definition for \"${variable.name}\".`, {\n\t\t\t\tcode: 'TENANT_API_INVALID_RESPONSE',\n\t\t\t\texitCode: ExitCode.InternalError,\n\t\t\t})\n\t}\n}\nconst projectBySlugFetcher = query$.projectBySlug(\n\tproject$\n\t\t.id.name.slug.config\n\t\t.roles(roleDefinition$.name.variables(roleVariableFetcher))\n\t\t.secrets(projectSecretInfo$$),\n)\nconst identityProvidersFetcher = query$.identityProviders(identityProvider$.slug.type.disabledAt)\nconst addIdpFetcher = mutation$.addIDP(addIDPResponse$$.error(addIDPError$$))\nconst updateIdpFetcher = mutation$.updateIDP(updateIDPResponse$$.error(updateIDPError$$))\nconst enableIdpFetcher = mutation$.enableIDP(enableIDPResponse$$.error(enableIDPError$$))\nconst disableIdpFetcher = mutation$.disableIDP(disableIDPResponse$$.error(disableIDPError$$))\nconst meFetcher = query$.me(\n\tidentity$$\n\t\t.permissions(identityGlobalPermissions$$)\n\t\t.projects(identityProjectRelation$.project(project$.slug.name).memberships(membership$$)),\n)\n\nconst toRateLimitWindow = (it: { limit: number; window: string }): TenantRateLimitWindowState => ({ limit: it.limit, window: it.window })\n\n/** Projects, project secrets, global tenant configuration, identity providers and `me`. */\nexport class TenantProjectClient {\n\tconstructor(\n\t\tprivate readonly transport: TenantApiTransport,\n\t) {\n\t}\n\n\tpublic async listProjects(): Promise<TenantProjectSummary[]> {\n\t\tconst result = await this.transport.exec(projectsFetcher, {})\n\t\treturn result.projects.map(it => ({ id: it.id, name: it.name, slug: it.slug }))\n\t}\n\n\t/** Null both when the project does not exist and when the caller may not see it — the API does not distinguish. */\n\tpublic async getProjectBySlug(slug: string): Promise<TenantProjectDetail | null> {\n\t\tconst result = await this.transport.exec(projectBySlugFetcher, { slug })\n\t\tconst project = result.projectBySlug\n\t\tif (!project) {\n\t\t\treturn null\n\t\t}\n\t\treturn {\n\t\t\tid: project.id,\n\t\t\tname: project.name,\n\t\t\tslug: project.slug,\n\t\t\tconfig: project.config,\n\t\t\troles: project.roles.map(role => ({\n\t\t\t\tname: role.name,\n\t\t\t\tvariables: role.variables.map(it => it.name),\n\t\t\t\tvariableDefinitions: role.variables.map(toRoleVariableDefinition),\n\t\t\t})),\n\t\t\tsecrets: project.secrets.map(it => ({ key: it.key, createdAt: it.createdAt, updatedAt: it.updatedAt })),\n\t\t}\n\t}\n\n\t/** Returns `null` (nothing created) when `ignoreExisting` swallowed an `ALREADY_EXISTS`. */\n\tpublic async createProject(slug: string, ignoreExisting = false, details?: TenantCreateProjectDetails): Promise<TenantCreateProjectResult | null> {\n\t\tconst result = await this.transport.exec(createProjectFetcher, {\n\t\t\tprojectSlug: slug,\n\t\t\tname: details?.name,\n\t\t\tconfig: details?.config,\n\t\t\toptions: details?.noDeployToken ? { noDeployToken: true } : undefined,\n\t\t})\n\t\tif (ignoreExisting && result.createProject?.error?.code === 'ALREADY_EXISTS') {\n\t\t\treturn null\n\t\t}\n\t\tthis.transport.assertOk(result.createProject, `createProject(${slug})`)\n\t\tconst deployerApiKey = result.createProject?.result?.deployerApiKey\n\t\treturn { deployerApiKey: deployerApiKey ? { id: deployerApiKey.id, token: deployerApiKey.token ?? null } : null }\n\t}\n\n\tpublic async updateProject(slug: string, changes: TenantUpdateProjectChanges): Promise<void> {\n\t\tconst result = await this.transport.exec(updateProjectFetcher, {\n\t\t\tprojectSlug: slug,\n\t\t\tname: changes.name,\n\t\t\tconfig: changes.config,\n\t\t\tmergeConfig: changes.mergeConfig,\n\t\t})\n\t\tthis.transport.assertOk(result.updateProject, `updateProject(${slug})`)\n\t}\n\n\tpublic async setProjectSecret(slug: string, key: string, value: string): Promise<void> {\n\t\tconst result = await this.transport.exec(setProjectSecretFetcher, { projectSlug: slug, key, value })\n\t\tthis.transport.assertOk(result.setProjectSecret, `setProjectSecret(${slug}/${key})`)\n\t}\n\n\tpublic async configure(config: TenantGlobalConfig): Promise<void> {\n\t\tconst result = await this.transport.exec(configureFetcher, { config })\n\t\tthis.transport.assertOk(result.configure, 'configure')\n\t}\n\n\tpublic async configuration(): Promise<TenantConfigState> {\n\t\tconst result = await this.transport.exec(configurationFetcher, {})\n\t\tconst config = result.configuration\n\t\treturn {\n\t\t\tsignup: { requireEmailVerification: config.signup.requireEmailVerification },\n\t\t\temailChange: { requireVerification: config.emailChange.requireVerification },\n\t\t\tpasswordless: {\n\t\t\t\tenabled: config.passwordless.enabled,\n\t\t\t\turl: config.passwordless.url ?? null,\n\t\t\t\texpiration: config.passwordless.expiration,\n\t\t\t},\n\t\t\tpassword: {\n\t\t\t\tminLength: config.password.minLength,\n\t\t\t\trequireUppercase: config.password.requireUppercase,\n\t\t\t\trequireLowercase: config.password.requireLowercase,\n\t\t\t\trequireDigit: config.password.requireDigit,\n\t\t\t\trequireSpecial: config.password.requireSpecial,\n\t\t\t\tpattern: config.password.pattern ?? null,\n\t\t\t\tcheckBlacklist: config.password.checkBlacklist,\n\t\t\t\tcheckHibp: config.password.checkHibp,\n\t\t\t},\n\t\t\tlogin: {\n\t\t\t\tbaseBackoff: config.login.baseBackoff,\n\t\t\t\tmaxBackoff: config.login.maxBackoff,\n\t\t\t\tattemptWindow: config.login.attemptWindow,\n\t\t\t\trevealUserExists: config.login.revealUserExists,\n\t\t\t\trevealLoginMethod: config.login.revealLoginMethod,\n\t\t\t\tdefaultTokenExpiration: config.login.defaultTokenExpiration,\n\t\t\t\tmaxTokenExpiration: config.login.maxTokenExpiration ?? null,\n\t\t\t\tmfaGraceDuration: config.login.mfaGraceDuration,\n\t\t\t\tanomalyDetection: {\n\t\t\t\t\tenabled: config.login.anomalyDetection.enabled,\n\t\t\t\t\thistorySize: config.login.anomalyDetection.historySize,\n\t\t\t\t\temailThreshold: config.login.anomalyDetection.emailThreshold,\n\t\t\t\t\tstepUpThreshold: config.login.anomalyDetection.stepUpThreshold,\n\t\t\t\t},\n\t\t\t},\n\t\t\tcaptcha: {\n\t\t\t\tprovider: config.captcha.provider ?? null,\n\t\t\t\tthreshold: config.captcha.threshold ?? null,\n\t\t\t\tprotect: {\n\t\t\t\t\tsignUp: config.captcha.protect.signUp,\n\t\t\t\t\tpasswordReset: config.captcha.protect.passwordReset,\n\t\t\t\t\tpasswordlessInit: config.captcha.protect.passwordlessInit,\n\t\t\t\t\temailVerification: config.captcha.protect.emailVerification,\n\t\t\t\t},\n\t\t\t},\n\t\t\trateLimits: {\n\t\t\t\tsignUpPerIp: toRateLimitWindow(config.rateLimits.signUpPerIp),\n\t\t\t\tloginPerIp: toRateLimitWindow(config.rateLimits.loginPerIp),\n\t\t\t\tpasswordResetPerIp: toRateLimitWindow(config.rateLimits.passwordResetPerIp),\n\t\t\t\tpasswordlessInitPerIp: toRateLimitWindow(config.rateLimits.passwordlessInitPerIp),\n\t\t\t\temailOtpPerPerson: toRateLimitWindow(config.rateLimits.emailOtpPerPerson),\n\t\t\t\temailVerificationPerIp: toRateLimitWindow(config.rateLimits.emailVerificationPerIp),\n\t\t\t},\n\t\t}\n\t}\n\n\tpublic async listIdentityProviders(): Promise<RemoteIdentityProvider[]> {\n\t\tconst result = await this.transport.exec(identityProvidersFetcher, {})\n\t\treturn result.identityProviders.map(it => ({\n\t\t\tslug: it.slug,\n\t\t\ttype: it.type,\n\t\t\tdisabledAt: it.disabledAt ?? null,\n\t\t}))\n\t}\n\n\tpublic async addIdp(slug: string, type: string, configuration: unknown, options?: TenantIdpOptions): Promise<void> {\n\t\tconst result = await this.transport.exec(addIdpFetcher, { identityProvider: slug, type, configuration, options })\n\t\tthis.transport.assertOk(result.addIDP, `addIDP(${slug})`)\n\t}\n\n\tpublic async updateIdp(slug: string, type: string, configuration: unknown, options?: TenantIdpOptions): Promise<void> {\n\t\tconst result = await this.transport.exec(updateIdpFetcher, {\n\t\t\tidentityProvider: slug,\n\t\t\ttype,\n\t\t\tconfiguration,\n\t\t\toptions,\n\t\t\tmergeConfiguration: false,\n\t\t})\n\t\tthis.transport.assertOk(result.updateIDP, `updateIDP(${slug})`)\n\t}\n\n\tpublic async enableIdp(slug: string): Promise<void> {\n\t\tconst result = await this.transport.exec(enableIdpFetcher, { identityProvider: slug })\n\t\tthis.transport.assertOk(result.enableIDP, `enableIDP(${slug})`)\n\t}\n\n\tpublic async disableIdp(slug: string): Promise<void> {\n\t\tconst result = await this.transport.exec(disableIdpFetcher, { identityProvider: slug })\n\t\tthis.transport.assertOk(result.disableIDP, `disableIDP(${slug})`)\n\t}\n\n\tpublic async whoAmI(): Promise<TenantWhoAmI> {\n\t\tconst result = await this.transport.exec(meFetcher, {})\n\t\tconst me = result.me\n\t\treturn {\n\t\t\tid: me.id,\n\t\t\tdescription: me.description ?? null,\n\t\t\troles: me.roles ? [...me.roles] : [],\n\t\t\tpermissions: me.permissions\n\t\t\t\t? { canCreateProject: me.permissions.canCreateProject, canDeployEntrypoint: me.permissions.canDeployEntrypoint }\n\t\t\t\t: null,\n\t\t\tprojects: me.projects.map(it => ({\n\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A,IAAA;AAAA,EAEJ;AACD;"}
|
|
1
|
+
{"version":3,"file":"TenantProjectClient.js","sources":["../../../../../../../packages/cli/src/lib/tenant/clients/TenantProjectClient.ts"],"sourcesContent":["import {\n\taddIDPError$$,\n\taddIDPResponse$$,\n\tapiKeyWithToken$$,\n\ttype CaptchaProvider,\n\tconfig$,\n\tconfigCaptcha$$,\n\tconfigCaptchaProtect$$,\n\tconfigEmailChange$$,\n\tconfigLogin$$,\n\tconfigLoginAnomalyDetection$$,\n\tconfigPassword$$,\n\tconfigPasswordless$$,\n\ttype ConfigPolicy,\n\tconfigRateLimits$,\n\tconfigRateLimitWindow$$,\n\tconfigSignup$$,\n\tconfigureError$$,\n\tconfigureResponse$$,\n\tcreateProjectResponse$$,\n\tcreateProjectResponseError$$,\n\tcreateProjectResult$,\n\tdisableIDPError$$,\n\tdisableIDPResponse$$,\n\tenableIDPError$$,\n\tenableIDPResponse$$,\n\tidentity$$,\n\tidentityGlobalPermissions$$,\n\tidentityProjectRelation$,\n\tidentityProvider$,\n\tmembership$$,\n\tmutation$,\n\tproject$,\n\tprojectSecretInfo$$,\n\tquery$,\n\troleConditionVariableDefinition$$,\n\troleDefinition$,\n\troleEntityVariableDefinition$$,\n\trolePredefinedVariableDefinition$$,\n\troleVariableDefinition$$,\n\tsetProjectSecretError$$,\n\tsetProjectSecretResponse$$,\n\tupdateIDPError$$,\n\tupdateIDPResponse$$,\n\tupdateProjectError$$,\n\tupdateProjectResponse$$,\n} from '@contember/graphql-client-tenant'\nimport { CliError, ExitCode } from '@contember/cli-common'\nimport type { ModelType } from 'graphql-ts-client-api'\nimport { TenantApiTransport } from '../TenantApiTransport.js'\nimport { TenantGlobalConfig, TenantIdpOptions } from '../tenantConfig.js'\n\nexport interface RemoteIdentityProvider {\n\tslug: string\n\ttype: string\n\tdisabledAt: string | null\n}\n\nexport interface TenantProjectSummary {\n\tid: string\n\tname: string\n\tslug: string\n}\n\nexport interface TenantProjectRole {\n\tname: string\n\t/** Variable names the role expects, retained for compatibility. */\n\tvariables: string[]\n\tvariableDefinitions: TenantProjectRoleVariableDefinition[]\n}\n\nexport type TenantProjectRoleVariableDefinition =\n\t| { type: 'entity'; name: string; entityName: string }\n\t| { type: 'predefined'; name: string; value: string }\n\t| { type: 'condition'; name: string }\n\nexport interface TenantProjectSecret {\n\tkey: string\n\tcreatedAt: string\n\tupdatedAt: string\n}\n\nexport interface TenantProjectDetail {\n\tid: string\n\tname: string\n\tslug: string\n\tconfig: unknown\n\troles: TenantProjectRole[]\n\tsecrets: TenantProjectSecret[]\n}\n\nexport interface TenantCreateProjectDetails {\n\tname?: string\n\tconfig?: unknown\n\t/** Skip issuing a deploy API key for the project. */\n\tnoDeployToken?: boolean\n}\n\nexport interface TenantCreateProjectResult {\n\t/** Null when {@link TenantCreateProjectDetails.noDeployToken} was requested. */\n\tdeployerApiKey: { id: string; token: string | null } | null\n}\n\nexport interface TenantUpdateProjectChanges {\n\tname?: string\n\tconfig?: unknown\n\tmergeConfig?: boolean\n}\n\nexport interface TenantRateLimitWindowState {\n\tlimit: number\n\twindow: string\n}\n\n/** The tenant-wide configuration returned by `Query.configuration` — the read side of {@link TenantGlobalConfig}. */\nexport interface TenantConfigState {\n\tsignup: { requireEmailVerification: boolean }\n\temailChange: { requireVerification: boolean; requireReauthentication: boolean }\n\tpasswordless: { enabled: ConfigPolicy; url: string | null; expiration: string; uniformResponse: boolean }\n\tpassword: {\n\t\tminLength: number\n\t\trequireUppercase: number\n\t\trequireLowercase: number\n\t\trequireDigit: number\n\t\trequireSpecial: number\n\t\tpattern: string | null\n\t\tcheckBlacklist: boolean\n\t\tcheckHibp: boolean\n\t\trevokeSessionsOnChange: boolean\n\t}\n\tlogin: {\n\t\tbaseBackoff: string\n\t\tmaxBackoff: string\n\t\tattemptWindow: string\n\t\trevealUserExists: boolean\n\t\trevealLoginMethod: boolean\n\t\tdefaultTokenExpiration: string\n\t\tmaxTokenExpiration: string | null\n\t\tmfaGraceDuration: string\n\t\tmfaChangeRequiresReauthentication: boolean\n\t\tanomalyDetection: {\n\t\t\tenabled: boolean\n\t\t\thistorySize: number\n\t\t\temailThreshold: number\n\t\t\tstepUpThreshold: number\n\t\t\tmissingSignalIsNew: boolean\n\t\t}\n\t}\n\tcaptcha: {\n\t\tprovider: CaptchaProvider | null\n\t\tthreshold: number | null\n\t\tprotect: {\n\t\t\tsignUp: boolean\n\t\t\tpasswordReset: boolean\n\t\t\tpasswordlessInit: boolean\n\t\t\temailVerification: boolean\n\t\t}\n\t}\n\trateLimits: {\n\t\tsignUpPerIp: TenantRateLimitWindowState\n\t\tloginPerIp: TenantRateLimitWindowState\n\t\tpasswordResetPerIp: TenantRateLimitWindowState\n\t\tpasswordlessInitPerIp: TenantRateLimitWindowState\n\t\temailOtpPerPerson: TenantRateLimitWindowState\n\t\temailVerificationPerIp: TenantRateLimitWindowState\n\t}\n}\n\nexport interface TenantWhoAmIProject {\n\tslug: string\n\tname: string\n\troles: string[]\n}\n\n/** `Query.me` — the identity behind the token the CLI is using. */\nexport interface TenantWhoAmI {\n\tid: string\n\tdescription: string | null\n\t/** Global (tenant-wide) roles — empty for an identity whose access is entirely project-scoped. */\n\troles: string[]\n\tpermissions: { canCreateProject: boolean; canDeployEntrypoint: boolean } | null\n\tprojects: TenantWhoAmIProject[]\n}\n\n// Fetchers are immutable and reusable, so they are built once at module load.\nconst createProjectFetcher = mutation$.createProject(\n\tcreateProjectResponse$$.error(createProjectResponseError$$).result(createProjectResult$.deployerApiKey(apiKeyWithToken$$)),\n)\nconst setProjectSecretFetcher = mutation$.setProjectSecret(setProjectSecretResponse$$.error(setProjectSecretError$$))\nconst updateProjectFetcher = mutation$.updateProject(updateProjectResponse$$.error(updateProjectError$$))\nconst configureFetcher = mutation$.configure(configureResponse$$.error(configureError$$))\nconst configurationFetcher = query$.configuration(\n\tconfig$\n\t\t.signup(configSignup$$)\n\t\t.emailChange(configEmailChange$$)\n\t\t.passwordless(configPasswordless$$)\n\t\t.password(configPassword$$)\n\t\t.login(configLogin$$.anomalyDetection(configLoginAnomalyDetection$$))\n\t\t.captcha(configCaptcha$$.protect(configCaptchaProtect$$))\n\t\t.rateLimits(\n\t\t\tconfigRateLimits$\n\t\t\t\t.signUpPerIp(configRateLimitWindow$$)\n\t\t\t\t.loginPerIp(configRateLimitWindow$$)\n\t\t\t\t.passwordResetPerIp(configRateLimitWindow$$)\n\t\t\t\t.passwordlessInitPerIp(configRateLimitWindow$$)\n\t\t\t\t.emailOtpPerPerson(configRateLimitWindow$$)\n\t\t\t\t.emailVerificationPerIp(configRateLimitWindow$$),\n\t\t),\n)\nconst projectsFetcher = query$.projects(project$.id.name.slug)\nconst roleVariableFetcher = roleVariableDefinition$$\n\t.on(roleConditionVariableDefinition$$)\n\t.on(roleEntityVariableDefinition$$)\n\t.on(rolePredefinedVariableDefinition$$)\nconst toRoleVariableDefinition = (variable: ModelType<typeof roleVariableFetcher>): TenantProjectRoleVariableDefinition => {\n\tswitch (variable.__typename) {\n\t\tcase 'RoleEntityVariableDefinition':\n\t\t\treturn { type: 'entity', name: variable.name, entityName: variable.entityName }\n\t\tcase 'RolePredefinedVariableDefinition':\n\t\t\treturn { type: 'predefined', name: variable.name, value: variable.value }\n\t\tcase 'RoleConditionVariableDefinition':\n\t\t\treturn { type: 'condition', name: variable.name }\n\t\tcase 'RoleVariableDefinition':\n\t\t\tthrow new CliError(`Tenant API returned an abstract role variable definition for \"${variable.name}\".`, {\n\t\t\t\tcode: 'TENANT_API_INVALID_RESPONSE',\n\t\t\t\texitCode: ExitCode.InternalError,\n\t\t\t})\n\t}\n}\nconst projectBySlugFetcher = query$.projectBySlug(\n\tproject$\n\t\t.id.name.slug.config\n\t\t.roles(roleDefinition$.name.variables(roleVariableFetcher))\n\t\t.secrets(projectSecretInfo$$),\n)\nconst identityProvidersFetcher = query$.identityProviders(identityProvider$.slug.type.disabledAt)\nconst addIdpFetcher = mutation$.addIDP(addIDPResponse$$.error(addIDPError$$))\nconst updateIdpFetcher = mutation$.updateIDP(updateIDPResponse$$.error(updateIDPError$$))\nconst enableIdpFetcher = mutation$.enableIDP(enableIDPResponse$$.error(enableIDPError$$))\nconst disableIdpFetcher = mutation$.disableIDP(disableIDPResponse$$.error(disableIDPError$$))\nconst meFetcher = query$.me(\n\tidentity$$\n\t\t.permissions(identityGlobalPermissions$$)\n\t\t.projects(identityProjectRelation$.project(project$.slug.name).memberships(membership$$)),\n)\n\nconst toRateLimitWindow = (it: { limit: number; window: string }): TenantRateLimitWindowState => ({ limit: it.limit, window: it.window })\n\n/** Projects, project secrets, global tenant configuration, identity providers and `me`. */\nexport class TenantProjectClient {\n\tconstructor(\n\t\tprivate readonly transport: TenantApiTransport,\n\t) {\n\t}\n\n\tpublic async listProjects(): Promise<TenantProjectSummary[]> {\n\t\tconst result = await this.transport.exec(projectsFetcher, {})\n\t\treturn result.projects.map(it => ({ id: it.id, name: it.name, slug: it.slug }))\n\t}\n\n\t/** Null both when the project does not exist and when the caller may not see it — the API does not distinguish. */\n\tpublic async getProjectBySlug(slug: string): Promise<TenantProjectDetail | null> {\n\t\tconst result = await this.transport.exec(projectBySlugFetcher, { slug })\n\t\tconst project = result.projectBySlug\n\t\tif (!project) {\n\t\t\treturn null\n\t\t}\n\t\treturn {\n\t\t\tid: project.id,\n\t\t\tname: project.name,\n\t\t\tslug: project.slug,\n\t\t\tconfig: project.config,\n\t\t\troles: project.roles.map(role => ({\n\t\t\t\tname: role.name,\n\t\t\t\tvariables: role.variables.map(it => it.name),\n\t\t\t\tvariableDefinitions: role.variables.map(toRoleVariableDefinition),\n\t\t\t})),\n\t\t\tsecrets: project.secrets.map(it => ({ key: it.key, createdAt: it.createdAt, updatedAt: it.updatedAt })),\n\t\t}\n\t}\n\n\t/** Returns `null` (nothing created) when `ignoreExisting` swallowed an `ALREADY_EXISTS`. */\n\tpublic async createProject(slug: string, ignoreExisting = false, details?: TenantCreateProjectDetails): Promise<TenantCreateProjectResult | null> {\n\t\tconst result = await this.transport.exec(createProjectFetcher, {\n\t\t\tprojectSlug: slug,\n\t\t\tname: details?.name,\n\t\t\tconfig: details?.config,\n\t\t\toptions: details?.noDeployToken ? { noDeployToken: true } : undefined,\n\t\t})\n\t\tif (ignoreExisting && result.createProject?.error?.code === 'ALREADY_EXISTS') {\n\t\t\treturn null\n\t\t}\n\t\tthis.transport.assertOk(result.createProject, `createProject(${slug})`)\n\t\tconst deployerApiKey = result.createProject?.result?.deployerApiKey\n\t\treturn { deployerApiKey: deployerApiKey ? { id: deployerApiKey.id, token: deployerApiKey.token ?? null } : null }\n\t}\n\n\tpublic async updateProject(slug: string, changes: TenantUpdateProjectChanges): Promise<void> {\n\t\tconst result = await this.transport.exec(updateProjectFetcher, {\n\t\t\tprojectSlug: slug,\n\t\t\tname: changes.name,\n\t\t\tconfig: changes.config,\n\t\t\tmergeConfig: changes.mergeConfig,\n\t\t})\n\t\tthis.transport.assertOk(result.updateProject, `updateProject(${slug})`)\n\t}\n\n\tpublic async setProjectSecret(slug: string, key: string, value: string): Promise<void> {\n\t\tconst result = await this.transport.exec(setProjectSecretFetcher, { projectSlug: slug, key, value })\n\t\tthis.transport.assertOk(result.setProjectSecret, `setProjectSecret(${slug}/${key})`)\n\t}\n\n\tpublic async configure(config: TenantGlobalConfig): Promise<void> {\n\t\tconst result = await this.transport.exec(configureFetcher, { config })\n\t\tthis.transport.assertOk(result.configure, 'configure')\n\t}\n\n\tpublic async configuration(): Promise<TenantConfigState> {\n\t\tconst result = await this.transport.exec(configurationFetcher, {})\n\t\tconst config = result.configuration\n\t\treturn {\n\t\t\tsignup: { requireEmailVerification: config.signup.requireEmailVerification },\n\t\t\temailChange: {\n\t\t\t\trequireVerification: config.emailChange.requireVerification,\n\t\t\t\trequireReauthentication: config.emailChange.requireReauthentication,\n\t\t\t},\n\t\t\tpasswordless: {\n\t\t\t\tenabled: config.passwordless.enabled,\n\t\t\t\turl: config.passwordless.url ?? null,\n\t\t\t\texpiration: config.passwordless.expiration,\n\t\t\t\tuniformResponse: config.passwordless.uniformResponse,\n\t\t\t},\n\t\t\tpassword: {\n\t\t\t\tminLength: config.password.minLength,\n\t\t\t\trequireUppercase: config.password.requireUppercase,\n\t\t\t\trequireLowercase: config.password.requireLowercase,\n\t\t\t\trequireDigit: config.password.requireDigit,\n\t\t\t\trequireSpecial: config.password.requireSpecial,\n\t\t\t\tpattern: config.password.pattern ?? null,\n\t\t\t\tcheckBlacklist: config.password.checkBlacklist,\n\t\t\t\tcheckHibp: config.password.checkHibp,\n\t\t\t\trevokeSessionsOnChange: config.password.revokeSessionsOnChange,\n\t\t\t},\n\t\t\tlogin: {\n\t\t\t\tbaseBackoff: config.login.baseBackoff,\n\t\t\t\tmaxBackoff: config.login.maxBackoff,\n\t\t\t\tattemptWindow: config.login.attemptWindow,\n\t\t\t\trevealUserExists: config.login.revealUserExists,\n\t\t\t\trevealLoginMethod: config.login.revealLoginMethod,\n\t\t\t\tdefaultTokenExpiration: config.login.defaultTokenExpiration,\n\t\t\t\tmaxTokenExpiration: config.login.maxTokenExpiration ?? null,\n\t\t\t\tmfaGraceDuration: config.login.mfaGraceDuration,\n\t\t\t\tmfaChangeRequiresReauthentication: config.login.mfaChangeRequiresReauthentication,\n\t\t\t\tanomalyDetection: {\n\t\t\t\t\tenabled: config.login.anomalyDetection.enabled,\n\t\t\t\t\thistorySize: config.login.anomalyDetection.historySize,\n\t\t\t\t\temailThreshold: config.login.anomalyDetection.emailThreshold,\n\t\t\t\t\tstepUpThreshold: config.login.anomalyDetection.stepUpThreshold,\n\t\t\t\t\tmissingSignalIsNew: config.login.anomalyDetection.missingSignalIsNew,\n\t\t\t\t},\n\t\t\t},\n\t\t\tcaptcha: {\n\t\t\t\tprovider: config.captcha.provider ?? null,\n\t\t\t\tthreshold: config.captcha.threshold ?? null,\n\t\t\t\tprotect: {\n\t\t\t\t\tsignUp: config.captcha.protect.signUp,\n\t\t\t\t\tpasswordReset: config.captcha.protect.passwordReset,\n\t\t\t\t\tpasswordlessInit: config.captcha.protect.passwordlessInit,\n\t\t\t\t\temailVerification: config.captcha.protect.emailVerification,\n\t\t\t\t},\n\t\t\t},\n\t\t\trateLimits: {\n\t\t\t\tsignUpPerIp: toRateLimitWindow(config.rateLimits.signUpPerIp),\n\t\t\t\tloginPerIp: toRateLimitWindow(config.rateLimits.loginPerIp),\n\t\t\t\tpasswordResetPerIp: toRateLimitWindow(config.rateLimits.passwordResetPerIp),\n\t\t\t\tpasswordlessInitPerIp: toRateLimitWindow(config.rateLimits.passwordlessInitPerIp),\n\t\t\t\temailOtpPerPerson: toRateLimitWindow(config.rateLimits.emailOtpPerPerson),\n\t\t\t\temailVerificationPerIp: toRateLimitWindow(config.rateLimits.emailVerificationPerIp),\n\t\t\t},\n\t\t}\n\t}\n\n\tpublic async listIdentityProviders(): Promise<RemoteIdentityProvider[]> {\n\t\tconst result = await this.transport.exec(identityProvidersFetcher, {})\n\t\treturn result.identityProviders.map(it => ({\n\t\t\tslug: it.slug,\n\t\t\ttype: it.type,\n\t\t\tdisabledAt: it.disabledAt ?? null,\n\t\t}))\n\t}\n\n\tpublic async addIdp(slug: string, type: string, configuration: unknown, options?: TenantIdpOptions): Promise<void> {\n\t\tconst result = await this.transport.exec(addIdpFetcher, { identityProvider: slug, type, configuration, options })\n\t\tthis.transport.assertOk(result.addIDP, `addIDP(${slug})`)\n\t}\n\n\tpublic async updateIdp(slug: string, type: string, configuration: unknown, options?: TenantIdpOptions): Promise<void> {\n\t\tconst result = await this.transport.exec(updateIdpFetcher, {\n\t\t\tidentityProvider: slug,\n\t\t\ttype,\n\t\t\tconfiguration,\n\t\t\toptions,\n\t\t\tmergeConfiguration: false,\n\t\t})\n\t\tthis.transport.assertOk(result.updateIDP, `updateIDP(${slug})`)\n\t}\n\n\tpublic async enableIdp(slug: string): Promise<void> {\n\t\tconst result = await this.transport.exec(enableIdpFetcher, { identityProvider: slug })\n\t\tthis.transport.assertOk(result.enableIDP, `enableIDP(${slug})`)\n\t}\n\n\tpublic async disableIdp(slug: string): Promise<void> {\n\t\tconst result = await this.transport.exec(disableIdpFetcher, { identityProvider: slug })\n\t\tthis.transport.assertOk(result.disableIDP, `disableIDP(${slug})`)\n\t}\n\n\tpublic async whoAmI(): Promise<TenantWhoAmI> {\n\t\tconst result = await this.transport.exec(meFetcher, {})\n\t\tconst me = result.me\n\t\treturn {\n\t\t\tid: me.id,\n\t\t\tdescription: me.description ?? null,\n\t\t\troles: me.roles ? [...me.roles] : [],\n\t\t\tpermissions: me.permissions\n\t\t\t\t? { canCreateProject: me.permissions.canCreateProject, canDeployEntrypoint: me.permissions.canDeployEntrypoint }\n\t\t\t\t: null,\n\t\t\tprojects: me.projects.map(it => ({\n\t\t\t\tslug: it.project.slug,\n\t\t\t\tname: it.project.name,\n\t\t\t\troles: it.memberships.map(m => m.role),\n\t\t\t})),\n\t\t}\n\t}\n}\n"],"names":[],"mappings":";;AAyLA,MAAM,uBAAuB,UAAU;AAAA,EACtC,wBAAwB,MAAM,4BAA4B,EAAE,OAAO,qBAAqB,eAAe,iBAAiB,CAAC;AAC1H;AACA,MAAM,0BAA0B,UAAU,iBAAiB,2BAA2B,MAAM,uBAAuB,CAAC;AACpH,MAAM,uBAAuB,UAAU,cAAc,wBAAwB,MAAM,oBAAoB,CAAC;AACxG,MAAM,mBAAmB,UAAU,UAAU,oBAAoB,MAAM,gBAAgB,CAAC;AACxF,MAAM,uBAAuB,OAAO;AAAA,EACnC,QACE,OAAO,cAAc,EACrB,YAAY,mBAAmB,EAC/B,aAAa,oBAAoB,EACjC,SAAS,gBAAgB,EACzB,MAAM,cAAc,iBAAiB,6BAA6B,CAAC,EACnE,QAAQ,gBAAgB,QAAQ,sBAAsB,CAAC,EACvD;AAAA,IACA,kBACE,YAAY,uBAAuB,EACnC,WAAW,uBAAuB,EAClC,mBAAmB,uBAAuB,EAC1C,sBAAsB,uBAAuB,EAC7C,kBAAkB,uBAAuB,EACzC,uBAAuB,uBAAuB;AAAA,EAAA;AAEnD;AACA,MAAM,kBAAkB,OAAO,SAAS,SAAS,G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,SAAK,UAAU,SAAS,OAAO,YAAY,cAAc,IAAI,GAAG;AAAA,EACjE;AAAA,EAEA,MAAa,SAAgC;AAC5C,UAAM,SAAS,MAAM,KAAK,UAAU,KAAK,WAAW,EAAE;AACtD,UAAM,KAAK,OAAO;AAClB,WAAO;AAAA,MACN,IAAI,GAAG;AAAA,MACP,aAAa,GAAG,eAAe;AAAA,MAC/B,OAAO,GAAG,QAAQ,CAAC,GAAG,GAAG,KAAK,IAAI,CAAA;AAAA,MAClC,aAAa,GAAG,cACb,EAAE,kBAAkB,GAAG,YAAY,kBAAkB,qBAAqB,GAAG,YAAY,oBAAA,IACzF;AAAA,MACH,UAAU,GAAG,SAAS,IAAI,CAAA,QAAO;AAAA,QAChC,MAAM,GAAG,QAAQ;AAAA,QACjB,MAAM,GAAG,QAAQ;AAAA,QACjB,OAAO,GAAG,YAAY,IAAI,CAAA,MAAK,EAAE,IAAI;AAAA,MAAA,EACpC;AAAA,IAAA;AAAA,EAEJ;AACD;"}
|
|
@@ -107,11 +107,15 @@ class TenantProjectClient {
|
|
|
107
107
|
const config = result.configuration;
|
|
108
108
|
return {
|
|
109
109
|
signup: { requireEmailVerification: config.signup.requireEmailVerification },
|
|
110
|
-
emailChange: {
|
|
110
|
+
emailChange: {
|
|
111
|
+
requireVerification: config.emailChange.requireVerification,
|
|
112
|
+
requireReauthentication: config.emailChange.requireReauthentication
|
|
113
|
+
},
|
|
111
114
|
passwordless: {
|
|
112
115
|
enabled: config.passwordless.enabled,
|
|
113
116
|
url: config.passwordless.url ?? null,
|
|
114
|
-
expiration: config.passwordless.expiration
|
|
117
|
+
expiration: config.passwordless.expiration,
|
|
118
|
+
uniformResponse: config.passwordless.uniformResponse
|
|
115
119
|
},
|
|
116
120
|
password: {
|
|
117
121
|
minLength: config.password.minLength,
|
|
@@ -121,7 +125,8 @@ class TenantProjectClient {
|
|
|
121
125
|
requireSpecial: config.password.requireSpecial,
|
|
122
126
|
pattern: config.password.pattern ?? null,
|
|
123
127
|
checkBlacklist: config.password.checkBlacklist,
|
|
124
|
-
checkHibp: config.password.checkHibp
|
|
128
|
+
checkHibp: config.password.checkHibp,
|
|
129
|
+
revokeSessionsOnChange: config.password.revokeSessionsOnChange
|
|
125
130
|
},
|
|
126
131
|
login: {
|
|
127
132
|
baseBackoff: config.login.baseBackoff,
|
|
@@ -132,11 +137,13 @@ class TenantProjectClient {
|
|
|
132
137
|
defaultTokenExpiration: config.login.defaultTokenExpiration,
|
|
133
138
|
maxTokenExpiration: config.login.maxTokenExpiration ?? null,
|
|
134
139
|
mfaGraceDuration: config.login.mfaGraceDuration,
|
|
140
|
+
mfaChangeRequiresReauthentication: config.login.mfaChangeRequiresReauthentication,
|
|
135
141
|
anomalyDetection: {
|
|
136
142
|
enabled: config.login.anomalyDetection.enabled,
|
|
137
143
|
historySize: config.login.anomalyDetection.historySize,
|
|
138
144
|
emailThreshold: config.login.anomalyDetection.emailThreshold,
|
|
139
|
-
stepUpThreshold: config.login.anomalyDetection.stepUpThreshold
|
|
145
|
+
stepUpThreshold: config.login.anomalyDetection.stepUpThreshold,
|
|
146
|
+
missingSignalIsNew: config.login.anomalyDetection.missingSignalIsNew
|
|
140
147
|
}
|
|
141
148
|
},
|
|
142
149
|
captcha: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TenantProjectClient.cjs","sources":["../../../../../../../packages/cli/src/lib/tenant/clients/TenantProjectClient.ts"],"sourcesContent":["import {\n\taddIDPError$$,\n\taddIDPResponse$$,\n\tapiKeyWithToken$$,\n\ttype CaptchaProvider,\n\tconfig$,\n\tconfigCaptcha$$,\n\tconfigCaptchaProtect$$,\n\tconfigEmailChange$$,\n\tconfigLogin$$,\n\tconfigLoginAnomalyDetection$$,\n\tconfigPassword$$,\n\tconfigPasswordless$$,\n\ttype ConfigPolicy,\n\tconfigRateLimits$,\n\tconfigRateLimitWindow$$,\n\tconfigSignup$$,\n\tconfigureError$$,\n\tconfigureResponse$$,\n\tcreateProjectResponse$$,\n\tcreateProjectResponseError$$,\n\tcreateProjectResult$,\n\tdisableIDPError$$,\n\tdisableIDPResponse$$,\n\tenableIDPError$$,\n\tenableIDPResponse$$,\n\tidentity$$,\n\tidentityGlobalPermissions$$,\n\tidentityProjectRelation$,\n\tidentityProvider$,\n\tmembership$$,\n\tmutation$,\n\tproject$,\n\tprojectSecretInfo$$,\n\tquery$,\n\troleConditionVariableDefinition$$,\n\troleDefinition$,\n\troleEntityVariableDefinition$$,\n\trolePredefinedVariableDefinition$$,\n\troleVariableDefinition$$,\n\tsetProjectSecretError$$,\n\tsetProjectSecretResponse$$,\n\tupdateIDPError$$,\n\tupdateIDPResponse$$,\n\tupdateProjectError$$,\n\tupdateProjectResponse$$,\n} from '@contember/graphql-client-tenant'\nimport { CliError, ExitCode } from '@contember/cli-common'\nimport type { ModelType } from 'graphql-ts-client-api'\nimport { TenantApiTransport } from '../TenantApiTransport.js'\nimport { TenantGlobalConfig, TenantIdpOptions } from '../tenantConfig.js'\n\nexport interface RemoteIdentityProvider {\n\tslug: string\n\ttype: string\n\tdisabledAt: string | null\n}\n\nexport interface TenantProjectSummary {\n\tid: string\n\tname: string\n\tslug: string\n}\n\nexport interface TenantProjectRole {\n\tname: string\n\t/** Variable names the role expects, retained for compatibility. */\n\tvariables: string[]\n\tvariableDefinitions: TenantProjectRoleVariableDefinition[]\n}\n\nexport type TenantProjectRoleVariableDefinition =\n\t| { type: 'entity'; name: string; entityName: string }\n\t| { type: 'predefined'; name: string; value: string }\n\t| { type: 'condition'; name: string }\n\nexport interface TenantProjectSecret {\n\tkey: string\n\tcreatedAt: string\n\tupdatedAt: string\n}\n\nexport interface TenantProjectDetail {\n\tid: string\n\tname: string\n\tslug: string\n\tconfig: unknown\n\troles: TenantProjectRole[]\n\tsecrets: TenantProjectSecret[]\n}\n\nexport interface TenantCreateProjectDetails {\n\tname?: string\n\tconfig?: unknown\n\t/** Skip issuing a deploy API key for the project. */\n\tnoDeployToken?: boolean\n}\n\nexport interface TenantCreateProjectResult {\n\t/** Null when {@link TenantCreateProjectDetails.noDeployToken} was requested. */\n\tdeployerApiKey: { id: string; token: string | null } | null\n}\n\nexport interface TenantUpdateProjectChanges {\n\tname?: string\n\tconfig?: unknown\n\tmergeConfig?: boolean\n}\n\nexport interface TenantRateLimitWindowState {\n\tlimit: number\n\twindow: string\n}\n\n/** The tenant-wide configuration returned by `Query.configuration` — the read side of {@link TenantGlobalConfig}. */\nexport interface TenantConfigState {\n\tsignup: { requireEmailVerification: boolean }\n\temailChange: { requireVerification: boolean }\n\tpasswordless: { enabled: ConfigPolicy; url: string | null; expiration: string }\n\tpassword: {\n\t\tminLength: number\n\t\trequireUppercase: number\n\t\trequireLowercase: number\n\t\trequireDigit: number\n\t\trequireSpecial: number\n\t\tpattern: string | null\n\t\tcheckBlacklist: boolean\n\t\tcheckHibp: boolean\n\t}\n\tlogin: {\n\t\tbaseBackoff: string\n\t\tmaxBackoff: string\n\t\tattemptWindow: string\n\t\trevealUserExists: boolean\n\t\trevealLoginMethod: boolean\n\t\tdefaultTokenExpiration: string\n\t\tmaxTokenExpiration: string | null\n\t\tmfaGraceDuration: string\n\t\tanomalyDetection: {\n\t\t\tenabled: boolean\n\t\t\thistorySize: number\n\t\t\temailThreshold: number\n\t\t\tstepUpThreshold: number\n\t\t}\n\t}\n\tcaptcha: {\n\t\tprovider: CaptchaProvider | null\n\t\tthreshold: number | null\n\t\tprotect: {\n\t\t\tsignUp: boolean\n\t\t\tpasswordReset: boolean\n\t\t\tpasswordlessInit: boolean\n\t\t\temailVerification: boolean\n\t\t}\n\t}\n\trateLimits: {\n\t\tsignUpPerIp: TenantRateLimitWindowState\n\t\tloginPerIp: TenantRateLimitWindowState\n\t\tpasswordResetPerIp: TenantRateLimitWindowState\n\t\tpasswordlessInitPerIp: TenantRateLimitWindowState\n\t\temailOtpPerPerson: TenantRateLimitWindowState\n\t\temailVerificationPerIp: TenantRateLimitWindowState\n\t}\n}\n\nexport interface TenantWhoAmIProject {\n\tslug: string\n\tname: string\n\troles: string[]\n}\n\n/** `Query.me` — the identity behind the token the CLI is using. */\nexport interface TenantWhoAmI {\n\tid: string\n\tdescription: string | null\n\t/** Global (tenant-wide) roles — empty for an identity whose access is entirely project-scoped. */\n\troles: string[]\n\tpermissions: { canCreateProject: boolean; canDeployEntrypoint: boolean } | null\n\tprojects: TenantWhoAmIProject[]\n}\n\n// Fetchers are immutable and reusable, so they are built once at module load.\nconst createProjectFetcher = mutation$.createProject(\n\tcreateProjectResponse$$.error(createProjectResponseError$$).result(createProjectResult$.deployerApiKey(apiKeyWithToken$$)),\n)\nconst setProjectSecretFetcher = mutation$.setProjectSecret(setProjectSecretResponse$$.error(setProjectSecretError$$))\nconst updateProjectFetcher = mutation$.updateProject(updateProjectResponse$$.error(updateProjectError$$))\nconst configureFetcher = mutation$.configure(configureResponse$$.error(configureError$$))\nconst configurationFetcher = query$.configuration(\n\tconfig$\n\t\t.signup(configSignup$$)\n\t\t.emailChange(configEmailChange$$)\n\t\t.passwordless(configPasswordless$$)\n\t\t.password(configPassword$$)\n\t\t.login(configLogin$$.anomalyDetection(configLoginAnomalyDetection$$))\n\t\t.captcha(configCaptcha$$.protect(configCaptchaProtect$$))\n\t\t.rateLimits(\n\t\t\tconfigRateLimits$\n\t\t\t\t.signUpPerIp(configRateLimitWindow$$)\n\t\t\t\t.loginPerIp(configRateLimitWindow$$)\n\t\t\t\t.passwordResetPerIp(configRateLimitWindow$$)\n\t\t\t\t.passwordlessInitPerIp(configRateLimitWindow$$)\n\t\t\t\t.emailOtpPerPerson(configRateLimitWindow$$)\n\t\t\t\t.emailVerificationPerIp(configRateLimitWindow$$),\n\t\t),\n)\nconst projectsFetcher = query$.projects(project$.id.name.slug)\nconst roleVariableFetcher = roleVariableDefinition$$\n\t.on(roleConditionVariableDefinition$$)\n\t.on(roleEntityVariableDefinition$$)\n\t.on(rolePredefinedVariableDefinition$$)\nconst toRoleVariableDefinition = (variable: ModelType<typeof roleVariableFetcher>): TenantProjectRoleVariableDefinition => {\n\tswitch (variable.__typename) {\n\t\tcase 'RoleEntityVariableDefinition':\n\t\t\treturn { type: 'entity', name: variable.name, entityName: variable.entityName }\n\t\tcase 'RolePredefinedVariableDefinition':\n\t\t\treturn { type: 'predefined', name: variable.name, value: variable.value }\n\t\tcase 'RoleConditionVariableDefinition':\n\t\t\treturn { type: 'condition', name: variable.name }\n\t\tcase 'RoleVariableDefinition':\n\t\t\tthrow new CliError(`Tenant API returned an abstract role variable definition for \"${variable.name}\".`, {\n\t\t\t\tcode: 'TENANT_API_INVALID_RESPONSE',\n\t\t\t\texitCode: ExitCode.InternalError,\n\t\t\t})\n\t}\n}\nconst projectBySlugFetcher = query$.projectBySlug(\n\tproject$\n\t\t.id.name.slug.config\n\t\t.roles(roleDefinition$.name.variables(roleVariableFetcher))\n\t\t.secrets(projectSecretInfo$$),\n)\nconst identityProvidersFetcher = query$.identityProviders(identityProvider$.slug.type.disabledAt)\nconst addIdpFetcher = mutation$.addIDP(addIDPResponse$$.error(addIDPError$$))\nconst updateIdpFetcher = mutation$.updateIDP(updateIDPResponse$$.error(updateIDPError$$))\nconst enableIdpFetcher = mutation$.enableIDP(enableIDPResponse$$.error(enableIDPError$$))\nconst disableIdpFetcher = mutation$.disableIDP(disableIDPResponse$$.error(disableIDPError$$))\nconst meFetcher = query$.me(\n\tidentity$$\n\t\t.permissions(identityGlobalPermissions$$)\n\t\t.projects(identityProjectRelation$.project(project$.slug.name).memberships(membership$$)),\n)\n\nconst toRateLimitWindow = (it: { limit: number; window: string }): TenantRateLimitWindowState => ({ limit: it.limit, window: it.window })\n\n/** Projects, project secrets, global tenant configuration, identity providers and `me`. */\nexport class TenantProjectClient {\n\tconstructor(\n\t\tprivate readonly transport: TenantApiTransport,\n\t) {\n\t}\n\n\tpublic async listProjects(): Promise<TenantProjectSummary[]> {\n\t\tconst result = await this.transport.exec(projectsFetcher, {})\n\t\treturn result.projects.map(it => ({ id: it.id, name: it.name, slug: it.slug }))\n\t}\n\n\t/** Null both when the project does not exist and when the caller may not see it — the API does not distinguish. */\n\tpublic async getProjectBySlug(slug: string): Promise<TenantProjectDetail | null> {\n\t\tconst result = await this.transport.exec(projectBySlugFetcher, { slug })\n\t\tconst project = result.projectBySlug\n\t\tif (!project) {\n\t\t\treturn null\n\t\t}\n\t\treturn {\n\t\t\tid: project.id,\n\t\t\tname: project.name,\n\t\t\tslug: project.slug,\n\t\t\tconfig: project.config,\n\t\t\troles: project.roles.map(role => ({\n\t\t\t\tname: role.name,\n\t\t\t\tvariables: role.variables.map(it => it.name),\n\t\t\t\tvariableDefinitions: role.variables.map(toRoleVariableDefinition),\n\t\t\t})),\n\t\t\tsecrets: project.secrets.map(it => ({ key: it.key, createdAt: it.createdAt, updatedAt: it.updatedAt })),\n\t\t}\n\t}\n\n\t/** Returns `null` (nothing created) when `ignoreExisting` swallowed an `ALREADY_EXISTS`. */\n\tpublic async createProject(slug: string, ignoreExisting = false, details?: TenantCreateProjectDetails): Promise<TenantCreateProjectResult | null> {\n\t\tconst result = await this.transport.exec(createProjectFetcher, {\n\t\t\tprojectSlug: slug,\n\t\t\tname: details?.name,\n\t\t\tconfig: details?.config,\n\t\t\toptions: details?.noDeployToken ? { noDeployToken: true } : undefined,\n\t\t})\n\t\tif (ignoreExisting && result.createProject?.error?.code === 'ALREADY_EXISTS') {\n\t\t\treturn null\n\t\t}\n\t\tthis.transport.assertOk(result.createProject, `createProject(${slug})`)\n\t\tconst deployerApiKey = result.createProject?.result?.deployerApiKey\n\t\treturn { deployerApiKey: deployerApiKey ? { id: deployerApiKey.id, token: deployerApiKey.token ?? null } : null }\n\t}\n\n\tpublic async updateProject(slug: string, changes: TenantUpdateProjectChanges): Promise<void> {\n\t\tconst result = await this.transport.exec(updateProjectFetcher, {\n\t\t\tprojectSlug: slug,\n\t\t\tname: changes.name,\n\t\t\tconfig: changes.config,\n\t\t\tmergeConfig: changes.mergeConfig,\n\t\t})\n\t\tthis.transport.assertOk(result.updateProject, `updateProject(${slug})`)\n\t}\n\n\tpublic async setProjectSecret(slug: string, key: string, value: string): Promise<void> {\n\t\tconst result = await this.transport.exec(setProjectSecretFetcher, { projectSlug: slug, key, value })\n\t\tthis.transport.assertOk(result.setProjectSecret, `setProjectSecret(${slug}/${key})`)\n\t}\n\n\tpublic async configure(config: TenantGlobalConfig): Promise<void> {\n\t\tconst result = await this.transport.exec(configureFetcher, { config })\n\t\tthis.transport.assertOk(result.configure, 'configure')\n\t}\n\n\tpublic async configuration(): Promise<TenantConfigState> {\n\t\tconst result = await this.transport.exec(configurationFetcher, {})\n\t\tconst config = result.configuration\n\t\treturn {\n\t\t\tsignup: { requireEmailVerification: config.signup.requireEmailVerification },\n\t\t\temailChange: { requireVerification: config.emailChange.requireVerification },\n\t\t\tpasswordless: {\n\t\t\t\tenabled: config.passwordless.enabled,\n\t\t\t\turl: config.passwordless.url ?? null,\n\t\t\t\texpiration: config.passwordless.expiration,\n\t\t\t},\n\t\t\tpassword: {\n\t\t\t\tminLength: config.password.minLength,\n\t\t\t\trequireUppercase: config.password.requireUppercase,\n\t\t\t\trequireLowercase: config.password.requireLowercase,\n\t\t\t\trequireDigit: config.password.requireDigit,\n\t\t\t\trequireSpecial: config.password.requireSpecial,\n\t\t\t\tpattern: config.password.pattern ?? null,\n\t\t\t\tcheckBlacklist: config.password.checkBlacklist,\n\t\t\t\tcheckHibp: config.password.checkHibp,\n\t\t\t},\n\t\t\tlogin: {\n\t\t\t\tbaseBackoff: config.login.baseBackoff,\n\t\t\t\tmaxBackoff: config.login.maxBackoff,\n\t\t\t\tattemptWindow: config.login.attemptWindow,\n\t\t\t\trevealUserExists: config.login.revealUserExists,\n\t\t\t\trevealLoginMethod: config.login.revealLoginMethod,\n\t\t\t\tdefaultTokenExpiration: config.login.defaultTokenExpiration,\n\t\t\t\tmaxTokenExpiration: config.login.maxTokenExpiration ?? null,\n\t\t\t\tmfaGraceDuration: config.login.mfaGraceDuration,\n\t\t\t\tanomalyDetection: {\n\t\t\t\t\tenabled: config.login.anomalyDetection.enabled,\n\t\t\t\t\thistorySize: config.login.anomalyDetection.historySize,\n\t\t\t\t\temailThreshold: config.login.anomalyDetection.emailThreshold,\n\t\t\t\t\tstepUpThreshold: config.login.anomalyDetection.stepUpThreshold,\n\t\t\t\t},\n\t\t\t},\n\t\t\tcaptcha: {\n\t\t\t\tprovider: config.captcha.provider ?? null,\n\t\t\t\tthreshold: config.captcha.threshold ?? null,\n\t\t\t\tprotect: {\n\t\t\t\t\tsignUp: config.captcha.protect.signUp,\n\t\t\t\t\tpasswordReset: config.captcha.protect.passwordReset,\n\t\t\t\t\tpasswordlessInit: config.captcha.protect.passwordlessInit,\n\t\t\t\t\temailVerification: config.captcha.protect.emailVerification,\n\t\t\t\t},\n\t\t\t},\n\t\t\trateLimits: {\n\t\t\t\tsignUpPerIp: toRateLimitWindow(config.rateLimits.signUpPerIp),\n\t\t\t\tloginPerIp: toRateLimitWindow(config.rateLimits.loginPerIp),\n\t\t\t\tpasswordResetPerIp: toRateLimitWindow(config.rateLimits.passwordResetPerIp),\n\t\t\t\tpasswordlessInitPerIp: toRateLimitWindow(config.rateLimits.passwordlessInitPerIp),\n\t\t\t\temailOtpPerPerson: toRateLimitWindow(config.rateLimits.emailOtpPerPerson),\n\t\t\t\temailVerificationPerIp: toRateLimitWindow(config.rateLimits.emailVerificationPerIp),\n\t\t\t},\n\t\t}\n\t}\n\n\tpublic async listIdentityProviders(): Promise<RemoteIdentityProvider[]> {\n\t\tconst result = await this.transport.exec(identityProvidersFetcher, {})\n\t\treturn result.identityProviders.map(it => ({\n\t\t\tslug: it.slug,\n\t\t\ttype: it.type,\n\t\t\tdisabledAt: it.disabledAt ?? null,\n\t\t}))\n\t}\n\n\tpublic async addIdp(slug: string, type: string, configuration: unknown, options?: TenantIdpOptions): Promise<void> {\n\t\tconst result = await this.transport.exec(addIdpFetcher, { identityProvider: slug, type, configuration, options })\n\t\tthis.transport.assertOk(result.addIDP, `addIDP(${slug})`)\n\t}\n\n\tpublic async updateIdp(slug: string, type: string, configuration: unknown, options?: TenantIdpOptions): Promise<void> {\n\t\tconst result = await this.transport.exec(updateIdpFetcher, {\n\t\t\tidentityProvider: slug,\n\t\t\ttype,\n\t\t\tconfiguration,\n\t\t\toptions,\n\t\t\tmergeConfiguration: false,\n\t\t})\n\t\tthis.transport.assertOk(result.updateIDP, `updateIDP(${slug})`)\n\t}\n\n\tpublic async enableIdp(slug: string): Promise<void> {\n\t\tconst result = await this.transport.exec(enableIdpFetcher, { identityProvider: slug })\n\t\tthis.transport.assertOk(result.enableIDP, `enableIDP(${slug})`)\n\t}\n\n\tpublic async disableIdp(slug: string): Promise<void> {\n\t\tconst result = await this.transport.exec(disableIdpFetcher, { identityProvider: slug })\n\t\tthis.transport.assertOk(result.disableIDP, `disableIDP(${slug})`)\n\t}\n\n\tpublic async whoAmI(): Promise<TenantWhoAmI> {\n\t\tconst result = await this.transport.exec(meFetcher, {})\n\t\tconst me = result.me\n\t\treturn {\n\t\t\tid: me.id,\n\t\t\tdescription: me.description ?? null,\n\t\t\troles: me.roles ? [...me.roles] : [],\n\t\t\tpermissions: me.permissions\n\t\t\t\t? { canCreateProject: me.permissions.canCreateProject, canDeployEntrypoint: me.permissions.canDeployEntrypoint }\n\t\t\t\t: null,\n\t\t\tprojects: me.projects.map(it => ({\n\t\t\t\tslug: it.project.slug,\n\t\t\t\tname: it.project.name,\n\t\t\t\troles: it.memberships.map(m => m.role),\n\t\t\t})),\n\t\t}\n\t}\n}\n"],"names":["mutation$","createProjectResponse$$","createProjectResponseError$$","createProjectResult$","apiKeyWithToken$$","setProjectSecretResponse$$","setProjectSecretError$$","updateProjectResponse$$","updateProjectError$$","configureResponse$$","configureError$$","query$","config$","configSignup$$","configEmailChange$$","configPasswordless$$","configPassword$$","configLogin$$","configLoginAnomalyDetection$$","configCaptcha$$","configCaptchaProtect$$","configRateLimits$","configRateLimitWindow$$","project$","roleVariableDefinition$$","roleConditionVariableDefinition$$","roleEntityVariableDefinition$$","rolePredefinedVariableDefinition$$","CliError","ExitCode","roleDefinition$","projectSecretInfo$$","identityProvider$","addIDPResponse$$","addIDPError$$","updateIDPResponse$$","updateIDPError$$","enableIDPResponse$$","enableIDPError$$","disableIDPResponse$$","disableIDPError$$","identity$$","identityGlobalPermissions$$","identityProjectRelation$","membership$$"],"mappings":";;;;AAsLA,MAAM,uBAAuBA,UAAAA,UAAU;AAAA,EACtCC,UAAAA,wBAAwB,MAAMC,sCAA4B,EAAE,OAAOC,UAAAA,qBAAqB,eAAeC,2BAAiB,CAAC;AAC1H;AACA,MAAM,0BAA0BJ,UAAAA,UAAU,iBAAiBK,UAAAA,2BAA2B,MAAMC,UAAAA,uBAAuB,CAAC;AACpH,MAAM,uBAAuBN,UAAAA,UAAU,cAAcO,UAAAA,wBAAwB,MAAMC,UAAAA,oBAAoB,CAAC;AACxG,MAAM,mBAAmBR,UAAAA,UAAU,UAAUS,UAAAA,oBAAoB,MAAMC,UAAAA,gBAAgB,CAAC;AACxF,MAAM,uBAAuBC,UAAAA,OAAO;AAAA,EACnCC,kBACE,OAAOC,UAAAA,cAAc,EACrB,YAAYC,6BAAmB,EAC/B,aAAaC,UAAAA,oBAAoB,EACjC,SAASC,UAAAA,gBAAgB,EACzB,MAAMC,UAAAA,cAAc,iBAAiBC,UAAAA,6BAA6B,CAAC,EACnE,QAAQC,UAAAA,gBAAgB,QAAQC,gCAAsB,CAAC,EACvD;AAAA,IACAC,UAAAA,kBACE,YAAYC,UAAAA,uBAAuB,EACnC,WAAWA,UAAAA,uBAAuB,EAClC,mBAAmBA,UAAAA,uBAAuB,EAC1C,sBAAsBA,UAAAA,uBAAuB,EAC7C,kBAAkBA,UAAAA,uBAAuB,EACzC,uBAAuBA,UAAAA,uBAAuB;AAAA,EAAA;AAEnD;AACA,MAAM,kBAAkBX,UAAAA,OAAO,SAASY,UAAAA,SAAS,GAAG,KAAK,IAAI;AAC7D,MAAM,sBAAsBC,UAAAA,yBAC1B,GAAGC,UAAAA,iCAAiC,EACpC,GAAGC,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cAAc,IAAI,GAAG;AAAA,EACjE;AAAA,EAEA,MAAa,SAAgC;AAC5C,UAAM,SAAS,MAAM,KAAK,UAAU,KAAK,WAAW,EAAE;AACtD,UAAM,KAAK,OAAO;AAClB,WAAO;AAAA,MACN,IAAI,GAAG;AAAA,MACP,aAAa,GAAG,eAAe;AAAA,MAC/B,OAAO,GAAG,QAAQ,CAAC,GAAG,GAAG,KAAK,IAAI,CAAA;AAAA,MAClC,aAAa,GAAG,cACb,EAAE,kBAAkB,GAAG,YAAY,kBAAkB,qBAAqB,GAAG,YAAY,oBAAA,IACzF;AAAA,MACH,UAAU,GAAG,SAAS,IAAI,CAAA,QAAO;AAAA,QAChC,MAAM,GAAG,QAAQ;AAAA,QACjB,MAAM,GAAG,QAAQ;AAAA,QACjB,OAAO,GAAG,YAAY,IAAI,CAAA,MAAK,EAAE,IAAI;AAAA,MAAA,EACpC;AAAA,IAAA;AAAA,EAEJ;AACD;;"}
|
|
1
|
+
{"version":3,"file":"TenantProjectClient.cjs","sources":["../../../../../../../packages/cli/src/lib/tenant/clients/TenantProjectClient.ts"],"sourcesContent":["import {\n\taddIDPError$$,\n\taddIDPResponse$$,\n\tapiKeyWithToken$$,\n\ttype CaptchaProvider,\n\tconfig$,\n\tconfigCaptcha$$,\n\tconfigCaptchaProtect$$,\n\tconfigEmailChange$$,\n\tconfigLogin$$,\n\tconfigLoginAnomalyDetection$$,\n\tconfigPassword$$,\n\tconfigPasswordless$$,\n\ttype ConfigPolicy,\n\tconfigRateLimits$,\n\tconfigRateLimitWindow$$,\n\tconfigSignup$$,\n\tconfigureError$$,\n\tconfigureResponse$$,\n\tcreateProjectResponse$$,\n\tcreateProjectResponseError$$,\n\tcreateProjectResult$,\n\tdisableIDPError$$,\n\tdisableIDPResponse$$,\n\tenableIDPError$$,\n\tenableIDPResponse$$,\n\tidentity$$,\n\tidentityGlobalPermissions$$,\n\tidentityProjectRelation$,\n\tidentityProvider$,\n\tmembership$$,\n\tmutation$,\n\tproject$,\n\tprojectSecretInfo$$,\n\tquery$,\n\troleConditionVariableDefinition$$,\n\troleDefinition$,\n\troleEntityVariableDefinition$$,\n\trolePredefinedVariableDefinition$$,\n\troleVariableDefinition$$,\n\tsetProjectSecretError$$,\n\tsetProjectSecretResponse$$,\n\tupdateIDPError$$,\n\tupdateIDPResponse$$,\n\tupdateProjectError$$,\n\tupdateProjectResponse$$,\n} from '@contember/graphql-client-tenant'\nimport { CliError, ExitCode } from '@contember/cli-common'\nimport type { ModelType } from 'graphql-ts-client-api'\nimport { TenantApiTransport } from '../TenantApiTransport.js'\nimport { TenantGlobalConfig, TenantIdpOptions } from '../tenantConfig.js'\n\nexport interface RemoteIdentityProvider {\n\tslug: string\n\ttype: string\n\tdisabledAt: string | null\n}\n\nexport interface TenantProjectSummary {\n\tid: string\n\tname: string\n\tslug: string\n}\n\nexport interface TenantProjectRole {\n\tname: string\n\t/** Variable names the role expects, retained for compatibility. */\n\tvariables: string[]\n\tvariableDefinitions: TenantProjectRoleVariableDefinition[]\n}\n\nexport type TenantProjectRoleVariableDefinition =\n\t| { type: 'entity'; name: string; entityName: string }\n\t| { type: 'predefined'; name: string; value: string }\n\t| { type: 'condition'; name: string }\n\nexport interface TenantProjectSecret {\n\tkey: string\n\tcreatedAt: string\n\tupdatedAt: string\n}\n\nexport interface TenantProjectDetail {\n\tid: string\n\tname: string\n\tslug: string\n\tconfig: unknown\n\troles: TenantProjectRole[]\n\tsecrets: TenantProjectSecret[]\n}\n\nexport interface TenantCreateProjectDetails {\n\tname?: string\n\tconfig?: unknown\n\t/** Skip issuing a deploy API key for the project. */\n\tnoDeployToken?: boolean\n}\n\nexport interface TenantCreateProjectResult {\n\t/** Null when {@link TenantCreateProjectDetails.noDeployToken} was requested. */\n\tdeployerApiKey: { id: string; token: string | null } | null\n}\n\nexport interface TenantUpdateProjectChanges {\n\tname?: string\n\tconfig?: unknown\n\tmergeConfig?: boolean\n}\n\nexport interface TenantRateLimitWindowState {\n\tlimit: number\n\twindow: string\n}\n\n/** The tenant-wide configuration returned by `Query.configuration` — the read side of {@link TenantGlobalConfig}. */\nexport interface TenantConfigState {\n\tsignup: { requireEmailVerification: boolean }\n\temailChange: { requireVerification: boolean; requireReauthentication: boolean }\n\tpasswordless: { enabled: ConfigPolicy; url: string | null; expiration: string; uniformResponse: boolean }\n\tpassword: {\n\t\tminLength: number\n\t\trequireUppercase: number\n\t\trequireLowercase: number\n\t\trequireDigit: number\n\t\trequireSpecial: number\n\t\tpattern: string | null\n\t\tcheckBlacklist: boolean\n\t\tcheckHibp: boolean\n\t\trevokeSessionsOnChange: boolean\n\t}\n\tlogin: {\n\t\tbaseBackoff: string\n\t\tmaxBackoff: string\n\t\tattemptWindow: string\n\t\trevealUserExists: boolean\n\t\trevealLoginMethod: boolean\n\t\tdefaultTokenExpiration: string\n\t\tmaxTokenExpiration: string | null\n\t\tmfaGraceDuration: string\n\t\tmfaChangeRequiresReauthentication: boolean\n\t\tanomalyDetection: {\n\t\t\tenabled: boolean\n\t\t\thistorySize: number\n\t\t\temailThreshold: number\n\t\t\tstepUpThreshold: number\n\t\t\tmissingSignalIsNew: boolean\n\t\t}\n\t}\n\tcaptcha: {\n\t\tprovider: CaptchaProvider | null\n\t\tthreshold: number | null\n\t\tprotect: {\n\t\t\tsignUp: boolean\n\t\t\tpasswordReset: boolean\n\t\t\tpasswordlessInit: boolean\n\t\t\temailVerification: boolean\n\t\t}\n\t}\n\trateLimits: {\n\t\tsignUpPerIp: TenantRateLimitWindowState\n\t\tloginPerIp: TenantRateLimitWindowState\n\t\tpasswordResetPerIp: TenantRateLimitWindowState\n\t\tpasswordlessInitPerIp: TenantRateLimitWindowState\n\t\temailOtpPerPerson: TenantRateLimitWindowState\n\t\temailVerificationPerIp: TenantRateLimitWindowState\n\t}\n}\n\nexport interface TenantWhoAmIProject {\n\tslug: string\n\tname: string\n\troles: string[]\n}\n\n/** `Query.me` — the identity behind the token the CLI is using. */\nexport interface TenantWhoAmI {\n\tid: string\n\tdescription: string | null\n\t/** Global (tenant-wide) roles — empty for an identity whose access is entirely project-scoped. */\n\troles: string[]\n\tpermissions: { canCreateProject: boolean; canDeployEntrypoint: boolean } | null\n\tprojects: TenantWhoAmIProject[]\n}\n\n// Fetchers are immutable and reusable, so they are built once at module load.\nconst createProjectFetcher = mutation$.createProject(\n\tcreateProjectResponse$$.error(createProjectResponseError$$).result(createProjectResult$.deployerApiKey(apiKeyWithToken$$)),\n)\nconst setProjectSecretFetcher = mutation$.setProjectSecret(setProjectSecretResponse$$.error(setProjectSecretError$$))\nconst updateProjectFetcher = mutation$.updateProject(updateProjectResponse$$.error(updateProjectError$$))\nconst configureFetcher = mutation$.configure(configureResponse$$.error(configureError$$))\nconst configurationFetcher = query$.configuration(\n\tconfig$\n\t\t.signup(configSignup$$)\n\t\t.emailChange(configEmailChange$$)\n\t\t.passwordless(configPasswordless$$)\n\t\t.password(configPassword$$)\n\t\t.login(configLogin$$.anomalyDetection(configLoginAnomalyDetection$$))\n\t\t.captcha(configCaptcha$$.protect(configCaptchaProtect$$))\n\t\t.rateLimits(\n\t\t\tconfigRateLimits$\n\t\t\t\t.signUpPerIp(configRateLimitWindow$$)\n\t\t\t\t.loginPerIp(configRateLimitWindow$$)\n\t\t\t\t.passwordResetPerIp(configRateLimitWindow$$)\n\t\t\t\t.passwordlessInitPerIp(configRateLimitWindow$$)\n\t\t\t\t.emailOtpPerPerson(configRateLimitWindow$$)\n\t\t\t\t.emailVerificationPerIp(configRateLimitWindow$$),\n\t\t),\n)\nconst projectsFetcher = query$.projects(project$.id.name.slug)\nconst roleVariableFetcher = roleVariableDefinition$$\n\t.on(roleConditionVariableDefinition$$)\n\t.on(roleEntityVariableDefinition$$)\n\t.on(rolePredefinedVariableDefinition$$)\nconst toRoleVariableDefinition = (variable: ModelType<typeof roleVariableFetcher>): TenantProjectRoleVariableDefinition => {\n\tswitch (variable.__typename) {\n\t\tcase 'RoleEntityVariableDefinition':\n\t\t\treturn { type: 'entity', name: variable.name, entityName: variable.entityName }\n\t\tcase 'RolePredefinedVariableDefinition':\n\t\t\treturn { type: 'predefined', name: variable.name, value: variable.value }\n\t\tcase 'RoleConditionVariableDefinition':\n\t\t\treturn { type: 'condition', name: variable.name }\n\t\tcase 'RoleVariableDefinition':\n\t\t\tthrow new CliError(`Tenant API returned an abstract role variable definition for \"${variable.name}\".`, {\n\t\t\t\tcode: 'TENANT_API_INVALID_RESPONSE',\n\t\t\t\texitCode: ExitCode.InternalError,\n\t\t\t})\n\t}\n}\nconst projectBySlugFetcher = query$.projectBySlug(\n\tproject$\n\t\t.id.name.slug.config\n\t\t.roles(roleDefinition$.name.variables(roleVariableFetcher))\n\t\t.secrets(projectSecretInfo$$),\n)\nconst identityProvidersFetcher = query$.identityProviders(identityProvider$.slug.type.disabledAt)\nconst addIdpFetcher = mutation$.addIDP(addIDPResponse$$.error(addIDPError$$))\nconst updateIdpFetcher = mutation$.updateIDP(updateIDPResponse$$.error(updateIDPError$$))\nconst enableIdpFetcher = mutation$.enableIDP(enableIDPResponse$$.error(enableIDPError$$))\nconst disableIdpFetcher = mutation$.disableIDP(disableIDPResponse$$.error(disableIDPError$$))\nconst meFetcher = query$.me(\n\tidentity$$\n\t\t.permissions(identityGlobalPermissions$$)\n\t\t.projects(identityProjectRelation$.project(project$.slug.name).memberships(membership$$)),\n)\n\nconst toRateLimitWindow = (it: { limit: number; window: string }): TenantRateLimitWindowState => ({ limit: it.limit, window: it.window })\n\n/** Projects, project secrets, global tenant configuration, identity providers and `me`. */\nexport class TenantProjectClient {\n\tconstructor(\n\t\tprivate readonly transport: TenantApiTransport,\n\t) {\n\t}\n\n\tpublic async listProjects(): Promise<TenantProjectSummary[]> {\n\t\tconst result = await this.transport.exec(projectsFetcher, {})\n\t\treturn result.projects.map(it => ({ id: it.id, name: it.name, slug: it.slug }))\n\t}\n\n\t/** Null both when the project does not exist and when the caller may not see it — the API does not distinguish. */\n\tpublic async getProjectBySlug(slug: string): Promise<TenantProjectDetail | null> {\n\t\tconst result = await this.transport.exec(projectBySlugFetcher, { slug })\n\t\tconst project = result.projectBySlug\n\t\tif (!project) {\n\t\t\treturn null\n\t\t}\n\t\treturn {\n\t\t\tid: project.id,\n\t\t\tname: project.name,\n\t\t\tslug: project.slug,\n\t\t\tconfig: project.config,\n\t\t\troles: project.roles.map(role => ({\n\t\t\t\tname: role.name,\n\t\t\t\tvariables: role.variables.map(it => it.name),\n\t\t\t\tvariableDefinitions: role.variables.map(toRoleVariableDefinition),\n\t\t\t})),\n\t\t\tsecrets: project.secrets.map(it => ({ key: it.key, createdAt: it.createdAt, updatedAt: it.updatedAt })),\n\t\t}\n\t}\n\n\t/** Returns `null` (nothing created) when `ignoreExisting` swallowed an `ALREADY_EXISTS`. */\n\tpublic async createProject(slug: string, ignoreExisting = false, details?: TenantCreateProjectDetails): Promise<TenantCreateProjectResult | null> {\n\t\tconst result = await this.transport.exec(createProjectFetcher, {\n\t\t\tprojectSlug: slug,\n\t\t\tname: details?.name,\n\t\t\tconfig: details?.config,\n\t\t\toptions: details?.noDeployToken ? { noDeployToken: true } : undefined,\n\t\t})\n\t\tif (ignoreExisting && result.createProject?.error?.code === 'ALREADY_EXISTS') {\n\t\t\treturn null\n\t\t}\n\t\tthis.transport.assertOk(result.createProject, `createProject(${slug})`)\n\t\tconst deployerApiKey = result.createProject?.result?.deployerApiKey\n\t\treturn { deployerApiKey: deployerApiKey ? { id: deployerApiKey.id, token: deployerApiKey.token ?? null } : null }\n\t}\n\n\tpublic async updateProject(slug: string, changes: TenantUpdateProjectChanges): Promise<void> {\n\t\tconst result = await this.transport.exec(updateProjectFetcher, {\n\t\t\tprojectSlug: slug,\n\t\t\tname: changes.name,\n\t\t\tconfig: changes.config,\n\t\t\tmergeConfig: changes.mergeConfig,\n\t\t})\n\t\tthis.transport.assertOk(result.updateProject, `updateProject(${slug})`)\n\t}\n\n\tpublic async setProjectSecret(slug: string, key: string, value: string): Promise<void> {\n\t\tconst result = await this.transport.exec(setProjectSecretFetcher, { projectSlug: slug, key, value })\n\t\tthis.transport.assertOk(result.setProjectSecret, `setProjectSecret(${slug}/${key})`)\n\t}\n\n\tpublic async configure(config: TenantGlobalConfig): Promise<void> {\n\t\tconst result = await this.transport.exec(configureFetcher, { config })\n\t\tthis.transport.assertOk(result.configure, 'configure')\n\t}\n\n\tpublic async configuration(): Promise<TenantConfigState> {\n\t\tconst result = await this.transport.exec(configurationFetcher, {})\n\t\tconst config = result.configuration\n\t\treturn {\n\t\t\tsignup: { requireEmailVerification: config.signup.requireEmailVerification },\n\t\t\temailChange: {\n\t\t\t\trequireVerification: config.emailChange.requireVerification,\n\t\t\t\trequireReauthentication: config.emailChange.requireReauthentication,\n\t\t\t},\n\t\t\tpasswordless: {\n\t\t\t\tenabled: config.passwordless.enabled,\n\t\t\t\turl: config.passwordless.url ?? null,\n\t\t\t\texpiration: config.passwordless.expiration,\n\t\t\t\tuniformResponse: config.passwordless.uniformResponse,\n\t\t\t},\n\t\t\tpassword: {\n\t\t\t\tminLength: config.password.minLength,\n\t\t\t\trequireUppercase: config.password.requireUppercase,\n\t\t\t\trequireLowercase: config.password.requireLowercase,\n\t\t\t\trequireDigit: config.password.requireDigit,\n\t\t\t\trequireSpecial: config.password.requireSpecial,\n\t\t\t\tpattern: config.password.pattern ?? null,\n\t\t\t\tcheckBlacklist: config.password.checkBlacklist,\n\t\t\t\tcheckHibp: config.password.checkHibp,\n\t\t\t\trevokeSessionsOnChange: config.password.revokeSessionsOnChange,\n\t\t\t},\n\t\t\tlogin: {\n\t\t\t\tbaseBackoff: config.login.baseBackoff,\n\t\t\t\tmaxBackoff: config.login.maxBackoff,\n\t\t\t\tattemptWindow: config.login.attemptWindow,\n\t\t\t\trevealUserExists: config.login.revealUserExists,\n\t\t\t\trevealLoginMethod: config.login.revealLoginMethod,\n\t\t\t\tdefaultTokenExpiration: config.login.defaultTokenExpiration,\n\t\t\t\tmaxTokenExpiration: config.login.maxTokenExpiration ?? null,\n\t\t\t\tmfaGraceDuration: config.login.mfaGraceDuration,\n\t\t\t\tmfaChangeRequiresReauthentication: config.login.mfaChangeRequiresReauthentication,\n\t\t\t\tanomalyDetection: {\n\t\t\t\t\tenabled: config.login.anomalyDetection.enabled,\n\t\t\t\t\thistorySize: config.login.anomalyDetection.historySize,\n\t\t\t\t\temailThreshold: config.login.anomalyDetection.emailThreshold,\n\t\t\t\t\tstepUpThreshold: config.login.anomalyDetection.stepUpThreshold,\n\t\t\t\t\tmissingSignalIsNew: config.login.anomalyDetection.missingSignalIsNew,\n\t\t\t\t},\n\t\t\t},\n\t\t\tcaptcha: {\n\t\t\t\tprovider: config.captcha.provider ?? null,\n\t\t\t\tthreshold: config.captcha.threshold ?? null,\n\t\t\t\tprotect: {\n\t\t\t\t\tsignUp: config.captcha.protect.signUp,\n\t\t\t\t\tpasswordReset: config.captcha.protect.passwordReset,\n\t\t\t\t\tpasswordlessInit: config.captcha.protect.passwordlessInit,\n\t\t\t\t\temailVerification: config.captcha.protect.emailVerification,\n\t\t\t\t},\n\t\t\t},\n\t\t\trateLimits: {\n\t\t\t\tsignUpPerIp: toRateLimitWindow(config.rateLimits.signUpPerIp),\n\t\t\t\tloginPerIp: toRateLimitWindow(config.rateLimits.loginPerIp),\n\t\t\t\tpasswordResetPerIp: toRateLimitWindow(config.rateLimits.passwordResetPerIp),\n\t\t\t\tpasswordlessInitPerIp: toRateLimitWindow(config.rateLimits.passwordlessInitPerIp),\n\t\t\t\temailOtpPerPerson: toRateLimitWindow(config.rateLimits.emailOtpPerPerson),\n\t\t\t\temailVerificationPerIp: toRateLimitWindow(config.rateLimits.emailVerificationPerIp),\n\t\t\t},\n\t\t}\n\t}\n\n\tpublic async listIdentityProviders(): Promise<RemoteIdentityProvider[]> {\n\t\tconst result = await this.transport.exec(identityProvidersFetcher, {})\n\t\treturn result.identityProviders.map(it => ({\n\t\t\tslug: it.slug,\n\t\t\ttype: it.type,\n\t\t\tdisabledAt: it.disabledAt ?? null,\n\t\t}))\n\t}\n\n\tpublic async addIdp(slug: string, type: string, configuration: unknown, options?: TenantIdpOptions): Promise<void> {\n\t\tconst result = await this.transport.exec(addIdpFetcher, { identityProvider: slug, type, configuration, options })\n\t\tthis.transport.assertOk(result.addIDP, `addIDP(${slug})`)\n\t}\n\n\tpublic async updateIdp(slug: string, type: string, configuration: unknown, options?: TenantIdpOptions): Promise<void> {\n\t\tconst result = await this.transport.exec(updateIdpFetcher, {\n\t\t\tidentityProvider: slug,\n\t\t\ttype,\n\t\t\tconfiguration,\n\t\t\toptions,\n\t\t\tmergeConfiguration: false,\n\t\t})\n\t\tthis.transport.assertOk(result.updateIDP, `updateIDP(${slug})`)\n\t}\n\n\tpublic async enableIdp(slug: string): Promise<void> {\n\t\tconst result = await this.transport.exec(enableIdpFetcher, { identityProvider: slug })\n\t\tthis.transport.assertOk(result.enableIDP, `enableIDP(${slug})`)\n\t}\n\n\tpublic async disableIdp(slug: string): Promise<void> {\n\t\tconst result = await this.transport.exec(disableIdpFetcher, { identityProvider: slug })\n\t\tthis.transport.assertOk(result.disableIDP, `disableIDP(${slug})`)\n\t}\n\n\tpublic async whoAmI(): Promise<TenantWhoAmI> {\n\t\tconst result = await this.transport.exec(meFetcher, {})\n\t\tconst me = result.me\n\t\treturn {\n\t\t\tid: me.id,\n\t\t\tdescription: me.description ?? null,\n\t\t\troles: me.roles ? [...me.roles] : [],\n\t\t\tpermissions: me.permissions\n\t\t\t\t? { canCreateProject: me.permissions.canCreateProject, canDeployEntrypoint: me.permissions.canDeployEntrypoint }\n\t\t\t\t: null,\n\t\t\tprojects: me.projects.map(it => ({\n\t\t\t\tslug: it.project.slug,\n\t\t\t\tname: it.project.name,\n\t\t\t\troles: it.memberships.map(m => m.role),\n\t\t\t})),\n\t\t}\n\t}\n}\n"],"names":["mutation$","createProjectResponse$$","createProjectResponseError$$","createProjectResult$","apiKeyWithToken$$","setProjectSecretResponse$$","setProjectSecretError$$","updateProjectResponse$$","updateProjectError$$","configureResponse$$","configureError$$","query$","config$","configSignup$$","configEmailChange$$","configPasswordless$$","configPassword$$","configLogin$$","configLoginAnomalyDetection$$","configCaptcha$$","configCaptchaProtect$$","configRateLimits$","configRateLimitWindow$$","project$","roleVariableDefinition$$","roleConditionVariableDefinition$$","roleEntityVariableDefinition$$","rolePredefinedVariableDefinition$$","CliError","ExitCode","roleDefinition$","projectSecretInfo$$","identityProvider$","addIDPResponse$$","addIDPError$$","updateIDPResponse$$","updateIDPError$$","enableIDPResponse$$","enableIDPError$$","disableIDPResponse$$","disableIDPError$$","identity$$","identityGlobalPermissions$$","identityProjectRelation$","membership$$"],"mappings":";;;;AAyLA,MAAM,uBAAuBA,UAAAA,UAAU;AAAA,EACtCC,UAAAA,wBAAwB,MAAMC,sCAA4B,EAAE,OAAOC,UAAAA,qBAAqB,eAAeC,2BAAiB,CAAC;AAC1H;AACA,MAAM,0BAA0BJ,UAAAA,UAAU,iBAAiBK,UAAAA,2BAA2B,MAAMC,UAAAA,uBAAuB,CAAC;AACpH,MAAM,uBAAuBN,UAAAA,UAAU,cAAcO,UAAAA,wBAAwB,MAAMC,UAAAA,oBAAoB,CAAC;AACxG,MAAM,mBAAmBR,UAAAA,UAAU,UAAUS,UAAAA,oBAAoB,MAAMC,UAAAA,gBAAgB,CAAC;AACxF,MAAM,uBAAuBC,UAAAA,OAAO;AAAA,EACnCC,kBACE,OAAOC,UAAAA,cAAc,EACrB,YAAYC,6BAAmB,EAC/B,aAAaC,UAAAA,oBAAoB,EACjC,SAASC,UAAAA,gBAAgB,EACzB,MAAMC,UAAAA,cAAc,iBAAiBC,UAAAA,6BAA6B,CAAC,EACnE,QAAQC,UAAAA,gBAAgB,QAAQC,gCAAsB,CAAC,EACvD;AAAA,IACAC,UAAAA,kBACE,YAAYC,UAAAA,uBAAuB,EACnC,WAAWA,UAAAA,uBAAuB,EAClC,mBAAmBA,UAAAA,uBAAuB,EAC1C,sBAAsBA,UAAAA,uBAAuB,EAC7C,kBAAkBA,UAAAA,uBAAuB,EACzC,uBAAuBA,UAAAA,uBAAuB;AAAA,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AAW,aAAa,IAAI,GAAG;AAAA,EAC/D;AAAA,EAEA,MAAa,UAAU,MAA6B;AACnD,UAAM,SAAS,MAAM,KAAK,UAAU,KAAK,kBAAkB,EAAE,kBAAkB,MAAM;AACrF,SAAK,UAAU,SAAS,OAAO,WAAW,aAAa,IAAI,GAAG;AAAA,EAC/D;AAAA,EAEA,MAAa,WAAW,MAA6B;AACpD,UAAM,SAAS,MAAM,KAAK,UAAU,KAAK,mBAAmB,EAAE,kBAAkB,MAAM;AACtF,SAAK,UAAU,SAAS,OAAO,YAAY,cAAc,IAAI,GAAG;AAAA,EACjE;AAAA,EAEA,MAAa,SAAgC;AAC5C,UAAM,SAAS,MAAM,KAAK,UAAU,KAAK,WAAW,EAAE;AACtD,UAAM,KAAK,OAAO;AAClB,WAAO;AAAA,MACN,IAAI,GAAG;AAAA,MACP,aAAa,GAAG,eAAe;AAAA,MAC/B,OAAO,GAAG,QAAQ,CAAC,GAAG,GAAG,KAAK,IAAI,CAAA;AAAA,MAClC,aAAa,GAAG,cACb,EAAE,kBAAkB,GAAG,YAAY,kBAAkB,qBAAqB,GAAG,YAAY,oBAAA,IACzF;AAAA,MACH,UAAU,GAAG,SAAS,IAAI,CAAA,QAAO;AAAA,QAChC,MAAM,GAAG,QAAQ;AAAA,QACjB,MAAM,GAAG,QAAQ;AAAA,QACjB,OAAO,GAAG,YAAY,IAAI,CAAA,MAAK,EAAE,IAAI;AAAA,MAAA,EACpC;AAAA,IAAA;AAAA,EAEJ;AACD;;"}
|
|
@@ -105,11 +105,15 @@ class TenantProjectClient {
|
|
|
105
105
|
const config = result.configuration;
|
|
106
106
|
return {
|
|
107
107
|
signup: { requireEmailVerification: config.signup.requireEmailVerification },
|
|
108
|
-
emailChange: {
|
|
108
|
+
emailChange: {
|
|
109
|
+
requireVerification: config.emailChange.requireVerification,
|
|
110
|
+
requireReauthentication: config.emailChange.requireReauthentication
|
|
111
|
+
},
|
|
109
112
|
passwordless: {
|
|
110
113
|
enabled: config.passwordless.enabled,
|
|
111
114
|
url: config.passwordless.url ?? null,
|
|
112
|
-
expiration: config.passwordless.expiration
|
|
115
|
+
expiration: config.passwordless.expiration,
|
|
116
|
+
uniformResponse: config.passwordless.uniformResponse
|
|
113
117
|
},
|
|
114
118
|
password: {
|
|
115
119
|
minLength: config.password.minLength,
|
|
@@ -119,7 +123,8 @@ class TenantProjectClient {
|
|
|
119
123
|
requireSpecial: config.password.requireSpecial,
|
|
120
124
|
pattern: config.password.pattern ?? null,
|
|
121
125
|
checkBlacklist: config.password.checkBlacklist,
|
|
122
|
-
checkHibp: config.password.checkHibp
|
|
126
|
+
checkHibp: config.password.checkHibp,
|
|
127
|
+
revokeSessionsOnChange: config.password.revokeSessionsOnChange
|
|
123
128
|
},
|
|
124
129
|
login: {
|
|
125
130
|
baseBackoff: config.login.baseBackoff,
|
|
@@ -130,11 +135,13 @@ class TenantProjectClient {
|
|
|
130
135
|
defaultTokenExpiration: config.login.defaultTokenExpiration,
|
|
131
136
|
maxTokenExpiration: config.login.maxTokenExpiration ?? null,
|
|
132
137
|
mfaGraceDuration: config.login.mfaGraceDuration,
|
|
138
|
+
mfaChangeRequiresReauthentication: config.login.mfaChangeRequiresReauthentication,
|
|
133
139
|
anomalyDetection: {
|
|
134
140
|
enabled: config.login.anomalyDetection.enabled,
|
|
135
141
|
historySize: config.login.anomalyDetection.historySize,
|
|
136
142
|
emailThreshold: config.login.anomalyDetection.emailThreshold,
|
|
137
|
-
stepUpThreshold: config.login.anomalyDetection.stepUpThreshold
|
|
143
|
+
stepUpThreshold: config.login.anomalyDetection.stepUpThreshold,
|
|
144
|
+
missingSignalIsNew: config.login.anomalyDetection.missingSignalIsNew
|
|
138
145
|
}
|
|
139
146
|
},
|
|
140
147
|
captcha: {
|