@epilot/sdk 2.8.1 → 2.8.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 (160) hide show
  1. package/README.md +1 -0
  2. package/definitions/access-token-runtime.json +1 -1
  3. package/definitions/access-token.json +155 -1
  4. package/definitions/snapshot-runtime.json +1 -0
  5. package/definitions/snapshot.json +734 -0
  6. package/definitions/user-runtime.json +1 -1
  7. package/definitions/user.json +441 -0
  8. package/dist/{_index-DB2VV4PQ.cjs → _index-D5TTZP5F.cjs} +4 -1
  9. package/dist/{_index-5FB6F5YY.js → _index-UY46ZN47.js} +3 -0
  10. package/dist/access-token-GD6REL4U.js +7 -0
  11. package/dist/access-token-NQ5BLMOW.cjs +7 -0
  12. package/dist/{access-token-runtime-KCKGT4O7.js → access-token-runtime-2PSLN2U3.js} +1 -1
  13. package/dist/{access-token-runtime-NZWZJPWV.cjs → access-token-runtime-B6Z7JLUS.cjs} +2 -2
  14. package/dist/{access-token.d-CnmUTOlq.d.cts → access-token.d-CegaQmrK.d.cts} +165 -5
  15. package/dist/{access-token.d-CnmUTOlq.d.ts → access-token.d-CegaQmrK.d.ts} +165 -5
  16. package/dist/apis/access-token.cjs +8 -8
  17. package/dist/apis/access-token.d.cts +2 -2
  18. package/dist/apis/access-token.d.ts +2 -2
  19. package/dist/apis/access-token.js +2 -2
  20. package/dist/apis/address-suggestions.cjs +6 -6
  21. package/dist/apis/address-suggestions.js +1 -1
  22. package/dist/apis/address.cjs +6 -6
  23. package/dist/apis/address.js +1 -1
  24. package/dist/apis/ai-agents.cjs +6 -6
  25. package/dist/apis/ai-agents.js +1 -1
  26. package/dist/apis/app.cjs +6 -6
  27. package/dist/apis/app.js +1 -1
  28. package/dist/apis/audit-logs.cjs +6 -6
  29. package/dist/apis/audit-logs.js +1 -1
  30. package/dist/apis/automation.cjs +6 -6
  31. package/dist/apis/automation.js +1 -1
  32. package/dist/apis/billing.cjs +6 -6
  33. package/dist/apis/billing.js +1 -1
  34. package/dist/apis/blueprint-manifest.cjs +6 -6
  35. package/dist/apis/blueprint-manifest.js +1 -1
  36. package/dist/apis/calendar.cjs +6 -6
  37. package/dist/apis/calendar.js +1 -1
  38. package/dist/apis/configuration-hub.cjs +6 -6
  39. package/dist/apis/configuration-hub.js +1 -1
  40. package/dist/apis/consent.cjs +6 -6
  41. package/dist/apis/consent.js +1 -1
  42. package/dist/apis/customer-portal.cjs +6 -6
  43. package/dist/apis/customer-portal.js +1 -1
  44. package/dist/apis/dashboard.cjs +6 -6
  45. package/dist/apis/dashboard.js +1 -1
  46. package/dist/apis/data-governance.cjs +6 -6
  47. package/dist/apis/data-governance.js +1 -1
  48. package/dist/apis/deduplication.cjs +6 -6
  49. package/dist/apis/deduplication.js +1 -1
  50. package/dist/apis/design.cjs +6 -6
  51. package/dist/apis/design.js +1 -1
  52. package/dist/apis/document.cjs +6 -6
  53. package/dist/apis/document.js +1 -1
  54. package/dist/apis/email-settings.cjs +6 -6
  55. package/dist/apis/email-settings.js +1 -1
  56. package/dist/apis/email-template.cjs +6 -6
  57. package/dist/apis/email-template.js +1 -1
  58. package/dist/apis/entity-mapping.cjs +6 -6
  59. package/dist/apis/entity-mapping.js +1 -1
  60. package/dist/apis/entity.cjs +6 -6
  61. package/dist/apis/entity.js +1 -1
  62. package/dist/apis/environments.cjs +6 -6
  63. package/dist/apis/environments.js +1 -1
  64. package/dist/apis/event-catalog.cjs +6 -6
  65. package/dist/apis/event-catalog.js +1 -1
  66. package/dist/apis/file.cjs +6 -6
  67. package/dist/apis/file.js +1 -1
  68. package/dist/apis/iban.cjs +6 -6
  69. package/dist/apis/iban.js +1 -1
  70. package/dist/apis/integration-toolkit.cjs +6 -6
  71. package/dist/apis/integration-toolkit.js +1 -1
  72. package/dist/apis/journey.cjs +6 -6
  73. package/dist/apis/journey.js +1 -1
  74. package/dist/apis/kanban.cjs +6 -6
  75. package/dist/apis/kanban.js +1 -1
  76. package/dist/apis/message.cjs +6 -6
  77. package/dist/apis/message.js +1 -1
  78. package/dist/apis/metering.cjs +6 -6
  79. package/dist/apis/metering.js +1 -1
  80. package/dist/apis/notes.cjs +6 -6
  81. package/dist/apis/notes.js +1 -1
  82. package/dist/apis/notification.cjs +6 -6
  83. package/dist/apis/notification.js +1 -1
  84. package/dist/apis/organization.cjs +6 -6
  85. package/dist/apis/organization.js +1 -1
  86. package/dist/apis/partner-directory.cjs +6 -6
  87. package/dist/apis/partner-directory.js +1 -1
  88. package/dist/apis/permissions.cjs +6 -6
  89. package/dist/apis/permissions.js +1 -1
  90. package/dist/apis/pricing-tier.cjs +6 -6
  91. package/dist/apis/pricing-tier.js +1 -1
  92. package/dist/apis/pricing.cjs +6 -6
  93. package/dist/apis/pricing.js +1 -1
  94. package/dist/apis/purpose.cjs +6 -6
  95. package/dist/apis/purpose.js +1 -1
  96. package/dist/apis/query.cjs +6 -6
  97. package/dist/apis/query.js +1 -1
  98. package/dist/apis/sandbox.cjs +6 -6
  99. package/dist/apis/sandbox.js +1 -1
  100. package/dist/apis/sharing.cjs +6 -6
  101. package/dist/apis/sharing.js +1 -1
  102. package/dist/apis/snapshot.cjs +38 -0
  103. package/dist/apis/snapshot.d.cts +18 -0
  104. package/dist/apis/snapshot.d.ts +18 -0
  105. package/dist/apis/snapshot.js +38 -0
  106. package/dist/apis/submission.cjs +6 -6
  107. package/dist/apis/submission.js +1 -1
  108. package/dist/apis/target.cjs +6 -6
  109. package/dist/apis/target.js +1 -1
  110. package/dist/apis/targeting.cjs +6 -6
  111. package/dist/apis/targeting.js +1 -1
  112. package/dist/apis/template-variables.cjs +6 -6
  113. package/dist/apis/template-variables.js +1 -1
  114. package/dist/apis/user.cjs +8 -8
  115. package/dist/apis/user.d.cts +2 -2
  116. package/dist/apis/user.d.ts +2 -2
  117. package/dist/apis/user.js +2 -2
  118. package/dist/apis/validation-rules.cjs +6 -6
  119. package/dist/apis/validation-rules.js +1 -1
  120. package/dist/apis/webhooks.cjs +6 -6
  121. package/dist/apis/webhooks.js +1 -1
  122. package/dist/apis/workflow-definition.cjs +6 -6
  123. package/dist/apis/workflow-definition.js +1 -1
  124. package/dist/apis/workflow.cjs +6 -6
  125. package/dist/apis/workflow.js +1 -1
  126. package/dist/{chunk-ALMZO57K.js → chunk-76M3RIDP.js} +7 -5
  127. package/dist/chunk-BJGLY4Z2.js +14 -0
  128. package/dist/{chunk-WPBRWQPL.cjs → chunk-FBQ4WDTG.cjs} +7 -5
  129. package/dist/chunk-K2QVMO5M.cjs +14 -0
  130. package/dist/chunk-NFIYEMMM.js +14 -0
  131. package/dist/{chunk-XSE4CFSM.js → chunk-OHHHS4HH.js} +1 -1
  132. package/dist/chunk-OWXEZ56F.cjs +14 -0
  133. package/dist/{chunk-OXJOO2YF.cjs → chunk-S5HBBTKM.cjs} +1 -1
  134. package/dist/index.cjs +22 -14
  135. package/dist/index.d.cts +19 -17
  136. package/dist/index.d.ts +19 -17
  137. package/dist/index.js +13 -5
  138. package/dist/snapshot-427N6KCO.js +7 -0
  139. package/dist/snapshot-NEMUND3M.cjs +7 -0
  140. package/dist/snapshot-runtime-ALPJLXVW.js +5 -0
  141. package/dist/snapshot-runtime-NWQYU5UK.cjs +5 -0
  142. package/dist/snapshot.d-DvoJ2n-v.d.cts +591 -0
  143. package/dist/snapshot.d-DvoJ2n-v.d.ts +591 -0
  144. package/dist/user-3SLAEEVD.cjs +7 -0
  145. package/dist/user-PRUYBXQV.js +7 -0
  146. package/dist/{user-runtime-U4HYUWJU.js → user-runtime-6ICV2Y73.js} +1 -1
  147. package/dist/user-runtime-Y3227ETX.cjs +5 -0
  148. package/dist/{user.d-D18fe97W.d.cts → user.d-L-C7_K84.d.cts} +421 -1
  149. package/dist/{user.d-D18fe97W.d.ts → user.d-L-C7_K84.d.ts} +421 -1
  150. package/docs/access-token.md +111 -3
  151. package/docs/snapshot.md +501 -0
  152. package/docs/user.md +321 -8
  153. package/package.json +10 -1
  154. package/dist/access-token-6BJDZSFE.cjs +0 -7
  155. package/dist/access-token-GSQZLDXR.js +0 -7
  156. package/dist/chunk-3XKBB5AE.js +0 -14
  157. package/dist/chunk-Z5TVWG3I.cjs +0 -14
  158. package/dist/user-7ZN2XO7G.cjs +0 -7
  159. package/dist/user-ZK7BK6VY.js +0 -7
  160. package/dist/user-runtime-7O2HLFVQ.cjs +0 -5
