scribase 0.1.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 (162) hide show
  1. package/README.md +220 -0
  2. package/dist/cli/credentials.d.ts +35 -0
  3. package/dist/cli/credentials.d.ts.map +1 -0
  4. package/dist/cli/credentials.js +125 -0
  5. package/dist/cli/credentials.js.map +1 -0
  6. package/dist/cli/envfile.d.ts +20 -0
  7. package/dist/cli/envfile.d.ts.map +1 -0
  8. package/dist/cli/envfile.js +86 -0
  9. package/dist/cli/envfile.js.map +1 -0
  10. package/dist/cli/framework.d.ts +45 -0
  11. package/dist/cli/framework.d.ts.map +1 -0
  12. package/dist/cli/framework.js +107 -0
  13. package/dist/cli/framework.js.map +1 -0
  14. package/dist/cli/index.d.ts +8 -0
  15. package/dist/cli/index.d.ts.map +1 -0
  16. package/dist/cli/index.js +239 -0
  17. package/dist/cli/index.js.map +1 -0
  18. package/dist/cli/init.d.ts +118 -0
  19. package/dist/cli/init.d.ts.map +1 -0
  20. package/dist/cli/init.js +455 -0
  21. package/dist/cli/init.js.map +1 -0
  22. package/dist/cli/login.d.ts +104 -0
  23. package/dist/cli/login.d.ts.map +1 -0
  24. package/dist/cli/login.js +306 -0
  25. package/dist/cli/login.js.map +1 -0
  26. package/dist/cli/pow.d.ts +9 -0
  27. package/dist/cli/pow.d.ts.map +1 -0
  28. package/dist/cli/pow.js +31 -0
  29. package/dist/cli/pow.js.map +1 -0
  30. package/dist/cli/vercel.d.ts +92 -0
  31. package/dist/cli/vercel.d.ts.map +1 -0
  32. package/dist/cli/vercel.js +230 -0
  33. package/dist/cli/vercel.js.map +1 -0
  34. package/dist/client.d.ts +137 -0
  35. package/dist/client.d.ts.map +1 -0
  36. package/dist/client.js +311 -0
  37. package/dist/client.js.map +1 -0
  38. package/dist/errors.d.ts +79 -0
  39. package/dist/errors.d.ts.map +1 -0
  40. package/dist/errors.js +139 -0
  41. package/dist/errors.js.map +1 -0
  42. package/dist/evidence.d.ts +78 -0
  43. package/dist/evidence.d.ts.map +1 -0
  44. package/dist/evidence.js +36 -0
  45. package/dist/evidence.js.map +1 -0
  46. package/dist/idempotency.d.ts +24 -0
  47. package/dist/idempotency.d.ts.map +1 -0
  48. package/dist/idempotency.js +59 -0
  49. package/dist/idempotency.js.map +1 -0
  50. package/dist/importers/firebase.d.ts +101 -0
  51. package/dist/importers/firebase.d.ts.map +1 -0
  52. package/dist/importers/firebase.js +251 -0
  53. package/dist/importers/firebase.js.map +1 -0
  54. package/dist/importers/index.d.ts +11 -0
  55. package/dist/importers/index.d.ts.map +1 -0
  56. package/dist/importers/index.js +9 -0
  57. package/dist/importers/index.js.map +1 -0
  58. package/dist/importers/instantdb.d.ts +76 -0
  59. package/dist/importers/instantdb.d.ts.map +1 -0
  60. package/dist/importers/instantdb.js +152 -0
  61. package/dist/importers/instantdb.js.map +1 -0
  62. package/dist/index.d.ts +78 -0
  63. package/dist/index.d.ts.map +1 -0
  64. package/dist/index.js +53 -0
  65. package/dist/index.js.map +1 -0
  66. package/dist/pagination.d.ts +33 -0
  67. package/dist/pagination.d.ts.map +1 -0
  68. package/dist/pagination.js +68 -0
  69. package/dist/pagination.js.map +1 -0
  70. package/dist/resources/account.d.ts +156 -0
  71. package/dist/resources/account.d.ts.map +1 -0
  72. package/dist/resources/account.js +114 -0
  73. package/dist/resources/account.js.map +1 -0
  74. package/dist/resources/audit.d.ts +26 -0
  75. package/dist/resources/audit.d.ts.map +1 -0
  76. package/dist/resources/audit.js +43 -0
  77. package/dist/resources/audit.js.map +1 -0
  78. package/dist/resources/auth.d.ts +149 -0
  79. package/dist/resources/auth.d.ts.map +1 -0
  80. package/dist/resources/auth.js +70 -0
  81. package/dist/resources/auth.js.map +1 -0
  82. package/dist/resources/backups.d.ts +117 -0
  83. package/dist/resources/backups.d.ts.map +1 -0
  84. package/dist/resources/backups.js +92 -0
  85. package/dist/resources/backups.js.map +1 -0
  86. package/dist/resources/branches.d.ts +151 -0
  87. package/dist/resources/branches.d.ts.map +1 -0
  88. package/dist/resources/branches.js +62 -0
  89. package/dist/resources/branches.js.map +1 -0
  90. package/dist/resources/database.d.ts +107 -0
  91. package/dist/resources/database.d.ts.map +1 -0
  92. package/dist/resources/database.js +54 -0
  93. package/dist/resources/database.js.map +1 -0
  94. package/dist/resources/environments.d.ts +106 -0
  95. package/dist/resources/environments.d.ts.map +1 -0
  96. package/dist/resources/environments.js +131 -0
  97. package/dist/resources/environments.js.map +1 -0
  98. package/dist/resources/export.d.ts +101 -0
  99. package/dist/resources/export.d.ts.map +1 -0
  100. package/dist/resources/export.js +89 -0
  101. package/dist/resources/export.js.map +1 -0
  102. package/dist/resources/functions.d.ts +75 -0
  103. package/dist/resources/functions.d.ts.map +1 -0
  104. package/dist/resources/functions.js +58 -0
  105. package/dist/resources/functions.js.map +1 -0
  106. package/dist/resources/imports.d.ts +183 -0
  107. package/dist/resources/imports.d.ts.map +1 -0
  108. package/dist/resources/imports.js +168 -0
  109. package/dist/resources/imports.js.map +1 -0
  110. package/dist/resources/insights.d.ts +50 -0
  111. package/dist/resources/insights.d.ts.map +1 -0
  112. package/dist/resources/insights.js +21 -0
  113. package/dist/resources/insights.js.map +1 -0
  114. package/dist/resources/metrics.d.ts +61 -0
  115. package/dist/resources/metrics.d.ts.map +1 -0
  116. package/dist/resources/metrics.js +23 -0
  117. package/dist/resources/metrics.js.map +1 -0
  118. package/dist/resources/migrations.d.ts +24 -0
  119. package/dist/resources/migrations.d.ts.map +1 -0
  120. package/dist/resources/migrations.js +29 -0
  121. package/dist/resources/migrations.js.map +1 -0
  122. package/dist/resources/operations.d.ts +37 -0
  123. package/dist/resources/operations.d.ts.map +1 -0
  124. package/dist/resources/operations.js +81 -0
  125. package/dist/resources/operations.js.map +1 -0
  126. package/dist/resources/organizations.d.ts +171 -0
  127. package/dist/resources/organizations.d.ts.map +1 -0
  128. package/dist/resources/organizations.js +180 -0
  129. package/dist/resources/organizations.js.map +1 -0
  130. package/dist/resources/previews.d.ts +49 -0
  131. package/dist/resources/previews.d.ts.map +1 -0
  132. package/dist/resources/previews.js +62 -0
  133. package/dist/resources/previews.js.map +1 -0
  134. package/dist/resources/projects.d.ts +73 -0
  135. package/dist/resources/projects.d.ts.map +1 -0
  136. package/dist/resources/projects.js +84 -0
  137. package/dist/resources/projects.js.map +1 -0
  138. package/dist/resources/queues.d.ts +100 -0
  139. package/dist/resources/queues.d.ts.map +1 -0
  140. package/dist/resources/queues.js +77 -0
  141. package/dist/resources/queues.js.map +1 -0
  142. package/dist/resources/realtime.d.ts +37 -0
  143. package/dist/resources/realtime.d.ts.map +1 -0
  144. package/dist/resources/realtime.js +23 -0
  145. package/dist/resources/realtime.js.map +1 -0
  146. package/dist/resources/restores.d.ts +67 -0
  147. package/dist/resources/restores.d.ts.map +1 -0
  148. package/dist/resources/restores.js +90 -0
  149. package/dist/resources/restores.js.map +1 -0
  150. package/dist/resources/storage.d.ts +50 -0
  151. package/dist/resources/storage.d.ts.map +1 -0
  152. package/dist/resources/storage.js +38 -0
  153. package/dist/resources/storage.js.map +1 -0
  154. package/dist/resources/usage.d.ts +85 -0
  155. package/dist/resources/usage.d.ts.map +1 -0
  156. package/dist/resources/usage.js +37 -0
  157. package/dist/resources/usage.js.map +1 -0
  158. package/dist/types.gen.d.ts +473 -0
  159. package/dist/types.gen.d.ts.map +1 -0
  160. package/dist/types.gen.js +8 -0
  161. package/dist/types.gen.js.map +1 -0
  162. package/package.json +53 -0
