@epilot/sdk 2.8.2 → 2.8.4

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 (164) hide show
  1. package/README.md +1 -0
  2. package/definitions/blueprint-manifest-runtime.json +1 -1
  3. package/definitions/blueprint-manifest.json +571 -1
  4. package/definitions/snapshot-runtime.json +1 -0
  5. package/definitions/snapshot.json +786 -0
  6. package/definitions/user-runtime.json +1 -1
  7. package/definitions/user.json +441 -0
  8. package/dist/README-NBWAQWQS.js +7 -0
  9. package/dist/README-XCIDDEAE.cjs +7 -0
  10. package/dist/{_index-DB2VV4PQ.cjs → _index-D5TTZP5F.cjs} +4 -1
  11. package/dist/{_index-5FB6F5YY.js → _index-UY46ZN47.js} +3 -0
  12. package/dist/apis/access-token.cjs +6 -6
  13. package/dist/apis/access-token.js +1 -1
  14. package/dist/apis/address-suggestions.cjs +6 -6
  15. package/dist/apis/address-suggestions.js +1 -1
  16. package/dist/apis/address.cjs +6 -6
  17. package/dist/apis/address.js +1 -1
  18. package/dist/apis/ai-agents.cjs +6 -6
  19. package/dist/apis/ai-agents.js +1 -1
  20. package/dist/apis/app.cjs +6 -6
  21. package/dist/apis/app.js +1 -1
  22. package/dist/apis/audit-logs.cjs +6 -6
  23. package/dist/apis/audit-logs.js +1 -1
  24. package/dist/apis/automation.cjs +6 -6
  25. package/dist/apis/automation.js +1 -1
  26. package/dist/apis/billing.cjs +6 -6
  27. package/dist/apis/billing.js +1 -1
  28. package/dist/apis/blueprint-manifest.cjs +8 -8
  29. package/dist/apis/blueprint-manifest.d.cts +2 -2
  30. package/dist/apis/blueprint-manifest.d.ts +2 -2
  31. package/dist/apis/blueprint-manifest.js +2 -2
  32. package/dist/apis/calendar.cjs +6 -6
  33. package/dist/apis/calendar.js +1 -1
  34. package/dist/apis/configuration-hub.cjs +6 -6
  35. package/dist/apis/configuration-hub.js +1 -1
  36. package/dist/apis/consent.cjs +6 -6
  37. package/dist/apis/consent.js +1 -1
  38. package/dist/apis/customer-portal.cjs +6 -6
  39. package/dist/apis/customer-portal.js +1 -1
  40. package/dist/apis/dashboard.cjs +6 -6
  41. package/dist/apis/dashboard.js +1 -1
  42. package/dist/apis/data-governance.cjs +6 -6
  43. package/dist/apis/data-governance.js +1 -1
  44. package/dist/apis/deduplication.cjs +6 -6
  45. package/dist/apis/deduplication.js +1 -1
  46. package/dist/apis/design.cjs +6 -6
  47. package/dist/apis/design.js +1 -1
  48. package/dist/apis/document.cjs +6 -6
  49. package/dist/apis/document.js +1 -1
  50. package/dist/apis/email-settings.cjs +6 -6
  51. package/dist/apis/email-settings.js +1 -1
  52. package/dist/apis/email-template.cjs +6 -6
  53. package/dist/apis/email-template.js +1 -1
  54. package/dist/apis/entity-mapping.cjs +6 -6
  55. package/dist/apis/entity-mapping.js +1 -1
  56. package/dist/apis/entity.cjs +6 -6
  57. package/dist/apis/entity.js +1 -1
  58. package/dist/apis/environments.cjs +6 -6
  59. package/dist/apis/environments.js +1 -1
  60. package/dist/apis/event-catalog.cjs +6 -6
  61. package/dist/apis/event-catalog.js +1 -1
  62. package/dist/apis/file.cjs +6 -6
  63. package/dist/apis/file.js +1 -1
  64. package/dist/apis/iban.cjs +6 -6
  65. package/dist/apis/iban.js +1 -1
  66. package/dist/apis/integration-toolkit.cjs +6 -6
  67. package/dist/apis/integration-toolkit.js +1 -1
  68. package/dist/apis/journey.cjs +6 -6
  69. package/dist/apis/journey.js +1 -1
  70. package/dist/apis/kanban.cjs +6 -6
  71. package/dist/apis/kanban.js +1 -1
  72. package/dist/apis/message.cjs +6 -6
  73. package/dist/apis/message.js +1 -1
  74. package/dist/apis/metering.cjs +6 -6
  75. package/dist/apis/metering.js +1 -1
  76. package/dist/apis/notes.cjs +6 -6
  77. package/dist/apis/notes.js +1 -1
  78. package/dist/apis/notification.cjs +6 -6
  79. package/dist/apis/notification.js +1 -1
  80. package/dist/apis/organization.cjs +6 -6
  81. package/dist/apis/organization.js +1 -1
  82. package/dist/apis/partner-directory.cjs +6 -6
  83. package/dist/apis/partner-directory.js +1 -1
  84. package/dist/apis/permissions.cjs +6 -6
  85. package/dist/apis/permissions.js +1 -1
  86. package/dist/apis/pricing-tier.cjs +6 -6
  87. package/dist/apis/pricing-tier.js +1 -1
  88. package/dist/apis/pricing.cjs +6 -6
  89. package/dist/apis/pricing.js +1 -1
  90. package/dist/apis/purpose.cjs +6 -6
  91. package/dist/apis/purpose.js +1 -1
  92. package/dist/apis/query.cjs +6 -6
  93. package/dist/apis/query.js +1 -1
  94. package/dist/apis/sandbox.cjs +6 -6
  95. package/dist/apis/sandbox.js +1 -1
  96. package/dist/apis/sharing.cjs +6 -6
  97. package/dist/apis/sharing.js +1 -1
  98. package/dist/apis/snapshot.cjs +38 -0
  99. package/dist/apis/snapshot.d.cts +18 -0
  100. package/dist/apis/snapshot.d.ts +18 -0
  101. package/dist/apis/snapshot.js +38 -0
  102. package/dist/apis/submission.cjs +6 -6
  103. package/dist/apis/submission.js +1 -1
  104. package/dist/apis/target.cjs +6 -6
  105. package/dist/apis/target.js +1 -1
  106. package/dist/apis/targeting.cjs +6 -6
  107. package/dist/apis/targeting.js +1 -1
  108. package/dist/apis/template-variables.cjs +6 -6
  109. package/dist/apis/template-variables.js +1 -1
  110. package/dist/apis/user.cjs +8 -8
  111. package/dist/apis/user.d.cts +2 -2
  112. package/dist/apis/user.d.ts +2 -2
  113. package/dist/apis/user.js +2 -2
  114. package/dist/apis/validation-rules.cjs +6 -6
  115. package/dist/apis/validation-rules.js +1 -1
  116. package/dist/apis/webhooks.cjs +6 -6
  117. package/dist/apis/webhooks.js +1 -1
  118. package/dist/apis/workflow-definition.cjs +6 -6
  119. package/dist/apis/workflow-definition.js +1 -1
  120. package/dist/apis/workflow.cjs +6 -6
  121. package/dist/apis/workflow.js +1 -1
  122. package/dist/blueprint-manifest-WHYSBU66.cjs +7 -0
  123. package/dist/blueprint-manifest-WZVBTKUL.js +7 -0
  124. package/dist/{blueprint-manifest-runtime-FRLU3ZSF.js → blueprint-manifest-runtime-2344IUIE.js} +1 -1
  125. package/dist/{blueprint-manifest-runtime-EIDOROIQ.cjs → blueprint-manifest-runtime-WU5MWPVT.cjs} +2 -2
  126. package/dist/{blueprint-manifest.d-B8yDxagC.d.cts → blueprint-manifest.d-2-TORV8o.d.cts} +926 -4
  127. package/dist/{blueprint-manifest.d-B8yDxagC.d.ts → blueprint-manifest.d-2-TORV8o.d.ts} +926 -4
  128. package/dist/chunk-DFYZ3LS2.cjs +14 -0
  129. package/dist/chunk-GUYARNLI.js +14 -0
  130. package/dist/{chunk-3IOUJMDV.cjs → chunk-M432U2EN.cjs} +8 -6
  131. package/dist/chunk-NFIYEMMM.js +14 -0
  132. package/dist/chunk-OWXEZ56F.cjs +14 -0
  133. package/dist/{chunk-NGHCQ2FA.cjs → chunk-T57MT6J5.cjs} +1 -1
  134. package/dist/{chunk-MVY54TDV.js → chunk-TP3MI5V5.js} +8 -6
  135. package/dist/{chunk-4YBWMDFP.js → chunk-UWGWRGGB.js} +1 -1
  136. package/dist/index.cjs +22 -14
  137. package/dist/index.d.cts +19 -17
  138. package/dist/index.d.ts +19 -17
  139. package/dist/index.js +13 -5
  140. package/dist/snapshot-CTKT2ILE.cjs +7 -0
  141. package/dist/snapshot-XYFMWDVA.js +7 -0
  142. package/dist/snapshot-runtime-EXWPPYJI.js +5 -0
  143. package/dist/snapshot-runtime-XUQIDON7.cjs +5 -0
  144. package/dist/snapshot.d-BX0xhQlH.d.cts +588 -0
  145. package/dist/snapshot.d-BX0xhQlH.d.ts +588 -0
  146. package/dist/user-3SLAEEVD.cjs +7 -0
  147. package/dist/user-PRUYBXQV.js +7 -0
  148. package/dist/{user-runtime-U4HYUWJU.js → user-runtime-6ICV2Y73.js} +1 -1
  149. package/dist/user-runtime-Y3227ETX.cjs +5 -0
  150. package/dist/{user.d-D18fe97W.d.ts → user.d-L-C7_K84.d.cts} +421 -1
  151. package/dist/{user.d-D18fe97W.d.cts → user.d-L-C7_K84.d.ts} +421 -1
  152. package/docs/blueprint-manifest.md +421 -95
  153. package/docs/snapshot.md +561 -0
  154. package/docs/user.md +321 -8
  155. package/package.json +10 -1
  156. package/dist/README-46VYEGGW.js +0 -7
  157. package/dist/README-IVBISSWB.cjs +0 -7
  158. package/dist/blueprint-manifest-6DEYW5MW.js +0 -7
  159. package/dist/blueprint-manifest-GCV7H74X.cjs +0 -7
  160. package/dist/chunk-3XKBB5AE.js +0 -14
  161. package/dist/chunk-Z5TVWG3I.cjs +0 -14
  162. package/dist/user-7ZN2XO7G.cjs +0 -7
  163. package/dist/user-ZK7BK6VY.js +0 -7
  164. package/dist/user-runtime-7O2HLFVQ.cjs +0 -5
@@ -0,0 +1,786 @@
1
+ {
2
+ "openapi": "3.0.3",
3
+ "info": {
4
+ "title": "Snapshot API",
5
+ "description": "Point-in-time backups of epilot configuration with restore.\n\nProvides a safety net for configuration changes: every blueprint install,\nevery Configuration Hub sync, and every manual config change can be preceded\nby a snapshot — giving operators a rollback point if something breaks.\n\nSee `docs/rfcs/RFC-snapshot-api.md` in the `blueprint-manifest-api` repo\nfor the full design.\n",
6
+ "version": "0.1.0"
7
+ },
8
+ "servers": [
9
+ {
10
+ "url": "https://snapshot.sls.epilot.io"
11
+ },
12
+ {
13
+ "url": "https://snapshot.dev.sls.epilot.io",
14
+ "description": "Dev"
15
+ },
16
+ {
17
+ "url": "https://snapshot.staging.sls.epilot.io",
18
+ "description": "Staging"
19
+ }
20
+ ],
21
+ "security": [
22
+ {
23
+ "EpilotAuth": []
24
+ }
25
+ ],
26
+ "tags": [
27
+ {
28
+ "name": "Snapshots",
29
+ "description": "Snapshot CRUD and restore operations"
30
+ }
31
+ ],
32
+ "paths": {
33
+ "/v1/snapshots": {
34
+ "post": {
35
+ "operationId": "createSnapshot",
36
+ "summary": "createSnapshot",
37
+ "description": "Create a new snapshot of the given resources. Async — returns immediately\nwith a snapshot ID; client polls `getSnapshot` until `create.status`\nmoves from `in_progress` to `completed` or `failed`.\n",
38
+ "tags": [
39
+ "Snapshots"
40
+ ],
41
+ "requestBody": {
42
+ "required": true,
43
+ "content": {
44
+ "application/json": {
45
+ "schema": {
46
+ "$ref": "#/components/schemas/CreateSnapshotRequest"
47
+ }
48
+ }
49
+ }
50
+ },
51
+ "responses": {
52
+ "202": {
53
+ "description": "Snapshot creation started",
54
+ "content": {
55
+ "application/json": {
56
+ "schema": {
57
+ "$ref": "#/components/schemas/CreateSnapshotResponse"
58
+ }
59
+ }
60
+ }
61
+ },
62
+ "400": {
63
+ "$ref": "#/components/responses/BadRequest"
64
+ },
65
+ "401": {
66
+ "$ref": "#/components/responses/Unauthorized"
67
+ }
68
+ }
69
+ },
70
+ "get": {
71
+ "operationId": "listSnapshots",
72
+ "summary": "listSnapshots",
73
+ "description": "List snapshots for the caller's organization, newest first.\n\nPass `resource=<type>:<id>` one or more times to filter to snapshots\ncontaining **any** of the listed resources (OR semantics). Each returned\nsnapshot includes a `matched_count` indicating how many of the filter\npairs are present in it. Hard cap of 50 filter pairs per request. When\nfiltered, pagination is not applied — the result set is bounded.\n",
74
+ "tags": [
75
+ "Snapshots"
76
+ ],
77
+ "parameters": [
78
+ {
79
+ "in": "query",
80
+ "name": "cursor",
81
+ "schema": {
82
+ "type": "string"
83
+ }
84
+ },
85
+ {
86
+ "in": "query",
87
+ "name": "size",
88
+ "schema": {
89
+ "type": "integer",
90
+ "minimum": 1,
91
+ "maximum": 100,
92
+ "default": 25
93
+ }
94
+ },
95
+ {
96
+ "in": "query",
97
+ "name": "resource",
98
+ "description": "Filter to snapshots containing one or more resources. Format\n`<type>:<id>`. Split on the first colon — the `<id>` half may\ncontain colons (e.g., role acl ids like `role:acl:internal:foo`).\nRepeat the param for multiple resources — results are OR-unioned.\nMaximum 50 pairs per request.\n",
99
+ "schema": {
100
+ "type": "array",
101
+ "items": {
102
+ "type": "string",
103
+ "pattern": "^[^:]+:.+$"
104
+ }
105
+ }
106
+ }
107
+ ],
108
+ "responses": {
109
+ "200": {
110
+ "description": "Snapshot list",
111
+ "content": {
112
+ "application/json": {
113
+ "schema": {
114
+ "type": "object",
115
+ "required": [
116
+ "results",
117
+ "page_size"
118
+ ],
119
+ "properties": {
120
+ "page_size": {
121
+ "type": "integer",
122
+ "description": "Number of items in this page (not the total across all pages)."
123
+ },
124
+ "cursor": {
125
+ "type": "string",
126
+ "description": "Pagination cursor; pass to the next request to get the next page."
127
+ },
128
+ "results": {
129
+ "type": "array",
130
+ "items": {
131
+ "$ref": "#/components/schemas/Snapshot"
132
+ }
133
+ }
134
+ }
135
+ }
136
+ }
137
+ }
138
+ },
139
+ "401": {
140
+ "$ref": "#/components/responses/Unauthorized"
141
+ }
142
+ }
143
+ }
144
+ },
145
+ "/v1/snapshots/{id}": {
146
+ "parameters": [
147
+ {
148
+ "in": "path",
149
+ "name": "id",
150
+ "required": true,
151
+ "schema": {
152
+ "type": "string"
153
+ }
154
+ }
155
+ ],
156
+ "get": {
157
+ "operationId": "getSnapshot",
158
+ "summary": "getSnapshot",
159
+ "description": "Fetch a snapshot's metadata. Poll this endpoint to track create/restore progress.",
160
+ "tags": [
161
+ "Snapshots"
162
+ ],
163
+ "responses": {
164
+ "200": {
165
+ "description": "Snapshot metadata",
166
+ "content": {
167
+ "application/json": {
168
+ "schema": {
169
+ "$ref": "#/components/schemas/Snapshot"
170
+ }
171
+ }
172
+ }
173
+ },
174
+ "401": {
175
+ "$ref": "#/components/responses/Unauthorized"
176
+ },
177
+ "404": {
178
+ "$ref": "#/components/responses/NotFound"
179
+ }
180
+ }
181
+ },
182
+ "delete": {
183
+ "operationId": "deleteSnapshot",
184
+ "summary": "deleteSnapshot",
185
+ "description": "Delete a snapshot's metadata and S3 manifest.",
186
+ "tags": [
187
+ "Snapshots"
188
+ ],
189
+ "responses": {
190
+ "204": {
191
+ "description": "Deleted"
192
+ },
193
+ "401": {
194
+ "$ref": "#/components/responses/Unauthorized"
195
+ },
196
+ "404": {
197
+ "$ref": "#/components/responses/NotFound"
198
+ }
199
+ }
200
+ }
201
+ },
202
+ "/v1/snapshots/{id}:restore": {
203
+ "parameters": [
204
+ {
205
+ "in": "path",
206
+ "name": "id",
207
+ "required": true,
208
+ "schema": {
209
+ "type": "string"
210
+ }
211
+ }
212
+ ],
213
+ "post": {
214
+ "operationId": "restoreSnapshot",
215
+ "summary": "restoreSnapshot",
216
+ "description": "Restore a snapshot to the org. Async — returns immediately; client polls\n`getSnapshot` until the latest entry in `restores` moves from\n`in_progress` to one of `completed | partial | failed`.\n\nv1: full restore only. Cherry-pick (`resources?` body filter) is an open\nquestion — see RFC OQ #1.\n",
217
+ "tags": [
218
+ "Snapshots"
219
+ ],
220
+ "requestBody": {
221
+ "required": false,
222
+ "content": {
223
+ "application/json": {
224
+ "schema": {
225
+ "$ref": "#/components/schemas/RestoreSnapshotRequest"
226
+ }
227
+ }
228
+ }
229
+ },
230
+ "responses": {
231
+ "202": {
232
+ "description": "Restore started",
233
+ "content": {
234
+ "application/json": {
235
+ "schema": {
236
+ "$ref": "#/components/schemas/RestoreSnapshotResponse"
237
+ }
238
+ }
239
+ }
240
+ },
241
+ "401": {
242
+ "$ref": "#/components/responses/Unauthorized"
243
+ },
244
+ "404": {
245
+ "$ref": "#/components/responses/NotFound"
246
+ }
247
+ }
248
+ }
249
+ },
250
+ "/v1/snapshots/{id}/resources": {
251
+ "parameters": [
252
+ {
253
+ "in": "path",
254
+ "name": "id",
255
+ "required": true,
256
+ "schema": {
257
+ "type": "string"
258
+ }
259
+ }
260
+ ],
261
+ "get": {
262
+ "operationId": "listSnapshotResources",
263
+ "summary": "listSnapshotResources",
264
+ "description": "List the resources captured in this snapshot. Returns lightweight\nidentity fields per resource — payloads are fetched via the\nsingle-resource endpoint when needed.\n\nUsed by Config Hub UI to render snapshot contents, and by\nblueprint-manifest-api to partition lineage rows during a restore\nsweep (resources in this list are touched; others are net-new).\n",
265
+ "tags": [
266
+ "Snapshots"
267
+ ],
268
+ "responses": {
269
+ "200": {
270
+ "description": "Captured resources",
271
+ "content": {
272
+ "application/json": {
273
+ "schema": {
274
+ "$ref": "#/components/schemas/SnapshotResourceList"
275
+ }
276
+ }
277
+ }
278
+ },
279
+ "401": {
280
+ "$ref": "#/components/responses/Unauthorized"
281
+ },
282
+ "404": {
283
+ "$ref": "#/components/responses/NotFound"
284
+ }
285
+ }
286
+ }
287
+ },
288
+ "/v1/snapshots/{id}/resources/{lineage_id}": {
289
+ "parameters": [
290
+ {
291
+ "in": "path",
292
+ "name": "id",
293
+ "required": true,
294
+ "schema": {
295
+ "type": "string"
296
+ }
297
+ },
298
+ {
299
+ "in": "path",
300
+ "name": "lineage_id",
301
+ "required": true,
302
+ "schema": {
303
+ "type": "string"
304
+ }
305
+ }
306
+ ],
307
+ "get": {
308
+ "operationId": "getSnapshotResource",
309
+ "summary": "getSnapshotResource",
310
+ "description": "Fetch one captured resource with its full payload. For UI views\nthat diff the captured state against the current destination.\n",
311
+ "tags": [
312
+ "Snapshots"
313
+ ],
314
+ "responses": {
315
+ "200": {
316
+ "description": "Captured resource with payload",
317
+ "content": {
318
+ "application/json": {
319
+ "schema": {
320
+ "$ref": "#/components/schemas/SnapshotResourceDetail"
321
+ }
322
+ }
323
+ }
324
+ },
325
+ "401": {
326
+ "$ref": "#/components/responses/Unauthorized"
327
+ },
328
+ "404": {
329
+ "$ref": "#/components/responses/NotFound"
330
+ }
331
+ }
332
+ }
333
+ },
334
+ "/v1/snapshots:list-dependencies": {
335
+ "post": {
336
+ "operationId": "listDependencies",
337
+ "summary": "listDependencies",
338
+ "description": "Walk the dependency tree for a set of resources and return the full\ntransitive closure, topologically sorted.\n\n**Not implemented in v1.** Returns 501. Callers should pass an explicit\nresource list to `createSnapshot`. See RFC Phase 5.\n",
339
+ "tags": [
340
+ "Snapshots"
341
+ ],
342
+ "requestBody": {
343
+ "required": true,
344
+ "content": {
345
+ "application/json": {
346
+ "schema": {
347
+ "type": "object",
348
+ "required": [
349
+ "resources"
350
+ ],
351
+ "properties": {
352
+ "resources": {
353
+ "type": "array",
354
+ "items": {
355
+ "$ref": "#/components/schemas/ResourceRef"
356
+ }
357
+ }
358
+ }
359
+ }
360
+ }
361
+ }
362
+ },
363
+ "responses": {
364
+ "200": {
365
+ "description": "Transitive dependency closure for the given resources, topologically sorted.",
366
+ "content": {
367
+ "application/json": {
368
+ "schema": {
369
+ "type": "object",
370
+ "required": [
371
+ "dependencies"
372
+ ],
373
+ "properties": {
374
+ "dependencies": {
375
+ "type": "array",
376
+ "items": {
377
+ "$ref": "#/components/schemas/ResourceRef"
378
+ }
379
+ }
380
+ }
381
+ }
382
+ }
383
+ }
384
+ },
385
+ "401": {
386
+ "$ref": "#/components/responses/Unauthorized"
387
+ },
388
+ "501": {
389
+ "description": "Not implemented",
390
+ "content": {
391
+ "application/json": {
392
+ "schema": {
393
+ "$ref": "#/components/schemas/Error"
394
+ }
395
+ }
396
+ }
397
+ }
398
+ }
399
+ }
400
+ }
401
+ },
402
+ "components": {
403
+ "securitySchemes": {
404
+ "EpilotAuth": {
405
+ "type": "apiKey",
406
+ "in": "header",
407
+ "name": "Authorization"
408
+ }
409
+ },
410
+ "responses": {
411
+ "BadRequest": {
412
+ "description": "Bad request",
413
+ "content": {
414
+ "application/json": {
415
+ "schema": {
416
+ "$ref": "#/components/schemas/Error"
417
+ }
418
+ }
419
+ }
420
+ },
421
+ "Unauthorized": {
422
+ "description": "Unauthorized",
423
+ "content": {
424
+ "application/json": {
425
+ "schema": {
426
+ "$ref": "#/components/schemas/Error"
427
+ }
428
+ }
429
+ }
430
+ },
431
+ "NotFound": {
432
+ "description": "Not found",
433
+ "content": {
434
+ "application/json": {
435
+ "schema": {
436
+ "$ref": "#/components/schemas/Error"
437
+ }
438
+ }
439
+ }
440
+ }
441
+ },
442
+ "schemas": {
443
+ "Error": {
444
+ "type": "object",
445
+ "required": [
446
+ "status",
447
+ "error"
448
+ ],
449
+ "properties": {
450
+ "status": {
451
+ "type": "integer"
452
+ },
453
+ "error": {
454
+ "type": "string"
455
+ }
456
+ }
457
+ },
458
+ "ResourceRef": {
459
+ "type": "object",
460
+ "required": [
461
+ "type",
462
+ "id"
463
+ ],
464
+ "properties": {
465
+ "type": {
466
+ "type": "string",
467
+ "description": "Resource type (e.g., custom_variable, journey, automation_flow)"
468
+ },
469
+ "id": {
470
+ "type": "string"
471
+ }
472
+ }
473
+ },
474
+ "SnapshotResourceSummary": {
475
+ "type": "object",
476
+ "description": "Lightweight identity for a captured resource. Returned by\n`listSnapshotResources`; the full payload is fetched separately via\n`getSnapshotResource` when needed.\n",
477
+ "required": [
478
+ "lineage_id",
479
+ "target_id",
480
+ "type"
481
+ ],
482
+ "properties": {
483
+ "lineage_id": {
484
+ "type": "string",
485
+ "description": "Cross-service correlation key — matches the lineage row id in\nblueprint-manifest-api's lineage table for `blueprint_install`\nsnapshots. Same as `target_id` for snapshots whose capture\ndoesn't distinguish source vs destination identifiers.\n"
486
+ },
487
+ "target_id": {
488
+ "type": "string",
489
+ "description": "Identifier the resource was captured by (passed in via `ResourceRef.id` on createSnapshot)."
490
+ },
491
+ "type": {
492
+ "type": "string"
493
+ },
494
+ "name": {
495
+ "type": "string",
496
+ "nullable": true,
497
+ "description": "Best-effort display name extracted from the captured payload\n(`name` / `title` / `label` / `key` in that order). Null when\nnone of those fields are present.\n"
498
+ }
499
+ }
500
+ },
501
+ "SnapshotResourceList": {
502
+ "type": "object",
503
+ "required": [
504
+ "resources"
505
+ ],
506
+ "properties": {
507
+ "resources": {
508
+ "type": "array",
509
+ "items": {
510
+ "$ref": "#/components/schemas/SnapshotResourceSummary"
511
+ }
512
+ }
513
+ }
514
+ },
515
+ "SnapshotResourceDetail": {
516
+ "type": "object",
517
+ "description": "A single captured resource with its full payload. The identity fields\nmatch `SnapshotResourceSummary`; the `captured` payload is the\npre-install state at snapshot time.\n",
518
+ "required": [
519
+ "lineage_id",
520
+ "target_id",
521
+ "type",
522
+ "captured"
523
+ ],
524
+ "properties": {
525
+ "lineage_id": {
526
+ "type": "string"
527
+ },
528
+ "target_id": {
529
+ "type": "string"
530
+ },
531
+ "type": {
532
+ "type": "string"
533
+ },
534
+ "name": {
535
+ "type": "string",
536
+ "nullable": true
537
+ },
538
+ "captured": {
539
+ "type": "object",
540
+ "additionalProperties": true,
541
+ "description": "Full captured payload of the resource at snapshot time."
542
+ }
543
+ }
544
+ },
545
+ "CreateSnapshotRequest": {
546
+ "type": "object",
547
+ "required": [
548
+ "name",
549
+ "resources"
550
+ ],
551
+ "properties": {
552
+ "name": {
553
+ "type": "string"
554
+ },
555
+ "description": {
556
+ "type": "string"
557
+ },
558
+ "trigger": {
559
+ "type": "string",
560
+ "enum": [
561
+ "manual",
562
+ "sync",
563
+ "blueprint_install"
564
+ ],
565
+ "default": "manual",
566
+ "description": "What initiated this snapshot. `scheduled` may be added in a later\nphase for nightly backups (RFC OQ #3).\n"
567
+ },
568
+ "blueprint_instance_id": {
569
+ "type": "string",
570
+ "description": "Required iff `trigger === 'blueprint_install'`; forbidden otherwise.\nIdentifies the destination blueprint instance whose install this\nsnapshot covers. Used at restore time as the join key for the\nlineage-driven delete sweep.\n"
571
+ },
572
+ "resources": {
573
+ "type": "array",
574
+ "items": {
575
+ "$ref": "#/components/schemas/ResourceRef"
576
+ },
577
+ "description": "List of resources to capture. Required non-empty for\n`trigger === 'manual'` or `'sync'`. May be empty when\n`trigger === 'blueprint_install'` — an install with no\nresources to overwrite still needs a snapshot row so the\nblueprint-manifest-api restore endpoint can find it.\n"
578
+ }
579
+ }
580
+ },
581
+ "CreateSnapshotResponse": {
582
+ "type": "object",
583
+ "required": [
584
+ "id",
585
+ "name",
586
+ "status",
587
+ "created_at"
588
+ ],
589
+ "properties": {
590
+ "id": {
591
+ "type": "string"
592
+ },
593
+ "name": {
594
+ "type": "string"
595
+ },
596
+ "status": {
597
+ "type": "string",
598
+ "enum": [
599
+ "creating"
600
+ ]
601
+ },
602
+ "created_at": {
603
+ "type": "string",
604
+ "format": "date-time"
605
+ }
606
+ }
607
+ },
608
+ "RestoreSnapshotRequest": {
609
+ "type": "object",
610
+ "properties": {
611
+ "mode": {
612
+ "type": "string",
613
+ "enum": [
614
+ "overwrite",
615
+ "preserve_edits"
616
+ ],
617
+ "default": "overwrite",
618
+ "description": "How to handle destination resources whose content has been modified\nsince the snapshot was captured:\n\n- `overwrite` (default) — apply every captured payload regardless\n of current destination state. Matches the manual-restore\n semantics Config Hub relies on.\n- `preserve_edits` — for each captured resource, compare the live\n destination payload's fingerprint against the install-time\n fingerprint on lineage. If modified, skip and surface the\n entry under `Operation.skipped`. Also skips co-owned resources\n (lineage row carrying ≥2 distinct blueprint_instance_ids).\n Used by blueprint-manifest-api when reverting a blueprint\n install so user edits and other blueprints' contributions\n survive.\n"
619
+ }
620
+ }
621
+ },
622
+ "RestoreSnapshotResponse": {
623
+ "type": "object",
624
+ "required": [
625
+ "id",
626
+ "status"
627
+ ],
628
+ "properties": {
629
+ "id": {
630
+ "type": "string"
631
+ },
632
+ "status": {
633
+ "type": "string",
634
+ "enum": [
635
+ "restoring"
636
+ ]
637
+ }
638
+ }
639
+ },
640
+ "Snapshot": {
641
+ "type": "object",
642
+ "required": [
643
+ "id",
644
+ "org_id",
645
+ "name",
646
+ "trigger",
647
+ "resource_counts",
648
+ "create",
649
+ "restores"
650
+ ],
651
+ "properties": {
652
+ "id": {
653
+ "type": "string"
654
+ },
655
+ "org_id": {
656
+ "type": "string"
657
+ },
658
+ "name": {
659
+ "type": "string"
660
+ },
661
+ "description": {
662
+ "type": "string"
663
+ },
664
+ "trigger": {
665
+ "type": "string",
666
+ "enum": [
667
+ "manual",
668
+ "sync",
669
+ "blueprint_install"
670
+ ]
671
+ },
672
+ "blueprint_instance_id": {
673
+ "type": "string",
674
+ "description": "Set iff `trigger === 'blueprint_install'`. The destination blueprint\ninstance this snapshot covers.\n"
675
+ },
676
+ "resource_counts": {
677
+ "type": "object",
678
+ "additionalProperties": {
679
+ "type": "integer"
680
+ },
681
+ "description": "Resource type → count of resources of that type in the snapshot."
682
+ },
683
+ "create": {
684
+ "$ref": "#/components/schemas/Operation"
685
+ },
686
+ "restores": {
687
+ "type": "array",
688
+ "items": {
689
+ "$ref": "#/components/schemas/Operation"
690
+ }
691
+ },
692
+ "matched_count": {
693
+ "type": "integer",
694
+ "description": "Number of `resource` filter pairs from the request that are\ncontained in this snapshot. Present only on `listSnapshots`\nresponses where the caller passed at least one `resource`\nfilter — absent on `getSnapshot` and on unfiltered list calls.\nDrives the coverage badge in Config Hub's snapshot picker.\n"
695
+ }
696
+ }
697
+ },
698
+ "Operation": {
699
+ "type": "object",
700
+ "required": [
701
+ "type",
702
+ "started_at",
703
+ "status",
704
+ "triggered_by"
705
+ ],
706
+ "properties": {
707
+ "type": {
708
+ "type": "string",
709
+ "enum": [
710
+ "create",
711
+ "restore"
712
+ ]
713
+ },
714
+ "started_at": {
715
+ "type": "string",
716
+ "format": "date-time"
717
+ },
718
+ "completed_at": {
719
+ "type": "string",
720
+ "format": "date-time"
721
+ },
722
+ "status": {
723
+ "type": "string",
724
+ "enum": [
725
+ "in_progress",
726
+ "completed",
727
+ "partial",
728
+ "failed"
729
+ ],
730
+ "description": "`partial` indicates the operation completed but skipped at least\none resource — see `skipped`. Only populated by restores triggered\nwith `mode: 'preserve_edits'`.\n"
731
+ },
732
+ "error": {
733
+ "type": "string"
734
+ },
735
+ "triggered_by": {
736
+ "$ref": "#/components/schemas/CallerIdentity"
737
+ },
738
+ "skipped": {
739
+ "type": "array",
740
+ "description": "Per-resource skips, populated only for restores triggered with\n`mode: 'preserve_edits'`. Empty / absent for Config Hub's\ndefault overwrite-mode restores.\n",
741
+ "items": {
742
+ "$ref": "#/components/schemas/SkippedResource"
743
+ }
744
+ }
745
+ }
746
+ },
747
+ "SkippedResource": {
748
+ "type": "object",
749
+ "required": [
750
+ "lineage_id",
751
+ "reason"
752
+ ],
753
+ "properties": {
754
+ "lineage_id": {
755
+ "type": "string"
756
+ },
757
+ "reason": {
758
+ "type": "string",
759
+ "enum": [
760
+ "modified",
761
+ "co_owned"
762
+ ],
763
+ "description": "- `modified` — current destination payload's fingerprint differs\n from the install-time fingerprint on the lineage row.\n- `co_owned` — lineage row has ≥2 distinct\n `blueprint_instance_ids`; restoring would unilaterally affect\n another blueprint instance's contribution.\n"
764
+ }
765
+ }
766
+ },
767
+ "CallerIdentity": {
768
+ "type": "object",
769
+ "required": [
770
+ "name"
771
+ ],
772
+ "properties": {
773
+ "name": {
774
+ "type": "string"
775
+ },
776
+ "user_id": {
777
+ "type": "string"
778
+ },
779
+ "token_id": {
780
+ "type": "string"
781
+ }
782
+ }
783
+ }
784
+ }
785
+ }
786
+ }