@epilot/sdk 2.8.2 → 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 (145) hide show
  1. package/README.md +1 -0
  2. package/definitions/snapshot-runtime.json +1 -0
  3. package/definitions/snapshot.json +734 -0
  4. package/definitions/user-runtime.json +1 -1
  5. package/definitions/user.json +441 -0
  6. package/dist/{_index-DB2VV4PQ.cjs → _index-D5TTZP5F.cjs} +4 -1
  7. package/dist/{_index-5FB6F5YY.js → _index-UY46ZN47.js} +3 -0
  8. package/dist/apis/access-token.cjs +6 -6
  9. package/dist/apis/access-token.js +1 -1
  10. package/dist/apis/address-suggestions.cjs +6 -6
  11. package/dist/apis/address-suggestions.js +1 -1
  12. package/dist/apis/address.cjs +6 -6
  13. package/dist/apis/address.js +1 -1
  14. package/dist/apis/ai-agents.cjs +6 -6
  15. package/dist/apis/ai-agents.js +1 -1
  16. package/dist/apis/app.cjs +6 -6
  17. package/dist/apis/app.js +1 -1
  18. package/dist/apis/audit-logs.cjs +6 -6
  19. package/dist/apis/audit-logs.js +1 -1
  20. package/dist/apis/automation.cjs +6 -6
  21. package/dist/apis/automation.js +1 -1
  22. package/dist/apis/billing.cjs +6 -6
  23. package/dist/apis/billing.js +1 -1
  24. package/dist/apis/blueprint-manifest.cjs +6 -6
  25. package/dist/apis/blueprint-manifest.js +1 -1
  26. package/dist/apis/calendar.cjs +6 -6
  27. package/dist/apis/calendar.js +1 -1
  28. package/dist/apis/configuration-hub.cjs +6 -6
  29. package/dist/apis/configuration-hub.js +1 -1
  30. package/dist/apis/consent.cjs +6 -6
  31. package/dist/apis/consent.js +1 -1
  32. package/dist/apis/customer-portal.cjs +6 -6
  33. package/dist/apis/customer-portal.js +1 -1
  34. package/dist/apis/dashboard.cjs +6 -6
  35. package/dist/apis/dashboard.js +1 -1
  36. package/dist/apis/data-governance.cjs +6 -6
  37. package/dist/apis/data-governance.js +1 -1
  38. package/dist/apis/deduplication.cjs +6 -6
  39. package/dist/apis/deduplication.js +1 -1
  40. package/dist/apis/design.cjs +6 -6
  41. package/dist/apis/design.js +1 -1
  42. package/dist/apis/document.cjs +6 -6
  43. package/dist/apis/document.js +1 -1
  44. package/dist/apis/email-settings.cjs +6 -6
  45. package/dist/apis/email-settings.js +1 -1
  46. package/dist/apis/email-template.cjs +6 -6
  47. package/dist/apis/email-template.js +1 -1
  48. package/dist/apis/entity-mapping.cjs +6 -6
  49. package/dist/apis/entity-mapping.js +1 -1
  50. package/dist/apis/entity.cjs +6 -6
  51. package/dist/apis/entity.js +1 -1
  52. package/dist/apis/environments.cjs +6 -6
  53. package/dist/apis/environments.js +1 -1
  54. package/dist/apis/event-catalog.cjs +6 -6
  55. package/dist/apis/event-catalog.js +1 -1
  56. package/dist/apis/file.cjs +6 -6
  57. package/dist/apis/file.js +1 -1
  58. package/dist/apis/iban.cjs +6 -6
  59. package/dist/apis/iban.js +1 -1
  60. package/dist/apis/integration-toolkit.cjs +6 -6
  61. package/dist/apis/integration-toolkit.js +1 -1
  62. package/dist/apis/journey.cjs +6 -6
  63. package/dist/apis/journey.js +1 -1
  64. package/dist/apis/kanban.cjs +6 -6
  65. package/dist/apis/kanban.js +1 -1
  66. package/dist/apis/message.cjs +6 -6
  67. package/dist/apis/message.js +1 -1
  68. package/dist/apis/metering.cjs +6 -6
  69. package/dist/apis/metering.js +1 -1
  70. package/dist/apis/notes.cjs +6 -6
  71. package/dist/apis/notes.js +1 -1
  72. package/dist/apis/notification.cjs +6 -6
  73. package/dist/apis/notification.js +1 -1
  74. package/dist/apis/organization.cjs +6 -6
  75. package/dist/apis/organization.js +1 -1
  76. package/dist/apis/partner-directory.cjs +6 -6
  77. package/dist/apis/partner-directory.js +1 -1
  78. package/dist/apis/permissions.cjs +6 -6
  79. package/dist/apis/permissions.js +1 -1
  80. package/dist/apis/pricing-tier.cjs +6 -6
  81. package/dist/apis/pricing-tier.js +1 -1
  82. package/dist/apis/pricing.cjs +6 -6
  83. package/dist/apis/pricing.js +1 -1
  84. package/dist/apis/purpose.cjs +6 -6
  85. package/dist/apis/purpose.js +1 -1
  86. package/dist/apis/query.cjs +6 -6
  87. package/dist/apis/query.js +1 -1
  88. package/dist/apis/sandbox.cjs +6 -6
  89. package/dist/apis/sandbox.js +1 -1
  90. package/dist/apis/sharing.cjs +6 -6
  91. package/dist/apis/sharing.js +1 -1
  92. package/dist/apis/snapshot.cjs +38 -0
  93. package/dist/apis/snapshot.d.cts +18 -0
  94. package/dist/apis/snapshot.d.ts +18 -0
  95. package/dist/apis/snapshot.js +38 -0
  96. package/dist/apis/submission.cjs +6 -6
  97. package/dist/apis/submission.js +1 -1
  98. package/dist/apis/target.cjs +6 -6
  99. package/dist/apis/target.js +1 -1
  100. package/dist/apis/targeting.cjs +6 -6
  101. package/dist/apis/targeting.js +1 -1
  102. package/dist/apis/template-variables.cjs +6 -6
  103. package/dist/apis/template-variables.js +1 -1
  104. package/dist/apis/user.cjs +8 -8
  105. package/dist/apis/user.d.cts +2 -2
  106. package/dist/apis/user.d.ts +2 -2
  107. package/dist/apis/user.js +2 -2
  108. package/dist/apis/validation-rules.cjs +6 -6
  109. package/dist/apis/validation-rules.js +1 -1
  110. package/dist/apis/webhooks.cjs +6 -6
  111. package/dist/apis/webhooks.js +1 -1
  112. package/dist/apis/workflow-definition.cjs +6 -6
  113. package/dist/apis/workflow-definition.js +1 -1
  114. package/dist/apis/workflow.cjs +6 -6
  115. package/dist/apis/workflow.js +1 -1
  116. package/dist/{chunk-MVY54TDV.js → chunk-76M3RIDP.js} +5 -3
  117. package/dist/chunk-BJGLY4Z2.js +14 -0
  118. package/dist/{chunk-3IOUJMDV.cjs → chunk-FBQ4WDTG.cjs} +5 -3
  119. package/dist/chunk-K2QVMO5M.cjs +14 -0
  120. package/dist/chunk-NFIYEMMM.js +14 -0
  121. package/dist/chunk-OWXEZ56F.cjs +14 -0
  122. package/dist/index.cjs +20 -12
  123. package/dist/index.d.cts +18 -16
  124. package/dist/index.d.ts +18 -16
  125. package/dist/index.js +12 -4
  126. package/dist/snapshot-427N6KCO.js +7 -0
  127. package/dist/snapshot-NEMUND3M.cjs +7 -0
  128. package/dist/snapshot-runtime-ALPJLXVW.js +5 -0
  129. package/dist/snapshot-runtime-NWQYU5UK.cjs +5 -0
  130. package/dist/snapshot.d-DvoJ2n-v.d.cts +591 -0
  131. package/dist/snapshot.d-DvoJ2n-v.d.ts +591 -0
  132. package/dist/user-3SLAEEVD.cjs +7 -0
  133. package/dist/user-PRUYBXQV.js +7 -0
  134. package/dist/{user-runtime-U4HYUWJU.js → user-runtime-6ICV2Y73.js} +1 -1
  135. package/dist/user-runtime-Y3227ETX.cjs +5 -0
  136. package/dist/{user.d-D18fe97W.d.cts → user.d-L-C7_K84.d.cts} +421 -1
  137. package/dist/{user.d-D18fe97W.d.ts → user.d-L-C7_K84.d.ts} +421 -1
  138. package/docs/snapshot.md +501 -0
  139. package/docs/user.md +321 -8
  140. package/package.json +10 -1
  141. package/dist/chunk-3XKBB5AE.js +0 -14
  142. package/dist/chunk-Z5TVWG3I.cjs +0 -14
  143. package/dist/user-7ZN2XO7G.cjs +0 -7
  144. package/dist/user-ZK7BK6VY.js +0 -7
  145. package/dist/user-runtime-7O2HLFVQ.cjs +0 -5
@@ -0,0 +1,734 @@
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
+ "maxItems": 50,
102
+ "items": {
103
+ "type": "string",
104
+ "pattern": "^[^:]+:.+$"
105
+ }
106
+ }
107
+ }
108
+ ],
109
+ "responses": {
110
+ "200": {
111
+ "description": "Snapshot list",
112
+ "content": {
113
+ "application/json": {
114
+ "schema": {
115
+ "type": "object",
116
+ "required": [
117
+ "results",
118
+ "page_size"
119
+ ],
120
+ "properties": {
121
+ "page_size": {
122
+ "type": "integer",
123
+ "description": "Number of items in this page (not the total across all pages)."
124
+ },
125
+ "cursor": {
126
+ "type": "string",
127
+ "description": "Pagination cursor; pass to the next request to get the next page."
128
+ },
129
+ "results": {
130
+ "type": "array",
131
+ "items": {
132
+ "$ref": "#/components/schemas/Snapshot"
133
+ }
134
+ }
135
+ }
136
+ }
137
+ }
138
+ }
139
+ },
140
+ "401": {
141
+ "$ref": "#/components/responses/Unauthorized"
142
+ }
143
+ }
144
+ }
145
+ },
146
+ "/v1/snapshots/{id}": {
147
+ "parameters": [
148
+ {
149
+ "in": "path",
150
+ "name": "id",
151
+ "required": true,
152
+ "schema": {
153
+ "type": "string"
154
+ }
155
+ }
156
+ ],
157
+ "get": {
158
+ "operationId": "getSnapshot",
159
+ "summary": "getSnapshot",
160
+ "description": "Fetch a snapshot's metadata. Poll this endpoint to track create/restore progress.",
161
+ "tags": [
162
+ "Snapshots"
163
+ ],
164
+ "responses": {
165
+ "200": {
166
+ "description": "Snapshot metadata",
167
+ "content": {
168
+ "application/json": {
169
+ "schema": {
170
+ "$ref": "#/components/schemas/Snapshot"
171
+ }
172
+ }
173
+ }
174
+ },
175
+ "401": {
176
+ "$ref": "#/components/responses/Unauthorized"
177
+ },
178
+ "404": {
179
+ "$ref": "#/components/responses/NotFound"
180
+ }
181
+ }
182
+ },
183
+ "delete": {
184
+ "operationId": "deleteSnapshot",
185
+ "summary": "deleteSnapshot",
186
+ "description": "Delete a snapshot's metadata and S3 manifest.",
187
+ "tags": [
188
+ "Snapshots"
189
+ ],
190
+ "responses": {
191
+ "204": {
192
+ "description": "Deleted"
193
+ },
194
+ "401": {
195
+ "$ref": "#/components/responses/Unauthorized"
196
+ },
197
+ "404": {
198
+ "$ref": "#/components/responses/NotFound"
199
+ }
200
+ }
201
+ }
202
+ },
203
+ "/v1/snapshots/{id}:restore": {
204
+ "parameters": [
205
+ {
206
+ "in": "path",
207
+ "name": "id",
208
+ "required": true,
209
+ "schema": {
210
+ "type": "string"
211
+ }
212
+ }
213
+ ],
214
+ "post": {
215
+ "operationId": "restoreSnapshot",
216
+ "summary": "restoreSnapshot",
217
+ "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 `completed` or `failed`.\n\nv1: full restore only. Cherry-pick (`resources?` body filter) is an open\nquestion — see RFC OQ #1.\n",
218
+ "tags": [
219
+ "Snapshots"
220
+ ],
221
+ "responses": {
222
+ "202": {
223
+ "description": "Restore started",
224
+ "content": {
225
+ "application/json": {
226
+ "schema": {
227
+ "$ref": "#/components/schemas/RestoreSnapshotResponse"
228
+ }
229
+ }
230
+ }
231
+ },
232
+ "401": {
233
+ "$ref": "#/components/responses/Unauthorized"
234
+ },
235
+ "404": {
236
+ "$ref": "#/components/responses/NotFound"
237
+ }
238
+ }
239
+ }
240
+ },
241
+ "/v1/snapshots/{id}/resources": {
242
+ "parameters": [
243
+ {
244
+ "in": "path",
245
+ "name": "id",
246
+ "required": true,
247
+ "schema": {
248
+ "type": "string"
249
+ }
250
+ }
251
+ ],
252
+ "get": {
253
+ "operationId": "listSnapshotResources",
254
+ "summary": "listSnapshotResources",
255
+ "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",
256
+ "tags": [
257
+ "Snapshots"
258
+ ],
259
+ "responses": {
260
+ "200": {
261
+ "description": "Captured resources",
262
+ "content": {
263
+ "application/json": {
264
+ "schema": {
265
+ "$ref": "#/components/schemas/SnapshotResourceList"
266
+ }
267
+ }
268
+ }
269
+ },
270
+ "401": {
271
+ "$ref": "#/components/responses/Unauthorized"
272
+ },
273
+ "404": {
274
+ "$ref": "#/components/responses/NotFound"
275
+ }
276
+ }
277
+ }
278
+ },
279
+ "/v1/snapshots/{id}/resources/{lineage_id}": {
280
+ "parameters": [
281
+ {
282
+ "in": "path",
283
+ "name": "id",
284
+ "required": true,
285
+ "schema": {
286
+ "type": "string"
287
+ }
288
+ },
289
+ {
290
+ "in": "path",
291
+ "name": "lineage_id",
292
+ "required": true,
293
+ "schema": {
294
+ "type": "string"
295
+ }
296
+ }
297
+ ],
298
+ "get": {
299
+ "operationId": "getSnapshotResource",
300
+ "summary": "getSnapshotResource",
301
+ "description": "Fetch one captured resource with its full payload. For UI views\nthat diff the captured state against the current destination.\n",
302
+ "tags": [
303
+ "Snapshots"
304
+ ],
305
+ "responses": {
306
+ "200": {
307
+ "description": "Captured resource with payload",
308
+ "content": {
309
+ "application/json": {
310
+ "schema": {
311
+ "$ref": "#/components/schemas/SnapshotResourceDetail"
312
+ }
313
+ }
314
+ }
315
+ },
316
+ "401": {
317
+ "$ref": "#/components/responses/Unauthorized"
318
+ },
319
+ "404": {
320
+ "$ref": "#/components/responses/NotFound"
321
+ }
322
+ }
323
+ }
324
+ },
325
+ "/v1/snapshots:list-dependencies": {
326
+ "post": {
327
+ "operationId": "listDependencies",
328
+ "summary": "listDependencies",
329
+ "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",
330
+ "tags": [
331
+ "Snapshots"
332
+ ],
333
+ "requestBody": {
334
+ "required": true,
335
+ "content": {
336
+ "application/json": {
337
+ "schema": {
338
+ "type": "object",
339
+ "required": [
340
+ "resources"
341
+ ],
342
+ "properties": {
343
+ "resources": {
344
+ "type": "array",
345
+ "items": {
346
+ "$ref": "#/components/schemas/ResourceRef"
347
+ }
348
+ }
349
+ }
350
+ }
351
+ }
352
+ }
353
+ },
354
+ "responses": {
355
+ "200": {
356
+ "description": "Transitive dependency closure for the given resources, topologically sorted.",
357
+ "content": {
358
+ "application/json": {
359
+ "schema": {
360
+ "type": "object",
361
+ "required": [
362
+ "dependencies"
363
+ ],
364
+ "properties": {
365
+ "dependencies": {
366
+ "type": "array",
367
+ "items": {
368
+ "$ref": "#/components/schemas/ResourceRef"
369
+ }
370
+ }
371
+ }
372
+ }
373
+ }
374
+ }
375
+ },
376
+ "401": {
377
+ "$ref": "#/components/responses/Unauthorized"
378
+ },
379
+ "501": {
380
+ "description": "Not implemented",
381
+ "content": {
382
+ "application/json": {
383
+ "schema": {
384
+ "$ref": "#/components/schemas/Error"
385
+ }
386
+ }
387
+ }
388
+ }
389
+ }
390
+ }
391
+ }
392
+ },
393
+ "components": {
394
+ "securitySchemes": {
395
+ "EpilotAuth": {
396
+ "type": "apiKey",
397
+ "in": "header",
398
+ "name": "Authorization"
399
+ }
400
+ },
401
+ "responses": {
402
+ "BadRequest": {
403
+ "description": "Bad request",
404
+ "content": {
405
+ "application/json": {
406
+ "schema": {
407
+ "$ref": "#/components/schemas/Error"
408
+ }
409
+ }
410
+ }
411
+ },
412
+ "Unauthorized": {
413
+ "description": "Unauthorized",
414
+ "content": {
415
+ "application/json": {
416
+ "schema": {
417
+ "$ref": "#/components/schemas/Error"
418
+ }
419
+ }
420
+ }
421
+ },
422
+ "NotFound": {
423
+ "description": "Not found",
424
+ "content": {
425
+ "application/json": {
426
+ "schema": {
427
+ "$ref": "#/components/schemas/Error"
428
+ }
429
+ }
430
+ }
431
+ }
432
+ },
433
+ "schemas": {
434
+ "Error": {
435
+ "type": "object",
436
+ "required": [
437
+ "status",
438
+ "error"
439
+ ],
440
+ "properties": {
441
+ "status": {
442
+ "type": "integer"
443
+ },
444
+ "error": {
445
+ "type": "string"
446
+ }
447
+ }
448
+ },
449
+ "ResourceRef": {
450
+ "type": "object",
451
+ "required": [
452
+ "type",
453
+ "id"
454
+ ],
455
+ "properties": {
456
+ "type": {
457
+ "type": "string",
458
+ "description": "Resource type (e.g., custom_variable, journey, automation_flow)"
459
+ },
460
+ "id": {
461
+ "type": "string"
462
+ }
463
+ }
464
+ },
465
+ "SnapshotResourceSummary": {
466
+ "type": "object",
467
+ "description": "Lightweight identity for a captured resource. Returned by\n`listSnapshotResources`; the full payload is fetched separately via\n`getSnapshotResource` when needed.\n",
468
+ "required": [
469
+ "lineage_id",
470
+ "target_id",
471
+ "type"
472
+ ],
473
+ "properties": {
474
+ "lineage_id": {
475
+ "type": "string",
476
+ "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"
477
+ },
478
+ "target_id": {
479
+ "type": "string",
480
+ "description": "Identifier the resource was captured by (passed in via `ResourceRef.id` on createSnapshot)."
481
+ },
482
+ "type": {
483
+ "type": "string"
484
+ },
485
+ "name": {
486
+ "type": "string",
487
+ "nullable": true,
488
+ "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"
489
+ }
490
+ }
491
+ },
492
+ "SnapshotResourceList": {
493
+ "type": "object",
494
+ "required": [
495
+ "resources"
496
+ ],
497
+ "properties": {
498
+ "resources": {
499
+ "type": "array",
500
+ "items": {
501
+ "$ref": "#/components/schemas/SnapshotResourceSummary"
502
+ }
503
+ }
504
+ }
505
+ },
506
+ "SnapshotResourceDetail": {
507
+ "type": "object",
508
+ "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",
509
+ "required": [
510
+ "lineage_id",
511
+ "target_id",
512
+ "type",
513
+ "captured"
514
+ ],
515
+ "properties": {
516
+ "lineage_id": {
517
+ "type": "string"
518
+ },
519
+ "target_id": {
520
+ "type": "string"
521
+ },
522
+ "type": {
523
+ "type": "string"
524
+ },
525
+ "name": {
526
+ "type": "string",
527
+ "nullable": true
528
+ },
529
+ "captured": {
530
+ "type": "object",
531
+ "additionalProperties": true,
532
+ "description": "Full captured payload of the resource at snapshot time."
533
+ }
534
+ }
535
+ },
536
+ "CreateSnapshotRequest": {
537
+ "type": "object",
538
+ "required": [
539
+ "name",
540
+ "resources"
541
+ ],
542
+ "properties": {
543
+ "name": {
544
+ "type": "string"
545
+ },
546
+ "description": {
547
+ "type": "string"
548
+ },
549
+ "trigger": {
550
+ "type": "string",
551
+ "enum": [
552
+ "manual",
553
+ "sync",
554
+ "blueprint_install"
555
+ ],
556
+ "default": "manual",
557
+ "description": "What initiated this snapshot. `scheduled` may be added in a later\nphase for nightly backups (RFC OQ #3).\n"
558
+ },
559
+ "blueprint_instance_id": {
560
+ "type": "string",
561
+ "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"
562
+ },
563
+ "resources": {
564
+ "type": "array",
565
+ "items": {
566
+ "$ref": "#/components/schemas/ResourceRef"
567
+ },
568
+ "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"
569
+ }
570
+ }
571
+ },
572
+ "CreateSnapshotResponse": {
573
+ "type": "object",
574
+ "required": [
575
+ "id",
576
+ "name",
577
+ "status",
578
+ "created_at"
579
+ ],
580
+ "properties": {
581
+ "id": {
582
+ "type": "string"
583
+ },
584
+ "name": {
585
+ "type": "string"
586
+ },
587
+ "status": {
588
+ "type": "string",
589
+ "enum": [
590
+ "creating"
591
+ ]
592
+ },
593
+ "created_at": {
594
+ "type": "string",
595
+ "format": "date-time"
596
+ }
597
+ }
598
+ },
599
+ "RestoreSnapshotResponse": {
600
+ "type": "object",
601
+ "required": [
602
+ "id",
603
+ "status"
604
+ ],
605
+ "properties": {
606
+ "id": {
607
+ "type": "string"
608
+ },
609
+ "status": {
610
+ "type": "string",
611
+ "enum": [
612
+ "restoring"
613
+ ]
614
+ }
615
+ }
616
+ },
617
+ "Snapshot": {
618
+ "type": "object",
619
+ "required": [
620
+ "id",
621
+ "org_id",
622
+ "name",
623
+ "trigger",
624
+ "resource_counts",
625
+ "create",
626
+ "restores"
627
+ ],
628
+ "properties": {
629
+ "id": {
630
+ "type": "string"
631
+ },
632
+ "org_id": {
633
+ "type": "string"
634
+ },
635
+ "name": {
636
+ "type": "string"
637
+ },
638
+ "description": {
639
+ "type": "string"
640
+ },
641
+ "trigger": {
642
+ "type": "string",
643
+ "enum": [
644
+ "manual",
645
+ "sync",
646
+ "blueprint_install"
647
+ ]
648
+ },
649
+ "blueprint_instance_id": {
650
+ "type": "string",
651
+ "description": "Set iff `trigger === 'blueprint_install'`. The destination blueprint\ninstance this snapshot covers.\n"
652
+ },
653
+ "resource_counts": {
654
+ "type": "object",
655
+ "additionalProperties": {
656
+ "type": "integer"
657
+ },
658
+ "description": "Resource type → count of resources of that type in the snapshot."
659
+ },
660
+ "create": {
661
+ "$ref": "#/components/schemas/Operation"
662
+ },
663
+ "restores": {
664
+ "type": "array",
665
+ "items": {
666
+ "$ref": "#/components/schemas/Operation"
667
+ }
668
+ },
669
+ "matched_count": {
670
+ "type": "integer",
671
+ "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"
672
+ }
673
+ }
674
+ },
675
+ "Operation": {
676
+ "type": "object",
677
+ "required": [
678
+ "type",
679
+ "started_at",
680
+ "status",
681
+ "triggered_by"
682
+ ],
683
+ "properties": {
684
+ "type": {
685
+ "type": "string",
686
+ "enum": [
687
+ "create",
688
+ "restore"
689
+ ]
690
+ },
691
+ "started_at": {
692
+ "type": "string",
693
+ "format": "date-time"
694
+ },
695
+ "completed_at": {
696
+ "type": "string",
697
+ "format": "date-time"
698
+ },
699
+ "status": {
700
+ "type": "string",
701
+ "enum": [
702
+ "in_progress",
703
+ "completed",
704
+ "failed"
705
+ ]
706
+ },
707
+ "error": {
708
+ "type": "string"
709
+ },
710
+ "triggered_by": {
711
+ "$ref": "#/components/schemas/CallerIdentity"
712
+ }
713
+ }
714
+ },
715
+ "CallerIdentity": {
716
+ "type": "object",
717
+ "required": [
718
+ "name"
719
+ ],
720
+ "properties": {
721
+ "name": {
722
+ "type": "string"
723
+ },
724
+ "user_id": {
725
+ "type": "string"
726
+ },
727
+ "token_id": {
728
+ "type": "string"
729
+ }
730
+ }
731
+ }
732
+ }
733
+ }
734
+ }