@epilot/sdk 2.9.0 → 2.9.1

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 (215) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +1 -0
  3. package/definitions/access-token-runtime.json +1 -1
  4. package/definitions/access-token.json +155 -1
  5. package/definitions/automation.json +120 -0
  6. package/definitions/blueprint-manifest-runtime.json +1 -1
  7. package/definitions/blueprint-manifest.json +571 -1
  8. package/definitions/journey.json +19 -2
  9. package/definitions/snapshot-runtime.json +1 -0
  10. package/definitions/snapshot.json +935 -0
  11. package/definitions/targeting.json +5 -4
  12. package/definitions/user-runtime.json +1 -1
  13. package/definitions/user.json +441 -0
  14. package/dist/README-NBWAQWQS.js +7 -0
  15. package/dist/README-XCIDDEAE.cjs +7 -0
  16. package/dist/{_index-DB2VV4PQ.cjs → _index-D5TTZP5F.cjs} +4 -1
  17. package/dist/{_index-5FB6F5YY.js → _index-UY46ZN47.js} +3 -0
  18. package/dist/access-token-GD6REL4U.js +7 -0
  19. package/dist/access-token-NQ5BLMOW.cjs +7 -0
  20. package/dist/{access-token-runtime-KCKGT4O7.js → access-token-runtime-2PSLN2U3.js} +1 -1
  21. package/dist/{access-token-runtime-NZWZJPWV.cjs → access-token-runtime-B6Z7JLUS.cjs} +2 -2
  22. package/dist/{access-token.d-CnmUTOlq.d.cts → access-token.d-CegaQmrK.d.cts} +165 -5
  23. package/dist/{access-token.d-CnmUTOlq.d.ts → access-token.d-CegaQmrK.d.ts} +165 -5
  24. package/dist/{ai-agents.d-OkXfr2bz.d.cts → ai-agents.d-CC5IjXrs.d.cts} +0 -2
  25. package/dist/{ai-agents.d-OkXfr2bz.d.ts → ai-agents.d-CC5IjXrs.d.ts} +0 -2
  26. package/dist/apis/access-token.cjs +8 -8
  27. package/dist/apis/access-token.d.cts +2 -2
  28. package/dist/apis/access-token.d.ts +2 -2
  29. package/dist/apis/access-token.js +2 -2
  30. package/dist/apis/address-suggestions.cjs +6 -6
  31. package/dist/apis/address-suggestions.js +1 -1
  32. package/dist/apis/address.cjs +6 -6
  33. package/dist/apis/address.js +1 -1
  34. package/dist/apis/ai-agents.cjs +6 -6
  35. package/dist/apis/ai-agents.d.cts +2 -2
  36. package/dist/apis/ai-agents.d.ts +2 -2
  37. package/dist/apis/ai-agents.js +1 -1
  38. package/dist/apis/app.cjs +6 -6
  39. package/dist/apis/app.js +1 -1
  40. package/dist/apis/audit-logs.cjs +6 -6
  41. package/dist/apis/audit-logs.js +1 -1
  42. package/dist/apis/automation.cjs +6 -6
  43. package/dist/apis/automation.d.cts +2 -2
  44. package/dist/apis/automation.d.ts +2 -2
  45. package/dist/apis/automation.js +1 -1
  46. package/dist/apis/billing.cjs +6 -6
  47. package/dist/apis/billing.js +1 -1
  48. package/dist/apis/blueprint-manifest.cjs +8 -8
  49. package/dist/apis/blueprint-manifest.d.cts +2 -2
  50. package/dist/apis/blueprint-manifest.d.ts +2 -2
  51. package/dist/apis/blueprint-manifest.js +2 -2
  52. package/dist/apis/calendar.cjs +6 -6
  53. package/dist/apis/calendar.js +1 -1
  54. package/dist/apis/configuration-hub.cjs +6 -6
  55. package/dist/apis/configuration-hub.js +1 -1
  56. package/dist/apis/consent.cjs +6 -6
  57. package/dist/apis/consent.js +1 -1
  58. package/dist/apis/customer-portal.cjs +6 -6
  59. package/dist/apis/customer-portal.js +1 -1
  60. package/dist/apis/dashboard.cjs +6 -6
  61. package/dist/apis/dashboard.js +1 -1
  62. package/dist/apis/data-governance.cjs +6 -6
  63. package/dist/apis/data-governance.js +1 -1
  64. package/dist/apis/deduplication.cjs +6 -6
  65. package/dist/apis/deduplication.js +1 -1
  66. package/dist/apis/design.cjs +6 -6
  67. package/dist/apis/design.js +1 -1
  68. package/dist/apis/document.cjs +6 -6
  69. package/dist/apis/document.js +1 -1
  70. package/dist/apis/email-settings.cjs +6 -6
  71. package/dist/apis/email-settings.js +1 -1
  72. package/dist/apis/email-template.cjs +6 -6
  73. package/dist/apis/email-template.js +1 -1
  74. package/dist/apis/entity-mapping.cjs +6 -6
  75. package/dist/apis/entity-mapping.js +1 -1
  76. package/dist/apis/entity.cjs +6 -6
  77. package/dist/apis/entity.js +1 -1
  78. package/dist/apis/environments.cjs +6 -6
  79. package/dist/apis/environments.js +1 -1
  80. package/dist/apis/event-catalog.cjs +6 -6
  81. package/dist/apis/event-catalog.js +1 -1
  82. package/dist/apis/file.cjs +6 -6
  83. package/dist/apis/file.js +1 -1
  84. package/dist/apis/iban.cjs +6 -6
  85. package/dist/apis/iban.js +1 -1
  86. package/dist/apis/integration-toolkit.cjs +6 -6
  87. package/dist/apis/integration-toolkit.js +1 -1
  88. package/dist/apis/journey.cjs +6 -6
  89. package/dist/apis/journey.d.cts +2 -2
  90. package/dist/apis/journey.d.ts +2 -2
  91. package/dist/apis/journey.js +1 -1
  92. package/dist/apis/kanban.cjs +6 -6
  93. package/dist/apis/kanban.js +1 -1
  94. package/dist/apis/message.cjs +6 -6
  95. package/dist/apis/message.js +1 -1
  96. package/dist/apis/metering.cjs +6 -6
  97. package/dist/apis/metering.js +1 -1
  98. package/dist/apis/notes.cjs +6 -6
  99. package/dist/apis/notes.js +1 -1
  100. package/dist/apis/notification.cjs +6 -6
  101. package/dist/apis/notification.js +1 -1
  102. package/dist/apis/organization.cjs +6 -6
  103. package/dist/apis/organization.js +1 -1
  104. package/dist/apis/partner-directory.cjs +6 -6
  105. package/dist/apis/partner-directory.js +1 -1
  106. package/dist/apis/permissions.cjs +6 -6
  107. package/dist/apis/permissions.js +1 -1
  108. package/dist/apis/pricing-tier.cjs +6 -6
  109. package/dist/apis/pricing-tier.js +1 -1
  110. package/dist/apis/pricing.cjs +6 -6
  111. package/dist/apis/pricing.js +1 -1
  112. package/dist/apis/purpose.cjs +6 -6
  113. package/dist/apis/purpose.js +1 -1
  114. package/dist/apis/query.cjs +6 -6
  115. package/dist/apis/query.js +1 -1
  116. package/dist/apis/sandbox.cjs +6 -6
  117. package/dist/apis/sandbox.js +1 -1
  118. package/dist/apis/sharing.cjs +6 -6
  119. package/dist/apis/sharing.js +1 -1
  120. package/dist/apis/snapshot.cjs +38 -0
  121. package/dist/apis/snapshot.d.cts +18 -0
  122. package/dist/apis/snapshot.d.ts +18 -0
  123. package/dist/apis/snapshot.js +38 -0
  124. package/dist/apis/submission.cjs +6 -6
  125. package/dist/apis/submission.js +1 -1
  126. package/dist/apis/target.cjs +6 -6
  127. package/dist/apis/target.js +1 -1
  128. package/dist/apis/targeting.cjs +6 -6
  129. package/dist/apis/targeting.d.cts +2 -2
  130. package/dist/apis/targeting.d.ts +2 -2
  131. package/dist/apis/targeting.js +1 -1
  132. package/dist/apis/template-variables.cjs +6 -6
  133. package/dist/apis/template-variables.js +1 -1
  134. package/dist/apis/user.cjs +8 -8
  135. package/dist/apis/user.d.cts +2 -2
  136. package/dist/apis/user.d.ts +2 -2
  137. package/dist/apis/user.js +2 -2
  138. package/dist/apis/validation-rules.cjs +6 -6
  139. package/dist/apis/validation-rules.js +1 -1
  140. package/dist/apis/webhooks.cjs +6 -6
  141. package/dist/apis/webhooks.js +1 -1
  142. package/dist/apis/workflow-definition.cjs +6 -6
  143. package/dist/apis/workflow-definition.js +1 -1
  144. package/dist/apis/workflow.cjs +6 -6
  145. package/dist/apis/workflow.js +1 -1
  146. package/dist/automation-S6NFS5KU.cjs +7 -0
  147. package/dist/automation-W75XZG7B.js +7 -0
  148. package/dist/{automation.d-Du6-uiz5.d.cts → automation.d-DS_YXDE8.d.cts} +300 -1
  149. package/dist/{automation.d-Du6-uiz5.d.ts → automation.d-DS_YXDE8.d.ts} +300 -1
  150. package/dist/blueprint-manifest-WHYSBU66.cjs +7 -0
  151. package/dist/blueprint-manifest-WZVBTKUL.js +7 -0
  152. package/dist/{blueprint-manifest-runtime-FRLU3ZSF.js → blueprint-manifest-runtime-2344IUIE.js} +1 -1
  153. package/dist/{blueprint-manifest-runtime-EIDOROIQ.cjs → blueprint-manifest-runtime-WU5MWPVT.cjs} +2 -2
  154. package/dist/{blueprint-manifest.d-B8yDxagC.d.cts → blueprint-manifest.d-2-TORV8o.d.cts} +926 -4
  155. package/dist/{blueprint-manifest.d-B8yDxagC.d.ts → blueprint-manifest.d-2-TORV8o.d.ts} +926 -4
  156. package/dist/chunk-54QNWEPZ.js +14 -0
  157. package/dist/{chunk-CULH5PIN.cjs → chunk-6V3NYADA.cjs} +13 -11
  158. package/dist/chunk-NFIYEMMM.js +14 -0
  159. package/dist/{chunk-XSE4CFSM.js → chunk-OHHHS4HH.js} +1 -1
  160. package/dist/chunk-OWXEZ56F.cjs +14 -0
  161. package/dist/{chunk-RZ4ABDOF.js → chunk-QGP5WMHK.js} +13 -11
  162. package/dist/{chunk-OXJOO2YF.cjs → chunk-S5HBBTKM.cjs} +1 -1
  163. package/dist/{chunk-NGHCQ2FA.cjs → chunk-T57MT6J5.cjs} +1 -1
  164. package/dist/{chunk-4YBWMDFP.js → chunk-UWGWRGGB.js} +1 -1
  165. package/dist/chunk-YXJ4PBFQ.cjs +14 -0
  166. package/dist/index.cjs +24 -16
  167. package/dist/index.d.cts +23 -21
  168. package/dist/index.d.ts +23 -21
  169. package/dist/index.js +14 -6
  170. package/dist/journey-LHVSSVTG.cjs +7 -0
  171. package/dist/journey-NXL264XW.js +7 -0
  172. package/dist/{journey.d-BenIUWaO.d.ts → journey.d-B1sOeMHw.d.cts} +16 -3
  173. package/dist/{journey.d-BenIUWaO.d.cts → journey.d-B1sOeMHw.d.ts} +16 -3
  174. package/dist/js-yaml-DLCVPJ7G.js +0 -0
  175. package/dist/snapshot-2HFERXRQ.js +7 -0
  176. package/dist/snapshot-UHCQAT4R.cjs +7 -0
  177. package/dist/snapshot-runtime-6DV42FVY.cjs +5 -0
  178. package/dist/snapshot-runtime-IW57MINC.js +5 -0
  179. package/dist/snapshot.d-CqefmvuB.d.cts +724 -0
  180. package/dist/snapshot.d-CqefmvuB.d.ts +724 -0
  181. package/dist/{targeting-DAFJBPIZ.cjs → targeting-WC62BBZN.cjs} +1 -1
  182. package/dist/{targeting-TGPCRRI6.js → targeting-X4Y2ODBT.js} +1 -1
  183. package/dist/{targeting.d-DxHQbn7-.d.cts → targeting.d-0rNF7ErD.d.cts} +11 -4
  184. package/dist/{targeting.d-DxHQbn7-.d.ts → targeting.d-0rNF7ErD.d.ts} +11 -4
  185. package/dist/user-3SLAEEVD.cjs +7 -0
  186. package/dist/user-PRUYBXQV.js +7 -0
  187. package/dist/{user-runtime-U4HYUWJU.js → user-runtime-6ICV2Y73.js} +1 -1
  188. package/dist/user-runtime-Y3227ETX.cjs +5 -0
  189. package/dist/{user.d-D18fe97W.d.cts → user.d-L-C7_K84.d.cts} +421 -1
  190. package/dist/{user.d-D18fe97W.d.ts → user.d-L-C7_K84.d.ts} +421 -1
  191. package/docs/access-token.md +111 -3
  192. package/docs/automation.md +180 -37
  193. package/docs/blueprint-manifest.md +421 -95
  194. package/docs/journey.md +28 -8
  195. package/docs/snapshot.md +607 -0
  196. package/docs/targeting.md +6 -3
  197. package/docs/user.md +321 -8
  198. package/package.json +20 -12
  199. package/definitions/focus-pocus-runtime.json +0 -1
  200. package/definitions/focus-pocus.json +0 -757
  201. package/dist/README-46VYEGGW.js +0 -7
  202. package/dist/README-IVBISSWB.cjs +0 -7
  203. package/dist/access-token-6BJDZSFE.cjs +0 -7
  204. package/dist/access-token-GSQZLDXR.js +0 -7
  205. package/dist/automation-BMO7ZFTN.cjs +0 -7
  206. package/dist/automation-MEZTSUR3.js +0 -7
  207. package/dist/blueprint-manifest-6DEYW5MW.js +0 -7
  208. package/dist/blueprint-manifest-GCV7H74X.cjs +0 -7
  209. package/dist/chunk-3XKBB5AE.js +0 -14
  210. package/dist/chunk-Z5TVWG3I.cjs +0 -14
  211. package/dist/journey-4DIIPRU4.js +0 -7
  212. package/dist/journey-ATC3Y5AW.cjs +0 -7
  213. package/dist/user-7ZN2XO7G.cjs +0 -7
  214. package/dist/user-ZK7BK6VY.js +0 -7
  215. package/dist/user-runtime-7O2HLFVQ.cjs +0 -5
