@minca/core 0.1.14 → 0.1.15
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/README.md +2 -2
- package/dist/files/space-files.d.ts +15 -3
- package/dist/files/space-files.d.ts.map +1 -1
- package/dist/files/space-files.js +225 -37
- package/dist/files/space-files.js.map +1 -1
- package/dist/network/relay-minca.d.ts +12 -1
- package/dist/network/relay-minca.d.ts.map +1 -1
- package/dist/network/relay-minca.js +14 -6
- package/dist/network/relay-minca.js.map +1 -1
- package/dist/network/relay-nostr.d.ts +14 -3
- package/dist/network/relay-nostr.d.ts.map +1 -1
- package/dist/network/relay-nostr.js +11 -9
- package/dist/network/relay-nostr.js.map +1 -1
- package/dist/network/relays.d.ts +26 -17
- package/dist/network/relays.d.ts.map +1 -1
- package/dist/network/relays.js +21 -28
- package/dist/network/relays.js.map +1 -1
- package/dist/network/rendezvous.d.ts +1 -1
- package/dist/network/rendezvous.d.ts.map +1 -1
- package/dist/network/rendezvous.js +2 -2
- package/dist/network/rendezvous.js.map +1 -1
- package/dist/node/actions.d.ts.map +1 -1
- package/dist/node/actions.js +6 -1
- package/dist/node/actions.js.map +1 -1
- package/dist/node/node.d.ts.map +1 -1
- package/dist/node/node.js +7 -7
- package/dist/node/node.js.map +1 -1
- package/dist/node/space-runtime.d.ts +1 -1
- package/dist/node/space-runtime.d.ts.map +1 -1
- package/dist/node/space-runtime.js +17 -5
- package/dist/node/space-runtime.js.map +1 -1
- package/dist/node/types.d.ts +4 -3
- package/dist/node/types.d.ts.map +1 -1
- package/dist/schema/collection-def.d.ts.map +1 -1
- package/dist/schema/collection-def.js +16 -5
- package/dist/schema/collection-def.js.map +1 -1
- package/dist/schemas/automations.d.ts +8 -0
- package/dist/schemas/automations.d.ts.map +1 -1
- package/dist/schemas/connectors.d.ts +12 -0
- package/dist/schemas/connectors.d.ts.map +1 -1
- package/dist/schemas/fragments.d.ts +22 -2
- package/dist/schemas/fragments.d.ts.map +1 -1
- package/dist/schemas/fragments.js +20 -12
- package/dist/schemas/fragments.js.map +1 -1
- package/dist/schemas/library/annotations.d.ts +30 -0
- package/dist/schemas/library/annotations.d.ts.map +1 -1
- package/dist/schemas/library/annotations.js +1 -0
- package/dist/schemas/library/annotations.js.map +1 -1
- package/dist/schemas/library/community.d.ts +28 -0
- package/dist/schemas/library/community.d.ts.map +1 -1
- package/dist/schemas/library/life.d.ts +62 -2
- package/dist/schemas/library/life.d.ts.map +1 -1
- package/dist/schemas/library/media.d.ts +36 -0
- package/dist/schemas/library/media.d.ts.map +1 -1
- package/dist/schemas/library/money.d.ts +74 -2
- package/dist/schemas/library/money.d.ts.map +1 -1
- package/dist/schemas/library/planning.d.ts +56 -0
- package/dist/schemas/library/planning.d.ts.map +1 -1
- package/dist/schemas/library/publishing.d.ts +80 -4
- package/dist/schemas/library/publishing.d.ts.map +1 -1
- package/dist/schemas/library/social.d.ts +44 -0
- package/dist/schemas/library/social.d.ts.map +1 -1
- package/docs/README.md +2 -2
- package/docs/actions.md +47 -20
- package/docs/blueprints-and-guides.md +41 -13
- package/docs/building-an-app.md +4 -4
- package/docs/collections.md +31 -3
- package/docs/node.md +14 -12
- package/docs/standard-library.md +26 -25
- package/docs/storage.md +33 -10
- package/package.json +2 -21
- package/dist/calls/calls.d.ts +0 -140
- package/dist/calls/calls.d.ts.map +0 -1
- package/dist/calls/calls.js +0 -861
- package/dist/calls/calls.js.map +0 -1
- package/dist/calls/index.d.ts +0 -4
- package/dist/calls/index.d.ts.map +0 -1
- package/dist/calls/index.js +0 -3
- package/dist/calls/index.js.map +0 -1
- package/dist/react/context.d.ts +0 -81
- package/dist/react/context.d.ts.map +0 -1
- package/dist/react/context.js +0 -97
- package/dist/react/context.js.map +0 -1
- package/dist/react/follow.d.ts +0 -11
- package/dist/react/follow.d.ts.map +0 -1
- package/dist/react/follow.js +0 -7
- package/dist/react/follow.js.map +0 -1
- package/dist/react/index.d.ts +0 -44
- package/dist/react/index.d.ts.map +0 -1
- package/dist/react/index.js +0 -40
- package/dist/react/index.js.map +0 -1
- package/dist/react/minca-auth.d.ts +0 -19
- package/dist/react/minca-auth.d.ts.map +0 -1
- package/dist/react/minca-auth.js +0 -36
- package/dist/react/minca-auth.js.map +0 -1
- package/dist/react/use-calls.d.ts +0 -21
- package/dist/react/use-calls.d.ts.map +0 -1
- package/dist/react/use-calls.js +0 -39
- package/dist/react/use-calls.js.map +0 -1
- package/dist/react/use-invite-link.d.ts +0 -24
- package/dist/react/use-invite-link.d.ts.map +0 -1
- package/dist/react/use-invite-link.js +0 -62
- package/dist/react/use-invite-link.js.map +0 -1
- package/dist/react/use-live.d.ts +0 -16
- package/dist/react/use-live.d.ts.map +0 -1
- package/dist/react/use-live.js +0 -56
- package/dist/react/use-live.js.map +0 -1
- package/dist/react/use-my-name.d.ts +0 -12
- package/dist/react/use-my-name.d.ts.map +0 -1
- package/dist/react/use-my-name.js +0 -38
- package/dist/react/use-my-name.js.map +0 -1
- package/dist/react/use-names.d.ts +0 -7
- package/dist/react/use-names.d.ts.map +0 -1
- package/dist/react/use-names.js +0 -13
- package/dist/react/use-names.js.map +0 -1
- package/dist/react/use-network.d.ts +0 -9
- package/dist/react/use-network.d.ts.map +0 -1
- package/dist/react/use-network.js +0 -33
- package/dist/react/use-network.js.map +0 -1
- package/dist/react/use-query.d.ts +0 -14
- package/dist/react/use-query.d.ts.map +0 -1
- package/dist/react/use-query.js +0 -26
- package/dist/react/use-query.js.map +0 -1
- package/dist/react/use-space.d.ts +0 -29
- package/dist/react/use-space.d.ts.map +0 -1
- package/dist/react/use-space.js +0 -57
- package/dist/react/use-space.js.map +0 -1
- package/dist/react/use-spaces.d.ts +0 -29
- package/dist/react/use-spaces.d.ts.map +0 -1
- package/dist/react/use-spaces.js +0 -78
- package/dist/react/use-spaces.js.map +0 -1
- package/docs/calls.md +0 -189
|
@@ -49,7 +49,7 @@ import { checkFoundingRole, definitionBody, KEY_CHANGE, readDefinition, RECORD_D
|
|
|
49
49
|
import { FOUNDER } from '../space/space-manager.js';
|
|
50
50
|
import { createSyncEngine } from '../sync/sync-engine.js';
|
|
51
51
|
import { SYNC_PROTOCOL_VERSION } from '../sync/sync-messages.js';
|
|
52
|
-
import { createSpaceFiles } from '../files/space-files.js';
|
|
52
|
+
import { createSpaceFiles, DEVICE_LIMITS } from '../files/space-files.js';
|
|
53
53
|
import { fileRefsIn, MAX_FILES } from '../files/file-id.js';
|
|
54
54
|
import { CATALOG_COLLECTION, checkStoredCollection, isStoredCollection, toJsonSchema, validateJsonSchema, } from '../schema/collection-def.js';
|
|
55
55
|
import { CARRIER_COLLECTION, MEMBERSHIP_COLLECTION, PROFILE_COLLECTION, isAvatarRef, } from '../space/account-registry.js';
|
|
@@ -1596,8 +1596,16 @@ export async function openSpaceRuntime(deps) {
|
|
|
1596
1596
|
if (collection.startsWith('sys.'))
|
|
1597
1597
|
return null;
|
|
1598
1598
|
const described = await definitionOf(collection);
|
|
1599
|
-
if (described)
|
|
1600
|
-
|
|
1599
|
+
if (described) {
|
|
1600
|
+
// A schema the validator can't build (a bad $id in an annotation, say)
|
|
1601
|
+
// checks nothing, like a definition that is invalid (spec 02 §6.1).
|
|
1602
|
+
try {
|
|
1603
|
+
return validateJsonSchema(described.schema, body);
|
|
1604
|
+
}
|
|
1605
|
+
catch {
|
|
1606
|
+
return null;
|
|
1607
|
+
}
|
|
1608
|
+
}
|
|
1601
1609
|
if (schemas.getCollection(collection)) {
|
|
1602
1610
|
const checked = await schemas.validate(collection, body);
|
|
1603
1611
|
return (checked.issues ?? []).map((issue) => ({ path: '/', message: issue.message }));
|
|
@@ -1806,8 +1814,7 @@ export async function openSpaceRuntime(deps) {
|
|
|
1806
1814
|
filesTimer = null;
|
|
1807
1815
|
filesPass = (async () => {
|
|
1808
1816
|
await spaceFiles?.tidy();
|
|
1809
|
-
|
|
1810
|
-
await spaceFiles?.fetchAll();
|
|
1817
|
+
await spaceFiles?.fetchMissing();
|
|
1811
1818
|
})()
|
|
1812
1819
|
.catch(() => {
|
|
1813
1820
|
// A peer or mirror out of reach; the next change tries again.
|
|
@@ -2272,6 +2279,8 @@ export async function openSpaceRuntime(deps) {
|
|
|
2272
2279
|
const standing = await standingOf(version);
|
|
2273
2280
|
return standing.ok || !!standing.withdrawn;
|
|
2274
2281
|
},
|
|
2282
|
+
// Files follow records: every file a version kept whole names is fetched, within a device's limits.
|
|
2283
|
+
...(deps.fetchFiles === 'all' ? {} : { limits: DEVICE_LIMITS }),
|
|
2275
2284
|
});
|
|
2276
2285
|
const sync = createSyncEngine({
|
|
2277
2286
|
storageProvider: storage,
|
|
@@ -2488,6 +2497,9 @@ export async function openSpaceRuntime(deps) {
|
|
|
2488
2497
|
sync.addPeer(info.did);
|
|
2489
2498
|
// Reconcile at once rather than waiting for the heartbeat.
|
|
2490
2499
|
sync.notifyPeers([info.did]);
|
|
2500
|
+
// It may hold a file nobody else had.
|
|
2501
|
+
spaceFiles?.joined(info.did);
|
|
2502
|
+
filesChanged();
|
|
2491
2503
|
emit({ type: 'status', space: space.id });
|
|
2492
2504
|
// The key may have changed between checking it and letting it in.
|
|
2493
2505
|
void letGoOfOutsiders().catch(() => { });
|