jazz-tools 0.7.0-alpha.3 → 0.7.0-alpha.30
Sign up to get free protection for your applications and to get access to all the features.
- package/.turbo/turbo-build.log +80 -8
- package/CHANGELOG.md +175 -0
- package/dist/coValues/account.js +78 -38
- package/dist/coValues/account.js.map +1 -1
- package/dist/coValues/coList.js +150 -99
- package/dist/coValues/coList.js.map +1 -1
- package/dist/coValues/coMap.js +178 -162
- package/dist/coValues/coMap.js.map +1 -1
- package/dist/coValues/coStream.js +195 -70
- package/dist/coValues/coStream.js.map +1 -1
- package/dist/coValues/extensions/imageDef.js +13 -8
- package/dist/coValues/extensions/imageDef.js.map +1 -1
- package/dist/coValues/group.js +40 -36
- package/dist/coValues/group.js.map +1 -1
- package/dist/coValues/interfaces.js +22 -4
- package/dist/coValues/interfaces.js.map +1 -1
- package/dist/implementation/refs.js +26 -12
- package/dist/implementation/refs.js.map +1 -1
- package/dist/implementation/schema.js +38 -1
- package/dist/implementation/schema.js.map +1 -1
- package/dist/implementation/symbols.js +5 -0
- package/dist/implementation/symbols.js.map +1 -0
- package/dist/index.js +4 -3
- package/dist/index.js.map +1 -1
- package/dist/internal.js +1 -0
- package/dist/internal.js.map +1 -1
- package/dist/tests/coList.test.js +20 -24
- package/dist/tests/coList.test.js.map +1 -1
- package/dist/tests/coMap.test.js +154 -43
- package/dist/tests/coMap.test.js.map +1 -1
- package/dist/tests/coStream.test.js +50 -55
- package/dist/tests/coStream.test.js.map +1 -1
- package/dist/tests/groupsAndAccounts.test.js +86 -0
- package/dist/tests/groupsAndAccounts.test.js.map +1 -0
- package/package.json +5 -4
- package/src/coValues/account.ts +116 -75
- package/src/coValues/coList.ts +189 -125
- package/src/coValues/coMap.ts +238 -295
- package/src/coValues/coStream.ts +282 -124
- package/src/coValues/extensions/imageDef.ts +13 -15
- package/src/coValues/group.ts +85 -85
- package/src/coValues/interfaces.ts +32 -11
- package/src/implementation/refs.ts +42 -25
- package/src/implementation/schema.ts +68 -46
- package/src/implementation/symbols.ts +12 -0
- package/src/index.ts +10 -8
- package/src/internal.ts +1 -0
- package/src/tests/coList.test.ts +20 -24
- package/src/tests/coMap.test.ts +153 -58
- package/src/tests/coStream.test.ts +65 -70
- package/src/tests/groupsAndAccounts.test.ts +96 -0
package/.turbo/turbo-build.log
CHANGED
@@ -1,24 +1,96 @@
|
|
1
1
|
|
2
|
-
> jazz-
|
2
|
+
> jazz-tools@0.7.0-alpha.29 build /Users/anselm/jazz/jazz/packages/jazz-tools
|
3
3
|
> npm run lint && rm -rf ./dist && tsc --sourceMap --outDir dist
|
4
4
|
|
5
5
|
|
6
|
-
> jazz-
|
6
|
+
> jazz-tools@0.7.0-alpha.29 lint
|
7
7
|
> eslint src/**/*.ts
|
8
8
|
|
9
9
|
|
10
|
-
/Users/anselm/jazz/jazz/packages/jazz-
|
10
|
+
/Users/anselm/jazz/jazz/packages/jazz-tools/src/coValues/account.ts
|
11
|
+
49:21 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
|
12
|
+
60:14 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
|
13
|
+
98:22 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
|
14
|
+
107:22 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
|
15
|
+
181:11 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
|
16
|
+
240:24 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
|
17
|
+
267:67 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
|
18
|
+
270:67 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
|
19
|
+
322:12 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
|
20
|
+
328:29 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
|
21
|
+
328:39 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
|
22
|
+
|
23
|
+
/Users/anselm/jazz/jazz/packages/jazz-tools/src/coValues/coList.ts
|
24
|
+
30:28 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
|
25
|
+
54:21 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
|
26
|
+
86:14 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
|
27
|
+
104:20 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
|
28
|
+
229:71 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
|
29
|
+
234:75 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
|
30
|
+
267:31 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
|
31
|
+
|
32
|
+
/Users/anselm/jazz/jazz/packages/jazz-tools/src/coValues/coMap.ts
|
33
|
+
27:20 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
|
34
|
+
28:18 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
|
35
|
+
54:21 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
|
36
|
+
80:14 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
|
37
|
+
131:20 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
|
38
|
+
173:44 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
|
39
|
+
191:56 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
|
40
|
+
217:38 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
|
41
|
+
255:42 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
|
42
|
+
|
43
|
+
/Users/anselm/jazz/jazz/packages/jazz-tools/src/coValues/coStream.ts
|
44
|
+
46:30 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
|
45
|
+
67:21 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
|
46
|
+
86:20 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
|
47
|
+
166:31 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
|
48
|
+
289:73 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
|
49
|
+
389:73 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
|
50
|
+
|
51
|
+
/Users/anselm/jazz/jazz/packages/jazz-tools/src/coValues/group.ts
|
52
|
+
55:21 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
|
53
|
+
64:14 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
|
54
|
+
93:22 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
|
55
|
+
100:22 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
|
56
|
+
105:23 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
|
57
|
+
|
58
|
+
/Users/anselm/jazz/jazz/packages/jazz-tools/src/coValues/interfaces.ts
|
59
|
+
16:19 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
|
60
|
+
19:71 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
|
61
|
+
58:62 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
|
62
|
+
74:15 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
|
63
|
+
76:18 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
|
64
|
+
79:34 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
|
65
|
+
82:39 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
|
66
|
+
115:27 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
|
67
|
+
217:24 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
|
68
|
+
|
69
|
+
/Users/anselm/jazz/jazz/packages/jazz-tools/src/implementation/schema.ts
|
70
|
+
27:61 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
|
71
|
+
30:61 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
|
72
|
+
33:71 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
|
73
|
+
38:58 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
|
74
|
+
65:68 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
|
75
|
+
74:5 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
|
76
|
+
75:5 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
|
77
|
+
79:17 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
|
78
|
+
80:17 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
|
79
|
+
|
80
|
+
/Users/anselm/jazz/jazz/packages/jazz-tools/src/implementation/subscriptionScope.ts
|
81
|
+
6:23 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
|
82
|
+
|
83
|
+
/Users/anselm/jazz/jazz/packages/jazz-tools/src/tests/coList.test.ts
|
11
84
|
0:0 warning File ignored because of a matching ignore pattern. Use "--no-ignore" to override
|
12
85
|
|
13
|
-
/Users/anselm/jazz/jazz/packages/jazz-
|
86
|
+
/Users/anselm/jazz/jazz/packages/jazz-tools/src/tests/coMap.test.ts
|
14
87
|
0:0 warning File ignored because of a matching ignore pattern. Use "--no-ignore" to override
|
15
88
|
|
16
|
-
/Users/anselm/jazz/jazz/packages/jazz-
|
89
|
+
/Users/anselm/jazz/jazz/packages/jazz-tools/src/tests/coStream.test.ts
|
17
90
|
0:0 warning File ignored because of a matching ignore pattern. Use "--no-ignore" to override
|
18
91
|
|
19
|
-
/Users/anselm/jazz/jazz/packages/jazz-
|
92
|
+
/Users/anselm/jazz/jazz/packages/jazz-tools/src/tests/groupsAndAccounts.test.ts
|
20
93
|
0:0 warning File ignored because of a matching ignore pattern. Use "--no-ignore" to override
|
21
94
|
|
22
|
-
✖
|
95
|
+
✖ 61 problems (0 errors, 61 warnings)
|
23
96
|
|
24
|
-
ELIFECYCLE Command failed.
|
package/CHANGELOG.md
CHANGED
@@ -1,5 +1,180 @@
|
|
1
1
|
# jazz-autosub
|
2
2
|
|
3
|
+
## 0.7.0-alpha.30
|
4
|
+
|
5
|
+
### Patch Changes
|
6
|
+
|
7
|
+
- CoValue casting & auto-subbing \_owner
|
8
|
+
|
9
|
+
## 0.7.0-alpha.29
|
10
|
+
|
11
|
+
### Patch Changes
|
12
|
+
|
13
|
+
- Reintroduce changes from main
|
14
|
+
- Updated dependencies
|
15
|
+
- cojson@0.7.0-alpha.29
|
16
|
+
|
17
|
+
## 0.7.0-alpha.28
|
18
|
+
|
19
|
+
### Patch Changes
|
20
|
+
|
21
|
+
- Implement profile visibility based on groups & new migration signature
|
22
|
+
- Updated dependencies
|
23
|
+
- cojson@0.7.0-alpha.28
|
24
|
+
|
25
|
+
## 0.7.0-alpha.27
|
26
|
+
|
27
|
+
### Patch Changes
|
28
|
+
|
29
|
+
- Fix CoList.splice / RawCoList.append
|
30
|
+
- Fix Costream[...].all
|
31
|
+
- Updated dependencies
|
32
|
+
- cojson@0.7.0-alpha.27
|
33
|
+
|
34
|
+
## 0.7.0-alpha.26
|
35
|
+
|
36
|
+
### Patch Changes
|
37
|
+
|
38
|
+
- Fix CoMap.Record.toJSON()
|
39
|
+
|
40
|
+
## 0.7.0-alpha.25
|
41
|
+
|
42
|
+
### Patch Changes
|
43
|
+
|
44
|
+
- Make Account -> Profile a lazy ref schema
|
45
|
+
|
46
|
+
## 0.7.0-alpha.24
|
47
|
+
|
48
|
+
### Patch Changes
|
49
|
+
|
50
|
+
- Relax types of CoMap.\_schema
|
51
|
+
- Fix schema of Account & Group
|
52
|
+
- Make sure delete on CoMaps deletes keys
|
53
|
+
- Updated dependencies
|
54
|
+
- cojson@0.7.0-alpha.24
|
55
|
+
|
56
|
+
## 0.7.0-alpha.23
|
57
|
+
|
58
|
+
### Patch Changes
|
59
|
+
|
60
|
+
- CoMap fixes and improvements
|
61
|
+
|
62
|
+
## 0.7.0-alpha.22
|
63
|
+
|
64
|
+
### Patch Changes
|
65
|
+
|
66
|
+
- Fix CoMap \_refs for co.items
|
67
|
+
|
68
|
+
## 0.7.0-alpha.21
|
69
|
+
|
70
|
+
### Patch Changes
|
71
|
+
|
72
|
+
- Add maxWidth option for loading images
|
73
|
+
|
74
|
+
## 0.7.0-alpha.20
|
75
|
+
|
76
|
+
### Patch Changes
|
77
|
+
|
78
|
+
- Make fast-check a direct dependency to help dev time resolution
|
79
|
+
|
80
|
+
## 0.7.0-alpha.19
|
81
|
+
|
82
|
+
### Patch Changes
|
83
|
+
|
84
|
+
- More precise imports from @effect/schema
|
85
|
+
|
86
|
+
## 0.7.0-alpha.17
|
87
|
+
|
88
|
+
### Patch Changes
|
89
|
+
|
90
|
+
- Use effect 3.0
|
91
|
+
|
92
|
+
## 0.7.0-alpha.16
|
93
|
+
|
94
|
+
### Patch Changes
|
95
|
+
|
96
|
+
- Make CoMaps even more subclassable
|
97
|
+
|
98
|
+
## 0.7.0-alpha.15
|
99
|
+
|
100
|
+
### Patch Changes
|
101
|
+
|
102
|
+
- More superclass-compatible CoMaps
|
103
|
+
|
104
|
+
## 0.7.0-alpha.14
|
105
|
+
|
106
|
+
### Patch Changes
|
107
|
+
|
108
|
+
- Fix CoStream types
|
109
|
+
|
110
|
+
## 0.7.0-alpha.13
|
111
|
+
|
112
|
+
### Patch Changes
|
113
|
+
|
114
|
+
- Add .all to CoStreamEntry
|
115
|
+
|
116
|
+
## 0.7.0-alpha.12
|
117
|
+
|
118
|
+
### Patch Changes
|
119
|
+
|
120
|
+
- Fix variance of ID.\_\_type
|
121
|
+
|
122
|
+
## 0.7.0-alpha.11
|
123
|
+
|
124
|
+
### Patch Changes
|
125
|
+
|
126
|
+
- Support stricter TS lint rules
|
127
|
+
- Updated dependencies
|
128
|
+
- cojson@0.7.0-alpha.11
|
129
|
+
|
130
|
+
## 0.7.0-alpha.10
|
131
|
+
|
132
|
+
### Patch Changes
|
133
|
+
|
134
|
+
- Clean up API more & re-add jazz-nodejs
|
135
|
+
- Updated dependencies
|
136
|
+
- cojson@0.7.0-alpha.10
|
137
|
+
|
138
|
+
## 0.7.0-alpha.9
|
139
|
+
|
140
|
+
### Patch Changes
|
141
|
+
|
142
|
+
- Even friendlier for subclassing CoMap
|
143
|
+
|
144
|
+
## 0.7.0-alpha.8
|
145
|
+
|
146
|
+
### Patch Changes
|
147
|
+
|
148
|
+
- More subclass-friendly types in CoMap
|
149
|
+
|
150
|
+
## 0.7.0-alpha.7
|
151
|
+
|
152
|
+
### Patch Changes
|
153
|
+
|
154
|
+
- Consistent proxy based API
|
155
|
+
- Updated dependencies
|
156
|
+
- cojson@0.7.0-alpha.7
|
157
|
+
|
158
|
+
## 0.7.0-alpha.6
|
159
|
+
|
160
|
+
### Patch Changes
|
161
|
+
|
162
|
+
- CoMap fix
|
163
|
+
|
164
|
+
## 0.7.0-alpha.5
|
165
|
+
|
166
|
+
### Patch Changes
|
167
|
+
|
168
|
+
- Refactoring
|
169
|
+
- Updated dependencies
|
170
|
+
- cojson@0.7.0-alpha.5
|
171
|
+
|
172
|
+
## 0.7.0-alpha.4
|
173
|
+
|
174
|
+
### Patch Changes
|
175
|
+
|
176
|
+
- Make refs on list more precise
|
177
|
+
|
3
178
|
## 0.7.0-alpha.3
|
4
179
|
|
5
180
|
### Patch Changes
|
package/dist/coValues/account.js
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
var _a;
|
2
2
|
import { LocalNode } from "cojson";
|
3
3
|
import { Context } from "effect";
|
4
|
-
import { CoValueBase, Profile,
|
4
|
+
import { Group, CoValueBase, MembersSym, Profile, Ref, SchemaInit, inspect, subscriptionsScopes, } from "../internal.js";
|
5
5
|
export class Account extends CoValueBase {
|
6
|
-
get
|
7
|
-
return this.constructor.
|
6
|
+
get _schema() {
|
7
|
+
return this.constructor._schema;
|
8
8
|
}
|
9
9
|
get _owner() {
|
10
10
|
return this;
|
@@ -18,12 +18,13 @@ export class Account extends CoValueBase {
|
|
18
18
|
const profileID = this._raw.get("profile");
|
19
19
|
const rootID = this._raw.get("root");
|
20
20
|
return {
|
21
|
-
profile: profileID &&
|
21
|
+
profile: profileID &&
|
22
|
+
new Ref(profileID, this._loadedAs, this._schema.profile),
|
22
23
|
root: rootID &&
|
23
|
-
new
|
24
|
+
new Ref(rootID, this._loadedAs, this._schema.root),
|
24
25
|
};
|
25
26
|
}
|
26
|
-
constructor(
|
27
|
+
constructor(_init, options) {
|
27
28
|
super();
|
28
29
|
this.acceptInvite = (async (valueID, inviteSecret, coValueClass) => {
|
29
30
|
if (!this.isMe) {
|
@@ -44,33 +45,12 @@ export class Account extends CoValueBase {
|
|
44
45
|
enumerable: false,
|
45
46
|
},
|
46
47
|
_raw: { value: options.fromRaw, enumerable: false },
|
47
|
-
profile: {
|
48
|
-
get: () => {
|
49
|
-
const ref = this._refs.profile;
|
50
|
-
return ref ? ref.accessFrom(this) : undefined;
|
51
|
-
},
|
52
|
-
set: (value) => {
|
53
|
-
if (value) {
|
54
|
-
this._raw.set("profile", value.id);
|
55
|
-
}
|
56
|
-
},
|
57
|
-
},
|
58
|
-
root: {
|
59
|
-
get: () => {
|
60
|
-
const ref = this._refs.root;
|
61
|
-
return ref ? ref.accessFrom(this) : undefined;
|
62
|
-
},
|
63
|
-
set: (value) => {
|
64
|
-
if (value) {
|
65
|
-
this._raw.set("root", value.id);
|
66
|
-
}
|
67
|
-
},
|
68
|
-
},
|
69
48
|
});
|
70
49
|
if (this.isMe) {
|
71
50
|
this.sessionID =
|
72
51
|
options.fromRaw.core.node.currentSessionID;
|
73
52
|
}
|
53
|
+
return new Proxy(this, AccountAndGroupProxyHandler);
|
74
54
|
}
|
75
55
|
myRole() {
|
76
56
|
if (this.isMe) {
|
@@ -80,11 +60,11 @@ export class Account extends CoValueBase {
|
|
80
60
|
static async create(options) {
|
81
61
|
const { node } = await LocalNode.withNewlyCreatedAccount({
|
82
62
|
...options,
|
83
|
-
migration: async (rawAccount) => {
|
63
|
+
migration: async (rawAccount, _node, creationProps) => {
|
84
64
|
const account = new this(undefined, {
|
85
65
|
fromRaw: rawAccount,
|
86
66
|
});
|
87
|
-
await account.migrate?.();
|
67
|
+
await account.migrate?.(creationProps);
|
88
68
|
},
|
89
69
|
});
|
90
70
|
return this.fromNode(node);
|
@@ -95,11 +75,11 @@ export class Account extends CoValueBase {
|
|
95
75
|
accountSecret: options.accountSecret,
|
96
76
|
sessionID: options.sessionID,
|
97
77
|
peersToLoadFrom: options.peersToLoadFrom,
|
98
|
-
migration: async (rawAccount) => {
|
78
|
+
migration: async (rawAccount, _node, creationProps) => {
|
99
79
|
const account = new this(undefined, {
|
100
80
|
fromRaw: rawAccount,
|
101
81
|
});
|
102
|
-
await account.migrate?.();
|
82
|
+
await account.migrate?.(creationProps);
|
103
83
|
},
|
104
84
|
});
|
105
85
|
return this.fromNode(node);
|
@@ -118,18 +98,78 @@ export class Account extends CoValueBase {
|
|
118
98
|
[inspect]() {
|
119
99
|
return this.toJSON();
|
120
100
|
}
|
121
|
-
|
122
|
-
|
123
|
-
|
101
|
+
migrate(creationProps) {
|
102
|
+
if (creationProps) {
|
103
|
+
const profileGroup = new Group({ owner: this });
|
104
|
+
profileGroup.addMember("everyone", "reader");
|
105
|
+
this.profile = new Profile({ name: creationProps.name }, { owner: profileGroup });
|
106
|
+
}
|
124
107
|
}
|
125
108
|
}
|
126
109
|
_a = Account;
|
127
110
|
(() => {
|
128
|
-
_a.
|
129
|
-
profile:
|
130
|
-
root:
|
111
|
+
_a._schema = {
|
112
|
+
profile: () => Profile,
|
113
|
+
root: "json",
|
131
114
|
};
|
132
115
|
})();
|
116
|
+
export const AccountAndGroupProxyHandler = {
|
117
|
+
get(target, key, receiver) {
|
118
|
+
if (key === "profile") {
|
119
|
+
const ref = target._refs.profile;
|
120
|
+
return ref ? ref.accessFrom(receiver) : undefined;
|
121
|
+
}
|
122
|
+
else if (key === "root") {
|
123
|
+
const ref = target._refs.root;
|
124
|
+
return ref ? ref.accessFrom(receiver) : undefined;
|
125
|
+
}
|
126
|
+
else {
|
127
|
+
return Reflect.get(target, key, receiver);
|
128
|
+
}
|
129
|
+
},
|
130
|
+
set(target, key, value, receiver) {
|
131
|
+
var _b;
|
132
|
+
if ((key === "profile" || key === "root" || key === MembersSym) &&
|
133
|
+
typeof value === "object" &&
|
134
|
+
SchemaInit in value) {
|
135
|
+
(_b = target.constructor)._schema || (_b._schema = {});
|
136
|
+
target.constructor._schema[key] =
|
137
|
+
value[SchemaInit];
|
138
|
+
return true;
|
139
|
+
}
|
140
|
+
else if (key === "profile") {
|
141
|
+
if (value) {
|
142
|
+
target._raw.set("profile", value.id, "trusting");
|
143
|
+
}
|
144
|
+
subscriptionsScopes.get(receiver)?.onRefAccessedOrSet(value.id);
|
145
|
+
return true;
|
146
|
+
}
|
147
|
+
else if (key === "root") {
|
148
|
+
if (value) {
|
149
|
+
target._raw.set("root", value.id);
|
150
|
+
}
|
151
|
+
subscriptionsScopes.get(receiver)?.onRefAccessedOrSet(value.id);
|
152
|
+
return true;
|
153
|
+
}
|
154
|
+
else {
|
155
|
+
return Reflect.set(target, key, value, receiver);
|
156
|
+
}
|
157
|
+
},
|
158
|
+
defineProperty(target, key, descriptor) {
|
159
|
+
var _b;
|
160
|
+
if ((key === "profile" || key === "root" || key === MembersSym) &&
|
161
|
+
typeof descriptor.value === "object" &&
|
162
|
+
SchemaInit in descriptor.value) {
|
163
|
+
(_b = target.constructor)._schema || (_b._schema = {});
|
164
|
+
target.constructor._schema[key] =
|
165
|
+
descriptor.value[SchemaInit];
|
166
|
+
return true;
|
167
|
+
}
|
168
|
+
else {
|
169
|
+
return Reflect.defineProperty(target, key, descriptor);
|
170
|
+
}
|
171
|
+
},
|
172
|
+
};
|
133
173
|
export class AccountCtx extends Context.Tag("Account")() {
|
134
174
|
}
|
135
175
|
export function isControlledAccount(account) {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"account.js","sourceRoot":"","sources":["../../src/coValues/account.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAYnC,OAAO,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;
|
1
|
+
{"version":3,"file":"account.js","sourceRoot":"","sources":["../../src/coValues/account.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAYnC,OAAO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