package/dist/client.js ADDED
@@ -0,0 +1,311 @@
1
+ import { NetworkError, ScribaseApiError, TimeoutError, errorFromResponse, } from './errors.js';
2
+ import { resolveIdempotencyKey } from './idempotency.js';
3
+ import { OrganizationsResource } from './resources/organizations.js';
4
+ import { ProjectsResource } from './resources/projects.js';
5
+ import { EnvironmentsResource } from './resources/environments.js';
6
+ import { PreviewsResource } from './resources/previews.js';
7
+ import { BackupsResource } from './resources/backups.js';
8
+ import { RestoresResource } from './resources/restores.js';
9
+ import { OperationsResource } from './resources/operations.js';
10
+ import { UsageResource } from './resources/usage.js';
11
+ import { ExportResource } from './resources/export.js';
12
+ import { MigrationsResource } from './resources/migrations.js';
13
+ import { AuditResource } from './resources/audit.js';
14
+ import { ImportsResource } from './resources/imports.js';
15
+ import { InsightsResource } from './resources/insights.js';
16
+ import { QueuesResource } from './resources/queues.js';
17
+ import { BranchesResource } from './resources/branches.js';
18
+ import { AuthResource } from './resources/auth.js';
19
+ import { StorageResource } from './resources/storage.js';
20
+ import { FunctionsResource } from './resources/functions.js';
21
+ import { MetricsResource } from './resources/metrics.js';
22
+ import { RealtimeResource } from './resources/realtime.js';
23
+ import { DatabaseResource } from './resources/database.js';
24
+ import { AccountResource } from './resources/account.js';
25
+ const DEFAULT_TIMEOUT_MS = 30_000;
26
+ const DEFAULT_MAX_RETRIES = 3;
27
+ const DEFAULT_RETRY_BASE_MS = 250;
28
+ const DEFAULT_RETRY_MAX_MS = 20_000;
29
+ const SDK_VERSION = '0.1.0';
30
+ const defaultSleep = (ms) => new Promise((resolve) => {
31
+ setTimeout(resolve, ms);
32
+ });
33
+ /**
34
+ * The Scribase control-plane client. Zero runtime dependencies: it is a typed
35
+ * wrapper over `fetch` that handles auth, idempotency keys, `problem+json`
36
+ * decoding, and bounded retry with backoff. Resource groups hang off it
37
+ * (`client.environments`, `client.export`, …).
38
+ */
39
+ export class ScribaseClient {
40
+ #baseUrl;
41
+ #token;
42
+ #fetch;
43
+ #timeoutMs;
44
+ #maxRetries;
45
+ #retryBaseMs;
46
+ #retryMaxMs;
47
+ #defaultHeaders;
48
+ #userAgent;
49
+ #sleep;
50
+ organizations;
51
+ projects;
52
+ environments;
53
+ previews;
54
+ backups;
55
+ restores;
56
+ operations;
57
+ usage;
58
+ export;
59
+ migrations;
60
+ audit;
61
+ imports;
62
+ insights;
63
+ queues;
64
+ branches;
65
+ auth;
66
+ storage;
67
+ functions;
68
+ metrics;
69
+ realtime;
70
+ database;
71
+ account;
72
+ constructor(options) {
73
+ const fetchImpl = options.fetch ?? globalThis.fetch;
74
+ if (typeof fetchImpl !== 'function') {
75
+ throw new TypeError('no global fetch found; pass `fetch` in ScribaseClientOptions (Node >= 22.13 has it built in)');
76
+ }
77
+ this.#baseUrl = normalizeBaseUrl(options.baseUrl);
78
+ this.#token = options.token;
79
+ this.#fetch = fetchImpl;
80
+ this.#timeoutMs = options.timeoutMs ?? DEFAULT_TIMEOUT_MS;
81
+ this.#maxRetries = options.maxRetries ?? DEFAULT_MAX_RETRIES;
82
+ this.#retryBaseMs = options.retryBaseDelayMs ?? DEFAULT_RETRY_BASE_MS;
83
+ this.#retryMaxMs = options.retryMaxDelayMs ?? DEFAULT_RETRY_MAX_MS;
84
+ this.#defaultHeaders = options.defaultHeaders ?? {};
85
+ this.#userAgent = options.userAgent ?? `scribase-js/${SDK_VERSION}`;
86
+ this.#sleep = options.sleep ?? defaultSleep;
87
+ this.organizations = new OrganizationsResource(this);
88
+ this.projects = new ProjectsResource(this);
89
+ this.environments = new EnvironmentsResource(this);
90
+ this.previews = new PreviewsResource(this);
91
+ this.backups = new BackupsResource(this);
92
+ this.restores = new RestoresResource(this);
93
+ this.operations = new OperationsResource(this);
94
+ this.usage = new UsageResource(this);
95
+ this.export = new ExportResource(this);
96
+ this.migrations = new MigrationsResource(this);
97
+ this.audit = new AuditResource(this);
98
+ this.imports = new ImportsResource(this);
99
+ this.insights = new InsightsResource(this);
100
+ this.queues = new QueuesResource(this);
101
+ this.branches = new BranchesResource(this);
102
+ this.auth = new AuthResource(this);
103
+ this.storage = new StorageResource(this);
104
+ this.functions = new FunctionsResource(this);
105
+ this.metrics = new MetricsResource(this);
106
+ this.realtime = new RealtimeResource(this);
107
+ this.database = new DatabaseResource(this);
108
+ this.account = new AccountResource(this);
109
+ }
110
+ /** Mint an idempotency key using the same generator resources use. */
111
+ idempotencyKey(explicit) {
112
+ return resolveIdempotencyKey(explicit);
113
+ }
114
+ /**
115
+ * `GET` a binary resource at an API-relative path (signed links carry their
116
+ * own authorization, so no bearer header is sent) and return its bytes.
117
+ */
118
+ async downloadBlob(path, options = {}) {
119
+ if (!path.startsWith('/v1/')) {
120
+ throw new TypeError('downloadBlob only follows API-relative /v1/ paths');
121
+ }
122
+ let response;
123
+ try {
124
+ response = await this.#fetch(this.#baseUrl + path, {
125
+ method: 'GET',
126
+ headers: { 'user-agent': this.#userAgent },
127
+ ...(options.signal ? { signal: options.signal } : {}),
128
+ });
129
+ }
130
+ catch (error) {
131
+ if (options.signal?.aborted) {
132
+ throw options.signal.reason ?? error;
133
+ }
134
+ throw new NetworkError(`download from ${path} failed`, error);
135
+ }
136
+ if (!response.ok) {
137
+ const body = await readBody(response);
138
+ throw errorFromResponse(response.status, body, parseRetryAfter(response.headers.get('retry-after')));
139
+ }
140
+ return response.blob();
141
+ }
142
+ async send(options) {
143
+ const url = this.#buildUrl(options.path, options.query);
144
+ let attempt = 0;
145
+ for (;;) {
146
+ try {
147
+ return await this.#attempt(url, options);
148
+ }
149
+ catch (error) {
150
+ const retryAfterMs = this.#retryDelay(error, attempt);
151
+ if (retryAfterMs === null || attempt >= this.#maxRetries) {
152
+ throw error;
153
+ }
154
+ await this.#sleep(retryAfterMs);
155
+ attempt += 1;
156
+ }
157
+ }
158
+ }
159
+ async #attempt(url, options) {
160
+ const headers = await this.#buildHeaders(options);
161
+ const controller = new AbortController();
162
+ const timer = setTimeout(() => {
163
+ controller.abort(new TimeoutError(this.#timeoutMs));
164
+ }, this.#timeoutMs);
165
+ const onExternalAbort = () => controller.abort(options.signal?.reason);
166
+ if (options.signal) {
167
+ if (options.signal.aborted) {
168
+ controller.abort(options.signal.reason);
169
+ }
170
+ else {
171
+ options.signal.addEventListener('abort', onExternalAbort, { once: true });
172
+ }
173
+ }
174
+ let response;
175
+ try {
176
+ // Build init conditionally: exactOptionalPropertyTypes forbids `body: undefined`.
177
+ const init = { method: options.method, headers, signal: controller.signal };
178
+ if (options.body !== undefined) {
179
+ init.body = JSON.stringify(options.body);
180
+ }
181
+ response = await this.#fetch(url, init);
182
+ }
183
+ catch (error) {
184
+ if (error instanceof TimeoutError) {
185
+ throw error;
186
+ }
187
+ // The per-attempt timeout aborts with a TimeoutError as the reason.
188
+ if (controller.signal.reason instanceof TimeoutError) {
189
+ throw controller.signal.reason;
190
+ }
191
+ // Caller cancellation: surface their reason unchanged, never as a
192
+ // retryable NetworkError.
193
+ if (options.signal?.aborted) {
194
+ throw options.signal.reason ?? error;
195
+ }
196
+ throw new NetworkError(`request to ${url} failed`, error);
197
+ }
198
+ finally {
199
+ clearTimeout(timer);
200
+ options.signal?.removeEventListener('abort', onExternalAbort);
201
+ }
202
+ return this.#decode(response, options);
203
+ }
204
+ async #decode(response, options) {
205
+ const idempotencyReplayed = (response.headers.get('idempotency-replayed') ?? '').toLowerCase() === 'true';
206
+ if (!response.ok) {
207
+ const body = await readBody(response);
208
+ throw errorFromResponse(response.status, body, parseRetryAfter(response.headers.get('retry-after')));
209
+ }
210
+ if (response.status === 204 || options.expectNoContent) {
211
+ return {
212
+ data: undefined,
213
+ status: response.status,
214
+ idempotencyReplayed,
215
+ headers: response.headers,
216
+ };
217
+ }
218
+ const body = (await readBody(response));
219
+ return { data: body, status: response.status, idempotencyReplayed, headers: response.headers };
220
+ }
221
+ /** Returns a delay in ms to retry, or `null` if the error is not retryable. */
222
+ #retryDelay(error, attempt) {
223
+ if (error instanceof ScribaseApiError && error.retryable) {
224
+ if (error.retryAfterSeconds !== undefined) {
225
+ return Math.min(error.retryAfterSeconds * 1000, this.#retryMaxMs);
226
+ }
227
+ return this.#backoff(attempt);
228
+ }
229
+ if (error instanceof NetworkError) {
230
+ return this.#backoff(attempt);
231
+ }
232
+ return null;
233
+ }
234
+ #backoff(attempt) {
235
+ const exponential = this.#retryBaseMs * 2 ** attempt;
236
+ const capped = Math.min(exponential, this.#retryMaxMs);
237
+ // Full jitter avoids synchronized retries across a fleet of agents.
238
+ return Math.round(Math.random() * capped);
239
+ }
240
+ async #buildHeaders(options) {
241
+ const headers = new Headers(this.#defaultHeaders);
242
+ headers.set('accept', 'application/json');
243
+ headers.set('user-agent', this.#userAgent);
244
+ headers.set('authorization', `Bearer ${await this.#resolveToken()}`);
245
+ if (options.body !== undefined) {
246
+ headers.set('content-type', 'application/json');
247
+ }
248
+ if (options.idempotencyKey !== undefined) {
249
+ headers.set('idempotency-key', options.idempotencyKey);
250
+ }
251
+ if (options.organizationHeader !== undefined) {
252
+ headers.set('x-scribase-organization-id', options.organizationHeader);
253
+ }
254
+ return headers;
255
+ }
256
+ async #resolveToken() {
257
+ const token = typeof this.#token === 'function' ? await this.#token() : this.#token;
258
+ if (!token) {
259
+ throw new TypeError('token provider returned an empty credential');
260
+ }
261
+ return token;
262
+ }
263
+ #buildUrl(path, query) {
264
+ const url = new URL(this.#baseUrl + path);
265
+ if (query) {
266
+ for (const [key, value] of Object.entries(query)) {
267
+ if (value !== undefined) {
268
+ url.searchParams.set(key, String(value));
269
+ }
270
+ }
271
+ }
272
+ return url.toString();
273
+ }
274
+ }
275
+ function normalizeBaseUrl(raw) {
276
+ let candidate;
277
+ try {
278
+ candidate = new URL(raw);
279
+ }
280
+ catch {
281
+ throw new TypeError(`invalid baseUrl: ${JSON.stringify(raw)}`);
282
+ }
283
+ if (candidate.protocol !== 'https:' && candidate.protocol !== 'http:') {
284
+ throw new TypeError(`baseUrl must be http(s), got ${candidate.protocol}`);
285
+ }
286
+ return raw.replace(/\/+$/, '');
287
+ }
288
+ async function readBody(response) {
289
+ const contentType = response.headers.get('content-type') ?? '';
290
+ const text = await response.text();
291
+ if (text.length === 0) {
292
+ return undefined;
293
+ }
294
+ if (contentType.includes('json')) {
295
+ try {
296
+ return JSON.parse(text);
297
+ }
298
+ catch {
299
+ return text;
300
+ }
301
+ }
302
+ return text;
303
+ }
304
+ function parseRetryAfter(value) {
305
+ if (value === null) {
306
+ return undefined;
307
+ }
308
+ const seconds = Number.parseInt(value, 10);
309
+ return Number.isFinite(seconds) && seconds >= 0 ? seconds : undefined;
310
+ }
311
+ //# sourceMappingURL=client.js.map
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AAO,GAAG,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;AACjC,CAAC;AAED,KAAK,UAAU,QAAQ,CAAC,QAAkB;IACxC,MAAM,WAAW,GAAG,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,IAAI,EAAE,CAAC;IAC/D,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;IACnC,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACtB,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,IAAI,WAAW,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;QACjC,IAAI,CAAC;YACH,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAY,CAAC;QACrC,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,IAAI,CAAC;QACd,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED,SAAS,eAAe,CAAC,KAAoB;IAC3C,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;QACnB,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,MAAM,OAAO,GAAG,MAAM,CAAC,QAAQ,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;IAC3C,OAAO,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,OAAO,IAAI,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC;AACxE,CAAC"}
@@ -0,0 +1,79 @@
1
+ import type { Operation, Problem } from './types.gen.js';
2
+ /**
3
+ * Base class for every error the client raises. Carrying a discriminant
4
+ * (`name`) plus the parsed {@link Problem} lets callers branch without
5
+ * string-matching messages.
6
+ */
7
+ export declare class ScribaseError extends Error {
8
+ readonly name: string;
9
+ constructor(message: string, options?: {
10
+ cause?: unknown;
11
+ });
12
+ }
13
+ /**
14
+ * The API replied with a non-2xx status and a `application/problem+json`
15
+ * (RFC 9457) body. Subclasses narrow by status; `problem.code` is the stable,
16
+ * machine-readable discriminator the contract guarantees.
17
+ */
18
+ export declare class ScribaseApiError extends ScribaseError {
19
+ readonly name: string;
20
+ readonly status: number;
21
+ readonly code: string;
22
+ readonly problem: Problem;
23
+ readonly requestId: string | undefined;
24
+ /** `Retry-After` seconds when the server supplied it (429 / 503). */
25
+ readonly retryAfterSeconds: number | undefined;
26
+ constructor(problem: Problem, retryAfterSeconds?: number);
27
+ /** True for statuses that are safe to retry with the same idempotency key. */
28
+ get retryable(): boolean;
29
+ }
30
+ export declare class BadRequestError extends ScribaseApiError {
31
+ readonly name = "BadRequestError";
32
+ }
33
+ export declare class UnauthorizedError extends ScribaseApiError {
34
+ readonly name = "UnauthorizedError";
35
+ }
36
+ export declare class ForbiddenError extends ScribaseApiError {
37
+ readonly name = "ForbiddenError";
38
+ }
39
+ export declare class NotFoundError extends ScribaseApiError {
40
+ readonly name = "NotFoundError";
41
+ }
42
+ export declare class ConflictError extends ScribaseApiError {
43
+ readonly name = "ConflictError";
44
+ }
45
+ export declare class QuotaExceededError extends ScribaseApiError {
46
+ readonly name = "QuotaExceededError";
47
+ }
48
+ export declare class ServiceUnavailableError extends ScribaseApiError {
49
+ readonly name = "ServiceUnavailableError";
50
+ }
51
+ /** Transport failed before a response arrived (DNS, connection, TLS, abort). */
52
+ export declare class NetworkError extends ScribaseError {
53
+ readonly name = "NetworkError";
54
+ constructor(message: string, cause: unknown);
55
+ }
56
+ /** A request exceeded the configured per-attempt timeout. */
57
+ export declare class TimeoutError extends ScribaseError {
58
+ readonly name = "TimeoutError";
59
+ readonly timeoutMs: number;
60
+ constructor(timeoutMs: number);
61
+ }
62
+ /** A polled {@link Operation} reached a terminal non-success state. */
63
+ export declare class OperationFailedError extends ScribaseError {
64
+ readonly name = "OperationFailedError";
65
+ readonly operation: Operation;
66
+ constructor(operation: Operation);
67
+ }
68
+ /** Polling a long-running resource exceeded the caller's deadline. */
69
+ export declare class PollTimeoutError extends ScribaseError {
70
+ readonly name = "PollTimeoutError";
71
+ constructor(what: string, timeoutMs: number);
72
+ }
73
+ /**
74
+ * Build the most specific {@link ScribaseApiError} for a response. When the
75
+ * body is not a well-formed Problem (a proxy 502, an HTML error page) we
76
+ * synthesize one so callers still get a typed `status`/`code` to branch on.
77
+ */
78
+ export declare function errorFromResponse(status: number, body: unknown, retryAfterSeconds?: number): ScribaseApiError;
79
+ //# sourceMappingURL=errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAEzD;;;;GAIG;AACH,qBAAa,aAAc,SAAQ,KAAK;IACtC,SAAkB,IAAI,EAAE,MAAM,CAAmB;gBAErC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,OAAO,CAAA;KAAE;CAK3D;AAED;;;;GAIG;AACH,qBAAa,gBAAiB,SAAQ,aAAa;IACjD,SAAkB,IAAI,EAAE,MAAM,CAAsB;IACpD,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;IACvC,qEAAqE;IACrE,QAAQ,CAAC,iBAAiB,EAAE,MAAM,GAAG,SAAS,CAAC;gBAEnC,OAAO,EAAE,OAAO,EAAE,iBAAiB,CAAC,EAAE,MAAM;IASxD,8EAA8E;IAC9E,IAAI,SAAS,IAAI,OAAO,CAEvB;CACF;AAED,qBAAa,eAAgB,SAAQ,gBAAgB;IACnD,SAAkB,IAAI,qBAAqB;CAC5C;AACD,qBAAa,iBAAkB,SAAQ,gBAAgB;IACrD,SAAkB,IAAI,uBAAuB;CAC9C;AACD,qBAAa,cAAe,SAAQ,gBAAgB;IAClD,SAAkB,IAAI,oBAAoB;CAC3C;AACD,qBAAa,aAAc,SAAQ,gBAAgB;IACjD,SAAkB,IAAI,mBAAmB;CAC1C;AACD,qBAAa,aAAc,SAAQ,gBAAgB;IACjD,SAAkB,IAAI,mBAAmB;CAC1C;AACD,qBAAa,kBAAmB,SAAQ,gBAAgB;IACtD,SAAkB,IAAI,wBAAwB;CAC/C;AACD,qBAAa,uBAAwB,SAAQ,gBAAgB;IAC3D,SAAkB,IAAI,6BAA6B;CACpD;AAED,gFAAgF;AAChF,qBAAa,YAAa,SAAQ,aAAa;IAC7C,SAAkB,IAAI,kBAAkB;gBAC5B,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO;CAG5C;AAED,6DAA6D;AAC7D,qBAAa,YAAa,SAAQ,aAAa;IAC7C,SAAkB,IAAI,kBAAkB;IACxC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;gBACf,SAAS,EAAE,MAAM;CAI9B;AAED,uEAAuE;AACvE,qBAAa,oBAAqB,SAAQ,aAAa;IACrD,SAAkB,IAAI,0BAA0B;IAChD,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAC;gBAClB,SAAS,EAAE,SAAS;CAQjC;AAED,sEAAsE;AACtE,qBAAa,gBAAiB,SAAQ,aAAa;IACjD,SAAkB,IAAI,sBAAsB;gBAChC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM;CAG5C;AAYD;;;;GAIG;AACH,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,OAAO,EACb,iBAAiB,CAAC,EAAE,MAAM,GACzB,gBAAgB,CAIlB"}
package/dist/errors.js ADDED
@@ -0,0 +1,139 @@
1
+ /**
2
+ * Base class for every error the client raises. Carrying a discriminant
3
+ * (`name`) plus the parsed {@link Problem} lets callers branch without
4
+ * string-matching messages.
5
+ */
6
+ export class ScribaseError extends Error {
7
+ name = 'ScribaseError';
8
+ constructor(message, options) {
9
+ super(message, options);
10
+ // Restore the prototype chain across the TS `extends Error` downlevel gap.
11
+ Object.setPrototypeOf(this, new.target.prototype);
12
+ }
13
+ }
14
+ /**
15
+ * The API replied with a non-2xx status and a `application/problem+json`
16
+ * (RFC 9457) body. Subclasses narrow by status; `problem.code` is the stable,
17
+ * machine-readable discriminator the contract guarantees.
18
+ */
19
+ export class ScribaseApiError extends ScribaseError {
20
+ name = 'ScribaseApiError';
21
+ status;
22
+ code;
23
+ problem;
24
+ requestId;
25
+ /** `Retry-After` seconds when the server supplied it (429 / 503). */
26
+ retryAfterSeconds;
27
+ constructor(problem, retryAfterSeconds) {
28
+ super(`${problem.status} ${problem.code}: ${problem.title}`);
29
+ this.status = problem.status;
30
+ this.code = problem.code;
31
+ this.problem = problem;
32
+ this.requestId = problem.request_id;
33
+ this.retryAfterSeconds = retryAfterSeconds;
34
+ }
35
+ /** True for statuses that are safe to retry with the same idempotency key. */
36
+ get retryable() {
37
+ return this.status === 429 || this.status === 503;
38
+ }
39
+ }
40
+ export class BadRequestError extends ScribaseApiError {
41
+ name = 'BadRequestError';
42
+ }
43
+ export class UnauthorizedError extends ScribaseApiError {
44
+ name = 'UnauthorizedError';
45
+ }
46
+ export class ForbiddenError extends ScribaseApiError {
47
+ name = 'ForbiddenError';
48
+ }
49
+ export class NotFoundError extends ScribaseApiError {
50
+ name = 'NotFoundError';
51
+ }
52
+ export class ConflictError extends ScribaseApiError {
53
+ name = 'ConflictError';
54
+ }
55
+ export class QuotaExceededError extends ScribaseApiError {
56
+ name = 'QuotaExceededError';
57
+ }
58
+ export class ServiceUnavailableError extends ScribaseApiError {
59
+ name = 'ServiceUnavailableError';
60
+ }
61
+ /** Transport failed before a response arrived (DNS, connection, TLS, abort). */
62
+ export class NetworkError extends ScribaseError {
63
+ name = 'NetworkError';
64
+ constructor(message, cause) {
65
+ super(message, { cause });
66
+ }
67
+ }
68
+ /** A request exceeded the configured per-attempt timeout. */
69
+ export class TimeoutError extends ScribaseError {
70
+ name = 'TimeoutError';
71
+ timeoutMs;
72
+ constructor(timeoutMs) {
73
+ super(`request timed out after ${timeoutMs}ms`);
74
+ this.timeoutMs = timeoutMs;
75
+ }
76
+ }
77
+ /** A polled {@link Operation} reached a terminal non-success state. */
78
+ export class OperationFailedError extends ScribaseError {
79
+ name = 'OperationFailedError';
80
+ operation;
81
+ constructor(operation) {
82
+ super(operation.state === 'cancelled'
83
+ ? `operation ${operation.id} was cancelled`
84
+ : `operation ${operation.id} failed: ${operation.error ?? 'unknown error'}`);
85
+ this.operation = operation;
86
+ }
87
+ }
88
+ /** Polling a long-running resource exceeded the caller's deadline. */
89
+ export class PollTimeoutError extends ScribaseError {
90
+ name = 'PollTimeoutError';
91
+ constructor(what, timeoutMs) {
92
+ super(`gave up waiting for ${what} after ${timeoutMs}ms`);
93
+ }
94
+ }
95
+ const BY_STATUS = {
96
+ 400: BadRequestError,
97
+ 401: UnauthorizedError,
98
+ 403: ForbiddenError,
99
+ 404: NotFoundError,
100
+ 409: ConflictError,
101
+ 429: QuotaExceededError,
102
+ 503: ServiceUnavailableError,
103
+ };
104
+ /**
105
+ * Build the most specific {@link ScribaseApiError} for a response. When the
106
+ * body is not a well-formed Problem (a proxy 502, an HTML error page) we
107
+ * synthesize one so callers still get a typed `status`/`code` to branch on.
108
+ */
109
+ export function errorFromResponse(status, body, retryAfterSeconds) {
110
+ const problem = coerceProblem(status, body);
111
+ const Ctor = BY_STATUS[problem.status] ?? ScribaseApiError;
112
+ return new Ctor(problem, retryAfterSeconds);
113
+ }
114
+ function coerceProblem(status, body) {
115
+ if (isProblem(body)) {
116
+ return body;
117
+ }
118
+ const detail = typeof body === 'string' && body.length > 0
119
+ ? body.slice(0, 2048)
120
+ : undefined;
121
+ return {
122
+ type: 'about:blank',
123
+ title: 'Unexpected error response',
124
+ status,
125
+ code: 'unexpected_response',
126
+ ...(detail !== undefined ? { detail } : {}),
127
+ };
128
+ }
129
+ function isProblem(value) {
130
+ if (typeof value !== 'object' || value === null) {
131
+ return false;
132
+ }
133
+ const candidate = value;
134
+ return (typeof candidate['type'] === 'string' &&
135
+ typeof candidate['title'] === 'string' &&
136
+ typeof candidate['status'] === 'number' &&
137
+ typeof candidate['code'] === 'string');
138
+ }
139
+ //# sourceMappingURL=errors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,MAAM,OAAO,aAAc,SAAQ,KAAK;IACpB,IAAI,GAAW,eAAe,CAAC;IAEjD,YAAY,OAAe,EAAE,OAA6B;QACxD,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QACxB,2EAA2E;QAC3E,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;IACpD,CAAC;CACF;AAED;;;;GAIG;AACH,MAAM,OAAO,gBAAiB,SAAQ,aAAa;IAC/B,IAAI,GAAW,kBAAkB,CAAC;IAC3C,MAAM,CAAS;IACf,IAAI,CAAS;IACb,OAAO,CAAU;IACjB,SAAS,CAAqB;IACvC,qEAAqE;IAC5D,iBAAiB,CAAqB;IAE/C,YAAY,OAAgB,EAAE,iBAA0B;QACtD,KAAK,CAAC,GAAG,OAAO,CAAC,MAAM,IAAI,OAAO,CAAC,IAAI,KAAK,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC;QAC7D,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;QAC7B,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;QACzB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,SAAS,GAAG,OAAO,CAAC,UAAU,CAAC;QACpC,IAAI,CAAC,iBAAiB,GAAG,iBAAiB,CAAC;IAC7C,CAAC;IAED,8EAA8E;IAC9E,IAAI,SAAS;QACX,OAAO,IAAI,CAAC,MAAM,KAAK,GAAG,IAAI,IAAI,CAAC,MAAM,KAAK,GAAG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QAClC,MAAM;QACN,IAAI,EAAE,qBAAqB;QAC3B,GAAG,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KAC5C,CAAC;AACJ,CAAC;AAED,SAAS,SAAS,CAAC,KAAc;IAC/B,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;QAChD,OAAO,KAAK,CAAC;IACf,CAAC;IACD,MAAM,SAAS,GAAG,KAAgC,CAAC;IACnD,OAAO,CACL,OAAO,SAAS,CAAC,MAAM,CAAC,KAAK,QAAQ;QACrC,OAAO,SAAS,CAAC,OAAO,CAAC,KAAK,QAAQ;QACtC,OAAO,SAAS,CAAC,QAAQ,CAAC,KAAK,QAAQ;QACvC,OAAO,SAAS,CAAC,MAAM,CAAC,KAAK,QAAQ,CACtC,CAAC;AACJ,CAAC"}
@@ -0,0 +1,78 @@
1
+ /**
2
+ * Verification evidence — the shared trust model behind the product's two
3
+ * money surfaces: the restore-evidence viewer and the export/import report.
4
+ *
5
+ * "Verified restore" and "runnable export" are only worth anything if the
6
+ * client can render *proof*: row counts that match, checksums that match,
7
+ * every RLS policy accounted for, and a real login that succeeded. These types
8
+ * carry that proof to the console verbatim; they are intentionally rich so the
9
+ * UI never has to guess what passed and what needs a human.
10
+ *
11
+ * These planned surfaces are not yet in `openapi.yaml`; they follow BUILDOUT
12
+ * §9 and ROADMAP §3-4 and mirror the contract's naming (epoch-second integers,
13
+ * portable identifiers, additive-only optional fields).
14
+ */
15
+ /** Per-relation row-count comparison between a source and its verified copy. */
16
+ export interface RowCountDiff {
17
+ relation: string;
18
+ source: number;
19
+ target: number;
20
+ matched: boolean;
21
+ }
22
+ /** Per-relation content checksum comparison. */
23
+ export interface ChecksumMatch {
24
+ relation: string;
25
+ algorithm: 'sha256';
26
+ source_digest: string;
27
+ target_digest: string;
28
+ matched: boolean;
29
+ }
30
+ /** Whether a specific RLS policy survived the copy on both sides. */
31
+ export interface PolicyParity {
32
+ policy: string;
33
+ relation: string;
34
+ present_in_source: boolean;
35
+ present_in_target: boolean;
36
+ matched: boolean;
37
+ }
38
+ /**
39
+ * A real authentication performed against the verified copy — the strongest
40
+ * possible evidence that auth data (users, identities, MFA factors, and the
41
+ * user IDs the JWTs are signed against) moved intact.
42
+ */
43
+ export interface LoginProof {
44
+ subject: string;
45
+ method: 'password' | 'oauth' | 'magic_link' | 'otp';
46
+ succeeded: boolean;
47
+ checked_at_epoch_seconds: number;
48
+ detail?: string;
49
+ }
50
+ export type VerificationCheckStatus = 'passed' | 'failed' | 'skipped';
51
+ /** A single named assertion in the verification run. */
52
+ export interface VerificationCheck {
53
+ name: string;
54
+ status: VerificationCheckStatus;
55
+ detail?: string;
56
+ observed?: string;
57
+ expected?: string;
58
+ }
59
+ export type VerificationState = 'unverified' | 'verifying' | 'verified' | 'failed';
60
+ /**
61
+ * The complete verification record for a backup, restore, or import. Rendered
62
+ * as the evidence card the product sells on. `state === 'verified'` is the only
63
+ * value that should present a green result; everything else demands attention.
64
+ */
65
+ export interface VerificationSummary {
66
+ state: VerificationState;
67
+ verified_at_epoch_seconds?: number;
68
+ checks: VerificationCheck[];
69
+ row_counts: RowCountDiff[];
70
+ checksums: ChecksumMatch[];
71
+ policy_parity: PolicyParity[];
72
+ login_proof: LoginProof[];
73
+ }
74
+ /** True only when the summary is fully verified with no failed check. */
75
+ export declare function isFullyVerified(summary: VerificationSummary): boolean;
76
+ /** Count checks by status for a compact headline in the evidence viewer. */
77
+ export declare function summarizeChecks(summary: VerificationSummary): Record<VerificationCheckStatus, number>;
78
+ //# sourceMappingURL=evidence.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"evidence.d.ts","sourceRoot":"","sources":["../src/evidence.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,gFAAgF;AAChF,MAAM,WAAW,YAAY;IAC3B,QAAQ,EAAE,MAAM,CAAC;IACjB,MA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