@flipstream/sdk 0.10.1 → 0.12.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.
Files changed (94) hide show
  1. package/CHANGELOG.md +75 -0
  2. package/README.md +98 -348
  3. package/dist/api/account.d.ts +50 -0
  4. package/dist/api/account.js +102 -0
  5. package/dist/api/account.js.map +1 -0
  6. package/dist/api/backend.d.ts +18 -0
  7. package/dist/api/backend.js +35 -4
  8. package/dist/api/backend.js.map +1 -1
  9. package/dist/api/created.d.ts +1 -1
  10. package/dist/api/created.js +3 -2
  11. package/dist/api/created.js.map +1 -1
  12. package/dist/api/credentials.js +4 -4
  13. package/dist/api/credentials.js.map +1 -1
  14. package/dist/api/datasets.d.ts +94 -14
  15. package/dist/api/datasets.js +210 -59
  16. package/dist/api/datasets.js.map +1 -1
  17. package/dist/api/index.d.ts +4 -3
  18. package/dist/api/log.d.ts +45 -24
  19. package/dist/api/log.js +113 -40
  20. package/dist/api/log.js.map +1 -1
  21. package/dist/api/me.d.ts +2 -0
  22. package/dist/api/me.js +9 -5
  23. package/dist/api/me.js.map +1 -1
  24. package/dist/api/members.d.ts +69 -7
  25. package/dist/api/members.js +110 -32
  26. package/dist/api/members.js.map +1 -1
  27. package/dist/api/time.js +4 -3
  28. package/dist/api/time.js.map +1 -1
  29. package/dist/api/wallet.d.ts +8 -5
  30. package/dist/api/wallet.js +36 -24
  31. package/dist/api/wallet.js.map +1 -1
  32. package/dist/api/workspaces.d.ts +42 -7
  33. package/dist/api/workspaces.js +80 -20
  34. package/dist/api/workspaces.js.map +1 -1
  35. package/dist/auth/discovery.d.ts +19 -6
  36. package/dist/auth/discovery.js +25 -4
  37. package/dist/auth/discovery.js.map +1 -1
  38. package/dist/auth/signIn.d.ts +18 -14
  39. package/dist/auth/signIn.js +29 -22
  40. package/dist/auth/signIn.js.map +1 -1
  41. package/dist/core/call.d.ts +4 -1
  42. package/dist/core/call.js +26 -6
  43. package/dist/core/call.js.map +1 -1
  44. package/dist/core/deadline.d.ts +30 -0
  45. package/dist/core/deadline.js +51 -0
  46. package/dist/core/deadline.js.map +1 -0
  47. package/dist/core/invalid.d.ts +7 -0
  48. package/dist/core/invalid.js +22 -0
  49. package/dist/core/invalid.js.map +1 -0
  50. package/dist/core/names.d.ts +31 -3
  51. package/dist/core/names.js +26 -6
  52. package/dist/core/names.js.map +1 -1
  53. package/dist/core/notFound.d.ts +8 -0
  54. package/dist/core/notFound.js +8 -0
  55. package/dist/core/notFound.js.map +1 -0
  56. package/dist/core/result.d.ts +17 -12
  57. package/dist/core/result.js +5 -5
  58. package/dist/core/result.js.map +1 -1
  59. package/dist/core/retry.d.ts +5 -2
  60. package/dist/core/retry.js +6 -3
  61. package/dist/core/retry.js.map +1 -1
  62. package/dist/core/scope.d.ts +20 -0
  63. package/dist/core/scope.js +54 -0
  64. package/dist/core/scope.js.map +1 -0
  65. package/dist/flipstream.d.ts +151 -70
  66. package/dist/flipstream.js +67 -45
  67. package/dist/flipstream.js.map +1 -1
  68. package/dist/node/clientSecret.js +5 -5
  69. package/dist/node/clientSecret.js.map +1 -1
  70. package/dist/node/headless.d.ts +14 -6
  71. package/dist/node/headless.js +8 -6
  72. package/dist/node/headless.js.map +1 -1
  73. package/dist/node/index.d.ts +1 -1
  74. package/dist/node/index.js +1 -1
  75. package/dist/node/index.js.map +1 -1
  76. package/dist/node/keychainChild.js +27 -10
  77. package/dist/node/keychainChild.js.map +1 -1
  78. package/dist/node/keychainError.d.ts +3 -3
  79. package/dist/node/keychainStore.d.ts +16 -12
  80. package/dist/node/keychainStore.js +50 -28
  81. package/dist/node/keychainStore.js.map +1 -1
  82. package/dist/node/loopback.d.ts +8 -1
  83. package/dist/node/loopback.js +19 -2
  84. package/dist/node/loopback.js.map +1 -1
  85. package/dist/node/session.d.ts +17 -9
  86. package/dist/node/session.js +55 -44
  87. package/dist/node/session.js.map +1 -1
  88. package/dist/node/store.d.ts +35 -2
  89. package/dist/node/store.js +56 -12
  90. package/dist/node/store.js.map +1 -1
  91. package/dist/version.gen.js +1 -1
  92. package/docs/admin.md +503 -0
  93. package/docs/node-sign-in.md +60 -35
  94. package/package.json +1 -1
@@ -1,9 +1,15 @@
1
1
  import { z } from 'zod';
