jazz-tools 0.7.0-alpha.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (85) hide show
  1. package/.eslintrc.cjs +24 -0
  2. package/.turbo/turbo-build.log +24 -0
  3. package/CHANGELOG.md +42 -0
  4. package/LICENSE.txt +19 -0
  5. package/README.md +3 -0
  6. package/dist/coValueInterfaces.js +8 -0
  7. package/dist/coValueInterfaces.js.map +1 -0
  8. package/dist/coValues/account/account.js +11 -0
  9. package/dist/coValues/account/account.js.map +1 -0
  10. package/dist/coValues/account/accountOf.js +150 -0
  11. package/dist/coValues/account/accountOf.js.map +1 -0
  12. package/dist/coValues/account/migration.js +4 -0
  13. package/dist/coValues/account/migration.js.map +1 -0
  14. package/dist/coValues/coList/coList.js +2 -0
  15. package/dist/coValues/coList/coList.js.map +1 -0
  16. package/dist/coValues/coList/coListOf.js +235 -0
  17. package/dist/coValues/coList/coListOf.js.map +1 -0
  18. package/dist/coValues/coList/internalDocs.js +2 -0
  19. package/dist/coValues/coList/internalDocs.js.map +1 -0
  20. package/dist/coValues/coMap/coMap.js +2 -0
  21. package/dist/coValues/coMap/coMap.js.map +1 -0
  22. package/dist/coValues/coMap/coMapOf.js +262 -0
  23. package/dist/coValues/coMap/coMapOf.js.map +1 -0
  24. package/dist/coValues/coMap/internalDocs.js +2 -0
  25. package/dist/coValues/coMap/internalDocs.js.map +1 -0
  26. package/dist/coValues/coStream/coStream.js +2 -0
  27. package/dist/coValues/coStream/coStream.js.map +1 -0
  28. package/dist/coValues/coStream/coStreamOf.js +244 -0
  29. package/dist/coValues/coStream/coStreamOf.js.map +1 -0
  30. package/dist/coValues/construction.js +34 -0
  31. package/dist/coValues/construction.js.map +1 -0
  32. package/dist/coValues/extensions/imageDef.js +36 -0
  33. package/dist/coValues/extensions/imageDef.js.map +1 -0
  34. package/dist/coValues/group/group.js +2 -0
  35. package/dist/coValues/group/group.js.map +1 -0
  36. package/dist/coValues/group/groupOf.js +109 -0
  37. package/dist/coValues/group/groupOf.js.map +1 -0
  38. package/dist/coValues/resolution.js +66 -0
  39. package/dist/coValues/resolution.js.map +1 -0
  40. package/dist/errors.js +2 -0
  41. package/dist/errors.js.map +1 -0
  42. package/dist/index.js +31 -0
  43. package/dist/index.js.map +1 -0
  44. package/dist/refs.js +95 -0
  45. package/dist/refs.js.map +1 -0
  46. package/dist/schemaHelpers.js +14 -0
  47. package/dist/schemaHelpers.js.map +1 -0
  48. package/dist/subscriptionScope.js +81 -0
  49. package/dist/subscriptionScope.js.map +1 -0
  50. package/dist/tests/coList.test.js +207 -0
  51. package/dist/tests/coList.test.js.map +1 -0
  52. package/dist/tests/coMap.test.js +238 -0
  53. package/dist/tests/coMap.test.js.map +1 -0
  54. package/dist/tests/coStream.test.js +263 -0
  55. package/dist/tests/coStream.test.js.map +1 -0
  56. package/dist/tests/types.test.js +33 -0
  57. package/dist/tests/types.test.js.map +1 -0
  58. package/package.json +23 -0
  59. package/src/coValueInterfaces.ts +105 -0
  60. package/src/coValues/account/account.ts +106 -0
  61. package/src/coValues/account/accountOf.ts +284 -0
  62. package/src/coValues/account/migration.ts +12 -0
  63. package/src/coValues/coList/coList.ts +57 -0
  64. package/src/coValues/coList/coListOf.ts +377 -0
  65. package/src/coValues/coList/internalDocs.ts +1 -0
  66. package/src/coValues/coMap/coMap.ts +110 -0
  67. package/src/coValues/coMap/coMapOf.ts +451 -0
  68. package/src/coValues/coMap/internalDocs.ts +1 -0
  69. package/src/coValues/coStream/coStream.ts +63 -0
  70. package/src/coValues/coStream/coStreamOf.ts +404 -0
  71. package/src/coValues/construction.ts +110 -0
  72. package/src/coValues/extensions/imageDef.ts +51 -0
  73. package/src/coValues/group/group.ts +27 -0
  74. package/src/coValues/group/groupOf.ts +183 -0
  75. package/src/coValues/resolution.ts +111 -0
  76. package/src/errors.ts +1 -0
  77. package/src/index.ts +68 -0
  78. package/src/refs.ts +128 -0
  79. package/src/schemaHelpers.ts +72 -0
  80. package/src/subscriptionScope.ts +118 -0
  81. package/src/tests/coList.test.ts +283 -0
  82. package/src/tests/coMap.test.ts +357 -0
  83. package/src/tests/coStream.test.ts +415 -0
  84. package/src/tests/types.test.ts +37 -0
  85. package/tsconfig.json +15 -0
