@flipstream/sdk 0.13.0 → 0.15.0
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/CHANGELOG.md +120 -0
- package/README.md +143 -21
- package/dist/api/backend.d.ts +7 -0
- package/dist/api/backend.js +7 -0
- package/dist/api/backend.js.map +1 -1
- package/dist/api/credentials.js +4 -4
- package/dist/api/credentials.js.map +1 -1
- package/dist/api/datasets.js +30 -50
- package/dist/api/datasets.js.map +1 -1
- package/dist/api/handoff.d.ts +1 -1
- package/dist/api/handoff.js +7 -0
- package/dist/api/handoff.js.map +1 -1
- package/dist/api/log.d.ts +4 -4
- package/dist/api/log.js +23 -42
- package/dist/api/log.js.map +1 -1
- package/dist/api/me.d.ts +5 -3
- package/dist/api/me.js +3 -3
- package/dist/api/me.js.map +1 -1
- package/dist/api/members.d.ts +40 -17
- package/dist/api/members.js +66 -29
- package/dist/api/members.js.map +1 -1
- package/dist/api/ownRecord.d.ts +46 -0
- package/dist/api/ownRecord.js +57 -0
- package/dist/api/ownRecord.js.map +1 -0
- package/dist/api/refusal.d.ts +14 -0
- package/dist/api/refusal.js +23 -0
- package/dist/api/refusal.js.map +1 -0
- package/dist/api/wallet.d.ts +2 -1
- package/dist/api/wallet.js +18 -24
- package/dist/api/wallet.js.map +1 -1
- package/dist/api/workspaces.d.ts +7 -2
- package/dist/api/workspaces.js +14 -8
- package/dist/api/workspaces.js.map +1 -1
- package/dist/auth/discovery.js +4 -5
- package/dist/auth/discovery.js.map +1 -1
- package/dist/auth/transport.d.ts +6 -2
- package/dist/auth/transport.js +5 -3
- package/dist/auth/transport.js.map +1 -1
- package/dist/core/call.d.ts +9 -4
- package/dist/core/call.js +12 -8
- package/dist/core/call.js.map +1 -1
- package/dist/core/fetch.d.ts +20 -1
- package/dist/core/fetch.js +50 -3
- package/dist/core/fetch.js.map +1 -1
- package/dist/core/hosts.d.ts +11 -0
- package/dist/core/hosts.js +13 -0
- package/dist/core/hosts.js.map +1 -0
- package/dist/core/identify.d.ts +12 -2
- package/dist/core/identify.js +31 -19
- package/dist/core/identify.js.map +1 -1
- package/dist/core/inPlaceOf.d.ts +6 -0
- package/dist/core/inPlaceOf.js +17 -0
- package/dist/core/inPlaceOf.js.map +1 -0
- package/dist/core/invalid.d.ts +32 -9
- package/dist/core/invalid.js +36 -23
- package/dist/core/invalid.js.map +1 -1
- package/dist/core/notFound.d.ts +2 -2
- package/dist/core/notFound.js.map +1 -1
- package/dist/core/read.d.ts +4 -10
- package/dist/core/read.js +1 -11
- package/dist/core/read.js.map +1 -1
- package/dist/core/result.d.ts +14 -10
- package/dist/core/result.js +1 -0
- package/dist/core/result.js.map +1 -1
- package/dist/core/shared.d.ts +15 -9
- package/dist/core/shared.js +8 -6
- package/dist/core/shared.js.map +1 -1
- package/dist/core/signal.d.ts +7 -0
- package/dist/core/signal.js +9 -0
- package/dist/core/signal.js.map +1 -1
- package/dist/first-party/asPerson.d.ts +13 -0
- package/dist/first-party/asPerson.js +144 -0
- package/dist/first-party/asPerson.js.map +1 -0
- package/dist/first-party/attempts.d.ts +71 -0
- package/dist/first-party/attempts.js +132 -0
- package/dist/first-party/attempts.js.map +1 -0
- package/dist/first-party/authProxyMark.d.ts +7 -0
- package/dist/first-party/authProxyMark.js +8 -0
- package/dist/first-party/authProxyMark.js.map +1 -0
- package/dist/first-party/browser.d.ts +55 -0
- package/dist/first-party/browser.js +137 -0
- package/dist/first-party/browser.js.map +1 -0
- package/dist/first-party/browserSession.d.ts +95 -0
- package/dist/first-party/browserSession.js +242 -0
- package/dist/first-party/browserSession.js.map +1 -0
- package/dist/first-party/calls/consent.d.ts +77 -0
- package/dist/first-party/calls/consent.js +174 -0
- package/dist/first-party/calls/consent.js.map +1 -0
- package/dist/first-party/calls/device.d.ts +75 -0
- package/dist/first-party/calls/device.js +133 -0
- package/dist/first-party/calls/device.js.map +1 -0
- package/dist/first-party/calls/invitation.d.ts +198 -0
- package/dist/first-party/calls/invitation.js +240 -0
- package/dist/first-party/calls/invitation.js.map +1 -0
- package/dist/first-party/calls/logIn.d.ts +41 -0
- package/dist/first-party/calls/logIn.js +48 -0
- package/dist/first-party/calls/logIn.js.map +1 -0
- package/dist/first-party/calls/reset.d.ts +58 -0
- package/dist/first-party/calls/reset.js +163 -0
- package/dist/first-party/calls/reset.js.map +1 -0
- package/dist/first-party/calls/signUp.d.ts +21 -0
- package/dist/first-party/calls/signUp.js +72 -0
- package/dist/first-party/calls/signUp.js.map +1 -0
- package/dist/first-party/calls/twoStepSetup.d.ts +55 -0
- package/dist/first-party/calls/twoStepSetup.js +168 -0
- package/dist/first-party/calls/twoStepSetup.js.map +1 -0
- package/dist/first-party/claims.d.ts +88 -0
- package/dist/first-party/claims.js +181 -0
- package/dist/first-party/claims.js.map +1 -0
- package/dist/first-party/enrollment.d.ts +10 -0
- package/dist/first-party/enrollment.js +44 -0
- package/dist/first-party/enrollment.js.map +1 -0
- package/dist/first-party/entry.d.ts +549 -0
- package/dist/first-party/entry.js +580 -0
- package/dist/first-party/entry.js.map +1 -0
- package/dist/first-party/hooks.d.ts +66 -0
- package/dist/first-party/hooks.js +19 -0
- package/dist/first-party/hooks.js.map +1 -0
- package/dist/first-party/http.d.ts +191 -0
- package/dist/first-party/http.js +364 -0
- package/dist/first-party/http.js.map +1 -0
- package/dist/first-party/index.d.ts +14 -0
- package/dist/first-party/index.js +3 -0
- package/dist/first-party/index.js.map +1 -0
- package/dist/first-party/landed.d.ts +32 -0
- package/dist/first-party/landed.js +50 -0
- package/dist/first-party/landed.js.map +1 -0
- package/dist/first-party/landedProof.d.ts +12 -0
- package/dist/first-party/landedProof.js +20 -0
- package/dist/first-party/landedProof.js.map +1 -0
- package/dist/first-party/linkToken.d.ts +16 -0
- package/dist/first-party/linkToken.js +29 -0
- package/dist/first-party/linkToken.js.map +1 -0
- package/dist/first-party/links.d.ts +100 -0
- package/dist/first-party/links.js +84 -0
- package/dist/first-party/links.js.map +1 -0
- package/dist/first-party/locks.d.ts +36 -0
- package/dist/first-party/locks.js +64 -0
- package/dist/first-party/locks.js.map +1 -0
- package/dist/first-party/personTransport.d.ts +38 -0
- package/dist/first-party/personTransport.js +177 -0
- package/dist/first-party/personTransport.js.map +1 -0
- package/dist/first-party/proxy/app.d.ts +25 -0
- package/dist/first-party/proxy/app.js +94 -0
- package/dist/first-party/proxy/app.js.map +1 -0
- package/dist/first-party/proxy/bound.d.ts +5 -0
- package/dist/first-party/proxy/bound.js +13 -0
- package/dist/first-party/proxy/bound.js.map +1 -0
- package/dist/first-party/proxy/cases.d.ts +54 -0
- package/dist/first-party/proxy/cases.js +412 -0
- package/dist/first-party/proxy/cases.js.map +1 -0
- package/dist/first-party/proxy/decide.d.ts +29 -0
- package/dist/first-party/proxy/decide.js +140 -0
- package/dist/first-party/proxy/decide.js.map +1 -0
- package/dist/first-party/proxy/freeze.d.ts +2 -0
- package/dist/first-party/proxy/freeze.js +10 -0
- package/dist/first-party/proxy/freeze.js.map +1 -0
- package/dist/first-party/proxy/handler.d.ts +23 -0
- package/dist/first-party/proxy/handler.js +190 -0
- package/dist/first-party/proxy/handler.js.map +1 -0
- package/dist/first-party/proxy/headers.d.ts +8 -0
- package/dist/first-party/proxy/headers.js +20 -0
- package/dist/first-party/proxy/headers.js.map +1 -0
- package/dist/first-party/proxy/hop.d.ts +9 -0
- package/dist/first-party/proxy/hop.js +37 -0
- package/dist/first-party/proxy/hop.js.map +1 -0
- package/dist/first-party/proxy/host.d.ts +5 -0
- package/dist/first-party/proxy/host.js +11 -0
- package/dist/first-party/proxy/host.js.map +1 -0
- package/dist/first-party/proxy/index.d.ts +7 -0
- package/dist/first-party/proxy/index.js +6 -0
- package/dist/first-party/proxy/index.js.map +1 -0
- package/dist/first-party/proxy/pass-back.d.ts +21 -0
- package/dist/first-party/proxy/pass-back.js +51 -0
- package/dist/first-party/proxy/pass-back.js.map +1 -0
- package/dist/first-party/proxy/paths.d.ts +17 -0
- package/dist/first-party/proxy/paths.js +36 -0
- package/dist/first-party/proxy/paths.js.map +1 -0
- package/dist/first-party/proxy/shown.d.ts +5 -0
- package/dist/first-party/proxy/shown.js +16 -0
- package/dist/first-party/proxy/shown.js.map +1 -0
- package/dist/first-party/proxy/stand-in.d.ts +47 -0
- package/dist/first-party/proxy/stand-in.js +318 -0
- package/dist/first-party/proxy/stand-in.js.map +1 -0
- package/dist/first-party/report.d.ts +47 -0
- package/dist/first-party/report.js +38 -0
- package/dist/first-party/report.js.map +1 -0
- package/dist/first-party/result.d.ts +82 -0
- package/dist/first-party/result.js +40 -0
- package/dist/first-party/result.js.map +1 -0
- package/dist/first-party/session/cell.d.ts +177 -0
- package/dist/first-party/session/cell.js +89 -0
- package/dist/first-party/session/cell.js.map +1 -0
- package/dist/first-party/session/closed.d.ts +8 -0
- package/dist/first-party/session/closed.js +12 -0
- package/dist/first-party/session/closed.js.map +1 -0
- package/dist/first-party/session/index.d.ts +3 -0
- package/dist/first-party/session/index.js +3 -0
- package/dist/first-party/session/index.js.map +1 -0
- package/dist/first-party/session/logout.d.ts +82 -0
- package/dist/first-party/session/logout.js +328 -0
- package/dist/first-party/session/logout.js.map +1 -0
- package/dist/first-party/session/owed.d.ts +30 -0
- package/dist/first-party/session/owed.js +27 -0
- package/dist/first-party/session/owed.js.map +1 -0
- package/dist/first-party/session/refresh.d.ts +19 -0
- package/dist/first-party/session/refresh.js +229 -0
- package/dist/first-party/session/refresh.js.map +1 -0
- package/dist/first-party/session/results.d.ts +38 -0
- package/dist/first-party/session/results.js +74 -0
- package/dist/first-party/session/results.js.map +1 -0
- package/dist/first-party/session/session.d.ts +2 -0
- package/dist/first-party/session/session.js +379 -0
- package/dist/first-party/session/session.js.map +1 -0
- package/dist/first-party/session/shared.d.ts +34 -0
- package/dist/first-party/session/shared.js +104 -0
- package/dist/first-party/session/shared.js.map +1 -0
- package/dist/first-party/session/sharedSignal.d.ts +27 -0
- package/dist/first-party/session/sharedSignal.js +55 -0
- package/dist/first-party/session/sharedSignal.js.map +1 -0
- package/dist/first-party/session/signIn.d.ts +43 -0
- package/dist/first-party/session/signIn.js +294 -0
- package/dist/first-party/session/signIn.js.map +1 -0
- package/dist/first-party/session/signInThrough.d.ts +5 -0
- package/dist/first-party/session/signInThrough.js +95 -0
- package/dist/first-party/session/signInThrough.js.map +1 -0
- package/dist/first-party/session/sync.d.ts +17 -0
- package/dist/first-party/session/sync.js +143 -0
- package/dist/first-party/session/sync.js.map +1 -0
- package/dist/first-party/session/tokens.d.ts +18 -0
- package/dist/first-party/session/tokens.js +64 -0
- package/dist/first-party/session/tokens.js.map +1 -0
- package/dist/first-party/session/types.d.ts +270 -0
- package/dist/first-party/session/types.js +3 -0
- package/dist/first-party/session/types.js.map +1 -0
- package/dist/first-party/sessionWire.d.ts +31 -0
- package/dist/first-party/sessionWire.js +91 -0
- package/dist/first-party/sessionWire.js.map +1 -0
- package/dist/first-party/signInHooks.d.ts +57 -0
- package/dist/first-party/signInHooks.js +2 -0
- package/dist/first-party/signInHooks.js.map +1 -0
- package/dist/first-party/state.d.ts +51 -0
- package/dist/first-party/state.js +52 -0
- package/dist/first-party/state.js.map +1 -0
- package/dist/first-party/strip.d.ts +1 -0
- package/dist/first-party/strip.js +8 -0
- package/dist/first-party/strip.js.map +1 -0
- package/dist/first-party/twoStepLock.d.ts +26 -0
- package/dist/first-party/twoStepLock.js +58 -0
- package/dist/first-party/twoStepLock.js.map +1 -0
- package/dist/first-party/twoStepSession.d.ts +21 -0
- package/dist/first-party/twoStepSession.js +31 -0
- package/dist/first-party/twoStepSession.js.map +1 -0
- package/dist/first-party/wire.d.ts +63 -0
- package/dist/first-party/wire.js +5 -0
- package/dist/first-party/wire.js.map +1 -0
- package/dist/flipstream.d.ts +132 -36
- package/dist/flipstream.js +94 -47
- package/dist/flipstream.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +3 -2
- package/dist/index.js.map +1 -1
- package/dist/node/keychainChild.js +60 -25
- package/dist/node/keychainChild.js.map +1 -1
- package/dist/node/keychainError.d.ts +4 -1
- package/dist/node/keychainError.js.map +1 -1
- package/dist/node/keychainStore.js +42 -8
- package/dist/node/keychainStore.js.map +1 -1
- package/dist/node/session.js +9 -8
- package/dist/node/session.js.map +1 -1
- package/dist/query/query.d.ts +52 -8
- package/dist/query/query.js +133 -19
- package/dist/query/query.js.map +1 -1
- package/dist/version.gen.js +1 -1
- package/docs/admin.md +53 -4
- package/docs/first-party.md +278 -0
- package/docs/node-sign-in.md +8 -4
- package/package.json +34 -5
package/dist/api/members.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import {
|
|
2
|
+
import { invalidIn } from '../core/invalid.js';
|
|
3
3
|
import { notFound } from '../core/notFound.js';
|
|
4
4
|
import { RANKED, roleFromBackend } from '../core/names.js';
|
|
5
5
|
import { createdById } from './created.js';
|
|
6
|
+
import { needsPerson, zHandOffOrganization } from './handoff.js';
|
|
6
7
|
import { sameUuid } from './ids.js';
|
|
7
8
|
import { instant } from './time.js';
|
|
8
9
|
const id = z.string().min(1);
|
|
@@ -103,28 +104,38 @@ export async function listMembers(seam, read, page) {
|
|
|
103
104
|
return organization;
|
|
104
105
|
if (!listed.ok)
|
|
105
106
|
return listed;
|
|
106
|
-
const foreign = listed
|
|
107
|
-
if (foreign !==
|
|
108
|
-
return
|
|
107
|
+
const foreign = foreignRow(listed, organization.data.id, 'member');
|
|
108
|
+
if (foreign !== null)
|
|
109
|
+
return foreign;
|
|
109
110
|
const key = listed.data.items.findIndex((member) => member.is_api_user);
|
|
110
111
|
if (key !== -1)
|
|
111
|
-
return
|
|
112
|
+
return invalidIn(listed, `records[${String(key)}] is an API user, not a person`);
|
|
112
113
|
return { ok: true, data: { ...listed.data, items: listed.data.items.map(publicOf) } };
|
|
113
114
|
}
|
|
114
115
|
/**
|
|
115
|
-
* `flipstream.members.get()`: one of your organisation's people, by their id
|
|
116
|
-
*
|
|
117
|
-
*
|
|
118
|
-
* Every invalid after the read keeps the response's status, 200.
|
|
119
|
-
* The organisation's failure, then the person's, is the answer. A caller that is reading your
|
|
120
|
-
* organisation already passes that read as `organization`, so it isn't read twice (#295); otherwise
|
|
121
|
-
* it's read here, and only once the path is known to be one, so a refused call sends nothing.
|
|
116
|
+
* `flipstream.members.get()`: one of your organisation's people, by their id, by `readMember`'s
|
|
117
|
+
* rules. A caller that is reading your organisation already passes that read as `organization`, so
|
|
118
|
+
* it isn't read twice (#295).
|
|
122
119
|
*/
|
|
123
|
-
export async function getMember(seam, read, request, organization) {
|
|
120
|
+
export async function getMember(seam, read, request, organization = () => read(seam.myOrganization(zOrganizationId))) {
|
|
121
|
+
const found = await readMember(seam, read, request, organization);
|
|
122
|
+
return found.ok ? { ok: true, data: found.data.member } : found;
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* One of your organisation's people, by their id, with your organisation as `organization` reads
|
|
126
|
+
* it. `organization` is a function, called only once the id is known to be one path segment, so a
|
|
127
|
+
* refused id asks no token, hands no transport a request and starts no shared read, whoever the
|
|
128
|
+
* caller is (#415's code review, 1 to 4). An answer that isn't the person asked for, or is another
|
|
129
|
+
* organisation's, is invalid, echoing no id; an API user's is `not_found`, as an id nobody has,
|
|
130
|
+
* whatever else its record holds. Only then is the person read. Every invalid after the read keeps
|
|
131
|
+
* the status the person's answer came with (#385). The organisation's failure, then the person's,
|
|
132
|
+
* is the answer.
|
|
133
|
+
*/
|
|
134
|
+
async function readMember(seam, read, request, organization) {
|
|
124
135
|
const spec = seam.user(request.member_id, zWho);
|
|
125
136
|
if (spec === null)
|
|
126
137
|
return { ok: false, error: { kind: 'refused', reason: 'path' } };
|
|
127
|
-
const [ours, who] = await Promise.all([organization
|
|
138
|
+
const [ours, who] = await Promise.all([organization(), read(spec)]);
|
|
128
139
|
if (!ours.ok)
|
|
129
140
|
return ours;
|
|
130
141
|
if (!who.ok)
|
|
@@ -132,15 +143,30 @@ export async function getMember(seam, read, request, organization) {
|
|
|
132
143
|
const whose = zWhose.safeParse(who.data);
|
|
133
144
|
// A key is not_found even when whose it is can't be read, as an id nobody has (#367's code review, 8).
|
|
134
145
|
if (!whose.success)
|
|
135
|
-
return who.data.is_api_user ? noSuchMember() :
|
|
146
|
+
return who.data.is_api_user ? noSuchMember() : invalidIn(who, z.prettifyError(whose.error));
|
|
136
147
|
if (!sameUuid(whose.data.id, request.member_id))
|
|
137
|
-
return
|
|
148
|
+
return invalidIn(who, "the member read isn't the one asked for");
|
|
138
149
|
if (!sameUuid(whose.data.organization_id, ours.data.id))
|
|
139
|
-
return
|
|
150
|
+
return invalidIn(who, "the member read is another organisation's");
|
|
140
151
|
if (who.data.is_api_user)
|
|
141
152
|
return noSuchMember();
|
|
142
153
|
const person = zRecord.safeParse(who.data);
|
|
143
|
-
return person.success ? { ok: true, data: publicOf(person.data) } :
|
|
154
|
+
return person.success ? { ok: true, data: { member: publicOf(person.data), organization: ours.data } } : invalidIn(who, z.prettifyError(person.error));
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* `flipstream.members.remove()`: a D542 hand-off, as `datasets.delete` is. The person is read by
|
|
158
|
+
* `readMember`'s rules, with your organisation read for its short name too: your organisation's
|
|
159
|
+
* failure, then the person's, is the answer, so one nobody has, one your role can't read or an API
|
|
160
|
+
* key is `not_found`, a refused read is `forbidden`, and another organisation's person is
|
|
161
|
+
* `invalid`. A path that can't stay one segment is refused before anything is read. Only then
|
|
162
|
+
* `needs_person`, never a write (no call sends `DELETE /users/{id}`), with the person's page in the
|
|
163
|
+
* console where one can be named.
|
|
164
|
+
*/
|
|
165
|
+
export async function handOffMemberRemove(seam, read, request) {
|
|
166
|
+
const member = await readMember(seam, read, request, () => read(seam.myOrganization(zHandOffOrganization)));
|
|
167
|
+
if (!member.ok)
|
|
168
|
+
return member;
|
|
169
|
+
return needsPerson('member.remove', seam.memberPage(member.data.organization.slug, member.data.member.id));
|
|
144
170
|
}
|
|
145
171
|
/**
|
|
146
172
|
* The workspaces `member` opens, by D560's rule, read so it fails closed: a person whose account
|
|
@@ -162,19 +188,30 @@ export function opensWorkspace(you, workspaceId) {
|
|
|
162
188
|
const opens = workspacesOpenedBy(you);
|
|
163
189
|
return opens === 'every' || opens.some((id) => sameUuid(id, workspaceId));
|
|
164
190
|
}
|
|
191
|
+
/**
|
|
192
|
+
* A page's first row of another organisation than `organizationId` (D556), as `invalid` naming its
|
|
193
|
+
* place, never an id, with `noun` naming what the row is, and the status the page's answer came with
|
|
194
|
+
* (#385); null when every row is your organisation's. None is dropped. The one check every page held
|
|
195
|
+
* to your organisation makes: your members, a workspace's datasets, their count and its logbook, and
|
|
196
|
+
* `heldToYou`'s first (#385's code review, 5).
|
|
197
|
+
*/
|
|
198
|
+
export function foreignRow(page, organizationId, noun) {
|
|
199
|
+
const at = page.data.items.findIndex((row) => !sameUuid(row.organization_id, organizationId));
|
|
200
|
+
return at === -1 ? null : invalidIn(page, `records[${String(at)}] is another organisation's ${noun}`);
|
|
201
|
+
}
|
|
165
202
|
/**
|
|
166
203
|
* A page's `items` held to you (D556, D560): the first of another organisation than
|
|
167
|
-
* `organizationId
|
|
168
|
-
* `invalid`, naming its place and never an id, with `noun` naming what the
|
|
169
|
-
*
|
|
170
|
-
*
|
|
171
|
-
* review, 7).
|
|
204
|
+
* `organizationId` (`foreignRow`), then the first in a workspace `you` don't open
|
|
205
|
+
* (`workspacesOpenedBy`), is `invalid`, naming its place and never an id, with `noun` naming what the
|
|
206
|
+
* record is, and the status the page's answer came with (#385). Null when every one is yours to see.
|
|
207
|
+
* None is dropped. The one check that log.list({ member_id }) (#295) and datasets.list({
|
|
208
|
+
* organization: true }) (#342) share, so the two can't drift apart (#342's code review, 7).
|
|
172
209
|
*/
|
|
173
|
-
export function heldToYou(
|
|
174
|
-
const foreign =
|
|
175
|
-
if (foreign !==
|
|
176
|
-
return
|
|
177
|
-
const closed = items.findIndex((item) => !opensWorkspace(you, item.workspace_id));
|
|
178
|
-
return closed === -1 ? null :
|
|
210
|
+
export function heldToYou(page, organizationId, you, noun) {
|
|
211
|
+
const foreign = foreignRow(page, organizationId, noun);
|
|
212
|
+
if (foreign !== null)
|
|
213
|
+
return foreign;
|
|
214
|
+
const closed = page.data.items.findIndex((item) => !opensWorkspace(you, item.workspace_id));
|
|
215
|
+
return closed === -1 ? null : invalidIn(page, `records[${String(closed)}].workspace_id is a workspace you don't open`);
|
|
179
216
|
}
|
|
180
217
|
//# sourceMappingURL=members.js.map
|
package/dist/api/members.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"members.js","sourceRoot":"","sources":["../../src/api/members.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"members.js","sourceRoot":"","sources":["../../src/api/members.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,EAAE,SAAS,EAAgC,MAAM,oBAAoB,CAAA;AAC5E,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAA;AAC9C,OAAO,EAAE,MAAM,EAAE,eAAe,EAAa,MAAM,kBAAkB,CAAA;AAGrE,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAC1C,OAAO,EAAE,WAAW,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAA;AAChE,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AAGnC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAkEnC,MAAM,EAAE,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAA;AAK5B;;;;;;;;GAQG;AACH,MAAM,MAAM,GAAG,CAAC;KACb,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;KACjB,QAAQ,EAAE;KACV,SAAS,CAAC,CAAC,KAAK,EAAa,EAAE;IAC9B,MAAM,IAAI,GAAG,IAAI,GAAG,EAAQ,CAAA;I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AC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,eAAe,EAAE,cAAc,CAAC,CAAC,CAAA;IAC7F,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,IAAI,EAAE,WAAW,MAAM,CAAC,EAAE,CAAC,+BAA+B,IAAI,EAAE,CAAC,CAAA;AACvG,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,SAAS,CACvB,IAA+G,EAC/G,cAAsB,EACtB,GAAW,EACX,IAAY;IAEZ,MAAM,OAAO,GAAG,UAAU,CAAC,IAAI,EAAE,cAAc,EAAE,IAAI,CAAC,CAAA;IACtD,IAAI,OAAO,KAAK,IAAI;QAAE,OAAO,OAAO,CAAA;IACpC,MAAM,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,cAAc,CAAC,GAAG,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC,CAAA;IAC3F,OAAO,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,IAAI,EAAE,WAAW,MAAM,CAAC,MAAM,CAAC,8CAA8C,CAAC,CAAA;AACxH,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { z } from 'zod';
|
|
2
|
+
import type { CallSpec } from '../core/call.js';
|
|
3
|
+
import { type Failed, type Heard } from '../core/invalid.js';
|
|
4
|
+
import type { ApiResult } from '../core/result.js';
|
|
5
|
+
import type { Backend } from './backend.js';
|
|
6
|
+
import { type Read } from './me.js';
|
|
7
|
+
/** What a record read by its id names: itself, its organisation and its workspace. */
|
|
8
|
+
interface Placed {
|
|
9
|
+
readonly id: string;
|
|
10
|
+
readonly organization_id: string;
|
|
11
|
+
readonly workspace_id: string;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* A record read by its id, a dataset or a log entry, held to you: the one rule both use (#404's
|
|
15
|
+
* code review, 1), as two copies of it drifted apart before (#404). The record names its workspace
|
|
16
|
+
* only once read, so it's read beside your organisation (D556) and you (`readUser`), all three
|
|
17
|
+
* started at once. A workspace named up front is `readOwnWorkspaceWith`'s rule instead.
|
|
18
|
+
* - **The order:** the answer is your organisation's failure, then yours, then the record's, then
|
|
19
|
+
* its checks: another organisation's record is `invalid`, and one in a workspace you don't open is
|
|
20
|
+
* `not_found`. So a sign-in whose read of you fails gets that failure whether the record exists or
|
|
21
|
+
* not (D571).
|
|
22
|
+
* - **No wait for the record once the answer is known:** when your organisation's read or yours has
|
|
23
|
+
* failed, the call answers once your organisation's read and yours have answered, without waiting
|
|
24
|
+
* for the record, and its end ends the record's read (the call scope, withReads, #349), whose
|
|
25
|
+
* rejection is still the call's.
|
|
26
|
+
* - **The record's own failure** is the backend's, passed on as it came, but pulse-admin's own
|
|
27
|
+
* refusal of it: that says it exists, so it answers `noSuch`, as one nobody has
|
|
28
|
+
* (`refusedAsNobodyHas`, D578), as one in a workspace you don't open does (D571). A role pulse-admin
|
|
29
|
+
* refuses every record gets `not_found` for every id, as accepted. A write's own 403, once the
|
|
30
|
+
* record is read, stays the caller's.
|
|
31
|
+
* - **An answer that isn't the record asked for** is `invalid`, and so is another organisation's,
|
|
32
|
+
* echoing no id: a staff token's reach is never shown as yours (D544). That `invalid` still says
|
|
33
|
+
* the record exists, to a token the backend answers other organisations' records for, as intended.
|
|
34
|
+
* - **One in a workspace you don't open** answers `noSuch`, the backend's own 404 for one nobody
|
|
35
|
+
* has, so a write after it sends nothing (D560, D571, #372).
|
|
36
|
+
* Both come back: the record as read, so a check after it keeps its status (#385), and your
|
|
37
|
+
* organisation, as `organizationSchema` reads it, so only a read that needs more than its id asks
|
|
38
|
+
* for more (#280). `what` names the record in an `invalid`'s words.
|
|
39
|
+
*/
|
|
40
|
+
export declare function readOwnRecord<R extends Placed, O extends {
|
|
41
|
+
readonly id: string;
|
|
42
|
+
}>(seam: Backend, read: Read, spec: CallSpec<R>, id: string, organizationSchema: z.ZodType<O>, what: string, noSuch: () => Failed): Promise<ApiResult<{
|
|
43
|
+
readonly record: Heard<R>;
|
|
44
|
+
readonly organization: O;
|
|
45
|
+
}>>;
|
|
46
|
+
export {};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { invalidIn } from '../core/invalid.js';
|
|
2
|
+
import { sameUuid } from './ids.js';
|
|
3
|
+
import { readUser } from './me.js';
|
|
4
|
+
import { opensWorkspace } from './members.js';
|
|
5
|
+
import { refusedAsNobodyHas } from './refusal.js';
|
|
6
|
+
/**
|
|
7
|
+
* A record read by its id, a dataset or a log entry, held to you: the one rule both use (#404's
|
|
8
|
+
* code review, 1), as two copies of it drifted apart before (#404). The record names its workspace
|
|
9
|
+
* only once read, so it's read beside your organisation (D556) and you (`readUser`), all three
|
|
10
|
+
* started at once. A workspace named up front is `readOwnWorkspaceWith`'s rule instead.
|
|
11
|
+
* - **The order:** the answer is your organisation's failure, then yours, then the record's, then
|
|
12
|
+
* its checks: another organisation's record is `invalid`, and one in a workspace you don't open is
|
|
13
|
+
* `not_found`. So a sign-in whose read of you fails gets that failure whether the record exists or
|
|
14
|
+
* not (D571).
|
|
15
|
+
* - **No wait for the record once the answer is known:** when your organisation's read or yours has
|
|
16
|
+
* failed, the call answers once your organisation's read and yours have answered, without waiting
|
|
17
|
+
* for the record, and its end ends the record's read (the call scope, withReads, #349), whose
|
|
18
|
+
* rejection is still the call's.
|
|
19
|
+
* - **The record's own failure** is the backend's, passed on as it came, but pulse-admin's own
|
|
20
|
+
* refusal of it: that says it exists, so it answers `noSuch`, as one nobody has
|
|
21
|
+
* (`refusedAsNobodyHas`, D578), as one in a workspace you don't open does (D571). A role pulse-admin
|
|
22
|
+
* refuses every record gets `not_found` for every id, as accepted. A write's own 403, once the
|
|
23
|
+
* record is read, stays the caller's.
|
|
24
|
+
* - **An answer that isn't the record asked for** is `invalid`, and so is another organisation's,
|
|
25
|
+
* echoing no id: a staff token's reach is never shown as yours (D544). That `invalid` still says
|
|
26
|
+
* the record exists, to a token the backend answers other organisations' records for, as intended.
|
|
27
|
+
* - **One in a workspace you don't open** answers `noSuch`, the backend's own 404 for one nobody
|
|
28
|
+
* has, so a write after it sends nothing (D560, D571, #372).
|
|
29
|
+
* Both come back: the record as read, so a check after it keeps its status (#385), and your
|
|
30
|
+
* organisation, as `organizationSchema` reads it, so only a read that needs more than its id asks
|
|
31
|
+
* for more (#280). `what` names the record in an `invalid`'s words.
|
|
32
|
+
*/
|
|
33
|
+
export async function readOwnRecord(seam, read, spec, id, organizationSchema, what, noSuch) {
|
|
34
|
+
// Started in this order, as they always were, so a transport's rejection is still the first
|
|
35
|
+
// read's to reject in that order (withReads, #349).
|
|
36
|
+
const organization = read(seam.myOrganization(organizationSchema));
|
|
37
|
+
const record = read(spec);
|
|
38
|
+
const you = readUser(seam, read);
|
|
39
|
+
// Observed at once: once your organisation's read or yours has failed, it isn't waited for.
|
|
40
|
+
record.catch(() => undefined);
|
|
41
|
+
const [ours, yours] = await Promise.all([organization, you]);
|
|
42
|
+
if (!ours.ok)
|
|
43
|
+
return ours;
|
|
44
|
+
if (!yours.ok)
|
|
45
|
+
return yours;
|
|
46
|
+
const answer = await record;
|
|
47
|
+
if (!answer.ok)
|
|
48
|
+
return refusedAsNobodyHas(answer, noSuch);
|
|
49
|
+
if (!sameUuid(answer.data.id, id))
|
|
50
|
+
return invalidIn(answer, `the ${what} read isn't the one asked for`);
|
|
51
|
+
if (!sameUuid(answer.data.organization_id, ours.data.id))
|
|
52
|
+
return invalidIn(answer, `the ${what} read is another organisation's`);
|
|
53
|
+
if (!opensWorkspace(yours.data, answer.data.workspace_id))
|
|
54
|
+
return noSuch();
|
|
55
|
+
return { ok: true, data: { record: answer, organization: ours.data } };
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=ownRecord.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{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AI,CAAC,EAAE,EAAE,EAAE,CAAC;QAAE,OAAO,SAAS,CAAC,MAAM,EAAE,OAAO,IAAI,+BAA+B,CAAC,CAAA;IACvG,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,eAAe,EAAE,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;QAAE,OAAO,SAAS,CAAC,MAAM,EAAE,OAAO,IAAI,iCAAiC,CAAC,CAAA;IAChI,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,IAAI,EAAE,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC;QAAE,OAAO,MAAM,EAAE,CAAA;IAC1E,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,IAAI,CAAC,IAAI,EAAE,EAAE,CAAA;AACxE,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Failed } from '../core/invalid.js';
|
|
2
|
+
/**
|
|
3
|
+
* A record's or a workspace's own read's failure, as the call answers it: the one rule
|
|
4
|
+
* `readOwnRecord` and `readOwnWorkspaceWith` use (D578, #406; #410's code review, 2, 3 and 8).
|
|
5
|
+
* - **pulse-admin's own refusal of it** says it exists, so it answers `noSuch`, exactly as one
|
|
6
|
+
* nobody has, as one in a workspace you don't open does (D571). It's answered in place of the
|
|
7
|
+
* refusal (`inPlaceOf`), so the call still names the read it came from, as for the backend's own
|
|
8
|
+
* 404 (#410's code review, 1).
|
|
9
|
+
* - **Any other failure** passes as it came: a 403 that isn't pulse-admin's own, from a proxy, a
|
|
10
|
+
* gateway or a sign-in page in front of it, or pulse-admin's refusal of the token, says nothing
|
|
11
|
+
* about the record, and masking it would make a setup that refuses everything read as nothing
|
|
12
|
+
* existing.
|
|
13
|
+
*/
|
|
14
|
+
export declare function refusedAsNobodyHas(failed: Failed, noSuch: () => Failed): Failed;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { inPlaceOf } from '../core/inPlaceOf.js';
|
|
2
|
+
// pulse-admin's own refusal: its ForbiddenException, a 403 with its JSON error, code
|
|
3
|
+
// FORBIDDEN_EXCEPTION (dff6bf9b, adapters/ingress/fastapi/__init__.py:124-133: the code is the
|
|
4
|
+
// exception's class name, as `{ code, message }`). Its other 403, TOKEN_INVALID_EXCEPTION, refuses
|
|
5
|
+
// the token, not a record.
|
|
6
|
+
const REFUSED = 'FORBIDDEN_EXCEPTION';
|
|
7
|
+
/**
|
|
8
|
+
* A record's or a workspace's own read's failure, as the call answers it: the one rule
|
|
9
|
+
* `readOwnRecord` and `readOwnWorkspaceWith` use (D578, #406; #410's code review, 2, 3 and 8).
|
|
10
|
+
* - **pulse-admin's own refusal of it** says it exists, so it answers `noSuch`, exactly as one
|
|
11
|
+
* nobody has, as one in a workspace you don't open does (D571). It's answered in place of the
|
|
12
|
+
* refusal (`inPlaceOf`), so the call still names the read it came from, as for the backend's own
|
|
13
|
+
* 404 (#410's code review, 1).
|
|
14
|
+
* - **Any other failure** passes as it came: a 403 that isn't pulse-admin's own, from a proxy, a
|
|
15
|
+
* gateway or a sign-in page in front of it, or pulse-admin's refusal of the token, says nothing
|
|
16
|
+
* about the record, and masking it would make a setup that refuses everything read as nothing
|
|
17
|
+
* existing.
|
|
18
|
+
*/
|
|
19
|
+
export function refusedAsNobodyHas(failed, noSuch) {
|
|
20
|
+
const { error } = failed;
|
|
21
|
+
return error.kind === 'forbidden' && error.code === REFUSED ? inPlaceOf(failed, noSuch()) : failed;
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=refusal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"refusal.js","sourceRoot":"","sources":["../../src/api/refusal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAA;AAGhD,qFAAqF;AACrF,+FAA+F;AAC/F,mGAAmG;AACnG,2BAA2B;AAC3B,MAAM,OAAO,GAAG,qBAAqB,CAAA;AAErC;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,kBAAkB,CAAC,MAAc,EAAE,MAAoB;IACrE,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,CAAA;IACxB,OAAO,KAAK,CAAC,IAAI,KAAK,WAAW,IAAI,KAAK,CAAC,IAAI,KAAK,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,CAAC,MAAM,CAAA;AACpG,CAAC"}
|
package/dist/api/wallet.d.ts
CHANGED
|
@@ -32,7 +32,8 @@ export interface Ledger {
|
|
|
32
32
|
/**
|
|
33
33
|
* `flipstream.wallet.balance()`: your organisation's balance, or null when it has no wallet. No
|
|
34
34
|
* wallet is a real state, not a fault, so it isn't `invalid`, and it isn't €0.00 either: a zero
|
|
35
|
-
* balance would claim a wallet that holds nothing.
|
|
35
|
+
* balance would claim a wallet that holds nothing. Your organisation is read first, every time, with
|
|
36
|
+
* no cache (once for a whole scope, #376), as `transactions()` reads it: the wallet's id is its id.
|
|
36
37
|
*/
|
|
37
38
|
export declare function readBalance(seam: Backend, read: Read): Promise<ApiResult<Balance | null>>;
|
|
38
39
|
/**
|
package/dist/api/wallet.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import {
|
|
2
|
+
import { invalidIn } from '../core/invalid.js';
|
|
3
3
|
import { sameUuid } from './ids.js';
|
|
4
4
|
import { instant } from './time.js';
|
|
5
5
|
/*
|
|
@@ -31,26 +31,19 @@ const zTransaction = z
|
|
|
31
31
|
created_on: instant,
|
|
32
32
|
})
|
|
33
33
|
.transform(({ dataset_id, ...row }) => ({ ...row, dataset_id: dataset_id === '' || dataset_id === null ? null : dataset_id }));
|
|
34
|
-
/**
|
|
35
|
-
* Your organisation's id, read every time, with no cache, but once for a whole scope (#376): the
|
|
36
|
-
* wallet's id is the organisation's.
|
|
37
|
-
*/
|
|
38
|
-
async function organizationId(seam, read) {
|
|
39
|
-
const organization = await read(seam.myOrganization(zOrganizationId));
|
|
40
|
-
return organization.ok ? { ok: true, data: organization.data.id } : organization;
|
|
41
|
-
}
|
|
42
34
|
/**
|
|
43
35
|
* The guard both reads share: the balance's rows held to the organisation read. pulse-wallet scopes
|
|
44
36
|
* by the token, not the path, and answers the caller's own wallet for another organisation's id
|
|
45
37
|
* (#244's recording), so a row of another wallet is invalid, never read as yours. Two wallets are
|
|
46
38
|
* invalid too: an organisation has one. No rows is no wallet, null.
|
|
47
39
|
*/
|
|
48
|
-
function ownWallet(
|
|
40
|
+
function ownWallet(balance, organization) {
|
|
41
|
+
const rows = balance.data;
|
|
49
42
|
if (rows.some((row) => !sameUuid(row.wallet_id, organization)))
|
|
50
|
-
return
|
|
43
|
+
return invalidIn(balance, "a balance row is another wallet's");
|
|
51
44
|
const [row, ...more] = rows;
|
|
52
45
|
if (more.length > 0)
|
|
53
|
-
return
|
|
46
|
+
return invalidIn(balance, 'more than one wallet for the organisation');
|
|
54
47
|
return { ok: true, data: row ?? null };
|
|
55
48
|
}
|
|
56
49
|
const UNNAMED = "the organisation's id can't name its wallet";
|
|
@@ -58,25 +51,26 @@ const UNNAMED = "the organisation's id can't name its wallet";
|
|
|
58
51
|
* Whether your organisation has a wallet, decided in this one place for both reads (#375's code
|
|
59
52
|
* review, 5): its balance rows, read and held to `organization` by `ownWallet`, so a row is your
|
|
60
53
|
* wallet and null is none. The first of: the balance's failure, the wallet's verdict. `organization`
|
|
61
|
-
* is your organisation
|
|
54
|
+
* is your organisation, read by the caller, so the ledger can be read beside the balance.
|
|
62
55
|
*/
|
|
63
56
|
async function readOwnWallet(seam, read, organization) {
|
|
64
|
-
const spec = seam.balanceOf(organization, zBalanceRow);
|
|
57
|
+
const spec = seam.balanceOf(organization.data.id, zBalanceRow);
|
|
65
58
|
if (spec === null)
|
|
66
|
-
return
|
|
59
|
+
return invalidIn(organization, UNNAMED);
|
|
67
60
|
const rows = await read(spec);
|
|
68
|
-
return rows.ok ? ownWallet(rows
|
|
61
|
+
return rows.ok ? ownWallet(rows, organization.data.id) : rows;
|
|
69
62
|
}
|
|
70
63
|
/**
|
|
71
64
|
* `flipstream.wallet.balance()`: your organisation's balance, or null when it has no wallet. No
|
|
72
65
|
* wallet is a real state, not a fault, so it isn't `invalid`, and it isn't €0.00 either: a zero
|
|
73
|
-
* balance would claim a wallet that holds nothing.
|
|
66
|
+
* balance would claim a wallet that holds nothing. Your organisation is read first, every time, with
|
|
67
|
+
* no cache (once for a whole scope, #376), as `transactions()` reads it: the wallet's id is its id.
|
|
74
68
|
*/
|
|
75
69
|
export async function readBalance(seam, read) {
|
|
76
|
-
const organization = await
|
|
70
|
+
const organization = await read(seam.myOrganization(zOrganizationId));
|
|
77
71
|
if (!organization.ok)
|
|
78
72
|
return organization;
|
|
79
|
-
const wallet = await readOwnWallet(seam, read, organization
|
|
73
|
+
const wallet = await readOwnWallet(seam, read, organization);
|
|
80
74
|
if (!wallet.ok)
|
|
81
75
|
return wallet;
|
|
82
76
|
return { ok: true, data: wallet.data === null ? null : { balance_micro: wallet.data.balance_micro, micro_per_euro: MICRO_PER_EURO } };
|
|
@@ -92,15 +86,15 @@ export async function readBalance(seam, read) {
|
|
|
92
86
|
* O2.F1).
|
|
93
87
|
*/
|
|
94
88
|
export async function readLedger(seam, read) {
|
|
95
|
-
const organization = await
|
|
89
|
+
const organization = await read(seam.myOrganization(zOrganizationId));
|
|
96
90
|
if (!organization.ok)
|
|
97
91
|
return organization;
|
|
98
92
|
// Checked before either read is sent. The balance's path takes the same id, so once the
|
|
99
93
|
// ledger's can name it, so can the balance's, and readOwnWallet never refuses after this.
|
|
100
|
-
const ledgerSpec = seam.ledgerOf(organization.data, zTransaction);
|
|
94
|
+
const ledgerSpec = seam.ledgerOf(organization.data.id, zTransaction);
|
|
101
95
|
if (ledgerSpec === null)
|
|
102
|
-
return
|
|
103
|
-
const [wallet, ledger] = await Promise.all([readOwnWallet(seam, read, organization
|
|
96
|
+
return invalidIn(organization, UNNAMED);
|
|
97
|
+
const [wallet, ledger] = await Promise.all([readOwnWallet(seam, read, organization), read(ledgerSpec)]);
|
|
104
98
|
// The wallet's verdict comes from the balance, so it comes before the ledger's own failure: a
|
|
105
99
|
// caller never retries a ledger of a wallet that isn't theirs, nor of no wallet.
|
|
106
100
|
if (!wallet.ok)
|
|
@@ -108,7 +102,7 @@ export async function readLedger(seam, read) {
|
|
|
108
102
|
if (wallet.data === null) {
|
|
109
103
|
if (!ledger.ok)
|
|
110
104
|
return ledger.error.kind === 'invalid' ? ledger : { ok: true, data: null };
|
|
111
|
-
return ledger.data.length > 0 ?
|
|
105
|
+
return ledger.data.length > 0 ? invalidIn(ledger, 'ledger rows for an organisation with no wallet') : { ok: true, data: null };
|
|
112
106
|
}
|
|
113
107
|
if (!ledger.ok)
|
|
114
108
|
return ledger;
|
package/dist/api/wallet.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wallet.js","sourceRoot":"","sources":["../../src/api/wallet.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"wallet.js","sourceRoot":"","sources":["../../src/api/wallet.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,EAAE,SAAS,EAAc,MAAM,oBAAoB,CAAA;AAG1D,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AAEnC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAEnC;;;GAGG;AAEH;;;;GAIG;AACH,MAAM,cAAc,GAAG,MAAM,CAAA;AAiC7B,MAAM,EAAE,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAA;AAC5B,MAAM,eAAe,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,EAAE,EAAE,CAAC,CAAA;AACxC,MAAM,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AAE,OAAO,MAAM,CAAA;IAC7B,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,KAAK,EAAE,MAAM,CAAC,IAAI,EAAE,cAAc,EAAE,cAAc,EAAE,EAAE,CAAA;AACnF,CAAC"}
|
package/dist/api/workspaces.d.ts
CHANGED
|
@@ -81,9 +81,14 @@ export declare function readOwnWorkspace<O extends {
|
|
|
81
81
|
* and 4).
|
|
82
82
|
* - **Then the workspace and `alongside`** (a list under it), side by side. A workspace of another
|
|
83
83
|
* organisation is invalid, as a staff token could otherwise reach it, and so is an answer that
|
|
84
|
-
* isn't the workspace asked for.
|
|
84
|
+
* isn't the workspace asked for. pulse-admin's own refusal of the workspace's read is `not_found`,
|
|
85
|
+
* exactly as one nobody has, since it says the workspace exists (`refusedAsNobodyHas`, D578), for
|
|
86
|
+
* every call under a named workspace. A 403 on `alongside`, or on a write after it, is the
|
|
87
|
+
* caller's, as it came.
|
|
85
88
|
* The organisation's failure, then yours, then the workspace's, is the answer; `alongside`'s answer
|
|
86
|
-
* comes back as it is, for the caller to read after.
|
|
89
|
+
* comes back as it is, for the caller to read after. This isn't `readOwnRecord`'s rule, which reads
|
|
90
|
+
* a record beside you because the record names its workspace only once read: a workspace named up
|
|
91
|
+
* front is read only once you're known to open it, so one you don't open is never fetched.
|
|
87
92
|
*/
|
|
88
93
|
export declare function readOwnWorkspaceWith<O extends {
|
|
89
94
|
readonly id: string;
|
package/dist/api/workspaces.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { parseJson } from '../core/body.js';
|
|
3
|
-
import {
|
|
3
|
+
import { invalidIn } from '../core/invalid.js';
|
|
4
4
|
import { notFound } from '../core/notFound.js';
|
|
5
5
|
import { needsPerson, zHandOffOrganization } from './handoff.js';
|
|
6
6
|
import { sameUuid } from './ids.js';
|
|
7
7
|
import { readUser } from './me.js';
|
|
8
8
|
import { opensWorkspace } from './members.js';
|
|
9
|
+
import { refusedAsNobodyHas } from './refusal.js';
|
|
9
10
|
import { pageQuery } from './page.js';
|
|
10
11
|
import { unsent } from './unsent.js';
|
|
11
12
|
const id = z.string().min(1);
|
|
@@ -62,7 +63,7 @@ export async function readWorkspaces(seam, read, page) {
|
|
|
62
63
|
const ours = organization.data.id;
|
|
63
64
|
const spec = seam.workspacesOf(ours, sent, zRecord, (workspace) => sameUuid(workspace.organization_id, ours));
|
|
64
65
|
if (spec === null)
|
|
65
|
-
return
|
|
66
|
+
return invalidIn(organization, "the organisation's id can't name its workspaces");
|
|
66
67
|
const listed = await read(spec);
|
|
67
68
|
return listed.ok ? { ok: true, data: { ...listed.data, items: listed.data.items.map(publicOf) } } : listed;
|
|
68
69
|
}
|
|
@@ -93,7 +94,7 @@ export async function createWorkspace(seam, send, request) {
|
|
|
93
94
|
if (!made.ok)
|
|
94
95
|
return made;
|
|
95
96
|
if (!sameUuid(made.data.organization_id, organization.data.id))
|
|
96
|
-
return
|
|
97
|
+
return invalidIn(made, "the workspace made is another organisation's");
|
|
97
98
|
return { ok: true, data: publicOf(made.data) };
|
|
98
99
|
}
|
|
99
100
|
// pulse-admin's own 404 for a workspace nobody has, as recorded (test/recorded/admin/error-404.json;
|
|
@@ -120,9 +121,14 @@ export async function readOwnWorkspace(seam, read, workspaceId, organizationSche
|
|
|
120
121
|
* and 4).
|
|
121
122
|
* - **Then the workspace and `alongside`** (a list under it), side by side. A workspace of another
|
|
122
123
|
* organisation is invalid, as a staff token could otherwise reach it, and so is an answer that
|
|
123
|
-
* isn't the workspace asked for.
|
|
124
|
+
* isn't the workspace asked for. pulse-admin's own refusal of the workspace's read is `not_found`,
|
|
125
|
+
* exactly as one nobody has, since it says the workspace exists (`refusedAsNobodyHas`, D578), for
|
|
126
|
+
* every call under a named workspace. A 403 on `alongside`, or on a write after it, is the
|
|
127
|
+
* caller's, as it came.
|
|
124
128
|
* The organisation's failure, then yours, then the workspace's, is the answer; `alongside`'s answer
|
|
125
|
-
* comes back as it is, for the caller to read after.
|
|
129
|
+
* comes back as it is, for the caller to read after. This isn't `readOwnRecord`'s rule, which reads
|
|
130
|
+
* a record beside you because the record names its workspace only once read: a workspace named up
|
|
131
|
+
* front is read only once you're known to open it, so one you don't open is never fetched.
|
|
126
132
|
*/
|
|
127
133
|
export async function readOwnWorkspaceWith(seam, read, workspaceId, organizationSchema, alongside) {
|
|
128
134
|
const spec = seam.workspace(workspaceId, zRecord);
|
|
@@ -137,14 +143,14 @@ export async function readOwnWorkspaceWith(seam, read, workspaceId, organization
|
|
|
137
143
|
return noSuchWorkspace();
|
|
138
144
|
const [workspace, beside] = await Promise.all([read(spec), alongside()]);
|
|
139
145
|
if (!workspace.ok)
|
|
140
|
-
return workspace;
|
|
146
|
+
return refusedAsNobodyHas(workspace, noSuchWorkspace);
|
|
141
147
|
// Another workspace than the one asked for is never answered as it, as me() holds its user to
|
|
142
148
|
// userinfo's sub; neither id is echoed. The caller's id may be any form pulse-admin reads as the
|
|
143
149
|
// same UUID (sameUuid), and so may the organisation's id the workspace names (#363).
|
|
144
150
|
if (!sameUuid(workspace.data.id, workspaceId))
|
|
145
|
-
return
|
|
151
|
+
return invalidIn(workspace, "the workspace read isn't the one asked for");
|
|
146
152
|
if (!sameUuid(workspace.data.organization_id, organization.data.id))
|
|
147
|
-
return
|
|
153
|
+
return invalidIn(workspace, "the workspace read is another organisation's");
|
|
148
154
|
return { ok: true, data: { organization: organization.data, workspace: workspace.data, alongside: beside } };
|
|
149
155
|
}
|
|
150
156
|
/** `flipstream.workspaces.get()`: one workspace, by `readOwnWorkspace`'s rules. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workspaces.js","sourceRoot":"","sources":["../../src/api/workspaces.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAC3C,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"workspaces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