@@ -0,0 +1,607 @@
1
+ # Snapshot API
2
+
3
+ - **Base URL:** `https://snapshot.sls.epilot.io`
4
+ - **Full API Docs:** [https://docs.epilot.io/api/snapshot](https://docs.epilot.io/api/snapshot)
5
+
6
+ ## Usage
7
+
8
+ ```ts
9
+ import { epilot } from '@epilot/sdk'
10
+
11
+ epilot.authorize(() => '<token>')
12
+ const { data } = await epilot.snapshot.createSnapshot(...)
13
+ ```
14
+
15
+ ### Tree-shakeable import
16
+
17
+ ```ts
18
+ import { getClient, authorize } from '@epilot/sdk/snapshot'
19
+
20
+ const snapshotClient = getClient()
21
+ authorize(snapshotClient, () => '<token>')
22
+ const { data } = await snapshotClient.createSnapshot(...)
23
+ ```
24
+
25
+ ## Operations
26
+
27
+ **Snapshots**
28
+ - [`createSnapshot`](#createsnapshot)
29
+ - [`listSnapshots`](#listsnapshots)
30
+ - [`captureOrgSnapshot`](#captureorgsnapshot)
31
+ - [`getSnapshot`](#getsnapshot)
32
+ - [`deleteSnapshot`](#deletesnapshot)
33
+ - [`restoreSnapshot`](#restoresnapshot)
34
+ - [`listSnapshotResources`](#listsnapshotresources)
35
+ - [`getSnapshotResource`](#getsnapshotresource)
36
+ - [`listDependencies`](#listdependencies)
37
+
38
+ **Schemas**
39
+ - [`Error`](#error)
40
+ - [`EmptyInventoryError`](#emptyinventoryerror)
41
+ - [`ResourceRef`](#resourceref)
42
+ - [`SnapshotResourceSummary`](#snapshotresourcesummary)
43
+ - [`SnapshotResourceList`](#snapshotresourcelist)
44
+ - [`SnapshotResourceDetail`](#snapshotresourcedetail)
45
+ - [`CreateSnapshotRequest`](#createsnapshotrequest)
46
+ - [`CreateOrgSnapshotRequest`](#createorgsnapshotrequest)
47
+ - [`CreateSnapshotResponse`](#createsnapshotresponse)
48
+ - [`RestoreSnapshotRequest`](#restoresnapshotrequest)
49
+ - [`RestoreSnapshotResponse`](#restoresnapshotresponse)
50
+ - [`Snapshot`](#snapshot)
51
+ - [`Operation`](#operation)
52
+ - [`CallerIdentity`](#calleridentity)
53
+
54
+ ### `createSnapshot`
55
+
56
+ Create a new snapshot of the given resources. Async — returns immediately
57
+ with a snapshot ID; client polls `getSnapshot` until `create.status`
58
+ moves from `in_progress` to `completed` or `failed`.
59
+
60
+ `POST /v1/snapshots`
61
+
62
+ ```ts
63
+ const { data } = await client.createSnapshot(
64
+ null,
65
+ {
66
+ name: 'string',
67
+ description: 'string',
68
+ trigger: 'manual',
69
+ blueprint_instance_id: 'string',
70
+ resources: [
71
+ {
72
+ type: 'string',
73
+ id: 'string'
74
+ }
75
+ ]
76
+ },
77
+ )
78
+ ```
79
+
80
+ ---
81
+
82
+ ### `listSnapshots`
83
+
84
+ List snapshots for the caller's organization, newest first.
85
+
86
+ `GET /v1/snapshots`
87
+
88
+ ```ts
89
+ const { data } = await client.listSnapshots({
90
+ cursor: 'example',
91
+ size: 1,
92
+ resource: ['...'],
93
+ trigger: 'example',
94
+ })
95
+ ```
96
+
97
+ <details>
98
+ <summary>Response</summary>
99
+
100
+ ```json
101
+ {
102
+ "page_size": 0,
103
+ "cursor": "string",
104
+ "results": [
105
+ {
106
+ "id": "string",
107
+ "org_id": "string",
108
+ "name": "string",
109
+ "description": "string",
110
+ "trigger": "manual",
111
+ "blueprint_instance_id": "string",
112
+ "resource_counts": {},
113
+ "create": {
114
+ "type": "create",
115
+ "started_at": "1970-01-01T00:00:00.000Z",
116
+ "completed_at": "1970-01-01T00:00:00.000Z",
117
+ "status": "in_progress",
118
+ "error": "string",
119
+ "triggered_by": {
120
+ "name": "string",
121
+ "user_id": "string",
122
+ "token_id": "string"
123
+ }
124
+ },
125
+ "restores": [
126
+ {
127
+ "type": "create",
128
+ "started_at": "1970-01-01T00:00:00.000Z",
129
+ "completed_at": "1970-01-01T00:00:00.000Z",
130
+ "status": "in_progress",
131
+ "error": "string",
132
+ "triggered_by": {
133
+ "name": "string",
134
+ "user_id": "string",
135
+ "token_id": "string"
136
+ }
137
+ }
138
+ ],
139
+ "matched_count": 0,
140
+ "scope": "selection",
141
+ "expires_at": "1970-01-01T00:00:00.000Z",
142
+ "capture_summary": {
143
+ "total": 0,
144
+ "captured": 0,
145
+ "skipped": 0,
146
+ "failed": 0
147
+ }
148
+ }
149
+ ]
150
+ }
151
+ ```
152
+
153
+ </details>
154
+
155
+ ---
156
+
157
+ ### `captureOrgSnapshot`
158
+
159
+ Snapshot the caller's whole organization now. Fetches a fresh inventory
160
+ of the org's configuration resources from configuration-hub-api, persists
161
+ it as an inventory artifact, and starts a `scope: "org
162
+
163
+ `POST /v1/snapshots:capture-org`
164
+
165
+ ```ts
166
+ const { data } = await client.captureOrgSnapshot(
167
+ null,
168
+ {
169
+ name: 'string',
170
+ retention: {
171
+ value: 1,
172
+ unit: 'days'
173
+ },
174
+ excluded_types: ['string']
175
+ },
176
+ )
177
+ ```
178
+
179
+ ---
180
+
181
+ ### `getSnapshot`
182
+
183
+ Fetch a snapshot's metadata. Poll this endpoint to track create/restore progress.
184
+
185
+ `GET /v1/snapshots/{id}`
186
+
187
+ ```ts
188
+ const { data } = await client.getSnapshot({
189
+ id: '123e4567-e89b-12d3-a456-426614174000',
190
+ })
191
+ ```
192
+
193
+ <details>
194
+ <summary>Response</summary>
195
+
196
+ ```json
197
+ {
198
+ "id": "string",
199
+ "org_id": "string",
200
+ "name": "string",
201
+ "description": "string",
202
+ "trigger": "manual",
203
+ "blueprint_instance_id": "string",
204
+ "resource_counts": {},
205
+ "create": {
206
+ "type": "create",
207
+ "started_at": "1970-01-01T00:00:00.000Z",
208
+ "completed_at": "1970-01-01T00:00:00.000Z",
209
+ "status": "in_progress",
210
+ "error": "string",
211
+ "triggered_by": {
212
+ "name": "string",
213
+ "user_id": "string",
214
+ "token_id": "string"
215
+ }
216
+ },
217
+ "restores": [
218
+ {
219
+ "type": "create",
220
+ "started_at": "1970-01-01T00:00:00.000Z",
221
+ "completed_at": "1970-01-01T00:00:00.000Z",
222
+ "status": "in_progress",
223
+ "error": "string",
224
+ "triggered_by": {
225
+ "name": "string",
226
+ "user_id": "string",
227
+ "token_id": "string"
228
+ }
229
+ }
230
+ ],
231
+ "matched_count": 0,
232
+ "scope": "selection",
233
+ "expires_at": "1970-01-01T00:00:00.000Z",
234
+ "capture_summary": {
235
+ "total": 0,
236
+ "captured": 0,
237
+ "skipped": 0,
238
+ "failed": 0
239
+ }
240
+ }
241
+ ```
242
+
243
+ </details>
244
+
245
+ ---
246
+
247
+ ### `deleteSnapshot`
248
+
249
+ Delete a snapshot's metadata and S3 manifest.
250
+
251
+ `DELETE /v1/snapshots/{id}`
252
+
253
+ ```ts
254
+ const { data } = await client.deleteSnapshot({
255
+ id: '123e4567-e89b-12d3-a456-426614174000',
256
+ })
257
+ ```
258
+
259
+ ---
260
+
261
+ ### `restoreSnapshot`
262
+
263
+ Restore a snapshot to the org. Async — returns immediately; client polls
264
+ `getSnapshot` until the latest entry in `restores` moves from
265
+ `in_progress` to one of `completed | partial | failed`.
266
+
267
+ `POST /v1/snapshots/{id}:restore`
268
+
269
+ ```ts
270
+ const { data } = await client.restoreSnapshot(
271
+ {
272
+ id: '123e4567-e89b-12d3-a456-426614174000',
273
+ },
274
+ {
275
+ exclude_target_ids: ['string']
276
+ },
277
+ )
278
+ ```
279
+
280
+ ---
281
+
282
+ ### `listSnapshotResources`
283
+
284
+ List the resources captured in this snapshot. Returns lightweight
285
+ identity fields per resource — payloads are fetched via the
286
+ single-resource endpoint when needed.
287
+
288
+ `GET /v1/snapshots/{id}/resources`
289
+
290
+ ```ts
291
+ const { data } = await client.listSnapshotResources({
292
+ id: '123e4567-e89b-12d3-a456-426614174000',
293
+ })
294
+ ```
295
+
296
+ <details>
297
+ <summary>Response</summary>
298
+
299
+ ```json
300
+ {
301
+ "resources": [
302
+ {
303
+ "lineage_id": "string",
304
+ "target_id": "string",
305
+ "type": "string",
306
+ "name": "string"
307
+ }
308
+ ]
309
+ }
310
+ ```
311
+
312
+ </details>
313
+
314
+ ---
315
+
316
+ ### `getSnapshotResource`
317
+
318
+ Fetch one captured resource with its full payload. For UI views
319
+ that diff the captured state against the current destination.
320
+
321
+ `GET /v1/snapshots/{id}/resources/{lineage_id}`
322
+
323
+ ```ts
324
+ const { data } = await client.getSnapshotResource({
325
+ id: '123e4567-e89b-12d3-a456-426614174000',
326
+ lineage_id: 'example',
327
+ })
328
+ ```
329
+
330
+ <details>
331
+ <summary>Response</summary>
332
+
333
+ ```json
334
+ {
335
+ "lineage_id": "string",
336
+ "target_id": "string",
337
+ "type": "string",
338
+ "name": "string",
339
+ "captured": {}
340
+ }
341
+ ```
342
+
343
+ </details>
344
+
345
+ ---
346
+
347
+ ### `listDependencies`
348
+
349
+ Walk the dependency tree for a set of resources and return the full
350
+ transitive closure, topologically sorted.
351
+
352
+ `POST /v1/snapshots:list-dependencies`
353
+
354
+ ```ts
355
+ const { data } = await client.listDependencies(
356
+ null,
357
+ {
358
+ resources: [
359
+ {
360
+ type: 'string',
361
+ id: 'string'
362
+ }
363
+ ]
364
+ },
365
+ )
366
+ ```
367
+
368
+ <details>
369
+ <summary>Response</summary>
370
+
371
+ ```json
372
+ {
373
+ "dependencies": [
374
+ {
375
+ "type": "string",
376
+ "id": "string"
377
+ }
378
+ ]
379
+ }
380
+ ```
381
+
382
+ </details>
383
+
384
+ ---
385
+
386
+ ## Schemas
387
+
388
+ ### `Error`
389
+
390
+ ```ts
391
+ type Error = {
392
+ status: number
393
+ error: string
394
+ }
395
+ ```
396
+
397
+ ### `EmptyInventoryError`
398
+
399
+ Returned (422) when the org inventory contains no capturable resources
400
+ after filtering out sensitive, unsupported, and excluded types. The
401
+ `skipped_types` array explains why every type was dropped.
402
+
403
+
404
+ ```ts
405
+ type EmptyInventoryError = {
406
+ message: string
407
+ skipped_types: Array<{
408
+ type: string
409
+ reason: string
410
+ }>
411
+ }
412
+ ```
413
+
414
+ ### `ResourceRef`
415
+
416
+ ```ts
417
+ type ResourceRef = {
418
+ type: string
419
+ id: string
420
+ }
421
+ ```
422
+
423
+ ### `SnapshotResourceSummary`
424
+
425
+ Lightweight identity for a captured resource. Returned by
426
+ `listSnapshotResources`; the full payload is fetched separately via
427
+ `getSnapshotResource` when needed.
428
+
429
+
430
+ ```ts
431
+ type SnapshotResourceSummary = {
432
+ lineage_id: string
433
+ target_id: string
434
+ type: string
435
+ name?: string
436
+ }
437
+ ```
438
+
439
+ ### `SnapshotResourceList`
440
+
441
+ ```ts
442
+ type SnapshotResourceList = {
443
+ resources: Array<{
444
+ lineage_id: string
445
+ target_id: string
446
+ type: string
447
+ name?: string
448
+ }>
449
+ }
450
+ ```
451
+
452
+ ### `SnapshotResourceDetail`
453
+
454
+ A single captured resource with its full payload. The identity fields
455
+ match `SnapshotResourceSummary`; the `captured` payload is the
456
+ pre-install state at snapshot time.
457
+
458
+
459
+ ```ts
460
+ type SnapshotResourceDetail = {
461
+ lineage_id: string
462
+ target_id: string
463
+ type: string
464
+ name?: string
465
+ captured: Record<string, unknown>
466
+ }
467
+ ```
468
+
469
+ ### `CreateSnapshotRequest`
470
+
471
+ ```ts
472
+ type CreateSnapshotRequest = {
473
+ name: string
474
+ description?: string
475
+ trigger?: "manual" | "sync" | "blueprint_install" | "scheduled"
476
+ blueprint_instance_id?: string
477
+ resources: Array<{
478
+ type: string
479
+ id: string
480
+ }>
481
+ }
482
+ ```
483
+
484
+ ### `CreateOrgSnapshotRequest`
485
+
486
+ Request body for `captureOrgSnapshot`. All fields optional — an empty body
487
+ snapshots the whole org with a default name and the 90-day default TTL.
488
+
489
+
490
+ ```ts
491
+ type CreateOrgSnapshotRequest = {
492
+ name?: string
493
+ retention?: {
494
+ value: number
495
+ unit: "days" | "weeks" | "months"
496
+ }
497
+ excluded_types?: string[]
498
+ }
499
+ ```
500
+
501
+ ### `CreateSnapshotResponse`
502
+
503
+ ```ts
504
+ type CreateSnapshotResponse = {
505
+ id: string
506
+ name: string
507
+ status: "creating"
508
+ created_at: string // date-time
509
+ }
510
+ ```
511
+
512
+ ### `RestoreSnapshotRequest`
513
+
514
+ Apply a captured snapshot to its source org. snapshot-api applies the
515
+ manifest verbatim minus any target ids the caller pre-decided to skip.
516
+ Drift detection (skip modified-since-install) is the caller's
517
+ responsibility — blueprint-manifest-api owns that logic for blueprint
518
+ restores; Config Hub's manu
519
+
520
+ ```ts
521
+ type RestoreSnapshotRequest = {
522
+ exclude_target_ids?: string[]
523
+ }
524
+ ```
525
+
526
+ ### `RestoreSnapshotResponse`
527
+
528
+ ```ts
529
+ type RestoreSnapshotResponse = {
530
+ id: string
531
+ status: "restoring"
532
+ }
533
+ ```
534
+
535
+ ### `Snapshot`
536
+
537
+ ```ts
538
+ type Snapshot = {
539
+ id: string
540
+ org_id: string
541
+ name: string
542
+ description?: string
543
+ trigger: "manual" | "sync" | "blueprint_install" | "scheduled"
544
+ blueprint_instance_id?: string
545
+ resource_counts: Record<string, number>
546
+ create: {
547
+ type: "create" | "restore"
548
+ started_at: string // date-time
549
+ completed_at?: string // date-time
550
+ status: "in_progress" | "completed" | "partial" | "failed"
551
+ error?: string
552
+ triggered_by: {
553
+ name: { ... }
554
+ user_id?: { ... }
555
+ token_id?: { ... }
556
+ }
557
+ }
558
+ restores: Array<{
559
+ type: "create" | "restore"
560
+ started_at: string // date-time
561
+ completed_at?: string // date-time
562
+ status: "in_progress" | "completed" | "partial" | "failed"
563
+ error?: string
564
+ triggered_by: {
565
+ name: { ... }
566
+ user_id?: { ... }
567
+ token_id?: { ... }
568
+ }
569
+ }>
570
+ matched_count?: number
571
+ scope?: "selection" | "org"
572
+ expires_at?: string // date-time
573
+ capture_summary?: {
574
+ total: number
575
+ captured: number
576
+ skipped: number
577
+ failed: number
578
+ }
579
+ }
580
+ ```
581
+
582
+ ### `Operation`
583
+
584
+ ```ts
585
+ type Operation = {
586
+ type: "create" | "restore"
587
+ started_at: string // date-time
588
+ completed_at?: string // date-time
589
+ status: "in_progress" | "completed" | "partial" | "failed"
590
+ error?: string
591
+ triggered_by: {
592
+ name: string
593
+ user_id?: string
594
+ token_id?: string
595
+ }
596
+ }
597
+ ```
598
+
599
+ ### `CallerIdentity`
600
+
601
+ ```ts
602
+ type CallerIdentity = {
603
+ name: string
604
+ user_id?: string
605
+ token_id?: string
606
+ }
607
+ ```
package/docs/targeting.md CHANGED
@@ -291,7 +291,8 @@ const { data } = await client.setupCampaign(
291
291
  block_id: 'b8c01433-5556-4e2b-aad4-6f5348d1df84'
292
292
  },
293
293
  email: {
294
- automation_id: 'b8c01433-5556-4e2b-aad4-6f5348d1df84'
294
+ automation_id: 'b8c01433-5556-4e2b-aad4-6f5348d1df84',
295
+ template_id: 'b8c01433-5556-4e2b-aad4-6f5348d1df84'
295
296
  }
296
297
  }
297
298
  },
@@ -1060,7 +1061,8 @@ type SetupCampaignRequest = {
1060
1061
  block_id: { ... }
1061
1062
  }
1062
1063
  email?: {
1063
- automation_id: { ... }
1064
+ automation_id?: { ... }
1065
+ template_id?: { ... }
1064
1066
  }
1065
1067
  }
1066
1068
  }
@@ -1094,7 +1096,8 @@ type SetupTariffChangeCampaignRequest = {
1094
1096
  block_id: { ... }
1095
1097
  }
1096
1098
  email?: {
1097
- automation_id: { ... }
1099
+ automation_id?: { ... }
1100
+ template_id?: { ... }
1098
1101
  }
1099
1102
  }
1100
1103
  }