jazz-tools 0.17.14 → 0.18.1
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/.svelte-kit/__package__/jazz.class.svelte.js +1 -1
- package/.svelte-kit/__package__/media/image.svelte +3 -9
- package/.svelte-kit/__package__/media/image.svelte.d.ts +1 -6
- package/.svelte-kit/__package__/media/image.svelte.d.ts.map +1 -1
- package/.svelte-kit/__package__/media/image.types.d.ts +7 -0
- package/.svelte-kit/__package__/media/image.types.d.ts.map +1 -0
- package/.svelte-kit/__package__/media/image.types.js +1 -0
- package/.svelte-kit/__package__/tests/media/image.svelte.test.js +31 -31
- package/.turbo/turbo-build.log +60 -46
- package/CHANGELOG.md +41 -0
- package/dist/better-auth/auth/client.d.ts +29 -0
- package/dist/better-auth/auth/client.d.ts.map +1 -0
- package/dist/better-auth/auth/client.js +127 -0
- package/dist/better-auth/auth/client.js.map +1 -0
- package/dist/better-auth/auth/react.d.ts +2170 -0
- package/dist/better-auth/auth/react.d.ts.map +1 -0
- package/dist/better-auth/auth/react.js +40 -0
- package/dist/better-auth/auth/react.js.map +1 -0
- package/dist/better-auth/auth/server.d.ts +14 -0
- package/dist/better-auth/auth/server.d.ts.map +1 -0
- package/dist/better-auth/auth/server.js +198 -0
- package/dist/better-auth/auth/server.js.map +1 -0
- package/dist/better-auth/auth/tests/client.test.d.ts +2 -0
- package/dist/better-auth/auth/tests/client.test.d.ts.map +1 -0
- package/dist/better-auth/auth/tests/server.test.d.ts +2 -0
- package/dist/better-auth/auth/tests/server.test.d.ts.map +1 -0
- package/dist/browser/index.js +2 -2
- package/dist/browser/index.js.map +1 -1
- package/dist/{chunk-LZOF6WP5.js → chunk-IERUTUXB.js} +1336 -1017
- package/dist/chunk-IERUTUXB.js.map +1 -0
- package/dist/index.js +18 -18
- package/dist/index.js.map +1 -1
- package/dist/inspector/{custom-element-ZSNTCECD.js → custom-element-WCY6D3QJ.js} +3 -3
- package/dist/inspector/{custom-element-ZSNTCECD.js.map → custom-element-WCY6D3QJ.js.map} +1 -1
- package/dist/inspector/index.js +1 -1
- package/dist/inspector/index.js.map +1 -1
- package/dist/inspector/register-custom-element.js +1 -1
- package/dist/media/{chunk-E5J3WLQW.js → chunk-KR2V6X2N.js} +14 -9
- package/dist/media/chunk-KR2V6X2N.js.map +1 -0
- package/dist/media/create-image.d.ts +6 -6
- package/dist/media/index.browser.d.ts +6 -6
- package/dist/media/index.browser.js +1 -1
- package/dist/media/index.d.ts +1 -1
- package/dist/media/index.js +1 -1
- package/dist/media/index.native.d.ts +6 -6
- package/dist/media/index.native.js +1 -1
- package/dist/media/utils.d.ts.map +1 -1
- package/dist/prosemirror/index.js +2 -2
- package/dist/prosemirror/index.js.map +1 -1
- package/dist/react/index.js +7 -5
- package/dist/react/index.js.map +1 -1
- package/dist/react-core/hooks.d.ts.map +1 -1
- package/dist/react-core/index.js +4675 -23
- package/dist/react-core/index.js.map +1 -1
- package/dist/react-native-core/index.js +1 -1
- package/dist/react-native-core/index.js.map +1 -1
- package/dist/svelte/jazz.class.svelte.js +1 -1
- package/dist/svelte/media/image.svelte +3 -9
- package/dist/svelte/media/image.svelte.d.ts +1 -6
- package/dist/svelte/media/image.svelte.d.ts.map +1 -1
- package/dist/svelte/media/image.types.d.ts +7 -0
- package/dist/svelte/media/image.types.d.ts.map +1 -0
- package/dist/svelte/media/image.types.js +1 -0
- package/dist/svelte/tests/media/image.svelte.test.js +31 -31
- package/dist/testing.js +18 -14
- package/dist/testing.js.map +1 -1
- package/dist/tools/coValues/CoFieldInit.d.ts +13 -0
- package/dist/tools/coValues/CoFieldInit.d.ts.map +1 -0
- package/dist/tools/coValues/CoValueBase.d.ts +18 -15
- package/dist/tools/coValues/CoValueBase.d.ts.map +1 -1
- package/dist/tools/coValues/account.d.ts +101 -46
- package/dist/tools/coValues/account.d.ts.map +1 -1
- package/dist/tools/coValues/coFeed.d.ts +78 -62
- package/dist/tools/coValues/coFeed.d.ts.map +1 -1
- package/dist/tools/coValues/coList.d.ts +212 -99
- package/dist/tools/coValues/coList.d.ts.map +1 -1
- package/dist/tools/coValues/coMap.d.ts +210 -192
- package/dist/tools/coValues/coMap.d.ts.map +1 -1
- package/dist/tools/coValues/coPlainText.d.ts +30 -22
- package/dist/tools/coValues/coPlainText.d.ts.map +1 -1
- package/dist/tools/coValues/deepLoading.d.ts +13 -13
- package/dist/tools/coValues/deepLoading.d.ts.map +1 -1
- package/dist/tools/coValues/extensions/imageDef.d.ts +1 -1
- package/dist/tools/coValues/group.d.ts +32 -32
- package/dist/tools/coValues/group.d.ts.map +1 -1
- package/dist/tools/coValues/inbox.d.ts.map +1 -1
- package/dist/tools/coValues/interfaces.d.ts +18 -17
- package/dist/tools/coValues/interfaces.d.ts.map +1 -1
- package/dist/tools/coValues/profile.d.ts +6 -5
- package/dist/tools/coValues/profile.d.ts.map +1 -1
- package/dist/tools/coValues/schemaUnion.d.ts +3 -3
- package/dist/tools/coValues/schemaUnion.d.ts.map +1 -1
- package/dist/tools/exports.d.ts +1 -1
- package/dist/tools/exports.d.ts.map +1 -1
- package/dist/tools/implementation/anonymousJazzAgent.d.ts +2 -1
- package/dist/tools/implementation/anonymousJazzAgent.d.ts.map +1 -1
- package/dist/tools/implementation/schema.d.ts +5 -5
- package/dist/tools/implementation/schema.d.ts.map +1 -1
- package/dist/tools/implementation/symbols.d.ts +2 -0
- package/dist/tools/implementation/symbols.d.ts.map +1 -1
- package/dist/tools/implementation/zodSchema/schemaTypes/AccountSchema.d.ts +2 -2
- package/dist/tools/implementation/zodSchema/schemaTypes/AccountSchema.d.ts.map +1 -1
- package/dist/tools/implementation/zodSchema/schemaTypes/CoFeedSchema.d.ts +6 -2
- package/dist/tools/implementation/zodSchema/schemaTypes/CoFeedSchema.d.ts.map +1 -1
- package/dist/tools/implementation/zodSchema/schemaTypes/CoListSchema.d.ts +8 -3
- package/dist/tools/implementation/zodSchema/schemaTypes/CoListSchema.d.ts.map +1 -1
- package/dist/tools/implementation/zodSchema/schemaTypes/CoMapSchema.d.ts +12 -7
- package/dist/tools/implementation/zodSchema/schemaTypes/CoMapSchema.d.ts.map +1 -1
- package/dist/tools/implementation/zodSchema/schemaTypes/CoRecordSchema.d.ts +13 -7
- package/dist/tools/implementation/zodSchema/schemaTypes/CoRecordSchema.d.ts.map +1 -1
- package/dist/tools/implementation/zodSchema/schemaTypes/FileStreamSchema.d.ts +11 -2
- package/dist/tools/implementation/zodSchema/schemaTypes/FileStreamSchema.d.ts.map +1 -1
- package/dist/tools/implementation/zodSchema/schemaTypes/PlainTextSchema.d.ts +4 -0
- package/dist/tools/implementation/zodSchema/schemaTypes/PlainTextSchema.d.ts.map +1 -1
- package/dist/tools/implementation/zodSchema/schemaTypes/RichTextSchema.d.ts +4 -0
- package/dist/tools/implementation/zodSchema/schemaTypes/RichTextSchema.d.ts.map +1 -1
- package/dist/tools/implementation/zodSchema/typeConverters/{CoFieldInit.d.ts → CoFieldSchemaInit.d.ts} +7 -7
- package/dist/tools/implementation/zodSchema/typeConverters/CoFieldSchemaInit.d.ts.map +1 -0
- package/dist/tools/implementation/zodSchema/typeConverters/InstanceOfSchema.d.ts +4 -4
- package/dist/tools/implementation/zodSchema/typeConverters/InstanceOfSchema.d.ts.map +1 -1
- package/dist/tools/implementation/zodSchema/typeConverters/InstanceOfSchemaCoValuesNullable.d.ts +4 -4
- package/dist/tools/implementation/zodSchema/typeConverters/InstanceOfSchemaCoValuesNullable.d.ts.map +1 -1
- package/dist/tools/implementation/zodSchema/zodCo.d.ts +3 -3
- package/dist/tools/implementation/zodSchema/zodCo.d.ts.map +1 -1
- package/dist/tools/internal.d.ts +2 -1
- package/dist/tools/internal.d.ts.map +1 -1
- package/dist/tools/lib/migration.d.ts +1 -1
- package/dist/tools/lib/migration.d.ts.map +1 -1
- package/dist/tools/subscribe/SubscriptionScope.d.ts.map +1 -1
- package/dist/tools/subscribe/index.d.ts +1 -1
- package/dist/tools/subscribe/index.d.ts.map +1 -1
- package/dist/tools/subscribe/utils.d.ts +2 -2
- package/dist/tools/subscribe/utils.d.ts.map +1 -1
- package/dist/tools/testing.d.ts.map +1 -1
- package/dist/tools/tests/utils.d.ts +2 -6
- package/dist/tools/tests/utils.d.ts.map +1 -1
- package/dist/worker/index.js +3 -3
- package/dist/worker/index.js.map +1 -1
- package/package.json +23 -4
- package/src/better-auth/auth/client.ts +169 -0
- package/src/better-auth/auth/react.tsx +105 -0
- package/src/better-auth/auth/server.ts +250 -0
- package/src/better-auth/auth/tests/client.test.ts +249 -0
- package/src/better-auth/auth/tests/server.test.ts +226 -0
- package/src/browser/auth/PasskeyAuth.ts +2 -2
- package/src/browser/createBrowserContext.ts +2 -2
- package/src/browser/tests/PasskeyAuth.test.ts +2 -2
- package/src/inspector/custom-element.tsx +2 -2
- package/src/inspector/viewer/new-app.tsx +1 -1
- package/src/media/create-image.test.ts +7 -7
- package/src/media/create-image.ts +5 -3
- package/src/media/index.ts +1 -1
- package/src/media/utils.test.ts +72 -66
- package/src/media/utils.ts +9 -6
- package/src/prosemirror/lib/plugin.ts +1 -1
- package/src/prosemirror/lib/sync.ts +1 -1
- package/src/prosemirror/tests/plugin.test.ts +4 -4
- package/src/react/media/image.tsx +2 -2
- package/src/react/tests/media/image.test.tsx +52 -32
- package/src/react-core/hooks.ts +11 -5
- package/src/react-core/tests/useAccount.test.ts +16 -22
- package/src/react-core/tests/useCoState.test.ts +19 -19
- package/src/react-core/tests/useInboxSender.test.ts +5 -2
- package/src/react-core/tests/usePassPhraseAuth.test.ts +6 -6
- package/src/react-native-core/media/image.tsx +1 -1
- package/src/svelte/jazz.class.svelte.ts +1 -1
- package/src/svelte/media/image.svelte +3 -9
- package/src/svelte/media/image.types.ts +7 -0
- package/src/svelte/tests/media/image.svelte.test.ts +34 -32
- package/src/tools/auth/DemoAuth.ts +2 -2
- package/src/tools/auth/PassphraseAuth.ts +2 -2
- package/src/tools/auth/clerk/index.ts +2 -2
- package/src/tools/auth/clerk/tests/JazzClerkAuth.test.ts +1 -1
- package/src/tools/coValues/CoFieldInit.ts +20 -0
- package/src/tools/coValues/CoValueBase.ts +40 -60
- package/src/tools/coValues/account.ts +311 -232
- package/src/tools/coValues/coFeed.ts +185 -153
- package/src/tools/coValues/coList.ts +507 -334
- package/src/tools/coValues/coMap.ts +434 -286
- package/src/tools/coValues/coPlainText.ts +94 -110
- package/src/tools/coValues/deepLoading.ts +13 -13
- package/src/tools/coValues/group.ts +100 -114
- package/src/tools/coValues/inbox.ts +16 -14
- package/src/tools/coValues/interfaces.ts +49 -31
- package/src/tools/coValues/profile.ts +8 -6
- package/src/tools/coValues/request.ts +9 -9
- package/src/tools/coValues/schemaUnion.ts +11 -5
- package/src/tools/exports.ts +1 -1
- package/src/tools/implementation/ContextManager.ts +4 -4
- package/src/tools/implementation/anonymousJazzAgent.ts +2 -1
- package/src/tools/implementation/createContext.ts +1 -1
- package/src/tools/implementation/devtoolsFormatters.ts +9 -9
- package/src/tools/implementation/invites.ts +2 -2
- package/src/tools/implementation/schema.ts +7 -7
- package/src/tools/implementation/symbols.ts +3 -0
- package/src/tools/implementation/zodSchema/schemaTypes/AccountSchema.ts +2 -2
- package/src/tools/implementation/zodSchema/schemaTypes/CoFeedSchema.ts +11 -2
- package/src/tools/implementation/zodSchema/schemaTypes/CoListSchema.ts +18 -7
- package/src/tools/implementation/zodSchema/schemaTypes/CoMapSchema.ts +17 -7
- package/src/tools/implementation/zodSchema/schemaTypes/CoRecordSchema.ts +20 -11
- package/src/tools/implementation/zodSchema/schemaTypes/FileStreamSchema.ts +19 -2
- package/src/tools/implementation/zodSchema/schemaTypes/PlainTextSchema.ts +6 -0
- package/src/tools/implementation/zodSchema/schemaTypes/RichTextSchema.ts +6 -0
- package/src/tools/implementation/zodSchema/typeConverters/{CoFieldInit.ts → CoFieldSchemaInit.ts} +11 -11
- package/src/tools/implementation/zodSchema/typeConverters/InstanceOfSchema.ts +4 -4
- package/src/tools/implementation/zodSchema/typeConverters/InstanceOfSchemaCoValuesNullable.ts +4 -4
- package/src/tools/implementation/zodSchema/zodCo.ts +3 -3
- package/src/tools/internal.ts +2 -1
- package/src/tools/lib/migration.ts +5 -5
- package/src/tools/subscribe/SubscriptionScope.ts +32 -24
- package/src/tools/subscribe/index.ts +4 -4
- package/src/tools/subscribe/utils.ts +11 -11
- package/src/tools/testing.ts +17 -13
- package/src/tools/tests/ContextManager.test.ts +70 -59
- package/src/tools/tests/PassphraseAuth.test.ts +2 -2
- package/src/tools/tests/account.test.ts +188 -67
- package/src/tools/tests/coDiscriminatedUnion.test-d.ts +12 -6
- package/src/tools/tests/coDiscriminatedUnion.test.ts +26 -17
- package/src/tools/tests/coFeed.test-d.ts +18 -17
- package/src/tools/tests/coFeed.test.ts +108 -97
- package/src/tools/tests/coList.test-d.ts +18 -23
- package/src/tools/tests/coList.test.ts +350 -165
- package/src/tools/tests/coMap.record.test-d.ts +9 -13
- package/src/tools/tests/coMap.record.test.ts +37 -23
- package/src/tools/tests/coMap.test-d.ts +43 -21
- package/src/tools/tests/coMap.test.ts +459 -182
- package/src/tools/tests/coOptional.test.ts +28 -13
- package/src/tools/tests/coPlainText.test.ts +15 -15
- package/src/tools/tests/createContext.test.ts +14 -14
- package/src/tools/tests/deepLoading.test.ts +95 -94
- package/src/tools/tests/exportImport.test.ts +61 -41
- package/src/tools/tests/groupsAndAccounts.test.ts +333 -116
- package/src/tools/tests/inbox.test.ts +22 -17
- package/src/tools/tests/interfaces.test.ts +12 -11
- package/src/tools/tests/invites.test.ts +6 -4
- package/src/tools/tests/load.test.ts +20 -18
- package/src/tools/tests/patterns/notifications.test.ts +7 -7
- package/src/tools/tests/patterns/quest.test.ts +3 -3
- package/src/tools/tests/patterns/requestToJoin.test.ts +22 -22
- package/src/tools/tests/request.test.ts +38 -39
- package/src/tools/tests/schemaUnion.test.ts +64 -10
- package/src/tools/tests/subscribe.test.ts +64 -64
- package/src/tools/tests/testing.test.ts +7 -11
- package/src/tools/tests/utils.ts +3 -3
- package/src/tools/tests/zod.test.ts +3 -3
- package/src/worker/index.ts +3 -3
- package/tsup.config.ts +9 -0
- package/dist/chunk-LZOF6WP5.js.map +0 -1
- package/dist/media/chunk-E5J3WLQW.js.map +0 -1
- package/dist/tools/implementation/zodSchema/typeConverters/CoFieldInit.d.ts.map +0 -1
@@ -1,18 +1,19 @@
|
|
1
1
|
import {
|
2
2
|
Account,
|
3
3
|
CoMap,
|
4
|
-
|
4
|
+
CoMapInit_DEPRECATED,
|
5
5
|
CoValueClass,
|
6
6
|
Group,
|
7
7
|
Simplify,
|
8
|
+
TypeSym,
|
8
9
|
coField,
|
9
10
|
} from "../internal.js";
|
10
11
|
|
11
12
|
/** @category Identity & Permissions */
|
12
13
|
export class Profile extends CoMap {
|
13
|
-
name = coField.string;
|
14
|
-
inbox? = coField.optional.string;
|
15
|
-
inboxInvite? = coField.optional.string;
|
14
|
+
readonly name = coField.string;
|
15
|
+
readonly inbox? = coField.optional.string;
|
16
|
+
readonly inboxInvite? = coField.optional.string;
|
16
17
|
|
17
18
|
/**
|
18
19
|
* Creates a new profile with the given initial values and owner.
|
@@ -20,10 +21,11 @@ export class Profile extends CoMap {
|
|
20
21
|
* The owner (a Group) determines access rights to the Profile.
|
21
22
|
*
|
22
23
|
* @category Creation
|
24
|
+
* @deprecated Use `co.profile(...).create` instead.
|
23
25
|
*/
|
24
26
|
static override create<M extends CoMap>(
|
25
27
|
this: CoValueClass<M>,
|
26
|
-
init: Simplify<
|
28
|
+
init: Simplify<CoMapInit_DEPRECATED<M>>,
|
27
29
|
options?:
|
28
30
|
| {
|
29
31
|
owner: Group;
|
@@ -34,7 +36,7 @@ export class Profile extends CoMap {
|
|
34
36
|
options !== undefined && "owner" in options ? options.owner : options;
|
35
37
|
|
36
38
|
// We add some guardrails to ensure that the owner of a profile is a group
|
37
|
-
if ((owner as Group | Account | undefined)?.
|
39
|
+
if ((owner as Group | Account | undefined)?.[TypeSym] === "Account") {
|
38
40
|
throw new Error("Profiles should be owned by a group");
|
39
41
|
}
|
40
42
|
|
@@ -136,7 +136,7 @@ async function serializeMessagePayload({
|
|
136
136
|
target: Account | Group;
|
137
137
|
}) {
|
138
138
|
const me = owner ?? Account.getMe();
|
139
|
-
const node = me.
|
139
|
+
const node = me.$jazz.localNode;
|
140
140
|
const crypto = node.crypto;
|
141
141
|
|
142
142
|
const agent = node.getCurrentAgent();
|
@@ -146,7 +146,7 @@ async function serializeMessagePayload({
|
|
146
146
|
const envelope = createMessageEnvelope(schema, value, me, target, type);
|
147
147
|
|
148
148
|
const contentPieces =
|
149
|
-
(await exportCoValue(schema, envelope.id, {
|
149
|
+
(await exportCoValue(schema, envelope.$jazz.id, {
|
150
150
|
resolve,
|
151
151
|
loadAs: me,
|
152
152
|
bestEffortResolution: true,
|
@@ -156,7 +156,7 @@ async function serializeMessagePayload({
|
|
156
156
|
|
157
157
|
const signPayload = crypto.secureHash({
|
158
158
|
contentPieces,
|
159
|
-
id: envelope.id,
|
159
|
+
id: envelope.$jazz.id,
|
160
160
|
createdAt,
|
161
161
|
signerID,
|
162
162
|
});
|
@@ -165,7 +165,7 @@ async function serializeMessagePayload({
|
|
165
165
|
|
166
166
|
return {
|
167
167
|
contentPieces,
|
168
|
-
id: envelope.id,
|
168
|
+
id: envelope.$jazz.id,
|
169
169
|
createdAt,
|
170
170
|
authToken,
|
171
171
|
signerID,
|
@@ -203,7 +203,7 @@ async function handleMessagePayload({
|
|
203
203
|
request: unknown;
|
204
204
|
loadAs: Account;
|
205
205
|
}) {
|
206
|
-
const node = loadAs.
|
206
|
+
const node = loadAs.$jazz.localNode;
|
207
207
|
const crypto = node.crypto;
|
208
208
|
|
209
209
|
const requestParsed = requestSchema.safeParse(request);
|
@@ -225,7 +225,7 @@ async function handleMessagePayload({
|
|
225
225
|
if (core.isAvailable()) {
|
226
226
|
const content = core.getCurrentContent() as RawCoMap;
|
227
227
|
|
228
|
-
if (content.get("$handled") === loadAs.id) {
|
228
|
+
if (content.get("$handled") === loadAs.$jazz.id) {
|
229
229
|
throw new JazzRequestError("Request payload is already handled", 400);
|
230
230
|
}
|
231
231
|
}
|
@@ -303,7 +303,7 @@ async function handleMessagePayload({
|
|
303
303
|
}
|
304
304
|
|
305
305
|
if (type === "request") {
|
306
|
-
value.
|
306
|
+
value.$jazz.raw.set("$handled", loadAs.$jazz.id);
|
307
307
|
}
|
308
308
|
|
309
309
|
return {
|
@@ -469,7 +469,7 @@ export class HttpRoute<
|
|
469
469
|
| Promise<MessageValuePayload<ResponseShape>>
|
470
470
|
| MessageValuePayload<ResponseShape>,
|
471
471
|
): Promise<Response> => {
|
472
|
-
const node = as.
|
472
|
+
const node = as.$jazz.localNode;
|
473
473
|
const body = await request.json();
|
474
474
|
const data = await handleMessagePayload({
|
475
475
|
type: "request",
|
@@ -612,7 +612,7 @@ function safeVerifySignature(
|
|
612
612
|
}
|
613
613
|
|
614
614
|
async function loadWorkerAccountOrGroup(id: string, loadAs: Account) {
|
615
|
-
const node = loadAs.
|
615
|
+
const node = loadAs.$jazz.localNode;
|
616
616
|
const coValue = await node.loadCoValueCore(id as `co_z${string}`);
|
617
617
|
|
618
618
|
if (!coValue.isAvailable()) {
|
@@ -2,11 +2,12 @@ import { JsonValue, RawCoMap } from "cojson";
|
|
2
2
|
import {
|
3
3
|
Account,
|
4
4
|
AnonymousJazzAgent,
|
5
|
-
|
5
|
+
CoMapInit_DEPRECATED,
|
6
6
|
CoValue,
|
7
7
|
CoValueBase,
|
8
8
|
CoValueClass,
|
9
9
|
CoValueFromRaw,
|
10
|
+
CoValueJazzApi,
|
10
11
|
Group,
|
11
12
|
ID,
|
12
13
|
Resolved,
|
@@ -100,9 +101,11 @@ export abstract class SchemaUnion extends CoValueBase implements CoValue {
|
|
100
101
|
discriminator: SchemaUnionDiscriminator<V>,
|
101
102
|
): SchemaUnionConcreteSubclass<V> {
|
102
103
|
return class SchemaUnionClass extends SchemaUnion {
|
104
|
+
declare $jazz: CoValueJazzApi<this>;
|
105
|
+
|
103
106
|
static override create<V extends CoValue>(
|
104
107
|
this: CoValueClass<V>,
|
105
|
-
init: Simplify<
|
108
|
+
init: Simplify<CoMapInit_DEPRECATED<V>>,
|
106
109
|
owner: Account | Group,
|
107
110
|
): V {
|
108
111
|
const ResolvedClass = discriminator(new Map(Object.entries(init)));
|
@@ -112,7 +115,7 @@ export abstract class SchemaUnion extends CoValueBase implements CoValue {
|
|
112
115
|
|
113
116
|
static override fromRaw<T extends CoValue>(
|
114
117
|
this: CoValueClass<T> & CoValueFromRaw<T>,
|
115
|
-
raw: T["
|
118
|
+
raw: T["$jazz"]["raw"],
|
116
119
|
): T {
|
117
120
|
const ResolvedClass = discriminator(
|
118
121
|
raw as RawCoMap,
|
@@ -124,7 +127,7 @@ export abstract class SchemaUnion extends CoValueBase implements CoValue {
|
|
124
127
|
|
125
128
|
static create<V extends CoValue>(
|
126
129
|
this: CoValueClass<V>,
|
127
|
-
init: Simplify<
|
130
|
+
init: Simplify<CoMapInit_DEPRECATED<V>>,
|
128
131
|
owner: Account | Group,
|
129
132
|
): V {
|
130
133
|
throw new Error("Not implemented");
|
@@ -136,7 +139,10 @@ export abstract class SchemaUnion extends CoValueBase implements CoValue {
|
|
136
139
|
*
|
137
140
|
* @internal
|
138
141
|
*/
|
139
|
-
static fromRaw<V extends CoValue>(
|
142
|
+
static fromRaw<V extends CoValue>(
|
143
|
+
this: CoValueClass<V>,
|
144
|
+
raw: V["$jazz"]["raw"],
|
145
|
+
): V {
|
140
146
|
throw new Error("Not implemented");
|
141
147
|
}
|
142
148
|
|
package/src/tools/exports.ts
CHANGED
@@ -247,7 +247,7 @@ export class JazzContextManager<
|
|
247
247
|
}
|
248
248
|
|
249
249
|
if (this.context && "me" in this.context) {
|
250
|
-
return this.context.me.id;
|
250
|
+
return this.context.me.$jazz.id;
|
251
251
|
}
|
252
252
|
|
253
253
|
throw new Error("The registration hasn't created a new account");
|
@@ -271,8 +271,8 @@ export class JazzContextManager<
|
|
271
271
|
// Using a direct connection to make coValue transfer almost synchronous
|
272
272
|
const [prevAccountAsPeer, currentAccountAsPeer] =
|
273
273
|
cojsonInternals.connectedPeers(
|
274
|
-
prevContext.me.id,
|
275
|
-
currentContext.me.id,
|
274
|
+
prevContext.me.$jazz.id,
|
275
|
+
currentContext.me.$jazz.id,
|
276
276
|
{
|
277
277
|
peer1role: "client",
|
278
278
|
peer2role: "server",
|
@@ -288,7 +288,7 @@ export class JazzContextManager<
|
|
288
288
|
|
289
289
|
try {
|
290
290
|
await this.props.onAnonymousAccountDiscarded?.(prevContext.me);
|
291
|
-
await prevContext.me.waitForAllCoValuesSync();
|
291
|
+
await prevContext.me.$jazz.waitForAllCoValuesSync();
|
292
292
|
} catch (error) {
|
293
293
|
console.error("Error onAnonymousAccountDiscarded", error);
|
294
294
|
}
|
@@ -271,7 +271,7 @@ export async function createJazzContext<
|
|
271
271
|
|
272
272
|
if (!options.newAccountProps) {
|
273
273
|
await authSecretStorage.setWithoutNotify({
|
274
|
-
accountID: context.account.id,
|
274
|
+
accountID: context.account.$jazz.id,
|
275
275
|
secretSeed,
|
276
276
|
accountSecret: context.node.getCurrentAgent().agentSecret,
|
277
277
|
provider: "anonymous",
|
@@ -1,19 +1,19 @@
|
|
1
1
|
/* istanbul ignore file -- @preserve */
|
2
2
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
3
|
-
import { ItemsSym } from "./symbols.js";
|
3
|
+
import { ItemsSym, TypeSym } from "./symbols.js";
|
4
4
|
|
5
5
|
(globalThis as any).devtoolsFormatters = [
|
6
6
|
{
|
7
7
|
header: (object: any) => {
|
8
|
-
if (object
|
8
|
+
if (object[TypeSym] === "CoMap") {
|
9
9
|
return ["div", {}, ["span", {}, object.constructor.name]];
|
10
|
-
} else if (object
|
10
|
+
} else if (object[TypeSym] === "CoList") {
|
11
11
|
return [
|
12
12
|
"div",
|
13
13
|
{},
|
14
14
|
["span", {}, object.constructor.name + "(" + object.length + ") "],
|
15
15
|
];
|
16
|
-
} else if (object
|
16
|
+
} else if (object[TypeSym] === "Account") {
|
17
17
|
return [
|
18
18
|
"div",
|
19
19
|
{},
|
@@ -22,7 +22,7 @@ import { ItemsSym } from "./symbols.js";
|
|
22
22
|
{},
|
23
23
|
object.constructor.name +
|
24
24
|
"(" +
|
25
|
-
object.
|
25
|
+
object.$jazz.refs.profile.value?.name +
|
26
26
|
(object.isMe ? " ME" : "") +
|
27
27
|
")",
|
28
28
|
],
|
@@ -35,7 +35,7 @@ import { ItemsSym } from "./symbols.js";
|
|
35
35
|
return true;
|
36
36
|
},
|
37
37
|
body: function (object: any) {
|
38
|
-
if (object
|
38
|
+
if (object[TypeSym] === "CoMap" || object[TypeSym] === "Account") {
|
39
39
|
return [
|
40
40
|
"div",
|
41
41
|
{ style: "margin-left: 15px" },
|
@@ -52,7 +52,7 @@ import { ItemsSym } from "./symbols.js";
|
|
52
52
|
"span",
|
53
53
|
{ style: "opacity: 0.5" },
|
54
54
|
` (pending ${object._schema[k].name} `,
|
55
|
-
["object", { object: object.
|
55
|
+
["object", { object: object.$jazz.refs[k] }],
|
56
56
|
")",
|
57
57
|
],
|
58
58
|
]
|
@@ -60,7 +60,7 @@ import { ItemsSym } from "./symbols.js";
|
|
60
60
|
: []),
|
61
61
|
]),
|
62
62
|
];
|
63
|
-
} else if (object
|
63
|
+
} else if (object[TypeSym] === "CoList") {
|
64
64
|
return [
|
65
65
|
"div",
|
66
66
|
{ style: "margin-left: 15px" },
|
@@ -77,7 +77,7 @@ import { ItemsSym } from "./symbols.js";
|
|
77
77
|
"span",
|
78
78
|
{ style: "opacity: 0.5" },
|
79
79
|
` (pending ${object._schema[ItemsSym].name} `,
|
80
|
-
["object", { object: object.
|
80
|
+
["object", { object: object.$jazz.refs[i] }],
|
81
81
|
")",
|
82
82
|
],
|
83
83
|
]
|
@@ -14,7 +14,7 @@ export function createInviteLink<C extends CoValue>(
|
|
14
14
|
baseURL: string,
|
15
15
|
valueHint?: string,
|
16
16
|
): string {
|
17
|
-
const coValueCore = value.
|
17
|
+
const coValueCore = value.$jazz.raw.core;
|
18
18
|
let currentCoValue = coValueCore;
|
19
19
|
|
20
20
|
while (currentCoValue.verified.header.ruleset.type === "ownedByGroup") {
|
@@ -31,7 +31,7 @@ export function createInviteLink<C extends CoValue>(
|
|
31
31
|
const inviteSecret = group.createInvite(role);
|
32
32
|
|
33
33
|
return `${baseURL}#/invite/${valueHint ? valueHint + "/" : ""}${
|
34
|
-
value.id
|
34
|
+
value.$jazz.id
|
35
35
|
}/${inviteSecret}`;
|
36
36
|
}
|
37
37
|
|
@@ -92,24 +92,24 @@ export const coField = {
|
|
92
92
|
};
|
93
93
|
|
94
94
|
function optionalRef<C extends CoValueClass>(
|
95
|
-
arg: C | ((
|
95
|
+
arg: C | ((raw: InstanceType<C>["$jazz"]["raw"]) => C),
|
96
96
|
): InstanceType<C> | null | undefined {
|
97
97
|
return ref(arg, { optional: true });
|
98
98
|
}
|
99
99
|
|
100
100
|
function ref<C extends CoValueClass>(
|
101
|
-
arg: C | ((
|
101
|
+
arg: C | ((raw: InstanceType<C>["$jazz"]["raw"]) => C),
|
102
102
|
options?: never,
|
103
103
|
): InstanceType<C> | null;
|
104
104
|
function ref<C extends CoValueClass>(
|
105
|
-
arg: C | ((
|
105
|
+
arg: C | ((raw: InstanceType<C>["$jazz"]["raw"]) => C),
|
106
106
|
options: { optional: true },
|
107
107
|
): InstanceType<C> | null | undefined;
|
108
108
|
function ref<
|
109
109
|
C extends CoValueClass,
|
110
110
|
Options extends { optional?: boolean } | undefined,
|
111
111
|
>(
|
112
|
-
arg: C | ((
|
112
|
+
arg: C | ((raw: InstanceType<C>["$jazz"]["raw"]) => C),
|
113
113
|
options?: Options,
|
114
114
|
): Options extends { optional: true }
|
115
115
|
? InstanceType<C> | null | undefined
|
@@ -164,17 +164,17 @@ export function instantiateRefEncodedFromRaw<V extends CoValue>(
|
|
164
164
|
export function instantiateRefEncodedWithInit<V extends CoValue>(
|
165
165
|
schema: RefEncoded<V>,
|
166
166
|
init: any,
|
167
|
-
parentOwner:
|
167
|
+
parentOwner: Group,
|
168
168
|
): V {
|
169
169
|
if (!isCoValueClass<V>(schema.ref)) {
|
170
170
|
throw Error(
|
171
171
|
`Cannot automatically create CoValue from value: ${JSON.stringify(init)}. Use the CoValue schema's create() method instead.`,
|
172
172
|
);
|
173
173
|
}
|
174
|
-
const node = parentOwner.
|
174
|
+
const node = parentOwner.$jazz.localNode;
|
175
175
|
const rawGroup = node.createGroup();
|
176
176
|
const owner = new Group({ fromRaw: rawGroup });
|
177
|
-
owner.addMember(parentOwner
|
177
|
+
owner.addMember(parentOwner);
|
178
178
|
// @ts-expect-error - create is a static method in all CoValue classes
|
179
179
|
return schema.ref.create(init, owner);
|
180
180
|
}
|
@@ -158,13 +158,13 @@ export interface CoreAccountSchema<
|
|
158
158
|
}
|
159
159
|
|
160
160
|
export type AccountInstance<Shape extends z.core.$ZodLooseShape> = {
|
161
|
-
|
161
|
+
readonly [key in keyof Shape]: InstanceOrPrimitiveOfSchema<Shape[key]>;
|
162
162
|
} & Account;
|
163
163
|
|
164
164
|
export type AccountInstanceCoValuesNullable<
|
165
165
|
Shape extends z.core.$ZodLooseShape,
|
166
166
|
> = {
|
167
|
-
|
167
|
+
readonly [key in keyof Shape]: InstanceOrPrimitiveOfSchemaCoValuesNullable<
|
168
168
|
Shape[key]
|
169
169
|
>;
|
170
170
|
} & Account;
|
@@ -10,7 +10,7 @@ import {
|
|
10
10
|
coOptionalDefiner,
|
11
11
|
} from "../../../internal.js";
|
12
12
|
import { AnonymousJazzAgent } from "../../anonymousJazzAgent.js";
|
13
|
-
import {
|
13
|
+
import { CoFeedSchemaInit } from "../typeConverters/CoFieldSchemaInit.js";
|
14
14
|
import { InstanceOrPrimitiveOfSchema } from "../typeConverters/InstanceOrPrimitiveOfSchema.js";
|
15
15
|
import { InstanceOrPrimitiveOfSchemaCoValuesNullable } from "../typeConverters/InstanceOrPrimitiveOfSchemaCoValuesNullable.js";
|
16
16
|
import { CoOptionalSchema } from "./CoOptionalSchema.js";
|
@@ -28,7 +28,16 @@ export class CoFeedSchema<T extends AnyZodOrCoValueSchema>
|
|
28
28
|
) {}
|
29
29
|
|
30
30
|
create(
|
31
|
-
init:
|
31
|
+
init: CoFeedSchemaInit<T>,
|
32
|
+
options?: { owner: Group } | Group,
|
33
|
+
): CoFeedInstance<T>;
|
34
|
+
/** @deprecated Creating CoValues with an Account as owner is deprecated. Use a Group instead. */
|
35
|
+
create(
|
36
|
+
init: CoFeedSchemaInit<T>,
|
37
|
+
options?: { owner: Account | Group } | Account | Group,
|
38
|
+
): CoFeedInstance<T>;
|
39
|
+
create(
|
40
|
+
init: CoFeedSchemaInit<T>,
|
32
41
|
options?: { owner: Account | Group } | Account | Group,
|
33
42
|
): CoFeedInstance<T> {
|
34
43
|
return this.coValueClass.create(init as any, options) as CoFeedInstance<T>;
|
@@ -11,7 +11,7 @@ import {
|
|
11
11
|
} from "../../../internal.js";
|
12
12
|
import { CoValueUniqueness } from "cojson";
|
13
13
|
import { AnonymousJazzAgent } from "../../anonymousJazzAgent.js";
|
14
|
-
import {
|
14
|
+
import { CoListSchemaInit } from "../typeConverters/CoFieldSchemaInit.js";
|
15
15
|
import { InstanceOrPrimitiveOfSchema } from "../typeConverters/InstanceOrPrimitiveOfSchema.js";
|
16
16
|
import { InstanceOrPrimitiveOfSchemaCoValuesNullable } from "../typeConverters/InstanceOrPrimitiveOfSchemaCoValuesNullable.js";
|
17
17
|
import { AnyZodOrCoValueSchema } from "../zodSchema.js";
|
@@ -30,12 +30,23 @@ export class CoListSchema<T extends AnyZodOrCoValueSchema>
|
|
30
30
|
) {}
|
31
31
|
|
32
32
|
create(
|
33
|
-
items:
|
33
|
+
items: CoListSchemaInit<T>,
|
34
34
|
options?:
|
35
|
-
| {
|
36
|
-
|
37
|
-
|
38
|
-
|
35
|
+
| { owner: Group; unique?: CoValueUniqueness["uniqueness"] }
|
36
|
+
| Group,
|
37
|
+
): CoListInstance<T>;
|
38
|
+
/** @deprecated Creating CoValues with an Account as owner is deprecated. Use a Group instead. */
|
39
|
+
create(
|
40
|
+
items: CoListSchemaInit<T>,
|
41
|
+
options?:
|
42
|
+
| { owner: Account | Group; unique?: CoValueUniqueness["uniqueness"] }
|
43
|
+
| Account
|
44
|
+
| Group,
|
45
|
+
): CoListInstance<T>;
|
46
|
+
create(
|
47
|
+
items: CoListSchemaInit<T>,
|
48
|
+
options?:
|
49
|
+
| { owner: Account | Group; unique?: CoValueUniqueness["uniqueness"] }
|
39
50
|
| Account
|
40
51
|
| Group,
|
41
52
|
): CoListInstance<T> {
|
@@ -82,7 +93,7 @@ export class CoListSchema<T extends AnyZodOrCoValueSchema>
|
|
82
93
|
upsertUnique<
|
83
94
|
const R extends RefsToResolve<CoListInstanceCoValuesNullable<T>> = true,
|
84
95
|
>(options: {
|
85
|
-
value:
|
96
|
+
value: CoListSchemaInit<T>;
|
86
97
|
unique: CoValueUniqueness["uniqueness"];
|
87
98
|
owner: Account | Group;
|
88
99
|
resolve?: RefsToResolveStrict<CoListInstanceCoValuesNullable<T>, R>;
|
@@ -17,7 +17,7 @@ import {
|
|
17
17
|
} from "../../../internal.js";
|
18
18
|
import { AnonymousJazzAgent } from "../../anonymousJazzAgent.js";
|
19
19
|
import { removeGetters } from "../../schemaUtils.js";
|
20
|
-
import { CoMapSchemaInit } from "../typeConverters/
|
20
|
+
import { CoMapSchemaInit } from "../typeConverters/CoFieldSchemaInit.js";
|
21
21
|
import { InstanceOrPrimitiveOfSchema } from "../typeConverters/InstanceOrPrimitiveOfSchema.js";
|
22
22
|
import { InstanceOrPrimitiveOfSchemaCoValuesNullable } from "../typeConverters/InstanceOrPrimitiveOfSchemaCoValuesNullable.js";
|
23
23
|
import { z } from "../zodReExport.js";
|
@@ -30,15 +30,25 @@ export interface CoMapSchema<
|
|
30
30
|
CatchAll extends AnyZodOrCoValueSchema | unknown = unknown,
|
31
31
|
Owner extends Account | Group = Account | Group,
|
32
32
|
> extends CoreCoMapSchema<Shape, CatchAll> {
|
33
|
-
create
|
33
|
+
create(
|
34
34
|
init: CoMapSchemaInit<Shape>,
|
35
35
|
options?:
|
36
36
|
| {
|
37
|
-
owner
|
37
|
+
owner?: Group;
|
38
|
+
unique?: CoValueUniqueness["uniqueness"];
|
39
|
+
}
|
40
|
+
| Group,
|
41
|
+
): CoMapInstanceShape<Shape, CatchAll> & CoMap;
|
42
|
+
/** @deprecated Creating CoValues with an Account as owner is deprecated. Use a Group instead. */
|
43
|
+
create(
|
44
|
+
init: CoMapSchemaInit<Shape>,
|
45
|
+
options?:
|
46
|
+
| {
|
47
|
+
owner?: Owner;
|
38
48
|
unique?: CoValueUniqueness["uniqueness"];
|
39
49
|
}
|
40
50
|
| Owner,
|
41
|
-
)
|
51
|
+
): CoMapInstanceShape<Shape, CatchAll> & CoMap;
|
42
52
|
|
43
53
|
load<
|
44
54
|
const R extends RefsToResolve<
|
@@ -298,16 +308,16 @@ export type CoMapInstanceShape<
|
|
298
308
|
Shape extends z.core.$ZodLooseShape,
|
299
309
|
CatchAll extends AnyZodOrCoValueSchema | unknown = unknown,
|
300
310
|
> = {
|
301
|
-
|
311
|
+
readonly [key in keyof Shape]: InstanceOrPrimitiveOfSchema<Shape[key]>;
|
302
312
|
} & (CatchAll extends AnyZodOrCoValueSchema
|
303
313
|
? {
|
304
|
-
[key: string]: InstanceOrPrimitiveOfSchema<CatchAll>;
|
314
|
+
readonly [key: string]: InstanceOrPrimitiveOfSchema<CatchAll>;
|
305
315
|
}
|
306
316
|
: {});
|
307
317
|
|
308
318
|
export type CoMapInstanceCoValuesNullable<Shape extends z.core.$ZodLooseShape> =
|
309
319
|
{
|
310
|
-
|
320
|
+
readonly [key in keyof Shape]: InstanceOrPrimitiveOfSchemaCoValuesNullable<
|
311
321
|
Shape[key]
|
312
322
|
>;
|
313
323
|
};
|
@@ -12,7 +12,7 @@ import {
|
|
12
12
|
SubscribeListenerOptions,
|
13
13
|
} from "../../../internal.js";
|
14
14
|
import { AnonymousJazzAgent } from "../../anonymousJazzAgent.js";
|
15
|
-
import {
|
15
|
+
import { CoFieldSchemaInit } from "../typeConverters/CoFieldSchemaInit.js";
|
16
16
|
import { InstanceOrPrimitiveOfSchema } from "../typeConverters/InstanceOrPrimitiveOfSchema.js";
|
17
17
|
import { InstanceOrPrimitiveOfSchemaCoValuesNullable } from "../typeConverters/InstanceOrPrimitiveOfSchemaCoValuesNullable.js";
|
18
18
|
import { z } from "../zodReExport.js";
|
@@ -24,25 +24,27 @@ type CoRecordInit<
|
|
24
24
|
K extends z.core.$ZodString<string>,
|
25
25
|
V extends AnyZodOrCoValueSchema,
|
26
26
|
> = {
|
27
|
-
[key in z.output<K>]:
|
27
|
+
[key in z.output<K>]: CoFieldSchemaInit<V>;
|
28
28
|
};
|
29
29
|
|
30
30
|
export interface CoRecordSchema<
|
31
31
|
K extends z.core.$ZodString<string>,
|
32
32
|
V extends AnyZodOrCoValueSchema,
|
33
33
|
> extends CoreCoRecordSchema<K, V> {
|
34
|
-
create
|
34
|
+
create(
|
35
35
|
init: Simplify<CoRecordInit<K, V>>,
|
36
36
|
options?:
|
37
|
-
| {
|
38
|
-
|
39
|
-
|
40
|
-
|
37
|
+
| { owner: Group; unique?: CoValueUniqueness["uniqueness"] }
|
38
|
+
| Group,
|
39
|
+
): CoRecordInstanceShape<K, V> & CoMap;
|
40
|
+
/** @deprecated Creating CoValues with an Account as owner is deprecated. Use a Group instead. */
|
41
|
+
create(
|
42
|
+
init: Simplify<CoRecordInit<K, V>>,
|
43
|
+
options?:
|
44
|
+
| { owner: Account | Group; unique?: CoValueUniqueness["uniqueness"] }
|
41
45
|
| Account
|
42
46
|
| Group,
|
43
|
-
)
|
44
|
-
[key in z.output<K>]: InstanceOrPrimitiveOfSchema<V>;
|
45
|
-
} & CoMap;
|
47
|
+
): CoRecordInstanceShape<K, V> & CoMap;
|
46
48
|
|
47
49
|
load<
|
48
50
|
const R extends RefsToResolve<
|
@@ -136,5 +138,12 @@ export type CoRecordInstanceCoValuesNullable<
|
|
136
138
|
K extends z.core.$ZodString<string>,
|
137
139
|
V extends AnyZodOrCoValueSchema,
|
138
140
|
> = {
|
139
|
-
[key in z.output<K>]: InstanceOrPrimitiveOfSchemaCoValuesNullable<V>;
|
141
|
+
readonly [key in z.output<K>]: InstanceOrPrimitiveOfSchemaCoValuesNullable<V>;
|
140
142
|
} & CoMap;
|
143
|
+
|
144
|
+
export type CoRecordInstanceShape<
|
145
|
+
K extends z.core.$ZodString<string>,
|
146
|
+
V extends AnyZodOrCoValueSchema,
|
147
|
+
> = {
|
148
|
+
readonly [key in z.output<K>]: InstanceOrPrimitiveOfSchema<V>;
|
149
|
+
};
|
@@ -25,15 +25,32 @@ export class FileStreamSchema implements CoreFileStreamSchema {
|
|
25
25
|
|
26
26
|
constructor(private coValueClass: typeof FileStream) {}
|
27
27
|
|
28
|
-
create(options?: { owner
|
28
|
+
create(options?: { owner: Group } | Group): FileStream;
|
29
|
+
/** @deprecated Creating CoValues with an Account as owner is deprecated. Use a Group instead. */
|
30
|
+
create(options?: { owner: Account | Group } | Account | Group): FileStream;
|
31
|
+
create(options?: { owner: Account | Group } | Account | Group): FileStream {
|
29
32
|
return this.coValueClass.create(options);
|
30
33
|
}
|
31
34
|
|
35
|
+
createFromBlob(
|
36
|
+
blob: Blob | File,
|
37
|
+
options?:
|
38
|
+
| { owner?: Group; onProgress?: (progress: number) => void }
|
39
|
+
| Group,
|
40
|
+
): Promise<FileStream>;
|
41
|
+
/** @deprecated Creating CoValues with an Account as owner is deprecated. Use a Group instead. */
|
42
|
+
createFromBlob(
|
43
|
+
blob: Blob | File,
|
44
|
+
options?:
|
45
|
+
| { owner?: Account | Group; onProgress?: (progress: number) => void }
|
46
|
+
| Account
|
47
|
+
| Group,
|
48
|
+
): Promise<FileStream>;
|
32
49
|
createFromBlob(
|
33
50
|
blob: Blob | File,
|
34
51
|
options?:
|
35
52
|
| {
|
36
|
-
owner?:
|
53
|
+
owner?: Account | Group;
|
37
54
|
onProgress?: (progress: number) => void;
|
38
55
|
}
|
39
56
|
| Account
|
@@ -26,6 +26,12 @@ export class PlainTextSchema implements CorePlainTextSchema {
|
|
26
26
|
|
27
27
|
constructor(private coValueClass: typeof CoPlainText) {}
|
28
28
|
|
29
|
+
create(text: string, options?: { owner: Group } | Group): CoPlainText;
|
30
|
+
/** @deprecated Creating CoValues with an Account as owner is deprecated. Use a Group instead. */
|
31
|
+
create(
|
32
|
+
text: string,
|
33
|
+
options?: { owner: Account | Group } | Account | Group,
|
34
|
+
): CoPlainText;
|
29
35
|
create(
|
30
36
|
text: string,
|
31
37
|
options?: { owner: Account | Group } | Account | Group,
|
@@ -25,6 +25,12 @@ export class RichTextSchema implements CoreRichTextSchema {
|
|
25
25
|
|
26
26
|
constructor(private coValueClass: typeof CoRichText) {}
|
27
27
|
|
28
|
+
create(text: string, options?: { owner: Group } | Group): CoRichText;
|
29
|
+
/** @deprecated Creating CoValues with an Account as owner is deprecated. Use a Group instead. */
|
30
|
+
create(
|
31
|
+
text: string,
|
32
|
+
options?: { owner: Account | Group } | Account | Group,
|
33
|
+
): CoRichText;
|
28
34
|
create(
|
29
35
|
text: string,
|
30
36
|
options?: { owner: Account | Group } | Account | Group,
|