@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
@@ -0,0 +1,50 @@
1
+ /** The account a dataset reads (#296): see `Dataset.account`. */
2
+ export interface DatasetAccount {
3
+ /**
4
+ * Its id as the backend holds it (D563): a string as stored, or a whole number from 1 to 2^53 - 1
5
+ * as its decimal string. Use it to find or send back the stored id; compare accounts by `shown`.
6
+ */
7
+ readonly id: string;
8
+ /**
9
+ * Its id as its source shows it, as the console shows it: trimmed, and a Google Ads id as
10
+ * `412-883-1024`. Compare two accounts of one dataset type by it, as the console's connect dialog
11
+ * does within one source (os connect/rows.ts:85-91 and :109-112 at 9687ac59), so one account
12
+ * stored in two forms is one. Across types, the same digits can name different accounts.
13
+ */
14
+ readonly shown: string;
15
+ }
16
+ /**
17
+ * Where each type keeps its account, in the order read: os's CONNECT, each type's `item`, then its
18
+ * `olderItem` (packages/libs/sources/src/connect/config.ts at os 9687ac59, last changed b876de40).
19
+ * Its writers store these: pulse-fe's buildConnectionParameters (4c4fed34) and pulse-admin's
20
+ * add_bulk (dff6bf9b); an older LinkedIn Ads row keeps `property` (pulse-fe#1940's audit). None for
21
+ * a type the console labels with none. Keyed by every DatasetType, so a type the SDK adds fails to
22
+ * compile until it's decided here.
23
+ */
24
+ export declare const ACCOUNT_KEYS: {
25
+ readonly google_analytics_4: readonly ["property"];
26
+ readonly google_search_console: readonly ["property"];
27
+ readonly google_ads: readonly ["property"];
28
+ readonly google_business_profile: readonly ["location"];
29
+ readonly google_sheets: readonly [];
30
+ readonly linkedin_ads: readonly ["account", "property"];
31
+ readonly pulse: readonly [];
32
+ readonly weather: readonly [];
33
+ readonly meta_ads: readonly ["account"];
34
+ readonly facebook_pages: readonly ["page"];
35
+ readonly llm_scrape_chatgpt: readonly [];
36
+ readonly llm_scrape_perplexity: readonly [];
37
+ readonly llm_scrape_gemini: readonly [];
38
+ readonly serp_scrape_google_organic: readonly [];
39
+ readonly serp_scrape_google_shopping: readonly [];
40
+ readonly serp_scrape_google_maps: readonly [];
41
+ readonly serp_scrape_youtube: readonly [];
42
+ };
43
+ /**
44
+ * The account a dataset of `type` reads, from its `parameters` (#296), as the console's
45
+ * `sourceAccount` reads it: the first of its type's keys that holds an id. Null when its type keeps
46
+ * none or isn't one the SDK knows, before `parameters` is parsed; when `parameters` isn't a string
47
+ * of a JSON object holding one; or when a key holds an id `idAt` refuses. Never a failure: it's a
48
+ * label, so the dataset still reads.
49
+ */
50
+ export declare function accountOf(type: string | null, parameters: unknown): DatasetAccount | null;
@@ -0,0 +1,102 @@
1
+ import { parseJson } from '../core/body.js';
2
+ /**
3
+ * Where each type keeps its account, in the order read: os's CONNECT, each type's `item`, then its
4
+ * `olderItem` (packages/libs/sources/src/connect/config.ts at os 9687ac59, last changed b876de40).
5
+ * Its writers store these: pulse-fe's buildConnectionParameters (4c4fed34) and pulse-admin's
6
+ * add_bulk (dff6bf9b); an older LinkedIn Ads row keeps `property` (pulse-fe#1940's audit). None for
7
+ * a type the console labels with none. Keyed by every DatasetType, so a type the SDK adds fails to
8
+ * compile until it's decided here.
9
+ */
10
+ export const ACCOUNT_KEYS = {
11
+ google_analytics_4: ['property'],
12
+ google_search_console: ['property'],
13
+ google_ads: ['property'],
14
+ google_business_profile: ['location'],
15
+ google_sheets: [],
16
+ linkedin_ads: ['account', 'property'],
17
+ pulse: [],
18
+ weather: [],
19
+ meta_ads: ['account'],
20
+ facebook_pages: ['page'],
21
+ llm_scrape_chatgpt: [],
22
+ llm_scrape_perplexity: [],
23
+ llm_scrape_gemini: [],
24
+ serp_scrape_google_organic: [],
25
+ serp_scrape_google_shopping: [],
26
+ serp_scrape_google_maps: [],
27
+ serp_scrape_youtube: [],
28
+ };
29
+ /** Whether `type` is one ACCOUNT_KEYS holds as its own, so `constructor` or `__proto__` never is. */
30
+ const keyed = (type) => Object.hasOwn(ACCOUNT_KEYS, type);
31
+ /** An own property's value, never one inherited. */
32
+ const own = (holder, key) => Object.getOwnPropertyDescriptor(holder, key)?.value;
33
+ /**
34
+ * The longest id read, in UTF-16 code units. The longest a writer stores is a Search Console
35
+ * property: `sc-domain:` and a domain of at most 253 characters (RFC 1035), 263 in all, or a URL
36
+ * prefix, a host and a short path. Every other source's id is under 40. A longer one is no account,
37
+ * never a label that breaks a caller's layout.
38
+ */
39
+ const MAX_ID = 512;
40
+ /**
41
+ * A control, format or separator character (Unicode's Cc, Cf, Zl and Zp), such as a terminal escape,
42
+ * a bidi override or U+2028: the class query/catalog.ts's `visible` escapes, so a viewer can't split
43
+ * or reorder a line. Kept as its own copy, since `visible` escapes with a global regex in another
44
+ * layer, while this refuses.
45
+ */
46
+ const UNPRINTABLE = /[\p{Cc}\p{Cf}\p{Zl}\p{Zp}]/u;
47
+ const ABSENT = { state: 'absent' };
48
+ const REFUSED = { state: 'refused' };
49
+ /**
50
+ * `parameters[key].id`, as the console's `idAt` reads it: a string kept as stored, or a whole number
51
+ * as its decimal string. Absent, as in os, when the key holds no object, or its id is neither a
52
+ * string nor a finite number (JSON.parse reads 1e999 as Infinity), or is blank. Refused, failing
53
+ * closed, where os would show it:
54
+ * - a string longer than MAX_ID, or holding a character in UNPRINTABLE, since a caller prints it;
55
+ * - a finite number that isn't a safe integer from 1: a number past 2^53 was rounded by JSON.parse,
56
+ * so it would name another account, and no source's id is 0 or below.
57
+ * os also trims the id; here `id` keeps it as the backend holds it (D563), and `shown` trims.
58
+ */
59
+ function idAt(parameters, key) {
60
+ const holder = own(parameters, key);
61
+ if (typeof holder !== 'object' || holder === null)
62
+ return ABSENT;
63
+ const id = own(holder, 'id');
64
+ if (typeof id === 'number' && Number.isFinite(id))
65
+ return Number.isSafeInteger(id) && id > 0 ? { state: 'id', id: String(id) } : REFUSED;
66
+ if (typeof id !== 'string' || id.trim() === '')
67
+ return ABSENT;
68
+ return id.length > MAX_ID || UNPRINTABLE.test(id) ? REFUSED : { state: 'id', id };
69
+ }
70
+ /** A Google Ads customer id as Google writes it, as the console's `googleAdsId`: ten digits as 123-456-7890, anything else as it is. */
71
+ function googleAdsId(id) {
72
+ const digits = id.replaceAll('-', '');
73
+ return /^\d{10}$/.test(digits) ? `${digits.slice(0, 3)}-${digits.slice(3, 6)}-${digits.slice(6)}` : id;
74
+ }
75
+ /**
76
+ * The account a dataset of `type` reads, from its `parameters` (#296), as the console's
77
+ * `sourceAccount` reads it: the first of its type's keys that holds an id. Null when its type keeps
78
+ * none or isn't one the SDK knows, before `parameters` is parsed; when `parameters` isn't a string
79
+ * of a JSON object holding one; or when a key holds an id `idAt` refuses. Never a failure: it's a
80
+ * label, so the dataset still reads.
81
+ */
82
+ export function accountOf(type, parameters) {
83
+ if (type === null || !keyed(type))
84
+ return null;
85
+ const keys = ACCOUNT_KEYS[type];
86
+ if (keys.length === 0 || typeof parameters !== 'string')
87
+ return null;
88
+ const parsed = parseJson(parameters);
89
+ if (!parsed.ok || typeof parsed.value !== 'object' || parsed.value === null)
90
+ return null;
91
+ for (const key of keys) {
92
+ const read = idAt(parsed.value, key);
93
+ if (read.state === 'absent')
94
+ continue;
95
+ if (read.state === 'refused')
96
+ return null;
97
+ const trimmed = read.id.trim();
98
+ return { id: read.id, shown: type === 'google_ads' ? googleAdsId(trimmed) : trimmed };
99
+ }
100
+ return null;
101
+ }
102
+ //# sourceMappingURL=account.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"account.js","sourceRoot":"","sources":["../../src/api/account.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AA8B3C;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,kBAAkB,EAAE,CAAC,UAAU,CAAC;IAChC,qBAAqB,EAAE,CAAC,UAAU,CAAC;IACnC,UAAU,EAAE,CAAC,UAAU,CAAC;IACxB,uBAAuB,EAAE,CAAC,UAAU,CAAC;IACrC,aAAa,EAAE,EAAE;IACjB,YAAY,EAAE,CAAC,SAAS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AAM,CAAC,EAAE,IAAI,OAAO,MAAM,CAAC,KAAK,KAAK,QAAQ,IAAI,MAAM,CAAC,KAAK,KAAK,IAAI;QAAE,OAAO,IAAI,CAAA;IACxF,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;QACvB,MAAM,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,GAAG,CAAC,CAAA;QACpC,IAAI,IAAI,CAAC,KAAK,KAAK,QAAQ;YAAE,SAAQ;QACrC,IAAI,IAAI,CAAC,KAAK,KAAK,SAAS;YAAE,OAAO,IAAI,CAAA;QACzC,MAAM,OAAO,GAAG,IAAI,CAAC,EAAE,CAAC,IAAI,EAAE,CAAA;QAC9B,OAAO,EAAE,EAAE,EAAE,IAAI,CAAC,EAAE,EAAE,KAAK,EAAE,IAAI,KAAK,YAAY,CAAC,CAAC,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE,CAAA;IACvF,CAAC;IACD,OAAO,IAAI,CAAA;AACb,CAAC"}
@@ -116,6 +116,14 @@ export declare function backend(hosts: BackendHosts): {
116
116
  * `order_by`, at 72ec7efe). Null when `workspaceId` can't stay one path segment.
