@withmarfa/client 0.0.15 → 0.0.17

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 (2) hide show
  1. package/dist/index.d.ts +133 -33
  2. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -1383,7 +1383,7 @@ interface paths {
1383
1383
  put?: never;
1384
1384
  /**
1385
1385
  * Restore from an archive
1386
- * @description Restores an exported archive atomically and returns counts of written and skipped records. Other writes wait until it finishes. Requires local authority or the owner, authenticated within five minutes.
1386
+ * @description Restores an exported archive atomically and returns counts of written and skipped records. Other writes wait until it finishes. Requires local authority or the owner, authenticated within five minutes before the request starts.
1387
1387
  */
1388
1388
  post: operations["restoreArchive"];
1389
1389
  delete?: never;
@@ -1447,7 +1447,7 @@ interface paths {
1447
1447
  put?: never;
1448
1448
  /**
1449
1449
  * Claim the instance
1450
- * @description Creates the one owner using a machine-issued setup code or setup-only browser session. The claim, consumed proof, and audit commit together. A claimed instance never reopens setup.
1450
+ * @description Creates the one owner using a machine-issued setup code or setup-only browser session. A claimed instance never reopens setup. A claim from the instance's own origin, which the setup page sends, also signs the owner in with a session cookie.
1451
1451
  */
1452
1452
  post: operations["createOwner"];
1453
1453
  delete?: never;
@@ -3411,6 +3411,23 @@ interface components {
3411
3411
  /** @description How many active items you can read carry the tag. */
3412
3412
  count: number;
3413
3413
  };
3414
+ /** @description An error response. */
3415
+ RequestTimeoutRefusal: {
3416
+ /** @description What went wrong. */
3417
+ error: {
3418
+ /**
3419
+ * @description A machine-readable code for the error. Use it in your logic.
3420
+ * @enum {string}
3421
+ */
3422
+ code: "request_timeout";
3423
+ /** @description A description of the error for a person to read. It can change, so don't match on it. */
3424
+ message: string;
3425
+ /** @description More about the error, such as the field it concerns. Each code defines its own details. */
3426
+ details?: {
3427
+ [key: string]: unknown;
3428
+ };
3429
+ };
3430
+ };
3414
3431
  /** @description A page holding every orphan. */
3415
3432
  BlobOrphanPage: {
3416
3433
  /** @description Every orphan. */
@@ -3490,6 +3507,23 @@ interface components {
3490
3507
  };
3491
3508
  };
3492
3509
  };
3510
+ /** @description An error response. */
3511
+ BlobStoreUnavailableOrWriteContentionRefusal: {
3512
+ /** @description What went wrong. */
3513
+ error: {
3514
+ /**
3515
+ * @description A machine-readable code for the error. Use it in your logic.
3516
+ * @enum {string}
3517
+ */
3518
+ code: "blob_store_unavailable" | "write_contention";
3519
+ /** @description A description of the error for a person to read. It can change, so don't match on it. */
3520
+ message: string;
3521
+ /** @description More about the error, such as the field it concerns. Each code defines its own details. */
3522
+ details?: {
3523
+ [key: string]: unknown;
3524
+ };
3525
+ };
3526
+ };
3493
3527
  /** @description A page holding every location. */
3494
3528
  BlobLocationPage: {
3495
3529
  /** @description Every location. */
@@ -4250,23 +4284,6 @@ interface components {
4250
4284
  };
4251
4285
  };
4252
4286
  };
4253
- /** @description An error response. */
4254
- BlobStoreUnavailableOrWriteContentionRefusal: {
4255
- /** @description What went wrong. */
4256
- error: {
4257
- /**
4258
- * @description A machine-readable code for the error. Use it in your logic.
4259
- * @enum {string}
4260
- */
4261
- code: "blob_store_unavailable" | "write_contention";
4262
- /** @description A description of the error for a person to read. It can change, so don't match on it. */
4263
- message: string;
4264
- /** @description More about the error, such as the field it concerns. Each code defines its own details. */
4265
- details?: {
4266
- [key: string]: unknown;
4267
- };
4268
- };
4269
- };
4270
4287
  /** @description A page holding every stale type. */
