@ekairos/domain 1.8.3 → 1.8.5-beta.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/dist/__type_tests__/domain-builder.typecheck.d.ts +2 -0
- package/dist/__type_tests__/domain-builder.typecheck.d.ts.map +1 -0
- package/dist/__type_tests__/domain-builder.typecheck.js +211 -0
- package/dist/__type_tests__/domain-builder.typecheck.js.map +1 -0
- package/dist/__type_tests__/domain-conflicts-examples.d.ts +2 -0
- package/dist/__type_tests__/domain-conflicts-examples.d.ts.map +1 -0
- package/dist/__type_tests__/domain-conflicts-examples.js +8 -0
- package/dist/__type_tests__/domain-conflicts-examples.js.map +1 -0
- package/dist/__type_tests__/instant-schema-example.d.ts +3 -0
- package/dist/__type_tests__/instant-schema-example.d.ts.map +1 -0
- package/dist/__type_tests__/instant-schema-example.js +188 -0
- package/dist/__type_tests__/instant-schema-example.js.map +1 -0
- package/dist/__type_tests__/instant-schema-migration-example.d.ts +4 -0
- package/dist/__type_tests__/instant-schema-migration-example.d.ts.map +1 -0
- package/dist/__type_tests__/instant-schema-migration-example.js +178 -0
- package/dist/__type_tests__/instant-schema-migration-example.js.map +1 -0
- package/dist/index.d.ts +34 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +42 -3
- package/dist/index.js.map +1 -1
- package/package.json +5 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"domain-builder.typecheck.d.ts","sourceRoot":"","sources":["../../src/__type_tests__/domain-builder.typecheck.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Type tests for domain builder with dependsOn
|
|
3
|
+
// These should fail initially, then pass after implementation
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
const __1 = require("..");
|
|
6
|
+
const core_1 = require("@instantdb/core");
|
|
7
|
+
// Base entities ($users, $files) are automatically included by domain builder
|
|
8
|
+
// Core domain (hosts organizations)
|
|
9
|
+
const otherDomain = (0, __1.domain)({
|
|
10
|
+
entities: {
|
|
11
|
+
organizations: core_1.i.entity({
|
|
12
|
+
clerkOrgId: core_1.i.string().indexed().unique(),
|
|
13
|
+
timezone: core_1.i.string().optional(),
|
|
14
|
+
}),
|
|
15
|
+
},
|
|
16
|
+
links: {},
|
|
17
|
+
rooms: {},
|
|
18
|
+
});
|
|
19
|
+
// OK: cross-domain links after includes (runtime automatically merges entities)
|
|
20
|
+
const management = (0, __1.domain)("management")
|
|
21
|
+
.includes(otherDomain)
|
|
22
|
+
.schema({
|
|
23
|
+
entities: {
|
|
24
|
+
management_projects: core_1.i.entity({
|
|
25
|
+
name: core_1.i.string(),
|
|
26
|
+
createdAt: core_1.i.date(),
|
|
27
|
+
updatedAt: core_1.i.date(),
|
|
28
|
+
description: core_1.i.string().optional(),
|
|
29
|
+
linearProjectId: core_1.i.string().optional(),
|
|
30
|
+
}),
|
|
31
|
+
management_tasks: core_1.i.entity({
|
|
32
|
+
title: core_1.i.string(),
|
|
33
|
+
status: core_1.i.string(),
|
|
34
|
+
createdAt: core_1.i.date(),
|
|
35
|
+
updatedAt: core_1.i.date(),
|
|
36
|
+
description: core_1.i.string().optional(),
|
|
37
|
+
}),
|
|
38
|
+
},
|
|
39
|
+
links: {
|
|
40
|
+
management_projectsOrganization: {
|
|
41
|
+
forward: { on: "management_projects", has: "one", label: "organization" },
|
|
42
|
+
reverse: { on: "organizations", has: "many", label: "management_projects" },
|
|
43
|
+
},
|
|
44
|
+
management_tasksUser: {
|
|
45
|
+
forward: { on: "management_tasks", has: "one", label: "assignee" },
|
|
46
|
+
reverse: { on: "$users", has: "many", label: "management_tasks" },
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
rooms: {},
|
|
50
|
+
});
|
|
51
|
+
// OK: link only to base entities ($users/$files) without deps
|
|
52
|
+
const filesOnly = (0, __1.domain)("filesOnly").schema({
|
|
53
|
+
entities: {
|
|
54
|
+
assets: core_1.i.entity({
|
|
55
|
+
name: core_1.i.string(),
|
|
56
|
+
}),
|
|
57
|
+
},
|
|
58
|
+
links: {
|
|
59
|
+
assetsFiles: {
|
|
60
|
+
forward: { on: "assets", has: "many", label: "$files" },
|
|
61
|
+
reverse: { on: "$files", has: "one", label: "asset" },
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
rooms: {},
|
|
65
|
+
});
|
|
66
|
+
// Note: Cross-domain link validation is now runtime-only for simplicity
|
|
67
|
+
// The domain builder automatically includes base entities and merges included domains
|
|
68
|
+
const runtimeValidatedExample = (0, __1.domain)("management")
|
|
69
|
+
.includes(otherDomain)
|
|
70
|
+
.schema({
|
|
71
|
+
entities: {
|
|
72
|
+
management_projects: core_1.i.entity({
|
|
73
|
+
name: core_1.i.string(),
|
|
74
|
+
}),
|
|
75
|
+
management_tasks: core_1.i.entity({
|
|
76
|
+
title: core_1.i.string(),
|
|
77
|
+
}),
|
|
78
|
+
},
|
|
79
|
+
links: {
|
|
80
|
+
// This will work because runtime merges in organizations from otherDomain
|
|
81
|
+
management_projectsOrganization: {
|
|
82
|
+
forward: { on: "management_projects", has: "one", label: "organization" },
|
|
83
|
+
reverse: { on: "organizations", has: "many", label: "management_projects" },
|
|
84
|
+
},
|
|
85
|
+
// Base entities are automatically available
|
|
86
|
+
management_tasksUser: {
|
|
87
|
+
forward: { on: "management_tasks", has: "one", label: "assignee" },
|
|
88
|
+
reverse: { on: "$users", has: "many", label: "management_tasks" },
|
|
89
|
+
},
|
|
90
|
+
},
|
|
91
|
+
rooms: {},
|
|
92
|
+
});
|
|
93
|
+
// OK: Base entities are automatically available without explicit declaration
|
|
94
|
+
const baseEntitiesOnly = (0, __1.domain)("baseTest").schema({
|
|
95
|
+
entities: {
|
|
96
|
+
test_entity: core_1.i.entity({
|
|
97
|
+
name: core_1.i.string(),
|
|
98
|
+
}),
|
|
99
|
+
},
|
|
100
|
+
links: {
|
|
101
|
+
testEntityFiles: {
|
|
102
|
+
forward: { on: "test_entity", has: "many", label: "$files" },
|
|
103
|
+
reverse: { on: "$files", has: "one", label: "test_entity" },
|
|
104
|
+
},
|
|
105
|
+
testEntityUsers: {
|
|
106
|
+
forward: { on: "test_entity", has: "one", label: "owner" },
|
|
107
|
+
reverse: { on: "$users", has: "many", label: "owned_entities" },
|
|
108
|
+
},
|
|
109
|
+
},
|
|
110
|
+
rooms: {},
|
|
111
|
+
});
|
|
112
|
+
// Example usage of includes method
|
|
113
|
+
const coreDomain = (0, __1.domain)({
|
|
114
|
+
entities: {
|
|
115
|
+
organizations: core_1.i.entity({
|
|
116
|
+
clerkOrgId: core_1.i.string().indexed().unique(),
|
|
117
|
+
timezone: core_1.i.string().optional(),
|
|
118
|
+
}),
|
|
119
|
+
},
|
|
120
|
+
links: {},
|
|
121
|
+
rooms: {},
|
|
122
|
+
});
|
|
123
|
+
const managementDomain = (0, __1.domain)("management")
|
|
124
|
+
.includes(coreDomain) // Include entities from coreDomain for cross-references
|
|
125
|
+
.schema({
|
|
126
|
+
entities: {
|
|
127
|
+
management_projects: core_1.i.entity({
|
|
128
|
+
name: core_1.i.string(),
|
|
129
|
+
createdAt: core_1.i.date(),
|
|
130
|
+
updatedAt: core_1.i.date(),
|
|
131
|
+
}),
|
|
132
|
+
management_tasks: core_1.i.entity({
|
|
133
|
+
title: core_1.i.string(),
|
|
134
|
+
status: core_1.i.string(),
|
|
135
|
+
createdAt: core_1.i.date(),
|
|
136
|
+
updatedAt: core_1.i.date(),
|
|
137
|
+
}),
|
|
138
|
+
},
|
|
139
|
+
links: {
|
|
140
|
+
// Can reference organizations from included coreDomain
|
|
141
|
+
management_projectsOrganization: {
|
|
142
|
+
forward: { on: "management_projects", has: "one", label: "organization" },
|
|
143
|
+
reverse: { on: "organizations", has: "many", label: "management_projects" },
|
|
144
|
+
},
|
|
145
|
+
// Can reference base entities ($users, $files) automatically
|
|
146
|
+
management_tasksUser: {
|
|
147
|
+
forward: { on: "management_tasks", has: "one", label: "assignee" },
|
|
148
|
+
reverse: { on: "$users", has: "many", label: "management_tasks" },
|
|
149
|
+
},
|
|
150
|
+
},
|
|
151
|
+
rooms: {},
|
|
152
|
+
});
|
|
153
|
+
// Flat schema construction - domains can be spread directly
|
|
154
|
+
const completeSchema = core_1.i.schema({
|
|
155
|
+
entities: {
|
|
156
|
+
...managementDomain.entities, // Includes base + core + management entities
|
|
157
|
+
},
|
|
158
|
+
links: {
|
|
159
|
+
...managementDomain.links,
|
|
160
|
+
},
|
|
161
|
+
rooms: {
|
|
162
|
+
...managementDomain.rooms,
|
|
163
|
+
},
|
|
164
|
+
});
|
|
165
|
+
// Test compose still works with domain instances
|
|
166
|
+
const classicDomain = (0, __1.domain)({
|
|
167
|
+
entities: { test: core_1.i.entity({ name: core_1.i.string() }) },
|
|
168
|
+
links: {},
|
|
169
|
+
rooms: {},
|
|
170
|
+
});
|
|
171
|
+
const composed = classicDomain.compose((0, __1.domain)({
|
|
172
|
+
entities: { other: core_1.i.entity({ value: core_1.i.number() }) },
|
|
173
|
+
links: {},
|
|
174
|
+
rooms: {},
|
|
175
|
+
}));
|
|
176
|
+
// Test: Domain builder produces flat objects compatible with i.schema
|
|
177
|
+
// This demonstrates the flat approach - domains return plain objects
|
|
178
|
+
const managementEntities = management.entities;
|
|
179
|
+
const managementLinks = management.links;
|
|
180
|
+
const filesOnlyEntities = filesOnly.entities;
|
|
181
|
+
// These can be spread directly into i.schema in real usage
|
|
182
|
+
const _entities = managementEntities;
|
|
183
|
+
const _links = managementLinks;
|
|
184
|
+
// Type assertions for runtime verification (these should not fail)
|
|
185
|
+
const _management = management;
|
|
186
|
+
const _filesOnly = filesOnly;
|
|
187
|
+
const _composed = composed;
|
|
188
|
+
// Test toInstantSchema method compatibility
|
|
189
|
+
const domainWithInstantSchema = (0, __1.domain)("instantTest")
|
|
190
|
+
.includes(otherDomain)
|
|
191
|
+
.schema({
|
|
192
|
+
entities: {
|
|
193
|
+
instant_entities: core_1.i.entity({
|
|
194
|
+
name: core_1.i.string(),
|
|
195
|
+
}),
|
|
196
|
+
},
|
|
197
|
+
links: {
|
|
198
|
+
instantEntityOrg: {
|
|
199
|
+
forward: { on: "instant_entities", has: "one", label: "organization" },
|
|
200
|
+
reverse: { on: "organizations", has: "many", label: "instant_entities" },
|
|
201
|
+
},
|
|
202
|
+
},
|
|
203
|
+
rooms: {},
|
|
204
|
+
});
|
|
205
|
+
const _instantSchemaCheck = true;
|
|
206
|
+
// =====================================================================================
|
|
207
|
+
// ❌ COMPILE-TIME VALIDATION: Links and Entity Conflicts
|
|
208
|
+
// =====================================================================================
|
|
209
|
+
// (Omitted negative tests that intentionally fail compilation)
|
|
210
|
+
// (Known limitation) Duplicate entity names across includes are not detected at compile time
|
|
211
|
+
//# sourceMappingURL=domain-builder.typecheck.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"domain-builder.typecheck.js","sourceRoot":"","sources":["../../src/__type_tests__/domain-builder.typecheck.ts"],"names":[],"mappings":";AAAA,+CAA+C;AAC/C,8DAA8D;;AAE9D,0BAA4B;AAC5B,0CAAoC;AAEpC,8EAA8E;AAE9E,oCAAoC;AACpC,MAAM,WAAW,GAAG,IAAA,UAAM,EAAC;IACzB,QAAQ,EAAE;QACR,aAAa,EAAE,QAAC,CAAC,MAAM,CAAC;YACtB,UAAU,EAAE,QAAC,CAAC,MAAM,EAAE,CAAC,OAAO,EAAE,CAAC,MAAM,EAAE;YACzC,QAAQ,EAAE,QAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;SAChC,CAAC;KACH;IACD,KAAK,EAAE,EAAE;IACT,KAAK,EAAE,EAAE;CACV,CAAC,CAAC;AAEH,gFAAgF;AAChF,MAAM,UAAU,GAAG,IAAA,UAAM,EAAC,YAAY,CAAC;KACpC,QAAQ,CAAC,WAAW,CAAC;KACrB,MAAM,CAAC;IACN,QAAQ,EAAE;QACR,mBAAmB,EAAE,QAAC,CAAC,MAAM,CAAC;YAC5B,IAAI,EAAE,QAAC,CAAC,M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E,MAAM,EAAE,KAAK,EAAE,kBAAkB,EAAE;SACzE;KACF;IACD,KAAK,EAAE,EAAE;CACV,CAAC,CAAC;AAKL,MAAM,mBAAmB,GAAyB,IAAI,CAAC;AAEvD,wFAAwF;AACxF,wDAAwD;AACxD,wFAAwF;AAExF,+DAA+D;AAE/D,6FAA6F"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"domain-conflicts-examples.d.ts","sourceRoot":"","sources":["../../src/__type_tests__/domain-conflicts-examples.ts"],"names":[],"mappings":"AAwMA,OAAO,EAAE,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// =====================================================================================
|
|
3
|
+
// ⚠️ DOMAIN CONFLICTS AND EDGE CASES
|
|
4
|
+
// =====================================================================================
|
|
5
|
+
// This file demonstrates scenarios where entity name conflicts can occur
|
|
6
|
+
// and how the domain builder handles them.
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
//# sourceMappingURL=domain-conflicts-examples.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"domain-conflicts-examples.js","sourceRoot":"","sources":["../../src/__type_tests__/domain-conflicts-examples.ts"],"names":[],"mappings":";AAAA,wFAAwF;AACxF,sCAAsC;AACtC,wFAAwF;AACxF,yEAAyE;AACzE,2CAA2C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"instant-schema-example.d.ts","sourceRoot":"","sources":["../../src/__type_tests__/instant-schema-example.ts"],"names":[],"mappings":"AAyKA,QAAA,MAAM,aAAa,KAA8B,CAAC;AAIlD,eAAe,aAAa,CAAC"}
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Example: instant.schema.ts using domain builder
|
|
3
|
+
// This shows how to build a complete InstantDB schema using domains
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
const core_1 = require("@instantdb/core");
|
|
6
|
+
const index_1 = require("../index");
|
|
7
|
+
// 1. Base/Core domain - defines fundamental entities
|
|
8
|
+
const coreDomain = (0, index_1.domain)({
|
|
9
|
+
entities: {
|
|
10
|
+
organizations: core_1.i.entity({
|
|
11
|
+
clerkOrgId: core_1.i.string().indexed().unique(),
|
|
12
|
+
name: core_1.i.string(),
|
|
13
|
+
timezone: core_1.i.string().optional(),
|
|
14
|
+
createdAt: core_1.i.date(),
|
|
15
|
+
}),
|
|
16
|
+
},
|
|
17
|
+
links: {},
|
|
18
|
+
rooms: {},
|
|
19
|
+
});
|
|
20
|
+
// 2. Finance domain - includes core entities for financial operations
|
|
21
|
+
const financeDomain = (0, index_1.domain)("finance")
|
|
22
|
+
.includes(coreDomain) // Include core entities (orgs, users) for cross-references
|
|
23
|
+
.schema({
|
|
24
|
+
entities: {
|
|
25
|
+
transactions: core_1.i.entity({
|
|
26
|
+
provider: core_1.i.string().indexed(),
|
|
27
|
+
externalId: core_1.i.string().indexed(),
|
|
28
|
+
amount: core_1.i.number(),
|
|
29
|
+
currency: core_1.i.string().optional(),
|
|
30
|
+
status: core_1.i.string().indexed(),
|
|
31
|
+
description: core_1.i.string().optional(),
|
|
32
|
+
createdAt: core_1.i.date().indexed(),
|
|
33
|
+
updatedAt: core_1.i.date().indexed().optional(),
|
|
34
|
+
}),
|
|
35
|
+
payments: core_1.i.entity({
|
|
36
|
+
provider: core_1.i.string().indexed(),
|
|
37
|
+
externalPaymentId: core_1.i.string().indexed(),
|
|
38
|
+
amount: core_1.i.number(),
|
|
39
|
+
currency: core_1.i.string().optional(),
|
|
40
|
+
status: core_1.i.string().indexed(),
|
|
41
|
+
method: core_1.i.string().optional(),
|
|
42
|
+
createdAt: core_1.i.date(),
|
|
43
|
+
}),
|
|
44
|
+
},
|
|
45
|
+
links: {
|
|
46
|
+
// Cross-reference to organizations from coreDomain
|
|
47
|
+
transactionOrganization: {
|
|
48
|
+
forward: { on: "transactions", has: "one", label: "organization" },
|
|
49
|
+
reverse: { on: "organizations", has: "many", label: "transactions" },
|
|
50
|
+
},
|
|
51
|
+
// Cross-reference to users (base entity, automatically available)
|
|
52
|
+
transactionUser: {
|
|
53
|
+
forward: { on: "transactions", has: "one", label: "createdBy" },
|
|
54
|
+
reverse: { on: "$users", has: "many", label: "transactions" },
|
|
55
|
+
},
|
|
56
|
+
// Base entities are automatically available
|
|
57
|
+
paymentFiles: {
|
|
58
|
+
forward: { on: "payments", has: "many", label: "$files" },
|
|
59
|
+
reverse: { on: "$files", has: "one", label: "payment" },
|
|
60
|
+
},
|
|
61
|
+
transactionPayment: {
|
|
62
|
+
forward: { on: "transactions", has: "one", label: "payment" },
|
|
63
|
+
reverse: { on: "payments", has: "one", label: "transaction" },
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
rooms: {},
|
|
67
|
+
});
|
|
68
|
+
// 3. Management domain - includes core entities for project management
|
|
69
|
+
const managementDomain = (0, index_1.domain)("management")
|
|
70
|
+
.includes(coreDomain) // Include core entities (orgs, users)
|
|
71
|
+
.schema({
|
|
72
|
+
entities: {
|
|
73
|
+
projects: core_1.i.entity({
|
|
74
|
+
name: core_1.i.string(),
|
|
75
|
+
description: core_1.i.string().optional(),
|
|
76
|
+
status: core_1.i.string(),
|
|
77
|
+
createdAt: core_1.i.date(),
|
|
78
|
+
updatedAt: core_1.i.date(),
|
|
79
|
+
}),
|
|
80
|
+
tasks: core_1.i.entity({
|
|
81
|
+
title: core_1.i.string(),
|
|
82
|
+
description: core_1.i.string().optional(),
|
|
83
|
+
status: core_1.i.string(),
|
|
84
|
+
priority: core_1.i.string().optional(),
|
|
85
|
+
createdAt: core_1.i.date(),
|
|
86
|
+
updatedAt: core_1.i.date(),
|
|
87
|
+
}),
|
|
88
|
+
},
|
|
89
|
+
links: {
|
|
90
|
+
// Cross-reference to organizations from coreDomain
|
|
91
|
+
projectOrganization: {
|
|
92
|
+
forward: { on: "projects", has: "one", label: "organization" },
|
|
93
|
+
reverse: { on: "organizations", has: "many", label: "projects" },
|
|
94
|
+
},
|
|
95
|
+
// Cross-reference to users (base entity, automatically available)
|
|
96
|
+
taskAssignee: {
|
|
97
|
+
forward: { on: "tasks", has: "one", label: "assignee" },
|
|
98
|
+
reverse: { on: "$users", has: "many", label: "assignedTasks" },
|
|
99
|
+
},
|
|
100
|
+
taskCreator: {
|
|
101
|
+
forward: { on: "tasks", has: "one", label: "creator" },
|
|
102
|
+
reverse: { on: "$users", has: "many", label: "createdTasks" },
|
|
103
|
+
},
|
|
104
|
+
// Project-Task relationship
|
|
105
|
+
projectTasks: {
|
|
106
|
+
forward: { on: "projects", has: "many", label: "tasks" },
|
|
107
|
+
reverse: { on: "tasks", has: "one", label: "project" },
|
|
108
|
+
},
|
|
109
|
+
// Base entities automatically available
|
|
110
|
+
projectFiles: {
|
|
111
|
+
forward: { on: "projects", has: "many", label: "$files" },
|
|
112
|
+
reverse: { on: "$files", has: "one", label: "project" },
|
|
113
|
+
},
|
|
114
|
+
},
|
|
115
|
+
rooms: {},
|
|
116
|
+
});
|
|
117
|
+
// 4. App domain - combines all domains for the complete application schema
|
|
118
|
+
const appDomain = (0, index_1.domain)("app")
|
|
119
|
+
.includes(coreDomain) // ✅ Include core domain
|
|
120
|
+
.includes(financeDomain) // ✅ Include finance domain
|
|
121
|
+
.includes(managementDomain) // ✅ Include management domain
|
|
122
|
+
.schema({
|
|
123
|
+
entities: {
|
|
124
|
+
// App-specific entities
|
|
125
|
+
app_settings: core_1.i.entity({
|
|
126
|
+
key: core_1.i.string().unique().indexed(),
|
|
127
|
+
value: core_1.i.any(),
|
|
128
|
+
createdAt: core_1.i.date(),
|
|
129
|
+
updatedAt: core_1.i.date(),
|
|
130
|
+
}),
|
|
131
|
+
notifications: core_1.i.entity({
|
|
132
|
+
type: core_1.i.string(),
|
|
133
|
+
message: core_1.i.string(),
|
|
134
|
+
read: core_1.i.boolean().optional(),
|
|
135
|
+
createdAt: core_1.i.date(),
|
|
136
|
+
}),
|
|
137
|
+
},
|
|
138
|
+
links: {
|
|
139
|
+
// Cross-references to all included domains
|
|
140
|
+
organizationMembers: {
|
|
141
|
+
forward: { on: "organizations", has: "many", label: "members" },
|
|
142
|
+
reverse: { on: "$users", has: "many", label: "organizations" },
|
|
143
|
+
},
|
|
144
|
+
settingsOrganization: {
|
|
145
|
+
forward: { on: "app_settings", has: "one", label: "organization" },
|
|
146
|
+
reverse: { on: "organizations", has: "many", label: "settings" },
|
|
147
|
+
},
|
|
148
|
+
notificationUser: {
|
|
149
|
+
forward: { on: "notifications", has: "one", label: "user" },
|
|
150
|
+
reverse: { on: "$users", has: "many", label: "notifications" },
|
|
151
|
+
},
|
|
152
|
+
// Can reference entities from transitively included domains
|
|
153
|
+
notificationTransaction: {
|
|
154
|
+
forward: { on: "notifications", has: "one", label: "relatedTransaction" },
|
|
155
|
+
reverse: { on: "transactions", has: "many", label: "notifications" },
|
|
156
|
+
},
|
|
157
|
+
notificationProject: {
|
|
158
|
+
forward: { on: "notifications", has: "one", label: "relatedProject" },
|
|
159
|
+
reverse: { on: "projects", has: "many", label: "notifications" },
|
|
160
|
+
},
|
|
161
|
+
},
|
|
162
|
+
rooms: {},
|
|
163
|
+
});
|
|
164
|
+
// FINAL SCHEMA: Complete InstantDB schema using domain toInstantSchema()
|
|
165
|
+
// This would be in your instant.schema.ts file:
|
|
166
|
+
const instantSchema = appDomain.toInstantSchema(); // That's it!
|
|
167
|
+
exports.default = instantSchema;
|
|
168
|
+
/*
|
|
169
|
+
USAGE NOTES:
|
|
170
|
+
|
|
171
|
+
1. When you .includes() a domain, you get ALL its entities transitively:
|
|
172
|
+
- appDomain.includes(coreDomain) → gets core entities
|
|
173
|
+
- appDomain.includes(financeDomain) → gets finance + core entities (transitive)
|
|
174
|
+
- appDomain.includes(managementDomain) → gets management + core entities (transitive)
|
|
175
|
+
|
|
176
|
+
2. Base entities ($users, $files) are automatically included in ALL domains
|
|
177
|
+
|
|
178
|
+
3. Cross-domain links work automatically - you can reference entities from included domains
|
|
179
|
+
|
|
180
|
+
4. toInstantSchema() returns the complete InstantDB schema directly:
|
|
181
|
+
- domain.toInstantSchema() ✅ Returns ready-to-use schema
|
|
182
|
+
- No need to wrap with i.schema() or manual spreading
|
|
183
|
+
|
|
184
|
+
5. No manual duplication of base entities or transitive dependencies needed
|
|
185
|
+
|
|
186
|
+
6. Anywhere you need an InstantDB schema object, you can use domain.toInstantSchema()
|
|
187
|
+
*/
|
|
188
|
+
//# sourceMappingURL=instant-schema-example.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"instant-schema-example.js","sourceRoot":"","sources":["../../src/__type_tests__/instant-schema-example.ts"],"names":[],"mappings":";AAAA,kDAAkD;AAClD,oEAAoE;;AAEpE,0CAAoC;AACpC,oCAAkC;AAElC,qDAAqD;AACrD,MAAM,UAAU,GAAG,IAAA,cAAM,EAAC;IACxB,QAAQ,EAAE;QACR,aAAa,EAAE,QAAC,CAAC,MAAM,CAAC;YACtB,UAAU,EAAE,QAAC,CAAC,MAAM,EAAE,CAAC,OAAO,EAAE,CAAC,MAAM,EAAE;YACzC,IAAI,EAAE,QAAC,CAAC,MAAM,EAAE;YAChB,QAAQ,EAAE,QAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;YAC/B,SAAS,EAAE,QAAC,CAAC,IAAI,EAAE;SACpB,CAAC;KACH;IACD,KAAK,EAAE,EAAE;IACT,KAAK,EAAE,EAAE;CACV,CAAC,CAAC;AAEH,sEAAsE;AACtE,MAAM,aAAa,GAAG,IAAA,cAAM,EAAC,SAAS,CAAC;KACpC,QAAQ,CAAC,UAAU,CAAC,CAAC,2DAA2D;KAChF,MAAM,CAAC;IACN,QAAQ,EAAE;QACR,YAAY,EAAE,QAAC,CAAC,MAAM,CAAC;YACrB,QAAQ,EAAE,QAAC,CAAC,MAAM,EAAE,CAAC,OAAO,EAAE;YAC9B,UAAU,EAAE,QAAC,CAAC,MAAM,EAAE,CAAC,OAAO,EAAE;YAChC,MAAM,EAAE,QAAC,C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,OAAO,EAAE,EAAE,EAAE,EAAE,eAAe,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,EAAE;SACjE;QACD,gBAAgB,EAAE;YAChB,OAAO,EAAE,EAAE,EAAE,EAAE,eAAe,EAAE,GAAG,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE;YAC3D,OAAO,EAAE,EAAE,EAAE,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,eAAe,EAAE;SAC/D;QACD,4DAA4D;QAC5D,uBAAuB,EAAE;YACvB,OAAO,EAAE,EAAE,EAAE,EAAE,eAAe,EAAE,GAAG,EAAE,KAAK,EAAE,KAAK,EAAE,oBAAoB,EAAE;YACzE,OAAO,EAAE,EAAE,EAAE,EAAE,cAAc,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,eAAe,EAAE;SACrE;QACD,mBAAmB,EAAE;YACnB,OAAO,EAAE,EAAE,EAAE,EAAE,eAAe,EAAE,GAAG,EAAE,KAAK,EAAE,KAAK,EAAE,gBAAgB,EAAE;YACrE,OAAO,EAAE,EAAE,EAAE,EAAE,UAAU,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,eAAe,EAAE;SACjE;KACF;IACC,KAAK,EAAE,EAAE;CACV,CAAC,CAAC;AAEL,yEAAyE;AACzE,gDAAgD;AAChD,MAAM,aAAa,GAAG,SAAS,CAAC,eAAe,EAAE,CAAC,CAAC,aAAa;AAIhE,kBAAe,aAAa,CAAC;AAE7B;;;;;;;;;;;;;;;;;;;EAmBE"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const instantSchema: import("@instantdb/core").InstantSchemaDef<import("@instantdb/core").EntitiesWithLinks<import("@instantdb/core").EntitiesDef, import("@instantdb/core").LinksDef<import("@instantdb/core").EntitiesDef>>, import("@instantdb/core").LinksDef<any>, import("@instantdb/core").RoomsDef>;
|
|
2
|
+
export type AppSchema = typeof instantSchema;
|
|
3
|
+
export default instantSchema;
|
|
4
|
+
//# sourceMappingURL=instant-schema-migration-example.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"instant-schema-migration-example.d.ts","sourceRoot":"","sources":["../../src/__type_tests__/instant-schema-migration-example.ts"],"names":[],"mappings":"AAoKA,eAAO,MAAM,aAAa,wRAAwC,CAAC;AASnE,MAAM,MAAM,SAAS,GAAG,OAAO,aAAa,CAAC;AAC7C,eAAe,aAAa,CAAC"}
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Example: Migrating from manual instant.schema.ts to domain-based schema
|
|
3
|
+
// This shows how to convert your existing ekairos-web instant.schema.ts
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.instantSchema = void 0;
|
|
6
|
+
const core_1 = require("@instantdb/core");
|
|
7
|
+
const index_1 = require("../index");
|
|
8
|
+
// BEFORE: Manual schema with 400+ lines
|
|
9
|
+
// const _schema = i.schema({
|
|
10
|
+
// entities: { /* 200+ lines of entities */ },
|
|
11
|
+
// links: { /* 200+ lines of links */ },
|
|
12
|
+
// rooms: { /* rooms */ },
|
|
13
|
+
// });
|
|
14
|
+
// AFTER: Domain-based schema - modular and maintainable
|
|
15
|
+
// Core domain - fundamental entities shared across all domains
|
|
16
|
+
const coreDomain = (0, index_1.domain)({
|
|
17
|
+
entities: {
|
|
18
|
+
organizations: core_1.i.entity({
|
|
19
|
+
clerkOrgId: core_1.i.string().indexed().unique(),
|
|
20
|
+
name: core_1.i.string(),
|
|
21
|
+
timezone: core_1.i.string().optional(),
|
|
22
|
+
}),
|
|
23
|
+
},
|
|
24
|
+
links: {},
|
|
25
|
+
rooms: {},
|
|
26
|
+
});
|
|
27
|
+
// Finance domain - all financial entities and operations
|
|
28
|
+
const financeDomain = (0, index_1.domain)("finance")
|
|
29
|
+
.includes(coreDomain)
|
|
30
|
+
.schema({
|
|
31
|
+
entities: {
|
|
32
|
+
transactions: core_1.i.entity({
|
|
33
|
+
provider: core_1.i.string().indexed(),
|
|
34
|
+
externalId: core_1.i.string().indexed(),
|
|
35
|
+
amount: core_1.i.number(),
|
|
36
|
+
currency: core_1.i.string().optional(),
|
|
37
|
+
status: core_1.i.string().indexed(),
|
|
38
|
+
description: core_1.i.string().optional(),
|
|
39
|
+
createdAt: core_1.i.date().indexed(),
|
|
40
|
+
updatedAt: core_1.i.date().indexed().optional(),
|
|
41
|
+
}),
|
|
42
|
+
payments: core_1.i.entity({
|
|
43
|
+
provider: core_1.i.string().indexed(),
|
|
44
|
+
externalPaymentId: core_1.i.string().indexed(),
|
|
45
|
+
amount: core_1.i.number(),
|
|
46
|
+
currency: core_1.i.string().optional(),
|
|
47
|
+
status: core_1.i.string().indexed(),
|
|
48
|
+
method: core_1.i.string().optional(),
|
|
49
|
+
createdAt: core_1.i.date(),
|
|
50
|
+
}),
|
|
51
|
+
},
|
|
52
|
+
links: {
|
|
53
|
+
transactionOrganization: {
|
|
54
|
+
forward: { on: "transactions", has: "one", label: "organization" },
|
|
55
|
+
reverse: { on: "organizations", has: "many", label: "transactions" },
|
|
56
|
+
},
|
|
57
|
+
transactionUser: {
|
|
58
|
+
forward: { on: "transactions", has: "one", label: "createdBy" },
|
|
59
|
+
reverse: { on: "$users", has: "many", label: "transactions" },
|
|
60
|
+
},
|
|
61
|
+
transactionPayment: {
|
|
62
|
+
forward: { on: "transactions", has: "one", label: "payment" },
|
|
63
|
+
reverse: { on: "payments", has: "one", label: "transaction" },
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
rooms: {},
|
|
67
|
+
});
|
|
68
|
+
// Management domain - project and task management
|
|
69
|
+
const managementDomain = (0, index_1.domain)("management")
|
|
70
|
+
.includes(coreDomain)
|
|
71
|
+
.schema({
|
|
72
|
+
entities: {
|
|
73
|
+
projects: core_1.i.entity({
|
|
74
|
+
name: core_1.i.string(),
|
|
75
|
+
description: core_1.i.string().optional(),
|
|
76
|
+
status: core_1.i.string(),
|
|
77
|
+
createdAt: core_1.i.date(),
|
|
78
|
+
updatedAt: core_1.i.date(),
|
|
79
|
+
}),
|
|
80
|
+
tasks: core_1.i.entity({
|
|
81
|
+
title: core_1.i.string(),
|
|
82
|
+
description: core_1.i.string().optional(),
|
|
83
|
+
status: core_1.i.string(),
|
|
84
|
+
priority: core_1.i.string().optional(),
|
|
85
|
+
createdAt: core_1.i.date(),
|
|
86
|
+
updatedAt: core_1.i.date(),
|
|
87
|
+
}),
|
|
88
|
+
},
|
|
89
|
+
links: {
|
|
90
|
+
projectOrganization: {
|
|
91
|
+
forward: { on: "projects", has: "one", label: "organization" },
|
|
92
|
+
reverse: { on: "organizations", has: "many", label: "projects" },
|
|
93
|
+
},
|
|
94
|
+
taskAssignee: {
|
|
95
|
+
forward: { on: "tasks", has: "one", label: "assignee" },
|
|
96
|
+
reverse: { on: "$users", has: "many", label: "assignedTasks" },
|
|
97
|
+
},
|
|
98
|
+
projectTasks: {
|
|
99
|
+
forward: { on: "projects", has: "many", label: "tasks" },
|
|
100
|
+
reverse: { on: "tasks", has: "one", label: "project" },
|
|
101
|
+
},
|
|
102
|
+
},
|
|
103
|
+
rooms: {},
|
|
104
|
+
});
|
|
105
|
+
// App domain - combines everything for the complete application
|
|
106
|
+
const appDomain = (0, index_1.domain)("app")
|
|
107
|
+
.includes(coreDomain) // Include core entities
|
|
108
|
+
.includes(financeDomain) // Include finance (transitively includes core)
|
|
109
|
+
.includes(managementDomain) // Include management (transitively includes core)
|
|
110
|
+
.schema({
|
|
111
|
+
entities: {
|
|
112
|
+
// App-specific entities
|
|
113
|
+
app_settings: core_1.i.entity({
|
|
114
|
+
key: core_1.i.string().unique().indexed(),
|
|
115
|
+
value: core_1.i.any(),
|
|
116
|
+
createdAt: core_1.i.date(),
|
|
117
|
+
updatedAt: core_1.i.date(),
|
|
118
|
+
}),
|
|
119
|
+
notifications: core_1.i.entity({
|
|
120
|
+
type: core_1.i.string(),
|
|
121
|
+
message: core_1.i.string(),
|
|
122
|
+
read: core_1.i.boolean().optional(),
|
|
123
|
+
createdAt: core_1.i.date(),
|
|
124
|
+
}),
|
|
125
|
+
// Add all the other entities from your current schema here...
|
|
126
|
+
// (locations, routes, items, etc.)
|
|
127
|
+
},
|
|
128
|
+
links: {
|
|
129
|
+
// Core organization links (base entities available here)
|
|
130
|
+
organizationMembers: {
|
|
131
|
+
forward: { on: "organizations", has: "many", label: "members" },
|
|
132
|
+
reverse: { on: "$users", has: "many", label: "organizations" },
|
|
133
|
+
},
|
|
134
|
+
// App-specific links
|
|
135
|
+
settingsOrganization: {
|
|
136
|
+
forward: { on: "app_settings", has: "one", label: "organization" },
|
|
137
|
+
reverse: { on: "organizations", has: "many", label: "settings" },
|
|
138
|
+
},
|
|
139
|
+
notificationUser: {
|
|
140
|
+
forward: { on: "notifications", has: "one", label: "user" },
|
|
141
|
+
reverse: { on: "$users", has: "many", label: "notifications" },
|
|
142
|
+
},
|
|
143
|
+
// Cross-domain references work automatically
|
|
144
|
+
notificationTransaction: {
|
|
145
|
+
forward: { on: "notifications", has: "one", label: "relatedTransaction" },
|
|
146
|
+
reverse: { on: "transactions", has: "many", label: "notifications" },
|
|
147
|
+
},
|
|
148
|
+
notificationProject: {
|
|
149
|
+
forward: { on: "notifications", has: "one", label: "relatedProject" },
|
|
150
|
+
reverse: { on: "projects", has: "many", label: "notifications" },
|
|
151
|
+
},
|
|
152
|
+
// Add all the other links from your current schema here...
|
|
153
|
+
// (organization links, finance links, etc.)
|
|
154
|
+
},
|
|
155
|
+
rooms: {
|
|
156
|
+
// Add rooms from your current schema
|
|
157
|
+
},
|
|
158
|
+
});
|
|
159
|
+
// FINAL SCHEMA: Direct compatibility with InstantDB
|
|
160
|
+
exports.instantSchema = core_1.i.schema(appDomain.toInstantSchema());
|
|
161
|
+
exports.default = exports.instantSchema;
|
|
162
|
+
/*
|
|
163
|
+
MIGRATION BENEFITS:
|
|
164
|
+
|
|
165
|
+
1. 📦 Modularity: Each domain is independent and reusable
|
|
166
|
+
2. 🔗 Type Safety: Cross-domain links are fully validated
|
|
167
|
+
3. 🚀 Maintainability: Changes are localized to relevant domains
|
|
168
|
+
4. ⚡ Performance: Only load domains you need in specific contexts
|
|
169
|
+
5. 🔄 Compatibility: Drop-in replacement for existing i.schema() calls
|
|
170
|
+
6. 🎯 Clarity: Intent is clear - domains explicitly include their dependencies
|
|
171
|
+
|
|
172
|
+
NEXT STEPS:
|
|
173
|
+
1. Break down your current instant.schema.ts into logical domains
|
|
174
|
+
2. Use .includes() to establish dependencies between domains
|
|
175
|
+
3. Replace manual schema with domain.toInstantSchema()
|
|
176
|
+
4. Test thoroughly - all existing functionality should work identically
|
|
177
|
+
*/
|
|
178
|
+
//# sourceMappingURL=instant-schema-migration-example.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"instant-schema-migration-example.js","sourceRoot":"","sources":["../../src/__type_tests__/instant-schema-migration-example.ts"],"names":[],"mappings":";AAAA,0EAA0E;AAC1E,wEAAwE;;;AAExE,0CAAoC;AACpC,oCAAkC;AAElC,wCAAwC;AACxC,6BAA6B;AAC7B,gDAAgD;AAChD,0CAA0C;AAC1C,4BAA4B;AAC5B,MAAM;AAEN,wDAAwD;AAExD,+DAA+D;AAC/D,MAAM,UAAU,GAAG,IAAA,cAAM,EAAC;IACxB,QAAQ,EAAE;QACR,aAAa,EAAE,QAAC,CAAC,MAAM,CAAC;YACtB,UAAU,EAAE,QAAC,CAAC,MAAM,EAAE,CAAC,OAAO,EAAE,CAAC,MAAM,EAAE;YACzC,IAAI,EAAE,QAAC,CAAC,MAAM,EAAE;YAChB,QAAQ,EAAE,QAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;SAChC,CAAC;KACH;IACD,KAAK,EAAE,EAAE;IACT,KAAK,EAAE,EAAE;CACV,CAAC,CAAC;AAEH,yDAAyD;AACzD,MAAM,aAAa,GAAG,IAAA,cAAM,EAAC,SAAS,CAAC;KACpC,QAAQ,CAAC,UAAU,CAAC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G,EAAE,MAAM,EAAE,KAAK,EAAE,eAAe,EAAE;SACrE;QACD,mBAAmB,EAAE;YACnB,OAAO,EAAE,EAAE,EAAE,EAAE,eAAe,EAAE,GAAG,EAAE,KAAK,EAAE,KAAK,EAAE,gBAAgB,EAAE;YACrE,OAAO,EAAE,EAAE,EAAE,EAAE,UAAU,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,eAAe,EAAE;SACjE;QACD,2DAA2D;QAC3D,4CAA4C;KAC7C;IACD,KAAK,EAAE;IACL,qCAAqC;KACtC;CACF,CAAC,CAAC;AAEL,oDAAoD;AACvC,QAAA,aAAa,GAAG,QAAC,CAAC,MAAM,CAAC,SAAS,CAAC,eAAe,EAAE,CAAC,CAAC;AAUnE,kBAAe,qBAAa,CAAC;AAE7B;;;;;;;;;;;;;;;EAeE"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,14 +1,45 @@
|
|
|
1
1
|
import { i } from "@instantdb/core";
|
|
2
2
|
import type { EntitiesDef, LinksDef, RoomsDef, InstantSchemaDef } from "@instantdb/core";
|
|
3
|
-
export type DomainDefinition<E extends EntitiesDef, L extends LinksDef<
|
|
3
|
+
export type DomainDefinition<E extends EntitiesDef, L extends LinksDef<E>, R extends RoomsDef> = {
|
|
4
4
|
entities: E;
|
|
5
5
|
links: L;
|
|
6
6
|
rooms: R;
|
|
7
7
|
};
|
|
8
|
-
export type DomainInstance<E extends EntitiesDef, L extends LinksDef<
|
|
8
|
+
export type DomainInstance<E extends EntitiesDef, L extends LinksDef<E>, R extends RoomsDef> = DomainDefinition<E, L, R> & {
|
|
9
9
|
schema: () => ReturnType<typeof i.schema>;
|
|
10
10
|
compose: <E2 extends EntitiesDef, L2 extends LinksDef<E2>, R2 extends RoomsDef>(other: DomainInstance<E2, L2, R2> | DomainDefinition<E2, L2, R2>) => DomainInstance<E & E2, LinksDef<E & E2>, R & R2>;
|
|
11
11
|
};
|
|
12
12
|
export type SchemaOf<D extends DomainDefinition<any, any, any>> = InstantSchemaDef<D["entities"], LinksDef<D["entities"]>, D["rooms"]>;
|
|
13
|
-
|
|
13
|
+
type MergeEntities<A extends EntitiesDef, B extends EntitiesDef> = {
|
|
14
|
+
[K in keyof A | keyof B]: K extends keyof A ? A[K] : K extends keyof B ? B[K] : never;
|
|
15
|
+
};
|
|
16
|
+
export type DomainSchemaResult<E extends EntitiesDef = EntitiesDef, L extends LinksDef<any> = LinksDef<any>, R extends RoomsDef = RoomsDef> = {
|
|
17
|
+
entities: E;
|
|
18
|
+
links: L;
|
|
19
|
+
rooms: R;
|
|
20
|
+
toInstantSchema: () => InstantSchemaWithDomain<any>;
|
|
21
|
+
};
|
|
22
|
+
export type InstantSchemaWithDomain<T> = T & {
|
|
23
|
+
entities: EntitiesDef;
|
|
24
|
+
links: Record<string, any>;
|
|
25
|
+
rooms: RoomsDef;
|
|
26
|
+
withRoomSchema: any;
|
|
27
|
+
};
|
|
28
|
+
type AnyEntityDef = EntitiesDef[string];
|
|
29
|
+
type BaseEntitiesPhantom = {
|
|
30
|
+
$users: AnyEntityDef;
|
|
31
|
+
$files: AnyEntityDef;
|
|
32
|
+
};
|
|
33
|
+
type WithBase<E extends EntitiesDef> = MergeEntities<E, BaseEntitiesPhantom>;
|
|
34
|
+
export type DomainBuilder<AccumE extends EntitiesDef> = {
|
|
35
|
+
includes: <E2 extends EntitiesDef>(other: DomainInstance<E2, any, any> | DomainSchemaResult<E2, any, any> | InstantSchemaDef<E2, any, any>) => DomainBuilder<MergeEntities<AccumE, E2>>;
|
|
36
|
+
schema: <LE extends EntitiesDef>(def: {
|
|
37
|
+
entities: LE;
|
|
38
|
+
links: LinksDef<WithBase<MergeEntities<AccumE, LE>>>;
|
|
39
|
+
rooms: RoomsDef;
|
|
40
|
+
}) => DomainSchemaResult<MergeEntities<AccumE, LE>, LinksDef<MergeEntities<AccumE, LE>>, RoomsDef>;
|
|
41
|
+
};
|
|
42
|
+
export declare function domain<E extends EntitiesDef, L extends LinksDef<E>, R extends RoomsDef>(def: DomainDefinition<E, L, R>): DomainInstance<E, L, R>;
|
|
43
|
+
export declare function domain(name?: string): DomainBuilder<{}>;
|
|
44
|
+
export {};
|
|
14
45
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,iBAAiB,CAAC;AACpC,OAAO,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,iBAAiB,CAAC;AACpC,OAAO,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAKzF,MAAM,MAAM,gBAAgB,CAAC,CAAC,SAAS,WAAW,EAAE,CAAC,SAAS,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,SAAS,QAAQ,IAAI;IAC/F,QAAQ,EAAE,CAAC,CAAC;IACZ,KAAK,EAAE,CAAC,CAAC;IACT,KAAK,EAAE,CAAC,CAAC;CACV,CAAC;AAEF,MAAM,MAAM,cAAc,CAAC,CAAC,SAAS,WAAW,EAAE,CAAC,SAAS,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,SAAS,QAAQ,IAAI,gBAAgB,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,GAAG;IACzH,MAAM,EAAE,MAAM,UAAU,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC;IAC1C,OAAO,EAAE,CAAC,EAAE,SAAS,WAAW,EAAE,EAAE,SAAS,QAAQ,CAAC,EAAE,CAAC,EAAE,EAAE,SAAS,QAAQ,EAC5E,KAAK,EAA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Ac,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;AAG3B,wBAAgB,MAAM,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,aAAa,CAAC,EAAE,CAAC,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.domain = domain;
|
|
4
4
|
const core_1 = require("@instantdb/core");
|
|
5
|
-
function
|
|
5
|
+
function makeInstance(def) {
|
|
6
6
|
function schema() {
|
|
7
7
|
return core_1.i.schema({
|
|
8
8
|
entities: def.entities,
|
|
@@ -11,13 +11,13 @@ function domain(def) {
|
|
|
11
11
|
});
|
|
12
12
|
}
|
|
13
13
|
function compose(other) {
|
|
14
|
-
const otherDef =
|
|
14
|
+
const otherDef = "schema" in other
|
|
15
15
|
? { entities: other.entities, links: other.links, rooms: other.rooms }
|
|
16
16
|
: other;
|
|
17
17
|
const mergedEntities = { ...def.entities, ...otherDef.entities };
|
|
18
18
|
const mergedLinks = { ...def.links, ...otherDef.links };
|
|
19
19
|
const mergedRooms = { ...def.rooms, ...otherDef.rooms };
|
|
20
|
-
return
|
|
20
|
+
return makeInstance({
|
|
21
21
|
entities: mergedEntities,
|
|
22
22
|
links: mergedLinks,
|
|
23
23
|
rooms: mergedRooms,
|
|
@@ -31,4 +31,43 @@ function domain(def) {
|
|
|
31
31
|
compose,
|
|
32
32
|
};
|
|
33
33
|
}
|
|
34
|
+
// Impl
|
|
35
|
+
function domain(arg) {
|
|
36
|
+
if (typeof arg === "object" && arg !== null) {
|
|
37
|
+
// classic API path: def provided directly
|
|
38
|
+
const def = arg;
|
|
39
|
+
return makeInstance(def);
|
|
40
|
+
}
|
|
41
|
+
// builder API - runtime state tracks accumulated dependencies
|
|
42
|
+
function createBuilder(deps) {
|
|
43
|
+
return {
|
|
44
|
+
includes: (other) => {
|
|
45
|
+
const entities = other.entities;
|
|
46
|
+
const merged = { ...deps, ...entities };
|
|
47
|
+
return createBuilder(merged);
|
|
48
|
+
},
|
|
49
|
+
schema: (def) => {
|
|
50
|
+
// Runtime merge for output; compile-time validation handled by types above
|
|
51
|
+
const allEntities = { ...deps, ...def.entities };
|
|
52
|
+
return {
|
|
53
|
+
entities: allEntities,
|
|
54
|
+
// Strip base phantom from public type so it's assignable to i.schema()
|
|
55
|
+
links: def.links,
|
|
56
|
+
rooms: def.rooms,
|
|
57
|
+
toInstantSchema: () => {
|
|
58
|
+
const { i } = require("@instantdb/core");
|
|
59
|
+
return i.schema({
|
|
60
|
+
entities: allEntities,
|
|
61
|
+
links: def.links,
|
|
62
|
+
rooms: def.rooms,
|
|
63
|
+
});
|
|
64
|
+
},
|
|
65
|
+
};
|
|
66
|
+
},
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
// Default include: start with an empty i.schema() so Instant base entities are present
|
|
70
|
+
const base = core_1.i.schema({ entities: {}, links: {}, rooms: {} });
|
|
71
|
+
return createBuilder({ ...base.entities });
|
|
72
|
+
}
|
|
34
73
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;AA8HA,wBA2CC;AAzKD,0CAAoC;AA8EpC,SAAS,YAAY,CACnB,GAA8B;IAE9B,SAAS,MAAM;QACb,OAAO,QAAC,CAAC,MAAM,CAAC;YACd,QAAQ,EAAE,GAAG,CAAC,QAAa;YAC3B,KAAK,EAAE,GAAG,CAAC,KAAU;YACrB,KAAK,EAAE,GAAG,CAAC,KAAU;SACtB,CAAgC,CAAC;IACpC,CAAC;IAED,SAAS,OAAO,CACd,KAAgE;QAEhE,MAAM,QAAQ,GACZ,QAAQ,IAAI,KAAK;YACf,CAAC,CAAC,EAAE,QAAQ,EAAE,KAAK,CAA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MAAM,EAAC,CAAyB,GAI/B,EAAwF,EAAE;gBACzF,2EAA2E;gBAC3E,MAAM,WAAW,GAAG,EAAE,GAAG,IAAI,EAAE,GAAG,GAAG,CAAC,QAAQ,EAA2B,CAAC;gBAC1E,OAAO;oBACL,QAAQ,EAAE,WAAW;oBACrB,uEAAuE;oBACvE,KAAK,EAAE,GAAG,CAAC,KAAmD;oBAC9D,KAAK,EAAE,GAAG,CAAC,KAAK;oBAChB,eAAe,EAAE,GAAG,EAAE;wBACpB,MAAM,EAAE,CAAC,EAAE,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;wBACzC,OAAO,CAAC,CAAC,MAAM,CAAC;4BACd,QAAQ,EAAE,WAAW;4BACrB,KAAK,EAAE,GAAG,CAAC,KAAmD;4BAC9D,KAAK,EAAE,GAAG,CAAC,KAAK;yBACjB,CAAC,CAAC;oBACL,CAAC;iBACF,CAAC;YACJ,CAAC;SACF,CAAC;IACJ,CAAC;IAED,uFAAuF;IACvF,MAAM,IAAI,GAAG,QAAC,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CAAC;IAC9D,OAAO,aAAa,CAAK,EAAE,GAAG,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;AACjD,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ekairos/domain",
|
|
3
|
-
"version": "1.8.
|
|
3
|
+
"version": "1.8.5-beta.0",
|
|
4
4
|
"description": "Pulzar Domain Utilities",
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -28,10 +28,12 @@
|
|
|
28
28
|
"build": "tsc -p tsconfig.json",
|
|
29
29
|
"dev": "tsc -p tsconfig.json --watch",
|
|
30
30
|
"clean": "node -e \"require('fs').rmSync('dist', {recursive:true, force:true})\"",
|
|
31
|
-
"typecheck": "tsc --noEmit"
|
|
31
|
+
"typecheck": "tsc --noEmit",
|
|
32
|
+
"typecheck:tests": "tsc --noEmit -p tsconfig.typecheck.json",
|
|
33
|
+
"test:conflicts": "node dist/__type_tests__/conflict-validation.test.js"
|
|
32
34
|
},
|
|
33
35
|
"dependencies": {
|
|
34
|
-
"@instantdb/core": "^0.
|
|
36
|
+
"@instantdb/core": "^0.20.21"
|
|
35
37
|
},
|
|
36
38
|
"devDependencies": {
|
|
37
39
|
"@ekairos/tsconfig": "workspace:*",
|