@weaveprotocol/core 0.2.1 → 0.2.3
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 +67 -46
- package/dist/doors/doors.d.ts +1 -1
- 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 +13 -0
- package/dist/elements/auth-styles.js.map +1 -1
- package/dist/elements/weave-auth.d.ts +2 -2
- package/dist/elements/weave-auth.d.ts.map +1 -1
- package/dist/elements/weave-auth.js +251 -119
- package/dist/elements/weave-auth.js.map +1 -1
- package/dist/identity/account-vault.d.ts +10 -3
- package/dist/identity/account-vault.d.ts.map +1 -1
- package/dist/identity/account-vault.js +10 -3
- package/dist/identity/account-vault.js.map +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/network/mailbox.d.ts +1 -1
- package/dist/network/mailbox.js +1 -1
- package/dist/network/peer-auth.d.ts +19 -0
- package/dist/network/peer-auth.d.ts.map +1 -1
- package/dist/network/peer-auth.js +22 -8
- package/dist/network/peer-auth.js.map +1 -1
- package/dist/node/actions.d.ts.map +1 -1
- package/dist/node/actions.js +9 -2
- package/dist/node/actions.js.map +1 -1
- package/dist/node/carrier.d.ts +16 -0
- package/dist/node/carrier.d.ts.map +1 -1
- package/dist/node/carrier.js +12 -0
- package/dist/node/carrier.js.map +1 -1
- package/dist/node/host.d.ts +2 -2
- package/dist/node/host.d.ts.map +1 -1
- package/dist/node/index.d.ts +3 -3
- package/dist/node/index.d.ts.map +1 -1
- package/dist/node/node.js +1 -1
- package/dist/node/node.js.map +1 -1
- package/dist/node/space-runtime.d.ts.map +1 -1
- package/dist/node/space-runtime.js +9 -1
- package/dist/node/space-runtime.js.map +1 -1
- package/dist/node/types.d.ts +6 -2
- package/dist/node/types.d.ts.map +1 -1
- package/dist/records/describe.d.ts +2 -0
- package/dist/records/describe.d.ts.map +1 -1
- package/dist/records/describe.js +5 -0
- package/dist/records/describe.js.map +1 -1
- package/dist/schema/collection-def.d.ts +16 -0
- package/dist/schema/collection-def.d.ts.map +1 -1
- package/dist/schema/collection-def.js +30 -0
- package/dist/schema/collection-def.js.map +1 -1
- package/dist/schemas/apps.d.ts +4 -1
- package/dist/schemas/apps.d.ts.map +1 -1
- package/dist/schemas/apps.js +8 -2
- package/dist/schemas/apps.js.map +1 -1
- package/dist/schemas/index.d.ts +1 -1
- package/dist/schemas/index.d.ts.map +1 -1
- package/dist/schemas/index.js +1 -1
- package/dist/schemas/index.js.map +1 -1
- package/dist/schemas/screens.d.ts +16 -4
- package/dist/schemas/screens.d.ts.map +1 -1
- package/dist/schemas/screens.js +49 -6
- package/dist/schemas/screens.js.map +1 -1
- package/dist/session/auth.d.ts +56 -10
- package/dist/session/auth.d.ts.map +1 -1
- package/dist/session/auth.js +247 -69
- package/dist/session/auth.js.map +1 -1
- package/dist/session/connect.d.ts +57 -3
- package/dist/session/connect.d.ts.map +1 -1
- package/dist/session/connect.js +49 -6
- package/dist/session/connect.js.map +1 -1
- package/dist/session/connection.d.ts +8 -1
- package/dist/session/connection.d.ts.map +1 -1
- package/dist/session/connection.js +6 -1
- package/dist/session/connection.js.map +1 -1
- package/dist/session/credentials.d.ts +22 -6
- package/dist/session/credentials.d.ts.map +1 -1
- package/dist/session/credentials.js +35 -6
- package/dist/session/credentials.js.map +1 -1
- package/dist/session/hosting.d.ts +1 -1
- package/dist/session/index.d.ts +5 -5
- package/dist/session/index.d.ts.map +1 -1
- package/dist/session/index.js +3 -3
- package/dist/session/index.js.map +1 -1
- package/dist/space/notify.d.ts +59 -1
- package/dist/space/notify.d.ts.map +1 -1
- package/dist/space/notify.js +91 -0
- package/dist/space/notify.js.map +1 -1
- package/dist/storage/blob/s3.js +1 -1
- package/package.json +52 -42
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"credentials.d.ts","sourceRoot":"","sources":["../../src/session/credentials.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAOH;;;;;;;;;;;GAWG;AACH,wBAAsB,WAAW,CAAC,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAW/F;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE1D;AAED
|
|
1
|
+
{"version":3,"file":"credentials.d.ts","sourceRoot":"","sources":["../../src/session/credentials.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAOH;;;;;;;;;;;GAWG;AACH,wBAAsB,WAAW,CAAC,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAW/F;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE1D;AAED;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEzD;AAED;;;;;;;;GAQG;AACH,wBAAgB,WAAW,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAoBhI"}
|
|
@@ -38,7 +38,7 @@ export async function offerToSave(id, password, name) {
|
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
40
|
/**
|
|
41
|
-
* What a password manager should file the account password under.
|
|
41
|
+
* What a password manager should file the account's password under.
|
|
42
42
|
*
|
|
43
43
|
* The account's own name, so the vault entry says which account it opens —
|
|
44
44
|
* useful the moment there is more than one.
|
|
@@ -47,14 +47,43 @@ export function accountCredentialName(name) {
|
|
|
47
47
|
return name;
|
|
48
48
|
}
|
|
49
49
|
/**
|
|
50
|
-
* What a password manager
|
|
50
|
+
* What a password manager filed a device password under, before an account
|
|
51
|
+
* had one password rather than one per device. Kept different from what the
|
|
52
|
+
* recovery code was filed under, so a manager would not fill one for the other.
|
|
51
53
|
*
|
|
52
|
-
*
|
|
53
|
-
* different secrets on the same origin: one opens the account anywhere, the
|
|
54
|
-
* other only here. Filed under the same name, a manager would offer whichever
|
|
55
|
-
* it saw last and quietly fill the wrong one.
|
|
54
|
+
* @deprecated New passwords are filed under {@link accountCredentialName}.
|
|
56
55
|
*/
|
|
57
56
|
export function deviceCredentialName(name) {
|
|
58
57
|
return `${name} (this device)`;
|
|
59
58
|
}
|
|
59
|
+
/**
|
|
60
|
+
* The recovery code as a file to keep.
|
|
61
|
+
*
|
|
62
|
+
* Plain text, so it opens anywhere and prints as it is. It names the account
|
|
63
|
+
* and its DID, so a drawer with two of these says which is which.
|
|
64
|
+
*
|
|
65
|
+
* @param account The code, and the account it opens
|
|
66
|
+
* @returns A file name and its contents
|
|
67
|
+
*/
|
|
68
|
+
export function recoveryKit({ code, name, did }) {
|
|
69
|
+
const slug = name.toLowerCase().replace(/[^a-z0-9]+/g, '-').replace(/^-|-$/g, '') || 'account';
|
|
70
|
+
const text = [
|
|
71
|
+
'Weave recovery code',
|
|
72
|
+
'',
|
|
73
|
+
`Account: ${name}`,
|
|
74
|
+
...(did ? [`Account ID: ${did}`] : []),
|
|
75
|
+
`Recovery code: ${code}`,
|
|
76
|
+
'',
|
|
77
|
+
'This code is your Weave account. It restores the account on any device or',
|
|
78
|
+
'Weave home, even one that has never seen it. Nobody can reissue it, and',
|
|
79
|
+
'anyone who has it can open your account.',
|
|
80
|
+
'',
|
|
81
|
+
'Keep it somewhere safe: a secure note in your password manager, or printed',
|
|
82
|
+
'and put away. Not as a saved login, where a new password could replace it.',
|
|
83
|
+
'',
|
|
84
|
+
`Made ${new Date().toISOString().slice(0, 10)}.`,
|
|
85
|
+
'',
|
|
86
|
+
].join('\n');
|
|
87
|
+
return { filename: `weave-recovery-${slug}.txt`, text };
|
|
88
|
+
}
|
|
60
89
|
//# sourceMappingURL=credentials.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"credentials.js","sourceRoot":"","sources":["../../src/session/credentials.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAOH;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,EAAU,EAAE,QAAgB,EAAE,IAAa;IAC3E,MAAM,IAAI,GAAI,UAAqE,CAAC,kBAAkB,CAAC;IACvG,IAAI,CAAC,IAAI;QAAE,OAAO,KAAK,CAAC;IAExB,IAAI,CAAC;QACH,MAAM,UAAU,CAAC,SAAS,CAAC,WAAW,CAAC,KAAK,CAAC,IAAI,IAAI,CAAC,EAAE,EAAE,EAAE,QAAQ,EAAE,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;QACpG,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,MAAM,CAAC;QACP,uDAAuD;QACvD,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,qBAAqB,CAAC,IAAY;IAChD,OAAO,IAAI,CAAC;AACd,CAAC;AAED
|
|
1
|
+
{"version":3,"file":"credentials.js","sourceRoot":"","sources":["../../src/session/credentials.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAOH;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,EAAU,EAAE,QAAgB,EAAE,IAAa;IAC3E,MAAM,IAAI,GAAI,UAAqE,CAAC,kBAAkB,CAAC;IACvG,IAAI,CAAC,IAAI;QAAE,OAAO,KAAK,CAAC;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,IAAI,CAAC,CAAC;IACb,OAAO,EAAE,QAAQ,EAAE,kBAAkB,IAAI,MAAM,EAAE,IAAI,EAAE,CAAC;AAC1D,CAAC"}
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* way a signed HTTP request is (AWS SigV4, RFC 9421), and a host refuses one
|
|
15
15
|
* more than five minutes off.
|
|
16
16
|
*
|
|
17
|
-
* What a device knows about paying is nothing (
|
|
17
|
+
* What a device knows about paying is nothing (spec/06-nodes-and-sessions.md, Hosts). A host describes
|
|
18
18
|
* itself at a well-known address (like a Nostr relay's NIP-11 document), signs
|
|
19
19
|
* every status it gives, and takes payments on its own page, which the device
|
|
20
20
|
* opens with a link signed by the subscription key — the way an S3 link is
|
package/dist/session/index.d.ts
CHANGED
|
@@ -7,12 +7,12 @@
|
|
|
7
7
|
* API when used — so it lives on its own entry point, away from the
|
|
8
8
|
* isomorphic core.
|
|
9
9
|
*/
|
|
10
|
-
export { createWeaveAuth } from './auth.js';
|
|
11
|
-
export type { WeaveAuth, WeaveAuthConfig, AuthState, AuthStage, AuthError, AccountEntry, WeaveSession, MovedToPod, Connection, GrantChoice, } from './auth.js';
|
|
10
|
+
export { createWeaveAuth, MIN_PASSWORD_LENGTH } from './auth.js';
|
|
11
|
+
export type { WeaveAuth, WeaveAuthConfig, AuthState, AuthStage, AuthSetup, AuthError, AccountEntry, WeaveSession, MovedToPod, Connection, GrantChoice, ProposeChoice, } from './auth.js';
|
|
12
12
|
export { createWeaveConnection } from './connection.js';
|
|
13
13
|
export type { WeaveConnection, WeaveConnectionConfig, ConnectionState, ConnectionStatus } from './connection.js';
|
|
14
|
-
export { connectToHome, connectCarrier, homeAddress, receiveConnectRequest, startConnectedNode, grantSigner, grantStore, grantCapabilities, appKey, forgetAppKey, MAX_GRANT_DAYS, } from './connect.js';
|
|
15
|
-
export type { ConnectRequest, ConnectOptions, Grant, CarryGrant, GrantedSpace, IncomingRequest, AppKey } from './connect.js';
|
|
14
|
+
export { connectToHome, connectCarrier, proposeToHome, isProposeRequest, homeAddress, receiveConnectRequest, startConnectedNode, grantSigner, grantStore, grantCapabilities, appKey, forgetAppKey, MAX_GRANT_DAYS, } from './connect.js';
|
|
15
|
+
export type { ConnectRequest, ConnectOptions, ProposeRequest, Proposed, Grant, CarryGrant, GrantedSpace, IncomingRequest, AppKey } from './connect.js';
|
|
16
16
|
export { browserPlace, folderPlace, pickPod, rememberPod, recallPod, forgetPod, listAccounts, inspectPod, storesFor, } from './places.js';
|
|
17
17
|
export type { Place, PodContents } from './places.js';
|
|
18
18
|
export { createStaySignedIn, STAY_SIGNED_IN_CHOICES, DEFAULT_STAY_SIGNED_IN } from './stay-signed-in.js';
|
|
@@ -21,5 +21,5 @@ export { offerToPhone, collectFromDesktop, readPairingTicket, clearPairingTicket
|
|
|
21
21
|
export type { PairingStage, PairingOffer } from './pairing.js';
|
|
22
22
|
export { offerAgentLink, acceptAgentLink, checkAgentGrant, newAgentCode, readAgentCode } from './agent-link.js';
|
|
23
23
|
export type { AgentLinkStage, AgentLinkOffer, AgentAsking } from './agent-link.js';
|
|
24
|
-
export { offerToSave, accountCredentialName, deviceCredentialName } from './credentials.js';
|
|
24
|
+
export { offerToSave, accountCredentialName, deviceCredentialName, recoveryKit } from './credentials.js';
|
|
25
25
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/session/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/session/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AACjE,YAAY,EACV,SAAS,EACT,eAAe,EACf,SAAS,EACT,SAAS,EACT,SAAS,EACT,SAAS,EACT,YAAY,EACZ,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AAC;AACnF,OAAO,EAAE,WAAW,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC"}
|
package/dist/session/index.js
CHANGED
|
@@ -7,12 +7,12 @@
|
|
|
7
7
|
* API when used — so it lives on its own entry point, away from the
|
|
8
8
|
* isomorphic core.
|
|
9
9
|
*/
|
|
10
|
-
export { createWeaveAuth } from './auth.js';
|
|
10
|
+
export { createWeaveAuth, MIN_PASSWORD_LENGTH } from './auth.js';
|
|
11
11
|
export { createWeaveConnection } from './connection.js';
|
|
12
|
-
export { connectToHome, connectCarrier, homeAddress, receiveConnectRequest, startConnectedNode, grantSigner, grantStore, grantCapabilities, appKey, forgetAppKey, MAX_GRANT_DAYS, } from './connect.js';
|
|
12
|
+
export { connectToHome, connectCarrier, proposeToHome, isProposeRequest, homeAddress, receiveConnectRequest, startConnectedNode, grantSigner, grantStore, grantCapabilities, appKey, forgetAppKey, MAX_GRANT_DAYS, } from './connect.js';
|
|
13
13
|
export { browserPlace, folderPlace, pickPod, rememberPod, recallPod, forgetPod, listAccounts, inspectPod, storesFor, } from './places.js';
|
|
14
14
|
export { createStaySignedIn, STAY_SIGNED_IN_CHOICES, DEFAULT_STAY_SIGNED_IN } from './stay-signed-in.js';
|
|
15
15
|
export { offerToPhone, collectFromDesktop, readPairingTicket, clearPairingTicket } from './pairing.js';
|
|
16
16
|
export { offerAgentLink, acceptAgentLink, checkAgentGrant, newAgentCode, readAgentCode } from './agent-link.js';
|
|
17
|
-
export { offerToSave, accountCredentialName, deviceCredentialName } from './credentials.js';
|
|
17
|
+
export { offerToSave, accountCredentialName, deviceCredentialName, recoveryKit } from './credentials.js';
|
|
18
18
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/session/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/session/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAejE,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAExD,OAAO,EACL,aAAa,EACb,cAAc,EACd,aAAa,EACb,gBAAgB,EAChB,WAAW,EACX,qBAAqB,EACrB,kBAAkB,EAClB,WAAW,EACX,UAAU,EACV,iBAAiB,EACjB,MAAM,EACN,YAAY,EACZ,cAAc,GACf,MAAM,cAAc,CAAC;AAEtB,OAAO,EACL,YAAY,EACZ,WAAW,EACX,OAAO,EACP,WAAW,EACX,SAAS,EACT,SAAS,EACT,YAAY,EACZ,UAAU,EACV,SAAS,GACV,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAEzG,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAEvG,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,eAAe,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhH,OAAO,EAAE,WAAW,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC"}
|
package/dist/space/notify.d.ts
CHANGED
|
@@ -15,8 +15,15 @@
|
|
|
15
15
|
* author and tag, all on the outside of a record, and says so; the extension
|
|
16
16
|
* shows a notification. The label is the person's own words, shown as is.
|
|
17
17
|
*
|
|
18
|
-
* The same split as a query in a space held in part (
|
|
18
|
+
* The same split as a query in a space held in part (spec/05-sync-and-storage.md, What a node holds): the part a
|
|
19
19
|
* blind node can check runs there, the rest where the keys are.
|
|
20
|
+
*
|
|
21
|
+
* An app knows its own collections and topics better than the person does,
|
|
22
|
+
* so it may propose subscriptions (`NotifyProposal`): when it connects, or
|
|
23
|
+
* later, as a node already connected (`proposeToHome`). The carrier does the
|
|
24
|
+
* same from the collections it sees go by. The person says yes to each on the
|
|
25
|
+
* home's approval screen, and the home writes them into the registry naming
|
|
26
|
+
* the app — the app never writes there itself.
|
|
20
27
|
*/
|
|
21
28
|
import type { Expression } from '../types.js';
|
|
22
29
|
import type { SpaceKey } from '../privacy/space-encryption.js';
|
|
@@ -46,7 +53,39 @@ export interface NotifyWhen {
|
|
|
46
53
|
readonly paused?: boolean;
|
|
47
54
|
/** When it was made: nothing written before it notifies */
|
|
48
55
|
readonly since: string;
|
|
56
|
+
/** The app that proposed it, by the origin the browser reported. Absent: the person made it in the home. */
|
|
57
|
+
readonly app?: NotifyApp;
|
|
58
|
+
}
|
|
59
|
+
/** Who proposed a subscription */
|
|
60
|
+
export interface NotifyApp {
|
|
61
|
+
readonly origin: string;
|
|
62
|
+
/** What the app called itself. Shown, never trusted. */
|
|
63
|
+
readonly name?: string;
|
|
49
64
|
}
|
|
65
|
+
/**
|
|
66
|
+
* A subscription an app asks for. It looks at the spaces the app may reach —
|
|
67
|
+
* every space for a whole-account app or a carrier, else the spaces it was
|
|
68
|
+
* given — or at `spaces`, some of those. `topic.me` stands for the account's
|
|
69
|
+
* DID, which the app does not know before it connects: "mentions me".
|
|
70
|
+
*/
|
|
71
|
+
export interface NotifyProposal {
|
|
72
|
+
readonly label: string;
|
|
73
|
+
readonly collection: string;
|
|
74
|
+
readonly topic?: {
|
|
75
|
+
readonly field: string;
|
|
76
|
+
readonly value: string | number | boolean;
|
|
77
|
+
} | {
|
|
78
|
+
readonly field: string;
|
|
79
|
+
readonly me: true;
|
|
80
|
+
};
|
|
81
|
+
readonly others?: boolean;
|
|
82
|
+
/** Only these of the spaces the app may reach. Default: all of them. */
|
|
83
|
+
readonly spaces?: ReadonlyArray<string>;
|
|
84
|
+
/** Must be on the app's own origin. Default: the app's origin. */
|
|
85
|
+
readonly open?: string;
|
|
86
|
+
}
|
|
87
|
+
/** At most this many proposals in one request */
|
|
88
|
+
export declare const MAX_PROPOSALS = 8;
|
|
50
89
|
/** A subscription as a carrier holds it: no values, only tags */
|
|
51
90
|
export interface CarriedSubscription {
|
|
52
91
|
readonly v: 1;
|
|
@@ -62,6 +101,25 @@ export interface CarriedSubscription {
|
|
|
62
101
|
}
|
|
63
102
|
/** Why a subscription can't be kept, or null */
|
|
64
103
|
export declare function checkNotify(when: unknown): string | null;
|
|
104
|
+
/**
|
|
105
|
+
* Why an app's proposal can't be offered, or null. `origin` is the app's, as
|
|
106
|
+
* the browser reported it: a click may only lead back to the app that asked.
|
|
107
|
+
*/
|
|
108
|
+
export declare function checkProposal(proposal: unknown, origin: string): string | null;
|
|
109
|
+
/**
|
|
110
|
+
* The spaces a proposal looks at, given the ones the app may reach; null when
|
|
111
|
+
* it names one outside them.
|
|
112
|
+
*/
|
|
113
|
+
export declare function proposalSpaces(proposal: NotifyProposal, reach: NotifySpaces): NotifySpaces | null;
|
|
114
|
+
/** The subscription a proposal becomes, once the person says yes to it */
|
|
115
|
+
export declare function fromProposal(proposal: NotifyProposal, context: {
|
|
116
|
+
readonly app: NotifyApp;
|
|
117
|
+
readonly spaces: NotifySpaces;
|
|
118
|
+
readonly account: string;
|
|
119
|
+
readonly since?: string;
|
|
120
|
+
}): NotifyWhen;
|
|
121
|
+
/** Whether two subscriptions ask about the same thing: an app connecting again adds nothing twice */
|
|
122
|
+
export declare function sameSubscription(a: NotifyWhen, b: NotifyWhen): boolean;
|
|
65
123
|
/** A space the account follows, as far as a subscription needs: its id, and its current key when private */
|
|
66
124
|
export interface NotifySpace {
|
|
67
125
|
readonly id: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notify.d.ts","sourceRoot":"","sources":["../../src/space/notify.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"notify.d.ts","sourceRoot":"","sources":["../../src/space/notify.ts"],"names":[],"mappings":"AAAA;;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,EAAE,mBAAmB,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,SAAa,GAAG,OAAO,CAY9I"}
|
package/dist/space/notify.js
CHANGED
|
@@ -4,6 +4,8 @@ import { checkTopics, topicKey, topicTag } from '../records/topics.js';
|
|
|
4
4
|
export const NOTIFY_COLLECTION = 'sys.notify';
|
|
5
5
|
/** Subscriptions as a carrier holds them, in its carry space: the same key, values replaced by tags */
|
|
6
6
|
export const SUBSCRIPTION_COLLECTION = 'sys.subscription';
|
|
7
|
+
/** At most this many proposals in one request */
|
|
8
|
+
export const MAX_PROPOSALS = 8;
|
|
7
9
|
const COLLECTION = /^[a-z][a-z0-9-]*(\.[a-z0-9-]+)+$/;
|
|
8
10
|
/** Why a subscription can't be kept, or null */
|
|
9
11
|
export function checkNotify(when) {
|
|
@@ -40,8 +42,97 @@ export function checkNotify(when) {
|
|
|
40
42
|
}
|
|
41
43
|
if (typeof w.since !== 'string' || !Number.isFinite(Date.parse(w.since)))
|
|
42
44
|
return 'since must be a date';
|
|
45
|
+
if (w.app !== undefined) {
|
|
46
|
+
const a = w.app;
|
|
47
|
+
if (typeof a !== 'object' || a === null || typeof a.origin !== 'string' || !isOrigin(a.origin))
|
|
48
|
+
return 'app.origin must be a web origin';
|
|
49
|
+
if (a.name !== undefined && (typeof a.name !== 'string' || a.name.length > 80))
|
|
50
|
+
return 'app.name must be text, at most 80 characters';
|
|
51
|
+
}
|
|
52
|
+
return null;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* `https://chat.example`, nothing after it: what a browser reports as a
|
|
56
|
+
* message's origin. A browser extension's origin (`chrome-extension://<id>`)
|
|
57
|
+
* is one too, though `URL` gives it none.
|
|
58
|
+
*/
|
|
59
|
+
function isOrigin(value) {
|
|
60
|
+
if (/^(chrome|moz|safari-web)-extension:\/\/[a-z0-9-]{1,64}$/i.test(value))
|
|
61
|
+
return true;
|
|
62
|
+
try {
|
|
63
|
+
return new URL(value).origin === value;
|
|
64
|
+
}
|
|
65
|
+
catch {
|
|
66
|
+
return false;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Why an app's proposal can't be offered, or null. `origin` is the app's, as
|
|
71
|
+
* the browser reported it: a click may only lead back to the app that asked.
|
|
72
|
+
*/
|
|
73
|
+
export function checkProposal(proposal, origin) {
|
|
74
|
+
const p = proposal;
|
|
75
|
+
if (typeof p !== 'object' || p === null)
|
|
76
|
+
return 'A proposed subscription must be an object';
|
|
77
|
+
const topic = p.topic;
|
|
78
|
+
if (topic !== undefined && (typeof topic !== 'object' || topic === null || ('me' in topic && (topic.me !== true || 'value' in topic)))) {
|
|
79
|
+
return 'topic is { field, value } or { field, me: true }';
|
|
80
|
+
}
|
|
81
|
+
const problem = checkNotify({
|
|
82
|
+
label: p.label,
|
|
83
|
+
collection: p.collection,
|
|
84
|
+
spaces: p.spaces ?? 'all',
|
|
85
|
+
...(topic ? { topic: { field: topic.field, value: topic.me === true ? 'me' : topic.value } } : {}),
|
|
86
|
+
...(p.others !== undefined ? { others: p.others } : {}),
|
|
87
|
+
...(p.open !== undefined ? { open: p.open } : {}),
|
|
88
|
+
since: new Date(0).toISOString(),
|
|
89
|
+
app: { origin },
|
|
90
|
+
});
|
|
91
|
+
if (problem)
|
|
92
|
+
return problem;
|
|
93
|
+
if (p.open !== undefined && new URL(p.open).origin !== origin)
|
|
94
|
+
return 'open must be an address on the app’s own site';
|
|
43
95
|
return null;
|
|
44
96
|
}
|
|
97
|
+
/**
|
|
98
|
+
* The spaces a proposal looks at, given the ones the app may reach; null when
|
|
99
|
+
* it names one outside them.
|
|
100
|
+
*/
|
|
101
|
+
export function proposalSpaces(proposal, reach) {
|
|
102
|
+
if (!proposal.spaces)
|
|
103
|
+
return reach;
|
|
104
|
+
if (reach !== 'all' && proposal.spaces.some((id) => !reach.includes(id)))
|
|
105
|
+
return null;
|
|
106
|
+
return [...new Set(proposal.spaces)];
|
|
107
|
+
}
|
|
108
|
+
/** The subscription a proposal becomes, once the person says yes to it */
|
|
109
|
+
export function fromProposal(proposal, context) {
|
|
110
|
+
const topic = proposal.topic;
|
|
111
|
+
const when = {
|
|
112
|
+
label: proposal.label.trim(),
|
|
113
|
+
collection: proposal.collection,
|
|
114
|
+
spaces: context.spaces,
|
|
115
|
+
...(topic ? { topic: { field: topic.field, value: 'me' in topic ? context.account : topic.value } } : {}),
|
|
116
|
+
others: proposal.others ?? true,
|
|
117
|
+
open: proposal.open ?? `${context.app.origin}/`,
|
|
118
|
+
since: context.since ?? new Date().toISOString(),
|
|
119
|
+
app: context.app,
|
|
120
|
+
};
|
|
121
|
+
// An app on plain http elsewhere than this machine: a click goes to the home instead.
|
|
122
|
+
if (checkNotify(when) === null || proposal.open !== undefined)
|
|
123
|
+
return when;
|
|
124
|
+
const { open: _open, ...rest } = when;
|
|
125
|
+
return rest;
|
|
126
|
+
}
|
|
127
|
+
/** Whether two subscriptions ask about the same thing: an app connecting again adds nothing twice */
|
|
128
|
+
export function sameSubscription(a, b) {
|
|
129
|
+
const spaces = (s) => (s === 'all' ? 'all' : [...s].sort().join(','));
|
|
130
|
+
return (a.collection === b.collection &&
|
|
131
|
+
spaces(a.spaces) === spaces(b.spaces) &&
|
|
132
|
+
a.topic?.field === b.topic?.field &&
|
|
133
|
+
a.topic?.value === b.topic?.value &&
|
|
134
|
+
(a.others ?? true) === (b.others ?? true));
|
|
135
|
+
}
|
|
45
136
|
/**
|
|
46
137
|
* What a carrier gets: the subscription with its value replaced by each
|
|
47
138
|
* space's tag. A private space whose key this device doesn't hold gets none,
|
package/dist/space/notify.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notify.js","sourceRoot":"","sources":["../../src/space/notify.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"notify.js","sourceRoot":"","sources":["../../src/space/notify.ts"],"names":[],"mappings":"AA6BA,OAAO,EAAE,SAAS,E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AAK,GAAG,CAAC,UAAU;QAAE,OAAO,KAAK,CAAC;IACtE,IAAI,OAAO,CAAC,GAAG,KAAK,CAAC,IAAI,OAAO,CAAC,OAAO;QAAE,OAAO,KAAK,CAAC;IACvD,IAAI,GAAG,CAAC,MAAM,KAAK,KAAK,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC;QAAE,OAAO,KAAK,CAAC;IACxE,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAC9C,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,GAAG,GAAG,OAAO,GAAG,gBAAgB;QAAE,OAAO,KAAK,CAAC;IACnH,IAAI,GAAG,CAAC,MAAM,IAAI,MAAM,CAAC,OAAO,CAAC,KAAK,OAAO;QAAE,OAAO,KAAK,CAAC;IAC5D,IAAI,GAAG,CAAC,IAAI,EAAE,CAAC;QACb,MAAM,MAAM,GAAG,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACjC,IAAI,CAAC,MAAM,EAAE,MAAM,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;YAAE,OAAO,KAAK,CAAC;IAC1F,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
|
package/dist/storage/blob/s3.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* MinIO, Wasabi, AWS itself.
|
|
5
5
|
*
|
|
6
6
|
* Requests are signed with `aws4fetch` rather than the AWS SDK or hand-written
|
|
7
|
-
* SigV4 (see
|
|
7
|
+
* SigV4 (see CLAUDE.md, Dependencies): tiny, no dependencies, `fetch` and
|
|
8
8
|
* `crypto.subtle` only, so it runs in browsers, Node and Bun alike.
|
|
9
9
|
*/
|
|
10
10
|
import { AwsClient } from 'aws4fetch';
|
package/package.json
CHANGED
|
@@ -1,97 +1,107 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@weaveprotocol/core",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Self-sovereign P2P protocol for the browser — identity, schemas, storage, networking, and gossip sync",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
8
|
-
"url": "git+https://github.com/leifriksheim/weave.git"
|
|
8
|
+
"url": "git+https://github.com/leifriksheim/weave.git",
|
|
9
|
+
"directory": "packages/core"
|
|
9
10
|
},
|
|
10
11
|
"files": [
|
|
11
12
|
"dist",
|
|
12
13
|
"README.md"
|
|
13
14
|
],
|
|
14
|
-
"workspaces": [
|
|
15
|
-
"cli"
|
|
16
|
-
],
|
|
17
15
|
"main": "dist/index.js",
|
|
18
16
|
"types": "dist/index.d.ts",
|
|
19
17
|
"exports": {
|
|
20
18
|
".": {
|
|
21
|
-
"
|
|
22
|
-
"types": "./dist/index.d.ts"
|
|
19
|
+
"@weaveprotocol/source": "./src/index.ts",
|
|
20
|
+
"types": "./dist/index.d.ts",
|
|
21
|
+
"import": "./dist/index.js"
|
|
23
22
|
},
|
|
24
23
|
"./identity": {
|
|
25
|
-
"
|
|
26
|
-
"types": "./dist/identity/index.d.ts"
|
|
24
|
+
"@weaveprotocol/source": "./src/identity/index.ts",
|
|
25
|
+
"types": "./dist/identity/index.d.ts",
|
|
26
|
+
"import": "./dist/identity/index.js"
|
|
27
27
|
},
|
|
28
28
|
"./schema": {
|
|
29
|
-
"
|
|
30
|
-
"types": "./dist/schema/index.d.ts"
|
|
29
|
+
"@weaveprotocol/source": "./src/schema/index.ts",
|
|
30
|
+
"types": "./dist/schema/index.d.ts",
|
|
31
|
+
"import": "./dist/schema/index.js"
|
|
31
32
|
},
|
|
32
33
|
"./storage": {
|
|
33
|
-
"
|
|
34
|
-
"types": "./dist/storage/index.d.ts"
|
|
34
|
+
"@weaveprotocol/source": "./src/storage/index.ts",
|
|
35
|
+
"types": "./dist/storage/index.d.ts",
|
|
36
|
+
"import": "./dist/storage/index.js"
|
|
35
37
|
},
|
|
36
38
|
"./network": {
|
|
37
|
-
"
|
|
38
|
-
"types": "./dist/network/index.d.ts"
|
|
39
|
+
"@weaveprotocol/source": "./src/network/index.ts",
|
|
40
|
+
"types": "./dist/network/index.d.ts",
|
|
41
|
+
"import": "./dist/network/index.js"
|
|
39
42
|
},
|
|
40
43
|
"./sync": {
|
|
41
|
-
"
|
|
42
|
-
"types": "./dist/sync/index.d.ts"
|
|
44
|
+
"@weaveprotocol/source": "./src/sync/index.ts",
|
|
45
|
+
"types": "./dist/sync/index.d.ts",
|
|
46
|
+
"import": "./dist/sync/index.js"
|
|
43
47
|
},
|
|
44
48
|
"./validation": {
|
|
45
|
-
"
|
|
46
|
-
"types": "./dist/validation/index.d.ts"
|
|
49
|
+
"@weaveprotocol/source": "./src/validation/index.ts",
|
|
50
|
+
"types": "./dist/validation/index.d.ts",
|
|
51
|
+
"import": "./dist/validation/index.js"
|
|
47
52
|
},
|
|
48
53
|
"./privacy": {
|
|
49
|
-
"
|
|
50
|
-
"types": "./dist/privacy/index.d.ts"
|
|
54
|
+
"@weaveprotocol/source": "./src/privacy/index.ts",
|
|
55
|
+
"types": "./dist/privacy/index.d.ts",
|
|
56
|
+
"import": "./dist/privacy/index.js"
|
|
51
57
|
},
|
|
52
58
|
"./node": {
|
|
53
|
-
"
|
|
54
|
-
"types": "./dist/node/index.d.ts"
|
|
59
|
+
"@weaveprotocol/source": "./src/node/index.ts",
|
|
60
|
+
"types": "./dist/node/index.d.ts",
|
|
61
|
+
"import": "./dist/node/index.js"
|
|
55
62
|
},
|
|
56
63
|
"./schemas": {
|
|
57
|
-
"
|
|
58
|
-
"types": "./dist/schemas/index.d.ts"
|
|
64
|
+
"@weaveprotocol/source": "./src/schemas/index.ts",
|
|
65
|
+
"types": "./dist/schemas/index.d.ts",
|
|
66
|
+
"import": "./dist/schemas/index.js"
|
|
59
67
|
},
|
|
60
68
|
"./session": {
|
|
61
|
-
"
|
|
62
|
-
"types": "./dist/session/index.d.ts"
|
|
69
|
+
"@weaveprotocol/source": "./src/session/index.ts",
|
|
70
|
+
"types": "./dist/session/index.d.ts",
|
|
71
|
+
"import": "./dist/session/index.js"
|
|
63
72
|
},
|
|
64
73
|
"./elements": {
|
|
65
|
-
"
|
|
66
|
-
"types": "./dist/elements/index.d.ts"
|
|
74
|
+
"@weaveprotocol/source": "./src/elements/index.ts",
|
|
75
|
+
"types": "./dist/elements/index.d.ts",
|
|
76
|
+
"import": "./dist/elements/index.js"
|
|
67
77
|
},
|
|
68
78
|
"./react": {
|
|
69
|
-
"
|
|
70
|
-
"types": "./dist/react/index.d.ts"
|
|
79
|
+
"@weaveprotocol/source": "./src/react/index.ts",
|
|
80
|
+
"types": "./dist/react/index.d.ts",
|
|
81
|
+
"import": "./dist/react/index.js"
|
|
71
82
|
},
|
|
72
83
|
"./calls": {
|
|
73
|
-
"
|
|
74
|
-
"types": "./dist/calls/index.d.ts"
|
|
84
|
+
"@weaveprotocol/source": "./src/calls/index.ts",
|
|
85
|
+
"types": "./dist/calls/index.d.ts",
|
|
86
|
+
"import": "./dist/calls/index.js"
|
|
75
87
|
},
|
|
76
88
|
"./doors": {
|
|
77
|
-
"
|
|
78
|
-
"types": "./dist/doors/index.d.ts"
|
|
89
|
+
"@weaveprotocol/source": "./src/doors/index.ts",
|
|
90
|
+
"types": "./dist/doors/index.d.ts",
|
|
91
|
+
"import": "./dist/doors/index.js"
|
|
79
92
|
}
|
|
80
93
|
},
|
|
81
94
|
"scripts": {
|
|
82
|
-
"dev": "node scripts/dev.mjs",
|
|
83
|
-
"weave": "node --env-file=cli/.env.dev --import tsx cli/src/main.ts",
|
|
84
95
|
"build": "rm -rf dist && tsc",
|
|
85
96
|
"typecheck": "tsc --noEmit",
|
|
86
|
-
"test": "node --experimental-vm-modules --import tsx --test tests
|
|
87
|
-
"
|
|
88
|
-
"
|
|
89
|
-
"
|
|
97
|
+
"test": "node --experimental-vm-modules --import tsx --test tests/*.test.ts",
|
|
98
|
+
"prepack": "cp ../../README.md README.md",
|
|
99
|
+
"postpack": "rm -f README.md",
|
|
100
|
+
"prepublishOnly": "npm run build"
|
|
90
101
|
},
|
|
91
102
|
"devDependencies": {
|
|
92
103
|
"@types/react": "^19.3.0",
|
|
93
104
|
"@types/ws": "^8.18.1",
|
|
94
|
-
"bumpp": "^12.3.0",
|
|
95
105
|
"tsx": "^4.19.0",
|
|
96
106
|
"typescript": "^5.6.0",
|
|
97
107
|
"ws": "^8.21.3",
|