4271
4288
  DriftedPlatformTypePage: {
4272
4289
  /** @description Every stale type. */
@@ -4471,6 +4488,40 @@ interface components {
4471
4488
  };
4472
4489
  };
4473
4490
  };
4491
+ /** @description An error response. */
4492
+ ExportRowsUnrestorableRefusal: {
4493
+ /** @description What went wrong. */
4494
+ error: {
4495
+ /**
4496
+ * @description A machine-readable code for the error. Use it in your logic.
4497
+ * @enum {string}
4498
+ */
4499
+ code: "export_rows_unrestorable";
4500
+ /** @description A description of the error for a person to read. It can change, so don't match on it. */
4501
+ message: string;
4502
+ /** @description More about the error, such as the field it concerns. Each code defines its own details. */
4503
+ details?: {
4504
+ [key: string]: unknown;
4505
+ };
4506
+ };
4507
+ };
4508
+ /** @description An error response. */
4509
+ BlobStoreUnavailableOrExportUnrestorableOrWriteContentionRefusal: {
4510
+ /** @description What went wrong. */
4511
+ error: {
4512
+ /**
4513
+ * @description A machine-readable code for the error. Use it in your logic.
4514
+ * @enum {string}
4515
+ */
4516
+ code: "blob_store_unavailable" | "export_unrestorable" | "write_contention";
4517
+ /** @description A description of the error for a person to read. It can change, so don't match on it. */
4518
+ message: string;
4519
+ /** @description More about the error, such as the field it concerns. Each code defines its own details. */
4520
+ details?: {
4521
+ [key: string]: unknown;
4522
+ };
4523
+ };
4524
+ };
4474
4525
  /** @description An OAuth client: its app metadata and the grants it uses. */
4475
4526
  OAuthClientRegistration: {
4476
4527
  /** @description The addresses Marfa may send a person back to after authorization. Required for `authorization_code`. At most 10. A `web` client's URIs must use `https` off the loopback; a `native` client may use `http` on `localhost`, `127.0.0.1` or `[::1]`. */
@@ -13957,6 +14008,21 @@ interface operations {
13957
14008
  "application/json": components["schemas"]["TypeNotPermittedRefusal"];
13958
14009
  };
13959
14010
  };
14011
+ /** @description - `request_timeout`: no bytes arrived for 60 seconds, or for the time `MARFA_UPLOAD_IDLE_TIMEOUT_MS` sets. Marfa stores nothing. An upload has no other time limit while bytes keep arriving. */
14012
+ 408: {
14013
+ headers: {
14014
+ "X-Marfa-Contract": components["headers"]["X-Marfa-Contract"];
14015
+ "X-Request-ID": components["headers"]["X-Request-ID"];
14016
+ "X-RateLimit-Limit": components["headers"]["X-RateLimit-Limit"];
14017
+ "X-RateLimit-Remaining": components["headers"]["X-RateLimit-Remaining"];
14018
+ "X-RateLimit-Reset": components["headers"]["X-RateLimit-Reset"];
14019
+ "X-Error-Code": components["headers"]["X-Error-Code"];
14020
+ [name: string]: unknown;
14021
+ };
14022
+ content: {
14023
+ "application/json": components["schemas"]["RequestTimeoutRefusal"];
14024
+ };
14025
+ };
13960
14026
  /** @description `instance_changed`: `X-Marfa-Instance-Id` names another instance. Nothing is written. Rebuild the working copy from the instance at this address. */
