@ekairos/domain 1.16.3-beta.0 → 1.16.5
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.
|
@@ -1,95 +1,95 @@
|
|
|
1
|
-
declare const schema: import("@instantdb/core").InstantSchemaDef<import("@instantdb/core").EntitiesWithLinks<{
|
|
2
|
-
$users: import("@instantdb/core").EntityDef<any, any, any>;
|
|
3
|
-
$files: import("@instantdb/core").EntityDef<any, any, any>;
|
|
4
|
-
test_a_items: import("@instantdb/core").EntityDef<{
|
|
5
|
-
name: import("@instantdb/core").DataAttrDef<string, true, false>;
|
|
6
|
-
value: import("@instantdb/core").DataAttrDef<number, true, false>;
|
|
7
|
-
createdAt: import("@instantdb/core").DataAttrDef<Date, true, false>;
|
|
8
|
-
}, {}, void>;
|
|
9
|
-
test_b_items: import("@instantdb/core").EntityDef<{
|
|
10
|
-
title: import("@instantdb/core").DataAttrDef<string, true, false>;
|
|
11
|
-
status: import("@instantdb/core").DataAttrDef<string, true, false>;
|
|
12
|
-
createdAt: import("@instantdb/core").DataAttrDef<Date, true, false>;
|
|
13
|
-
}, {}, void>;
|
|
14
|
-
combined_items: import("@instantdb/core").EntityDef<{
|
|
15
|
-
description: import("@instantdb/core").DataAttrDef<string, true, false>;
|
|
16
|
-
priority: import("@instantdb/core").DataAttrDef<number, false, false>;
|
|
17
|
-
createdAt: import("@instantdb/core").DataAttrDef<Date, true, false>;
|
|
18
|
-
}, {}, void>;
|
|
19
|
-
}, {
|
|
20
|
-
testAItemsOwner: {
|
|
21
|
-
readonly forward: {
|
|
22
|
-
readonly on: "test_a_items";
|
|
23
|
-
readonly has: "one";
|
|
24
|
-
readonly label: "owner";
|
|
25
|
-
};
|
|
26
|
-
readonly reverse: {
|
|
27
|
-
readonly on: "$users";
|
|
28
|
-
readonly has: "many";
|
|
29
|
-
readonly label: "owned_test_a_items";
|
|
30
|
-
};
|
|
31
|
-
};
|
|
32
|
-
testBItemsCreator: {
|
|
33
|
-
readonly forward: {
|
|
34
|
-
readonly on: "test_b_items";
|
|
35
|
-
readonly has: "one";
|
|
36
|
-
readonly label: "creator";
|
|
37
|
-
};
|
|
38
|
-
readonly reverse: {
|
|
39
|
-
readonly on: "$users";
|
|
40
|
-
readonly has: "many";
|
|
41
|
-
readonly label: "created_test_b_items";
|
|
42
|
-
};
|
|
43
|
-
};
|
|
44
|
-
testBItemsRelated: {
|
|
45
|
-
readonly forward: {
|
|
46
|
-
readonly on: "test_b_items";
|
|
47
|
-
readonly has: "one";
|
|
48
|
-
readonly label: "related";
|
|
49
|
-
};
|
|
50
|
-
readonly reverse: {
|
|
51
|
-
readonly on: "test_a_items";
|
|
52
|
-
readonly has: "many";
|
|
53
|
-
readonly label: "test_b_items";
|
|
54
|
-
};
|
|
55
|
-
};
|
|
56
|
-
combinedItemsParent: {
|
|
57
|
-
readonly forward: {
|
|
58
|
-
readonly on: "combined_items";
|
|
59
|
-
readonly has: "one";
|
|
60
|
-
readonly label: "parent";
|
|
61
|
-
};
|
|
62
|
-
readonly reverse: {
|
|
63
|
-
readonly on: "test_b_items";
|
|
64
|
-
readonly has: "many";
|
|
65
|
-
readonly label: "combined_items";
|
|
66
|
-
};
|
|
67
|
-
};
|
|
68
|
-
combinedItemsOwner: {
|
|
69
|
-
readonly forward: {
|
|
70
|
-
readonly on: "combined_items";
|
|
71
|
-
readonly has: "one";
|
|
72
|
-
readonly label: "owner";
|
|
73
|
-
};
|
|
74
|
-
readonly reverse: {
|
|
75
|
-
readonly on: "$users";
|
|
76
|
-
readonly has: "many";
|
|
77
|
-
readonly label: "owned_combined_items";
|
|
78
|
-
};
|
|
79
|
-
};
|
|
80
|
-
combinedItemsFiles: {
|
|
81
|
-
readonly forward: {
|
|
82
|
-
readonly on: "combined_items";
|
|
83
|
-
readonly has: "many";
|
|
84
|
-
readonly label: "files";
|
|
85
|
-
};
|
|
86
|
-
readonly reverse: {
|
|
87
|
-
readonly on: "$files";
|
|
88
|
-
readonly has: "one";
|
|
89
|
-
readonly label: "combined_item";
|
|
90
|
-
};
|
|
91
|
-
};
|
|
92
|
-
}>, import("@instantdb/core").LinksDef<any>, import("@instantdb/core").RoomsDef>;
|
|
93
|
-
export type TestSchema = typeof schema;
|
|
94
|
-
export default schema;
|
|
1
|
+
declare const schema: import("@instantdb/core").InstantSchemaDef<import("@instantdb/core").EntitiesWithLinks<{
|
|
2
|
+
$users: import("@instantdb/core").EntityDef<any, any, any>;
|
|
3
|
+
$files: import("@instantdb/core").EntityDef<any, any, any>;
|
|
4
|
+
test_a_items: import("@instantdb/core").EntityDef<{
|
|
5
|
+
name: import("@instantdb/core").DataAttrDef<string, true, false>;
|
|
6
|
+
value: import("@instantdb/core").DataAttrDef<number, true, false>;
|
|
7
|
+
createdAt: import("@instantdb/core").DataAttrDef<Date, true, false>;
|
|
8
|
+
}, {}, void>;
|
|
9
|
+
test_b_items: import("@instantdb/core").EntityDef<{
|
|
10
|
+
title: import("@instantdb/core").DataAttrDef<string, true, false>;
|
|
11
|
+
status: import("@instantdb/core").DataAttrDef<string, true, false>;
|
|
12
|
+
createdAt: import("@instantdb/core").DataAttrDef<Date, true, false>;
|
|
13
|
+
}, {}, void>;
|
|
14
|
+
combined_items: import("@instantdb/core").EntityDef<{
|
|
15
|
+
description: import("@instantdb/core").DataAttrDef<string, true, false>;
|
|
16
|
+
priority: import("@instantdb/core").DataAttrDef<number, false, false>;
|
|
17
|
+
createdAt: import("@instantdb/core").DataAttrDef<Date, true, false>;
|
|
18
|
+
}, {}, void>;
|
|
19
|
+
}, {
|
|
20
|
+
testAItemsOwner: {
|
|
21
|
+
readonly forward: {
|
|
22
|
+
readonly on: "test_a_items";
|
|
23
|
+
readonly has: "one";
|
|
24
|
+
readonly label: "owner";
|
|
25
|
+
};
|
|
26
|
+
readonly reverse: {
|
|
27
|
+
readonly on: "$users";
|
|
28
|
+
readonly has: "many";
|
|
29
|
+
readonly label: "owned_test_a_items";
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
testBItemsCreator: {
|
|
33
|
+
readonly forward: {
|
|
34
|
+
readonly on: "test_b_items";
|
|
35
|
+
readonly has: "one";
|
|
36
|
+
readonly label: "creator";
|
|
37
|
+
};
|
|
38
|
+
readonly reverse: {
|
|
39
|
+
readonly on: "$users";
|
|
40
|
+
readonly has: "many";
|
|
41
|
+
readonly label: "created_test_b_items";
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
testBItemsRelated: {
|
|
45
|
+
readonly forward: {
|
|
46
|
+
readonly on: "test_b_items";
|
|
47
|
+
readonly has: "one";
|
|
48
|
+
readonly label: "related";
|
|
49
|
+
};
|
|
50
|
+
readonly reverse: {
|
|
51
|
+
readonly on: "test_a_items";
|
|
52
|
+
readonly has: "many";
|
|
53
|
+
readonly label: "test_b_items";
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
combinedItemsParent: {
|
|
57
|
+
readonly forward: {
|
|
58
|
+
readonly on: "combined_items";
|
|
59
|
+
readonly has: "one";
|
|
60
|
+
readonly label: "parent";
|
|
61
|
+
};
|
|
62
|
+
readonly reverse: {
|
|
63
|
+
readonly on: "test_b_items";
|
|
64
|
+
readonly has: "many";
|
|
65
|
+
readonly label: "combined_items";
|
|
66
|
+
};
|
|
67
|
+
};
|
|
68
|
+
combinedItemsOwner: {
|
|
69
|
+
readonly forward: {
|
|
70
|
+
readonly on: "combined_items";
|
|
71
|
+
readonly has: "one";
|
|
72
|
+
readonly label: "owner";
|
|
73
|
+
};
|
|
74
|
+
readonly reverse: {
|
|
75
|
+
readonly on: "$users";
|
|
76
|
+
readonly has: "many";
|
|
77
|
+
readonly label: "owned_combined_items";
|
|
78
|
+
};
|
|
79
|
+
};
|
|
80
|
+
combinedItemsFiles: {
|
|
81
|
+
readonly forward: {
|
|
82
|
+
readonly on: "combined_items";
|
|
83
|
+
readonly has: "many";
|
|
84
|
+
readonly label: "files";
|
|
85
|
+
};
|
|
86
|
+
readonly reverse: {
|
|
87
|
+
readonly on: "$files";
|
|
88
|
+
readonly has: "one";
|
|
89
|
+
readonly label: "combined_item";
|
|
90
|
+
};
|
|
91
|
+
};
|
|
92
|
+
}>, import("@instantdb/core").LinksDef<any>, import("@instantdb/core").RoomsDef>;
|
|
93
|
+
export type TestSchema = typeof schema;
|
|
94
|
+
export default schema;
|
|
95
95
|
//# sourceMappingURL=test.schema.d.ts.map
|
|
@@ -1,86 +1,86 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
// Schema file for testing with instant-cli push
|
|
4
|
-
// This schema demonstrates all domain builder features:
|
|
5
|
-
// - Multiple domains with includes
|
|
6
|
-
// - Cross-domain links
|
|
7
|
-
// - Links to base entities ($users, $files)
|
|
8
|
-
// - Complex entity relationships
|
|
9
|
-
const index_1 = require("../index");
|
|
10
|
-
const core_1 = require("@instantdb/core");
|
|
11
|
-
// Domain A: Core entities
|
|
12
|
-
const testDomainA = (0, index_1.domain)("testA").schema({
|
|
13
|
-
entities: {
|
|
14
|
-
test_a_items: core_1.i.entity({
|
|
15
|
-
name: core_1.i.string(),
|
|
16
|
-
value: core_1.i.number(),
|
|
17
|
-
createdAt: core_1.i.date(),
|
|
18
|
-
}),
|
|
19
|
-
},
|
|
20
|
-
links: {
|
|
21
|
-
testAItemsOwner: {
|
|
22
|
-
forward: { on: "test_a_items", has: "one", label: "owner" },
|
|
23
|
-
reverse: { on: "$users", has: "many", label: "owned_test_a_items" },
|
|
24
|
-
},
|
|
25
|
-
},
|
|
26
|
-
rooms: {},
|
|
27
|
-
});
|
|
28
|
-
// Domain B: Includes Domain A and adds its own entities with cross-domain links
|
|
29
|
-
const testDomainB = (0, index_1.domain)("testB")
|
|
30
|
-
.includes(testDomainA)
|
|
31
|
-
.schema({
|
|
32
|
-
entities: {
|
|
33
|
-
test_b_items: core_1.i.entity({
|
|
34
|
-
title: core_1.i.string(),
|
|
35
|
-
status: core_1.i.string(),
|
|
36
|
-
createdAt: core_1.i.date(),
|
|
37
|
-
}),
|
|
38
|
-
},
|
|
39
|
-
links: {
|
|
40
|
-
testBItemsCreator: {
|
|
41
|
-
forward: { on: "test_b_items", has: "one", label: "creator" },
|
|
42
|
-
reverse: { on: "$users", has: "many", label: "created_test_b_items" },
|
|
43
|
-
},
|
|
44
|
-
// Cross-domain link: references test_a_items from included domain
|
|
45
|
-
testBItemsRelated: {
|
|
46
|
-
forward: { on: "test_b_items", has: "one", label: "related" },
|
|
47
|
-
reverse: { on: "test_a_items", has: "many", label: "test_b_items" },
|
|
48
|
-
},
|
|
49
|
-
},
|
|
50
|
-
rooms: {},
|
|
51
|
-
});
|
|
52
|
-
// Combined schema: Includes both domains and adds final entities
|
|
53
|
-
// This demonstrates the full power of domain composition
|
|
54
|
-
const combinedTestSchema = (0, index_1.domain)("combined")
|
|
55
|
-
.includes(testDomainA)
|
|
56
|
-
.includes(testDomainB)
|
|
57
|
-
.schema({
|
|
58
|
-
entities: {
|
|
59
|
-
combined_items: core_1.i.entity({
|
|
60
|
-
description: core_1.i.string(),
|
|
61
|
-
priority: core_1.i.number().optional(),
|
|
62
|
-
createdAt: core_1.i.date(),
|
|
63
|
-
}),
|
|
64
|
-
},
|
|
65
|
-
links: {
|
|
66
|
-
// Link to entities from included domains
|
|
67
|
-
combinedItemsParent: {
|
|
68
|
-
forward: { on: "combined_items", has: "one", label: "parent" },
|
|
69
|
-
reverse: { on: "test_b_items", has: "many", label: "combined_items" },
|
|
70
|
-
},
|
|
71
|
-
// Link to base entities
|
|
72
|
-
combinedItemsOwner: {
|
|
73
|
-
forward: { on: "combined_items", has: "one", label: "owner" },
|
|
74
|
-
reverse: { on: "$users", has: "many", label: "owned_combined_items" },
|
|
75
|
-
},
|
|
76
|
-
// Link to files (base entity)
|
|
77
|
-
combinedItemsFiles: {
|
|
78
|
-
forward: { on: "combined_items", has: "many", label: "files" },
|
|
79
|
-
reverse: { on: "$files", has: "one", label: "combined_item" },
|
|
80
|
-
},
|
|
81
|
-
},
|
|
82
|
-
rooms: {},
|
|
83
|
-
});
|
|
84
|
-
const schema = combinedTestSchema.toInstantSchema();
|
|
85
|
-
exports.default = schema;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
// Schema file for testing with instant-cli push
|
|
4
|
+
// This schema demonstrates all domain builder features:
|
|
5
|
+
// - Multiple domains with includes
|
|
6
|
+
// - Cross-domain links
|
|
7
|
+
// - Links to base entities ($users, $files)
|
|
8
|
+
// - Complex entity relationships
|
|
9
|
+
const index_1 = require("../index");
|
|
10
|
+
const core_1 = require("@instantdb/core");
|
|
11
|
+
// Domain A: Core entities
|
|
12
|
+
const testDomainA = (0, index_1.domain)("testA").schema({
|
|
13
|
+
entities: {
|
|
14
|
+
test_a_items: core_1.i.entity({
|
|
15
|
+
name: core_1.i.string(),
|
|
16
|
+
value: core_1.i.number(),
|
|
17
|
+
createdAt: core_1.i.date(),
|
|
18
|
+
}),
|
|
19
|
+
},
|
|
20
|
+
links: {
|
|
21
|
+
testAItemsOwner: {
|
|
22
|
+
forward: { on: "test_a_items", has: "one", label: "owner" },
|
|
23
|
+
reverse: { on: "$users", has: "many", label: "owned_test_a_items" },
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
rooms: {},
|
|
27
|
+
});
|
|
28
|
+
// Domain B: Includes Domain A and adds its own entities with cross-domain links
|
|
29
|
+
const testDomainB = (0, index_1.domain)("testB")
|
|
30
|
+
.includes(testDomainA)
|
|
31
|
+
.schema({
|
|
32
|
+
entities: {
|
|
33
|
+
test_b_items: core_1.i.entity({
|
|
34
|
+
title: core_1.i.string(),
|
|
35
|
+
status: core_1.i.string(),
|
|
36
|
+
createdAt: core_1.i.date(),
|
|
37
|
+
}),
|
|
38
|
+
},
|
|
39
|
+
links: {
|
|
40
|
+
testBItemsCreator: {
|
|
41
|
+
forward: { on: "test_b_items", has: "one", label: "creator" },
|
|
42
|
+
reverse: { on: "$users", has: "many", label: "created_test_b_items" },
|
|
43
|
+
},
|
|
44
|
+
// Cross-domain link: references test_a_items from included domain
|
|
45
|
+
testBItemsRelated: {
|
|
46
|
+
forward: { on: "test_b_items", has: "one", label: "related" },
|
|
47
|
+
reverse: { on: "test_a_items", has: "many", label: "test_b_items" },
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
rooms: {},
|
|
51
|
+
});
|
|
52
|
+
// Combined schema: Includes both domains and adds final entities
|
|
53
|
+
// This demonstrates the full power of domain composition
|
|
54
|
+
const combinedTestSchema = (0, index_1.domain)("combined")
|
|
55
|
+
.includes(testDomainA)
|
|
56
|
+
.includes(testDomainB)
|
|
57
|
+
.schema({
|
|
58
|
+
entities: {
|
|
59
|
+
combined_items: core_1.i.entity({
|
|
60
|
+
description: core_1.i.string(),
|
|
61
|
+
priority: core_1.i.number().optional(),
|
|
62
|
+
createdAt: core_1.i.date(),
|
|
63
|
+
}),
|
|
64
|
+
},
|
|
65
|
+
links: {
|
|
66
|
+
// Link to entities from included domains
|
|
67
|
+
combinedItemsParent: {
|
|
68
|
+
forward: { on: "combined_items", has: "one", label: "parent" },
|
|
69
|
+
reverse: { on: "test_b_items", has: "many", label: "combined_items" },
|
|
70
|
+
},
|
|
71
|
+
// Link to base entities
|
|
72
|
+
combinedItemsOwner: {
|
|
73
|
+
forward: { on: "combined_items", has: "one", label: "owner" },
|
|
74
|
+
reverse: { on: "$users", has: "many", label: "owned_combined_items" },
|
|
75
|
+
},
|
|
76
|
+
// Link to files (base entity)
|
|
77
|
+
combinedItemsFiles: {
|
|
78
|
+
forward: { on: "combined_items", has: "many", label: "files" },
|
|
79
|
+
reverse: { on: "$files", has: "one", label: "combined_item" },
|
|
80
|
+
},
|
|
81
|
+
},
|
|
82
|
+
rooms: {},
|
|
83
|
+
});
|
|
84
|
+
const schema = combinedTestSchema.toInstantSchema();
|
|
85
|
+
exports.default = schema;
|
|
86
86
|
//# sourceMappingURL=test.schema.js.map
|