@arke-institute/sdk 2.3.1 → 2.3.3

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.
@@ -6,7 +6,7 @@
6
6
  *
7
7
  * Source: Arke v1 API
8
8
  * Version: 1.0.0
9
- * Generated: 2026-01-04T14:33:00.781Z
9
+ * Generated: 2026-01-04T18:00:08.698Z
10
10
  */
11
11
  type paths = {
12
12
  "/auth/register": {
@@ -2042,6 +2042,76 @@ type paths = {
2042
2042
  patch?: never;
2043
2043
  trace?: never;
2044
2044
  };
2045
+ "/entities/{id}/collection": {
2046
+ parameters: {
2047
+ query?: never;
2048
+ header?: never;
2049
+ path?: never;
2050
+ cookie?: never;
2051
+ };
2052
+ /**
2053
+ * Get entity collection
2054
+ * @description Returns the collection ID that this entity belongs to. Returns null if the entity is not in any collection. If the entity IS a collection, returns its own ID.
2055
+ */
2056
+ get: {
2057
+ parameters: {
2058
+ query?: never;
2059
+ header?: never;
2060
+ path: {
2061
+ /** @description Entity ID (ULID) */
2062
+ id: string;
2063
+ };
2064
+ cookie?: never;
2065
+ };
2066
+ requestBody?: never;
2067
+ responses: {
2068
+ /** @description Collection lookup result */
2069
+ 200: {
2070
+ headers: {
2071
+ [name: string]: unknown;
2072
+ };
2073
+ content: {
2074
+ "application/json": components["schemas"]["EntityCollectionResponse"];
2075
+ };
2076
+ };
2077
+ /** @description Forbidden - Insufficient permissions */
2078
+ 403: {
2079
+ headers: {
2080
+ [name: string]: unknown;
2081
+ };
2082
+ content: {
2083
+ /**
2084
+ * @example {
2085
+ * "error": "Forbidden: You do not have permission to perform this action"
2086
+ * }
2087
+ */
2088
+ "application/json": components["schemas"]["ErrorResponse"];
2089
+ };
2090
+ };
2091
+ /** @description Not Found - Resource does not exist */
2092
+ 404: {
2093
+ headers: {
2094
+ [name: string]: unknown;
2095
+ };
2096
+ content: {
2097
+ /**
2098
+ * @example {
2099
+ * "error": "Entity not found"
2100
+ * }
2101
+ */
2102
+ "application/json": components["schemas"]["ErrorResponse"];
2103
+ };
2104
+ };
2105
+ };
2106
+ };
2107
+ put?: never;
2108
+ post?: never;
2109
+ delete?: never;
2110
+ options?: never;
2111
+ head?: never;
2112
+ patch?: never;
2113
+ trace?: never;
2114
+ };
2045
2115
  "/relationships": {
2046
2116
  parameters: {
2047
2117
  query?: never;
@@ -4866,12 +4936,17 @@ type paths = {
4866
4936
  * @description Returns a cursor-based list of entity change events for client synchronization.
4867
4937
  *
4868
4938
  * **Usage:**
4869
- * - Start with `?after=0` to get all events
4870
- * - Use the returned `cursor` as `?after=` for the next page
4871
- * - Poll periodically (e.g., every 10s) to stay in sync
4939
+ * - Call without cursor to get newest events
4940
+ * - Use returned `cursor` as `?cursor=` to get older events
4941
+ * - Poll without cursor periodically to check for new events
4942
+ *
4943
+ * **Sync flow:**
4944
+ * 1. Initial: `GET /events` → get newest, save highest `id` as high-water mark
4945
+ * 2. Paginate: `GET /events?cursor=X` → get older events until `has_more=false`
4946
+ * 3. Poll: `GET /events` → if newest `id` > high-water mark, process new events
4872
4947
  *
4873
4948
  * **Event data:**
4874
- * - `id`: Auto-increment ID (use as cursor)
4949
+ * - `id`: Auto-increment ID
4875
4950
  * - `pi`: Entity ID that changed
4876
4951
  * - `cid`: New manifest CID
4877
4952
  * - `ts`: ISO timestamp
@@ -4881,8 +4956,8 @@ type paths = {
4881
4956
  get: {
4882
4957
  parameters: {
4883
4958
  query?: {
4884
- /** @description Return events with id > after (cursor for pagination) */
4885
- after?: number | null;
4959
+ /** @description Return events older than this id (from previous response cursor) */
4960
+ cursor?: number;
4886
4961
  /** @description Maximum number of events to return (default: 100, max: 1000) */
4887
4962
  limit?: number;
4888
4963
  /** @description Network to query (default: main) */
@@ -5784,6 +5859,13 @@ type components = {
5784
5859
  */
5785
5860
  note?: string;
5786
5861
  };
5862
+ EntityCollectionResponse: {
5863
+ /**
5864
+ * @description The collection ID this entity belongs to, or null if not in any collection
5865
+ * @example 01KDETYWYWM0MJVKM8DK3AEXPY
5866
+ */
5867
+ collection_id: string | null;
5868
+ };
5787
5869
  AddRelationshipResponse: {
5788
5870
  source: components["schemas"]["EntityResponse"] & unknown;
5789
5871
  target?: components["schemas"]["EntityResponse"] & unknown;
@@ -7016,16 +7098,16 @@ type components = {
7016
7098
  ts: string;
7017
7099
  };
7018
7100
  EventsListResponse: {
7019
- /** @description List of events */
7101
+ /** @description List of events (newest first) */
7020
7102
  events: components["schemas"]["Event"][];
7021
7103
  /**
7022
- * @description Whether there are more events available
7104
+ * @description Whether there are more (older) events available
7023
7105
  * @example true
7024
7106
  */
7025
7107
  has_more: boolean;
7026
7108
  /**
7027
- * @description Cursor for the next page (pass as ?after= parameter)
7028
- * @example 12347
7109
+ * @description Cursor for the next page (oldest id in batch, pass as ?cursor= for older events)
7110
+ * @example 12340
7029
7111
  */
7030
7112
  cursor: number;
7031
7113
  };
@@ -6,7 +6,7 @@
6
6
  *
7
7
  * Source: Arke v1 API
8
8
  * Version: 1.0.0
9
- * Generated: 2026-01-04T14:33:00.781Z
9
+ * Generated: 2026-01-04T18:00:08.698Z
10
10
  */
11
11
  type paths = {
12
12
  "/auth/register": {
@@ -2042,6 +2042,76 @@ type paths = {
2042
2042
  patch?: never;
2043
2043
  trace?: never;
2044
2044
  };
2045
+ "/entities/{id}/collection": {
2046
+ parameters: {
2047
+ query?: never;
2048
+ header?: never;
2049
+ path?: never;
2050
+ cookie?: never;
2051
+ };
2052
+ /**
2053
+ * Get entity collection
2054
+ * @description Returns the collection ID that this entity belongs to. Returns null if the entity is not in any collection. If the entity IS a collection, returns its own ID.
2055
+ */
2056
+ get: {
2057
+ parameters: {
2058
+ query?: never;
2059
+ header?: never;
2060
+ path: {
2061
+ /** @description Entity ID (ULID) */
2062
+ id: string;
2063
+ };
2064
+ cookie?: never;
2065
+ };
2066
+ requestBody?: never;
2067
+ responses: {
2068
+ /** @description Collection lookup result */
2069
+ 200: {
2070
+ headers: {
2071
+ [name: string]: unknown;
2072
+ };
2073
+ content: {
2074
+ "application/json": components["schemas"]["EntityCollectionResponse"];
2075
+ };
2076
+ };
2077
+ /** @description Forbidden - Insufficient permissions */
2078
+ 403: {
2079
+ headers: {
2080
+ [name: string]: unknown;
2081
+ };
2082
+ content: {
2083
+ /**
2084
+ * @example {
2085
+ * "error": "Forbidden: You do not have permission to perform this action"
2086
+ * }
2087
+ */
2088
+ "application/json": components["schemas"]["ErrorResponse"];
2089
+ };
2090
+ };
2091
+ /** @description Not Found - Resource does not exist */
2092
+ 404: {
2093
+ headers: {
2094
+ [name: string]: unknown;
2095
+ };
2096
+ content: {
2097
+ /**
2098
+ * @example {
2099
+ * "error": "Entity not found"
2100
+ * }
2101
+ */
2102
+ "application/json": components["schemas"]["ErrorResponse"];
2103
+ };
2104
+ };
2105
+ };
2106
+ };
2107
+ put?: never;
2108
+ post?: never;
2109
+ delete?: never;
2110
+ options?: never;
2111
+ head?: never;
2112
+ patch?: never;
2113
+ trace?: never;
2114
+ };
2045
2115
  "/relationships": {
2046
2116
  parameters: {
2047
2117
  query?: never;
@@ -4866,12 +4936,17 @@ type paths = {
4866
4936
  * @description Returns a cursor-based list of entity change events for client synchronization.
4867
4937
  *
4868
4938
  * **Usage:**
4869
- * - Start with `?after=0` to get all events
4870
- * - Use the returned `cursor` as `?after=` for the next page
4871
- * - Poll periodically (e.g., every 10s) to stay in sync
4939
+ * - Call without cursor to get newest events
4940
+ * - Use returned `cursor` as `?cursor=` to get older events
4941
+ * - Poll without cursor periodically to check for new events
4942
+ *
4943
+ * **Sync flow:**
4944
+ * 1. Initial: `GET /events` → get newest, save highest `id` as high-water mark
4945
+ * 2. Paginate: `GET /events?cursor=X` → get older events until `has_more=false`
4946
+ * 3. Poll: `GET /events` → if newest `id` > high-water mark, process new events
4872
4947
  *
4873
4948
  * **Event data:**
4874
- * - `id`: Auto-increment ID (use as cursor)
4949
+ * - `id`: Auto-increment ID
4875
4950
  * - `pi`: Entity ID that changed
4876
4951
  * - `cid`: New manifest CID
4877
4952
  * - `ts`: ISO timestamp
@@ -4881,8 +4956,8 @@ type paths = {
4881
4956
  get: {
4882
4957
  parameters: {
4883
4958
  query?: {
4884
- /** @description Return events with id > after (cursor for pagination) */
4885
- after?: number | null;
4959
+ /** @description Return events older than this id (from previous response cursor) */
4960
+ cursor?: number;
4886
4961
  /** @description Maximum number of events to return (default: 100, max: 1000) */
4887
4962
  limit?: number;
4888
4963
  /** @description Network to query (default: main) */
@@ -5784,6 +5859,13 @@ type components = {
5784
5859
  */
5785
5860
  note?: string;
5786
5861
  };
5862
+ EntityCollectionResponse: {
5863
+ /**
5864
+ * @description The collection ID this entity belongs to, or null if not in any collection
5865
+ * @example 01KDETYWYWM0MJVKM8DK3AEXPY
5866
+ */
5867
+ collection_id: string | null;
5868
+ };
5787
5869
  AddRelationshipResponse: {
5788
5870
  source: components["schemas"]["EntityResponse"] & unknown;
5789
5871
  target?: components["schemas"]["EntityResponse"] & unknown;
@@ -7016,16 +7098,16 @@ type components = {
7016
7098
  ts: string;
7017
7099
  };
7018
7100
  EventsListResponse: {
7019
- /** @description List of events */
7101
+ /** @description List of events (newest first) */
7020
7102
  events: components["schemas"]["Event"][];
7021
7103
  /**
7022
- * @description Whether there are more events available
7104
+ * @description Whether there are more (older) events available
7023
7105
  * @example true
7024
7106
  */
7025
7107
  has_more: boolean;
7026
7108
  /**
7027
- * @description Cursor for the next page (pass as ?after= parameter)
7028
- * @example 12347
7109
+ * @description Cursor for the next page (oldest id in batch, pass as ?cursor= for older events)
7110
+ * @example 12340
7029
7111
  */
7030
7112
  cursor: number;
7031
7113
  };
package/openapi/spec.json CHANGED
@@ -1802,6 +1802,20 @@
1802
1802
  "expect_tip"
1803
1803
  ]
1804
1804
  },
1805
+ "EntityCollectionResponse": {
1806
+ "type": "object",
1807
+ "properties": {
1808
+ "collection_id": {
1809
+ "type": "string",
1810
+ "nullable": true,
1811
+ "description": "The collection ID this entity belongs to, or null if not in any collection",
1812
+ "example": "01KDETYWYWM0MJVKM8DK3AEXPY"
1813
+ }
1814
+ },
1815
+ "required": [
1816
+ "collection_id"
1817
+ ]
1818
+ },
1805
1819
  "AddRelationshipResponse": {
1806
1820
  "type": "object",
1807
1821
  "properties": {
@@ -4434,17 +4448,17 @@
4434
4448
  "items": {
4435
4449
  "$ref": "#/components/schemas/Event"
4436
4450
  },
4437
- "description": "List of events"
4451
+ "description": "List of events (newest first)"
4438
4452
  },
4439
4453
  "has_more": {
4440
4454
  "type": "boolean",
4441
- "description": "Whether there are more events available",
4455
+ "description": "Whether there are more (older) events available",
4442
4456
  "example": true
4443
4457
  },
4444
4458
  "cursor": {
4445
4459
  "type": "integer",
4446
- "description": "Cursor for the next page (pass as ?after= parameter)",
4447
- "example": 12347
4460
+ "description": "Cursor for the next page (oldest id in batch, pass as ?cursor= for older events)",
4461
+ "example": 12340
4448
4462
  }
4449
4463
  },
4450
4464
  "required": [
@@ -6525,6 +6539,69 @@
6525
6539
  }
6526
6540
  }
6527
6541
  },
6542
+ "/entities/{id}/collection": {
6543
+ "get": {
6544
+ "tags": [
6545
+ "Entities"
6546
+ ],
6547
+ "summary": "Get entity collection",
6548
+ "description": "Returns the collection ID that this entity belongs to. Returns null if the entity is not in any collection. If the entity IS a collection, returns its own ID.",
6549
+ "x-arke-action": "entity:view",
6550
+ "x-arke-auth": "optional",
6551
+ "parameters": [
6552
+ {
6553
+ "schema": {
6554
+ "type": "string",
6555
+ "pattern": "^(?:II[0-9A-HJKMNP-TV-Z]{24}|[FC][0-9A-HJKMNP-TV-Z]{25}|[0-9A-HJKMNP-TV-Z]{26})$",
6556
+ "description": "Entity ID (ULID format)",
6557
+ "example": "01KDETYWYWM0MJVKM8DK3AEXPY"
6558
+ },
6559
+ "required": true,
6560
+ "description": "Entity ID (ULID)",
6561
+ "name": "id",
6562
+ "in": "path"
6563
+ }
6564
+ ],
6565
+ "responses": {
6566
+ "200": {
6567
+ "description": "Collection lookup result",
6568
+ "content": {
6569
+ "application/json": {
6570
+ "schema": {
6571
+ "$ref": "#/components/schemas/EntityCollectionResponse"
6572
+ }
6573
+ }
6574
+ }
6575
+ },
6576
+ "403": {
6577
+ "description": "Forbidden - Insufficient permissions",
6578
+ "content": {
6579
+ "application/json": {
6580
+ "schema": {
6581
+ "$ref": "#/components/schemas/ErrorResponse"
6582
+ },
6583
+ "example": {
6584
+ "error": "Forbidden: You do not have permission to perform this action"
6585
+ }
6586
+ }
6587
+ }
6588
+ },
6589
+ "404": {
6590
+ "description": "Not Found - Resource does not exist",
6591
+ "content": {
6592
+ "application/json": {
6593
+ "schema": {
6594
+ "$ref": "#/components/schemas/ErrorResponse"
6595
+ },
6596
+ "example": {
6597
+ "error": "Entity not found"
6598
+ }
6599
+ }
6600
+ }
6601
+ }
6602
+ }
6603
+ }
6604
+ },
6528
6605
  "/relationships": {
6529
6606
  "post": {
6530
6607
  "tags": [
@@ -9248,20 +9325,19 @@
9248
9325
  "Events"
9249
9326
  ],
9250
9327
  "summary": "List entity change events",
9251
- "description": "Returns a cursor-based list of entity change events for client synchronization.\n\n**Usage:**\n- Start with `?after=0` to get all events\n- Use the returned `cursor` as `?after=` for the next page\n- Poll periodically (e.g., every 10s) to stay in sync\n\n**Event data:**\n- `id`: Auto-increment ID (use as cursor)\n- `pi`: Entity ID that changed\n- `cid`: New manifest CID\n- `ts`: ISO timestamp\n\nEvents are ephemeral (30-day rolling window) - for full sync, use snapshots.",
9328
+ "description": "Returns a cursor-based list of entity change events for client synchronization.\n\n**Usage:**\n- Call without cursor to get newest events\n- Use returned `cursor` as `?cursor=` to get older events\n- Poll without cursor periodically to check for new events\n\n**Sync flow:**\n1. Initial: `GET /events` get newest, save highest `id` as high-water mark\n2. Paginate: `GET /events?cursor=X` → get older events until `has_more=false`\n3. Poll: `GET /events` → if newest `id` > high-water mark, process new events\n\n**Event data:**\n- `id`: Auto-increment ID\n- `pi`: Entity ID that changed\n- `cid`: New manifest CID\n- `ts`: ISO timestamp\n\nEvents are ephemeral (30-day rolling window) - for full sync, use snapshots.",
9252
9329
  "x-arke-action": "events:list",
9253
9330
  "x-arke-auth": "none",
9254
9331
  "parameters": [
9255
9332
  {
9256
9333
  "schema": {
9257
9334
  "type": "integer",
9258
- "nullable": true,
9259
- "minimum": 0,
9335
+ "minimum": 1,
9260
9336
  "example": 12345
9261
9337
  },
9262
9338
  "required": false,
9263
- "description": "Return events with id > after (cursor for pagination)",
9264
- "name": "after",
9339
+ "description": "Return events older than this id (from previous response cursor)",
9340
+ "name": "cursor",
9265
9341
  "in": "query"
9266
9342
  },
9267
9343
  {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "specVersion": "1.0.0",
3
3
  "apiVersion": "1.0.0",
4
- "fetchedAt": "2026-01-04T14:32:59.979Z",
4
+ "fetchedAt": "2026-01-04T18:00:07.945Z",
5
5
  "sourceUrl": "https://arke-v1.arke.institute/openapi.json",
6
6
  "openApiVersion": "3.1.0"
7
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arke-institute/sdk",
3
- "version": "2.3.1",
3
+ "version": "2.3.3",
4
4
  "description": "TypeScript SDK for the Arke API - auto-generated from OpenAPI spec",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs",