@tonytang99/integration-canonical 1.0.0 → 1.2.0
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/README.md +414 -1
- package/dist/index.d.ts +5 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +80 -15
- package/dist/index.js.map +1 -1
- package/dist/schemas/customer.d.ts +746 -0
- package/dist/schemas/customer.d.ts.map +1 -0
- package/dist/schemas/customer.js +282 -0
- package/dist/schemas/customer.js.map +1 -0
- package/dist/schemas/index.d.ts +13 -0
- package/dist/schemas/index.d.ts.map +1 -0
- package/dist/schemas/index.js +33 -0
- package/dist/schemas/index.js.map +1 -0
- package/dist/schemas/inventory.d.ts +1642 -0
- package/dist/schemas/inventory.d.ts.map +1 -0
- package/dist/schemas/inventory.js +302 -0
- package/dist/schemas/inventory.js.map +1 -0
- package/dist/schemas/order.d.ts +1339 -0
- package/dist/schemas/order.d.ts.map +1 -0
- package/dist/schemas/order.js +310 -0
- package/dist/schemas/order.js.map +1 -0
- package/dist/schemas/product.d.ts +717 -0
- package/dist/schemas/product.d.ts.map +1 -0
- package/dist/schemas/product.js +303 -0
- package/dist/schemas/product.js.map +1 -0
- package/dist/slots.d.ts +572 -0
- package/dist/slots.d.ts.map +1 -0
- package/dist/slots.js +20 -0
- package/dist/slots.js.map +1 -0
- package/dist/types/common.d.ts +284 -0
- package/dist/types/common.d.ts.map +1 -0
- package/dist/types/common.js +401 -0
- package/dist/types/common.js.map +1 -0
- package/dist/types/enrichments.d.ts +378 -0
- package/dist/types/enrichments.d.ts.map +1 -0
- package/dist/types/enrichments.js +96 -0
- package/dist/types/enrichments.js.map +1 -0
- package/package.json +2 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"customer.d.ts","sourceRoot":"","sources":["../../src/schemas/customer.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAOxB,eAAO,MAAM,qBAAqB;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.CanonicalCustomerSchema = exports.CustomerStatus = exports.CustomerGroupSchema = exports.CustomerStatsSchema = exports.CustomerAddressSchema = void 0;
|
|
4
|
+
// packages/canonical/src/schemas/customer.ts
|
|
5
|
+
const zod_1 = require("zod");
|
|
6
|
+
const common_1 = require("../types/common");
|
|
7
|
+
// ============================================================================
|
|
8
|
+
// CUSTOMER ADDRESS WITH TYPE
|
|
9
|
+
// ============================================================================
|
|
10
|
+
exports.CustomerAddressSchema = common_1.AddressSchema.extend({
|
|
11
|
+
id: zod_1.z.string().optional(),
|
|
12
|
+
label: zod_1.z.string().optional(), // e.g., "Home", "Office"
|
|
13
|
+
isDefault: zod_1.z.boolean().optional(),
|
|
14
|
+
});
|
|
15
|
+
// ============================================================================
|
|
16
|
+
// CUSTOMER STATS
|
|
17
|
+
// ============================================================================
|
|
18
|
+
exports.CustomerStatsSchema = zod_1.z.object({
|
|
19
|
+
totalOrders: zod_1.z.number().int().min(0),
|
|
20
|
+
totalSpent: common_1.MoneySchema,
|
|
21
|
+
averageOrderValue: common_1.MoneySchema,
|
|
22
|
+
lastOrderValue: common_1.MoneySchema.optional(),
|
|
23
|
+
lifetimeValue: common_1.MoneySchema.optional(), // Predicted CLV
|
|
24
|
+
});
|
|
25
|
+
// ============================================================================
|
|
26
|
+
// CUSTOMER GROUP/SEGMENT
|
|
27
|
+
// ============================================================================
|
|
28
|
+
exports.CustomerGroupSchema = zod_1.z.object({
|
|
29
|
+
id: zod_1.z.string(),
|
|
30
|
+
name: zod_1.z.string(),
|
|
31
|
+
type: zod_1.z.enum(['tier', 'segment', 'category', 'custom']).optional(),
|
|
32
|
+
});
|
|
33
|
+
// ============================================================================
|
|
34
|
+
// CUSTOMER STATUS
|
|
35
|
+
// ============================================================================
|
|
36
|
+
exports.CustomerStatus = zod_1.z.enum([
|
|
37
|
+
'active', // Active customer
|
|
38
|
+
'inactive', // No recent activity
|
|
39
|
+
'suspended', // Account suspended
|
|
40
|
+
'blocked', // Blocked for fraud/abuse
|
|
41
|
+
'pending', // Pending verification
|
|
42
|
+
]);
|
|
43
|
+
// ============================================================================
|
|
44
|
+
// CANONICAL CUSTOMER
|
|
45
|
+
// ============================================================================
|
|
46
|
+
exports.CanonicalCustomerSchema = zod_1.z.object({
|
|
47
|
+
// ========== IDENTITY ==========
|
|
48
|
+
id: zod_1.z.string(),
|
|
49
|
+
email: zod_1.z.string().email(),
|
|
50
|
+
// ========== PERSONAL INFO ==========
|
|
51
|
+
firstName: zod_1.z.string(),
|
|
52
|
+
lastName: zod_1.z.string(),
|
|
53
|
+
company: zod_1.z.string().optional(),
|
|
54
|
+
// ========== CONTACT ==========
|
|
55
|
+
phone: zod_1.z.string().optional(),
|
|
56
|
+
phones: zod_1.z.array(common_1.PhoneNumberSchema).optional(), // Multiple phone numbers
|
|
57
|
+
// ========== ADDRESSES ==========
|
|
58
|
+
defaultBillingAddressId: zod_1.z.string().optional(),
|
|
59
|
+
defaultShippingAddressId: zod_1.z.string().optional(),
|
|
60
|
+
addresses: zod_1.z.array(exports.CustomerAddressSchema).optional(),
|
|
61
|
+
// ========== ACCOUNT STATUS ==========
|
|
62
|
+
status: exports.CustomerStatus,
|
|
63
|
+
isVerified: zod_1.z.boolean().optional(),
|
|
64
|
+
acceptsMarketing: zod_1.z.boolean(),
|
|
65
|
+
acceptsSms: zod_1.z.boolean().optional(),
|
|
66
|
+
// ========== STATISTICS ==========
|
|
67
|
+
stats: exports.CustomerStatsSchema.optional(),
|
|
68
|
+
// ========== DATES ==========
|
|
69
|
+
dates: zod_1.z.object({
|
|
70
|
+
createdAt: zod_1.z.string().datetime(),
|
|
71
|
+
updatedAt: zod_1.z.string().datetime(),
|
|
72
|
+
lastOrderAt: zod_1.z.string().datetime().optional(),
|
|
73
|
+
lastLoginAt: zod_1.z.string().datetime().optional(),
|
|
74
|
+
verifiedAt: zod_1.z.string().datetime().optional(),
|
|
75
|
+
}),
|
|
76
|
+
// ========== SEGMENTATION ==========
|
|
77
|
+
tags: zod_1.z.array(zod_1.z.string()).optional(),
|
|
78
|
+
groups: zod_1.z.array(exports.CustomerGroupSchema).optional(),
|
|
79
|
+
tier: zod_1.z.string().optional(), // e.g., "Bronze", "Silver", "Gold", "Platinum"
|
|
80
|
+
// ========== PREFERENCES ==========
|
|
81
|
+
preferences: zod_1.z.object({
|
|
82
|
+
language: zod_1.z.string().optional(), // ISO 639-1 code
|
|
83
|
+
currency: zod_1.z.string().optional(), // ISO 4217 code
|
|
84
|
+
timezone: zod_1.z.string().optional(), // IANA timezone
|
|
85
|
+
communicationPreferences: zod_1.z.object({
|
|
86
|
+
email: zod_1.z.boolean().optional(),
|
|
87
|
+
sms: zod_1.z.boolean().optional(),
|
|
88
|
+
phone: zod_1.z.boolean().optional(),
|
|
89
|
+
push: zod_1.z.boolean().optional(),
|
|
90
|
+
}).optional(),
|
|
91
|
+
}).optional(),
|
|
92
|
+
// ========== NOTES ==========
|
|
93
|
+
notes: zod_1.z.string().optional(),
|
|
94
|
+
internalNotes: zod_1.z.string().optional(),
|
|
95
|
+
// ========== CUSTOM FIELDS ==========
|
|
96
|
+
customFields: zod_1.z.record(zod_1.z.string(), zod_1.z.unknown()).optional(),
|
|
97
|
+
// ========== METADATA ==========
|
|
98
|
+
metadata: zod_1.z.object({
|
|
99
|
+
source: zod_1.z.string(), // 'bigcommerce', 'myob', 'adobe', 'shopify'
|
|
100
|
+
sourceId: zod_1.z.string(),
|
|
101
|
+
externalIds: zod_1.z.record(zod_1.z.string(), zod_1.z.string()).optional(), // IDs in other systems
|
|
102
|
+
// Account info
|
|
103
|
+
accountNumber: zod_1.z.string().optional(), // ERP account number
|
|
104
|
+
taxExempt: zod_1.z.boolean().optional(),
|
|
105
|
+
taxExemptionId: zod_1.z.string().optional(),
|
|
106
|
+
// Business info
|
|
107
|
+
businessType: zod_1.z.enum(['individual', 'business', 'non-profit']).optional(),
|
|
108
|
+
vatNumber: zod_1.z.string().optional(),
|
|
109
|
+
// Flags
|
|
110
|
+
isWholesale: zod_1.z.boolean().optional(),
|
|
111
|
+
isVip: zod_1.z.boolean().optional(),
|
|
112
|
+
isTest: zod_1.z.boolean().optional(),
|
|
113
|
+
}),
|
|
114
|
+
});
|
|
115
|
+
// ============================================================================
|
|
116
|
+
// HELPER FUNCTIONS
|
|
117
|
+
// ============================================================================
|
|
118
|
+
exports.CustomerHelper = {
|
|
119
|
+
/**
|
|
120
|
+
* Get customer full name
|
|
121
|
+
*/
|
|
122
|
+
getFullName(customer) {
|
|
123
|
+
return `${customer.firstName} ${customer.lastName}`.trim();
|
|
124
|
+
},
|
|
125
|
+
/**
|
|
126
|
+
* Get display name (with company if available)
|
|
127
|
+
*/
|
|
128
|
+
getDisplayName(customer) {
|
|
129
|
+
const name = this.getFullName(customer);
|
|
130
|
+
return customer.company ? `${name} (${customer.company})` : name;
|
|
131
|
+
},
|
|
132
|
+
/**
|
|
133
|
+
* Check if customer is active
|
|
134
|
+
*/
|
|
135
|
+
isActive(customer) {
|
|
136
|
+
return customer.status === 'active';
|
|
137
|
+
},
|
|
138
|
+
/**
|
|
139
|
+
* Check if customer has placed orders
|
|
140
|
+
*/
|
|
141
|
+
hasOrders(customer) {
|
|
142
|
+
return customer.stats ? customer.stats.totalOrders > 0 : false;
|
|
143
|
+
},
|
|
144
|
+
/**
|
|
145
|
+
* Check if customer is new (no orders yet)
|
|
146
|
+
*/
|
|
147
|
+
isNew(customer) {
|
|
148
|
+
return !this.hasOrders(customer);
|
|
149
|
+
},
|
|
150
|
+
/**
|
|
151
|
+
* Get default billing address
|
|
152
|
+
*/
|
|
153
|
+
getDefaultBillingAddress(customer) {
|
|
154
|
+
if (!customer.addresses || customer.addresses.length === 0) {
|
|
155
|
+
return null;
|
|
156
|
+
}
|
|
157
|
+
if (customer.defaultBillingAddressId) {
|
|
158
|
+
const address = customer.addresses.find(a => a.id === customer.defaultBillingAddressId);
|
|
159
|
+
if (address)
|
|
160
|
+
return address;
|
|
161
|
+
}
|
|
162
|
+
// Fall back to first address marked as billing or default
|
|
163
|
+
return customer.addresses.find(a => a.type === 'billing' || a.type === 'both' || a.isDefault) || customer.addresses[0];
|
|
164
|
+
},
|
|
165
|
+
/**
|
|
166
|
+
* Get default shipping address
|
|
167
|
+
*/
|
|
168
|
+
getDefaultShippingAddress(customer) {
|
|
169
|
+
if (!customer.addresses || customer.addresses.length === 0) {
|
|
170
|
+
return null;
|
|
171
|
+
}
|
|
172
|
+
if (customer.defaultShippingAddressId) {
|
|
173
|
+
const address = customer.addresses.find(a => a.id === customer.defaultShippingAddressId);
|
|
174
|
+
if (address)
|
|
175
|
+
return address;
|
|
176
|
+
}
|
|
177
|
+
// Fall back to first address marked as shipping or default
|
|
178
|
+
return customer.addresses.find(a => a.type === 'shipping' || a.type === 'both' || a.isDefault) || customer.addresses[0];
|
|
179
|
+
},
|
|
180
|
+
/**
|
|
181
|
+
* Get primary phone number
|
|
182
|
+
*/
|
|
183
|
+
getPrimaryPhone(customer) {
|
|
184
|
+
if (customer.phone) {
|
|
185
|
+
return customer.phone;
|
|
186
|
+
}
|
|
187
|
+
if (customer.phones && customer.phones.length > 0) {
|
|
188
|
+
return customer.phones[0].number;
|
|
189
|
+
}
|
|
190
|
+
return null;
|
|
191
|
+
},
|
|
192
|
+
/**
|
|
193
|
+
* Check if customer accepts marketing
|
|
194
|
+
*/
|
|
195
|
+
acceptsMarketing(customer) {
|
|
196
|
+
return customer.acceptsMarketing;
|
|
197
|
+
},
|
|
198
|
+
/**
|
|
199
|
+
* Get days since last order
|
|
200
|
+
*/
|
|
201
|
+
getDaysSinceLastOrder(customer) {
|
|
202
|
+
if (!customer.dates.lastOrderAt) {
|
|
203
|
+
return null;
|
|
204
|
+
}
|
|
205
|
+
const lastOrder = new Date(customer.dates.lastOrderAt);
|
|
206
|
+
const now = new Date();
|
|
207
|
+
const diffMs = now.getTime() - lastOrder.getTime();
|
|
208
|
+
return Math.floor(diffMs / (1000 * 60 * 60 * 24));
|
|
209
|
+
},
|
|
210
|
+
/**
|
|
211
|
+
* Check if customer is at risk (hasn't ordered in X days)
|
|
212
|
+
*/
|
|
213
|
+
isAtRisk(customer, daysThreshold = 90) {
|
|
214
|
+
const daysSince = this.getDaysSinceLastOrder(customer);
|
|
215
|
+
return daysSince !== null && daysSince > daysThreshold;
|
|
216
|
+
},
|
|
217
|
+
/**
|
|
218
|
+
* Calculate customer lifetime in days
|
|
219
|
+
*/
|
|
220
|
+
getCustomerLifetimeDays(customer) {
|
|
221
|
+
const created = new Date(customer.dates.createdAt);
|
|
222
|
+
const now = new Date();
|
|
223
|
+
const diffMs = now.getTime() - created.getTime();
|
|
224
|
+
return Math.floor(diffMs / (1000 * 60 * 60 * 24));
|
|
225
|
+
},
|
|
226
|
+
/**
|
|
227
|
+
* Check if customer has specific tag
|
|
228
|
+
*/
|
|
229
|
+
hasTag(customer, tag) {
|
|
230
|
+
return customer.tags?.includes(tag) || false;
|
|
231
|
+
},
|
|
232
|
+
/**
|
|
233
|
+
* Check if customer is in specific group
|
|
234
|
+
*/
|
|
235
|
+
isInGroup(customer, groupId) {
|
|
236
|
+
return customer.groups?.some(g => g.id === groupId) || false;
|
|
237
|
+
},
|
|
238
|
+
/**
|
|
239
|
+
* Get customer tier
|
|
240
|
+
*/
|
|
241
|
+
getTier(customer) {
|
|
242
|
+
return customer.tier || null;
|
|
243
|
+
},
|
|
244
|
+
/**
|
|
245
|
+
* Check if customer is VIP
|
|
246
|
+
*/
|
|
247
|
+
isVip(customer) {
|
|
248
|
+
return customer.metadata.isVip === true;
|
|
249
|
+
},
|
|
250
|
+
/**
|
|
251
|
+
* Check if customer is wholesale
|
|
252
|
+
*/
|
|
253
|
+
isWholesale(customer) {
|
|
254
|
+
return customer.metadata.isWholesale === true;
|
|
255
|
+
},
|
|
256
|
+
/**
|
|
257
|
+
* Check if customer is tax exempt
|
|
258
|
+
*/
|
|
259
|
+
isTaxExempt(customer) {
|
|
260
|
+
return customer.metadata.taxExempt === true;
|
|
261
|
+
},
|
|
262
|
+
/**
|
|
263
|
+
* Get customer's order frequency (orders per month)
|
|
264
|
+
*/
|
|
265
|
+
getOrderFrequency(customer) {
|
|
266
|
+
if (!customer.stats || customer.stats.totalOrders === 0) {
|
|
267
|
+
return null;
|
|
268
|
+
}
|
|
269
|
+
const lifetimeDays = this.getCustomerLifetimeDays(customer);
|
|
270
|
+
const lifetimeMonths = lifetimeDays / 30;
|
|
271
|
+
return customer.stats.totalOrders / lifetimeMonths;
|
|
272
|
+
},
|
|
273
|
+
/**
|
|
274
|
+
* Format customer for display
|
|
275
|
+
*/
|
|
276
|
+
format(customer) {
|
|
277
|
+
const name = this.getDisplayName(customer);
|
|
278
|
+
const email = customer.email;
|
|
279
|
+
return `${name} <${email}>`;
|
|
280
|
+
},
|
|
281
|
+
};
|
|
282
|
+
//# sourceMappingURL=customer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"customer.js","sourceRoot":"","sources":["../../src/schemas/customer.ts"],"names":[],"mappings":";;;AAAA,6CAA6C;AAC7C,6BAAwB;AACxB,4CAA0G;AAE1G,+EAA+E;AAC/E,6BAA6B;AAC7B,+EAA+E;AAElE,QAAA,qBAAqB,GAAG,sBAAa,CAAC,MAAM,CAAC;IACxD,EAAE,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACzB,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,EAAE,yBAAyB;IACvD,SAAS,EAAE,OAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;CAClC,CAAC,CAAC;AAIH,+EAA+E;AAC/E,iBAAiB;AACjB,+EAA+E;AAElE,QAAA,mBAAmB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC1C,WAAW,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACpC,UAAU,EAAE,oBAAW;IACvB,iBAAiB,EAAE,oBAAW;IAC9B,cAAc,EAAE,oBAAW,CAAC,QAAQ,EAAE;IACtC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AED;;OAEG;IACH,iBAAiB,CAAC,QAA2B;QAC3C,IAAI,CAAC,QAAQ,CAAC,KAAK,IAAI,QAAQ,CAAC,KAAK,CAAC,WAAW,KAAK,CAAC,EAAE,CAAC;YACxD,OAAO,IAAI,CAAC;QACd,CAAC;QAED,MAAM,YAAY,GAAG,IAAI,CAAC,uBAAuB,CAAC,QAAQ,CAAC,CAAC;QAC5D,MAAM,cAAc,GAAG,YAAY,GAAG,EAAE,CAAC;QAEzC,OAAO,QAAQ,CAAC,KAAK,CAAC,WAAW,GAAG,cAAc,CAAC;IACrD,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,QAA2B;QAChC,MAAM,IAAI,GAAG,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC;QAC3C,MAAM,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAC;QAC7B,OAAO,GAAG,IAAI,KAAK,KAAK,GAAG,CAAC;IAC9B,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export { CanonicalProduct as product, CanonicalProductSchema } from './product';
|
|
2
|
+
export { CanonicalOrder as order, CanonicalOrderSchema } from './order';
|
|
3
|
+
export { CanonicalCustomer as customer, CanonicalCustomerSchema } from './customer';
|
|
4
|
+
export { CanonicalInventory as inventory, CanonicalInventorySchema } from './inventory';
|
|
5
|
+
export type { CanonicalProduct } from './product';
|
|
6
|
+
export type { CanonicalOrder } from './order';
|
|
7
|
+
export type { CanonicalCustomer } from './customer';
|
|
8
|
+
export type { CanonicalInventory } from './inventory';
|
|
9
|
+
export * from './product';
|
|
10
|
+
export * from './order';
|
|
11
|
+
export * from './customer';
|
|
12
|
+
export * from './inventory';
|
|
13
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/schemas/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,gBAAgB,IAAI,OAAO,EAAE,sBAAsB,EAAE,MAAM,WAAW,CAAC;AAChF,OAAO,EAAE,cAAc,IAAI,KAAK,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AACxE,OAAO,EAAE,iBAAiB,IAAI,QAAQ,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC;AACpF,OAAO,EAAE,kBAAkB,IAAI,SAAS,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AAGxF,YAAY,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAClD,YAAY,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAC9C,YAAY,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AACpD,YAAY,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAGtD,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// packages/canonical/src/schemas/index.ts
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
15
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
16
|
+
};
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.CanonicalInventorySchema = exports.CanonicalCustomerSchema = exports.CanonicalOrderSchema = exports.CanonicalProductSchema = void 0;
|
|
19
|
+
// Re-export types with lowercase aliases to match import conventions
|
|
20
|
+
var product_1 = require("./product");
|
|
21
|
+
Object.defineProperty(exports, "CanonicalProductSchema", { enumerable: true, get: function () { return product_1.CanonicalProductSchema; } });
|
|
22
|
+
var order_1 = require("./order");
|
|
23
|
+
Object.defineProperty(exports, "CanonicalOrderSchema", { enumerable: true, get: function () { return order_1.CanonicalOrderSchema; } });
|
|
24
|
+
var customer_1 = require("./customer");
|
|
25
|
+
Object.defineProperty(exports, "CanonicalCustomerSchema", { enumerable: true, get: function () { return customer_1.CanonicalCustomerSchema; } });
|
|
26
|
+
var inventory_1 = require("./inventory");
|
|
27
|
+
Object.defineProperty(exports, "CanonicalInventorySchema", { enumerable: true, get: function () { return inventory_1.CanonicalInventorySchema; } });
|
|
28
|
+
// Export all other types and helpers
|
|
29
|
+
__exportStar(require("./product"), exports);
|
|
30
|
+
__exportStar(require("./order"), exports);
|
|
31
|
+
__exportStar(require("./customer"), exports);
|
|
32
|
+
__exportStar(require("./inventory"), exports);
|
|
33
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/schemas/index.ts"],"names":[],"mappings":";AAAA,0CAA0C;;;;;;;;;;;;;;;;;AAE1C,qEAAqE;AACrE,qCAAgF;AAA1C,iHAAA,sBAAsB,OAAA;AAC5D,iCAAwE;AAAtC,6GAAA,oBAAoB,OAAA;AACtD,uCAAoF;AAA5C,mHAAA,uBAAuB,OAAA;AAC/D,yCAAwF;AAA9C,qHAAA,wBAAwB,OAAA;AAQlE,qCAAqC;AACrC,4CAA0B;AAC1B,0CAAwB;AACxB,6CAA2B;AAC3B,8CAA4B"}
|