117
117
  */
118
118
  workspaceLog<T>(workspaceId: string, page: PageRequest, item: z.ZodType<T>, inScope: (item: T) => boolean): CallSpec<Page<T>> | null;
119
+ /**
120
+ * `GET /users/{id}/event-logs`: one page of the log entries one person wrote, in every workspace
121
+ * of the organisation (#295). pulse-admin reads them from the same event logs as a workspace's,
122
+ * filtered on `created_by_id`, under the same role check, which limits a viewer whose token names
123
+ * workspaces to those (at dff6bf9b). No `sort` is sent (D550), so the order is the workspace
124
+ * log's, `-created_on`, newest first. Null when `memberId` can't stay one path segment.
125
+ */
126
+ memberLog<T>(memberId: string, page: PageRequest, item: z.ZodType<T>, inScope: (item: T) => boolean): CallSpec<Page<T>> | null;
119
127
  /**
120
128
  * `GET /clients/{id}/connections`: one page of a workspace's datasets, pulse-admin's connections.
121
129
  * Never the global `GET /connections`, which ignores a workspace filter. No `sort` is sent
@@ -123,6 +131,16 @@ export declare function backend(hosts: BackendHosts): {
123
131
  * 72ec7efe), with no tiebreaker. Null when `workspaceId` can't stay one path segment.
124
132
  */
