@flipstream/sdk 0.11.0 → 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 (85) hide show
  1. package/CHANGELOG.md +48 -0
  2. package/README.md +97 -412
  3. package/dist/api/backend.d.ts +10 -0
  4. package/dist/api/backend.js +24 -4
  5. package/dist/api/backend.js.map +1 -1
  6. package/dist/api/credentials.js +4 -4
  7. package/dist/api/credentials.js.map +1 -1
  8. package/dist/api/datasets.d.ts +82 -14
  9. package/dist/api/datasets.js +193 -57
  10. package/dist/api/datasets.js.map +1 -1
  11. package/dist/api/index.d.ts +1 -1
  12. package/dist/api/log.d.ts +25 -20
  13. package/dist/api/log.js +63 -48
  14. package/dist/api/log.js.map +1 -1
  15. package/dist/api/me.js +7 -4
  16. package/dist/api/me.js.map +1 -1
  17. package/dist/api/members.d.ts +34 -1
  18. package/dist/api/members.js +67 -27
  19. package/dist/api/members.js.map +1 -1
  20. package/dist/api/wallet.d.ts +8 -5
  21. package/dist/api/wallet.js +36 -24
  22. package/dist/api/wallet.js.map +1 -1
  23. package/dist/api/workspaces.d.ts +28 -7
  24. package/dist/api/workspaces.js +46 -16
  25. package/dist/api/workspaces.js.map +1 -1
  26. package/dist/auth/discovery.d.ts +19 -6
  27. package/dist/auth/discovery.js +25 -4
  28. package/dist/auth/discovery.js.map +1 -1
  29. package/dist/auth/signIn.d.ts +18 -14
  30. package/dist/auth/signIn.js +29 -22
  31. package/dist/auth/signIn.js.map +1 -1
  32. package/dist/core/call.d.ts +4 -1
  33. package/dist/core/call.js +26 -6
  34. package/dist/core/call.js.map +1 -1
  35. package/dist/core/deadline.d.ts +30 -0
  36. package/dist/core/deadline.js +51 -0
  37. package/dist/core/deadline.js.map +1 -0
  38. package/dist/core/invalid.d.ts +7 -0
  39. package/dist/core/invalid.js +22 -0
  40. package/dist/core/invalid.js.map +1 -0
  41. package/dist/core/names.d.ts +13 -2
  42. package/dist/core/names.js +11 -2
  43. package/dist/core/names.js.map +1 -1
  44. package/dist/core/notFound.d.ts +8 -0
  45. package/dist/core/notFound.js +8 -0
  46. package/dist/core/notFound.js.map +1 -0
  47. package/dist/core/result.d.ts +17 -12
  48. package/dist/core/result.js +5 -5
  49. package/dist/core/result.js.map +1 -1
  50. package/dist/core/retry.d.ts +5 -2
  51. package/dist/core/retry.js +6 -3
  52. package/dist/core/retry.js.map +1 -1
  53. package/dist/core/scope.d.ts +20 -0
  54. package/dist/core/scope.js +54 -0
  55. package/dist/core/scope.js.map +1 -0
  56. package/dist/flipstream.d.ts +136 -69
  57. package/dist/flipstream.js +67 -45
  58. package/dist/flipstream.js.map +1 -1
  59. package/dist/node/clientSecret.js +5 -5
  60. package/dist/node/clientSecret.js.map +1 -1
  61. package/dist/node/headless.d.ts +14 -6
  62. package/dist/node/headless.js +8 -6
  63. package/dist/node/headless.js.map +1 -1
  64. package/dist/node/index.d.ts +1 -1
  65. package/dist/node/index.js +1 -1
  66. package/dist/node/index.js.map +1 -1
  67. package/dist/node/keychainChild.js +26 -14
  68. package/dist/node/keychainChild.js.map +1 -1
  69. package/dist/node/keychainError.d.ts +3 -3
  70. package/dist/node/keychainStore.d.ts +10 -7
  71. package/dist/node/keychainStore.js +44 -23
  72. package/dist/node/keychainStore.js.map +1 -1
  73. package/dist/node/loopback.d.ts +8 -1
  74. package/dist/node/loopback.js +19 -2
  75. package/dist/node/loopback.js.map +1 -1
  76. package/dist/node/session.d.ts +17 -9
  77. package/dist/node/session.js +55 -44
  78. package/dist/node/session.js.map +1 -1
  79. package/dist/node/store.d.ts +35 -2
  80. package/dist/node/store.js +56 -12
  81. package/dist/node/store.js.map +1 -1
  82. package/dist/version.gen.js +1 -1
  83. package/docs/admin.md +503 -0
  84. package/docs/node-sign-in.md +60 -38
  85. package/package.json +1 -1
