@minca/core 0.1.15 → 0.1.17
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 +10 -10
- 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 +35 -9
- 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 +169 -72
- 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/network/ws-transport.d.ts.map +1 -1
- package/dist/network/ws-transport.js +3 -0
- package/dist/network/ws-transport.js.map +1 -1
- package/dist/node/actions.d.ts +2 -0
- package/dist/node/actions.d.ts.map +1 -1
- package/dist/node/actions.js +89 -58
- package/dist/node/actions.js.map +1 -1
- package/dist/node/api.d.ts +7 -0
- package/dist/node/api.d.ts.map +1 -1
- package/dist/node/api.js +7 -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 +567 -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 +456 -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 +199 -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 +53 -0
- package/dist/node/space-holding.d.ts.map +1 -0
- package/dist/node/space-holding.js +339 -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 +629 -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 +107 -140
- package/dist/node/space-runtime.d.ts.map +1 -1
- package/dist/node/space-runtime.js +331 -3985
- 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 +74 -0
- package/dist/node/space-writing.d.ts.map +1 -0
- package/dist/node/space-writing.js +442 -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 +243 -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/schemas/library/social.d.ts +258 -0
- package/dist/schemas/library/social.d.ts.map +1 -1
- package/dist/schemas/library/social.js +28 -1
- package/dist/schemas/library/social.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/hosting.d.ts.map +1 -1
- package/dist/session/hosting.js +8 -2
- package/dist/session/hosting.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/presets.d.ts +2 -2
- package/dist/space/presets.d.ts.map +1 -1
- package/dist/space/presets.js +3 -2
- package/dist/space/presets.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 +32 -25
- package/docs/agents.md +28 -16
- package/docs/automations.md +1 -1
- package/docs/blueprints-and-guides.md +37 -5
- 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 +6 -2
- package/docs/inbox.md +5 -11
- package/docs/node.md +54 -22
- package/docs/records-and-queries.md +1 -1
- package/docs/sign-in.md +54 -26
- package/docs/spaces.md +9 -8
- package/docs/standard-library.md +37 -14
- package/docs/storage.md +5 -6
- package/docs/usernames.md +161 -0
- package/docs/warrants.md +1 -1
- package/package.json +1 -2
package/dist/schemas/cron.js
CHANGED
|
@@ -29,42 +29,41 @@ function cronField(text, min, max) {
|
|
|
29
29
|
}
|
|
30
30
|
/** Why a cron version can't be read, or null */
|
|
31
31
|
export function checkCron(version) {
|
|
32
|
+
const read = readCron(version);
|
|
33
|
+
return typeof read === 'string' ? read : null;
|
|
34
|
+
}
|
|
35
|
+
/** Whether a cron version names this minute, in local time. As in cron, a day and a weekday both given means either. */
|
|
36
|
+
export function cronMatches(version, at) {
|
|
37
|
+
const read = readCron(version);
|
|
38
|
+
return typeof read !== 'string' && read(at);
|
|
39
|
+
}
|
|
40
|
+
/** A schedule as a test for a minute, or why it can't be read */
|
|
41
|
+
function readCron(version) {
|
|
32
42
|
const parts = version.trim().split(/\s+/);
|
|
33
43
|
if (parts.length !== 5)
|
|
34
44
|
return 'A schedule is five fields: minute hour day month weekday';
|
|
45
|
+
const allowed = new Map();
|
|
35
46
|
for (const [index, field] of CRON_FIELDS.entries()) {
|
|
36
47
|
const read = cronField(parts[index] ?? '', field.min, field.max);
|
|
37
48
|
if (typeof read === 'string')
|
|
38
49
|
return `${field.name}: ${read}`;
|
|
50
|
+
allowed.set(field.name, read);
|
|
39
51
|
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
return
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
if (!minute.has(at.getMinutes()) || !hour.has(at.getHours()) || !month.has(at.getMonth() + 1))
|
|
56
|
-
return false;
|
|
57
|
-
const anyDay = parts[2] === '*';
|
|
58
|
-
const anyWeekday = parts[4] === '*';
|
|
59
|
-
const onDay = day.has(at.getDate());
|
|
60
|
-
const onWeekday = weekday.has(at.getDay());
|
|
61
|
-
if (anyDay && anyWeekday)
|
|
62
|
-
return true;
|
|
63
|
-
if (anyDay)
|
|
64
|
-
return onWeekday;
|
|
65
|
-
if (anyWeekday)
|
|
66
|
-
return onDay;
|
|
67
|
-
return onDay || onWeekday;
|
|
52
|
+
// Sunday is 0 or 7.
|
|
53
|
+
if (allowed.get('weekday')?.has(7))
|
|
54
|
+
allowed.get('weekday')?.add(0);
|
|
55
|
+
const has = (name, value) => allowed.get(name)?.has(value) ?? false;
|
|
56
|
+
// Only when both are narrowed does either one do.
|
|
57
|
+
const narrowed = parts[2] !== '*' && parts[4] !== '*';
|
|
58
|
+
return (at) => {
|
|
59
|
+
const onDay = has('day', at.getDate());
|
|
60
|
+
const onWeekday = has('weekday', at.getDay());
|
|
61
|
+
const dayMatches = narrowed ? onDay || onWeekday : onDay && onWeekday;
|
|
62
|
+
return (has('minute', at.getMinutes()) &&
|
|
63
|
+
has('hour', at.getHours()) &&
|
|
64
|
+
has('month', at.getMonth() + 1) &&
|
|
65
|
+
dayMatches);
|
|
66
|
+
};
|
|
68
67
|
}
|
|
69
68
|
/** Times people pick most, in words, for a builder to offer before five cron fields */
|
|
70
69
|
export const SCHEDULES = [
|
package/dist/schemas/cron.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cron.js","sourceRoot":"","sources":["../../src/schemas/cron.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,WAAW,GAAG;IAClB,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE;IACnC,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE;IACjC,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE;IAChC,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE;IAClC,EAAE,IAAI,EAAE,SAAS,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE;CAC3B,CAAC;AAEX,qEAAqE;AACrE,SAAS,SAAS,CAAC,IAAY,EAAE,GAAW,EAAE,GAAW;IACvD,MAAM,OAAO,GAAG,IAAI,GAAG,EAAU,CAAC;IAClC,KAAK,MAAM,IAAI,IAAI,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC;QACnC,MAAM,KAAK,GAAG,qCAAqC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC/D,IAAI,CAAC,KAAK;YAAE,OAAO,IAAI,IAAI,yCAAyC,CAAC;QACrE,MAAM,CAAC,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,CAAC,GAAG,KAA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ACpD,EAAE,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,YAAY,EAAE;CAC5C,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { NodeCollection, P2PNode } from '../node/types.js';
|
|
2
|
+
/** The names of the collections that have a definition, not only records */
|
|
3
|
+
export declare const definedIn: (collections: ReadonlyArray<NodeCollection>) => ReadonlySet<string>;
|
|
4
|
+
/** The names of the collections a space has a definition for */
|
|
5
|
+
export declare function definedNames(node: P2PNode, space: string): Promise<ReadonlySet<string>>;
|
|
6
|
+
//# sourceMappingURL=defined.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"defined.d.ts","sourceRoot":"","sources":["../../src/schemas/defined.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAEhE,4EAA4E;AAC5E,eAAO,MAAM,SAAS,gBAAiB,aAAa,CAAC,cAAc,CAAC,KAAG,WAAW,CAAC,MAAM,CACd,CAAC;AAE5E,gEAAgE;AAChE,wBAAsB,YAAY,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,CAE7F"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** The names of the collections that have a definition, not only records */
|
|
2
|
+
export const definedIn = (collections) => new Set(collections.filter((c) => c.version !== null).map((c) => c.name));
|
|
3
|
+
/** The names of the collections a space has a definition for */
|
|
4
|
+
export async function definedNames(node, space) {
|
|
5
|
+
return definedIn(await node.collections.list(space));
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=defined.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"defined.js","sourceRoot":"","sources":["../../src/schemas/defined.ts"],"names":[],"mappings":"AAEA,4EAA4E;AAC5E,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,WAA0C,EAAuB,EAAE,CAC3F,IAAI,GAAG,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,KAAK,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;AAE5E,gEAAgE;AAChE,MAAM,CAAC,KAAK,UAAU,YAAY,CAAC,IAAa,EAAE,KAAa;IAC7D,OAAO,SAAS,CAAC,MAAM,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;AACvD,CAAC"}
|
package/dist/schemas/guides.d.ts
CHANGED
|
@@ -13,12 +13,14 @@
|
|
|
13
13
|
*/
|
|
14
14
|
import type { NodeRecord, P2PNode } from '../node/types.js';
|
|
15
15
|
import { type Guide } from './library/collections.js';
|
|
16
|
+
type GuideRecord = NodeRecord<Guide>;
|
|
16
17
|
/** The space's guides, by the collections they are about */
|
|
17
|
-
export declare function guidesOf(node: P2PNode, spaceId: string): Promise<ReadonlyMap<string, ReadonlyArray<
|
|
18
|
+
export declare function guidesOf(node: P2PNode, spaceId: string): Promise<ReadonlyMap<string, ReadonlyArray<GuideRecord>>>;
|
|
18
19
|
/**
|
|
19
20
|
* Writes a guide, or rewrites it when the space has one of that name that this
|
|
20
21
|
* account wrote and it says something else. One someone else wrote holds the
|
|
21
22
|
* name: theirs stays. Defines `std.guide` first when the space lacks it.
|
|
22
23
|
*/
|
|
23
24
|
export declare function writeGuide(node: P2PNode, spaceId: string, body: Guide): Promise<void>;
|
|
25
|
+
export {};
|
|
24
26
|
//# sourceMappingURL=guides.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"guides.d.ts","sourceRoot":"","sources":["../../src/schemas/guides.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC5D,OAAO,EAAS,KAAK,KAAK,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"guides.d.ts","sourceRoot":"","sources":["../../src/schemas/guides.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC5D,OAAO,EAAS,KAAK,KAAK,EAAE,MAAM,0BAA0B,CAAC;AAG7D,KAAK,WAAW,GAAG,UAAU,CAAC,KAAK,CAAC,CAAC;AAErC,4DAA4D;AAC5D,wBAAsB,QAAQ,CAC5B,IAAI,EAAE,OAAO,EACb,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,WAAW,CAAC,MAAM,EAAE,aAAa,CAAC,WAAW,CAAC,CAAC,CAAC,CAU1D;AAED;;;;GAIG;AACH,wBAAsB,UAAU,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,GAAG,OAAO,CAAC,IAAI,CAAC,CAS3F"}
|
package/dist/schemas/guides.js
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import { guide } from './library/collections.js';
|
|
2
|
+
import { definedNames } from './defined.js';
|
|
2
3
|
/** The space's guides, by the collections they are about */
|
|
3
4
|
export async function guidesOf(node, spaceId) {
|
|
4
|
-
const records = await node.records.list(spaceId, { collection: guide.name });
|
|
5
5
|
const about = new Map();
|
|
6
|
-
for (const record of
|
|
7
|
-
for (const name of record.body?.collections ?? [])
|
|
8
|
-
|
|
6
|
+
for (const record of await listGuides(node, spaceId)) {
|
|
7
|
+
for (const name of record.body?.collections ?? []) {
|
|
8
|
+
const list = about.get(name) ?? [];
|
|
9
|
+
list.push(record);
|
|
10
|
+
about.set(name, list);
|
|
11
|
+
}
|
|
9
12
|
}
|
|
10
13
|
return about;
|
|
11
14
|
}
|
|
@@ -15,18 +18,16 @@ export async function guidesOf(node, spaceId) {
|
|
|
15
18
|
* name: theirs stays. Defines `std.guide` first when the space lacks it.
|
|
16
19
|
*/
|
|
17
20
|
export async function writeGuide(node, spaceId, body) {
|
|
18
|
-
|
|
19
|
-
if (!collections.some((c) => c.name === guide.name && c.version !== null))
|
|
21
|
+
if (!(await definedNames(node, spaceId)).has(guide.name))
|
|
20
22
|
await node.collections.define(spaceId, guide);
|
|
21
|
-
const held = (await node
|
|
23
|
+
const held = (await listGuides(node, spaceId)).find((record) => record.body?.name === body.name);
|
|
22
24
|
if (!held) {
|
|
23
25
|
await node.records.put(spaceId, guide, body);
|
|
24
26
|
return;
|
|
25
27
|
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
return;
|
|
30
|
-
await node.records.update(spaceId, held.key, body);
|
|
28
|
+
const unchanged = JSON.stringify(held.body) === JSON.stringify(body);
|
|
29
|
+
if (held.createdBy === node.did && !unchanged)
|
|
30
|
+
await node.records.update(spaceId, held.key, body);
|
|
31
31
|
}
|
|
32
|
+
const listGuides = (node, spaceId) => node.records.list(spaceId, { collection: guide.name });
|
|
32
33
|
//# sourceMappingURL=guides.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"guides.js","sourceRoot":"","sources":["../../src/schemas/guides.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,KAAK,EAAc,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"guides.js","sourceRoot":"","sources":["../../src/schemas/guides.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,KAAK,EAAc,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAI5C,4DAA4D;AAC5D,MAAM,CAAC,KAAK,UAAU,QAAQ,CAC5B,IAAa,EACb,OAAe;IAEf,MAAM,KAAK,GAAG,IAAI,GAAG,EAAyB,CAAC;IAC/C,KAAK,MAAM,MAAM,IAAI,MAAM,UAAU,CAAC,IAAI,EAAE,OAAO,CAAC,EAAE,CAAC;QACrD,KAAK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ACpG,CAAC;AAED,MAAM,UAAU,GAAG,CAAC,IAAa,EAAE,OAAe,EAAE,EAAE,CACpD,IAAI,CAAC,OAAO,CAAC,IAAI,CAAQ,OAAO,EAAE,EAAE,UAAU,EAAE,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC"}
|
package/dist/schemas/index.d.ts
CHANGED
|
@@ -63,8 +63,8 @@ export declare function positionBetween(before?: string | null, after?: string |
|
|
|
63
63
|
* A space you cannot write in is skipped.
|
|
64
64
|
*/
|
|
65
65
|
export declare function useSchemas(node: P2PNode, spaceId: string, schemas: ReadonlyArray<DefineCollection>): Promise<void>;
|
|
66
|
-
export { contact, contactRequest, inbox, knock } from './contacts.js';
|
|
67
|
-
export type { Contact, ContactRequestRecord, Inbox, Knock } from './contacts.js';
|
|
66
|
+
export { contact, contactRequest, inbox, knock, spaceInvite } from './contacts.js';
|
|
67
|
+
export type { Contact, ContactRequestRecord, Inbox, Knock, SpaceInviteRecord } from './contacts.js';
|
|
68
68
|
export * from './library/collections.js';
|
|
69
69
|
export { checkBlueprint, reviewBlueprint, standardCollections, supersededBlueprints, proposeCollections, applyBlueprint, copyBlueprint, } from './blueprints.js';
|
|
70
70
|
export { guidesOf, writeGuide } from './guides.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/schemas/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,OAAO,KAAK,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/schemas/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,OAAO,KAAK,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAElE,cAAc,0BAA0B,CAAC;AACzC,cAAc,q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EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EACL,UAAU,EACV,aAAa,EACb,QAAQ,EACR,eAAe,EACf,sBAAsB,EACtB,SAAS,EACT,WAAW,EACX,EAAE,EACF,EAAE,EACF,QAAQ,EACR,QAAQ,EACR,eAAe,EACf,YAAY,EACZ,QAAQ,EACR,GAAG,EACH,cAAc,EACd,gBAAgB,EAChB,cAAc,EACd,oBAAoB,EACpB,kBAAkB,GACnB,MAAM,kBAAkB,CAAC;AAC1B,YAAY,EACV,gBAAgB,EAChB,UAAU,EACV,gBAAgB,EAChB,cAAc,EACd,eAAe,EACf,aAAa,EACb,aAAa,EACb,gBAAgB,EAChB,QAAQ,EACR,aAAa,EACb,iBAAiB,EACjB,cAAc,EACd,kBAAkB,EAClB,qBAAqB,EACrB,uBAAuB,GACxB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,OAAO,EACP,SAAS,EACT,uBAAuB,EACvB,YAAY,EACZ,eAAe,EACf,WAAW,EACX,WAAW,EACX,oBAAoB,EACpB,YAAY,EACZ,aAAa,GACd,MAAM,iBAAiB,CAAC;AACzB,YAAY,EAAE,WAAW,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACnF,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAC9D,YAAY,EAAE,eAAe,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACxF,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AACvE,YAAY,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC"}
|
package/dist/schemas/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { definedNames } from './defined.js';
|
|
1
2
|
export * from './library/annotations.js';
|
|
2
3
|
export * from './library/social.js';
|
|
3
4
|
export * from './library/publishing.js';
|
|
@@ -22,23 +23,26 @@ export function positionBetween(before, after) {
|
|
|
22
23
|
let b = after && after > a ? after : null;
|
|
23
24
|
let out = '';
|
|
24
25
|
for (let i = 0;; i++) {
|
|
25
|
-
const low =
|
|
26
|
-
const high = b
|
|
27
|
-
|
|
28
|
-
out += DIGITS[low];
|
|
29
|
-
continue;
|
|
30
|
-
}
|
|
31
|
-
// At an open end, step by one rather than halving, so a list that only
|
|
32
|
-
// ever grows at the end (or the start) keeps short positions.
|
|
33
|
-
const open = i < a.length ? (b === null ? 'after' : null) : b !== null ? 'before' : null;
|
|
34
|
-
const mid = open === 'after' ? low + 1 : open === 'before' ? high - 1 : Math.floor((low + high) / 2);
|
|
26
|
+
const low = digitAt(a, i);
|
|
27
|
+
const high = b === null ? DIGITS.length : digitAt(b, i);
|
|
28
|
+
const mid = middleDigit(low, high, i < a.length, b !== null);
|
|
35
29
|
if (mid > low && mid < high)
|
|
36
30
|
return out + DIGITS[mid];
|
|
37
|
-
// Adjacent digits: keep the lower one, and anything above the rest of `a` will do.
|
|
38
31
|
out += DIGITS[low];
|
|
39
|
-
|
|
32
|
+
// Adjacent digits: keep the lower one, and anything above the rest of `a` will do.
|
|
33
|
+
if (low !== high)
|
|
34
|
+
b = null;
|
|
40
35
|
}
|
|
41
36
|
}
|
|
37
|
+
const digitAt = (text, i) => (i < text.length ? DIGITS.indexOf(text[i]) : 0);
|
|
38
|
+
/** At an open end, step by one rather than halving, so a list that only grows at one end keeps short positions */
|
|
39
|
+
function middleDigit(low, high, insideBefore, bounded) {
|
|
40
|
+
if (insideBefore && !bounded)
|
|
41
|
+
return low + 1;
|
|
42
|
+
if (!insideBefore && bounded)
|
|
43
|
+
return high - 1;
|
|
44
|
+
return Math.floor((low + high) / 2);
|
|
45
|
+
}
|
|
42
46
|
/**
|
|
43
47
|
* Makes sure a space knows these collections: defines the ones it has no
|
|
44
48
|
* definition for, and leaves the rest alone — so calling it every time a
|
|
@@ -49,13 +53,13 @@ export async function useSchemas(node, spaceId, schemas) {
|
|
|
49
53
|
const summary = await node.spaces.get(spaceId);
|
|
50
54
|
if (!summary?.writable)
|
|
51
55
|
return;
|
|
52
|
-
const known =
|
|
56
|
+
const known = await definedNames(node, spaceId);
|
|
53
57
|
for (const schema of schemas) {
|
|
54
58
|
if (!known.has(schema.name))
|
|
55
59
|
await node.collections.define(spaceId, schema);
|
|
56
60
|
}
|
|
57
61
|
}
|
|
58
|
-
export { contact, contactRequest, inbox, knock } from './contacts.js';
|
|
62
|
+
export { contact, contactRequest, inbox, knock, spaceInvite } from './contacts.js';
|
|
59
63
|
export * from './library/collections.js';
|
|
60
64
|
export { checkBlueprint, reviewBlueprint, standardCollections, supersededBlueprints, proposeCollections, applyBlueprint, copyBlueprint, } from './blueprints.js';
|
|
61
65
|
export { guidesOf, writeGuide } from './guides.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/schemas/index.ts"],"names":[],"mappings":"AAsCA,cAAc,0BAA0B,CAAC;AACzC,cAAc,qBAAqB,CAAC;AACpC,cAAc,yBAAyB,CAAC;AACxC,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,wBAAwB,CAAC;AACvC,OAAO,EACL,eAAe,EACf,OAAO,EACP,MAAM,EACN,QAAQ,EACR,UAAU,EACV,OAAO,EACP,WAAW,EACX,UAAU,GAEX,MAAM,UAAU,CAAC;AAClB,+GAA+G;AAC/G,OAAO,KAAK,SAAS,MAAM,gBAAgB,CAAC;AAG5C,OAAO,EACL,mBAAmB,EACnB,cAAc,EACd,aAAa,EACb,eAAe,EACf,kBAAkB,GACnB,MAAM,eAAe,CAAC;AAEvB,MAAM,MAAM,GAAG,sCAAsC,CAAC;AAEtD;;;;;GAKG;AACH,MAAM,UAAU,eAAe,CAAC,MAAsB,EAAE,KAAqB;IAC3E,MAAM,CAAC,GAAG,MAAM,IA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E9D,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC"}
|
|
@@ -161,6 +161,141 @@ export declare const profile: {
|
|
|
161
161
|
readonly bot?: boolean | undefined;
|
|
162
162
|
}>;
|
|
163
163
|
export type Profile = BodyOf<typeof profile>;
|
|
164
|
+
/**
|
|
165
|
+
* How the space presents itself, as `std.profile` is how someone does: what
|
|
166
|
+
* apps show in place of the name its constitution was founded with, and a
|
|
167
|
+
* picture. One record per space: it names the space it is of, and `onePer`
|
|
168
|
+
* that gives every writer the same shared key, so changing it is editing it,
|
|
169
|
+
* and which edit stands is the versions' order, never a writer's clock. A
|
|
170
|
+
* reader takes only the one whose `space` is the space it is in. Who may
|
|
171
|
+
* write it is the space's grants, so the presets leave it to those who keep
|
|
172
|
+
* order (`STAFF_COLLECTIONS`).
|
|
173
|
+
*/
|
|
174
|
+
export declare const spaceProfile: {
|
|
175
|
+
readonly name: "std.space-profile";
|
|
176
|
+
readonly title: "Space profile";
|
|
177
|
+
readonly description: "How the space presents itself: its name, a line about it and its picture. One per space: \"space\" is its id.";
|
|
178
|
+
readonly schema: {
|
|
179
|
+
readonly type: "object";
|
|
180
|
+
readonly properties: {
|
|
181
|
+
readonly space: {
|
|
182
|
+
readonly type: "string";
|
|
183
|
+
readonly minLength: 1;
|
|
184
|
+
readonly maxLength: 256;
|
|
185
|
+
readonly description: "The space it presents: its id";
|
|
186
|
+
};
|
|
187
|
+
readonly name: {
|
|
188
|
+
type: 'string';
|
|
189
|
+
minLength?: number | undefined;
|
|
190
|
+
maxLength: number;
|
|
191
|
+
};
|
|
192
|
+
readonly bio: {
|
|
193
|
+
type: 'string';
|
|
194
|
+
minLength?: number | undefined;
|
|
195
|
+
maxLength: number;
|
|
196
|
+
};
|
|
197
|
+
readonly avatar: {
|
|
198
|
+
type: 'object';
|
|
199
|
+
properties: {
|
|
200
|
+
hash: {
|
|
201
|
+
type: 'string';
|
|
202
|
+
minLength: number;
|
|
203
|
+
maxLength: number;
|
|
204
|
+
};
|
|
205
|
+
size: {
|
|
206
|
+
type: 'integer';
|
|
207
|
+
minimum: number;
|
|
208
|
+
};
|
|
209
|
+
mime: {
|
|
210
|
+
type: 'string';
|
|
211
|
+
minLength?: number | undefined;
|
|
212
|
+
maxLength: number;
|
|
213
|
+
};
|
|
214
|
+
name: {
|
|
215
|
+
type: 'string';
|
|
216
|
+
minLength?: number | undefined;
|
|
217
|
+
maxLength: number;
|
|
218
|
+
};
|
|
219
|
+
key: {
|
|
220
|
+
type: 'string';
|
|
221
|
+
minLength: number;
|
|
222
|
+
maxLength: number;
|
|
223
|
+
};
|
|
224
|
+
salt: {
|
|
225
|
+
type: 'string';
|
|
226
|
+
minLength: number;
|
|
227
|
+
maxLength: number;
|
|
228
|
+
};
|
|
229
|
+
};
|
|
230
|
+
required: readonly ["hash", "size", "mime"];
|
|
231
|
+
} & {
|
|
232
|
+
readonly 'x-kind': "file";
|
|
233
|
+
};
|
|
234
|
+
readonly banner: {
|
|
235
|
+
type: 'object';
|
|
236
|
+
properties: {
|
|
237
|
+
hash: {
|
|
238
|
+
type: 'string';
|
|
239
|
+
minLength: number;
|
|
240
|
+
maxLength: number;
|
|
241
|
+
};
|
|
242
|
+
size: {
|
|
243
|
+
type: 'integer';
|
|
244
|
+
minimum: number;
|
|
245
|
+
};
|
|
246
|
+
mime: {
|
|
247
|
+
type: 'string';
|
|
248
|
+
minLength?: number | undefined;
|
|
249
|
+
maxLength: number;
|
|
250
|
+
};
|
|
251
|
+
name: {
|
|
252
|
+
type: 'string';
|
|
253
|
+
minLength?: number | undefined;
|
|
254
|
+
maxLength: number;
|
|
255
|
+
};
|
|
256
|
+
key: {
|
|
257
|
+
type: 'string';
|
|
258
|
+
minLength: number;
|
|
259
|
+
maxLength: number;
|
|
260
|
+
};
|
|
261
|
+
salt: {
|
|
262
|
+
type: 'string';
|
|
263
|
+
minLength: number;
|
|
264
|
+
maxLength: number;
|
|
265
|
+
};
|
|
266
|
+
};
|
|
267
|
+
required: readonly ["hash", "size", "mime"];
|
|
268
|
+
} & {
|
|
269
|
+
readonly 'x-kind': "file";
|
|
270
|
+
};
|
|
271
|
+
};
|
|
272
|
+
readonly required: readonly ["space"];
|
|
273
|
+
};
|
|
274
|
+
readonly rules: {
|
|
275
|
+
readonly onePer: readonly ["space"];
|
|
276
|
+
};
|
|
277
|
+
} & import("../../index.js").Typed<{
|
|
278
|
+
readonly space: string;
|
|
279
|
+
readonly name?: string | undefined;
|
|
280
|
+
readonly bio?: string | undefined;
|
|
281
|
+
readonly avatar?: {
|
|
282
|
+
readonly hash: string;
|
|
283
|
+
readonly size: number;
|
|
284
|
+
readonly mime: string;
|
|
285
|
+
readonly name?: string | undefined;
|
|
286
|
+
readonly key?: string | undefined;
|
|
287
|
+
readonly salt?: string | undefined;
|
|
288
|
+
} | undefined;
|
|
289
|
+
readonly banner?: {
|
|
290
|
+
readonly hash: string;
|
|
291
|
+
readonly size: number;
|
|
292
|
+
readonly mime: string;
|
|
293
|
+
readonly name?: string | undefined;
|
|
294
|
+
readonly key?: string | undefined;
|
|
295
|
+
readonly salt?: string | undefined;
|
|
296
|
+
} | undefined;
|
|
297
|
+
}>;
|
|
298
|
+
export type SpaceProfileRecord = BodyOf<typeof spaceProfile>;
|
|
164
299
|
/**
|
|
165
300
|
* A person who may not be on Minca: a subset of JSContact (RFC 9553). For
|
|
166
301
|
* people who are, `std.contact` keeps their DID.
|
|
@@ -678,6 +813,129 @@ export declare const socialGroups: {
|
|
|
678
813
|
readonly url: string;
|
|
679
814
|
}[] | undefined;
|
|
680
815
|
readonly bot?: boolean | undefined;
|
|
816
|
+
}>) | ({
|
|
817
|
+
readonly name: "std.space-profile";
|
|
818
|
+
readonly title: "Space profile";
|
|
819
|
+
readonly description: "How the space presents itself: its name, a line about it and its picture. One per space: \"space\" is its id.";
|
|
820
|
+
readonly schema: {
|
|
821
|
+
readonly type: "object";
|
|
822
|
+
readonly properties: {
|
|
823
|
+
readonly space: {
|
|
824
|
+
readonly type: "string";
|
|
825
|
+
readonly minLength: 1;
|
|
826
|
+
readonly maxLength: 256;
|
|
827
|
+
readonly description: "The space it presents: its id";
|
|
828
|
+
};
|
|
829
|
+
readonly name: {
|
|
830
|
+
type: 'string';
|
|
831
|
+
minLength?: number | undefined;
|
|
832
|
+
maxLength: number;
|
|
833
|
+
};
|
|
834
|
+
readonly bio: {
|
|
835
|
+
type: 'string';
|
|
836
|
+
minLength?: number | undefined;
|
|
837
|
+
maxLength: number;
|
|
838
|
+
};
|
|
839
|
+
readonly avatar: {
|
|
840
|
+
type: 'object';
|
|
841
|
+
properties: {
|
|
842
|
+
hash: {
|
|
843
|
+
type: 'string';
|
|
844
|
+
minLength: number;
|
|
845
|
+
maxLength: number;
|
|
846
|
+
};
|
|
847
|
+
size: {
|
|
848
|
+
type: 'integer';
|
|
849
|
+
minimum: number;
|
|
850
|
+
};
|
|
851
|
+
mime: {
|
|
852
|
+
type: 'string';
|
|
853
|
+
minLength?: number | undefined;
|
|
854
|
+
maxLength: number;
|
|
855
|
+
};
|
|
856
|
+
name: {
|
|
857
|
+
type: 'string';
|
|
858
|
+
minLength?: number | undefined;
|
|
859
|
+
maxLength: number;
|
|
860
|
+
};
|
|
861
|
+
key: {
|
|
862
|
+
type: 'string';
|
|
863
|
+
minLength: number;
|
|
864
|
+
maxLength: number;
|
|
865
|
+
};
|
|
866
|
+
salt: {
|
|
867
|
+
type: 'string';
|
|
868
|
+
minLength: number;
|
|
869
|
+
maxLength: number;
|
|
870
|
+
};
|
|
871
|
+
};
|
|
872
|
+
required: readonly ["hash", "size", "mime"];
|
|
873
|
+
} & {
|
|
874
|
+
readonly 'x-kind': "file";
|
|
875
|
+
};
|
|
876
|
+
readonly banner: {
|
|
877
|
+
type: 'object';
|
|
878
|
+
properties: {
|
|
879
|
+
hash: {
|
|
880
|
+
type: 'string';
|
|
881
|
+
minLength: number;
|
|
882
|
+
maxLength: number;
|
|
883
|
+
};
|
|
884
|
+
size: {
|
|
885
|
+
type: 'integer';
|
|
886
|
+
minimum: number;
|
|
887
|
+
};
|
|
888
|
+
mime: {
|
|
889
|
+
type: 'string';
|
|
890
|
+
minLength?: number | undefined;
|
|
891
|
+
maxLength: number;
|
|
892
|
+
};
|
|
893
|
+
name: {
|
|
894
|
+
type: 'string';
|
|
895
|
+
minLength?: number | undefined;
|
|
896
|
+
maxLength: number;
|
|
897
|
+
};
|
|
898
|
+
key: {
|
|
899
|
+
type: 'string';
|
|
900
|
+
minLength: number;
|
|
901
|
+
maxLength: number;
|
|
902
|
+
};
|
|
903
|
+
salt: {
|
|
904
|
+
type: 'string';
|
|
905
|
+
minLength: number;
|
|
906
|
+
maxLength: number;
|
|
907
|
+
};
|
|
908
|
+
};
|
|
909
|
+
required: readonly ["hash", "size", "mime"];
|
|
910
|
+
} & {
|
|
911
|
+
readonly 'x-kind': "file";
|
|
912
|
+
};
|
|
913
|
+
};
|
|
914
|
+
readonly required: readonly ["space"];
|
|
915
|
+
};
|
|
916
|
+
readonly rules: {
|
|
917
|
+
readonly onePer: readonly ["space"];
|
|
918
|
+
};
|
|
919
|
+
} & import("../../index.js").Typed<{
|
|
920
|
+
readonly space: string;
|
|
921
|
+
readonly name?: string | undefined;
|
|
922
|
+
readonly bio?: string | undefined;
|
|
923
|
+
readonly avatar?: {
|
|
924
|
+
readonly hash: string;
|
|
925
|
+
readonly size: number;
|
|
926
|
+
readonly mime: string;
|
|
927
|
+
readonly name?: string | undefined;
|
|
928
|
+
readonly key?: string | undefined;
|
|
929
|
+
readonly salt?: string | undefined;
|
|
930
|
+
} | undefined;
|
|
931
|
+
readonly banner?: {
|
|
932
|
+
readonly hash: string;
|
|
933
|
+
readonly size: number;
|
|
934
|
+
readonly mime: string;
|
|
935
|
+
readonly name?: string | undefined;
|
|
936
|
+
readonly key?: string | undefined;
|
|
937
|
+
readonly salt?: string | undefined;
|
|
938
|
+
} | undefined;
|
|
681
939
|
}>) | ({
|
|
682
940
|
readonly name: "std.card";
|
|
683
941
|
readonly title: "Contact card";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"social.d.ts","sourceRoot":"","sources":["../../../src/schemas/library/social.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAEnD;;;;;;;GAOG;AACH,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAiBI,KAAK;;;;;wBAAa,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAQ3C,CAAC;AACH,MAAM,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,OAAO,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"social.d.ts","sourceRoot":"","sources":["../../../src/schemas/library/social.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAEnD;;;;;;;GAOG;AACH,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAiBI,KAAK;;;;;wBAAa,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAQ3C,CAAC;AACH,MAAM,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,OAAO,CAAC,CAAC;AAE7C;;;;;;;;;GASG;AACH,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiBvB,CAAC;AACH,MAAM,MAAM,kBAAkB,GAAG,MAAM,CAAC,OAAO,YAAY,CAAC,C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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4BAtIgB,KAAK;;;;;4BAAa,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAiEvB,IAAI;;;;;wBAAa,KAAK;;;;;wBAAa,MAAM;;;;;;;;0BAvBvD,OAAO;;;8BAGL,QAAQ;;;;;;;;;;;;;;;;;;0BAHV,OAAO;;;8BAGL,QAAQ;;;;;;;;;;;;;;;;;;0BAHV,OAAO;;;8BAGL,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gBA2CA,GAAG;;;;;;;gBAA6B,KAAK;;;;;;;;;;;;;;;;;;;;;;gBAenC,GAAG;;;;;;;gBAAY,KAAK;;;;;;;;;;;;;;;;;;;;;;;gBAuBtB,IAAI;;;;;gBAAa,KAAK;;;;;gBAAY,KAAK;;;;;;;;;;;;;;;;;CASxD,CAAC"}
|
|
@@ -38,6 +38,33 @@ export const profile = define({
|
|
|
38
38
|
},
|
|
39
39
|
rules: { onePer: ['@author'] },
|
|
40
40
|
});
|
|
41
|
+
/**
|
|
42
|
+
* How the space presents itself, as `std.profile` is how someone does: what
|
|
43
|
+
* apps show in place of the name its constitution was founded with, and a
|
|
44
|
+
* picture. One record per space: it names the space it is of, and `onePer`
|
|
45
|
+
* that gives every writer the same shared key, so changing it is editing it,
|
|
46
|
+
* and which edit stands is the versions' order, never a writer's clock. A
|
|
47
|
+
* reader takes only the one whose `space` is the space it is in. Who may
|
|
48
|
+
* write it is the space's grants, so the presets leave it to those who keep
|
|
49
|
+
* order (`STAFF_COLLECTIONS`).
|
|
50
|
+
*/
|
|
51
|
+
export const spaceProfile = define({
|
|
52
|
+
name: 'std.space-profile',
|
|
53
|
+
title: 'Space profile',
|
|
54
|
+
description: 'How the space presents itself: its name, a line about it and its picture. One per space: "space" is its id.',
|
|
55
|
+
schema: {
|
|
56
|
+
type: 'object',
|
|
57
|
+
properties: {
|
|
58
|
+
space: { type: 'string', minLength: 1, maxLength: 256, description: 'The space it presents: its id' },
|
|
59
|
+
name: text(100),
|
|
60
|
+
bio: text(2000),
|
|
61
|
+
avatar: blob(),
|
|
62
|
+
banner: blob(),
|
|
63
|
+
},
|
|
64
|
+
required: ['space'],
|
|
65
|
+
},
|
|
66
|
+
rules: { onePer: ['space'] },
|
|
67
|
+
});
|
|
41
68
|
const labelled = (value, required) => ({
|
|
42
69
|
type: 'array',
|
|
43
70
|
maxItems: 16,
|
|
@@ -115,6 +142,6 @@ export const status = define({
|
|
|
115
142
|
});
|
|
116
143
|
/** This file's part of `standardGroups` */
|
|
117
144
|
export const socialGroups = {
|
|
118
|
-
People: [profile, card, follow, block, mute, status],
|
|
145
|
+
People: [profile, spaceProfile, card, follow, block, mute, status],
|
|
119
146
|
};
|
|
120
147
|
//# sourceMappingURL=social.js.map
|