@withmarfa/client 0.0.16 → 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 +79 -29
  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. */
@@ -13991,6 +14008,21 @@ interface operations {
13991
14008
  "application/json": components["schemas"]["TypeNotPermittedRefusal"];
13992
14009
  };
13993
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
+ };
13994
14026
  /** @description `instance_changed`: `X-Marfa-Instance-Id` names another instance. Nothing is written. Rebuild the working copy from the instance at this address. */
13995
14027
  409: {
13996
14028
  headers: {
@@ -14497,7 +14529,10 @@ interface operations {
14497
14529
  "application/json": components["schemas"]["InternalErrorRefusal"];
14498
14530
  };
14499
14531
  };
14500
- /** @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
+ */
14501
14536
  503: {
14502
14537
  headers: {
14503
14538
  "X-Marfa-Contract": components["headers"]["X-Marfa-Contract"];
@@ -14509,7 +14544,7 @@ interface operations {
14509
14544
  [name: string]: unknown;
14510
14545
  };
14511
14546
  content: {
14512
- "application/json": components["schemas"]["WriteContentionRefusal"];
14547
+ "application/json": components["schemas"]["BlobStoreUnavailableOrWriteContentionRefusal"];
14513
14548
  };
14514
14549
  };
14515
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. */
@@ -21207,14 +21242,14 @@ interface operations {
21207
21242
  path?: never;
21208
21243
  cookie?: never;
21209
21244
  };
21210
- /** @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. */
21211
21246
  requestBody: {
21212
21247
  content: {
21213
21248
  "application/gzip": Blob | ArrayBuffer | ArrayBufferView | ReadableStream<Uint8Array>;
21214
21249
  };
21215
21250
  };
21216
21251
  responses: {
21217
- /** @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. */
21218
21253
  200: {
21219
21254
  headers: {
21220
21255
  "X-Marfa-Contract": components["headers"]["X-Marfa-Contract"];
@@ -21254,9 +21289,9 @@ interface operations {
21254
21289
  };
21255
21290
  };
21256
21291
  /**
21257
- * @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.
21258
- * - `invalid_properties`: an item sets a property its type doesn't declare, and `strict_mode` names that type.
21259
- * - `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.
21260
21295
  */
21261
21296
  400: {
21262
21297
  headers: {
@@ -21287,7 +21322,7 @@ interface operations {
21287
21322
  "application/json": components["schemas"]["UnauthorizedRefusal"];
21288
21323
  };
21289
21324
  };
21290
- /** @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. */
21291
21326
  403: {
21292
21327
  headers: {
21293
21328
  "X-Marfa-Contract": components["headers"]["X-Marfa-Contract"];
@@ -21302,6 +21337,21 @@ interface operations {
21302
21337
  "application/json": components["schemas"]["ForbiddenRefusal"];
21303
21338
  };
21304
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
+ };
21305
21355
  /**
21306
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.
21307
21357
  * - `link_taken`: the archive registers a type naming a `link_field` in which two rows a forced delete left share a value.
@@ -21889,7 +21939,7 @@ interface operations {
21889
21939
  };
21890
21940
  };
21891
21941
  responses: {
21892
- /** @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. */
21893
21943
  201: {
21894
21944
  headers: {
21895
21945
  "X-Marfa-Contract": components["headers"]["X-Marfa-Contract"];
@@ -23386,7 +23436,7 @@ interface operations {
23386
23436
  };
23387
23437
  requestBody?: never;
23388
23438
  responses: {
23389
- /** @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. */
23390
23440
  200: {
23391
23441
  headers: {
23392
23442
  "X-Marfa-Contract": components["headers"]["X-Marfa-Contract"];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@withmarfa/client",
3
- "version": "0.0.16",
3
+ "version": "0.0.17",
4
4
  "license": "Apache-2.0",
5
5
  "repository": {
6
6
  "type": "git",