@@ -1,10 +1,15 @@
1
1
  import { z } from 'zod';
2
+ import { invalidAnswer, invalidWith } from '../core/invalid.js';
3
+ import { notFound } from '../core/notFound.js';
2
4
  import { accountOf } from './account.js';
3
5
  import { needsPerson, zHandOffOrganization } from './handoff.js';
4
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';
5
10
  import { createdById, createdOn } from './created.js';
6
11
  import { unsent } from './unsent.js';
7
- import { readOwnWorkspace } from './workspaces.js';
12
+ import { readOwnWorkspaceWith } from './workspaces.js';
8
13
  /**
9
14
  * Every `DatasetType`, in the spec's order. Admin 0.0.126 has no route for them, so
10
15
  * `datasetTypes.list()` answers this list, as MCP's `list_connection_types` does.
@@ -32,6 +37,21 @@ const DATASET_TYPES = [
32
37
  const everyType = true;
33
38
  void everyType; // read once, so unused-locals checks keep it
34
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
+ }
35
55
  // A dataset as read, in our names, so client_id is workspace_id, with the organisation it's in, so
36
56
  // a record of another one is caught; the public Dataset drops it. An object schema keeps only the
37
57
  // fields it names, so `secret`, `secret_id`, `settings`, `meta` and the embedded `client` and
@@ -39,22 +59,22 @@ const id = z.string().min(1);
39
59
  // #231: when it was made, and by whom, each null when left out; pulse-admin's empty default for the
40
60
  // maker's id counts as left out. The embedded `created_by` is never read (#67).
41
61
  // #293: its history, pulse-admin's `backfill` under our name (names.ts, D563), its values kept as
42
- // they came. A null, a value this version doesn't know, or none at all is null, never a guess and
43
- // never invalid, so a new backend value never makes a workspace's list unreadable (#265's rule).
44
- // `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.
45
63
  const HISTORIES = ['not_available', 'todo', 'started', 'done'];
46
64
  // Fails to compile when DatasetHistory gains a value HISTORIES doesn't hold (#303 round 2, O2.F2).
47
65
  const everyHistory = true;
48
66
  void everyHistory; // read once, so unused-locals checks keep it
49
- const KNOWN_HISTORIES = new Set(HISTORIES);
50
- const isHistory = (value) => typeof value === 'string' && KNOWN_HISTORIES.has(value);
51
- // `.optional()` is what lets the key be missing: without it, zod answers a missing key "expected
52
- // nonoptional" and the dataset is invalid (#303's code review, 8; the test with no backfill).
53
- // The name is the record's, so `backfill` never holds one of the SDK's values (finding 9).
54
- const history = z
55
- .unknown()
56
- .optional()
57
- .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
58
78
  const zRecord = z.object({
59
79
  id,
60
80
  name: z.string(),
@@ -64,14 +84,17 @@ const zRecord = z.object({
64
84
  organization_id: id,
65
85
  created_on: createdOn,
66
86
  created_by_id: createdById,
67
- 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),
68
91
  // #296: kept as it came, and only the public Dataset reads its account from it (accountOf), so it
69
92
  // never reaches a caller, and a read for another call's sake never parses it. Any value reads: one
70
93
  // accountOf can't read is no account, never an invalid dataset.
71
94
  parameters: z.unknown().optional(),
72
95
  });
73
96
  const zOrganizationId = z.object({ id });
74
- const publicOf = ({ id: datasetId, name, workspace_id, type, active, created_on, created_by_id, history, parameters }) => ({
97
+ const publicOf = ({ id: datasetId, name, workspace_id, type, active, created_on, created_by_id, history, refresh_status, parameters }) => ({
75
98
  id: datasetId,
76
99
  name,
77
100
  workspace_id,
@@ -80,51 +103,157 @@ const publicOf = ({ id: datasetId, name, workspace_id, type, active, created_on,
80
103
  created_on,
81
104
  created_by_id,
82
105
  history,
106
+ refresh_status,
83
107
  account: accountOf(type, parameters),
84
108
  });
85
- const invalid = (issues) => ({ ok: false, error: { kind: 'invalid', issues } });
86
109
  const refusedPath = { ok: false, error: { kind: 'refused', reason: 'path' } };
87
110
  /**
88
- * `flipstream.datasets.list()`: one page of a workspace's datasets, in the backend's own order, by
89
- * name (no sort is sent, D550). The workspace is read beside the list, by `readOwnWorkspace`'s
90
- * rules, so one nobody has is `not_found` and another organisation's is invalid, never an empty
91
- * page. A row of another workspace is invalid, naming its place; the caller's id may be any form
92
- * pulse-admin reads as the same UUID (sameUuid). A row of another organisation is invalid too,
93
- * naming its place, never an id. The organisation's failure, then the workspace's, then the
94
- * list's, is the answer, whichever finishes first. A bad limit or offset throws, as every list's
95
- * 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.
96
125
  */
