@tangle-network/agent-integrations 0.53.21 → 0.53.23
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/dist/catalog.js +5 -5
- package/dist/{chunk-DZUD7PHN.js → chunk-3JYFULR4.js} +82 -14
- package/dist/chunk-3JYFULR4.js.map +1 -0
- package/dist/{chunk-HNKLPD2J.js → chunk-B5O6DPFJ.js} +8 -20
- package/dist/chunk-B5O6DPFJ.js.map +1 -0
- package/dist/{chunk-TS4LMQX5.js → chunk-EJWOVPMG.js} +2 -2
- package/dist/{chunk-FKBVBEKX.js → chunk-KBWGXHMC.js} +7 -1
- package/dist/chunk-KBWGXHMC.js.map +1 -0
- package/dist/{chunk-NG3QG5RG.js → chunk-X3WHOEX7.js} +1900 -108
- package/dist/{chunk-NG3QG5RG.js.map → chunk-X3WHOEX7.js.map} +1 -1
- package/dist/connectors/adapters/index.d.ts +54 -1
- package/dist/connectors/adapters/index.js +17 -1
- package/dist/connectors/index.d.ts +1 -1
- package/dist/connectors/index.js +18 -2
- package/dist/coverage-catalog.js +1 -1
- package/dist/index.d.ts +6 -2
- package/dist/index.js +25 -5
- package/dist/mcp.js +5 -5
- package/dist/registry.js +5 -5
- package/dist/runtime.js +5 -5
- package/dist/specs.js +4 -4
- package/docs/integration-execution-audit.md +26 -19
- package/docs/integration-execution-matrix.json +501 -118
- package/package.json +1 -1
- package/dist/chunk-DZUD7PHN.js.map +0 -1
- package/dist/chunk-FKBVBEKX.js.map +0 -1
- package/dist/chunk-HNKLPD2J.js.map +0 -1
- /package/dist/{chunk-TS4LMQX5.js.map → chunk-EJWOVPMG.js.map} +0 -0
|
@@ -74,6 +74,7 @@ __export(adapters_exports, {
|
|
|
74
74
|
auth0Connector: () => auth0Connector,
|
|
75
75
|
autoboundConnector: () => autoboundConnector,
|
|
76
76
|
autocallsConnector: () => autocallsConnector,
|
|
77
|
+
avalaraConnector: () => avalaraConnector,
|
|
77
78
|
avianConnector: () => avianConnector,
|
|
78
79
|
avomaConnector: () => avomaConnector,
|
|
79
80
|
azureAdConnector: () => azureAdConnector,
|
|
@@ -146,6 +147,7 @@ __export(adapters_exports, {
|
|
|
146
147
|
clicdataConnector: () => clicdataConnector,
|
|
147
148
|
clickfunnelsConnector: () => clickfunnelsConnector,
|
|
148
149
|
clickupConnector: () => clickupConnector,
|
|
150
|
+
clientCredentialsRestConnector: () => clientCredentialsRestConnector,
|
|
149
151
|
clioConnector: () => clioConnector,
|
|
150
152
|
clockifyConnector: () => clockifyConnector,
|
|
151
153
|
clockodoConnector: () => clockodoConnector,
|
|
@@ -419,6 +421,7 @@ __export(adapters_exports, {
|
|
|
419
421
|
mollieConnector: () => mollieConnector,
|
|
420
422
|
mondayConnector: () => mondayConnector,
|
|
421
423
|
mongodbConnector: () => mongodbConnector,
|
|
424
|
+
mycaseConnector: () => mycaseConnector,
|
|
422
425
|
n8nConnector: () => n8nConnector,
|
|
423
426
|
netlifyConnector: () => netlifyConnector,
|
|
424
427
|
netsuiteConnector: () => netsuiteConnector,
|
|
@@ -436,6 +439,7 @@ __export(adapters_exports, {
|
|
|
436
439
|
omnihrConnector: () => omnihrConnector,
|
|
437
440
|
oneDrive: () => oneDrive,
|
|
438
441
|
oneSpanSignConnector: () => oneSpanSignConnector,
|
|
442
|
+
oneloginConnector: () => oneloginConnector,
|
|
439
443
|
openPhoneConnector: () => openPhoneConnector,
|
|
440
444
|
openRouterConnector: () => openRouterConnector,
|
|
441
445
|
openaiConnector: () => openaiConnector,
|
|
@@ -463,6 +467,7 @@ __export(adapters_exports, {
|
|
|
463
467
|
phonyConnector: () => phonyConnector,
|
|
464
468
|
pinchPaymentsConnector: () => pinchPaymentsConnector,
|
|
465
469
|
pineconeConnector: () => pineconeConnector,
|
|
470
|
+
pingIdentityConnector: () => pingIdentityConnector,
|
|
466
471
|
pipedreamConnector: () => pipedreamConnector,
|
|
467
472
|
pipedriveConnector: () => pipedriveConnector,
|
|
468
473
|
placidConnector: () => placidConnector,
|
|
@@ -490,6 +495,7 @@ __export(adapters_exports, {
|
|
|
490
495
|
rapidtextAiConnector: () => rapidtextAiConnector,
|
|
491
496
|
reachinboxConnector: () => reachinboxConnector,
|
|
492
497
|
recallAiConnector: () => recallAiConnector,
|
|
498
|
+
recurlyConnector: () => recurlyConnector,
|
|
493
499
|
redditConnector: () => redditConnector,
|
|
494
500
|
reoonVerifierConnector: () => reoonVerifierConnector,
|
|
495
501
|
replyIoConnector: () => replyIoConnector,
|
|
@@ -510,6 +516,7 @@ __export(adapters_exports, {
|
|
|
510
516
|
sanityConnector: () => sanityConnector,
|
|
511
517
|
sardisConnector: () => sardisConnector,
|
|
512
518
|
savvycalConnector: () => savvycalConnector,
|
|
519
|
+
scimConnector: () => scimConnector,
|
|
513
520
|
scrapegraphaiConnector: () => scrapegraphaiConnector,
|
|
514
521
|
scrapelessConnector: () => scrapelessConnector,
|
|
515
522
|
seamlessAiConnector: () => seamlessAiConnector,
|
|
@@ -557,6 +564,7 @@ __export(adapters_exports, {
|
|
|
557
564
|
talkableConnector: () => talkableConnector,
|
|
558
565
|
tallyConnector: () => tallyConnector,
|
|
559
566
|
tangleIdentity: () => tangleIdentity,
|
|
567
|
+
taxjarConnector: () => taxjarConnector,
|
|
560
568
|
teableConnector: () => teableConnector,
|
|
561
569
|
telegramConnector: () => telegramConnector,
|
|
562
570
|
telnyxConnector: () => telnyxConnector,
|
|
@@ -770,11 +778,11 @@ function declarativeRestConnector(spec) {
|
|
|
770
778
|
const op = readOperation(spec, inv.capabilityName, "read");
|
|
771
779
|
const response = await executeRestRequest(spec, op.request, inv, requiredArgsOf(op.parameters));
|
|
772
780
|
if (response.outcome === "rate-limited") {
|
|
773
|
-
const
|
|
781
|
+
const retryAfterMs4 = response.retryAfterMs ?? DEFAULT_RETRY_AFTER_MS;
|
|
774
782
|
throw new ProviderRateLimited(
|
|
775
|
-
`${spec.displayName} ${inv.capabilityName} rate limit (429); retry after ${
|
|
783
|
+
`${spec.displayName} ${inv.capabilityName} rate limit (429); retry after ${retryAfterMs4}ms`,
|
|
776
784
|
inv.source.id,
|
|
777
|
-
{ status: 429, body: response.data, retryAfterMs:
|
|
785
|
+
{ status: 429, body: response.data, retryAfterMs: retryAfterMs4 }
|
|
778
786
|
);
|
|
779
787
|
}
|
|
780
788
|
if (response.outcome === "conflict") {
|
|
@@ -919,7 +927,10 @@ async function executeRestRequest(spec, request4, inv, requiredArgs) {
|
|
|
919
927
|
...renderHeaders(spec.defaultHeaders ?? {}, scope, true),
|
|
920
928
|
...renderHeaders(renderableHeaders, scope)
|
|
921
929
|
};
|
|
922
|
-
const structuredCredentials = placement.kind === "structured-headers" || placement.kind === "structured-json-body" ? readStructuredCredentials(inv.source.credentials, placement.fields) :
|
|
930
|
+
const structuredCredentials = placement.kind === "structured-headers" || placement.kind === "structured-json-body" ? readStructuredCredentials(inv.source.credentials, placement.fields) : placement.kind === "basic-structured" ? readStructuredCredentials(inv.source.credentials, {
|
|
931
|
+
[placement.usernameField]: placement.usernameField,
|
|
932
|
+
[placement.passwordField]: placement.passwordField
|
|
933
|
+
}) : void 0;
|
|
923
934
|
if (placement.kind === "structured-headers") {
|
|
924
935
|
for (const [credentialName, headerName] of Object.entries(placement.fields)) {
|
|
925
936
|
headers[headerName] = structuredCredentials[credentialName];
|
|
@@ -955,6 +966,10 @@ async function executeRestRequest(spec, request4, inv, requiredArgs) {
|
|
|
955
966
|
region: awsRegion,
|
|
956
967
|
bundle: aws
|
|
957
968
|
});
|
|
969
|
+
} else if (placement.kind === "basic-structured") {
|
|
970
|
+
const username = structuredCredentials[placement.usernameField];
|
|
971
|
+
const password = structuredCredentials[placement.passwordField];
|
|
972
|
+
headers.authorization = `Basic ${Buffer.from(`${username}:${password}`).toString("base64")}`;
|
|
958
973
|
} else if (placement.kind !== "structured-headers" && placement.kind !== "structured-json-body") {
|
|
959
974
|
applyCredentials(headers, url, placement, inv.source.credentials);
|
|
960
975
|
}
|
|
@@ -968,7 +983,11 @@ async function executeRestRequest(spec, request4, inv, requiredArgs) {
|
|
|
968
983
|
throw new CredentialsExpired(`${spec.displayName} rejected credentials (${res.status})`, inv.source.id);
|
|
969
984
|
}
|
|
970
985
|
if (res.status === 409 || res.status === 412) {
|
|
971
|
-
const text2 = redactCredentialText(
|
|
986
|
+
const text2 = redactCredentialText(
|
|
987
|
+
await safeErrorText(res),
|
|
988
|
+
inv.source.credentials,
|
|
989
|
+
[getHeaderCI(headers, "authorization")]
|
|
990
|
+
);
|
|
972
991
|
return {
|
|
973
992
|
data: parseBodyText(text2),
|
|
974
993
|
outcome: "conflict",
|
|
@@ -978,7 +997,11 @@ async function executeRestRequest(spec, request4, inv, requiredArgs) {
|
|
|
978
997
|
};
|
|
979
998
|
}
|
|
980
999
|
if (res.status === 429) {
|
|
981
|
-
const text2 = redactCredentialText(
|
|
1000
|
+
const text2 = redactCredentialText(
|
|
1001
|
+
await safeErrorText(res),
|
|
1002
|
+
inv.source.credentials,
|
|
1003
|
+
[getHeaderCI(headers, "authorization")]
|
|
1004
|
+
);
|
|
982
1005
|
return {
|
|
983
1006
|
data: parseBodyText(text2),
|
|
984
1007
|
outcome: "rate-limited",
|
|
@@ -991,7 +1014,11 @@ async function executeRestRequest(spec, request4, inv, requiredArgs) {
|
|
|
991
1014
|
return { data: { exists: res.status === 204 } };
|
|
992
1015
|
}
|
|
993
1016
|
if (!res.ok) {
|
|
994
|
-
const text2 = redactCredentialText(
|
|
1017
|
+
const text2 = redactCredentialText(
|
|
1018
|
+
await safeErrorText(res),
|
|
1019
|
+
inv.source.credentials,
|
|
1020
|
+
[getHeaderCI(headers, "authorization")]
|
|
1021
|
+
);
|
|
995
1022
|
throw new Error(`${spec.kind} ${request4.method} ${url.pathname} HTTP ${res.status}: ${text2.slice(0, 300)}`);
|
|
996
1023
|
}
|
|
997
1024
|
const text = await res.text();
|
|
@@ -1080,7 +1107,9 @@ function applyCredentials(headers, url, placement, credentials) {
|
|
|
1080
1107
|
if (placement.kind === "basic-api-key") {
|
|
1081
1108
|
headers.authorization = `Basic ${Buffer.from(`${token}:`).toString("base64")}`;
|
|
1082
1109
|
}
|
|
1083
|
-
if (placement.kind === "header")
|
|
1110
|
+
if (placement.kind === "header") {
|
|
1111
|
+
headers[placement.header] = `${placement.prefix ?? ""}${token}${placement.suffix ?? ""}`;
|
|
1112
|
+
}
|
|
1084
1113
|
if (placement.kind === "query") url.searchParams.set(placement.parameter, token);
|
|
1085
1114
|
}
|
|
1086
1115
|
function readStructuredCredentials(credentials, fields) {
|
|
@@ -1121,9 +1150,9 @@ function credentialToken(credentials) {
|
|
|
1121
1150
|
}
|
|
1122
1151
|
throw new Error(`declarative REST connectors require oauth2 or api-key credentials, got ${credentials.kind}`);
|
|
1123
1152
|
}
|
|
1124
|
-
function redactCredentialText(text, credentials) {
|
|
1153
|
+
function redactCredentialText(text, credentials, additionalSecrets = []) {
|
|
1125
1154
|
const candidates = credentials.kind === "oauth2" ? [credentials.accessToken, credentials.refreshToken] : credentials.kind === "api-key" ? [credentials.apiKey, ...jsonStringValues(credentials.apiKey)] : credentials.kind === "custom" ? Object.values(credentials.values) : [];
|
|
1126
|
-
const secrets = candidates.filter(
|
|
1155
|
+
const secrets = [...candidates, ...additionalSecrets].filter(
|
|
1127
1156
|
(secret) => typeof secret === "string" && secret.length > 0
|
|
1128
1157
|
);
|
|
1129
1158
|
return secrets.reduce(
|
|
@@ -1537,6 +1566,803 @@ function membershipCapability(name, method, description) {
|
|
|
1537
1566
|
};
|
|
1538
1567
|
}
|
|
1539
1568
|
|
|
1569
|
+
// src/connectors/adapters/client-credentials-rest.ts
|
|
1570
|
+
import { createHash as createHash2 } from "crypto";
|
|
1571
|
+
function clientCredentialsRestConnector(spec) {
|
|
1572
|
+
const regionMetadataKey = spec.regionMetadataKey ?? "region";
|
|
1573
|
+
const delegated = declarativeRestConnector({
|
|
1574
|
+
...spec,
|
|
1575
|
+
baseUrl: { metadataKey: "__clientCredentialsApiBaseUrl" },
|
|
1576
|
+
allowedBaseUrls: Object.values(spec.regions).map((region) => region.apiBaseUrl),
|
|
1577
|
+
credentialPlacement: spec.apiCredentialPlacement ?? { kind: "bearer" }
|
|
1578
|
+
});
|
|
1579
|
+
const tokens = /* @__PURE__ */ new Map();
|
|
1580
|
+
const pending = /* @__PURE__ */ new Map();
|
|
1581
|
+
async function authenticatedSource(source) {
|
|
1582
|
+
const bundle = readCredentialBundle(source.credentials);
|
|
1583
|
+
const regionName = readRegionName(bundle, source.metadata, regionMetadataKey, spec.defaultRegion);
|
|
1584
|
+
const region = spec.regions[regionName];
|
|
1585
|
+
if (!region) {
|
|
1586
|
+
throw new Error(`${spec.kind}: unsupported region ${regionName}; expected one of ${Object.keys(spec.regions).join(", ")}`);
|
|
1587
|
+
}
|
|
1588
|
+
const resolvedRegion = {
|
|
1589
|
+
...region,
|
|
1590
|
+
tokenUrl: renderConnectionMetadata(region.tokenUrl, source.metadata)
|
|
1591
|
+
};
|
|
1592
|
+
const scope = bundle.scope ?? spec.defaultScope;
|
|
1593
|
+
const fingerprint = credentialFingerprint(bundle, resolvedRegion, scope);
|
|
1594
|
+
const cached = tokens.get(source.id);
|
|
1595
|
+
if (cached?.fingerprint === fingerprint && cached.expiresAt > Date.now() + 6e4) {
|
|
1596
|
+
return withAccessToken(source, resolvedRegion.apiBaseUrl, cached.accessToken);
|
|
1597
|
+
}
|
|
1598
|
+
if (cached) tokens.delete(source.id);
|
|
1599
|
+
const inFlight = pending.get(source.id);
|
|
1600
|
+
if (inFlight?.fingerprint === fingerprint) {
|
|
1601
|
+
const token = await inFlight.promise;
|
|
1602
|
+
return withAccessToken(source, resolvedRegion.apiBaseUrl, token.accessToken);
|
|
1603
|
+
}
|
|
1604
|
+
const promise = exchangeClientCredentials(
|
|
1605
|
+
spec.displayName,
|
|
1606
|
+
source.id,
|
|
1607
|
+
bundle,
|
|
1608
|
+
resolvedRegion,
|
|
1609
|
+
fingerprint,
|
|
1610
|
+
scope,
|
|
1611
|
+
spec.tokenCredentialPlacement ?? "basic"
|
|
1612
|
+
);
|
|
1613
|
+
pending.set(source.id, { fingerprint, promise });
|
|
1614
|
+
try {
|
|
1615
|
+
const token = await promise;
|
|
1616
|
+
if (pending.get(source.id)?.promise === promise) cacheToken(tokens, source.id, token);
|
|
1617
|
+
return withAccessToken(source, resolvedRegion.apiBaseUrl, token.accessToken);
|
|
1618
|
+
} finally {
|
|
1619
|
+
if (pending.get(source.id)?.promise === promise) pending.delete(source.id);
|
|
1620
|
+
}
|
|
1621
|
+
}
|
|
1622
|
+
return {
|
|
1623
|
+
manifest: delegated.manifest,
|
|
1624
|
+
executeRead: delegated.executeRead ? async (invocation) => delegated.executeRead({
|
|
1625
|
+
...invocation,
|
|
1626
|
+
source: await authenticatedSource(invocation.source)
|
|
1627
|
+
}) : void 0,
|
|
1628
|
+
executeMutation: delegated.executeMutation ? async (invocation) => delegated.executeMutation({
|
|
1629
|
+
...invocation,
|
|
1630
|
+
source: await authenticatedSource(invocation.source)
|
|
1631
|
+
}) : void 0,
|
|
1632
|
+
async test(source) {
|
|
1633
|
+
try {
|
|
1634
|
+
return delegated.test(await authenticatedSource(source));
|
|
1635
|
+
} catch (error) {
|
|
1636
|
+
return { ok: false, reason: error instanceof Error ? error.message : "unknown error" };
|
|
1637
|
+
}
|
|
1638
|
+
}
|
|
1639
|
+
};
|
|
1640
|
+
}
|
|
1641
|
+
function cacheToken(tokens, sourceId, token) {
|
|
1642
|
+
tokens.set(sourceId, token);
|
|
1643
|
+
const timeout = setTimeout(() => {
|
|
1644
|
+
if (tokens.get(sourceId) === token) tokens.delete(sourceId);
|
|
1645
|
+
}, Math.max(0, token.expiresAt - Date.now()));
|
|
1646
|
+
timeout.unref();
|
|
1647
|
+
}
|
|
1648
|
+
function readCredentialBundle(credentials) {
|
|
1649
|
+
let values;
|
|
1650
|
+
if (credentials.kind === "custom") {
|
|
1651
|
+
values = credentials.values;
|
|
1652
|
+
} else if (credentials.kind === "api-key") {
|
|
1653
|
+
try {
|
|
1654
|
+
const parsed = JSON.parse(credentials.apiKey);
|
|
1655
|
+
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) throw new Error("not an object");
|
|
1656
|
+
values = parsed;
|
|
1657
|
+
} catch {
|
|
1658
|
+
throw new Error("client credentials require a JSON object in the API-key field");
|
|
1659
|
+
}
|
|
1660
|
+
} else {
|
|
1661
|
+
throw new Error(`client credentials require custom or API-key credentials, got ${credentials.kind}`);
|
|
1662
|
+
}
|
|
1663
|
+
const clientId = requiredString(values.clientId, "clientId");
|
|
1664
|
+
const clientSecret = requiredString(values.clientSecret, "clientSecret");
|
|
1665
|
+
return {
|
|
1666
|
+
clientId,
|
|
1667
|
+
clientSecret,
|
|
1668
|
+
region: optionalString(values.region, "region"),
|
|
1669
|
+
scope: optionalString(values.scope, "scope")
|
|
1670
|
+
};
|
|
1671
|
+
}
|
|
1672
|
+
function requiredString(value, field) {
|
|
1673
|
+
if (typeof value !== "string" || !value.trim()) throw new Error(`client credentials are missing ${field}`);
|
|
1674
|
+
return value.trim();
|
|
1675
|
+
}
|
|
1676
|
+
function optionalString(value, field) {
|
|
1677
|
+
if (value === void 0 || value === null || value === "") return void 0;
|
|
1678
|
+
if (typeof value !== "string") throw new Error(`client credentials ${field} must be a string`);
|
|
1679
|
+
return value.trim();
|
|
1680
|
+
}
|
|
1681
|
+
function readRegionName(bundle, metadata, metadataKey, fallback) {
|
|
1682
|
+
const metadataRegion = metadata[metadataKey];
|
|
1683
|
+
if (metadataRegion !== void 0 && typeof metadataRegion !== "string") {
|
|
1684
|
+
throw new Error(`connection metadata.${metadataKey} must be a string`);
|
|
1685
|
+
}
|
|
1686
|
+
return (bundle.region ?? metadataRegion ?? fallback).toLowerCase().trim();
|
|
1687
|
+
}
|
|
1688
|
+
function credentialFingerprint(bundle, region, scope) {
|
|
1689
|
+
return createHash2("sha256").update(bundle.clientId).update("\0").update(bundle.clientSecret).update("\0").update(region.tokenUrl).update("\0").update(scope ?? "").digest("hex");
|
|
1690
|
+
}
|
|
1691
|
+
function renderConnectionMetadata(template, metadata) {
|
|
1692
|
+
const rendered = template.replace(/\{connection\.([a-zA-Z0-9_.-]+)\}/g, (_match, key) => {
|
|
1693
|
+
const value = key.split(".").reduce((current, part) => {
|
|
1694
|
+
if (current && typeof current === "object" && part in current) {
|
|
1695
|
+
return current[part];
|
|
1696
|
+
}
|
|
1697
|
+
return void 0;
|
|
1698
|
+
}, metadata);
|
|
1699
|
+
if (typeof value !== "string" || !value.trim()) throw new Error(`missing metadata.${key}`);
|
|
1700
|
+
return encodeURIComponent(value.trim());
|
|
1701
|
+
});
|
|
1702
|
+
const url = new URL(rendered);
|
|
1703
|
+
if (url.protocol !== "https:" || url.username || url.password) {
|
|
1704
|
+
throw new Error("client-credentials token URL must be HTTPS without embedded credentials");
|
|
1705
|
+
}
|
|
1706
|
+
return url.href;
|
|
1707
|
+
}
|
|
1708
|
+
async function exchangeClientCredentials(displayName, sourceId, bundle, region, fingerprint, scope, credentialPlacement = "basic") {
|
|
1709
|
+
const body = new URLSearchParams({ grant_type: "client_credentials" });
|
|
1710
|
+
if (scope) body.set("scope", scope);
|
|
1711
|
+
if (credentialPlacement === "form-body") {
|
|
1712
|
+
body.set("client_id", bundle.clientId);
|
|
1713
|
+
body.set("client_secret", bundle.clientSecret);
|
|
1714
|
+
}
|
|
1715
|
+
const headers = {
|
|
1716
|
+
accept: "application/json",
|
|
1717
|
+
"content-type": "application/x-www-form-urlencoded"
|
|
1718
|
+
};
|
|
1719
|
+
if (credentialPlacement === "basic") {
|
|
1720
|
+
headers.authorization = `Basic ${Buffer.from(`${bundle.clientId}:${bundle.clientSecret}`).toString("base64")}`;
|
|
1721
|
+
}
|
|
1722
|
+
const response = await fetch(region.tokenUrl, {
|
|
1723
|
+
method: "POST",
|
|
1724
|
+
headers,
|
|
1725
|
+
body: body.toString(),
|
|
1726
|
+
signal: AbortSignal.timeout(2e4)
|
|
1727
|
+
});
|
|
1728
|
+
if (response.status === 429) {
|
|
1729
|
+
throw new ProviderRateLimited(`${displayName} token endpoint rate limit (429)`, sourceId, {
|
|
1730
|
+
status: 429,
|
|
1731
|
+
retryAfterMs: retryAfterMs(response.headers.get("retry-after"))
|
|
1732
|
+
});
|
|
1733
|
+
}
|
|
1734
|
+
if (response.status === 400 || response.status === 401 || response.status === 403) {
|
|
1735
|
+
throw new CredentialsExpired(`${displayName} rejected client credentials (${response.status})`, sourceId, {
|
|
1736
|
+
status: response.status
|
|
1737
|
+
});
|
|
1738
|
+
}
|
|
1739
|
+
if (!response.ok) throw new Error(`${displayName} token exchange failed (${response.status})`);
|
|
1740
|
+
let payload;
|
|
1741
|
+
try {
|
|
1742
|
+
payload = await response.json();
|
|
1743
|
+
} catch {
|
|
1744
|
+
throw new Error(`${displayName} token exchange returned malformed JSON`);
|
|
1745
|
+
}
|
|
1746
|
+
if (!payload || typeof payload !== "object" || Array.isArray(payload)) {
|
|
1747
|
+
throw new Error(`${displayName} token exchange returned an invalid response`);
|
|
1748
|
+
}
|
|
1749
|
+
const values = payload;
|
|
1750
|
+
const accessToken3 = requiredString(values.access_token, "access_token");
|
|
1751
|
+
const expiresIn = Number(values.expires_in ?? 3600);
|
|
1752
|
+
if (!Number.isFinite(expiresIn) || expiresIn <= 0) {
|
|
1753
|
+
throw new Error(`${displayName} token exchange returned an invalid expires_in`);
|
|
1754
|
+
}
|
|
1755
|
+
return {
|
|
1756
|
+
fingerprint,
|
|
1757
|
+
accessToken: accessToken3,
|
|
1758
|
+
expiresAt: Date.now() + Math.round(expiresIn * 1e3)
|
|
1759
|
+
};
|
|
1760
|
+
}
|
|
1761
|
+
function withAccessToken(source, apiBaseUrl, accessToken3) {
|
|
1762
|
+
return {
|
|
1763
|
+
...source,
|
|
1764
|
+
metadata: { ...source.metadata, __clientCredentialsApiBaseUrl: apiBaseUrl },
|
|
1765
|
+
credentials: { kind: "oauth2", accessToken: accessToken3 }
|
|
1766
|
+
};
|
|
1767
|
+
}
|
|
1768
|
+
function retryAfterMs(raw) {
|
|
1769
|
+
if (!raw) return 6e4;
|
|
1770
|
+
const seconds = Number(raw);
|
|
1771
|
+
if (Number.isFinite(seconds) && seconds >= 0) return Math.max(1e3, Math.round(seconds * 1e3));
|
|
1772
|
+
const at = Date.parse(raw);
|
|
1773
|
+
return Number.isFinite(at) ? Math.max(1e3, at - Date.now()) : 6e4;
|
|
1774
|
+
}
|
|
1775
|
+
|
|
1776
|
+
// src/connectors/adapters/onelogin.ts
|
|
1777
|
+
var userId2 = { type: "string", description: "OneLogin user id." };
|
|
1778
|
+
var groupId2 = { type: "string", description: "OneLogin group id." };
|
|
1779
|
+
var oneloginRestConnector = clientCredentialsRestConnector({
|
|
1780
|
+
kind: "onelogin",
|
|
1781
|
+
displayName: "OneLogin",
|
|
1782
|
+
description: "Provision OneLogin users, groups, and user group assignments with customer-owned API credentials.",
|
|
1783
|
+
auth: {
|
|
1784
|
+
kind: "api-key",
|
|
1785
|
+
hint: 'JSON credential bundle: {"clientId":"...","clientSecret":"...","region":"us|eu"}.'
|
|
1786
|
+
},
|
|
1787
|
+
category: "other",
|
|
1788
|
+
defaultConsistencyModel: "authoritative",
|
|
1789
|
+
regions: {
|
|
1790
|
+
us: {
|
|
1791
|
+
apiBaseUrl: "https://api.us.onelogin.com",
|
|
1792
|
+
tokenUrl: "https://api.us.onelogin.com/auth/oauth2/v2/token"
|
|
1793
|
+
},
|
|
1794
|
+
eu: {
|
|
1795
|
+
apiBaseUrl: "https://api.eu.onelogin.com",
|
|
1796
|
+
tokenUrl: "https://api.eu.onelogin.com/auth/oauth2/v2/token"
|
|
1797
|
+
}
|
|
1798
|
+
},
|
|
1799
|
+
defaultRegion: "us",
|
|
1800
|
+
tokenCredentialPlacement: "form-body",
|
|
1801
|
+
apiCredentialPlacement: { kind: "header", header: "Authorization", prefix: "bearer:" },
|
|
1802
|
+
defaultHeaders: { Accept: "application/json" },
|
|
1803
|
+
test: { method: "GET", path: "/api/2/users", query: { limit: 1 } },
|
|
1804
|
+
capabilities: [
|
|
1805
|
+
{
|
|
1806
|
+
name: "users.list",
|
|
1807
|
+
class: "read",
|
|
1808
|
+
description: "List or filter OneLogin users.",
|
|
1809
|
+
parameters: {
|
|
1810
|
+
type: "object",
|
|
1811
|
+
properties: {
|
|
1812
|
+
limit: { type: "integer", minimum: 1, maximum: 1e3 },
|
|
1813
|
+
page: { type: "integer", minimum: 1 },
|
|
1814
|
+
email: { type: "string" },
|
|
1815
|
+
username: { type: "string" },
|
|
1816
|
+
status: { type: "integer" },
|
|
1817
|
+
group_id: { type: "integer" },
|
|
1818
|
+
role_id: { type: "integer" }
|
|
1819
|
+
}
|
|
1820
|
+
},
|
|
1821
|
+
request: {
|
|
1822
|
+
method: "GET",
|
|
1823
|
+
path: "/api/2/users",
|
|
1824
|
+
query: {
|
|
1825
|
+
limit: "{limit}",
|
|
1826
|
+
page: "{page}",
|
|
1827
|
+
email: "{email}",
|
|
1828
|
+
username: "{username}",
|
|
1829
|
+
status: "{status}",
|
|
1830
|
+
group_id: "{group_id}",
|
|
1831
|
+
role_id: "{role_id}"
|
|
1832
|
+
}
|
|
1833
|
+
}
|
|
1834
|
+
},
|
|
1835
|
+
{
|
|
1836
|
+
name: "users.get",
|
|
1837
|
+
class: "read",
|
|
1838
|
+
description: "Read one OneLogin user.",
|
|
1839
|
+
parameters: { type: "object", properties: { userId: userId2 }, required: ["userId"] },
|
|
1840
|
+
request: { method: "GET", path: "/api/2/users/{userId}" }
|
|
1841
|
+
},
|
|
1842
|
+
{
|
|
1843
|
+
name: "users.create",
|
|
1844
|
+
class: "mutation",
|
|
1845
|
+
description: "Create a OneLogin user from a provider-native user object.",
|
|
1846
|
+
parameters: { type: "object", properties: { user: { type: "object" } }, required: ["user"] },
|
|
1847
|
+
request: { method: "POST", path: "/api/2/users", body: "{user}" },
|
|
1848
|
+
cas: "native-idempotency",
|
|
1849
|
+
externalEffect: true
|
|
1850
|
+
},
|
|
1851
|
+
{
|
|
1852
|
+
name: "users.update",
|
|
1853
|
+
class: "mutation",
|
|
1854
|
+
description: "Update mutable fields on a OneLogin user.",
|
|
1855
|
+
parameters: {
|
|
1856
|
+
type: "object",
|
|
1857
|
+
properties: { userId: userId2, user: { type: "object" } },
|
|
1858
|
+
required: ["userId", "user"]
|
|
1859
|
+
},
|
|
1860
|
+
request: { method: "PUT", path: "/api/2/users/{userId}", body: "{user}" },
|
|
1861
|
+
cas: "optimistic-read-verify",
|
|
1862
|
+
externalEffect: true
|
|
1863
|
+
},
|
|
1864
|
+
{
|
|
1865
|
+
name: "users.deactivate",
|
|
1866
|
+
class: "mutation",
|
|
1867
|
+
description: "Set a OneLogin user to suspended status without deleting the record.",
|
|
1868
|
+
parameters: { type: "object", properties: { userId: userId2 }, required: ["userId"] },
|
|
1869
|
+
request: { method: "PUT", path: "/api/2/users/{userId}", body: { status: 2 } },
|
|
1870
|
+
cas: "optimistic-read-verify",
|
|
1871
|
+
externalEffect: true
|
|
1872
|
+
},
|
|
1873
|
+
{
|
|
1874
|
+
name: "groups.list",
|
|
1875
|
+
class: "read",
|
|
1876
|
+
description: "List OneLogin groups.",
|
|
1877
|
+
parameters: {
|
|
1878
|
+
type: "object",
|
|
1879
|
+
properties: {
|
|
1880
|
+
limit: { type: "integer", minimum: 1, maximum: 1e3 },
|
|
1881
|
+
page: { type: "integer", minimum: 1 },
|
|
1882
|
+
name: { type: "string" }
|
|
1883
|
+
}
|
|
1884
|
+
},
|
|
1885
|
+
request: { method: "GET", path: "/api/1/groups", query: { limit: "{limit}", page: "{page}", name: "{name}" } }
|
|
1886
|
+
},
|
|
1887
|
+
{
|
|
1888
|
+
name: "groups.get",
|
|
1889
|
+
class: "read",
|
|
1890
|
+
description: "Read one OneLogin group.",
|
|
1891
|
+
parameters: { type: "object", properties: { groupId: groupId2 }, required: ["groupId"] },
|
|
1892
|
+
request: { method: "GET", path: "/api/1/groups/{groupId}" }
|
|
1893
|
+
},
|
|
1894
|
+
{
|
|
1895
|
+
name: "groups.users.add",
|
|
1896
|
+
class: "mutation",
|
|
1897
|
+
description: "Assign a OneLogin user to a group. OneLogin permits one group per user.",
|
|
1898
|
+
parameters: {
|
|
1899
|
+
type: "object",
|
|
1900
|
+
properties: { groupId: groupId2, userId: userId2 },
|
|
1901
|
+
required: ["groupId", "userId"]
|
|
1902
|
+
},
|
|
1903
|
+
request: { method: "PUT", path: "/api/2/users/{userId}", body: { group_id: "{groupId}" } },
|
|
1904
|
+
cas: "optimistic-read-verify",
|
|
1905
|
+
externalEffect: true
|
|
1906
|
+
},
|
|
1907
|
+
{
|
|
1908
|
+
name: "groups.users.remove",
|
|
1909
|
+
class: "mutation",
|
|
1910
|
+
description: "Remove a OneLogin user from the expected current group.",
|
|
1911
|
+
parameters: {
|
|
1912
|
+
type: "object",
|
|
1913
|
+
properties: { groupId: groupId2, userId: userId2 },
|
|
1914
|
+
required: ["groupId", "userId"]
|
|
1915
|
+
},
|
|
1916
|
+
request: { method: "PUT", path: "/api/2/users/{userId}", body: { group_id: null } },
|
|
1917
|
+
cas: "optimistic-read-verify",
|
|
1918
|
+
externalEffect: true
|
|
1919
|
+
}
|
|
1920
|
+
]
|
|
1921
|
+
});
|
|
1922
|
+
var oneloginConnector = {
|
|
1923
|
+
...oneloginRestConnector,
|
|
1924
|
+
async executeMutation(invocation) {
|
|
1925
|
+
if (invocation.capabilityName !== "groups.users.remove") {
|
|
1926
|
+
return oneloginRestConnector.executeMutation(invocation);
|
|
1927
|
+
}
|
|
1928
|
+
const current = await oneloginRestConnector.executeRead({
|
|
1929
|
+
...invocation,
|
|
1930
|
+
capabilityName: "users.get",
|
|
1931
|
+
args: { userId: invocation.args.userId }
|
|
1932
|
+
});
|
|
1933
|
+
const currentGroup = readGroupId(current.data);
|
|
1934
|
+
const expectedGroup = String(invocation.args.groupId);
|
|
1935
|
+
if (currentGroup !== expectedGroup) {
|
|
1936
|
+
return {
|
|
1937
|
+
status: "conflict",
|
|
1938
|
+
alternatives: [],
|
|
1939
|
+
currentState: current.data,
|
|
1940
|
+
message: `OneLogin user is assigned to group ${currentGroup ?? "none"}, not ${expectedGroup}`
|
|
1941
|
+
};
|
|
1942
|
+
}
|
|
1943
|
+
return oneloginRestConnector.executeMutation(invocation);
|
|
1944
|
+
}
|
|
1945
|
+
};
|
|
1946
|
+
function readGroupId(data4) {
|
|
1947
|
+
if (!data4 || typeof data4 !== "object" || Array.isArray(data4)) return void 0;
|
|
1948
|
+
const value = data4.group_id;
|
|
1949
|
+
return typeof value === "string" || typeof value === "number" ? String(value) : void 0;
|
|
1950
|
+
}
|
|
1951
|
+
|
|
1952
|
+
// src/connectors/adapters/ping-identity.ts
|
|
1953
|
+
var userId3 = { type: "string", description: "PingOne user id." };
|
|
1954
|
+
var groupId3 = { type: "string", description: "PingOne group id." };
|
|
1955
|
+
var regions = {
|
|
1956
|
+
us: { apiBaseUrl: "https://api.pingone.com", tokenUrl: "https://auth.pingone.com/{connection.environmentId}/as/token" },
|
|
1957
|
+
ca: { apiBaseUrl: "https://api.pingone.ca", tokenUrl: "https://auth.pingone.ca/{connection.environmentId}/as/token" },
|
|
1958
|
+
eu: { apiBaseUrl: "https://api.pingone.eu", tokenUrl: "https://auth.pingone.eu/{connection.environmentId}/as/token" },
|
|
1959
|
+
au: { apiBaseUrl: "https://api.pingone.com.au", tokenUrl: "https://auth.pingone.com.au/{connection.environmentId}/as/token" },
|
|
1960
|
+
asia: { apiBaseUrl: "https://api.pingone.asia", tokenUrl: "https://auth.pingone.asia/{connection.environmentId}/as/token" }
|
|
1961
|
+
};
|
|
1962
|
+
var pingIdentityConnector = clientCredentialsRestConnector({
|
|
1963
|
+
kind: "ping-identity",
|
|
1964
|
+
displayName: "Ping Identity",
|
|
1965
|
+
description: "Provision PingOne users, groups, and group memberships with customer-owned worker credentials.",
|
|
1966
|
+
auth: {
|
|
1967
|
+
kind: "api-key",
|
|
1968
|
+
hint: 'JSON credential bundle: {"clientId":"...","clientSecret":"...","region":"us|ca|eu|au|asia"}. Set environmentId in connection metadata.'
|
|
1969
|
+
},
|
|
1970
|
+
category: "other",
|
|
1971
|
+
defaultConsistencyModel: "authoritative",
|
|
1972
|
+
regions,
|
|
1973
|
+
defaultRegion: "us",
|
|
1974
|
+
defaultHeaders: { Accept: "application/json" },
|
|
1975
|
+
test: {
|
|
1976
|
+
method: "GET",
|
|
1977
|
+
path: "/v1/environments/{connection.environmentId}/users",
|
|
1978
|
+
query: { limit: 1 }
|
|
1979
|
+
},
|
|
1980
|
+
capabilities: [
|
|
1981
|
+
{
|
|
1982
|
+
name: "users.list",
|
|
1983
|
+
class: "read",
|
|
1984
|
+
description: "List or filter users in the connected PingOne environment.",
|
|
1985
|
+
parameters: {
|
|
1986
|
+
type: "object",
|
|
1987
|
+
properties: {
|
|
1988
|
+
limit: { type: "integer", minimum: 1, maximum: 200 },
|
|
1989
|
+
filter: { type: "string" },
|
|
1990
|
+
order: { type: "string" }
|
|
1991
|
+
}
|
|
1992
|
+
},
|
|
1993
|
+
request: {
|
|
1994
|
+
method: "GET",
|
|
1995
|
+
path: "/v1/environments/{connection.environmentId}/users",
|
|
1996
|
+
query: { limit: "{limit}", filter: "{filter}", order: "{order}" }
|
|
1997
|
+
}
|
|
1998
|
+
},
|
|
1999
|
+
{
|
|
2000
|
+
name: "users.get",
|
|
2001
|
+
class: "read",
|
|
2002
|
+
description: "Read one PingOne user.",
|
|
2003
|
+
parameters: { type: "object", properties: { userId: userId3 }, required: ["userId"] },
|
|
2004
|
+
request: { method: "GET", path: "/v1/environments/{connection.environmentId}/users/{userId}" }
|
|
2005
|
+
},
|
|
2006
|
+
{
|
|
2007
|
+
name: "users.create",
|
|
2008
|
+
class: "mutation",
|
|
2009
|
+
description: "Create a PingOne user from a provider-native user object.",
|
|
2010
|
+
parameters: {
|
|
2011
|
+
type: "object",
|
|
2012
|
+
properties: { user: { type: "object" } },
|
|
2013
|
+
required: ["user"]
|
|
2014
|
+
},
|
|
2015
|
+
request: { method: "POST", path: "/v1/environments/{connection.environmentId}/users", body: "{user}" },
|
|
2016
|
+
cas: "native-idempotency",
|
|
2017
|
+
externalEffect: true
|
|
2018
|
+
},
|
|
2019
|
+
{
|
|
2020
|
+
name: "users.update",
|
|
2021
|
+
class: "mutation",
|
|
2022
|
+
description: "Patch mutable fields on a PingOne user.",
|
|
2023
|
+
parameters: {
|
|
2024
|
+
type: "object",
|
|
2025
|
+
properties: { userId: userId3, user: { type: "object" } },
|
|
2026
|
+
required: ["userId", "user"]
|
|
2027
|
+
},
|
|
2028
|
+
request: { method: "PATCH", path: "/v1/environments/{connection.environmentId}/users/{userId}", body: "{user}" },
|
|
2029
|
+
cas: "optimistic-read-verify",
|
|
2030
|
+
externalEffect: true
|
|
2031
|
+
},
|
|
2032
|
+
{
|
|
2033
|
+
name: "users.deactivate",
|
|
2034
|
+
class: "mutation",
|
|
2035
|
+
description: "Disable a PingOne user without deleting the record.",
|
|
2036
|
+
parameters: { type: "object", properties: { userId: userId3 }, required: ["userId"] },
|
|
2037
|
+
request: {
|
|
2038
|
+
method: "PATCH",
|
|
2039
|
+
path: "/v1/environments/{connection.environmentId}/users/{userId}",
|
|
2040
|
+
body: { enabled: false }
|
|
2041
|
+
},
|
|
2042
|
+
cas: "optimistic-read-verify",
|
|
2043
|
+
externalEffect: true
|
|
2044
|
+
},
|
|
2045
|
+
{
|
|
2046
|
+
name: "groups.list",
|
|
2047
|
+
class: "read",
|
|
2048
|
+
description: "List or filter groups in the PingOne environment.",
|
|
2049
|
+
parameters: {
|
|
2050
|
+
type: "object",
|
|
2051
|
+
properties: {
|
|
2052
|
+
limit: { type: "integer", minimum: 1, maximum: 200 },
|
|
2053
|
+
filter: { type: "string" }
|
|
2054
|
+
}
|
|
2055
|
+
},
|
|
2056
|
+
request: {
|
|
2057
|
+
method: "GET",
|
|
2058
|
+
path: "/v1/environments/{connection.environmentId}/groups",
|
|
2059
|
+
query: { limit: "{limit}", filter: "{filter}" }
|
|
2060
|
+
}
|
|
2061
|
+
},
|
|
2062
|
+
{
|
|
2063
|
+
name: "groups.get",
|
|
2064
|
+
class: "read",
|
|
2065
|
+
description: "Read one PingOne group.",
|
|
2066
|
+
parameters: { type: "object", properties: { groupId: groupId3 }, required: ["groupId"] },
|
|
2067
|
+
request: { method: "GET", path: "/v1/environments/{connection.environmentId}/groups/{groupId}" }
|
|
2068
|
+
},
|
|
2069
|
+
{
|
|
2070
|
+
name: "groups.create",
|
|
2071
|
+
class: "mutation",
|
|
2072
|
+
description: "Create a PingOne group from a provider-native group object.",
|
|
2073
|
+
parameters: { type: "object", properties: { group: { type: "object" } }, required: ["group"] },
|
|
2074
|
+
request: { method: "POST", path: "/v1/environments/{connection.environmentId}/groups", body: "{group}" },
|
|
2075
|
+
cas: "native-idempotency",
|
|
2076
|
+
externalEffect: true
|
|
2077
|
+
},
|
|
2078
|
+
{
|
|
2079
|
+
name: "groups.update",
|
|
2080
|
+
class: "mutation",
|
|
2081
|
+
description: "Patch mutable fields on a PingOne group.",
|
|
2082
|
+
parameters: {
|
|
2083
|
+
type: "object",
|
|
2084
|
+
properties: { groupId: groupId3, group: { type: "object" } },
|
|
2085
|
+
required: ["groupId", "group"]
|
|
2086
|
+
},
|
|
2087
|
+
request: { method: "PUT", path: "/v1/environments/{connection.environmentId}/groups/{groupId}", body: "{group}" },
|
|
2088
|
+
cas: "optimistic-read-verify",
|
|
2089
|
+
externalEffect: true
|
|
2090
|
+
},
|
|
2091
|
+
{
|
|
2092
|
+
name: "groups.users.add",
|
|
2093
|
+
class: "mutation",
|
|
2094
|
+
description: "Add a PingOne user to a group.",
|
|
2095
|
+
parameters: {
|
|
2096
|
+
type: "object",
|
|
2097
|
+
properties: { groupId: groupId3, userId: userId3 },
|
|
2098
|
+
required: ["groupId", "userId"]
|
|
2099
|
+
},
|
|
2100
|
+
request: {
|
|
2101
|
+
method: "POST",
|
|
2102
|
+
path: "/v1/environments/{connection.environmentId}/users/{userId}/memberOfGroups",
|
|
2103
|
+
body: { id: "{groupId}" }
|
|
2104
|
+
},
|
|
2105
|
+
cas: "native-idempotency",
|
|
2106
|
+
externalEffect: true
|
|
2107
|
+
},
|
|
2108
|
+
{
|
|
2109
|
+
name: "groups.users.remove",
|
|
2110
|
+
class: "mutation",
|
|
2111
|
+
description: "Remove a PingOne user from a group.",
|
|
2112
|
+
parameters: {
|
|
2113
|
+
type: "object",
|
|
2114
|
+
properties: { groupId: groupId3, userId: userId3 },
|
|
2115
|
+
required: ["groupId", "userId"]
|
|
2116
|
+
},
|
|
2117
|
+
request: {
|
|
2118
|
+
method: "DELETE",
|
|
2119
|
+
path: "/v1/environments/{connection.environmentId}/users/{userId}/memberOfGroups/{groupId}"
|
|
2120
|
+
},
|
|
2121
|
+
cas: "native-idempotency",
|
|
2122
|
+
externalEffect: true
|
|
2123
|
+
}
|
|
2124
|
+
]
|
|
2125
|
+
});
|
|
2126
|
+
|
|
2127
|
+
// src/connectors/adapters/scim.ts
|
|
2128
|
+
var userId4 = { type: "string", description: "SCIM user resource id." };
|
|
2129
|
+
var groupId4 = { type: "string", description: "SCIM group resource id." };
|
|
2130
|
+
var patchSchema = "urn:ietf:params:scim:api:messages:2.0:PatchOp";
|
|
2131
|
+
var scimRestConnector = declarativeRestConnector({
|
|
2132
|
+
kind: "scim",
|
|
2133
|
+
displayName: "SCIM",
|
|
2134
|
+
description: "Provision users, groups, and group memberships against any public SCIM 2.0 service provider.",
|
|
2135
|
+
auth: {
|
|
2136
|
+
kind: "api-key",
|
|
2137
|
+
hint: "SCIM bearer token. Set baseUrl to the provider SCIM 2.0 root, for example https://tenant.example.com/scim/v2."
|
|
2138
|
+
},
|
|
2139
|
+
category: "other",
|
|
2140
|
+
defaultConsistencyModel: "authoritative",
|
|
2141
|
+
baseUrl: { metadataKey: "baseUrl" },
|
|
2142
|
+
requirePublicHttpsBaseUrl: true,
|
|
2143
|
+
credentialPlacement: { kind: "bearer" },
|
|
2144
|
+
defaultHeaders: {
|
|
2145
|
+
Accept: "application/scim+json, application/json",
|
|
2146
|
+
"Content-Type": "application/scim+json"
|
|
2147
|
+
},
|
|
2148
|
+
test: { method: "GET", path: "/ServiceProviderConfig" },
|
|
2149
|
+
capabilities: [
|
|
2150
|
+
{
|
|
2151
|
+
name: "users.list",
|
|
2152
|
+
class: "read",
|
|
2153
|
+
description: "List or filter SCIM users with standard pagination and attribute selection.",
|
|
2154
|
+
parameters: {
|
|
2155
|
+
type: "object",
|
|
2156
|
+
properties: {
|
|
2157
|
+
filter: { type: "string" },
|
|
2158
|
+
startIndex: { type: "integer", minimum: 1 },
|
|
2159
|
+
count: { type: "integer", minimum: 1, maximum: 1e3 },
|
|
2160
|
+
attributes: { type: "string" },
|
|
2161
|
+
excludedAttributes: { type: "string" },
|
|
2162
|
+
sortBy: { type: "string" },
|
|
2163
|
+
sortOrder: { type: "string", enum: ["ascending", "descending"] }
|
|
2164
|
+
}
|
|
2165
|
+
},
|
|
2166
|
+
request: {
|
|
2167
|
+
method: "GET",
|
|
2168
|
+
path: "/Users",
|
|
2169
|
+
query: {
|
|
2170
|
+
filter: "{filter}",
|
|
2171
|
+
startIndex: "{startIndex}",
|
|
2172
|
+
count: "{count}",
|
|
2173
|
+
attributes: "{attributes}",
|
|
2174
|
+
excludedAttributes: "{excludedAttributes}",
|
|
2175
|
+
sortBy: "{sortBy}",
|
|
2176
|
+
sortOrder: "{sortOrder}"
|
|
2177
|
+
}
|
|
2178
|
+
}
|
|
2179
|
+
},
|
|
2180
|
+
{
|
|
2181
|
+
name: "users.get",
|
|
2182
|
+
class: "read",
|
|
2183
|
+
description: "Read one SCIM user.",
|
|
2184
|
+
parameters: { type: "object", properties: { userId: userId4 }, required: ["userId"] },
|
|
2185
|
+
request: { method: "GET", path: "/Users/{userId}" }
|
|
2186
|
+
},
|
|
2187
|
+
{
|
|
2188
|
+
name: "users.create",
|
|
2189
|
+
class: "mutation",
|
|
2190
|
+
description: "Create a SCIM user from a complete provider-compatible resource.",
|
|
2191
|
+
parameters: { type: "object", properties: { user: { type: "object" } }, required: ["user"] },
|
|
2192
|
+
request: { method: "POST", path: "/Users", body: "{user}" },
|
|
2193
|
+
cas: "native-idempotency",
|
|
2194
|
+
externalEffect: true
|
|
2195
|
+
},
|
|
2196
|
+
{
|
|
2197
|
+
name: "users.replace",
|
|
2198
|
+
class: "mutation",
|
|
2199
|
+
description: "Replace a SCIM user resource.",
|
|
2200
|
+
parameters: {
|
|
2201
|
+
type: "object",
|
|
2202
|
+
properties: { userId: userId4, user: { type: "object" } },
|
|
2203
|
+
required: ["userId", "user"]
|
|
2204
|
+
},
|
|
2205
|
+
request: { method: "PUT", path: "/Users/{userId}", body: "{user}" },
|
|
2206
|
+
cas: "etag-if-match",
|
|
2207
|
+
externalEffect: true
|
|
2208
|
+
},
|
|
2209
|
+
{
|
|
2210
|
+
name: "users.update",
|
|
2211
|
+
class: "mutation",
|
|
2212
|
+
description: "Apply SCIM PatchOp operations to a user.",
|
|
2213
|
+
parameters: {
|
|
2214
|
+
type: "object",
|
|
2215
|
+
properties: { userId: userId4, operations: { type: "array", items: { type: "object" } } },
|
|
2216
|
+
required: ["userId", "operations"]
|
|
2217
|
+
},
|
|
2218
|
+
request: {
|
|
2219
|
+
method: "PATCH",
|
|
2220
|
+
path: "/Users/{userId}",
|
|
2221
|
+
body: { schemas: [patchSchema], Operations: "{operations}" }
|
|
2222
|
+
},
|
|
2223
|
+
cas: "etag-if-match",
|
|
2224
|
+
externalEffect: true
|
|
2225
|
+
},
|
|
2226
|
+
{
|
|
2227
|
+
name: "users.deactivate",
|
|
2228
|
+
class: "mutation",
|
|
2229
|
+
description: "Deactivate a SCIM user by setting active=false.",
|
|
2230
|
+
parameters: { type: "object", properties: { userId: userId4 }, required: ["userId"] },
|
|
2231
|
+
request: {
|
|
2232
|
+
method: "PATCH",
|
|
2233
|
+
path: "/Users/{userId}",
|
|
2234
|
+
body: { schemas: [patchSchema], Operations: [{ op: "replace", path: "active", value: false }] }
|
|
2235
|
+
},
|
|
2236
|
+
cas: "etag-if-match",
|
|
2237
|
+
externalEffect: true
|
|
2238
|
+
},
|
|
2239
|
+
{
|
|
2240
|
+
name: "groups.list",
|
|
2241
|
+
class: "read",
|
|
2242
|
+
description: "List or filter SCIM groups.",
|
|
2243
|
+
parameters: {
|
|
2244
|
+
type: "object",
|
|
2245
|
+
properties: {
|
|
2246
|
+
filter: { type: "string" },
|
|
2247
|
+
startIndex: { type: "integer", minimum: 1 },
|
|
2248
|
+
count: { type: "integer", minimum: 1, maximum: 1e3 },
|
|
2249
|
+
attributes: { type: "string" },
|
|
2250
|
+
excludedAttributes: { type: "string" }
|
|
2251
|
+
}
|
|
2252
|
+
},
|
|
2253
|
+
request: {
|
|
2254
|
+
method: "GET",
|
|
2255
|
+
path: "/Groups",
|
|
2256
|
+
query: {
|
|
2257
|
+
filter: "{filter}",
|
|
2258
|
+
startIndex: "{startIndex}",
|
|
2259
|
+
count: "{count}",
|
|
2260
|
+
attributes: "{attributes}",
|
|
2261
|
+
excludedAttributes: "{excludedAttributes}"
|
|
2262
|
+
}
|
|
2263
|
+
}
|
|
2264
|
+
},
|
|
2265
|
+
{
|
|
2266
|
+
name: "groups.get",
|
|
2267
|
+
class: "read",
|
|
2268
|
+
description: "Read one SCIM group.",
|
|
2269
|
+
parameters: { type: "object", properties: { groupId: groupId4 }, required: ["groupId"] },
|
|
2270
|
+
request: { method: "GET", path: "/Groups/{groupId}" }
|
|
2271
|
+
},
|
|
2272
|
+
{
|
|
2273
|
+
name: "groups.create",
|
|
2274
|
+
class: "mutation",
|
|
2275
|
+
description: "Create a SCIM group from a complete provider-compatible resource.",
|
|
2276
|
+
parameters: { type: "object", properties: { group: { type: "object" } }, required: ["group"] },
|
|
2277
|
+
request: { method: "POST", path: "/Groups", body: "{group}" },
|
|
2278
|
+
cas: "native-idempotency",
|
|
2279
|
+
externalEffect: true
|
|
2280
|
+
},
|
|
2281
|
+
{
|
|
2282
|
+
name: "groups.update",
|
|
2283
|
+
class: "mutation",
|
|
2284
|
+
description: "Apply SCIM PatchOp operations to a group.",
|
|
2285
|
+
parameters: {
|
|
2286
|
+
type: "object",
|
|
2287
|
+
properties: { groupId: groupId4, operations: { type: "array", items: { type: "object" } } },
|
|
2288
|
+
required: ["groupId", "operations"]
|
|
2289
|
+
},
|
|
2290
|
+
request: {
|
|
2291
|
+
method: "PATCH",
|
|
2292
|
+
path: "/Groups/{groupId}",
|
|
2293
|
+
body: { schemas: [patchSchema], Operations: "{operations}" }
|
|
2294
|
+
},
|
|
2295
|
+
cas: "etag-if-match",
|
|
2296
|
+
externalEffect: true
|
|
2297
|
+
},
|
|
2298
|
+
{
|
|
2299
|
+
name: "groups.users.add",
|
|
2300
|
+
class: "mutation",
|
|
2301
|
+
description: "Add a user reference to a SCIM group.",
|
|
2302
|
+
parameters: {
|
|
2303
|
+
type: "object",
|
|
2304
|
+
properties: { groupId: groupId4, userId: userId4 },
|
|
2305
|
+
required: ["groupId", "userId"]
|
|
2306
|
+
},
|
|
2307
|
+
request: {
|
|
2308
|
+
method: "PATCH",
|
|
2309
|
+
path: "/Groups/{groupId}",
|
|
2310
|
+
body: {
|
|
2311
|
+
schemas: [patchSchema],
|
|
2312
|
+
Operations: [{ op: "add", path: "members", value: [{ value: "{userId}" }] }]
|
|
2313
|
+
}
|
|
2314
|
+
},
|
|
2315
|
+
cas: "etag-if-match",
|
|
2316
|
+
externalEffect: true
|
|
2317
|
+
},
|
|
2318
|
+
{
|
|
2319
|
+
name: "groups.users.remove",
|
|
2320
|
+
class: "mutation",
|
|
2321
|
+
description: "Remove a user reference from a SCIM group.",
|
|
2322
|
+
parameters: {
|
|
2323
|
+
type: "object",
|
|
2324
|
+
properties: {
|
|
2325
|
+
groupId: groupId4,
|
|
2326
|
+
userId: userId4
|
|
2327
|
+
},
|
|
2328
|
+
required: ["groupId", "userId"]
|
|
2329
|
+
},
|
|
2330
|
+
request: {
|
|
2331
|
+
method: "PATCH",
|
|
2332
|
+
path: "/Groups/{groupId}",
|
|
2333
|
+
body: { schemas: [patchSchema], Operations: ["{operation}"] }
|
|
2334
|
+
},
|
|
2335
|
+
cas: "etag-if-match",
|
|
2336
|
+
externalEffect: true
|
|
2337
|
+
}
|
|
2338
|
+
]
|
|
2339
|
+
});
|
|
2340
|
+
var scimConnector = {
|
|
2341
|
+
...scimRestConnector,
|
|
2342
|
+
async executeMutation(invocation) {
|
|
2343
|
+
if (invocation.capabilityName !== "groups.users.remove") {
|
|
2344
|
+
return scimRestConnector.executeMutation(invocation);
|
|
2345
|
+
}
|
|
2346
|
+
const userIdValue = invocation.args.userId;
|
|
2347
|
+
if (typeof userIdValue !== "string" || !userIdValue.trim()) {
|
|
2348
|
+
throw new Error("missing required argument: userId");
|
|
2349
|
+
}
|
|
2350
|
+
return scimRestConnector.executeMutation({
|
|
2351
|
+
...invocation,
|
|
2352
|
+
args: {
|
|
2353
|
+
...invocation.args,
|
|
2354
|
+
operation: {
|
|
2355
|
+
op: "remove",
|
|
2356
|
+
path: `members[value eq "${escapeScimFilterValue(userIdValue)}"]`
|
|
2357
|
+
}
|
|
2358
|
+
}
|
|
2359
|
+
});
|
|
2360
|
+
}
|
|
2361
|
+
};
|
|
2362
|
+
function escapeScimFilterValue(value) {
|
|
2363
|
+
return value.replace(/\\/g, "\\\\").replace(/"/g, '\\"');
|
|
2364
|
+
}
|
|
2365
|
+
|
|
1540
2366
|
// src/connectors/adapters/actualbudget.ts
|
|
1541
2367
|
var actualbudgetConnector = declarativeRestConnector({
|
|
1542
2368
|
kind: "actualbudget",
|
|
@@ -6899,7 +7725,7 @@ var modelslabConnector = {
|
|
|
6899
7725
|
if (inv.capabilityName !== "text.to.image") {
|
|
6900
7726
|
throw new Error(`modelslab: unknown mutation capability ${inv.capabilityName}`);
|
|
6901
7727
|
}
|
|
6902
|
-
const prompt =
|
|
7728
|
+
const prompt = requiredString2(inv.args, "prompt");
|
|
6903
7729
|
const data4 = await request(inv.source, `${baseUrl}/text2img`, {
|
|
6904
7730
|
...pick(inv.args, [
|
|
6905
7731
|
"negative_prompt",
|
|
@@ -6925,7 +7751,7 @@ var modelslabConnector = {
|
|
|
6925
7751
|
if (inv.capabilityName !== "images.status") {
|
|
6926
7752
|
throw new Error(`modelslab: unknown read capability ${inv.capabilityName}`);
|
|
6927
7753
|
}
|
|
6928
|
-
const requestId = encodeURIComponent(
|
|
7754
|
+
const requestId = encodeURIComponent(requiredString2(inv.args, "requestId"));
|
|
6929
7755
|
const data4 = await request(inv.source, `${baseUrl}/fetch/${requestId}`, {});
|
|
6930
7756
|
return { data: data4, fetchedAt: Date.now() };
|
|
6931
7757
|
},
|
|
@@ -6954,7 +7780,7 @@ async function request(source, url, body) {
|
|
|
6954
7780
|
throw new ProviderRateLimited("ModelsLab rate limit (429)", source.id, {
|
|
6955
7781
|
status: 429,
|
|
6956
7782
|
body: responseBody,
|
|
6957
|
-
retryAfterMs:
|
|
7783
|
+
retryAfterMs: retryAfterMs2(response.headers.get("retry-after"))
|
|
6958
7784
|
});
|
|
6959
7785
|
}
|
|
6960
7786
|
if (!response.ok) throw new Error(`modelslab POST ${new URL(url).pathname} HTTP ${response.status}`);
|
|
@@ -6967,7 +7793,7 @@ function credential(source) {
|
|
|
6967
7793
|
}
|
|
6968
7794
|
return source.credentials.apiKey;
|
|
6969
7795
|
}
|
|
6970
|
-
function
|
|
7796
|
+
function requiredString2(args, key) {
|
|
6971
7797
|
const value = args[key];
|
|
6972
7798
|
if (typeof value !== "string" || !value) throw new Error(`modelslab: ${key} is required`);
|
|
6973
7799
|
return value;
|
|
@@ -6987,7 +7813,7 @@ async function readBody(response) {
|
|
|
6987
7813
|
function isErrorResponse(value) {
|
|
6988
7814
|
return Boolean(value && typeof value === "object" && value.status === "error");
|
|
6989
7815
|
}
|
|
6990
|
-
function
|
|
7816
|
+
function retryAfterMs2(value) {
|
|
6991
7817
|
if (!value) return 6e4;
|
|
6992
7818
|
const seconds = Number(value);
|
|
6993
7819
|
return Number.isFinite(seconds) && seconds >= 0 ? Math.max(1e3, seconds * 1e3) : 6e4;
|
|
@@ -7701,12 +8527,12 @@ function collectionRead(name, description, path, entity) {
|
|
|
7701
8527
|
}
|
|
7702
8528
|
};
|
|
7703
8529
|
}
|
|
7704
|
-
function entityRead(name, description, path,
|
|
8530
|
+
function entityRead(name, description, path, id2) {
|
|
7705
8531
|
return {
|
|
7706
8532
|
name,
|
|
7707
8533
|
class: "read",
|
|
7708
8534
|
description,
|
|
7709
|
-
parameters: idParameters(
|
|
8535
|
+
parameters: idParameters(id2),
|
|
7710
8536
|
request: { method: "GET", path }
|
|
7711
8537
|
};
|
|
7712
8538
|
}
|
|
@@ -7721,15 +8547,15 @@ function entityCreate(name, description, path) {
|
|
|
7721
8547
|
externalEffect: true
|
|
7722
8548
|
};
|
|
7723
8549
|
}
|
|
7724
|
-
function entityUpdate(name, description, path,
|
|
8550
|
+
function entityUpdate(name, description, path, id2) {
|
|
7725
8551
|
return {
|
|
7726
8552
|
name,
|
|
7727
8553
|
class: "mutation",
|
|
7728
8554
|
description,
|
|
7729
8555
|
parameters: {
|
|
7730
8556
|
type: "object",
|
|
7731
|
-
properties: { [
|
|
7732
|
-
required: [
|
|
8557
|
+
properties: { [id2]: { type: "integer" } },
|
|
8558
|
+
required: [id2],
|
|
7733
8559
|
additionalProperties: true
|
|
7734
8560
|
},
|
|
7735
8561
|
request: { method: "PUT", path, body: "args" },
|
|
@@ -7737,22 +8563,22 @@ function entityUpdate(name, description, path, id) {
|
|
|
7737
8563
|
externalEffect: true
|
|
7738
8564
|
};
|
|
7739
8565
|
}
|
|
7740
|
-
function entityDelete(name, description, path,
|
|
8566
|
+
function entityDelete(name, description, path, id2) {
|
|
7741
8567
|
return {
|
|
7742
8568
|
name,
|
|
7743
8569
|
class: "mutation",
|
|
7744
8570
|
description,
|
|
7745
|
-
parameters: idParameters(
|
|
8571
|
+
parameters: idParameters(id2),
|
|
7746
8572
|
request: { method: "DELETE", path },
|
|
7747
8573
|
cas: "native-idempotency",
|
|
7748
8574
|
externalEffect: true
|
|
7749
8575
|
};
|
|
7750
8576
|
}
|
|
7751
|
-
function idParameters(
|
|
8577
|
+
function idParameters(id2) {
|
|
7752
8578
|
return {
|
|
7753
8579
|
type: "object",
|
|
7754
|
-
properties: { [
|
|
7755
|
-
required: [
|
|
8580
|
+
properties: { [id2]: { type: "integer" } },
|
|
8581
|
+
required: [id2]
|
|
7756
8582
|
};
|
|
7757
8583
|
}
|
|
7758
8584
|
function arbitraryBodyParameters() {
|
|
@@ -9635,6 +10461,192 @@ var avomaConnector = declarativeRestConnector({
|
|
|
9635
10461
|
]
|
|
9636
10462
|
});
|
|
9637
10463
|
|
|
10464
|
+
// src/connectors/adapters/avalara.ts
|
|
10465
|
+
var companyCode = { type: "string", description: "Avalara company code." };
|
|
10466
|
+
var transactionCode = { type: "string", description: "Merchant transaction code." };
|
|
10467
|
+
var model = {
|
|
10468
|
+
type: "object",
|
|
10469
|
+
description: "Provider-native AvaTax v2 request model."
|
|
10470
|
+
};
|
|
10471
|
+
var avalaraConnector = declarativeRestConnector({
|
|
10472
|
+
kind: "avalara",
|
|
10473
|
+
displayName: "Avalara AvaTax",
|
|
10474
|
+
description: "Calculate tax and manage AvaTax transaction documents, adjustments, commits, voids, and refunds.",
|
|
10475
|
+
auth: {
|
|
10476
|
+
kind: "api-key",
|
|
10477
|
+
hint: 'JSON credential bundle: {"accountId":"...","licenseKey":"..."}. Use apiBaseUrl metadata for the sandbox host when needed.'
|
|
10478
|
+
},
|
|
10479
|
+
category: "commerce",
|
|
10480
|
+
defaultConsistencyModel: "authoritative",
|
|
10481
|
+
baseUrl: { metadataKey: "apiBaseUrl", fallback: "https://rest.avatax.com" },
|
|
10482
|
+
allowedBaseUrls: ["https://rest.avatax.com", "https://sandbox-rest.avatax.com"],
|
|
10483
|
+
credentialPlacement: {
|
|
10484
|
+
kind: "basic-structured",
|
|
10485
|
+
usernameField: "accountId",
|
|
10486
|
+
passwordField: "licenseKey"
|
|
10487
|
+
},
|
|
10488
|
+
test: { method: "GET", path: "/api/v2/utilities/ping" },
|
|
10489
|
+
capabilities: [
|
|
10490
|
+
{
|
|
10491
|
+
name: "rates.by-address",
|
|
10492
|
+
class: "read",
|
|
10493
|
+
description: "Estimate the total tax rate for one postal address.",
|
|
10494
|
+
parameters: {
|
|
10495
|
+
type: "object",
|
|
10496
|
+
properties: {
|
|
10497
|
+
line1: { type: "string" },
|
|
10498
|
+
city: { type: "string" },
|
|
10499
|
+
region: { type: "string" },
|
|
10500
|
+
postalCode: { type: "string" },
|
|
10501
|
+
country: { type: "string" }
|
|
10502
|
+
},
|
|
10503
|
+
required: ["postalCode", "country"]
|
|
10504
|
+
},
|
|
10505
|
+
request: {
|
|
10506
|
+
method: "GET",
|
|
10507
|
+
path: "/api/v2/taxrates/byaddress",
|
|
10508
|
+
query: {
|
|
10509
|
+
line1: "{line1}",
|
|
10510
|
+
city: "{city}",
|
|
10511
|
+
region: "{region}",
|
|
10512
|
+
postalCode: "{postalCode}",
|
|
10513
|
+
country: "{country}"
|
|
10514
|
+
}
|
|
10515
|
+
}
|
|
10516
|
+
},
|
|
10517
|
+
{
|
|
10518
|
+
name: "definitions.tax-codes.list",
|
|
10519
|
+
class: "read",
|
|
10520
|
+
description: "List Avalara system tax codes for product classification.",
|
|
10521
|
+
parameters: {
|
|
10522
|
+
type: "object",
|
|
10523
|
+
properties: {
|
|
10524
|
+
top: { type: "integer", minimum: 1, maximum: 1e3 },
|
|
10525
|
+
skip: { type: "integer", minimum: 0 },
|
|
10526
|
+
filter: { type: "string" },
|
|
10527
|
+
orderBy: { type: "string" }
|
|
10528
|
+
}
|
|
10529
|
+
},
|
|
10530
|
+
request: {
|
|
10531
|
+
method: "GET",
|
|
10532
|
+
path: "/api/v2/definitions/taxcodes",
|
|
10533
|
+
query: { "$top": "{top}", "$skip": "{skip}", "$filter": "{filter}", "$orderby": "{orderBy}" }
|
|
10534
|
+
}
|
|
10535
|
+
},
|
|
10536
|
+
{
|
|
10537
|
+
name: "transactions.create",
|
|
10538
|
+
class: "mutation",
|
|
10539
|
+
description: "Create an AvaTax transaction document and calculate its tax.",
|
|
10540
|
+
parameters: {
|
|
10541
|
+
type: "object",
|
|
10542
|
+
properties: { model },
|
|
10543
|
+
required: ["model"]
|
|
10544
|
+
},
|
|
10545
|
+
request: { method: "POST", path: "/api/v2/transactions/create", body: "{model}" },
|
|
10546
|
+
cas: "native-idempotency",
|
|
10547
|
+
externalEffect: true
|
|
10548
|
+
},
|
|
10549
|
+
{
|
|
10550
|
+
name: "transactions.create-or-adjust",
|
|
10551
|
+
class: "mutation",
|
|
10552
|
+
description: "Create a transaction or adjust the existing transaction with the same company/code/type.",
|
|
10553
|
+
parameters: {
|
|
10554
|
+
type: "object",
|
|
10555
|
+
properties: { model },
|
|
10556
|
+
required: ["model"]
|
|
10557
|
+
},
|
|
10558
|
+
request: { method: "POST", path: "/api/v2/transactions/createoradjust", body: "{model}" },
|
|
10559
|
+
cas: "native-idempotency",
|
|
10560
|
+
externalEffect: true
|
|
10561
|
+
},
|
|
10562
|
+
transactionRead("transactions.get", "", "Read one AvaTax transaction and its summary."),
|
|
10563
|
+
{
|
|
10564
|
+
name: "transactions.audit",
|
|
10565
|
+
class: "read",
|
|
10566
|
+
description: "Read the audit trail for one AvaTax transaction.",
|
|
10567
|
+
parameters: {
|
|
10568
|
+
type: "object",
|
|
10569
|
+
properties: { companyCode, transactionCode },
|
|
10570
|
+
required: ["companyCode", "transactionCode"]
|
|
10571
|
+
},
|
|
10572
|
+
request: {
|
|
10573
|
+
method: "GET",
|
|
10574
|
+
path: "/api/v2/companies/{companyCode}/transactions/{transactionCode}/audit"
|
|
10575
|
+
}
|
|
10576
|
+
},
|
|
10577
|
+
transactionAction("transactions.commit", "/commit", "Commit a transaction for reporting and filing."),
|
|
10578
|
+
transactionAction("transactions.void", "/void", "Void a transaction with an explicit AvaTax void reason."),
|
|
10579
|
+
transactionAction("transactions.refund", "/refund", "Create a full or partial refund transaction."),
|
|
10580
|
+
transactionAction("transactions.lock", "/lock", "Lock a transaction against further edits."),
|
|
10581
|
+
{
|
|
10582
|
+
name: "companies.list",
|
|
10583
|
+
class: "read",
|
|
10584
|
+
description: "List AvaTax companies accessible to the account.",
|
|
10585
|
+
parameters: {
|
|
10586
|
+
type: "object",
|
|
10587
|
+
properties: {
|
|
10588
|
+
top: { type: "integer", minimum: 1, maximum: 1e3 },
|
|
10589
|
+
skip: { type: "integer", minimum: 0 },
|
|
10590
|
+
filter: { type: "string" }
|
|
10591
|
+
}
|
|
10592
|
+
},
|
|
10593
|
+
request: {
|
|
10594
|
+
method: "GET",
|
|
10595
|
+
path: "/api/v2/companies",
|
|
10596
|
+
query: { "$top": "{top}", "$skip": "{skip}", "$filter": "{filter}" }
|
|
10597
|
+
}
|
|
10598
|
+
}
|
|
10599
|
+
]
|
|
10600
|
+
});
|
|
10601
|
+
function transactionRead(name, suffix, description) {
|
|
10602
|
+
return {
|
|
10603
|
+
name,
|
|
10604
|
+
class: "read",
|
|
10605
|
+
description,
|
|
10606
|
+
parameters: {
|
|
10607
|
+
type: "object",
|
|
10608
|
+
properties: {
|
|
10609
|
+
companyCode,
|
|
10610
|
+
transactionCode,
|
|
10611
|
+
documentType: { type: "string" },
|
|
10612
|
+
include: { type: "string", description: "Related response objects to include." }
|
|
10613
|
+
},
|
|
10614
|
+
required: ["companyCode", "transactionCode"]
|
|
10615
|
+
},
|
|
10616
|
+
request: {
|
|
10617
|
+
method: "GET",
|
|
10618
|
+
path: `/api/v2/companies/{companyCode}/transactions/{transactionCode}${suffix}`,
|
|
10619
|
+
query: { documentType: "{documentType}", "$include": "{include}" }
|
|
10620
|
+
}
|
|
10621
|
+
};
|
|
10622
|
+
}
|
|
10623
|
+
function transactionAction(name, suffix, description) {
|
|
10624
|
+
return {
|
|
10625
|
+
name,
|
|
10626
|
+
class: "mutation",
|
|
10627
|
+
description,
|
|
10628
|
+
parameters: {
|
|
10629
|
+
type: "object",
|
|
10630
|
+
properties: {
|
|
10631
|
+
companyCode,
|
|
10632
|
+
transactionCode,
|
|
10633
|
+
documentType: { type: "string" },
|
|
10634
|
+
include: { type: "string", description: "Related response objects to include." },
|
|
10635
|
+
model
|
|
10636
|
+
},
|
|
10637
|
+
required: ["companyCode", "transactionCode", "model"]
|
|
10638
|
+
},
|
|
10639
|
+
request: {
|
|
10640
|
+
method: "POST",
|
|
10641
|
+
path: `/api/v2/companies/{companyCode}/transactions/{transactionCode}${suffix}`,
|
|
10642
|
+
query: { documentType: "{documentType}", "$include": "{include}" },
|
|
10643
|
+
body: "{model}"
|
|
10644
|
+
},
|
|
10645
|
+
cas: "native-idempotency",
|
|
10646
|
+
externalEffect: true
|
|
10647
|
+
};
|
|
10648
|
+
}
|
|
10649
|
+
|
|
9638
10650
|
// src/connectors/adapters/azure-ad.ts
|
|
9639
10651
|
var azureAdConnector = declarativeRestConnector({
|
|
9640
10652
|
kind: "azure-ad",
|
|
@@ -15310,6 +16322,494 @@ var chargebeeConnector = declarativeRestConnector({
|
|
|
15310
16322
|
]
|
|
15311
16323
|
});
|
|
15312
16324
|
|
|
16325
|
+
// src/connectors/adapters/recurly.ts
|
|
16326
|
+
var id = (description) => ({ type: "string", description });
|
|
16327
|
+
var pageQuery = {
|
|
16328
|
+
limit: { type: "integer", minimum: 1, maximum: 200 },
|
|
16329
|
+
cursor: { type: "string" },
|
|
16330
|
+
sort: { type: "string", enum: ["asc", "desc"] },
|
|
16331
|
+
begin_time: { type: "string", description: "ISO 8601 lower timestamp bound." },
|
|
16332
|
+
end_time: { type: "string", description: "ISO 8601 upper timestamp bound." }
|
|
16333
|
+
};
|
|
16334
|
+
var recurlyConnector = declarativeRestConnector({
|
|
16335
|
+
kind: "recurly",
|
|
16336
|
+
displayName: "Recurly",
|
|
16337
|
+
description: "Manage Recurly billing accounts, plans, subscriptions, invoices, and subscription lifecycle state.",
|
|
16338
|
+
auth: {
|
|
16339
|
+
kind: "api-key",
|
|
16340
|
+
hint: "Recurly private API key from Developer Settings. Sent as the HTTP Basic username with an empty password."
|
|
16341
|
+
},
|
|
16342
|
+
category: "crm",
|
|
16343
|
+
defaultConsistencyModel: "authoritative",
|
|
16344
|
+
baseUrl: "https://v3.recurly.com",
|
|
16345
|
+
credentialPlacement: { kind: "basic-api-key" },
|
|
16346
|
+
defaultHeaders: {
|
|
16347
|
+
accept: "application/vnd.recurly.v2021-02-25",
|
|
16348
|
+
"content-type": "application/json"
|
|
16349
|
+
},
|
|
16350
|
+
test: { method: "GET", path: "/sites", query: { limit: 1 } },
|
|
16351
|
+
capabilities: [
|
|
16352
|
+
{
|
|
16353
|
+
name: "sites.list",
|
|
16354
|
+
class: "read",
|
|
16355
|
+
description: "List sites accessible to the supplied Recurly private API key.",
|
|
16356
|
+
parameters: { type: "object", properties: { limit: pageQuery.limit } },
|
|
16357
|
+
request: { method: "GET", path: "/sites", query: { limit: "{limit}" } }
|
|
16358
|
+
},
|
|
16359
|
+
{
|
|
16360
|
+
name: "accounts.list",
|
|
16361
|
+
class: "read",
|
|
16362
|
+
description: "List billing accounts with optional lifecycle and time filters.",
|
|
16363
|
+
parameters: {
|
|
16364
|
+
type: "object",
|
|
16365
|
+
properties: {
|
|
16366
|
+
...pageQuery,
|
|
16367
|
+
state: { type: "string", enum: ["active", "closed", "any"] },
|
|
16368
|
+
email: { type: "string" }
|
|
16369
|
+
}
|
|
16370
|
+
},
|
|
16371
|
+
request: {
|
|
16372
|
+
method: "GET",
|
|
16373
|
+
path: "/accounts",
|
|
16374
|
+
query: {
|
|
16375
|
+
limit: "{limit}",
|
|
16376
|
+
cursor: "{cursor}",
|
|
16377
|
+
sort: "{sort}",
|
|
16378
|
+
begin_time: "{begin_time}",
|
|
16379
|
+
end_time: "{end_time}",
|
|
16380
|
+
state: "{state}",
|
|
16381
|
+
email: "{email}"
|
|
16382
|
+
}
|
|
16383
|
+
}
|
|
16384
|
+
},
|
|
16385
|
+
{
|
|
16386
|
+
name: "accounts.get",
|
|
16387
|
+
class: "read",
|
|
16388
|
+
description: "Read one billing account by UUID or code-prefixed identifier.",
|
|
16389
|
+
parameters: {
|
|
16390
|
+
type: "object",
|
|
16391
|
+
properties: { accountId: id("Account UUID or `code-<account code>`.") },
|
|
16392
|
+
required: ["accountId"]
|
|
16393
|
+
},
|
|
16394
|
+
request: { method: "GET", path: "/accounts/{accountId}" }
|
|
16395
|
+
},
|
|
16396
|
+
{
|
|
16397
|
+
name: "accounts.create",
|
|
16398
|
+
class: "mutation",
|
|
16399
|
+
description: "Create a billing account.",
|
|
16400
|
+
parameters: {
|
|
16401
|
+
type: "object",
|
|
16402
|
+
properties: {
|
|
16403
|
+
code: { type: "string" },
|
|
16404
|
+
email: { type: "string" },
|
|
16405
|
+
first_name: { type: "string" },
|
|
16406
|
+
last_name: { type: "string" },
|
|
16407
|
+
company: { type: "string" },
|
|
16408
|
+
preferred_locale: { type: "string" },
|
|
16409
|
+
preferred_time_zone: { type: "string" },
|
|
16410
|
+
address: { type: "object" },
|
|
16411
|
+
custom_fields: { type: "array", items: { type: "object" } }
|
|
16412
|
+
},
|
|
16413
|
+
required: ["code", "email"]
|
|
16414
|
+
},
|
|
16415
|
+
request: { method: "POST", path: "/accounts", body: "args" },
|
|
16416
|
+
cas: "native-idempotency",
|
|
16417
|
+
externalEffect: true
|
|
16418
|
+
},
|
|
16419
|
+
{
|
|
16420
|
+
name: "accounts.update",
|
|
16421
|
+
class: "mutation",
|
|
16422
|
+
description: "Update profile, address, locale, or custom fields on a billing account.",
|
|
16423
|
+
parameters: {
|
|
16424
|
+
type: "object",
|
|
16425
|
+
properties: {
|
|
16426
|
+
accountId: id("Account UUID or `code-<account code>`."),
|
|
16427
|
+
email: { type: "string" },
|
|
16428
|
+
first_name: { type: "string" },
|
|
16429
|
+
last_name: { type: "string" },
|
|
16430
|
+
company: { type: "string" },
|
|
16431
|
+
preferred_locale: { type: "string" },
|
|
16432
|
+
preferred_time_zone: { type: "string" },
|
|
16433
|
+
address: { type: "object" },
|
|
16434
|
+
custom_fields: { type: "array", items: { type: "object" } }
|
|
16435
|
+
},
|
|
16436
|
+
required: ["accountId"]
|
|
16437
|
+
},
|
|
16438
|
+
request: { method: "PUT", path: "/accounts/{accountId}", body: "args" },
|
|
16439
|
+
cas: "optimistic-read-verify",
|
|
16440
|
+
externalEffect: true
|
|
16441
|
+
},
|
|
16442
|
+
{
|
|
16443
|
+
name: "plans.list",
|
|
16444
|
+
class: "read",
|
|
16445
|
+
description: "List subscription plans.",
|
|
16446
|
+
parameters: {
|
|
16447
|
+
type: "object",
|
|
16448
|
+
properties: { ...pageQuery, state: { type: "string", enum: ["active", "inactive"] } }
|
|
16449
|
+
},
|
|
16450
|
+
request: {
|
|
16451
|
+
method: "GET",
|
|
16452
|
+
path: "/plans",
|
|
16453
|
+
query: {
|
|
16454
|
+
limit: "{limit}",
|
|
16455
|
+
cursor: "{cursor}",
|
|
16456
|
+
sort: "{sort}",
|
|
16457
|
+
begin_time: "{begin_time}",
|
|
16458
|
+
end_time: "{end_time}",
|
|
16459
|
+
state: "{state}"
|
|
16460
|
+
}
|
|
16461
|
+
}
|
|
16462
|
+
},
|
|
16463
|
+
{
|
|
16464
|
+
name: "subscriptions.list",
|
|
16465
|
+
class: "read",
|
|
16466
|
+
description: "List subscriptions across the site.",
|
|
16467
|
+
parameters: {
|
|
16468
|
+
type: "object",
|
|
16469
|
+
properties: {
|
|
16470
|
+
...pageQuery,
|
|
16471
|
+
state: { type: "string", enum: ["active", "canceled", "expired", "failed", "future", "paused"] }
|
|
16472
|
+
}
|
|
16473
|
+
},
|
|
16474
|
+
request: {
|
|
16475
|
+
method: "GET",
|
|
16476
|
+
path: "/subscriptions",
|
|
16477
|
+
query: {
|
|
16478
|
+
limit: "{limit}",
|
|
16479
|
+
cursor: "{cursor}",
|
|
16480
|
+
sort: "{sort}",
|
|
16481
|
+
begin_time: "{begin_time}",
|
|
16482
|
+
end_time: "{end_time}",
|
|
16483
|
+
state: "{state}"
|
|
16484
|
+
}
|
|
16485
|
+
}
|
|
16486
|
+
},
|
|
16487
|
+
{
|
|
16488
|
+
name: "accounts.subscriptions.list",
|
|
16489
|
+
class: "read",
|
|
16490
|
+
description: "List subscriptions belonging to one billing account.",
|
|
16491
|
+
parameters: {
|
|
16492
|
+
type: "object",
|
|
16493
|
+
properties: {
|
|
16494
|
+
...pageQuery,
|
|
16495
|
+
accountId: id("Account UUID or `code-<account code>`."),
|
|
16496
|
+
state: { type: "string", enum: ["active", "canceled", "expired", "failed", "future", "paused"] }
|
|
16497
|
+
},
|
|
16498
|
+
required: ["accountId"]
|
|
16499
|
+
},
|
|
16500
|
+
request: {
|
|
16501
|
+
method: "GET",
|
|
16502
|
+
path: "/accounts/{accountId}/subscriptions",
|
|
16503
|
+
query: {
|
|
16504
|
+
limit: "{limit}",
|
|
16505
|
+
cursor: "{cursor}",
|
|
16506
|
+
sort: "{sort}",
|
|
16507
|
+
begin_time: "{begin_time}",
|
|
16508
|
+
end_time: "{end_time}",
|
|
16509
|
+
state: "{state}"
|
|
16510
|
+
}
|
|
16511
|
+
}
|
|
16512
|
+
},
|
|
16513
|
+
{
|
|
16514
|
+
name: "subscriptions.get",
|
|
16515
|
+
class: "read",
|
|
16516
|
+
description: "Read one subscription by UUID.",
|
|
16517
|
+
parameters: {
|
|
16518
|
+
type: "object",
|
|
16519
|
+
properties: { subscriptionId: id("Subscription UUID.") },
|
|
16520
|
+
required: ["subscriptionId"]
|
|
16521
|
+
},
|
|
16522
|
+
request: { method: "GET", path: "/subscriptions/{subscriptionId}" }
|
|
16523
|
+
},
|
|
16524
|
+
{
|
|
16525
|
+
name: "subscriptions.create",
|
|
16526
|
+
class: "mutation",
|
|
16527
|
+
description: "Start a subscription for an existing or inline billing account.",
|
|
16528
|
+
parameters: {
|
|
16529
|
+
type: "object",
|
|
16530
|
+
properties: {
|
|
16531
|
+
plan_code: { type: "string" },
|
|
16532
|
+
currency: { type: "string", minLength: 3, maxLength: 3 },
|
|
16533
|
+
account: { type: "object", description: "Existing account reference or inline account object." },
|
|
16534
|
+
quantity: { type: "integer", minimum: 1 },
|
|
16535
|
+
starts_at: { type: "string" },
|
|
16536
|
+
trial_ends_at: { type: "string" },
|
|
16537
|
+
collection_method: { type: "string", enum: ["automatic", "manual"] },
|
|
16538
|
+
net_terms: { type: "integer", minimum: 0 },
|
|
16539
|
+
custom_fields: { type: "array", items: { type: "object" } }
|
|
16540
|
+
},
|
|
16541
|
+
required: ["plan_code", "currency", "account"]
|
|
16542
|
+
},
|
|
16543
|
+
request: { method: "POST", path: "/subscriptions", body: "args" },
|
|
16544
|
+
cas: "native-idempotency",
|
|
16545
|
+
externalEffect: true
|
|
16546
|
+
},
|
|
16547
|
+
{
|
|
16548
|
+
name: "subscriptions.cancel",
|
|
16549
|
+
class: "mutation",
|
|
16550
|
+
description: "Schedule a subscription to cancel at its renewal date.",
|
|
16551
|
+
parameters: {
|
|
16552
|
+
type: "object",
|
|
16553
|
+
properties: { subscriptionId: id("Subscription UUID.") },
|
|
16554
|
+
required: ["subscriptionId"]
|
|
16555
|
+
},
|
|
16556
|
+
request: { method: "POST", path: "/subscriptions/{subscriptionId}/cancel", body: {} },
|
|
16557
|
+
cas: "native-idempotency",
|
|
16558
|
+
externalEffect: true
|
|
16559
|
+
},
|
|
16560
|
+
{
|
|
16561
|
+
name: "subscriptions.reactivate",
|
|
16562
|
+
class: "mutation",
|
|
16563
|
+
description: "Reactivate a subscription that is pending cancellation.",
|
|
16564
|
+
parameters: {
|
|
16565
|
+
type: "object",
|
|
16566
|
+
properties: { subscriptionId: id("Subscription UUID.") },
|
|
16567
|
+
required: ["subscriptionId"]
|
|
16568
|
+
},
|
|
16569
|
+
request: { method: "POST", path: "/subscriptions/{subscriptionId}/reactivate", body: {} },
|
|
16570
|
+
cas: "native-idempotency",
|
|
16571
|
+
externalEffect: true
|
|
16572
|
+
},
|
|
16573
|
+
{
|
|
16574
|
+
name: "subscriptions.terminate",
|
|
16575
|
+
class: "mutation",
|
|
16576
|
+
description: "Immediately terminate a subscription, with an explicit refund policy.",
|
|
16577
|
+
parameters: {
|
|
16578
|
+
type: "object",
|
|
16579
|
+
properties: {
|
|
16580
|
+
subscriptionId: id("Subscription UUID."),
|
|
16581
|
+
refund: { type: "string", enum: ["none", "partial", "full"] }
|
|
16582
|
+
},
|
|
16583
|
+
required: ["subscriptionId", "refund"]
|
|
16584
|
+
},
|
|
16585
|
+
request: {
|
|
16586
|
+
method: "POST",
|
|
16587
|
+
path: "/subscriptions/{subscriptionId}/terminate",
|
|
16588
|
+
query: { refund: "{refund}" },
|
|
16589
|
+
body: {}
|
|
16590
|
+
},
|
|
16591
|
+
cas: "native-idempotency",
|
|
16592
|
+
externalEffect: true
|
|
16593
|
+
},
|
|
16594
|
+
{
|
|
16595
|
+
name: "invoices.list",
|
|
16596
|
+
class: "read",
|
|
16597
|
+
description: "List invoices with account, state, type, and time filters.",
|
|
16598
|
+
parameters: {
|
|
16599
|
+
type: "object",
|
|
16600
|
+
properties: {
|
|
16601
|
+
...pageQuery,
|
|
16602
|
+
accountId: id("Optional account UUID or `code-<account code>`."),
|
|
16603
|
+
state: { type: "string", enum: ["pending", "processing", "past_due", "paid", "failed", "voided"] },
|
|
16604
|
+
type: { type: "string", enum: ["charge", "credit", "non-legacy"] }
|
|
16605
|
+
}
|
|
16606
|
+
},
|
|
16607
|
+
request: {
|
|
16608
|
+
method: "GET",
|
|
16609
|
+
path: "/invoices",
|
|
16610
|
+
query: {
|
|
16611
|
+
limit: "{limit}",
|
|
16612
|
+
cursor: "{cursor}",
|
|
16613
|
+
sort: "{sort}",
|
|
16614
|
+
begin_time: "{begin_time}",
|
|
16615
|
+
end_time: "{end_time}",
|
|
16616
|
+
account_id: "{accountId}",
|
|
16617
|
+
state: "{state}",
|
|
16618
|
+
type: "{type}"
|
|
16619
|
+
}
|
|
16620
|
+
}
|
|
16621
|
+
},
|
|
16622
|
+
{
|
|
16623
|
+
name: "invoices.get",
|
|
16624
|
+
class: "read",
|
|
16625
|
+
description: "Read one invoice by UUID or number-prefixed identifier.",
|
|
16626
|
+
parameters: {
|
|
16627
|
+
type: "object",
|
|
16628
|
+
properties: { invoiceId: id("Invoice UUID or `number-<invoice number>`.") },
|
|
16629
|
+
required: ["invoiceId"]
|
|
16630
|
+
},
|
|
16631
|
+
request: { method: "GET", path: "/invoices/{invoiceId}" }
|
|
16632
|
+
},
|
|
16633
|
+
{
|
|
16634
|
+
name: "accounts.invoices.list",
|
|
16635
|
+
class: "read",
|
|
16636
|
+
description: "List invoices belonging to one billing account.",
|
|
16637
|
+
parameters: {
|
|
16638
|
+
type: "object",
|
|
16639
|
+
properties: {
|
|
16640
|
+
...pageQuery,
|
|
16641
|
+
accountId: id("Account UUID or `code-<account code>`."),
|
|
16642
|
+
state: { type: "string", enum: ["pending", "processing", "past_due", "paid", "failed", "voided"] },
|
|
16643
|
+
type: { type: "string", enum: ["charge", "credit", "non-legacy"] }
|
|
16644
|
+
},
|
|
16645
|
+
required: ["accountId"]
|
|
16646
|
+
},
|
|
16647
|
+
request: {
|
|
16648
|
+
method: "GET",
|
|
16649
|
+
path: "/accounts/{accountId}/invoices",
|
|
16650
|
+
query: {
|
|
16651
|
+
limit: "{limit}",
|
|
16652
|
+
cursor: "{cursor}",
|
|
16653
|
+
sort: "{sort}",
|
|
16654
|
+
begin_time: "{begin_time}",
|
|
16655
|
+
end_time: "{end_time}",
|
|
16656
|
+
state: "{state}",
|
|
16657
|
+
type: "{type}"
|
|
16658
|
+
}
|
|
16659
|
+
}
|
|
16660
|
+
}
|
|
16661
|
+
]
|
|
16662
|
+
});
|
|
16663
|
+
|
|
16664
|
+
// src/connectors/adapters/taxjar.ts
|
|
16665
|
+
var transactionId = { type: "string", description: "Merchant transaction id." };
|
|
16666
|
+
var provider = {
|
|
16667
|
+
type: "string",
|
|
16668
|
+
enum: ["api", "stripe", "square"],
|
|
16669
|
+
description: "Transaction source. Defaults to api."
|
|
16670
|
+
};
|
|
16671
|
+
var taxjarConnector = declarativeRestConnector({
|
|
16672
|
+
kind: "taxjar",
|
|
16673
|
+
displayName: "TaxJar",
|
|
16674
|
+
description: "Calculate sales tax and synchronize order/refund transactions with TaxJar for reporting and filing.",
|
|
16675
|
+
auth: {
|
|
16676
|
+
kind: "api-key",
|
|
16677
|
+
hint: "TaxJar SmartCalcs API token from Account \u2192 TaxJar API."
|
|
16678
|
+
},
|
|
16679
|
+
category: "commerce",
|
|
16680
|
+
defaultConsistencyModel: "authoritative",
|
|
16681
|
+
baseUrl: "https://api.taxjar.com/v2",
|
|
16682
|
+
credentialPlacement: {
|
|
16683
|
+
kind: "header",
|
|
16684
|
+
header: "Authorization",
|
|
16685
|
+
prefix: 'Token token="',
|
|
16686
|
+
suffix: '"'
|
|
16687
|
+
},
|
|
16688
|
+
test: { method: "GET", path: "/categories" },
|
|
16689
|
+
capabilities: [
|
|
16690
|
+
{
|
|
16691
|
+
name: "taxes.calculate",
|
|
16692
|
+
class: "read",
|
|
16693
|
+
description: "Calculate sales tax for a cart or order without creating a TaxJar transaction.",
|
|
16694
|
+
parameters: {
|
|
16695
|
+
type: "object",
|
|
16696
|
+
properties: {
|
|
16697
|
+
from_country: { type: "string" },
|
|
16698
|
+
from_zip: { type: "string" },
|
|
16699
|
+
from_state: { type: "string" },
|
|
16700
|
+
from_city: { type: "string" },
|
|
16701
|
+
from_street: { type: "string" },
|
|
16702
|
+
to_country: { type: "string" },
|
|
16703
|
+
to_zip: { type: "string" },
|
|
16704
|
+
to_state: { type: "string" },
|
|
16705
|
+
to_city: { type: "string" },
|
|
16706
|
+
to_street: { type: "string" },
|
|
16707
|
+
amount: { type: "number" },
|
|
16708
|
+
shipping: { type: "number" },
|
|
16709
|
+
customer_id: { type: "string" },
|
|
16710
|
+
exemption_type: { type: "string" },
|
|
16711
|
+
nexus_addresses: { type: "array", items: { type: "object" } },
|
|
16712
|
+
line_items: { type: "array", items: { type: "object" } }
|
|
16713
|
+
},
|
|
16714
|
+
required: ["from_country", "from_zip", "to_country", "to_zip", "amount", "shipping"]
|
|
16715
|
+
},
|
|
16716
|
+
request: { method: "POST", path: "/taxes", body: "args" }
|
|
16717
|
+
},
|
|
16718
|
+
{
|
|
16719
|
+
name: "rates.get",
|
|
16720
|
+
class: "read",
|
|
16721
|
+
description: "Read the combined sales-tax rate for a US or Canadian postal code.",
|
|
16722
|
+
parameters: {
|
|
16723
|
+
type: "object",
|
|
16724
|
+
properties: {
|
|
16725
|
+
zip: { type: "string" },
|
|
16726
|
+
country: { type: "string" },
|
|
16727
|
+
state: { type: "string" },
|
|
16728
|
+
city: { type: "string" },
|
|
16729
|
+
street: { type: "string" }
|
|
16730
|
+
},
|
|
16731
|
+
required: ["zip"]
|
|
16732
|
+
},
|
|
16733
|
+
request: {
|
|
16734
|
+
method: "GET",
|
|
16735
|
+
path: "/rates/{zip}",
|
|
16736
|
+
query: { country: "{country}", state: "{state}", city: "{city}", street: "{street}" }
|
|
16737
|
+
}
|
|
16738
|
+
},
|
|
16739
|
+
{
|
|
16740
|
+
name: "categories.list",
|
|
16741
|
+
class: "read",
|
|
16742
|
+
description: "List TaxJar product tax categories and their tax codes.",
|
|
16743
|
+
parameters: { type: "object", properties: {} },
|
|
16744
|
+
request: { method: "GET", path: "/categories" }
|
|
16745
|
+
},
|
|
16746
|
+
{
|
|
16747
|
+
name: "nexus-regions.list",
|
|
16748
|
+
class: "read",
|
|
16749
|
+
description: "List nexus regions configured for the TaxJar account.",
|
|
16750
|
+
parameters: { type: "object", properties: {} },
|
|
16751
|
+
request: { method: "GET", path: "/nexus/regions" }
|
|
16752
|
+
},
|
|
16753
|
+
transactionRead2("orders.get", "/transactions/orders/{transactionId}", "Read a synced order transaction."),
|
|
16754
|
+
transactionWrite("orders.create", "POST", "/transactions/orders", "Create an order transaction for reporting and filing."),
|
|
16755
|
+
transactionWrite("orders.update", "PUT", "/transactions/orders/{transactionId}", "Update an order transaction."),
|
|
16756
|
+
transactionDelete("orders.delete", "/transactions/orders/{transactionId}", "Delete an order transaction."),
|
|
16757
|
+
transactionRead2("refunds.get", "/transactions/refunds/{transactionId}", "Read a synced refund transaction."),
|
|
16758
|
+
transactionWrite("refunds.create", "POST", "/transactions/refunds", "Create a refund transaction for reporting and filing."),
|
|
16759
|
+
transactionWrite("refunds.update", "PUT", "/transactions/refunds/{transactionId}", "Update a refund transaction."),
|
|
16760
|
+
transactionDelete("refunds.delete", "/transactions/refunds/{transactionId}", "Delete a refund transaction.")
|
|
16761
|
+
]
|
|
16762
|
+
});
|
|
16763
|
+
function transactionRead2(name, path, description) {
|
|
16764
|
+
return {
|
|
16765
|
+
name,
|
|
16766
|
+
class: "read",
|
|
16767
|
+
description,
|
|
16768
|
+
parameters: {
|
|
16769
|
+
type: "object",
|
|
16770
|
+
properties: { transactionId, provider },
|
|
16771
|
+
required: ["transactionId"]
|
|
16772
|
+
},
|
|
16773
|
+
request: { method: "GET", path, query: { provider: "{provider}" } }
|
|
16774
|
+
};
|
|
16775
|
+
}
|
|
16776
|
+
function transactionWrite(name, method, path, description) {
|
|
16777
|
+
return {
|
|
16778
|
+
name,
|
|
16779
|
+
class: "mutation",
|
|
16780
|
+
description,
|
|
16781
|
+
parameters: {
|
|
16782
|
+
type: "object",
|
|
16783
|
+
properties: {
|
|
16784
|
+
transactionId,
|
|
16785
|
+
data: {
|
|
16786
|
+
type: "object",
|
|
16787
|
+
description: "Provider-native TaxJar order/refund payload, including transaction_id and transaction_date."
|
|
16788
|
+
}
|
|
16789
|
+
},
|
|
16790
|
+
required: method === "POST" ? ["data"] : ["transactionId", "data"]
|
|
16791
|
+
},
|
|
16792
|
+
request: { method, path, body: "{data}" },
|
|
16793
|
+
cas: "native-idempotency",
|
|
16794
|
+
externalEffect: true
|
|
16795
|
+
};
|
|
16796
|
+
}
|
|
16797
|
+
function transactionDelete(name, path, description) {
|
|
16798
|
+
return {
|
|
16799
|
+
name,
|
|
16800
|
+
class: "mutation",
|
|
16801
|
+
description,
|
|
16802
|
+
parameters: {
|
|
16803
|
+
type: "object",
|
|
16804
|
+
properties: { transactionId, provider },
|
|
16805
|
+
required: ["transactionId"]
|
|
16806
|
+
},
|
|
16807
|
+
request: { method: "DELETE", path, query: { provider: "{provider}" } },
|
|
16808
|
+
cas: "native-idempotency",
|
|
16809
|
+
externalEffect: true
|
|
16810
|
+
};
|
|
16811
|
+
}
|
|
16812
|
+
|
|
15313
16813
|
// src/connectors/adapters/cashfree-payments.ts
|
|
15314
16814
|
var cashfreePaymentsConnector = declarativeRestConnector({
|
|
15315
16815
|
kind: "cashfree-payments",
|
|
@@ -19726,7 +21226,7 @@ var frontConnector = declarativeRestConnector({
|
|
|
19726
21226
|
});
|
|
19727
21227
|
|
|
19728
21228
|
// src/connectors/oauth.ts
|
|
19729
|
-
import { createHash as
|
|
21229
|
+
import { createHash as createHash3, randomBytes } from "crypto";
|
|
19730
21230
|
var PENDING_TTL_MS = 10 * 60 * 1e3;
|
|
19731
21231
|
var InMemoryOAuthFlowStore = class {
|
|
19732
21232
|
pendingFlows = /* @__PURE__ */ new Map();
|
|
@@ -19754,7 +21254,7 @@ function startOAuthFlow(input) {
|
|
|
19754
21254
|
const now = input.now ?? Date.now();
|
|
19755
21255
|
store.sweep?.(now);
|
|
19756
21256
|
const codeVerifier = base64Url(randomBytes(48));
|
|
19757
|
-
const codeChallenge = base64Url(
|
|
21257
|
+
const codeChallenge = base64Url(createHash3("sha256").update(codeVerifier).digest());
|
|
19758
21258
|
const state = base64Url(randomBytes(24));
|
|
19759
21259
|
store.put(state, {
|
|
19760
21260
|
codeVerifier,
|
|
@@ -19939,20 +21439,20 @@ async function googleApiError(res, context, dataSourceId) {
|
|
|
19939
21439
|
const body = await readErrorBody(res);
|
|
19940
21440
|
return classifyGoogleError(res.status, body, context, dataSourceId);
|
|
19941
21441
|
}
|
|
19942
|
-
function googleTestFailureReason(status, body,
|
|
21442
|
+
function googleTestFailureReason(status, body, provider2) {
|
|
19943
21443
|
const reason = googleErrorReason(body);
|
|
19944
21444
|
const cls = classifyGoogleReason(reason);
|
|
19945
21445
|
const detail = reason ? `, ${reason}` : "";
|
|
19946
21446
|
if (cls === "quota" || status === 429) {
|
|
19947
|
-
return `${
|
|
21447
|
+
return `${provider2} rate limit (${status}${detail}) \u2014 retry later`;
|
|
19948
21448
|
}
|
|
19949
21449
|
if (cls === "auth" || status === 401) {
|
|
19950
|
-
return `${
|
|
21450
|
+
return `${provider2} rejected token (${status}${detail}) \u2014 reconnect required`;
|
|
19951
21451
|
}
|
|
19952
21452
|
if (cls === "config" || status === 403) {
|
|
19953
|
-
return `${
|
|
21453
|
+
return `${provider2} permission/config error (${status}${detail}) \u2014 check the API is enabled and scopes are granted`;
|
|
19954
21454
|
}
|
|
19955
|
-
return `${
|
|
21455
|
+
return `${provider2} returned ${status}`;
|
|
19956
21456
|
}
|
|
19957
21457
|
async function readErrorBody(res) {
|
|
19958
21458
|
const text = await res.text().catch(() => "");
|
|
@@ -20163,7 +21663,7 @@ async function listMessages(inv, accessToken3, timeoutMs) {
|
|
|
20163
21663
|
const params = new URLSearchParams({
|
|
20164
21664
|
maxResults: String(args.maxResults ?? 25)
|
|
20165
21665
|
});
|
|
20166
|
-
for (const
|
|
21666
|
+
for (const id2 of args.labelIds ?? ["INBOX"]) params.append("labelIds", id2);
|
|
20167
21667
|
if (args.query) params.set("q", args.query);
|
|
20168
21668
|
if (args.pageToken) params.set("pageToken", args.pageToken);
|
|
20169
21669
|
const listRes = await fetch(`${API}/messages?${params.toString()}`, {
|
|
@@ -20176,8 +21676,8 @@ async function listMessages(inv, accessToken3, timeoutMs) {
|
|
|
20176
21676
|
const listJson = await listRes.json();
|
|
20177
21677
|
const ids = listJson.messages ?? [];
|
|
20178
21678
|
const metas = await Promise.all(
|
|
20179
|
-
ids.map(async ({ id }) => {
|
|
20180
|
-
const res = await fetch(`${API}/messages/${encodeURIComponent(
|
|
21679
|
+
ids.map(async ({ id: id2 }) => {
|
|
21680
|
+
const res = await fetch(`${API}/messages/${encodeURIComponent(id2)}?format=metadata&metadataHeaders=From&metadataHeaders=To&metadataHeaders=Subject&metadataHeaders=Date`, {
|
|
20181
21681
|
headers: { authorization: `Bearer ${accessToken3}` },
|
|
20182
21682
|
signal: AbortSignal.timeout(timeoutMs)
|
|
20183
21683
|
});
|
|
@@ -20206,13 +21706,13 @@ function toMessageSummary(meta) {
|
|
|
20206
21706
|
};
|
|
20207
21707
|
}
|
|
20208
21708
|
async function readMessage(inv, accessToken3, timeoutMs) {
|
|
20209
|
-
const { id } = inv.args;
|
|
20210
|
-
const res = await fetch(`${API}/messages/${encodeURIComponent(
|
|
21709
|
+
const { id: id2 } = inv.args;
|
|
21710
|
+
const res = await fetch(`${API}/messages/${encodeURIComponent(id2)}?format=full`, {
|
|
20211
21711
|
headers: { authorization: `Bearer ${accessToken3}` },
|
|
20212
21712
|
signal: AbortSignal.timeout(timeoutMs)
|
|
20213
21713
|
});
|
|
20214
21714
|
if (res.status === 404) {
|
|
20215
|
-
throw new Error(`gmail read_message: message ${
|
|
21715
|
+
throw new Error(`gmail read_message: message ${id2} not found`);
|
|
20216
21716
|
}
|
|
20217
21717
|
if (!res.ok) {
|
|
20218
21718
|
throw await googleApiError(res, "gmail read_message", inv.source.id);
|
|
@@ -23444,7 +24944,7 @@ async function ensureFreshAccessToken5(creds, clientId, clientSecret) {
|
|
|
23444
24944
|
}
|
|
23445
24945
|
|
|
23446
24946
|
// src/connectors/adapters/google-sheets.ts
|
|
23447
|
-
import { createHash as
|
|
24947
|
+
import { createHash as createHash4 } from "crypto";
|
|
23448
24948
|
var SCOPES5 = ["https://www.googleapis.com/auth/spreadsheets"];
|
|
23449
24949
|
var AUTH_URL6 = "https://accounts.google.com/o/oauth2/v2/auth";
|
|
23450
24950
|
var TOKEN_URL6 = "https://oauth2.googleapis.com/token";
|
|
@@ -23717,7 +25217,7 @@ async function fetchAllRows(accessToken3, meta) {
|
|
|
23717
25217
|
function rowFingerprint(values) {
|
|
23718
25218
|
const keys = Object.keys(values).sort();
|
|
23719
25219
|
const blob = keys.map((k) => `${k}=${values[k]}`).join("");
|
|
23720
|
-
return
|
|
25220
|
+
return createHash4("sha256").update(blob).digest("hex").slice(0, 16);
|
|
23721
25221
|
}
|
|
23722
25222
|
function matchesPredicate(row, predicate) {
|
|
23723
25223
|
for (const [k, v] of Object.entries(predicate)) {
|
|
@@ -25628,8 +27128,8 @@ async function createDeal(inv, accessToken3, timeoutMs) {
|
|
|
25628
27128
|
const payload = { properties: dealProperties };
|
|
25629
27129
|
const contactIds = args.associations?.contactIds ?? [];
|
|
25630
27130
|
if (contactIds.length > 0) {
|
|
25631
|
-
payload.associations = contactIds.map((
|
|
25632
|
-
to: { id },
|
|
27131
|
+
payload.associations = contactIds.map((id2) => ({
|
|
27132
|
+
to: { id: id2 },
|
|
25633
27133
|
// 3 = deal→contact association type id (standard HubSpot mapping)
|
|
25634
27134
|
types: [{ associationCategory: "HUBSPOT_DEFINED", associationTypeId: 3 }]
|
|
25635
27135
|
}));
|
|
@@ -27582,19 +29082,55 @@ var ironcladConnector = declarativeRestConnector({
|
|
|
27582
29082
|
});
|
|
27583
29083
|
|
|
27584
29084
|
// src/connectors/adapters/jira-cloud.ts
|
|
29085
|
+
var JIRA_READ_SCOPE = "read:jira-work";
|
|
29086
|
+
var JIRA_WRITE_SCOPE = "write:jira-work";
|
|
29087
|
+
var JIRA_USER_SCOPE = "read:jira-user";
|
|
29088
|
+
var jiraSiteProperty = {
|
|
29089
|
+
cloudId: {
|
|
29090
|
+
type: "string",
|
|
29091
|
+
description: "Atlassian site id from resources.list."
|
|
29092
|
+
}
|
|
29093
|
+
};
|
|
27585
29094
|
var jiraCloudConnector = declarativeRestConnector({
|
|
27586
29095
|
kind: "jira-cloud",
|
|
27587
29096
|
displayName: "Jira Cloud",
|
|
27588
29097
|
description: "Issue tracking and project management on Jira Cloud \u2014 create, update, comment on, transition, and search issues via the REST API v3.",
|
|
27589
29098
|
auth: {
|
|
27590
|
-
kind: "
|
|
27591
|
-
|
|
29099
|
+
kind: "oauth2",
|
|
29100
|
+
authorizationUrl: "https://auth.atlassian.com/authorize",
|
|
29101
|
+
tokenUrl: "https://auth.atlassian.com/oauth/token",
|
|
29102
|
+
scopes: [
|
|
29103
|
+
"offline_access",
|
|
29104
|
+
JIRA_READ_SCOPE,
|
|
29105
|
+
JIRA_WRITE_SCOPE,
|
|
29106
|
+
JIRA_USER_SCOPE
|
|
29107
|
+
],
|
|
29108
|
+
clientIdEnv: "ATLASSIAN_OAUTH_CLIENT_ID",
|
|
29109
|
+
clientSecretEnv: "ATLASSIAN_OAUTH_CLIENT_SECRET",
|
|
29110
|
+
extraAuthParams: {
|
|
29111
|
+
audience: "api.atlassian.com",
|
|
29112
|
+
prompt: "consent"
|
|
29113
|
+
}
|
|
27592
29114
|
},
|
|
27593
29115
|
category: "doc",
|
|
27594
29116
|
defaultConsistencyModel: "authoritative",
|
|
27595
|
-
baseUrl:
|
|
27596
|
-
|
|
29117
|
+
baseUrl: "https://api.atlassian.com",
|
|
29118
|
+
defaultHeaders: { accept: "application/json" },
|
|
29119
|
+
test: { method: "GET", path: "/oauth/token/accessible-resources" },
|
|
27597
29120
|
capabilities: [
|
|
29121
|
+
{
|
|
29122
|
+
name: "resources.list",
|
|
29123
|
+
class: "read",
|
|
29124
|
+
description: "List Atlassian sites authorized for this connection. Use a returned id as the cloudId required by every Jira action.",
|
|
29125
|
+
parameters: {
|
|
29126
|
+
type: "object",
|
|
29127
|
+
properties: {}
|
|
29128
|
+
},
|
|
29129
|
+
request: {
|
|
29130
|
+
method: "GET",
|
|
29131
|
+
path: "/oauth/token/accessible-resources"
|
|
29132
|
+
}
|
|
29133
|
+
},
|
|
27598
29134
|
{
|
|
27599
29135
|
name: "issues.create",
|
|
27600
29136
|
class: "mutation",
|
|
@@ -27602,16 +29138,28 @@ var jiraCloudConnector = declarativeRestConnector({
|
|
|
27602
29138
|
parameters: {
|
|
27603
29139
|
type: "object",
|
|
27604
29140
|
properties: {
|
|
29141
|
+
...jiraSiteProperty,
|
|
27605
29142
|
fields: { type: "object", description: "Issue fields \u2014 must include project, summary, and issuetype." },
|
|
27606
29143
|
update: { type: "object" },
|
|
27607
29144
|
transition: { type: "object" },
|
|
27608
29145
|
properties: { type: "array" },
|
|
27609
29146
|
historyMetadata: { type: "object" }
|
|
27610
29147
|
},
|
|
27611
|
-
required: ["fields"]
|
|
29148
|
+
required: ["cloudId", "fields"]
|
|
27612
29149
|
},
|
|
27613
|
-
request: {
|
|
27614
|
-
|
|
29150
|
+
request: {
|
|
29151
|
+
method: "POST",
|
|
29152
|
+
path: "/ex/jira/{cloudId}/rest/api/3/issue",
|
|
29153
|
+
body: {
|
|
29154
|
+
fields: "{fields}",
|
|
29155
|
+
update: "{update}",
|
|
29156
|
+
transition: "{transition}",
|
|
29157
|
+
properties: "{properties}",
|
|
29158
|
+
historyMetadata: "{historyMetadata}"
|
|
29159
|
+
}
|
|
29160
|
+
},
|
|
29161
|
+
cas: "native-idempotency",
|
|
29162
|
+
requiredScopes: [JIRA_WRITE_SCOPE]
|
|
27615
29163
|
},
|
|
27616
29164
|
{
|
|
27617
29165
|
name: "issues.search",
|
|
@@ -27620,6 +29168,7 @@ var jiraCloudConnector = declarativeRestConnector({
|
|
|
27620
29168
|
parameters: {
|
|
27621
29169
|
type: "object",
|
|
27622
29170
|
properties: {
|
|
29171
|
+
...jiraSiteProperty,
|
|
27623
29172
|
jql: { type: "string", description: "JQL query (see https://support.atlassian.com/jira-software-cloud/docs/use-advanced-search-with-jira-query-language-jql/)." },
|
|
27624
29173
|
startAt: { type: "integer", minimum: 0 },
|
|
27625
29174
|
maxResults: { type: "integer", minimum: 1, maximum: 100 },
|
|
@@ -27627,11 +29176,11 @@ var jiraCloudConnector = declarativeRestConnector({
|
|
|
27627
29176
|
expand: { type: "string" },
|
|
27628
29177
|
validateQuery: { type: "string", enum: ["strict", "warn", "none", "true", "false"] }
|
|
27629
29178
|
},
|
|
27630
|
-
required: ["jql"]
|
|
29179
|
+
required: ["cloudId", "jql"]
|
|
27631
29180
|
},
|
|
27632
29181
|
request: {
|
|
27633
29182
|
method: "GET",
|
|
27634
|
-
path: "/rest/api/3/search",
|
|
29183
|
+
path: "/ex/jira/{cloudId}/rest/api/3/search",
|
|
27635
29184
|
query: {
|
|
27636
29185
|
jql: "{jql}",
|
|
27637
29186
|
startAt: "{startAt}",
|
|
@@ -27640,7 +29189,8 @@ var jiraCloudConnector = declarativeRestConnector({
|
|
|
27640
29189
|
expand: "{expand}",
|
|
27641
29190
|
validateQuery: "{validateQuery}"
|
|
27642
29191
|
}
|
|
27643
|
-
}
|
|
29192
|
+
},
|
|
29193
|
+
requiredScopes: [JIRA_READ_SCOPE]
|
|
27644
29194
|
},
|
|
27645
29195
|
{
|
|
27646
29196
|
name: "issues.get",
|
|
@@ -27649,18 +29199,20 @@ var jiraCloudConnector = declarativeRestConnector({
|
|
|
27649
29199
|
parameters: {
|
|
27650
29200
|
type: "object",
|
|
27651
29201
|
properties: {
|
|
29202
|
+
...jiraSiteProperty,
|
|
27652
29203
|
issueIdOrKey: { type: "string" },
|
|
27653
29204
|
fields: { type: "string" },
|
|
27654
29205
|
expand: { type: "string", description: 'Comma-delimited expand list \u2014 e.g. "renderedFields,names,schema,transitions".' },
|
|
27655
29206
|
properties: { type: "string" }
|
|
27656
29207
|
},
|
|
27657
|
-
required: ["issueIdOrKey"]
|
|
29208
|
+
required: ["cloudId", "issueIdOrKey"]
|
|
27658
29209
|
},
|
|
27659
29210
|
request: {
|
|
27660
29211
|
method: "GET",
|
|
27661
|
-
path: "/rest/api/3/issue/{issueIdOrKey}",
|
|
29212
|
+
path: "/ex/jira/{cloudId}/rest/api/3/issue/{issueIdOrKey}",
|
|
27662
29213
|
query: { fields: "{fields}", expand: "{expand}", properties: "{properties}" }
|
|
27663
|
-
}
|
|
29214
|
+
},
|
|
29215
|
+
requiredScopes: [JIRA_READ_SCOPE]
|
|
27664
29216
|
},
|
|
27665
29217
|
{
|
|
27666
29218
|
name: "issues.update",
|
|
@@ -27669,6 +29221,7 @@ var jiraCloudConnector = declarativeRestConnector({
|
|
|
27669
29221
|
parameters: {
|
|
27670
29222
|
type: "object",
|
|
27671
29223
|
properties: {
|
|
29224
|
+
...jiraSiteProperty,
|
|
27672
29225
|
issueIdOrKey: { type: "string" },
|
|
27673
29226
|
fields: { type: "object" },
|
|
27674
29227
|
update: { type: "object" },
|
|
@@ -27676,15 +29229,16 @@ var jiraCloudConnector = declarativeRestConnector({
|
|
|
27676
29229
|
historyMetadata: { type: "object" },
|
|
27677
29230
|
notifyUsers: { type: "boolean" }
|
|
27678
29231
|
},
|
|
27679
|
-
required: ["issueIdOrKey"]
|
|
29232
|
+
required: ["cloudId", "issueIdOrKey"]
|
|
27680
29233
|
},
|
|
27681
29234
|
request: {
|
|
27682
29235
|
method: "PUT",
|
|
27683
|
-
path: "/rest/api/3/issue/{issueIdOrKey}",
|
|
29236
|
+
path: "/ex/jira/{cloudId}/rest/api/3/issue/{issueIdOrKey}",
|
|
27684
29237
|
query: { notifyUsers: "{notifyUsers}" },
|
|
27685
29238
|
body: { fields: "{fields}", update: "{update}", properties: "{properties}", historyMetadata: "{historyMetadata}" }
|
|
27686
29239
|
},
|
|
27687
|
-
cas: "optimistic-read-verify"
|
|
29240
|
+
cas: "optimistic-read-verify",
|
|
29241
|
+
requiredScopes: [JIRA_WRITE_SCOPE]
|
|
27688
29242
|
},
|
|
27689
29243
|
{
|
|
27690
29244
|
name: "issues.assign",
|
|
@@ -27693,17 +29247,19 @@ var jiraCloudConnector = declarativeRestConnector({
|
|
|
27693
29247
|
parameters: {
|
|
27694
29248
|
type: "object",
|
|
27695
29249
|
properties: {
|
|
29250
|
+
...jiraSiteProperty,
|
|
27696
29251
|
issueIdOrKey: { type: "string" },
|
|
27697
29252
|
accountId: { type: ["string", "null"] }
|
|
27698
29253
|
},
|
|
27699
|
-
required: ["issueIdOrKey"]
|
|
29254
|
+
required: ["cloudId", "issueIdOrKey"]
|
|
27700
29255
|
},
|
|
27701
29256
|
request: {
|
|
27702
29257
|
method: "PUT",
|
|
27703
|
-
path: "/rest/api/3/issue/{issueIdOrKey}/assignee",
|
|
29258
|
+
path: "/ex/jira/{cloudId}/rest/api/3/issue/{issueIdOrKey}/assignee",
|
|
27704
29259
|
body: { accountId: "{accountId}" }
|
|
27705
29260
|
},
|
|
27706
|
-
cas: "optimistic-read-verify"
|
|
29261
|
+
cas: "optimistic-read-verify",
|
|
29262
|
+
requiredScopes: [JIRA_WRITE_SCOPE]
|
|
27707
29263
|
},
|
|
27708
29264
|
{
|
|
27709
29265
|
name: "issues.transition",
|
|
@@ -27712,20 +29268,22 @@ var jiraCloudConnector = declarativeRestConnector({
|
|
|
27712
29268
|
parameters: {
|
|
27713
29269
|
type: "object",
|
|
27714
29270
|
properties: {
|
|
29271
|
+
...jiraSiteProperty,
|
|
27715
29272
|
issueIdOrKey: { type: "string" },
|
|
27716
29273
|
transition: { type: "object", description: "Object with at least { id: string }." },
|
|
27717
29274
|
fields: { type: "object" },
|
|
27718
29275
|
update: { type: "object" },
|
|
27719
29276
|
historyMetadata: { type: "object" }
|
|
27720
29277
|
},
|
|
27721
|
-
required: ["issueIdOrKey", "transition"]
|
|
29278
|
+
required: ["cloudId", "issueIdOrKey", "transition"]
|
|
27722
29279
|
},
|
|
27723
29280
|
request: {
|
|
27724
29281
|
method: "POST",
|
|
27725
|
-
path: "/rest/api/3/issue/{issueIdOrKey}/transitions",
|
|
29282
|
+
path: "/ex/jira/{cloudId}/rest/api/3/issue/{issueIdOrKey}/transitions",
|
|
27726
29283
|
body: { transition: "{transition}", fields: "{fields}", update: "{update}", historyMetadata: "{historyMetadata}" }
|
|
27727
29284
|
},
|
|
27728
|
-
cas: "native-idempotency"
|
|
29285
|
+
cas: "native-idempotency",
|
|
29286
|
+
requiredScopes: [JIRA_WRITE_SCOPE]
|
|
27729
29287
|
},
|
|
27730
29288
|
{
|
|
27731
29289
|
name: "issues.link",
|
|
@@ -27734,19 +29292,21 @@ var jiraCloudConnector = declarativeRestConnector({
|
|
|
27734
29292
|
parameters: {
|
|
27735
29293
|
type: "object",
|
|
27736
29294
|
properties: {
|
|
29295
|
+
...jiraSiteProperty,
|
|
27737
29296
|
type: { type: "object", description: "Link type \u2014 { name: string } or { id: string }." },
|
|
27738
29297
|
inwardIssue: { type: "object", description: "{ key: string } | { id: string }." },
|
|
27739
29298
|
outwardIssue: { type: "object", description: "{ key: string } | { id: string }." },
|
|
27740
29299
|
comment: { type: "object" }
|
|
27741
29300
|
},
|
|
27742
|
-
required: ["type", "inwardIssue", "outwardIssue"]
|
|
29301
|
+
required: ["cloudId", "type", "inwardIssue", "outwardIssue"]
|
|
27743
29302
|
},
|
|
27744
29303
|
request: {
|
|
27745
29304
|
method: "POST",
|
|
27746
|
-
path: "/rest/api/3/issueLink",
|
|
29305
|
+
path: "/ex/jira/{cloudId}/rest/api/3/issueLink",
|
|
27747
29306
|
body: { type: "{type}", inwardIssue: "{inwardIssue}", outwardIssue: "{outwardIssue}", comment: "{comment}" }
|
|
27748
29307
|
},
|
|
27749
|
-
cas: "native-idempotency"
|
|
29308
|
+
cas: "native-idempotency",
|
|
29309
|
+
requiredScopes: [JIRA_WRITE_SCOPE]
|
|
27750
29310
|
},
|
|
27751
29311
|
{
|
|
27752
29312
|
name: "issues.watchers.add",
|
|
@@ -27755,17 +29315,19 @@ var jiraCloudConnector = declarativeRestConnector({
|
|
|
27755
29315
|
parameters: {
|
|
27756
29316
|
type: "object",
|
|
27757
29317
|
properties: {
|
|
29318
|
+
...jiraSiteProperty,
|
|
27758
29319
|
issueIdOrKey: { type: "string" },
|
|
27759
29320
|
accountId: { type: "string" }
|
|
27760
29321
|
},
|
|
27761
|
-
required: ["issueIdOrKey", "accountId"]
|
|
29322
|
+
required: ["cloudId", "issueIdOrKey", "accountId"]
|
|
27762
29323
|
},
|
|
27763
29324
|
request: {
|
|
27764
29325
|
method: "POST",
|
|
27765
|
-
path: "/rest/api/3/issue/{issueIdOrKey}/watchers",
|
|
29326
|
+
path: "/ex/jira/{cloudId}/rest/api/3/issue/{issueIdOrKey}/watchers",
|
|
27766
29327
|
body: "{accountId}"
|
|
27767
29328
|
},
|
|
27768
|
-
cas: "native-idempotency"
|
|
29329
|
+
cas: "native-idempotency",
|
|
29330
|
+
requiredScopes: [JIRA_WRITE_SCOPE]
|
|
27769
29331
|
},
|
|
27770
29332
|
{
|
|
27771
29333
|
name: "comments.list",
|
|
@@ -27774,19 +29336,21 @@ var jiraCloudConnector = declarativeRestConnector({
|
|
|
27774
29336
|
parameters: {
|
|
27775
29337
|
type: "object",
|
|
27776
29338
|
properties: {
|
|
29339
|
+
...jiraSiteProperty,
|
|
27777
29340
|
issueIdOrKey: { type: "string" },
|
|
27778
29341
|
startAt: { type: "integer", minimum: 0 },
|
|
27779
29342
|
maxResults: { type: "integer", minimum: 1, maximum: 100 },
|
|
27780
29343
|
orderBy: { type: "string", enum: ["created", "-created", "+created"] },
|
|
27781
29344
|
expand: { type: "string" }
|
|
27782
29345
|
},
|
|
27783
|
-
required: ["issueIdOrKey"]
|
|
29346
|
+
required: ["cloudId", "issueIdOrKey"]
|
|
27784
29347
|
},
|
|
27785
29348
|
request: {
|
|
27786
29349
|
method: "GET",
|
|
27787
|
-
path: "/rest/api/3/issue/{issueIdOrKey}/comment",
|
|
29350
|
+
path: "/ex/jira/{cloudId}/rest/api/3/issue/{issueIdOrKey}/comment",
|
|
27788
29351
|
query: { startAt: "{startAt}", maxResults: "{maxResults}", orderBy: "{orderBy}", expand: "{expand}" }
|
|
27789
|
-
}
|
|
29352
|
+
},
|
|
29353
|
+
requiredScopes: [JIRA_READ_SCOPE]
|
|
27790
29354
|
},
|
|
27791
29355
|
{
|
|
27792
29356
|
name: "comments.create",
|
|
@@ -27795,19 +29359,21 @@ var jiraCloudConnector = declarativeRestConnector({
|
|
|
27795
29359
|
parameters: {
|
|
27796
29360
|
type: "object",
|
|
27797
29361
|
properties: {
|
|
29362
|
+
...jiraSiteProperty,
|
|
27798
29363
|
issueIdOrKey: { type: "string" },
|
|
27799
29364
|
body: { type: ["object", "string"], description: 'ADF document or plain string (wiki text via "expand=renderedBody" in subsequent fetch).' },
|
|
27800
29365
|
visibility: { type: "object" },
|
|
27801
29366
|
properties: { type: "array" }
|
|
27802
29367
|
},
|
|
27803
|
-
required: ["issueIdOrKey", "body"]
|
|
29368
|
+
required: ["cloudId", "issueIdOrKey", "body"]
|
|
27804
29369
|
},
|
|
27805
29370
|
request: {
|
|
27806
29371
|
method: "POST",
|
|
27807
|
-
path: "/rest/api/3/issue/{issueIdOrKey}/comment",
|
|
29372
|
+
path: "/ex/jira/{cloudId}/rest/api/3/issue/{issueIdOrKey}/comment",
|
|
27808
29373
|
body: { body: "{body}", visibility: "{visibility}", properties: "{properties}" }
|
|
27809
29374
|
},
|
|
27810
|
-
cas: "native-idempotency"
|
|
29375
|
+
cas: "native-idempotency",
|
|
29376
|
+
requiredScopes: [JIRA_WRITE_SCOPE]
|
|
27811
29377
|
},
|
|
27812
29378
|
{
|
|
27813
29379
|
name: "comments.update",
|
|
@@ -27816,20 +29382,22 @@ var jiraCloudConnector = declarativeRestConnector({
|
|
|
27816
29382
|
parameters: {
|
|
27817
29383
|
type: "object",
|
|
27818
29384
|
properties: {
|
|
29385
|
+
...jiraSiteProperty,
|
|
27819
29386
|
issueIdOrKey: { type: "string" },
|
|
27820
29387
|
commentId: { type: "string" },
|
|
27821
29388
|
body: { type: ["object", "string"] },
|
|
27822
29389
|
visibility: { type: "object" },
|
|
27823
29390
|
properties: { type: "array" }
|
|
27824
29391
|
},
|
|
27825
|
-
required: ["issueIdOrKey", "commentId", "body"]
|
|
29392
|
+
required: ["cloudId", "issueIdOrKey", "commentId", "body"]
|
|
27826
29393
|
},
|
|
27827
29394
|
request: {
|
|
27828
29395
|
method: "PUT",
|
|
27829
|
-
path: "/rest/api/3/issue/{issueIdOrKey}/comment/{commentId}",
|
|
29396
|
+
path: "/ex/jira/{cloudId}/rest/api/3/issue/{issueIdOrKey}/comment/{commentId}",
|
|
27830
29397
|
body: { body: "{body}", visibility: "{visibility}", properties: "{properties}" }
|
|
27831
29398
|
},
|
|
27832
|
-
cas: "optimistic-read-verify"
|
|
29399
|
+
cas: "optimistic-read-verify",
|
|
29400
|
+
requiredScopes: [JIRA_WRITE_SCOPE]
|
|
27833
29401
|
},
|
|
27834
29402
|
{
|
|
27835
29403
|
name: "comments.delete",
|
|
@@ -27838,16 +29406,18 @@ var jiraCloudConnector = declarativeRestConnector({
|
|
|
27838
29406
|
parameters: {
|
|
27839
29407
|
type: "object",
|
|
27840
29408
|
properties: {
|
|
29409
|
+
...jiraSiteProperty,
|
|
27841
29410
|
issueIdOrKey: { type: "string" },
|
|
27842
29411
|
commentId: { type: "string" }
|
|
27843
29412
|
},
|
|
27844
|
-
required: ["issueIdOrKey", "commentId"]
|
|
29413
|
+
required: ["cloudId", "issueIdOrKey", "commentId"]
|
|
27845
29414
|
},
|
|
27846
29415
|
request: {
|
|
27847
29416
|
method: "DELETE",
|
|
27848
|
-
path: "/rest/api/3/issue/{issueIdOrKey}/comment/{commentId}"
|
|
29417
|
+
path: "/ex/jira/{cloudId}/rest/api/3/issue/{issueIdOrKey}/comment/{commentId}"
|
|
27849
29418
|
},
|
|
27850
|
-
cas: "optimistic-read-verify"
|
|
29419
|
+
cas: "optimistic-read-verify",
|
|
29420
|
+
requiredScopes: [JIRA_WRITE_SCOPE]
|
|
27851
29421
|
},
|
|
27852
29422
|
{
|
|
27853
29423
|
name: "attachments.get",
|
|
@@ -27855,13 +29425,17 @@ var jiraCloudConnector = declarativeRestConnector({
|
|
|
27855
29425
|
description: "Fetch attachment metadata by attachment ID.",
|
|
27856
29426
|
parameters: {
|
|
27857
29427
|
type: "object",
|
|
27858
|
-
properties: {
|
|
27859
|
-
|
|
29428
|
+
properties: {
|
|
29429
|
+
...jiraSiteProperty,
|
|
29430
|
+
attachmentId: { type: "string" }
|
|
29431
|
+
},
|
|
29432
|
+
required: ["cloudId", "attachmentId"]
|
|
27860
29433
|
},
|
|
27861
29434
|
request: {
|
|
27862
29435
|
method: "GET",
|
|
27863
|
-
path: "/rest/api/3/attachment/{attachmentId}"
|
|
27864
|
-
}
|
|
29436
|
+
path: "/ex/jira/{cloudId}/rest/api/3/attachment/{attachmentId}"
|
|
29437
|
+
},
|
|
29438
|
+
requiredScopes: [JIRA_READ_SCOPE]
|
|
27865
29439
|
},
|
|
27866
29440
|
{
|
|
27867
29441
|
name: "users.find",
|
|
@@ -27870,22 +29444,25 @@ var jiraCloudConnector = declarativeRestConnector({
|
|
|
27870
29444
|
parameters: {
|
|
27871
29445
|
type: "object",
|
|
27872
29446
|
properties: {
|
|
29447
|
+
...jiraSiteProperty,
|
|
27873
29448
|
query: { type: "string" },
|
|
27874
29449
|
accountId: { type: "string" },
|
|
27875
29450
|
startAt: { type: "integer", minimum: 0 },
|
|
27876
29451
|
maxResults: { type: "integer", minimum: 1, maximum: 1e3 }
|
|
27877
|
-
}
|
|
29452
|
+
},
|
|
29453
|
+
required: ["cloudId"]
|
|
27878
29454
|
},
|
|
27879
29455
|
request: {
|
|
27880
29456
|
method: "GET",
|
|
27881
|
-
path: "/rest/api/3/user/search",
|
|
29457
|
+
path: "/ex/jira/{cloudId}/rest/api/3/user/search",
|
|
27882
29458
|
query: {
|
|
27883
29459
|
query: "{query}",
|
|
27884
29460
|
accountId: "{accountId}",
|
|
27885
29461
|
startAt: "{startAt}",
|
|
27886
29462
|
maxResults: "{maxResults}"
|
|
27887
29463
|
}
|
|
27888
|
-
}
|
|
29464
|
+
},
|
|
29465
|
+
requiredScopes: [JIRA_USER_SCOPE]
|
|
27889
29466
|
}
|
|
27890
29467
|
]
|
|
27891
29468
|
});
|
|
@@ -31767,9 +33344,9 @@ function microsoftGraph(opts) {
|
|
|
31767
33344
|
return { data: { groups }, fetchedAt: Date.now() };
|
|
31768
33345
|
}
|
|
31769
33346
|
if (inv.capabilityName === "list_group_members") {
|
|
31770
|
-
const { groupId:
|
|
33347
|
+
const { groupId: groupId5, top } = inv.args;
|
|
31771
33348
|
const t = Math.min(Math.max(1, top ?? 50), 100);
|
|
31772
|
-
const url = `${GRAPH}/groups/${encodeURIComponent(
|
|
33349
|
+
const url = `${GRAPH}/groups/${encodeURIComponent(groupId5)}/members?$select=id,displayName,mail,userPrincipalName&$top=${t}`;
|
|
31773
33350
|
const json = await graphGet(url, accessToken3, inv.source.id);
|
|
31774
33351
|
const members = (json.value ?? []).map((m) => ({
|
|
31775
33352
|
// odata.type is '#microsoft.graph.user' | '#microsoft.graph.group'
|
|
@@ -33957,6 +35534,200 @@ var mondayConnector = declarativeRestConnector({
|
|
|
33957
35534
|
]
|
|
33958
35535
|
});
|
|
33959
35536
|
|
|
35537
|
+
// src/connectors/adapters/mycase.ts
|
|
35538
|
+
var pageProperties = {
|
|
35539
|
+
page: { type: "integer", minimum: 1 },
|
|
35540
|
+
page_size: { type: "integer", minimum: 1, maximum: 100 },
|
|
35541
|
+
updated_after: { type: "string", description: "ISO 8601 lower timestamp bound for incremental synchronization." }
|
|
35542
|
+
};
|
|
35543
|
+
var resourceId = { type: "string", description: "MyCase resource id." };
|
|
35544
|
+
var dataObject = {
|
|
35545
|
+
type: "object",
|
|
35546
|
+
description: "Provider-native MyCase JSON payload for this resource."
|
|
35547
|
+
};
|
|
35548
|
+
function list(name, path, description, extra = {}) {
|
|
35549
|
+
const query2 = Object.fromEntries(
|
|
35550
|
+
Object.keys({ ...pageProperties, ...extra }).map((key) => [key, `{${key}}`])
|
|
35551
|
+
);
|
|
35552
|
+
return {
|
|
35553
|
+
name,
|
|
35554
|
+
class: "read",
|
|
35555
|
+
description,
|
|
35556
|
+
parameters: { type: "object", properties: { ...pageProperties, ...extra } },
|
|
35557
|
+
request: { method: "GET", path, query: query2 }
|
|
35558
|
+
};
|
|
35559
|
+
}
|
|
35560
|
+
function create(name, path, description) {
|
|
35561
|
+
return {
|
|
35562
|
+
name,
|
|
35563
|
+
class: "mutation",
|
|
35564
|
+
description,
|
|
35565
|
+
parameters: {
|
|
35566
|
+
type: "object",
|
|
35567
|
+
properties: { data: dataObject },
|
|
35568
|
+
required: ["data"]
|
|
35569
|
+
},
|
|
35570
|
+
request: { method: "POST", path, body: "{data}" },
|
|
35571
|
+
cas: "native-idempotency",
|
|
35572
|
+
externalEffect: true
|
|
35573
|
+
};
|
|
35574
|
+
}
|
|
35575
|
+
function update(name, path, description) {
|
|
35576
|
+
return {
|
|
35577
|
+
name,
|
|
35578
|
+
class: "mutation",
|
|
35579
|
+
description,
|
|
35580
|
+
parameters: {
|
|
35581
|
+
type: "object",
|
|
35582
|
+
properties: { id: resourceId, data: dataObject },
|
|
35583
|
+
required: ["id", "data"]
|
|
35584
|
+
},
|
|
35585
|
+
request: { method: "PUT", path: `${path}/{id}`, body: "{data}" },
|
|
35586
|
+
cas: "optimistic-read-verify",
|
|
35587
|
+
externalEffect: true
|
|
35588
|
+
};
|
|
35589
|
+
}
|
|
35590
|
+
var mycaseConnector = declarativeRestConnector({
|
|
35591
|
+
kind: "mycase",
|
|
35592
|
+
displayName: "MyCase",
|
|
35593
|
+
description: "Manage legal cases, clients, companies, leads, matters, activities, time, expenses, and notes in MyCase.",
|
|
35594
|
+
auth: {
|
|
35595
|
+
kind: "oauth2",
|
|
35596
|
+
authorizationUrl: "https://auth.mycase.com/login_sessions/new",
|
|
35597
|
+
tokenUrl: "https://auth.mycase.com/tokens",
|
|
35598
|
+
scopes: [],
|
|
35599
|
+
sendScopeParam: false,
|
|
35600
|
+
clientIdEnv: "MYCASE_OAUTH_CLIENT_ID",
|
|
35601
|
+
clientSecretEnv: "MYCASE_OAUTH_CLIENT_SECRET"
|
|
35602
|
+
},
|
|
35603
|
+
category: "crm",
|
|
35604
|
+
defaultConsistencyModel: "authoritative",
|
|
35605
|
+
baseUrl: "https://external-integrations.mycase.com/v1",
|
|
35606
|
+
credentialPlacement: { kind: "bearer" },
|
|
35607
|
+
test: { method: "GET", path: "/staff", query: { page_size: 1 } },
|
|
35608
|
+
capabilities: [
|
|
35609
|
+
list("cases.list", "/cases", "List or incrementally synchronize legal cases.", {
|
|
35610
|
+
name: { type: "string" },
|
|
35611
|
+
case_number: { type: "string" },
|
|
35612
|
+
case_stage_id: { type: "string" },
|
|
35613
|
+
practice_area_id: { type: "string" },
|
|
35614
|
+
status: { type: "string" }
|
|
35615
|
+
}),
|
|
35616
|
+
create("cases.create", "/cases", "Create a legal case."),
|
|
35617
|
+
update("cases.update", "/cases", "Update a legal case."),
|
|
35618
|
+
list("clients.list", "/clients", "List or incrementally synchronize clients.", {
|
|
35619
|
+
first_name: { type: "string" },
|
|
35620
|
+
last_name: { type: "string" },
|
|
35621
|
+
email: { type: "string" }
|
|
35622
|
+
}),
|
|
35623
|
+
create("clients.create", "/clients", "Create a person/client record."),
|
|
35624
|
+
update("clients.update", "/clients", "Update a person/client record."),
|
|
35625
|
+
list("companies.list", "/companies", "List or incrementally synchronize companies.", {
|
|
35626
|
+
name: { type: "string" },
|
|
35627
|
+
email: { type: "string" }
|
|
35628
|
+
}),
|
|
35629
|
+
create("companies.create", "/companies", "Create a company record."),
|
|
35630
|
+
update("companies.update", "/companies", "Update a company record."),
|
|
35631
|
+
list("leads.list", "/leads", "List or incrementally synchronize leads.", {
|
|
35632
|
+
first_name: { type: "string" },
|
|
35633
|
+
last_name: { type: "string" },
|
|
35634
|
+
email: { type: "string" },
|
|
35635
|
+
status: { type: "string" }
|
|
35636
|
+
}),
|
|
35637
|
+
create("leads.create", "/leads", "Create a lead."),
|
|
35638
|
+
list("staff.list", "/staff", "List firm staff who can own or participate in work.", {
|
|
35639
|
+
first_name: { type: "string" },
|
|
35640
|
+
last_name: { type: "string" },
|
|
35641
|
+
email: { type: "string" }
|
|
35642
|
+
}),
|
|
35643
|
+
list("case-stages.list", "/case_stages", "List case stages."),
|
|
35644
|
+
create("case-stages.create", "/case_stages", "Create a case stage."),
|
|
35645
|
+
list("practice-areas.list", "/practice_areas", "List practice areas."),
|
|
35646
|
+
create("practice-areas.create", "/practice_areas", "Create a practice area."),
|
|
35647
|
+
list("referral-sources.list", "/referral_sources", "List referral sources."),
|
|
35648
|
+
create("referral-sources.create", "/referral_sources", "Create a referral source."),
|
|
35649
|
+
list("people-groups.list", "/people_groups", "List people groups."),
|
|
35650
|
+
list("locations.list", "/locations", "List office and event locations.", {
|
|
35651
|
+
name: { type: "string" }
|
|
35652
|
+
}),
|
|
35653
|
+
create("locations.create", "/locations", "Create a location."),
|
|
35654
|
+
list("events.list", "/events", "List or incrementally synchronize calendar events.", {
|
|
35655
|
+
start_date: { type: "string" },
|
|
35656
|
+
end_date: { type: "string" },
|
|
35657
|
+
case_id: { type: "string" }
|
|
35658
|
+
}),
|
|
35659
|
+
create("events.create", "/events", "Create a calendar event."),
|
|
35660
|
+
list("tasks.list", "/tasks", "List or incrementally synchronize tasks.", {
|
|
35661
|
+
due_date_start: { type: "string" },
|
|
35662
|
+
due_date_end: { type: "string" },
|
|
35663
|
+
case_id: { type: "string" },
|
|
35664
|
+
assignee_id: { type: "string" },
|
|
35665
|
+
completed: { type: "boolean" }
|
|
35666
|
+
}),
|
|
35667
|
+
create("tasks.create", "/tasks", "Create a task."),
|
|
35668
|
+
list("calls.list", "/calls", "List logged calls.", {
|
|
35669
|
+
caller_id: { type: "string" },
|
|
35670
|
+
caller_type: { type: "string", enum: ["client", "lead"] },
|
|
35671
|
+
staff_id: { type: "string" }
|
|
35672
|
+
}),
|
|
35673
|
+
create("calls.create", "/calls", "Log a call."),
|
|
35674
|
+
list("time-entries.list", "/time_entries", "List time entries.", {
|
|
35675
|
+
case_id: { type: "string" },
|
|
35676
|
+
staff_id: { type: "string" },
|
|
35677
|
+
start_date: { type: "string" },
|
|
35678
|
+
end_date: { type: "string" }
|
|
35679
|
+
}),
|
|
35680
|
+
create("time-entries.create", "/time_entries", "Create a time entry."),
|
|
35681
|
+
list("expenses.list", "/expenses", "List case expenses.", {
|
|
35682
|
+
case_id: { type: "string" },
|
|
35683
|
+
staff_id: { type: "string" },
|
|
35684
|
+
start_date: { type: "string" },
|
|
35685
|
+
end_date: { type: "string" }
|
|
35686
|
+
}),
|
|
35687
|
+
create("expenses.create", "/expenses", "Create a case expense."),
|
|
35688
|
+
{
|
|
35689
|
+
name: "case-notes.create",
|
|
35690
|
+
class: "mutation",
|
|
35691
|
+
description: "Add a note to a case.",
|
|
35692
|
+
parameters: {
|
|
35693
|
+
type: "object",
|
|
35694
|
+
properties: { caseId: resourceId, data: dataObject },
|
|
35695
|
+
required: ["caseId", "data"]
|
|
35696
|
+
},
|
|
35697
|
+
request: { method: "POST", path: "/cases/{caseId}/notes", body: "{data}" },
|
|
35698
|
+
cas: "native-idempotency",
|
|
35699
|
+
externalEffect: true
|
|
35700
|
+
},
|
|
35701
|
+
{
|
|
35702
|
+
name: "client-notes.create",
|
|
35703
|
+
class: "mutation",
|
|
35704
|
+
description: "Add a note to a client.",
|
|
35705
|
+
parameters: {
|
|
35706
|
+
type: "object",
|
|
35707
|
+
properties: { clientId: resourceId, data: dataObject },
|
|
35708
|
+
required: ["clientId", "data"]
|
|
35709
|
+
},
|
|
35710
|
+
request: { method: "POST", path: "/clients/{clientId}/notes", body: "{data}" },
|
|
35711
|
+
cas: "native-idempotency",
|
|
35712
|
+
externalEffect: true
|
|
35713
|
+
},
|
|
35714
|
+
{
|
|
35715
|
+
name: "company-notes.create",
|
|
35716
|
+
class: "mutation",
|
|
35717
|
+
description: "Add a note to a company.",
|
|
35718
|
+
parameters: {
|
|
35719
|
+
type: "object",
|
|
35720
|
+
properties: { companyId: resourceId, data: dataObject },
|
|
35721
|
+
required: ["companyId", "data"]
|
|
35722
|
+
},
|
|
35723
|
+
request: { method: "POST", path: "/companies/{companyId}/notes", body: "{data}" },
|
|
35724
|
+
cas: "native-idempotency",
|
|
35725
|
+
externalEffect: true
|
|
35726
|
+
},
|
|
35727
|
+
create("custom-fields.create", "/custom_fields", "Create a custom field definition.")
|
|
35728
|
+
]
|
|
35729
|
+
});
|
|
35730
|
+
|
|
33960
35731
|
// src/connectors/adapters/notion.ts
|
|
33961
35732
|
var TOKEN_URL12 = "https://api.notion.com/v1/oauth/token";
|
|
33962
35733
|
var NOTION_VERSION = "2022-06-28";
|
|
@@ -36579,8 +38350,8 @@ function toMessageSummary2(m) {
|
|
|
36579
38350
|
};
|
|
36580
38351
|
}
|
|
36581
38352
|
async function readMessage2(inv, accessToken3, timeoutMs) {
|
|
36582
|
-
const { id } = inv.args;
|
|
36583
|
-
const url = `${API7}/me/messages/${encodeURIComponent(
|
|
38353
|
+
const { id: id2 } = inv.args;
|
|
38354
|
+
const url = `${API7}/me/messages/${encodeURIComponent(id2)}?$expand=attachments($select=id,name,contentType,size,isInline)`;
|
|
36584
38355
|
const res = await fetch(url, {
|
|
36585
38356
|
headers: { authorization: `Bearer ${accessToken3}` },
|
|
36586
38357
|
signal: AbortSignal.timeout(timeoutMs)
|
|
@@ -36589,7 +38360,7 @@ async function readMessage2(inv, accessToken3, timeoutMs) {
|
|
|
36589
38360
|
throw new CredentialsExpired(`Outlook Mail rejected token (${res.status})`, inv.source.id);
|
|
36590
38361
|
}
|
|
36591
38362
|
if (res.status === 404) {
|
|
36592
|
-
throw new Error(`outlook-mail read_message: message ${
|
|
38363
|
+
throw new Error(`outlook-mail read_message: message ${id2} not found`);
|
|
36593
38364
|
}
|
|
36594
38365
|
if (!res.ok) {
|
|
36595
38366
|
const text = await res.text().catch(() => "");
|
|
@@ -39151,9 +40922,9 @@ function parseRss(text) {
|
|
|
39151
40922
|
const pubDate = firstTagText(item, "pubDate");
|
|
39152
40923
|
const author = firstTagText(item, "author") ?? firstTagText(item, "dc:creator");
|
|
39153
40924
|
const categories = collectElements(item, "category").map((cat) => decodeXml(stripTags(cat)) ?? "").filter(Boolean);
|
|
39154
|
-
const
|
|
40925
|
+
const id2 = decodeXml(guid) ?? decodeXml(link) ?? hash(item);
|
|
39155
40926
|
return {
|
|
39156
|
-
id,
|
|
40927
|
+
id: id2,
|
|
39157
40928
|
title: decodeXml(title),
|
|
39158
40929
|
link: decodeXml(link),
|
|
39159
40930
|
summary: decodeXml(description),
|
|
@@ -39173,7 +40944,7 @@ function parseAtom(text, feedUrl) {
|
|
|
39173
40944
|
const feedUpdated = normalizeDate(decodeXml(firstTagText(feedInner, "updated")));
|
|
39174
40945
|
const items = collectElements(feedOuter, "entry");
|
|
39175
40946
|
const entries = items.map((item) => {
|
|
39176
|
-
const
|
|
40947
|
+
const id2 = decodeXml(firstTagText(item, "id"));
|
|
39177
40948
|
const title = decodeXml(firstTagText(item, "title"));
|
|
39178
40949
|
const summary = decodeXml(firstTagText(item, "summary"));
|
|
39179
40950
|
const contentNode = firstTagText(item, "content");
|
|
@@ -39183,7 +40954,7 @@ function parseAtom(text, feedUrl) {
|
|
|
39183
40954
|
const link = pickAtomLink(item);
|
|
39184
40955
|
const categories = collectAtomCategories(item);
|
|
39185
40956
|
return {
|
|
39186
|
-
id:
|
|
40957
|
+
id: id2 ?? link ?? hash(item),
|
|
39187
40958
|
title,
|
|
39188
40959
|
link,
|
|
39189
40960
|
summary,
|
|
@@ -40887,11 +42658,11 @@ function sharepoint(opts) {
|
|
|
40887
42658
|
};
|
|
40888
42659
|
}
|
|
40889
42660
|
if (inv.capabilityName === "lists.create") {
|
|
40890
|
-
const { siteId, displayName, columns, list } = inv.args;
|
|
42661
|
+
const { siteId, displayName, columns, list: list2 } = inv.args;
|
|
40891
42662
|
const url = `${GRAPH3}/sites/${encodeURIComponent(siteId)}/lists`;
|
|
40892
42663
|
const body = { displayName };
|
|
40893
42664
|
if (Array.isArray(columns)) body.columns = columns;
|
|
40894
|
-
if (
|
|
42665
|
+
if (list2 && typeof list2 === "object") body.list = list2;
|
|
40895
42666
|
const res = await fetch(url, {
|
|
40896
42667
|
method: "POST",
|
|
40897
42668
|
headers: {
|
|
@@ -49323,7 +51094,7 @@ async function request2(source, path, options) {
|
|
|
49323
51094
|
throw new ProviderRateLimited("Zoho Bookings rate limit (429)", source.id, {
|
|
49324
51095
|
status: 429,
|
|
49325
51096
|
body: responseBody,
|
|
49326
|
-
retryAfterMs:
|
|
51097
|
+
retryAfterMs: retryAfterMs3(response.headers.get("retry-after"))
|
|
49327
51098
|
});
|
|
49328
51099
|
}
|
|
49329
51100
|
if (!response.ok) throw new Error(`zoho-bookings ${options.method} ${path} HTTP ${response.status}`);
|
|
@@ -49368,7 +51139,7 @@ function exactlyOne(args, keys, label) {
|
|
|
49368
51139
|
const present = keys.filter((key) => args[key] !== void 0 && args[key] !== null && args[key] !== "");
|
|
49369
51140
|
if (present.length !== 1) throw new Error(`zoho-bookings: exactly one ${label} is required`);
|
|
49370
51141
|
}
|
|
49371
|
-
function
|
|
51142
|
+
function retryAfterMs3(value) {
|
|
49372
51143
|
if (!value) return 6e4;
|
|
49373
51144
|
const seconds = Number(value);
|
|
49374
51145
|
return Number.isFinite(seconds) && seconds >= 0 ? Math.max(1e3, seconds * 1e3) : 6e4;
|
|
@@ -50507,11 +52278,11 @@ async function request3(source, path, options) {
|
|
|
50507
52278
|
});
|
|
50508
52279
|
}
|
|
50509
52280
|
if (response.status === 429) {
|
|
50510
|
-
const
|
|
52281
|
+
const retryAfterMs4 = parseRetryAfter(response.headers.get("retry-after"));
|
|
50511
52282
|
throw new ProviderRateLimited("Zoho Campaigns rate limit (429)", source.id, {
|
|
50512
52283
|
status: 429,
|
|
50513
52284
|
body: responseBody,
|
|
50514
|
-
retryAfterMs:
|
|
52285
|
+
retryAfterMs: retryAfterMs4
|
|
50515
52286
|
});
|
|
50516
52287
|
}
|
|
50517
52288
|
if (!response.ok) {
|
|
@@ -57234,7 +59005,10 @@ var CONNECTOR_ADAPTER_FACTORIES = [
|
|
|
57234
59005
|
clientSecret: "TODOIST_OAUTH_CLIENT_SECRET"
|
|
57235
59006
|
}),
|
|
57236
59007
|
defineFactoryAdapter(() => trelloConnector, {}),
|
|
57237
|
-
defineFactoryAdapter(() => jiraCloudConnector, {
|
|
59008
|
+
defineFactoryAdapter(() => jiraCloudConnector, {
|
|
59009
|
+
clientId: "ATLASSIAN_OAUTH_CLIENT_ID",
|
|
59010
|
+
clientSecret: "ATLASSIAN_OAUTH_CLIENT_SECRET"
|
|
59011
|
+
}),
|
|
57238
59012
|
defineFactoryAdapter(() => ringcentralConnector, {
|
|
57239
59013
|
clientId: "RINGCENTRAL_OAUTH_CLIENT_ID",
|
|
57240
59014
|
clientSecret: "RINGCENTRAL_OAUTH_CLIENT_SECRET"
|
|
@@ -57275,6 +59049,10 @@ var CONNECTOR_ADAPTER_FACTORIES = [
|
|
|
57275
59049
|
clientId: "IRONCLAD_OAUTH_CLIENT_ID",
|
|
57276
59050
|
clientSecret: "IRONCLAD_OAUTH_CLIENT_SECRET"
|
|
57277
59051
|
}),
|
|
59052
|
+
defineFactoryAdapter(() => mycaseConnector, {
|
|
59053
|
+
clientId: "MYCASE_OAUTH_CLIENT_ID",
|
|
59054
|
+
clientSecret: "MYCASE_OAUTH_CLIENT_SECRET"
|
|
59055
|
+
}),
|
|
57278
59056
|
defineFactoryAdapter(() => signNowConnector, {}),
|
|
57279
59057
|
defineFactoryAdapter(() => oneSpanSignConnector, {}),
|
|
57280
59058
|
defineFactoryAdapter(() => affinityConnector, {}),
|
|
@@ -57319,6 +59097,9 @@ var CONNECTOR_ADAPTER_FACTORIES = [
|
|
|
57319
59097
|
clientSecret: "AUTH0_OAUTH_CLIENT_SECRET"
|
|
57320
59098
|
}),
|
|
57321
59099
|
defineFactoryAdapter(() => oktaConnector, {}),
|
|
59100
|
+
defineFactoryAdapter(() => pingIdentityConnector, {}),
|
|
59101
|
+
defineFactoryAdapter(() => oneloginConnector, {}),
|
|
59102
|
+
defineFactoryAdapter(() => scimConnector, {}),
|
|
57322
59103
|
defineFactoryAdapter(() => twentyConnector, {}),
|
|
57323
59104
|
defineFactoryAdapter(() => folkConnector, {}),
|
|
57324
59105
|
defineFactoryAdapter(() => freshsalesConnector, {}),
|
|
@@ -57356,6 +59137,9 @@ var CONNECTOR_ADAPTER_FACTORIES = [
|
|
|
57356
59137
|
// credential bundles, so no shared deployment secret gates registration.
|
|
57357
59138
|
defineFactoryAdapter(() => stripePackConnector, {}),
|
|
57358
59139
|
defineFactoryAdapter(() => chargebeeConnector, {}),
|
|
59140
|
+
defineFactoryAdapter(() => recurlyConnector, {}),
|
|
59141
|
+
defineFactoryAdapter(() => avalaraConnector, {}),
|
|
59142
|
+
defineFactoryAdapter(() => taxjarConnector, {}),
|
|
57359
59143
|
defineFactoryAdapter(() => paddleConnector, {}),
|
|
57360
59144
|
defineFactoryAdapter(() => plaidConnector, {}),
|
|
57361
59145
|
defineFactoryAdapter(() => rampConnector, {}),
|
|
@@ -57727,11 +59511,11 @@ var phonyConnector = {
|
|
|
57727
59511
|
};
|
|
57728
59512
|
}
|
|
57729
59513
|
if (inv.capabilityName === "get_call") {
|
|
57730
|
-
const { id } = inv.args;
|
|
59514
|
+
const { id: id2 } = inv.args;
|
|
57731
59515
|
const json = await getJson(
|
|
57732
59516
|
inv,
|
|
57733
59517
|
token,
|
|
57734
|
-
`${API13}/v1/outbound/${encodeURIComponent(
|
|
59518
|
+
`${API13}/v1/outbound/${encodeURIComponent(id2)}`,
|
|
57735
59519
|
"get_call"
|
|
57736
59520
|
);
|
|
57737
59521
|
return { data: { call: json.call ?? null }, fetchedAt: Date.now() };
|
|
@@ -137030,6 +138814,10 @@ var demandbaseConnector = declarativeRestConnector({
|
|
|
137030
138814
|
export {
|
|
137031
138815
|
declarativeRestConnector,
|
|
137032
138816
|
oktaConnector,
|
|
138817
|
+
clientCredentialsRestConnector,
|
|
138818
|
+
oneloginConnector,
|
|
138819
|
+
pingIdentityConnector,
|
|
138820
|
+
scimConnector,
|
|
137033
138821
|
actualbudgetConnector,
|
|
137034
138822
|
aianswerConnector,
|
|
137035
138823
|
airparserConnector,
|
|
@@ -137081,6 +138869,7 @@ export {
|
|
|
137081
138869
|
attioConnector,
|
|
137082
138870
|
auth0Connector,
|
|
137083
138871
|
avomaConnector,
|
|
138872
|
+
avalaraConnector,
|
|
137084
138873
|
azureAdConnector,
|
|
137085
138874
|
basecampConnector,
|
|
137086
138875
|
backblazeConnector,
|
|
@@ -137101,6 +138890,8 @@ export {
|
|
|
137101
138890
|
contentfulConnector,
|
|
137102
138891
|
copperConnector,
|
|
137103
138892
|
chargebeeConnector,
|
|
138893
|
+
recurlyConnector,
|
|
138894
|
+
taxjarConnector,
|
|
137104
138895
|
cashfreePaymentsConnector,
|
|
137105
138896
|
circleConnector,
|
|
137106
138897
|
checkoutConnector,
|
|
@@ -137175,6 +138966,7 @@ export {
|
|
|
137175
138966
|
meetgeekAiConnector,
|
|
137176
138967
|
mollieConnector,
|
|
137177
138968
|
mondayConnector,
|
|
138969
|
+
mycaseConnector,
|
|
137178
138970
|
notionConnector,
|
|
137179
138971
|
notion,
|
|
137180
138972
|
n8nConnector,
|
|
@@ -137642,4 +139434,4 @@ export {
|
|
|
137642
139434
|
demandbaseConnector,
|
|
137643
139435
|
adapters_exports
|
|
137644
139436
|
};
|
|
137645
|
-
//# sourceMappingURL=chunk-
|
|
139437
|
+
//# sourceMappingURL=chunk-X3WHOEX7.js.map
|