@executioncontrolprotocol/adobe-firefly-services 0.13.2 → 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.
- package/LICENSE +198 -13
- package/README.md +113 -83
- package/dist/auth/ims.d.ts +47 -14
- package/dist/auth/ims.d.ts.map +1 -1
- package/dist/auth/ims.js +127 -26
- package/dist/auth/ims.js.map +1 -1
- package/dist/config.d.ts +27 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +51 -0
- package/dist/config.js.map +1 -0
- package/dist/errors.d.ts +42 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +53 -0
- package/dist/errors.js.map +1 -0
- package/dist/generated/audio-video/capabilities.d.ts +21 -36
- package/dist/generated/audio-video/capabilities.d.ts.map +1 -1
- package/dist/generated/audio-video/capabilities.js +295 -259
- package/dist/generated/audio-video/capabilities.js.map +1 -1
- package/dist/generated/audio-video/operations.d.ts +13 -0
- package/dist/generated/audio-video/operations.d.ts.map +1 -0
- package/dist/generated/audio-video/operations.js +182 -0
- package/dist/generated/audio-video/operations.js.map +1 -0
- package/dist/generated/audio-video/schemas.d.ts +245 -82
- package/dist/generated/audio-video/schemas.d.ts.map +1 -1
- package/dist/generated/audio-video/schemas.js +552 -466
- package/dist/generated/audio-video/schemas.js.map +1 -1
- package/dist/generated/creative-production/capabilities.d.ts +10 -10
- package/dist/generated/creative-production/capabilities.d.ts.map +1 -1
- package/dist/generated/creative-production/capabilities.js +64 -77
- package/dist/generated/creative-production/capabilities.js.map +1 -1
- package/dist/generated/creative-production/operations.d.ts +13 -0
- package/dist/generated/creative-production/operations.d.ts.map +1 -0
- package/dist/generated/creative-production/operations.js +48 -0
- package/dist/generated/creative-production/operations.js.map +1 -0
- package/dist/generated/creative-production/schemas.d.ts +65 -21
- package/dist/generated/creative-production/schemas.d.ts.map +1 -1
- package/dist/generated/creative-production/schemas.js +149 -128
- package/dist/generated/creative-production/schemas.js.map +1 -1
- package/dist/generated/express/capabilities.d.ts +11 -10
- package/dist/generated/express/capabilities.d.ts.map +1 -1
- package/dist/generated/express/capabilities.js +65 -64
- package/dist/generated/express/capabilities.js.map +1 -1
- package/dist/generated/express/operations.d.ts +13 -0
- package/dist/generated/express/operations.d.ts.map +1 -0
- package/dist/generated/express/operations.js +58 -0
- package/dist/generated/express/operations.js.map +1 -0
- package/dist/generated/express/schemas.d.ts +100 -34
- package/dist/generated/express/schemas.d.ts.map +1 -1
- package/dist/generated/express/schemas.js +165 -134
- package/dist/generated/express/schemas.js.map +1 -1
- package/dist/generated/firefly/capabilities.d.ts +18 -28
- package/dist/generated/firefly/capabilities.d.ts.map +1 -1
- package/dist/generated/firefly/capabilities.js +289 -172
- package/dist/generated/firefly/capabilities.js.map +1 -1
- package/dist/generated/firefly/operations.d.ts +13 -0
- package/dist/generated/firefly/operations.d.ts.map +1 -0
- package/dist/generated/firefly/operations.js +145 -0
- package/dist/generated/firefly/operations.js.map +1 -0
- package/dist/generated/firefly/schemas.d.ts +250 -105
- package/dist/generated/firefly/schemas.d.ts.map +1 -1
- package/dist/generated/firefly/schemas.js +462 -451
- package/dist/generated/firefly/schemas.js.map +1 -1
- package/dist/generated/illustrator/capabilities.d.ts +11 -16
- package/dist/generated/illustrator/capabilities.d.ts.map +1 -1
- package/dist/generated/illustrator/capabilities.js +99 -100
- package/dist/generated/illustrator/capabilities.js.map +1 -1
- package/dist/generated/illustrator/operations.d.ts +13 -0
- package/dist/generated/illustrator/operations.d.ts.map +1 -0
- package/dist/generated/illustrator/operations.js +65 -0
- package/dist/generated/illustrator/operations.js.map +1 -0
- package/dist/generated/illustrator/schemas.d.ts +85 -54
- package/dist/generated/illustrator/schemas.d.ts.map +1 -1
- package/dist/generated/illustrator/schemas.js +187 -233
- package/dist/generated/illustrator/schemas.js.map +1 -1
- package/dist/generated/indesign/capabilities.d.ts +19 -32
- package/dist/generated/indesign/capabilities.d.ts.map +1 -1
- package/dist/generated/indesign/capabilities.js +394 -197
- package/dist/generated/indesign/capabilities.js.map +1 -1
- package/dist/generated/indesign/operations.d.ts +13 -0
- package/dist/generated/indesign/operations.d.ts.map +1 -0
- package/dist/generated/indesign/operations.js +133 -0
- package/dist/generated/indesign/operations.js.map +1 -0
- package/dist/generated/indesign/schemas.d.ts +75 -24
- package/dist/generated/indesign/schemas.d.ts.map +1 -1
- package/dist/generated/indesign/schemas.js +351 -240
- package/dist/generated/indesign/schemas.js.map +1 -1
- package/dist/generated/index.d.ts +74 -3
- package/dist/generated/index.d.ts.map +1 -1
- package/dist/generated/index.js +28 -97
- package/dist/generated/index.js.map +1 -1
- package/dist/generated/photoshop/capabilities.d.ts +13 -14
- package/dist/generated/photoshop/capabilities.d.ts.map +1 -1
- package/dist/generated/photoshop/capabilities.js +133 -90
- package/dist/generated/photoshop/capabilities.js.map +1 -1
- package/dist/generated/photoshop/operations.d.ts +13 -0
- package/dist/generated/photoshop/operations.d.ts.map +1 -0
- package/dist/generated/photoshop/operations.js +88 -0
- package/dist/generated/photoshop/operations.js.map +1 -0
- package/dist/generated/photoshop/schemas.d.ts +430 -152
- package/dist/generated/photoshop/schemas.d.ts.map +1 -1
- package/dist/generated/photoshop/schemas.js +809 -716
- package/dist/generated/photoshop/schemas.js.map +1 -1
- package/dist/generated/substance3d/capabilities.d.ts +16 -22
- package/dist/generated/substance3d/capabilities.d.ts.map +1 -1
- package/dist/generated/substance3d/capabilities.js +181 -136
- package/dist/generated/substance3d/capabilities.js.map +1 -1
- package/dist/generated/substance3d/operations.d.ts +13 -0
- package/dist/generated/substance3d/operations.d.ts.map +1 -0
- package/dist/generated/substance3d/operations.js +114 -0
- package/dist/generated/substance3d/operations.js.map +1 -0
- package/dist/generated/substance3d/schemas.d.ts +305 -76
- package/dist/generated/substance3d/schemas.d.ts.map +1 -1
- package/dist/generated/substance3d/schemas.js +634 -515
- package/dist/generated/substance3d/schemas.js.map +1 -1
- package/dist/http/async-job.d.ts +24 -14
- package/dist/http/async-job.d.ts.map +1 -1
- package/dist/http/async-job.js +135 -69
- package/dist/http/async-job.js.map +1 -1
- package/dist/http/client.d.ts +54 -26
- package/dist/http/client.d.ts.map +1 -1
- package/dist/http/client.js +136 -53
- package/dist/http/client.js.map +1 -1
- package/dist/http/request-limit.d.ts +42 -0
- package/dist/http/request-limit.d.ts.map +1 -0
- package/dist/http/request-limit.js +46 -0
- package/dist/http/request-limit.js.map +1 -0
- package/dist/index.d.ts +84 -30
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +20 -34
- package/dist/index.js.map +1 -1
- package/dist/runtime/abort.d.ts +17 -0
- package/dist/runtime/abort.d.ts.map +1 -0
- package/dist/runtime/abort.js +51 -0
- package/dist/runtime/abort.js.map +1 -0
- package/dist/runtime/assemble.d.ts +99 -0
- package/dist/runtime/assemble.d.ts.map +1 -0
- package/dist/runtime/assemble.js +159 -0
- package/dist/runtime/assemble.js.map +1 -0
- package/dist/runtime/invoke-capability.d.ts +46 -0
- package/dist/runtime/invoke-capability.d.ts.map +1 -0
- package/dist/runtime/invoke-capability.js +68 -0
- package/dist/runtime/invoke-capability.js.map +1 -0
- package/dist/runtime/product-shape.d.ts +49 -0
- package/dist/runtime/product-shape.d.ts.map +1 -0
- package/dist/runtime/product-shape.js +309 -0
- package/dist/runtime/product-shape.js.map +1 -0
- package/dist/schemas.d.ts +13 -0
- package/dist/schemas.d.ts.map +1 -0
- package/dist/schemas.js +7 -0
- package/dist/schemas.js.map +1 -0
- package/ecp.manifest.json +840 -0
- package/ecp.schema.json +23498 -0
- package/package.json +28 -19
- package/dist/generated/audio-video/capabilities.browser.d.ts +0 -37
- package/dist/generated/audio-video/capabilities.browser.d.ts.map +0 -1
- package/dist/generated/audio-video/capabilities.browser.js +0 -44
- package/dist/generated/audio-video/capabilities.browser.js.map +0 -1
- package/dist/generated/audio-video/index.d.ts +0 -3
- package/dist/generated/audio-video/index.d.ts.map +0 -1
- package/dist/generated/audio-video/index.js +0 -3
- package/dist/generated/audio-video/index.js.map +0 -1
- package/dist/generated/audio-video/shells.d.ts +0 -39
- package/dist/generated/audio-video/shells.d.ts.map +0 -1
- package/dist/generated/audio-video/shells.js +0 -290
- package/dist/generated/audio-video/shells.js.map +0 -1
- package/dist/generated/creative-production/capabilities.browser.d.ts +0 -11
- package/dist/generated/creative-production/capabilities.browser.d.ts.map +0 -1
- package/dist/generated/creative-production/capabilities.browser.js +0 -18
- package/dist/generated/creative-production/capabilities.browser.js.map +0 -1
- package/dist/generated/creative-production/index.d.ts +0 -3
- package/dist/generated/creative-production/index.d.ts.map +0 -1
- package/dist/generated/creative-production/index.js +0 -3
- package/dist/generated/creative-production/index.js.map +0 -1
- package/dist/generated/creative-production/shells.d.ts +0 -13
- package/dist/generated/creative-production/shells.d.ts.map +0 -1
- package/dist/generated/creative-production/shells.js +0 -108
- package/dist/generated/creative-production/shells.js.map +0 -1
- package/dist/generated/express/capabilities.browser.d.ts +0 -11
- package/dist/generated/express/capabilities.browser.d.ts.map +0 -1
- package/dist/generated/express/capabilities.browser.js +0 -18
- package/dist/generated/express/capabilities.browser.js.map +0 -1
- package/dist/generated/express/index.d.ts +0 -3
- package/dist/generated/express/index.d.ts.map +0 -1
- package/dist/generated/express/index.js +0 -3
- package/dist/generated/express/index.js.map +0 -1
- package/dist/generated/express/shells.d.ts +0 -13
- package/dist/generated/express/shells.d.ts.map +0 -1
- package/dist/generated/express/shells.js +0 -72
- package/dist/generated/express/shells.js.map +0 -1
- package/dist/generated/firefly/capabilities.browser.d.ts +0 -29
- package/dist/generated/firefly/capabilities.browser.d.ts.map +0 -1
- package/dist/generated/firefly/capabilities.browser.js +0 -36
- package/dist/generated/firefly/capabilities.browser.js.map +0 -1
- package/dist/generated/firefly/index.d.ts +0 -3
- package/dist/generated/firefly/index.d.ts.map +0 -1
- package/dist/generated/firefly/index.js +0 -3
- package/dist/generated/firefly/index.js.map +0 -1
- package/dist/generated/firefly/shells.d.ts +0 -31
- package/dist/generated/firefly/shells.d.ts.map +0 -1
- package/dist/generated/firefly/shells.js +0 -199
- package/dist/generated/firefly/shells.js.map +0 -1
- package/dist/generated/illustrator/capabilities.browser.d.ts +0 -17
- package/dist/generated/illustrator/capabilities.browser.d.ts.map +0 -1
- package/dist/generated/illustrator/capabilities.browser.js +0 -24
- package/dist/generated/illustrator/capabilities.browser.js.map +0 -1
- package/dist/generated/illustrator/index.d.ts +0 -3
- package/dist/generated/illustrator/index.d.ts.map +0 -1
- package/dist/generated/illustrator/index.js +0 -3
- package/dist/generated/illustrator/index.js.map +0 -1
- package/dist/generated/illustrator/shells.d.ts +0 -19
- package/dist/generated/illustrator/shells.d.ts.map +0 -1
- package/dist/generated/illustrator/shells.js +0 -106
- package/dist/generated/illustrator/shells.js.map +0 -1
- package/dist/generated/indesign/capabilities.browser.d.ts +0 -33
- package/dist/generated/indesign/capabilities.browser.d.ts.map +0 -1
- package/dist/generated/indesign/capabilities.browser.js +0 -40
- package/dist/generated/indesign/capabilities.browser.js.map +0 -1
- package/dist/generated/indesign/index.d.ts +0 -3
- package/dist/generated/indesign/index.d.ts.map +0 -1
- package/dist/generated/indesign/index.js +0 -3
- package/dist/generated/indesign/index.js.map +0 -1
- package/dist/generated/indesign/shells.d.ts +0 -35
- package/dist/generated/indesign/shells.d.ts.map +0 -1
- package/dist/generated/indesign/shells.js +0 -208
- package/dist/generated/indesign/shells.js.map +0 -1
- package/dist/generated/index.browser.d.ts +0 -4
- package/dist/generated/index.browser.d.ts.map +0 -1
- package/dist/generated/index.browser.js +0 -98
- package/dist/generated/index.browser.js.map +0 -1
- package/dist/generated/photoshop/capabilities.browser.d.ts +0 -15
- package/dist/generated/photoshop/capabilities.browser.d.ts.map +0 -1
- package/dist/generated/photoshop/capabilities.browser.js +0 -22
- package/dist/generated/photoshop/capabilities.browser.js.map +0 -1
- package/dist/generated/photoshop/index.d.ts +0 -3
- package/dist/generated/photoshop/index.d.ts.map +0 -1
- package/dist/generated/photoshop/index.js +0 -3
- package/dist/generated/photoshop/index.js.map +0 -1
- package/dist/generated/photoshop/shells.d.ts +0 -17
- package/dist/generated/photoshop/shells.d.ts.map +0 -1
- package/dist/generated/photoshop/shells.js +0 -92
- package/dist/generated/photoshop/shells.js.map +0 -1
- package/dist/generated/substance3d/capabilities.browser.d.ts +0 -23
- package/dist/generated/substance3d/capabilities.browser.d.ts.map +0 -1
- package/dist/generated/substance3d/capabilities.browser.js +0 -30
- package/dist/generated/substance3d/capabilities.browser.js.map +0 -1
- package/dist/generated/substance3d/index.d.ts +0 -3
- package/dist/generated/substance3d/index.d.ts.map +0 -1
- package/dist/generated/substance3d/index.js +0 -3
- package/dist/generated/substance3d/index.js.map +0 -1
- package/dist/generated/substance3d/shells.d.ts +0 -25
- package/dist/generated/substance3d/shells.d.ts.map +0 -1
- package/dist/generated/substance3d/shells.js +0 -146
- package/dist/generated/substance3d/shells.js.map +0 -1
- package/dist/index.browser.d.ts +0 -19
- package/dist/index.browser.d.ts.map +0 -1
- package/dist/index.browser.js +0 -27
- package/dist/index.browser.js.map +0 -1
- package/dist/runtime/invoke.d.ts +0 -67
- package/dist/runtime/invoke.d.ts.map +0 -1
- package/dist/runtime/invoke.js +0 -69
- package/dist/runtime/invoke.js.map +0 -1
- package/dist/runtime/photoshop-manifest.d.ts +0 -40
- package/dist/runtime/photoshop-manifest.d.ts.map +0 -1
- package/dist/runtime/photoshop-manifest.js +0 -115
- package/dist/runtime/photoshop-manifest.js.map +0 -1
- package/dist/shared.d.ts +0 -11
- package/dist/shared.d.ts.map +0 -1
- package/dist/shared.js +0 -39
- package/dist/shared.js.map +0 -1
- package/openapi/audio-video/audio-video-api.json +0 -8333
- package/openapi/audio-video/translate-lipsync-openapi.json +0 -1967
- package/openapi/content-tagging/SOURCE.md +0 -10
- package/openapi/creative-production/workflow-builder-api.yaml +0 -1002
- package/openapi/express/ffs-express-api.json +0 -2262
- package/openapi/firefly/firefly-api.json +0 -4964
- package/openapi/illustrator/illustrator-api-beta.json +0 -1329
- package/openapi/illustrator/illustrator-api.json +0 -2447
- package/openapi/indesign/indesignapi.json +0 -2907
- package/openapi/overlays/schema-fixes.json +0 -95
- package/openapi/photoshop/photoshopv2-api.json +0 -5395
- package/openapi/substance3d/openapi.yaml +0 -3583
package/dist/http/client.js
CHANGED
|
@@ -1,75 +1,158 @@
|
|
|
1
|
+
import { AdobeServiceError, errorMessage, isAbortError, PROVIDER_ERROR } from "../errors.js";
|
|
2
|
+
import { sleep } from "../runtime/abort.js";
|
|
1
3
|
/**
|
|
4
|
+
* Default retry budget for 429 (any method) and 502/503/504 (GET only).
|
|
2
5
|
* @category Http
|
|
3
|
-
* Typed Adobe Firefly Services HTTP error.
|
|
4
6
|
*/
|
|
5
|
-
export
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
bodyText;
|
|
10
|
-
/** Request URL. */
|
|
11
|
-
url;
|
|
12
|
-
constructor(status, bodyText, url) {
|
|
13
|
-
super(`Adobe API ${status} for ${url}: ${bodyText.slice(0, 500)}`);
|
|
14
|
-
this.name = "AdobeHttpError";
|
|
15
|
-
this.status = status;
|
|
16
|
-
this.bodyText = bodyText;
|
|
17
|
-
this.url = url;
|
|
18
|
-
}
|
|
19
|
-
}
|
|
7
|
+
export const DEFAULT_MAX_RETRIES = 2;
|
|
8
|
+
const MAX_RETRY_WAIT_MS = 10_000;
|
|
9
|
+
const GATEWAY_STATUSES = new Set([502, 503, 504]);
|
|
10
|
+
const MAX_ERROR_BODY_CHARS = 2000;
|
|
20
11
|
/**
|
|
21
|
-
* Create
|
|
12
|
+
* Create the Adobe HTTP client (Bearer token plus `x-api-key`). A 429 is retried for any
|
|
13
|
+
* method because Adobe has not accepted the request; gateway errors are retried for GET only
|
|
14
|
+
* so a job is never submitted twice.
|
|
22
15
|
* @category Http
|
|
23
16
|
*/
|
|
24
17
|
export function createAdobeHttpClient(options) {
|
|
25
|
-
const
|
|
18
|
+
const maxRetries = options.maxRetries ?? DEFAULT_MAX_RETRIES;
|
|
19
|
+
const retryBaseMs = options.retryBaseMs ?? 1000;
|
|
26
20
|
return {
|
|
27
21
|
async request(req) {
|
|
28
|
-
const
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
22
|
+
const fetchImpl = options.fetchImpl ?? fetch;
|
|
23
|
+
for (let attempt = 0;; attempt++) {
|
|
24
|
+
const token = await options.getAccessToken(req.signal);
|
|
25
|
+
const headers = {
|
|
26
|
+
accept: "application/json",
|
|
27
|
+
...(req.headers ?? {}),
|
|
28
|
+
authorization: `Bearer ${token}`,
|
|
29
|
+
"x-api-key": options.clientId,
|
|
30
|
+
};
|
|
31
|
+
let body;
|
|
32
|
+
if (req.body !== undefined) {
|
|
33
|
+
headers["content-type"] = "application/json";
|
|
34
|
+
body = JSON.stringify(req.body);
|
|
35
|
+
}
|
|
36
|
+
if (options.limiter && req.method !== "GET")
|
|
37
|
+
await options.limiter.acquire(req.signal);
|
|
38
|
+
let res;
|
|
39
|
+
try {
|
|
40
|
+
res = await fetchImpl(req.url, { method: req.method, headers, body, signal: req.signal });
|
|
41
|
+
}
|
|
42
|
+
catch (error) {
|
|
43
|
+
if (isAbortError(error))
|
|
44
|
+
throw error;
|
|
45
|
+
throw new AdobeServiceError(PROVIDER_ERROR, `Adobe API request failed: ${errorMessage(error)}`, {
|
|
46
|
+
method: req.method,
|
|
47
|
+
url: redactUrl(req.url),
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
const text = await res.text();
|
|
51
|
+
if (res.ok) {
|
|
52
|
+
if (!text)
|
|
53
|
+
return undefined;
|
|
54
|
+
try {
|
|
55
|
+
return JSON.parse(text);
|
|
56
|
+
}
|
|
57
|
+
catch {
|
|
58
|
+
throw new AdobeServiceError(PROVIDER_ERROR, "Adobe API returned a non-JSON success body.", {
|
|
59
|
+
method: req.method,
|
|
60
|
+
url: redactUrl(req.url),
|
|
61
|
+
status: res.status,
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
const retryable = res.status === 429 || (req.method === "GET" && GATEWAY_STATUSES.has(res.status));
|
|
66
|
+
if (retryable && attempt < maxRetries) {
|
|
67
|
+
await sleep(retryDelayMs(res.headers.get("retry-after"), attempt, retryBaseMs), req.signal);
|
|
68
|
+
continue;
|
|
69
|
+
}
|
|
70
|
+
const errorBody = parseErrorBody(text);
|
|
71
|
+
throw new AdobeServiceError(PROVIDER_ERROR, adobeHttpErrorMessage(res.status, req.method, pathOf(req.url), errorBody), {
|
|
72
|
+
method: req.method,
|
|
73
|
+
url: redactUrl(req.url),
|
|
74
|
+
status: res.status,
|
|
75
|
+
body: errorBody,
|
|
76
|
+
});
|
|
52
77
|
}
|
|
53
78
|
},
|
|
54
79
|
};
|
|
55
80
|
}
|
|
56
81
|
/**
|
|
57
|
-
*
|
|
82
|
+
* Delay before a retry: the Retry-After header (seconds) when present, else exponential
|
|
83
|
+
* backoff. Capped at ten seconds.
|
|
58
84
|
* @category Http
|
|
59
85
|
*/
|
|
60
|
-
export function
|
|
86
|
+
export function retryDelayMs(retryAfter, attempt, baseMs) {
|
|
87
|
+
const seconds = retryAfter === null ? Number.NaN : Number(retryAfter);
|
|
88
|
+
const wait = Number.isFinite(seconds) && seconds >= 0 ? seconds * 1000 : baseMs * 2 ** attempt;
|
|
89
|
+
return Math.min(wait, MAX_RETRY_WAIT_MS);
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Substitute `{param}` placeholders in an OpenAPI path template and append query values.
|
|
93
|
+
* @category Http
|
|
94
|
+
*/
|
|
95
|
+
export function buildUrl(serverUrl, pathTemplate, pathParams, queryParams = {}) {
|
|
61
96
|
let path = pathTemplate;
|
|
62
97
|
for (const [key, value] of Object.entries(pathParams)) {
|
|
63
|
-
path = path.
|
|
64
|
-
}
|
|
65
|
-
const url = new URL(path.replace(/^\//, ""), baseUrl.endsWith("/") ? baseUrl : `${baseUrl}/`);
|
|
66
|
-
if (queryParams) {
|
|
67
|
-
for (const [key, value] of Object.entries(queryParams)) {
|
|
68
|
-
if (value === undefined)
|
|
69
|
-
continue;
|
|
70
|
-
url.searchParams.set(key, String(value));
|
|
71
|
-
}
|
|
98
|
+
path = path.split(`{${key}}`).join(encodeURIComponent(String(value)));
|
|
72
99
|
}
|
|
100
|
+
const base = serverUrl.endsWith("/") ? serverUrl : `${serverUrl}/`;
|
|
101
|
+
const url = new URL(path.replace(/^\//, ""), base);
|
|
102
|
+
for (const [key, value] of Object.entries(queryParams))
|
|
103
|
+
url.searchParams.set(key, String(value));
|
|
73
104
|
return url.toString();
|
|
74
105
|
}
|
|
106
|
+
/**
|
|
107
|
+
* URL without its query string, so presigned tokens never reach step records or logs.
|
|
108
|
+
* @category Http
|
|
109
|
+
*/
|
|
110
|
+
export function redactUrl(url) {
|
|
111
|
+
try {
|
|
112
|
+
const parsed = new URL(url);
|
|
113
|
+
return `${parsed.origin}${parsed.pathname}`;
|
|
114
|
+
}
|
|
115
|
+
catch {
|
|
116
|
+
return url.split("?")[0] ?? url;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
function pathOf(url) {
|
|
120
|
+
try {
|
|
121
|
+
return new URL(url).pathname;
|
|
122
|
+
}
|
|
123
|
+
catch {
|
|
124
|
+
return url;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
function parseErrorBody(text) {
|
|
128
|
+
if (!text)
|
|
129
|
+
return undefined;
|
|
130
|
+
try {
|
|
131
|
+
return JSON.parse(text);
|
|
132
|
+
}
|
|
133
|
+
catch {
|
|
134
|
+
return text.slice(0, MAX_ERROR_BODY_CHARS);
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
function adobeHttpErrorMessage(status, method, path, body) {
|
|
138
|
+
const detail = providerDetail(body);
|
|
139
|
+
const base = `Adobe API returned HTTP ${status} for ${method} ${path}`;
|
|
140
|
+
return detail ? `${base}: ${detail}` : `${base}.`;
|
|
141
|
+
}
|
|
142
|
+
function providerDetail(body) {
|
|
143
|
+
if (!isRecord(body))
|
|
144
|
+
return typeof body === "string" && body.length > 0 ? body.slice(0, 500) : undefined;
|
|
145
|
+
if (typeof body.error_description === "string")
|
|
146
|
+
return body.error_description;
|
|
147
|
+
if (typeof body.message === "string")
|
|
148
|
+
return body.message;
|
|
149
|
+
if (typeof body.error === "string")
|
|
150
|
+
return body.error;
|
|
151
|
+
if (isRecord(body.error) && typeof body.error.message === "string")
|
|
152
|
+
return body.error.message;
|
|
153
|
+
return undefined;
|
|
154
|
+
}
|
|
155
|
+
function isRecord(value) {
|
|
156
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
157
|
+
}
|
|
75
158
|
//# sourceMappingURL=client.js.map
|
package/dist/http/client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/http/client.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/http/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,YAAY,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA;AAE5F,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAA;AAyD3C;;;GAGG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAA;AAEpC,MAAM,iBAAiB,GAAG,MAAM,CAAA;AAChC,MAAM,gBAAgB,GAAG,IAAI,GAAG,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,CAAA;AACjD,MAAM,oBAAoB,GAAG,IAAI,CAAA;AAEjC;;;;;GAKG;AACH,MAAM,UAAU,qBAAqB,CAAC,OAA+B;IACnE,MAAM,U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spaces request starts so a credential set stays under a per-minute request limit.
|
|
3
|
+
* @category Http
|
|
4
|
+
*/
|
|
5
|
+
export interface RequestLimiter {
|
|
6
|
+
/** Wait for this request's turn. Rejects with the abort reason if `signal` aborts while waiting. */
|
|
7
|
+
acquire(signal?: AbortSignal): Promise<void>;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Clock seam for {@link createRequestLimiter}.
|
|
11
|
+
* @category Http
|
|
12
|
+
*/
|
|
13
|
+
export interface RequestLimiterClock {
|
|
14
|
+
/** Current time in milliseconds. */
|
|
15
|
+
now(): number;
|
|
16
|
+
/** Wait `ms`, rejecting when `signal` aborts. */
|
|
17
|
+
sleep(ms: number, signal?: AbortSignal): Promise<void>;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Create a limiter that starts at most `maxRequestsPerMinute` requests in any minute by keeping
|
|
21
|
+
* `60000 / maxRequestsPerMinute` ms between starts (no bursts). Each call reserves the next free
|
|
22
|
+
* slot up front, so concurrent callers queue in call order; a caller that aborts while waiting
|
|
23
|
+
* gives up its slot without it being reused, which only ever errs on the slow side.
|
|
24
|
+
* @category Http
|
|
25
|
+
*/
|
|
26
|
+
export declare function createRequestLimiter(maxRequestsPerMinute: number, clock?: RequestLimiterClock): RequestLimiter;
|
|
27
|
+
/**
|
|
28
|
+
* The limiter shared by every step in this process that uses the same client id, endpoint and limit,
|
|
29
|
+
* so concurrent steps and items draw on one budget.
|
|
30
|
+
* @category Http
|
|
31
|
+
*/
|
|
32
|
+
export declare function sharedRequestLimiter(options: {
|
|
33
|
+
clientId: string;
|
|
34
|
+
baseUrl?: string;
|
|
35
|
+
maxRequestsPerMinute: number;
|
|
36
|
+
}): RequestLimiter;
|
|
37
|
+
/**
|
|
38
|
+
* Forget the shared limiters (tests).
|
|
39
|
+
* @category Http
|
|
40
|
+
*/
|
|
41
|
+
export declare function resetSharedRequestLimiters(): void;
|
|
42
|
+
//# sourceMappingURL=request-limit.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"request-limit.d.ts","sourceRoot":"","sources":["../../src/http/request-limit.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B,oGAAoG;IACpG,OAAO,CAAC,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CAC7C;AAED;;;GAGG;AACH,MAAM,WAAW,mBAAmB;IAClC,oCAAoC;IACpC,GAAG,IAAI,MAAM,CAAA;IACb,iDAAiD;IACjD,KAAK,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CACvD;AAID;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,oBAAoB,EAAE,MAAM,EAAE,KAAK,GAAE,mBAAiC,GAAG,cAAc,CAY3H;AAID;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,oBAAoB,EAAE,MAAM,CAAA;CAAE,GAAG,cAAc,CAQlI;AAED;;;GAGG;AACH,wBAAgB,0BAA0B,IAAI,IAAI,CAEjD"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { sleep as abortableSleep } from "../runtime/abort.js";
|
|
2
|
+
const systemClock = { now: () => Date.now(), sleep: abortableSleep };
|
|
3
|
+
/**
|
|
4
|
+
* Create a limiter that starts at most `maxRequestsPerMinute` requests in any minute by keeping
|
|
5
|
+
* `60000 / maxRequestsPerMinute` ms between starts (no bursts). Each call reserves the next free
|
|
6
|
+
* slot up front, so concurrent callers queue in call order; a caller that aborts while waiting
|
|
7
|
+
* gives up its slot without it being reused, which only ever errs on the slow side.
|
|
8
|
+
* @category Http
|
|
9
|
+
*/
|
|
10
|
+
export function createRequestLimiter(maxRequestsPerMinute, clock = systemClock) {
|
|
11
|
+
const spacingMs = 60_000 / maxRequestsPerMinute;
|
|
12
|
+
let nextStart = Number.NEGATIVE_INFINITY;
|
|
13
|
+
return {
|
|
14
|
+
async acquire(signal) {
|
|
15
|
+
signal?.throwIfAborted();
|
|
16
|
+
const now = clock.now();
|
|
17
|
+
const start = Math.max(now, nextStart);
|
|
18
|
+
nextStart = start + spacingMs;
|
|
19
|
+
if (start > now)
|
|
20
|
+
await clock.sleep(start - now, signal);
|
|
21
|
+
},
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
const shared = new Map();
|
|
25
|
+
/**
|
|
26
|
+
* The limiter shared by every step in this process that uses the same client id, endpoint and limit,
|
|
27
|
+
* so concurrent steps and items draw on one budget.
|
|
28
|
+
* @category Http
|
|
29
|
+
*/
|
|
30
|
+
export function sharedRequestLimiter(options) {
|
|
31
|
+
const key = JSON.stringify([options.clientId, options.baseUrl ?? "", options.maxRequestsPerMinute]);
|
|
32
|
+
let limiter = shared.get(key);
|
|
33
|
+
if (!limiter) {
|
|
34
|
+
limiter = createRequestLimiter(options.maxRequestsPerMinute);
|
|
35
|
+
shared.set(key, limiter);
|
|
36
|
+
}
|
|
37
|
+
return limiter;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Forget the shared limiters (tests).
|
|
41
|
+
* @category Http
|
|
42
|
+
*/
|
|
43
|
+
export function resetSharedRequestLimiters() {
|
|
44
|
+
shared.clear();
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=request-limit.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"request-limit.js","sourceRoot":"","sources":["../../src/http/request-limit.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,IAAI,cAAc,EAAE,MAAM,qBAAqB,CAAA;AAsB7D,MAAM,WAAW,GAAwB,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,GAAG,EAAE,EAAE,KAAK,EAAE,cAAc,EAAE,CAAA;AAEzF;;;;;;GAMG;AACH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
|
1
|
-
|
|
2
|
-
|
|
1
|
+
export { adobeConfigSchema } from "./config.js";
|
|
2
|
+
export type { AdobeConfig } from "./config.js";
|
|
3
|
+
export { GENERATED_CAPABILITY_COUNT, generatedCapabilities } from "./generated/index.js";
|
|
3
4
|
/**
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* One capability per OpenAPI operation across Firefly Services families
|
|
7
|
-
* (`firefly`, `photoshop` v2, `express`, `indesign`, `substance3d`, `illustrator`,
|
|
8
|
-
* `creative-production`, `audio-video`). Capability ids are family-prefixed kebab, e.g.
|
|
9
|
-
* `@executioncontrolprotocol/adobe-firefly-services.firefly-generate-images-v5-async`.
|
|
10
|
-
*
|
|
11
|
-
* Auth uses OAuth Server-to-Server (`client_credentials`). Bind secrets via
|
|
12
|
-
* `secrets("adobe-firefly-services/client-id")` /
|
|
13
|
-
* `secrets("adobe-firefly-services/client-secret")` or `env(...)`.
|
|
14
|
-
*
|
|
15
|
-
* @category Extensions
|
|
5
|
+
* Plugin id. Capability ids are `${PLUGIN_ID}.<family>-<operation>`.
|
|
6
|
+
* @category Plugins
|
|
16
7
|
*/
|
|
17
|
-
export declare const
|
|
8
|
+
export declare const PLUGIN_ID = "@executioncontrolprotocol/adobe-firefly-services";
|
|
18
9
|
/**
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
* @category
|
|
10
|
+
* Adobe Firefly Services plugin. Capabilities are generated from the vendored OpenAPI specs;
|
|
11
|
+
* handler code loads on first call.
|
|
12
|
+
* @category Plugins
|
|
22
13
|
*/
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
14
|
+
declare const _default: import("@executioncontrolprotocol/plugin-sdk").PluginDefinition<import("zod").ZodObject<{
|
|
15
|
+
clientId: import("zod").ZodString;
|
|
16
|
+
clientSecret: import("zod").ZodString;
|
|
17
|
+
scopes: import("zod").ZodOptional<import("zod").ZodString>;
|
|
18
|
+
imsEndpoint: import("zod").ZodOptional<import("zod").ZodURL>;
|
|
19
|
+
baseUrl: import("zod").ZodOptional<import("zod").ZodURL>;
|
|
20
|
+
pollIntervalMs: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
21
|
+
pollTimeoutMs: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
22
|
+
maxRequestsPerMinute: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
23
|
+
}, import("zod/v4/core").$strip>, {
|
|
24
|
+
"substance3d-create-space-from-frame-io-v2": import("@executioncontrolprotocol/plugin-sdk").CapabilityDefinition<import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>, import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>, Record<string, unknown> | undefined>;
|
|
25
|
+
"substance3d-create-space-from-next-frame-io-v2": import("@executioncontrolprotocol/plugin-sdk").CapabilityDefinition<import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>, import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>, Record<string, unknown> | undefined>;
|
|
26
|
+
"substance3d-create-space-url-v2": import("@executioncontrolprotocol/plugin-sdk").CapabilityDefinition<import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>, import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>, Record<string, unknown> | undefined>;
|
|
27
|
+
"substance3d-v1-composites-compose": import("@executioncontrolprotocol/plugin-sdk").CapabilityDefinition<import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>, import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>, Record<string, unknown> | undefined>;
|
|
28
|
+
"substance3d-v1-scenes-assemble": import("@executioncontrolprotocol/plugin-sdk").CapabilityDefinition<import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>, import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>, Record<string, unknown> | undefined>;
|
|
29
|
+
"substance3d-v1-scenes-convert": import("@executioncontrolprotocol/plugin-sdk").CapabilityDefinition<import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>, import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>, Record<string, unknown> | undefined>;
|
|
30
|
+
"substance3d-v1-scenes-describe": import("@executioncontrolprotocol/plugin-sdk").CapabilityDefinition<import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>, import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>, Record<string, unknown> | undefined>;
|
|
31
|
+
"substance3d-v1-scenes-render": import("@executioncontrolprotocol/plugin-sdk").CapabilityDefinition<import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>, import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>, Record<string, unknown> | undefined>;
|
|
32
|
+
"substance3d-v1-scenes-render-basic": import("@executioncontrolprotocol/plugin-sdk").CapabilityDefinition<import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>, import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>, Record<string, unknown> | undefined>;
|
|
33
|
+
"photoshop-actions": import("@executioncontrolprotocol/plugin-sdk").CapabilityDefinition<import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>, import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>, Record<string, unknown> | undefined>;
|
|
34
|
+
"photoshop-auto-crop": import("@executioncontrolprotocol/plugin-sdk").CapabilityDefinition<import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>, import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>, Record<string, unknown> | undefined>;
|
|
35
|
+
"photoshop-create-artboard": import("@executioncontrolprotocol/plugin-sdk").CapabilityDefinition<import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>, import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>, Record<string, unknown> | undefined>;
|
|
36
|
+
"photoshop-create-composite": import("@executioncontrolprotocol/plugin-sdk").CapabilityDefinition<import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>, import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>, Record<string, unknown> | undefined>;
|
|
37
|
+
"photoshop-edit": import("@executioncontrolprotocol/plugin-sdk").CapabilityDefinition<import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>, import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>, Record<string, unknown> | undefined>;
|
|
38
|
+
"photoshop-generate-manifest": import("@executioncontrolprotocol/plugin-sdk").CapabilityDefinition<import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>, import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>, Record<string, unknown> | undefined>;
|
|
39
|
+
"indesign-convert-pdfto-in-design": import("@executioncontrolprotocol/plugin-sdk").CapabilityDefinition<import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>, import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>, Record<string, unknown> | undefined>;
|
|
40
|
+
"indesign-data-merge": import("@executioncontrolprotocol/plugin-sdk").CapabilityDefinition<import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>, import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>, Record<string, unknown> | undefined>;
|
|
41
|
+
"indesign-data-merge-tags": import("@executioncontrolprotocol/plugin-sdk").CapabilityDefinition<import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>, import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>, Record<string, unknown> | undefined>;
|
|
42
|
+
"indesign-delete-custom-script": import("@executioncontrolprotocol/plugin-sdk").CapabilityDefinition<import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>, import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>, Record<string, unknown> | undefined>;
|
|
43
|
+
"indesign-execute-custom-script": import("@executioncontrolprotocol/plugin-sdk").CapabilityDefinition<import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>, import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>, Record<string, unknown> | undefined>;
|
|
44
|
+
"indesign-get-custom-script-details": import("@executioncontrolprotocol/plugin-sdk").CapabilityDefinition<import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>, import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>, Record<string, unknown> | undefined>;
|
|
45
|
+
"indesign-get-document-info": import("@executioncontrolprotocol/plugin-sdk").CapabilityDefinition<import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>, import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>, Record<string, unknown> | undefined>;
|
|
46
|
+
"indesign-list-app-versions": import("@executioncontrolprotocol/plugin-sdk").CapabilityDefinition<import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>, import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>, Record<string, unknown> | undefined>;
|
|
47
|
+
"indesign-list-custom-scripts": import("@executioncontrolprotocol/plugin-sdk").CapabilityDefinition<import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>, import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>, Record<string, unknown> | undefined>;
|
|
48
|
+
"indesign-remap-links": import("@executioncontrolprotocol/plugin-sdk").CapabilityDefinition<import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>, import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>, Record<string, unknown> | undefined>;
|
|
49
|
+
"indesign-rendition-job": import("@executioncontrolprotocol/plugin-sdk").CapabilityDefinition<import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>, import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>, Record<string, unknown> | undefined>;
|
|
50
|
+
"indesign-update-script-app-version": import("@executioncontrolprotocol/plugin-sdk").CapabilityDefinition<import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>, import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>, Record<string, unknown> | undefined>;
|
|
51
|
+
"illustrator-create-rendition": import("@executioncontrolprotocol/plugin-sdk").CapabilityDefinition<import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>, import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>, Record<string, unknown> | undefined>;
|
|
52
|
+
"illustrator-data-merge": import("@executioncontrolprotocol/plugin-sdk").CapabilityDefinition<import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>, import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>, Record<string, unknown> | undefined>;
|
|
53
|
+
"illustrator-execute-custom-script-capability": import("@executioncontrolprotocol/plugin-sdk").CapabilityDefinition<import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>, import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>, Record<string, unknown> | undefined>;
|
|
54
|
+
"illustrator-trace-image": import("@executioncontrolprotocol/plugin-sdk").CapabilityDefinition<import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>, import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>, Record<string, unknown> | undefined>;
|
|
55
|
+
"firefly-adaptive-composite": import("@executioncontrolprotocol/plugin-sdk").CapabilityDefinition<import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>, import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>, Record<string, unknown> | undefined>;
|
|
56
|
+
"firefly-expand-images-v3-async": import("@executioncontrolprotocol/plugin-sdk").CapabilityDefinition<import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>, import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>, Record<string, unknown> | undefined>;
|
|
57
|
+
"firefly-fill-images-v3-async": import("@executioncontrolprotocol/plugin-sdk").CapabilityDefinition<import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>, import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>, Record<string, unknown> | undefined>;
|
|
58
|
+
"firefly-generate-images-v3-async": import("@executioncontrolprotocol/plugin-sdk").CapabilityDefinition<import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>, import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>, Record<string, unknown> | undefined>;
|
|
59
|
+
"firefly-generate-images-v5-async": import("@executioncontrolprotocol/plugin-sdk").CapabilityDefinition<import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>, import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>, Record<string, unknown> | undefined>;
|
|
60
|
+
"firefly-generate-object-composite-v3-async": import("@executioncontrolprotocol/plugin-sdk").CapabilityDefinition<import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>, import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>, Record<string, unknown> | undefined>;
|
|
61
|
+
"firefly-generate-similar-images-v3-async": import("@executioncontrolprotocol/plugin-sdk").CapabilityDefinition<import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>, import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>, Record<string, unknown> | undefined>;
|
|
62
|
+
"firefly-generate-video-v3": import("@executioncontrolprotocol/plugin-sdk").CapabilityDefinition<import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>, import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>, Record<string, unknown> | undefined>;
|
|
63
|
+
"firefly-get-custom-models": import("@executioncontrolprotocol/plugin-sdk").CapabilityDefinition<import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>, import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>, Record<string, unknown> | undefined>;
|
|
64
|
+
"firefly-precise-composite": import("@executioncontrolprotocol/plugin-sdk").CapabilityDefinition<import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>, import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>, Record<string, unknown> | undefined>;
|
|
65
|
+
"firefly-precise-upsampler-v3-async": import("@executioncontrolprotocol/plugin-sdk").CapabilityDefinition<import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>, import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>, Record<string, unknown> | undefined>;
|
|
66
|
+
"express-export-rendition": import("@executioncontrolprotocol/plugin-sdk").CapabilityDefinition<import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>, import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>, Record<string, unknown> | undefined>;
|
|
67
|
+
"express-generate-variation": import("@executioncontrolprotocol/plugin-sdk").CapabilityDefinition<import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>, import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>, Record<string, unknown> | undefined>;
|
|
68
|
+
"express-tagged-document-details": import("@executioncontrolprotocol/plugin-sdk").CapabilityDefinition<import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>, import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>, Record<string, unknown> | undefined>;
|
|
69
|
+
"express-tagged-documents": import("@executioncontrolprotocol/plugin-sdk").CapabilityDefinition<import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>, import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>, Record<string, unknown> | undefined>;
|
|
70
|
+
"creative-production-batch-execute": import("@executioncontrolprotocol/plugin-sdk").CapabilityDefinition<import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>, import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>, Record<string, unknown> | undefined>;
|
|
71
|
+
"creative-production-list-batch-executions": import("@executioncontrolprotocol/plugin-sdk").CapabilityDefinition<import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>, import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>, Record<string, unknown> | undefined>;
|
|
72
|
+
"creative-production-list-batches": import("@executioncontrolprotocol/plugin-sdk").CapabilityDefinition<import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>, import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>, Record<string, unknown> | undefined>;
|
|
73
|
+
"audio-video-avatars": import("@executioncontrolprotocol/plugin-sdk").CapabilityDefinition<import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>, import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>, Record<string, unknown> | undefined>;
|
|
74
|
+
"audio-video-dub": import("@executioncontrolprotocol/plugin-sdk").CapabilityDefinition<import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>, import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>, Record<string, unknown> | undefined>;
|
|
75
|
+
"audio-video-dub-translate-lipsync": import("@executioncontrolprotocol/plugin-sdk").CapabilityDefinition<import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>, import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>, Record<string, unknown> | undefined>;
|
|
76
|
+
"audio-video-generate-avatar": import("@executioncontrolprotocol/plugin-sdk").CapabilityDefinition<import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>, import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>, Record<string, unknown> | undefined>;
|
|
77
|
+
"audio-video-generate-reframed-video": import("@executioncontrolprotocol/plugin-sdk").CapabilityDefinition<import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>, import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>, Record<string, unknown> | undefined>;
|
|
78
|
+
"audio-video-generate-reframed-video-v2": import("@executioncontrolprotocol/plugin-sdk").CapabilityDefinition<import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>, import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>, Record<string, unknown> | undefined>;
|
|
79
|
+
"audio-video-generate-speech": import("@executioncontrolprotocol/plugin-sdk").CapabilityDefinition<import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>, import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>, Record<string, unknown> | undefined>;
|
|
80
|
+
"audio-video-get-presets": import("@executioncontrolprotocol/plugin-sdk").CapabilityDefinition<import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>, import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>, Record<string, unknown> | undefined>;
|
|
81
|
+
"audio-video-list-render-jobs": import("@executioncontrolprotocol/plugin-sdk").CapabilityDefinition<import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>, import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>, Record<string, unknown> | undefined>;
|
|
82
|
+
"audio-video-template-describe": import("@executioncontrolprotocol/plugin-sdk").CapabilityDefinition<import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>, import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>, Record<string, unknown> | undefined>;
|
|
83
|
+
"audio-video-template-render": import("@executioncontrolprotocol/plugin-sdk").CapabilityDefinition<import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>, import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>, Record<string, unknown> | undefined>;
|
|
84
|
+
"audio-video-transcribe": import("@executioncontrolprotocol/plugin-sdk").CapabilityDefinition<import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>, import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>, Record<string, unknown> | undefined>;
|
|
85
|
+
"audio-video-transcribe-translate-lipsync": import("@executioncontrolprotocol/plugin-sdk").CapabilityDefinition<import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>, import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>, Record<string, unknown> | undefined>;
|
|
86
|
+
"audio-video-voices": import("@executioncontrolprotocol/plugin-sdk").CapabilityDefinition<import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>, import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>, Record<string, unknown> | undefined>;
|
|
87
|
+
}>;
|
|
88
|
+
export default _default;
|
|
35
89
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAA;AAC/C,YAAY,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAC9C,OAAO,EAAE,0BAA0B,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAA;AAExF;;;GAGG;AACH,eAAO,MAAM,SAAS,qDAAqD,CAAA;AAE3E;;;;GAIG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACH,wBASE"}
|
package/dist/index.js
CHANGED
|
@@ -1,39 +1,25 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { definePlugin } from "@executioncontrolprotocol/plugin-sdk";
|
|
2
|
+
import { adobeConfigSchema } from "./config.js";
|
|
3
|
+
import { generatedCapabilities } from "./generated/index.js";
|
|
4
|
+
export { adobeConfigSchema } from "./config.js";
|
|
5
|
+
export { GENERATED_CAPABILITY_COUNT, generatedCapabilities } from "./generated/index.js";
|
|
4
6
|
/**
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* One capability per OpenAPI operation across Firefly Services families
|
|
8
|
-
* (`firefly`, `photoshop` v2, `express`, `indesign`, `substance3d`, `illustrator`,
|
|
9
|
-
* `creative-production`, `audio-video`). Capability ids are family-prefixed kebab, e.g.
|
|
10
|
-
* `@executioncontrolprotocol/adobe-firefly-services.firefly-generate-images-v5-async`.
|
|
11
|
-
*
|
|
12
|
-
* Auth uses OAuth Server-to-Server (`client_credentials`). Bind secrets via
|
|
13
|
-
* `secrets("adobe-firefly-services/client-id")` /
|
|
14
|
-
* `secrets("adobe-firefly-services/client-secret")` or `env(...)`.
|
|
15
|
-
*
|
|
16
|
-
* @category Extensions
|
|
7
|
+
* Plugin id. Capability ids are `${PLUGIN_ID}.<family>-<operation>`.
|
|
8
|
+
* @category Plugins
|
|
17
9
|
*/
|
|
18
|
-
export const
|
|
19
|
-
...adobeGeneratedCapabilities,
|
|
20
|
-
]);
|
|
21
|
-
catalogExtension(adobeFireflyServicesExtension);
|
|
10
|
+
export const PLUGIN_ID = "@executioncontrolprotocol/adobe-firefly-services";
|
|
22
11
|
/**
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
* @category
|
|
12
|
+
* Adobe Firefly Services plugin. Capabilities are generated from the vendored OpenAPI specs;
|
|
13
|
+
* handler code loads on first call.
|
|
14
|
+
* @category Plugins
|
|
26
15
|
*/
|
|
27
|
-
export
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
export { extractAdobeStatusUrl, pollAdobeJob } from "./http/async-job.js";
|
|
37
|
-
export { collectManifestDestinationUrls, extractEmbeddedManifestJson, materializePhotoshopManifest, photoshopManifestDocumentSchema, photoshopManifestLayerSchema, } from "./runtime/photoshop-manifest.js";
|
|
38
|
-
export default adobeFireflyServicesExtension;
|
|
16
|
+
export default definePlugin({
|
|
17
|
+
id: PLUGIN_ID,
|
|
18
|
+
summary: "Adobe Firefly Services: Firefly image and video generation and Photoshop document edits.",
|
|
19
|
+
description: "One capability per Firefly Services API operation, generated from Adobe's OpenAPI specs: Firefly image generation, expand, fill, composites, upscaling and video, and Photoshop document edits, actions, UXP scripts, artboards and layer manifests. The config object holds OAuth server-to-server credentials (client id and secret as secret references). Async jobs are polled inside the step, which returns the job result. Request fields are top-level parameters; an optional body carries the rest of the JSON document. Files move by URL: pass presigned storage URLs as sources and output destinations.",
|
|
20
|
+
config: adobeConfigSchema,
|
|
21
|
+
capabilities: {
|
|
22
|
+
...generatedCapabilities,
|
|
23
|
+
},
|
|
24
|
+
});
|
|
39
25
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,sCAAsC,CAAA;AACnE,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAA;AAC/C,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAA;AAE5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAA;AAE/C,OAAO,EAAE,0BAA0B,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAA;AAExF;;;GAGG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,kDAAkD,CAAA;AAE3E;;;;GAIG;AACH,eAAe,YAAY,CAAC;IAC1B,EAAE,EAAE,SAAS;IACb,OAAO,EAAE,0FAA0F;IACnG,WAAW,EACT,ulBAAulB;IACzlB,MAAM,EAAE,iBAAiB;IACzB,YAAY,EAAE;QACZ,GAAG,qBAAqB;KACzB;CACF,CAAC,CAAA"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The abort reason as a throwable, defaulting to a DOMException named AbortError.
|
|
3
|
+
* @category Runtime
|
|
4
|
+
*/
|
|
5
|
+
export declare function abortReason(signal: AbortSignal): unknown;
|
|
6
|
+
/**
|
|
7
|
+
* Wait `ms`, rejecting early with the abort reason when `signal` aborts.
|
|
8
|
+
* @category Runtime
|
|
9
|
+
*/
|
|
10
|
+
export declare function sleep(ms: number, signal?: AbortSignal): Promise<void>;
|
|
11
|
+
/**
|
|
12
|
+
* Settle with `promise`, or reject with the abort reason if `signal` aborts first. The
|
|
13
|
+
* underlying work keeps running; use this for shared work one caller must not cancel.
|
|
14
|
+
* @category Runtime
|
|
15
|
+
*/
|
|
16
|
+
export declare function raceSignal<T>(promise: Promise<T>, signal?: AbortSignal): Promise<T>;
|
|
17
|
+
//# sourceMappingURL=abort.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"abort.d.ts","sourceRoot":"","sources":["../../src/runtime/abort.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,WAAW,GAAG,OAAO,CAExD;AAED;;;GAGG;AACH,wBAAgB,KAAK,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAgBrE;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,CAAC,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,CAAC,CAAC,CAiBnF"}
|