97
126
  export async function listDatasets(seam, read, request) {
98
- 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);
99
136
  const spec = seam.workspaceDatasets(workspace_id, page, zRecord, (dataset) => sameUuid(dataset.workspace_id, workspace_id));
100
137
  if (spec === null)
101
138
  return refusedPath;
102
- 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));
103
140
  if (!own.ok)
104
141
  return own;
142
+ const listed = own.data.alongside;
105
143
  if (!listed.ok)
106
144
  return listed;
107
- const foreign = listed.data.items.findIndex((dataset) => !sameUuid(dataset.organization_id, own.data.organization.id));
108
- if (foreign !== -1)
109
- 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;
110
148
  return { ok: true, data: { ...listed.data, items: listed.data.items.map(publicOf) } };
111
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!');
112
233
  /**
113
- * The dataset `spec` reads, `datasetId`, read beside your organisation (D556): an answer that isn't
114
- * the dataset asked for, or is another organisation's, is invalid, echoing no id. The organisation's
115
- * failure, then the dataset's, is the answer. Both come back: the dataset, and your organisation, as
116
- * `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).
117
242
  */
118
243
  async function readOwnDataset(seam, read, spec, datasetId, organizationSchema) {
119
- 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)]);
120
245
  if (!organization.ok)
121
246
  return organization;
122
247
  if (!dataset.ok)
123
248
  return dataset;
124
249
  if (!sameUuid(dataset.data.id, datasetId))
125
- return invalid("the dataset read isn't the one asked for");
250
+ return invalidAnswer("the dataset read isn't the one asked for");
126
251
  if (!sameUuid(dataset.data.organization_id, organization.data.id))
127
- 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();
128
257
  return { ok: true, data: { dataset: dataset.data, organization: organization.data } };
129
258
  }
130
259
  /** `flipstream.datasets.get()`: one dataset, by its id, by `readOwnDataset`'s rules. */
@@ -137,9 +266,9 @@ export async function getDataset(seam, read, request) {
137
266
  }
