@baseplate-dev/project-builder-lib 0.2.0 → 0.2.2
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/definition/feature/feature-utils.js +1 -1
- package/dist/definition/feature/feature-utils.js.map +1 -1
- package/dist/definition/project-definition-container.d.ts +3 -2
- package/dist/definition/project-definition-container.d.ts.map +1 -1
- package/dist/definition/project-definition-container.js +8 -6
- package/dist/definition/project-definition-container.js.map +1 -1
- package/dist/definition/project-definition-container.test-utils.d.ts.map +1 -1
- package/dist/definition/project-definition-container.test-utils.js +3 -7
- package/dist/definition/project-definition-container.test-utils.js.map +1 -1
- package/dist/migrations/index.d.ts.map +1 -1
- package/dist/migrations/index.js +2 -0
- package/dist/migrations/index.js.map +1 -1
- package/dist/migrations/migration-015-null-parent-refs.d.ts +17 -0
- package/dist/migrations/migration-015-null-parent-refs.d.ts.map +1 -0
- package/dist/migrations/migration-015-null-parent-refs.js +20 -0
- package/dist/migrations/migration-015-null-parent-refs.js.map +1 -0
- package/dist/parser/parser.d.ts +2 -2
- package/dist/parser/parser.d.ts.map +1 -1
- package/dist/parser/parser.js +11 -7
- package/dist/parser/parser.js.map +1 -1
- package/dist/plugins/migrations/run-migrations.js.map +1 -1
- package/dist/plugins/schema/index.d.ts +0 -2
- package/dist/plugins/schema/index.d.ts.map +1 -1
- package/dist/plugins/schema/index.js +0 -2
- package/dist/plugins/schema/index.js.map +1 -1
- package/dist/plugins/spec/config-spec.d.ts +3 -3
- package/dist/plugins/spec/config-spec.d.ts.map +1 -1
- package/dist/plugins/spec/config-spec.js +3 -3
- package/dist/plugins/spec/config-spec.js.map +1 -1
- package/dist/references/{ref-builder.d.ts → definition-ref-builder.d.ts} +13 -137
- package/dist/references/definition-ref-builder.d.ts.map +1 -0
- package/dist/references/definition-ref-builder.js +242 -0
- package/dist/references/definition-ref-builder.js.map +1 -0
- package/dist/references/deserialize-schema.d.ts +12 -1
- package/dist/references/deserialize-schema.d.ts.map +1 -1
- package/dist/references/deserialize-schema.js +24 -4
- package/dist/references/deserialize-schema.js.map +1 -1
- package/dist/references/extend-parser-context-with-refs.d.ts +16 -0
- package/dist/references/extend-parser-context-with-refs.d.ts.map +1 -0
- package/dist/references/extend-parser-context-with-refs.js +82 -0
- package/dist/references/extend-parser-context-with-refs.js.map +1 -0
- package/dist/references/extract-definition-refs.d.ts +19 -0
- package/dist/references/extract-definition-refs.d.ts.map +1 -0
- package/dist/references/extract-definition-refs.js +63 -0
- package/dist/references/extract-definition-refs.js.map +1 -0
- package/dist/references/fix-ref-deletions.d.ts +6 -6
- package/dist/references/fix-ref-deletions.d.ts.map +1 -1
- package/dist/references/fix-ref-deletions.js +13 -5
- package/dist/references/fix-ref-deletions.js.map +1 -1
- package/dist/references/index.d.ts +2 -1
- package/dist/references/index.d.ts.map +1 -1
- package/dist/references/index.js +2 -1
- package/dist/references/index.js.map +1 -1
- package/dist/references/markers.d.ts +22 -0
- package/dist/references/markers.d.ts.map +1 -0
- package/dist/references/markers.js +21 -0
- package/dist/references/markers.js.map +1 -0
- package/dist/references/parse-schema-with-references.d.ts +2 -2
- package/dist/references/parse-schema-with-references.d.ts.map +1 -1
- package/dist/references/parse-schema-with-references.js +13 -4
- package/dist/references/parse-schema-with-references.js.map +1 -1
- package/dist/references/resolve-zod-ref-payload-names.d.ts +1 -1
- package/dist/references/resolve-zod-ref-payload-names.d.ts.map +1 -1
- package/dist/references/serialize-schema.d.ts +2 -2
- package/dist/references/serialize-schema.d.ts.map +1 -1
- package/dist/references/serialize-schema.js +4 -3
- package/dist/references/serialize-schema.js.map +1 -1
- package/dist/references/strip-ref-markers.d.ts +7 -0
- package/dist/references/strip-ref-markers.d.ts.map +1 -0
- package/dist/references/strip-ref-markers.js +22 -0
- package/dist/references/strip-ref-markers.js.map +1 -0
- package/dist/references/types.d.ts +2 -2
- package/dist/references/types.d.ts.map +1 -1
- package/dist/schema/apps/admin/app.d.ts +958 -200
- package/dist/schema/apps/admin/app.d.ts.map +1 -1
- package/dist/schema/apps/admin/app.js +2 -3
- package/dist/schema/apps/admin/app.js.map +1 -1
- package/dist/schema/apps/admin/sections/base.d.ts +15 -3
- package/dist/schema/apps/admin/sections/base.d.ts.map +1 -1
- package/dist/schema/apps/admin/sections/base.js +4 -4
- package/dist/schema/apps/admin/sections/base.js.map +1 -1
- package/dist/schema/apps/admin/sections/crud-form/admin-crud-input.d.ts +12 -6
- package/dist/schema/apps/admin/sections/crud-form/admin-crud-input.d.ts.map +1 -1
- package/dist/schema/apps/admin/sections/crud-form/admin-crud-input.js +9 -5
- package/dist/schema/apps/admin/sections/crud-form/admin-crud-input.js.map +1 -1
- package/dist/schema/apps/admin/sections/crud-form/built-in-input.d.ts +19 -19
- package/dist/schema/apps/admin/sections/crud-form/built-in-input.d.ts.map +1 -1
- package/dist/schema/apps/admin/sections/crud-form/built-in-input.js +18 -19
- package/dist/schema/apps/admin/sections/crud-form/built-in-input.js.map +1 -1
- package/dist/schema/apps/admin/sections/crud-form/types.d.ts +1 -1
- package/dist/schema/apps/admin/sections/crud-form/types.d.ts.map +1 -1
- package/dist/schema/apps/admin/sections/crud.d.ts +468 -130
- package/dist/schema/apps/admin/sections/crud.d.ts.map +1 -1
- package/dist/schema/apps/admin/sections/crud.js +14 -14
- package/dist/schema/apps/admin/sections/crud.js.map +1 -1
- package/dist/schema/apps/backend/index.d.ts +1 -1
- package/dist/schema/apps/types.d.ts +1 -1
- package/dist/schema/apps/types.js +1 -1
- package/dist/schema/apps/web/index.d.ts +2 -2
- package/dist/schema/apps/web/index.d.ts.map +1 -1
- package/dist/schema/apps/web/index.js +2 -3
- package/dist/schema/apps/web/index.js.map +1 -1
- package/dist/schema/auth/index.d.ts +1 -1
- package/dist/schema/auth/index.js +1 -1
- package/dist/schema/creator/schema-creator.d.ts +3 -2
- package/dist/schema/creator/schema-creator.d.ts.map +1 -1
- package/dist/schema/creator/schema-creator.js +8 -1
- package/dist/schema/creator/schema-creator.js.map +1 -1
- package/dist/schema/creator/types.d.ts +35 -2
- package/dist/schema/creator/types.d.ts.map +1 -1
- package/dist/schema/features/feature.d.ts +29 -15
- package/dist/schema/features/feature.d.ts.map +1 -1
- package/dist/schema/features/feature.js +7 -4
- package/dist/schema/features/feature.js.map +1 -1
- package/dist/schema/features/theme.d.ts +12 -12
- package/dist/schema/models/enums.d.ts +62 -19
- package/dist/schema/models/enums.d.ts.map +1 -1
- package/dist/schema/models/enums.js +5 -4
- package/dist/schema/models/enums.js.map +1 -1
- package/dist/schema/models/graphql.d.ts +9 -9
- package/dist/schema/models/graphql.d.ts.map +1 -1
- package/dist/schema/models/graphql.js +12 -13
- package/dist/schema/models/graphql.js.map +1 -1
- package/dist/schema/models/index.d.ts +545 -131
- package/dist/schema/models/index.d.ts.map +1 -1
- package/dist/schema/models/index.js +24 -19
- package/dist/schema/models/index.js.map +1 -1
- package/dist/schema/models/transformers/built-in-transformers.d.ts +87 -23
- package/dist/schema/models/transformers/built-in-transformers.d.ts.map +1 -1
- package/dist/schema/models/transformers/built-in-transformers.js +10 -10
- package/dist/schema/models/transformers/built-in-transformers.js.map +1 -1
- package/dist/schema/models/transformers/transformers.d.ts +14 -8
- package/dist/schema/models/transformers/transformers.d.ts.map +1 -1
- package/dist/schema/models/transformers/transformers.js +9 -5
- package/dist/schema/models/transformers/transformers.js.map +1 -1
- package/dist/schema/models/transformers/types.d.ts +4 -3
- package/dist/schema/models/transformers/types.d.ts.map +1 -1
- package/dist/schema/models/transformers/types.js +2 -4
- package/dist/schema/models/transformers/types.js.map +1 -1
- package/dist/schema/plugins/definition.d.ts +64 -70
- package/dist/schema/plugins/definition.d.ts.map +1 -1
- package/dist/schema/plugins/definition.js +18 -16
- package/dist/schema/plugins/definition.js.map +1 -1
- package/dist/schema/project-definition.d.ts +1960 -534
- package/dist/schema/project-definition.d.ts.map +1 -1
- package/dist/schema/project-definition.js +1 -2
- package/dist/schema/project-definition.js.map +1 -1
- package/dist/schema/settings.d.ts +15 -15
- package/dist/schema/template-extractor/index.d.ts +1 -1
- package/dist/tools/model-merger/model-merger.d.ts +6 -6
- package/dist/tools/model-merger/model-merger.d.ts.map +1 -1
- package/dist/web/hooks/index.d.ts +1 -1
- package/dist/web/hooks/index.d.ts.map +1 -1
- package/dist/web/hooks/index.js +1 -1
- package/dist/web/hooks/index.js.map +1 -1
- package/dist/web/hooks/use-definition-schema.d.ts +3 -0
- package/dist/web/hooks/use-definition-schema.d.ts.map +1 -0
- package/dist/web/hooks/use-definition-schema.js +7 -0
- package/dist/web/hooks/use-definition-schema.js.map +1 -0
- package/dist/web/hooks/use-project-definition.d.ts +3 -3
- package/dist/web/hooks/use-project-definition.d.ts.map +1 -1
- package/package.json +5 -5
- package/dist/plugins/schema/common.d.ts +0 -6
- package/dist/plugins/schema/common.d.ts.map +0 -1
- package/dist/plugins/schema/common.js +0 -2
- package/dist/plugins/schema/common.js.map +0 -1
- package/dist/plugins/schema/parser.d.ts +0 -19
- package/dist/plugins/schema/parser.d.ts.map +0 -1
- package/dist/plugins/schema/parser.js +0 -41
- package/dist/plugins/schema/parser.js.map +0 -1
- package/dist/plugins/schema/zod-with-plugins.d.ts +0 -12
- package/dist/plugins/schema/zod-with-plugins.d.ts.map +0 -1
- package/dist/plugins/schema/zod-with-plugins.js +0 -26
- package/dist/plugins/schema/zod-with-plugins.js.map +0 -1
- package/dist/references/ref-builder.d.ts.map +0 -1
- package/dist/references/ref-builder.js +0 -494
- package/dist/references/ref-builder.js.map +0 -1
- package/dist/web/hooks/use-plugin-enhanced-schema.d.ts +0 -4
- package/dist/web/hooks/use-plugin-enhanced-schema.d.ts.map +0 -1
- package/dist/web/hooks/use-plugin-enhanced-schema.js +0 -8
- package/dist/web/hooks/use-plugin-enhanced-schema.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"crud.d.ts","sourceRoot":"","sources":["../../../../../src/schema/apps/admin/sections/crud.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAyBxC,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG,GAAG,CAAC,WAAW,CAClD,OAAO,4BAA4B,CACpC,CAAC;AAEF,MAAM,MAAM,2BAA2B,GAAG,GAAG,CAAC,UAAU,CACtD,OAAO,4BAA4B,CACpC,CAAC"}
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { zRef, zRefBuilder } from '#src/references/index.js';
|
|
3
2
|
import { definitionSchema } from '#src/schema/creator/schema-creator.js';
|
|
4
3
|
import { modelEntityType, modelLocalRelationEntityType, modelScalarFieldEntityType, } from '#src/schema/models/index.js';
|
|
5
|
-
import {
|
|
4
|
+
import { createBaseAdminSectionValidators } from './base.js';
|
|
6
5
|
import { createAdminCrudInputSchema } from './crud-form/admin-crud-input.js';
|
|
7
6
|
import { adminCrudEmbeddedFormEntityType } from './crud-form/types.js';
|
|
8
7
|
// Table Columns
|
|
9
|
-
export const createAdminCrudForeignDisplaySchema = definitionSchema(() => z.object({
|
|
8
|
+
export const createAdminCrudForeignDisplaySchema = definitionSchema((ctx) => z.object({
|
|
10
9
|
type: z.literal('foreign'),
|
|
11
|
-
localRelationRef:
|
|
10
|
+
localRelationRef: ctx.withRef({
|
|
12
11
|
type: modelLocalRelationEntityType,
|
|
13
12
|
onDelete: 'RESTRICT',
|
|
14
13
|
parentPath: { context: 'model' },
|
|
@@ -16,9 +15,9 @@ export const createAdminCrudForeignDisplaySchema = definitionSchema(() => z.obje
|
|
|
16
15
|
labelExpression: z.string().min(1),
|
|
17
16
|
valueExpression: z.string().min(1),
|
|
18
17
|
}));
|
|
19
|
-
export const createAdminCrudTextDisplaySchema = definitionSchema(() => z.object({
|
|
18
|
+
export const createAdminCrudTextDisplaySchema = definitionSchema((ctx) => z.object({
|
|
20
19
|
type: z.literal('text'),
|
|
21
|
-
modelFieldRef:
|
|
20
|
+
modelFieldRef: ctx.withRef({
|
|
22
21
|
type: modelScalarFieldEntityType,
|
|
23
22
|
onDelete: 'RESTRICT',
|
|
24
23
|
parentPath: { context: 'model' },
|
|
@@ -38,7 +37,7 @@ export const createAdminCrudTableColumnSchema = definitionSchema((ctx) => z.obje
|
|
|
38
37
|
export const createAdminCrudEmbeddedObjectSchema = definitionSchema((ctx) => z.object({
|
|
39
38
|
id: z.string().min(1),
|
|
40
39
|
name: z.string().min(1),
|
|
41
|
-
modelRef:
|
|
40
|
+
modelRef: ctx.withRef({
|
|
42
41
|
type: modelEntityType,
|
|
43
42
|
onDelete: 'RESTRICT',
|
|
44
43
|
}),
|
|
@@ -51,7 +50,7 @@ export const createAdminCrudEmbeddedObjectSchema = definitionSchema((ctx) => z.o
|
|
|
51
50
|
export const createAdminCrudEmbeddedListSchema = definitionSchema((ctx) => z.object({
|
|
52
51
|
id: z.string().min(1),
|
|
53
52
|
name: z.string().min(1),
|
|
54
|
-
modelRef:
|
|
53
|
+
modelRef: ctx.withRef({
|
|
55
54
|
type: modelEntityType,
|
|
56
55
|
onDelete: 'RESTRICT',
|
|
57
56
|
}),
|
|
@@ -66,7 +65,7 @@ export const createAdminCrudEmbeddedListSchema = definitionSchema((ctx) => z.obj
|
|
|
66
65
|
fields: z.array(createAdminCrudInputSchema(ctx)),
|
|
67
66
|
}),
|
|
68
67
|
}));
|
|
69
|
-
export const createAdminCrudEmbeddedFormSchema = definitionSchema((ctx) =>
|
|
68
|
+
export const createAdminCrudEmbeddedFormSchema = definitionSchema((ctx) => ctx.withRefBuilder(z.discriminatedUnion('type', [
|
|
70
69
|
createAdminCrudEmbeddedObjectSchema(ctx),
|
|
71
70
|
createAdminCrudEmbeddedListSchema(ctx),
|
|
72
71
|
]), (builder) => {
|
|
@@ -77,10 +76,9 @@ export const createAdminCrudEmbeddedFormSchema = definitionSchema((ctx) => zRefB
|
|
|
77
76
|
builder.addPathToContext('modelRef', modelEntityType, 'model');
|
|
78
77
|
}));
|
|
79
78
|
// Admin Section
|
|
80
|
-
export const createAdminCrudSectionSchema = definitionSchema((ctx) =>
|
|
81
|
-
...baseAdminSectionValidators,
|
|
79
|
+
export const createAdminCrudSectionSchema = definitionSchema((ctx) => ctx.withRefBuilder(createBaseAdminSectionValidators(ctx).and(z.object({
|
|
82
80
|
type: z.literal('crud'),
|
|
83
|
-
modelRef:
|
|
81
|
+
modelRef: ctx.withRef({
|
|
84
82
|
type: modelEntityType,
|
|
85
83
|
onDelete: 'RESTRICT',
|
|
86
84
|
}),
|
|
@@ -91,8 +89,10 @@ export const createAdminCrudSectionSchema = definitionSchema((ctx) => zRefBuilde
|
|
|
91
89
|
form: z.object({
|
|
92
90
|
fields: z.array(createAdminCrudInputSchema(ctx)),
|
|
93
91
|
}),
|
|
94
|
-
embeddedForms: z
|
|
95
|
-
|
|
92
|
+
embeddedForms: z
|
|
93
|
+
.array(createAdminCrudEmbeddedFormSchema(ctx))
|
|
94
|
+
.optional(),
|
|
95
|
+
})), (builder) => {
|
|
96
96
|
builder.addPathToContext('modelRef', modelEntityType, 'model');
|
|
97
97
|
}));
|
|
98
98
|
//# sourceMappingURL=crud.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"crud.js","sourceRoot":"","sources":["../../../../../src/schema/apps/admin/sections/crud.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"crud.js","sourceRoot":"","sources":["../../../../../src/schema/apps/admin/sections/crud.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,OAAO,EAAE,gBAAgB,EAAE,MAAM,uCAAuC,CAAC;AACzE,OAAO,EACL,eAAe,EACf,4BAA4B,EAC5B,0BAA0B,GAC3B,MAAM,6BAA6B,CAAC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AG,CAAC,OAAO,CAAC;QACpB,IAAI,EAAE,eAAe;QACrB,QAAQ,EAAE,UAAU;KACrB,CAAC;IACF,aAAa,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IACrC,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC;QACd,OAAO,EAAE,CAAC,CAAC,KAAK,CAAC,gCAAgC,CAAC,GAAG,CAAC,CAAC;KACxD,CAAC;IACF,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC;QACb,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,0BAA0B,CAAC,GAAG,CAAC,CAAC;KACjD,CAAC;IACF,aAAa,EAAE,CAAC;SACb,KAAK,CAAC,iCAAiC,CAAC,GAAG,CAAC,CAAC;SAC7C,QAAQ,EAAE;CACd,CAAC,CACH,EACD,CAAC,OAAO,EAAE,EAAE;IACV,OAAO,CAAC,gBAAgB,CAAC,UAAU,EAAE,eAAe,EAAE,OAAO,CAAC,CAAC;AACjE,CAAC,CACF,CACF,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import type { def } from '#src/schema/creator/index.js';
|
|
3
|
-
export declare const createBackendAppSchema: (
|
|
3
|
+
export declare const createBackendAppSchema: (context: import("#src/schema/creator/index.js").DefinitionSchemaParserContext) => z.ZodObject<{
|
|
4
4
|
type: z.ZodLiteral<"backend">;
|
|
5
5
|
enableStripe: z.ZodOptional<z.ZodBoolean>;
|
|
6
6
|
enableRedis: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const appEntityType: import("#src/references/
|
|
1
|
+
export declare const appEntityType: import("#src/references/types.js").DefinitionEntityType<false>;
|
|
2
2
|
export type AppEntryType<AppEntryDefinition> = string & {
|
|
3
3
|
__brand?: AppEntryDefinition;
|
|
4
4
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import type { def } from '#src/schema/creator/index.js';
|
|
3
|
-
export declare const createWebAppSchema: (
|
|
3
|
+
export declare const createWebAppSchema: (context: import("#src/schema/creator/index.js").DefinitionSchemaParserContext) => z.ZodObject<{
|
|
4
4
|
type: z.ZodLiteral<"web">;
|
|
5
5
|
includeAuth: z.ZodOptional<z.ZodBoolean>;
|
|
6
6
|
title: z.ZodOptional<z.ZodString>;
|
|
7
7
|
description: z.ZodOptional<z.ZodString>;
|
|
8
|
-
allowedRoles: z.ZodOptional<z.ZodArray<
|
|
8
|
+
allowedRoles: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">>;
|
|
9
9
|
includeUploadComponents: z.ZodOptional<z.ZodBoolean>;
|
|
10
10
|
enableSubscriptions: z.ZodOptional<z.ZodBoolean>;
|
|
11
11
|
id: z.ZodDefault<z.ZodString>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/schema/apps/web/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/schema/apps/web/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,8BAA8B,CAAC;AAQxD,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkB9B,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG,GAAG,CAAC,WAAW,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAEtE,eAAO,MAAM,eAAe;;;;;;;;;;;EAA0C,CAAC"}
|
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { zRef } from '#src/references/index.js';
|
|
3
2
|
import { authRoleEntityType } from '#src/schema/auth/index.js';
|
|
4
3
|
import { definitionSchema } from '#src/schema/creator/schema-creator.js';
|
|
5
4
|
import { baseAppValidators } from '../base.js';
|
|
6
5
|
import { createAppEntryType } from '../types.js';
|
|
7
|
-
export const createWebAppSchema = definitionSchema(() => z.object({
|
|
6
|
+
export const createWebAppSchema = definitionSchema((ctx) => z.object({
|
|
8
7
|
...baseAppValidators,
|
|
9
8
|
type: z.literal('web'),
|
|
10
9
|
includeAuth: z.boolean().optional(),
|
|
11
10
|
title: z.string().optional(),
|
|
12
11
|
description: z.string().optional(),
|
|
13
12
|
allowedRoles: z
|
|
14
|
-
.array(
|
|
13
|
+
.array(ctx.withRef({
|
|
15
14
|
type: authRoleEntityType,
|
|
16
15
|
onDelete: 'DELETE',
|
|
17
16
|
}))
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/schema/apps/web/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/schema/apps/web/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,uCAAuC,CAAC;AAEzE,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAEjD,MAAM,CAAC,MAAM,kBAAkB,GAAG,gBAAgB,CAAC,CAAC,GAAG,EAAE,EAAE,CACzD,CAAC,CAAC,MAAM,CAAC;IACP,GAAG,iBAAiB;IACpB,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC;IACtB,WAAW,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IACnC,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC5B,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAClC,YAAY,EAAE,CAAC;SACZ,KAAK,CACJ,GAAG,CAAC,OAAO,CAAC;QACV,IAAI,EAAE,kBAAkB;QACxB,QAAQ,EAAE,QAAQ;KACnB,CAAC,CACH;SACA,QAAQ,EAAE;IACb,uBAAuB,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IAC/C,mBAAmB,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;CAC5C,CAAC,CACH,CAAC;AAIF,MAAM,CAAC,MAAM,eAAe,GAAG,kBAAkB,CAAe,KAAK,CAAC,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const authRoleEntityType: import("#src/references/
|
|
1
|
+
export declare const authRoleEntityType: import("#src/references/types.js").DefinitionEntityType<false>;
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { z } from 'zod';
|
|
2
|
-
import type { DefinitionSchemaCreator, DefinitionSchemaCreatorOptions } from './types.js';
|
|
3
|
-
export declare function
|
|
2
|
+
import type { DefinitionSchemaCreator, DefinitionSchemaCreatorOptions, DefinitionSchemaParserContext } from './types.js';
|
|
3
|
+
export declare function createDefinitionSchemaParserContext(options: DefinitionSchemaCreatorOptions): DefinitionSchemaParserContext;
|
|
4
|
+
export declare function definitionSchema<T extends z.ZodTypeAny>(creator: DefinitionSchemaCreator<T>): (context: DefinitionSchemaParserContext) => T;
|
|
4
5
|
//# sourceMappingURL=schema-creator.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema-creator.d.ts","sourceRoot":"","sources":["../../../src/schema/creator/schema-creator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"schema-creator.d.ts","sourceRoot":"","sources":["../../../src/schema/creator/schema-creator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAI7B,OAAO,KAAK,EACV,uBAAuB,EACvB,8BAA8B,EAC9B,6BAA6B,EAC9B,MAAM,YAAY,CAAC;AAEpB,wBAAgB,mCAAmC,CACjD,OAAO,EAAE,8BAA8B,GACtC,6BAA6B,CAK/B;AAED,wBAAgB,gBAAgB,CAAC,CAAC,SAAS,CAAC,CAAC,UAAU,EACrD,OAAO,EAAE,uBAAuB,CAAC,CAAC,CAAC,GAClC,CAAC,OAAO,EAAE,6BAA6B,KAAK,CAAC,CAE/C"}
|
|
@@ -1,4 +1,11 @@
|
|
|
1
|
+
import { extendParserContextWithRefs } from '#src/references/extend-parser-context-with-refs.js';
|
|
2
|
+
export function createDefinitionSchemaParserContext(options) {
|
|
3
|
+
return {
|
|
4
|
+
...options,
|
|
5
|
+
...extendParserContextWithRefs(options),
|
|
6
|
+
};
|
|
7
|
+
}
|
|
1
8
|
export function definitionSchema(creator) {
|
|
2
|
-
return (
|
|
9
|
+
return (context) => creator(context);
|
|
3
10
|
}
|
|
4
11
|
//# sourceMappingURL=schema-creator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema-creator.js","sourceRoot":"","sources":["../../../src/schema/creator/schema-creator.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"schema-creator.js","sourceRoot":"","sources":["../../../src/schema/creator/schema-creator.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,2BAA2B,EAAE,MAAM,oDAAoD,CAAC;AAQjG,MAAM,UAAU,mCAAmC,CACjD,OAAuC;IAEvC,OAAO;QACL,GAAG,OAAO;QACV,GAAG,2BAA2B,CAAC,OAAO,CAAC;KACxC,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,gBAAgB,CAC9B,OAAmC;IAEnC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;AACvC,CAAC"}
|
|
@@ -1,11 +1,44 @@
|
|
|
1
1
|
import type { z } from 'zod';
|
|
2
2
|
import type { PluginImplementationStore } from '#src/plugins/index.js';
|
|
3
|
+
import type { WithEntType, WithRefBuilder, WithRefType } from '#src/references/extend-parser-context-with-refs.js';
|
|
4
|
+
/**
|
|
5
|
+
* Options for creating a definition schema.
|
|
6
|
+
*/
|
|
3
7
|
export interface DefinitionSchemaCreatorOptions {
|
|
8
|
+
/**
|
|
9
|
+
* The plugin implementation store that contains the instantiated plugin spec implementations.
|
|
10
|
+
*/
|
|
4
11
|
plugins: PluginImplementationStore;
|
|
12
|
+
/**
|
|
13
|
+
* If true, the schema will be transformed to include references.
|
|
14
|
+
*
|
|
15
|
+
* Note: The parsed data will not match the Typescript type definition of the schema
|
|
16
|
+
* because refs will be replaced with special marker classes. You must call extractRefs
|
|
17
|
+
* to convert the parsed data to the correct type.
|
|
18
|
+
*/
|
|
19
|
+
transformReferences?: boolean;
|
|
5
20
|
}
|
|
6
|
-
interface DefinitionSchemaParserContext {
|
|
21
|
+
export interface DefinitionSchemaParserContext {
|
|
22
|
+
/**
|
|
23
|
+
* The plugin implementation store that contains the instantiated plugin spec implementations.
|
|
24
|
+
*/
|
|
7
25
|
plugins: PluginImplementationStore;
|
|
26
|
+
/**
|
|
27
|
+
* If true, the schema will be transformed to include references.
|
|
28
|
+
*/
|
|
29
|
+
transformReferences?: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Adds a reference to the schema.
|
|
32
|
+
*/
|
|
33
|
+
withRef: WithRefType;
|
|
34
|
+
/**
|
|
35
|
+
* Adds an entity to the schema.
|
|
36
|
+
*/
|
|
37
|
+
withEnt: WithEntType;
|
|
38
|
+
/**
|
|
39
|
+
* Provides access to the reference builder functions for the schema.
|
|
40
|
+
*/
|
|
41
|
+
withRefBuilder: WithRefBuilder;
|
|
8
42
|
}
|
|
9
43
|
export type DefinitionSchemaCreator<T extends z.ZodTypeAny = z.ZodTypeAny> = (ctx: DefinitionSchemaParserContext) => T;
|
|
10
|
-
export {};
|
|
11
44
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/schema/creator/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAE7B,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/schema/creator/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAE7B,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,uBAAuB,CAAC;AACvE,OAAO,KAAK,EACV,WAAW,EACX,cAAc,EACd,WAAW,EACZ,MAAM,oDAAoD,CAAC;AAE5D;;GAEG;AACH,MAAM,WAAW,8BAA8B;IAC7C;;OAEG;IACH,OAAO,EAAE,yBAAyB,CAAC;IACnC;;;;;;OAMG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAC;CAC/B;AAED,MAAM,WAAW,6BAA6B;IAC5C;;OAEG;IACH,OAAO,EAAE,yBAAyB,CAAC;IACnC;;OAEG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B;;OAEG;IACH,OAAO,EAAE,WAAW,CAAC;IACrB;;OAEG;IACH,OAAO,EAAE,WAAW,CAAC;IACrB;;OAEG;IACH,cAAc,EAAE,cAAc,CAAC;CAChC;AAED,MAAM,MAAM,uBAAuB,CAAC,CAAC,SAAS,CAAC,CAAC,UAAU,GAAG,CAAC,CAAC,UAAU,IAAI,CAC3E,GAAG,EAAE,6BAA6B,KAC/B,CAAC,CAAC"}
|
|
@@ -1,34 +1,48 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import type { def } from '#src/schema/creator/index.js';
|
|
3
|
-
export declare const featureEntityType: import("#src/references/
|
|
3
|
+
export declare const featureEntityType: import("#src/references/types.js").DefinitionEntityType<false>;
|
|
4
4
|
export declare const featureNameSchema: z.ZodString;
|
|
5
|
-
export declare const createFeatureSchema: (
|
|
5
|
+
export declare const createFeatureSchema: (context: import("#src/schema/creator/index.js").DefinitionSchemaParserContext) => z.ZodEffects<z.ZodObject<{
|
|
6
|
+
id: z.ZodString;
|
|
6
7
|
name: z.ZodEffects<z.ZodString, string, string>;
|
|
7
|
-
parentRef:
|
|
8
|
-
} & {
|
|
9
|
-
id: z.ZodType<string, z.ZodAnyDef, string>;
|
|
8
|
+
parentRef: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
|
|
10
9
|
}, "strip", z.ZodTypeAny, {
|
|
11
10
|
name: string;
|
|
12
11
|
id: string;
|
|
13
|
-
parentRef?: string |
|
|
12
|
+
parentRef?: string | undefined;
|
|
14
13
|
}, {
|
|
15
14
|
name: string;
|
|
16
15
|
id: string;
|
|
17
|
-
parentRef?: string |
|
|
18
|
-
}
|
|
16
|
+
parentRef?: string | undefined;
|
|
17
|
+
}>, {
|
|
18
|
+
name: string;
|
|
19
|
+
id: string;
|
|
20
|
+
parentRef?: string | undefined;
|
|
21
|
+
}, {
|
|
22
|
+
name: string;
|
|
23
|
+
id: string;
|
|
24
|
+
parentRef?: string | undefined;
|
|
25
|
+
}>;
|
|
19
26
|
export type FeatureConfig = def.InferOutput<typeof createFeatureSchema>;
|
|
20
|
-
export declare const createFeaturesSchema: (
|
|
27
|
+
export declare const createFeaturesSchema: (context: import("#src/schema/creator/index.js").DefinitionSchemaParserContext) => z.ZodDefault<z.ZodArray<z.ZodEffects<z.ZodObject<{
|
|
28
|
+
id: z.ZodString;
|
|
21
29
|
name: z.ZodEffects<z.ZodString, string, string>;
|
|
22
|
-
parentRef:
|
|
23
|
-
} & {
|
|
24
|
-
id: z.ZodType<string, z.ZodAnyDef, string>;
|
|
30
|
+
parentRef: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
|
|
25
31
|
}, "strip", z.ZodTypeAny, {
|
|
26
32
|
name: string;
|
|
27
33
|
id: string;
|
|
28
|
-
parentRef?: string |
|
|
34
|
+
parentRef?: string | undefined;
|
|
35
|
+
}, {
|
|
36
|
+
name: string;
|
|
37
|
+
id: string;
|
|
38
|
+
parentRef?: string | undefined;
|
|
39
|
+
}>, {
|
|
40
|
+
name: string;
|
|
41
|
+
id: string;
|
|
42
|
+
parentRef?: string | undefined;
|
|
29
43
|
}, {
|
|
30
44
|
name: string;
|
|
31
45
|
id: string;
|
|
32
|
-
parentRef?: string |
|
|
33
|
-
}
|
|
46
|
+
parentRef?: string | undefined;
|
|
47
|
+
}>, "many">>;
|
|
34
48
|
//# sourceMappingURL=feature.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"feature.d.ts","sourceRoot":"","sources":["../../../src/schema/features/feature.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,8BAA8B,CAAC;AAKxD,eAAO,MAAM,iBAAiB,gEAA8B,CAAC;AAE7D,eAAO,MAAM,iBAAiB,aAA6B,CAAC;AAE5D,eAAO,MAAM,mBAAmB
|
|
1
|
+
{"version":3,"file":"feature.d.ts","sourceRoot":"","sources":["../../../src/schema/features/feature.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,8BAA8B,CAAC;AAKxD,eAAO,MAAM,iBAAiB,gEAA8B,CAAC;AAE7D,eAAO,MAAM,iBAAiB,aAA6B,CAAC;AAE5D,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;EA0B/B,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG,GAAG,CAAC,WAAW,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAExE,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;YAEhC,CAAC"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { CASE_VALIDATORS } from '@baseplate-dev/utils';
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
-
import { createEntityType
|
|
3
|
+
import { createEntityType } from '#src/references/types.js';
|
|
4
4
|
import { definitionSchema } from '#src/schema/creator/schema-creator.js';
|
|
5
5
|
export const featureEntityType = createEntityType('feature');
|
|
6
6
|
export const featureNameSchema = CASE_VALIDATORS.KEBAB_CASE;
|
|
7
|
-
export const createFeatureSchema = definitionSchema(() =>
|
|
7
|
+
export const createFeatureSchema = definitionSchema((ctx) => ctx.withEnt(z.object({
|
|
8
|
+
id: z.string(),
|
|
8
9
|
name: z
|
|
9
10
|
.string()
|
|
10
11
|
.min(1)
|
|
@@ -13,10 +14,12 @@ export const createFeatureSchema = definitionSchema(() => zEnt(z.object({
|
|
|
13
14
|
.every((part) => featureNameSchema.safeParse(part).success), {
|
|
14
15
|
message: 'Feature name must be lowercase and contain only letters, numbers, and dashes',
|
|
15
16
|
}),
|
|
16
|
-
parentRef:
|
|
17
|
+
parentRef: ctx
|
|
18
|
+
.withRef({
|
|
17
19
|
type: featureEntityType,
|
|
18
20
|
onDelete: 'DELETE_PARENT',
|
|
19
|
-
})
|
|
21
|
+
})
|
|
22
|
+
.optional(),
|
|
20
23
|
}), { type: featureEntityType }));
|
|
21
24
|
export const createFeaturesSchema = definitionSchema((ctx) => z.array(createFeatureSchema(ctx)).default([]));
|
|
22
25
|
//# sourceMappingURL=feature.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"feature.js","sourceRoot":"","sources":["../../../src/schema/features/feature.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,CAA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AC,KAAK,CAAC,mBAAmB,CAAC,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAC9C,CAAC"}
|
|
@@ -2,7 +2,7 @@ import { z } from 'zod';
|
|
|
2
2
|
import type { PaletteShade } from '#src/constants/colors.js';
|
|
3
3
|
import type { def } from '#src/schema/creator/index.js';
|
|
4
4
|
export declare const oklchColor: z.ZodString;
|
|
5
|
-
export declare const themeColorSchema: z.ZodRecord<z.ZodEnum<["link" | "
|
|
5
|
+
export declare const themeColorSchema: z.ZodRecord<z.ZodEnum<["link" | "background" | "foreground" | "muted" | "mutedForeground" | "card" | "cardForeground" | "popover" | "popoverForeground" | "accent" | "accentForeground" | "success" | "successForeground" | "warning" | "warningForeground" | "error" | "errorForeground" | "primary" | "primaryHover" | "primaryForeground" | "secondary" | "secondaryHover" | "secondaryForeground" | "destructive" | "destructiveHover" | "destructiveForeground" | "linkVisited" | "border" | "input" | "ring", ...("link" | "background" | "foreground" | "muted" | "mutedForeground" | "card" | "cardForeground" | "popover" | "popoverForeground" | "accent" | "accentForeground" | "success" | "successForeground" | "warning" | "warningForeground" | "error" | "errorForeground" | "primary" | "primaryHover" | "primaryForeground" | "secondary" | "secondaryHover" | "secondaryForeground" | "destructive" | "destructiveHover" | "destructiveForeground" | "linkVisited" | "border" | "input" | "ring")[]]>, z.ZodString>;
|
|
6
6
|
export type ThemeColorsConfig = z.infer<typeof themeColorSchema>;
|
|
7
7
|
export type PaletteShades = Record<PaletteShade, string>;
|
|
8
8
|
export declare const paletteSchema: z.ZodEffects<z.ZodObject<{
|
|
@@ -93,7 +93,7 @@ export declare const palettesSchema: z.ZodObject<{
|
|
|
93
93
|
};
|
|
94
94
|
}>;
|
|
95
95
|
export type PalettesConfig = z.infer<typeof palettesSchema>;
|
|
96
|
-
export declare const createThemeSchema: (
|
|
96
|
+
export declare const createThemeSchema: (context: import("#src/schema/creator/index.js").DefinitionSchemaParserContext) => z.ZodObject<{
|
|
97
97
|
palettes: z.ZodObject<{
|
|
98
98
|
base: z.ZodEffects<z.ZodObject<{
|
|
99
99
|
paletteName: z.ZodString;
|
|
@@ -161,14 +161,14 @@ export declare const createThemeSchema: (options: import("#src/schema/creator/in
|
|
|
161
161
|
};
|
|
162
162
|
}>;
|
|
163
163
|
colors: z.ZodObject<{
|
|
164
|
-
light: z.ZodRecord<z.ZodEnum<["link" | "
|
|
165
|
-
dark: z.ZodRecord<z.ZodEnum<["link" | "
|
|
164
|
+
light: z.ZodRecord<z.ZodEnum<["link" | "background" | "foreground" | "muted" | "mutedForeground" | "card" | "cardForeground" | "popover" | "popoverForeground" | "accent" | "accentForeground" | "success" | "successForeground" | "warning" | "warningForeground" | "error" | "errorForeground" | "primary" | "primaryHover" | "primaryForeground" | "secondary" | "secondaryHover" | "secondaryForeground" | "destructive" | "destructiveHover" | "destructiveForeground" | "linkVisited" | "border" | "input" | "ring", ...("link" | "background" | "foreground" | "muted" | "mutedForeground" | "card" | "cardForeground" | "popover" | "popoverForeground" | "accent" | "accentForeground" | "success" | "successForeground" | "warning" | "warningForeground" | "error" | "errorForeground" | "primary" | "primaryHover" | "primaryForeground" | "secondary" | "secondaryHover" | "secondaryForeground" | "destructive" | "destructiveHover" | "destructiveForeground" | "linkVisited" | "border" | "input" | "ring")[]]>, z.ZodString>;
|
|
165
|
+
dark: z.ZodRecord<z.ZodEnum<["link" | "background" | "foreground" | "muted" | "mutedForeground" | "card" | "cardForeground" | "popover" | "popoverForeground" | "accent" | "accentForeground" | "success" | "successForeground" | "warning" | "warningForeground" | "error" | "errorForeground" | "primary" | "primaryHover" | "primaryForeground" | "secondary" | "secondaryHover" | "secondaryForeground" | "destructive" | "destructiveHover" | "destructiveForeground" | "linkVisited" | "border" | "input" | "ring", ...("link" | "background" | "foreground" | "muted" | "mutedForeground" | "card" | "cardForeground" | "popover" | "popoverForeground" | "accent" | "accentForeground" | "success" | "successForeground" | "warning" | "warningForeground" | "error" | "errorForeground" | "primary" | "primaryHover" | "primaryForeground" | "secondary" | "secondaryHover" | "secondaryForeground" | "destructive" | "destructiveHover" | "destructiveForeground" | "linkVisited" | "border" | "input" | "ring")[]]>, z.ZodString>;
|
|
166
166
|
}, "strip", z.ZodTypeAny, {
|
|
167
|
-
light: Partial<Record<"link" | "
|
|
168
|
-
dark: Partial<Record<"link" | "
|
|
167
|
+
light: Partial<Record<"link" | "background" | "foreground" | "muted" | "mutedForeground" | "card" | "cardForeground" | "popover" | "popoverForeground" | "accent" | "accentForeground" | "success" | "successForeground" | "warning" | "warningForeground" | "error" | "errorForeground" | "primary" | "primaryHover" | "primaryForeground" | "secondary" | "secondaryHover" | "secondaryForeground" | "destructive" | "destructiveHover" | "destructiveForeground" | "linkVisited" | "border" | "input" | "ring", string>>;
|
|
168
|
+
dark: Partial<Record<"link" | "background" | "foreground" | "muted" | "mutedForeground" | "card" | "cardForeground" | "popover" | "popoverForeground" | "accent" | "accentForeground" | "success" | "successForeground" | "warning" | "warningForeground" | "error" | "errorForeground" | "primary" | "primaryHover" | "primaryForeground" | "secondary" | "secondaryHover" | "secondaryForeground" | "destructive" | "destructiveHover" | "destructiveForeground" | "linkVisited" | "border" | "input" | "ring", string>>;
|
|
169
169
|
}, {
|
|
170
|
-
light: Partial<Record<"link" | "
|
|
171
|
-
dark: Partial<Record<"link" | "
|
|
170
|
+
light: Partial<Record<"link" | "background" | "foreground" | "muted" | "mutedForeground" | "card" | "cardForeground" | "popover" | "popoverForeground" | "accent" | "accentForeground" | "success" | "successForeground" | "warning" | "warningForeground" | "error" | "errorForeground" | "primary" | "primaryHover" | "primaryForeground" | "secondary" | "secondaryHover" | "secondaryForeground" | "destructive" | "destructiveHover" | "destructiveForeground" | "linkVisited" | "border" | "input" | "ring", string>>;
|
|
171
|
+
dark: Partial<Record<"link" | "background" | "foreground" | "muted" | "mutedForeground" | "card" | "cardForeground" | "popover" | "popoverForeground" | "accent" | "accentForeground" | "success" | "successForeground" | "warning" | "warningForeground" | "error" | "errorForeground" | "primary" | "primaryHover" | "primaryForeground" | "secondary" | "secondaryHover" | "secondaryForeground" | "destructive" | "destructiveHover" | "destructiveForeground" | "linkVisited" | "border" | "input" | "ring", string>>;
|
|
172
172
|
}>;
|
|
173
173
|
}, "strip", z.ZodTypeAny, {
|
|
174
174
|
palettes: {
|
|
@@ -184,8 +184,8 @@ export declare const createThemeSchema: (options: import("#src/schema/creator/in
|
|
|
184
184
|
};
|
|
185
185
|
};
|
|
186
186
|
colors: {
|
|
187
|
-
light: Partial<Record<"link" | "
|
|
188
|
-
dark: Partial<Record<"link" | "
|
|
187
|
+
light: Partial<Record<"link" | "background" | "foreground" | "muted" | "mutedForeground" | "card" | "cardForeground" | "popover" | "popoverForeground" | "accent" | "accentForeground" | "success" | "successForeground" | "warning" | "warningForeground" | "error" | "errorForeground" | "primary" | "primaryHover" | "primaryForeground" | "secondary" | "secondaryHover" | "secondaryForeground" | "destructive" | "destructiveHover" | "destructiveForeground" | "linkVisited" | "border" | "input" | "ring", string>>;
|
|
188
|
+
dark: Partial<Record<"link" | "background" | "foreground" | "muted" | "mutedForeground" | "card" | "cardForeground" | "popover" | "popoverForeground" | "accent" | "accentForeground" | "success" | "successForeground" | "warning" | "warningForeground" | "error" | "errorForeground" | "primary" | "primaryHover" | "primaryForeground" | "secondary" | "secondaryHover" | "secondaryForeground" | "destructive" | "destructiveHover" | "destructiveForeground" | "linkVisited" | "border" | "input" | "ring", string>>;
|
|
189
189
|
};
|
|
190
190
|
}, {
|
|
191
191
|
palettes: {
|
|
@@ -201,8 +201,8 @@ export declare const createThemeSchema: (options: import("#src/schema/creator/in
|
|
|
201
201
|
};
|
|
202
202
|
};
|
|
203
203
|
colors: {
|
|
204
|
-
light: Partial<Record<"link" | "
|
|
205
|
-
dark: Partial<Record<"link" | "
|
|
204
|
+
light: Partial<Record<"link" | "background" | "foreground" | "muted" | "mutedForeground" | "card" | "cardForeground" | "popover" | "popoverForeground" | "accent" | "accentForeground" | "success" | "successForeground" | "warning" | "warningForeground" | "error" | "errorForeground" | "primary" | "primaryHover" | "primaryForeground" | "secondary" | "secondaryHover" | "secondaryForeground" | "destructive" | "destructiveHover" | "destructiveForeground" | "linkVisited" | "border" | "input" | "ring", string>>;
|
|
205
|
+
dark: Partial<Record<"link" | "background" | "foreground" | "muted" | "mutedForeground" | "card" | "cardForeground" | "popover" | "popoverForeground" | "accent" | "accentForeground" | "success" | "successForeground" | "warning" | "warningForeground" | "error" | "errorForeground" | "primary" | "primaryHover" | "primaryForeground" | "secondary" | "secondaryHover" | "secondaryForeground" | "destructive" | "destructiveHover" | "destructiveForeground" | "linkVisited" | "border" | "input" | "ring", string>>;
|
|
206
206
|
};
|
|
207
207
|
}>;
|
|
208
208
|
export type ThemeConfig = def.InferOutput<typeof createThemeSchema>;
|