mirror of
https://github.com/eigent-ai/eigent.git
synced 2026-04-29 20:20:16 +00:00
Initial commit of eigent-main
This commit is contained in:
commit
723df5a03e
1144 changed files with 103478 additions and 0 deletions
39
package/@stackframe/stack-shared/dist/config/format.d.mts
vendored
Normal file
39
package/@stackframe/stack-shared/dist/config/format.d.mts
vendored
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
type ConfigValue = string | number | boolean | null | ConfigValue[] | Config;
|
||||
type Config = {
|
||||
[keyOrDotNotation: string]: ConfigValue | undefined;
|
||||
};
|
||||
type NormalizedConfigValue = string | number | boolean | NormalizedConfig | NormalizedConfigValue[];
|
||||
type NormalizedConfig = {
|
||||
[key: string]: NormalizedConfigValue | undefined;
|
||||
};
|
||||
type _NormalizesTo<N> = N extends object ? (Config & {
|
||||
[K in keyof N]?: _NormalizesTo<N[K]> | null;
|
||||
} & {
|
||||
[K in `${string}.${string}`]: ConfigValue;
|
||||
}) : N;
|
||||
type NormalizesTo<N extends NormalizedConfig> = _NormalizesTo<N>;
|
||||
/**
|
||||
* Note that a config can both be valid and not normalizable.
|
||||
*/
|
||||
declare function isValidConfig(c: unknown): c is Config;
|
||||
declare function getInvalidConfigReason(c: unknown, options?: {
|
||||
configName?: string;
|
||||
}): string | undefined;
|
||||
declare function assertValidConfig(c: unknown): void;
|
||||
declare function override(c1: Config, ...configs: Config[]): Config;
|
||||
type NormalizeOptions = {
|
||||
/**
|
||||
* What to do if a dot notation is used on null.
|
||||
*
|
||||
* - "empty" (default): Replace the null with an empty object.
|
||||
* - "throw": Throw an error.
|
||||
* - "ignore": Ignore the dot notation field.
|
||||
*/
|
||||
onDotIntoNull?: "empty" | "throw" | "ignore";
|
||||
};
|
||||
declare class NormalizationError extends Error {
|
||||
constructor(...args: ConstructorParameters<typeof Error>);
|
||||
}
|
||||
declare function normalize(c: Config, options?: NormalizeOptions): NormalizedConfig;
|
||||
|
||||
export { type Config, type ConfigValue, NormalizationError, type NormalizedConfig, type NormalizedConfigValue, type NormalizesTo, type _NormalizesTo, assertValidConfig, getInvalidConfigReason, isValidConfig, normalize, override };
|
||||
39
package/@stackframe/stack-shared/dist/config/format.d.ts
vendored
Normal file
39
package/@stackframe/stack-shared/dist/config/format.d.ts
vendored
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
type ConfigValue = string | number | boolean | null | ConfigValue[] | Config;
|
||||
type Config = {
|
||||
[keyOrDotNotation: string]: ConfigValue | undefined;
|
||||
};
|
||||
type NormalizedConfigValue = string | number | boolean | NormalizedConfig | NormalizedConfigValue[];
|
||||
type NormalizedConfig = {
|
||||
[key: string]: NormalizedConfigValue | undefined;
|
||||
};
|
||||
type _NormalizesTo<N> = N extends object ? (Config & {
|
||||
[K in keyof N]?: _NormalizesTo<N[K]> | null;
|
||||
} & {
|
||||
[K in `${string}.${string}`]: ConfigValue;
|
||||
}) : N;
|
||||
type NormalizesTo<N extends NormalizedConfig> = _NormalizesTo<N>;
|
||||
/**
|
||||
* Note that a config can both be valid and not normalizable.
|
||||
*/
|
||||
declare function isValidConfig(c: unknown): c is Config;
|
||||
declare function getInvalidConfigReason(c: unknown, options?: {
|
||||
configName?: string;
|
||||
}): string | undefined;
|
||||
declare function assertValidConfig(c: unknown): void;
|
||||
declare function override(c1: Config, ...configs: Config[]): Config;
|
||||
type NormalizeOptions = {
|
||||
/**
|
||||
* What to do if a dot notation is used on null.
|
||||
*
|
||||
* - "empty" (default): Replace the null with an empty object.
|
||||
* - "throw": Throw an error.
|
||||
* - "ignore": Ignore the dot notation field.
|
||||
*/
|
||||
onDotIntoNull?: "empty" | "throw" | "ignore";
|
||||
};
|
||||
declare class NormalizationError extends Error {
|
||||
constructor(...args: ConstructorParameters<typeof Error>);
|
||||
}
|
||||
declare function normalize(c: Config, options?: NormalizeOptions): NormalizedConfig;
|
||||
|
||||
export { type Config, type ConfigValue, NormalizationError, type NormalizedConfig, type NormalizedConfigValue, type NormalizesTo, type _NormalizesTo, assertValidConfig, getInvalidConfigReason, isValidConfig, normalize, override };
|
||||
165
package/@stackframe/stack-shared/dist/config/format.js
vendored
Normal file
165
package/@stackframe/stack-shared/dist/config/format.js
vendored
Normal file
|
|
@ -0,0 +1,165 @@
|
|||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
|
||||
// src/config/format.ts
|
||||
var format_exports = {};
|
||||
__export(format_exports, {
|
||||
NormalizationError: () => NormalizationError,
|
||||
assertValidConfig: () => assertValidConfig,
|
||||
getInvalidConfigReason: () => getInvalidConfigReason,
|
||||
isValidConfig: () => isValidConfig,
|
||||
normalize: () => normalize,
|
||||
override: () => override
|
||||
});
|
||||
module.exports = __toCommonJS(format_exports);
|
||||
var import_errors = require("../utils/errors");
|
||||
var import_objects = require("../utils/objects");
|
||||
function isValidConfig(c) {
|
||||
return getInvalidConfigReason(c) === void 0;
|
||||
}
|
||||
function getInvalidConfigReason(c, options = {}) {
|
||||
const configName = options.configName ?? "config";
|
||||
if (c === null || typeof c !== "object") return `${configName} must be a non-null object`;
|
||||
for (const [key, value] of Object.entries(c)) {
|
||||
if (value === void 0) continue;
|
||||
if (typeof key !== "string") return `${configName} must have only string keys (found: ${typeof key})`;
|
||||
if (!key.match(/^[a-zA-Z0-9_:$][a-zA-Z_:$0-9\-]*(?:\.[a-zA-Z0-9_:$][a-zA-Z_:$0-9\-]*)*$/)) return `All keys of ${configName} must consist of only alphanumeric characters, dots, underscores, colons, dollar signs, or hyphens and start with a character other than a hyphen (found: ${key})`;
|
||||
const entryName = `${configName}.${key}`;
|
||||
const reason = getInvalidConfigValueReason(value, { valueName: entryName });
|
||||
if (reason) return reason;
|
||||
}
|
||||
return void 0;
|
||||
}
|
||||
function getInvalidConfigValueReason(value, options = {}) {
|
||||
const valueName = options.valueName ?? "value";
|
||||
switch (typeof value) {
|
||||
case "string":
|
||||
case "number":
|
||||
case "boolean": {
|
||||
break;
|
||||
}
|
||||
case "object": {
|
||||
if (value === null) {
|
||||
break;
|
||||
} else if (Array.isArray(value)) {
|
||||
for (const [index, v] of value.entries()) {
|
||||
const reason = getInvalidConfigValueReason(v, { valueName: `${valueName}[${index}]` });
|
||||
if (reason) return reason;
|
||||
}
|
||||
} else {
|
||||
const reason = getInvalidConfigReason(value, { configName: valueName });
|
||||
if (reason) return reason;
|
||||
}
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
return `${valueName} has an invalid value type ${typeof value} (value: ${value})`;
|
||||
}
|
||||
}
|
||||
return void 0;
|
||||
}
|
||||
function assertValidConfig(c) {
|
||||
const reason = getInvalidConfigReason(c);
|
||||
if (reason) throw new import_errors.StackAssertionError(`Invalid config: ${reason}`, { c });
|
||||
}
|
||||
function override(c1, ...configs) {
|
||||
if (configs.length === 0) return c1;
|
||||
if (configs.length > 1) return override(override(c1, configs[0]), ...configs.slice(1));
|
||||
const c2 = configs[0];
|
||||
assertValidConfig(c1);
|
||||
assertValidConfig(c2);
|
||||
let result = c1;
|
||||
for (const key of Object.keys((0, import_objects.filterUndefined)(c2))) {
|
||||
result = Object.fromEntries(
|
||||
Object.entries(result).filter(([k]) => k !== key && !k.startsWith(key + "."))
|
||||
);
|
||||
}
|
||||
return {
|
||||
...result,
|
||||
...(0, import_objects.filterUndefined)(c2)
|
||||
};
|
||||
}
|
||||
var NormalizationError = class extends Error {
|
||||
constructor(...args) {
|
||||
super(...args);
|
||||
}
|
||||
};
|
||||
NormalizationError.prototype.name = "NormalizationError";
|
||||
function normalize(c, options = {}) {
|
||||
assertValidConfig(c);
|
||||
const onDotIntoNull = options.onDotIntoNull ?? "empty";
|
||||
const countDots = (s) => s.match(/\./g)?.length ?? 0;
|
||||
const result = {};
|
||||
const keysByDepth = Object.keys(c).sort((a, b) => countDots(a) - countDots(b));
|
||||
outer: for (const key of keysByDepth) {
|
||||
const keySegmentsWithoutLast = key.split(".");
|
||||
const last = keySegmentsWithoutLast.pop() ?? (0, import_errors.throwErr)("split returns empty array?");
|
||||
const value = (0, import_objects.get)(c, key);
|
||||
if (value === void 0) continue;
|
||||
let current = result;
|
||||
for (const keySegment of keySegmentsWithoutLast) {
|
||||
if (!(0, import_objects.hasAndNotUndefined)(current, keySegment)) {
|
||||
switch (onDotIntoNull) {
|
||||
case "empty": {
|
||||
(0, import_objects.set)(current, keySegment, {});
|
||||
break;
|
||||
}
|
||||
case "throw": {
|
||||
throw new NormalizationError(`Tried to use dot notation to access ${JSON.stringify(key)}, but ${JSON.stringify(keySegment)} doesn't exist on the object (or is null). Maybe this config is not normalizable?`);
|
||||
}
|
||||
case "ignore": {
|
||||
continue outer;
|
||||
}
|
||||
}
|
||||
}
|
||||
const value2 = (0, import_objects.get)(current, keySegment);
|
||||
if (typeof value2 !== "object") {
|
||||
throw new NormalizationError(`Tried to use dot notation to access ${JSON.stringify(key)}, but ${JSON.stringify(keySegment)} is not an object. Maybe this config is not normalizable?`);
|
||||
}
|
||||
current = value2;
|
||||
}
|
||||
setNormalizedValue(current, last, value);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
function normalizeValue(value) {
|
||||
if (value === null) throw new NormalizationError("Tried to normalize a null value");
|
||||
if (Array.isArray(value)) return value.map(normalizeValue);
|
||||
if (typeof value === "object") return normalize(value);
|
||||
return value;
|
||||
}
|
||||
function setNormalizedValue(result, key, value) {
|
||||
if (value === null) {
|
||||
if ((0, import_objects.hasAndNotUndefined)(result, key)) {
|
||||
(0, import_objects.deleteKey)(result, key);
|
||||
}
|
||||
} else {
|
||||
(0, import_objects.set)(result, key, normalizeValue(value));
|
||||
}
|
||||
}
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
NormalizationError,
|
||||
assertValidConfig,
|
||||
getInvalidConfigReason,
|
||||
isValidConfig,
|
||||
normalize,
|
||||
override
|
||||
});
|
||||
//# sourceMappingURL=format.js.map
|
||||
1
package/@stackframe/stack-shared/dist/config/format.js.map
vendored
Normal file
1
package/@stackframe/stack-shared/dist/config/format.js.map
vendored
Normal file
File diff suppressed because one or more lines are too long
729
package/@stackframe/stack-shared/dist/config/schema.d.mts
vendored
Normal file
729
package/@stackframe/stack-shared/dist/config/schema.d.mts
vendored
Normal file
|
|
@ -0,0 +1,729 @@
|
|||
import * as yup from 'yup';
|
||||
import { DeepMerge, DeepPartial } from '../utils/objects.mjs';
|
||||
import { PrettifyType } from '../utils/types.mjs';
|
||||
import { NormalizesTo, Config } from './format.mjs';
|
||||
|
||||
declare const configLevels: readonly ["project", "branch", "environment", "organization"];
|
||||
type ConfigLevel = typeof configLevels[number];
|
||||
/**
|
||||
* All fields that can be overridden at this level.
|
||||
*/
|
||||
declare const projectConfigSchema: yup.ObjectSchema<{}, yup.AnyObject, {}, "">;
|
||||
declare const branchConfigSchema: yup.ObjectSchema<{} & {
|
||||
rbac: {
|
||||
permissions?: Record<string, {
|
||||
description?: string | undefined;
|
||||
scope?: "project" | "team" | undefined;
|
||||
containedPermissionIds?: Record<string, true | undefined> | undefined;
|
||||
} | undefined> | undefined;
|
||||
defaultPermissions?: {
|
||||
teamCreator?: Record<string, true | undefined> | undefined;
|
||||
teamMember?: Record<string, true | undefined> | undefined;
|
||||
signUp?: Record<string, true | undefined> | undefined;
|
||||
} | undefined;
|
||||
} | undefined;
|
||||
teams: {
|
||||
createPersonalTeamOnSignUp?: boolean | undefined;
|
||||
allowClientTeamCreation?: boolean | undefined;
|
||||
} | undefined;
|
||||
users: {
|
||||
allowClientUserDeletion?: boolean | undefined;
|
||||
} | undefined;
|
||||
apiKeys: {
|
||||
enabled?: {
|
||||
team?: boolean | undefined;
|
||||
user?: boolean | undefined;
|
||||
} | undefined;
|
||||
} | undefined;
|
||||
domains: {
|
||||
allowLocalhost?: boolean | undefined;
|
||||
} | undefined;
|
||||
auth: {
|
||||
allowSignUp?: boolean | undefined;
|
||||
password?: {
|
||||
allowSignIn?: boolean | undefined;
|
||||
} | undefined;
|
||||
otp?: {
|
||||
allowSignIn?: boolean | undefined;
|
||||
} | undefined;
|
||||
passkey?: {
|
||||
allowSignIn?: boolean | undefined;
|
||||
} | undefined;
|
||||
oauth?: {
|
||||
accountMergeStrategy?: "link_method" | "raise_error" | "allow_duplicates" | undefined;
|
||||
providers?: Record<string, {
|
||||
allowSignIn?: boolean | undefined;
|
||||
type?: "google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin" | "apple" | "x" | undefined;
|
||||
allowConnectedAccounts?: boolean | undefined;
|
||||
}> | undefined;
|
||||
} | undefined;
|
||||
} | undefined;
|
||||
emails: {};
|
||||
}, yup.AnyObject, {
|
||||
rbac: {
|
||||
permissions: undefined;
|
||||
defaultPermissions: {
|
||||
teamCreator: undefined;
|
||||
teamMember: undefined;
|
||||
signUp: undefined;
|
||||
};
|
||||
};
|
||||
teams: {
|
||||
createPersonalTeamOnSignUp: undefined;
|
||||
allowClientTeamCreation: undefined;
|
||||
};
|
||||
users: {
|
||||
allowClientUserDeletion: undefined;
|
||||
};
|
||||
apiKeys: {
|
||||
enabled: {
|
||||
team: undefined;
|
||||
user: undefined;
|
||||
};
|
||||
};
|
||||
domains: {
|
||||
allowLocalhost: undefined;
|
||||
};
|
||||
auth: {
|
||||
allowSignUp: undefined;
|
||||
password: {
|
||||
allowSignIn: undefined;
|
||||
};
|
||||
otp: {
|
||||
allowSignIn: undefined;
|
||||
};
|
||||
passkey: {
|
||||
allowSignIn: undefined;
|
||||
};
|
||||
oauth: {
|
||||
accountMergeStrategy: undefined;
|
||||
providers: undefined;
|
||||
};
|
||||
};
|
||||
emails: {};
|
||||
}, "">;
|
||||
declare const environmentConfigSchema: yup.ObjectSchema<{
|
||||
rbac: {
|
||||
permissions?: Record<string, {
|
||||
description?: string | undefined;
|
||||
scope?: "project" | "team" | undefined;
|
||||
containedPermissionIds?: Record<string, true | undefined> | undefined;
|
||||
} | undefined> | undefined;
|
||||
defaultPermissions?: {
|
||||
teamCreator?: Record<string, true | undefined> | undefined;
|
||||
teamMember?: Record<string, true | undefined> | undefined;
|
||||
signUp?: Record<string, true | undefined> | undefined;
|
||||
} | undefined;
|
||||
} | undefined;
|
||||
teams: {
|
||||
createPersonalTeamOnSignUp?: boolean | undefined;
|
||||
allowClientTeamCreation?: boolean | undefined;
|
||||
} | undefined;
|
||||
users: {
|
||||
allowClientUserDeletion?: boolean | undefined;
|
||||
} | undefined;
|
||||
apiKeys: {
|
||||
enabled?: {
|
||||
team?: boolean | undefined;
|
||||
user?: boolean | undefined;
|
||||
} | undefined;
|
||||
} | undefined;
|
||||
domains: (Omit<{
|
||||
allowLocalhost?: boolean | undefined;
|
||||
}, "trustedDomains"> & {
|
||||
trustedDomains?: Record<string, {
|
||||
baseUrl?: string | undefined;
|
||||
handlerPath?: string | undefined;
|
||||
}> | undefined;
|
||||
}) | undefined;
|
||||
auth: (Omit<{
|
||||
allowSignUp?: boolean | undefined;
|
||||
password?: {
|
||||
allowSignIn?: boolean | undefined;
|
||||
} | undefined;
|
||||
otp?: {
|
||||
allowSignIn?: boolean | undefined;
|
||||
} | undefined;
|
||||
passkey?: {
|
||||
allowSignIn?: boolean | undefined;
|
||||
} | undefined;
|
||||
oauth?: {
|
||||
accountMergeStrategy?: "link_method" | "raise_error" | "allow_duplicates" | undefined;
|
||||
providers?: Record<string, {
|
||||
allowSignIn?: boolean | undefined;
|
||||
type?: "google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin" | "apple" | "x" | undefined;
|
||||
allowConnectedAccounts?: boolean | undefined;
|
||||
}> | undefined;
|
||||
} | undefined;
|
||||
}, "oauth"> & {
|
||||
oauth?: (Omit<{
|
||||
accountMergeStrategy?: "link_method" | "raise_error" | "allow_duplicates" | undefined;
|
||||
providers?: Record<string, {
|
||||
allowSignIn?: boolean | undefined;
|
||||
type?: "google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin" | "apple" | "x" | undefined;
|
||||
allowConnectedAccounts?: boolean | undefined;
|
||||
}> | undefined;
|
||||
}, never> & {
|
||||
providers?: Record<string, {
|
||||
allowSignIn?: boolean | undefined;
|
||||
type?: "google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin" | "apple" | "x" | undefined;
|
||||
allowConnectedAccounts?: boolean | undefined;
|
||||
isShared?: boolean | undefined;
|
||||
clientId?: string | undefined;
|
||||
clientSecret?: string | undefined;
|
||||
facebookConfigId?: string | undefined;
|
||||
microsoftTenantId?: string | undefined;
|
||||
}> | undefined;
|
||||
}) | undefined;
|
||||
}) | undefined;
|
||||
emails: Omit<{}, never> & {
|
||||
server: {
|
||||
password?: string | undefined;
|
||||
isShared?: boolean | undefined;
|
||||
host?: string | undefined;
|
||||
port?: number | undefined;
|
||||
username?: string | undefined;
|
||||
senderName?: string | undefined;
|
||||
senderEmail?: string | undefined;
|
||||
};
|
||||
};
|
||||
} & {
|
||||
auth: (Omit<{
|
||||
allowSignUp?: boolean | undefined;
|
||||
password?: {
|
||||
allowSignIn?: boolean | undefined;
|
||||
} | undefined;
|
||||
otp?: {
|
||||
allowSignIn?: boolean | undefined;
|
||||
} | undefined;
|
||||
passkey?: {
|
||||
allowSignIn?: boolean | undefined;
|
||||
} | undefined;
|
||||
oauth?: {
|
||||
accountMergeStrategy?: "link_method" | "raise_error" | "allow_duplicates" | undefined;
|
||||
providers?: Record<string, {
|
||||
allowSignIn?: boolean | undefined;
|
||||
type?: "google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin" | "apple" | "x" | undefined;
|
||||
allowConnectedAccounts?: boolean | undefined;
|
||||
}> | undefined;
|
||||
} | undefined;
|
||||
}, "oauth"> & {
|
||||
oauth?: (Omit<{
|
||||
accountMergeStrategy?: "link_method" | "raise_error" | "allow_duplicates" | undefined;
|
||||
providers?: Record<string, {
|
||||
allowSignIn?: boolean | undefined;
|
||||
type?: "google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin" | "apple" | "x" | undefined;
|
||||
allowConnectedAccounts?: boolean | undefined;
|
||||
}> | undefined;
|
||||
}, never> & {
|
||||
providers?: Record<string, {
|
||||
allowSignIn?: boolean | undefined;
|
||||
type?: "google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin" | "apple" | "x" | undefined;
|
||||
allowConnectedAccounts?: boolean | undefined;
|
||||
isShared?: boolean | undefined;
|
||||
clientId?: string | undefined;
|
||||
clientSecret?: string | undefined;
|
||||
facebookConfigId?: string | undefined;
|
||||
microsoftTenantId?: string | undefined;
|
||||
}> | undefined;
|
||||
}) | undefined;
|
||||
}) | undefined;
|
||||
emails: Omit<{}, never> & {
|
||||
server: {
|
||||
password?: string | undefined;
|
||||
isShared?: boolean | undefined;
|
||||
host?: string | undefined;
|
||||
port?: number | undefined;
|
||||
username?: string | undefined;
|
||||
senderName?: string | undefined;
|
||||
senderEmail?: string | undefined;
|
||||
};
|
||||
};
|
||||
domains: (Omit<{
|
||||
allowLocalhost?: boolean | undefined;
|
||||
}, "trustedDomains"> & {
|
||||
trustedDomains?: Record<string, {
|
||||
baseUrl?: string | undefined;
|
||||
handlerPath?: string | undefined;
|
||||
}> | undefined;
|
||||
}) | undefined;
|
||||
}, yup.AnyObject, {
|
||||
rbac: {
|
||||
permissions: undefined;
|
||||
defaultPermissions: {
|
||||
teamCreator: undefined;
|
||||
teamMember: undefined;
|
||||
signUp: undefined;
|
||||
};
|
||||
};
|
||||
teams: {
|
||||
createPersonalTeamOnSignUp: undefined;
|
||||
allowClientTeamCreation: undefined;
|
||||
};
|
||||
users: {
|
||||
allowClientUserDeletion: undefined;
|
||||
};
|
||||
apiKeys: {
|
||||
enabled: {
|
||||
team: undefined;
|
||||
user: undefined;
|
||||
};
|
||||
};
|
||||
domains: {
|
||||
rbac: {
|
||||
permissions: undefined;
|
||||
defaultPermissions: {
|
||||
teamCreator: undefined;
|
||||
teamMember: undefined;
|
||||
signUp: undefined;
|
||||
};
|
||||
};
|
||||
teams: {
|
||||
createPersonalTeamOnSignUp: undefined;
|
||||
allowClientTeamCreation: undefined;
|
||||
};
|
||||
users: {
|
||||
allowClientUserDeletion: undefined;
|
||||
};
|
||||
apiKeys: {
|
||||
enabled: {
|
||||
team: undefined;
|
||||
user: undefined;
|
||||
};
|
||||
};
|
||||
domains: {
|
||||
allowLocalhost: undefined;
|
||||
};
|
||||
auth: {
|
||||
allowSignUp: undefined;
|
||||
password: {
|
||||
allowSignIn: undefined;
|
||||
};
|
||||
otp: {
|
||||
allowSignIn: undefined;
|
||||
};
|
||||
passkey: {
|
||||
allowSignIn: undefined;
|
||||
};
|
||||
oauth: {
|
||||
accountMergeStrategy: undefined;
|
||||
providers: undefined;
|
||||
};
|
||||
};
|
||||
emails: {};
|
||||
};
|
||||
auth: {
|
||||
rbac: {
|
||||
permissions: undefined;
|
||||
defaultPermissions: {
|
||||
teamCreator: undefined;
|
||||
teamMember: undefined;
|
||||
signUp: undefined;
|
||||
};
|
||||
};
|
||||
teams: {
|
||||
createPersonalTeamOnSignUp: undefined;
|
||||
allowClientTeamCreation: undefined;
|
||||
};
|
||||
users: {
|
||||
allowClientUserDeletion: undefined;
|
||||
};
|
||||
apiKeys: {
|
||||
enabled: {
|
||||
team: undefined;
|
||||
user: undefined;
|
||||
};
|
||||
};
|
||||
domains: {
|
||||
allowLocalhost: undefined;
|
||||
};
|
||||
auth: {
|
||||
allowSignUp: undefined;
|
||||
password: {
|
||||
allowSignIn: undefined;
|
||||
};
|
||||
otp: {
|
||||
allowSignIn: undefined;
|
||||
};
|
||||
passkey: {
|
||||
allowSignIn: undefined;
|
||||
};
|
||||
oauth: {
|
||||
accountMergeStrategy: undefined;
|
||||
providers: undefined;
|
||||
};
|
||||
};
|
||||
emails: {};
|
||||
};
|
||||
emails: {
|
||||
rbac: {
|
||||
permissions: undefined;
|
||||
defaultPermissions: {
|
||||
teamCreator: undefined;
|
||||
teamMember: undefined;
|
||||
signUp: undefined;
|
||||
};
|
||||
};
|
||||
teams: {
|
||||
createPersonalTeamOnSignUp: undefined;
|
||||
allowClientTeamCreation: undefined;
|
||||
};
|
||||
users: {
|
||||
allowClientUserDeletion: undefined;
|
||||
};
|
||||
apiKeys: {
|
||||
enabled: {
|
||||
team: undefined;
|
||||
user: undefined;
|
||||
};
|
||||
};
|
||||
domains: {
|
||||
allowLocalhost: undefined;
|
||||
};
|
||||
auth: {
|
||||
allowSignUp: undefined;
|
||||
password: {
|
||||
allowSignIn: undefined;
|
||||
};
|
||||
otp: {
|
||||
allowSignIn: undefined;
|
||||
};
|
||||
passkey: {
|
||||
allowSignIn: undefined;
|
||||
};
|
||||
oauth: {
|
||||
accountMergeStrategy: undefined;
|
||||
providers: undefined;
|
||||
};
|
||||
};
|
||||
emails: {};
|
||||
};
|
||||
}, "">;
|
||||
declare const organizationConfigSchema: yup.ObjectSchema<{
|
||||
rbac: {
|
||||
permissions?: Record<string, {
|
||||
description?: string | undefined;
|
||||
scope?: "project" | "team" | undefined;
|
||||
containedPermissionIds?: Record<string, true | undefined> | undefined;
|
||||
} | undefined> | undefined;
|
||||
defaultPermissions?: {
|
||||
teamCreator?: Record<string, true | undefined> | undefined;
|
||||
teamMember?: Record<string, true | undefined> | undefined;
|
||||
signUp?: Record<string, true | undefined> | undefined;
|
||||
} | undefined;
|
||||
} | undefined;
|
||||
teams: {
|
||||
createPersonalTeamOnSignUp?: boolean | undefined;
|
||||
allowClientTeamCreation?: boolean | undefined;
|
||||
} | undefined;
|
||||
users: {
|
||||
allowClientUserDeletion?: boolean | undefined;
|
||||
} | undefined;
|
||||
apiKeys: {
|
||||
enabled?: {
|
||||
team?: boolean | undefined;
|
||||
user?: boolean | undefined;
|
||||
} | undefined;
|
||||
} | undefined;
|
||||
domains: (Omit<{
|
||||
allowLocalhost?: boolean | undefined;
|
||||
}, "trustedDomains"> & {
|
||||
trustedDomains?: Record<string, {
|
||||
baseUrl?: string | undefined;
|
||||
handlerPath?: string | undefined;
|
||||
}> | undefined;
|
||||
}) | undefined;
|
||||
auth: (Omit<{
|
||||
allowSignUp?: boolean | undefined;
|
||||
password?: {
|
||||
allowSignIn?: boolean | undefined;
|
||||
} | undefined;
|
||||
otp?: {
|
||||
allowSignIn?: boolean | undefined;
|
||||
} | undefined;
|
||||
passkey?: {
|
||||
allowSignIn?: boolean | undefined;
|
||||
} | undefined;
|
||||
oauth?: {
|
||||
accountMergeStrategy?: "link_method" | "raise_error" | "allow_duplicates" | undefined;
|
||||
providers?: Record<string, {
|
||||
allowSignIn?: boolean | undefined;
|
||||
type?: "google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin" | "apple" | "x" | undefined;
|
||||
allowConnectedAccounts?: boolean | undefined;
|
||||
}> | undefined;
|
||||
} | undefined;
|
||||
}, "oauth"> & {
|
||||
oauth?: (Omit<{
|
||||
accountMergeStrategy?: "link_method" | "raise_error" | "allow_duplicates" | undefined;
|
||||
providers?: Record<string, {
|
||||
allowSignIn?: boolean | undefined;
|
||||
type?: "google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin" | "apple" | "x" | undefined;
|
||||
allowConnectedAccounts?: boolean | undefined;
|
||||
}> | undefined;
|
||||
}, never> & {
|
||||
providers?: Record<string, {
|
||||
allowSignIn?: boolean | undefined;
|
||||
type?: "google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin" | "apple" | "x" | undefined;
|
||||
allowConnectedAccounts?: boolean | undefined;
|
||||
isShared?: boolean | undefined;
|
||||
clientId?: string | undefined;
|
||||
clientSecret?: string | undefined;
|
||||
facebookConfigId?: string | undefined;
|
||||
microsoftTenantId?: string | undefined;
|
||||
}> | undefined;
|
||||
}) | undefined;
|
||||
}) | undefined;
|
||||
emails: Omit<{}, never> & {
|
||||
server: {
|
||||
password?: string | undefined;
|
||||
isShared?: boolean | undefined;
|
||||
host?: string | undefined;
|
||||
port?: number | undefined;
|
||||
username?: string | undefined;
|
||||
senderName?: string | undefined;
|
||||
senderEmail?: string | undefined;
|
||||
};
|
||||
};
|
||||
} & {}, yup.AnyObject, {
|
||||
rbac: {
|
||||
permissions: undefined;
|
||||
defaultPermissions: {
|
||||
teamCreator: undefined;
|
||||
teamMember: undefined;
|
||||
signUp: undefined;
|
||||
};
|
||||
};
|
||||
teams: {
|
||||
createPersonalTeamOnSignUp: undefined;
|
||||
allowClientTeamCreation: undefined;
|
||||
};
|
||||
users: {
|
||||
allowClientUserDeletion: undefined;
|
||||
};
|
||||
apiKeys: {
|
||||
enabled: {
|
||||
team: undefined;
|
||||
user: undefined;
|
||||
};
|
||||
};
|
||||
domains: {
|
||||
rbac: {
|
||||
permissions: undefined;
|
||||
defaultPermissions: {
|
||||
teamCreator: undefined;
|
||||
teamMember: undefined;
|
||||
signUp: undefined;
|
||||
};
|
||||
};
|
||||
teams: {
|
||||
createPersonalTeamOnSignUp: undefined;
|
||||
allowClientTeamCreation: undefined;
|
||||
};
|
||||
users: {
|
||||
allowClientUserDeletion: undefined;
|
||||
};
|
||||
apiKeys: {
|
||||
enabled: {
|
||||
team: undefined;
|
||||
user: undefined;
|
||||
};
|
||||
};
|
||||
domains: {
|
||||
allowLocalhost: undefined;
|
||||
};
|
||||
auth: {
|
||||
allowSignUp: undefined;
|
||||
password: {
|
||||
allowSignIn: undefined;
|
||||
};
|
||||
otp: {
|
||||
allowSignIn: undefined;
|
||||
};
|
||||
passkey: {
|
||||
allowSignIn: undefined;
|
||||
};
|
||||
oauth: {
|
||||
accountMergeStrategy: undefined;
|
||||
providers: undefined;
|
||||
};
|
||||
};
|
||||
emails: {};
|
||||
};
|
||||
auth: {
|
||||
rbac: {
|
||||
permissions: undefined;
|
||||
defaultPermissions: {
|
||||
teamCreator: undefined;
|
||||
teamMember: undefined;
|
||||
signUp: undefined;
|
||||
};
|
||||
};
|
||||
teams: {
|
||||
createPersonalTeamOnSignUp: undefined;
|
||||
allowClientTeamCreation: undefined;
|
||||
};
|
||||
users: {
|
||||
allowClientUserDeletion: undefined;
|
||||
};
|
||||
apiKeys: {
|
||||
enabled: {
|
||||
team: undefined;
|
||||
user: undefined;
|
||||
};
|
||||
};
|
||||
domains: {
|
||||
allowLocalhost: undefined;
|
||||
};
|
||||
auth: {
|
||||
allowSignUp: undefined;
|
||||
password: {
|
||||
allowSignIn: undefined;
|
||||
};
|
||||
otp: {
|
||||
allowSignIn: undefined;
|
||||
};
|
||||
passkey: {
|
||||
allowSignIn: undefined;
|
||||
};
|
||||
oauth: {
|
||||
accountMergeStrategy: undefined;
|
||||
providers: undefined;
|
||||
};
|
||||
};
|
||||
emails: {};
|
||||
};
|
||||
emails: {
|
||||
rbac: {
|
||||
permissions: undefined;
|
||||
defaultPermissions: {
|
||||
teamCreator: undefined;
|
||||
teamMember: undefined;
|
||||
signUp: undefined;
|
||||
};
|
||||
};
|
||||
teams: {
|
||||
createPersonalTeamOnSignUp: undefined;
|
||||
allowClientTeamCreation: undefined;
|
||||
};
|
||||
users: {
|
||||
allowClientUserDeletion: undefined;
|
||||
};
|
||||
apiKeys: {
|
||||
enabled: {
|
||||
team: undefined;
|
||||
user: undefined;
|
||||
};
|
||||
};
|
||||
domains: {
|
||||
allowLocalhost: undefined;
|
||||
};
|
||||
auth: {
|
||||
allowSignUp: undefined;
|
||||
password: {
|
||||
allowSignIn: undefined;
|
||||
};
|
||||
otp: {
|
||||
allowSignIn: undefined;
|
||||
};
|
||||
passkey: {
|
||||
allowSignIn: undefined;
|
||||
};
|
||||
oauth: {
|
||||
accountMergeStrategy: undefined;
|
||||
providers: undefined;
|
||||
};
|
||||
};
|
||||
emails: {};
|
||||
};
|
||||
}, "">;
|
||||
declare const projectConfigDefaults: {};
|
||||
declare const branchConfigDefaults: {};
|
||||
declare const environmentConfigDefaults: {};
|
||||
declare const organizationConfigDefaults: {
|
||||
rbac: {
|
||||
permissions: (key: string) => {};
|
||||
defaultPermissions: {
|
||||
teamCreator: {};
|
||||
teamMember: {};
|
||||
signUp: {};
|
||||
};
|
||||
};
|
||||
apiKeys: {
|
||||
enabled: {
|
||||
team: false;
|
||||
user: false;
|
||||
};
|
||||
};
|
||||
teams: {
|
||||
createPersonalTeamOnSignUp: false;
|
||||
allowClientTeamCreation: false;
|
||||
};
|
||||
users: {
|
||||
allowClientUserDeletion: false;
|
||||
};
|
||||
domains: {
|
||||
allowLocalhost: false;
|
||||
trustedDomains: (key: string) => {
|
||||
handlerPath: string;
|
||||
};
|
||||
};
|
||||
auth: {
|
||||
allowSignUp: true;
|
||||
password: {
|
||||
allowSignIn: false;
|
||||
};
|
||||
otp: {
|
||||
allowSignIn: false;
|
||||
};
|
||||
passkey: {
|
||||
allowSignIn: false;
|
||||
};
|
||||
oauth: {
|
||||
accountMergeStrategy: "link_method";
|
||||
providers: (key: string) => {
|
||||
isShared: true;
|
||||
allowSignIn: false;
|
||||
allowConnectedAccounts: false;
|
||||
};
|
||||
};
|
||||
};
|
||||
emails: {
|
||||
server: {
|
||||
isShared: true;
|
||||
};
|
||||
};
|
||||
};
|
||||
type DeepReplaceAllowFunctionsForObjects<T> = T extends object ? {
|
||||
[K in keyof T]: DeepReplaceAllowFunctionsForObjects<T[K]>;
|
||||
} | ((arg: keyof T) => DeepReplaceAllowFunctionsForObjects<T[keyof T]>) : T;
|
||||
type DeepReplaceFunctionsWithObjects<T> = T extends (arg: infer K extends string) => infer R ? DeepReplaceFunctionsWithObjects<Record<K, R>> : (T extends object ? {
|
||||
[K in keyof T]: DeepReplaceFunctionsWithObjects<T[K]>;
|
||||
} : T);
|
||||
type ApplyDefaults<D extends object | ((key: string) => unknown), C extends object> = DeepMerge<DeepReplaceFunctionsWithObjects<D>, C>;
|
||||
declare function applyDefaults<D extends object | ((key: string) => unknown), C extends object>(defaults: D, config: C): ApplyDefaults<D, C>;
|
||||
type ProjectConfigNormalizedOverride = yup.InferType<typeof projectConfigSchema>;
|
||||
type BranchConfigNormalizedOverride = yup.InferType<typeof branchConfigSchema>;
|
||||
type EnvironmentConfigNormalizedOverride = yup.InferType<typeof environmentConfigSchema>;
|
||||
type OrganizationConfigNormalizedOverride = yup.InferType<typeof organizationConfigSchema>;
|
||||
type ProjectConfigStrippedNormalizedOverride = Omit<ProjectConfigNormalizedOverride, keyof BranchConfigNormalizedOverride | keyof EnvironmentConfigNormalizedOverride | keyof OrganizationConfigNormalizedOverride>;
|
||||
type BranchConfigStrippedNormalizedOverride = Omit<BranchConfigNormalizedOverride, keyof EnvironmentConfigNormalizedOverride | keyof OrganizationConfigNormalizedOverride>;
|
||||
type EnvironmentConfigStrippedNormalizedOverride = Omit<EnvironmentConfigNormalizedOverride, keyof OrganizationConfigNormalizedOverride>;
|
||||
type OrganizationConfigStrippedNormalizedOverride = OrganizationConfigNormalizedOverride;
|
||||
type ProjectConfigOverride = NormalizesTo<ProjectConfigNormalizedOverride>;
|
||||
type BranchConfigOverride = NormalizesTo<BranchConfigNormalizedOverride>;
|
||||
type EnvironmentConfigOverride = NormalizesTo<EnvironmentConfigNormalizedOverride>;
|
||||
type OrganizationConfigOverride = NormalizesTo<OrganizationConfigNormalizedOverride>;
|
||||
type ProjectConfigOverrideOverride = Config & DeepPartial<ProjectConfigOverride>;
|
||||
type BranchConfigOverrideOverride = Config & DeepPartial<BranchConfigOverride>;
|
||||
type EnvironmentConfigOverrideOverride = Config & DeepPartial<EnvironmentConfigOverride>;
|
||||
type OrganizationConfigOverrideOverride = Config & DeepPartial<OrganizationConfigOverride>;
|
||||
type ProjectIncompleteConfig = ProjectConfigNormalizedOverride;
|
||||
type BranchIncompleteConfig = ProjectIncompleteConfig & BranchConfigNormalizedOverride;
|
||||
type EnvironmentIncompleteConfig = BranchIncompleteConfig & EnvironmentConfigNormalizedOverride;
|
||||
type OrganizationIncompleteConfig = EnvironmentIncompleteConfig & OrganizationConfigNormalizedOverride;
|
||||
type ProjectRenderedConfig = PrettifyType<ApplyDefaults<typeof projectConfigDefaults, ProjectConfigStrippedNormalizedOverride>>;
|
||||
type BranchRenderedConfig = PrettifyType<ProjectRenderedConfig & ApplyDefaults<typeof branchConfigDefaults, BranchConfigStrippedNormalizedOverride>>;
|
||||
type EnvironmentRenderedConfig = PrettifyType<BranchRenderedConfig & ApplyDefaults<typeof environmentConfigDefaults, EnvironmentConfigStrippedNormalizedOverride>>;
|
||||
type OrganizationRenderedConfig = PrettifyType<EnvironmentRenderedConfig & ApplyDefaults<typeof organizationConfigDefaults, OrganizationConfigStrippedNormalizedOverride>>;
|
||||
|
||||
export { type ApplyDefaults, type BranchConfigNormalizedOverride, type BranchConfigOverride, type BranchConfigOverrideOverride, type BranchConfigStrippedNormalizedOverride, type BranchIncompleteConfig, type BranchRenderedConfig, type ConfigLevel, type DeepReplaceAllowFunctionsForObjects, type DeepReplaceFunctionsWithObjects, type EnvironmentConfigNormalizedOverride, type EnvironmentConfigOverride, type EnvironmentConfigOverrideOverride, type EnvironmentConfigStrippedNormalizedOverride, type EnvironmentIncompleteConfig, type EnvironmentRenderedConfig, type OrganizationConfigNormalizedOverride, type OrganizationConfigOverride, type OrganizationConfigOverrideOverride, type OrganizationConfigStrippedNormalizedOverride, type OrganizationIncompleteConfig, type OrganizationRenderedConfig, type ProjectConfigNormalizedOverride, type ProjectConfigOverride, type ProjectConfigOverrideOverride, type ProjectConfigStrippedNormalizedOverride, type ProjectIncompleteConfig, type ProjectRenderedConfig, applyDefaults, branchConfigDefaults, branchConfigSchema, configLevels, environmentConfigDefaults, environmentConfigSchema, organizationConfigDefaults, organizationConfigSchema, projectConfigDefaults, projectConfigSchema };
|
||||
729
package/@stackframe/stack-shared/dist/config/schema.d.ts
vendored
Normal file
729
package/@stackframe/stack-shared/dist/config/schema.d.ts
vendored
Normal file
|
|
@ -0,0 +1,729 @@
|
|||
import * as yup from 'yup';
|
||||
import { DeepMerge, DeepPartial } from '../utils/objects.js';
|
||||
import { PrettifyType } from '../utils/types.js';
|
||||
import { NormalizesTo, Config } from './format.js';
|
||||
|
||||
declare const configLevels: readonly ["project", "branch", "environment", "organization"];
|
||||
type ConfigLevel = typeof configLevels[number];
|
||||
/**
|
||||
* All fields that can be overridden at this level.
|
||||
*/
|
||||
declare const projectConfigSchema: yup.ObjectSchema<{}, yup.AnyObject, {}, "">;
|
||||
declare const branchConfigSchema: yup.ObjectSchema<{} & {
|
||||
rbac: {
|
||||
permissions?: Record<string, {
|
||||
description?: string | undefined;
|
||||
scope?: "project" | "team" | undefined;
|
||||
containedPermissionIds?: Record<string, true | undefined> | undefined;
|
||||
} | undefined> | undefined;
|
||||
defaultPermissions?: {
|
||||
teamCreator?: Record<string, true | undefined> | undefined;
|
||||
teamMember?: Record<string, true | undefined> | undefined;
|
||||
signUp?: Record<string, true | undefined> | undefined;
|
||||
} | undefined;
|
||||
} | undefined;
|
||||
teams: {
|
||||
createPersonalTeamOnSignUp?: boolean | undefined;
|
||||
allowClientTeamCreation?: boolean | undefined;
|
||||
} | undefined;
|
||||
users: {
|
||||
allowClientUserDeletion?: boolean | undefined;
|
||||
} | undefined;
|
||||
apiKeys: {
|
||||
enabled?: {
|
||||
team?: boolean | undefined;
|
||||
user?: boolean | undefined;
|
||||
} | undefined;
|
||||
} | undefined;
|
||||
domains: {
|
||||
allowLocalhost?: boolean | undefined;
|
||||
} | undefined;
|
||||
auth: {
|
||||
allowSignUp?: boolean | undefined;
|
||||
password?: {
|
||||
allowSignIn?: boolean | undefined;
|
||||
} | undefined;
|
||||
otp?: {
|
||||
allowSignIn?: boolean | undefined;
|
||||
} | undefined;
|
||||
passkey?: {
|
||||
allowSignIn?: boolean | undefined;
|
||||
} | undefined;
|
||||
oauth?: {
|
||||
accountMergeStrategy?: "link_method" | "raise_error" | "allow_duplicates" | undefined;
|
||||
providers?: Record<string, {
|
||||
allowSignIn?: boolean | undefined;
|
||||
type?: "google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin" | "apple" | "x" | undefined;
|
||||
allowConnectedAccounts?: boolean | undefined;
|
||||
}> | undefined;
|
||||
} | undefined;
|
||||
} | undefined;
|
||||
emails: {};
|
||||
}, yup.AnyObject, {
|
||||
rbac: {
|
||||
permissions: undefined;
|
||||
defaultPermissions: {
|
||||
teamCreator: undefined;
|
||||
teamMember: undefined;
|
||||
signUp: undefined;
|
||||
};
|
||||
};
|
||||
teams: {
|
||||
createPersonalTeamOnSignUp: undefined;
|
||||
allowClientTeamCreation: undefined;
|
||||
};
|
||||
users: {
|
||||
allowClientUserDeletion: undefined;
|
||||
};
|
||||
apiKeys: {
|
||||
enabled: {
|
||||
team: undefined;
|
||||
user: undefined;
|
||||
};
|
||||
};
|
||||
domains: {
|
||||
allowLocalhost: undefined;
|
||||
};
|
||||
auth: {
|
||||
allowSignUp: undefined;
|
||||
password: {
|
||||
allowSignIn: undefined;
|
||||
};
|
||||
otp: {
|
||||
allowSignIn: undefined;
|
||||
};
|
||||
passkey: {
|
||||
allowSignIn: undefined;
|
||||
};
|
||||
oauth: {
|
||||
accountMergeStrategy: undefined;
|
||||
providers: undefined;
|
||||
};
|
||||
};
|
||||
emails: {};
|
||||
}, "">;
|
||||
declare const environmentConfigSchema: yup.ObjectSchema<{
|
||||
rbac: {
|
||||
permissions?: Record<string, {
|
||||
description?: string | undefined;
|
||||
scope?: "project" | "team" | undefined;
|
||||
containedPermissionIds?: Record<string, true | undefined> | undefined;
|
||||
} | undefined> | undefined;
|
||||
defaultPermissions?: {
|
||||
teamCreator?: Record<string, true | undefined> | undefined;
|
||||
teamMember?: Record<string, true | undefined> | undefined;
|
||||
signUp?: Record<string, true | undefined> | undefined;
|
||||
} | undefined;
|
||||
} | undefined;
|
||||
teams: {
|
||||
createPersonalTeamOnSignUp?: boolean | undefined;
|
||||
allowClientTeamCreation?: boolean | undefined;
|
||||
} | undefined;
|
||||
users: {
|
||||
allowClientUserDeletion?: boolean | undefined;
|
||||
} | undefined;
|
||||
apiKeys: {
|
||||
enabled?: {
|
||||
team?: boolean | undefined;
|
||||
user?: boolean | undefined;
|
||||
} | undefined;
|
||||
} | undefined;
|
||||
domains: (Omit<{
|
||||
allowLocalhost?: boolean | undefined;
|
||||
}, "trustedDomains"> & {
|
||||
trustedDomains?: Record<string, {
|
||||
baseUrl?: string | undefined;
|
||||
handlerPath?: string | undefined;
|
||||
}> | undefined;
|
||||
}) | undefined;
|
||||
auth: (Omit<{
|
||||
allowSignUp?: boolean | undefined;
|
||||
password?: {
|
||||
allowSignIn?: boolean | undefined;
|
||||
} | undefined;
|
||||
otp?: {
|
||||
allowSignIn?: boolean | undefined;
|
||||
} | undefined;
|
||||
passkey?: {
|
||||
allowSignIn?: boolean | undefined;
|
||||
} | undefined;
|
||||
oauth?: {
|
||||
accountMergeStrategy?: "link_method" | "raise_error" | "allow_duplicates" | undefined;
|
||||
providers?: Record<string, {
|
||||
allowSignIn?: boolean | undefined;
|
||||
type?: "google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin" | "apple" | "x" | undefined;
|
||||
allowConnectedAccounts?: boolean | undefined;
|
||||
}> | undefined;
|
||||
} | undefined;
|
||||
}, "oauth"> & {
|
||||
oauth?: (Omit<{
|
||||
accountMergeStrategy?: "link_method" | "raise_error" | "allow_duplicates" | undefined;
|
||||
providers?: Record<string, {
|
||||
allowSignIn?: boolean | undefined;
|
||||
type?: "google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin" | "apple" | "x" | undefined;
|
||||
allowConnectedAccounts?: boolean | undefined;
|
||||
}> | undefined;
|
||||
}, never> & {
|
||||
providers?: Record<string, {
|
||||
allowSignIn?: boolean | undefined;
|
||||
type?: "google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin" | "apple" | "x" | undefined;
|
||||
allowConnectedAccounts?: boolean | undefined;
|
||||
isShared?: boolean | undefined;
|
||||
clientId?: string | undefined;
|
||||
clientSecret?: string | undefined;
|
||||
facebookConfigId?: string | undefined;
|
||||
microsoftTenantId?: string | undefined;
|
||||
}> | undefined;
|
||||
}) | undefined;
|
||||
}) | undefined;
|
||||
emails: Omit<{}, never> & {
|
||||
server: {
|
||||
password?: string | undefined;
|
||||
isShared?: boolean | undefined;
|
||||
host?: string | undefined;
|
||||
port?: number | undefined;
|
||||
username?: string | undefined;
|
||||
senderName?: string | undefined;
|
||||
senderEmail?: string | undefined;
|
||||
};
|
||||
};
|
||||
} & {
|
||||
auth: (Omit<{
|
||||
allowSignUp?: boolean | undefined;
|
||||
password?: {
|
||||
allowSignIn?: boolean | undefined;
|
||||
} | undefined;
|
||||
otp?: {
|
||||
allowSignIn?: boolean | undefined;
|
||||
} | undefined;
|
||||
passkey?: {
|
||||
allowSignIn?: boolean | undefined;
|
||||
} | undefined;
|
||||
oauth?: {
|
||||
accountMergeStrategy?: "link_method" | "raise_error" | "allow_duplicates" | undefined;
|
||||
providers?: Record<string, {
|
||||
allowSignIn?: boolean | undefined;
|
||||
type?: "google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin" | "apple" | "x" | undefined;
|
||||
allowConnectedAccounts?: boolean | undefined;
|
||||
}> | undefined;
|
||||
} | undefined;
|
||||
}, "oauth"> & {
|
||||
oauth?: (Omit<{
|
||||
accountMergeStrategy?: "link_method" | "raise_error" | "allow_duplicates" | undefined;
|
||||
providers?: Record<string, {
|
||||
allowSignIn?: boolean | undefined;
|
||||
type?: "google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin" | "apple" | "x" | undefined;
|
||||
allowConnectedAccounts?: boolean | undefined;
|
||||
}> | undefined;
|
||||
}, never> & {
|
||||
providers?: Record<string, {
|
||||
allowSignIn?: boolean | undefined;
|
||||
type?: "google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin" | "apple" | "x" | undefined;
|
||||
allowConnectedAccounts?: boolean | undefined;
|
||||
isShared?: boolean | undefined;
|
||||
clientId?: string | undefined;
|
||||
clientSecret?: string | undefined;
|
||||
facebookConfigId?: string | undefined;
|
||||
microsoftTenantId?: string | undefined;
|
||||
}> | undefined;
|
||||
}) | undefined;
|
||||
}) | undefined;
|
||||
emails: Omit<{}, never> & {
|
||||
server: {
|
||||
password?: string | undefined;
|
||||
isShared?: boolean | undefined;
|
||||
host?: string | undefined;
|
||||
port?: number | undefined;
|
||||
username?: string | undefined;
|
||||
senderName?: string | undefined;
|
||||
senderEmail?: string | undefined;
|
||||
};
|
||||
};
|
||||
domains: (Omit<{
|
||||
allowLocalhost?: boolean | undefined;
|
||||
}, "trustedDomains"> & {
|
||||
trustedDomains?: Record<string, {
|
||||
baseUrl?: string | undefined;
|
||||
handlerPath?: string | undefined;
|
||||
}> | undefined;
|
||||
}) | undefined;
|
||||
}, yup.AnyObject, {
|
||||
rbac: {
|
||||
permissions: undefined;
|
||||
defaultPermissions: {
|
||||
teamCreator: undefined;
|
||||
teamMember: undefined;
|
||||
signUp: undefined;
|
||||
};
|
||||
};
|
||||
teams: {
|
||||
createPersonalTeamOnSignUp: undefined;
|
||||
allowClientTeamCreation: undefined;
|
||||
};
|
||||
users: {
|
||||
allowClientUserDeletion: undefined;
|
||||
};
|
||||
apiKeys: {
|
||||
enabled: {
|
||||
team: undefined;
|
||||
user: undefined;
|
||||
};
|
||||
};
|
||||
domains: {
|
||||
rbac: {
|
||||
permissions: undefined;
|
||||
defaultPermissions: {
|
||||
teamCreator: undefined;
|
||||
teamMember: undefined;
|
||||
signUp: undefined;
|
||||
};
|
||||
};
|
||||
teams: {
|
||||
createPersonalTeamOnSignUp: undefined;
|
||||
allowClientTeamCreation: undefined;
|
||||
};
|
||||
users: {
|
||||
allowClientUserDeletion: undefined;
|
||||
};
|
||||
apiKeys: {
|
||||
enabled: {
|
||||
team: undefined;
|
||||
user: undefined;
|
||||
};
|
||||
};
|
||||
domains: {
|
||||
allowLocalhost: undefined;
|
||||
};
|
||||
auth: {
|
||||
allowSignUp: undefined;
|
||||
password: {
|
||||
allowSignIn: undefined;
|
||||
};
|
||||
otp: {
|
||||
allowSignIn: undefined;
|
||||
};
|
||||
passkey: {
|
||||
allowSignIn: undefined;
|
||||
};
|
||||
oauth: {
|
||||
accountMergeStrategy: undefined;
|
||||
providers: undefined;
|
||||
};
|
||||
};
|
||||
emails: {};
|
||||
};
|
||||
auth: {
|
||||
rbac: {
|
||||
permissions: undefined;
|
||||
defaultPermissions: {
|
||||
teamCreator: undefined;
|
||||
teamMember: undefined;
|
||||
signUp: undefined;
|
||||
};
|
||||
};
|
||||
teams: {
|
||||
createPersonalTeamOnSignUp: undefined;
|
||||
allowClientTeamCreation: undefined;
|
||||
};
|
||||
users: {
|
||||
allowClientUserDeletion: undefined;
|
||||
};
|
||||
apiKeys: {
|
||||
enabled: {
|
||||
team: undefined;
|
||||
user: undefined;
|
||||
};
|
||||
};
|
||||
domains: {
|
||||
allowLocalhost: undefined;
|
||||
};
|
||||
auth: {
|
||||
allowSignUp: undefined;
|
||||
password: {
|
||||
allowSignIn: undefined;
|
||||
};
|
||||
otp: {
|
||||
allowSignIn: undefined;
|
||||
};
|
||||
passkey: {
|
||||
allowSignIn: undefined;
|
||||
};
|
||||
oauth: {
|
||||
accountMergeStrategy: undefined;
|
||||
providers: undefined;
|
||||
};
|
||||
};
|
||||
emails: {};
|
||||
};
|
||||
emails: {
|
||||
rbac: {
|
||||
permissions: undefined;
|
||||
defaultPermissions: {
|
||||
teamCreator: undefined;
|
||||
teamMember: undefined;
|
||||
signUp: undefined;
|
||||
};
|
||||
};
|
||||
teams: {
|
||||
createPersonalTeamOnSignUp: undefined;
|
||||
allowClientTeamCreation: undefined;
|
||||
};
|
||||
users: {
|
||||
allowClientUserDeletion: undefined;
|
||||
};
|
||||
apiKeys: {
|
||||
enabled: {
|
||||
team: undefined;
|
||||
user: undefined;
|
||||
};
|
||||
};
|
||||
domains: {
|
||||
allowLocalhost: undefined;
|
||||
};
|
||||
auth: {
|
||||
allowSignUp: undefined;
|
||||
password: {
|
||||
allowSignIn: undefined;
|
||||
};
|
||||
otp: {
|
||||
allowSignIn: undefined;
|
||||
};
|
||||
passkey: {
|
||||
allowSignIn: undefined;
|
||||
};
|
||||
oauth: {
|
||||
accountMergeStrategy: undefined;
|
||||
providers: undefined;
|
||||
};
|
||||
};
|
||||
emails: {};
|
||||
};
|
||||
}, "">;
|
||||
declare const organizationConfigSchema: yup.ObjectSchema<{
|
||||
rbac: {
|
||||
permissions?: Record<string, {
|
||||
description?: string | undefined;
|
||||
scope?: "project" | "team" | undefined;
|
||||
containedPermissionIds?: Record<string, true | undefined> | undefined;
|
||||
} | undefined> | undefined;
|
||||
defaultPermissions?: {
|
||||
teamCreator?: Record<string, true | undefined> | undefined;
|
||||
teamMember?: Record<string, true | undefined> | undefined;
|
||||
signUp?: Record<string, true | undefined> | undefined;
|
||||
} | undefined;
|
||||
} | undefined;
|
||||
teams: {
|
||||
createPersonalTeamOnSignUp?: boolean | undefined;
|
||||
allowClientTeamCreation?: boolean | undefined;
|
||||
} | undefined;
|
||||
users: {
|
||||
allowClientUserDeletion?: boolean | undefined;
|
||||
} | undefined;
|
||||
apiKeys: {
|
||||
enabled?: {
|
||||
team?: boolean | undefined;
|
||||
user?: boolean | undefined;
|
||||
} | undefined;
|
||||
} | undefined;
|
||||
domains: (Omit<{
|
||||
allowLocalhost?: boolean | undefined;
|
||||
}, "trustedDomains"> & {
|
||||
trustedDomains?: Record<string, {
|
||||
baseUrl?: string | undefined;
|
||||
handlerPath?: string | undefined;
|
||||
}> | undefined;
|
||||
}) | undefined;
|
||||
auth: (Omit<{
|
||||
allowSignUp?: boolean | undefined;
|
||||
password?: {
|
||||
allowSignIn?: boolean | undefined;
|
||||
} | undefined;
|
||||
otp?: {
|
||||
allowSignIn?: boolean | undefined;
|
||||
} | undefined;
|
||||
passkey?: {
|
||||
allowSignIn?: boolean | undefined;
|
||||
} | undefined;
|
||||
oauth?: {
|
||||
accountMergeStrategy?: "link_method" | "raise_error" | "allow_duplicates" | undefined;
|
||||
providers?: Record<string, {
|
||||
allowSignIn?: boolean | undefined;
|
||||
type?: "google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin" | "apple" | "x" | undefined;
|
||||
allowConnectedAccounts?: boolean | undefined;
|
||||
}> | undefined;
|
||||
} | undefined;
|
||||
}, "oauth"> & {
|
||||
oauth?: (Omit<{
|
||||
accountMergeStrategy?: "link_method" | "raise_error" | "allow_duplicates" | undefined;
|
||||
providers?: Record<string, {
|
||||
allowSignIn?: boolean | undefined;
|
||||
type?: "google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin" | "apple" | "x" | undefined;
|
||||
allowConnectedAccounts?: boolean | undefined;
|
||||
}> | undefined;
|
||||
}, never> & {
|
||||
providers?: Record<string, {
|
||||
allowSignIn?: boolean | undefined;
|
||||
type?: "google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin" | "apple" | "x" | undefined;
|
||||
allowConnectedAccounts?: boolean | undefined;
|
||||
isShared?: boolean | undefined;
|
||||
clientId?: string | undefined;
|
||||
clientSecret?: string | undefined;
|
||||
facebookConfigId?: string | undefined;
|
||||
microsoftTenantId?: string | undefined;
|
||||
}> | undefined;
|
||||
}) | undefined;
|
||||
}) | undefined;
|
||||
emails: Omit<{}, never> & {
|
||||
server: {
|
||||
password?: string | undefined;
|
||||
isShared?: boolean | undefined;
|
||||
host?: string | undefined;
|
||||
port?: number | undefined;
|
||||
username?: string | undefined;
|
||||
senderName?: string | undefined;
|
||||
senderEmail?: string | undefined;
|
||||
};
|
||||
};
|
||||
} & {}, yup.AnyObject, {
|
||||
rbac: {
|
||||
permissions: undefined;
|
||||
defaultPermissions: {
|
||||
teamCreator: undefined;
|
||||
teamMember: undefined;
|
||||
signUp: undefined;
|
||||
};
|
||||
};
|
||||
teams: {
|
||||
createPersonalTeamOnSignUp: undefined;
|
||||
allowClientTeamCreation: undefined;
|
||||
};
|
||||
users: {
|
||||
allowClientUserDeletion: undefined;
|
||||
};
|
||||
apiKeys: {
|
||||
enabled: {
|
||||
team: undefined;
|
||||
user: undefined;
|
||||
};
|
||||
};
|
||||
domains: {
|
||||
rbac: {
|
||||
permissions: undefined;
|
||||
defaultPermissions: {
|
||||
teamCreator: undefined;
|
||||
teamMember: undefined;
|
||||
signUp: undefined;
|
||||
};
|
||||
};
|
||||
teams: {
|
||||
createPersonalTeamOnSignUp: undefined;
|
||||
allowClientTeamCreation: undefined;
|
||||
};
|
||||
users: {
|
||||
allowClientUserDeletion: undefined;
|
||||
};
|
||||
apiKeys: {
|
||||
enabled: {
|
||||
team: undefined;
|
||||
user: undefined;
|
||||
};
|
||||
};
|
||||
domains: {
|
||||
allowLocalhost: undefined;
|
||||
};
|
||||
auth: {
|
||||
allowSignUp: undefined;
|
||||
password: {
|
||||
allowSignIn: undefined;
|
||||
};
|
||||
otp: {
|
||||
allowSignIn: undefined;
|
||||
};
|
||||
passkey: {
|
||||
allowSignIn: undefined;
|
||||
};
|
||||
oauth: {
|
||||
accountMergeStrategy: undefined;
|
||||
providers: undefined;
|
||||
};
|
||||
};
|
||||
emails: {};
|
||||
};
|
||||
auth: {
|
||||
rbac: {
|
||||
permissions: undefined;
|
||||
defaultPermissions: {
|
||||
teamCreator: undefined;
|
||||
teamMember: undefined;
|
||||
signUp: undefined;
|
||||
};
|
||||
};
|
||||
teams: {
|
||||
createPersonalTeamOnSignUp: undefined;
|
||||
allowClientTeamCreation: undefined;
|
||||
};
|
||||
users: {
|
||||
allowClientUserDeletion: undefined;
|
||||
};
|
||||
apiKeys: {
|
||||
enabled: {
|
||||
team: undefined;
|
||||
user: undefined;
|
||||
};
|
||||
};
|
||||
domains: {
|
||||
allowLocalhost: undefined;
|
||||
};
|
||||
auth: {
|
||||
allowSignUp: undefined;
|
||||
password: {
|
||||
allowSignIn: undefined;
|
||||
};
|
||||
otp: {
|
||||
allowSignIn: undefined;
|
||||
};
|
||||
passkey: {
|
||||
allowSignIn: undefined;
|
||||
};
|
||||
oauth: {
|
||||
accountMergeStrategy: undefined;
|
||||
providers: undefined;
|
||||
};
|
||||
};
|
||||
emails: {};
|
||||
};
|
||||
emails: {
|
||||
rbac: {
|
||||
permissions: undefined;
|
||||
defaultPermissions: {
|
||||
teamCreator: undefined;
|
||||
teamMember: undefined;
|
||||
signUp: undefined;
|
||||
};
|
||||
};
|
||||
teams: {
|
||||
createPersonalTeamOnSignUp: undefined;
|
||||
allowClientTeamCreation: undefined;
|
||||
};
|
||||
users: {
|
||||
allowClientUserDeletion: undefined;
|
||||
};
|
||||
apiKeys: {
|
||||
enabled: {
|
||||
team: undefined;
|
||||
user: undefined;
|
||||
};
|
||||
};
|
||||
domains: {
|
||||
allowLocalhost: undefined;
|
||||
};
|
||||
auth: {
|
||||
allowSignUp: undefined;
|
||||
password: {
|
||||
allowSignIn: undefined;
|
||||
};
|
||||
otp: {
|
||||
allowSignIn: undefined;
|
||||
};
|
||||
passkey: {
|
||||
allowSignIn: undefined;
|
||||
};
|
||||
oauth: {
|
||||
accountMergeStrategy: undefined;
|
||||
providers: undefined;
|
||||
};
|
||||
};
|
||||
emails: {};
|
||||
};
|
||||
}, "">;
|
||||
declare const projectConfigDefaults: {};
|
||||
declare const branchConfigDefaults: {};
|
||||
declare const environmentConfigDefaults: {};
|
||||
declare const organizationConfigDefaults: {
|
||||
rbac: {
|
||||
permissions: (key: string) => {};
|
||||
defaultPermissions: {
|
||||
teamCreator: {};
|
||||
teamMember: {};
|
||||
signUp: {};
|
||||
};
|
||||
};
|
||||
apiKeys: {
|
||||
enabled: {
|
||||
team: false;
|
||||
user: false;
|
||||
};
|
||||
};
|
||||
teams: {
|
||||
createPersonalTeamOnSignUp: false;
|
||||
allowClientTeamCreation: false;
|
||||
};
|
||||
users: {
|
||||
allowClientUserDeletion: false;
|
||||
};
|
||||
domains: {
|
||||
allowLocalhost: false;
|
||||
trustedDomains: (key: string) => {
|
||||
handlerPath: string;
|
||||
};
|
||||
};
|
||||
auth: {
|
||||
allowSignUp: true;
|
||||
password: {
|
||||
allowSignIn: false;
|
||||
};
|
||||
otp: {
|
||||
allowSignIn: false;
|
||||
};
|
||||
passkey: {
|
||||
allowSignIn: false;
|
||||
};
|
||||
oauth: {
|
||||
accountMergeStrategy: "link_method";
|
||||
providers: (key: string) => {
|
||||
isShared: true;
|
||||
allowSignIn: false;
|
||||
allowConnectedAccounts: false;
|
||||
};
|
||||
};
|
||||
};
|
||||
emails: {
|
||||
server: {
|
||||
isShared: true;
|
||||
};
|
||||
};
|
||||
};
|
||||
type DeepReplaceAllowFunctionsForObjects<T> = T extends object ? {
|
||||
[K in keyof T]: DeepReplaceAllowFunctionsForObjects<T[K]>;
|
||||
} | ((arg: keyof T) => DeepReplaceAllowFunctionsForObjects<T[keyof T]>) : T;
|
||||
type DeepReplaceFunctionsWithObjects<T> = T extends (arg: infer K extends string) => infer R ? DeepReplaceFunctionsWithObjects<Record<K, R>> : (T extends object ? {
|
||||
[K in keyof T]: DeepReplaceFunctionsWithObjects<T[K]>;
|
||||
} : T);
|
||||
type ApplyDefaults<D extends object | ((key: string) => unknown), C extends object> = DeepMerge<DeepReplaceFunctionsWithObjects<D>, C>;
|
||||
declare function applyDefaults<D extends object | ((key: string) => unknown), C extends object>(defaults: D, config: C): ApplyDefaults<D, C>;
|
||||
type ProjectConfigNormalizedOverride = yup.InferType<typeof projectConfigSchema>;
|
||||
type BranchConfigNormalizedOverride = yup.InferType<typeof branchConfigSchema>;
|
||||
type EnvironmentConfigNormalizedOverride = yup.InferType<typeof environmentConfigSchema>;
|
||||
type OrganizationConfigNormalizedOverride = yup.InferType<typeof organizationConfigSchema>;
|
||||
type ProjectConfigStrippedNormalizedOverride = Omit<ProjectConfigNormalizedOverride, keyof BranchConfigNormalizedOverride | keyof EnvironmentConfigNormalizedOverride | keyof OrganizationConfigNormalizedOverride>;
|
||||
type BranchConfigStrippedNormalizedOverride = Omit<BranchConfigNormalizedOverride, keyof EnvironmentConfigNormalizedOverride | keyof OrganizationConfigNormalizedOverride>;
|
||||
type EnvironmentConfigStrippedNormalizedOverride = Omit<EnvironmentConfigNormalizedOverride, keyof OrganizationConfigNormalizedOverride>;
|
||||
type OrganizationConfigStrippedNormalizedOverride = OrganizationConfigNormalizedOverride;
|
||||
type ProjectConfigOverride = NormalizesTo<ProjectConfigNormalizedOverride>;
|
||||
type BranchConfigOverride = NormalizesTo<BranchConfigNormalizedOverride>;
|
||||
type EnvironmentConfigOverride = NormalizesTo<EnvironmentConfigNormalizedOverride>;
|
||||
type OrganizationConfigOverride = NormalizesTo<OrganizationConfigNormalizedOverride>;
|
||||
type ProjectConfigOverrideOverride = Config & DeepPartial<ProjectConfigOverride>;
|
||||
type BranchConfigOverrideOverride = Config & DeepPartial<BranchConfigOverride>;
|
||||
type EnvironmentConfigOverrideOverride = Config & DeepPartial<EnvironmentConfigOverride>;
|
||||
type OrganizationConfigOverrideOverride = Config & DeepPartial<OrganizationConfigOverride>;
|
||||
type ProjectIncompleteConfig = ProjectConfigNormalizedOverride;
|
||||
type BranchIncompleteConfig = ProjectIncompleteConfig & BranchConfigNormalizedOverride;
|
||||
type EnvironmentIncompleteConfig = BranchIncompleteConfig & EnvironmentConfigNormalizedOverride;
|
||||
type OrganizationIncompleteConfig = EnvironmentIncompleteConfig & OrganizationConfigNormalizedOverride;
|
||||
type ProjectRenderedConfig = PrettifyType<ApplyDefaults<typeof projectConfigDefaults, ProjectConfigStrippedNormalizedOverride>>;
|
||||
type BranchRenderedConfig = PrettifyType<ProjectRenderedConfig & ApplyDefaults<typeof branchConfigDefaults, BranchConfigStrippedNormalizedOverride>>;
|
||||
type EnvironmentRenderedConfig = PrettifyType<BranchRenderedConfig & ApplyDefaults<typeof environmentConfigDefaults, EnvironmentConfigStrippedNormalizedOverride>>;
|
||||
type OrganizationRenderedConfig = PrettifyType<EnvironmentRenderedConfig & ApplyDefaults<typeof organizationConfigDefaults, OrganizationConfigStrippedNormalizedOverride>>;
|
||||
|
||||
export { type ApplyDefaults, type BranchConfigNormalizedOverride, type BranchConfigOverride, type BranchConfigOverrideOverride, type BranchConfigStrippedNormalizedOverride, type BranchIncompleteConfig, type BranchRenderedConfig, type ConfigLevel, type DeepReplaceAllowFunctionsForObjects, type DeepReplaceFunctionsWithObjects, type EnvironmentConfigNormalizedOverride, type EnvironmentConfigOverride, type EnvironmentConfigOverrideOverride, type EnvironmentConfigStrippedNormalizedOverride, type EnvironmentIncompleteConfig, type EnvironmentRenderedConfig, type OrganizationConfigNormalizedOverride, type OrganizationConfigOverride, type OrganizationConfigOverrideOverride, type OrganizationConfigStrippedNormalizedOverride, type OrganizationIncompleteConfig, type OrganizationRenderedConfig, type ProjectConfigNormalizedOverride, type ProjectConfigOverride, type ProjectConfigOverrideOverride, type ProjectConfigStrippedNormalizedOverride, type ProjectIncompleteConfig, type ProjectRenderedConfig, applyDefaults, branchConfigDefaults, branchConfigSchema, configLevels, environmentConfigDefaults, environmentConfigSchema, organizationConfigDefaults, organizationConfigSchema, projectConfigDefaults, projectConfigSchema };
|
||||
245
package/@stackframe/stack-shared/dist/config/schema.js
vendored
Normal file
245
package/@stackframe/stack-shared/dist/config/schema.js
vendored
Normal file
|
|
@ -0,0 +1,245 @@
|
|||
"use strict";
|
||||
var __create = Object.create;
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __getProtoOf = Object.getPrototypeOf;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
||||
// If the importer is in node compatibility mode or this is not an ESM
|
||||
// file that has been converted to a CommonJS file using a Babel-
|
||||
// compatible transform (i.e. "__esModule" has not been set), then set
|
||||
// "default" to the CommonJS "module.exports" for node compatibility.
|
||||
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
||||
mod
|
||||
));
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
|
||||
// src/config/schema.ts
|
||||
var schema_exports = {};
|
||||
__export(schema_exports, {
|
||||
applyDefaults: () => applyDefaults,
|
||||
branchConfigDefaults: () => branchConfigDefaults,
|
||||
branchConfigSchema: () => branchConfigSchema,
|
||||
configLevels: () => configLevels,
|
||||
environmentConfigDefaults: () => environmentConfigDefaults,
|
||||
environmentConfigSchema: () => environmentConfigSchema,
|
||||
organizationConfigDefaults: () => organizationConfigDefaults,
|
||||
organizationConfigSchema: () => organizationConfigSchema,
|
||||
projectConfigDefaults: () => projectConfigDefaults,
|
||||
projectConfigSchema: () => projectConfigSchema
|
||||
});
|
||||
module.exports = __toCommonJS(schema_exports);
|
||||
var schemaFields = __toESM(require("../schema-fields"));
|
||||
var import_schema_fields = require("../schema-fields");
|
||||
var import_oauth = require("../utils/oauth");
|
||||
var import_objects = require("../utils/objects");
|
||||
var configLevels = ["project", "branch", "environment", "organization"];
|
||||
var permissionRegex = /^\$?[a-z0-9_:]+$/;
|
||||
var customPermissionRegex = /^[a-z0-9_:]+$/;
|
||||
var projectConfigSchema = (0, import_schema_fields.yupObject)({});
|
||||
var branchRbacDefaultPermissions = (0, import_schema_fields.yupRecord)(
|
||||
(0, import_schema_fields.yupString)().optional().matches(permissionRegex),
|
||||
(0, import_schema_fields.yupBoolean)().isTrue().optional()
|
||||
).optional();
|
||||
var branchRbacSchema = (0, import_schema_fields.yupObject)({
|
||||
permissions: (0, import_schema_fields.yupRecord)(
|
||||
(0, import_schema_fields.yupString)().optional().matches(customPermissionRegex),
|
||||
(0, import_schema_fields.yupObject)({
|
||||
description: (0, import_schema_fields.yupString)().optional(),
|
||||
scope: (0, import_schema_fields.yupString)().oneOf(["team", "project"]).optional(),
|
||||
containedPermissionIds: (0, import_schema_fields.yupRecord)(
|
||||
(0, import_schema_fields.yupString)().optional().matches(permissionRegex),
|
||||
(0, import_schema_fields.yupBoolean)().isTrue().optional()
|
||||
).optional()
|
||||
}).optional()
|
||||
).optional(),
|
||||
defaultPermissions: (0, import_schema_fields.yupObject)({
|
||||
teamCreator: branchRbacDefaultPermissions,
|
||||
teamMember: branchRbacDefaultPermissions,
|
||||
signUp: branchRbacDefaultPermissions
|
||||
}).optional()
|
||||
}).optional();
|
||||
var branchApiKeysSchema = (0, import_schema_fields.yupObject)({
|
||||
enabled: (0, import_schema_fields.yupObject)({
|
||||
team: (0, import_schema_fields.yupBoolean)().optional(),
|
||||
user: (0, import_schema_fields.yupBoolean)().optional()
|
||||
}).optional()
|
||||
}).optional();
|
||||
var branchAuthSchema = (0, import_schema_fields.yupObject)({
|
||||
allowSignUp: (0, import_schema_fields.yupBoolean)().optional(),
|
||||
password: (0, import_schema_fields.yupObject)({
|
||||
allowSignIn: (0, import_schema_fields.yupBoolean)().optional()
|
||||
}).optional(),
|
||||
otp: (0, import_schema_fields.yupObject)({
|
||||
allowSignIn: (0, import_schema_fields.yupBoolean)().optional()
|
||||
}).optional(),
|
||||
passkey: (0, import_schema_fields.yupObject)({
|
||||
allowSignIn: (0, import_schema_fields.yupBoolean)().optional()
|
||||
}).optional(),
|
||||
oauth: (0, import_schema_fields.yupObject)({
|
||||
accountMergeStrategy: (0, import_schema_fields.yupString)().oneOf(["link_method", "raise_error", "allow_duplicates"]).optional(),
|
||||
providers: (0, import_schema_fields.yupRecord)(
|
||||
(0, import_schema_fields.yupString)().optional().matches(permissionRegex),
|
||||
(0, import_schema_fields.yupObject)({
|
||||
type: (0, import_schema_fields.yupString)().oneOf(import_oauth.allProviders).optional(),
|
||||
allowSignIn: (0, import_schema_fields.yupBoolean)().optional(),
|
||||
allowConnectedAccounts: (0, import_schema_fields.yupBoolean)().optional()
|
||||
}).defined()
|
||||
).optional()
|
||||
}).optional()
|
||||
}).optional();
|
||||
var branchDomain = (0, import_schema_fields.yupObject)({
|
||||
allowLocalhost: (0, import_schema_fields.yupBoolean)().optional()
|
||||
}).optional();
|
||||
var branchConfigSchema = projectConfigSchema.concat((0, import_schema_fields.yupObject)({
|
||||
rbac: branchRbacSchema,
|
||||
teams: (0, import_schema_fields.yupObject)({
|
||||
createPersonalTeamOnSignUp: (0, import_schema_fields.yupBoolean)().optional(),
|
||||
allowClientTeamCreation: (0, import_schema_fields.yupBoolean)().optional()
|
||||
}).optional(),
|
||||
users: (0, import_schema_fields.yupObject)({
|
||||
allowClientUserDeletion: (0, import_schema_fields.yupBoolean)().optional()
|
||||
}).optional(),
|
||||
apiKeys: branchApiKeysSchema,
|
||||
domains: branchDomain,
|
||||
auth: branchAuthSchema,
|
||||
emails: (0, import_schema_fields.yupObject)({})
|
||||
}));
|
||||
var environmentConfigSchema = branchConfigSchema.concat((0, import_schema_fields.yupObject)({
|
||||
auth: branchConfigSchema.getNested("auth").concat((0, import_schema_fields.yupObject)({
|
||||
oauth: branchConfigSchema.getNested("auth").getNested("oauth").concat((0, import_schema_fields.yupObject)({
|
||||
providers: (0, import_schema_fields.yupRecord)(
|
||||
(0, import_schema_fields.yupString)().optional().matches(permissionRegex),
|
||||
(0, import_schema_fields.yupObject)({
|
||||
type: (0, import_schema_fields.yupString)().oneOf(import_oauth.allProviders).optional(),
|
||||
isShared: (0, import_schema_fields.yupBoolean)().optional(),
|
||||
clientId: schemaFields.oauthClientIdSchema.optional(),
|
||||
clientSecret: schemaFields.oauthClientSecretSchema.optional(),
|
||||
facebookConfigId: schemaFields.oauthFacebookConfigIdSchema.optional(),
|
||||
microsoftTenantId: schemaFields.oauthMicrosoftTenantIdSchema.optional(),
|
||||
allowSignIn: (0, import_schema_fields.yupBoolean)().optional(),
|
||||
allowConnectedAccounts: (0, import_schema_fields.yupBoolean)().optional()
|
||||
})
|
||||
).optional()
|
||||
}).optional())
|
||||
})),
|
||||
emails: branchConfigSchema.getNested("emails").concat((0, import_schema_fields.yupObject)({
|
||||
server: (0, import_schema_fields.yupObject)({
|
||||
isShared: (0, import_schema_fields.yupBoolean)().optional(),
|
||||
host: schemaFields.emailHostSchema.optional().nonEmpty(),
|
||||
port: schemaFields.emailPortSchema.optional(),
|
||||
username: schemaFields.emailUsernameSchema.optional().nonEmpty(),
|
||||
password: schemaFields.emailPasswordSchema.optional().nonEmpty(),
|
||||
senderName: schemaFields.emailSenderNameSchema.optional().nonEmpty(),
|
||||
senderEmail: schemaFields.emailSenderEmailSchema.optional().nonEmpty()
|
||||
})
|
||||
}).optional()),
|
||||
domains: branchConfigSchema.getNested("domains").concat((0, import_schema_fields.yupObject)({
|
||||
trustedDomains: (0, import_schema_fields.yupRecord)(
|
||||
(0, import_schema_fields.yupString)().uuid().optional(),
|
||||
(0, import_schema_fields.yupObject)({
|
||||
baseUrl: schemaFields.urlSchema.optional(),
|
||||
handlerPath: schemaFields.handlerPathSchema.optional()
|
||||
})
|
||||
).optional()
|
||||
}))
|
||||
}));
|
||||
var organizationConfigSchema = environmentConfigSchema.concat((0, import_schema_fields.yupObject)({}));
|
||||
var projectConfigDefaults = {};
|
||||
var branchConfigDefaults = {};
|
||||
var environmentConfigDefaults = {};
|
||||
var organizationConfigDefaults = {
|
||||
rbac: {
|
||||
permissions: (key) => ({}),
|
||||
defaultPermissions: {
|
||||
teamCreator: {},
|
||||
teamMember: {},
|
||||
signUp: {}
|
||||
}
|
||||
},
|
||||
apiKeys: {
|
||||
enabled: {
|
||||
team: false,
|
||||
user: false
|
||||
}
|
||||
},
|
||||
teams: {
|
||||
createPersonalTeamOnSignUp: false,
|
||||
allowClientTeamCreation: false
|
||||
},
|
||||
users: {
|
||||
allowClientUserDeletion: false
|
||||
},
|
||||
domains: {
|
||||
allowLocalhost: false,
|
||||
trustedDomains: (key) => ({
|
||||
handlerPath: "/handler"
|
||||
})
|
||||
},
|
||||
auth: {
|
||||
allowSignUp: true,
|
||||
password: {
|
||||
allowSignIn: false
|
||||
},
|
||||
otp: {
|
||||
allowSignIn: false
|
||||
},
|
||||
passkey: {
|
||||
allowSignIn: false
|
||||
},
|
||||
oauth: {
|
||||
accountMergeStrategy: "link_method",
|
||||
providers: (key) => ({
|
||||
isShared: true,
|
||||
allowSignIn: false,
|
||||
allowConnectedAccounts: false
|
||||
})
|
||||
}
|
||||
},
|
||||
emails: {
|
||||
server: {
|
||||
isShared: true
|
||||
}
|
||||
}
|
||||
};
|
||||
function applyDefaults(defaults, config) {
|
||||
const res = typeof defaults === "function" ? {} : (0, import_objects.mapValues)(defaults, (v) => typeof v === "function" ? {} : typeof v === "object" ? applyDefaults(v, {}) : v);
|
||||
for (const [key, mergeValue] of Object.entries(config)) {
|
||||
const baseValue = typeof defaults === "function" ? defaults(key) : (0, import_objects.has)(defaults, key) ? (0, import_objects.get)(defaults, key) : void 0;
|
||||
if (baseValue !== void 0) {
|
||||
if ((0, import_objects.isObjectLike)(baseValue) && (0, import_objects.isObjectLike)(mergeValue)) {
|
||||
(0, import_objects.set)(res, key, applyDefaults(baseValue, mergeValue));
|
||||
continue;
|
||||
}
|
||||
}
|
||||
(0, import_objects.set)(res, key, mergeValue);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
applyDefaults,
|
||||
branchConfigDefaults,
|
||||
branchConfigSchema,
|
||||
configLevels,
|
||||
environmentConfigDefaults,
|
||||
environmentConfigSchema,
|
||||
organizationConfigDefaults,
|
||||
organizationConfigSchema,
|
||||
projectConfigDefaults,
|
||||
projectConfigSchema
|
||||
});
|
||||
//# sourceMappingURL=schema.js.map
|
||||
1
package/@stackframe/stack-shared/dist/config/schema.js.map
vendored
Normal file
1
package/@stackframe/stack-shared/dist/config/schema.js.map
vendored
Normal file
File diff suppressed because one or more lines are too long
Loading…
Add table
Add a link
Reference in a new issue