138
267
  /**
139
268
  * `flipstream.datasets.delete()`: a D542 hand-off (D546), as `workspaces.delete` is. The dataset is
140
- * read by `readOwnDataset`'s rules, so one nobody has is `not_found` and another organisation's
141
- * invalid, before any hand-off. Then `needs_person`, never a write, with the console's dataset page
142
- * 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).
143
272
  */
144
273
  export async function handOffDatasetDelete(seam, read, request) {
145
274
  const spec = seam.dataset(request.dataset_id, zRecord);
@@ -154,31 +283,38 @@ export async function handOffDatasetDelete(seam, read, request) {
154
283
  /** `record` held to the dataset `was`: its id, its workspace and its organisation; null when it is. */
155
284
  function otherThan(record, was, what) {
156
285
  if (!sameUuid(record.id, was.id))
157
- return invalid(`the dataset ${what} isn't the one asked for`);
286
+ return invalidAnswer(`the dataset ${what} isn't the one asked for`);
158
287
  if (!sameUuid(record.workspace_id, was.workspace_id))
159
- return invalid(`the dataset ${what} is another workspace's`);
288
+ return invalidAnswer(`the dataset ${what} is another workspace's`);
160
289
  if (!sameUuid(record.organization_id, was.organization_id))
161
- return invalid(`the dataset ${what} is another organisation's`);
290
+ return invalidAnswer(`the dataset ${what} is another organisation's`);
162
291
  return null;
163
292
  }
164
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);
165
296
  /** A failure as far as it may be told: its kind, and its status when it has one, never a value. */
166
- 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
+ };
167
301
  // The kinds that already say a write may have been made, kept as they come after it: every other
168
302
  // kind (a 4xx refusal, refused, no_token) would say nothing was written (#272 round 3).
169
303
  const MAY_HAVE_WRITTEN = new Set(['timeout', 'aborted', 'cancelled', 'unavailable', 'invalid']);
170
304
  /**
171
- * `flipstream.datasets.pause()` and `resume()` (#212): `active` set as asked, by D557's rules. Before
172
- * anything is sent, a key other than `dataset_id` is `refused` (`fields`), and an id that isn't a
173
- * string is a TypeError. The dataset is read fresh, past pulse-admin's cache, beside your
174
- * organisation (`readOwnDataset`). Then one PUT sends `{ active }` alone (os D313): the same PUT
175
- * whatever it was, so each verb is idempotent. Its answer is held to the dataset, its workspace,
176
- * your organisation and the `active` asked for. Then the dataset is read fresh again, and that read
177
- * is the answer, held the same way: pulse-admin can answer a PUT with what was sent without storing
178
- * it, so only the read shows the write held (#272 round 1). That read comes after the write was
179
- * sent, so a failure of it that would say nothing was written (a 4xx kind, `refused`, `no_token`)
180
- * is `invalid`, naming its kind (#272 round 2); a `timeout`, `aborted`, `cancelled`, `unavailable`
181
- * 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).
182
318
  */
183
319
  async function setActive(seam, send, call, request, active) {
184
320
  const refused = unsent(request, ['dataset_id']);
@@ -205,15 +341,15 @@ async function setActive(seam, send, call, request, active) {
205
341
  if (wrong !== null)
206
342
  return wrong;
207
343
  if (written.data.active !== active)
208
- 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`);
209
345
  const read = await send(after);
210
346
  if (!read.ok)
211
- 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));
212
348
  const moved = otherThan(read.data, was, 'read after the write');
213
349
  if (moved !== null)
214
350
  return moved;
215
351
  if (read.data.active !== active)
216
- 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`);
217
353
  return { ok: true, data: publicOf(read.data) };
218
354
  }
219
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;AAGvB,OAAO,EAAE,SAAS,EAAuB,MAAM,cAAc,CAAA;AAE7D,OAAO,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I,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,6 +1,6 @@
1
1
  export type { DatasetAccount } from './account.js';
2
2
  export type { Credential } from './credentials.js';
