@withmarfa/client 0.0.51 → 0.0.52

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 +547 -12
  2. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -71,7 +71,7 @@ interface paths {
71
71
  put?: never;
72
72
  /**
73
73
  * Preview trashing items
74
- * @description Returns what `POST /items/trash` would move to the trash for the same `ids`: each item and every item you can read that a cascading edge such as `parent-of` would take with it. Nothing changes.
74
+ * @description Returns what `POST /items/trash` would move to the trash for the same `ids`: each item and every item you can read that a cascading edge such as `parent-of` reaches, or comment or attachment whose hosts would all be in the trash. Nothing changes.
75
75
  */
76
76
  post: operations["previewItemTrash"];
77
77
  delete?: never;
@@ -249,7 +249,7 @@ interface paths {
249
249
  };
250
250
  /**
251
251
  * Get item counts
252
- * @description Returns item counts by state or type using the filters of `GET /items`. Counts every state unless you name one. The owner can use their browser session.
252
+ * @description Returns item counts by state, type or source using the filters of `GET /items`. Counts every state unless you name one. The owner can use their browser session.
253
253
  */
254
254
  get: operations["getItemStats"];
255
255
  put?: never;
@@ -1600,6 +1600,50 @@ interface paths {
1600
1600
  patch?: never;
1601
1601
  trace?: never;
1602
1602
  };
1603
+ "/sources": {
1604
+ parameters: {
1605
+ query?: never;
1606
+ header?: never;
1607
+ path?: never;
1608
+ cookie?: never;
1609
+ };
1610
+ /**
1611
+ * List sources
1612
+ * @description Returns the sources you can see, each with its name and mark: your own, those you claim, and those of items you can read. `keys.manage` and the owner see every source in use or named.
1613
+ */
1614
+ get: operations["listSources"];
1615
+ put?: never;
1616
+ post?: never;
1617
+ delete?: never;
1618
+ options?: never;
1619
+ head?: never;
1620
+ patch?: never;
1621
+ trace?: never;
1622
+ };
1623
+ "/source": {
1624
+ parameters: {
1625
+ query?: never;
1626
+ header?: never;
1627
+ path?: never;
1628
+ cookie?: never;
1629
+ };
1630
+ /**
1631
+ * Get a source
1632
+ * @description Returns a source's name and mark. A source needs no item or key to be read, but you see only your own, those you claim and those of items you can read, unless you hold `keys.manage`.
1633
+ */
1634
+ get: operations["getSource"];
1635
+ put?: never;
1636
+ post?: never;
1637
+ delete?: never;
1638
+ options?: never;
1639
+ head?: never;
1640
+ /**
1641
+ * Name a source
1642
+ * @description Sets or clears a source's name and mark, and returns the source. A field left out keeps its value. You can change your own source and those you claim; any other needs `keys.manage`.
1643
+ */
1644
+ patch: operations["updateSource"];
1645
+ trace?: never;
1646
+ };
1603
1647
  "/keys": {
1604
1648
  parameters: {
1605
1649
  query?: never;
@@ -2203,10 +2247,10 @@ interface components {
2203
2247
  /** @description The types an edge's target item can have, in the same form as `source_type_constraints`. */
2204
2248
  target_type_constraints: string[];
2205
2249
  /**
2206
- * @description What happens when an item an edge joins is deleted. `cascade`: deleting the source trashes the target. `orphan`: the other item stays. `block`: the delete fails while the edge exists.
2250
+ * @description What deleting an item an edge joins does. `cascade`: the source's delete trashes the target. `orphan`: the other stays. `block`: the delete fails. `with-hosts`: the source is trashed with its last target, restored with any.
2207
2251
  * @enum {string}
2208
2252
  */
2209
- cascade_on_delete: "cascade" | "orphan" | "block";
2253
+ cascade_on_delete: "cascade" | "orphan" | "block" | "with-hosts";
2210
2254
  /** @description The properties an edge of the type can carry, by name. Marfa checks an edge's properties against it each time the edge is written, and accepts a property it doesn't list. */
2211
2255
  property_schema: {
2212
2256
  [key: string]: components["schemas"]["EdgePropertyDefinition"];
@@ -3348,9 +3392,9 @@ interface components {
3348
3392
  type: string;
3349
3393
  /** @description The item's version. */
3350
3394
  version: number;
3351
- /** @description The other items you can read that a cascading edge such as `parent-of` would take into the trash with this item, leaves first, at most 100. */
3395
+ /** @description The other items you can read that trashing the named items would take into the trash with this item, leaves first, at most 100: what a cascading edge such as `parent-of` reaches, and each comment or attachment whose hosts would all be in the trash. */
3352
3396
  takes: components["schemas"]["TrashPreviewEntry"][];
3353
- /** @description How many items you can read that trashing this item would move to the trash, the item itself included. */
3397
+ /** @description How many items you can read that trashing the named items would move to the trash with this item, the item itself included. */
3354
3398
  count: number;
3355
3399
  /**
3356
3400
  * @description `true` if `takes` was cut at its limit. Absent when it lists every item.
@@ -3879,10 +3923,10 @@ interface components {
3879
3923
  /** @description The types an edge's target item can have, in the same form as `source_type_constraints`. Leave it out to allow any type. */
3880
3924
  target_type_constraints?: string[];
3881
3925
  /**
3882
- * @description What happens when an item an edge joins is deleted. `cascade`: deleting the source trashes the target. `orphan`: the other item stays. `block`: the delete fails while the edge exists. Leave it out for `orphan`.
3926
+ * @description What deleting an item an edge joins does. `cascade`: the source's delete trashes the target. `orphan`: the other stays. `block`: the delete fails. `with-hosts`: the source is trashed with its last target, restored with any. Leave it out for `orphan`.
3883
3927
  * @enum {string}
3884
3928
  */
3885
- cascade_on_delete?: "cascade" | "orphan" | "block";
3929
+ cascade_on_delete?: "cascade" | "orphan" | "block" | "with-hosts";
3886
3930
  /** @description The properties an edge of the type can carry, by name. Marfa checks an edge's properties against it each time the edge is written, and accepts a property it doesn't list. Leave it out for none. */
3887
3931
  property_schema?: {
3888
3932
  [key: string]: components["schemas"]["EdgePropertyDefinition"];
@@ -5503,6 +5547,53 @@ interface components {
5503
5547
  };
5504
5548
  };
5505
5549
  };
5550
+ /** @description A page holding every source. */
5551
+ SourcePage: {
5552
+ /** @description Every source. */
5553
+ data: components["schemas"]["Source"][];
5554
+ /** @description Always `null`: Marfa returns every source in one page. */
5555
+ next_cursor: string | null;
5556
+ };
5557
+ /** @description A source code with the name and mark it's shown by. */
5558
+ Source: {
5559
+ /**
5560
+ * @description The source code, as items carry it in `source`.
5561
+ * @example github
5562
+ */
5563
+ source: string;
5564
+ /**
5565
+ * @description The name to show for the source.
5566
+ * @example GitHub
5567
+ */
5568
+ name: string;
5569
+ /**
5570
+ * @description Where `name` comes from: `set` on the source, the `app` signed in under it, the label of the `key` that holds it, or the `code` itself.
5571
+ * @enum {string}
5572
+ */
5573
+ name_from: "set" | "app" | "key" | "code";
5574
+ /**
5575
+ * @description The icon ID set for the source, from the same sets as a type's `icon`. Absent until someone sets one.
5576
+ * @example simple-icons:github
5577
+ */
5578
+ mark?: string;
5579
+ };
5580
+ /** @description An error response. */
5581
+ SourceNotFoundRefusal: {
5582
+ /** @description What went wrong. */
5583
+ error: {
5584
+ /**
5585
+ * @description A machine-readable code for the error. Use it in your logic.
5586
+ * @enum {string}
5587
+ */
5588
+ code: "source_not_found";
5589
+ /** @description A description of the error for a person to read. It can change, so don't match on it. */
5590
+ message: string;
5591
+ /** @description More about the error, such as the field it concerns. Each code defines its own details. */
5592
+ details?: {
5593
+ [key: string]: unknown;
5594
+ };
5595
+ };
5596
+ };
5506
5597
  /** @description The instance configuration: its display name, enforcement levers and live settings, with the instance's ID. */
5507
5598
  InstanceConfig: {
5508
5599
  /** @description Unique identifier for the instance, the same value `GET /` returns. */
@@ -9448,8 +9539,8 @@ interface operations {
9448
9539
  getItemStats: {
9449
9540
  parameters: {
9450
9541
  query?: {
9451
- /** @description Grouping axis. Defaults to `state`. */
9452
- by?: "state" | "type";
9542
+ /** @description Grouping axis: `state`, `type` or `source`. Defaults to `state`. */
9543
+ by?: "state" | "type" | "source";
9453
9544
  /** @description Only return items of these types and their subtypes: a comma-separated list of up to 10, such as `core.note,app.*`. A wildcard such as `core.*` matches every type under that prefix. */
9454
9545
  type?: string;
9455
9546
  /** @description Only count items in these lifecycle states: one state or a comma-separated list, such as `active,archived`. Without it, every state is counted, as with `any`. */
@@ -9479,7 +9570,7 @@ interface operations {
9479
9570
  };
9480
9571
  requestBody?: never;
9481
9572
  responses: {
9482
- /** @description Returns an object that maps each state, or each type, to its count. */
9573
+ /** @description Returns an object that maps each state, type or source to its count. */
9483
9574
  200: {
9484
9575
  headers: {
9485
9576
  "X-Marfa-Contract": components["headers"]["X-Marfa-Contract"];
@@ -9496,7 +9587,7 @@ interface operations {
9496
9587
  };
9497
9588
  };
9498
9589
  /**
9499
- * @description - `validation_error`: a query parameter is unknown or invalid, or `by` is not `state` or `type`.
9590
+ * @description - `validation_error`: a query parameter is unknown or invalid, or `by` is not `state`, `type` or `source`.
9500
9591
  * - `unknown_type`: `type` is a concrete type that nothing registers.
9501
9592
  */
9502
9593
  400: {
@@ -25309,6 +25400,442 @@ interface operations {
25309
25400
  };
25310
25401
  };
25311
25402
  };
25403
+ listSources: {
25404
+ parameters: {
25405
+ query?: never;
25406
+ header?: never;
25407
+ path?: never;
25408
+ cookie?: never;
25409
+ };
25410
+ requestBody?: never;
25411
+ responses: {
25412
+ /** @description Returns every source you can see, ordered by code. */
25413
+ 200: {
25414
+ headers: {
25415
+ "X-Marfa-Contract": components["headers"]["X-Marfa-Contract"];
25416
+ "X-Request-ID": components["headers"]["X-Request-ID"];
25417
+ "X-RateLimit-Limit": components["headers"]["X-RateLimit-Limit"];
25418
+ "X-RateLimit-Remaining": components["headers"]["X-RateLimit-Remaining"];
25419
+ "X-RateLimit-Reset": components["headers"]["X-RateLimit-Reset"];
25420
+ [name: string]: unknown;
25421
+ };
25422
+ content: {
25423
+ "application/json": components["schemas"]["SourcePage"];
25424
+ };
25425
+ };
25426
+ /** @description - `validation_error`: the query has a parameter this endpoint doesn't take. */
25427
+ 400: {
25428
+ headers: {
25429
+ "X-Marfa-Contract": components["headers"]["X-Marfa-Contract"];
25430
+ "X-Request-ID": components["headers"]["X-Request-ID"];
25431
+ "X-RateLimit-Limit": components["headers"]["X-RateLimit-Limit"];
25432
+ "X-RateLimit-Remaining": components["headers"]["X-RateLimit-Remaining"];
25433
+ "X-RateLimit-Reset": components["headers"]["X-RateLimit-Reset"];
25434
+ "X-Error-Code": components["headers"]["X-Error-Code"];
25435
+ [name: string]: unknown;
25436
+ };
25437
+ content: {
25438
+ "application/json": components["schemas"]["ValidationErrorRefusal"];
25439
+ };
25440
+ };
25441
+ /** @description `unauthorized`: the request has no credential, or its credential is not valid. */
25442
+ 401: {
25443
+ headers: {
25444
+ "X-Marfa-Contract": components["headers"]["X-Marfa-Contract"];
25445
+ "X-Request-ID": components["headers"]["X-Request-ID"];
25446
+ "X-RateLimit-Limit": components["headers"]["X-RateLimit-Limit"];
25447
+ "X-RateLimit-Remaining": components["headers"]["X-RateLimit-Remaining"];
25448
+ "X-RateLimit-Reset": components["headers"]["X-RateLimit-Reset"];
25449
+ "X-Error-Code": components["headers"]["X-Error-Code"];
25450
+ [name: string]: unknown;
25451
+ };
25452
+ content: {
25453
+ "application/json": components["schemas"]["UnauthorizedRefusal"];
25454
+ };
25455
+ };
25456
+ /** @description `rate_limited`: you sent too many requests. Wait for the number of seconds in `Retry-After`, then try again. */
25457
+ 429: {
25458
+ headers: {
25459
+ "X-Marfa-Contract": components["headers"]["X-Marfa-Contract"];
25460
+ "X-Request-ID": components["headers"]["X-Request-ID"];
25461
+ "X-RateLimit-Limit": components["headers"]["X-RateLimit-Limit"];
25462
+ "X-RateLimit-Remaining": components["headers"]["X-RateLimit-Remaining"];
25463
+ "X-RateLimit-Reset": components["headers"]["X-RateLimit-Reset"];
25464
+ "X-Error-Code": components["headers"]["X-Error-Code"];
25465
+ "Retry-After": components["headers"]["Retry-After"];
25466
+ [name: string]: unknown;
25467
+ };
25468
+ content: {
25469
+ "application/json": components["schemas"]["RateLimitedRefusal"];
25470
+ };
25471
+ };
25472
+ /** @description `internal_error`: Marfa failed in a way it didn't expect, and the request may not have completed. Read what you changed before you repeat a write. */
25473
+ 500: {
25474
+ headers: {
25475
+ "X-Marfa-Contract": components["headers"]["X-Marfa-Contract"];
25476
+ "X-Request-ID": components["headers"]["X-Request-ID"];
25477
+ "X-RateLimit-Limit": components["headers"]["X-RateLimit-Limit"];
25478
+ "X-RateLimit-Remaining": components["headers"]["X-RateLimit-Remaining"];
25479
+ "X-RateLimit-Reset": components["headers"]["X-RateLimit-Reset"];
25480
+ "X-Error-Code": components["headers"]["X-Error-Code"];
25481
+ [name: string]: unknown;
25482
+ };
25483
+ content: {
25484
+ "application/json": components["schemas"]["InternalErrorRefusal"];
25485
+ };
25486
+ };
25487
+ /** @description `write_contention`: the database was busy, and Marfa couldn't complete the request in time. Nothing changed. Try the request again. */
25488
+ 503: {
25489
+ headers: {
25490
+ "X-Marfa-Contract": components["headers"]["X-Marfa-Contract"];
25491
+ "X-Request-ID": components["headers"]["X-Request-ID"];
25492
+ "X-RateLimit-Limit": components["headers"]["X-RateLimit-Limit"];
25493
+ "X-RateLimit-Remaining": components["headers"]["X-RateLimit-Remaining"];
25494
+ "X-RateLimit-Reset": components["headers"]["X-RateLimit-Reset"];
25495
+ "X-Error-Code": components["headers"]["X-Error-Code"];
25496
+ [name: string]: unknown;
25497
+ };
25498
+ content: {
25499
+ "application/json": components["schemas"]["WriteContentionRefusal"];
25500
+ };
25501
+ };
25502
+ /** @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. */
25503
+ 507: {
25504
+ headers: {
25505
+ "X-Marfa-Contract": components["headers"]["X-Marfa-Contract"];
25506
+ "X-Request-ID": components["headers"]["X-Request-ID"];
25507
+ "X-RateLimit-Limit": components["headers"]["X-RateLimit-Limit"];
25508
+ "X-RateLimit-Remaining": components["headers"]["X-RateLimit-Remaining"];
25509
+ "X-RateLimit-Reset": components["headers"]["X-RateLimit-Reset"];
25510
+ "X-Error-Code": components["headers"]["X-Error-Code"];
25511
+ [name: string]: unknown;
25512
+ };
25513
+ content: {
25514
+ "application/json": components["schemas"]["InsufficientStorageRefusal"];
25515
+ };
25516
+ };
25517
+ };
25518
+ };
25519
+ getSource: {
25520
+ parameters: {
25521
+ query: {
25522
+ /** @description The source code. It's a query parameter because a code such as `..` or one holding `/` can't travel safely in a path. */
25523
+ source: string;
25524
+ };
25525
+ header?: never;
25526
+ path?: never;
25527
+ cookie?: never;
25528
+ };
25529
+ requestBody?: never;
25530
+ responses: {
25531
+ /** @description Returns the source. */
25532
+ 200: {
25533
+ headers: {
25534
+ "X-Marfa-Contract": components["headers"]["X-Marfa-Contract"];
25535
+ "X-Request-ID": components["headers"]["X-Request-ID"];
25536
+ "X-RateLimit-Limit": components["headers"]["X-RateLimit-Limit"];
25537
+ "X-RateLimit-Remaining": components["headers"]["X-RateLimit-Remaining"];
25538
+ "X-RateLimit-Reset": components["headers"]["X-RateLimit-Reset"];
25539
+ [name: string]: unknown;
25540
+ };
25541
+ content: {
25542
+ "application/json": components["schemas"]["Source"];
25543
+ };
25544
+ };
25545
+ /**
25546
+ * @description - `missing_required_field`: `source` is missing.
25547
+ * - `validation_error`: `source` is empty, padded, or over 200 characters excluding a leading `restored:`, or the query has a parameter this endpoint doesn't take.
25548
+ */
25549
+ 400: {
25550
+ headers: {
25551
+ "X-Marfa-Contract": components["headers"]["X-Marfa-Contract"];
25552
+ "X-Request-ID": components["headers"]["X-Request-ID"];
25553
+ "X-RateLimit-Limit": components["headers"]["X-RateLimit-Limit"];
25554
+ "X-RateLimit-Remaining": components["headers"]["X-RateLimit-Remaining"];
25555
+ "X-RateLimit-Reset": components["headers"]["X-RateLimit-Reset"];
25556
+ "X-Error-Code": components["headers"]["X-Error-Code"];
25557
+ [name: string]: unknown;
25558
+ };
25559
+ content: {
25560
+ "application/json": components["schemas"]["MissingRequiredFieldOrValidationErrorRefusal"];
25561
+ };
25562
+ };
25563
+ /** @description `unauthorized`: the request has no credential, or its credential is not valid. */
25564
+ 401: {
25565
+ headers: {
25566
+ "X-Marfa-Contract": components["headers"]["X-Marfa-Contract"];
25567
+ "X-Request-ID": components["headers"]["X-Request-ID"];
25568
+ "X-RateLimit-Limit": components["headers"]["X-RateLimit-Limit"];
25569
+ "X-RateLimit-Remaining": components["headers"]["X-RateLimit-Remaining"];
25570
+ "X-RateLimit-Reset": components["headers"]["X-RateLimit-Reset"];
25571
+ "X-Error-Code": components["headers"]["X-Error-Code"];
25572
+ [name: string]: unknown;
25573
+ };
25574
+ content: {
25575
+ "application/json": components["schemas"]["UnauthorizedRefusal"];
25576
+ };
25577
+ };
25578
+ /** @description `source_not_found`: the source isn't your own or one you claim, and no item you can read carries it. */
25579
+ 404: {
25580
+ headers: {
25581
+ "X-Marfa-Contract": components["headers"]["X-Marfa-Contract"];
25582
+ "X-Request-ID": components["headers"]["X-Request-ID"];
25583
+ "X-RateLimit-Limit": components["headers"]["X-RateLimit-Limit"];
25584
+ "X-RateLimit-Remaining": components["headers"]["X-RateLimit-Remaining"];
25585
+ "X-RateLimit-Reset": components["headers"]["X-RateLimit-Reset"];
25586
+ "X-Error-Code": components["headers"]["X-Error-Code"];
25587
+ [name: string]: unknown;
25588
+ };
25589
+ content: {
25590
+ "application/json": components["schemas"]["SourceNotFoundRefusal"];
25591
+ };
25592
+ };
25593
+ /** @description `rate_limited`: you sent too many requests. Wait for the number of seconds in `Retry-After`, then try again. */
25594
+ 429: {
25595
+ headers: {
25596
+ "X-Marfa-Contract": components["headers"]["X-Marfa-Contract"];
25597
+ "X-Request-ID": components["headers"]["X-Request-ID"];
25598
+ "X-RateLimit-Limit": components["headers"]["X-RateLimit-Limit"];
25599
+ "X-RateLimit-Remaining": components["headers"]["X-RateLimit-Remaining"];
25600
+ "X-RateLimit-Reset": components["headers"]["X-RateLimit-Reset"];
25601
+ "X-Error-Code": components["headers"]["X-Error-Code"];
25602
+ "Retry-After": components["headers"]["Retry-After"];
25603
+ [name: string]: unknown;
25604
+ };
25605
+ content: {
25606
+ "application/json": components["schemas"]["RateLimitedRefusal"];
25607
+ };
25608
+ };
25609
+ /** @description `internal_error`: Marfa failed in a way it didn't expect, and the request may not have completed. Read what you changed before you repeat a write. */
25610
+ 500: {
25611
+ headers: {
25612
+ "X-Marfa-Contract": components["headers"]["X-Marfa-Contract"];
25613
+ "X-Request-ID": components["headers"]["X-Request-ID"];
25614
+ "X-RateLimit-Limit": components["headers"]["X-RateLimit-Limit"];
25615
+ "X-RateLimit-Remaining": components["headers"]["X-RateLimit-Remaining"];
25616
+ "X-RateLimit-Reset": components["headers"]["X-RateLimit-Reset"];
25617
+ "X-Error-Code": components["headers"]["X-Error-Code"];
25618
+ [name: string]: unknown;
25619
+ };
25620
+ content: {
25621
+ "application/json": components["schemas"]["InternalErrorRefusal"];
25622
+ };
25623
+ };
25624
+ /** @description `write_contention`: the database was busy, and Marfa couldn't complete the request in time. Nothing changed. Try the request again. */
25625
+ 503: {
25626
+ headers: {
25627
+ "X-Marfa-Contract": components["headers"]["X-Marfa-Contract"];
25628
+ "X-Request-ID": components["headers"]["X-Request-ID"];
25629
+ "X-RateLimit-Limit": components["headers"]["X-RateLimit-Limit"];
25630
+ "X-RateLimit-Remaining": components["headers"]["X-RateLimit-Remaining"];
25631
+ "X-RateLimit-Reset": components["headers"]["X-RateLimit-Reset"];
25632
+ "X-Error-Code": components["headers"]["X-Error-Code"];
25633
+ [name: string]: unknown;
25634
+ };
25635
+ content: {
25636
+ "application/json": components["schemas"]["WriteContentionRefusal"];
25637
+ };
25638
+ };
25639
+ /** @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. */
25640
+ 507: {
25641
+ headers: {
25642
+ "X-Marfa-Contract": components["headers"]["X-Marfa-Contract"];
25643
+ "X-Request-ID": components["headers"]["X-Request-ID"];
25644
+ "X-RateLimit-Limit": components["headers"]["X-RateLimit-Limit"];
25645
+ "X-RateLimit-Remaining": components["headers"]["X-RateLimit-Remaining"];
25646
+ "X-RateLimit-Reset": components["headers"]["X-RateLimit-Reset"];
25647
+ "X-Error-Code": components["headers"]["X-Error-Code"];
25648
+ [name: string]: unknown;
25649
+ };
25650
+ content: {
25651
+ "application/json": components["schemas"]["InsufficientStorageRefusal"];
25652
+ };
25653
+ };
25654
+ };
25655
+ };
25656
+ updateSource: {
25657
+ parameters: {
25658
+ query: {
25659
+ /** @description The source code. It's a query parameter because a code such as `..` or one holding `/` can't travel safely in a path. */
25660
+ source: string;
25661
+ };
25662
+ header?: {
25663
+ /** @description The ID of the instance you expect, as `GET /` returns it. If another instance answers at this address, Marfa returns `409 instance_changed` and doesn't write. Leave it out to send the request to whichever instance answers. */
25664
+ "X-Marfa-Instance-Id"?: string;
25665
+ };
25666
+ path?: never;
25667
+ cookie?: never;
25668
+ };
25669
+ requestBody: {
25670
+ content: {
25671
+ "application/json": {
25672
+ /**
25673
+ * @description The name to show for the source, or `null` to clear it. Marfa trims spaces from each end.
25674
+ * @example GitHub
25675
+ */
25676
+ name?: string | null;
25677
+ /**
25678
+ * @description An icon ID from the same sets as a type's `icon`, or `null` to clear it.
25679
+ * @example simple-icons:github
25680
+ */
25681
+ mark?: string | null;
25682
+ };
25683
+ };
25684
+ };
25685
+ responses: {
25686
+ /** @description Returns the source as it now reads. */
25687
+ 200: {
25688
+ headers: {
25689
+ "X-Marfa-Contract": components["headers"]["X-Marfa-Contract"];
25690
+ "X-Request-ID": components["headers"]["X-Request-ID"];
25691
+ "X-RateLimit-Limit": components["headers"]["X-RateLimit-Limit"];
25692
+ "X-RateLimit-Remaining": components["headers"]["X-RateLimit-Remaining"];
25693
+ "X-RateLimit-Reset": components["headers"]["X-RateLimit-Reset"];
25694
+ [name: string]: unknown;
25695
+ };
25696
+ content: {
25697
+ "application/json": components["schemas"]["Source"];
25698
+ };
25699
+ };
25700
+ /**
25701
+ * @description - `missing_required_field`: `source` is missing.
25702
+ * - `validation_error`: `source` is empty, padded, or over 200 characters excluding a leading `restored:`, `name` is empty, too long or holds a control character, the body has a field this endpoint doesn't take, or the query has a parameter it doesn't take.
25703
+ * - `invalid_schema`: `mark` isn't the ID of an icon in a pinned set (`details.errors` names it).
25704
+ */
25705
+ 400: {
25706
+ headers: {
25707
+ "X-Marfa-Contract": components["headers"]["X-Marfa-Contract"];
25708
+ "X-Request-ID": components["headers"]["X-Request-ID"];
25709
+ "X-RateLimit-Limit": components["headers"]["X-RateLimit-Limit"];
25710
+ "X-RateLimit-Remaining": components["headers"]["X-RateLimit-Remaining"];
25711
+ "X-RateLimit-Reset": components["headers"]["X-RateLimit-Reset"];
25712
+ "X-Error-Code": components["headers"]["X-Error-Code"];
25713
+ [name: string]: unknown;
25714
+ };
25715
+ content: {
25716
+ "application/json": components["schemas"]["InvalidSchemaOrMissingRequiredFieldOrValidationErrorRefusal"];
25717
+ };
25718
+ };
25719
+ /** @description `unauthorized`: the request has no credential, or its credential is not valid. */
25720
+ 401: {
25721
+ headers: {
25722
+ "X-Marfa-Contract": components["headers"]["X-Marfa-Contract"];
25723
+ "X-Request-ID": components["headers"]["X-Request-ID"];
25724
+ "X-RateLimit-Limit": components["headers"]["X-RateLimit-Limit"];
25725
+ "X-RateLimit-Remaining": components["headers"]["X-RateLimit-Remaining"];
25726
+ "X-RateLimit-Reset": components["headers"]["X-RateLimit-Reset"];
25727
+ "X-Error-Code": components["headers"]["X-Error-Code"];
25728
+ [name: string]: unknown;
25729
+ };
25730
+ content: {
25731
+ "application/json": components["schemas"]["UnauthorizedRefusal"];
25732
+ };
25733
+ };
25734
+ /** @description `forbidden`: the source isn't your own or one you claim, and you don't hold `keys.manage` (`details.required_scope`). */
25735
+ 403: {
25736
+ headers: {
25737
+ "X-Marfa-Contract": components["headers"]["X-Marfa-Contract"];
25738
+ "X-Request-ID": components["headers"]["X-Request-ID"];
25739
+ "X-RateLimit-Limit": components["headers"]["X-RateLimit-Limit"];
25740
+ "X-RateLimit-Remaining": components["headers"]["X-RateLimit-Remaining"];
25741
+ "X-RateLimit-Reset": components["headers"]["X-RateLimit-Reset"];
25742
+ "X-Error-Code": components["headers"]["X-Error-Code"];
25743
+ [name: string]: unknown;
25744
+ };
25745
+ content: {
25746
+ "application/json": components["schemas"]["ForbiddenRefusal"];
25747
+ };
25748
+ };
25749
+ /** @description `instance_changed`: `X-Marfa-Instance-Id` names another instance. Nothing is written. Rebuild the working copy from the instance at this address. */
25750
+ 409: {
25751
+ headers: {
25752
+ "X-Marfa-Contract": components["headers"]["X-Marfa-Contract"];
25753
+ "X-Request-ID": components["headers"]["X-Request-ID"];
25754
+ "X-RateLimit-Limit": components["headers"]["X-RateLimit-Limit"];
25755
+ "X-RateLimit-Remaining": components["headers"]["X-RateLimit-Remaining"];
25756
+ "X-RateLimit-Reset": components["headers"]["X-RateLimit-Reset"];
25757
+ "X-Error-Code": components["headers"]["X-Error-Code"];
25758
+ [name: string]: unknown;
25759
+ };
25760
+ content: {
25761
+ "application/json": components["schemas"]["InstanceChangedRefusal"];
25762
+ };
25763
+ };
25764
+ /** @description `request_too_large`: the request body is larger than this instance accepts. */
25765
+ 413: {
25766
+ headers: {
25767
+ "X-Marfa-Contract": components["headers"]["X-Marfa-Contract"];
25768
+ "X-Request-ID": components["headers"]["X-Request-ID"];
25769
+ "X-Error-Code": components["headers"]["X-Error-Code"];
25770
+ [name: string]: unknown;
25771
+ };
25772
+ content: {
25773
+ "application/json": components["schemas"]["RequestTooLargeRefusal"];
25774
+ };
25775
+ };
25776
+ /** @description `rate_limited`: you sent too many requests. Wait for the number of seconds in `Retry-After`, then try again. */
25777
+ 429: {
25778
+ headers: {
25779
+ "X-Marfa-Contract": components["headers"]["X-Marfa-Contract"];
25780
+ "X-Request-ID": components["headers"]["X-Request-ID"];
25781
+ "X-RateLimit-Limit": components["headers"]["X-RateLimit-Limit"];
25782
+ "X-RateLimit-Remaining": components["headers"]["X-RateLimit-Remaining"];
25783
+ "X-RateLimit-Reset": components["headers"]["X-RateLimit-Reset"];
25784
+ "X-Error-Code": components["headers"]["X-Error-Code"];
25785
+ "Retry-After": components["headers"]["Retry-After"];
25786
+ [name: string]: unknown;
25787
+ };
25788
+ content: {
25789
+ "application/json": components["schemas"]["RateLimitedRefusal"];
25790
+ };
25791
+ };
25792
+ /** @description `internal_error`: Marfa failed in a way it didn't expect, and the request may not have completed. Read what you changed before you repeat a write. */
25793
+ 500: {
25794
+ headers: {
25795
+ "X-Marfa-Contract": components["headers"]["X-Marfa-Contract"];
25796
+ "X-Request-ID": components["headers"]["X-Request-ID"];
25797
+ "X-RateLimit-Limit": components["headers"]["X-RateLimit-Limit"];
25798
+ "X-RateLimit-Remaining": components["headers"]["X-RateLimit-Remaining"];
25799
+ "X-RateLimit-Reset": components["headers"]["X-RateLimit-Reset"];
25800
+ "X-Error-Code": components["headers"]["X-Error-Code"];
25801
+ [name: string]: unknown;
25802
+ };
25803
+ content: {
25804
+ "application/json": components["schemas"]["InternalErrorRefusal"];
25805
+ };
25806
+ };
25807
+ /** @description `write_contention`: the database was busy, and Marfa couldn't complete the request in time. Nothing changed. Try the request again. */
25808
+ 503: {
25809
+ headers: {
25810
+ "X-Marfa-Contract": components["headers"]["X-Marfa-Contract"];
25811
+ "X-Request-ID": components["headers"]["X-Request-ID"];
25812
+ "X-RateLimit-Limit": components["headers"]["X-RateLimit-Limit"];
25813
+ "X-RateLimit-Remaining": components["headers"]["X-RateLimit-Remaining"];
25814
+ "X-RateLimit-Reset": components["headers"]["X-RateLimit-Reset"];
25815
+ "X-Error-Code": components["headers"]["X-Error-Code"];
25816
+ [name: string]: unknown;
25817
+ };
25818
+ content: {
25819
+ "application/json": components["schemas"]["WriteContentionRefusal"];
25820
+ };
25821
+ };
25822
+ /** @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. */
25823
+ 507: {
25824
+ headers: {
25825
+ "X-Marfa-Contract": components["headers"]["X-Marfa-Contract"];
25826
+ "X-Request-ID": components["headers"]["X-Request-ID"];
25827
+ "X-RateLimit-Limit": components["headers"]["X-RateLimit-Limit"];
25828
+ "X-RateLimit-Remaining": components["headers"]["X-RateLimit-Remaining"];
25829
+ "X-RateLimit-Reset": components["headers"]["X-RateLimit-Reset"];
25830
+ "X-Error-Code": components["headers"]["X-Error-Code"];
25831
+ [name: string]: unknown;
25832
+ };
25833
+ content: {
25834
+ "application/json": components["schemas"]["InsufficientStorageRefusal"];
25835
+ };
25836
+ };
25837
+ };
25838
+ };
25312
25839
  listKeys: {
25313
25840
  parameters: {
25314
25841
  query?: never;
@@ -31128,6 +31655,14 @@ interface operations {
31128
31655
  type_icons_skipped_reasons: {
31129
31656
  [key: string]: number;
31130
31657
  };
31658
+ /** @description How many source names and marks Marfa added, for sources the instance names nothing yet. */
31659
+ sources_added: number;
31660
+ /** @description How many source names and marks Marfa skipped. */
31661
+ sources_skipped: number;
31662
+ /** @description How many source names and marks Marfa skipped for each reason: `already_set` when the instance already has a name or mark for the source, `unknown_mark` when the mark isn't the ID of an icon in a set Marfa pins, `duplicate_code` when another line of the archive lands on the same code and the line already carrying it wins. */
31663
+ sources_skipped_reasons: {
31664
+ [key: string]: number;
31665
+ };
31131
31666
  };
31132
31667
  };
31133
31668
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@withmarfa/client",
3
- "version": "0.0.51",
3
+ "version": "0.0.52",
4
4
  "license": "Apache-2.0",
5
5
  "repository": {
6
6
  "type": "git",