@executioncontrolprotocol/adobe-firefly-services 0.14.0 → 0.60.0

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 (280) hide show
  1. package/README.md +113 -84
  2. package/dist/auth/ims.d.ts +47 -14
  3. package/dist/auth/ims.d.ts.map +1 -1
  4. package/dist/auth/ims.js +127 -26
  5. package/dist/auth/ims.js.map +1 -1
  6. package/dist/config.d.ts +27 -0
  7. package/dist/config.d.ts.map +1 -0
  8. package/dist/config.js +51 -0
  9. package/dist/config.js.map +1 -0
  10. package/dist/errors.d.ts +42 -0
  11. package/dist/errors.d.ts.map +1 -0
  12. package/dist/errors.js +53 -0
  13. package/dist/errors.js.map +1 -0
  14. package/dist/generated/audio-video/capabilities.d.ts +21 -36
  15. package/dist/generated/audio-video/capabilities.d.ts.map +1 -1
  16. package/dist/generated/audio-video/capabilities.js +295 -259
  17. package/dist/generated/audio-video/capabilities.js.map +1 -1
  18. package/dist/generated/audio-video/operations.d.ts +13 -0
  19. package/dist/generated/audio-video/operations.d.ts.map +1 -0
  20. package/dist/generated/audio-video/operations.js +182 -0
  21. package/dist/generated/audio-video/operations.js.map +1 -0
  22. package/dist/generated/audio-video/schemas.d.ts +245 -82
  23. package/dist/generated/audio-video/schemas.d.ts.map +1 -1
  24. package/dist/generated/audio-video/schemas.js +552 -466
  25. package/dist/generated/audio-video/schemas.js.map +1 -1
  26. package/dist/generated/creative-production/capabilities.d.ts +10 -10
  27. package/dist/generated/creative-production/capabilities.d.ts.map +1 -1
  28. package/dist/generated/creative-production/capabilities.js +64 -77
  29. package/dist/generated/creative-production/capabilities.js.map +1 -1
  30. package/dist/generated/creative-production/operations.d.ts +13 -0
  31. package/dist/generated/creative-production/operations.d.ts.map +1 -0
  32. package/dist/generated/creative-production/operations.js +48 -0
  33. package/dist/generated/creative-production/operations.js.map +1 -0
  34. package/dist/generated/creative-production/schemas.d.ts +65 -21
  35. package/dist/generated/creative-production/schemas.d.ts.map +1 -1
  36. package/dist/generated/creative-production/schemas.js +149 -128
  37. package/dist/generated/creative-production/schemas.js.map +1 -1
  38. package/dist/generated/express/capabilities.d.ts +11 -10
  39. package/dist/generated/express/capabilities.d.ts.map +1 -1
  40. package/dist/generated/express/capabilities.js +65 -64
  41. package/dist/generated/express/capabilities.js.map +1 -1
  42. package/dist/generated/express/operations.d.ts +13 -0
  43. package/dist/generated/express/operations.d.ts.map +1 -0
  44. package/dist/generated/express/operations.js +58 -0
  45. package/dist/generated/express/operations.js.map +1 -0
  46. package/dist/generated/express/schemas.d.ts +100 -34
  47. package/dist/generated/express/schemas.d.ts.map +1 -1
  48. package/dist/generated/express/schemas.js +165 -134
  49. package/dist/generated/express/schemas.js.map +1 -1
  50. package/dist/generated/firefly/capabilities.d.ts +18 -28
  51. package/dist/generated/firefly/capabilities.d.ts.map +1 -1
  52. package/dist/generated/firefly/capabilities.js +289 -172
  53. package/dist/generated/firefly/capabilities.js.map +1 -1
  54. package/dist/generated/firefly/operations.d.ts +13 -0
  55. package/dist/generated/firefly/operations.d.ts.map +1 -0
  56. package/dist/generated/firefly/operations.js +145 -0
  57. package/dist/generated/firefly/operations.js.map +1 -0
  58. package/dist/generated/firefly/schemas.d.ts +250 -105
  59. package/dist/generated/firefly/schemas.d.ts.map +1 -1
  60. package/dist/generated/firefly/schemas.js +462 -451
  61. package/dist/generated/firefly/schemas.js.map +1 -1
  62. package/dist/generated/illustrator/capabilities.d.ts +11 -16
  63. package/dist/generated/illustrator/capabilities.d.ts.map +1 -1
  64. package/dist/generated/illustrator/capabilities.js +99 -100
  65. package/dist/generated/illustrator/capabilities.js.map +1 -1
  66. package/dist/generated/illustrator/operations.d.ts +13 -0
  67. package/dist/generated/illustrator/operations.d.ts.map +1 -0
  68. package/dist/generated/illustrator/operations.js +65 -0
  69. package/dist/generated/illustrator/operations.js.map +1 -0
  70. package/dist/generated/illustrator/schemas.d.ts +85 -54
  71. package/dist/generated/illustrator/schemas.d.ts.map +1 -1
  72. package/dist/generated/illustrator/schemas.js +187 -233
  73. package/dist/generated/illustrator/schemas.js.map +1 -1
  74. package/dist/generated/indesign/capabilities.d.ts +19 -32
  75. package/dist/generated/indesign/capabilities.d.ts.map +1 -1
  76. package/dist/generated/indesign/capabilities.js +394 -197
  77. package/dist/generated/indesign/capabilities.js.map +1 -1
  78. package/dist/generated/indesign/operations.d.ts +13 -0
  79. package/dist/generated/indesign/operations.d.ts.map +1 -0
  80. package/dist/generated/indesign/operations.js +133 -0
  81. package/dist/generated/indesign/operations.js.map +1 -0
  82. package/dist/generated/indesign/schemas.d.ts +75 -24
  83. package/dist/generated/indesign/schemas.d.ts.map +1 -1
  84. package/dist/generated/indesign/schemas.js +351 -240
  85. package/dist/generated/indesign/schemas.js.map +1 -1
  86. package/dist/generated/index.d.ts +74 -3
  87. package/dist/generated/index.d.ts.map +1 -1
  88. package/dist/generated/index.js +28 -97
  89. package/dist/generated/index.js.map +1 -1
  90. package/dist/generated/photoshop/capabilities.d.ts +13 -14
  91. package/dist/generated/photoshop/capabilities.d.ts.map +1 -1
  92. package/dist/generated/photoshop/capabilities.js +133 -90
  93. package/dist/generated/photoshop/capabilities.js.map +1 -1
  94. package/dist/generated/photoshop/operations.d.ts +13 -0
  95. package/dist/generated/photoshop/operations.d.ts.map +1 -0
  96. package/dist/generated/photoshop/operations.js +88 -0
  97. package/dist/generated/photoshop/operations.js.map +1 -0
  98. package/dist/generated/photoshop/schemas.d.ts +430 -152
  99. package/dist/generated/photoshop/schemas.d.ts.map +1 -1
  100. package/dist/generated/photoshop/schemas.js +809 -716
  101. package/dist/generated/photoshop/schemas.js.map +1 -1
  102. package/dist/generated/substance3d/capabilities.d.ts +16 -22
  103. package/dist/generated/substance3d/capabilities.d.ts.map +1 -1
  104. package/dist/generated/substance3d/capabilities.js +181 -136
  105. package/dist/generated/substance3d/capabilities.js.map +1 -1
  106. package/dist/generated/substance3d/operations.d.ts +13 -0
  107. package/dist/generated/substance3d/operations.d.ts.map +1 -0
  108. package/dist/generated/substance3d/operations.js +114 -0
  109. package/dist/generated/substance3d/operations.js.map +1 -0
  110. package/dist/generated/substance3d/schemas.d.ts +305 -76
  111. package/dist/generated/substance3d/schemas.d.ts.map +1 -1
  112. package/dist/generated/substance3d/schemas.js +634 -515
  113. package/dist/generated/substance3d/schemas.js.map +1 -1
  114. package/dist/http/async-job.d.ts +24 -14
  115. package/dist/http/async-job.d.ts.map +1 -1
  116. package/dist/http/async-job.js +135 -69
  117. package/dist/http/async-job.js.map +1 -1
  118. package/dist/http/client.d.ts +54 -26
  119. package/dist/http/client.d.ts.map +1 -1
  120. package/dist/http/client.js +136 -53
  121. package/dist/http/client.js.map +1 -1
  122. package/dist/http/request-limit.d.ts +42 -0
  123. package/dist/http/request-limit.d.ts.map +1 -0
  124. package/dist/http/request-limit.js +46 -0
  125. package/dist/http/request-limit.js.map +1 -0
  126. package/dist/index.d.ts +84 -30
  127. package/dist/index.d.ts.map +1 -1
  128. package/dist/index.js +20 -34
  129. package/dist/index.js.map +1 -1
  130. package/dist/runtime/abort.d.ts +17 -0
  131. package/dist/runtime/abort.d.ts.map +1 -0
  132. package/dist/runtime/abort.js +51 -0
  133. package/dist/runtime/abort.js.map +1 -0
  134. package/dist/runtime/assemble.d.ts +99 -0
  135. package/dist/runtime/assemble.d.ts.map +1 -0
  136. package/dist/runtime/assemble.js +159 -0
  137. package/dist/runtime/assemble.js.map +1 -0
  138. package/dist/runtime/invoke-capability.d.ts +46 -0
  139. package/dist/runtime/invoke-capability.d.ts.map +1 -0
  140. package/dist/runtime/invoke-capability.js +68 -0
  141. package/dist/runtime/invoke-capability.js.map +1 -0
  142. package/dist/runtime/product-shape.d.ts +49 -0
  143. package/dist/runtime/product-shape.d.ts.map +1 -0
  144. package/dist/runtime/product-shape.js +309 -0
  145. package/dist/runtime/product-shape.js.map +1 -0
  146. package/dist/schemas.d.ts +13 -0
  147. package/dist/schemas.d.ts.map +1 -0
  148. package/dist/schemas.js +7 -0
  149. package/dist/schemas.js.map +1 -0
  150. package/ecp.manifest.json +840 -0
  151. package/ecp.schema.json +23498 -0
  152. package/package.json +28 -21
  153. package/dist/generated/audio-video/capabilities.browser.d.ts +0 -37
  154. package/dist/generated/audio-video/capabilities.browser.d.ts.map +0 -1
  155. package/dist/generated/audio-video/capabilities.browser.js +0 -44
  156. package/dist/generated/audio-video/capabilities.browser.js.map +0 -1
  157. package/dist/generated/audio-video/index.d.ts +0 -3
  158. package/dist/generated/audio-video/index.d.ts.map +0 -1
  159. package/dist/generated/audio-video/index.js +0 -3
  160. package/dist/generated/audio-video/index.js.map +0 -1
  161. package/dist/generated/audio-video/shells.d.ts +0 -39
  162. package/dist/generated/audio-video/shells.d.ts.map +0 -1
  163. package/dist/generated/audio-video/shells.js +0 -290
  164. package/dist/generated/audio-video/shells.js.map +0 -1
  165. package/dist/generated/creative-production/capabilities.browser.d.ts +0 -11
  166. package/dist/generated/creative-production/capabilities.browser.d.ts.map +0 -1
  167. package/dist/generated/creative-production/capabilities.browser.js +0 -18
  168. package/dist/generated/creative-production/capabilities.browser.js.map +0 -1
  169. package/dist/generated/creative-production/index.d.ts +0 -3
  170. package/dist/generated/creative-production/index.d.ts.map +0 -1
  171. package/dist/generated/creative-production/index.js +0 -3
  172. package/dist/generated/creative-production/index.js.map +0 -1
  173. package/dist/generated/creative-production/shells.d.ts +0 -13
  174. package/dist/generated/creative-production/shells.d.ts.map +0 -1
  175. package/dist/generated/creative-production/shells.js +0 -108
  176. package/dist/generated/creative-production/shells.js.map +0 -1
  177. package/dist/generated/express/capabilities.browser.d.ts +0 -11
  178. package/dist/generated/express/capabilities.browser.d.ts.map +0 -1
  179. package/dist/generated/express/capabilities.browser.js +0 -18
  180. package/dist/generated/express/capabilities.browser.js.map +0 -1
  181. package/dist/generated/express/index.d.ts +0 -3
  182. package/dist/generated/express/index.d.ts.map +0 -1
  183. package/dist/generated/express/index.js +0 -3
  184. package/dist/generated/express/index.js.map +0 -1
  185. package/dist/generated/express/shells.d.ts +0 -13
  186. package/dist/generated/express/shells.d.ts.map +0 -1
  187. package/dist/generated/express/shells.js +0 -72
  188. package/dist/generated/express/shells.js.map +0 -1
  189. package/dist/generated/firefly/capabilities.browser.d.ts +0 -29
  190. package/dist/generated/firefly/capabilities.browser.d.ts.map +0 -1
  191. package/dist/generated/firefly/capabilities.browser.js +0 -36
  192. package/dist/generated/firefly/capabilities.browser.js.map +0 -1
  193. package/dist/generated/firefly/index.d.ts +0 -3
  194. package/dist/generated/firefly/index.d.ts.map +0 -1
  195. package/dist/generated/firefly/index.js +0 -3
  196. package/dist/generated/firefly/index.js.map +0 -1
  197. package/dist/generated/firefly/shells.d.ts +0 -31
  198. package/dist/generated/firefly/shells.d.ts.map +0 -1
  199. package/dist/generated/firefly/shells.js +0 -199
  200. package/dist/generated/firefly/shells.js.map +0 -1
  201. package/dist/generated/illustrator/capabilities.browser.d.ts +0 -17
  202. package/dist/generated/illustrator/capabilities.browser.d.ts.map +0 -1
  203. package/dist/generated/illustrator/capabilities.browser.js +0 -24
  204. package/dist/generated/illustrator/capabilities.browser.js.map +0 -1
  205. package/dist/generated/illustrator/index.d.ts +0 -3
  206. package/dist/generated/illustrator/index.d.ts.map +0 -1
  207. package/dist/generated/illustrator/index.js +0 -3
  208. package/dist/generated/illustrator/index.js.map +0 -1
  209. package/dist/generated/illustrator/shells.d.ts +0 -19
  210. package/dist/generated/illustrator/shells.d.ts.map +0 -1
  211. package/dist/generated/illustrator/shells.js +0 -106
  212. package/dist/generated/illustrator/shells.js.map +0 -1
  213. package/dist/generated/indesign/capabilities.browser.d.ts +0 -33
  214. package/dist/generated/indesign/capabilities.browser.d.ts.map +0 -1
  215. package/dist/generated/indesign/capabilities.browser.js +0 -40
  216. package/dist/generated/indesign/capabilities.browser.js.map +0 -1
  217. package/dist/generated/indesign/index.d.ts +0 -3
  218. package/dist/generated/indesign/index.d.ts.map +0 -1
  219. package/dist/generated/indesign/index.js +0 -3
  220. package/dist/generated/indesign/index.js.map +0 -1
  221. package/dist/generated/indesign/shells.d.ts +0 -35
  222. package/dist/generated/indesign/shells.d.ts.map +0 -1
  223. package/dist/generated/indesign/shells.js +0 -208
  224. package/dist/generated/indesign/shells.js.map +0 -1
  225. package/dist/generated/index.browser.d.ts +0 -4
  226. package/dist/generated/index.browser.d.ts.map +0 -1
  227. package/dist/generated/index.browser.js +0 -98
  228. package/dist/generated/index.browser.js.map +0 -1
  229. package/dist/generated/photoshop/capabilities.browser.d.ts +0 -15
  230. package/dist/generated/photoshop/capabilities.browser.d.ts.map +0 -1
  231. package/dist/generated/photoshop/capabilities.browser.js +0 -22
  232. package/dist/generated/photoshop/capabilities.browser.js.map +0 -1
  233. package/dist/generated/photoshop/index.d.ts +0 -3
  234. package/dist/generated/photoshop/index.d.ts.map +0 -1
  235. package/dist/generated/photoshop/index.js +0 -3
  236. package/dist/generated/photoshop/index.js.map +0 -1
  237. package/dist/generated/photoshop/shells.d.ts +0 -17
  238. package/dist/generated/photoshop/shells.d.ts.map +0 -1
  239. package/dist/generated/photoshop/shells.js +0 -92
  240. package/dist/generated/photoshop/shells.js.map +0 -1
  241. package/dist/generated/substance3d/capabilities.browser.d.ts +0 -23
  242. package/dist/generated/substance3d/capabilities.browser.d.ts.map +0 -1
  243. package/dist/generated/substance3d/capabilities.browser.js +0 -30
  244. package/dist/generated/substance3d/capabilities.browser.js.map +0 -1
  245. package/dist/generated/substance3d/index.d.ts +0 -3
  246. package/dist/generated/substance3d/index.d.ts.map +0 -1
  247. package/dist/generated/substance3d/index.js +0 -3
  248. package/dist/generated/substance3d/index.js.map +0 -1
  249. package/dist/generated/substance3d/shells.d.ts +0 -25
  250. package/dist/generated/substance3d/shells.d.ts.map +0 -1
  251. package/dist/generated/substance3d/shells.js +0 -146
  252. package/dist/generated/substance3d/shells.js.map +0 -1
  253. package/dist/index.browser.d.ts +0 -19
  254. package/dist/index.browser.d.ts.map +0 -1
  255. package/dist/index.browser.js +0 -27
  256. package/dist/index.browser.js.map +0 -1
  257. package/dist/runtime/invoke.d.ts +0 -67
  258. package/dist/runtime/invoke.d.ts.map +0 -1
  259. package/dist/runtime/invoke.js +0 -69
  260. package/dist/runtime/invoke.js.map +0 -1
  261. package/dist/runtime/photoshop-manifest.d.ts +0 -40
  262. package/dist/runtime/photoshop-manifest.d.ts.map +0 -1
  263. package/dist/runtime/photoshop-manifest.js +0 -115
  264. package/dist/runtime/photoshop-manifest.js.map +0 -1
  265. package/dist/shared.d.ts +0 -11
  266. package/dist/shared.d.ts.map +0 -1
  267. package/dist/shared.js +0 -39
  268. package/dist/shared.js.map +0 -1
  269. package/openapi/audio-video/audio-video-api.json +0 -8333
  270. package/openapi/audio-video/translate-lipsync-openapi.json +0 -1967
  271. package/openapi/content-tagging/SOURCE.md +0 -10
  272. package/openapi/creative-production/workflow-builder-api.yaml +0 -1002
  273. package/openapi/express/ffs-express-api.json +0 -2262
  274. package/openapi/firefly/firefly-api.json +0 -4964
  275. package/openapi/illustrator/illustrator-api-beta.json +0 -1329
  276. package/openapi/illustrator/illustrator-api.json +0 -2447
  277. package/openapi/indesign/indesignapi.json +0 -2907
  278. package/openapi/overlays/schema-fixes.json +0 -95
  279. package/openapi/photoshop/photoshopv2-api.json +0 -5395
  280. package/openapi/substance3d/openapi.yaml +0 -3583
package/README.md CHANGED
@@ -1,98 +1,127 @@
1
- # @executioncontrolprotocol/adobe-firefly-services
1
+ # `@executioncontrolprotocol/adobe-firefly-services`
2
2
 
3
- Adobe Firefly Services extension for ECP. One package exposes **family-prefixed** capabilities generated from vendored OpenAPI specs (Photoshop **v2** only).
3
+ Adobe Firefly Services APIs as ECP capabilities, generated from vendored OpenAPI specs under
4
+ `openapi/`. **63** capabilities ship across eight families (`content-tagging` is skipped — no
5
+ published Firefly Services OpenAPI).
4
6
 
5
- Auth uses current [OAuth Server-to-Server](https://developer.adobe.com/developer-console/docs/guides/authentication/ServerToServerAuthentication/) (`client_credentials`). Bind credentials with `secrets()` / `env()` — not deprecated JWT technical accounts.
7
+ **Entrypoints:** `src/index.ts`, `ecp.manifest.json`, `ecp.schema.json`
6
8
 
7
- Guide index: [Firefly Services docs](https://developer.adobe.com/firefly-services/docs/guides/).
9
+ Used by the A10 localize-banner dogfood (`examples/localize-banner/`).
8
10
 
9
- ## Binding
11
+ ## Request limit
10
12
 
11
- ```ts
12
- import "@executioncontrolprotocol/adobe-firefly-services"
13
- import { environment, extension, secrets } from "@executioncontrolprotocol/node"
13
+ If your credentials allow only so many requests per minute, set `maxRequestsPerMinute` on the config. The plugin
14
+ then spaces job submissions and other non-GET requests (including a retry after HTTP 429) evenly, shared by every
15
+ step and run in the host that uses the same client id, endpoint and limit, so concurrent `forEach` items draw on
16
+ one budget. Job status polls (GET) are not counted; `pollIntervalMs` sets their pace.
14
17
 
15
- export default environment("adobe-demo")
16
- .withExtensions([
17
- extension("@executioncontrolprotocol/secrets").with({}),
18
- extension("@executioncontrolprotocol/adobe-firefly-services").with({
19
- clientId: secrets("adobe-firefly-services/client-id"),
20
- clientSecret: secrets("adobe-firefly-services/client-secret"),
21
- // scopes: optional; defaults to Firefly Services S2S scopes
22
- }),
23
- ])
24
- ```
25
-
26
- ## Families
27
-
28
- | Prefix | Spec (under `openapi/`) | Notes |
29
- | ------ | ----------------------- | ----- |
30
- | `firefly` | `firefly/firefly-api.json` | Generative image/video/etc. |
31
- | `photoshop` | `photoshop/photoshopv2-api.json` | v2 only; absorbs Lightroom-style workflows |
32
- | `express` | `express/ffs-express-api.json` | Express (beta) |
33
- | `indesign` | `indesign/indesignapi.json` | InDesign |
34
- | `substance3d` | `substance3d/openapi.yaml` | Substance 3D |
35
- | `illustrator` | `illustrator/*.json` | GA + beta merged |
36
- | `creative-production` | `creative-production/workflow-builder-api.yaml` | Workflow Builder |
37
- | `audio-video` | `audio-video/*.json` | Audio/Video + translate/lipsync |
38
-
39
- Capability ids: `@executioncontrolprotocol/adobe-firefly-services.<family>-<kebab-operationId>` (single segment after the package; no extra `.`)
40
- Examples:
41
-
42
- - `@executioncontrolprotocol/adobe-firefly-services.firefly-generate-images-v3-async`
43
- - `@executioncontrolprotocol/adobe-firefly-services.firefly-generate-images-v5-async` (Image5)
44
- - `@executioncontrolprotocol/adobe-firefly-services.photoshop-generate-manifest`
45
-
46
- Browser apps import the package root; bundlers resolve `exports["."].browser` to a host-hop catalog (no IMS). Pair `ecp up --env …` for real execution.
47
-
48
- Photoshop v1 and standalone Lightroom OpenAPI are **out of scope** (v2 supersedes them).
49
-
50
- **Content Tagging:** no Firefly Services OpenAPI is published under AdobeDocs `ffs-*` yet — see `openapi/content-tagging/SOURCE.md`. Express tagged-document endpoints live under the `express` family.
51
-
52
- ## Asset URLs via Azure Blob Storage
53
-
54
- Firefly and Photoshop accept allow-listed HTTPS SAS URLs (including Azure `*.windows.net`). Use [`@executioncontrolprotocol/azure-blob-storage`](../azure-blob-storage/) to upload assets and mint read/write SAS URLs, then pass them into Firefly `referenceBlobs` / Photoshop `source.url` via `ref()`. See `examples/azure-adobe-assets/`.
55
-
56
- ## Async capabilities return final results
57
-
58
- Adobe Firefly Services APIs are often **202 async**. This package hides that from
59
- workflows:
60
-
61
- - **Async submit** ops always poll internally via `pollAdobeJob` and return the
62
- **completed** job / product payload (not `jobId` / `statusUrl` accept links).
63
- - Optional `pollIntervalMs` / `pollTimeoutMs` tune the wait; there is no `poll` flag.
64
- - **Status / cancel** caps remain for diagnostics; happy-path workflows should not need them.
65
- - **Sync** caps (list/get metadata) are unchanged.
66
-
67
- `photoshop-generate-manifest` materializes the **PSD manifest JSON** (layer tree)
68
- after the job succeeds so you can `ref("manifest.layers.0.id")` and inspect it with
69
- `ecp test` `runTo`.
70
-
71
- ## Capability input shape
72
-
73
- Generated handlers merge OpenAPI path/query/header/body into:
74
-
75
- ```ts
18
+ ```json
76
19
  {
77
- path?: { ... },
78
- query?: { ... },
79
- headers?: { ... },
80
- body?: { ... },
81
- // async-submit only:
82
- pollIntervalMs?: number,
83
- pollTimeoutMs?: number,
20
+ "schema": "@executioncontrolprotocol.config",
21
+ "version": "1.0",
22
+ "id": "adobe-firefly-services/default",
23
+ "plugin": "@executioncontrolprotocol/adobe-firefly-services",
24
+ "values": {
25
+ "clientId": { "$secret": "adobe-firefly-services/client-id" },
26
+ "clientSecret": { "$secret": "adobe-firefly-services/client-secret" },
27
+ "maxRequestsPerMinute": 4
28
+ }
84
29
  }
85
30
  ```
86
31
 
87
- ## Codegen
32
+ ## Capabilities by family
33
+
34
+ ### audio-video (14)
35
+
36
+ - audio-video-avatars
37
+ - audio-video-dub
38
+ - audio-video-dub-translate-lipsync
39
+ - audio-video-generate-avatar
40
+ - audio-video-generate-reframed-video
41
+ - audio-video-generate-reframed-video-v2
42
+ - audio-video-generate-speech
43
+ - audio-video-get-presets
44
+ - audio-video-list-render-jobs
45
+ - audio-video-template-describe
46
+ - audio-video-template-render
47
+ - audio-video-transcribe
48
+ - audio-video-transcribe-translate-lipsync
49
+ - audio-video-voices
50
+
51
+ ### creative-production (3)
52
+
53
+ - creative-production-batch-execute
54
+ - creative-production-list-batch-executions
55
+ - creative-production-list-batches
56
+
57
+ ### express (4)
58
+
59
+ - express-export-rendition
60
+ - express-generate-variation
61
+ - express-tagged-document-details
62
+ - express-tagged-documents
63
+
64
+ ### firefly (11)
65
+
66
+ - firefly-adaptive-composite
67
+ - firefly-expand-images-v3-async
68
+ - firefly-fill-images-v3-async
69
+ - firefly-generate-images-v3-async
70
+ - firefly-generate-images-v5-async
71
+ - firefly-generate-object-composite-v3-async
72
+ - firefly-generate-similar-images-v3-async
73
+ - firefly-generate-video-v3
74
+ - firefly-get-custom-models
75
+ - firefly-precise-composite
76
+ - firefly-precise-upsampler-v3-async
77
+
78
+ ### illustrator (4)
79
+
80
+ - illustrator-create-rendition
81
+ - illustrator-data-merge
82
+ - illustrator-execute-custom-script-capability
83
+ - illustrator-trace-image
84
+
85
+ ### indesign (12)
86
+
87
+ - indesign-convert-pdfto-in-design
88
+ - indesign-data-merge
89
+ - indesign-data-merge-tags
90
+ - indesign-delete-custom-script
91
+ - indesign-execute-custom-script
92
+ - indesign-get-custom-script-details
93
+ - indesign-get-document-info
94
+ - indesign-list-app-versions
95
+ - indesign-list-custom-scripts
96
+ - indesign-remap-links
97
+ - indesign-rendition-job
98
+ - indesign-update-script-app-version
99
+
100
+ ### photoshop (6)
101
+
102
+ - photoshop-actions
103
+ - photoshop-auto-crop
104
+ - photoshop-create-artboard
105
+ - photoshop-create-composite
106
+ - photoshop-edit
107
+ - photoshop-generate-manifest
108
+
109
+ ### substance3d (9)
110
+
111
+ - substance3d-create-space-from-frame-io-v2
112
+ - substance3d-create-space-from-next-frame-io-v2
113
+ - substance3d-create-space-url-v2
114
+ - substance3d-v1-composites-compose
115
+ - substance3d-v1-scenes-assemble
116
+ - substance3d-v1-scenes-convert
117
+ - substance3d-v1-scenes-describe
118
+ - substance3d-v1-scenes-render
119
+ - substance3d-v1-scenes-render-basic
120
+
121
+ ## Regeneration
88
122
 
89
123
  ```sh
90
- npm run fetch:specs -w @executioncontrolprotocol/adobe-firefly-services # network
91
- npm run generate -w @executioncontrolprotocol/adobe-firefly-services # offline from openapi/
124
+ pnpm run build # generate + tsc + ecp-plugin-manifest
92
125
  ```
93
126
 
94
- Generated sources under `src/generated/` are committed. Empty free-form OpenAPI objects fail the generator (use `openapi/overlays/`); `z.unknown` / `z.any` / untyped `z.record` are forbidden.
95
-
96
- ## Example
97
-
98
- See [`examples/adobe-firefly-smoke/`](../../examples/adobe-firefly-smoke/) for a thin env + workflow, and [`examples/azure-adobe-assets/`](../../examples/azure-adobe-assets/) for Azure upload + Image5 recolor.
127
+ Live integration tests need Adobe IMS credentials in the plugin config; they skip when unset.
@@ -1,42 +1,75 @@
1
1
  /**
2
+ * Production IMS OAuth server-to-server token endpoint.
2
3
  * @category Auth
3
- * Adobe IMS OAuth Server-to-Server (client_credentials) token helper.
4
4
  */
5
5
  export declare const DEFAULT_IMS_TOKEN_URL = "https://ims-na1.adobelogin.com/ims/token/v3";
6
- /** Default scopes for Firefly Services S2S credentials. */
6
+ /**
7
+ * Scopes requested when the config sets none.
8
+ * @category Auth
9
+ */
7
10
  export declare const DEFAULT_FIREFLY_SCOPES = "openid,AdobeID,session,additional_info,read_organizations,firefly_api,ff_apis";
8
11
  /**
9
- * Extension config fields used for IMS auth.
12
+ * A cached token is refreshed this long before it expires.
13
+ * @category Auth
14
+ */
15
+ export declare const TOKEN_REFRESH_SKEW_MS = 60000;
16
+ /**
17
+ * Config fields used for IMS auth.
10
18
  * @category Auth
11
19
  */
12
20
  export interface AdobeImsConfig {
13
- /** Adobe Developer Console client id (also used as x-api-key). */
21
+ /** Adobe Developer Console client id. */
14
22
  clientId: string;
15
23
  /** Adobe Developer Console client secret. */
16
24
  clientSecret: string;
17
25
  /** Space- or comma-separated IMS scopes. */
18
26
  scopes?: string;
19
- /** Override IMS token endpoint. */
27
+ /** IMS token endpoint override. */
20
28
  imsEndpoint?: string;
21
29
  }
22
30
  /**
23
- * Cached bearer token.
31
+ * Returns a bearer token, fetching or refreshing it when needed.
32
+ * @category Auth
33
+ */
34
+ export type AccessTokenProvider = (signal?: AbortSignal) => Promise<string>;
35
+ /**
36
+ * Options for {@link createImsTokenProvider}.
24
37
  * @category Auth
25
38
  */
26
- export interface AdobeAccessToken {
27
- /** Bearer access token. */
28
- accessToken: string;
29
- /** Absolute expiry time (epoch ms). */
30
- expiresAtMs: number;
39
+ export interface ImsTokenProviderOptions {
40
+ /** Fetch implementation. Defaults to the global `fetch` at call time. */
41
+ fetchImpl?: typeof fetch;
42
+ /** Refresh skew in milliseconds. Defaults to {@link TOKEN_REFRESH_SKEW_MS}. */
43
+ skewMs?: number;
44
+ /** Clock. Defaults to `Date.now`. */
45
+ now?: () => number;
31
46
  }
32
47
  /**
33
- * Normalize scopes to the form IMS expects (comma-separated).
48
+ * Normalize scopes to the comma-separated form IMS expects.
34
49
  * @category Auth
35
50
  */
36
51
  export declare function normalizeScopes(scopes: string | undefined): string;
37
52
  /**
38
- * Create an IMS token provider with in-memory cache and refresh skew.
53
+ * Cache key for one credential set: a hash of client id, secret, scopes and endpoint, so the
54
+ * secret is never used as a map key in clear.
55
+ * @category Auth
56
+ */
57
+ export declare function imsCacheKey(config: AdobeImsConfig): string;
58
+ /**
59
+ * Create a token provider with its own in-memory cache. Concurrent callers share one token
60
+ * request; a caller's signal only stops that caller from waiting.
61
+ * @category Auth
62
+ */
63
+ export declare function createImsTokenProvider(config: AdobeImsConfig, options?: ImsTokenProviderOptions): AccessTokenProvider;
64
+ /**
65
+ * Token provider for a credential set, shared across calls in this process so a warm host
66
+ * reuses the token until it nears expiry.
67
+ * @category Auth
68
+ */
69
+ export declare function getImsTokenProvider(config: AdobeImsConfig, options?: ImsTokenProviderOptions): AccessTokenProvider;
70
+ /**
71
+ * Drop every cached provider and token (tests, credential rotation).
39
72
  * @category Auth
40
73
  */
41
- export declare function createImsTokenProvider(config: AdobeImsConfig, fetchImpl?: typeof fetch, skewMs?: number): () => Promise<string>;
74
+ export declare function clearImsTokenCache(): void;
42
75
  //# sourceMappingURL=ims.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ims.d.ts","sourceRoot":"","sources":["../../src/auth/ims.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,qBAAqB,gDAAgD,CAAA;AAElF,2DAA2D;AAC3D,eAAO,MAAM,sBAAsB,kFAC8C,CAAA;AAEjF;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B,kEAAkE;IAClE,QAAQ,EAAE,MAAM,CAAA;IAChB,6CAA6C;IAC7C,YAAY,EAAE,MAAM,CAAA;IACpB,4CAA4C;IAC5C,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,mCAAmC;IACnC,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB;AAED;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAC/B,2BAA2B;IAC3B,WAAW,EAAE,MAAM,CAAA;IACnB,uCAAuC;IACvC,WAAW,EAAE,MAAM,CAAA;CACpB;AAED;;;GAGG;AACH,wBAAgB,eAAe,CA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,OAAO,GAAE,uBAA4B,GACpC,mBAAmB,CAgErB;AAID;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,cAAc,EAAE,OAAO,GAAE,uBAA4B,GAAG,mBAAmB,CAQtH;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,IAAI,IAAI,CAEzC"}
package/dist/auth/ims.js CHANGED
@@ -1,29 +1,55 @@
1
+ import { createHash } from "node:crypto";
2
+ import { AdobeServiceError, errorMessage, PROVIDER_ERROR } from "../errors.js";
3
+ import { raceSignal } from "../runtime/abort.js";
1
4
  /**
5
+ * Production IMS OAuth server-to-server token endpoint.
2
6
  * @category Auth
3
- * Adobe IMS OAuth Server-to-Server (client_credentials) token helper.
4
7
  */
5
8
  export const DEFAULT_IMS_TOKEN_URL = "https://ims-na1.adobelogin.com/ims/token/v3";
6
- /** Default scopes for Firefly Services S2S credentials. */
9
+ /**
10
+ * Scopes requested when the config sets none.
11
+ * @category Auth
12
+ */
7
13
  export const DEFAULT_FIREFLY_SCOPES = "openid,AdobeID,session,additional_info,read_organizations,firefly_api,ff_apis";
8
14
  /**
9
- * Normalize scopes to the form IMS expects (comma-separated).
15
+ * A cached token is refreshed this long before it expires.
16
+ * @category Auth
17
+ */
18
+ export const TOKEN_REFRESH_SKEW_MS = 60_000;
19
+ /**
20
+ * Normalize scopes to the comma-separated form IMS expects.
10
21
  * @category Auth
11
22
  */
12
23
  export function normalizeScopes(scopes) {
13
- const raw = (scopes ?? DEFAULT_FIREFLY_SCOPES).trim();
24
+ const raw = scopes?.trim() || DEFAULT_FIREFLY_SCOPES;
14
25
  return raw.split(/[,\s]+/).filter(Boolean).join(",");
15
26
  }
16
27
  /**
17
- * Create an IMS token provider with in-memory cache and refresh skew.
28
+ * Cache key for one credential set: a hash of client id, secret, scopes and endpoint, so the
29
+ * secret is never used as a map key in clear.
18
30
  * @category Auth
19
31
  */
20
- export function createImsTokenProvider(config, fetchImpl = fetch, skewMs = 60_000) {
32
+ export function imsCacheKey(config) {
33
+ const parts = [
34
+ config.clientId,
35
+ config.clientSecret,
36
+ normalizeScopes(config.scopes),
37
+ config.imsEndpoint ?? DEFAULT_IMS_TOKEN_URL,
38
+ ];
39
+ return createHash("sha256").update(JSON.stringify(parts)).digest("hex");
40
+ }
41
+ /**
42
+ * Create a token provider with its own in-memory cache. Concurrent callers share one token
43
+ * request; a caller's signal only stops that caller from waiting.
44
+ * @category Auth
45
+ */
46
+ export function createImsTokenProvider(config, options = {}) {
47
+ const skewMs = options.skewMs ?? TOKEN_REFRESH_SKEW_MS;
48
+ const now = options.now ?? Date.now;
21
49
  let cached;
22
- return async () => {
23
- const now = Date.now();
24
- if (cached && cached.expiresAtMs - skewMs > now) {
25
- return cached.accessToken;
26
- }
50
+ let pending;
51
+ const fetchToken = async () => {
52
+ const fetchImpl = options.fetchImpl ?? fetch;
27
53
  const endpoint = config.imsEndpoint ?? DEFAULT_IMS_TOKEN_URL;
28
54
  const body = new URLSearchParams({
29
55
  grant_type: "client_credentials",
@@ -31,24 +57,99 @@ export function createImsTokenProvider(config, fetchImpl = fetch, skewMs = 60_00
31
57
  client_secret: config.clientSecret,
32
58
  scope: normalizeScopes(config.scopes),
33
59
  });
34
- const res = await fetchImpl(endpoint, {
35
- method: "POST",
36
- headers: { "Content-Type": "application/x-www-form-urlencoded" },
37
- body,
38
- });
60
+ const requestedAt = now();
61
+ let res;
62
+ try {
63
+ res = await fetchImpl(endpoint, {
64
+ method: "POST",
65
+ headers: { "content-type": "application/x-www-form-urlencoded" },
66
+ body,
67
+ });
68
+ }
69
+ catch (error) {
70
+ throw new AdobeServiceError(PROVIDER_ERROR, `Adobe IMS token request failed: ${errorMessage(error)}`, {
71
+ endpoint,
72
+ });
73
+ }
74
+ const text = await res.text();
39
75
  if (!res.ok) {
40
- const text = await res.text();
41
- throw new Error(`Adobe IMS token request failed (${res.status}): ${text}`);
76
+ const body = parseBody(text);
77
+ throw new AdobeServiceError(PROVIDER_ERROR, imsHttpErrorMessage(res.status, body), {
78
+ endpoint,
79
+ status: res.status,
80
+ body,
81
+ });
42
82
  }
43
- const json = (await res.json());
44
- if (!json.access_token || typeof json.expires_in !== "number") {
45
- throw new Error("Adobe IMS token response missing access_token or expires_in");
83
+ const json = parseBody(text);
84
+ if (typeof json?.access_token !== "string" || typeof json.expires_in !== "number") {
85
+ throw new AdobeServiceError(PROVIDER_ERROR, "Adobe IMS token response is missing access_token or expires_in.", {
86
+ endpoint,
87
+ status: res.status,
88
+ });
46
89
  }
47
- cached = {
48
- accessToken: json.access_token,
49
- expiresAtMs: now + json.expires_in * 1000,
50
- };
51
- return cached.accessToken;
90
+ return { accessToken: json.access_token, expiresAtMs: requestedAt + json.expires_in * 1000 };
52
91
  };
92
+ return async (signal) => {
93
+ if (cached && cached.expiresAtMs - skewMs > now())
94
+ return cached.accessToken;
95
+ if (!pending) {
96
+ pending = fetchToken().then((token) => {
97
+ cached = token;
98
+ pending = undefined;
99
+ return token;
100
+ }, (error) => {
101
+ pending = undefined;
102
+ throw error;
103
+ });
104
+ }
105
+ return (await raceSignal(pending, signal)).accessToken;
106
+ };
107
+ }
108
+ const providers = new Map();
109
+ /**
110
+ * Token provider for a credential set, shared across calls in this process so a warm host
111
+ * reuses the token until it nears expiry.
112
+ * @category Auth
113
+ */
114
+ export function getImsTokenProvider(config, options = {}) {
115
+ const key = imsCacheKey(config);
116
+ let provider = providers.get(key);
117
+ if (!provider) {
118
+ provider = createImsTokenProvider(config, options);
119
+ providers.set(key, provider);
120
+ }
121
+ return provider;
122
+ }
123
+ /**
124
+ * Drop every cached provider and token (tests, credential rotation).
125
+ * @category Auth
126
+ */
127
+ export function clearImsTokenCache() {
128
+ providers.clear();
129
+ }
130
+ function parseBody(text) {
131
+ if (!text)
132
+ return undefined;
133
+ try {
134
+ return JSON.parse(text);
135
+ }
136
+ catch {
137
+ return text.slice(0, 2000);
138
+ }
139
+ }
140
+ function imsHttpErrorMessage(status, body) {
141
+ const detail = isRecord(body) && typeof body.error_description === "string"
142
+ ? body.error_description
143
+ : isRecord(body) && typeof body.error === "string"
144
+ ? body.error
145
+ : isRecord(body) && isRecord(body.error) && typeof body.error.message === "string"
146
+ ? body.error.message
147
+ : undefined;
148
+ return detail
149
+ ? `Adobe IMS token request returned HTTP ${status}: ${detail}`
150
+ : `Adobe IMS token request returned HTTP ${status}.`;
151
+ }
152
+ function isRecord(value) {
153
+ return typeof value === "object" && value !== null && !Array.isArray(value);
53
154
  }
54
155
  //# sourceMappingURL=ims.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ims.js","sourceRoot":"","sources":["../../src/auth/ims.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,6CAA6C,CAAA;AAElF,2DAA2D;AAC3D,MAAM,CAAC,MAAM,sBAAsB,GACjC,+EAA+E,CAAA;AA4BjF;;;GAGG;AACH,MAAM,UAAU,eAAe,CAAC,MAA0B;IACxD,MAAM,GAAG,GAAG,CAAC,MAAM,IAAI,sBAAsB,CAAC,CAAC,IAAI,EAAE,CAAA;IACrD,OAAO,GAAG,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;AACtD,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,sBAAsB,CACpC,MAAsB,EACtB,YAA0B,KAAK,EAC/B,MAAM,GAAG,MAAM;IAEf,IAAI,MAAoC,CAAA;IAExC,OAAO,KAAK,IAAI,EAAE;QAChB,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,EAAE,CAAA;QACtB,IAAI,MAAM,IAAI,MAAM,CAAC,WAAW,GAAG,MAAM,GAAG,GAAG,EAAE,CAAC;YAChD,OAAO,MAAM,CAAC,WAAW,CAAA;QAC3B,CAAC;QAED,MAAM,QAAQ,GAAG,MAAM,CAAC,WAAW,IAAI,qBAAqB,CAAA;QAC5D,MAAM,IAAI,GAAG,IAAI,eAAe,CAAC;YAC/B,UAA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endpoint overrides, poll timing and a request limit.
5
+ * @category Plugins
6
+ */
7
+ export declare const adobeConfigSchema: z.ZodObject<{
8
+ clientId: z.ZodString;
9
+ clientSecret: z.ZodString;
10
+ scopes: z.ZodOptional<z.ZodString>;
11
+ imsEndpoint: z.ZodOptional<z.ZodURL>;
12
+ baseUrl: z.ZodOptional<z.ZodURL>;
13
+ pollIntervalMs: z.ZodOptional<z.ZodNumber>;
14
+ pollTimeoutMs: z.ZodOptional<z.ZodNumber>;
15
+ maxRequestsPerMinute: z.ZodOptional<z.ZodNumber>;
16
+ }, z.core.$strip>;
17
+ /**
18
+ * Resolved plugin config.
19
+ * @category Plugins
20
+ */
21
+ export type AdobeConfig = z.infer<typeof adobeConfigSchema>;
22
+ /**
23
+ * Parse the step's config object or throw `ECP_CONFIG_INVALID` with issue paths.
24
+ * @category Plugins
25
+ */
26
+ export declare function resolveAdobeConfig(raw: unknown): AdobeConfig;
27
+ //# sourceMappingURL=config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAGvB;;;;GAIG;AACH,eAAO,MAAM,iBAAiB;;;;;;;;;iBAiC5B,CAAA;AAEF;;;GAGG;AACH,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAA;AAE3D;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,OAAO,GAAG,WAAW,CAU5D"}
package/dist/config.js ADDED
@@ -0,0 +1,51 @@
1
+ import { z } from "zod";
2
+ import { AdobeServiceError, CONFIG_INVALID } from "./errors.js";
3
+ /**
4
+ * Plugin config: OAuth server-to-server credentials from the Adobe Developer Console, plus
5
+ * optional endpoint overrides, poll timing and a request limit.
6
+ * @category Plugins
7
+ */
8
+ export const adobeConfigSchema = z.object({
9
+ clientId: z.string().min(1).describe("Adobe Developer Console client id. Also sent as the x-api-key header."),
10
+ clientSecret: z.string().min(1).describe("Adobe Developer Console client secret."),
11
+ scopes: z
12
+ .string()
13
+ .optional()
14
+ .describe("IMS scopes, comma- or space-separated. Defaults to the Firefly Services scope set."),
15
+ imsEndpoint: z.url().optional().describe("IMS token endpoint. Defaults to the production IMS v3 token URL."),
16
+ baseUrl: z
17
+ .url()
18
+ .optional()
19
+ .describe("Replaces each API's server URL (for a proxy or a mock). Status URLs returned by Adobe are used as-is."),
20
+ pollIntervalMs: z
21
+ .number()
22
+ .int()
23
+ .positive()
24
+ .optional()
25
+ .describe("Delay between async job status checks. Defaults to 2000."),
26
+ pollTimeoutMs: z
27
+ .number()
28
+ .int()
29
+ .positive()
30
+ .optional()
31
+ .describe("Longest wait for an async job before the step fails. Defaults to 570000."),
32
+ maxRequestsPerMinute: z
33
+ .number()
34
+ .int()
35
+ .positive()
36
+ .max(100_000)
37
+ .optional()
38
+ .describe("Most API requests to start per minute with these credentials, across every step and run in the host. Requests are spaced evenly; job status polls (GET) are not counted. Omit for no limit."),
39
+ });
40
+ /**
41
+ * Parse the step's config object or throw `ECP_CONFIG_INVALID` with issue paths.
42
+ * @category Plugins
43
+ */
44
+ export function resolveAdobeConfig(raw) {
45
+ const parsed = adobeConfigSchema.safeParse(raw);
46
+ if (!parsed.success) {
47
+ throw new AdobeServiceError(CONFIG_INVALID, "The adobe-firefly-services step needs a config object with clientId and clientSecret.", { issues: parsed.error.issues.map((issue) => ({ path: issue.path.join("."), message: issue.message })) });
48
+ }
49
+ return parsed.data;
50
+ }
51
+ //# sourceMappingURL=config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAE/D;;;;GAIG;AACH,MAAM,CAAC,MAAM,iBAAiB,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AAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC,EAAE,CACzG,CAAA;IACH,CAAC;IACD,OAAO,MAAM,CAAC,IAAI,CAAA;AACpB,CAAC"}
@@ -0,0 +1,42 @@
1
+ /**
2
+ * Error code for failures reported by Adobe (IMS or a Firefly Services API).
3
+ * @category Plugins
4
+ */
5
+ export declare const PROVIDER_ERROR = "ECP_PROVIDER_ERROR";
6
+ /**
7
+ * Error code for a config object that fails the plugin's config schema.
8
+ * @category Plugins
9
+ */
10
+ export declare const CONFIG_INVALID = "ECP_CONFIG_INVALID";
11
+ /**
12
+ * Error code for capability input that cannot form a valid Adobe request.
13
+ * @category Plugins
14
+ */
15
+ export declare const INPUT_INVALID = "ECP_INPUT_INVALID";
16
+ /**
17
+ * Error thrown by the Adobe plugin. The host reads `code` and `details` into the step record.
18
+ * @category Plugins
19
+ */
20
+ export declare class AdobeServiceError extends Error {
21
+ /** Stable `ECP_*` code. */
22
+ readonly code: string;
23
+ /** Structured facts for the caller (HTTP status, response body, issue paths). */
24
+ readonly details: Record<string, unknown>;
25
+ /**
26
+ * @param code `ECP_*` code.
27
+ * @param message One sentence saying what failed.
28
+ * @param details Structured facts for the caller.
29
+ */
30
+ constructor(code: string, message: string, details?: Record<string, unknown>);
31
+ }
32
+ /**
33
+ * True for the error a fetch or sleep throws when its signal aborts.
34
+ * @category Plugins
35
+ */
36
+ export declare function isAbortError(error: unknown): boolean;
37
+ /**
38
+ * Message text of an unknown thrown value.
39
+ * @category Plugins
40
+ */
41
+ export declare function errorMessage(error: unknown): string;
42
+ //# sourceMappingURL=errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,cAAc,uBAAuB,CAAA;AAElD;;;GAGG;AACH,eAAO,MAAM,cAAc,uBAAuB,CAAA;AAElD;;;GAGG;AACH,eAAO,MAAM,aAAa,sBAAsB,CAAA;AAEhD;;;GAGG;AACH,qBAAa,iBAAkB,SAAQ,KAAK;IAC1C,2BAA2B;IAC3B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,iFAAiF;IACjF,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAEzC;;;;OAIG;gBACS,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,GAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAM;CAMjF;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAMpD;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAEnD"}