@baseplate-dev/plugin-auth 1.0.5 → 1.0.6
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/auth/core/node.d.ts.map +1 -1
- package/dist/auth/core/node.js +9 -17
- package/dist/auth/core/node.js.map +1 -1
- package/dist/auth0/core/node.d.ts.map +1 -1
- package/dist/auth0/core/node.js +13 -21
- package/dist/auth0/core/node.js.map +1 -1
- package/dist/placeholder-auth/core/node.d.ts.map +1 -1
- package/dist/placeholder-auth/core/node.js +6 -14
- package/dist/placeholder-auth/core/node.js.map +1 -1
- package/dist/web/assets/{__federation_expose_auth0CoreCommon-BXcKWfCq.js → __federation_expose_auth0CoreCommon-CSWdt8d_.js} +3 -3
- package/dist/web/assets/{__federation_expose_auth0CoreCommon-BXcKWfCq.js.map → __federation_expose_auth0CoreCommon-CSWdt8d_.js.map} +1 -1
- package/dist/web/assets/{__federation_expose_auth0CoreWeb-VnxlQY01.js → __federation_expose_auth0CoreWeb-DjVw47sM.js} +6 -6
- package/dist/web/assets/{__federation_expose_auth0CoreWeb-VnxlQY01.js.map → __federation_expose_auth0CoreWeb-DjVw47sM.js.map} +1 -1
- package/dist/web/assets/{__federation_expose_authCoreCommon-LrPwgIpw.js → __federation_expose_authCoreCommon-CvHJZFIq.js} +3 -3
- package/dist/web/assets/{__federation_expose_authCoreCommon-LrPwgIpw.js.map → __federation_expose_authCoreCommon-CvHJZFIq.js.map} +1 -1
- package/dist/web/assets/{__federation_expose_authCoreWeb-CGWfg0Fb.js → __federation_expose_authCoreWeb-CrFEmZp3.js} +6 -6
- package/dist/web/assets/{__federation_expose_authCoreWeb-CGWfg0Fb.js.map → __federation_expose_authCoreWeb-CrFEmZp3.js.map} +1 -1
- package/dist/web/assets/{__federation_expose_placeholder-authCoreCommon-DCZZPRb7.js → __federation_expose_placeholder-authCoreCommon-CmkiEJ6z.js} +3 -3
- package/dist/web/assets/{__federation_expose_placeholder-authCoreCommon-DCZZPRb7.js.map → __federation_expose_placeholder-authCoreCommon-CmkiEJ6z.js.map} +1 -1
- package/dist/web/assets/{__federation_expose_placeholder-authCoreWeb-BunerD5g.js → __federation_expose_placeholder-authCoreWeb-CpxfTdxv.js} +6 -6
- package/dist/web/assets/{__federation_expose_placeholder-authCoreWeb-BunerD5g.js.map → __federation_expose_placeholder-authCoreWeb-CpxfTdxv.js.map} +1 -1
- package/dist/web/assets/{__federation_fn_import-BDimcZUI.js → __federation_fn_import-CGvRdRVe.js} +2 -2
- package/dist/web/assets/{__federation_fn_import-BDimcZUI.js.map → __federation_fn_import-CGvRdRVe.js.map} +1 -1
- package/dist/web/assets/__federation_shared_@baseplate-dev/project-builder-lib/{web-oq9zm9eN.js → web-D1kBtwsm.js} +5 -5
- package/dist/web/assets/__federation_shared_@baseplate-dev/project-builder-lib/{web-oq9zm9eN.js.map → web-D1kBtwsm.js.map} +1 -1
- package/dist/web/assets/__federation_shared_@baseplate-dev/{project-builder-lib-DqkNAXn3.js → project-builder-lib-B7442OYh.js} +246 -208
- package/dist/web/assets/__federation_shared_@baseplate-dev/project-builder-lib-B7442OYh.js.map +1 -0
- package/dist/web/assets/__federation_shared_@baseplate-dev/{ui-components-BxXhpJ04.js → ui-components-X318M5Ml.js} +41 -27
- package/dist/web/assets/__federation_shared_@baseplate-dev/{ui-components-BxXhpJ04.js.map → ui-components-X318M5Ml.js.map} +1 -1
- package/dist/web/assets/{index-D4PxvJ0z.js → index-ydDQKauE.js} +2 -2
- package/dist/web/assets/{index-D4PxvJ0z.js.map → index-ydDQKauE.js.map} +1 -1
- package/dist/web/assets/{index.esm-qm5h2Bmg.js → index.esm-DYWXRkn-.js} +2 -2
- package/dist/web/assets/{index.esm-qm5h2Bmg.js.map → index.esm-DYWXRkn-.js.map} +1 -1
- package/dist/web/assets/{model-merger-CA2yaVFd.js → model-merger-BVBtbNAj.js} +39 -15
- package/dist/web/assets/model-merger-BVBtbNAj.js.map +1 -0
- package/dist/web/assets/{plugin-definition-CoiivnNt.js → plugin-definition-Bdhuga1j.js} +3 -3
- package/dist/web/assets/{plugin-definition-CoiivnNt.js.map → plugin-definition-Bdhuga1j.js.map} +1 -1
- package/dist/web/assets/{plugin-definition-X0d5-H4U.js → plugin-definition-C9d7ykhX.js} +3 -3
- package/dist/web/assets/{plugin-definition-X0d5-H4U.js.map → plugin-definition-C9d7ykhX.js.map} +1 -1
- package/dist/web/assets/{plugin-definition-BEHZirWF.js → plugin-definition-QzgXWr1I.js} +3 -3
- package/dist/web/assets/{plugin-definition-BEHZirWF.js.map → plugin-definition-QzgXWr1I.js.map} +1 -1
- package/dist/web/assets/{react-BLL9qrdY.js → react-B23vKoD0.js} +2 -2
- package/dist/web/assets/{react-BLL9qrdY.js.map → react-B23vKoD0.js.map} +1 -1
- package/dist/web/assets/remoteEntry.js +6 -6
- package/dist/web/assets/{role-editor-form-lOkPZX7S.js → role-editor-form-BkcoVwtU.js} +4 -4
- package/dist/web/assets/{role-editor-form-lOkPZX7S.js.map → role-editor-form-BkcoVwtU.js.map} +1 -1
- package/dist/web/assets/{styles-B6SRrcui.js → styles-Dfjm_ApH.js} +3 -3
- package/dist/web/assets/{styles-B6SRrcui.js.map → styles-Dfjm_ApH.js.map} +1 -1
- package/package.json +10 -10
- package/dist/web/assets/__federation_shared_@baseplate-dev/project-builder-lib-DqkNAXn3.js.map +0 -1
- package/dist/web/assets/model-merger-CA2yaVFd.js.map +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { c as createPluginSpec, i as isEqual, m as mapValues, a as createEntityType, C as CASE_VALIDATORS, D as DefinitionReferenceMarker, g as get$1, R as REF_ANNOTATIONS_MARKER_SYMBOL, b as createDefinitionSchemaParserContext, s as set$1,
|
|
2
|
-
export { K as DefinitionDiffArrayIncludesField, I as DefinitionDiffKeyedArrayField, J as DefinitionDiffReplacementField, v as DefinitionEntityType, F as FeatureUtils, O as applyDefinitionDiff, E as applyModelMergerDiff, G as applyModelMergerResultInPlace, H as createAndApplyModelMergerResults, N as createDefinitionDiff, L as createDefinitionDiffConfig, x as createFeatureSchema, u as createInitializedPluginSpec, z as createModelMergerResult, B as createModelMergerResults, A as doesModelMergerResultsHaveChanges, w as featureNameSchema, y as modelMergerDefinitionDiffConfig } from '../model-merger-
|
|
3
|
-
import { importShared } from '../__federation_fn_import-
|
|
1
|
+
import { c as createPluginSpec, i as isEqual, m as mapValues, a as createEntityType, C as CASE_VALIDATORS, d as definitionSchema, D as DefinitionReferenceMarker, g as get$1, R as REF_ANNOTATIONS_MARKER_SYMBOL, b as createDefinitionSchemaParserContext, s as set$1, e as modelForeignRelationEntityType, f as modelLocalRelationEntityType, h as modelScalarFieldEntityType, j as modelTransformerEntityType, k as modelEntityType, l as modelEnumValueEntityType, n as featureEntityType, o as modelEnumEntityType, p as modelUniqueConstraintEntityType, q as createFeaturesSchema, M as ModelUtils, r as omit, t as cloneDeep } from '../model-merger-BVBtbNAj.js';
|
|
2
|
+
export { K as DefinitionDiffArrayIncludesField, I as DefinitionDiffKeyedArrayField, J as DefinitionDiffReplacementField, v as DefinitionEntityType, F as FeatureUtils, O as applyDefinitionDiff, E as applyModelMergerDiff, G as applyModelMergerResultInPlace, H as createAndApplyModelMergerResults, N as createDefinitionDiff, L as createDefinitionDiffConfig, x as createFeatureSchema, u as createInitializedPluginSpec, z as createModelMergerResult, B as createModelMergerResults, A as doesModelMergerResultsHaveChanges, w as featureNameSchema, y as modelMergerDefinitionDiffConfig } from '../model-merger-BVBtbNAj.js';
|
|
3
|
+
import { importShared } from '../__federation_fn_import-CGvRdRVe.js';
|
|
4
4
|
|
|
5
5
|
function createAdminCrudInputCompilerImplementation() {
|
|
6
6
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -2261,8 +2261,6 @@ const AppUtils = {
|
|
|
2261
2261
|
getBackendRelativePath,
|
|
2262
2262
|
};
|
|
2263
2263
|
|
|
2264
|
-
const authRoleEntityType = createEntityType('role');
|
|
2265
|
-
|
|
2266
2264
|
const appEntityType = createEntityType('app');
|
|
2267
2265
|
function createAppEntryType(name) {
|
|
2268
2266
|
return name;
|
|
@@ -2282,6 +2280,21 @@ const baseAppValidators = {
|
|
|
2282
2280
|
};
|
|
2283
2281
|
const baseAppSchema = z$j.object(baseAppValidators);
|
|
2284
2282
|
|
|
2283
|
+
const {z: z$i} = await importShared('zod');
|
|
2284
|
+
const createBackendAppSchema = definitionSchema(() => z$i.object({
|
|
2285
|
+
...baseAppValidators,
|
|
2286
|
+
type: z$i.literal('backend'),
|
|
2287
|
+
enableStripe: z$i.boolean().optional(),
|
|
2288
|
+
enableRedis: z$i.boolean().optional(),
|
|
2289
|
+
enableBullQueue: z$i.boolean().optional(),
|
|
2290
|
+
enablePostmark: z$i.boolean().optional(),
|
|
2291
|
+
enableSubscriptions: z$i.boolean().optional(),
|
|
2292
|
+
enableAxios: z$i.boolean().optional(),
|
|
2293
|
+
}));
|
|
2294
|
+
const backendAppEntryType = createAppEntryType('backend');
|
|
2295
|
+
|
|
2296
|
+
const authRoleEntityType = createEntityType('role');
|
|
2297
|
+
|
|
2285
2298
|
/**
|
|
2286
2299
|
* Strips the DefinitionReferenceMarker from the value recursively.
|
|
2287
2300
|
* @param value - The value to strip the DefinitionReferenceMarker from.
|
|
@@ -2905,141 +2918,141 @@ const SCALAR_FIELD_TYPES = [
|
|
|
2905
2918
|
'enum',
|
|
2906
2919
|
];
|
|
2907
2920
|
|
|
2908
|
-
const {z: z$
|
|
2909
|
-
const oklchColor = z$
|
|
2921
|
+
const {z: z$h} = await importShared('zod');
|
|
2922
|
+
const oklchColor = z$h
|
|
2910
2923
|
.string()
|
|
2911
2924
|
.regex(/^oklch\(\s*([\d.]+)\s+([\d.]+)\s+([\d.]+)(?:\s*\/\s*([\d.]+))?\s*\)$/, {
|
|
2912
2925
|
message: 'OKLCH color must be of the format "oklch(l c h [/ a])" where l and c are between 0 and 1 and h is between 0 and 360 and a is between 0 and 100',
|
|
2913
2926
|
});
|
|
2914
|
-
const themeColorSchema = z$
|
|
2915
|
-
const paletteSchema = z$
|
|
2927
|
+
const themeColorSchema = z$h.record(z$h.enum(THEME_COLOR_KEYS), oklchColor);
|
|
2928
|
+
const paletteSchema = z$h
|
|
2916
2929
|
.object({
|
|
2917
|
-
paletteName: z$
|
|
2930
|
+
paletteName: z$h.string().min(1),
|
|
2918
2931
|
customBase: oklchColor.nullish(),
|
|
2919
|
-
shades: z$
|
|
2932
|
+
shades: z$h.record(z$h.enum(PALETTE_SHADES), oklchColor),
|
|
2920
2933
|
})
|
|
2921
2934
|
.refine((data) => data.paletteName !== 'custom' || !!data.paletteName, {
|
|
2922
2935
|
message: 'A custom base color is required if using a custom base palette',
|
|
2923
2936
|
path: ['customBase'],
|
|
2924
2937
|
});
|
|
2925
|
-
const palettesSchema = z$
|
|
2938
|
+
const palettesSchema = z$h.object({
|
|
2926
2939
|
base: paletteSchema,
|
|
2927
2940
|
primary: paletteSchema,
|
|
2928
2941
|
});
|
|
2929
|
-
const createThemeSchema = definitionSchema(() => z$
|
|
2930
|
-
palettes: z$
|
|
2942
|
+
const createThemeSchema = definitionSchema(() => z$h.object({
|
|
2943
|
+
palettes: z$h.object({
|
|
2931
2944
|
base: paletteSchema,
|
|
2932
2945
|
primary: paletteSchema,
|
|
2933
2946
|
}),
|
|
2934
|
-
colors: z$
|
|
2947
|
+
colors: z$h.object({
|
|
2935
2948
|
light: themeColorSchema,
|
|
2936
2949
|
dark: themeColorSchema,
|
|
2937
2950
|
}),
|
|
2938
2951
|
}));
|
|
2939
2952
|
|
|
2940
|
-
const {z: z$
|
|
2953
|
+
const {z: z$g} = await importShared('zod');
|
|
2941
2954
|
|
|
2942
2955
|
const VALIDATORS = {
|
|
2943
|
-
PASCAL_CASE_STRING: z$
|
|
2956
|
+
PASCAL_CASE_STRING: z$g
|
|
2944
2957
|
.string()
|
|
2945
2958
|
.regex(/^[A-Z][a-zA-Z0-9]*$/, "Should be PascalCase, e.g. 'MyModel'"),
|
|
2946
|
-
CAMEL_CASE_STRING: z$
|
|
2959
|
+
CAMEL_CASE_STRING: z$g
|
|
2947
2960
|
.string()
|
|
2948
2961
|
.regex(/^[a-z][a-zA-Z0-9]*$/, "Should be camelCase, e.g. 'myField'"),
|
|
2949
|
-
CONSTANT_CASE_STRING: z$
|
|
2962
|
+
CONSTANT_CASE_STRING: z$g
|
|
2950
2963
|
.string()
|
|
2951
2964
|
.regex(/^[A-Z][A-Z0-9_]*$/, "Should be CONSTANT_CASE, e.g. 'MY_CONSTANT'"),
|
|
2952
|
-
OPTIONAL_CONSTANT_CASE_STRING: z$
|
|
2965
|
+
OPTIONAL_CONSTANT_CASE_STRING: z$g
|
|
2953
2966
|
.string()
|
|
2954
2967
|
.regex(/^[A-Z][A-Z0-9_]*$/, "Should be CONSTANT_CASE, e.g. 'MY_CONSTANT'")
|
|
2955
|
-
.or(z$
|
|
2968
|
+
.or(z$g.literal(''))
|
|
2956
2969
|
.optional(),
|
|
2957
2970
|
};
|
|
2958
2971
|
|
|
2959
|
-
const {z: z$
|
|
2960
|
-
const createRoleArray = definitionSchema((ctx) => ctx.withDefault(z$
|
|
2972
|
+
const {z: z$f} = await importShared('zod');
|
|
2973
|
+
const createRoleArray = definitionSchema((ctx) => ctx.withDefault(z$f.array(ctx.withRef({
|
|
2961
2974
|
type: authRoleEntityType,
|
|
2962
2975
|
onDelete: 'DELETE',
|
|
2963
2976
|
})), []));
|
|
2964
|
-
const createModelGraphqlSchema = definitionSchema((ctx) => z$
|
|
2965
|
-
objectType: ctx.withDefault(z$
|
|
2966
|
-
enabled: ctx.withDefault(z$
|
|
2967
|
-
fields: ctx.withDefault(z$
|
|
2977
|
+
const createModelGraphqlSchema = definitionSchema((ctx) => z$f.object({
|
|
2978
|
+
objectType: ctx.withDefault(z$f.object({
|
|
2979
|
+
enabled: ctx.withDefault(z$f.boolean(), false),
|
|
2980
|
+
fields: ctx.withDefault(z$f.array(ctx.withRef({
|
|
2968
2981
|
type: modelScalarFieldEntityType,
|
|
2969
2982
|
onDelete: 'DELETE',
|
|
2970
2983
|
parentPath: { context: 'model' },
|
|
2971
2984
|
})), []),
|
|
2972
|
-
localRelations: ctx.withDefault(z$
|
|
2985
|
+
localRelations: ctx.withDefault(z$f.array(ctx.withRef({
|
|
2973
2986
|
type: modelLocalRelationEntityType,
|
|
2974
2987
|
onDelete: 'DELETE',
|
|
2975
2988
|
parentPath: { context: 'model' },
|
|
2976
2989
|
})), []),
|
|
2977
|
-
foreignRelations: ctx.withDefault(z$
|
|
2990
|
+
foreignRelations: ctx.withDefault(z$f.array(ctx.withRef({
|
|
2978
2991
|
type: modelForeignRelationEntityType,
|
|
2979
2992
|
onDelete: 'DELETE',
|
|
2980
2993
|
parentPath: { context: 'model' },
|
|
2981
2994
|
})), []),
|
|
2982
2995
|
}), {}),
|
|
2983
|
-
queries: ctx.withDefault(z$
|
|
2984
|
-
get: ctx.withDefault(z$
|
|
2985
|
-
enabled: ctx.withDefault(z$
|
|
2996
|
+
queries: ctx.withDefault(z$f.object({
|
|
2997
|
+
get: ctx.withDefault(z$f.object({
|
|
2998
|
+
enabled: ctx.withDefault(z$f.boolean(), false),
|
|
2986
2999
|
roles: createRoleArray(ctx),
|
|
2987
3000
|
}), {}),
|
|
2988
|
-
list: ctx.withDefault(z$
|
|
2989
|
-
enabled: ctx.withDefault(z$
|
|
3001
|
+
list: ctx.withDefault(z$f.object({
|
|
3002
|
+
enabled: ctx.withDefault(z$f.boolean(), false),
|
|
2990
3003
|
roles: createRoleArray(ctx),
|
|
2991
3004
|
}), {}),
|
|
2992
3005
|
}), {}),
|
|
2993
|
-
mutations: ctx.withDefault(z$
|
|
2994
|
-
create: ctx.withDefault(z$
|
|
2995
|
-
enabled: ctx.withDefault(z$
|
|
3006
|
+
mutations: ctx.withDefault(z$f.object({
|
|
3007
|
+
create: ctx.withDefault(z$f.object({
|
|
3008
|
+
enabled: ctx.withDefault(z$f.boolean(), false),
|
|
2996
3009
|
roles: createRoleArray(ctx),
|
|
2997
3010
|
}), {}),
|
|
2998
|
-
update: ctx.withDefault(z$
|
|
2999
|
-
enabled: ctx.withDefault(z$
|
|
3011
|
+
update: ctx.withDefault(z$f.object({
|
|
3012
|
+
enabled: ctx.withDefault(z$f.boolean(), false),
|
|
3000
3013
|
roles: createRoleArray(ctx),
|
|
3001
3014
|
}), {}),
|
|
3002
|
-
delete: ctx.withDefault(z$
|
|
3003
|
-
enabled: ctx.withDefault(z$
|
|
3015
|
+
delete: ctx.withDefault(z$f.object({
|
|
3016
|
+
enabled: ctx.withDefault(z$f.boolean(), false),
|
|
3004
3017
|
roles: createRoleArray(ctx),
|
|
3005
3018
|
}), {}),
|
|
3006
3019
|
}), {}),
|
|
3007
3020
|
}));
|
|
3008
3021
|
|
|
3009
|
-
const {z: z$
|
|
3022
|
+
const {z: z$e} = await importShared('zod');
|
|
3010
3023
|
|
|
3011
3024
|
const baseTransformerFields = {
|
|
3012
|
-
id: z$
|
|
3013
|
-
type: z$
|
|
3025
|
+
id: z$e.string(),
|
|
3026
|
+
type: z$e.string().min(1),
|
|
3014
3027
|
};
|
|
3015
|
-
const baseTransformerSchema = z$
|
|
3028
|
+
const baseTransformerSchema = z$e.object(baseTransformerFields);
|
|
3016
3029
|
function createModelTransformerType(payload) {
|
|
3017
3030
|
return payload;
|
|
3018
3031
|
}
|
|
3019
3032
|
|
|
3020
|
-
const {z: z$
|
|
3021
|
-
const createPasswordTransformerSchema = definitionSchema((ctx) => ctx.withEnt(z$
|
|
3033
|
+
const {z: z$d} = await importShared('zod');
|
|
3034
|
+
const createPasswordTransformerSchema = definitionSchema((ctx) => ctx.withEnt(z$d.object({
|
|
3022
3035
|
...baseTransformerFields,
|
|
3023
|
-
type: z$
|
|
3036
|
+
type: z$d.literal('password'),
|
|
3024
3037
|
}), {
|
|
3025
3038
|
type: modelTransformerEntityType,
|
|
3026
3039
|
parentPath: { context: 'model' },
|
|
3027
3040
|
getNameResolver: () => 'password',
|
|
3028
3041
|
}));
|
|
3029
|
-
const createEmbeddedRelationTransformerSchema = definitionSchema((ctx) => ctx.withRefBuilder(ctx.withEnt(z$
|
|
3042
|
+
const createEmbeddedRelationTransformerSchema = definitionSchema((ctx) => ctx.withRefBuilder(ctx.withEnt(z$d.object({
|
|
3030
3043
|
...baseTransformerFields,
|
|
3031
3044
|
foreignRelationRef: ctx.withRef({
|
|
3032
3045
|
type: modelForeignRelationEntityType,
|
|
3033
3046
|
onDelete: 'DELETE_PARENT',
|
|
3034
3047
|
parentPath: { context: 'model' },
|
|
3035
3048
|
}),
|
|
3036
|
-
type: z$
|
|
3037
|
-
embeddedFieldNames: z$
|
|
3049
|
+
type: z$d.literal('embeddedRelation'),
|
|
3050
|
+
embeddedFieldNames: z$d.array(ctx.withRef({
|
|
3038
3051
|
type: modelScalarFieldEntityType,
|
|
3039
3052
|
onDelete: 'RESTRICT',
|
|
3040
3053
|
parentPath: { context: 'embeddedModel' },
|
|
3041
3054
|
})),
|
|
3042
|
-
embeddedTransformerNames: z$
|
|
3055
|
+
embeddedTransformerNames: z$d
|
|
3043
3056
|
.array(ctx.withRef({
|
|
3044
3057
|
type: modelTransformerEntityType,
|
|
3045
3058
|
onDelete: 'RESTRICT',
|
|
@@ -3119,46 +3132,46 @@ const createTransformerSchema = definitionSchema((ctx) => baseTransformerSchema.
|
|
|
3119
3132
|
});
|
|
3120
3133
|
}));
|
|
3121
3134
|
|
|
3122
|
-
const {z: z$
|
|
3123
|
-
const createEnumValueSchema = definitionSchema((ctx) => ctx.withEnt(z$
|
|
3124
|
-
id: z$
|
|
3125
|
-
name: z$
|
|
3126
|
-
friendlyName: z$
|
|
3135
|
+
const {z: z$c} = await importShared('zod');
|
|
3136
|
+
const createEnumValueSchema = definitionSchema((ctx) => ctx.withEnt(z$c.object({
|
|
3137
|
+
id: z$c.string(),
|
|
3138
|
+
name: z$c.string().min(1),
|
|
3139
|
+
friendlyName: z$c.string().min(1),
|
|
3127
3140
|
}), {
|
|
3128
3141
|
type: modelEnumValueEntityType,
|
|
3129
3142
|
parentPath: { context: 'enum' },
|
|
3130
3143
|
}));
|
|
3131
|
-
const createEnumBaseSchema = definitionSchema((ctx) => z$
|
|
3132
|
-
id: z$
|
|
3133
|
-
name: z$
|
|
3144
|
+
const createEnumBaseSchema = definitionSchema((ctx) => z$c.object({
|
|
3145
|
+
id: z$c.string(),
|
|
3146
|
+
name: z$c.string().min(1),
|
|
3134
3147
|
featureRef: ctx.withRef({
|
|
3135
3148
|
type: featureEntityType,
|
|
3136
3149
|
onDelete: 'RESTRICT',
|
|
3137
3150
|
}),
|
|
3138
|
-
values: z$
|
|
3139
|
-
isExposed: z$
|
|
3151
|
+
values: z$c.array(createEnumValueSchema(ctx)),
|
|
3152
|
+
isExposed: z$c.boolean(),
|
|
3140
3153
|
}));
|
|
3141
3154
|
const createEnumSchema = definitionSchema((ctx) => ctx.withEnt(createEnumBaseSchema(ctx), {
|
|
3142
3155
|
type: modelEnumEntityType,
|
|
3143
3156
|
addContext: 'enum',
|
|
3144
3157
|
}));
|
|
3145
3158
|
|
|
3146
|
-
const {z: z$
|
|
3159
|
+
const {z: z$b} = await importShared('zod');
|
|
3147
3160
|
const createModelScalarFieldSchema = definitionSchema((ctx) => ctx
|
|
3148
|
-
.withEnt(z$
|
|
3149
|
-
id: z$
|
|
3161
|
+
.withEnt(z$b.object({
|
|
3162
|
+
id: z$b.string(),
|
|
3150
3163
|
name: VALIDATORS.CAMEL_CASE_STRING,
|
|
3151
|
-
type: z$
|
|
3152
|
-
isOptional: z$
|
|
3153
|
-
options: ctx.withRefBuilder(z$
|
|
3164
|
+
type: z$b.enum(SCALAR_FIELD_TYPES),
|
|
3165
|
+
isOptional: z$b.boolean().default(false),
|
|
3166
|
+
options: ctx.withRefBuilder(z$b
|
|
3154
3167
|
.object({
|
|
3155
3168
|
// string options
|
|
3156
|
-
default: z$
|
|
3169
|
+
default: z$b.string().default(''),
|
|
3157
3170
|
// uuid options
|
|
3158
|
-
genUuid: z$
|
|
3171
|
+
genUuid: z$b.boolean().optional(),
|
|
3159
3172
|
// date options
|
|
3160
|
-
updatedAt: z$
|
|
3161
|
-
defaultToNow: z$
|
|
3173
|
+
updatedAt: z$b.boolean().optional(),
|
|
3174
|
+
defaultToNow: z$b.boolean().optional(),
|
|
3162
3175
|
// enum options
|
|
3163
3176
|
enumRef: ctx
|
|
3164
3177
|
.withRef({
|
|
@@ -3166,7 +3179,7 @@ const createModelScalarFieldSchema = definitionSchema((ctx) => ctx
|
|
|
3166
3179
|
onDelete: 'RESTRICT',
|
|
3167
3180
|
})
|
|
3168
3181
|
.optional(),
|
|
3169
|
-
defaultEnumValueRef: z$
|
|
3182
|
+
defaultEnumValueRef: z$b.string().optional(),
|
|
3170
3183
|
})
|
|
3171
3184
|
.transform((val) => ({
|
|
3172
3185
|
...val,
|
|
@@ -3218,13 +3231,13 @@ const REFERENTIAL_ACTIONS = [
|
|
|
3218
3231
|
'SetNull',
|
|
3219
3232
|
'SetDefault',
|
|
3220
3233
|
];
|
|
3221
|
-
const createModelRelationFieldSchema = definitionSchema((ctx) => ctx.withRefBuilder(z$
|
|
3222
|
-
id: z$
|
|
3223
|
-
foreignId: z$
|
|
3234
|
+
const createModelRelationFieldSchema = definitionSchema((ctx) => ctx.withRefBuilder(z$b.object({
|
|
3235
|
+
id: z$b.string(),
|
|
3236
|
+
foreignId: z$b
|
|
3224
3237
|
.string()
|
|
3225
3238
|
.default(() => modelForeignRelationEntityType.generateNewId()),
|
|
3226
3239
|
name: VALIDATORS.CAMEL_CASE_STRING,
|
|
3227
|
-
references: z$
|
|
3240
|
+
references: z$b.array(z$b.object({
|
|
3228
3241
|
localRef: ctx.withRef({
|
|
3229
3242
|
type: modelScalarFieldEntityType,
|
|
3230
3243
|
onDelete: 'RESTRICT',
|
|
@@ -3236,10 +3249,10 @@ const createModelRelationFieldSchema = definitionSchema((ctx) => ctx.withRefBuil
|
|
|
3236
3249
|
parentPath: { context: 'foreignModel' },
|
|
3237
3250
|
}),
|
|
3238
3251
|
})),
|
|
3239
|
-
modelRef: z$
|
|
3252
|
+
modelRef: z$b.string().min(1),
|
|
3240
3253
|
foreignRelationName: VALIDATORS.CAMEL_CASE_STRING,
|
|
3241
|
-
onDelete: z$
|
|
3242
|
-
onUpdate: z$
|
|
3254
|
+
onDelete: z$b.enum(REFERENTIAL_ACTIONS).default('Cascade'),
|
|
3255
|
+
onUpdate: z$b.enum(REFERENTIAL_ACTIONS).default('Restrict'),
|
|
3243
3256
|
}), (builder) => {
|
|
3244
3257
|
builder.addReference({
|
|
3245
3258
|
type: modelEntityType,
|
|
@@ -3258,9 +3271,9 @@ const createModelRelationFieldSchema = definitionSchema((ctx) => ctx.withRefBuil
|
|
|
3258
3271
|
parentPath: 'modelRef',
|
|
3259
3272
|
});
|
|
3260
3273
|
}));
|
|
3261
|
-
const createModelUniqueConstraintSchema = definitionSchema((ctx) => ctx.withEnt(z$
|
|
3262
|
-
id: z$
|
|
3263
|
-
fields: z$
|
|
3274
|
+
const createModelUniqueConstraintSchema = definitionSchema((ctx) => ctx.withEnt(z$b.object({
|
|
3275
|
+
id: z$b.string(),
|
|
3276
|
+
fields: z$b.array(z$b.object({
|
|
3264
3277
|
fieldRef: ctx.withRef({
|
|
3265
3278
|
type: modelScalarFieldEntityType,
|
|
3266
3279
|
onDelete: 'RESTRICT',
|
|
@@ -3277,18 +3290,18 @@ const createModelUniqueConstraintSchema = definitionSchema((ctx) => ctx.withEnt(
|
|
|
3277
3290
|
});
|
|
3278
3291
|
},
|
|
3279
3292
|
}));
|
|
3280
|
-
const createModelServiceSchema = definitionSchema((ctx) => z$
|
|
3281
|
-
create: z$
|
|
3293
|
+
const createModelServiceSchema = definitionSchema((ctx) => z$b.object({
|
|
3294
|
+
create: z$b
|
|
3282
3295
|
.object({
|
|
3283
|
-
enabled: z$
|
|
3284
|
-
fields: z$
|
|
3296
|
+
enabled: z$b.boolean().default(false),
|
|
3297
|
+
fields: z$b
|
|
3285
3298
|
.array(ctx.withRef({
|
|
3286
3299
|
type: modelScalarFieldEntityType,
|
|
3287
3300
|
onDelete: 'DELETE',
|
|
3288
3301
|
parentPath: { context: 'model' },
|
|
3289
3302
|
}))
|
|
3290
3303
|
.optional(),
|
|
3291
|
-
transformerNames: z$
|
|
3304
|
+
transformerNames: z$b
|
|
3292
3305
|
.array(ctx.withRef({
|
|
3293
3306
|
type: modelTransformerEntityType,
|
|
3294
3307
|
onDelete: 'DELETE',
|
|
@@ -3297,17 +3310,17 @@ const createModelServiceSchema = definitionSchema((ctx) => z$c.object({
|
|
|
3297
3310
|
.optional(),
|
|
3298
3311
|
})
|
|
3299
3312
|
.default({ enabled: false }),
|
|
3300
|
-
update: z$
|
|
3313
|
+
update: z$b
|
|
3301
3314
|
.object({
|
|
3302
|
-
enabled: z$
|
|
3303
|
-
fields: z$
|
|
3315
|
+
enabled: z$b.boolean().default(false),
|
|
3316
|
+
fields: z$b
|
|
3304
3317
|
.array(ctx.withRef({
|
|
3305
3318
|
type: modelScalarFieldEntityType,
|
|
3306
3319
|
onDelete: 'DELETE',
|
|
3307
3320
|
parentPath: { context: 'model' },
|
|
3308
3321
|
}))
|
|
3309
3322
|
.optional(),
|
|
3310
|
-
transformerNames: z$
|
|
3323
|
+
transformerNames: z$b
|
|
3311
3324
|
.array(ctx.withRef({
|
|
3312
3325
|
type: modelTransformerEntityType,
|
|
3313
3326
|
onDelete: 'DELETE',
|
|
@@ -3316,33 +3329,33 @@ const createModelServiceSchema = definitionSchema((ctx) => z$c.object({
|
|
|
3316
3329
|
.optional(),
|
|
3317
3330
|
})
|
|
3318
3331
|
.default({ enabled: false }),
|
|
3319
|
-
delete: z$
|
|
3332
|
+
delete: z$b
|
|
3320
3333
|
.object({
|
|
3321
|
-
enabled: z$
|
|
3334
|
+
enabled: z$b.boolean().default(false),
|
|
3322
3335
|
})
|
|
3323
3336
|
.default({
|
|
3324
3337
|
enabled: false,
|
|
3325
3338
|
}),
|
|
3326
|
-
transformers: z$
|
|
3339
|
+
transformers: z$b.array(createTransformerSchema(ctx)).default([]),
|
|
3327
3340
|
}));
|
|
3328
|
-
const createModelBaseSchema = definitionSchema((ctx) => z$
|
|
3329
|
-
id: z$
|
|
3341
|
+
const createModelBaseSchema = definitionSchema((ctx) => z$b.object({
|
|
3342
|
+
id: z$b.string(),
|
|
3330
3343
|
name: VALIDATORS.PASCAL_CASE_STRING,
|
|
3331
3344
|
featureRef: ctx.withRef({
|
|
3332
3345
|
type: featureEntityType,
|
|
3333
3346
|
onDelete: 'RESTRICT',
|
|
3334
3347
|
}),
|
|
3335
|
-
model: z$
|
|
3336
|
-
fields: z$
|
|
3337
|
-
relations: z$
|
|
3338
|
-
primaryKeyFieldRefs: z$
|
|
3348
|
+
model: z$b.object({
|
|
3349
|
+
fields: z$b.array(createModelScalarFieldSchema(ctx)),
|
|
3350
|
+
relations: z$b.array(createModelRelationFieldSchema(ctx)).optional(),
|
|
3351
|
+
primaryKeyFieldRefs: z$b
|
|
3339
3352
|
.array(ctx.withRef({
|
|
3340
3353
|
type: modelScalarFieldEntityType,
|
|
3341
3354
|
onDelete: 'RESTRICT',
|
|
3342
3355
|
parentPath: { context: 'model' },
|
|
3343
3356
|
}))
|
|
3344
3357
|
.min(1),
|
|
3345
|
-
uniqueConstraints: z$
|
|
3358
|
+
uniqueConstraints: z$b
|
|
3346
3359
|
.array(createModelUniqueConstraintSchema(ctx))
|
|
3347
3360
|
.optional(),
|
|
3348
3361
|
}),
|
|
@@ -3363,22 +3376,22 @@ const adminSectionEntityType = createEntityType('admin-section', {
|
|
|
3363
3376
|
parentType: appEntityType,
|
|
3364
3377
|
});
|
|
3365
3378
|
|
|
3366
|
-
const {z: z$
|
|
3367
|
-
const createBaseAdminSectionValidators = definitionSchema((ctx) => z$
|
|
3368
|
-
id: z$
|
|
3369
|
-
name: z$
|
|
3379
|
+
const {z: z$a} = await importShared('zod');
|
|
3380
|
+
const createBaseAdminSectionValidators = definitionSchema((ctx) => z$a.object({
|
|
3381
|
+
id: z$a.string().default(adminSectionEntityType.generateNewId()),
|
|
3382
|
+
name: z$a.string().min(1),
|
|
3370
3383
|
featureRef: ctx.withRef({
|
|
3371
3384
|
type: featureEntityType,
|
|
3372
3385
|
onDelete: 'RESTRICT',
|
|
3373
3386
|
}),
|
|
3374
|
-
icon: z$
|
|
3375
|
-
type: z$
|
|
3387
|
+
icon: z$a.string().optional(),
|
|
3388
|
+
type: z$a.string().min(1),
|
|
3376
3389
|
}));
|
|
3377
3390
|
|
|
3378
|
-
const {z: z$
|
|
3379
|
-
const baseAdminCrudInputSchema = z$
|
|
3380
|
-
type: z$
|
|
3381
|
-
label: z$
|
|
3391
|
+
const {z: z$9} = await importShared('zod');
|
|
3392
|
+
const baseAdminCrudInputSchema = z$9.object({
|
|
3393
|
+
type: z$9.string().min(1),
|
|
3394
|
+
label: z$9.string().min(1),
|
|
3382
3395
|
});
|
|
3383
3396
|
function createAdminCrudInputType(payload) {
|
|
3384
3397
|
return payload;
|
|
@@ -3387,41 +3400,41 @@ const adminCrudEmbeddedFormEntityType = createEntityType('admin-crud-embedded-fo
|
|
|
3387
3400
|
parentType: adminSectionEntityType,
|
|
3388
3401
|
});
|
|
3389
3402
|
|
|
3390
|
-
const {z: z$
|
|
3391
|
-
const createAdminCrudTextInputSchema = definitionSchema((ctx) => z$
|
|
3392
|
-
type: z$
|
|
3393
|
-
label: z$
|
|
3403
|
+
const {z: z$8} = await importShared('zod');
|
|
3404
|
+
const createAdminCrudTextInputSchema = definitionSchema((ctx) => z$8.object({
|
|
3405
|
+
type: z$8.literal('text'),
|
|
3406
|
+
label: z$8.string().min(1),
|
|
3394
3407
|
modelFieldRef: ctx.withRef({
|
|
3395
3408
|
type: modelScalarFieldEntityType,
|
|
3396
3409
|
onDelete: 'RESTRICT',
|
|
3397
3410
|
parentPath: { context: 'model' },
|
|
3398
3411
|
}),
|
|
3399
|
-
validation: z$
|
|
3412
|
+
validation: z$8.string().optional(),
|
|
3400
3413
|
}));
|
|
3401
3414
|
const adminCrudTextInputType = createAdminCrudInputType({
|
|
3402
3415
|
name: 'text',
|
|
3403
3416
|
createSchema: createAdminCrudTextInputSchema,
|
|
3404
3417
|
});
|
|
3405
|
-
const createAdminCrudForeignInputSchema = definitionSchema((ctx) => z$
|
|
3406
|
-
type: z$
|
|
3407
|
-
label: z$
|
|
3418
|
+
const createAdminCrudForeignInputSchema = definitionSchema((ctx) => z$8.object({
|
|
3419
|
+
type: z$8.literal('foreign'),
|
|
3420
|
+
label: z$8.string().min(1),
|
|
3408
3421
|
localRelationRef: ctx.withRef({
|
|
3409
3422
|
type: modelLocalRelationEntityType,
|
|
3410
3423
|
onDelete: 'RESTRICT',
|
|
3411
3424
|
parentPath: { context: 'model' },
|
|
3412
3425
|
}),
|
|
3413
|
-
labelExpression: z$
|
|
3414
|
-
valueExpression: z$
|
|
3415
|
-
defaultLabel: z$
|
|
3416
|
-
nullLabel: z$
|
|
3426
|
+
labelExpression: z$8.string().min(1),
|
|
3427
|
+
valueExpression: z$8.string().min(1),
|
|
3428
|
+
defaultLabel: z$8.string().optional(),
|
|
3429
|
+
nullLabel: z$8.string().optional(),
|
|
3417
3430
|
}));
|
|
3418
3431
|
const adminCrudForeignInputType = createAdminCrudInputType({
|
|
3419
3432
|
name: 'foreign',
|
|
3420
3433
|
createSchema: createAdminCrudForeignInputSchema,
|
|
3421
3434
|
});
|
|
3422
|
-
const createAdminCrudEnumInputSchema = definitionSchema((ctx) => z$
|
|
3423
|
-
type: z$
|
|
3424
|
-
label: z$
|
|
3435
|
+
const createAdminCrudEnumInputSchema = definitionSchema((ctx) => z$8.object({
|
|
3436
|
+
type: z$8.literal('enum'),
|
|
3437
|
+
label: z$8.string().min(1),
|
|
3425
3438
|
modelFieldRef: ctx.withRef({
|
|
3426
3439
|
type: modelScalarFieldEntityType,
|
|
3427
3440
|
onDelete: 'RESTRICT',
|
|
@@ -3432,9 +3445,9 @@ const adminCrudEnumInputType = createAdminCrudInputType({
|
|
|
3432
3445
|
name: 'enum',
|
|
3433
3446
|
createSchema: createAdminCrudEnumInputSchema,
|
|
3434
3447
|
});
|
|
3435
|
-
const createAdminCrudEmbeddedInputSchema = definitionSchema((ctx) => z$
|
|
3436
|
-
type: z$
|
|
3437
|
-
label: z$
|
|
3448
|
+
const createAdminCrudEmbeddedInputSchema = definitionSchema((ctx) => z$8.object({
|
|
3449
|
+
type: z$8.literal('embedded'),
|
|
3450
|
+
label: z$8.string().min(1),
|
|
3438
3451
|
modelRelationRef: ctx.withRef({
|
|
3439
3452
|
type: modelForeignRelationEntityType,
|
|
3440
3453
|
onDelete: 'RESTRICT',
|
|
@@ -3450,9 +3463,9 @@ const adminCrudEmbeddedInputType = createAdminCrudInputType({
|
|
|
3450
3463
|
name: 'embedded',
|
|
3451
3464
|
createSchema: createAdminCrudEmbeddedInputSchema,
|
|
3452
3465
|
});
|
|
3453
|
-
const createAdminCrudEmbeddedLocalInputSchema = definitionSchema((ctx) => z$
|
|
3454
|
-
type: z$
|
|
3455
|
-
label: z$
|
|
3466
|
+
const createAdminCrudEmbeddedLocalInputSchema = definitionSchema((ctx) => z$8.object({
|
|
3467
|
+
type: z$8.literal('embeddedLocal'),
|
|
3468
|
+
label: z$8.string().min(1),
|
|
3456
3469
|
localRelationRef: ctx.withRef({
|
|
3457
3470
|
type: modelLocalRelationEntityType,
|
|
3458
3471
|
onDelete: 'RESTRICT',
|
|
@@ -3468,9 +3481,9 @@ const adminCrudEmbeddedLocalInputType = createAdminCrudInputType({
|
|
|
3468
3481
|
name: 'embeddedLocal',
|
|
3469
3482
|
createSchema: createAdminCrudEmbeddedLocalInputSchema,
|
|
3470
3483
|
});
|
|
3471
|
-
const createAdminCrudPasswordInputSchema = definitionSchema(() => z$
|
|
3472
|
-
type: z$
|
|
3473
|
-
label: z$
|
|
3484
|
+
const createAdminCrudPasswordInputSchema = definitionSchema(() => z$8.object({
|
|
3485
|
+
type: z$8.literal('password'),
|
|
3486
|
+
label: z$8.string().min(1),
|
|
3474
3487
|
}));
|
|
3475
3488
|
const adminCrudPasswordInputType = createAdminCrudInputType({
|
|
3476
3489
|
name: 'password',
|
|
@@ -3526,69 +3539,69 @@ const createAdminCrudInputSchema = definitionSchema((ctx) => baseAdminCrudInputS
|
|
|
3526
3539
|
});
|
|
3527
3540
|
}));
|
|
3528
3541
|
|
|
3529
|
-
const {z: z$
|
|
3542
|
+
const {z: z$7} = await importShared('zod');
|
|
3530
3543
|
// Table Columns
|
|
3531
|
-
const createAdminCrudForeignDisplaySchema = definitionSchema((ctx) => z$
|
|
3532
|
-
type: z$
|
|
3544
|
+
const createAdminCrudForeignDisplaySchema = definitionSchema((ctx) => z$7.object({
|
|
3545
|
+
type: z$7.literal('foreign'),
|
|
3533
3546
|
localRelationRef: ctx.withRef({
|
|
3534
3547
|
type: modelLocalRelationEntityType,
|
|
3535
3548
|
onDelete: 'RESTRICT',
|
|
3536
3549
|
parentPath: { context: 'model' },
|
|
3537
3550
|
}),
|
|
3538
|
-
labelExpression: z$
|
|
3539
|
-
valueExpression: z$
|
|
3551
|
+
labelExpression: z$7.string().min(1),
|
|
3552
|
+
valueExpression: z$7.string().min(1),
|
|
3540
3553
|
}));
|
|
3541
|
-
const createAdminCrudTextDisplaySchema = definitionSchema((ctx) => z$
|
|
3542
|
-
type: z$
|
|
3554
|
+
const createAdminCrudTextDisplaySchema = definitionSchema((ctx) => z$7.object({
|
|
3555
|
+
type: z$7.literal('text'),
|
|
3543
3556
|
modelFieldRef: ctx.withRef({
|
|
3544
3557
|
type: modelScalarFieldEntityType,
|
|
3545
3558
|
onDelete: 'RESTRICT',
|
|
3546
3559
|
parentPath: { context: 'model' },
|
|
3547
3560
|
}),
|
|
3548
3561
|
}));
|
|
3549
|
-
const createAdminCrudDisplaySchema = definitionSchema((ctx) => z$
|
|
3562
|
+
const createAdminCrudDisplaySchema = definitionSchema((ctx) => z$7.discriminatedUnion('type', [
|
|
3550
3563
|
createAdminCrudTextDisplaySchema(ctx),
|
|
3551
3564
|
createAdminCrudForeignDisplaySchema(ctx),
|
|
3552
3565
|
]));
|
|
3553
3566
|
// TODO: Improve this to be more dynamic in the future
|
|
3554
3567
|
const adminCrudDisplayTypes = ['text', 'foreign'];
|
|
3555
|
-
const createAdminCrudTableColumnSchema = definitionSchema((ctx) => z$
|
|
3556
|
-
label: z$
|
|
3568
|
+
const createAdminCrudTableColumnSchema = definitionSchema((ctx) => z$7.object({
|
|
3569
|
+
label: z$7.string().min(1),
|
|
3557
3570
|
display: createAdminCrudDisplaySchema(ctx),
|
|
3558
3571
|
}));
|
|
3559
3572
|
// Embedded Crud
|
|
3560
|
-
const createAdminCrudEmbeddedObjectSchema = definitionSchema((ctx) => z$
|
|
3561
|
-
id: z$
|
|
3562
|
-
name: z$
|
|
3573
|
+
const createAdminCrudEmbeddedObjectSchema = definitionSchema((ctx) => z$7.object({
|
|
3574
|
+
id: z$7.string().min(1),
|
|
3575
|
+
name: z$7.string().min(1),
|
|
3563
3576
|
modelRef: ctx.withRef({
|
|
3564
3577
|
type: modelEntityType,
|
|
3565
3578
|
onDelete: 'RESTRICT',
|
|
3566
3579
|
}),
|
|
3567
|
-
includeIdField: z$
|
|
3568
|
-
type: z$
|
|
3569
|
-
form: z$
|
|
3570
|
-
fields: z$
|
|
3580
|
+
includeIdField: z$7.boolean().optional(),
|
|
3581
|
+
type: z$7.literal('object'),
|
|
3582
|
+
form: z$7.object({
|
|
3583
|
+
fields: z$7.array(createAdminCrudInputSchema(ctx)),
|
|
3571
3584
|
}),
|
|
3572
3585
|
}));
|
|
3573
|
-
const createAdminCrudEmbeddedListSchema = definitionSchema((ctx) => z$
|
|
3574
|
-
id: z$
|
|
3575
|
-
name: z$
|
|
3586
|
+
const createAdminCrudEmbeddedListSchema = definitionSchema((ctx) => z$7.object({
|
|
3587
|
+
id: z$7.string().min(1),
|
|
3588
|
+
name: z$7.string().min(1),
|
|
3576
3589
|
modelRef: ctx.withRef({
|
|
3577
3590
|
type: modelEntityType,
|
|
3578
3591
|
onDelete: 'RESTRICT',
|
|
3579
3592
|
}),
|
|
3580
|
-
includeIdField: z$
|
|
3581
|
-
type: z$
|
|
3593
|
+
includeIdField: z$7.boolean().optional(),
|
|
3594
|
+
type: z$7.literal('list'),
|
|
3582
3595
|
// NOTE: These two fields need to be synced with crud section schema
|
|
3583
3596
|
// because the web app expects that (TODO)
|
|
3584
|
-
table: z$
|
|
3585
|
-
columns: z$
|
|
3597
|
+
table: z$7.object({
|
|
3598
|
+
columns: z$7.array(createAdminCrudTableColumnSchema(ctx)),
|
|
3586
3599
|
}),
|
|
3587
|
-
form: z$
|
|
3588
|
-
fields: z$
|
|
3600
|
+
form: z$7.object({
|
|
3601
|
+
fields: z$7.array(createAdminCrudInputSchema(ctx)),
|
|
3589
3602
|
}),
|
|
3590
3603
|
}));
|
|
3591
|
-
const createAdminCrudEmbeddedFormSchema = definitionSchema((ctx) => ctx.withRefBuilder(z$
|
|
3604
|
+
const createAdminCrudEmbeddedFormSchema = definitionSchema((ctx) => ctx.withRefBuilder(z$7.discriminatedUnion('type', [
|
|
3592
3605
|
createAdminCrudEmbeddedObjectSchema(ctx),
|
|
3593
3606
|
createAdminCrudEmbeddedListSchema(ctx),
|
|
3594
3607
|
]), (builder) => {
|
|
@@ -3599,75 +3612,58 @@ const createAdminCrudEmbeddedFormSchema = definitionSchema((ctx) => ctx.withRefB
|
|
|
3599
3612
|
builder.addPathToContext('modelRef', modelEntityType, 'model');
|
|
3600
3613
|
}));
|
|
3601
3614
|
// Admin Section
|
|
3602
|
-
const createAdminCrudSectionSchema = definitionSchema((ctx) => ctx.withRefBuilder(createBaseAdminSectionValidators(ctx).and(z$
|
|
3603
|
-
type: z$
|
|
3615
|
+
const createAdminCrudSectionSchema = definitionSchema((ctx) => ctx.withRefBuilder(createBaseAdminSectionValidators(ctx).and(z$7.object({
|
|
3616
|
+
type: z$7.literal('crud'),
|
|
3604
3617
|
modelRef: ctx.withRef({
|
|
3605
3618
|
type: modelEntityType,
|
|
3606
3619
|
onDelete: 'RESTRICT',
|
|
3607
3620
|
}),
|
|
3608
|
-
disableCreate: z$
|
|
3609
|
-
table: z$
|
|
3610
|
-
columns: z$
|
|
3621
|
+
disableCreate: z$7.boolean().optional(),
|
|
3622
|
+
table: z$7.object({
|
|
3623
|
+
columns: z$7.array(createAdminCrudTableColumnSchema(ctx)),
|
|
3611
3624
|
}),
|
|
3612
|
-
form: z$
|
|
3613
|
-
fields: z$
|
|
3625
|
+
form: z$7.object({
|
|
3626
|
+
fields: z$7.array(createAdminCrudInputSchema(ctx)),
|
|
3614
3627
|
}),
|
|
3615
|
-
embeddedForms: z$
|
|
3628
|
+
embeddedForms: z$7
|
|
3616
3629
|
.array(createAdminCrudEmbeddedFormSchema(ctx))
|
|
3617
3630
|
.optional(),
|
|
3618
3631
|
})), (builder) => {
|
|
3619
3632
|
builder.addPathToContext('modelRef', modelEntityType, 'model');
|
|
3620
3633
|
}));
|
|
3621
3634
|
|
|
3622
|
-
const {z: z$
|
|
3623
|
-
const
|
|
3635
|
+
const {z: z$6} = await importShared('zod');
|
|
3636
|
+
const createWebAdminSectionSchema = definitionSchema((ctx) => ctx.withRefBuilder(createAdminCrudSectionSchema(ctx), (builder) => {
|
|
3624
3637
|
builder.addEntity({
|
|
3625
3638
|
type: adminSectionEntityType,
|
|
3626
3639
|
parentPath: { context: 'app' },
|
|
3627
3640
|
addContext: 'admin-section',
|
|
3628
3641
|
});
|
|
3629
3642
|
}));
|
|
3630
|
-
const createAdminAppSchema = definitionSchema((ctx) => z$
|
|
3631
|
-
|
|
3632
|
-
|
|
3633
|
-
allowedRoles: z$
|
|
3634
|
-
.array(ctx.withRef({
|
|
3643
|
+
const createAdminAppSchema = definitionSchema((ctx) => ctx.withDefault(z$6.object({
|
|
3644
|
+
enabled: z$6.boolean(),
|
|
3645
|
+
pathPrefix: z$6.string().default('/admin'),
|
|
3646
|
+
allowedRoles: ctx.withDefault(z$6.array(ctx.withRef({
|
|
3635
3647
|
type: authRoleEntityType,
|
|
3636
3648
|
onDelete: 'DELETE',
|
|
3637
|
-
}))
|
|
3638
|
-
|
|
3639
|
-
|
|
3640
|
-
}));
|
|
3641
|
-
const adminAppEntryType = createAppEntryType('admin');
|
|
3642
|
-
|
|
3643
|
-
const {z: z$6} = await importShared('zod');
|
|
3644
|
-
const createBackendAppSchema = definitionSchema(() => z$6.object({
|
|
3645
|
-
...baseAppValidators,
|
|
3646
|
-
type: z$6.literal('backend'),
|
|
3647
|
-
enableStripe: z$6.boolean().optional(),
|
|
3648
|
-
enableRedis: z$6.boolean().optional(),
|
|
3649
|
-
enableBullQueue: z$6.boolean().optional(),
|
|
3650
|
-
enablePostmark: z$6.boolean().optional(),
|
|
3651
|
-
enableSubscriptions: z$6.boolean().optional(),
|
|
3652
|
-
enableAxios: z$6.boolean().optional(),
|
|
3653
|
-
}));
|
|
3654
|
-
const backendAppEntryType = createAppEntryType('backend');
|
|
3649
|
+
})), []),
|
|
3650
|
+
sections: ctx.withDefault(z$6.array(createWebAdminSectionSchema(ctx)), []),
|
|
3651
|
+
}), { enabled: false, pathPrefix: '/admin' }));
|
|
3655
3652
|
|
|
3656
3653
|
const {z: z$5} = await importShared('zod');
|
|
3657
3654
|
const createWebAppSchema = definitionSchema((ctx) => z$5.object({
|
|
3658
3655
|
...baseAppValidators,
|
|
3659
3656
|
type: z$5.literal('web'),
|
|
3660
|
-
includeAuth: z$5.boolean()
|
|
3661
|
-
title: z$5.string().
|
|
3662
|
-
description: z$5.string().
|
|
3663
|
-
allowedRoles: z$5
|
|
3664
|
-
.array(ctx.withRef({
|
|
3657
|
+
includeAuth: ctx.withDefault(z$5.boolean(), false),
|
|
3658
|
+
title: z$5.string().default(''),
|
|
3659
|
+
description: z$5.string().default(''),
|
|
3660
|
+
allowedRoles: ctx.withDefault(z$5.array(ctx.withRef({
|
|
3665
3661
|
type: authRoleEntityType,
|
|
3666
3662
|
onDelete: 'DELETE',
|
|
3667
|
-
}))
|
|
3668
|
-
|
|
3669
|
-
|
|
3670
|
-
|
|
3663
|
+
})), []),
|
|
3664
|
+
includeUploadComponents: ctx.withDefault(z$5.boolean(), false),
|
|
3665
|
+
enableSubscriptions: ctx.withDefault(z$5.boolean(), false),
|
|
3666
|
+
adminApp: createAdminAppSchema(ctx),
|
|
3671
3667
|
}));
|
|
3672
3668
|
const webAppEntryType = createAppEntryType('web');
|
|
3673
3669
|
|
|
@@ -3751,7 +3747,6 @@ const {z: z$1} = await importShared('zod');
|
|
|
3751
3747
|
const createAppSchema = definitionSchema((ctx) => ctx.withRefBuilder(z$1.discriminatedUnion('type', [
|
|
3752
3748
|
createBackendAppSchema(ctx),
|
|
3753
3749
|
createWebAppSchema(ctx),
|
|
3754
|
-
createAdminAppSchema(ctx),
|
|
3755
3750
|
]), (builder) => {
|
|
3756
3751
|
builder.addEntity({
|
|
3757
3752
|
type: appEntityType,
|
|
@@ -9097,6 +9092,48 @@ const migration015NullParentRefs = createSchemaMigration({
|
|
|
9097
9092
|
},
|
|
9098
9093
|
});
|
|
9099
9094
|
|
|
9095
|
+
const migration016WebAdminConfig = createSchemaMigration({
|
|
9096
|
+
version: 16,
|
|
9097
|
+
name: 'webAdminApp',
|
|
9098
|
+
description: 'Convert admin apps to web apps with adminApp and add adminApp to existing web apps',
|
|
9099
|
+
migrate: (config) => {
|
|
9100
|
+
if (!config.apps) {
|
|
9101
|
+
return config;
|
|
9102
|
+
}
|
|
9103
|
+
const apps = config.apps.map((app) => {
|
|
9104
|
+
// Convert admin apps to web apps with adminConfig enabled
|
|
9105
|
+
if (app.type === 'admin') {
|
|
9106
|
+
const { sections, allowedRoles, ...restApp } = app;
|
|
9107
|
+
return {
|
|
9108
|
+
...restApp,
|
|
9109
|
+
type: 'web',
|
|
9110
|
+
adminApp: {
|
|
9111
|
+
enabled: true,
|
|
9112
|
+
pathPrefix: '/admin',
|
|
9113
|
+
sections: sections ?? [],
|
|
9114
|
+
allowedRoles: allowedRoles ?? undefined,
|
|
9115
|
+
},
|
|
9116
|
+
};
|
|
9117
|
+
}
|
|
9118
|
+
// Add adminApp to web apps that don't already have it
|
|
9119
|
+
if (app.type === 'web' && !('adminApp' in app)) {
|
|
9120
|
+
return {
|
|
9121
|
+
...app,
|
|
9122
|
+
adminApp: {
|
|
9123
|
+
enabled: false,
|
|
9124
|
+
pathPrefix: '/admin',
|
|
9125
|
+
},
|
|
9126
|
+
};
|
|
9127
|
+
}
|
|
9128
|
+
return app;
|
|
9129
|
+
});
|
|
9130
|
+
return {
|
|
9131
|
+
...config,
|
|
9132
|
+
apps,
|
|
9133
|
+
};
|
|
9134
|
+
},
|
|
9135
|
+
});
|
|
9136
|
+
|
|
9100
9137
|
const SCHEMA_MIGRATIONS = [
|
|
9101
9138
|
migration005PrimaryUniqueRefs,
|
|
9102
9139
|
migration006IndividualServiceControllers,
|
|
@@ -9109,6 +9146,7 @@ const SCHEMA_MIGRATIONS = [
|
|
|
9109
9146
|
migration013MoveGeneralSettings,
|
|
9110
9147
|
migration014MigratePluginIds,
|
|
9111
9148
|
migration015NullParentRefs,
|
|
9149
|
+
migration016WebAdminConfig,
|
|
9112
9150
|
];
|
|
9113
9151
|
function isMigrateableProjectDefinition(projectDefinition) {
|
|
9114
9152
|
return (typeof projectDefinition === 'object' &&
|
|
@@ -10247,5 +10285,5 @@ function generateDefaultTheme() {
|
|
|
10247
10285
|
};
|
|
10248
10286
|
}
|
|
10249
10287
|
|
|
10250
|
-
export { AVAILABLE_FLAGS, AppUtils, BUILT_IN_ADMIN_CRUD_INPUTS, BUILT_IN_TRANSFORMERS, COLOR_PALETTES, DefinitionRefBuilder, EnumUtils, FIXED_COLOR_MAPPINGS, ModelFieldUtils, ModelTransformerUtils, ModelUtils, PALETTE_SHADES, PluginImplementationStore, PluginUtils, ProjectDefinitionContainer, REFERENTIAL_ACTIONS, SCALAR_FIELD_TYPES, SCHEMA_MIGRATIONS, SchemaMigrationError, THEME_COLORS, THEME_COLOR_KEYS, VALIDATORS,
|
|
10251
|
-
//# sourceMappingURL=project-builder-lib-
|
|
10288
|
+
export { AVAILABLE_FLAGS, AppUtils, BUILT_IN_ADMIN_CRUD_INPUTS, BUILT_IN_TRANSFORMERS, COLOR_PALETTES, DefinitionRefBuilder, EnumUtils, FIXED_COLOR_MAPPINGS, ModelFieldUtils, ModelTransformerUtils, ModelUtils, PALETTE_SHADES, PluginImplementationStore, PluginUtils, ProjectDefinitionContainer, REFERENTIAL_ACTIONS, SCALAR_FIELD_TYPES, SCHEMA_MIGRATIONS, SchemaMigrationError, THEME_COLORS, THEME_COLOR_KEYS, VALIDATORS, adminCrudDisplayTypes, adminCrudEmbeddedFormEntityType, adminCrudEmbeddedInputType, adminCrudEmbeddedLocalInputType, adminCrudInputCompilerSpec, adminCrudInputSpec, adminSectionEntityType, appCompilerSpec, appEntityType, authConfigSpec, authRoleEntityType, backendAppEntryType, baseAdminCrudInputSchema, baseAppSchema, baseAppValidators, basePluginDefinitionSchema, baseTransformerFields, baseTransformerSchema, convertColorNameToOklch, convertHexToOklch, convertOklchToColorName, convertOklchToHex, createAdminAppSchema, createAdminCrudDisplaySchema, createAdminCrudEmbeddedFormSchema, createAdminCrudEmbeddedInputSchema, createAdminCrudEmbeddedListSchema, createAdminCrudEmbeddedLocalInputSchema, createAdminCrudEmbeddedObjectSchema, createAdminCrudEnumInputSchema, createAdminCrudForeignDisplaySchema, createAdminCrudForeignInputSchema, createAdminCrudInputCompilerImplementation, createAdminCrudInputImplementation, createAdminCrudInputSchema, createAdminCrudInputType, createAdminCrudPasswordInputSchema, createAdminCrudSectionSchema, createAdminCrudTableColumnSchema, createAdminCrudTextDisplaySchema, createAdminCrudTextInputSchema, createAppCompiler, createAppCompilerPlugin, createAppEntryType, createAppSchema, createBackendAppSchema, createBaseAdminSectionValidators, createDefinitionEntityNameResolver, createDefinitionSchemaParserContext, createEmbeddedRelationTransformerSchema, createEntityType, createEnumBaseSchema, createEnumSchema, createEnumValueSchema, createFeaturesSchema, createModelBaseSchema, createModelGraphqlSchema, createModelRelationFieldSchema, createModelScalarFieldSchema, createModelSchema, createModelServiceSchema, createModelTransformerCompilerImplementation, createModelTransformerImplementation, createModelTransformerType, createModelUniqueConstraintSchema, createPasswordTransformerSchema, createPlatformPluginExport, createPluginConfigImplementation, createPluginImplementationStore, createPluginSpec, createPluginWithConfigSchema, createPluginsSchema, createProjectDefinitionSchema, createProjectDefinitionSchemaWithContext, createSettingsSchema, createTemplateExtractorSchema, createTestProjectDefinition, createTestProjectDefinitionContainer, createTestProjectDefinitionInput, createThemeSchema, createTransformerSchema, createWebAdminSectionSchema, createWebAppSchema, createWebConfigImplementation, definitionSchema, deserializeSchemaWithTransformedReferences, extractDefinitionRefs, extractDefinitionRefsRecursive, featureEntityType, fixRefDeletions, generalSettingsSchema, generateCssFromThemeConfig, generateDefaultTheme, generateThemeColorsFromShade, getBackendRelativePath, getDefaultThemeColorFromShade, getLatestMigrationVersion, initializePlugins, isMigrateableProjectDefinition, modelEntityType, modelEnumEntityType, modelEnumValueEntityType, modelForeignRelationEntityType, modelLocalRelationEntityType, modelScalarFieldEntityType, modelTransformerCompilerSpec, modelTransformerEntityType, modelTransformerSpec, modelUniqueConstraintEntityType, oklchColor, paletteSchema, palettesSchema, parseOklch, parseProjectDefinitionWithContext, parseProjectDefinitionWithReferences, pluginConfigSpec, pluginEntityType, pluginManifestJsonSchema, pluginMetadataSchema, pluginSpecDependencySchema, pluginSpecSupportSchema, runPluginMigrations, runSchemaMigrations, serializeSchema, serializeSchemaFromRefPayload, stripEmptyGeneratorChildren, stripUndefinedValues, themeColorSchema, undefinedIfEmpty, undefinedIfFalsy, webAppEntryType, webConfigSpec };
|
|
10289
|
+
//# sourceMappingURL=project-builder-lib-B7442OYh.js.map
|