125
133
  workspaceDatasets<T>(workspaceId: string, page: PageRequest, item: z.ZodType<T>, inScope: (item: T) => boolean): CallSpec<Page<T>> | null;
134
+ /**
135
+ * `GET /organizations/{id}/connections`: one page of the organisation's datasets, in every
136
+ * workspace (#342). pulse-admin reads them from the same connections as a workspace's, filtered on
137
+ * `organization_id` (OrganizationService.find_connections, at dff6bf9b), under the same role check
138
+ * (`CONNECTIONS`), which limits a viewer whose token names workspaces to those
139
+ * (limit_to_external_clients). No `sort` is sent (D550), so the order is a workspace's, `name`,
140
+ * with no tiebreaker. It keeps no body's text, as `workspaceDatasets` doesn't (#279). Null when
141
+ * `organizationId` can't stay one path segment.
142
+ */
143
+ organizationDatasets<T>(organizationId: string, page: PageRequest, item: z.ZodType<T>, inScope: (item: T) => boolean): CallSpec<Page<T>> | null;
126
144
  /**
127
145
  * `GET /connections/{id}`: one dataset, pulse-admin's connection. Its `refresh`, a read past
128
146
  * pulse-admin's cache, isn't sent. Its answer embeds the dataset's sign-in, so no body's text is
@@ -117,6 +117,13 @@ export function getList(base, call, path, page, concepts, item, inScope, query =
117
117
  schema: pageOf(inOurNames(call, concepts, item), sent, inScope),
118
118
  };
119
119
  }
120
+ /**
121
+ * The concepts a pulse-admin connection, a dataset, is read and written in: its workspace, its
122
+ * history (#293) and its refresh status (#343). One list for every connection call (a workspace's
123
+ * list, the organisation's list, the get, the fresh get and the PUT), so a field renamed for one is
124
+ * renamed for all (#348's code review, 7).
125
+ */
126
+ const CONNECTION_CONCEPTS = ['workspace', 'history', 'refresh_status'];
120
127
  /** Every operation on today's backends, each given the schema its answer is read with. */
