@minca/core 0.1.15 → 0.1.16
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/elements/auth-styles.d.ts +1 -1
- package/dist/elements/auth-styles.d.ts.map +1 -1
- package/dist/elements/auth-styles.js +21 -4
- package/dist/elements/auth-styles.js.map +1 -1
- package/dist/elements/minca-auth.d.ts.map +1 -1
- package/dist/elements/minca-auth.js +151 -57
- package/dist/elements/minca-auth.js.map +1 -1
- package/dist/identity/abilities.d.ts +2 -0
- package/dist/identity/abilities.d.ts.map +1 -1
- package/dist/identity/abilities.js +2 -0
- package/dist/identity/abilities.js.map +1 -1
- package/dist/identity/account-vault.d.ts +15 -71
- package/dist/identity/account-vault.d.ts.map +1 -1
- package/dist/identity/account-vault.js +45 -104
- package/dist/identity/account-vault.js.map +1 -1
- package/dist/identity/channel.d.ts +3 -9
- package/dist/identity/channel.d.ts.map +1 -1
- package/dist/identity/channel.js +42 -42
- package/dist/identity/channel.js.map +1 -1
- package/dist/identity/contact-key.d.ts +14 -29
- package/dist/identity/contact-key.d.ts.map +1 -1
- package/dist/identity/contact-key.js +31 -51
- package/dist/identity/contact-key.js.map +1 -1
- package/dist/identity/crypto-p256.d.ts.map +1 -1
- package/dist/identity/crypto-p256.js +39 -53
- package/dist/identity/crypto-p256.js.map +1 -1
- package/dist/identity/hpke.d.ts.map +1 -1
- package/dist/identity/hpke.js +19 -19
- package/dist/identity/hpke.js.map +1 -1
- package/dist/identity/identity-manager.d.ts.map +1 -1
- package/dist/identity/identity-manager.js +1 -2
- package/dist/identity/identity-manager.js.map +1 -1
- package/dist/identity/policy.d.ts.map +1 -1
- package/dist/identity/policy.js +35 -61
- package/dist/identity/policy.js.map +1 -1
- package/dist/identity/recovery-code.d.ts +2 -8
- package/dist/identity/recovery-code.d.ts.map +1 -1
- package/dist/identity/recovery-code.js +4 -11
- package/dist/identity/recovery-code.js.map +1 -1
- package/dist/identity/root-signer.d.ts +1 -6
- package/dist/identity/root-signer.d.ts.map +1 -1
- package/dist/identity/root-signer.js +12 -15
- package/dist/identity/root-signer.js.map +1 -1
- package/dist/identity/ucan.d.ts.map +1 -1
- package/dist/identity/ucan.js +48 -39
- package/dist/identity/ucan.js.map +1 -1
- package/dist/identity/webauthn.d.ts +6 -11
- package/dist/identity/webauthn.d.ts.map +1 -1
- package/dist/identity/webauthn.js +18 -30
- package/dist/identity/webauthn.js.map +1 -1
- package/dist/inbox/inbox.d.ts.map +1 -1
- package/dist/inbox/inbox.js +40 -30
- package/dist/inbox/inbox.js.map +1 -1
- package/dist/inbox/index.d.ts +2 -0
- package/dist/inbox/index.d.ts.map +1 -1
- package/dist/inbox/index.js +1 -0
- package/dist/inbox/index.js.map +1 -1
- package/dist/inbox/names.d.ts +54 -0
- package/dist/inbox/names.d.ts.map +1 -0
- package/dist/inbox/names.js +299 -0
- package/dist/inbox/names.js.map +1 -0
- package/dist/index.d.ts +3 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9 -12
- package/dist/index.js.map +1 -1
- package/dist/network/mesh.d.ts +7 -20
- package/dist/network/mesh.d.ts.map +1 -1
- package/dist/network/mesh.js +267 -245
- package/dist/network/mesh.js.map +1 -1
- package/dist/network/relay-link.d.ts +31 -0
- package/dist/network/relay-link.d.ts.map +1 -0
- package/dist/network/relay-link.js +62 -0
- package/dist/network/relay-link.js.map +1 -0
- package/dist/network/relay-minca.d.ts.map +1 -1
- package/dist/network/relay-minca.js +11 -49
- package/dist/network/relay-minca.js.map +1 -1
- package/dist/network/relay-nostr.d.ts.map +1 -1
- package/dist/network/relay-nostr.js +23 -63
- package/dist/network/relay-nostr.js.map +1 -1
- package/dist/network/relay-socket.d.ts +1 -1
- package/dist/network/relay-socket.d.ts.map +1 -1
- package/dist/network/relay-socket.js +3 -1
- package/dist/network/relay-socket.js.map +1 -1
- package/dist/node/actions.d.ts.map +1 -1
- package/dist/node/actions.js +50 -38
- package/dist/node/actions.js.map +1 -1
- package/dist/node/api.d.ts +6 -0
- package/dist/node/api.d.ts.map +1 -1
- package/dist/node/api.js +6 -0
- package/dist/node/api.js.map +1 -1
- package/dist/node/carrier.d.ts +5 -0
- package/dist/node/carrier.d.ts.map +1 -1
- package/dist/node/carrier.js +94 -73
- package/dist/node/carrier.js.map +1 -1
- package/dist/node/copy.d.ts +8 -7
- package/dist/node/copy.d.ts.map +1 -1
- package/dist/node/copy.js +54 -56
- package/dist/node/copy.js.map +1 -1
- package/dist/node/host.d.ts +39 -65
- package/dist/node/host.d.ts.map +1 -1
- package/dist/node/host.js +362 -379
- package/dist/node/host.js.map +1 -1
- package/dist/node/index.d.ts +2 -2
- package/dist/node/index.d.ts.map +1 -1
- package/dist/node/index.js +1 -1
- package/dist/node/index.js.map +1 -1
- package/dist/node/node-carriers.d.ts +35 -0
- package/dist/node/node-carriers.d.ts.map +1 -0
- package/dist/node/node-carriers.js +562 -0
- package/dist/node/node-carriers.js.map +1 -0
- package/dist/node/node-contacts.d.ts +11 -0
- package/dist/node/node-contacts.d.ts.map +1 -0
- package/dist/node/node-contacts.js +808 -0
- package/dist/node/node-contacts.js.map +1 -0
- package/dist/node/node-context.d.ts +76 -0
- package/dist/node/node-context.d.ts.map +1 -0
- package/dist/node/node-context.js +54 -0
- package/dist/node/node-context.js.map +1 -0
- package/dist/node/node-hosting.d.ts +20 -0
- package/dist/node/node-hosting.d.ts.map +1 -0
- package/dist/node/node-hosting.js +449 -0
- package/dist/node/node-hosting.js.map +1 -0
- package/dist/node/node-records.d.ts +18 -0
- package/dist/node/node-records.d.ts.map +1 -0
- package/dist/node/node-records.js +262 -0
- package/dist/node/node-records.js.map +1 -0
- package/dist/node/node.d.ts.map +1 -1
- package/dist/node/node.js +198 -1990
- package/dist/node/node.js.map +1 -1
- package/dist/node/remote.d.ts +5 -6
- package/dist/node/remote.d.ts.map +1 -1
- package/dist/node/remote.js +272 -260
- package/dist/node/remote.js.map +1 -1
- package/dist/node/space-catalog.d.ts +40 -0
- package/dist/node/space-catalog.d.ts.map +1 -0
- package/dist/node/space-catalog.js +158 -0
- package/dist/node/space-catalog.js.map +1 -0
- package/dist/node/space-checks.d.ts +25 -0
- package/dist/node/space-checks.d.ts.map +1 -0
- package/dist/node/space-checks.js +343 -0
- package/dist/node/space-checks.js.map +1 -0
- package/dist/node/space-history.d.ts +37 -0
- package/dist/node/space-history.d.ts.map +1 -0
- package/dist/node/space-history.js +350 -0
- package/dist/node/space-history.js.map +1 -0
- package/dist/node/space-holding.d.ts +49 -0
- package/dist/node/space-holding.d.ts.map +1 -0
- package/dist/node/space-holding.js +267 -0
- package/dist/node/space-holding.js.map +1 -0
- package/dist/node/space-index.d.ts +41 -0
- package/dist/node/space-index.d.ts.map +1 -0
- package/dist/node/space-index.js +217 -0
- package/dist/node/space-index.js.map +1 -0
- package/dist/node/space-keys.d.ts +34 -0
- package/dist/node/space-keys.d.ts.map +1 -0
- package/dist/node/space-keys.js +309 -0
- package/dist/node/space-keys.js.map +1 -0
- package/dist/node/space-lines.d.ts +33 -0
- package/dist/node/space-lines.d.ts.map +1 -0
- package/dist/node/space-lines.js +145 -0
- package/dist/node/space-lines.js.map +1 -0
- package/dist/node/space-membership.d.ts +69 -0
- package/dist/node/space-membership.d.ts.map +1 -0
- package/dist/node/space-membership.js +242 -0
- package/dist/node/space-membership.js.map +1 -0
- package/dist/node/space-mirrors.d.ts +43 -0
- package/dist/node/space-mirrors.d.ts.map +1 -0
- package/dist/node/space-mirrors.js +125 -0
- package/dist/node/space-mirrors.js.map +1 -0
- package/dist/node/space-peers.d.ts +104 -0
- package/dist/node/space-peers.d.ts.map +1 -0
- package/dist/node/space-peers.js +595 -0
- package/dist/node/space-peers.js.map +1 -0
- package/dist/node/space-profiles.d.ts +18 -0
- package/dist/node/space-profiles.d.ts.map +1 -0
- package/dist/node/space-profiles.js +105 -0
- package/dist/node/space-profiles.js.map +1 -0
- package/dist/node/space-rules.d.ts +29 -0
- package/dist/node/space-rules.d.ts.map +1 -0
- package/dist/node/space-rules.js +144 -0
- package/dist/node/space-rules.js.map +1 -0
- package/dist/node/space-runtime.d.ts +103 -142
- package/dist/node/space-runtime.d.ts.map +1 -1
- package/dist/node/space-runtime.js +290 -3963
- package/dist/node/space-runtime.js.map +1 -1
- package/dist/node/space-standing.d.ts +20 -0
- package/dist/node/space-standing.d.ts.map +1 -0
- package/dist/node/space-standing.js +317 -0
- package/dist/node/space-standing.js.map +1 -0
- package/dist/node/space-versions.d.ts +104 -0
- package/dist/node/space-versions.d.ts.map +1 -0
- package/dist/node/space-versions.js +153 -0
- package/dist/node/space-versions.js.map +1 -0
- package/dist/node/space-warrants.d.ts +25 -0
- package/dist/node/space-warrants.d.ts.map +1 -0
- package/dist/node/space-warrants.js +214 -0
- package/dist/node/space-warrants.js.map +1 -0
- package/dist/node/space-writing.d.ts +72 -0
- package/dist/node/space-writing.d.ts.map +1 -0
- package/dist/node/space-writing.js +440 -0
- package/dist/node/space-writing.js.map +1 -0
- package/dist/node/stores.d.ts +19 -50
- package/dist/node/stores.d.ts.map +1 -1
- package/dist/node/stores.js +14 -33
- package/dist/node/stores.js.map +1 -1
- package/dist/node/types.d.ts +225 -306
- package/dist/node/types.d.ts.map +1 -1
- package/dist/node/usage.d.ts +2 -24
- package/dist/node/usage.d.ts.map +1 -1
- package/dist/node/usage.js +118 -102
- package/dist/node/usage.js.map +1 -1
- package/dist/node/watch-notifications.d.ts.map +1 -1
- package/dist/node/watch-notifications.js +32 -29
- package/dist/node/watch-notifications.js.map +1 -1
- package/dist/node/worker.d.ts +5 -6
- package/dist/node/worker.d.ts.map +1 -1
- package/dist/node/worker.js +80 -72
- package/dist/node/worker.js.map +1 -1
- package/dist/node/writer-keys.d.ts +5 -6
- package/dist/node/writer-keys.d.ts.map +1 -1
- package/dist/node/writer-keys.js +66 -57
- package/dist/node/writer-keys.js.map +1 -1
- package/dist/node/writers.d.ts +12 -19
- package/dist/node/writers.d.ts.map +1 -1
- package/dist/node/writers.js +7 -15
- package/dist/node/writers.js.map +1 -1
- package/dist/privacy/direct.d.ts.map +1 -1
- package/dist/privacy/direct.js +31 -27
- package/dist/privacy/direct.js.map +1 -1
- package/dist/privacy/space-encryption.d.ts.map +1 -1
- package/dist/privacy/space-encryption.js +5 -9
- package/dist/privacy/space-encryption.js.map +1 -1
- package/dist/query/computed.d.ts.map +1 -1
- package/dist/query/computed.js +78 -77
- package/dist/query/computed.js.map +1 -1
- package/dist/query/engine.d.ts +3 -4
- package/dist/query/engine.d.ts.map +1 -1
- package/dist/query/engine.js +93 -86
- package/dist/query/engine.js.map +1 -1
- package/dist/query/filter.d.ts +8 -10
- package/dist/query/filter.d.ts.map +1 -1
- package/dist/query/filter.js +144 -161
- package/dist/query/filter.js.map +1 -1
- package/dist/records/cel-types.d.ts.map +1 -1
- package/dist/records/cel-types.js +13 -27
- package/dist/records/cel-types.js.map +1 -1
- package/dist/records/cel.d.ts.map +1 -1
- package/dist/records/cel.js +177 -242
- package/dist/records/cel.js.map +1 -1
- package/dist/records/rules.d.ts.map +1 -1
- package/dist/records/rules.js +46 -50
- package/dist/records/rules.js.map +1 -1
- package/dist/records/topics.d.ts.map +1 -1
- package/dist/records/topics.js +18 -22
- package/dist/records/topics.js.map +1 -1
- package/dist/schemas/automations.d.ts +8 -15
- package/dist/schemas/automations.d.ts.map +1 -1
- package/dist/schemas/automations.js +203 -165
- package/dist/schemas/automations.js.map +1 -1
- package/dist/schemas/blueprints.d.ts.map +1 -1
- package/dist/schemas/blueprints.js +14 -13
- package/dist/schemas/blueprints.js.map +1 -1
- package/dist/schemas/connectors.d.ts.map +1 -1
- package/dist/schemas/connectors.js +16 -11
- package/dist/schemas/connectors.js.map +1 -1
- package/dist/schemas/contacts.d.ts +57 -0
- package/dist/schemas/contacts.d.ts.map +1 -1
- package/dist/schemas/contacts.js +32 -0
- package/dist/schemas/contacts.js.map +1 -1
- package/dist/schemas/cron.d.ts.map +1 -1
- package/dist/schemas/cron.js +27 -28
- package/dist/schemas/cron.js.map +1 -1
- package/dist/schemas/defined.d.ts +6 -0
- package/dist/schemas/defined.d.ts.map +1 -0
- package/dist/schemas/defined.js +7 -0
- package/dist/schemas/defined.js.map +1 -0
- package/dist/schemas/guides.d.ts +3 -1
- package/dist/schemas/guides.d.ts.map +1 -1
- package/dist/schemas/guides.js +13 -12
- package/dist/schemas/guides.js.map +1 -1
- package/dist/schemas/index.d.ts +2 -2
- package/dist/schemas/index.d.ts.map +1 -1
- package/dist/schemas/index.js +18 -14
- package/dist/schemas/index.js.map +1 -1
- package/dist/session/account-hint.d.ts.map +1 -1
- package/dist/session/account-hint.js +8 -5
- package/dist/session/account-hint.js.map +1 -1
- package/dist/session/auth.d.ts +36 -2
- package/dist/session/auth.d.ts.map +1 -1
- package/dist/session/auth.js +95 -2
- package/dist/session/auth.js.map +1 -1
- package/dist/session/connect.d.ts +1 -0
- package/dist/session/connect.d.ts.map +1 -1
- package/dist/session/connect.js +3 -1
- package/dist/session/connect.js.map +1 -1
- package/dist/session/credentials.d.ts +8 -26
- package/dist/session/credentials.d.ts.map +1 -1
- package/dist/session/credentials.js +14 -32
- package/dist/session/credentials.js.map +1 -1
- package/dist/session/index.d.ts +1 -0
- package/dist/session/index.d.ts.map +1 -1
- package/dist/session/index.js +1 -0
- package/dist/session/index.js.map +1 -1
- package/dist/session/pairing.d.ts.map +1 -1
- package/dist/session/pairing.js +92 -88
- package/dist/session/pairing.js.map +1 -1
- package/dist/session/password-strength.d.ts.map +1 -1
- package/dist/session/password-strength.js +37 -37
- package/dist/session/password-strength.js.map +1 -1
- package/dist/session/places.d.ts.map +1 -1
- package/dist/session/places.js +18 -13
- package/dist/session/places.js.map +1 -1
- package/dist/session/popup.d.ts +13 -0
- package/dist/session/popup.d.ts.map +1 -0
- package/dist/session/popup.js +23 -0
- package/dist/session/popup.js.map +1 -0
- package/dist/space/constitution.d.ts.map +1 -1
- package/dist/space/constitution.js +22 -29
- package/dist/space/constitution.js.map +1 -1
- package/dist/space/grants.d.ts.map +1 -1
- package/dist/space/grants.js +37 -39
- package/dist/space/grants.js.map +1 -1
- package/dist/space/invite-link.d.ts.map +1 -1
- package/dist/space/invite-link.js +33 -33
- package/dist/space/invite-link.js.map +1 -1
- package/dist/space/own-automations.d.ts +13 -24
- package/dist/space/own-automations.d.ts.map +1 -1
- package/dist/space/own-automations.js +47 -37
- package/dist/space/own-automations.js.map +1 -1
- package/dist/space/roles.d.ts +56 -80
- package/dist/space/roles.d.ts.map +1 -1
- package/dist/space/roles.js +448 -441
- package/dist/space/roles.js.map +1 -1
- package/dist/space/space-access.d.ts +3 -4
- package/dist/space/space-access.d.ts.map +1 -1
- package/dist/space/space-access.js +3 -8
- package/dist/space/space-access.js.map +1 -1
- package/dist/storage/blob/directory.d.ts.map +1 -1
- package/dist/storage/blob/directory.js +39 -32
- package/dist/storage/blob/directory.js.map +1 -1
- package/dist/storage/blob/s3.d.ts.map +1 -1
- package/dist/storage/blob/s3.js +21 -19
- package/dist/storage/blob/s3.js.map +1 -1
- package/dist/storage/blob-store.d.ts +0 -9
- package/dist/storage/blob-store.d.ts.map +1 -1
- package/dist/storage/directory-access.d.ts +8 -32
- package/dist/storage/directory-access.d.ts.map +1 -1
- package/dist/storage/directory-access.js +11 -36
- package/dist/storage/directory-access.js.map +1 -1
- package/dist/storage/encrypted-adapter.d.ts +12 -32
- package/dist/storage/encrypted-adapter.d.ts.map +1 -1
- package/dist/storage/encrypted-adapter.js +31 -54
- package/dist/storage/encrypted-adapter.js.map +1 -1
- package/dist/storage/folder-adapter.d.ts +12 -26
- package/dist/storage/folder-adapter.d.ts.map +1 -1
- package/dist/storage/folder-adapter.js +37 -54
- package/dist/storage/folder-adapter.js.map +1 -1
- package/dist/storage/folder-reconcile.d.ts +12 -26
- package/dist/storage/folder-reconcile.d.ts.map +1 -1
- package/dist/storage/folder-reconcile.js +39 -48
- package/dist/storage/folder-reconcile.js.map +1 -1
- package/dist/storage/indexeddb-adapter.d.ts +2 -6
- package/dist/storage/indexeddb-adapter.d.ts.map +1 -1
- package/dist/storage/indexeddb-adapter.js +60 -114
- package/dist/storage/indexeddb-adapter.js.map +1 -1
- package/dist/storage/mirror.d.ts +0 -29
- package/dist/storage/mirror.d.ts.map +1 -1
- package/dist/storage/mirror.js +153 -110
- package/dist/storage/mirror.js.map +1 -1
- package/dist/storage/segment.d.ts.map +1 -1
- package/dist/storage/segment.js +3 -7
- package/dist/storage/segment.js.map +1 -1
- package/dist/storage/storage-provider.d.ts +6 -11
- package/dist/storage/storage-provider.d.ts.map +1 -1
- package/dist/storage/storage-provider.js +112 -116
- package/dist/storage/storage-provider.js.map +1 -1
- package/dist/sync/sync-engine.d.ts +10 -44
- package/dist/sync/sync-engine.d.ts.map +1 -1
- package/dist/sync/sync-engine.js +245 -247
- package/dist/sync/sync-engine.js.map +1 -1
- package/dist/sync/sync-messages.d.ts +1 -1
- package/dist/sync/sync-messages.d.ts.map +1 -1
- package/dist/sync/sync-messages.js +1 -1
- package/dist/sync/sync-messages.js.map +1 -1
- package/dist/utils/guards.d.ts +1 -0
- package/dist/utils/guards.d.ts.map +1 -1
- package/dist/utils/guards.js +1 -0
- package/dist/utils/guards.js.map +1 -1
- package/dist/utils/hmac.d.ts +5 -0
- package/dist/utils/hmac.d.ts.map +1 -0
- package/dist/utils/hmac.js +20 -0
- package/dist/utils/hmac.js.map +1 -0
- package/dist/utils/map.d.ts +10 -0
- package/dist/utils/map.d.ts.map +1 -0
- package/dist/utils/map.js +30 -0
- package/dist/utils/map.js.map +1 -0
- package/dist/utils/serial.d.ts +2 -0
- package/dist/utils/serial.d.ts.map +1 -1
- package/dist/utils/serial.js +9 -0
- package/dist/utils/serial.js.map +1 -1
- package/dist/validation/capability-gate.d.ts +7 -15
- package/dist/validation/capability-gate.d.ts.map +1 -1
- package/dist/validation/capability-gate.js +32 -36
- package/dist/validation/capability-gate.js.map +1 -1
- package/dist/validation/crypto-gate.d.ts.map +1 -1
- package/dist/validation/crypto-gate.js +12 -21
- package/dist/validation/crypto-gate.js.map +1 -1
- package/docs/README.md +1 -0
- package/docs/actions.md +1 -1
- package/docs/automations.md +1 -1
- package/docs/blueprints-and-guides.md +17 -1
- package/docs/building-an-app.md +7 -4
- package/docs/collections.md +3 -3
- package/docs/contacts.md +34 -1
- package/docs/contracts.md +1 -1
- package/docs/direct-messages.md +1 -1
- package/docs/inbox.md +5 -11
- package/docs/node.md +22 -14
- package/docs/records-and-queries.md +1 -1
- package/docs/sign-in.md +54 -26
- package/docs/spaces.md +6 -6
- package/docs/standard-library.md +7 -6
- package/docs/storage.md +4 -5
- package/docs/usernames.md +161 -0
- package/docs/warrants.md +1 -1
- package/package.json +1 -1
package/dist/node/host.d.ts
CHANGED
|
@@ -3,28 +3,23 @@
|
|
|
3
3
|
* A carrier that never sleeps, for many accounts: what a hosting service runs.
|
|
4
4
|
*
|
|
5
5
|
* It is the extension's carrier (`node/carrier.ts`) with more than one carry
|
|
6
|
-
* space. Each **subscription**
|
|
7
|
-
* account made, a date it is paid until, and once a device hands it over,
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* is one space here, online for all its members.
|
|
6
|
+
* space. Each **subscription** (someone paying for hosting) is a key the
|
|
7
|
+
* account made, a date it is paid until, and once a device hands it over, the
|
|
8
|
+
* account's carry space. The spaces the carry spaces' passes name are held
|
|
9
|
+
* once, whoever asks, so a space shared by two paying members is one space here.
|
|
11
10
|
*
|
|
12
|
-
* Blind, like any carrier:
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
11
|
+
* Blind, like any carrier: no seed, no space key, no note; it signs nothing and
|
|
12
|
+
* takes in only what passes the same gates as any member's node. It learns
|
|
13
|
+
* which spaces exist, their size, when they change, and which account asked
|
|
14
|
+
* for which.
|
|
16
15
|
*
|
|
17
|
-
* A space can
|
|
18
|
-
*
|
|
19
|
-
* Anyone may pay into it; what it carries is still only ciphertext.
|
|
16
|
+
* A space can pay for itself: a subscription named `space:<id>` carries that
|
|
17
|
+
* one space from its pass, handed over by any member's device.
|
|
20
18
|
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
* free plan, and paying buys room. A space several accounts write in is free
|
|
26
|
-
* up to a line — how many accounts wrote there lately, and its size — and past
|
|
27
|
-
* it, after a grace period, only its own subscription carries it (spec 08 §1.1).
|
|
19
|
+
* With `limits`, an account's subscription needs no payment: it is on the free
|
|
20
|
+
* plan, and paying buys room. A space several accounts write in is free up to
|
|
21
|
+
* a line, and past it, after a grace period, only its own subscription carries
|
|
22
|
+
* it (spec 08 §1.1).
|
|
28
23
|
*/
|
|
29
24
|
import type { CryptoProvider } from '../types.js';
|
|
30
25
|
import type { HostLimits, OverSpace, SpaceUsage } from '../session/hosting.js';
|
|
@@ -36,10 +31,7 @@ import type { BlobStore } from '../storage/blob-store.js';
|
|
|
36
31
|
export declare const spaceSubscription: (spaceId: string) => string;
|
|
37
32
|
/** Someone paying for hosting, as the host knows them */
|
|
38
33
|
export interface Subscription {
|
|
39
|
-
/**
|
|
40
|
-
* The subscription key's DID, what every call about it is signed with; or
|
|
41
|
-
* for a space paying for itself, `space:<space id>`
|
|
42
|
-
*/
|
|
34
|
+
/** The subscription key's DID, which signs every call about it; or `space:<space id>` */
|
|
43
35
|
readonly id: string;
|
|
44
36
|
/** Unix seconds. Past it, the grace period; past that, it is dropped. */
|
|
45
37
|
readonly paidUntil: number;
|
|
@@ -51,13 +43,13 @@ export interface Subscription {
|
|
|
51
43
|
readonly space: string;
|
|
52
44
|
readonly invite: string;
|
|
53
45
|
};
|
|
54
|
-
/** For a space's own subscription: the pass a member's device handed over
|
|
46
|
+
/** For a space's own subscription: the pass a member's device handed over */
|
|
55
47
|
readonly pass?: unknown;
|
|
56
|
-
/** The payment provider's reference for whoever pays
|
|
48
|
+
/** The payment provider's reference for whoever pays; nothing else about them is kept */
|
|
57
49
|
readonly customer?: string;
|
|
58
50
|
/** A wallet payment asked for and not yet seen (`packages/cli/src/wallet.ts`) */
|
|
59
51
|
readonly invoice?: Invoice;
|
|
60
|
-
/** When one of its devices last made a signed call, unix seconds, to the day
|
|
52
|
+
/** When one of its devices last made a signed call, unix seconds, to the day */
|
|
61
53
|
readonly seen?: number;
|
|
62
54
|
}
|
|
63
55
|
/** A payment a host asked a wallet for: an exact amount, so the transfer that arrives says whose it is */
|
|
@@ -65,46 +57,38 @@ export interface Invoice {
|
|
|
65
57
|
readonly plan: string;
|
|
66
58
|
/** In the token's smallest unit, as a decimal string */
|
|
67
59
|
readonly amount: string;
|
|
68
|
-
/** When it was asked for, unix seconds
|
|
60
|
+
/** When it was asked for, unix seconds: a transfer made before it pays nothing */
|
|
69
61
|
readonly at: number;
|
|
70
62
|
}
|
|
71
63
|
export type SubscriptionState = 'active' | 'grace' | 'lapsed';
|
|
64
|
+
type Changes = {
|
|
65
|
+
over: string[];
|
|
66
|
+
stopped: string[];
|
|
67
|
+
under: string[];
|
|
68
|
+
};
|
|
72
69
|
export interface HostConfig {
|
|
73
|
-
/** The host's own key
|
|
70
|
+
/** The host's own key: who it is to peers */
|
|
74
71
|
readonly key: CryptoKeyPair;
|
|
75
72
|
readonly stores: StoreFactory;
|
|
76
73
|
readonly network?: NodeNetworkConfig;
|
|
77
74
|
readonly provider?: CryptoProvider;
|
|
78
75
|
/** Days a lapsed subscription is kept, carried, before it is dropped. Default 30. */
|
|
79
76
|
readonly graceDays?: number;
|
|
80
|
-
/** Every subscription counts as paid
|
|
77
|
+
/** Every subscription counts as paid: for someone hosting only themselves, and for trying it out */
|
|
81
78
|
readonly free?: boolean;
|
|
82
|
-
/**
|
|
83
|
-
* The accounts this host carries for, and no others — someone hosting only
|
|
84
|
-
* themselves and their family. Absent: any account whose subscription is paid.
|
|
85
|
-
*/
|
|
79
|
+
/** The accounts this host carries for, and no others. Absent: any account whose subscription is paid. */
|
|
86
80
|
readonly allow?: ReadonlyArray<string>;
|
|
87
81
|
/** Unix seconds now; for tests */
|
|
88
82
|
readonly now?: () => number;
|
|
89
83
|
/**
|
|
90
|
-
* The host's bucket (`storage/blob/s3.ts`): every carried space
|
|
91
|
-
* there too,
|
|
92
|
-
* host's disk is then only a cache — lose it, and everything comes back.
|
|
93
|
-
* A space nobody pays for any more is deleted from it.
|
|
84
|
+
* The host's bucket (`storage/blob/s3.ts`): every carried space and the
|
|
85
|
+
* subscriptions are kept there too, so the host's disk is only a cache.
|
|
94
86
|
*/
|
|
95
87
|
readonly mirror?: BlobStore;
|
|
96
88
|
readonly watchIntervalMs?: number;
|
|
97
|
-
/**
|
|
98
|
-
* Whether the subscription an account's carry space belongs to may take no
|
|
99
|
-
* more spaces: what it carries stays, and a space its account adds later
|
|
100
|
-
* waits until this says no. The host's storage limit, its own policy.
|
|
101
|
-
*/
|
|
89
|
+
/** Whether a carry space's subscription may take no more spaces: the host's storage limit */
|
|
102
90
|
readonly full?: (carrySpace: string) => boolean;
|
|
103
|
-
/**
|
|
104
|
-
* Free hosting within limits: an account's subscription needs no payment,
|
|
105
|
-
* and a community past the free line pays for itself (spec 08 §1.1).
|
|
106
|
-
* Ignored with `free`.
|
|
107
|
-
*/
|
|
91
|
+
/** Free hosting within limits (spec 08 §1.1). Ignored with `free`. */
|
|
108
92
|
readonly limits?: HostLimits;
|
|
109
93
|
/** How many bytes a carried space takes: what the free line's `bytes` reads */
|
|
110
94
|
readonly measure?: (spaceId: string) => Promise<number>;
|
|
@@ -134,31 +118,20 @@ export declare function createHostNode(config: HostConfig): Promise<Readonly<{
|
|
|
134
118
|
/** The limits it keeps to, or null when it has none */
|
|
135
119
|
limits: HostLimits | null;
|
|
136
120
|
/**
|
|
137
|
-
* Whether a subscription's spaces take more than its room
|
|
138
|
-
*
|
|
139
|
-
* a whole window of fitting, so a dip under for an hour starts nothing anew.
|
|
121
|
+
* Whether a subscription's spaces take more than its room. The notice runs
|
|
122
|
+
* from when they first did, and goes only after a whole window of fitting.
|
|
140
123
|
*/
|
|
141
124
|
setFull(id: string, over: boolean): Promise<void>;
|
|
142
125
|
/** Whether a subscription is past its notice of being over its room */
|
|
143
126
|
outOfRoom: (subscription: Subscription) => boolean;
|
|
144
|
-
/**
|
|
145
|
-
* Holds back these solo spaces of a subscription's for want of room, and
|
|
146
|
-
* no others of its: the host keeps them, unserved, until they fit.
|
|
147
|
-
*/
|
|
127
|
+
/** Holds back these solo spaces of a subscription's for want of room, and no others: kept, unserved, until they fit */
|
|
148
128
|
holdForRoom(id: string, spaceIds: ReadonlyArray<string>): Promise<void>;
|
|
149
|
-
/**
|
|
150
|
-
* Stops carrying a subscription's carry space, which is over its room by
|
|
151
|
-
* itself past its notice, and turns it away until the host's owner says.
|
|
152
|
-
*/
|
|
129
|
+
/** Stops carrying a carry space over its room by itself past its notice, until the host's owner says */
|
|
153
130
|
refuse(id: string): Promise<void>;
|
|
154
131
|
seen(id: string): Promise<void>;
|
|
155
132
|
/** A session key proved it reads a carried space: counted, though readers only ever hint */
|
|
156
133
|
read(spaceId: string, session: string): void;
|
|
157
|
-
evaluate: () => Promise<
|
|
158
|
-
over: string[];
|
|
159
|
-
stopped: string[];
|
|
160
|
-
under: string[];
|
|
161
|
-
}>;
|
|
134
|
+
evaluate: () => Promise<Changes>;
|
|
162
135
|
/** The spaces over the free line that a subscription names, or its own space when it is one */
|
|
163
136
|
overFor(id: string): Promise<ReadonlyArray<OverSpace>>;
|
|
164
137
|
/** How a space is used, as a status says it; null at a host without limits */
|
|
@@ -168,11 +141,11 @@ export declare function createHostNode(config: HostConfig): Promise<Readonly<{
|
|
|
168
141
|
since: number;
|
|
169
142
|
until: number;
|
|
170
143
|
} | null;
|
|
171
|
-
/** Whether members' subscriptions hold a space back, being past the free line
|
|
144
|
+
/** Whether members' subscriptions hold a space back, being past the free line */
|
|
172
145
|
heldBack: (spaceId: string) => boolean;
|
|
173
146
|
/** Whether a space pays for itself now, so no account's room counts it */
|
|
174
147
|
paysItself: (spaceId: string) => Promise<boolean>;
|
|
175
|
-
/** Moves a subscription's paid-until date
|
|
148
|
+
/** Moves a subscription's paid-until date: the one thing payments do */
|
|
176
149
|
extend(id: string, until: number, customer?: string): Promise<Subscription>;
|
|
177
150
|
/** Sets a paid-until date outright, earlier too: what a fund's estimate says as it is spent */
|
|
178
151
|
setPaidUntil(id: string, until: number): Promise<Subscription>;
|
|
@@ -210,4 +183,5 @@ export declare function createHostNode(config: HostConfig): Promise<Readonly<{
|
|
|
210
183
|
subscribeEvents: (listener: (event: CarrierEvent) => void) => () => void;
|
|
211
184
|
close(): Promise<void>;
|
|
212
185
|
}>>;
|
|
186
|
+
export {};
|
|
213
187
|
//# sourceMappingURL=host.d.ts.map
|
package/dist/node/host.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"host.d.ts","sourceRoot":"","sources":["../../src/node/host.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"host.d.ts","sourceRoot":"","sources":["../../src/node/host.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,OAAO,KAAK,EAAE,cAAc,EAA2B,MAAM,aAAa,CAAC;AAC3E,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAM/E,OAAO,EAAmB,KAAK,YAAY,EAAE,MAAM,cAAc,CAAC;AAClE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AACpD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAS1D,wDAAwD;AACxD,eAAO,MAAM,iBAAiB,YAAa,MAAM,WAA6C,CAAC;AAE/F,yDAAyD;AACzD,MAAM,WAAW,YAAY;IAC3B,yFAAyF;IACzF,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,yEAAyE;IACzE,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,qCAAqC;IACrC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IAC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