cliodot 1.2.2 → 1.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -0
- package/README.md +81 -0
- package/dist/AuthAppClient.d.ts +1 -0
- package/dist/AuthAppClient.d.ts.map +1 -1
- package/dist/AuthAppClient.js +199 -1
- package/dist/CommercialAppClient.d.ts +178 -0
- package/dist/CommercialAppClient.d.ts.map +1 -0
- package/dist/CommercialAppClient.js +576 -0
- package/dist/ConnectorBuilder.js +104 -1
- package/dist/Events.d.ts +2 -0
- package/dist/Events.d.ts.map +1 -1
- package/dist/Events.js +325 -1
- package/dist/Flosync.js +296 -1
- package/dist/FlosyncClient.js +429 -1
- package/dist/FunctionBuilder.js +65 -1
- package/dist/IdentityAppClient.d.ts +23 -0
- package/dist/IdentityAppClient.d.ts.map +1 -0
- package/dist/IdentityAppClient.js +197 -0
- package/dist/MemoryAppClient.d.ts +28 -0
- package/dist/MemoryAppClient.d.ts.map +1 -0
- package/dist/MemoryAppClient.js +149 -0
- package/dist/MemoryClient.d.ts +8 -0
- package/dist/MemoryClient.d.ts.map +1 -0
- package/dist/MemoryClient.js +20 -0
- package/dist/OAuthAppClient.d.ts +1 -0
- package/dist/OAuthAppClient.d.ts.map +1 -1
- package/dist/OAuthAppClient.js +269 -1
- package/dist/ProviderServicesClient.d.ts +24 -0
- package/dist/ProviderServicesClient.d.ts.map +1 -0
- package/dist/ProviderServicesClient.js +158 -0
- package/dist/Surface.d.ts +2 -0
- package/dist/Surface.d.ts.map +1 -1
- package/dist/Surface.js +255 -1
- package/dist/ValidatorBuilder.js +24 -1
- package/dist/Webhooks.d.ts +20 -0
- package/dist/Webhooks.d.ts.map +1 -0
- package/dist/Webhooks.js +61 -0
- package/dist/WorkflowBuilder.js +279 -1
- package/dist/__tests__/CommercialAppClient.test.d.ts +2 -0
- package/dist/__tests__/CommercialAppClient.test.d.ts.map +1 -0
- package/dist/__tests__/CommercialAppClient.test.js +217 -0
- package/dist/__tests__/Events.test.js +191 -1
- package/dist/__tests__/IdentityAppClient.test.d.ts +2 -0
- package/dist/__tests__/IdentityAppClient.test.d.ts.map +1 -0
- package/dist/__tests__/IdentityAppClient.test.js +232 -0
- package/dist/__tests__/OAuthAppClient.test.js +300 -1
- package/dist/__tests__/ProviderServicesClient.test.d.ts +2 -0
- package/dist/__tests__/ProviderServicesClient.test.d.ts.map +1 -0
- package/dist/__tests__/ProviderServicesClient.test.js +131 -0
- package/dist/__tests__/Surface.test.js +150 -1
- package/dist/__tests__/errors.test.js +54 -1
- package/dist/__tests__/function.test.js +58 -1
- package/dist/__tests__/helpers.d.ts +5 -0
- package/dist/__tests__/helpers.d.ts.map +1 -0
- package/dist/__tests__/helpers.js +10 -0
- package/dist/__tests__/localhost-lookup.test.d.ts +2 -0
- package/dist/__tests__/localhost-lookup.test.d.ts.map +1 -0
- package/dist/__tests__/localhost-lookup.test.js +26 -0
- package/dist/__tests__/parse-api-error.test.js +26 -1
- package/dist/__tests__/runner.test.js +156 -1
- package/dist/connectors/builtin.js +354 -1
- package/dist/connectors/registry.js +300 -1
- package/dist/decorators/build.js +105 -1
- package/dist/decorators/connector.js +56 -1
- package/dist/decorators/index.js +34 -1
- package/dist/decorators/metadata.js +338 -1
- package/dist/decorators/steps.js +220 -1
- package/dist/decorators/workflow.js +52 -1
- package/dist/errors.js +76 -1
- package/dist/http/__tests__/cliodot-request.environment.test.d.ts +2 -0
- package/dist/http/__tests__/cliodot-request.environment.test.d.ts.map +1 -0
- package/dist/http/__tests__/cliodot-request.environment.test.js +37 -0
- package/dist/http/__tests__/cliodot-result.test.d.ts +2 -0
- package/dist/http/__tests__/cliodot-result.test.d.ts.map +1 -0
- package/dist/http/__tests__/cliodot-result.test.js +57 -0
- package/dist/http/__tests__/events-instance-id.test.d.ts +2 -0
- package/dist/http/__tests__/events-instance-id.test.d.ts.map +1 -0
- package/dist/http/__tests__/events-instance-id.test.js +45 -0
- package/dist/http/cliodot-request.d.ts +35 -0
- package/dist/http/cliodot-request.d.ts.map +1 -0
- package/dist/http/cliodot-request.js +105 -0
- package/dist/http/cliodot-result.d.ts +40 -0
- package/dist/http/cliodot-result.d.ts.map +1 -0
- package/dist/http/cliodot-result.js +139 -0
- package/dist/http/create-client.d.ts +3 -0
- package/dist/http/create-client.d.ts.map +1 -0
- package/dist/http/create-client.js +14 -0
- package/dist/http/events-instance-id.d.ts +11 -0
- package/dist/http/events-instance-id.d.ts.map +1 -0
- package/dist/http/events-instance-id.js +86 -0
- package/dist/http/localhost-lookup.d.ts +12 -0
- package/dist/http/localhost-lookup.d.ts.map +1 -0
- package/dist/http/localhost-lookup.js +67 -0
- package/dist/http/parse-api-error.js +56 -1
- package/dist/http/sanitize-execution-headers.js +79 -1
- package/dist/identity-offline-verify.d.ts +6 -0
- package/dist/identity-offline-verify.d.ts.map +1 -0
- package/dist/identity-offline-verify.js +174 -0
- package/dist/identity-token-cache.d.ts +6 -0
- package/dist/identity-token-cache.d.ts.map +1 -0
- package/dist/identity-token-cache.js +51 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +108 -1
- package/dist/runner/ProcessorEngine.js +1311 -1
- package/dist/runner/connector.executor.js +1786 -1
- package/dist/runner/utilities/math.executor.js +153 -1
- package/dist/runner/utilities/random.executor.js +151 -1
- package/dist/runner/utilities/string.executor.js +825 -1
- package/dist/template.js +127 -1
- package/dist/transformers/StepsToNodesTransformer.js +214 -1
- package/dist/transformers/WorkflowTransformer.js +189 -1
- package/dist/types/auth-app.api.d.ts +2 -0
- package/dist/types/auth-app.api.d.ts.map +1 -1
- package/dist/types/auth-app.api.js +2 -1
- package/dist/types/builtin.js +2 -1
- package/dist/types/client.api.js +2 -1
- package/dist/types/commercial-app.api.d.ts +963 -0
- package/dist/types/commercial-app.api.d.ts.map +1 -0
- package/dist/types/commercial-app.api.js +2 -0
- package/dist/types/connector.js +2 -1
- package/dist/types/context.js +2 -1
- package/dist/types/event-app.api.d.ts +8 -0
- package/dist/types/event-app.api.d.ts.map +1 -1
- package/dist/types/event-app.api.js +2 -1
- package/dist/types/function.js +2 -1
- package/dist/types/identity-app.api.d.ts +99 -0
- package/dist/types/identity-app.api.d.ts.map +1 -0
- package/dist/types/identity-app.api.js +2 -0
- package/dist/types/index.js +23 -1
- package/dist/types/memory-app.api.d.ts +140 -0
- package/dist/types/memory-app.api.d.ts.map +1 -0
- package/dist/types/memory-app.api.js +2 -0
- package/dist/types/oauth-app.api.d.ts +2 -0
- package/dist/types/oauth-app.api.d.ts.map +1 -1
- package/dist/types/oauth-app.api.js +105 -1
- package/dist/types/provider-services.api.d.ts +98 -0
- package/dist/types/provider-services.api.d.ts.map +1 -0
- package/dist/types/provider-services.api.js +2 -0
- package/dist/types/validator.js +2 -1
- package/dist/types/webhook-app.api.d.ts +2 -0
- package/dist/types/webhook-app.api.d.ts.map +1 -0
- package/dist/types/webhook-app.api.js +2 -0
- package/dist/types/workflow.js +33 -1
- package/dist/validators/validators.js +478 -1
- package/dist/variable.js +37 -1
- package/package.json +3 -2
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.createCliodotAxios = createCliodotAxios;
|
|
7
|
+
const axios_1 = __importDefault(require("axios"));
|
|
8
|
+
const localhost_lookup_1 = require("./localhost-lookup");
|
|
9
|
+
function createCliodotAxios(config = {}) {
|
|
10
|
+
return axios_1.default.create({
|
|
11
|
+
...(0, localhost_lookup_1.cliodotHttpAgents)(),
|
|
12
|
+
...config,
|
|
13
|
+
});
|
|
14
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare const CLIODOT_INSTANCE_HEADER = "x-cliodot-instance-id";
|
|
2
|
+
/**
|
|
3
|
+
* Stable id for this Event app on this computer.
|
|
4
|
+
* Same machine always hashes the same; a different computer gets a new id.
|
|
5
|
+
*/
|
|
6
|
+
export declare function resolveEventsInstanceId(input: {
|
|
7
|
+
appId: string;
|
|
8
|
+
instanceId?: string;
|
|
9
|
+
}): string;
|
|
10
|
+
export declare function applyInstanceHeader(headers: Record<string, string>, instanceId: string): Record<string, string>;
|
|
11
|
+
//# sourceMappingURL=events-instance-id.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"events-instance-id.d.ts","sourceRoot":"","sources":["../../src/http/events-instance-id.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,uBAAuB,0BAA0B,CAAC;AA+D/D;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE;IAC7C,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,GAAG,MAAM,CAWT;AAED,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC/B,UAAU,EAAE,MAAM,GACjB,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAKxB"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CLIODOT_INSTANCE_HEADER = void 0;
|
|
4
|
+
exports.resolveEventsInstanceId = resolveEventsInstanceId;
|
|
5
|
+
exports.applyInstanceHeader = applyInstanceHeader;
|
|
6
|
+
const crypto_1 = require("crypto");
|
|
7
|
+
exports.CLIODOT_INSTANCE_HEADER = "x-cliodot-instance-id";
|
|
8
|
+
const INSTANCE_ID_RE = /^[A-Za-z0-9._-]{8,128}$/;
|
|
9
|
+
function sha256Hex(value) {
|
|
10
|
+
return (0, crypto_1.createHash)("sha256").update(value).digest("hex");
|
|
11
|
+
}
|
|
12
|
+
function isNodeRuntime() {
|
|
13
|
+
return typeof process !== "undefined" && Boolean(process.versions?.node);
|
|
14
|
+
}
|
|
15
|
+
function nodeMachineSeed() {
|
|
16
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
17
|
+
const os = require("os");
|
|
18
|
+
let username = "";
|
|
19
|
+
try {
|
|
20
|
+
username = os.userInfo()?.username || "";
|
|
21
|
+
}
|
|
22
|
+
catch {
|
|
23
|
+
username = "";
|
|
24
|
+
}
|
|
25
|
+
return [
|
|
26
|
+
os.hostname?.() || "",
|
|
27
|
+
os.platform?.() || "",
|
|
28
|
+
os.arch?.() || "",
|
|
29
|
+
username,
|
|
30
|
+
os.homedir?.() || "",
|
|
31
|
+
os.cpus?.()?.[0]?.model || "",
|
|
32
|
+
].join("|");
|
|
33
|
+
}
|
|
34
|
+
function readGlobal(name) {
|
|
35
|
+
return globalThis[name];
|
|
36
|
+
}
|
|
37
|
+
function browserInstanceSeed(appId) {
|
|
38
|
+
const key = `cliodot.events.instance.${appId}`;
|
|
39
|
+
const storage = readGlobal("localStorage");
|
|
40
|
+
try {
|
|
41
|
+
if (storage && typeof storage.getItem === "function") {
|
|
42
|
+
let stored = String(storage.getItem(key) || "");
|
|
43
|
+
if (!stored) {
|
|
44
|
+
stored =
|
|
45
|
+
typeof crypto_1.randomUUID === "function"
|
|
46
|
+
? (0, crypto_1.randomUUID)()
|
|
47
|
+
: sha256Hex(`${Date.now()}.${Math.random()}`);
|
|
48
|
+
storage.setItem(key, stored);
|
|
49
|
+
}
|
|
50
|
+
return stored;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
catch {
|
|
54
|
+
// private mode / disabled storage
|
|
55
|
+
}
|
|
56
|
+
const nav = readGlobal("navigator");
|
|
57
|
+
const scr = readGlobal("screen");
|
|
58
|
+
return [
|
|
59
|
+
nav?.userAgent || "",
|
|
60
|
+
nav?.language || "",
|
|
61
|
+
String(scr?.width || ""),
|
|
62
|
+
String(scr?.height || ""),
|
|
63
|
+
].join("|");
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Stable id for this Event app on this computer.
|
|
67
|
+
* Same machine always hashes the same; a different computer gets a new id.
|
|
68
|
+
*/
|
|
69
|
+
function resolveEventsInstanceId(input) {
|
|
70
|
+
const override = input.instanceId?.trim();
|
|
71
|
+
if (override) {
|
|
72
|
+
if (INSTANCE_ID_RE.test(override))
|
|
73
|
+
return override;
|
|
74
|
+
return sha256Hex(`cliodot-events:${input.appId}:override:${override}`);
|
|
75
|
+
}
|
|
76
|
+
const seed = isNodeRuntime()
|
|
77
|
+
? nodeMachineSeed()
|
|
78
|
+
: browserInstanceSeed(input.appId);
|
|
79
|
+
return sha256Hex(`cliodot-events|${input.appId}|${seed}`);
|
|
80
|
+
}
|
|
81
|
+
function applyInstanceHeader(headers, instanceId) {
|
|
82
|
+
if (instanceId) {
|
|
83
|
+
headers[exports.CLIODOT_INSTANCE_HEADER] = instanceId;
|
|
84
|
+
}
|
|
85
|
+
return headers;
|
|
86
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import http from "http";
|
|
2
|
+
import https from "https";
|
|
3
|
+
import type { LookupAddress, LookupOptions } from "dns";
|
|
4
|
+
type LookupCallback = (err: NodeJS.ErrnoException | null, address: string | LookupAddress[], family?: number) => void;
|
|
5
|
+
export declare function isLoopbackHostname(hostname: string): boolean;
|
|
6
|
+
export declare function localhostAwareLookup(hostname: string, options: LookupOptions | number | LookupCallback, callback?: LookupCallback): void;
|
|
7
|
+
export declare function cliodotHttpAgents(): {
|
|
8
|
+
httpAgent?: http.Agent;
|
|
9
|
+
httpsAgent?: https.Agent;
|
|
10
|
+
};
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=localhost-lookup.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"localhost-lookup.d.ts","sourceRoot":"","sources":["../../src/http/localhost-lookup.ts"],"names":[],"mappings":"AACA,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AAExD,KAAK,cAAc,GAAG,CACpB,GAAG,EAAE,MAAM,CAAC,cAAc,GAAG,IAAI,EACjC,OAAO,EAAE,MAAM,GAAG,aAAa,EAAE,EACjC,MAAM,CAAC,EAAE,MAAM,KACZ,IAAI,CAAC;AAEV,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAM5D;AAED,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,aAAa,GAAG,MAAM,GAAG,cAAc,EAChD,QAAQ,CAAC,EAAE,cAAc,GACxB,IAAI,CA4BN;AASD,wBAAgB,iBAAiB,IAAI;IACnC,SAAS,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC;IACvB,UAAU,CAAC,EAAE,KAAK,CAAC,KAAK,CAAC;CAC1B,CAeA"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.isLoopbackHostname = isLoopbackHostname;
|
|
7
|
+
exports.localhostAwareLookup = localhostAwareLookup;
|
|
8
|
+
exports.cliodotHttpAgents = cliodotHttpAgents;
|
|
9
|
+
const dns_1 = __importDefault(require("dns"));
|
|
10
|
+
const http_1 = __importDefault(require("http"));
|
|
11
|
+
const https_1 = __importDefault(require("https"));
|
|
12
|
+
function isLoopbackHostname(hostname) {
|
|
13
|
+
const host = String(hostname || "")
|
|
14
|
+
.trim()
|
|
15
|
+
.toLowerCase()
|
|
16
|
+
.replace(/\.$/, "");
|
|
17
|
+
return host === "localhost" || host.endsWith(".localhost");
|
|
18
|
+
}
|
|
19
|
+
function localhostAwareLookup(hostname, options, callback) {
|
|
20
|
+
if (typeof options === "function") {
|
|
21
|
+
callback = options;
|
|
22
|
+
options = {};
|
|
23
|
+
}
|
|
24
|
+
const cb = callback;
|
|
25
|
+
if (!cb)
|
|
26
|
+
return;
|
|
27
|
+
const opts = typeof options === "number" ? { family: options } : options || {};
|
|
28
|
+
if (isLoopbackHostname(hostname)) {
|
|
29
|
+
if (opts.family === 6) {
|
|
30
|
+
if (opts.all) {
|
|
31
|
+
cb(null, [{ address: "::1", family: 6 }]);
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
cb(null, "::1", 6);
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
if (opts.all) {
|
|
38
|
+
cb(null, [{ address: "127.0.0.1", family: 4 }]);
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
cb(null, "127.0.0.1", 4);
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
dns_1.default.lookup(hostname, opts, cb);
|
|
45
|
+
}
|
|
46
|
+
function isNodeRuntime() {
|
|
47
|
+
return typeof process !== "undefined" && Boolean(process.versions?.node);
|
|
48
|
+
}
|
|
49
|
+
let httpAgent;
|
|
50
|
+
let httpsAgent;
|
|
51
|
+
function cliodotHttpAgents() {
|
|
52
|
+
if (!isNodeRuntime())
|
|
53
|
+
return {};
|
|
54
|
+
if (!httpAgent) {
|
|
55
|
+
httpAgent = new http_1.default.Agent({
|
|
56
|
+
keepAlive: true,
|
|
57
|
+
lookup: localhostAwareLookup,
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
if (!httpsAgent) {
|
|
61
|
+
httpsAgent = new https_1.default.Agent({
|
|
62
|
+
keepAlive: true,
|
|
63
|
+
lookup: localhostAwareLookup,
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
return { httpAgent, httpsAgent };
|
|
67
|
+
}
|
|
@@ -1 +1,56 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.parseApiErrorMessage = parseApiErrorMessage;
|
|
4
|
+
exports.parseApiErrorCode = parseApiErrorCode;
|
|
5
|
+
exports.parseApiErrorStatus = parseApiErrorStatus;
|
|
6
|
+
function parseApiErrorMessage(data) {
|
|
7
|
+
if (!data || typeof data !== "object") {
|
|
8
|
+
return typeof data === "string" && data.trim() ? data.trim() : undefined;
|
|
9
|
+
}
|
|
10
|
+
const body = data;
|
|
11
|
+
if (typeof body.message === "string" && body.message.trim()) {
|
|
12
|
+
return body.message.trim();
|
|
13
|
+
}
|
|
14
|
+
if (typeof body.error === "string" && body.error.trim()) {
|
|
15
|
+
return body.error.trim();
|
|
16
|
+
}
|
|
17
|
+
if (body.error && typeof body.error === "object") {
|
|
18
|
+
const nested = body.error;
|
|
19
|
+
if (typeof nested.message === "string" && nested.message.trim()) {
|
|
20
|
+
return nested.message.trim();
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
return undefined;
|
|
24
|
+
}
|
|
25
|
+
function parseApiErrorCode(data) {
|
|
26
|
+
if (!data || typeof data !== "object") {
|
|
27
|
+
return undefined;
|
|
28
|
+
}
|
|
29
|
+
const body = data;
|
|
30
|
+
if (body.error && typeof body.error === "object") {
|
|
31
|
+
const nested = body.error;
|
|
32
|
+
if (typeof nested.code === "string" && nested.code.trim()) {
|
|
33
|
+
return nested.code.trim();
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
if (typeof body.code === "string" && body.code.trim()) {
|
|
37
|
+
return body.code.trim();
|
|
38
|
+
}
|
|
39
|
+
return undefined;
|
|
40
|
+
}
|
|
41
|
+
function parseApiErrorStatus(data, fallback) {
|
|
42
|
+
if (!data || typeof data !== "object") {
|
|
43
|
+
return fallback;
|
|
44
|
+
}
|
|
45
|
+
const body = data;
|
|
46
|
+
if (typeof body.statusCode === "number") {
|
|
47
|
+
return body.statusCode;
|
|
48
|
+
}
|
|
49
|
+
if (body.error && typeof body.error === "object") {
|
|
50
|
+
const nested = body.error;
|
|
51
|
+
if (typeof nested.statusCode === "number") {
|
|
52
|
+
return nested.statusCode;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
return fallback;
|
|
56
|
+
}
|
|
@@ -1 +1,79 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.sanitizeExecutionHeaders = sanitizeExecutionHeaders;
|
|
4
|
+
const BLOCKED_FOR_EXPLICIT_HEADERS = new Set([
|
|
5
|
+
"proxy-authorization",
|
|
6
|
+
"cookie",
|
|
7
|
+
"set-cookie",
|
|
8
|
+
"host",
|
|
9
|
+
"connection",
|
|
10
|
+
"content-length",
|
|
11
|
+
"expect",
|
|
12
|
+
"upgrade",
|
|
13
|
+
"te",
|
|
14
|
+
"trailer",
|
|
15
|
+
"transfer-encoding",
|
|
16
|
+
"keep-alive",
|
|
17
|
+
"www-authenticate",
|
|
18
|
+
]);
|
|
19
|
+
const DEFAULT_MAX_KEYS = 48;
|
|
20
|
+
const DEFAULT_MAX_NAME_LEN = 128;
|
|
21
|
+
const DEFAULT_MAX_VALUE_LEN = 8192;
|
|
22
|
+
const DEFAULT_MAX_TOTAL_VALUE_CHARS = 65536;
|
|
23
|
+
function isBlockedForExplicitExecutionHeaders(lower) {
|
|
24
|
+
if (BLOCKED_FOR_EXPLICIT_HEADERS.has(lower))
|
|
25
|
+
return true;
|
|
26
|
+
if (lower.startsWith("sec-"))
|
|
27
|
+
return true;
|
|
28
|
+
if (lower.startsWith("proxy-"))
|
|
29
|
+
return true;
|
|
30
|
+
return false;
|
|
31
|
+
}
|
|
32
|
+
function coerceHeaderValue(value) {
|
|
33
|
+
if (value === undefined || value === null)
|
|
34
|
+
return null;
|
|
35
|
+
if (typeof value === "string")
|
|
36
|
+
return value;
|
|
37
|
+
if (typeof value === "number" && Number.isFinite(value))
|
|
38
|
+
return String(value);
|
|
39
|
+
if (typeof value === "boolean")
|
|
40
|
+
return value ? "true" : "false";
|
|
41
|
+
if (Array.isArray(value)) {
|
|
42
|
+
const first = value.find((x) => x !== undefined && x !== null);
|
|
43
|
+
return coerceHeaderValue(first);
|
|
44
|
+
}
|
|
45
|
+
return null;
|
|
46
|
+
}
|
|
47
|
+
function sanitizeExecutionHeaders(raw, limits) {
|
|
48
|
+
const maxKeys = limits?.maxKeys ?? DEFAULT_MAX_KEYS;
|
|
49
|
+
const maxNameLen = limits?.maxNameLen ?? DEFAULT_MAX_NAME_LEN;
|
|
50
|
+
const maxValueLen = limits?.maxValueLen ?? DEFAULT_MAX_VALUE_LEN;
|
|
51
|
+
const maxTotalValueChars = limits?.maxTotalValueChars ?? DEFAULT_MAX_TOTAL_VALUE_CHARS;
|
|
52
|
+
if (!raw || typeof raw !== "object" || Array.isArray(raw))
|
|
53
|
+
return {};
|
|
54
|
+
let totalChars = 0;
|
|
55
|
+
const out = {};
|
|
56
|
+
let count = 0;
|
|
57
|
+
for (const [k, v] of Object.entries(raw)) {
|
|
58
|
+
if (count >= maxKeys)
|
|
59
|
+
break;
|
|
60
|
+
if (typeof k !== "string")
|
|
61
|
+
continue;
|
|
62
|
+
const name = k.trim();
|
|
63
|
+
if (!name || name.length > maxNameLen)
|
|
64
|
+
continue;
|
|
65
|
+
const lower = name.toLowerCase();
|
|
66
|
+
if (isBlockedForExplicitExecutionHeaders(lower))
|
|
67
|
+
continue;
|
|
68
|
+
const val = coerceHeaderValue(v);
|
|
69
|
+
if (val === null)
|
|
70
|
+
continue;
|
|
71
|
+
const clipped = val.length > maxValueLen ? val.slice(0, maxValueLen) : val;
|
|
72
|
+
if (totalChars + clipped.length > maxTotalValueChars)
|
|
73
|
+
break;
|
|
74
|
+
totalChars += clipped.length;
|
|
75
|
+
out[lower] = clipped;
|
|
76
|
+
count += 1;
|
|
77
|
+
}
|
|
78
|
+
return out;
|
|
79
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { IdentityOfflineVerifyOptions } from "./types/identity-app.api";
|
|
2
|
+
export declare function clearIdentityJwksCache(): void;
|
|
3
|
+
export declare function verifyIdentityTokenOffline(token: string, options: IdentityOfflineVerifyOptions): Promise<Record<string, unknown>>;
|
|
4
|
+
export declare function parseIdentityScopeClaim(tokenOrClaims: string | Record<string, unknown>): string[];
|
|
5
|
+
export declare function tokenHasScopes(tokenOrClaims: string | Record<string, unknown>, required: string[]): boolean;
|
|
6
|
+
//# sourceMappingURL=identity-offline-verify.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"identity-offline-verify.d.ts","sourceRoot":"","sources":["../src/identity-offline-verify.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAEV,4BAA4B,EAC7B,MAAM,0BAA0B,CAAC;AAoElC,wBAAgB,sBAAsB,IAAI,IAAI,CAE7C;AAED,wBAAsB,0BAA0B,CAC9C,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,4BAA4B,GACpC,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CA4ElC;AAED,wBAAgB,uBAAuB,CACrC,aAAa,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC9C,MAAM,EAAE,CA8BV;AAED,wBAAgB,cAAc,CAC5B,aAAa,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC/C,QAAQ,EAAE,MAAM,EAAE,GACjB,OAAO,CAQT"}
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.clearIdentityJwksCache = clearIdentityJwksCache;
|
|
7
|
+
exports.verifyIdentityTokenOffline = verifyIdentityTokenOffline;
|
|
8
|
+
exports.parseIdentityScopeClaim = parseIdentityScopeClaim;
|
|
9
|
+
exports.tokenHasScopes = tokenHasScopes;
|
|
10
|
+
const crypto_1 = __importDefault(require("crypto"));
|
|
11
|
+
const jsonwebtoken_1 = __importDefault(require("jsonwebtoken"));
|
|
12
|
+
const errors_1 = require("./errors");
|
|
13
|
+
const jwksCache = new Map();
|
|
14
|
+
function decodeJwtHeader(token) {
|
|
15
|
+
const parts = token.split(".");
|
|
16
|
+
if (parts.length < 2) {
|
|
17
|
+
throw new errors_1.CliodotApiError("Invalid JWT", { code: "IDENTITY_TOKEN_INVALID" });
|
|
18
|
+
}
|
|
19
|
+
try {
|
|
20
|
+
return JSON.parse(Buffer.from(parts[0], "base64url").toString("utf8"));
|
|
21
|
+
}
|
|
22
|
+
catch {
|
|
23
|
+
throw new errors_1.CliodotApiError("Invalid JWT header", {
|
|
24
|
+
code: "IDENTITY_TOKEN_INVALID",
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
function jwkToPem(jwk) {
|
|
29
|
+
return crypto_1.default
|
|
30
|
+
.createPublicKey({ key: jwk, format: "jwk" })
|
|
31
|
+
.export({ type: "spki", format: "pem" })
|
|
32
|
+
.toString();
|
|
33
|
+
}
|
|
34
|
+
async function loadJwksKeys(jwksUrl, cacheTtlMs, fetchImpl) {
|
|
35
|
+
const cached = jwksCache.get(jwksUrl);
|
|
36
|
+
if (cached && cached.expiresAt > Date.now()) {
|
|
37
|
+
return cached.keys;
|
|
38
|
+
}
|
|
39
|
+
const res = await fetchImpl(jwksUrl);
|
|
40
|
+
if (!res.ok) {
|
|
41
|
+
throw new errors_1.CliodotApiError(`JWKS fetch failed (${res.status})`, {
|
|
42
|
+
status: res.status,
|
|
43
|
+
code: "IDENTITY_JWT_KEYS_NOT_FOUND",
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
const body = (await res.json());
|
|
47
|
+
const keys = body.keys || [];
|
|
48
|
+
jwksCache.set(jwksUrl, {
|
|
49
|
+
keys,
|
|
50
|
+
expiresAt: Date.now() + cacheTtlMs,
|
|
51
|
+
});
|
|
52
|
+
return keys;
|
|
53
|
+
}
|
|
54
|
+
function pickRs256Key(keys, kid) {
|
|
55
|
+
if (kid) {
|
|
56
|
+
const match = keys.find((k) => k.kid === kid);
|
|
57
|
+
if (match)
|
|
58
|
+
return match;
|
|
59
|
+
}
|
|
60
|
+
return keys[0];
|
|
61
|
+
}
|
|
62
|
+
function clearIdentityJwksCache() {
|
|
63
|
+
jwksCache.clear();
|
|
64
|
+
}
|
|
65
|
+
async function verifyIdentityTokenOffline(token, options) {
|
|
66
|
+
if (!token?.trim()) {
|
|
67
|
+
throw new errors_1.CliodotApiError("token is required", {
|
|
68
|
+
code: "IDENTITY_TOKEN_INVALID",
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
const header = decodeJwtHeader(token.trim());
|
|
72
|
+
if (options.algorithm === "HS256") {
|
|
73
|
+
if (!options.secret?.trim()) {
|
|
74
|
+
throw new errors_1.CliodotApiError("HS256 verify requires secret");
|
|
75
|
+
}
|
|
76
|
+
try {
|
|
77
|
+
return jsonwebtoken_1.default.verify(token.trim(), options.secret, {
|
|
78
|
+
algorithms: ["HS256"],
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
catch (err) {
|
|
82
|
+
if (err?.name === "TokenExpiredError") {
|
|
83
|
+
throw new errors_1.CliodotApiError("Access token expired", {
|
|
84
|
+
code: "IDENTITY_TOKEN_EXPIRED",
|
|
85
|
+
status: 401,
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
throw new errors_1.CliodotApiError("Invalid access token", {
|
|
89
|
+
code: "IDENTITY_TOKEN_INVALID",
|
|
90
|
+
status: 401,
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
const fetchImpl = options.fetch || fetch;
|
|
95
|
+
let publicKeyPem = options.publicKeyPem?.trim();
|
|
96
|
+
if (!publicKeyPem) {
|
|
97
|
+
if (!options.jwksUrl?.trim()) {
|
|
98
|
+
throw new errors_1.CliodotApiError("RS256 verify requires jwksUrl or publicKeyPem");
|
|
99
|
+
}
|
|
100
|
+
const cacheTtlMs = options.cacheTtlMs ?? 300000;
|
|
101
|
+
let keys = await loadJwksKeys(options.jwksUrl.trim(), cacheTtlMs, fetchImpl);
|
|
102
|
+
let jwk = pickRs256Key(keys, header.kid);
|
|
103
|
+
if (!jwk && header.kid) {
|
|
104
|
+
jwksCache.delete(options.jwksUrl.trim());
|
|
105
|
+
keys = await loadJwksKeys(options.jwksUrl.trim(), cacheTtlMs, fetchImpl);
|
|
106
|
+
jwk = pickRs256Key(keys, header.kid);
|
|
107
|
+
}
|
|
108
|
+
if (!jwk) {
|
|
109
|
+
throw new errors_1.CliodotApiError("No matching JWKS key", {
|
|
110
|
+
code: "IDENTITY_JWT_KEYS_NOT_FOUND",
|
|
111
|
+
status: 401,
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
publicKeyPem = jwkToPem(jwk);
|
|
115
|
+
}
|
|
116
|
+
try {
|
|
117
|
+
return jsonwebtoken_1.default.verify(token.trim(), publicKeyPem, {
|
|
118
|
+
algorithms: ["RS256"],
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
catch (err) {
|
|
122
|
+
if (err?.name === "TokenExpiredError") {
|
|
123
|
+
throw new errors_1.CliodotApiError("Access token expired", {
|
|
124
|
+
code: "IDENTITY_TOKEN_EXPIRED",
|
|
125
|
+
status: 401,
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
throw new errors_1.CliodotApiError("Invalid access token", {
|
|
129
|
+
code: "IDENTITY_TOKEN_INVALID",
|
|
130
|
+
status: 401,
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
function parseIdentityScopeClaim(tokenOrClaims) {
|
|
135
|
+
let claims;
|
|
136
|
+
if (typeof tokenOrClaims === "string") {
|
|
137
|
+
const parts = tokenOrClaims.split(".");
|
|
138
|
+
if (parts.length < 2)
|
|
139
|
+
return [];
|
|
140
|
+
try {
|
|
141
|
+
claims = JSON.parse(Buffer.from(parts[1], "base64url").toString("utf8"));
|
|
142
|
+
}
|
|
143
|
+
catch {
|
|
144
|
+
return [];
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
else {
|
|
148
|
+
claims = tokenOrClaims;
|
|
149
|
+
}
|
|
150
|
+
const raw = claims.scope;
|
|
151
|
+
if (Array.isArray(raw)) {
|
|
152
|
+
return [...new Set(raw.map(String).map((s) => s.trim()).filter(Boolean))];
|
|
153
|
+
}
|
|
154
|
+
if (typeof raw === "string") {
|
|
155
|
+
return [
|
|
156
|
+
...new Set(raw
|
|
157
|
+
.split(/[\s,]+/)
|
|
158
|
+
.map((s) => s.trim())
|
|
159
|
+
.filter(Boolean)),
|
|
160
|
+
];
|
|
161
|
+
}
|
|
162
|
+
return [];
|
|
163
|
+
}
|
|
164
|
+
function tokenHasScopes(tokenOrClaims, required) {
|
|
165
|
+
const have = new Set(parseIdentityScopeClaim(tokenOrClaims));
|
|
166
|
+
for (const name of required || []) {
|
|
167
|
+
const n = String(name || "").trim();
|
|
168
|
+
if (!n)
|
|
169
|
+
continue;
|
|
170
|
+
if (!have.has(n))
|
|
171
|
+
return false;
|
|
172
|
+
}
|
|
173
|
+
return true;
|
|
174
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { IdentityTokenCacheOptions } from "./types/identity-app.api";
|
|
2
|
+
export declare function createIdentityTokenCache(options: IdentityTokenCacheOptions): {
|
|
3
|
+
getAccessToken: (targetAppId: string) => Promise<string>;
|
|
4
|
+
clear: (targetAppId?: string) => void;
|
|
5
|
+
};
|
|
6
|
+
//# sourceMappingURL=identity-token-cache.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"identity-token-cache.d.ts","sourceRoot":"","sources":["../src/identity-token-cache.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,yBAAyB,EAC1B,MAAM,0BAA0B,CAAC;AASlC,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,yBAAyB;kCAI9B,MAAM,KAAG,OAAO,CAAC,MAAM,CAAC;0BAoCtC,MAAM,KAAG,IAAI;EAS3C"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createIdentityTokenCache = createIdentityTokenCache;
|
|
4
|
+
const errors_1 = require("./errors");
|
|
5
|
+
function createIdentityTokenCache(options) {
|
|
6
|
+
const store = new Map();
|
|
7
|
+
const skewSeconds = options.skewSeconds ?? 60;
|
|
8
|
+
async function getAccessToken(targetAppId) {
|
|
9
|
+
if (!targetAppId?.trim()) {
|
|
10
|
+
throw new errors_1.CliodotApiError("targetAppId is required");
|
|
11
|
+
}
|
|
12
|
+
const key = targetAppId.trim();
|
|
13
|
+
const cached = store.get(key);
|
|
14
|
+
const now = Date.now();
|
|
15
|
+
if (cached && cached.expires_at - skewSeconds * 1000 > now) {
|
|
16
|
+
return cached.access_token;
|
|
17
|
+
}
|
|
18
|
+
let tokens;
|
|
19
|
+
if (cached?.refresh_token) {
|
|
20
|
+
try {
|
|
21
|
+
tokens = await options.client.refresh({
|
|
22
|
+
refresh_token: cached.refresh_token,
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
catch {
|
|
26
|
+
tokens = await options.client.authenticate({
|
|
27
|
+
target_app_id: key,
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
else {
|
|
32
|
+
tokens = await options.client.authenticate({
|
|
33
|
+
target_app_id: key,
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
store.set(key, {
|
|
37
|
+
access_token: tokens.access_token,
|
|
38
|
+
refresh_token: tokens.refresh_token,
|
|
39
|
+
expires_at: Date.now() + Math.max(1, tokens.expires_in) * 1000,
|
|
40
|
+
});
|
|
41
|
+
return tokens.access_token;
|
|
42
|
+
}
|
|
43
|
+
function clear(targetAppId) {
|
|
44
|
+
if (targetAppId?.trim()) {
|
|
45
|
+
store.delete(targetAppId.trim());
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
store.clear();
|
|
49
|
+
}
|
|
50
|
+
return { getAccessToken, clear };
|
|
51
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -10,6 +10,13 @@ export type { FlosyncClientConfig } from "./FlosyncClient";
|
|
|
10
10
|
export { OAuthAppClient } from "./OAuthAppClient";
|
|
11
11
|
export { AuthAppClient } from "./AuthAppClient";
|
|
12
12
|
export { Events } from "./Events";
|
|
13
|
+
export { MemoryAppClient } from "./MemoryAppClient";
|
|
14
|
+
export { MemoryClient } from "./MemoryClient";
|
|
15
|
+
export { IdentityAppClient } from "./IdentityAppClient";
|
|
16
|
+
export { CommercialAppClient } from "./CommercialAppClient";
|
|
17
|
+
export { verifyIdentityTokenOffline, clearIdentityJwksCache, tokenHasScopes, parseIdentityScopeClaim, } from "./identity-offline-verify";
|
|
18
|
+
export { createIdentityTokenCache } from "./identity-token-cache";
|
|
19
|
+
export { Webhooks, buildWebhookReceiveUrl, signCliodotWebhookPayload, verifyCliodotWebhookSignature } from "./Webhooks";
|
|
13
20
|
export { Surface } from "./Surface";
|
|
14
21
|
export type { SurfaceConfig, SurfaceCatalog, SurfaceOp, SurfaceClient, SurfaceHelpers, } from "./Surface";
|
|
15
22
|
export { sanitizeExecutionHeaders } from "./http/sanitize-execution-headers";
|
|
@@ -19,6 +26,9 @@ export type { OAuthAppClientConfig, OAuthAppClientApi, OAuthAppErrorCode, OAuthC
|
|
|
19
26
|
export { OAuthAppProtocol, OAuthConnectionStorage, OAuthConnectionStatus, OAuthTokenExposurePolicy, OAUTH_GRANT_TYPE_AUTHORIZATION_CODE, OAUTH_GRANT_TYPE_CLIENT_CREDENTIALS, OAUTH_GRANT_TYPE_DEVICE_CODE, OAUTH_GRANT_TYPE_JWT_BEARER, OAUTH_GRANT_TYPE_SAML2_BEARER, OAUTH_GRANT_TYPE_TOKEN_EXCHANGE, isOidcProtocol, isSamlProtocol, normalizeOAuthGrantType, isBrowserAuthorizationResponse, isDeviceConnectResponse, isImmediateConnectResponse, isDeviceAuthorizationPendingError, pollDeviceConnectWithBackoff, } from "./types/oauth-app.api";
|
|
20
27
|
export type { AuthAppClientConfig, AuthAppClientApi, AuthMfaApi, AuthUsersApi, AuthMfaStatusResponse, AuthTotpEnrollResponse, AuthTotpVerifyResponse, AuthRecoveryCodesResponse, AuthUpsertUserInput, AuthOtpSendInput, AuthOtpSendResponse, AuthOtpVerifyResponse, AuthOtpStatusResponse, AuthOtpProviderApi, AuthProvidersApi, AuthMagicLinkSendResponse, AuthMagicLinkVerifyResponse, AuthMagicLinkProviderApi, } from "./types/auth-app.api";
|
|
21
28
|
export type { EventsConfig, EventsApi, EventPublishOptions, EventPublishResponse, EventSubscribeInput, EventSubscribeResponse, EventUnsubscribeResponse, EventListenOptions, EventListenHandle, EventListenHandler, EventListenMessage, EventListenConnected, EventEnvelope, } from "./types/event-app.api";
|
|
29
|
+
export type { MemoryAppClientConfig, MemoryAppClientApi, MemoryClientConfig, MemoryClientApi, MemoryStoreInput, MemoryStoreResponse, MemoryStoreManyInput, MemoryStoreManyResponse, MemoryAddressInput, MemoryUpdateInput, MemoryDeleteInput, MemoryFindInput, MemoryFindResponse, MemorySearchInput, MemorySearchResponse, MemoryCrossSearchInput, MemorySearchHit, MemoryObject, MemorySearchMode, MemoryDeleteMode, } from "./types/memory-app.api";
|
|
30
|
+
export type { IdentityAppClientConfig, IdentityAppClientApi, IdentityAuthenticateInput, IdentityAuthenticateResponse, IdentityMeResponse, IdentityVerifyInput, IdentityVerifyResponse, IdentityRefreshInput, IdentityRevokeInput, IdentityRevokeResponse, IdentityJwks, IdentityOfflineVerifyOptions, IdentityOfflineVerifyHs256, IdentityOfflineVerifyRs256, IdentityTokenCacheOptions, IdentityProviderHandle, } from "./types/identity-app.api";
|
|
31
|
+
export type { CommercialAppClientConfig, CommercialAppClientApi, CommercialPaginationMeta, CommercialListParams, CommercialCustomer, CommercialFeature, CommercialPlan, CommercialPlanInterval, CommercialPlanEntitlement, CommercialPrice, CommercialSubscription, CommercialCheckInput, CommercialCheckResult, CommercialConsumeInput, CommercialConsumeResult, CommercialConsumeBreakdown, CommercialStateInput, CommercialStateResult, CommercialListCustomersResponse, CommercialListFeaturesResponse, CommercialListPlansResponse, CommercialListSubscriptionsParams, CommercialListSubscriptionsResponse, CommercialCreateSubscriptionInput, CommercialChangePlanInput, CommercialUpdatePendingSubscriptionInput, CommercialUpdateSubscriptionStatusInput, CommercialPricingQuoteInput, CommercialPricingQuote, CommercialInvoice, CommercialInvoiceLineItem, CommercialInitiatePaymentInput, CommercialInitiatePaymentResult, CommercialConfirmPaymentInput, CommercialConfirmPaymentResult, CommercialChargeUsageInput, CommercialChargeUsageResult, CommercialRenewSubscriptionInput, CommercialRenewSubscriptionResult, CommercialCreditBalance, CommercialCreditLedgerEvent, CommercialListCreditsParams, CommercialListCreditsResponse, CommercialCustomerCard, CommercialAddCardInput, CommercialListCardsParams, CommercialListCardsResponse, CommercialLifecycleEvent, CommercialUsageEvent, CommercialListEventsParams, CommercialListEventsResponse, CommercialListUsageEventsResponse, CommercialEntitlementTopupInput, CommercialCreditsTopupInput, CommercialDiscount, CommercialTaxRate, CommercialAddon, CommercialSeatAssignInput, CommercialSeatAssignment, CommercialLicenseIssueInput, CommercialLicenseValidateInput, CommercialLicense, CommercialAnalyticsParams, } from "./types/commercial-app.api";
|
|
22
32
|
export { stepsToNodes } from "./transformers/StepsToNodesTransformer";
|
|
23
33
|
export { WorkflowBuilder, StepBuilder, StepResult } from "./WorkflowBuilder";
|
|
24
34
|
export { ConnectorBuilder, connector } from "./ConnectorBuilder";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC7C,Y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