3
- export type { Dataset, DatasetHistory, DatasetListRequest, DatasetType } from './datasets.js';
3
+ export type { Dataset, DatasetHistory, DatasetListRequest, DatasetOrganizationListRequest, DatasetRefreshStatus, DatasetType } from './datasets.js';
4
4
  export type { LogAddRequest, LogEntry, LogListRequest, LogMemberListRequest, LogUpdateRequest } from './log.js';
5
5
  export type { Me, Organization, OrganizationAccess } from './me.js';
6
6
  export type { Member } from './members.js';
package/dist/api/log.d.ts CHANGED
@@ -65,19 +65,22 @@ export interface LogUpdateRequest {
65
65
  * `flipstream.log.list()`: exactly one of a workspace's logbook (`workspace_id`) and one member's
66
66
  * entries (`member_id`, `listMemberLog`); both, or neither, is a TypeError, with nothing sent (#295).
67
67
  *
68
- * A workspace's: one page of its logbook, in the backend's own order, newest first (no sort is sent, D550). The workspace is read beside the list, by `readOwnWorkspace`'s
69
- * rules (D556, as amended), so one nobody has is `not_found` and another organisation's is invalid,
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,
70
72
  * never an empty page. An entry of another workspace is invalid, naming its place; the caller's id
71
- * may be any form pulse-admin reads as the same UUID (sameUuid). An entry of another organisation is
72
- * invalid too, naming its place, never an id (D556). The organisation's failure, then the
73
- * workspace's, then the list's, is the answer, whichever finishes first. A bad limit or offset
74
- * 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.
75
77
  */
76
78
  export declare function listLog(seam: Backend, read: Read, request: LogListRequest | LogMemberListRequest): Promise<ApiResult<Page<LogEntry>>>;
77
79
  /**
78
- * `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
79
81
  * answer that isn't the entry asked for, or is another organisation's, is invalid, echoing no id,
80
- * 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.
81
84
  */
82
85
  export declare function getLog(seam: Backend, read: Read, request: {
83
86
  readonly log_id: string;
@@ -86,25 +89,27 @@ export declare function getLog(seam: Backend, read: Read, request: {
86
89
  * `flipstream.log.add()`: a new entry in a workspace's logbook (#219), by D557's rules. Before
87
90
  * anything is sent, a key it doesn't send is `refused` (`fields`), and a description that isn't a
88
91
  * non-blank string, a time it can't read, or a start after the end is a TypeError. Then the
89
- * workspace is proved yours (`readOwnWorkspace`: one nobody has is `not_found`, another
90
- * organisation's `invalid`, with nothing written), and one POST sends the five fields, the times
91
- * 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.
92
96
  */
93
97
  export declare function addLog(seam: Backend, send: Read, request: LogAddRequest): Promise<ApiResult<LogEntry>>;
94
98
  /**
95
- * `flipstream.log.update()`: an entry's words or range changed (#219), by D557's rules: refused keys
96
- * and TypeErrors as `add()`'s, and at least one change. The entry is read first, beside your
97
- * organisation (`readOwnEntry`). Then one PUT sends the contract's five fields: the changed ones,
98
- * times as UTC instants, and the rest exactly as stored. When it gives a time, a start after the
99
- * end, the stored one included, is a TypeError, with nothing written. The answer is held to the
100
- * 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.
101
106
  */
102
107
  export declare function updateLog(seam: Backend, send: Read, request: LogUpdateRequest): Promise<ApiResult<LogEntry>>;
103
108
  /**
104
109
  * `flipstream.log.remove()`: an entry removed (#219), directly, not handed off: D542's hand-offs
105
- * are workspaces, datasets and members. A key it doesn't send is `refused`. The entry is read first,
106
- * beside your organisation (`readOwnEntry`), then one DELETE; its answer holds nothing, so an ok is
107
- * `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`.
108
113
  */
109
114
  export declare function removeLog(seam: Backend, send: Read, request: {
110
115
  readonly log_id: string;