@stackframe/stack-shared 2.8.64 → 2.8.65
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/config/schema-fuzzer.test.js +14 -1
- package/dist/config/schema-fuzzer.test.js.map +1 -1
- package/dist/config/schema.d.mts +103 -0
- package/dist/config/schema.d.ts +103 -0
- package/dist/config/schema.js +41 -3
- package/dist/config/schema.js.map +1 -1
- package/dist/esm/config/schema-fuzzer.test.js +14 -1
- package/dist/esm/config/schema-fuzzer.test.js.map +1 -1
- package/dist/esm/config/schema.js +41 -3
- package/dist/esm/config/schema.js.map +1 -1
- package/dist/esm/interface/client-interface.js.map +1 -1
- package/dist/esm/interface/crud/current-user.js +3 -1
- package/dist/esm/interface/crud/current-user.js.map +1 -1
- package/dist/esm/interface/crud/sign-up-rules.js +1 -0
- package/dist/esm/interface/crud/sign-up-rules.js.map +1 -0
- package/dist/esm/interface/crud/users.js +40 -4
- package/dist/esm/interface/crud/users.js.map +1 -1
- package/dist/esm/known-errors.js +13 -0
- package/dist/esm/known-errors.js.map +1 -1
- package/dist/esm/schema-fields.js +1 -1
- package/dist/esm/schema-fields.js.map +1 -1
- package/dist/esm/utils/types.js.map +1 -1
- package/dist/interface/client-interface.js.map +1 -1
- package/dist/interface/crud/current-user.d.mts +22 -2
- package/dist/interface/crud/current-user.d.ts +22 -2
- package/dist/interface/crud/current-user.js +3 -1
- package/dist/interface/crud/current-user.js.map +1 -1
- package/dist/interface/crud/project-api-keys.d.mts +2 -2
- package/dist/interface/crud/project-api-keys.d.ts +2 -2
- package/dist/interface/crud/sign-up-rules.d.mts +13 -0
- package/dist/interface/crud/sign-up-rules.d.ts +13 -0
- package/dist/interface/crud/sign-up-rules.js +19 -0
- package/dist/interface/crud/sign-up-rules.js.map +1 -0
- package/dist/interface/crud/team-member-profiles.d.mts +14 -2
- package/dist/interface/crud/team-member-profiles.d.ts +14 -2
- package/dist/interface/crud/users.d.mts +52 -4
- package/dist/interface/crud/users.d.ts +52 -4
- package/dist/interface/crud/users.js +40 -4
- package/dist/interface/crud/users.js.map +1 -1
- package/dist/interface/webhooks.d.mts +14 -2
- package/dist/interface/webhooks.d.ts +14 -2
- package/dist/known-errors.d.mts +4 -1
- package/dist/known-errors.d.ts +4 -1
- package/dist/known-errors.js +13 -0
- package/dist/known-errors.js.map +1 -1
- package/dist/schema-fields.d.mts +2 -2
- package/dist/schema-fields.d.ts +2 -2
- package/dist/schema-fields.js +1 -1
- package/dist/schema-fields.js.map +1 -1
- package/dist/sessions.d.mts +2 -2
- package/dist/sessions.d.ts +2 -2
- package/dist/utils/types.d.mts +2 -2
- package/dist/utils/types.d.ts +2 -2
- package/dist/utils/types.js.map +1 -1
- package/package.json +1 -1
|
@@ -35,7 +35,20 @@ var branchSchemaFuzzerConfig = [{
|
|
|
35
35
|
allowConnectedAccounts: [true, false]
|
|
36
36
|
}]
|
|
37
37
|
}]
|
|
38
|
-
}]
|
|
38
|
+
}],
|
|
39
|
+
signUpRules: [{
|
|
40
|
+
"some-rule-id": [{
|
|
41
|
+
enabled: [true, false],
|
|
42
|
+
displayName: ["Block Test Emails", "Allow Only Company Domain"],
|
|
43
|
+
priority: [0, 1, 100],
|
|
44
|
+
condition: ['email.endsWith("@test.com")', 'emailDomain == "company.com"'],
|
|
45
|
+
action: [{
|
|
46
|
+
type: ["allow", "reject", "restrict", "log"],
|
|
47
|
+
message: ["", "Sign up is not allowed for this email"]
|
|
48
|
+
}]
|
|
49
|
+
}]
|
|
50
|
+
}],
|
|
51
|
+
signUpRulesDefaultAction: ["allow", "reject"]
|
|
39
52
|
}],
|
|
40
53
|
dataVault: [{
|
|
41
54
|
stores: [{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/config/schema-fuzzer.test.ts"],"sourcesContent":["import { ALL_APPS } from \"../apps/apps-config\";\nimport { SUPPORTED_CURRENCIES } from \"../utils/currency-constants\";\nimport { StackAssertionError } from \"../utils/errors\";\nimport { getOrUndefined, isObjectLike, set, typedEntries, typedFromEntries } from \"../utils/objects\";\nimport { nicify } from \"../utils/strings\";\nimport { normalize, override } from \"./format\";\nimport { BranchConfigNormalizedOverride, EnvironmentConfigNormalizedOverride, OrganizationConfigNormalizedOverride, ProjectConfigNormalizedOverride, applyBranchDefaults, applyEnvironmentDefaults, applyOrganizationDefaults, applyProjectDefaults, assertNoConfigOverrideErrors, branchConfigSchema, environmentConfigSchema, migrateConfigOverride, organizationConfigSchema, projectConfigSchema, sanitizeBranchConfig, sanitizeEnvironmentConfig, sanitizeOrganizationConfig, sanitizeProjectConfig } from \"./schema\";\n\ntype FuzzerConfig<T> = ReadonlyArray<T extends object ? ([T] extends [any[]] ? { readonly [K in keyof T]: FuzzerConfig<T[K]> } : Required<{\n [K in keyof T]: FuzzerConfig<T[K]>;\n}> & Record<string, FuzzerConfig<any>>) : T>;\n\nconst projectSchemaFuzzerConfig = [{\n sourceOfTruth: [{\n type: [\"hosted\", \"neon\", \"postgres\"],\n connectionString: [\"\", \"postgres://user:password@host:port/database\", \"THIS IS A STRING LOLOL\"],\n connectionStrings: [{\n \"123-some-branch-id\": [\"\", \"THIS IS A CONNECTION STRING OR SO\"],\n }],\n }],\n}] satisfies FuzzerConfig<ProjectConfigNormalizedOverride>;\n\nconst branchSchemaFuzzerConfig = [{\n apiKeys: [{\n enabled: [{\n team: [true, false],\n user: [true, false],\n }],\n }],\n auth: [{\n allowSignUp: [true, false],\n password: [{\n allowSignIn: [true, false],\n }],\n otp: [{\n allowSignIn: [true, false],\n }],\n passkey: [{\n allowSignIn: [true, false],\n }],\n oauth: [{\n accountMergeStrategy: [\"link_method\", \"raise_error\", \"allow_duplicates\"],\n providers: [{\n \"google\": [{\n type: [\"google\", \"github\", \"x\"] as const,\n allowSignIn: [true, false],\n allowConnectedAccounts: [true, false],\n }],\n }],\n }],\n }],\n dataVault: [{\n stores: [{\n \"some-store-id\": [{\n displayName: [\"Some Store\", \"Some Other Store\"],\n }],\n \"some-other-store-id\": [{\n displayName: [\"Some Store\", \"Some Other Store\"],\n }],\n }],\n }],\n payments: [{\n blockNewPurchases: [false, true],\n autoPay: [{\n interval: [[[0, 1, -3, 100, 0.333, Infinity], [\"day\", \"week\", \"month\", \"year\"]]] as const,\n }],\n productLines: [{\n \"some-product-line-id\": [{\n displayName: [\"Some Product Line\", \"Some Other Product Line\"],\n customerType: [\"user\", \"team\", \"custom\"] as const,\n }],\n }],\n catalogs: [{ // ensure migration works\n \"some-product-line-id\": [{\n displayName: [\"Some Product Line\", \"Some Other Product Line\"],\n }],\n }],\n groups: [{ // ensure migration works\n \"some-product-line-id\": [{\n displayName: [\"Some Product Line\", \"Some Other Product Line\"],\n }],\n }],\n items: [{\n \"some-item-id\": [{\n customerType: [\"user\", \"team\", \"custom\"] as const,\n displayName: [\"Some Item\", \"Some Other Item\"],\n }],\n }],\n products: [{\n \"some-product-id\": [{\n displayName: [\"Some Product\", \"Some Other Product\"],\n customerType: [\"user\", \"team\", \"custom\"] as const,\n freeTrial: [[[0, 1, -3, 100, 0.333, Infinity], [\"day\", \"week\", \"month\", \"year\"]]] as const,\n serverOnly: [true, false],\n stackable: [true, false],\n productLineId: [\"some-product-line-id\", \"some-other-product-line-id\"],\n catalogId: [\"some-product-line-id\", \"some-other-product-line-id\"], // ensure migration works\n groupId: [\"some-product-line-id\", \"some-other-product-line-id\"], // ensure migration works\n isAddOnTo: [false, { \"some-product-id\": [true], \"some-other-product-id\": [true] }] as const,\n prices: [\"include-by-default\" as \"include-by-default\", {\n \"some-price-id\": [{\n ...typedFromEntries(SUPPORTED_CURRENCIES.map(currency => [currency.code, [\"100_00\", \"not a number\", \"Infinity\", \"0\"]])),\n interval: [[[0, 1, -3, 100, 0.333, Infinity], [\"day\", \"week\", \"month\", \"year\"]]] as const,\n serverOnly: [true, false],\n freeTrial: [[[0, 1, -3, 100, 0.333, Infinity], [\"day\", \"week\", \"month\", \"year\"]]] as const,\n }],\n }],\n includedItems: [{\n \"some-item-id\": [{\n quantity: [0, 1, -3, 100, 0.333, Infinity],\n repeat: [\"never\", [[0, 1, -3, 100, 0.333, Infinity], [\"day\", \"week\", \"month\", \"year\"]]] as const,\n expires: [\"never\", \"when-purchase-expires\", \"when-repeated\"] as const,\n }],\n }],\n }],\n }],\n }],\n emails: [{\n themes: [{\n \"12345678-1234-4234-9234-123456789012\": [{\n displayName: [\"Some Theme\", \"Some Other Theme\"],\n tsxSource: [\"\", \"some typescript source code\"],\n }],\n }],\n selectedThemeId: [\"some-theme-id\", \"some-other-theme-id\"],\n templates: [{\n \"12345678-1234-4234-9234-123456789012\": [{\n themeId: [\"some-theme-id\", \"some-other-theme-id\"],\n displayName: [\"Some Template\", \"Some Other Template\"],\n tsxSource: [\"\", \"some typescript source code\"],\n }],\n }],\n }],\n teams: [{\n createPersonalTeamOnSignUp: [true, false],\n allowClientTeamCreation: [true, false],\n }],\n users: [{\n allowClientUserDeletion: [true, false],\n }],\n rbac: [{\n permissions: [{\n \"some_permission_id\": [{\n containedPermissionIds: [{\n \"some_permission_id\": [true],\n \"$some_other_permission_id\": [true],\n }] as const,\n description: [\"Some Permission\", \"Some Other Permission\"],\n scope: [\"team\", \"project\"] as const,\n }],\n }],\n defaultPermissions: [{\n teamCreator: [{\n \"some_permission_id\": [true],\n \"$some_other_permission_id\": [true],\n }] as const,\n teamMember: [{\n \"some_permission_id\": [true],\n \"$some_other_permission_id\": [true],\n }] as const,\n signUp: [{\n \"some_permission_id\": [true],\n \"$some_other_permission_id\": [true],\n }] as const,\n }],\n }],\n domains: [{}],\n apps: [{\n installed: [typedFromEntries(typedEntries(ALL_APPS).map(([key, value]) => [key, [{\n enabled: [true, false],\n }]]))],\n }],\n onboarding: [{\n requireEmailVerification: [true, false],\n }],\n}] satisfies FuzzerConfig<BranchConfigNormalizedOverride>;\n\nconst environmentSchemaFuzzerConfig = [{\n ...branchSchemaFuzzerConfig[0],\n auth: [{\n ...branchSchemaFuzzerConfig[0].auth[0],\n oauth: [{\n ...branchSchemaFuzzerConfig[0].auth[0].oauth[0],\n providers: [typedFromEntries(typedEntries(branchSchemaFuzzerConfig[0].auth[0].oauth[0].providers[0]).map(([key, value]) => [key, [{\n ...value[0],\n isShared: [true, false],\n clientId: [\"some-client-id\"],\n clientSecret: [\"some-client-secret\"],\n facebookConfigId: [\"some-facebook-config-id\"],\n microsoftTenantId: [\"some-microsoft-tenant-id\"],\n appleBundles: [{ \"some-bundle-id\": [{ bundleId: [\"com.example.app\"] }] }],\n }]]))] as const,\n }],\n }],\n domains: [{\n allowLocalhost: [true, false],\n trustedDomains: [{\n \"some-domain-id\": [{\n baseUrl: [\"https://example.com/something-here\"],\n handlerPath: [\"/something-here\"],\n }],\n }],\n }],\n emails: [{\n ...branchSchemaFuzzerConfig[0].emails[0],\n server: [{\n isShared: [true, false],\n provider: [\"resend\", \"smtp\"] as const,\n host: [\"example.com\", \"://super weird host that's not valid\"],\n port: [1234, 0.12543, -100, Infinity],\n username: [\"some-username\", \"some username with a space\"],\n password: [\"some-password\", \"some password with a space\"],\n senderName: [\"Some Sender\"],\n senderEmail: [\"some-sender@example.com\", \"some invalid email\"],\n }],\n }],\n payments: [{\n ...branchSchemaFuzzerConfig[0].payments[0],\n testMode: [false, true],\n }],\n}] satisfies FuzzerConfig<EnvironmentConfigNormalizedOverride>;\n\nconst organizationSchemaFuzzerConfig = environmentSchemaFuzzerConfig satisfies FuzzerConfig<OrganizationConfigNormalizedOverride>;\n\nfunction setDeep<T>(obj: T, path: string[], value: any) {\n if (!isObjectLike(obj)) return obj;\n\n if (path.length === 0) {\n throw new Error(\"Path is empty\");\n } else if (path.length === 1) {\n set(obj as any, path[0], value);\n } else {\n const [key, ...rest] = path;\n setDeep(getOrUndefined(obj as any, key), rest, value);\n }\n}\n\nfunction createFuzzerInput<T>(config: FuzzerConfig<T>, progress: number): T {\n progress = Math.min(1, 2 * progress);\n const createShouldRandom = (strength: number) => {\n const chance = Math.random() * strength * 1.2 - 0.1;\n return () => Math.random() < chance;\n };\n const createShouldObjectDependent = (strength: number) => {\n const objectChance = Math.random() * strength * 1.2 - 0.1;\n const primitiveChance = Math.random() * strength * 1.2 - 0.1;\n return (v: any) => Math.random() * Math.random() < (isObjectLike(v) ? objectChance : primitiveChance);\n };\n\n const shouldKeep = createShouldObjectDependent(progress * 1);\n const shouldMakeNested = createShouldObjectDependent(1.25);\n const shouldNull = createShouldRandom(0.25);\n\n let res: any;\n const recurse = <U>(outputPath: string[], config: FuzzerConfig<U>, forceNested: boolean, forceNonNull: boolean) => {\n let subConfig: any = config[Math.floor(Math.random() * config.length)];\n const originalValue = isObjectLike(subConfig) ? (Array.isArray(subConfig) ? [] : {}) : subConfig;\n\n const newValue = forceNonNull || !shouldNull() ? originalValue : null;\n const newOutputPath = forceNested || shouldMakeNested(originalValue) || outputPath.length === 0 ? outputPath : [outputPath.join(\".\")];\n if (outputPath.length === 0) {\n res = newValue;\n } else {\n if (forceNested || shouldKeep(originalValue)) {\n setDeep(res, newOutputPath, newValue);\n }\n }\n if (isObjectLike(subConfig)) {\n for (const [key, newValue] of typedEntries(subConfig)) {\n recurse([...newOutputPath, key], newValue, Array.isArray(subConfig), Array.isArray(subConfig));\n }\n }\n };\n recurse<T>([], config, false, true);\n return res;\n}\n\nundefined?.test(\"fuzz schemas\", async ({ expect }) => {\n const totalIterations = process.env.CI ? 1000 : 200;\n for (let i = 0; i < totalIterations; i++) {\n const projectInput = createFuzzerInput<ProjectConfigNormalizedOverride>(projectSchemaFuzzerConfig, i / totalIterations);\n const branchInput = createFuzzerInput<BranchConfigNormalizedOverride>(branchSchemaFuzzerConfig, i / totalIterations);\n const environmentInput = createFuzzerInput<EnvironmentConfigNormalizedOverride>(environmentSchemaFuzzerConfig, i / totalIterations);\n const organizationInput = createFuzzerInput<OrganizationConfigNormalizedOverride>(organizationSchemaFuzzerConfig, i / totalIterations);\n\n try {\n const projectMigrated = migrateConfigOverride(\"project\", projectInput);\n await assertNoConfigOverrideErrors(projectConfigSchema, projectMigrated);\n const projectOverridden = override({}, projectMigrated);\n await sanitizeProjectConfig(normalize(applyProjectDefaults(projectOverridden), { onDotIntoNonObject: \"ignore\" }) as any);\n\n const branchMigrated = migrateConfigOverride(\"branch\", branchInput);\n await assertNoConfigOverrideErrors(branchConfigSchema, branchMigrated);\n const branchOverridden = override(projectOverridden, branchMigrated);\n await sanitizeBranchConfig(normalize(applyBranchDefaults(branchOverridden), { onDotIntoNonObject: \"ignore\" }) as any);\n\n const environmentMigrated = migrateConfigOverride(\"environment\", environmentInput);\n await assertNoConfigOverrideErrors(environmentConfigSchema, environmentMigrated);\n const environmentOverridden = override(branchOverridden, environmentMigrated);\n await sanitizeEnvironmentConfig(normalize(applyEnvironmentDefaults(environmentOverridden), { onDotIntoNonObject: \"ignore\" }) as any);\n\n const organizationMigrated = migrateConfigOverride(\"organization\", organizationInput);\n await assertNoConfigOverrideErrors(organizationConfigSchema, organizationMigrated);\n const organizationOverridden = override(environmentOverridden, organizationMigrated);\n await sanitizeOrganizationConfig(normalize(applyOrganizationDefaults(organizationOverridden), { onDotIntoNonObject: \"ignore\" }) as any);\n\n } catch (e) {\n const data = {\n cause: e,\n inputs: {\n projectInput,\n branchInput,\n environmentInput,\n organizationInput,\n },\n } as const;\n console.error(\"Failed to fuzz schema in iteration ${i}/${totalIterations}!\", nicify(data));\n throw new StackAssertionError(`Error in iteration ${i}/${totalIterations} of schema fuzz: ${e}`, { cause: e });\n }\n }\n});\n"],"mappings":";;;AAAA,yBAAyB;AACzB,gCAAqC;AACrC,oBAAoC;AACpC,qBAAkF;AAClF,qBAAuB;AACvB,oBAAoC;AACpC,oBAAgf;AAgBhf,IAAM,2BAA2B,CAAC;AAAA,EAChC,SAAS,CAAC;AAAA,IACR,SAAS,CAAC;AAAA,MACR,MAAM,CAAC,MAAM,KAAK;AAAA,MAClB,MAAM,CAAC,MAAM,KAAK;AAAA,IACpB,CAAC;AAAA,EACH,CAAC;AAAA,EACD,MAAM,CAAC;AAAA,IACL,aAAa,CAAC,MAAM,KAAK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AAAA,EACD,UAAU,CAAC;AAAA,IACT,GAAG,yBAAyB,CAAC,EAAE,SAAS,CAAC;AAAA,IACzC,UAAU,CAAC,OAAO,IAAI;AAAA,EACxB,CAAC;AACH,CAAC;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../src/config/schema-fuzzer.test.ts"],"sourcesContent":["import { ALL_APPS } from \"../apps/apps-config\";\nimport { SUPPORTED_CURRENCIES } from \"../utils/currency-constants\";\nimport { StackAssertionError } from \"../utils/errors\";\nimport { getOrUndefined, isObjectLike, set, typedEntries, typedFromEntries } from \"../utils/objects\";\nimport { nicify } from \"../utils/strings\";\nimport { normalize, override } from \"./format\";\nimport { BranchConfigNormalizedOverride, EnvironmentConfigNormalizedOverride, OrganizationConfigNormalizedOverride, ProjectConfigNormalizedOverride, applyBranchDefaults, applyEnvironmentDefaults, applyOrganizationDefaults, applyProjectDefaults, assertNoConfigOverrideErrors, branchConfigSchema, environmentConfigSchema, migrateConfigOverride, organizationConfigSchema, projectConfigSchema, sanitizeBranchConfig, sanitizeEnvironmentConfig, sanitizeOrganizationConfig, sanitizeProjectConfig } from \"./schema\";\n\ntype FuzzerConfig<T> = ReadonlyArray<T extends object ? ([T] extends [any[]] ? { readonly [K in keyof T]: FuzzerConfig<T[K]> } : Required<{\n [K in keyof T]: FuzzerConfig<T[K]>;\n}> & Record<string, FuzzerConfig<any>>) : T>;\n\nconst projectSchemaFuzzerConfig = [{\n sourceOfTruth: [{\n type: [\"hosted\", \"neon\", \"postgres\"],\n connectionString: [\"\", \"postgres://user:password@host:port/database\", \"THIS IS A STRING LOLOL\"],\n connectionStrings: [{\n \"123-some-branch-id\": [\"\", \"THIS IS A CONNECTION STRING OR SO\"],\n }],\n }],\n}] satisfies FuzzerConfig<ProjectConfigNormalizedOverride>;\n\nconst branchSchemaFuzzerConfig = [{\n apiKeys: [{\n enabled: [{\n team: [true, false],\n user: [true, false],\n }],\n }],\n auth: [{\n allowSignUp: [true, false],\n password: [{\n allowSignIn: [true, false],\n }],\n otp: [{\n allowSignIn: [true, false],\n }],\n passkey: [{\n allowSignIn: [true, false],\n }],\n oauth: [{\n accountMergeStrategy: [\"link_method\", \"raise_error\", \"allow_duplicates\"],\n providers: [{\n \"google\": [{\n type: [\"google\", \"github\", \"x\"] as const,\n allowSignIn: [true, false],\n allowConnectedAccounts: [true, false],\n }],\n }],\n }],\n signUpRules: [{\n \"some-rule-id\": [{\n enabled: [true, false],\n displayName: [\"Block Test Emails\", \"Allow Only Company Domain\"],\n priority: [0, 1, 100],\n condition: ['email.endsWith(\"@test.com\")', 'emailDomain == \"company.com\"'],\n action: [{\n type: [\"allow\", \"reject\", \"restrict\", \"log\"] as const,\n message: [\"\", \"Sign up is not allowed for this email\"],\n }],\n }],\n }],\n signUpRulesDefaultAction: [\"allow\", \"reject\"],\n }],\n dataVault: [{\n stores: [{\n \"some-store-id\": [{\n displayName: [\"Some Store\", \"Some Other Store\"],\n }],\n \"some-other-store-id\": [{\n displayName: [\"Some Store\", \"Some Other Store\"],\n }],\n }],\n }],\n payments: [{\n blockNewPurchases: [false, true],\n autoPay: [{\n interval: [[[0, 1, -3, 100, 0.333, Infinity], [\"day\", \"week\", \"month\", \"year\"]]] as const,\n }],\n productLines: [{\n \"some-product-line-id\": [{\n displayName: [\"Some Product Line\", \"Some Other Product Line\"],\n customerType: [\"user\", \"team\", \"custom\"] as const,\n }],\n }],\n catalogs: [{ // ensure migration works\n \"some-product-line-id\": [{\n displayName: [\"Some Product Line\", \"Some Other Product Line\"],\n }],\n }],\n groups: [{ // ensure migration works\n \"some-product-line-id\": [{\n displayName: [\"Some Product Line\", \"Some Other Product Line\"],\n }],\n }],\n items: [{\n \"some-item-id\": [{\n customerType: [\"user\", \"team\", \"custom\"] as const,\n displayName: [\"Some Item\", \"Some Other Item\"],\n }],\n }],\n products: [{\n \"some-product-id\": [{\n displayName: [\"Some Product\", \"Some Other Product\"],\n customerType: [\"user\", \"team\", \"custom\"] as const,\n freeTrial: [[[0, 1, -3, 100, 0.333, Infinity], [\"day\", \"week\", \"month\", \"year\"]]] as const,\n serverOnly: [true, false],\n stackable: [true, false],\n productLineId: [\"some-product-line-id\", \"some-other-product-line-id\"],\n catalogId: [\"some-product-line-id\", \"some-other-product-line-id\"], // ensure migration works\n groupId: [\"some-product-line-id\", \"some-other-product-line-id\"], // ensure migration works\n isAddOnTo: [false, { \"some-product-id\": [true], \"some-other-product-id\": [true] }] as const,\n prices: [\"include-by-default\" as \"include-by-default\", {\n \"some-price-id\": [{\n ...typedFromEntries(SUPPORTED_CURRENCIES.map(currency => [currency.code, [\"100_00\", \"not a number\", \"Infinity\", \"0\"]])),\n interval: [[[0, 1, -3, 100, 0.333, Infinity], [\"day\", \"week\", \"month\", \"year\"]]] as const,\n serverOnly: [true, false],\n freeTrial: [[[0, 1, -3, 100, 0.333, Infinity], [\"day\", \"week\", \"month\", \"year\"]]] as const,\n }],\n }],\n includedItems: [{\n \"some-item-id\": [{\n quantity: [0, 1, -3, 100, 0.333, Infinity],\n repeat: [\"never\", [[0, 1, -3, 100, 0.333, Infinity], [\"day\", \"week\", \"month\", \"year\"]]] as const,\n expires: [\"never\", \"when-purchase-expires\", \"when-repeated\"] as const,\n }],\n }],\n }],\n }],\n }],\n emails: [{\n themes: [{\n \"12345678-1234-4234-9234-123456789012\": [{\n displayName: [\"Some Theme\", \"Some Other Theme\"],\n tsxSource: [\"\", \"some typescript source code\"],\n }],\n }],\n selectedThemeId: [\"some-theme-id\", \"some-other-theme-id\"],\n templates: [{\n \"12345678-1234-4234-9234-123456789012\": [{\n themeId: [\"some-theme-id\", \"some-other-theme-id\"],\n displayName: [\"Some Template\", \"Some Other Template\"],\n tsxSource: [\"\", \"some typescript source code\"],\n }],\n }],\n }],\n teams: [{\n createPersonalTeamOnSignUp: [true, false],\n allowClientTeamCreation: [true, false],\n }],\n users: [{\n allowClientUserDeletion: [true, false],\n }],\n rbac: [{\n permissions: [{\n \"some_permission_id\": [{\n containedPermissionIds: [{\n \"some_permission_id\": [true],\n \"$some_other_permission_id\": [true],\n }] as const,\n description: [\"Some Permission\", \"Some Other Permission\"],\n scope: [\"team\", \"project\"] as const,\n }],\n }],\n defaultPermissions: [{\n teamCreator: [{\n \"some_permission_id\": [true],\n \"$some_other_permission_id\": [true],\n }] as const,\n teamMember: [{\n \"some_permission_id\": [true],\n \"$some_other_permission_id\": [true],\n }] as const,\n signUp: [{\n \"some_permission_id\": [true],\n \"$some_other_permission_id\": [true],\n }] as const,\n }],\n }],\n domains: [{}],\n apps: [{\n installed: [typedFromEntries(typedEntries(ALL_APPS).map(([key, value]) => [key, [{\n enabled: [true, false],\n }]]))],\n }],\n onboarding: [{\n requireEmailVerification: [true, false],\n }],\n}] satisfies FuzzerConfig<BranchConfigNormalizedOverride>;\n\nconst environmentSchemaFuzzerConfig = [{\n ...branchSchemaFuzzerConfig[0],\n auth: [{\n ...branchSchemaFuzzerConfig[0].auth[0],\n oauth: [{\n ...branchSchemaFuzzerConfig[0].auth[0].oauth[0],\n providers: [typedFromEntries(typedEntries(branchSchemaFuzzerConfig[0].auth[0].oauth[0].providers[0]).map(([key, value]) => [key, [{\n ...value[0],\n isShared: [true, false],\n clientId: [\"some-client-id\"],\n clientSecret: [\"some-client-secret\"],\n facebookConfigId: [\"some-facebook-config-id\"],\n microsoftTenantId: [\"some-microsoft-tenant-id\"],\n appleBundles: [{ \"some-bundle-id\": [{ bundleId: [\"com.example.app\"] }] }],\n }]]))] as const,\n }],\n }],\n domains: [{\n allowLocalhost: [true, false],\n trustedDomains: [{\n \"some-domain-id\": [{\n baseUrl: [\"https://example.com/something-here\"],\n handlerPath: [\"/something-here\"],\n }],\n }],\n }],\n emails: [{\n ...branchSchemaFuzzerConfig[0].emails[0],\n server: [{\n isShared: [true, false],\n provider: [\"resend\", \"smtp\"] as const,\n host: [\"example.com\", \"://super weird host that's not valid\"],\n port: [1234, 0.12543, -100, Infinity],\n username: [\"some-username\", \"some username with a space\"],\n password: [\"some-password\", \"some password with a space\"],\n senderName: [\"Some Sender\"],\n senderEmail: [\"some-sender@example.com\", \"some invalid email\"],\n }],\n }],\n payments: [{\n ...branchSchemaFuzzerConfig[0].payments[0],\n testMode: [false, true],\n }],\n}] satisfies FuzzerConfig<EnvironmentConfigNormalizedOverride>;\n\nconst organizationSchemaFuzzerConfig = environmentSchemaFuzzerConfig satisfies FuzzerConfig<OrganizationConfigNormalizedOverride>;\n\nfunction setDeep<T>(obj: T, path: string[], value: any) {\n if (!isObjectLike(obj)) return obj;\n\n if (path.length === 0) {\n throw new Error(\"Path is empty\");\n } else if (path.length === 1) {\n set(obj as any, path[0], value);\n } else {\n const [key, ...rest] = path;\n setDeep(getOrUndefined(obj as any, key), rest, value);\n }\n}\n\nfunction createFuzzerInput<T>(config: FuzzerConfig<T>, progress: number): T {\n progress = Math.min(1, 2 * progress);\n const createShouldRandom = (strength: number) => {\n const chance = Math.random() * strength * 1.2 - 0.1;\n return () => Math.random() < chance;\n };\n const createShouldObjectDependent = (strength: number) => {\n const objectChance = Math.random() * strength * 1.2 - 0.1;\n const primitiveChance = Math.random() * strength * 1.2 - 0.1;\n return (v: any) => Math.random() * Math.random() < (isObjectLike(v) ? objectChance : primitiveChance);\n };\n\n const shouldKeep = createShouldObjectDependent(progress * 1);\n const shouldMakeNested = createShouldObjectDependent(1.25);\n const shouldNull = createShouldRandom(0.25);\n\n let res: any;\n const recurse = <U>(outputPath: string[], config: FuzzerConfig<U>, forceNested: boolean, forceNonNull: boolean) => {\n let subConfig: any = config[Math.floor(Math.random() * config.length)];\n const originalValue = isObjectLike(subConfig) ? (Array.isArray(subConfig) ? [] : {}) : subConfig;\n\n const newValue = forceNonNull || !shouldNull() ? originalValue : null;\n const newOutputPath = forceNested || shouldMakeNested(originalValue) || outputPath.length === 0 ? outputPath : [outputPath.join(\".\")];\n if (outputPath.length === 0) {\n res = newValue;\n } else {\n if (forceNested || shouldKeep(originalValue)) {\n setDeep(res, newOutputPath, newValue);\n }\n }\n if (isObjectLike(subConfig)) {\n for (const [key, newValue] of typedEntries(subConfig)) {\n recurse([...newOutputPath, key], newValue, Array.isArray(subConfig), Array.isArray(subConfig));\n }\n }\n };\n recurse<T>([], config, false, true);\n return res;\n}\n\nundefined?.test(\"fuzz schemas\", async ({ expect }) => {\n const totalIterations = process.env.CI ? 1000 : 200;\n for (let i = 0; i < totalIterations; i++) {\n const projectInput = createFuzzerInput<ProjectConfigNormalizedOverride>(projectSchemaFuzzerConfig, i / totalIterations);\n const branchInput = createFuzzerInput<BranchConfigNormalizedOverride>(branchSchemaFuzzerConfig, i / totalIterations);\n const environmentInput = createFuzzerInput<EnvironmentConfigNormalizedOverride>(environmentSchemaFuzzerConfig, i / totalIterations);\n const organizationInput = createFuzzerInput<OrganizationConfigNormalizedOverride>(organizationSchemaFuzzerConfig, i / totalIterations);\n\n try {\n const projectMigrated = migrateConfigOverride(\"project\", projectInput);\n await assertNoConfigOverrideErrors(projectConfigSchema, projectMigrated);\n const projectOverridden = override({}, projectMigrated);\n await sanitizeProjectConfig(normalize(applyProjectDefaults(projectOverridden), { onDotIntoNonObject: \"ignore\" }) as any);\n\n const branchMigrated = migrateConfigOverride(\"branch\", branchInput);\n await assertNoConfigOverrideErrors(branchConfigSchema, branchMigrated);\n const branchOverridden = override(projectOverridden, branchMigrated);\n await sanitizeBranchConfig(normalize(applyBranchDefaults(branchOverridden), { onDotIntoNonObject: \"ignore\" }) as any);\n\n const environmentMigrated = migrateConfigOverride(\"environment\", environmentInput);\n await assertNoConfigOverrideErrors(environmentConfigSchema, environmentMigrated);\n const environmentOverridden = override(branchOverridden, environmentMigrated);\n await sanitizeEnvironmentConfig(normalize(applyEnvironmentDefaults(environmentOverridden), { onDotIntoNonObject: \"ignore\" }) as any);\n\n const organizationMigrated = migrateConfigOverride(\"organization\", organizationInput);\n await assertNoConfigOverrideErrors(organizationConfigSchema, organizationMigrated);\n const organizationOverridden = override(environmentOverridden, organizationMigrated);\n await sanitizeOrganizationConfig(normalize(applyOrganizationDefaults(organizationOverridden), { onDotIntoNonObject: \"ignore\" }) as any);\n\n } catch (e) {\n const data = {\n cause: e,\n inputs: {\n projectInput,\n branchInput,\n environmentInput,\n organizationInput,\n },\n } as const;\n console.error(\"Failed to fuzz schema in iteration ${i}/${totalIterations}!\", nicify(data));\n throw new StackAssertionError(`Error in iteration ${i}/${totalIterations} of schema fuzz: ${e}`, { cause: e });\n }\n }\n});\n"],"mappings":";;;AAAA,yBAAyB;AACzB,gCAAqC;AACrC,oBAAoC;AACpC,qBAAkF;AAClF,qBAAuB;AACvB,oBAAoC;AACpC,oBAAgf;AAgBhf,IAAM,2BAA2B,CAAC;AAAA,EAChC,SAAS,CAAC;AAAA,IACR,SAAS,CAAC;AAAA,MACR,MAAM,CAAC,MAAM,KAAK;AAAA,MAClB,MAAM,CAAC,MAAM,KAAK;AAAA,IACpB,CAAC;AAAA,EACH,CAAC;AAAA,EACD,MAAM,CAAC;AAAA,IACL,aAAa,CAAC,MAAM,KAAK;AAAA,IACzB,UAAU,CAAC;AAAA,MACT,aAAa,CAAC,MAAM,KAAK;AAAA,IAC3B,CAAC;AAAA,IACD,KAAK,CAAC;AAAA,MACJ,aAAa,CAAC,MAAM,KAAK;AAAA,IAC3B,CAAC;AAAA,IACD,SAAS,CAAC;AAAA,MACR,aAAa,CAAC,MAAM,KAAK;AAAA,IAC3B,CAAC;AAAA,IACD,OAAO,CAAC;AAAA,MACN,sBAAsB,CAAC,eAAe,eAAe,kBAAkB;AAAA,MACvE,WAAW,CAAC;AAAA,QACV,UAAU,CAAC;AAAA,UACT,MAAM,CAAC,UAAU,UAAU,GAAG;AAAA,UAC9B,aAAa,CAAC,MAAM,KAAK;AAAA,UACzB,wBAAwB,CAAC,MAAM,KAAK;AAAA,QACtC,CAAC;AAAA,MACH,CAAC;AAAA,IACH,CAAC;AAAA,IACD,aAAa,CAAC;AAAA,MACZ,gBAAgB,CAAC;AAAA,QACf,SAAS,CAAC,MAAM,KAAK;AAAA,QACrB,aAAa,CAAC,qBAAqB,2BAA2B;AAA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
|
147
147
|
domains: {};
|
|
148
148
|
auth: {
|
|
149
149
|
allowSignUp?: boolean | undefined;
|
|
150
|
+
signUpRulesDefaultAction?: string | undefined;
|
|
150
151
|
password: {
|
|
151
152
|
allowSignIn?: boolean | undefined;
|
|
152
153
|
};
|
|
@@ -164,6 +165,16 @@ declare const branchConfigSchema: yup.Schema<Omit<Omit<{
|
|
|
164
165
|
allowConnectedAccounts?: boolean | undefined;
|
|
165
166
|
}>;
|
|
166
167
|
};
|
|
168
|
+
signUpRules: Record<string, {
|
|
169
|
+
displayName?: string | undefined;
|
|
170
|
+
enabled?: boolean | undefined;
|
|
171
|
+
priority?: number | undefined;
|
|
172
|
+
condition?: string | undefined;
|
|
173
|
+
action: {
|
|
174
|
+
message?: string | undefined;
|
|
175
|
+
type: "allow" | "reject" | "restrict" | "log";
|
|
176
|
+
};
|
|
177
|
+
}>;
|
|
167
178
|
};
|
|
168
179
|
onboarding: {
|
|
169
180
|
requireEmailVerification?: boolean | undefined;
|
|
@@ -245,6 +256,8 @@ declare const branchConfigSchema: yup.Schema<Omit<Omit<{
|
|
|
245
256
|
accountMergeStrategy: undefined;
|
|
246
257
|
providers: undefined;
|
|
247
258
|
};
|
|
259
|
+
signUpRules: undefined;
|
|
260
|
+
signUpRulesDefaultAction: undefined;
|
|
248
261
|
};
|
|
249
262
|
emails: {
|
|
250
263
|
selectedThemeId: undefined;
|
|
@@ -334,6 +347,7 @@ declare const environmentConfigSchema: yup.Schema<Omit<NonNullable<Omit<Omit<{
|
|
|
334
347
|
domains: {};
|
|
335
348
|
auth: {
|
|
336
349
|
allowSignUp?: boolean | undefined;
|
|
350
|
+
signUpRulesDefaultAction?: string | undefined;
|
|
337
351
|
password: {
|
|
338
352
|
allowSignIn?: boolean | undefined;
|
|
339
353
|
};
|
|
@@ -351,6 +365,16 @@ declare const environmentConfigSchema: yup.Schema<Omit<NonNullable<Omit<Omit<{
|
|
|
351
365
|
allowConnectedAccounts?: boolean | undefined;
|
|
352
366
|
}>;
|
|
353
367
|
};
|
|
368
|
+
signUpRules: Record<string, {
|
|
369
|
+
displayName?: string | undefined;
|
|
370
|
+
enabled?: boolean | undefined;
|
|
371
|
+
priority?: number | undefined;
|
|
372
|
+
condition?: string | undefined;
|
|
373
|
+
action: {
|
|
374
|
+
message?: string | undefined;
|
|
375
|
+
type: "allow" | "reject" | "restrict" | "log";
|
|
376
|
+
};
|
|
377
|
+
}>;
|
|
354
378
|
};
|
|
355
379
|
onboarding: {
|
|
356
380
|
requireEmailVerification?: boolean | undefined;
|
|
@@ -461,6 +485,7 @@ declare const environmentConfigSchema: yup.Schema<Omit<NonNullable<Omit<Omit<{
|
|
|
461
485
|
};
|
|
462
486
|
auth: Omit<{
|
|
463
487
|
allowSignUp?: boolean | undefined;
|
|
488
|
+
signUpRulesDefaultAction?: string | undefined;
|
|
464
489
|
password: {
|
|
465
490
|
allowSignIn?: boolean | undefined;
|
|
466
491
|
};
|
|
@@ -478,6 +503,16 @@ declare const environmentConfigSchema: yup.Schema<Omit<NonNullable<Omit<Omit<{
|
|
|
478
503
|
allowConnectedAccounts?: boolean | undefined;
|
|
479
504
|
}>;
|
|
480
505
|
};
|
|
506
|
+
signUpRules: Record<string, {
|
|
507
|
+
displayName?: string | undefined;
|
|
508
|
+
enabled?: boolean | undefined;
|
|
509
|
+
priority?: number | undefined;
|
|
510
|
+
condition?: string | undefined;
|
|
511
|
+
action: {
|
|
512
|
+
message?: string | undefined;
|
|
513
|
+
type: "allow" | "reject" | "restrict" | "log";
|
|
514
|
+
};
|
|
515
|
+
}>;
|
|
481
516
|
}, "oauth"> & {
|
|
482
517
|
oauth: Omit<{
|
|
483
518
|
accountMergeStrategy?: "link_method" | "raise_error" | "allow_duplicates" | undefined;
|
|
@@ -548,6 +583,8 @@ declare const environmentConfigSchema: yup.Schema<Omit<NonNullable<Omit<Omit<{
|
|
|
548
583
|
accountMergeStrategy: undefined;
|
|
549
584
|
providers: undefined;
|
|
550
585
|
};
|
|
586
|
+
signUpRules: undefined;
|
|
587
|
+
signUpRulesDefaultAction: undefined;
|
|
551
588
|
};
|
|
552
589
|
emails: {
|
|
553
590
|
selectedThemeId: undefined;
|
|
@@ -613,6 +650,8 @@ declare const environmentConfigSchema: yup.Schema<Omit<NonNullable<Omit<Omit<{
|
|
|
613
650
|
accountMergeStrategy: undefined;
|
|
614
651
|
providers: undefined;
|
|
615
652
|
};
|
|
653
|
+
signUpRules: undefined;
|
|
654
|
+
signUpRulesDefaultAction: undefined;
|
|
616
655
|
};
|
|
617
656
|
emails: {
|
|
618
657
|
selectedThemeId: undefined;
|
|
@@ -678,6 +717,8 @@ declare const environmentConfigSchema: yup.Schema<Omit<NonNullable<Omit<Omit<{
|
|
|
678
717
|
accountMergeStrategy: undefined;
|
|
679
718
|
providers: undefined;
|
|
680
719
|
};
|
|
720
|
+
signUpRules: undefined;
|
|
721
|
+
signUpRulesDefaultAction: undefined;
|
|
681
722
|
};
|
|
682
723
|
emails: {
|
|
683
724
|
selectedThemeId: undefined;
|
|
@@ -746,6 +787,8 @@ declare const environmentConfigSchema: yup.Schema<Omit<NonNullable<Omit<Omit<{
|
|
|
746
787
|
accountMergeStrategy: undefined;
|
|
747
788
|
providers: undefined;
|
|
748
789
|
};
|
|
790
|
+
signUpRules: undefined;
|
|
791
|
+
signUpRulesDefaultAction: undefined;
|
|
749
792
|
};
|
|
750
793
|
emails: {
|
|
751
794
|
selectedThemeId: undefined;
|
|
@@ -822,6 +865,8 @@ declare const environmentConfigSchema: yup.Schema<Omit<NonNullable<Omit<Omit<{
|
|
|
822
865
|
accountMergeStrategy: undefined;
|
|
823
866
|
providers: undefined;
|
|
824
867
|
};
|
|
868
|
+
signUpRules: undefined;
|
|
869
|
+
signUpRulesDefaultAction: undefined;
|
|
825
870
|
};
|
|
826
871
|
emails: {
|
|
827
872
|
selectedThemeId: undefined;
|
|
@@ -890,6 +935,8 @@ declare const environmentConfigSchema: yup.Schema<Omit<NonNullable<Omit<Omit<{
|
|
|
890
935
|
accountMergeStrategy: undefined;
|
|
891
936
|
providers: undefined;
|
|
892
937
|
};
|
|
938
|
+
signUpRules: undefined;
|
|
939
|
+
signUpRulesDefaultAction: undefined;
|
|
893
940
|
};
|
|
894
941
|
emails: {
|
|
895
942
|
selectedThemeId: undefined;
|
|
@@ -982,6 +1029,7 @@ declare const organizationConfigSchema: yup.Schema<Omit<NonNullable<Omit<NonNull
|
|
|
982
1029
|
domains: {};
|
|
983
1030
|
auth: {
|
|
984
1031
|
allowSignUp?: boolean | undefined;
|
|
1032
|
+
signUpRulesDefaultAction?: string | undefined;
|
|
985
1033
|
password: {
|
|
986
1034
|
allowSignIn?: boolean | undefined;
|
|
987
1035
|
};
|
|
@@ -999,6 +1047,16 @@ declare const organizationConfigSchema: yup.Schema<Omit<NonNullable<Omit<NonNull
|
|
|
999
1047
|
allowConnectedAccounts?: boolean | undefined;
|
|
1000
1048
|
}>;
|
|
1001
1049
|
};
|
|
1050
|
+
signUpRules: Record<string, {
|
|
1051
|
+
displayName?: string | undefined;
|
|
1052
|
+
enabled?: boolean | undefined;
|
|
1053
|
+
priority?: number | undefined;
|
|
1054
|
+
condition?: string | undefined;
|
|
1055
|
+
action: {
|
|
1056
|
+
message?: string | undefined;
|
|
1057
|
+
type: "allow" | "reject" | "restrict" | "log";
|
|
1058
|
+
};
|
|
1059
|
+
}>;
|
|
1002
1060
|
};
|
|
1003
1061
|
onboarding: {
|
|
1004
1062
|
requireEmailVerification?: boolean | undefined;
|
|
@@ -1109,6 +1167,7 @@ declare const organizationConfigSchema: yup.Schema<Omit<NonNullable<Omit<NonNull
|
|
|
1109
1167
|
};
|
|
1110
1168
|
auth: Omit<{
|
|
1111
1169
|
allowSignUp?: boolean | undefined;
|
|
1170
|
+
signUpRulesDefaultAction?: string | undefined;
|
|
1112
1171
|
password: {
|
|
1113
1172
|
allowSignIn?: boolean | undefined;
|
|
1114
1173
|
};
|
|
@@ -1126,6 +1185,16 @@ declare const organizationConfigSchema: yup.Schema<Omit<NonNullable<Omit<NonNull
|
|
|
1126
1185
|
allowConnectedAccounts?: boolean | undefined;
|
|
1127
1186
|
}>;
|
|
1128
1187
|
};
|
|
1188
|
+
signUpRules: Record<string, {
|
|
1189
|
+
displayName?: string | undefined;
|
|
1190
|
+
enabled?: boolean | undefined;
|
|
1191
|
+
priority?: number | undefined;
|
|
1192
|
+
condition?: string | undefined;
|
|
1193
|
+
action: {
|
|
1194
|
+
message?: string | undefined;
|
|
1195
|
+
type: "allow" | "reject" | "restrict" | "log";
|
|
1196
|
+
};
|
|
1197
|
+
}>;
|
|
1129
1198
|
}, "oauth"> & {
|
|
1130
1199
|
oauth: Omit<{
|
|
1131
1200
|
accountMergeStrategy?: "link_method" | "raise_error" | "allow_duplicates" | undefined;
|
|
@@ -1196,6 +1265,8 @@ declare const organizationConfigSchema: yup.Schema<Omit<NonNullable<Omit<NonNull
|
|
|
1196
1265
|
accountMergeStrategy: undefined;
|
|
1197
1266
|
providers: undefined;
|
|
1198
1267
|
};
|
|
1268
|
+
signUpRules: undefined;
|
|
1269
|
+
signUpRulesDefaultAction: undefined;
|
|
1199
1270
|
};
|
|
1200
1271
|
emails: {
|
|
1201
1272
|
selectedThemeId: undefined;
|
|
@@ -1261,6 +1332,8 @@ declare const organizationConfigSchema: yup.Schema<Omit<NonNullable<Omit<NonNull
|
|
|
1261
1332
|
accountMergeStrategy: undefined;
|
|
1262
1333
|
providers: undefined;
|
|
1263
1334
|
};
|
|
1335
|
+
signUpRules: undefined;
|
|
1336
|
+
signUpRulesDefaultAction: undefined;
|
|
1264
1337
|
};
|
|
1265
1338
|
emails: {
|
|
1266
1339
|
selectedThemeId: undefined;
|
|
@@ -1326,6 +1399,8 @@ declare const organizationConfigSchema: yup.Schema<Omit<NonNullable<Omit<NonNull
|
|
|
1326
1399
|
accountMergeStrategy: undefined;
|
|
1327
1400
|
providers: undefined;
|
|
1328
1401
|
};
|
|
1402
|
+
signUpRules: undefined;
|
|
1403
|
+
signUpRulesDefaultAction: undefined;
|
|
1329
1404
|
};
|
|
1330
1405
|
emails: {
|
|
1331
1406
|
selectedThemeId: undefined;
|
|
@@ -1394,6 +1469,8 @@ declare const organizationConfigSchema: yup.Schema<Omit<NonNullable<Omit<NonNull
|
|
|
1394
1469
|
accountMergeStrategy: undefined;
|
|
1395
1470
|
providers: undefined;
|
|
1396
1471
|
};
|
|
1472
|
+
signUpRules: undefined;
|
|
1473
|
+
signUpRulesDefaultAction: undefined;
|
|
1397
1474
|
};
|
|
1398
1475
|
emails: {
|
|
1399
1476
|
selectedThemeId: undefined;
|
|
@@ -1470,6 +1547,8 @@ declare const organizationConfigSchema: yup.Schema<Omit<NonNullable<Omit<NonNull
|
|
|
1470
1547
|
accountMergeStrategy: undefined;
|
|
1471
1548
|
providers: undefined;
|
|
1472
1549
|
};
|
|
1550
|
+
signUpRules: undefined;
|
|
1551
|
+
signUpRulesDefaultAction: undefined;
|
|
1473
1552
|
};
|
|
1474
1553
|
emails: {
|
|
1475
1554
|
selectedThemeId: undefined;
|
|
@@ -1538,6 +1617,8 @@ declare const organizationConfigSchema: yup.Schema<Omit<NonNullable<Omit<NonNull
|
|
|
1538
1617
|
accountMergeStrategy: undefined;
|
|
1539
1618
|
providers: undefined;
|
|
1540
1619
|
};
|
|
1620
|
+
signUpRules: undefined;
|
|
1621
|
+
signUpRulesDefaultAction: undefined;
|
|
1541
1622
|
};
|
|
1542
1623
|
emails: {
|
|
1543
1624
|
selectedThemeId: undefined;
|
|
@@ -1636,6 +1717,17 @@ declare const organizationConfigDefaults: {
|
|
|
1636
1717
|
appleBundles: undefined;
|
|
1637
1718
|
};
|
|
1638
1719
|
};
|
|
1720
|
+
readonly signUpRules: (key: string) => {
|
|
1721
|
+
enabled: false;
|
|
1722
|
+
displayName: undefined;
|
|
1723
|
+
priority: number;
|
|
1724
|
+
condition: undefined;
|
|
1725
|
+
action: {
|
|
1726
|
+
type: "allow";
|
|
1727
|
+
message: undefined;
|
|
1728
|
+
};
|
|
1729
|
+
};
|
|
1730
|
+
readonly signUpRulesDefaultAction: "allow";
|
|
1639
1731
|
};
|
|
1640
1732
|
readonly emails: {
|
|
1641
1733
|
readonly server: {
|
|
@@ -1841,6 +1933,16 @@ declare function sanitizeOrganizationConfig(config: OrganizationRenderedConfigBe
|
|
|
1841
1933
|
}>;
|
|
1842
1934
|
accountMergeStrategy: "link_method" | "raise_error" | "allow_duplicates";
|
|
1843
1935
|
};
|
|
1936
|
+
signUpRules: Record<string, {
|
|
1937
|
+
displayName: string | undefined;
|
|
1938
|
+
enabled: boolean;
|
|
1939
|
+
priority: number;
|
|
1940
|
+
condition: string | undefined;
|
|
1941
|
+
action: {
|
|
1942
|
+
message: string | undefined;
|
|
1943
|
+
type: "allow" | "reject" | "restrict" | "log";
|
|
1944
|
+
};
|
|
1945
|
+
}>;
|
|
1844
1946
|
password: {
|
|
1845
1947
|
allowSignIn: boolean;
|
|
1846
1948
|
};
|
|
@@ -1851,6 +1953,7 @@ declare function sanitizeOrganizationConfig(config: OrganizationRenderedConfigBe
|
|
|
1851
1953
|
passkey: {
|
|
1852
1954
|
allowSignIn: boolean;
|
|
1853
1955
|
};
|
|
1956
|
+
signUpRulesDefaultAction: string;
|
|
1854
1957
|
};
|
|
1855
1958
|
emails: {
|
|
1856
1959
|
selectedThemeId: string;
|
package/dist/config/schema.d.ts
CHANGED
|
@@ -147,6 +147,7 @@ declare const branchConfigSchema: yup.Schema<Omit<Omit<{
|
|
|
147
147
|
domains: {};
|
|
148
148
|
auth: {
|
|
149
149
|
allowSignUp?: boolean | undefined;
|
|
150
|
+
signUpRulesDefaultAction?: string | undefined;
|
|
150
151
|
password: {
|
|
151
152
|
allowSignIn?: boolean | undefined;
|
|
152
153
|
};
|
|
@@ -164,6 +165,16 @@ declare const branchConfigSchema: yup.Schema<Omit<Omit<{
|
|
|
164
165
|
allowConnectedAccounts?: boolean | undefined;
|
|
165
166
|
}>;
|
|
166
167
|
};
|
|
168
|
+
signUpRules: Record<string, {
|
|
169
|
+
displayName?: string | undefined;
|
|
170
|
+
enabled?: boolean | undefined;
|
|
171
|
+
priority?: number | undefined;
|
|
172
|
+
condition?: string | undefined;
|
|
173
|
+
action: {
|
|
174
|
+
message?: string | undefined;
|
|
175
|
+
type: "allow" | "reject" | "restrict" | "log";
|
|
176
|
+
};
|
|
177
|
+
}>;
|
|
167
178
|
};
|
|
168
179
|
onboarding: {
|
|
169
180
|
requireEmailVerification?: boolean | undefined;
|
|
@@ -245,6 +256,8 @@ declare const branchConfigSchema: yup.Schema<Omit<Omit<{
|
|
|
245
256
|
accountMergeStrategy: undefined;
|
|
246
257
|
providers: undefined;
|
|
247
258
|
};
|
|
259
|
+
signUpRules: undefined;
|
|
260
|
+
signUpRulesDefaultAction: undefined;
|
|
248
261
|
};
|
|
249
262
|
emails: {
|
|
250
263
|
selectedThemeId: undefined;
|
|
@@ -334,6 +347,7 @@ declare const environmentConfigSchema: yup.Schema<Omit<NonNullable<Omit<Omit<{
|
|
|
334
347
|
domains: {};
|
|
335
348
|
auth: {
|
|
336
349
|
allowSignUp?: boolean | undefined;
|
|
350
|
+
signUpRulesDefaultAction?: string | undefined;
|
|
337
351
|
password: {
|
|
338
352
|
allowSignIn?: boolean | undefined;
|
|
339
353
|
};
|
|
@@ -351,6 +365,16 @@ declare const environmentConfigSchema: yup.Schema<Omit<NonNullable<Omit<Omit<{
|
|
|
351
365
|
allowConnectedAccounts?: boolean | undefined;
|
|
352
366
|
}>;
|
|
353
367
|
};
|
|
368
|
+
signUpRules: Record<string, {
|
|
369
|
+
displayName?: string | undefined;
|
|
370
|
+
enabled?: boolean | undefined;
|
|
371
|
+
priority?: number | undefined;
|
|
372
|
+
condition?: string | undefined;
|
|
373
|
+
action: {
|
|
374
|
+
message?: string | undefined;
|
|
375
|
+
type: "allow" | "reject" | "restrict" | "log";
|
|
376
|
+
};
|
|
377
|
+
}>;
|
|
354
378
|
};
|
|
355
379
|
onboarding: {
|
|
356
380
|
requireEmailVerification?: boolean | undefined;
|
|
@@ -461,6 +485,7 @@ declare const environmentConfigSchema: yup.Schema<Omit<NonNullable<Omit<Omit<{
|
|
|
461
485
|
};
|
|
462
486
|
auth: Omit<{
|
|
463
487
|
allowSignUp?: boolean | undefined;
|
|
488
|
+
signUpRulesDefaultAction?: string | undefined;
|
|
464
489
|
password: {
|
|
465
490
|
allowSignIn?: boolean | undefined;
|
|
466
491
|
};
|
|
@@ -478,6 +503,16 @@ declare const environmentConfigSchema: yup.Schema<Omit<NonNullable<Omit<Omit<{
|
|
|
478
503
|
allowConnectedAccounts?: boolean | undefined;
|
|
479
504
|
}>;
|
|
480
505
|
};
|
|
506
|
+
signUpRules: Record<string, {
|
|
507
|
+
displayName?: string | undefined;
|
|
508
|
+
enabled?: boolean | undefined;
|
|
509
|
+
priority?: number | undefined;
|
|
510
|
+
condition?: string | undefined;
|
|
511
|
+
action: {
|
|
512
|
+
message?: string | undefined;
|
|
513
|
+
type: "allow" | "reject" | "restrict" | "log";
|
|
514
|
+
};
|
|
515
|
+
}>;
|
|
481
516
|
}, "oauth"> & {
|
|
482
517
|
oauth: Omit<{
|
|
483
518
|
accountMergeStrategy?: "link_method" | "raise_error" | "allow_duplicates" | undefined;
|
|
@@ -548,6 +583,8 @@ declare const environmentConfigSchema: yup.Schema<Omit<NonNullable<Omit<Omit<{
|
|
|
548
583
|
accountMergeStrategy: undefined;
|
|
549
584
|
providers: undefined;
|
|
550
585
|
};
|
|
586
|
+
signUpRules: undefined;
|
|
587
|
+
signUpRulesDefaultAction: undefined;
|
|
551
588
|
};
|
|
552
589
|
emails: {
|
|
553
590
|
selectedThemeId: undefined;
|
|
@@ -613,6 +650,8 @@ declare const environmentConfigSchema: yup.Schema<Omit<NonNullable<Omit<Omit<{
|
|
|
613
650
|
accountMergeStrategy: undefined;
|
|
614
651
|
providers: undefined;
|
|
615
652
|
};
|
|
653
|
+
signUpRules: undefined;
|
|
654
|
+
signUpRulesDefaultAction: undefined;
|
|
616
655
|
};
|
|
617
656
|
emails: {
|
|
618
657
|
selectedThemeId: undefined;
|
|
@@ -678,6 +717,8 @@ declare const environmentConfigSchema: yup.Schema<Omit<NonNullable<Omit<Omit<{
|
|
|
678
717
|
accountMergeStrategy: undefined;
|
|
679
718
|
providers: undefined;
|
|
680
719
|
};
|
|
720
|
+
signUpRules: undefined;
|
|
721
|
+
signUpRulesDefaultAction: undefined;
|
|
681
722
|
};
|
|
682
723
|
emails: {
|
|
683
724
|
selectedThemeId: undefined;
|
|
@@ -746,6 +787,8 @@ declare const environmentConfigSchema: yup.Schema<Omit<NonNullable<Omit<Omit<{
|
|
|
746
787
|
accountMergeStrategy: undefined;
|
|
747
788
|
providers: undefined;
|
|
748
789
|
};
|
|
790
|
+
signUpRules: undefined;
|
|
791
|
+
signUpRulesDefaultAction: undefined;
|
|
749
792
|
};
|
|
750
793
|
emails: {
|
|
751
794
|
selectedThemeId: undefined;
|
|
@@ -822,6 +865,8 @@ declare const environmentConfigSchema: yup.Schema<Omit<NonNullable<Omit<Omit<{
|
|
|
822
865
|
accountMergeStrategy: undefined;
|
|
823
866
|
providers: undefined;
|
|
824
867
|
};
|
|
868
|
+
signUpRules: undefined;
|
|
869
|
+
signUpRulesDefaultAction: undefined;
|
|
825
870
|
};
|
|
826
871
|
emails: {
|
|
827
872
|
selectedThemeId: undefined;
|
|
@@ -890,6 +935,8 @@ declare const environmentConfigSchema: yup.Schema<Omit<NonNullable<Omit<Omit<{
|
|
|
890
935
|
accountMergeStrategy: undefined;
|
|
891
936
|
providers: undefined;
|
|
892
937
|
};
|
|
938
|
+
signUpRules: undefined;
|
|
939
|
+
signUpRulesDefaultAction: undefined;
|
|
893
940
|
};
|
|
894
941
|
emails: {
|
|
895
942
|
selectedThemeId: undefined;
|
|
@@ -982,6 +1029,7 @@ declare const organizationConfigSchema: yup.Schema<Omit<NonNullable<Omit<NonNull
|
|
|
982
1029
|
domains: {};
|
|
983
1030
|
auth: {
|
|
984
1031
|
allowSignUp?: boolean | undefined;
|
|
1032
|
+
signUpRulesDefaultAction?: string | undefined;
|
|
985
1033
|
password: {
|
|
986
1034
|
allowSignIn?: boolean | undefined;
|
|
987
1035
|
};
|
|
@@ -999,6 +1047,16 @@ declare const organizationConfigSchema: yup.Schema<Omit<NonNullable<Omit<NonNull
|
|
|
999
1047
|
allowConnectedAccounts?: boolean | undefined;
|
|
1000
1048
|
}>;
|
|
1001
1049
|
};
|
|
1050
|
+
signUpRules: Record<string, {
|
|
1051
|
+
displayName?: string | undefined;
|
|
1052
|
+
enabled?: boolean | undefined;
|
|
1053
|
+
priority?: number | undefined;
|
|
1054
|
+
condition?: string | undefined;
|
|
1055
|
+
action: {
|
|
1056
|
+
message?: string | undefined;
|
|
1057
|
+
type: "allow" | "reject" | "restrict" | "log";
|
|
1058
|
+
};
|
|
1059
|
+
}>;
|
|
1002
1060
|
};
|
|
1003
1061
|
onboarding: {
|
|
1004
1062
|
requireEmailVerification?: boolean | undefined;
|
|
@@ -1109,6 +1167,7 @@ declare const organizationConfigSchema: yup.Schema<Omit<NonNullable<Omit<NonNull
|
|
|
1109
1167
|
};
|
|
1110
1168
|
auth: Omit<{
|
|
1111
1169
|
allowSignUp?: boolean | undefined;
|
|
1170
|
+
signUpRulesDefaultAction?: string | undefined;
|
|
1112
1171
|
password: {
|
|
1113
1172
|
allowSignIn?: boolean | undefined;
|
|
1114
1173
|
};
|
|
@@ -1126,6 +1185,16 @@ declare const organizationConfigSchema: yup.Schema<Omit<NonNullable<Omit<NonNull
|
|
|
1126
1185
|
allowConnectedAccounts?: boolean | undefined;
|
|
1127
1186
|
}>;
|
|
1128
1187
|
};
|
|
1188
|
+
signUpRules: Record<string, {
|
|
1189
|
+
displayName?: string | undefined;
|
|
1190
|
+
enabled?: boolean | undefined;
|
|
1191
|
+
priority?: number | undefined;
|
|
1192
|
+
condition?: string | undefined;
|
|
1193
|
+
action: {
|
|
1194
|
+
message?: string | undefined;
|
|
1195
|
+
type: "allow" | "reject" | "restrict" | "log";
|
|
1196
|
+
};
|
|
1197
|
+
}>;
|
|
1129
1198
|
}, "oauth"> & {
|
|
1130
1199
|
oauth: Omit<{
|
|
1131
1200
|
accountMergeStrategy?: "link_method" | "raise_error" | "allow_duplicates" | undefined;
|
|
@@ -1196,6 +1265,8 @@ declare const organizationConfigSchema: yup.Schema<Omit<NonNullable<Omit<NonNull
|
|
|
1196
1265
|
accountMergeStrategy: undefined;
|
|
1197
1266
|
providers: undefined;
|
|
1198
1267
|
};
|
|
1268
|
+
signUpRules: undefined;
|
|
1269
|
+
signUpRulesDefaultAction: undefined;
|
|
1199
1270
|
};
|
|
1200
1271
|
emails: {
|
|
1201
1272
|
selectedThemeId: undefined;
|
|
@@ -1261,6 +1332,8 @@ declare const organizationConfigSchema: yup.Schema<Omit<NonNullable<Omit<NonNull
|
|
|
1261
1332
|
accountMergeStrategy: undefined;
|
|
1262
1333
|
providers: undefined;
|
|
1263
1334
|
};
|
|
1335
|
+
signUpRules: undefined;
|
|
1336
|
+
signUpRulesDefaultAction: undefined;
|
|
1264
1337
|
};
|
|
1265
1338
|
emails: {
|
|
1266
1339
|
selectedThemeId: undefined;
|
|
@@ -1326,6 +1399,8 @@ declare const organizationConfigSchema: yup.Schema<Omit<NonNullable<Omit<NonNull
|
|
|
1326
1399
|
accountMergeStrategy: undefined;
|
|
1327
1400
|
providers: undefined;
|
|
1328
1401
|
};
|
|
1402
|
+
signUpRules: undefined;
|
|
1403
|
+
signUpRulesDefaultAction: undefined;
|
|
1329
1404
|
};
|
|
1330
1405
|
emails: {
|
|
1331
1406
|
selectedThemeId: undefined;
|
|
@@ -1394,6 +1469,8 @@ declare const organizationConfigSchema: yup.Schema<Omit<NonNullable<Omit<NonNull
|
|
|
1394
1469
|
accountMergeStrategy: undefined;
|
|
1395
1470
|
providers: undefined;
|
|
1396
1471
|
};
|
|
1472
|
+
signUpRules: undefined;
|
|
1473
|
+
signUpRulesDefaultAction: undefined;
|
|
1397
1474
|
};
|
|
1398
1475
|
emails: {
|
|
1399
1476
|
selectedThemeId: undefined;
|
|
@@ -1470,6 +1547,8 @@ declare const organizationConfigSchema: yup.Schema<Omit<NonNullable<Omit<NonNull
|
|
|
1470
1547
|
accountMergeStrategy: undefined;
|
|
1471
1548
|
providers: undefined;
|
|
1472
1549
|
};
|
|
1550
|
+
signUpRules: undefined;
|
|
1551
|
+
signUpRulesDefaultAction: undefined;
|
|
1473
1552
|
};
|
|
1474
1553
|
emails: {
|
|
1475
1554
|
selectedThemeId: undefined;
|
|
@@ -1538,6 +1617,8 @@ declare const organizationConfigSchema: yup.Schema<Omit<NonNullable<Omit<NonNull
|
|
|
1538
1617
|
accountMergeStrategy: undefined;
|
|
1539
1618
|
providers: undefined;
|
|
1540
1619
|
};
|
|
1620
|
+
signUpRules: undefined;
|
|
1621
|
+
signUpRulesDefaultAction: undefined;
|
|
1541
1622
|
};
|
|
1542
1623
|
emails: {
|
|
1543
1624
|
selectedThemeId: undefined;
|
|
@@ -1636,6 +1717,17 @@ declare const organizationConfigDefaults: {
|
|
|
1636
1717
|
appleBundles: undefined;
|
|
1637
1718
|
};
|
|
1638
1719
|
};
|
|
1720
|
+
readonly signUpRules: (key: string) => {
|
|
1721
|
+
enabled: false;
|
|
1722
|
+
displayName: undefined;
|
|
1723
|
+
priority: number;
|
|
1724
|
+
condition: undefined;
|
|
1725
|
+
action: {
|
|
1726
|
+
type: "allow";
|
|
1727
|
+
message: undefined;
|
|
1728
|
+
};
|
|
1729
|
+
};
|
|
1730
|
+
readonly signUpRulesDefaultAction: "allow";
|
|
1639
1731
|
};
|
|
1640
1732
|
readonly emails: {
|
|
1641
1733
|
readonly server: {
|
|
@@ -1841,6 +1933,16 @@ declare function sanitizeOrganizationConfig(config: OrganizationRenderedConfigBe
|
|
|
1841
1933
|
}>;
|
|
1842
1934
|
accountMergeStrategy: "link_method" | "raise_error" | "allow_duplicates";
|
|
1843
1935
|
};
|
|
1936
|
+
signUpRules: Record<string, {
|
|
1937
|
+
displayName: string | undefined;
|
|
1938
|
+
enabled: boolean;
|
|
1939
|
+
priority: number;
|
|
1940
|
+
condition: string | undefined;
|
|
1941
|
+
action: {
|
|
1942
|
+
message: string | undefined;
|
|
1943
|
+
type: "allow" | "reject" | "restrict" | "log";
|
|
1944
|
+
};
|
|
1945
|
+
}>;
|
|
1844
1946
|
password: {
|
|
1845
1947
|
allowSignIn: boolean;
|
|
1846
1948
|
};
|
|
@@ -1851,6 +1953,7 @@ declare function sanitizeOrganizationConfig(config: OrganizationRenderedConfigBe
|
|
|
1851
1953
|
passkey: {
|
|
1852
1954
|
allowSignIn: boolean;
|
|
1853
1955
|
};
|
|
1956
|
+
signUpRulesDefaultAction: string;
|
|
1854
1957
|
};
|
|
1855
1958
|
emails: {
|
|
1856
1959
|
selectedThemeId: string;
|