2
+ import { invalidAnswer, invalidWith } from '../core/invalid.js';
3
+ import { notFound } from '../core/notFound.js';
4
+ import { accountOf } from './account.js';
2
5
  import { needsPerson, zHandOffOrganization } from './handoff.js';
3
6
  import { sameUuid } from './ids.js';
7
+ import { readUser } from './me.js';
8
+ import { heldToYou, opensWorkspace } from './members.js';
9
+ import { pageQuery } from './page.js';
4
10
  import { createdById, createdOn } from './created.js';
5
11
  import { unsent } from './unsent.js';
6
- import { readOwnWorkspace } from './workspaces.js';
12
+ import { readOwnWorkspaceWith } from './workspaces.js';
7
13
  /**
8
14
  * Every `DatasetType`, in the spec's order. Admin 0.0.126 has no route for them, so
9
15
  * `datasetTypes.list()` answers this list, as MCP's `list_connection_types` does.
@@ -31,29 +37,44 @@ const DATASET_TYPES = [
31
37
  const everyType = true;
32
38
  void everyType; // read once, so unused-locals checks keep it
33
39
  const id = z.string().min(1);
40
+ /**
41
+ * A field of one of `values`, kept as it came. A null, a value this version doesn't know, or none
42
+ * at all is null, never a guess and never invalid, so a new backend value never makes a
43
+ * workspace's list unreadable (#265's rule). `.optional()` is what lets the key be missing: without
44
+ * it, zod answers a missing key "expected nonoptional" and the dataset is invalid (#303's code
45
+ * review, 8; the test with no backfill).
46
+ */
47
+ function knownOrNull(values) {
48
+ const known = new Set(values);
49
+ const isKnown = (value) => typeof value === 'string' && known.has(value);
50
+ return z
51
+ .unknown()
52
+ .optional()
53
+ .transform((value) => (isKnown(value) ? value : null));
54
+ }
34
55
  // A dataset as read, in our names, so client_id is workspace_id, with the organisation it's in, so
35
56
  // a record of another one is caught; the public Dataset drops it. An object schema keeps only the
36
- // fields it names, so `secret`, `secret_id`, `parameters`, `settings`, `meta` and the embedded
37
- // `client` and `organization` never reach a caller.
57
+ // fields it names, so `secret`, `secret_id`, `settings`, `meta` and the embedded `client` and
58
+ // `organization` never reach a caller.
38
59
  // #231: when it was made, and by whom, each null when left out; pulse-admin's empty default for the
39
60
  // maker's id counts as left out. The embedded `created_by` is never read (#67).
40
61
  // #293: its history, pulse-admin's `backfill` under our name (names.ts, D563), its values kept as
41
- // they came. A null, a value this version doesn't know, or none at all is null, never a guess and
42
- // never invalid, so a new backend value never makes a workspace's list unreadable (#265's rule).
43
- // `backfill_started` and `backfill_done` are a second copy, never read.
62
+ // they came. `backfill_started` and `backfill_done` are a second copy, never read.
44
63
  const HISTORIES = ['not_available', 'todo', 'started', 'done'];
45
64
  // Fails to compile when DatasetHistory gains a value HISTORIES doesn't hold (#303 round 2, O2.F2).
46
65
  const everyHistory = true;
47
66
  void everyHistory; // read once, so unused-locals checks keep it
