@axova/shared 1.0.0 → 1.0.1
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/schemas/index.d.ts +2 -0
- package/dist/schemas/index.js +5 -1
- package/dist/schemas/store/storefront-config-schema.d.ts +1320 -0
- package/dist/schemas/store/storefront-config-schema.js +109 -0
- package/package.json +1 -1
- package/src/schemas/index.ts +5 -0
- package/src/schemas/store/storefront-config-schema.ts +604 -0
- package/nul +0 -8
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.storefrontConfigRelations = exports.storefrontConfigs = void 0;
|
|
4
|
+
const cuid2_1 = require("@paralleldrive/cuid2");
|
|
5
|
+
const drizzle_orm_1 = require("drizzle-orm");
|
|
6
|
+
const pg_core_1 = require("drizzle-orm/pg-core");
|
|
7
|
+
const store_schema_1 = require("./store-schema");
|
|
8
|
+
exports.storefrontConfigs = (0, pg_core_1.pgTable)("storefront_configs", {
|
|
9
|
+
id: (0, pg_core_1.text)("id")
|
|
10
|
+
.primaryKey()
|
|
11
|
+
.$defaultFn(() => (0, cuid2_1.createId)()),
|
|
12
|
+
storeId: (0, pg_core_1.text)("store_id")
|
|
13
|
+
.notNull()
|
|
14
|
+
.references(() => store_schema_1.stores.id, { onDelete: "cascade" }),
|
|
15
|
+
// Setup Status Tracking
|
|
16
|
+
setupStatus: (0, pg_core_1.varchar)("setup_status", { length: 30 })
|
|
17
|
+
.notNull()
|
|
18
|
+
.default("INCOMPLETE")
|
|
19
|
+
.$type(),
|
|
20
|
+
setupProgress: (0, pg_core_1.integer)("setup_progress").notNull().default(0), // 0-100
|
|
21
|
+
setupSteps: (0, pg_core_1.jsonb)("setup_steps")
|
|
22
|
+
.$type()
|
|
23
|
+
.default({
|
|
24
|
+
branding: { completed: false },
|
|
25
|
+
layout: { completed: false },
|
|
26
|
+
pages: { completed: false },
|
|
27
|
+
localization: { completed: false },
|
|
28
|
+
theme: { completed: false },
|
|
29
|
+
seo: { completed: false },
|
|
30
|
+
}),
|
|
31
|
+
// Branding Configuration
|
|
32
|
+
branding: (0, pg_core_1.jsonb)("branding")
|
|
33
|
+
.$type()
|
|
34
|
+
.notNull(),
|
|
35
|
+
// Layout Configuration
|
|
36
|
+
layout: (0, pg_core_1.jsonb)("layout")
|
|
37
|
+
.$type()
|
|
38
|
+
.notNull(),
|
|
39
|
+
// Pages Configuration
|
|
40
|
+
pages: (0, pg_core_1.jsonb)("pages")
|
|
41
|
+
.$type()
|
|
42
|
+
.notNull(),
|
|
43
|
+
// Localization Configuration
|
|
44
|
+
localization: (0, pg_core_1.jsonb)("localization")
|
|
45
|
+
.$type()
|
|
46
|
+
.notNull(),
|
|
47
|
+
// Theme Configuration
|
|
48
|
+
theme: (0, pg_core_1.jsonb)("theme")
|
|
49
|
+
.$type()
|
|
50
|
+
.default({
|
|
51
|
+
mode: "light",
|
|
52
|
+
radius: 8,
|
|
53
|
+
animations: true,
|
|
54
|
+
transitions: true,
|
|
55
|
+
effects: {
|
|
56
|
+
blur: true,
|
|
57
|
+
shadows: true,
|
|
58
|
+
gradients: true,
|
|
59
|
+
},
|
|
60
|
+
}),
|
|
61
|
+
// SEO Configuration
|
|
62
|
+
seo: (0, pg_core_1.jsonb)("seo")
|
|
63
|
+
.$type()
|
|
64
|
+
.default({}),
|
|
65
|
+
// Text Limits and Validation
|
|
66
|
+
textLimits: (0, pg_core_1.jsonb)("text_limits")
|
|
67
|
+
.$type()
|
|
68
|
+
.default({
|
|
69
|
+
homeHero: {
|
|
70
|
+
badgeTextMax: 48,
|
|
71
|
+
titleMax: 64,
|
|
72
|
+
subtitleMax: 160,
|
|
73
|
+
newsletterPlaceholderMax: 48,
|
|
74
|
+
newsletterButtonTextMax: 24,
|
|
75
|
+
trustedByTextMax: 48,
|
|
76
|
+
},
|
|
77
|
+
}),
|
|
78
|
+
// Advanced Features
|
|
79
|
+
features: (0, pg_core_1.jsonb)("features")
|
|
80
|
+
.$type()
|
|
81
|
+
.default({}),
|
|
82
|
+
// Version Control
|
|
83
|
+
version: (0, pg_core_1.integer)("version").notNull().default(1),
|
|
84
|
+
publishedVersion: (0, pg_core_1.integer)("published_version"),
|
|
85
|
+
isDraft: (0, pg_core_1.boolean)("is_draft").notNull().default(true),
|
|
86
|
+
// Metadata
|
|
87
|
+
lastEditedBy: (0, pg_core_1.text)("last_edited_by"),
|
|
88
|
+
publishedAt: (0, pg_core_1.timestamp)("published_at", { withTimezone: true }),
|
|
89
|
+
publishedBy: (0, pg_core_1.text)("published_by"),
|
|
90
|
+
createdAt: (0, pg_core_1.timestamp)("created_at", { withTimezone: true })
|
|
91
|
+
.defaultNow()
|
|
92
|
+
.notNull(),
|
|
93
|
+
updatedAt: (0, pg_core_1.timestamp)("updated_at", { withTimezone: true })
|
|
94
|
+
.defaultNow()
|
|
95
|
+
.notNull(),
|
|
96
|
+
}, (table) => ({
|
|
97
|
+
storeIdIndex: (0, pg_core_1.index)("idx_storefront_configs_store_id").on(table.storeId),
|
|
98
|
+
storeIdUnique: (0, pg_core_1.unique)("idx_storefront_configs_store_unique").on(table.storeId),
|
|
99
|
+
setupStatusIndex: (0, pg_core_1.index)("idx_storefront_configs_setup_status").on(table.setupStatus),
|
|
100
|
+
setupProgressIndex: (0, pg_core_1.index)("idx_storefront_configs_setup_progress").on(table.setupProgress),
|
|
101
|
+
versionIndex: (0, pg_core_1.index)("idx_storefront_configs_version").on(table.version),
|
|
102
|
+
isDraftIndex: (0, pg_core_1.index)("idx_storefront_configs_draft").on(table.isDraft),
|
|
103
|
+
}));
|
|
104
|
+
exports.storefrontConfigRelations = (0, drizzle_orm_1.relations)(exports.storefrontConfigs, ({ one }) => ({
|
|
105
|
+
store: one(store_schema_1.stores, {
|
|
106
|
+
fields: [exports.storefrontConfigs.storeId],
|
|
107
|
+
references: [store_schema_1.stores.id],
|
|
108
|
+
}),
|
|
109
|
+
}));
|
package/package.json
CHANGED
package/src/schemas/index.ts
CHANGED
|
@@ -179,11 +179,16 @@ export * from "./product/discount-relations";
|
|
|
179
179
|
export * from "./store/store-schema";
|
|
180
180
|
export * from "./store/store-settings-schema";
|
|
181
181
|
export * from "./store/store-audit-schema";
|
|
182
|
+
export * from "./store/storefront-config-schema";
|
|
182
183
|
export {
|
|
183
184
|
storeSettings,
|
|
184
185
|
marketRegions,
|
|
185
186
|
storeSettingsRelations,
|
|
186
187
|
marketRegionsRelations,
|
|
187
188
|
} from "./store/store-settings-schema";
|
|
189
|
+
export {
|
|
190
|
+
storefrontConfigs,
|
|
191
|
+
storefrontConfigRelations,
|
|
192
|
+
} from "./store/storefront-config-schema";
|
|
188
193
|
// Types
|
|
189
194
|
export * from "./types";
|