@archastro/sdk 0.5.2 → 0.5.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.
Files changed (222) hide show
  1. package/README.md +86 -0
  2. package/dist/auth.d.ts +143 -0
  3. package/dist/auth.d.ts.map +1 -1
  4. package/dist/auth.js +187 -1
  5. package/dist/auth.js.map +1 -1
  6. package/dist/client.d.ts +26 -0
  7. package/dist/client.d.ts.map +1 -1
  8. package/dist/client.js +27 -1
  9. package/dist/client.js.map +1 -1
  10. package/dist/index.d.ts +1 -1
  11. package/dist/index.d.ts.map +1 -1
  12. package/dist/index.js +2 -2
  13. package/dist/index.js.map +1 -1
  14. package/dist/types/ai.d.ts +150 -12
  15. package/dist/types/ai.d.ts.map +1 -1
  16. package/dist/types/ai.js +71 -41
  17. package/dist/types/ai.js.map +1 -1
  18. package/dist/types/artifacts.d.ts +81 -24
  19. package/dist/types/artifacts.d.ts.map +1 -1
  20. package/dist/types/artifacts.js +39 -21
  21. package/dist/types/artifacts.js.map +1 -1
  22. package/dist/types/automations.d.ts +41 -9
  23. package/dist/types/automations.d.ts.map +1 -1
  24. package/dist/types/automations.js +25 -17
  25. package/dist/types/automations.js.map +1 -1
  26. package/dist/types/chat.d.ts +21418 -0
  27. package/dist/types/chat.d.ts.map +1 -0
  28. package/dist/types/chat.js +70 -0
  29. package/dist/types/chat.js.map +1 -0
  30. package/dist/types/common.d.ts +16970 -2136
  31. package/dist/types/common.d.ts.map +1 -1
  32. package/dist/types/common.js +1695 -332
  33. package/dist/types/common.js.map +1 -1
  34. package/dist/types/config.d.ts +239 -31
  35. package/dist/types/config.d.ts.map +1 -1
  36. package/dist/types/config.js +86 -34
  37. package/dist/types/config.js.map +1 -1
  38. package/dist/types/image.d.ts +27 -4
  39. package/dist/types/image.d.ts.map +1 -1
  40. package/dist/types/image.js +17 -10
  41. package/dist/types/image.js.map +1 -1
  42. package/dist/types/index.d.ts +2 -1
  43. package/dist/types/index.d.ts.map +1 -1
  44. package/dist/types/index.js +3 -2
  45. package/dist/types/index.js.map +1 -1
  46. package/dist/types/invites.d.ts +20 -11
  47. package/dist/types/invites.d.ts.map +1 -1
  48. package/dist/types/invites.js +9 -12
  49. package/dist/types/invites.js.map +1 -1
  50. package/dist/types/notifications.d.ts +163 -0
  51. package/dist/types/notifications.d.ts.map +1 -0
  52. package/dist/types/notifications.js +44 -0
  53. package/dist/types/notifications.js.map +1 -0
  54. package/dist/types/teams.d.ts +1628 -231
  55. package/dist/types/teams.d.ts.map +1 -1
  56. package/dist/types/teams.js +76 -45
  57. package/dist/types/teams.js.map +1 -1
  58. package/dist/types/threads.d.ts +997 -243
  59. package/dist/types/threads.d.ts.map +1 -1
  60. package/dist/types/threads.js +84 -51
  61. package/dist/types/threads.js.map +1 -1
  62. package/dist/types/users.d.ts +98 -18
  63. package/dist/types/users.d.ts.map +1 -1
  64. package/dist/types/users.js +43 -18
  65. package/dist/types/users.js.map +1 -1
  66. package/dist/v1/resources/activity_feed.d.ts +89 -0
  67. package/dist/v1/resources/activity_feed.d.ts.map +1 -1
  68. package/dist/v1/resources/activity_feed.js +56 -2
  69. package/dist/v1/resources/activity_feed.js.map +1 -1
  70. package/dist/v1/resources/agent_computers.d.ts +48 -2
  71. package/dist/v1/resources/agent_computers.d.ts.map +1 -1
  72. package/dist/v1/resources/agent_computers.js +48 -1
  73. package/dist/v1/resources/agent_computers.js.map +1 -1
  74. package/dist/v1/resources/agent_env_vars.d.ts +50 -0
  75. package/dist/v1/resources/agent_env_vars.d.ts.map +1 -0
  76. package/dist/v1/resources/agent_env_vars.js +56 -0
  77. package/dist/v1/resources/agent_env_vars.js.map +1 -0
  78. package/dist/v1/resources/agent_health_actions.d.ts +43 -0
  79. package/dist/v1/resources/agent_health_actions.d.ts.map +1 -0
  80. package/dist/v1/resources/agent_health_actions.js +50 -0
  81. package/dist/v1/resources/agent_health_actions.js.map +1 -0
  82. package/dist/v1/resources/agent_installations.d.ts +100 -0
  83. package/dist/v1/resources/agent_installations.d.ts.map +1 -1
  84. package/dist/v1/resources/agent_installations.js +106 -2
  85. package/dist/v1/resources/agent_installations.js.map +1 -1
  86. package/dist/v1/resources/agent_routine_runs.d.ts +33 -0
  87. package/dist/v1/resources/agent_routine_runs.d.ts.map +1 -0
  88. package/dist/v1/resources/agent_routine_runs.js +48 -0
  89. package/dist/v1/resources/agent_routine_runs.js.map +1 -0
  90. package/dist/v1/resources/agent_routines.d.ts +148 -2
  91. package/dist/v1/resources/agent_routines.d.ts.map +1 -1
  92. package/dist/v1/resources/agent_routines.js +168 -3
  93. package/dist/v1/resources/agent_routines.js.map +1 -1
  94. package/dist/v1/resources/agent_sessions.d.ts +118 -1
  95. package/dist/v1/resources/agent_sessions.d.ts.map +1 -1
  96. package/dist/v1/resources/agent_sessions.js +134 -2
  97. package/dist/v1/resources/agent_sessions.js.map +1 -1
  98. package/dist/v1/resources/agent_skills.d.ts +83 -1
  99. package/dist/v1/resources/agent_skills.d.ts.map +1 -1
  100. package/dist/v1/resources/agent_skills.js +87 -2
  101. package/dist/v1/resources/agent_skills.js.map +1 -1
  102. package/dist/v1/resources/agent_tools.d.ts +109 -2
  103. package/dist/v1/resources/agent_tools.d.ts.map +1 -1
  104. package/dist/v1/resources/agent_tools.js +114 -2
  105. package/dist/v1/resources/agent_tools.js.map +1 -1
  106. package/dist/v1/resources/agents.d.ts +517 -9
  107. package/dist/v1/resources/agents.d.ts.map +1 -1
  108. package/dist/v1/resources/agents.js +515 -12
  109. package/dist/v1/resources/agents.js.map +1 -1
  110. package/dist/v1/resources/ai.d.ts +93 -0
  111. package/dist/v1/resources/ai.d.ts.map +1 -1
  112. package/dist/v1/resources/ai.js +89 -1
  113. package/dist/v1/resources/ai.js.map +1 -1
  114. package/dist/v1/resources/artifacts.d.ts +73 -0
  115. package/dist/v1/resources/artifacts.d.ts.map +1 -1
  116. package/dist/v1/resources/artifacts.js +74 -2
  117. package/dist/v1/resources/artifacts.js.map +1 -1
  118. package/dist/v1/resources/automation_runs.d.ts +8 -4
  119. package/dist/v1/resources/automation_runs.d.ts.map +1 -1
  120. package/dist/v1/resources/automation_runs.js +9 -5
  121. package/dist/v1/resources/automation_runs.js.map +1 -1
  122. package/dist/v1/resources/automations.d.ts +20 -0
  123. package/dist/v1/resources/automations.d.ts.map +1 -1
  124. package/dist/v1/resources/automations.js +21 -1
  125. package/dist/v1/resources/automations.js.map +1 -1
  126. package/dist/v1/resources/bug_reports.d.ts +29 -0
  127. package/dist/v1/resources/bug_reports.d.ts.map +1 -0
  128. package/dist/v1/resources/bug_reports.js +29 -0
  129. package/dist/v1/resources/bug_reports.js.map +1 -0
  130. package/dist/v1/resources/config.d.ts +429 -4
  131. package/dist/v1/resources/config.d.ts.map +1 -1
  132. package/dist/v1/resources/config.js +493 -9
  133. package/dist/v1/resources/config.js.map +1 -1
  134. package/dist/v1/resources/custom_objects.d.ts +117 -2
  135. package/dist/v1/resources/custom_objects.d.ts.map +1 -1
  136. package/dist/v1/resources/custom_objects.js +132 -3
  137. package/dist/v1/resources/custom_objects.js.map +1 -1
  138. package/dist/v1/resources/files.d.ts +62 -0
  139. package/dist/v1/resources/files.d.ts.map +1 -0
  140. package/dist/v1/resources/files.js +58 -0
  141. package/dist/v1/resources/files.js.map +1 -0
  142. package/dist/v1/resources/index.d.ts +13 -0
  143. package/dist/v1/resources/index.d.ts.map +1 -1
  144. package/dist/v1/resources/index.js +14 -1
  145. package/dist/v1/resources/index.js.map +1 -1
  146. package/dist/v1/resources/installation_sources.d.ts +12 -0
  147. package/dist/v1/resources/installation_sources.d.ts.map +1 -1
  148. package/dist/v1/resources/installation_sources.js +13 -1
  149. package/dist/v1/resources/installation_sources.js.map +1 -1
  150. package/dist/v1/resources/invites.d.ts +15 -0
  151. package/dist/v1/resources/invites.d.ts.map +1 -1
  152. package/dist/v1/resources/invites.js +16 -1
  153. package/dist/v1/resources/invites.js.map +1 -1
  154. package/dist/v1/resources/knowledge_documents.d.ts +104 -0
  155. package/dist/v1/resources/knowledge_documents.d.ts.map +1 -0
  156. package/dist/v1/resources/knowledge_documents.js +112 -0
  157. package/dist/v1/resources/knowledge_documents.js.map +1 -0
  158. package/dist/v1/resources/knowledge_sources.d.ts +190 -0
  159. package/dist/v1/resources/knowledge_sources.d.ts.map +1 -0
  160. package/dist/v1/resources/knowledge_sources.js +176 -0
  161. package/dist/v1/resources/knowledge_sources.js.map +1 -0
  162. package/dist/v1/resources/kv.d.ts +73 -0
  163. package/dist/v1/resources/kv.d.ts.map +1 -1
  164. package/dist/v1/resources/kv.js +96 -3
  165. package/dist/v1/resources/kv.js.map +1 -1
  166. package/dist/v1/resources/notification_preferences.d.ts +61 -0
  167. package/dist/v1/resources/notification_preferences.d.ts.map +1 -0
  168. package/dist/v1/resources/notification_preferences.js +65 -0
  169. package/dist/v1/resources/notification_preferences.js.map +1 -0
  170. package/dist/v1/resources/notifications.d.ts +133 -0
  171. package/dist/v1/resources/notifications.d.ts.map +1 -0
  172. package/dist/v1/resources/notifications.js +136 -0
  173. package/dist/v1/resources/notifications.js.map +1 -0
  174. package/dist/v1/resources/orgs.d.ts +18 -0
  175. package/dist/v1/resources/orgs.d.ts.map +1 -1
  176. package/dist/v1/resources/orgs.js +30 -2
  177. package/dist/v1/resources/orgs.js.map +1 -1
  178. package/dist/v1/resources/slack_channel_bindings.d.ts +101 -0
  179. package/dist/v1/resources/slack_channel_bindings.d.ts.map +1 -0
  180. package/dist/v1/resources/slack_channel_bindings.js +114 -0
  181. package/dist/v1/resources/slack_channel_bindings.js.map +1 -0
  182. package/dist/v1/resources/solution_categories.d.ts +36 -0
  183. package/dist/v1/resources/solution_categories.d.ts.map +1 -0
  184. package/dist/v1/resources/solution_categories.js +55 -0
  185. package/dist/v1/resources/solution_categories.js.map +1 -0
  186. package/dist/v1/resources/solution_tags.d.ts +37 -0
  187. package/dist/v1/resources/solution_tags.d.ts.map +1 -0
  188. package/dist/v1/resources/solution_tags.js +54 -0
  189. package/dist/v1/resources/solution_tags.js.map +1 -0
  190. package/dist/v1/resources/solutions.d.ts +309 -0
  191. package/dist/v1/resources/solutions.d.ts.map +1 -0
  192. package/dist/v1/resources/solutions.js +214 -0
  193. package/dist/v1/resources/solutions.js.map +1 -0
  194. package/dist/v1/resources/team_memberships.d.ts +31 -0
  195. package/dist/v1/resources/team_memberships.d.ts.map +1 -1
  196. package/dist/v1/resources/team_memberships.js +49 -2
  197. package/dist/v1/resources/team_memberships.js.map +1 -1
  198. package/dist/v1/resources/teams.d.ts +458 -49
  199. package/dist/v1/resources/teams.d.ts.map +1 -1
  200. package/dist/v1/resources/teams.js +319 -27
  201. package/dist/v1/resources/teams.js.map +1 -1
  202. package/dist/v1/resources/thread_messages.d.ts +70 -0
  203. package/dist/v1/resources/thread_messages.d.ts.map +1 -1
  204. package/dist/v1/resources/thread_messages.js +85 -2
  205. package/dist/v1/resources/thread_messages.js.map +1 -1
  206. package/dist/v1/resources/threads.d.ts +201 -0
  207. package/dist/v1/resources/threads.d.ts.map +1 -1
  208. package/dist/v1/resources/threads.js +220 -4
  209. package/dist/v1/resources/threads.js.map +1 -1
  210. package/dist/v1/resources/users.d.ts +213 -39
  211. package/dist/v1/resources/users.d.ts.map +1 -1
  212. package/dist/v1/resources/users.js +121 -16
  213. package/dist/v1/resources/users.js.map +1 -1
  214. package/dist/v1.d.ts +26 -0
  215. package/dist/v1.d.ts.map +1 -1
  216. package/dist/v1.js +40 -1
  217. package/dist/v1.js.map +1 -1
  218. package/package.json +3 -1
  219. package/dist/types/agents.d.ts +0 -2084
  220. package/dist/types/agents.d.ts.map +0 -1
  221. package/dist/types/agents.js +0 -203
  222. package/dist/types/agents.js.map +0 -1