48
- const KNOWN_HISTORIES = new Set(HISTORIES);
49
- const isHistory = (value) => typeof value === 'string' && KNOWN_HISTORIES.has(value);
50
- // `.optional()` is what lets the key be missing: without it, zod answers a missing key "expected
51
- // nonoptional" and the dataset is invalid (#303's code review, 8; the test with no backfill).
52
- // The name is the record's, so `backfill` never holds one of the SDK's values (finding 9).
53
- const history = z
54
- .unknown()
55
- .optional()
56
- .transform((value) => (isHistory(value) ? value : null));
67
+ // #343: its refresh status, pulse-admin's `data_refresh_status` under our name (names.ts, D563),
68
+ // its values kept as they came: DataRefreshStatus at pulse-admin dff6bf9b (domain/enums.py:30).
69
+ // What each one means, as DatasetRefreshStatus says it: pulse-admin dff6bf9b asks for a rebuild only
70
+ // from idle, completed or failed (custom/domain/connection/commands/change_custom_dimensions.py:42-48);
71
+ // pulse-dagster 040fcf4 takes up only a request (ops/transform.py:422-428), skips a dataset for a
72
+ // shared connector database or no enabled tables (:933-949), and writes failed only for a
73
+ // CalledProcessError (:1113-1125), a failed write back being only logged (:994-1023).
74
+ const REFRESH_STATUSES = ['idle', 'data_refresh_requested', 'data_refresh_in_progress', 'data_refresh_completed', 'data_refresh_failed'];
75
+ // Fails to compile when DatasetRefreshStatus gains a value REFRESH_STATUSES doesn't hold.
76
+ const everyRefreshStatus = true;
77
+ void everyRefreshStatus; // read once, so unused-locals checks keep it
57
78
  const zRecord = z.object({
58
79
  id,
59
80
  name: z.string(),
@@ -63,53 +84,176 @@ const zRecord = z.object({
63
84
  organization_id: id,
64
85
  created_on: createdOn,
65
86
  created_by_id: createdById,
66
- history,
87
+ // Our names, the record's after names.ts, so `backfill` or `data_refresh_status` never holds one
88
+ // of the SDK's values (#303's code review, 9).
89
+ history: knownOrNull(HISTORIES),
90
+ refresh_status: knownOrNull(REFRESH_STATUSES),
91
+ // #296: kept as it came, and only the public Dataset reads its account from it (accountOf), so it
92
+ // never reaches a caller, and a read for another call's sake never parses it. Any value reads: one
93
+ // accountOf can't read is no account, never an invalid dataset.
94
+ parameters: z.unknown().optional(),
67
95
  });
68
96
  const zOrganizationId = z.object({ id });
69
- const publicOf = ({ id: datasetId, name, workspace_id, type, active, created_on, created_by_id, history }) => ({ id: datasetId, name, workspace_id, type, active, created_on, created_by_id, history });
70
- const invalid = (issues) => ({ ok: false, error: { kind: 'invalid', issues } });
97
+ const publicOf = ({ id: datasetId, name, workspace_id, type, active, created_on, created_by_id, history, refresh_status, parameters }) => ({
98
+ id: datasetId,
99
+ name,
100
+ workspace_id,
101
+ type,
102
+ active,
103
+ created_on,
104
+ created_by_id,
105
+ history,
106
+ refresh_status,
107
+ account: accountOf(type, parameters),
108
+ });
71
109
  const refusedPath = { ok: false, error: { kind: 'refused', reason: 'path' } };
72
110
  /**
73
- * `flipstream.datasets.list()`: one page of a workspace's datasets, in the backend's own order, by
74
- * name (no sort is sent, D550). The workspace is read beside the list, by `readOwnWorkspace`'s
75
- * rules, so one nobody has is `not_found` and another organisation's is invalid, never an empty
76
- * page. A row of another workspace is invalid, naming its place; the caller's id may be any form
77
- * pulse-admin reads as the same UUID (sameUuid). A row of another organisation is invalid too,
78
- * naming its place, never an id. The organisation's failure, then the workspace's, then the
79
- * list's, is the answer, whichever finishes first. A bad limit or offset throws, as every list's
80
- * does.
111
+ * `flipstream.datasets.list()`: exactly one of a workspace's datasets (`workspace_id`) and your
112
+ * organisation's (`organization: true`, `listOrganizationDatasets`); both, neither, or an
113
+ * `organization` that isn't `true` is a TypeError, with nothing sent (#342, as #322's rule for
114
+ * log.list).
115
+ *
116
+ * A workspace's: one page of its datasets, in the backend's own order, by name (no sort is sent,
117
+ * D550). The workspace is read beside the list, by `readOwnWorkspaceWith`'s rules (D571), once your
118
+ * organisation and you are read: one you don't open is `not_found` with no list asked for, so its
119
+ * datasets, with their embedded sign-ins, are never fetched; one nobody has is `not_found` too, and
120
+ * another organisation's is invalid, never an empty page. A row of another workspace is invalid,
121
+ * naming its place; the caller's id may be any form pulse-admin reads as the same UUID (sameUuid).
122
+ * A row of another organisation is invalid too, naming its place, never an id. The organisation's
123
+ * failure, then yours, then the workspace's, then the list's, is the answer, whichever finishes
124
+ * first. A bad limit or offset throws, as every list's does.
81
125
  */
82
126
  export async function listDatasets(seam, read, request) {
83
- const { workspace_id, ...page } = request;
127
+ const { workspace_id, organization, ...page } = request;
128
+ const neither = 'datasets.list: give exactly one of workspace_id and organization: true';
129
+ if (organization !== undefined) {
130
+ if (organization !== true || workspace_id !== undefined)
131
+ throw new TypeError(neither);
132
+ return listOrganizationDatasets(seam, read, page);
133
+ }
134
+ if (workspace_id === undefined)
135
+ throw new TypeError(neither);
84
136
  const spec = seam.workspaceDatasets(workspace_id, page, zRecord, (dataset) => sameUuid(dataset.workspace_id, workspace_id));
85
137
  if (spec === null)
86
138
  return refusedPath;
87
- const [own, listed] = await Promise.all([readOwnWorkspace(seam, read, workspace_id, zOrganizationId), read(spec)]);
139
+ const own = await readOwnWorkspaceWith(seam, read, workspace_id, zOrganizationId, () => read(spec));
88
140
  if (!own.ok)
89
141
  return own;
142
+ const listed = own.data.alongside;
90
143
  if (!listed.ok)
91
144
  return listed;
92
- const foreign = listed.data.items.findIndex((dataset) => !sameUuid(dataset.organization_id, own.data.organization.id));
93
- if (foreign !== -1)
94
- return invalid(`records[${String(foreign)}] is another organisation's dataset`);
145
+ const foreign = foreignAt(listed.data.items, own.data.organization.id);
146
+ if (foreign !== null)
147
+ return foreign;
95
148
  return { ok: true, data: { ...listed.data, items: listed.data.items.map(publicOf) } };
96
149
  }
150
+ /** A page's first row of another organisation than `organizationId`, as `invalid` naming its place; null when there's none. */
151
+ function foreignAt(rows, organizationId) {
152
+ const at = rows.findIndex((row) => !sameUuid(row.organization_id, organizationId));
153
+ return at === -1 ? null : invalidAnswer(`records[${String(at)}] is another organisation's dataset`);
154
+ }
155
+ // #364: a row of the count's page, read for its scope alone, the workspace and organisation it's of
156
+ // (#366's code review, 1 and 2). An object schema keeps only these, so the rest of the row is never
157
+ // parsed, and a row bad anywhere else can't lose the count; it never reaches a caller.
158
+ const zScope = z.object({ workspace_id: id, organization_id: id });
159
+ /**
160
+ * `flipstream.datasets.count()` (#364, D566): how many datasets a workspace has, from pulse-admin's
161
+ * own `count`: the total of one page of its datasets with the smallest limit, 1, read as
162
+ * `datasets.list({ workspace_id })` reads a page (#366's code review, 1 and 2). Its shape is
163
+ * checked (a count no smaller than its rows, no more rows than the limit, and a row whenever the
164
+ * count is above 0), and its row is held to the workspace and your organisation, so a page that
165
+ * leaks another workspace's or organisation's dataset is invalid; of the row only those two are
166
+ * read, so one bad anywhere else can't lose the count. The workspace is read beside it, by
167
+ * `readOwnWorkspaceWith`'s rules, as for the list: one you don't open is `not_found` with no count
168
+ * asked for, one nobody has is `not_found` too, and another organisation's is invalid, never a
169
+ * count of 0. The organisation's failure, then yours, then the workspace's, then the count's, is
170
+ * the answer, whichever finishes first. A `workspace_id` that isn't a string is a TypeError, with
171
+ * nothing sent.
172
+ */
173
+ export async function countDatasets(seam, read, request) {
174
+ const { workspace_id } = request;
175
+ if (typeof workspace_id !== 'string')
176
+ throw new TypeError('datasets.count: workspace_id must be a string');
177
+ const spec = seam.workspaceDatasets(workspace_id, { limit: 1 }, zScope, (row) => sameUuid(row.workspace_id, workspace_id));
178
+ if (spec === null)
179
+ return refusedPath;
180
+ const own = await readOwnWorkspaceWith(seam, read, workspace_id, zOrganizationId, () => read(spec));
181
+ if (!own.ok)
182
+ return own;
183
+ const counted = own.data.alongside;
184
+ if (!counted.ok)
185
+ return counted;
186
+ // #366 round 2, O2.F1: at offset 0 a count above 0 comes with its first row, and that row is all the
187
+ // scope checks can read, so a page without one is a count nobody checked.
188
+ if (counted.data.total > 0 && counted.data.items.length === 0)
189
+ return invalidAnswer('records is empty on the first page of a count above 0, so no row could be held to the workspace and organisation');
190
+ return foreignAt(counted.data.items, own.data.organization.id) ?? { ok: true, data: { count: counted.data.total } };
191
+ }
192
+ /**
193
+ * The `organization: true` form of `flipstream.datasets.list()` (#342): one page of
194
+ * `GET /organizations/{id}/connections`, in the backend's own order, by name (D550). A bad limit or
195
+ * offset throws before anything is sent. Your organisation is read first, since its id names the
196
+ * route, and you (me()'s read, `readUser`) beside it; the datasets are asked for once your
197
+ * organisation is read, beside the rest of yours: two round trips in a row, under one deadline. A
198
+ * dataset of another organisation (D556), or in a workspace you don't open (`workspacesOpenedBy`,
199
+ * D560), makes the page invalid, naming its place (`heldToYou`). None is dropped, and no id is
200
+ * echoed. pulse-admin limits a viewer whose token names workspaces to those itself, so the SDK's
201
+ * check is the second guard. Your organisation's failure, then yours, then the datasets', is the
202
+ * answer; an organisation id that can't name the route is the organisation's failure, so it comes
203
+ * before yours (#342's code review, 2). The call answers, or rejects, with no read still being
204
+ * waited on: one on its way is ended, and a transport's rejection is the call's, the first read's
205
+ * to reject in the order started (the call scope, withReads, #349).
206
+ */
207
+ async function listOrganizationDatasets(seam, read, page) {
208
+ // Checked before your organisation is read, and sent as checked, as workspaces.list does.
209
+ const sent = pageQuery(page);
210
+ const organization = read(seam.myOrganization(zOrganizationId));
211
+ const caller = readUser(seam, read);
212
+ // Observed at once: a transport that rejects (the console brings its own) would otherwise leave
213
+ // your read's rejection unhandled while the organisation is read. It's still awaited, and thrown, below.
214
+ caller.catch(() => undefined);
215
+ const ours = await organization;
216
+ if (!ours.ok)
217
+ return ours;
218
+ // The organisation is checked below, so the dataset's message names it, as a workspace's list does.
219
+ const spec = seam.organizationDatasets(ours.data.id, sent, zRecord, () => true);
220
+ if (spec === null)
221
+ return invalidAnswer("the organisation's id can't name its datasets");
222
+ const [you, listed] = await Promise.all([caller, read(spec)]);
223
+ if (!you.ok)
224
+ return you;
225
+ if (!listed.ok)
226
+ return listed;
227
+ const datasets = listed.data.items;
228
+ return heldToYou(datasets, ours.data.id, you.data, 'dataset') ?? { ok: true, data: { ...listed.data, items: datasets.map(publicOf) } };
229
+ }
230
+ // pulse-admin's own 404 for a dataset nobody has (dff6bf9b, domain/connection/__init__.py:138-145):
231
+ // one in a workspace you don't open answers exactly this (D571, #372).
232
+ const noSuchDataset = () => notFound('CONNECTION_NOT_FOUND', 'Connection not found!');
97
233
  /**
98
- * The dataset `spec` reads, `datasetId`, read beside your organisation (D556): an answer that isn't
99
- * the dataset asked for, or is another organisation's, is invalid, echoing no id. The organisation's
100
- * failure, then the dataset's, is the answer. Both come back: the dataset, and your organisation, as
101
- * `organizationSchema` reads it, so only the reads that need more than its id ask for more (#280).
234
+ * The dataset `spec` reads, `datasetId`, read beside your organisation (D556) and you (`readUser`):
235
+ * an answer that isn't the dataset asked for, or is another organisation's, is invalid, echoing no
236
+ * id. One in a workspace you don't open (`opensWorkspace`, D560) is `not_found`, exactly as one
237
+ * nobody has, so a write after it sends nothing (D571, #372). The dataset names its workspace only
238
+ * once read, so a failure of its own read is the backend's, passed on as it is. The organisation's
239
+ * failure, then the dataset's, then yours, is the answer. Both come back: the dataset, and your
240
+ * organisation, as `organizationSchema` reads it, so only the reads that need more than its id ask
241
+ * for more (#280).
102
242
  */
103
243
  async function readOwnDataset(seam, read, spec, datasetId, organizationSchema) {
104
- const [organization, dataset] = await Promise.all([read(seam.myOrganization(organizationSchema)), read(spec)]);
244
+ const [organization, dataset, you] = await Promise.all([read(seam.myOrganization(organizationSchema)), read(spec), readUser(seam, read)]);
105
245
  if (!organization.ok)
106
246
  return organization;
107
247
  if (!dataset.ok)
108
248
  return dataset;
109
249
  if (!sameUuid(dataset.data.id, datasetId))
110
- return invalid("the dataset read isn't the one asked for");
250
+ return invalidAnswer("the dataset read isn't the one asked for");
111
251
  if (!sameUuid(dataset.data.organization_id, organization.data.id))
112
- return invalid("the dataset read is another organisation's");
252
+ return invalidAnswer("the dataset read is another organisation's");
253
+ if (!you.ok)
254
+ return you;
255
+ if (!opensWorkspace(you.data, dataset.data.workspace_id))
256
+ return noSuchDataset();
113
257
  return { ok: true, data: { dataset: dataset.data, organization: organization.data } };
114
258
  }
115
259
  /** `flipstream.datasets.get()`: one dataset, by its id, by `readOwnDataset`'s rules. */
@@ -122,9 +266,9 @@ export async function getDataset(seam, read, request) {
122
266
  }
123
267
  /**
124
268
  * `flipstream.datasets.delete()`: a D542 hand-off (D546), as `workspaces.delete` is. The dataset is
125
- * read by `readOwnDataset`'s rules, so one nobody has is `not_found` and another organisation's
126
- * invalid, before any hand-off. Then `needs_person`, never a write, with the console's dataset page
127
- * where a console can be named (os D1334).
269
+ * read by `readOwnDataset`'s rules, so one nobody has, or one in a workspace you don't open, is
270
+ * `not_found` and another organisation's invalid, before any hand-off. Then `needs_person`, never a
271
+ * write, with the console's dataset page where a console can be named (os D1334).
128
272
  */
129
273
  export async function handOffDatasetDelete(seam, read, request) {
130
274
  const spec = seam.dataset(request.dataset_id, zRecord);
@@ -139,31 +283,38 @@ export async function handOffDatasetDelete(seam, read, request) {
139
283
  /** `record` held to the dataset `was`: its id, its workspace and its organisation; null when it is. */
140
284
  function otherThan(record, was, what) {
141
285
  if (!sameUuid(record.id, was.id))
142
- return invalid(`the dataset ${what} isn't the one asked for`);
286
+ return invalidAnswer(`the dataset ${what} isn't the one asked for`);
143
287
  if (!sameUuid(record.workspace_id, was.workspace_id))
144
- return invalid(`the dataset ${what} is another workspace's`);
288
+ return invalidAnswer(`the dataset ${what} is another workspace's`);
145
289
  if (!sameUuid(record.organization_id, was.organization_id))
146
- return invalid(`the dataset ${what} is another organisation's`);
290
+ return invalidAnswer(`the dataset ${what} is another organisation's`);
147
291
  return null;
148
292
  }
149
293
  const stateOf = (active) => (active ? 'active' : 'paused');
294
+ /** A failure's status, when an answer came with one. */
295
+ const statusOf = (error) => ('status' in error ? error.status : undefined);
150
296
  /** A failure as far as it may be told: its kind, and its status when it has one, never a value. */
151
- const kindOf = (error) => ('status' in error && error.status !== undefined ? `${error.kind} ${String(error.status)}` : error.kind);
297
+ const kindOf = (error) => {
298
+ const status = statusOf(error);
299
+ return status === undefined ? error.kind : `${error.kind} ${String(status)}`;
300
+ };
152
301
  // The kinds that already say a write may have been made, kept as they come after it: every other
153
302
  // kind (a 4xx refusal, refused, no_token) would say nothing was written (#272 round 3).
154
303
  const MAY_HAVE_WRITTEN = new Set(['timeout', 'aborted', 'cancelled', 'unavailable', 'invalid']);
155
304
  /**
156
- * `flipstream.datasets.pause()` and `resume()` (#212): `active` set as asked, by D557's rules. Before
157
- * anything is sent, a key other than `dataset_id` is `refused` (`fields`), and an id that isn't a
158
- * string is a TypeError. The dataset is read fresh, past pulse-admin's cache, beside your
159
- * organisation (`readOwnDataset`). Then one PUT sends `{ active }` alone (os D313): the same PUT
160
- * whatever it was, so each verb is idempotent. Its answer is held to the dataset, its workspace,
161
- * your organisation and the `active` asked for. Then the dataset is read fresh again, and that read
162
- * is the answer, held the same way: pulse-admin can answer a PUT with what was sent without storing
163
- * it, so only the read shows the write held (#272 round 1). That read comes after the write was
164
- * sent, so a failure of it that would say nothing was written (a 4xx kind, `refused`, `no_token`)
165
- * is `invalid`, naming its kind (#272 round 2); a `timeout`, `aborted`, `cancelled`, `unavailable`
166
- * or `invalid` already says the write may have been made, and keeps its kind (#272 round 3).
305
+ * `flipstream.datasets.pause()` and `resume()` (#212): `active` set as asked, by D557's rules.
306
+ * Before anything is sent, a key other than `dataset_id` is `refused` (`fields`), and an id that
307
+ * isn't a string is a TypeError. The dataset is read fresh, past pulse-admin's cache, by
308
+ * `readOwnDataset`'s rules, so one in a workspace you don't open is `not_found`, with nothing
309
+ * written. Then one PUT sends `{ active }` alone (os D313): the same PUT whatever it was, so each
310
+ * verb is idempotent. Its answer is held to the dataset, its workspace, your organisation and the
311
+ * `active` asked for. Then the dataset is read fresh again, and that read is the answer, held the
312
+ * same way: pulse-admin can answer a PUT with what was sent without storing it, so only the read
313
+ * shows the write held (#272 round 1). That read comes after the write was sent, so a failure of it
314
+ * that would say nothing was written (a 4xx kind, `refused`, `no_token`) is `invalid`, naming its
315
+ * kind (#272 round 2), with the status that read answered, when it had one (#371's code review, 3);
316
+ * a `timeout`, `aborted`, `cancelled`, `unavailable` or `invalid` already says the write may have
317
+ * been made, and keeps its kind (#272 round 3).
167
318
  */
168
319
  async function setActive(seam, send, call, request, active) {
169
320
  const refused = unsent(request, ['dataset_id']);
@@ -190,15 +341,15 @@ async function setActive(seam, send, call, request, active) {
190
341
  if (wrong !== null)
191
342
  return wrong;
192
343
  if (written.data.active !== active)
193
- return invalid(`the dataset written is ${stateOf(written.data.active)}, not ${stateOf(active)} as asked`);
344
+ return invalidAnswer(`the dataset written is ${stateOf(written.data.active)}, not ${stateOf(active)} as asked`);
194
345
  const read = await send(after);
195
346
  if (!read.ok)
196
- return MAY_HAVE_WRITTEN.has(read.error.kind) ? read : invalid(`the write was sent, and the read after it failed: ${kindOf(read.error)}`);
347
+ return MAY_HAVE_WRITTEN.has(read.error.kind) ? read : invalidWith(`the write was sent, and the read after it failed: ${kindOf(read.error)}`, statusOf(read.error));
197
348
  const moved = otherThan(read.data, was, 'read after the write');
198
349
  if (moved !== null)
199
350
  return moved;
200
351
  if (read.data.active !== active)
201
- return invalid(`the dataset read after the write is ${stateOf(read.data.active)}, not ${stateOf(active)} as asked: the write may not have been stored`);
352
+ return invalidAnswer(`the dataset read after the write is ${stateOf(read.data.active)}, not ${stateOf(active)} as asked: the write may not have been stored`);
202
353
  return { ok: true, data: publicOf(read.data) };
203
354
  }
204
355
  /** `flipstream.datasets.pause()`: `active` false, by `setActive`'s rules. */
@@ -1 +1 @@
1
- {"version":3,"file":"datasets.js","sourceRoot":"","sources":["../../src/api/datasets.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAIvB,OAAO,EAAE,WAAW,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAA;AAChE,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AAGnC,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AACrD,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACpC,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AAmClD;;;GAGG;AACH,MAAM,aAAa,GAAG;IACpB,oBAAoB;IACpB,uBAAuB;IACvB,YAAY;IACZ,yBAAyB;IACzB,eAAe;IACf,cAAc;IACd,OAAO;IACP,SAAS;IACT,UAAU;IACV,gBAAgB;IAChB,oBAAoB;IACpB,uBAAuB;IACvB,mBAAmB;IACnB,4BAA4B;IAC5B,6BAA6B;IAC7B,yBAAyB;IACzB,qBAAqB;CACoB,CAAA;AAC3C,wEAAwE;AACxE,MAAM,SAAS,GAA0F,IAAI,CAAA;AAC7G,KAAK,SAAS,CAAA,CAAC,6CAA6C;AAuD5D,MAAM,EAAE,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAA;AAE5B,mGAAmG;AACnG,kGAAkG;AAClG,+FAA+F;AAC/F,oDAAoD;AACpD,oGAAoG;AACpG,gFAAgF;AAChF,kGAAkG;AAClG,kGAAkG;AAClG,iGAAiG;AACjG,wEAAwE;AACxE,MAAM,SAAS,GAAG,CAAC,eAAe,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,CAA8C,CAAA;AAC3G,mGAAmG;AACnG,MAAM,YAAY,GAAyF,IAAI,CAAA;AAC/G,KAAK,YAA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,IAAI;QAAE,OAAO,KAAK,CAAA;IAChC,IAAI,IAAI,CAAC,IAAI,CAAC,MAAM,KAAK,MAAM;QAAE,OAAO,aAAa,CAAC,uCAAuC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,OAAO,CAAC,MAAM,CAAC,+CAA+C,CAAC,CAAA;IAC9L,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAA;AAChD,CAAC;AAED,6EAA6E;AAC7E,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,IAAa,EAAE,IAAU,EAAE,OAAwC,EAA+B,EAAE,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,CAAC,CAAA;AAEhL,6EAA6E;AAC7E,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,IAAa,EAAE,IAAU,EAAE,OAAwC,EAA+B,EAAE,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,CAAC,CAAA;AAEjL,+GAA+G;AAC/G,MAAM,UAAU,gBAAgB;IAC9B,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,GAAG,aAAa,CAAC,EAAE,CAAA;AAC/C,CAAC"}
@@ -1,9 +1,10 @@
1
+ export type { DatasetAccount } from './account.js';
1
2
  export type { Credential } from './credentials.js';
2
- export type { Dataset, DatasetHistory, DatasetListRequest, DatasetType } from './datasets.js';
3
- export type { LogAddRequest, LogEntry, LogListRequest, LogUpdateRequest } from './log.js';
3
+ export type { Dataset, DatasetHistory, DatasetListRequest, DatasetOrganizationListRequest, DatasetRefreshStatus, DatasetType } from './datasets.js';
4
+ export type { LogAddRequest, LogEntry, LogListRequest, LogMemberListRequest, LogUpdateRequest } from './log.js';
4
5
  export type { Me, Organization, OrganizationAccess } from './me.js';
5
6
  export type { Member } from './members.js';
6
7
  export type { Page, PageRequest } from './page.js';
7
8
  export type { Balance, Ledger, Transaction } from './wallet.js';
8
- export type { Workspace } from './workspaces.js';
9
+ export type { Workspace, WorkspaceServices } from './workspaces.js';
9
10
  export type { Role } from '../core/names.js';
package/dist/api/log.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import type { ApiResult } from '../core/result.js';
2
2
  import type { Backend } from './backend.js';
3
3
  import type { Page } from './page.js';
4
- import type { Read } from './me.js';
4
+ import { type Read } from './me.js';
5
5
  /** A logbook entry (#218): a note on a time range in a workspace, such as a launch or a migration. */
6
6
  export interface LogEntry {
7
7
  readonly id: string;
@@ -20,9 +20,23 @@ export interface LogEntry {
20
20
  */
21
21
  readonly created_by_id: string | null;
22
22
  }
23
- /** What `flipstream.log.list()` takes: the workspace, and the page, as every list does. */
23
+ /** What `flipstream.log.list()` takes for a workspace's logbook: the workspace, and the page, as every list does. */
24
24
  export interface LogListRequest {
25
25
  readonly workspace_id: string;
26
+ /** Never beside `workspace_id`: one member's entries are a `LogMemberListRequest`. */
27
+ readonly member_id?: never;
28
+ /** At most 1,000, and 100 when left out. */
29
+ readonly limit?: number;
30
+ readonly offset?: number;
31
+ }
32
+ /**
33
+ * What `flipstream.log.list()` takes for one member's entries, in every workspace of your organisation
34
+ * (#295): the member, and the page, as every list does.
35
+ */
36
+ export interface LogMemberListRequest {
37
+ readonly member_id: string;
38
+ /** Never beside `member_id`: a workspace's logbook is a `LogListRequest`. */
39
+ readonly workspace_id?: never;
26
40
  /** At most 1,000, and 100 when left out. */
27
41
  readonly limit?: number;
28
42
  readonly offset?: number;
@@ -48,20 +62,25 @@ export interface LogUpdateRequest {
48
62
  readonly end_date?: string;
49
63
  }
50
64
  /**
51
- * `flipstream.log.list()`: one page of a workspace's logbook, in the backend's own order, newest
52
- * first (no sort is sent, D550). The workspace is read beside the list, by `readOwnWorkspace`'s
53
- * rules (D556, as amended), so one nobody has is `not_found` and another organisation's is invalid,
65
+ * `flipstream.log.list()`: exactly one of a workspace's logbook (`workspace_id`) and one member's
66
+ * entries (`member_id`, `listMemberLog`); both, or neither, is a TypeError, with nothing sent (#295).
67
+ *
68
+ * A workspace's: one page of its logbook, in the backend's own order, newest first (no sort is
69
+ * sent, D550). The workspace is read beside the list, by `readOwnWorkspaceWith`'s rules (D556, as
70
+ * amended; D571), once your organisation and you are read: one you don't open is `not_found` with
71
+ * no list asked for, one nobody has is `not_found` too, and another organisation's is invalid,
54
72
  * never an empty page. An entry of another workspace is invalid, naming its place; the caller's id
55
- * may be any form pulse-admin reads as the same UUID (sameUuid). An entry of another organisation is
56
- * invalid too, naming its place, never an id (D556). The organisation's failure, then the
57
- * workspace's, then the list's, is the answer, whichever finishes first. A bad limit or offset
58
- * throws, as every list's does.
73
+ * may be any form pulse-admin reads as the same UUID (sameUuid). An entry of another organisation
74
+ * is invalid too, naming its place, never an id (D556). The organisation's failure, then yours,
75
+ * then the workspace's, then the list's, is the answer, whichever finishes first. A bad limit or
76
+ * offset throws, as every list's does.
59
77
  */
60
- export declare function listLog(seam: Backend, read: Read, request: LogListRequest): Promise<ApiResult<Page<LogEntry>>>;
78
+ export declare function listLog(seam: Backend, read: Read, request: LogListRequest | LogMemberListRequest): Promise<ApiResult<Page<LogEntry>>>;
61
79
  /**
62
- * `flipstream.log.get()`: one logbook entry, by its id, read beside your organisation (D556): an
80
+ * `flipstream.log.get()`: one logbook entry, by its id, by `readOwnEntry`'s rules (D556, D571): an
63
81
  * answer that isn't the entry asked for, or is another organisation's, is invalid, echoing no id,
64
- * as workspaces.get()'s is. The organisation's failure, then the entry's, is the answer.
82
+ * as workspaces.get()'s is, and one in a workspace you don't open is `not_found`. The
83
+ * organisation's failure, then the entry's, then yours, is the answer.
65
84
  */
66
85
  export declare function getLog(seam: Backend, read: Read, request: {
67
86
  readonly log_id: string;
@@ -70,25 +89,27 @@ export declare function getLog(seam: Backend, read: Read, request: {
70
89
  * `flipstream.log.add()`: a new entry in a workspace's logbook (#219), by D557's rules. Before
71
90
  * anything is sent, a key it doesn't send is `refused` (`fields`), and a description that isn't a
72
91
  * non-blank string, a time it can't read, or a start after the end is a TypeError. Then the
73
- * workspace is proved yours (`readOwnWorkspace`: one nobody has is `not_found`, another
74
- * organisation's `invalid`, with nothing written), and one POST sends the five fields, the times
75
- * as UTC instants. The answer is the entry made, held to that workspace and organisation.
92
+ * workspace is proved yours (`readOwnWorkspace`: one nobody has, or one you don't open, is
93
+ * `not_found`, another organisation's `invalid`, with nothing written), and one POST sends the five
94
+ * fields, the times as UTC instants. The answer is the entry made, held to that workspace and
95
+ * organisation.
76
96
  */
77
97
  export declare function addLog(seam: Backend, send: Read, request: LogAddRequest): Promise<ApiResult<LogEntry>>;
78
98
  /**
79
- * `flipstream.log.update()`: an entry's words or range changed (#219), by D557's rules: refused keys
80
- * and TypeErrors as `add()`'s, and at least one change. The entry is read first, beside your
81
- * organisation (`readOwnEntry`). Then one PUT sends the contract's five fields: the changed ones,
82
- * times as UTC instants, and the rest exactly as stored. When it gives a time, a start after the
83
- * end, the stored one included, is a TypeError, with nothing written. The answer is held to the
84
- * entry, its workspace and your organisation.
99
+ * `flipstream.log.update()`: an entry's words or range changed (#219), by D557's rules: refused
100
+ * keys and TypeErrors as `add()`'s, and at least one change. The entry is read first, by
101
+ * `readOwnEntry`'s rules, so one in a workspace you don't open is `not_found`, with nothing
102
+ * written. Then one PUT sends the contract's five fields: the changed ones, times as UTC instants,
103
+ * and the rest exactly as stored. When it gives a time, a start after the end, the stored one
104
+ * included, is a TypeError, with nothing written. The answer is held to the entry, its workspace
105
+ * and your organisation.
85
106
  */
86
107
  export declare function updateLog(seam: Backend, send: Read, request: LogUpdateRequest): Promise<ApiResult<LogEntry>>;
87
108
  /**
88
109
  * `flipstream.log.remove()`: an entry removed (#219), directly, not handed off: D542's hand-offs
89
- * are workspaces, datasets and members. A key it doesn't send is `refused`. The entry is read first,
90
- * beside your organisation (`readOwnEntry`), then one DELETE; its answer holds nothing, so an ok is
91
- * `null`.
110
+ * are workspaces, datasets and members. A key it doesn't send is `refused`. The entry is read
111
+ * first, by `readOwnEntry`'s rules, so one in a workspace you don't open is `not_found`, with
112
+ * nothing removed; then one DELETE; its answer holds nothing, so an ok is `null`.
92
113
  */
93
114
  export declare function removeLog(seam: Backend, send: Read, request: {
94
115
  readonly log_id: string;