13961
14027
  409: {
13962
14028
  headers: {
@@ -14463,7 +14529,10 @@ interface operations {
14463
14529
  "application/json": components["schemas"]["InternalErrorRefusal"];
14464
14530
  };
14465
14531
  };
14466
- /** @description `write_contention`: the database was busy, and Marfa couldn't complete the request in time. Nothing changed. Try the request again. */
14532
+ /**
14533
+ * @description - `blob_store_unavailable`: no store that holds this blob answered, so Marfa couldn't tell whether it still has the bytes. Try again later.
14534
+ * - `write_contention`: the database was busy, and Marfa couldn't complete the request in time. Nothing changed. Try the request again.
14535
+ */
14467
14536
  503: {
14468
14537
  headers: {
14469
14538
  "X-Marfa-Contract": components["headers"]["X-Marfa-Contract"];
@@ -14475,7 +14544,7 @@ interface operations {
14475
14544
  [name: string]: unknown;
14476
14545
  };
14477
14546
  content: {
14478
- "application/json": components["schemas"]["WriteContentionRefusal"];
14547
+ "application/json": components["schemas"]["BlobStoreUnavailableOrWriteContentionRefusal"];
14479
14548
  };
14480
14549
  };
14481
14550
  /** @description `insufficient_storage`: the disk that holds the instance's data has no room for the request, or the request would leave less free than the instance keeps in reserve. Nothing changed, unless `details.write_outcome` is `unknown`, which means the write may have landed: read what you changed before you repeat it. Free space on the disk, then try the request again. */
@@ -20506,7 +20575,7 @@ interface operations {
20506
20575
  "application/json": components["schemas"]["UnauthorizedRefusal"];
20507
20576
  };
20508
20577
  };
20509
- /** @description - `forbidden`: this operation requires its explicit permission or direct owner or local authority. `details.required_scope` names it. */
20578
+ /** @description - `forbidden`: you hold neither `keys.manage` nor `keys.mint` and aren't the owner or local command, or you're the owner and your browser session signed in more than five minutes ago. `details.required_scope` names a missing permission. */
20510
20579
  403: {
20511
20580
  headers: {
20512
20581
  "X-Marfa-Contract": components["headers"]["X-Marfa-Contract"];
@@ -21173,14 +21242,14 @@ interface operations {
21173
21242
  path?: never;
21174
21243
  cookie?: never;
21175
21244
  };
21176
- /** @description The archive file, as `GET /export?format=archive` returned it. Only the build that wrote an archive is sure to read it. */
21245
+ /** @description The archive file, as `GET /export?format=archive` returned it, with its `manifest.json`, `items.ndjson`, `edges.ndjson` and `types.ndjson`. Only the build that wrote an archive is sure to read it. */
21177
21246
  requestBody: {
21178
21247
  content: {
21179
21248
  "application/gzip": Blob | ArrayBuffer | ArrayBufferView | ReadableStream<Uint8Array>;
21180
21249
  };
21181
21250
  };
21182
21251
  responses: {
21183
- /** @description Returns the counts. Items and edges keep their IDs, versions and dates, and items keep their tags, extensions and history. Marfa restores an edge whether or not its properties fit its edge type's `property_schema`. Marfa leaves an existing item as it is when an archived one has its ID, natural key or link. An archive holds no keys, webhooks, configuration or tombstones. */
21252
+ /** @description Returns the counts. Items and edges keep their IDs, versions and dates, and items keep their tags, extensions and history. Marfa restores an edge, and an item of a type you registered, as archived, even if its type now refuses it or is gone. Marfa leaves an existing item as it is when an archived one has its ID, natural key or link. An archive holds no keys, webhooks, configuration or tombstones. */
21184
21253
  200: {
21185
21254
  headers: {
21186
21255
  "X-Marfa-Contract": components["headers"]["X-Marfa-Contract"];
@@ -21220,9 +21289,9 @@ interface operations {
21220
21289
  };
21221
21290
  };
21222
21291
  /**
21223
- * @description - `validation_error`: the body isn't a valid archive, or is at another format version, repeats an entry, has an invalid row, or has a file over 64 MiB.
21224
- * - `invalid_properties`: an item sets a property its type doesn't declare, and `strict_mode` names that type.
21225
- * - `invalid_schema`: an archived type is invalid or carries a key the schema doesn't define.
21292
+ * @description - `validation_error`: the body isn't a valid archive, lacks one of its four files (`details.entries`), repeats an entry, is at another version, has an invalid row, or has a file over 64 MiB.
21293
+ * - `invalid_properties`: a `core` or `system` item breaks its type, an event's schedule can't unfold, or `strict_mode` refuses a property.
21294
+ * - `invalid_schema`: an archived type is invalid or has an unknown key.
21226
21295
  */
21227
21296
  400: {
21228
21297
  headers: {
@@ -21253,7 +21322,7 @@ interface operations {
21253
21322
  "application/json": components["schemas"]["UnauthorizedRefusal"];
21254
21323
  };
21255
21324
  };
21256
- /** @description Requires direct owner or local authority and recent owner authentication. */
21325
+ /** @description Requires direct owner or local authority, and an owner who signed in within five minutes before the request started, however long the upload takes. */
21257
21326
  403: {
21258
21327
  headers: {
21259
21328
  "X-Marfa-Contract": components["headers"]["X-Marfa-Contract"];
@@ -21268,6 +21337,21 @@ interface operations {
21268
21337
  "application/json": components["schemas"]["ForbiddenRefusal"];
21269
21338
  };
21270
21339
  };
21340
+ /** @description - `request_timeout`: no bytes of the archive arrived for 60 seconds, or for the time `MARFA_UPLOAD_IDLE_TIMEOUT_MS` sets. Nothing was written. An upload has no other time limit while bytes keep arriving. */
21341
+ 408: {
21342
+ headers: {
21343
+ "X-Marfa-Contract": components["headers"]["X-Marfa-Contract"];
21344
+ "X-Request-ID": components["headers"]["X-Request-ID"];
21345
+ "X-RateLimit-Limit": components["headers"]["X-RateLimit-Limit"];
21346
+ "X-RateLimit-Remaining": components["headers"]["X-RateLimit-Remaining"];
21347
+ "X-RateLimit-Reset": components["headers"]["X-RateLimit-Reset"];
21348
+ "X-Error-Code": components["headers"]["X-Error-Code"];
21349
+ [name: string]: unknown;
21350
+ };
21351
+ content: {
21352
+ "application/json": components["schemas"]["RequestTimeoutRefusal"];
21353
+ };
21354
+ };
21271
21355
  /**
21272
21356
  * @description - `conflict`: the archive redefines a type this instance registers differently or registered while the restore ran, carries a core edge type, or carries a snapshot ID that already exists.
21273
21357
  * - `link_taken`: the archive registers a type naming a `link_field` in which two rows a forced delete left share a value.
@@ -21855,7 +21939,7 @@ interface operations {
21855
21939
  };
21856
21940
  };
21857
21941
  responses: {
21858
- /** @description The new owner can sign in. */
21942
+ /** @description The new owner can sign in. A claim from the instance's own origin also sets the owner session cookie, unless the sign-in that follows the claim fails. A claim with no `Origin` header, such as a script's, sets none. */
21859
21943
  201: {
21860
21944
  headers: {
21861
21945
  "X-Marfa-Contract": components["headers"]["X-Marfa-Contract"];
@@ -23352,7 +23436,7 @@ interface operations {
23352
23436
  };
23353
23437
  requestBody?: never;
23354
23438
  responses: {
23355
- /** @description With `format=ndjson`, one JSON object per line: `item` and `metadata` for each item, then `edge` for each edge between them whose type you can read. With `format=archive`, a `.tar.gz` of the items with the history you can read, the edges, the type registrations and the blobs they reference that you can read. If an archive fails partway, the connection ends early and the file won't unpack. */
23439
+ /** @description With `format=ndjson`, one JSON object per line: `item` and `metadata` for each item, then `edge` for each edge between them whose type you can read. With `format=archive`, a `.tar.gz` of the items, history, edges, type registrations and blobs you can read. If the export fails partway or your credential ends or narrows below it, the connection ends early and an archive won't unpack. */
23356
23440
  200: {
23357
23441
  headers: {
23358
23442
  "X-Marfa-Contract": components["headers"]["X-Marfa-Contract"];
@@ -23415,6 +23499,21 @@ interface operations {
23415
23499
  "application/json": components["schemas"]["TypeNotPermittedRefusal"];
23416
23500
  };
23417
23501
  };
23502
+ /** @description - `export_rows_unrestorable`: with `format=archive`, Marfa read the selection twice, and both times a restore would refuse or skip the same row, which was unchanged between the reads, so no archive was sent. `details.row` names the row by `kind`, `id`, `type` and `field`, with the `code` a restore refuses it with or the reason it skips it. Correct the row or its type, then export again. */
23503
+ 409: {
23504
+ headers: {
23505
+ "X-Marfa-Contract": components["headers"]["X-Marfa-Contract"];
23506
+ "X-Request-ID": components["headers"]["X-Request-ID"];
23507
+ "X-RateLimit-Limit": components["headers"]["X-RateLimit-Limit"];
23508
+ "X-RateLimit-Remaining": components["headers"]["X-RateLimit-Remaining"];
23509
+ "X-RateLimit-Reset": components["headers"]["X-RateLimit-Reset"];
23510
+ "X-Error-Code": components["headers"]["X-Error-Code"];
23511
+ [name: string]: unknown;
23512
+ };
23513
+ content: {
23514
+ "application/json": components["schemas"]["ExportRowsUnrestorableRefusal"];
23515
+ };
23516
+ };
23418
23517
  /** @description `rate_limited`: you sent too many requests. Wait for the number of seconds in `Retry-After`, then try again. */
23419
23518
  429: {
23420
23519
  headers: {
@@ -23447,8 +23546,9 @@ interface operations {
23447
23546
  };
23448
23547
  };
23449
23548
  /**
23450
- * @description - `blob_store_unavailable`: a blob store failed, or didn't answer in time, while Marfa checked a blob's copy. Nothing was written. Try again later.
23451
- * - `write_contention`: the database was busy, and Marfa couldn't complete the request in time. Nothing changed. Try the request again.
23549
+ * @description - `blob_store_unavailable`: a blob store failed, or didn't answer in time, while Marfa checked a blob's copy. Try again later.
23550
+ * - `write_contention`: the database was busy. Nothing changed. Try the request again.
23551
+ * - `export_unrestorable`: with `format=archive`, writes changed a row that a restore would refuse, or its type, between two reads. No archive was sent. Retry the export.
23452
23552
  */
23453
23553
  503: {
23454
23554
  headers: {
@@ -23461,7 +23561,7 @@ interface operations {
23461
23561
  [name: string]: unknown;
23462
23562
  };
23463
23563
  content: {
23464
- "application/json": components["schemas"]["BlobStoreUnavailableOrWriteContentionRefusal"];
23564
+ "application/json": components["schemas"]["BlobStoreUnavailableOrExportUnrestorableOrWriteContentionRefusal"];
23465
23565
  };
23466
23566
  };
23467
23567
  /** @description `insufficient_storage`: the disk that holds the instance's data has no room for the request, or the request would leave less free than the instance keeps in reserve. Nothing changed, unless `details.write_outcome` is `unknown`, which means the write may have landed: read what you changed before you repeat it. Free space on the disk, then try the request again. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@withmarfa/client",
3
- "version": "0.0.15",
3
+ "version": "0.0.17",
4
4
  "license": "Apache-2.0",
5
5
  "repository": {
6
6
  "type": "git",