121
128
  export function backend(hosts) {
122
129
  return {
@@ -215,6 +222,17 @@ export function backend(hosts) {
215
222
  const name = segment(workspaceId);
216
223
  return name === null ? null : getList(hosts.admin, { service: 'admin', endpoint: 'admin.clients.event-logs' }, `/clients/${name}/event-logs`, page, ['workspace'], item, inScope);
217
224
  },
225
+ /**
226
+ * `GET /users/{id}/event-logs`: one page of the log entries one person wrote, in every workspace
227
+ * of the organisation (#295). pulse-admin reads them from the same event logs as a workspace's,
228
+ * filtered on `created_by_id`, under the same role check, which limits a viewer whose token names
229
+ * workspaces to those (at dff6bf9b). No `sort` is sent (D550), so the order is the workspace
230
+ * log's, `-created_on`, newest first. Null when `memberId` can't stay one path segment.
231
+ */
232
+ memberLog(memberId, page, item, inScope) {
233
+ const name = segment(memberId);
234
+ return name === null ? null : getList(hosts.admin, { service: 'admin', endpoint: 'admin.users.event-logs' }, `/users/${name}/event-logs`, page, ['workspace'], item, inScope);
235
+ },
218
236
  /**
219
237
  * `GET /clients/{id}/connections`: one page of a workspace's datasets, pulse-admin's connections.
220
238
  * Never the global `GET /connections`, which ignores a workspace filter. No `sort` is sent
@@ -225,7 +243,20 @@ export function backend(hosts) {
225
243
  const name = segment(workspaceId);
226
244
  // A connection embeds its sign-in (pulse-admin dff6bf9b, connection _enrich), so, as on the
227
245
  // sign-in routes, no body's text is ever kept (#279). The allowlist keeps the rest out.
228
- return name === null ? null : { ...getList(hosts.admin, { service: 'admin', endpoint: 'admin.clients.connections' }, `/clients/${name}/connections`, page, ['workspace', 'history'], item, inScope), keepsNoText: true };
246
+ return name === null ? null : { ...getList(hosts.admin, { service: 'admin', endpoint: 'admin.clients.connections' }, `/clients/${name}/connections`, page, CONNECTION_CONCEPTS, item, inScope), keepsNoText: true };
247
+ },
248
+ /**
249
+ * `GET /organizations/{id}/connections`: one page of the organisation's datasets, in every
250
+ * workspace (#342). pulse-admin reads them from the same connections as a workspace's, filtered on
251
+ * `organization_id` (OrganizationService.find_connections, at dff6bf9b), under the same role check
252
+ * (`CONNECTIONS`), which limits a viewer whose token names workspaces to those
253
+ * (limit_to_external_clients). No `sort` is sent (D550), so the order is a workspace's, `name`,
254
+ * with no tiebreaker. It keeps no body's text, as `workspaceDatasets` doesn't (#279). Null when
255
+ * `organizationId` can't stay one path segment.
256
+ */
257
+ organizationDatasets(organizationId, page, item, inScope) {
258
+ const name = segment(organizationId);
259
+ return name === null ? null : { ...getList(hosts.admin, { service: 'admin', endpoint: 'admin.organizations.connections' }, `/organizations/${name}/connections`, page, CONNECTION_CONCEPTS, item, inScope), keepsNoText: true };
229
260
  },
230
261
  /**
231
262
  * `GET /connections/{id}`: one dataset, pulse-admin's connection. Its `refresh`, a read past
@@ -234,7 +265,7 @@ export function backend(hosts) {
234
265
  */
235
266
  dataset(id, schema) {
236
267
  const name = segment(id);
237
- return name === null ? null : { ...get(hosts.admin, { service: 'admin', endpoint: 'admin.connections.get' }, `/connections/${name}`, ['workspace', 'history'], schema), keepsNoText: true };
268
+ return name === null ? null : { ...get(hosts.admin, { service: 'admin', endpoint: 'admin.connections.get' }, `/connections/${name}`, CONNECTION_CONCEPTS, schema), keepsNoText: true };
238
269
  },
239
270
  /**
240
271
  * `GET /connections/{id}?refresh=true`: one dataset, read past pulse-admin's cache, before and
@@ -243,7 +274,7 @@ export function backend(hosts) {
243
274
  */
244
275
  freshDataset(id, schema) {
245
276
  const name = segment(id);
246
- return name === null ? null : { ...get(hosts.admin, { service: 'admin', endpoint: 'admin.connections.get' }, `/connections/${name}?refresh=true`, ['workspace', 'history'], schema), keepsNoText: true };
277
+ return name === null ? null : { ...get(hosts.admin, { service: 'admin', endpoint: 'admin.connections.get' }, `/connections/${name}?refresh=true`, CONNECTION_CONCEPTS, schema), keepsNoText: true };
247
278
  },
248
279
  /**
249
280
  * `PUT /connections/{id}` with `{ active }` alone (#212, os D313). pulse-admin's PUT takes
@@ -258,7 +289,7 @@ export function backend(hosts) {
258
289
  setDatasetActive(id, active, schema) {
259
290
  const name = segment(id);
260
291
  // Its answer is the connection, sign-in embedded, so no body's text is kept (#279).
261
- return name === null ? null : { ...put(hosts.admin, { service: 'admin', endpoint: 'admin.connections.update' }, `/connections/${name}`, ['workspace', 'history'], { active }, schema), keepsNoText: true };
292
+ return name === null ? null : { ...put(hosts.admin, { service: 'admin', endpoint: 'admin.connections.update' }, `/connections/${name}`, CONNECTION_CONCEPTS, { active }, schema), keepsNoText: true };
262
293
  },
263
294
  /**
264
295
  * `GET /organizations/{id}/secrets`: one page of the organisation's provider sign-ins (#70),
@@ -1 +1 @@
1
- {"version":3,"file":"backend.js","sourceRoot":"","sources":["../../src/api/backend.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,OAAO,EAAE,WAAW,EAAE,SAAS,EAAgB,MAAM,kBAAkB,CAAA;AAEvE,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAC7C,OAAO,EAAE,MAAM,EAAE,SAAS,EAA+B,MAAM,WAAW,CAAA;AAuB1E;;;;;;GAMG;AACH,MAAM,YAAY,GAAY,KAAK,CAAA;AACnC,MAAM,OAAO,GAAG,6BAA6B,CAAA;AAE7C;;;;;;GAMG;AACH,MAAM,UAAU,WAAW,CAAC,UAA8B,EAAE,cAAuB,EAAE,OAAgB,YAAY;IAC/G,IAAI,UAAU,KAAK,SAAS;QAAE,OAAO,UAAU,CAAA;IAC/C,OAAO,IAAI,IAAI,cAAc,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAA;AACrD,CAAC;AAED;;;GAGG;AACH,SAAS,UAAU,CAAC,IAAwB,EAAE,KAAwB;IACpE,IAAI,IAAI,KAAK,SAAS;QAAE,OAAO,SAAS,CAAA;IACxC,MAAM,QAAQ,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,CAAA;IACnC,OAAO,QAAQ,CAAC,KAAK,CAAC,CAAC,IAAI,EAAkB,EAAE,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,IAAI,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,C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@
1
1
  import { z } from 'zod';
2
2
  /** `created_on`: an ISO 8601 instant in UTC, or null when the admin API holds none. */
3
3
  export declare const createdOn: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>>, z.ZodTransform<string | null, string | null | undefined>>;
4
- /** `created_by_id`: a person's id, or null when the admin API holds none, or its empty default. */
4
+ /** `created_by_id`: a person's id, or null when the backend holds none, or its empty default. */
5
5
  export declare const createdById: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
@@ -2,12 +2,13 @@ import { z } from 'zod';
2
2
  import { instant } from './time.js';
3
3
  /*
4
4
  * When a record was made, and by whom, as the admin API sends them on a connection (#231) and on a
5
- * logbook entry (#229): one reading for both, so a dataset and an entry say it the same way. The
5
+ * logbook entry (#229): one reading for both, so a dataset and an entry say it the same way. A
6
+ * member (#294) reads its maker by `createdById` too, and its time more leniently (members.ts). The
6
7
  * embedded `created_by` is never read (#67); the person is named through `flipstream.members.get`.
7
8
  */
8
9
  /** `created_on`: an ISO 8601 instant in UTC, or null when the admin API holds none. */
9
10
  export const createdOn = instant.nullish().transform((time) => time ?? null);
10
- /** `created_by_id`: a person's id, or null when the admin API holds none, or its empty default. */
11
+ /** `created_by_id`: a person's id, or null when the backend holds none, or its empty default. */
11
12
  export const createdById = z
12
13
  .string()
13
14
  .nullish()
@@ -1 +1 @@
1
- {"version":3,"file":"created.js","sourceRoot":"","sources":["../../src/api/created.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAEnC;;;;GAIG;AAEH,uFAAuF;AACvF,MAAM,CAAC,MAAM,SAAS,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC,SAAS,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,IAAI,IAAI,CAAC,CAAA;AAE5E,mGAAmG;AACnG,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC;KACzB,MAAM,EAAE;KACR,OAAO,EAAE;KACT,SAAS,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAA"}
1
+ {"version":3,"file":"created.js","sourceRoot":"","sources":["../../src/api/created.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAEnC;;;;;GAKG;AAEH,uFAAuF;AACvF,MAAM,CAAC,MAAM,SAAS,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC,SAAS,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,IAAI,IAAI,CAAC,CAAA;AAE5E,iGAAiG;AACjG,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC;KACzB,MAAM,EAAE;KACR,OAAO,EAAE;KACT,SAAS,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAA"}
@@ -1,4 +1,5 @@
1
1
  import { z } from 'zod';
2
+ import { invalidAnswer } from '../core/invalid.js';
2
3
  import { isSecretKey } from '../core/secrets.js';
3
4
  import { credentialNeedsPerson } from './handoff.js';
4
5
  import { sameUuid } from './ids.js';
@@ -50,7 +51,6 @@ const zRecord = z
50
51
  }));
51
52
  const zOrganizationId = z.object({ id });
52
53
  const publicOf = ({ id: credentialId, name, type, datasource_types, created_on }) => ({ id: credentialId, name, type, datasource_types, created_on });
53
- const invalid = (issues) => ({ ok: false, error: { kind: 'invalid', issues } });
54
54
  const refusedPath = { ok: false, error: { kind: 'refused', reason: 'path' } };
55
55
  /**
56
56
  * `flipstream.credentials.list()`: one page of your organisation's sign-ins, as metadata. A bad
@@ -66,7 +66,7 @@ export async function listCredentials(seam, read, request = {}) {
66
66
  // A record is checked before this runs, but the scope check never throws on what it's given.
67
67
  const spec = seam.organizationCredentials(organization.data.id, request, zRecord, (record) => typeof record.organization_id === 'string' && sameUuid(record.organization_id, organization.data.id));
68
68
  if (spec === null)
69
- return invalid("the organisation's id can't name its sign-ins");
69
+ return invalidAnswer("the organisation's id can't name its sign-ins");
70
70
  const listed = await read(spec);
71
71
  return listed.ok ? { ok: true, data: { ...listed.data, items: listed.data.items.map(publicOf) } } : listed;
72
72
  }
@@ -86,9 +86,9 @@ export async function handOffCredential(seam, read, credentialId, action) {
86
86
  if (!credential.ok)
87
87
  return credential;
88
88
  if (!sameUuid(credential.data.id, credentialId))
89
- return invalid("the sign-in read isn't the one asked for");
89
+ return invalidAnswer("the sign-in read isn't the one asked for");
90
90
  if (!sameUuid(credential.data.organization_id, organization.data.id))
91
- return invalid("the sign-in read is another organisation's");
91
+ return invalidAnswer("the sign-in read is another organisation's");
92
92
  return credentialNeedsPerson(action);
93
93
  }
94
94
  //# sourceMappingURL=credentials.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"credentials.js","sourceRoot":"","sources":["../../src/api/credentials.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AAGhD,OAAO,EAAE,qBAAqB,EAA0B,MAAM,cAAc,CAAA;AAC5E,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AAEnC,OAAO,EAAE,SAAS,EAA+B,MAAM,WAAW,CAAA;AAClE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AA4BnC;;;;GAIG;AACH,SAAS,UAAU,CAAC,KAAc,EAAE,IAAkC,EAAE,OA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AAC,UAAU,CAAC,EAAE;QAAE,OAAO,UAAU,CAAA;IACrC,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,EAAE,YAAY,CAAC;QAAE,OAAO,aAAa,CAAC,0CAA0C,CAAC,CAAA;IACjH,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,CAAC,eAAe,EAAE,YAAY,CAAC,IAAI,CAAC,EAAE,CAAC;QAAE,OAAO,aAAa,CAAC,4CAA4C,CAAC,CAAA;IACxI,OAAO,qBAAqB,CAAC,MAAM,CAAC,CAAA;AACtC,CAAC"}
@@ -1,7 +1,8 @@
1
1
  import type { ApiResult } from '../core/result.js';
2
+ import { type DatasetAccount } from './account.js';
2
3
  import type { Backend } from './backend.js';
3
- import type { Read } from './me.js';
4
- import type { Page } from './page.js';
4
+ import { type Read } from './me.js';
5
+ import { type Page } from './page.js';
5
6
  /**
6
7
  * A dataset type this version of the SDK knows: pulse-admin's DataSourceType at admin 0.0.126, in
7
8
  * its own spelling, since D540 renames fields, never values. Written out, so the public type names
@@ -22,6 +23,28 @@ export type DatasetType = 'google_analytics_4' | 'google_search_console' | 'goog
22
23
  * An app merges them as it needs: the console shows `todo` and `started` alike as "coming in".
23
24
  */
24
25
  export type DatasetHistory = 'not_available' | 'todo' | 'started' | 'done';
26
+ /**
27
+ * pulse-admin's own `data_refresh_status` (#343), in its own spelling (D563): its record of the last
28
+ * request to rebuild a dataset's custom-dimension tables, as the backend left it. A rebuild is asked
29
+ * for when the custom dimensions change, and the pipeline writes back what it did; nothing else
30
+ * moves it on, so each value is the last one written, never a promise of what comes next or when.
31
+ * It says nothing of the daily load. As pulse-admin dff6bf9b (change_custom_dimensions.py) and
32
+ * pulse-dagster 040fcf4 (ops/transform.py) write it:
33
+ * - `idle`: pulse-admin's default; every new dataset starts here.
34
+ * - `data_refresh_requested`: a rebuild was asked for and the pipeline hasn't taken it up. It can
35
+ * stay so: a run skips a dataset none of whose tables it builds, or one that shares its tables
36
+ * with a dataset the run already built.
37
+ * - `data_refresh_in_progress`: the pipeline took it up. It can stay so for good: only a build that
38
+ * fails is written back as `data_refresh_failed`, so a run that stops another way, or a write back
39
+ * that fails, leaves it here, and a change of the custom dimensions asks for nothing from here.
40
+ * - `data_refresh_completed`: the pipeline finished a rebuild. It may be one made with the custom
41
+ * dimensions from before a change: a change made while one is in progress asks for no new one.
42
+ * - `data_refresh_failed`: the pipeline's rebuild failed. A change of the custom dimensions asks for
43
+ * a new one.
44
+ *
45
+ * Show it as what it is, the custom dimensions' rebuild, never as the dataset's health.
46
+ */
47
+ export type DatasetRefreshStatus = 'idle' | 'data_refresh_requested' | 'data_refresh_in_progress' | 'data_refresh_completed' | 'data_refresh_failed';
25
48
  /** A dataset in a workspace (#211): an upload or a connected account alike, the backend's connection. */
26
49
  export interface Dataset {
27
50
  readonly id: string;
@@ -50,34 +73,91 @@ export interface Dataset {
50
73
  * yet", never a value of your own (os D1348).
51
74
  */
52
75
  readonly history: DatasetHistory | null;
76
+ /**
77
+ * The last word on its custom dimensions' rebuild (#343): see `DatasetRefreshStatus`. Null when
78
+ * it's unknown: the backend holds none, or a value this version doesn't know, so show it as
79
+ * unknown, never as idle.
80
+ */
81
+ readonly refresh_status: DatasetRefreshStatus | null;
82
+ /**
83
+ * Which account it reads (#296), as the console labels a dataset: `sc-domain:bever.nl`,
84
+ * `412-883-1024`. Read from the key its type keeps it under (an older LinkedIn Ads dataset's:
85
+ * `property`, when `account` holds none), and only that key's id. Null when its type keeps none,
86
+ * or when the backend holds no readable one: show the dataset's name instead. Where the console
87
+ * shows a label and this is null, the id is refused: one longer than 512 UTF-16 code units, one
88
+ * holding a control or format character or a line or paragraph separator, or a finite number
89
+ * that isn't a whole one from 1 to 2^53 - 1. A refused id ends the read, so another key's account
90
+ * never stands in for it.
91
+ */
92
+ readonly account: DatasetAccount | null;
53
93
  }
54
94
  /** What `flipstream.datasets.list()` takes: the workspace, and the page, as every list does. */
55
95
  export interface DatasetListRequest {
56
96
  readonly workspace_id: string;
97
+ /** Never beside `workspace_id`: your organisation's datasets are a `DatasetOrganizationListRequest`. */
98
+ readonly organization?: never;
57
99
  /** At most 1,000, and 100 when left out. */
58
100
  readonly limit?: number;
59
101
  readonly offset?: number;
60
102
  }
61
103
  /**
62
- * `flipstream.datasets.list()`: one page of a workspace's datasets, in the backend's own order, by
63
- * name (no sort is sent, D550). The workspace is read beside the list, by `readOwnWorkspace`'s
64
- * rules, so one nobody has is `not_found` and another organisation's is invalid, never an empty
65
- * page. A row of another workspace is invalid, naming its place; the caller's id may be any form
66
- * pulse-admin reads as the same UUID (sameUuid). A row of another organisation is invalid too,
67
- * naming its place, never an id. The organisation's failure, then the workspace's, then the
68
- * list's, is the answer, whichever finishes first. A bad limit or offset throws, as every list's
69
- * does.
104
+ * What `flipstream.datasets.list()` takes for your organisation's datasets, in every workspace you
105
+ * open (#342): `organization: true`, said outright, so a missing workspace can never widen a read,
106
+ * and the page, as every list does.
70
107
  */
71
- export declare function listDatasets(seam: Backend, read: Read, request: DatasetListRequest): Promise<ApiResult<Page<Dataset>>>;
108
+ export interface DatasetOrganizationListRequest {
109
+ readonly organization: true;
110
+ /** Never beside `organization`: one workspace's datasets are a `DatasetListRequest`. */
111
+ readonly workspace_id?: never;
112
+ /** At most 1,000, and 100 when left out. */
113
+ readonly limit?: number;
114
+ readonly offset?: number;
115
+ }
116
+ /**
117
+ * `flipstream.datasets.list()`: exactly one of a workspace's datasets (`workspace_id`) and your
118
+ * organisation's (`organization: true`, `listOrganizationDatasets`); both, neither, or an
119
+ * `organization` that isn't `true` is a TypeError, with nothing sent (#342, as #322's rule for
120
+ * log.list).
121
+ *
122
+ * A workspace's: one page of its datasets, in the backend's own order, by name (no sort is sent,
123
+ * D550). The workspace is read beside the list, by `readOwnWorkspaceWith`'s rules (D571), once your
124
+ * organisation and you are read: one you don't open is `not_found` with no list asked for, so its
125
+ * datasets, with their embedded sign-ins, are never fetched; one nobody has is `not_found` too, and
126
+ * another organisation's is invalid, never an empty page. A row of another workspace is invalid,
127
+ * naming its place; the caller's id may be any form pulse-admin reads as the same UUID (sameUuid).
128
+ * A row of another organisation is invalid too, naming its place, never an id. The organisation's
129
+ * failure, then yours, then the workspace's, then the list's, is the answer, whichever finishes
130
+ * first. A bad limit or offset throws, as every list's does.
131
+ */
132
+ export declare function listDatasets(seam: Backend, read: Read, request: DatasetListRequest | DatasetOrganizationListRequest): Promise<ApiResult<Page<Dataset>>>;
133
+ /**
134
+ * `flipstream.datasets.count()` (#364, D566): how many datasets a workspace has, from pulse-admin's
135
+ * own `count`: the total of one page of its datasets with the smallest limit, 1, read as
136
+ * `datasets.list({ workspace_id })` reads a page (#366's code review, 1 and 2). Its shape is
137
+ * checked (a count no smaller than its rows, no more rows than the limit, and a row whenever the
138
+ * count is above 0), and its row is held to the workspace and your organisation, so a page that
139
+ * leaks another workspace's or organisation's dataset is invalid; of the row only those two are
140
+ * read, so one bad anywhere else can't lose the count. The workspace is read beside it, by
141
+ * `readOwnWorkspaceWith`'s rules, as for the list: one you don't open is `not_found` with no count
142
+ * asked for, one nobody has is `not_found` too, and another organisation's is invalid, never a
143
+ * count of 0. The organisation's failure, then yours, then the workspace's, then the count's, is
144
+ * the answer, whichever finishes first. A `workspace_id` that isn't a string is a TypeError, with
145
+ * nothing sent.
146
+ */
147
+ export declare function countDatasets(seam: Backend, read: Read, request: {
148
+ readonly workspace_id: string;
149
+ }): Promise<ApiResult<{
150
+ readonly count: number;
151
+ }>>;
72
152
  /** `flipstream.datasets.get()`: one dataset, by its id, by `readOwnDataset`'s rules. */
73
153
  export declare function getDataset(seam: Backend, read: Read, request: {
74
154
  readonly dataset_id: string;
75
155
  }): Promise<ApiResult<Dataset>>;
76
156
  /**
77
157
  * `flipstream.datasets.delete()`: a D542 hand-off (D546), as `workspaces.delete` is. The dataset is
78
- * read by `readOwnDataset`'s rules, so one nobody has is `not_found` and another organisation's
79
- * invalid, before any hand-off. Then `needs_person`, never a write, with the console's dataset page
80
- * where a console can be named (os D1334).
158
+ * read by `readOwnDataset`'s rules, so one nobody has, or one in a workspace you don't open, is
159
+ * `not_found` and another organisation's invalid, before any hand-off. Then `needs_person`, never a
160
+ * write, with the console's dataset page where a console can be named (os D1334).
81
161
  */
82
162
  export declare function handOffDatasetDelete(seam: Backend, read: Read, request: {
83
163
  readonly dataset_id: string;