package/.eslintrc.cjs ADDED
@@ -0,0 +1,24 @@
1
+ module.exports = {
2
+ extends: [
3
+ "eslint:recommended",
4
+ "plugin:@typescript-eslint/recommended",
5
+ "plugin:require-extensions/recommended",
6
+ ],
7
+ parser: "@typescript-eslint/parser",
8
+ plugins: ["@typescript-eslint", "require-extensions"],
9
+ parserOptions: {
10
+ project: "./tsconfig.json",
11
+ tsconfigRootDir: __dirname,
12
+ },
13
+ ignorePatterns: [".eslint.cjs", "**/tests/*"],
14
+ root: true,
15
+ rules: {
16
+ "no-unused-vars": "off",
17
+ "@typescript-eslint/no-unused-vars": [
18
+ "error",
19
+ { argsIgnorePattern: "^_", varsIgnorePattern: "^_" },
20
+ ],
21
+ "@typescript-eslint/no-floating-promises": "error",
22
+ "@typescript-eslint/no-explicit-any": "warn"
23
+ },
24
+ };
@@ -0,0 +1,24 @@
1
+
2
+ > jazz-js@0.6.1 build /Users/anselm/jazz/jazz/packages/jazz-js
3
+ > npm run lint && rm -rf ./dist && tsc --sourceMap --outDir dist
4
+
5
+
6
+ > jazz-js@0.6.1 lint
7
+ > eslint src/**/*.ts
8
+
9
+
10
+ /Users/anselm/jazz/jazz/packages/jazz-js/src/tests/binaryCoStream.test.ts
11
+ 0:0 warning File ignored because of a matching ignore pattern. Use "--no-ignore" to override
12
+
13
+ /Users/anselm/jazz/jazz/packages/jazz-js/src/tests/coList.test.ts
14
+ 0:0 warning File ignored because of a matching ignore pattern. Use "--no-ignore" to override
15
+
16
+ /Users/anselm/jazz/jazz/packages/jazz-js/src/tests/coMap.test.ts
17
+ 0:0 warning File ignored because of a matching ignore pattern. Use "--no-ignore" to override
18
+
19
+ /Users/anselm/jazz/jazz/packages/jazz-js/src/tests/coStream.test.ts
20
+ 0:0 warning File ignored because of a matching ignore pattern. Use "--no-ignore" to override
21
+
22
+ ✖ 4 problems (0 errors, 4 warnings)
23
+
24
+  ELIFECYCLE  Command failed.
package/CHANGELOG.md ADDED
@@ -0,0 +1,42 @@
1
+ # jazz-autosub
2
+
3
+ ## 0.7.0-alpha.0
4
+
5
+ ### Minor Changes
6
+
7
+ - New simplified API
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies
12
+ - cojson@0.7.0-alpha.0
13
+
14
+ ## 0.6.1
15
+
16
+ ### Patch Changes
17
+
18
+ - Fix loading of accounts
19
+ - Updated dependencies
20
+ - cojson@0.6.5
21
+
22
+ ## 0.6.0
23
+
24
+ ### Minor Changes
25
+
26
+ - Make addMember and removeMember take loaded Accounts instead of just IDs
27
+
28
+ ### Patch Changes
29
+
30
+ - Updated dependencies
31
+ - cojson@0.6.0
32
+
33
+ ## 0.5.0
34
+
35
+ ### Minor Changes
36
+
37
+ - Adding a lot of performance improvements to cojson, add a stresstest for the twit example and make that run smoother in a lot of ways.
38
+
39
+ ### Patch Changes
40
+
41
+ - Updated dependencies
42
+ - cojson@0.5.0
package/LICENSE.txt ADDED
@@ -0,0 +1,19 @@
1
+ Copyright 2023, Garden Computing, Inc.
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy
4
+ of this software and associated documentation files (the "Software"), to deal
5
+ in the Software without restriction, including without limitation the rights
6
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
+ copies of the Software, and to permit persons to whom the Software is
8
+ furnished to do so, subject to the following conditions:
9
+
10
+ The above copyright notice and this permission notice shall be included in all
11
+ copies or substantial portions of the Software.
12
+
13
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,3 @@
1
+ # CoJSON
2
+
3
+ [See the top-level README](../../README.md#cojson)
@@ -0,0 +1,8 @@
1
+ export function isCoValueSchema(value) {
2
+ return value && value.type !== undefined;
3
+ }
4
+ export const inspect = Symbol.for("nodejs.util.inspect.custom");
5
+ export function isCoValue(value) {
6
+ return value && value._type !== undefined;
7
+ }
8
+ //# sourceMappingURL=coValueInterfaces.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"coValueInterfaces.js","sourceRoot":"","sources":["../src/coValueInterfaces.ts"],"names":[],"mappings":"AAoEA,MAAM,UAAU,eAAe,CAAC,KAAU;IACtC,OAAO,KAAK,IAAI,KAAK,CAAC,IAAI,KAAK,SAAS,CAAC;AAC7C,CAAC;AAED,MAAM,CAAC,MAAM,OAAO,GAAG,MAAM,CAAC,GAAG,CAAC,4BAA4B,CAAC,CAAC;AA2BhE,MAAM,UAAU,SAAS,CAAC,KAAU;IAChC,OAAO,KAAK,IAAI,KAAK,CAAC,KAAK,KAAK,SAAS,CAAC;AAC9C,CAAC"}
@@ -0,0 +1,11 @@
1
+ import { Context } from "effect";
2
+ export function isAccount(value) {
3
+ return value._type === "Account";
4
+ }
5
+ export function isControlledAccount(value) {
6
+ return isAccount(value) && value.isMe;
7
+ }
8
+ export const controlledAccountSym = Symbol("@jazz/controlledAccount");
9
+ export class ControlledAccountCtx extends Context.Tag("ControlledAccount")() {
10
+ }
11
+ //# sourceMappingURL=account.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"account.js","sourceRoot":"","sources":["../../../src/coValues/account/account.ts"],"names":[],"mappings":"AAkBA,OAAO,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AA0BjC,MAAM,UAAU,SAAS,CAAC,KAAc;IACpC,OAAO,KAAK,CAAC,KAAK,KAAK,SAAS,CAAC;AACrC,CAAC;AAED,MAAM,UAAU,mBAAmB,CAC/B,KAAc;IAEd,OAAO,SAAS,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC;AAC1C,CAAC;AA+CD,MAAM,CAAC,MAAM,oBAAoB,GAAG,MAAM,CAAC,yBAAyB,CAAC,CAAC;AAGtE,MAAM,OAAO,oBAAqB,SAAQ,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC,EAGvE;CAAG"}
@@ -0,0 +1,150 @@
1
+ import { LocalNode, RawControlledAccount, } from "cojson";
2
+ import { inspect, } from "../../coValueInterfaces.js";
3
+ import { CoMapOf } from "../coMap/coMapOf.js";
4
+ import { controlledAccountSym, } from "./account.js";
5
+ import * as S from "@effect/schema/Schema";
6
+ import { AST, Schema } from "@effect/schema";
7
+ import { SharedCoValueConstructor } from "../construction.js";
8
+ import { constructorOfSchemaSym } from "../resolution.js";
9
+ import { pipeArguments } from "effect/Pipeable";
10
+ import { ValueRef } from "../../refs.js";
11
+ export function AccountOf(fields) {
12
+ class AccountOfProfileAndRoot extends SharedCoValueConstructor {
13
+ static get ast() {
14
+ return AST.setAnnotation(Schema.instanceOf(this).ast, constructorOfSchemaSym, this);
15
+ }
16
+ static pipe() {
17
+ // eslint-disable-next-line prefer-rest-params
18
+ return pipeArguments(this, arguments);
19
+ }
20
+ constructor(init, options) {
21
+ super();
22
+ if (!("fromRaw" in options)) {
23
+ throw new Error("Can only construct account from raw or with .create()");
24
+ }
25
+ this.isMe =
26
+ options.fromRaw.id == options.fromRaw.core.node.account.id;
27
+ const refs = {
28
+ get profile() {
29
+ const profileID = options.fromRaw.get("profile");
30
+ return profileID && new ValueRef(profileID, controlledAccountFromNode(options.fromRaw.core.node), fields.profile);
31
+ },
32
+ get root() {
33
+ const rootID = options.fromRaw.get("root");
34
+ return rootID && new ValueRef(rootID, controlledAccountFromNode(options.fromRaw.core.node), fields.root);
35
+ },
36
+ };
37
+ Object.defineProperties(this, {
38
+ id: { value: options.fromRaw.id, enumerable: false },
39
+ _type: { value: "Account", enumerable: false },
40
+ _owner: { value: this, enumerable: false },
41
+ _refs: { value: refs, enumerable: false },
42
+ _raw: { value: options.fromRaw, enumerable: false },
43
+ _loadedAs: {
44
+ get: () => this.isMe
45
+ ? this
46
+ : controlledAccountFromNode(options.fromRaw.core.node),
47
+ enumerable: false,
48
+ },
49
+ _schema: { value: AccountOfProfileAndRoot, enumerable: false },
50
+ });
51
+ if (this.isMe) {
52
+ this.sessionID =
53
+ options.fromRaw.core.node.currentSessionID;
54
+ }
55
+ }
56
+ static fromRaw(raw) {
57
+ return new AccountOfProfileAndRoot(undefined, {
58
+ fromRaw: raw,
59
+ });
60
+ }
61
+ static async create(options) {
62
+ const { node } = await LocalNode.withNewlyCreatedAccount({
63
+ ...options,
64
+ migration: options.migration &&
65
+ (async (rawAccount) => {
66
+ const account = new AccountOfProfileAndRoot(undefined, {
67
+ fromRaw: rawAccount,
68
+ });
69
+ await options.migration(account);
70
+ }),
71
+ });
72
+ return new AccountOfProfileAndRoot(undefined, {
73
+ fromRaw: node.account,
74
+ });
75
+ }
76
+ static async become(options) {
77
+ const node = await LocalNode.withLoadedAccount({
78
+ accountID: options.accountID,
79
+ accountSecret: options.accountSecret,
80
+ sessionID: options.sessionID,
81
+ peersToLoadFrom: options.peersToLoadFrom,
82
+ migration: options.migration &&
83
+ (async (rawAccount) => {
84
+ const account = new AccountOfProfileAndRoot(undefined, {
85
+ fromRaw: rawAccount,
86
+ });
87
+ await options.migration(account);
88
+ }),
89
+ });
90
+ return new AccountOfProfileAndRoot(undefined, {
91
+ fromRaw: node.account,
92
+ });
93
+ }
94
+ async acceptInvite(valueID, inviteSecret, valueSchema) {
95
+ if (!this.isMe) {
96
+ throw new Error("Only a controlled account can accept invites");
97
+ }
98
+ await this._raw.acceptInvite(valueID, inviteSecret);
99
+ return valueSchema.load(valueID, { as: this });
100
+ }
101
+ get profile() {
102
+ return this._refs.profile.accessFrom(this);
103
+ }
104
+ get root() {
105
+ return this._refs.root.accessFrom(this);
106
+ }
107
+ myRole() {
108
+ return "admin";
109
+ }
110
+ toJSON() {
111
+ return {
112
+ profile: this.profile?.toJSON(),
113
+ root: this.root?.toJSON(),
114
+ };
115
+ }
116
+ [(Schema.TypeId, inspect)]() {
117
+ return this.toJSON();
118
+ }
119
+ static as() {
120
+ return this;
121
+ }
122
+ }
123
+ AccountOfProfileAndRoot.type = "Account";
124
+ return AccountOfProfileAndRoot;
125
+ }
126
+ export class BaseProfile extends CoMapOf({
127
+ name: S.string,
128
+ }).as() {
129
+ }
130
+ export class Account extends AccountOf({
131
+ profile: BaseProfile,
132
+ root: S.null,
133
+ }).as() {
134
+ }
135
+ const simpleControlledAccounts = new WeakMap();
136
+ export function controlledAccountFromNode(node) {
137
+ if (!(node.account instanceof RawControlledAccount)) {
138
+ throw new Error("Expected a controlled account");
139
+ }
140
+ let simpleAccount;
141
+ if (simpleControlledAccounts.has(node.account)) {
142
+ simpleAccount = simpleControlledAccounts.get(node.account);
143
+ }
144
+ else {
145
+ simpleAccount = Account.fromRaw(node.account);
146
+ simpleControlledAccounts.set(node.account, simpleAccount);
147
+ }
148
+ return simpleAccount;
149
+ }
150
+ //# sourceMappingURL=accountOf.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"accountOf.js","sourceRoot":"","sources":["../../../src/coValues/account/accountOf.ts"],"names":[],"mappings":"AAAA,OAAO,EAIH,SAAS,EAIT,oBAAoB,GAEvB,MAAM,QAAQ,CAAC;AAChB,OAAO,EAGH,OAAO,GAEV,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAKH,oBAAoB,GACvB,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,CAAC,MAAM,uBAAuB,CAAC;AAE3C,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AA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,wBAAwB,GAAG,IAAI,OAAO,EAGzC,CAAC;AAEJ,MAAM,UAAU,yBAAyB,CAAC,IAAe;IACrD,IAAI,CAAC,CAAC,IAAI,CAAC,OAAO,YAAY,oBAAoB,CAAC,EAAE,CAAC;QAClD,MAAM,IAAI,KAAK,CAAC,+BAA+B,CAAC,CAAC;IACrD,CAAC;IACD,IAAI,aAAa,CAAC;IAElB,IAAI,wBAAwB,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC;QAC7C,aAAa,GAAG,wBAAwB,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAC/D,CAAC;SAAM,CAAC;QACJ,aAAa,GAAG,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CACvB,CAAC;QACtB,wBAAwB,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,EAAE,aAAa,CAAC,CAAC;IAC9D,CAAC;IAED,OAAO,aAAc,CAAC;AAC1B,CAAC"}
@@ -0,0 +1,4 @@
1
+ export function createAccountMigration(accountSchema, migration) {
2
+ return migration;
3
+ }
4
+ //# sourceMappingURL=migration.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"migration.js","sourceRoot":"","sources":["../../../src/coValues/account/migration.ts"],"names":[],"mappings":"AAMA,MAAM,UAAU,sBAAsB,CAClC,aAAgB,EAChB,SAA8B;IAE9B,OAAO,SAAS,CAAC;AACrB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=coList.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"coList.js","sourceRoot":"","sources":["../../../src/coValues/coList/coList.ts"],"names":[],"mappings":""}
@@ -0,0 +1,235 @@
1
+ import { RawAccount, cojsonInternals, } from "cojson";
2
+ import { inspect } from "../../coValueInterfaces.js";
3
+ import { AST, Schema } from "@effect/schema";
4
+ import { constructorOfSchemaSym, propertyIsCoValueSchema, } from "../resolution.js";
5
+ import { ValueRef, makeRefs } from "../../refs.js";
6
+ import { Account, controlledAccountFromNode } from "../account/accountOf.js";
7
+ import { subscriptionsScopes } from "../../subscriptionScope.js";
8
+ import { SharedCoValueConstructor } from "../construction.js";
9
+ import { pipeArguments } from "effect/Pipeable";
10
+ import { Group } from "../group/groupOf.js";
11
+ export function CoListOf(itemSchema) {
12
+ const decodeItem = Schema.decodeSync(itemSchema);
13
+ const encodeItem = Schema.encodeSync(itemSchema);
14
+ class CoListOfItem extends Array {
15
+ static get ast() {
16
+ return AST.setAnnotation(Schema.instanceOf(this).ast, constructorOfSchemaSym, this);
17
+ }
18
+ static pipe() {
19
+ // eslint-disable-next-line prefer-rest-params
20
+ return pipeArguments(this, arguments);
21
+ }
22
+ constructor(init, options) {
23
+ if (typeof init === "number") {
24
+ // this might be called from an intrinsic, like map, trying to create an empty array
25
+ // passing `0` as the only parameter
26
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
27
+ return new Array(init);
28
+ }
29
+ super();
30
+ const itemsAreCoValues = propertyIsCoValueSchema(itemSchema);
31
+ if (!options) {
32
+ throw new Error("Must provide options");
33
+ }
34
+ let raw;
35
+ if ("fromRaw" in options) {
36
+ raw = options.fromRaw;
37
+ }
38
+ else {
39
+ const rawOwner = options.owner._raw;
40
+ const rawInit = itemsAreCoValues
41
+ ? init?.map((item) => item.id)
42
+ : init?.map((item) => encodeItem(item));
43
+ raw = rawOwner.createList(rawInit);
44
+ }
45
+ const refs = itemsAreCoValues
46
+ ? makeRefs((idx) => raw.get(idx), () => Array.from({ length: raw.entries().length }, (_, idx) => idx), controlledAccountFromNode(raw.core.node), (_idx) => itemSchema)
47
+ : [];
48
+ const getEdits = () => new Proxy(this, {
49
+ get: (target, key, receiver) => {
50
+ if (typeof key === "string" && !isNaN(+key)) {
51
+ const rawEdit = raw.editAt(Number(key));
52
+ if (!rawEdit)
53
+ return undefined;
54
+ return {
55
+ get value() {
56
+ if (itemsAreCoValues) {
57
+ return this.ref?.accessFrom(receiver);
58
+ }
59
+ else {
60
+ return (rawEdit?.value &&
61
+ decodeItem(rawEdit?.value));
62
+ }
63
+ },
64
+ get ref() {
65
+ if (itemsAreCoValues) {
66
+ return (rawEdit?.value &&
67
+ new ValueRef(rawEdit?.value, receiver._loadedAs, itemSchema));
68
+ }
69
+ },
70
+ get by() {
71
+ if (cojsonInternals.isAccountID(rawEdit.by)) {
72
+ return new ValueRef(rawEdit.by, receiver._loadedAs, Account).accessFrom(receiver);
73
+ }
74
+ },
75
+ madeAt: rawEdit.at,
76
+ tx: rawEdit.tx,
77
+ };
78
+ }
79
+ else if (key === "length") {
80
+ return raw.entries().length;
81
+ }
82
+ return Reflect.get(target, key, receiver);
83
+ },
84
+ });
85
+ Object.defineProperties(this, {
86
+ id: { value: raw.id, enumerable: false },
87
+ _type: { value: "CoList", enumerable: false },
88
+ _owner: {
89
+ get: () => raw.group instanceof RawAccount
90
+ ? Account.fromRaw(raw.group)
91
+ : Group.fromRaw(raw.group),
92
+ enumerable: false,
93
+ },
94
+ _refs: { value: refs, enumerable: false },
95
+ _edits: { get: getEdits, enumerable: false },
96
+ _raw: { value: raw, enumerable: false },
97
+ _loadedAs: {
98
+ get: () => controlledAccountFromNode(raw.core.node),
99
+ enumerable: false,
100
+ },
101
+ _schema: { value: this.constructor, enumerable: false },
102
+ });
103
+ return new Proxy(this, {
104
+ get(target, key, receiver) {
105
+ if (typeof key === "string" && !isNaN(+key)) {
106
+ if (itemsAreCoValues) {
107
+ return target._refs[Number(key)]?.accessFrom(receiver);
108
+ }
109
+ else {
110
+ return decodeItem(raw.get(Number(key)));
111
+ }
112
+ }
113
+ else if (key === "length") {
114
+ return raw.entries().length;
115
+ }
116
+ const prop = Reflect.get(target, key, receiver);
117
+ if (typeof prop === "function") {
118
+ return prop.bind(receiver);
119
+ }
120
+ return prop;
121
+ },
122
+ set(target, key, value, receiver) {
123
+ if (typeof key === "string" && !isNaN(+key)) {
124
+ if (itemsAreCoValues) {
125
+ raw.replace(Number(key), value.id);
126
+ subscriptionsScopes
127
+ .get(receiver)
128
+ ?.onRefAccessedOrSet(value.id);
129
+ return true;
130
+ }
131
+ else {
132
+ raw.replace(Number(key), encodeItem(value));
133
+ return true;
134
+ }
135
+ }
136
+ else {
137
+ return Reflect.set(target, key, value);
138
+ }
139
+ },
140
+ has(target, key) {
141
+ if (typeof key === "string" && !isNaN(+key)) {
142
+ return Number(key) < raw.entries().length;
143
+ }
144
+ else {
145
+ return Reflect.has(target, key);
146
+ }
147
+ },
148
+ });
149
+ }
150
+ static fromRaw(raw) {
151
+ return new CoListOfItem(undefined, { fromRaw: raw });
152
+ }
153
+ push(...items) {
154
+ let rawItems;
155
+ if (propertyIsCoValueSchema(itemSchema)) {
156
+ rawItems = items.map((item) => item.id);
157
+ }
158
+ else {
159
+ rawItems = items.map((item) => encodeItem(item));
160
+ }
161
+ for (const item of rawItems) {
162
+ this._raw.append(item);
163
+ }
164
+ return this._raw.entries().length;
165
+ }
166
+ unshift(...items) {
167
+ let rawItems;
168
+ if (propertyIsCoValueSchema(itemSchema)) {
169
+ rawItems = items.map((item) => item.id);
170
+ }
171
+ else {
172
+ rawItems = items.map((item) => encodeItem(item));
173
+ }
174
+ for (const item of rawItems) {
175
+ this._raw.prepend(item);
176
+ }
177
+ return this._raw.entries().length;
178
+ }
179
+ pop() {
180
+ const last = this[this.length - 1];
181
+ this._raw.delete(this.length - 1);
182
+ return last;
183
+ }
184
+ shift() {
185
+ const first = this[0];
186
+ this._raw.delete(0);
187
+ return first;
188
+ }
189
+ splice(start, deleteCount, ...items) {
190
+ const deleted = this.slice(start, start + deleteCount);
191
+ for (let idxToDelete = start + deleteCount; idxToDelete > start; idxToDelete--) {
192
+ this._raw.delete(idxToDelete);
193
+ }
194
+ let rawItems;
195
+ if (propertyIsCoValueSchema(itemSchema)) {
196
+ rawItems = items.map((item) => item.id);
197
+ }
198
+ else {
199
+ rawItems = items.map((item) => encodeItem(item));
200
+ }
201
+ let appendAfter = start;
202
+ for (const item of rawItems) {
203
+ this._raw.append(item, appendAfter);
204
+ appendAfter++;
205
+ }
206
+ return deleted;
207
+ }
208
+ toJSON() {
209
+ return this.map((item) => typeof item === "object" &&
210
+ "toJSON" in item &&
211
+ typeof item.toJSON === "function"
212
+ ? item.toJSON()
213
+ : item);
214
+ }
215
+ [(Schema.TypeId, inspect)]() {
216
+ return this.toJSON();
217
+ }
218
+ static as() {
219
+ return CoListOfItem;
220
+ }
221
+ subscribe(listener) {
222
+ return SharedCoValueConstructor.prototype.subscribe.call(this, listener);
223
+ }
224
+ subscribeEf() {
225
+ return SharedCoValueConstructor.prototype.subscribeEf.call(this);
226
+ }
227
+ }
228
+ CoListOfItem.type = "CoList";
229
+ CoListOfItem.load = SharedCoValueConstructor.load;
230
+ CoListOfItem.loadEf = SharedCoValueConstructor.loadEf;
231
+ CoListOfItem.subscribe = SharedCoValueConstructor.subscribe;
232
+ CoListOfItem.subscribeEf = SharedCoValueConstructor.subscribeEf;
233
+ return CoListOfItem;
234
+ }
235
+ //# sourceMappingURL=coListOf.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"coListOf.js","sourceRoot":"","sources":["../../../src/coValues/coList/coListOf.ts"],"names":[],"mappings":"AAAA,OAAO,EAGH,UAAU,EAEV,eAAe,GAClB,MAAM,QAAQ,CAAC;AAChB,OAAO,EAAqB,OAAO,EAAE,MAAM,4BAA4B,CAAC;AAGxE,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAG7C,OAAO,EACH,sBAAsB,EACtB,uBAAuB,GAC1B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,yBAAyB,EAAE,MAAM,yBAAyB,CAAC;AAC7E,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,MA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,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CACrB,OAAO,IAAI,KAAK,QAAQ;gBACxB,QAAQ,IAAI,IAAI;gBAChB,OAAO,IAAI,CAAC,MAAM,KAAK,UAAU;gBAC7B,CAAC,CAAC,IAAI,CAAC,MAAM,EAAE;gBACf,CAAC,CAAC,IAAI,CACb,CAAC;QACN,CAAC;QAED,EA9SQ,MAAM,CAAC,MAAM,EA8SpB,OAAO,EAAC;YACL,OAAO,IAAI,CAAC,MAAM,EAAE,CAAC;QACzB,CAAC;QAED,MAAM,CAAC,EAAE;YACL,OAAO,YAAuD,CAAC;QACnE,CAAC;QAED,SAAS,CAAC,QAAgC;YACtC,OAAO,wBAAwB,CAAC,SAAS,CAAC,SAAS,CAAC,IAAI,CACpD,IAAI,EACJ,QAES,CACZ,CAAC;QACN,CAAC;QAED,WAAW;YACP,OAAO,wBAAwB,CAAC,SAAS,CAAC,WAAW,CAAC,IAAI,CACtD,IAAI,CACoD,CAAC;QACjE,CAAC;;IA1TM,iBAAI,GAAG,QAAiB,CAAC;IAsRzB,iBAAI,GAAG,wBAAwB,CAAC,IAAI,CAAC;IACrC,mBAAM,GAAG,wBAAwB,CAAC,MAAM,CAAC;IACzC,sBAAS,GAAG,wBAAwB,CAAC,SAAS,CAAC;IAC/C,wBAAW,GAAG,wBAAwB,CAAC,WAAW,CAAC;IAoC9D,OAAO,YAEN,CAAC;AACN,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=internalDocs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"internalDocs.js","sourceRoot":"","sources":["../../../src/coValues/coList/internalDocs.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=coMap.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"coMap.js","sourceRoot":"","sources":["../../../src/coValues/coMap/coMap.ts"],"names":[],"mappings":""}