@@ -3,6 +3,26 @@ import type { KeyValueStorageEntry, KeyValueStorageEntryPage } from "../../types
3
3
  export declare class KvResource {
4
4
  private http;
5
5
  constructor(http: HttpClient);
6
+ /**
7
+ * List key-value storage entries
8
+ * Returns key-value storage entries in one of two modes depending on the caller's
9
+ * auth scope.
10
+ * **User-JWT callers** receive a flat list of all their own entries with no
11
+ * pagination fields. The `page`, `page_size`, `user`, `user_search`, and `key`
12
+ * params are ignored.
13
+ * **Developer and server-to-server callers** receive a page-based paginated
14
+ * response across all users within the caller's app. Use `user` to scope results
15
+ * to a single user, `user_search` to do a substring match on email or full name,
16
+ * and `key` to filter entries whose key starts with the given prefix. Results are
17
+ * ordered by creation time descending.
18
+ * @param params - Query parameters.
19
+ * @param params.page - Page number to retrieve. Applies to developer and server-to-server callers only. Defaults to 1.
20
+ * @param params.pageSize - Number of entries per page. Applies to developer and server-to-server callers only. Defaults to 25; maximum is 100.
21
+ * @param params.user - Filter results to entries belonging to this user ID. Applies to developer and server-to-server callers only.
22
+ * @param params.userSearch - Substring match against user email address and full name. Applies to developer and server-to-server callers only.
23
+ * @param params.key - Prefix filter on the storage key. Returns only entries whose key starts with this string. Applies to developer and server-to-server callers only.
24
+ * @returns Key-value storage entries for the current page, with pagination metadata for developer and server-to-server callers.
25
+ */
6
26
  list(params?: {
7
27
  page?: number;
8
28
  pageSize?: number;
@@ -10,15 +30,68 @@ export declare class KvResource {
10
30
  userSearch?: string;
11
31
  key?: string;
12
32
  }): Promise<KeyValueStorageEntryPage>;
33
+ /**
34
+ * Create a key-value storage entry
35
+ * Creates a new key-value storage entry for the target user under the given key.
36
+ * The key must not already exist for this user; use the upsert endpoint to create
37
+ * or overwrite in a single call.
38
+ * End-user (user-JWT) callers always write to their own storage. Developer and
39
+ * server-to-server callers must supply a `user` param identifying the target user
40
+ * within their app's scope. Attempting to write for a user in a different app
41
+ * returns 404.
42
+ * @param input - Request body.
43
+ * @param input.key - Storage key for the entry. Must be a non-empty string unique to this user.
44
+ * @param input.user - Target user ID. Required when calling as a developer or with a server-to-server key; ignored for end-user callers.
45
+ * @param input.value - Value to store under `key`. Must be a non-empty string.
46
+ * @returns The newly created key-value storage entry.
47
+ */
13
48
  create(input: {
14
49
  key: string;
15
50
  user?: string | undefined;
16
51
  value: string;
17
52
  }): Promise<KeyValueStorageEntry>;
53
+ /**
54
+ * Delete a key-value storage entry
55
+ * Permanently deletes the key-value storage entry identified by `key` for the
56
+ * target user. Returns 204 No Content on success and 404 if the entry does not
57
+ * exist.
58
+ * End-user (user-JWT) callers can only delete entries they own. Developer and
59
+ * server-to-server callers must supply a `user` param identifying the target user
60
+ * within their app's scope.
61
+ * @param key - Storage key of the entry to delete. Must be a non-empty string.
62
+ * @returns Empty response body. HTTP 204 No Content on success.
63
+ */
18
64
  delete(key: string): Promise<void>;
65
+ /**
66
+ * Retrieve a key-value storage entry
67
+ * Returns the key-value storage entry identified by `key` for the target user.
68
+ * Returns 404 if no entry exists for that key.
69
+ * End-user (user-JWT) callers retrieve entries from their own storage. Developer
70
+ * and server-to-server callers must supply a `user` param identifying the target
71
+ * user within their app's scope.
72
+ * @param key - Storage key of the entry to retrieve. Must be a non-empty string.
73
+ * @param params - Query parameters.
74
+ * @param params.user - Target user ID. Required when calling as a developer or with a server-to-server key; ignored for end-user callers.
75
+ * @returns The key-value storage entry for the given key.
76
+ */
19
77
  get(key: string, params?: {
20
78
  user?: string;
21
79
  }): Promise<KeyValueStorageEntry>;
80
+ /**
81
+ * Create or update a key-value storage entry
82
+ * Creates a new key-value storage entry for the given `key`, or overwrites the
83
+ * value if an entry already exists. This is the idempotent alternative to the
84
+ * create endpoint: safe to call regardless of whether the key already exists.
85
+ * End-user (user-JWT) callers always write to their own storage. Developer and
86
+ * server-to-server callers must supply a `user` param identifying the target user
87
+ * within their app's scope. Attempting to write for a user in a different app
88
+ * returns 404.
89
+ * @param key - Storage key to create or overwrite. Must be a non-empty string.
90
+ * @param input - Request body.
91
+ * @param input.user - Target user ID. Required when calling as a developer or with a server-to-server key; ignored for end-user callers.
92
+ * @param input.value - New value to store under `key`. Must be a non-empty string. Replaces any existing value.
93
+ * @returns The created or updated key-value storage entry.
94
+ */
22
95
  upsert(key: string, input: {
23
96
  user?: string | undefined;
24
97
  value: string;
@@ -1 +1 @@
1
- {"version":3,"file":"kv.d.ts","sourceRoot":"","sources":["../../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AM,uBAAuB,CAAC;AAE5F,qBAAa,UAAU;IACT,OAAO,CAAC,IAAI;gBAAJ,IAAI,EAAE,UAAU;IAEpC;;;;;;;;;;;;;;;;;;;OAmBG;IACG,IAAI,CAAC,MAAM,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,UAAU,CAAC,EAAE,MAAM,CAAC;QAAC,GAAG,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,wBAAwB,CAAC;IAqB9I;;;;;;;;;;;;;;OAcG;IACG,MAAM,CAAC,KAAK,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAI7G;;;;;;;;;;OAUG;IACG,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAIxC;;;;;;;;;;;OAWG;IACG,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,oBAAoB,CAAC;IASjF;;;;;;;;;;;;;;OAcG;IACG,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,oBAAoB,CAAC;CAG9G"}
@@ -1,23 +1,116 @@
1
1
  // Copyright (c) 2026 ArchAstro Inc. All Rights Reserved.
2
2
  // This file is auto-generated by @archastro/sdk-generator. Do not edit.
3
- // Content hash: 7672a8f64869
3
+ // Content hash: e121fa00429e
4
4
  export class KvResource {
5
5
  http;
6
6
  constructor(http) {
7
7
  this.http = http;
8
8
  }
9
+ /**
10
+ * List key-value storage entries
11
+ * Returns key-value storage entries in one of two modes depending on the caller's
12
+ * auth scope.
13
+ * **User-JWT callers** receive a flat list of all their own entries with no
14
+ * pagination fields. The `page`, `page_size`, `user`, `user_search`, and `key`
15
+ * params are ignored.
16
+ * **Developer and server-to-server callers** receive a page-based paginated
17
+ * response across all users within the caller's app. Use `user` to scope results
18
+ * to a single user, `user_search` to do a substring match on email or full name,
19
+ * and `key` to filter entries whose key starts with the given prefix. Results are
20
+ * ordered by creation time descending.
21
+ * @param params - Query parameters.
22
+ * @param params.page - Page number to retrieve. Applies to developer and server-to-server callers only. Defaults to 1.
23
+ * @param params.pageSize - Number of entries per page. Applies to developer and server-to-server callers only. Defaults to 25; maximum is 100.
24
+ * @param params.user - Filter results to entries belonging to this user ID. Applies to developer and server-to-server callers only.
25
+ * @param params.userSearch - Substring match against user email address and full name. Applies to developer and server-to-server callers only.
26
+ * @param params.key - Prefix filter on the storage key. Returns only entries whose key starts with this string. Applies to developer and server-to-server callers only.
27
+ * @returns Key-value storage entries for the current page, with pagination metadata for developer and server-to-server callers.
28
+ */
9
29
  async list(params) {
10
- return this.http.request(`/api/v1/kv`, { query: params });
30
+ const query = {};
31
+ if (params?.page !== undefined) {
32
+ query["page"] = params?.page;
33
+ }
34
+ if (params?.pageSize !== undefined) {
35
+ query["page_size"] = params?.pageSize;
36
+ }
37
+ if (params?.user !== undefined) {
38
+ query["user"] = params?.user;
39
+ }
40
+ if (params?.userSearch !== undefined) {
41
+ query["user_search"] = params?.userSearch;
42
+ }
43
+ if (params?.key !== undefined) {
44
+ query["key"] = params?.key;
45
+ }
46
+ return this.http.request(`/api/v1/kv`, { query });
11
47
  }
48
+ /**
49
+ * Create a key-value storage entry
50
+ * Creates a new key-value storage entry for the target user under the given key.
51
+ * The key must not already exist for this user; use the upsert endpoint to create
52
+ * or overwrite in a single call.
53
+ * End-user (user-JWT) callers always write to their own storage. Developer and
54
+ * server-to-server callers must supply a `user` param identifying the target user
55
+ * within their app's scope. Attempting to write for a user in a different app
56
+ * returns 404.
57
+ * @param input - Request body.
58
+ * @param input.key - Storage key for the entry. Must be a non-empty string unique to this user.
59
+ * @param input.user - Target user ID. Required when calling as a developer or with a server-to-server key; ignored for end-user callers.
60
+ * @param input.value - Value to store under `key`. Must be a non-empty string.
61
+ * @returns The newly created key-value storage entry.
62
+ */
12
63
  async create(input) {
13
64
  return this.http.request(`/api/v1/kv`, { method: "POST", body: input });
14
65
  }
66
+ /**
67
+ * Delete a key-value storage entry
68
+ * Permanently deletes the key-value storage entry identified by `key` for the
69
+ * target user. Returns 204 No Content on success and 404 if the entry does not
70
+ * exist.
71
+ * End-user (user-JWT) callers can only delete entries they own. Developer and
72
+ * server-to-server callers must supply a `user` param identifying the target user
73
+ * within their app's scope.
74
+ * @param key - Storage key of the entry to delete. Must be a non-empty string.
75
+ * @returns Empty response body. HTTP 204 No Content on success.
76
+ */
15
77
  async delete(key) {
16
78
  await this.http.request(`/api/v1/kv/${key}`, { method: "DELETE" });
17
79
  }
80
+ /**
81
+ * Retrieve a key-value storage entry
82
+ * Returns the key-value storage entry identified by `key` for the target user.
83
+ * Returns 404 if no entry exists for that key.
84
+ * End-user (user-JWT) callers retrieve entries from their own storage. Developer
85
+ * and server-to-server callers must supply a `user` param identifying the target
86
+ * user within their app's scope.
87
+ * @param key - Storage key of the entry to retrieve. Must be a non-empty string.
88
+ * @param params - Query parameters.
89
+ * @param params.user - Target user ID. Required when calling as a developer or with a server-to-server key; ignored for end-user callers.
90
+ * @returns The key-value storage entry for the given key.
91
+ */
18
92
  async get(key, params) {
19
- return this.http.request(`/api/v1/kv/${key}`, { query: params });
93
+ const query = {};
94
+ if (params?.user !== undefined) {
95
+ query["user"] = params?.user;
96
+ }
97
+ return this.http.request(`/api/v1/kv/${key}`, { query });
20
98
  }
99
+ /**
100
+ * Create or update a key-value storage entry
101
+ * Creates a new key-value storage entry for the given `key`, or overwrites the
102
+ * value if an entry already exists. This is the idempotent alternative to the
103
+ * create endpoint: safe to call regardless of whether the key already exists.
104
+ * End-user (user-JWT) callers always write to their own storage. Developer and
105
+ * server-to-server callers must supply a `user` param identifying the target user
106
+ * within their app's scope. Attempting to write for a user in a different app
107
+ * returns 404.
108
+ * @param key - Storage key to create or overwrite. Must be a non-empty string.
109
+ * @param input - Request body.
110
+ * @param input.user - Target user ID. Required when calling as a developer or with a server-to-server key; ignored for end-user callers.
111
+ * @param input.value - New value to store under `key`. Must be a non-empty string. Replaces any existing value.
112
+ * @returns The created or updated key-value storage entry.
113
+ */
21
114
  async upsert(key, input) {
22
115
  return this.http.request(`/api/v1/kv/${key}`, { method: "PUT", body: input });
23
116
  }
@@ -1 +1 @@
1
- {"version":3,"file":"kv.js","sourceRoot":"","sources":["../../../src/v1/resources/kv.ts"],"names":[],"mappings":"AAAA,yDAAyD;AACzD,wEAAwE;AACxE,6BAA6B;AAK7B,MAAM,OAAO,UAAU;IACD;IAApB,YAAoB,IAAgB;QAAhB,SAAI,GAAJ,IAAI,CAAY;IAAG,CAAC;IAExC,KAAK,CAAC,IAAI,CAAC,MAA+F;QACxG,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,YAAY,EAAE,EAAE,KAAK,EAAE,MAAkG,EAAE,CAAC,CAAC;IACxJ,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,KAAgE;QAC3E,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,YAAY,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC;IAC1E,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,GAAW;QACtB,MAAM,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,cAAc,GAAG,EAAE,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,CAAC;IACrE,CAAC;IAED,KAAK,CAAC,GAAG,CAAC,GAAW,EAAE,MAA0B;QAC/C,OAAO,IAAI,CAAC,IAAI,CAAC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E,GAAG,CAAC;QAC7B,CAAC;QAED,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,YAAY,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC;IACpD,CAAC;IAED;;;;;;;;;;;;;;OAcG;IACH,KAAK,CAAC,MAAM,CAAC,KAAgE;QAC3E,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,YAAY,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC;IAC1E,CAAC;IAED;;;;;;;;;;OAUG;IACH,KAAK,CAAC,MAAM,CAAC,GAAW;QACtB,MAAM,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,cAAc,GAAG,EAAE,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,CAAC;IACrE,CAAC;IAED;;;;;;;;;;;OAWG;IACH,KAAK,CAAC,GAAG,CAAC,GAAW,EAAE,MAA0B;QAC/C,MAAM,KAAK,GAA6F,EAAE,CAAC;QAC3G,IAAI,MAAM,EAAE,IAAI,KAAK,SAAS,EAAE,CAAC;YAC/B,KAAK,CAAC,MAAM,CAAC,GAAG,MAAM,EAAE,IAAI,CAAC;QAC/B,CAAC;QAED,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,cAAc,GAAG,EAAE,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC;IAC3D,CAAC;IAED;;;;;;;;;;;;;;OAcG;IACH,KAAK,CAAC,MAAM,CAAC,GAAW,EAAE,KAAmD;QAC3E,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,cAAc,GAAG,EAAE,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC;IAChF,CAAC;CACF"}
@@ -0,0 +1,61 @@
1
+ import { HttpClient } from "../../runtime/http-client.js";
2
+ import type { NotificationPreference, NotificationPreferenceList } from "../../types/notifications.js";
3
+ export declare class NotificationPreferenceResource {
4
+ private http;
5
+ constructor(http: HttpClient);
6
+ /**
7
+ * Delete a notification preference
8
+ * Removes the authenticated user's explicit notification preference for a
9
+ * given `(type, channel)` combination, reverting that slot to the type's
10
+ * default channel set.
11
+ * The `app_id` param scopes the deletion to a specific app's preference
12
+ * row. Omit `app_id` to target the system-level (no-app) slot. Because
13
+ * the two slots are stored independently, omitting `app_id` will not
14
+ * match a row that has one set, and vice versa.
15
+ * Returns `204 No Content` on success. Returns `404` if no preference
16
+ * exists for the given composite key.
17
+ * @returns Empty response body. A `204 No Content` status indicates the preference was deleted successfully.
18
+ */
19
+ remove(): Promise<void>;
20
+ /**
21
+ * List notification preferences
22
+ * Returns all explicit notification preferences belonging to the authenticated
23
+ * user. Preferences are returned for every `(type, channel)` combination the
24
+ * user has explicitly configured; slots that have not been overridden are not
25
+ * included and fall back to the type's defaults.
26
+ * The recipient is derived from the authenticated viewer. You cannot retrieve
27
+ * preferences for any other user through this endpoint. All configured
28
+ * preferences — system-level and app-scoped — are returned together in the
29
+ * `data` array.
30
+ * @returns An object with a `data` array containing all explicit notification preferences for the authenticated user.
31
+ */
32
+ list(): Promise<NotificationPreferenceList>;
33
+ /**
34
+ * Create or update a notification preference
35
+ * Creates or replaces the authenticated user's notification preference for a
36
+ * given `(type, channel)` combination. This is an idempotent PUT: if no
37
+ * preference exists for the composite key, a new row is created; if one
38
+ * already exists, its `enabled` flag is updated to the value you provide.
39
+ * The recipient is derived from the authenticated viewer. You cannot set
40
+ * preferences for another user through this endpoint.
41
+ * Pass `app_id` to scope the preference to a specific app's notifications —
42
+ * most useful for the `app_*` notification type family. Omit `app_id` to
43
+ * configure the system-level (no-app) slot. System-level and app-scoped
44
+ * preferences are stored independently and do not overwrite each other.
45
+ * The `in_app` channel is not configurable and will be rejected with a
46
+ * validation error if supplied.
47
+ * @param input - Request body.
48
+ * @param input.app_id - App to scope this preference to. Omit to configure the system-level (no-app) slot. App-scoped and system-level preferences are stored separately and do not affect each other.
49
+ * @param input.channel - Delivery channel to configure (e.g., `"email"`, `"sms"`). The `in_app` channel is not configurable and will be rejected with a validation error.
50
+ * @param input.enabled - Whether the specified channel should be enabled for this notification type and scope. Set to `false` to suppress delivery on this channel.
51
+ * @param input.type - Notification type to configure. Use a builtin name (e.g., `"app_info"`, `"billing_alert"`) or a `"custom:<lookup_key>"` identifier matching a NotificationType config registered in your app's bundle. Unknown type identifiers are rejected with a validation error.
52
+ * @returns The created or updated notification preference reflecting the new `enabled` state.
53
+ */
54
+ replace(input: {
55
+ app_id?: string | undefined;
56
+ channel: string;
57
+ enabled: boolean;
58
+ type: string;
59
+ }): Promise<NotificationPreference>;
60
+ }
61
+ //# sourceMappingURL=notification_preferences.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notification_preferences.d.ts","sourceRoot":"","sources":["../../../src/v1/resources/notification_preferences.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAC1D,OAAO,KAAK,EAAE,sBAAsB,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAC;AAEvG,qBAAa,8BAA8B;IAC7B,OAAO,CAAC,IAAI;gBAAJ,IAAI,EAAE,UAAU;IAEpC;;;;;;;;;;;;OAYG;IACG,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC;IAI7B;;;;;;;;;;;OAWG;IACG,IAAI,IAAI,OAAO,CAAC,0BAA0B,CAAC;IAIjD;;;;;;;;;;;;;;;;;;;;OAoBG;IACG,OAAO,CAAC,KAAK,EAAE;QAAE,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,OAAO,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,sBAAsB,CAAC;CAGxI"}
@@ -0,0 +1,65 @@
1
+ // Copyright (c) 2026 ArchAstro Inc. All Rights Reserved.
2
+ // This file is auto-generated by @archastro/sdk-generator. Do not edit.
3
+ // Content hash: 56f6e81ca367
4
+ export class NotificationPreferenceResource {
5
+ http;
6
+ constructor(http) {
7
+ this.http = http;
8
+ }
9
+ /**
10
+ * Delete a notification preference
11
+ * Removes the authenticated user's explicit notification preference for a
12
+ * given `(type, channel)` combination, reverting that slot to the type's
13
+ * default channel set.
14
+ * The `app_id` param scopes the deletion to a specific app's preference
15
+ * row. Omit `app_id` to target the system-level (no-app) slot. Because
16
+ * the two slots are stored independently, omitting `app_id` will not
17
+ * match a row that has one set, and vice versa.
18
+ * Returns `204 No Content` on success. Returns `404` if no preference
19
+ * exists for the given composite key.
20
+ * @returns Empty response body. A `204 No Content` status indicates the preference was deleted successfully.
21
+ */
22
+ async remove() {
23
+ await this.http.request(`/api/v1/notification_preferences`, { method: "DELETE" });
24
+ }
25
+ /**
26
+ * List notification preferences
27
+ * Returns all explicit notification preferences belonging to the authenticated
28
+ * user. Preferences are returned for every `(type, channel)` combination the
29
+ * user has explicitly configured; slots that have not been overridden are not
30
+ * included and fall back to the type's defaults.
31
+ * The recipient is derived from the authenticated viewer. You cannot retrieve
32
+ * preferences for any other user through this endpoint. All configured
33
+ * preferences — system-level and app-scoped — are returned together in the
34
+ * `data` array.
35
+ * @returns An object with a `data` array containing all explicit notification preferences for the authenticated user.
36
+ */
37
+ async list() {
38
+ return this.http.request(`/api/v1/notification_preferences`);
39
+ }
40
+ /**
41
+ * Create or update a notification preference
42
+ * Creates or replaces the authenticated user's notification preference for a
43
+ * given `(type, channel)` combination. This is an idempotent PUT: if no
44
+ * preference exists for the composite key, a new row is created; if one
45
+ * already exists, its `enabled` flag is updated to the value you provide.
46
+ * The recipient is derived from the authenticated viewer. You cannot set
47
+ * preferences for another user through this endpoint.
48
+ * Pass `app_id` to scope the preference to a specific app's notifications —
49
+ * most useful for the `app_*` notification type family. Omit `app_id` to
50
+ * configure the system-level (no-app) slot. System-level and app-scoped
51
+ * preferences are stored independently and do not overwrite each other.
52
+ * The `in_app` channel is not configurable and will be rejected with a
53
+ * validation error if supplied.
54
+ * @param input - Request body.
55
+ * @param input.app_id - App to scope this preference to. Omit to configure the system-level (no-app) slot. App-scoped and system-level preferences are stored separately and do not affect each other.
56
+ * @param input.channel - Delivery channel to configure (e.g., `"email"`, `"sms"`). The `in_app` channel is not configurable and will be rejected with a validation error.
57
+ * @param input.enabled - Whether the specified channel should be enabled for this notification type and scope. Set to `false` to suppress delivery on this channel.
58
+ * @param input.type - Notification type to configure. Use a builtin name (e.g., `"app_info"`, `"billing_alert"`) or a `"custom:<lookup_key>"` identifier matching a NotificationType config registered in your app's bundle. Unknown type identifiers are rejected with a validation error.
59
+ * @returns The created or updated notification preference reflecting the new `enabled` state.
60
+ */
61
+ async replace(input) {
62
+ return this.http.request(`/api/v1/notification_preferences`, { method: "PUT", body: input });
63
+ }
64
+ }
65
+ //# sourceMappingURL=notification_preferences.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notification_preferences.js","sourceRoot":"","sources":["../../../src/v1/resources/notification_preferences.ts"],"names":[],"mappings":"AAAA,yDAAyD;AACzD,wEAAwE;AACxE,6BAA6B;AAK7B,MAAM,OAAO,8BAA8B;IACrB;IAApB,YAAoB,IAAgB;QAAhB,SAAI,GAAJ,IAAI,CAAY;IAAG,CAAC;IAExC;;;;;;;;;;;;OAYG;IACH,KAAK,CAAC,MAAM;QACV,MAAM,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,kCAAkC,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,CAAC;IACpF,CAAC;IAED;;;;;;;;;;;OAWG;IACH,KAAK,CAAC,IAAI;QACR,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,kCAAkC,CAAC,CAAC;IAC/D,CAAC;IAED;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,KAAK,CAAC,OAAO,CAAC,KAAuF;QACnG,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,kCAAkC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC;IAC/F,CAAC;CACF"}
@@ -0,0 +1,133 @@
1
+ import { HttpClient } from "../../runtime/http-client.js";
2
+ import type { Notification } from "../../types/notifications.js";
3
+ export declare class NotificationResource {
4
+ private http;
5
+ constructor(http: HttpClient);
6
+ /**
7
+ * List a user's notifications
8
+ * Returns a cursor-paginated list of inbox notifications for the authenticated
9
+ * user, ordered by creation time descending (newest first). All status groups
10
+ * are included by default; pass `status` to narrow results to a specific group.
11
+ * Each notification's `rendered` field contains type-specific display data
12
+ * resolved at request time. Notifications whose type is no longer registered
13
+ * in the platform are rendered with `kind: "unknown"` rather than being omitted.
14
+ * Pagination is forward-only: supply `after_cursor` from a previous response to
15
+ * fetch the next (older) page. The `before_cursor` field is always `null` for
16
+ * this endpoint. Requires an app-scoped token.
17
+ * @param params - Query parameters.
18
+ * @param params.status - Filter by notification status. One of `"all"`, `"active"`, `"unread"`, `"read"`, or `"archived"`. Defaults to `"all"` when omitted.
19
+ * @param params.limit - Maximum number of notifications to return per page. Defaults to 20; maximum is 100.
20
+ * @param params.afterCursor - Opaque pagination cursor from a previous response's `after_cursor` field. Omit to fetch the most recent notifications.
21
+ * @returns Successful response
22
+ */
23
+ list(params?: {
24
+ status?: string;
25
+ limit?: number;
26
+ afterCursor?: string;
27
+ }): Promise<{
28
+ after_cursor?: string | undefined;
29
+ before_cursor?: string | undefined;
30
+ data: {
31
+ archived_at?: string | undefined;
32
+ created_at: string;
33
+ id: string;
34
+ read_at?: string | undefined;
35
+ rendered: Record<string, unknown>;
36
+ status: string;
37
+ type: string;
38
+ }[];
39
+ has_more: boolean;
40
+ }>;
41
+ /**
42
+ * Mark all notifications as read
43
+ * Marks every `"unread"` notification belonging to the authenticated user as
44
+ * `"read"` in a single operation. Notifications that are already `"read"` or
45
+ * `"archived"` are not affected.
46
+ * This call is safe to retry — if there are no unread notifications, it
47
+ * succeeds without error. Requires an app-scoped token. Returns 204 No Content
48
+ * on success.
49
+ * @returns No content
50
+ */
51
+ readAll(): Promise<void>;
52
+ /**
53
+ * Send a custom notification to a user
54
+ * Delivers a custom-typed notification to one of the calling app's users.
55
+ * Apps define notification types by declaring `NotificationType` config objects
56
+ * in their bundle (one per `lookup_key`). Supply the type as
57
+ * `"custom:<lookup_key>"` and provide a `data` map that is merged with
58
+ * platform-provided context to render the notification's display fields.
59
+ * Only app-scoped tokens may call this endpoint — user tokens are rejected with
60
+ * 403. The app scope is stamped onto the notification automatically; an app
61
+ * cannot target recipients outside its tenant. Built-in platform types such as
62
+ * `"app_info"` and `"billing_alert"` are not accepted here.
63
+ * Pass `idempotency_key` to deduplicate sends. If you call this endpoint twice
64
+ * with the same `idempotency_key` for the same recipient, the second call
65
+ * returns the original notification without creating a duplicate. The key is
66
+ * scoped to the calling app, so the same raw key used by different apps cannot
67
+ * collide.
68
+ * @param input - Request body.
69
+ * @param input.data - Arbitrary key-value payload merged with platform-provided context (recipient, app, org, brand) when rendering the notification's display fields. Defaults to an empty object when omitted.
70
+ * @param input.idempotency_key - Optional deduplication key. A second call with the same `idempotency_key` for the same recipient returns the originally-created notification without inserting a new record. Scoped per calling app.
71
+ * @param input.type - Custom notification type identifier in the form `"custom:<lookup_key>"`, where `<lookup_key>` matches a `NotificationType` config declared in the calling app's bundle.
72
+ * @param input.user - Recipient user ID (`usr_...`). Must be a member of the calling app's tenant.
73
+ * @returns The created notification, or the existing notification when deduplicated by `idempotency_key`.
74
+ */
75
+ send(input: {
76
+ data?: Record<string, unknown> | undefined;
77
+ idempotency_key?: string | undefined;
78
+ type: string;
79
+ user: string;
80
+ }): Promise<Notification>;
81
+ /**
82
+ * Get the unread notification count
83
+ * Returns the total number of `"unread"` notifications for the authenticated
84
+ * user. Useful for displaying a badge or indicator in your UI without
85
+ * fetching the full notification list.
86
+ * Notifications with `"read"` or `"archived"` status are not included in the
87
+ * count. Requires an app-scoped token.
88
+ * @returns Successful response
89
+ */
90
+ unreadCount(): Promise<{
91
+ count: number;
92
+ }>;
93
+ /**
94
+ * Archive a notification
95
+ * Moves a notification to `"archived"` status regardless of whether it is
96
+ * currently `"unread"` or `"read"`. Archived notifications are excluded from
97
+ * the default inbox view but remain retrievable by passing `status: "archived"`
98
+ * to the list endpoint.
99
+ * The authenticated user must own the notification. Passing a notification ID
100
+ * that belongs to a different user returns a 404. If the notification is
101
+ * already archived this call succeeds without error (idempotent).
102
+ * Requires an app-scoped token. Returns 204 No Content on success.
103
+ * @param notification - Notification ID (`ntf_...`) to archive. Must belong to the authenticated user.
104
+ * @returns No content
105
+ */
106
+ archive(notification: string): Promise<void>;
107
+ /**
108
+ * Mark a notification as read
109
+ * Transitions a notification from `"unread"` to `"read"` status. If the
110
+ * notification is already `"read"` or `"archived"`, the call succeeds without
111
+ * changing its status (idempotent).
112
+ * The authenticated user must own the notification. Passing a notification ID
113
+ * that belongs to a different user returns a 404. Requires an app-scoped token.
114
+ * Returns 204 No Content on success.
115
+ * @param notification - Notification ID (`ntf_...`) to mark as read. Must belong to the authenticated user.
116
+ * @returns No content
117
+ */
118
+ read(notification: string): Promise<void>;
119
+ /**
120
+ * Unarchive a notification
121
+ * Restores an `"archived"` notification to its previous active status:
122
+ * `"read"` if the notification had been read before archiving, or `"unread"`
123
+ * otherwise. The notification will appear again in the default inbox view.
124
+ * The authenticated user must own the notification. Passing a notification ID
125
+ * that belongs to a different user returns a 404. If the notification is not
126
+ * currently archived this call succeeds without changing its status (idempotent).
127
+ * Requires an app-scoped token. Returns 204 No Content on success.
128
+ * @param notification - Notification ID (`ntf_...`) to unarchive. Must belong to the authenticated user.
129
+ * @returns No content
130
+ */
131
+ unarchive(notification: string): Promise<void>;
132
+ }
133
+ //# sourceMappingURL=notifications.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notifications.d.ts","sourceRoot":"","sources":["../../../src/v1/resources/notifications.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAC1D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM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AAY,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAIlD;;;;;;;;;;OAUG;IACG,IAAI,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAI/C;;;;;;;;;;;OAWG;IACG,SAAS,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAGrD"}
@@ -0,0 +1,136 @@
1
+ // Copyright (c) 2026 ArchAstro Inc. All Rights Reserved.
2
+ // This file is auto-generated by @archastro/sdk-generator. Do not edit.
3
+ // Content hash: 23416df03aaa
4
+ export class NotificationResource {
5
+ http;
6
+ constructor(http) {
7
+ this.http = http;
8
+ }
9
+ /**
10
+ * List a user's notifications
11
+ * Returns a cursor-paginated list of inbox notifications for the authenticated
12
+ * user, ordered by creation time descending (newest first). All status groups
13
+ * are included by default; pass `status` to narrow results to a specific group.
14
+ * Each notification's `rendered` field contains type-specific display data
15
+ * resolved at request time. Notifications whose type is no longer registered
16
+ * in the platform are rendered with `kind: "unknown"` rather than being omitted.
17
+ * Pagination is forward-only: supply `after_cursor` from a previous response to
18
+ * fetch the next (older) page. The `before_cursor` field is always `null` for
19
+ * this endpoint. Requires an app-scoped token.
20
+ * @param params - Query parameters.
21
+ * @param params.status - Filter by notification status. One of `"all"`, `"active"`, `"unread"`, `"read"`, or `"archived"`. Defaults to `"all"` when omitted.
22
+ * @param params.limit - Maximum number of notifications to return per page. Defaults to 20; maximum is 100.
23
+ * @param params.afterCursor - Opaque pagination cursor from a previous response's `after_cursor` field. Omit to fetch the most recent notifications.
24
+ * @returns Successful response
25
+ */
26
+ async list(params) {
27
+ const query = {};
28
+ if (params?.status !== undefined) {
29
+ query["status"] = params?.status;
30
+ }
31
+ if (params?.limit !== undefined) {
32
+ query["limit"] = params?.limit;
33
+ }
34
+ if (params?.afterCursor !== undefined) {
35
+ query["after_cursor"] = params?.afterCursor;
36
+ }
37
+ return this.http.request(`/api/v1/notifications`, { query });
38
+ }
39
+ /**
40
+ * Mark all notifications as read
41
+ * Marks every `"unread"` notification belonging to the authenticated user as
42
+ * `"read"` in a single operation. Notifications that are already `"read"` or
43
+ * `"archived"` are not affected.
44
+ * This call is safe to retry — if there are no unread notifications, it
45
+ * succeeds without error. Requires an app-scoped token. Returns 204 No Content
46
+ * on success.
47
+ * @returns No content
48
+ */
49
+ async readAll() {
50
+ await this.http.request(`/api/v1/notifications/read_all`, { method: "POST" });
51
+ }
52
+ /**
53
+ * Send a custom notification to a user
54
+ * Delivers a custom-typed notification to one of the calling app's users.
55
+ * Apps define notification types by declaring `NotificationType` config objects
56
+ * in their bundle (one per `lookup_key`). Supply the type as
57
+ * `"custom:<lookup_key>"` and provide a `data` map that is merged with
58
+ * platform-provided context to render the notification's display fields.
59
+ * Only app-scoped tokens may call this endpoint — user tokens are rejected with
60
+ * 403. The app scope is stamped onto the notification automatically; an app
61
+ * cannot target recipients outside its tenant. Built-in platform types such as
62
+ * `"app_info"` and `"billing_alert"` are not accepted here.
63
+ * Pass `idempotency_key` to deduplicate sends. If you call this endpoint twice
64
+ * with the same `idempotency_key` for the same recipient, the second call
65
+ * returns the original notification without creating a duplicate. The key is
66
+ * scoped to the calling app, so the same raw key used by different apps cannot
67
+ * collide.
68
+ * @param input - Request body.
69
+ * @param input.data - Arbitrary key-value payload merged with platform-provided context (recipient, app, org, brand) when rendering the notification's display fields. Defaults to an empty object when omitted.
70
+ * @param input.idempotency_key - Optional deduplication key. A second call with the same `idempotency_key` for the same recipient returns the originally-created notification without inserting a new record. Scoped per calling app.
71
+ * @param input.type - Custom notification type identifier in the form `"custom:<lookup_key>"`, where `<lookup_key>` matches a `NotificationType` config declared in the calling app's bundle.
72
+ * @param input.user - Recipient user ID (`usr_...`). Must be a member of the calling app's tenant.
73
+ * @returns The created notification, or the existing notification when deduplicated by `idempotency_key`.
74
+ */
75
+ async send(input) {
76
+ return this.http.request(`/api/v1/notifications/send`, { method: "POST", body: input });
77
+ }
78
+ /**
79
+ * Get the unread notification count
80
+ * Returns the total number of `"unread"` notifications for the authenticated
81
+ * user. Useful for displaying a badge or indicator in your UI without
82
+ * fetching the full notification list.
83
+ * Notifications with `"read"` or `"archived"` status are not included in the
84
+ * count. Requires an app-scoped token.
85
+ * @returns Successful response
86
+ */
87
+ async unreadCount() {
88
+ return this.http.request(`/api/v1/notifications/unread_count`);
89
+ }
90
+ /**
91
+ * Archive a notification
92
+ * Moves a notification to `"archived"` status regardless of whether it is
93
+ * currently `"unread"` or `"read"`. Archived notifications are excluded from
94
+ * the default inbox view but remain retrievable by passing `status: "archived"`
95
+ * to the list endpoint.
96
+ * The authenticated user must own the notification. Passing a notification ID
97
+ * that belongs to a different user returns a 404. If the notification is
98
+ * already archived this call succeeds without error (idempotent).
99
+ * Requires an app-scoped token. Returns 204 No Content on success.
100
+ * @param notification - Notification ID (`ntf_...`) to archive. Must belong to the authenticated user.
101
+ * @returns No content
102
+ */
103
+ async archive(notification) {
104
+ await this.http.request(`/api/v1/notifications/${notification}/archive`, { method: "POST" });
105
+ }
106
+ /**
107
+ * Mark a notification as read
108
+ * Transitions a notification from `"unread"` to `"read"` status. If the
109
+ * notification is already `"read"` or `"archived"`, the call succeeds without
110
+ * changing its status (idempotent).
111
+ * The authenticated user must own the notification. Passing a notification ID
112
+ * that belongs to a different user returns a 404. Requires an app-scoped token.
113
+ * Returns 204 No Content on success.
114
+ * @param notification - Notification ID (`ntf_...`) to mark as read. Must belong to the authenticated user.
115
+ * @returns No content
116
+ */
117
+ async read(notification) {
118
+ await this.http.request(`/api/v1/notifications/${notification}/read`, { method: "POST" });
119
+ }
120
+ /**
121
+ * Unarchive a notification
122
+ * Restores an `"archived"` notification to its previous active status:
123
+ * `"read"` if the notification had been read before archiving, or `"unread"`
124
+ * otherwise. The notification will appear again in the default inbox view.
125
+ * The authenticated user must own the notification. Passing a notification ID
126
+ * that belongs to a different user returns a 404. If the notification is not
127
+ * currently archived this call succeeds without changing its status (idempotent).
128
+ * Requires an app-scoped token. Returns 204 No Content on success.
129
+ * @param notification - Notification ID (`ntf_...`) to unarchive. Must belong to the authenticated user.
130
+ * @returns No content
131
+ */
132
+ async unarchive(notification) {
133
+ await this.http.request(`/api/v1/notifications/${notification}/unarchive`, { method: "POST" });
134
+ }
135
+ }
136
+ //# sourceMappingURL=notifications.js.map