@@ -0,0 +1,501 @@
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
+ - [`getSnapshot`](#getsnapshot)
31
+ - [`deleteSnapshot`](#deletesnapshot)
32
+ - [`restoreSnapshot`](#restoresnapshot)
33
+ - [`listSnapshotResources`](#listsnapshotresources)
34
+ - [`getSnapshotResource`](#getsnapshotresource)
35
+ - [`listDependencies`](#listdependencies)
36
+
37
+ **Schemas**
38
+ - [`Error`](#error)
39
+ - [`ResourceRef`](#resourceref)
40
+ - [`SnapshotResourceSummary`](#snapshotresourcesummary)
41
+ - [`SnapshotResourceList`](#snapshotresourcelist)
42
+ - [`SnapshotResourceDetail`](#snapshotresourcedetail)
43
+ - [`CreateSnapshotRequest`](#createsnapshotrequest)
44
+ - [`CreateSnapshotResponse`](#createsnapshotresponse)
45
+ - [`RestoreSnapshotResponse`](#restoresnapshotresponse)
46
+ - [`Snapshot`](#snapshot)
47
+ - [`Operation`](#operation)
48
+ - [`CallerIdentity`](#calleridentity)
49
+
50
+ ### `createSnapshot`
51
+
52
+ Create a new snapshot of the given resources. Async — returns immediately
53
+ with a snapshot ID; client polls `getSnapshot` until `create.status`
54
+ moves from `in_progress` to `completed` or `failed`.
55
+
56
+ `POST /v1/snapshots`
57
+
58
+ ```ts
59
+ const { data } = await client.createSnapshot(
60
+ null,
61
+ {
62
+ name: 'string',
63
+ description: 'string',
64
+ trigger: 'manual',
65
+ blueprint_instance_id: 'string',
66
+ resources: [
67
+ {
68
+ type: 'string',
69
+ id: 'string'
70
+ }
71
+ ]
72
+ },
73
+ )
74
+ ```
75
+
76
+ ---
77
+
78
+ ### `listSnapshots`
79
+
80
+ List snapshots for the caller's organization, newest first.
81
+
82
+ `GET /v1/snapshots`
83
+
84
+ ```ts
85
+ const { data } = await client.listSnapshots({
86
+ cursor: 'example',
87
+ size: 1,
88
+ resource: ['...'],
89
+ })
90
+ ```
91
+
92
+ <details>
93
+ <summary>Response</summary>
94
+
95
+ ```json
96
+ {
97
+ "page_size": 0,
98
+ "cursor": "string",
99
+ "results": [
100
+ {
101
+ "id": "string",
102
+ "org_id": "string",
103
+ "name": "string",
104
+ "description": "string",
105
+ "trigger": "manual",
106
+ "blueprint_instance_id": "string",
107
+ "resource_counts": {},
108
+ "create": {
109
+ "type": "create",
110
+ "started_at": "1970-01-01T00:00:00.000Z",
111
+ "completed_at": "1970-01-01T00:00:00.000Z",
112
+ "status": "in_progress",
113
+ "error": "string",
114
+ "triggered_by": {
115
+ "name": "string",
116
+ "user_id": "string",
117
+ "token_id": "string"
118
+ }
119
+ },
120
+ "restores": [
121
+ {
122
+ "type": "create",
123
+ "started_at": "1970-01-01T00:00:00.000Z",
124
+ "completed_at": "1970-01-01T00:00:00.000Z",
125
+ "status": "in_progress",
126
+ "error": "string",
127
+ "triggered_by": {
128
+ "name": "string",
129
+ "user_id": "string",
130
+ "token_id": "string"
131
+ }
132
+ }
133
+ ],
134
+ "matched_count": 0
135
+ }
136
+ ]
137
+ }
138
+ ```
139
+
140
+ </details>
141
+
142
+ ---
143
+
144
+ ### `getSnapshot`
145
+
146
+ Fetch a snapshot's metadata. Poll this endpoint to track create/restore progress.
147
+
148
+ `GET /v1/snapshots/{id}`
149
+
150
+ ```ts
151
+ const { data } = await client.getSnapshot({
152
+ id: '123e4567-e89b-12d3-a456-426614174000',
153
+ })
154
+ ```
155
+
156
+ <details>
157
+ <summary>Response</summary>
158
+
159
+ ```json
160
+ {
161
+ "id": "string",
162
+ "org_id": "string",
163
+ "name": "string",
164
+ "description": "string",
165
+ "trigger": "manual",
166
+ "blueprint_instance_id": "string",
167
+ "resource_counts": {},
168
+ "create": {
169
+ "type": "create",
170
+ "started_at": "1970-01-01T00:00:00.000Z",
171
+ "completed_at": "1970-01-01T00:00:00.000Z",
172
+ "status": "in_progress",
173
+ "error": "string",
174
+ "triggered_by": {
175
+ "name": "string",
176
+ "user_id": "string",
177
+ "token_id": "string"
178
+ }
179
+ },
180
+ "restores": [
181
+ {
182
+ "type": "create",
183
+ "started_at": "1970-01-01T00:00:00.000Z",
184
+ "completed_at": "1970-01-01T00:00:00.000Z",
185
+ "status": "in_progress",
186
+ "error": "string",
187
+ "triggered_by": {
188
+ "name": "string",
189
+ "user_id": "string",
190
+ "token_id": "string"
191
+ }
192
+ }
193
+ ],
194
+ "matched_count": 0
195
+ }
196
+ ```
197
+
198
+ </details>
199
+
200
+ ---
201
+
202
+ ### `deleteSnapshot`
203
+
204
+ Delete a snapshot's metadata and S3 manifest.
205
+
206
+ `DELETE /v1/snapshots/{id}`
207
+
208
+ ```ts
209
+ const { data } = await client.deleteSnapshot({
210
+ id: '123e4567-e89b-12d3-a456-426614174000',
211
+ })
212
+ ```
213
+
214
+ ---
215
+
216
+ ### `restoreSnapshot`
217
+
218
+ Restore a snapshot to the org. Async — returns immediately; client polls
219
+ `getSnapshot` until the latest entry in `restores` moves from
220
+ `in_progress` to `completed` or `failed`.
221
+
222
+ `POST /v1/snapshots/{id}:restore`
223
+
224
+ ```ts
225
+ const { data } = await client.restoreSnapshot({
226
+ id: '123e4567-e89b-12d3-a456-426614174000',
227
+ })
228
+ ```
229
+
230
+ ---
231
+
232
+ ### `listSnapshotResources`
233
+
234
+ List the resources captured in this snapshot. Returns lightweight
235
+ identity fields per resource — payloads are fetched via the
236
+ single-resource endpoint when needed.
237
+
238
+ `GET /v1/snapshots/{id}/resources`
239
+
240
+ ```ts
241
+ const { data } = await client.listSnapshotResources({
242
+ id: '123e4567-e89b-12d3-a456-426614174000',
243
+ })
244
+ ```
245
+
246
+ <details>
247
+ <summary>Response</summary>
248
+
249
+ ```json
250
+ {
251
+ "resources": [
252
+ {
253
+ "lineage_id": "string",
254
+ "target_id": "string",
255
+ "type": "string",
256
+ "name": "string"
257
+ }
258
+ ]
259
+ }
260
+ ```
261
+
262
+ </details>
263
+
264
+ ---
265
+
266
+ ### `getSnapshotResource`
267
+
268
+ Fetch one captured resource with its full payload. For UI views
269
+ that diff the captured state against the current destination.
270
+
271
+ `GET /v1/snapshots/{id}/resources/{lineage_id}`
272
+
273
+ ```ts
274
+ const { data } = await client.getSnapshotResource({
275
+ id: '123e4567-e89b-12d3-a456-426614174000',
276
+ lineage_id: 'example',
277
+ })
278
+ ```
279
+
280
+ <details>
281
+ <summary>Response</summary>
282
+
283
+ ```json
284
+ {
285
+ "lineage_id": "string",
286
+ "target_id": "string",
287
+ "type": "string",
288
+ "name": "string",
289
+ "captured": {}
290
+ }
291
+ ```
292
+
293
+ </details>
294
+
295
+ ---
296
+
297
+ ### `listDependencies`
298
+
299
+ Walk the dependency tree for a set of resources and return the full
300
+ transitive closure, topologically sorted.
301
+
302
+ `POST /v1/snapshots:list-dependencies`
303
+
304
+ ```ts
305
+ const { data } = await client.listDependencies(
306
+ null,
307
+ {
308
+ resources: [
309
+ {
310
+ type: 'string',
311
+ id: 'string'
312
+ }
313
+ ]
314
+ },
315
+ )
316
+ ```
317
+
318
+ <details>
319
+ <summary>Response</summary>
320
+
321
+ ```json
322
+ {
323
+ "dependencies": [
324
+ {
325
+ "type": "string",
326
+ "id": "string"
327
+ }
328
+ ]
329
+ }
330
+ ```
331
+
332
+ </details>
333
+
334
+ ---
335
+
336
+ ## Schemas
337
+
338
+ ### `Error`
339
+
340
+ ```ts
341
+ type Error = {
342
+ status: number
343
+ error: string
344
+ }
345
+ ```
346
+
347
+ ### `ResourceRef`
348
+
349
+ ```ts
350
+ type ResourceRef = {
351
+ type: string
352
+ id: string
353
+ }
354
+ ```
355
+
356
+ ### `SnapshotResourceSummary`
357
+
358
+ Lightweight identity for a captured resource. Returned by
359
+ `listSnapshotResources`; the full payload is fetched separately via
360
+ `getSnapshotResource` when needed.
361
+
362
+
363
+ ```ts
364
+ type SnapshotResourceSummary = {
365
+ lineage_id: string
366
+ target_id: string
367
+ type: string
368
+ name?: string
369
+ }
370
+ ```
371
+
372
+ ### `SnapshotResourceList`
373
+
374
+ ```ts
375
+ type SnapshotResourceList = {
376
+ resources: Array<{
377
+ lineage_id: string
378
+ target_id: string
379
+ type: string
380
+ name?: string
381
+ }>
382
+ }
383
+ ```
384
+
385
+ ### `SnapshotResourceDetail`
386
+
387
+ A single captured resource with its full payload. The identity fields
388
+ match `SnapshotResourceSummary`; the `captured` payload is the
389
+ pre-install state at snapshot time.
390
+
391
+
392
+ ```ts
393
+ type SnapshotResourceDetail = {
394
+ lineage_id: string
395
+ target_id: string
396
+ type: string
397
+ name?: string
398
+ captured: Record<string, unknown>
399
+ }
400
+ ```
401
+
402
+ ### `CreateSnapshotRequest`
403
+
404
+ ```ts
405
+ type CreateSnapshotRequest = {
406
+ name: string
407
+ description?: string
408
+ trigger?: "manual" | "sync" | "blueprint_install"
409
+ blueprint_instance_id?: string
410
+ resources: Array<{
411
+ type: string
412
+ id: string
413
+ }>
414
+ }
415
+ ```
416
+
417
+ ### `CreateSnapshotResponse`
418
+
419
+ ```ts
420
+ type CreateSnapshotResponse = {
421
+ id: string
422
+ name: string
423
+ status: "creating"
424
+ created_at: string // date-time
425
+ }
426
+ ```
427
+
428
+ ### `RestoreSnapshotResponse`
429
+
430
+ ```ts
431
+ type RestoreSnapshotResponse = {
432
+ id: string
433
+ status: "restoring"
434
+ }
435
+ ```
436
+
437
+ ### `Snapshot`
438
+
439
+ ```ts
440
+ type Snapshot = {
441
+ id: string
442
+ org_id: string
443
+ name: string
444
+ description?: string
445
+ trigger: "manual" | "sync" | "blueprint_install"
446
+ blueprint_instance_id?: string
447
+ resource_counts: Record<string, number>
448
+ create: {
449
+ type: "create" | "restore"
450
+ started_at: string // date-time
451
+ completed_at?: string // date-time
452
+ status: "in_progress" | "completed" | "failed"
453
+ error?: string
454
+ triggered_by: {
455
+ name: { ... }
456
+ user_id?: { ... }
457
+ token_id?: { ... }
458
+ }
459
+ }
460
+ restores: Array<{
461
+ type: "create" | "restore"
462
+ started_at: string // date-time
463
+ completed_at?: string // date-time
464
+ status: "in_progress" | "completed" | "failed"
465
+ error?: string
466
+ triggered_by: {
467
+ name: { ... }
468
+ user_id?: { ... }
469
+ token_id?: { ... }
470
+ }
471
+ }>
472
+ matched_count?: number
473
+ }
474
+ ```
475
+
476
+ ### `Operation`
477
+
478
+ ```ts
479
+ type Operation = {
480
+ type: "create" | "restore"
481
+ started_at: string // date-time
482
+ completed_at?: string // date-time
483
+ status: "in_progress" | "completed" | "failed"
484
+ error?: string
485
+ triggered_by: {
486
+ name: string
487
+ user_id?: string
488
+ token_id?: string
489
+ }
490
+ }
491
+ ```
492
+
493
+ ### `CallerIdentity`
494
+
495
+ ```ts
496
+ type CallerIdentity = {
497
+ name: string
498
+ user_id?: string
499
+ token_id?: string
500
+ }
501
+ ```