@tangle-network/agent-integrations 0.53.24 → 0.53.25
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 +4 -4
- package/dist/{chunk-ASAV5XL6.js → chunk-6NICNEJG.js} +3 -3
- package/dist/{chunk-KIPIGOZD.js → chunk-ACAQVJ4F.js} +2 -2
- package/dist/{chunk-BZIOH6KJ.js → chunk-AE7GYW2O.js} +28 -2
- package/dist/chunk-AE7GYW2O.js.map +1 -0
- package/dist/{chunk-YWNB5M5K.js → chunk-EXPZGJ4A.js} +666 -102
- package/dist/{chunk-YWNB5M5K.js.map → chunk-EXPZGJ4A.js.map} +1 -1
- package/dist/connectors/adapters/index.d.ts +3 -1
- package/dist/connectors/adapters/index.js +3 -1
- package/dist/connectors/index.d.ts +1 -1
- package/dist/connectors/index.js +4 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.js +6 -4
- package/dist/mcp.js +4 -4
- package/dist/registry.js +4 -4
- package/dist/runtime.js +4 -4
- package/dist/specs.js +3 -3
- package/docs/integration-execution-audit.md +10 -9
- package/docs/integration-execution-matrix.json +19 -14
- package/package.json +1 -1
- package/dist/chunk-BZIOH6KJ.js.map +0 -1
- /package/dist/{chunk-ASAV5XL6.js.map → chunk-6NICNEJG.js.map} +0 -0
- /package/dist/{chunk-KIPIGOZD.js.map → chunk-ACAQVJ4F.js.map} +0 -0
|
@@ -83,6 +83,7 @@ __export(adapters_exports, {
|
|
|
83
83
|
azureBlobStorageConnector: () => azureBlobStorageConnector,
|
|
84
84
|
azureCommunicationServicesConnector: () => azureCommunicationServicesConnector,
|
|
85
85
|
azureOpenaiConnector: () => azureOpenaiConnector,
|
|
86
|
+
azureServiceBusConnector: () => azureServiceBusConnector,
|
|
86
87
|
backblazeConnector: () => backblazeConnector,
|
|
87
88
|
bamboohrConnector: () => bamboohrConnector,
|
|
88
89
|
bannerbearConnector: () => bannerbearConnector,
|
|
@@ -786,11 +787,11 @@ function declarativeRestConnector(spec) {
|
|
|
786
787
|
const op = readOperation(spec, inv.capabilityName, "read");
|
|
787
788
|
const response = await executeRestRequest(spec, op.request, inv, requiredArgsOf(op.parameters));
|
|
788
789
|
if (response.outcome === "rate-limited") {
|
|
789
|
-
const
|
|
790
|
+
const retryAfterMs6 = response.retryAfterMs ?? DEFAULT_RETRY_AFTER_MS;
|
|
790
791
|
throw new ProviderRateLimited(
|
|
791
|
-
`${spec.displayName} ${inv.capabilityName} rate limit (429); retry after ${
|
|
792
|
+
`${spec.displayName} ${inv.capabilityName} rate limit (429); retry after ${retryAfterMs6}ms`,
|
|
792
793
|
inv.source.id,
|
|
793
|
-
{ status: 429, body: response.data, retryAfterMs:
|
|
794
|
+
{ status: 429, body: response.data, retryAfterMs: retryAfterMs6 }
|
|
794
795
|
);
|
|
795
796
|
}
|
|
796
797
|
if (response.outcome === "conflict") {
|
|
@@ -11928,11 +11929,11 @@ async function azureRequest(credentials, inv, method, pathSegments, query2 = new
|
|
|
11928
11929
|
throw new CredentialsExpired(`Azure Blob Storage rejected credentials (${response.status})`, inv.source.id);
|
|
11929
11930
|
}
|
|
11930
11931
|
if (response.status === 429 || response.status === 503) {
|
|
11931
|
-
const
|
|
11932
|
+
const retryAfterMs6 = retryAfter(response.headers.get("retry-after"));
|
|
11932
11933
|
throw new ProviderRateLimited(
|
|
11933
|
-
`Azure Blob Storage rate limit (${response.status}); retry after ${
|
|
11934
|
+
`Azure Blob Storage rate limit (${response.status}); retry after ${retryAfterMs6}ms`,
|
|
11934
11935
|
inv.source.id,
|
|
11935
|
-
{ status: response.status, retryAfterMs:
|
|
11936
|
+
{ status: response.status, retryAfterMs: retryAfterMs6 }
|
|
11936
11937
|
);
|
|
11937
11938
|
}
|
|
11938
11939
|
if (!response.ok) {
|
|
@@ -12205,6 +12206,567 @@ function numberOrUndefined(value) {
|
|
|
12205
12206
|
return Number.isFinite(parsed) ? parsed : void 0;
|
|
12206
12207
|
}
|
|
12207
12208
|
|
|
12209
|
+
// src/connectors/adapters/azure-service-bus.ts
|
|
12210
|
+
import { createHmac as createHmac3 } from "crypto";
|
|
12211
|
+
var MANAGEMENT_API_VERSION = "2017-04";
|
|
12212
|
+
var MAX_RESPONSE_BYTES2 = 8 * 1024 * 1024;
|
|
12213
|
+
var MAX_MESSAGE_BYTES = 256 * 1024;
|
|
12214
|
+
var SERVICE_BUS_SUFFIXES = [
|
|
12215
|
+
".servicebus.windows.net",
|
|
12216
|
+
".servicebus.usgovcloudapi.net",
|
|
12217
|
+
".servicebus.chinacloudapi.cn",
|
|
12218
|
+
".servicebus.cloudapi.de"
|
|
12219
|
+
];
|
|
12220
|
+
var azureServiceBusConnector = {
|
|
12221
|
+
manifest: {
|
|
12222
|
+
kind: "azure-service-bus",
|
|
12223
|
+
displayName: "Azure Service Bus",
|
|
12224
|
+
description: "Send and receive Azure Service Bus queue and topic messages and discover queue, topic, and subscription entities with a customer-owned SAS connection string.",
|
|
12225
|
+
auth: {
|
|
12226
|
+
kind: "api-key",
|
|
12227
|
+
hint: "Azure Service Bus connection string containing Endpoint, SharedAccessKeyName, and SharedAccessKey. EntityPath is supported and restricts this connection to that queue or topic."
|
|
12228
|
+
},
|
|
12229
|
+
category: "webhook",
|
|
12230
|
+
// The REST receive-and-delete operation destructively consumes a message,
|
|
12231
|
+
// and message delivery is at-least-once. Acceptance is not proof that a
|
|
12232
|
+
// downstream consumer processed the payload exactly once.
|
|
12233
|
+
defaultConsistencyModel: "advisory",
|
|
12234
|
+
rateLimit: { requests: 600, windowMs: 6e4, scope: "data-source" },
|
|
12235
|
+
capabilities: [
|
|
12236
|
+
readCapability2("queues.list", "List queues visible to a namespace-level Manage policy.", listProperties()),
|
|
12237
|
+
readCapability2("queues.get", "Get one queue description and message counts.", {
|
|
12238
|
+
queue: { type: "string" }
|
|
12239
|
+
}, ["queue"]),
|
|
12240
|
+
readCapability2("topics.list", "List topics visible to a namespace-level Manage policy.", listProperties()),
|
|
12241
|
+
readCapability2("topics.get", "Get one topic description and message counts.", {
|
|
12242
|
+
topic: { type: "string" }
|
|
12243
|
+
}, ["topic"]),
|
|
12244
|
+
readCapability2("subscriptions.list", "List subscriptions for one topic.", {
|
|
12245
|
+
topic: { type: "string" },
|
|
12246
|
+
...listProperties()
|
|
12247
|
+
}, ["topic"]),
|
|
12248
|
+
readCapability2("subscriptions.get", "Get one topic subscription description and message counts.", {
|
|
12249
|
+
topic: { type: "string" },
|
|
12250
|
+
subscription: { type: "string" }
|
|
12251
|
+
}, ["topic", "subscription"]),
|
|
12252
|
+
mutationCapability2("queues.send", "Send a UTF-8 or base64 message to a queue.", sendProperties("queue"), ["queue", "content"]),
|
|
12253
|
+
mutationCapability2("topics.send", "Publish a UTF-8 or base64 message to a topic.", sendProperties("topic"), ["topic", "content"]),
|
|
12254
|
+
mutationCapability2("queues.receiveDelete", "Receive and permanently delete the next queue message.", {
|
|
12255
|
+
queue: { type: "string" },
|
|
12256
|
+
timeoutSeconds: { type: "integer", minimum: 0, maximum: 55 }
|
|
12257
|
+
}, ["queue"]),
|
|
12258
|
+
mutationCapability2("subscriptions.receiveDelete", "Receive and permanently delete the next message from a topic subscription.", {
|
|
12259
|
+
topic: { type: "string" },
|
|
12260
|
+
subscription: { type: "string" },
|
|
12261
|
+
timeoutSeconds: { type: "integer", minimum: 0, maximum: 55 }
|
|
12262
|
+
}, ["topic", "subscription"]),
|
|
12263
|
+
mutationCapability2("queues.deadLetters.receiveDelete", "Receive and permanently delete the next queue dead-letter message.", {
|
|
12264
|
+
queue: { type: "string" },
|
|
12265
|
+
timeoutSeconds: { type: "integer", minimum: 0, maximum: 55 }
|
|
12266
|
+
}, ["queue"]),
|
|
12267
|
+
mutationCapability2("subscriptions.deadLetters.receiveDelete", "Receive and permanently delete the next subscription dead-letter message.", {
|
|
12268
|
+
topic: { type: "string" },
|
|
12269
|
+
subscription: { type: "string" },
|
|
12270
|
+
timeoutSeconds: { type: "integer", minimum: 0, maximum: 55 }
|
|
12271
|
+
}, ["topic", "subscription"])
|
|
12272
|
+
]
|
|
12273
|
+
},
|
|
12274
|
+
async executeRead(inv) {
|
|
12275
|
+
const credentials = parseConnectionString(inv.source.credentials, inv.source.id);
|
|
12276
|
+
let path;
|
|
12277
|
+
let list2 = false;
|
|
12278
|
+
switch (inv.capabilityName) {
|
|
12279
|
+
case "queues.list":
|
|
12280
|
+
requireNamespacePolicy(credentials, "queues.list");
|
|
12281
|
+
path = "$Resources/Queues";
|
|
12282
|
+
list2 = true;
|
|
12283
|
+
break;
|
|
12284
|
+
case "queues.get":
|
|
12285
|
+
path = entityName(inv.args.queue, "queue");
|
|
12286
|
+
enforceEntityPath(credentials, path);
|
|
12287
|
+
break;
|
|
12288
|
+
case "topics.list":
|
|
12289
|
+
requireNamespacePolicy(credentials, "topics.list");
|
|
12290
|
+
path = "$Resources/Topics";
|
|
12291
|
+
list2 = true;
|
|
12292
|
+
break;
|
|
12293
|
+
case "topics.get":
|
|
12294
|
+
path = entityName(inv.args.topic, "topic");
|
|
12295
|
+
enforceEntityPath(credentials, path);
|
|
12296
|
+
break;
|
|
12297
|
+
case "subscriptions.list": {
|
|
12298
|
+
const topic = entityName(inv.args.topic, "topic");
|
|
12299
|
+
enforceEntityPath(credentials, topic);
|
|
12300
|
+
path = `${topic}/Subscriptions/`;
|
|
12301
|
+
list2 = true;
|
|
12302
|
+
break;
|
|
12303
|
+
}
|
|
12304
|
+
case "subscriptions.get": {
|
|
12305
|
+
const topic = entityName(inv.args.topic, "topic");
|
|
12306
|
+
enforceEntityPath(credentials, topic);
|
|
12307
|
+
path = `${topic}/Subscriptions/${entityName(inv.args.subscription, "subscription")}`;
|
|
12308
|
+
break;
|
|
12309
|
+
}
|
|
12310
|
+
default:
|
|
12311
|
+
throw new Error(`azure-service-bus: unknown read capability ${inv.capabilityName}`);
|
|
12312
|
+
}
|
|
12313
|
+
const query2 = list2 ? managementListQuery(inv.args) : new URLSearchParams({ "api-version": MANAGEMENT_API_VERSION });
|
|
12314
|
+
const result = await serviceBusRequest(
|
|
12315
|
+
credentials,
|
|
12316
|
+
inv,
|
|
12317
|
+
"GET",
|
|
12318
|
+
path,
|
|
12319
|
+
query2
|
|
12320
|
+
);
|
|
12321
|
+
const xml = decodeUtf82(result.body);
|
|
12322
|
+
const data4 = list2 ? parseAtomFeed(xml) : parseAtomEntry(xml);
|
|
12323
|
+
return { data: data4, fetchedAt: Date.now() };
|
|
12324
|
+
},
|
|
12325
|
+
async executeMutation(inv) {
|
|
12326
|
+
const credentials = parseConnectionString(inv.source.credentials, inv.source.id);
|
|
12327
|
+
let data4;
|
|
12328
|
+
switch (inv.capabilityName) {
|
|
12329
|
+
case "queues.send":
|
|
12330
|
+
data4 = await sendMessage(credentials, inv, entityName(inv.args.queue, "queue"));
|
|
12331
|
+
break;
|
|
12332
|
+
case "topics.send":
|
|
12333
|
+
data4 = await sendMessage(credentials, inv, entityName(inv.args.topic, "topic"));
|
|
12334
|
+
break;
|
|
12335
|
+
case "queues.receiveDelete":
|
|
12336
|
+
data4 = await receiveAndDelete(credentials, inv, entityName(inv.args.queue, "queue"));
|
|
12337
|
+
break;
|
|
12338
|
+
case "subscriptions.receiveDelete":
|
|
12339
|
+
data4 = await receiveAndDelete(
|
|
12340
|
+
credentials,
|
|
12341
|
+
inv,
|
|
12342
|
+
`${entityName(inv.args.topic, "topic")}/subscriptions/${entityName(inv.args.subscription, "subscription")}`
|
|
12343
|
+
);
|
|
12344
|
+
break;
|
|
12345
|
+
case "queues.deadLetters.receiveDelete":
|
|
12346
|
+
data4 = await receiveAndDelete(
|
|
12347
|
+
credentials,
|
|
12348
|
+
inv,
|
|
12349
|
+
`${entityName(inv.args.queue, "queue")}/$DeadLetterQueue`
|
|
12350
|
+
);
|
|
12351
|
+
break;
|
|
12352
|
+
case "subscriptions.deadLetters.receiveDelete":
|
|
12353
|
+
data4 = await receiveAndDelete(
|
|
12354
|
+
credentials,
|
|
12355
|
+
inv,
|
|
12356
|
+
`${entityName(inv.args.topic, "topic")}/subscriptions/${entityName(inv.args.subscription, "subscription")}/$DeadLetterQueue`
|
|
12357
|
+
);
|
|
12358
|
+
break;
|
|
12359
|
+
default:
|
|
12360
|
+
throw new Error(`azure-service-bus: unknown mutation capability ${inv.capabilityName}`);
|
|
12361
|
+
}
|
|
12362
|
+
return {
|
|
12363
|
+
status: "committed",
|
|
12364
|
+
data: data4,
|
|
12365
|
+
committedAt: Date.now(),
|
|
12366
|
+
idempotentReplay: false
|
|
12367
|
+
};
|
|
12368
|
+
},
|
|
12369
|
+
async test(source) {
|
|
12370
|
+
try {
|
|
12371
|
+
parseConnectionString(source.credentials, source.id);
|
|
12372
|
+
return { ok: true };
|
|
12373
|
+
} catch (error) {
|
|
12374
|
+
return { ok: false, reason: error instanceof Error ? error.message : "Azure Service Bus connection string is invalid" };
|
|
12375
|
+
}
|
|
12376
|
+
}
|
|
12377
|
+
};
|
|
12378
|
+
function readCapability2(name, description, properties, required = []) {
|
|
12379
|
+
return {
|
|
12380
|
+
name,
|
|
12381
|
+
class: "read",
|
|
12382
|
+
description,
|
|
12383
|
+
parameters: { type: "object", properties, ...required.length ? { required } : {} }
|
|
12384
|
+
};
|
|
12385
|
+
}
|
|
12386
|
+
function mutationCapability2(name, description, properties, required) {
|
|
12387
|
+
return {
|
|
12388
|
+
name,
|
|
12389
|
+
class: "mutation",
|
|
12390
|
+
description,
|
|
12391
|
+
parameters: { type: "object", properties, required },
|
|
12392
|
+
cas: "none",
|
|
12393
|
+
externalEffect: true
|
|
12394
|
+
};
|
|
12395
|
+
}
|
|
12396
|
+
function sendProperties(entity) {
|
|
12397
|
+
return {
|
|
12398
|
+
[entity]: { type: "string" },
|
|
12399
|
+
content: { type: "string", description: "UTF-8 text or canonical base64 message body." },
|
|
12400
|
+
encoding: { type: "string", enum: ["utf-8", "base64"], default: "utf-8" },
|
|
12401
|
+
contentType: { type: "string" },
|
|
12402
|
+
brokerProperties: {
|
|
12403
|
+
type: "object",
|
|
12404
|
+
description: "Allowed broker properties such as MessageId, CorrelationId, Label, SessionId, TimeToLive, and ScheduledEnqueueTimeUtc."
|
|
12405
|
+
},
|
|
12406
|
+
applicationProperties: {
|
|
12407
|
+
type: "object",
|
|
12408
|
+
description: "Application property headers with string, number, or boolean values."
|
|
12409
|
+
}
|
|
12410
|
+
};
|
|
12411
|
+
}
|
|
12412
|
+
function listProperties() {
|
|
12413
|
+
return {
|
|
12414
|
+
skip: { type: "integer", minimum: 0 },
|
|
12415
|
+
top: { type: "integer", minimum: 1, maximum: 1e3 }
|
|
12416
|
+
};
|
|
12417
|
+
}
|
|
12418
|
+
function managementListQuery(args) {
|
|
12419
|
+
const query2 = new URLSearchParams({ "api-version": MANAGEMENT_API_VERSION });
|
|
12420
|
+
if (args.skip !== void 0) query2.set("$skip", String(boundedInteger(args.skip, "skip", 0, 1e6)));
|
|
12421
|
+
if (args.top !== void 0) query2.set("$top", String(boundedInteger(args.top, "top", 1, 1e3)));
|
|
12422
|
+
return query2;
|
|
12423
|
+
}
|
|
12424
|
+
function parseConnectionString(credentials, dataSourceId) {
|
|
12425
|
+
if (credentials.kind !== "api-key") {
|
|
12426
|
+
throw new CredentialsExpired("Azure Service Bus requires a connection string", dataSourceId);
|
|
12427
|
+
}
|
|
12428
|
+
const values = /* @__PURE__ */ new Map();
|
|
12429
|
+
for (const part of credentials.apiKey.split(";")) {
|
|
12430
|
+
if (!part.trim()) continue;
|
|
12431
|
+
const separator = part.indexOf("=");
|
|
12432
|
+
if (separator <= 0) {
|
|
12433
|
+
throw new CredentialsExpired("Azure Service Bus connection string is malformed", dataSourceId);
|
|
12434
|
+
}
|
|
12435
|
+
const name = part.slice(0, separator).trim().toLowerCase();
|
|
12436
|
+
if (values.has(name)) {
|
|
12437
|
+
throw new CredentialsExpired(`Azure Service Bus connection string repeats ${name}`, dataSourceId);
|
|
12438
|
+
}
|
|
12439
|
+
values.set(name, part.slice(separator + 1).trim());
|
|
12440
|
+
}
|
|
12441
|
+
const endpointValue = values.get("endpoint");
|
|
12442
|
+
const keyName = values.get("sharedaccesskeyname");
|
|
12443
|
+
const keyValue = values.get("sharedaccesskey");
|
|
12444
|
+
if (!endpointValue || !keyName || !keyValue) {
|
|
12445
|
+
throw new CredentialsExpired("Azure Service Bus connection string is missing Endpoint, SharedAccessKeyName, or SharedAccessKey", dataSourceId);
|
|
12446
|
+
}
|
|
12447
|
+
let endpoint;
|
|
12448
|
+
try {
|
|
12449
|
+
endpoint = new URL(endpointValue.replace(/^sb:/i, "https:"));
|
|
12450
|
+
} catch {
|
|
12451
|
+
throw new CredentialsExpired("Azure Service Bus Endpoint is invalid", dataSourceId);
|
|
12452
|
+
}
|
|
12453
|
+
if (endpoint.protocol !== "https:" || endpoint.username || endpoint.password || endpoint.port || endpoint.search || endpoint.hash || endpoint.pathname !== "/" || !SERVICE_BUS_SUFFIXES.some((suffix) => endpoint.hostname.endsWith(suffix))) {
|
|
12454
|
+
throw new CredentialsExpired("Azure Service Bus Endpoint must be a public Azure Service Bus namespace", dataSourceId);
|
|
12455
|
+
}
|
|
12456
|
+
if (!/^[A-Za-z0-9][A-Za-z0-9._-]{0,255}$/.test(keyName)) {
|
|
12457
|
+
throw new CredentialsExpired("Azure Service Bus SharedAccessKeyName is invalid", dataSourceId);
|
|
12458
|
+
}
|
|
12459
|
+
let key;
|
|
12460
|
+
try {
|
|
12461
|
+
key = Buffer.from(keyValue, "base64");
|
|
12462
|
+
} catch {
|
|
12463
|
+
throw new CredentialsExpired("Azure Service Bus SharedAccessKey is invalid base64", dataSourceId);
|
|
12464
|
+
}
|
|
12465
|
+
if (key.length < 16 || key.toString("base64").replace(/=+$/, "") !== keyValue.replace(/=+$/, "")) {
|
|
12466
|
+
throw new CredentialsExpired("Azure Service Bus SharedAccessKey is invalid base64", dataSourceId);
|
|
12467
|
+
}
|
|
12468
|
+
const entityPathValue = values.get("entitypath");
|
|
12469
|
+
const entityPath = entityPathValue ? entityName(entityPathValue, "EntityPath") : void 0;
|
|
12470
|
+
return { endpoint, keyName, key, entityPath };
|
|
12471
|
+
}
|
|
12472
|
+
async function sendMessage(credentials, inv, entityPath) {
|
|
12473
|
+
enforceEntityPath(credentials, entityPath);
|
|
12474
|
+
const content = requiredString4(inv.args.content, "content", true);
|
|
12475
|
+
const encoding = inv.args.encoding === void 0 ? "utf-8" : enumValue(inv.args.encoding, "encoding", ["utf-8", "base64"]);
|
|
12476
|
+
const body = encoding === "base64" ? strictBase64(content) : Buffer.from(content, "utf8");
|
|
12477
|
+
if (body.byteLength > MAX_MESSAGE_BYTES) {
|
|
12478
|
+
throw new Error(`Azure Service Bus message exceeds ${MAX_MESSAGE_BYTES} bytes`);
|
|
12479
|
+
}
|
|
12480
|
+
const headers = {
|
|
12481
|
+
"content-type": inv.args.contentType === void 0 ? "application/octet-stream" : requiredHeaderValue(inv.args.contentType, "contentType")
|
|
12482
|
+
};
|
|
12483
|
+
const brokerProperties = allowedBrokerProperties(inv.args.brokerProperties);
|
|
12484
|
+
if (brokerProperties) {
|
|
12485
|
+
const serializedBrokerProperties = JSON.stringify(brokerProperties);
|
|
12486
|
+
if (Buffer.byteLength(serializedBrokerProperties) > 16 * 1024) {
|
|
12487
|
+
throw new Error("brokerProperties exceeds 16384 bytes");
|
|
12488
|
+
}
|
|
12489
|
+
headers.BrokerProperties = serializedBrokerProperties;
|
|
12490
|
+
}
|
|
12491
|
+
Object.assign(headers, applicationPropertyHeaders(inv.args.applicationProperties));
|
|
12492
|
+
const result = await serviceBusRequest(credentials, inv, "POST", `${entityPath}/messages`, void 0, headers, body);
|
|
12493
|
+
return {
|
|
12494
|
+
accepted: true,
|
|
12495
|
+
entityPath,
|
|
12496
|
+
size: body.byteLength,
|
|
12497
|
+
location: result.response.headers.get("location") ?? void 0
|
|
12498
|
+
};
|
|
12499
|
+
}
|
|
12500
|
+
async function receiveAndDelete(credentials, inv, entityPath) {
|
|
12501
|
+
enforceEntityPath(credentials, entityPath);
|
|
12502
|
+
const timeoutSeconds = inv.args.timeoutSeconds === void 0 ? 0 : boundedInteger(inv.args.timeoutSeconds, "timeoutSeconds", 0, 55);
|
|
12503
|
+
const result = await serviceBusRequest(
|
|
12504
|
+
credentials,
|
|
12505
|
+
inv,
|
|
12506
|
+
"DELETE",
|
|
12507
|
+
`${entityPath}/messages/head`,
|
|
12508
|
+
new URLSearchParams({ timeout: String(timeoutSeconds) }),
|
|
12509
|
+
void 0,
|
|
12510
|
+
void 0,
|
|
12511
|
+
[200, 204]
|
|
12512
|
+
);
|
|
12513
|
+
if (result.response.status === 204) return { message: null };
|
|
12514
|
+
const brokerPropertiesHeader = result.response.headers.get("brokerproperties");
|
|
12515
|
+
let brokerProperties;
|
|
12516
|
+
if (brokerPropertiesHeader) {
|
|
12517
|
+
try {
|
|
12518
|
+
brokerProperties = JSON.parse(brokerPropertiesHeader);
|
|
12519
|
+
} catch {
|
|
12520
|
+
throw new Error("Azure Service Bus returned invalid BrokerProperties JSON");
|
|
12521
|
+
}
|
|
12522
|
+
}
|
|
12523
|
+
return {
|
|
12524
|
+
message: {
|
|
12525
|
+
body: Buffer.from(result.body).toString("base64"),
|
|
12526
|
+
encoding: "base64",
|
|
12527
|
+
contentType: result.response.headers.get("content-type") ?? "application/octet-stream",
|
|
12528
|
+
brokerProperties,
|
|
12529
|
+
applicationProperties: responseApplicationProperties(result.response.headers)
|
|
12530
|
+
}
|
|
12531
|
+
};
|
|
12532
|
+
}
|
|
12533
|
+
async function serviceBusRequest(credentials, inv, method, path, query2, headers = {}, body, acceptedStatuses = [200, 201, 202, 204]) {
|
|
12534
|
+
const url = new URL(path.split("/").map(encodePathSegment2).join("/"), credentials.endpoint);
|
|
12535
|
+
if (query2) url.search = query2.toString();
|
|
12536
|
+
const resourceUri = `${url.origin}${url.pathname}`;
|
|
12537
|
+
const expiry = Math.floor(Date.now() / 1e3) + 300;
|
|
12538
|
+
const encodedResourceUri = encodeURIComponent(resourceUri);
|
|
12539
|
+
const signature = createHmac3("sha256", credentials.key).update(`${encodedResourceUri}
|
|
12540
|
+
${expiry}`, "utf8").digest("base64");
|
|
12541
|
+
const authorization = `SharedAccessSignature sr=${encodedResourceUri}&sig=${encodeURIComponent(signature)}&se=${expiry}&skn=${encodeURIComponent(credentials.keyName)}`;
|
|
12542
|
+
const response = await fetch(url, {
|
|
12543
|
+
method,
|
|
12544
|
+
headers: { authorization, accept: "application/atom+xml, application/xml, */*", ...headers },
|
|
12545
|
+
body: body === void 0 ? void 0 : Uint8Array.from(body).buffer
|
|
12546
|
+
});
|
|
12547
|
+
const responseBody = await readBounded(response, MAX_RESPONSE_BYTES2);
|
|
12548
|
+
if (acceptedStatuses.includes(response.status)) return { response, body: responseBody };
|
|
12549
|
+
const text = decodeUtf82(responseBody);
|
|
12550
|
+
if (response.status === 401) {
|
|
12551
|
+
throw new CredentialsExpired("Azure Service Bus rejected the shared access signature", inv.source.id, {
|
|
12552
|
+
status: response.status,
|
|
12553
|
+
body: redactProviderText(text)
|
|
12554
|
+
});
|
|
12555
|
+
}
|
|
12556
|
+
if (response.status === 403) {
|
|
12557
|
+
throw new ProviderConfigError("Azure Service Bus policy lacks permission for this operation", inv.source.id, {
|
|
12558
|
+
status: response.status,
|
|
12559
|
+
body: redactProviderText(text)
|
|
12560
|
+
});
|
|
12561
|
+
}
|
|
12562
|
+
if (response.status === 429 || response.status === 503) {
|
|
12563
|
+
throw new ProviderRateLimited("Azure Service Bus is throttling requests", inv.source.id, {
|
|
12564
|
+
status: response.status,
|
|
12565
|
+
body: redactProviderText(text),
|
|
12566
|
+
retryAfterMs: retryAfterMs3(response.headers.get("retry-after"))
|
|
12567
|
+
});
|
|
12568
|
+
}
|
|
12569
|
+
throw new Error(`Azure Service Bus request failed with HTTP ${response.status}: ${redactProviderText(text).slice(0, 500)}`);
|
|
12570
|
+
}
|
|
12571
|
+
function encodePathSegment2(segment) {
|
|
12572
|
+
if (segment === "$Resources" || segment === "$DeadLetterQueue") return segment;
|
|
12573
|
+
return encodeURIComponent(segment);
|
|
12574
|
+
}
|
|
12575
|
+
function entityName(value, field) {
|
|
12576
|
+
const name = requiredString4(value, field);
|
|
12577
|
+
if (!/^[A-Za-z0-9][A-Za-z0-9._~-]{0,259}$/.test(name)) {
|
|
12578
|
+
throw new Error(`${field} must be a valid Azure Service Bus entity name`);
|
|
12579
|
+
}
|
|
12580
|
+
return name;
|
|
12581
|
+
}
|
|
12582
|
+
function requireNamespacePolicy(credentials, capability) {
|
|
12583
|
+
if (credentials.entityPath) {
|
|
12584
|
+
throw new Error(`${capability} requires a namespace-level connection string without EntityPath`);
|
|
12585
|
+
}
|
|
12586
|
+
}
|
|
12587
|
+
function enforceEntityPath(credentials, requestedPath) {
|
|
12588
|
+
if (!credentials.entityPath) return;
|
|
12589
|
+
const normalized = requestedPath.toLowerCase();
|
|
12590
|
+
const allowed = credentials.entityPath.toLowerCase();
|
|
12591
|
+
if (normalized !== allowed && normalized !== `${allowed}/$deadletterqueue` && !normalized.startsWith(`${allowed}/subscriptions/`)) {
|
|
12592
|
+
throw new Error(`Connection string EntityPath restricts access to ${credentials.entityPath}`);
|
|
12593
|
+
}
|
|
12594
|
+
}
|
|
12595
|
+
var BROKER_PROPERTY_NAMES = /* @__PURE__ */ new Set([
|
|
12596
|
+
"CorrelationId",
|
|
12597
|
+
"SessionId",
|
|
12598
|
+
"Label",
|
|
12599
|
+
"MessageId",
|
|
12600
|
+
"ReplyTo",
|
|
12601
|
+
"ReplyToSessionId",
|
|
12602
|
+
"To",
|
|
12603
|
+
"TimeToLive",
|
|
12604
|
+
"ScheduledEnqueueTimeUtc",
|
|
12605
|
+
"PartitionKey",
|
|
12606
|
+
"ViaPartitionKey",
|
|
12607
|
+
"ForcePersistence"
|
|
12608
|
+
]);
|
|
12609
|
+
function allowedBrokerProperties(value) {
|
|
12610
|
+
if (value === void 0) return void 0;
|
|
12611
|
+
if (!isRecord(value)) throw new Error("brokerProperties must be an object");
|
|
12612
|
+
const entries = Object.entries(value);
|
|
12613
|
+
if (entries.length > BROKER_PROPERTY_NAMES.size) throw new Error("brokerProperties contains too many fields");
|
|
12614
|
+
const result = {};
|
|
12615
|
+
for (const [key, property] of entries) {
|
|
12616
|
+
if (!BROKER_PROPERTY_NAMES.has(key)) throw new Error(`brokerProperties.${key} is not allowed`);
|
|
12617
|
+
if (!["string", "number", "boolean"].includes(typeof property) || !Number.isFinite(typeof property === "number" ? property : 0)) {
|
|
12618
|
+
throw new Error(`brokerProperties.${key} must be a finite string, number, or boolean`);
|
|
12619
|
+
}
|
|
12620
|
+
if (typeof property === "string") requiredHeaderValue(property, `brokerProperties.${key}`);
|
|
12621
|
+
result[key] = property;
|
|
12622
|
+
}
|
|
12623
|
+
return result;
|
|
12624
|
+
}
|
|
12625
|
+
var RESERVED_HEADERS = /* @__PURE__ */ new Set([
|
|
12626
|
+
"authorization",
|
|
12627
|
+
"brokerproperties",
|
|
12628
|
+
"content-length",
|
|
12629
|
+
"content-type",
|
|
12630
|
+
"host"
|
|
12631
|
+
]);
|
|
12632
|
+
function applicationPropertyHeaders(value) {
|
|
12633
|
+
if (value === void 0) return {};
|
|
12634
|
+
if (!isRecord(value)) throw new Error("applicationProperties must be an object");
|
|
12635
|
+
const entries = Object.entries(value);
|
|
12636
|
+
if (entries.length > 64) throw new Error("applicationProperties cannot contain more than 64 entries");
|
|
12637
|
+
const result = {};
|
|
12638
|
+
let size = 0;
|
|
12639
|
+
for (const [key, property] of entries) {
|
|
12640
|
+
if (!/^[A-Za-z][A-Za-z0-9-]{0,63}$/.test(key) || RESERVED_HEADERS.has(key.toLowerCase()) || key.toLowerCase().startsWith("x-ms-")) {
|
|
12641
|
+
throw new Error(`applicationProperties.${key} is not a safe header name`);
|
|
12642
|
+
}
|
|
12643
|
+
if (!["string", "number", "boolean"].includes(typeof property)) {
|
|
12644
|
+
throw new Error(`applicationProperties.${key} must be a string, number, or boolean`);
|
|
12645
|
+
}
|
|
12646
|
+
if (typeof property === "number" && !Number.isFinite(property)) {
|
|
12647
|
+
throw new Error(`applicationProperties.${key} must be finite`);
|
|
12648
|
+
}
|
|
12649
|
+
const headerValue = requiredHeaderValue(String(property), `applicationProperties.${key}`);
|
|
12650
|
+
size += Buffer.byteLength(key) + Buffer.byteLength(headerValue);
|
|
12651
|
+
if (size > 32 * 1024) throw new Error("applicationProperties exceeds 32768 bytes");
|
|
12652
|
+
result[key] = headerValue;
|
|
12653
|
+
}
|
|
12654
|
+
return result;
|
|
12655
|
+
}
|
|
12656
|
+
function responseApplicationProperties(headers) {
|
|
12657
|
+
const result = {};
|
|
12658
|
+
for (const [key, value] of headers.entries()) {
|
|
12659
|
+
if (!RESERVED_HEADERS.has(key.toLowerCase()) && !key.toLowerCase().startsWith("x-ms-") && key.toLowerCase() !== "date" && key.toLowerCase() !== "server" && key.toLowerCase() !== "transfer-encoding") result[key] = value;
|
|
12660
|
+
}
|
|
12661
|
+
return result;
|
|
12662
|
+
}
|
|
12663
|
+
function parseAtomFeed(xml) {
|
|
12664
|
+
const nextLink = xml.match(/<link\b(?=[^>]*\brel=["']next["'])(?=[^>]*\bhref=["']([^"']+)["'])[^>]*\/?>/i)?.[1];
|
|
12665
|
+
return {
|
|
12666
|
+
entries: [...xml.matchAll(/<entry\b[^>]*>([\s\S]*?)<\/entry>/gi)].map((match) => parseAtomEntry(match[0])),
|
|
12667
|
+
...nextLink ? { nextLink: decodeXml2(nextLink) } : {}
|
|
12668
|
+
};
|
|
12669
|
+
}
|
|
12670
|
+
function parseAtomEntry(xml) {
|
|
12671
|
+
const title = xmlValue(xml, "title");
|
|
12672
|
+
const id2 = xmlValue(xml, "id");
|
|
12673
|
+
const updated = xmlValue(xml, "updated");
|
|
12674
|
+
const properties = {};
|
|
12675
|
+
for (const match of xml.matchAll(/<(?:[A-Za-z0-9]+:)?([A-Za-z][A-Za-z0-9]*)\b[^>]*>([^<]*)<\/(?:[A-Za-z0-9]+:)?\1>/g)) {
|
|
12676
|
+
const key = match[1];
|
|
12677
|
+
if (["title", "id", "updated"].includes(key.toLowerCase())) continue;
|
|
12678
|
+
const raw = decodeXml2(match[2]);
|
|
12679
|
+
properties[key] = xmlScalar(raw);
|
|
12680
|
+
}
|
|
12681
|
+
return { title, id: id2, updated, properties };
|
|
12682
|
+
}
|
|
12683
|
+
function xmlValue(xml, tag) {
|
|
12684
|
+
const match = xml.match(new RegExp(`<(?:[A-Za-z0-9]+:)?${tag}\\b[^>]*>([^<]*)<\\/(?:[A-Za-z0-9]+:)?${tag}>`, "i"));
|
|
12685
|
+
return match ? decodeXml2(match[1]) : void 0;
|
|
12686
|
+
}
|
|
12687
|
+
function xmlScalar(value) {
|
|
12688
|
+
if (value === "true") return true;
|
|
12689
|
+
if (value === "false") return false;
|
|
12690
|
+
if (/^-?\d+$/.test(value)) {
|
|
12691
|
+
const parsed = Number(value);
|
|
12692
|
+
if (Number.isSafeInteger(parsed)) return parsed;
|
|
12693
|
+
}
|
|
12694
|
+
return value;
|
|
12695
|
+
}
|
|
12696
|
+
function decodeXml2(value) {
|
|
12697
|
+
return value.replace(/</g, "<").replace(/>/g, ">").replace(/"/g, '"').replace(/'/g, "'").replace(/&/g, "&");
|
|
12698
|
+
}
|
|
12699
|
+
async function readBounded(response, limit) {
|
|
12700
|
+
const declared = Number(response.headers.get("content-length"));
|
|
12701
|
+
if (Number.isFinite(declared) && declared > limit) throw new Error(`Azure Service Bus response exceeds ${limit} bytes`);
|
|
12702
|
+
if (!response.body) return new Uint8Array();
|
|
12703
|
+
const reader = response.body.getReader();
|
|
12704
|
+
const chunks = [];
|
|
12705
|
+
let size = 0;
|
|
12706
|
+
while (true) {
|
|
12707
|
+
const { done, value } = await reader.read();
|
|
12708
|
+
if (done) break;
|
|
12709
|
+
size += value.byteLength;
|
|
12710
|
+
if (size > limit) {
|
|
12711
|
+
await reader.cancel();
|
|
12712
|
+
throw new Error(`Azure Service Bus response exceeds ${limit} bytes`);
|
|
12713
|
+
}
|
|
12714
|
+
chunks.push(value);
|
|
12715
|
+
}
|
|
12716
|
+
const body = new Uint8Array(size);
|
|
12717
|
+
let offset = 0;
|
|
12718
|
+
for (const chunk of chunks) {
|
|
12719
|
+
body.set(chunk, offset);
|
|
12720
|
+
offset += chunk.byteLength;
|
|
12721
|
+
}
|
|
12722
|
+
return body;
|
|
12723
|
+
}
|
|
12724
|
+
function strictBase64(value) {
|
|
12725
|
+
if (!/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(value)) {
|
|
12726
|
+
throw new Error("content must be canonical base64 when encoding=base64");
|
|
12727
|
+
}
|
|
12728
|
+
return Buffer.from(value, "base64");
|
|
12729
|
+
}
|
|
12730
|
+
function requiredString4(value, field, allowEmpty = false) {
|
|
12731
|
+
if (typeof value !== "string" || !allowEmpty && value.trim() === "") {
|
|
12732
|
+
throw new Error(`${field} must be ${allowEmpty ? "a string" : "a non-empty string"}`);
|
|
12733
|
+
}
|
|
12734
|
+
return allowEmpty ? value : value.trim();
|
|
12735
|
+
}
|
|
12736
|
+
function requiredHeaderValue(value, field) {
|
|
12737
|
+
const parsed = requiredString4(value, field);
|
|
12738
|
+
if (/\r|\n/.test(parsed) || parsed.length > 4096) throw new Error(`${field} is not a safe header value`);
|
|
12739
|
+
return parsed;
|
|
12740
|
+
}
|
|
12741
|
+
function boundedInteger(value, field, minimum, maximum) {
|
|
12742
|
+
if (!Number.isInteger(value) || value < minimum || value > maximum) {
|
|
12743
|
+
throw new Error(`${field} must be an integer from ${minimum} to ${maximum}`);
|
|
12744
|
+
}
|
|
12745
|
+
return value;
|
|
12746
|
+
}
|
|
12747
|
+
function enumValue(value, field, choices) {
|
|
12748
|
+
if (typeof value !== "string" || !choices.includes(value)) {
|
|
12749
|
+
throw new Error(`${field} must be one of ${choices.join(", ")}`);
|
|
12750
|
+
}
|
|
12751
|
+
return value;
|
|
12752
|
+
}
|
|
12753
|
+
function decodeUtf82(value) {
|
|
12754
|
+
return new TextDecoder("utf-8", { fatal: true }).decode(value);
|
|
12755
|
+
}
|
|
12756
|
+
function retryAfterMs3(value) {
|
|
12757
|
+
if (!value) return 6e4;
|
|
12758
|
+
const seconds = Number(value);
|
|
12759
|
+
if (Number.isFinite(seconds) && seconds >= 0) return seconds * 1e3;
|
|
12760
|
+
const date = Date.parse(value);
|
|
12761
|
+
return Number.isFinite(date) ? Math.max(0, date - Date.now()) : 6e4;
|
|
12762
|
+
}
|
|
12763
|
+
function redactProviderText(value) {
|
|
12764
|
+
return value.replace(/SharedAccessSignature\s+[^\s<]+/gi, "SharedAccessSignature [redacted]").replace(/SharedAccessKey=[^;\s<]+/gi, "SharedAccessKey=[redacted]");
|
|
12765
|
+
}
|
|
12766
|
+
function isRecord(value) {
|
|
12767
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
12768
|
+
}
|
|
12769
|
+
|
|
12208
12770
|
// src/connectors/adapters/basecamp.ts
|
|
12209
12771
|
var basecampConnector = declarativeRestConnector({
|
|
12210
12772
|
kind: "basecamp",
|
|
@@ -18735,7 +19297,7 @@ var checkoutConnector = declarativeRestConnector({
|
|
|
18735
19297
|
});
|
|
18736
19298
|
|
|
18737
19299
|
// src/connectors/adapters/docuseal.ts
|
|
18738
|
-
import { createHmac as
|
|
19300
|
+
import { createHmac as createHmac4, timingSafeEqual } from "crypto";
|
|
18739
19301
|
var DEFAULT_BASE = "https://api.docuseal.com";
|
|
18740
19302
|
function readDocuSealCredentials(creds) {
|
|
18741
19303
|
if (creds.kind === "api-key" && typeof creds.apiKey === "string" && creds.apiKey.length > 0) {
|
|
@@ -18860,7 +19422,7 @@ function docuseal(opts = {}) {
|
|
|
18860
19422
|
if (!creds?.webhookSecret) return { valid: false, reason: "missing_webhook_secret" };
|
|
18861
19423
|
const sig = firstHeader(headers, "x-docuseal-signature");
|
|
18862
19424
|
if (!sig) return { valid: false, reason: "missing_signature_header" };
|
|
18863
|
-
const expected =
|
|
19425
|
+
const expected = createHmac4("sha256", creds.webhookSecret).update(rawBody).digest("hex");
|
|
18864
19426
|
const a = Buffer.from(sig.toLowerCase(), "utf-8");
|
|
18865
19427
|
const b = Buffer.from(expected, "utf-8");
|
|
18866
19428
|
if (a.length !== b.length) return { valid: false, reason: "invalid_signature" };
|
|
@@ -24433,7 +24995,7 @@ import { createHash as createHash4, createSign } from "crypto";
|
|
|
24433
24995
|
var TOKEN_URL3 = "https://oauth2.googleapis.com/token";
|
|
24434
24996
|
var API_ROOT = "https://pubsub.googleapis.com/v1";
|
|
24435
24997
|
var PUBSUB_SCOPE = "https://www.googleapis.com/auth/pubsub";
|
|
24436
|
-
var
|
|
24998
|
+
var MAX_RESPONSE_BYTES3 = 8 * 1024 * 1024;
|
|
24437
24999
|
var MAX_REQUEST_BYTES = 1e7;
|
|
24438
25000
|
var MAX_TOKEN_CACHE_ENTRIES = 256;
|
|
24439
25001
|
var tokenCache = /* @__PURE__ */ new Map();
|
|
@@ -24454,14 +25016,14 @@ var googlePubSubConnector = {
|
|
|
24454
25016
|
defaultConsistencyModel: "advisory",
|
|
24455
25017
|
rateLimit: { requests: 600, windowMs: 6e4, scope: "data-source" },
|
|
24456
25018
|
capabilities: [
|
|
24457
|
-
|
|
25019
|
+
readCapability3("topics.list", "List topics in the service account project.", {
|
|
24458
25020
|
pageSize: { type: "integer", minimum: 1, maximum: 1e3 },
|
|
24459
25021
|
pageToken: { type: "string" }
|
|
24460
25022
|
}),
|
|
24461
|
-
|
|
25023
|
+
readCapability3("topics.get", "Get one topic and its server-side configuration.", {
|
|
24462
25024
|
topic: { type: "string", description: "Topic ID in the service account project." }
|
|
24463
25025
|
}, ["topic"]),
|
|
24464
|
-
|
|
25026
|
+
mutationCapability3("topics.create", "Create a topic in the service account project.", {
|
|
24465
25027
|
topic: { type: "string" },
|
|
24466
25028
|
labels: { type: "object", additionalProperties: { type: "string" } },
|
|
24467
25029
|
allowedPersistenceRegions: { type: "array", items: { type: "string" } },
|
|
@@ -24469,10 +25031,10 @@ var googlePubSubConnector = {
|
|
|
24469
25031
|
schema: { type: "string", description: "Full Pub/Sub schema resource name." },
|
|
24470
25032
|
schemaEncoding: { type: "string", enum: ["JSON", "BINARY"] }
|
|
24471
25033
|
}, ["topic"]),
|
|
24472
|
-
|
|
25034
|
+
mutationCapability3("topics.delete", "Delete a topic. Existing subscriptions remain but stop receiving messages.", {
|
|
24473
25035
|
topic: { type: "string" }
|
|
24474
25036
|
}, ["topic"]),
|
|
24475
|
-
|
|
25037
|
+
mutationCapability3("messages.publish", "Publish up to 1,000 messages to a topic.", {
|
|
24476
25038
|
topic: { type: "string" },
|
|
24477
25039
|
messages: {
|
|
24478
25040
|
type: "array",
|
|
@@ -24481,14 +25043,14 @@ var googlePubSubConnector = {
|
|
|
24481
25043
|
description: "Messages with either text (UTF-8) or data (base64), plus optional string attributes and orderingKey."
|
|
24482
25044
|
}
|
|
24483
25045
|
}, ["topic", "messages"]),
|
|
24484
|
-
|
|
25046
|
+
readCapability3("subscriptions.list", "List subscriptions in the service account project.", {
|
|
24485
25047
|
pageSize: { type: "integer", minimum: 1, maximum: 1e3 },
|
|
24486
25048
|
pageToken: { type: "string" }
|
|
24487
25049
|
}),
|
|
24488
|
-
|
|
25050
|
+
readCapability3("subscriptions.get", "Get one subscription and its delivery configuration.", {
|
|
24489
25051
|
subscription: { type: "string" }
|
|
24490
25052
|
}, ["subscription"]),
|
|
24491
|
-
|
|
25053
|
+
mutationCapability3("subscriptions.create", "Create a pull subscription for a topic.", {
|
|
24492
25054
|
subscription: { type: "string" },
|
|
24493
25055
|
topic: { type: "string" },
|
|
24494
25056
|
ackDeadlineSeconds: { type: "integer", minimum: 10, maximum: 600 },
|
|
@@ -24504,18 +25066,18 @@ var googlePubSubConnector = {
|
|
|
24504
25066
|
enableExactlyOnceDelivery: { type: "boolean" },
|
|
24505
25067
|
labels: { type: "object", additionalProperties: { type: "string" } }
|
|
24506
25068
|
}, ["subscription", "topic"]),
|
|
24507
|
-
|
|
25069
|
+
mutationCapability3("subscriptions.delete", "Delete a subscription and discard its retained messages.", {
|
|
24508
25070
|
subscription: { type: "string" }
|
|
24509
25071
|
}, ["subscription"]),
|
|
24510
|
-
|
|
25072
|
+
mutationCapability3("messages.pull", "Pull messages and make them temporarily unavailable to other subscribers.", {
|
|
24511
25073
|
subscription: { type: "string" },
|
|
24512
25074
|
maxMessages: { type: "integer", minimum: 1, maximum: 1e3 }
|
|
24513
25075
|
}, ["subscription", "maxMessages"]),
|
|
24514
|
-
|
|
25076
|
+
mutationCapability3("messages.acknowledge", "Acknowledge delivered messages by ack ID.", {
|
|
24515
25077
|
subscription: { type: "string" },
|
|
24516
25078
|
ackIds: { type: "array", minItems: 1, maxItems: 1e3, items: { type: "string" } }
|
|
24517
25079
|
}, ["subscription", "ackIds"]),
|
|
24518
|
-
|
|
25080
|
+
mutationCapability3("messages.modifyAckDeadline", "Change the acknowledgement deadline for delivered messages.", {
|
|
24519
25081
|
subscription: { type: "string" },
|
|
24520
25082
|
ackIds: { type: "array", minItems: 1, maxItems: 1e3, items: { type: "string" } },
|
|
24521
25083
|
ackDeadlineSeconds: { type: "integer", minimum: 0, maximum: 600 }
|
|
@@ -24553,11 +25115,11 @@ var googlePubSubConnector = {
|
|
|
24553
25115
|
if (labels) body.labels = labels;
|
|
24554
25116
|
const regions2 = optionalStringArray(inv.args.allowedPersistenceRegions, "allowedPersistenceRegions");
|
|
24555
25117
|
if (regions2) body.messageStoragePolicy = { allowedPersistenceRegions: regions2 };
|
|
24556
|
-
if (inv.args.kmsKeyName !== void 0) body.kmsKeyName =
|
|
25118
|
+
if (inv.args.kmsKeyName !== void 0) body.kmsKeyName = requiredString5(inv.args.kmsKeyName, "kmsKeyName");
|
|
24557
25119
|
if (inv.args.schema !== void 0) {
|
|
24558
25120
|
body.schemaSettings = {
|
|
24559
|
-
schema:
|
|
24560
|
-
...inv.args.schemaEncoding === void 0 ? {} : { encoding:
|
|
25121
|
+
schema: requiredString5(inv.args.schema, "schema"),
|
|
25122
|
+
...inv.args.schemaEncoding === void 0 ? {} : { encoding: enumValue2(inv.args.schemaEncoding, "schemaEncoding", ["JSON", "BINARY"]) }
|
|
24561
25123
|
};
|
|
24562
25124
|
}
|
|
24563
25125
|
data4 = await pubSubRequest(credentials, inv, "PUT", topicPath(credentials, inv.args.topic), void 0, body);
|
|
@@ -24596,7 +25158,7 @@ var googlePubSubConnector = {
|
|
|
24596
25158
|
"POST",
|
|
24597
25159
|
`${subscriptionPath(credentials, inv.args.subscription)}:pull`,
|
|
24598
25160
|
void 0,
|
|
24599
|
-
{ maxMessages:
|
|
25161
|
+
{ maxMessages: boundedInteger2(inv.args.maxMessages, "maxMessages", 1, 1e3) }
|
|
24600
25162
|
);
|
|
24601
25163
|
break;
|
|
24602
25164
|
case "messages.acknowledge":
|
|
@@ -24618,7 +25180,7 @@ var googlePubSubConnector = {
|
|
|
24618
25180
|
void 0,
|
|
24619
25181
|
{
|
|
24620
25182
|
ackIds: requiredStringArray(inv.args.ackIds, "ackIds", 1e3),
|
|
24621
|
-
ackDeadlineSeconds:
|
|
25183
|
+
ackDeadlineSeconds: boundedInteger2(inv.args.ackDeadlineSeconds, "ackDeadlineSeconds", 0, 600)
|
|
24622
25184
|
}
|
|
24623
25185
|
);
|
|
24624
25186
|
break;
|
|
@@ -24647,7 +25209,7 @@ var googlePubSubConnector = {
|
|
|
24647
25209
|
}
|
|
24648
25210
|
}
|
|
24649
25211
|
};
|
|
24650
|
-
function
|
|
25212
|
+
function readCapability3(name, description, properties, required = []) {
|
|
24651
25213
|
return {
|
|
24652
25214
|
name,
|
|
24653
25215
|
class: "read",
|
|
@@ -24655,7 +25217,7 @@ function readCapability2(name, description, properties, required = []) {
|
|
|
24655
25217
|
parameters: { type: "object", properties, ...required.length ? { required } : {} }
|
|
24656
25218
|
};
|
|
24657
25219
|
}
|
|
24658
|
-
function
|
|
25220
|
+
function mutationCapability3(name, description, properties, required) {
|
|
24659
25221
|
return {
|
|
24660
25222
|
name,
|
|
24661
25223
|
class: "mutation",
|
|
@@ -24675,7 +25237,7 @@ function parseServiceAccountCredentials(credentials, dataSourceId) {
|
|
|
24675
25237
|
} catch {
|
|
24676
25238
|
throw new CredentialsExpired("Google Pub/Sub service-account key must be valid JSON", dataSourceId);
|
|
24677
25239
|
}
|
|
24678
|
-
if (!
|
|
25240
|
+
if (!isRecord2(parsed) || parsed.type !== "service_account") {
|
|
24679
25241
|
throw new CredentialsExpired("Google Pub/Sub requires a Google service_account key", dataSourceId);
|
|
24680
25242
|
}
|
|
24681
25243
|
const projectId = requiredCredentialString(parsed.project_id, "project_id", dataSourceId);
|
|
@@ -24735,8 +25297,8 @@ async function exchangeAccessToken(credentials, dataSourceId, cacheKey) {
|
|
|
24735
25297
|
body: form2
|
|
24736
25298
|
});
|
|
24737
25299
|
const body = await readJson(response, 64 * 1024);
|
|
24738
|
-
if (!response.ok || !
|
|
24739
|
-
const reason =
|
|
25300
|
+
if (!response.ok || !isRecord2(body) || typeof body.access_token !== "string" || body.access_token.trim() === "") {
|
|
25301
|
+
const reason = isRecord2(body) && typeof body.error === "string" ? body.error : void 0;
|
|
24740
25302
|
throw new CredentialsExpired("Google rejected the Pub/Sub service-account grant", dataSourceId, {
|
|
24741
25303
|
status: response.status,
|
|
24742
25304
|
reason,
|
|
@@ -24772,9 +25334,9 @@ async function pubSubRequest(credentials, inv, method, path, query2, body) {
|
|
|
24772
25334
|
},
|
|
24773
25335
|
body: serialized
|
|
24774
25336
|
});
|
|
24775
|
-
const responseBody = await readJson(response,
|
|
25337
|
+
const responseBody = await readJson(response, MAX_RESPONSE_BYTES3);
|
|
24776
25338
|
if (response.ok) return responseBody;
|
|
24777
|
-
const providerError =
|
|
25339
|
+
const providerError = isRecord2(responseBody) && isRecord2(responseBody.error) ? responseBody.error : void 0;
|
|
24778
25340
|
const reason = providerError && typeof providerError.status === "string" ? providerError.status : void 0;
|
|
24779
25341
|
if (response.status === 401) {
|
|
24780
25342
|
throw new CredentialsExpired("Google Pub/Sub credentials were rejected", inv.source.id, {
|
|
@@ -24795,7 +25357,7 @@ async function pubSubRequest(credentials, inv, method, path, query2, body) {
|
|
|
24795
25357
|
status: response.status,
|
|
24796
25358
|
reason,
|
|
24797
25359
|
body: responseBody,
|
|
24798
|
-
retryAfterMs:
|
|
25360
|
+
retryAfterMs: retryAfterMs4(response.headers.get("retry-after"))
|
|
24799
25361
|
});
|
|
24800
25362
|
}
|
|
24801
25363
|
const message = providerError && typeof providerError.message === "string" ? providerError.message : `HTTP ${response.status}`;
|
|
@@ -24811,7 +25373,7 @@ function subscriptionPath(credentials, value) {
|
|
|
24811
25373
|
return `${projectPath(credentials, "subscriptions")}/${encodeURIComponent(resourceId(value, "subscription"))}`;
|
|
24812
25374
|
}
|
|
24813
25375
|
function resourceId(value, field) {
|
|
24814
|
-
const id2 =
|
|
25376
|
+
const id2 = requiredString5(value, field);
|
|
24815
25377
|
if (!/^[A-Za-z][A-Za-z0-9._~+%-]{2,254}$/.test(id2) || id2.toLowerCase().startsWith("goog")) {
|
|
24816
25378
|
throw new Error(`${field} must be a valid Pub/Sub resource ID`);
|
|
24817
25379
|
}
|
|
@@ -24819,8 +25381,8 @@ function resourceId(value, field) {
|
|
|
24819
25381
|
}
|
|
24820
25382
|
function pagination(args) {
|
|
24821
25383
|
const query2 = new URLSearchParams();
|
|
24822
|
-
if (args.pageSize !== void 0) query2.set("pageSize", String(
|
|
24823
|
-
if (args.pageToken !== void 0) query2.set("pageToken",
|
|
25384
|
+
if (args.pageSize !== void 0) query2.set("pageSize", String(boundedInteger2(args.pageSize, "pageSize", 1, 1e3)));
|
|
25385
|
+
if (args.pageToken !== void 0) query2.set("pageToken", requiredString5(args.pageToken, "pageToken"));
|
|
24824
25386
|
return query2;
|
|
24825
25387
|
}
|
|
24826
25388
|
function subscriptionBody(credentials, args) {
|
|
@@ -24829,11 +25391,11 @@ function subscriptionBody(credentials, args) {
|
|
|
24829
25391
|
setOptionalBoolean(body, "retainAckedMessages", args.retainAckedMessages);
|
|
24830
25392
|
setOptionalDuration(body, "messageRetentionDuration", args.messageRetentionDuration);
|
|
24831
25393
|
if (args.expirationTtl !== void 0) body.expirationPolicy = { ttl: duration(args.expirationTtl, "expirationTtl") };
|
|
24832
|
-
if (args.filter !== void 0) body.filter =
|
|
25394
|
+
if (args.filter !== void 0) body.filter = requiredString5(args.filter, "filter");
|
|
24833
25395
|
if (args.deadLetterTopic !== void 0) {
|
|
24834
25396
|
body.deadLetterPolicy = {
|
|
24835
25397
|
deadLetterTopic: topicPath(credentials, args.deadLetterTopic),
|
|
24836
|
-
maxDeliveryAttempts:
|
|
25398
|
+
maxDeliveryAttempts: boundedInteger2(args.maxDeliveryAttempts, "maxDeliveryAttempts", 5, 100)
|
|
24837
25399
|
};
|
|
24838
25400
|
} else if (args.maxDeliveryAttempts !== void 0) {
|
|
24839
25401
|
throw new Error("maxDeliveryAttempts requires deadLetterTopic");
|
|
@@ -24855,15 +25417,15 @@ function publishMessages(value) {
|
|
|
24855
25417
|
throw new Error("messages must contain 1 to 1000 entries");
|
|
24856
25418
|
}
|
|
24857
25419
|
return value.map((entry, index) => {
|
|
24858
|
-
if (!
|
|
25420
|
+
if (!isRecord2(entry)) throw new Error(`messages[${index}] must be an object`);
|
|
24859
25421
|
const hasText = typeof entry.text === "string";
|
|
24860
25422
|
const hasData = typeof entry.data === "string";
|
|
24861
25423
|
if (hasText === hasData) throw new Error(`messages[${index}] requires exactly one of text or data`);
|
|
24862
|
-
const data4 = hasText ? Buffer.from(entry.text, "utf8").toString("base64") :
|
|
25424
|
+
const data4 = hasText ? Buffer.from(entry.text, "utf8").toString("base64") : strictBase642(entry.data, `messages[${index}].data`);
|
|
24863
25425
|
const message = { data: data4 };
|
|
24864
25426
|
const attributes = optionalStringMap(entry.attributes, `messages[${index}].attributes`);
|
|
24865
25427
|
if (attributes) message.attributes = attributes;
|
|
24866
|
-
if (entry.orderingKey !== void 0) message.orderingKey =
|
|
25428
|
+
if (entry.orderingKey !== void 0) message.orderingKey = requiredString5(entry.orderingKey, `messages[${index}].orderingKey`);
|
|
24867
25429
|
return message;
|
|
24868
25430
|
});
|
|
24869
25431
|
}
|
|
@@ -24904,11 +25466,11 @@ function requiredCredentialString(value, field, dataSourceId) {
|
|
|
24904
25466
|
}
|
|
24905
25467
|
return value.trim();
|
|
24906
25468
|
}
|
|
24907
|
-
function
|
|
25469
|
+
function requiredString5(value, field) {
|
|
24908
25470
|
if (typeof value !== "string" || value.trim() === "") throw new Error(`${field} must be a non-empty string`);
|
|
24909
25471
|
return value.trim();
|
|
24910
25472
|
}
|
|
24911
|
-
function
|
|
25473
|
+
function boundedInteger2(value, field, minimum, maximum) {
|
|
24912
25474
|
if (!Number.isInteger(value) || value < minimum || value > maximum) {
|
|
24913
25475
|
throw new Error(`${field} must be an integer from ${minimum} to ${maximum}`);
|
|
24914
25476
|
}
|
|
@@ -24918,7 +25480,7 @@ function requiredStringArray(value, field, maximum) {
|
|
|
24918
25480
|
if (!Array.isArray(value) || value.length < 1 || value.length > maximum) {
|
|
24919
25481
|
throw new Error(`${field} must contain 1 to ${maximum} strings`);
|
|
24920
25482
|
}
|
|
24921
|
-
return value.map((entry, index) =>
|
|
25483
|
+
return value.map((entry, index) => requiredString5(entry, `${field}[${index}]`));
|
|
24922
25484
|
}
|
|
24923
25485
|
function optionalStringArray(value, field) {
|
|
24924
25486
|
if (value === void 0) return void 0;
|
|
@@ -24926,16 +25488,16 @@ function optionalStringArray(value, field) {
|
|
|
24926
25488
|
}
|
|
24927
25489
|
function optionalStringMap(value, field) {
|
|
24928
25490
|
if (value === void 0) return void 0;
|
|
24929
|
-
if (!
|
|
25491
|
+
if (!isRecord2(value)) throw new Error(`${field} must be an object of strings`);
|
|
24930
25492
|
const entries = Object.entries(value);
|
|
24931
25493
|
if (entries.length > 64) throw new Error(`${field} cannot contain more than 64 entries`);
|
|
24932
25494
|
return Object.fromEntries(entries.map(([key, entry]) => [
|
|
24933
|
-
|
|
24934
|
-
|
|
25495
|
+
requiredString5(key, `${field} key`),
|
|
25496
|
+
requiredString5(entry, `${field}.${key}`)
|
|
24935
25497
|
]));
|
|
24936
25498
|
}
|
|
24937
25499
|
function setOptionalInteger(body, key, value, minimum, maximum) {
|
|
24938
|
-
if (value !== void 0) body[key] =
|
|
25500
|
+
if (value !== void 0) body[key] = boundedInteger2(value, key, minimum, maximum);
|
|
24939
25501
|
}
|
|
24940
25502
|
function setOptionalBoolean(body, key, value) {
|
|
24941
25503
|
if (value === void 0) return;
|
|
@@ -24946,17 +25508,17 @@ function setOptionalDuration(body, key, value) {
|
|
|
24946
25508
|
if (value !== void 0) body[key] = duration(value, key);
|
|
24947
25509
|
}
|
|
24948
25510
|
function duration(value, field) {
|
|
24949
|
-
const parsed =
|
|
25511
|
+
const parsed = requiredString5(value, field);
|
|
24950
25512
|
if (!/^\d+(?:\.\d{1,9})?s$/.test(parsed)) throw new Error(`${field} must be a protobuf duration ending in s`);
|
|
24951
25513
|
return parsed;
|
|
24952
25514
|
}
|
|
24953
|
-
function
|
|
25515
|
+
function enumValue2(value, field, choices) {
|
|
24954
25516
|
if (typeof value !== "string" || !choices.includes(value)) {
|
|
24955
25517
|
throw new Error(`${field} must be one of ${choices.join(", ")}`);
|
|
24956
25518
|
}
|
|
24957
25519
|
return value;
|
|
24958
25520
|
}
|
|
24959
|
-
function
|
|
25521
|
+
function strictBase642(value, field) {
|
|
24960
25522
|
if (!/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(value)) {
|
|
24961
25523
|
throw new Error(`${field} must be canonical base64`);
|
|
24962
25524
|
}
|
|
@@ -24965,14 +25527,14 @@ function strictBase64(value, field) {
|
|
|
24965
25527
|
function base64UrlJson(value) {
|
|
24966
25528
|
return Buffer.from(JSON.stringify(value), "utf8").toString("base64url");
|
|
24967
25529
|
}
|
|
24968
|
-
function
|
|
25530
|
+
function retryAfterMs4(value) {
|
|
24969
25531
|
if (!value) return 6e4;
|
|
24970
25532
|
const seconds = Number(value);
|
|
24971
25533
|
if (Number.isFinite(seconds) && seconds >= 0) return seconds * 1e3;
|
|
24972
25534
|
const date = Date.parse(value);
|
|
24973
25535
|
return Number.isFinite(date) ? Math.max(0, date - Date.now()) : 6e4;
|
|
24974
25536
|
}
|
|
24975
|
-
function
|
|
25537
|
+
function isRecord2(value) {
|
|
24976
25538
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
24977
25539
|
}
|
|
24978
25540
|
|
|
@@ -27875,7 +28437,7 @@ var granolaConnector = declarativeRestConnector({
|
|
|
27875
28437
|
});
|
|
27876
28438
|
|
|
27877
28439
|
// src/connectors/adapters/hellosign.ts
|
|
27878
|
-
import { createHmac as
|
|
28440
|
+
import { createHmac as createHmac5, timingSafeEqual as timingSafeEqual2 } from "crypto";
|
|
27879
28441
|
var SCOPES6 = [
|
|
27880
28442
|
"basic_account_info",
|
|
27881
28443
|
"request_signature",
|
|
@@ -28098,7 +28660,7 @@ function hellosign(opts) {
|
|
|
28098
28660
|
if (!event || typeof event.event_time !== "string" || typeof event.event_type !== "string" || typeof event.event_hash !== "string") {
|
|
28099
28661
|
return { valid: false, reason: "missing_event_fields" };
|
|
28100
28662
|
}
|
|
28101
|
-
const expected =
|
|
28663
|
+
const expected = createHmac5("sha256", source.credentials.accessToken).update(`${event.event_time}${event.event_type}`).digest("hex");
|
|
28102
28664
|
const a = Buffer.from(event.event_hash.toLowerCase(), "utf-8");
|
|
28103
28665
|
const b = Buffer.from(expected.toLowerCase(), "utf-8");
|
|
28104
28666
|
if (a.length !== b.length) return { valid: false, reason: "invalid_signature" };
|
|
@@ -40041,7 +40603,7 @@ function outlookMail(opts) {
|
|
|
40041
40603
|
async executeMutation(inv) {
|
|
40042
40604
|
const accessToken4 = await ensureFreshAccessToken13(inv.source.credentials, clientId, clientSecret, inv.onCredentialsRotated);
|
|
40043
40605
|
if (inv.capabilityName === "send_reply") return sendReply2(inv, accessToken4, timeoutMs);
|
|
40044
|
-
if (inv.capabilityName === "send_message") return
|
|
40606
|
+
if (inv.capabilityName === "send_message") return sendMessage2(inv, accessToken4, timeoutMs);
|
|
40045
40607
|
if (inv.capabilityName === "create_draft") return createDraft(inv, accessToken4, timeoutMs);
|
|
40046
40608
|
if (inv.capabilityName === "subscribe_folder") return subscribeFolder(inv, accessToken4, timeoutMs);
|
|
40047
40609
|
if (inv.capabilityName === "forward_message") return forwardMessage(inv, accessToken4, timeoutMs);
|
|
@@ -40299,7 +40861,7 @@ function buildMessagePayload(args, idempotencyKey, cap) {
|
|
|
40299
40861
|
}
|
|
40300
40862
|
return payload;
|
|
40301
40863
|
}
|
|
40302
|
-
async function
|
|
40864
|
+
async function sendMessage2(inv, accessToken4, timeoutMs) {
|
|
40303
40865
|
const args = inv.args ?? {};
|
|
40304
40866
|
const message = buildMessagePayload(args, inv.idempotencyKey, "send_message");
|
|
40305
40867
|
const res = await fetch(`${API7}/me/sendMail`, {
|
|
@@ -42715,7 +43277,7 @@ function parseRss(text) {
|
|
|
42715
43277
|
return { feedTitle: null, feedUpdated: null, entries: [], format: "rss" };
|
|
42716
43278
|
}
|
|
42717
43279
|
const channelInner = stripAllElements(channelOuter, "item");
|
|
42718
|
-
const feedTitle =
|
|
43280
|
+
const feedTitle = decodeXml3(firstTagText(channelInner, "title"));
|
|
42719
43281
|
const items = collectElements(channelOuter, "item");
|
|
42720
43282
|
const entries = items.map((item) => {
|
|
42721
43283
|
const guid = firstTagText(item, "guid");
|
|
@@ -42725,17 +43287,17 @@ function parseRss(text) {
|
|
|
42725
43287
|
const contentEncoded = firstTagText(item, "content:encoded");
|
|
42726
43288
|
const pubDate = firstTagText(item, "pubDate");
|
|
42727
43289
|
const author = firstTagText(item, "author") ?? firstTagText(item, "dc:creator");
|
|
42728
|
-
const categories = collectElements(item, "category").map((cat) =>
|
|
42729
|
-
const id2 =
|
|
43290
|
+
const categories = collectElements(item, "category").map((cat) => decodeXml3(stripTags(cat)) ?? "").filter(Boolean);
|
|
43291
|
+
const id2 = decodeXml3(guid) ?? decodeXml3(link) ?? hash(item);
|
|
42730
43292
|
return {
|
|
42731
43293
|
id: id2,
|
|
42732
|
-
title:
|
|
42733
|
-
link:
|
|
42734
|
-
summary:
|
|
42735
|
-
content:
|
|
42736
|
-
published: normalizeDate(
|
|
43294
|
+
title: decodeXml3(title),
|
|
43295
|
+
link: decodeXml3(link),
|
|
43296
|
+
summary: decodeXml3(description),
|
|
43297
|
+
content: decodeXml3(contentEncoded),
|
|
43298
|
+
published: normalizeDate(decodeXml3(pubDate)),
|
|
42737
43299
|
updated: null,
|
|
42738
|
-
author:
|
|
43300
|
+
author: decodeXml3(author),
|
|
42739
43301
|
categories
|
|
42740
43302
|
};
|
|
42741
43303
|
});
|
|
@@ -42744,17 +43306,17 @@ function parseRss(text) {
|
|
|
42744
43306
|
function parseAtom(text, feedUrl) {
|
|
42745
43307
|
const feedOuter = extractFirstElement(text, "feed") ?? text;
|
|
42746
43308
|
const feedInner = stripAllElements(feedOuter, "entry");
|
|
42747
|
-
const feedTitle =
|
|
42748
|
-
const feedUpdated = normalizeDate(
|
|
43309
|
+
const feedTitle = decodeXml3(firstTagText(feedInner, "title"));
|
|
43310
|
+
const feedUpdated = normalizeDate(decodeXml3(firstTagText(feedInner, "updated")));
|
|
42749
43311
|
const items = collectElements(feedOuter, "entry");
|
|
42750
43312
|
const entries = items.map((item) => {
|
|
42751
|
-
const id2 =
|
|
42752
|
-
const title =
|
|
42753
|
-
const summary =
|
|
43313
|
+
const id2 = decodeXml3(firstTagText(item, "id"));
|
|
43314
|
+
const title = decodeXml3(firstTagText(item, "title"));
|
|
43315
|
+
const summary = decodeXml3(firstTagText(item, "summary"));
|
|
42754
43316
|
const contentNode = firstTagText(item, "content");
|
|
42755
|
-
const published = normalizeDate(
|
|
42756
|
-
const updated = normalizeDate(
|
|
42757
|
-
const author =
|
|
43317
|
+
const published = normalizeDate(decodeXml3(firstTagText(item, "published")));
|
|
43318
|
+
const updated = normalizeDate(decodeXml3(firstTagText(item, "updated")));
|
|
43319
|
+
const author = decodeXml3(firstTagText(extractFirstElement(item, "author") ?? "", "name")) ?? decodeXml3(firstTagText(item, "author"));
|
|
42758
43320
|
const link = pickAtomLink(item);
|
|
42759
43321
|
const categories = collectAtomCategories(item);
|
|
42760
43322
|
return {
|
|
@@ -42762,7 +43324,7 @@ function parseAtom(text, feedUrl) {
|
|
|
42762
43324
|
title,
|
|
42763
43325
|
link,
|
|
42764
43326
|
summary,
|
|
42765
|
-
content:
|
|
43327
|
+
content: decodeXml3(contentNode),
|
|
42766
43328
|
published,
|
|
42767
43329
|
updated,
|
|
42768
43330
|
author,
|
|
@@ -42848,9 +43410,9 @@ function collectAtomCategories(entryOuter) {
|
|
|
42848
43410
|
let m;
|
|
42849
43411
|
while ((m = re.exec(entryOuter)) !== null) {
|
|
42850
43412
|
const term = readAttr(m[1] ?? "", "term");
|
|
42851
|
-
if (term) out.push(
|
|
43413
|
+
if (term) out.push(decodeXml3(term) ?? "");
|
|
42852
43414
|
else if (m[2]) {
|
|
42853
|
-
const inner =
|
|
43415
|
+
const inner = decodeXml3(stripTags(m[2]));
|
|
42854
43416
|
if (inner) out.push(inner);
|
|
42855
43417
|
}
|
|
42856
43418
|
}
|
|
@@ -42878,7 +43440,7 @@ function unwrapCdata(value) {
|
|
|
42878
43440
|
out += value.slice(lastIdx);
|
|
42879
43441
|
return out;
|
|
42880
43442
|
}
|
|
42881
|
-
function
|
|
43443
|
+
function decodeXml3(value) {
|
|
42882
43444
|
if (value === null) return null;
|
|
42883
43445
|
const trimmed = value.trim();
|
|
42884
43446
|
if (trimmed.length === 0) return null;
|
|
@@ -52665,17 +53227,17 @@ var zohoBookingsConnector = {
|
|
|
52665
53227
|
category: "calendar",
|
|
52666
53228
|
defaultConsistencyModel: "authoritative",
|
|
52667
53229
|
capabilities: [
|
|
52668
|
-
|
|
52669
|
-
|
|
53230
|
+
readCapability4("workspaces.list", "List Zoho Bookings workspaces.", {}),
|
|
53231
|
+
readCapability4("services.list", "List services, optionally within one workspace.", {
|
|
52670
53232
|
workspace_id: { type: "string" }
|
|
52671
53233
|
}),
|
|
52672
|
-
|
|
53234
|
+
readCapability4("resources.list", "List bookable resources, optionally for one service.", {
|
|
52673
53235
|
service_id: { type: "string" }
|
|
52674
53236
|
}),
|
|
52675
|
-
|
|
53237
|
+
readCapability4("staff.list", "List staff, optionally for one service.", {
|
|
52676
53238
|
service_id: { type: "string" }
|
|
52677
53239
|
}),
|
|
52678
|
-
|
|
53240
|
+
readCapability4("appointments.list", "List appointments from a required start time.", {
|
|
52679
53241
|
from_time: {
|
|
52680
53242
|
type: "string",
|
|
52681
53243
|
description: "Zoho timestamp in dd-MMM-yyyy HH:mm:ss format."
|
|
@@ -52685,17 +53247,17 @@ var zohoBookingsConnector = {
|
|
|
52685
53247
|
staff_id: { type: "string" },
|
|
52686
53248
|
status: { type: "string" }
|
|
52687
53249
|
}, ["from_time"]),
|
|
52688
|
-
|
|
53250
|
+
readCapability4("appointments.get", "Read one appointment by booking id.", {
|
|
52689
53251
|
booking_id: { type: "string" }
|
|
52690
53252
|
}, ["booking_id"]),
|
|
52691
|
-
|
|
53253
|
+
readCapability4("availability.fetch", "Fetch open time slots for a service and date.", {
|
|
52692
53254
|
service_id: { type: "string" },
|
|
52693
53255
|
selected_date: { type: "string", description: "Date in YYYY-MM-DD format." },
|
|
52694
53256
|
staff_id: { type: "string" },
|
|
52695
53257
|
group_id: { type: "string" },
|
|
52696
53258
|
resource_id: { type: "string" }
|
|
52697
53259
|
}, ["service_id", "selected_date"]),
|
|
52698
|
-
|
|
53260
|
+
mutationCapability4("appointments.book", "Book an appointment for a customer.", {
|
|
52699
53261
|
service_id: { type: "string" },
|
|
52700
53262
|
from_time: { type: "string", description: "Zoho timestamp in dd-MMM-yyyy HH:mm:ss format." },
|
|
52701
53263
|
customer_details: {
|
|
@@ -52711,13 +53273,13 @@ var zohoBookingsConnector = {
|
|
|
52711
53273
|
additional_fields: { type: "object" },
|
|
52712
53274
|
payment_info: { type: "object" }
|
|
52713
53275
|
}, ["service_id", "from_time", "customer_details"]),
|
|
52714
|
-
|
|
53276
|
+
mutationCapability4("appointments.reschedule", "Move an appointment to a new time, staff member, or group.", {
|
|
52715
53277
|
booking_id: { type: "string" },
|
|
52716
53278
|
start_time: { type: "string", description: "Zoho timestamp in dd-MMM-yyyy HH:mm:ss format." },
|
|
52717
53279
|
staff_id: { type: "string" },
|
|
52718
53280
|
group_id: { type: "string" }
|
|
52719
53281
|
}, ["booking_id"]),
|
|
52720
|
-
|
|
53282
|
+
mutationCapability4("appointments.cancel", "Cancel an appointment by booking id.", {
|
|
52721
53283
|
booking_id: { type: "string" }
|
|
52722
53284
|
}, ["booking_id"])
|
|
52723
53285
|
]
|
|
@@ -52834,7 +53396,7 @@ var zohoBookingsConnector = {
|
|
|
52834
53396
|
}
|
|
52835
53397
|
}
|
|
52836
53398
|
};
|
|
52837
|
-
function
|
|
53399
|
+
function readCapability4(name, description, properties, required = []) {
|
|
52838
53400
|
return {
|
|
52839
53401
|
name,
|
|
52840
53402
|
class: "read",
|
|
@@ -52843,7 +53405,7 @@ function readCapability3(name, description, properties, required = []) {
|
|
|
52843
53405
|
requiredScopes: ["zohobookings.data.READ"]
|
|
52844
53406
|
};
|
|
52845
53407
|
}
|
|
52846
|
-
function
|
|
53408
|
+
function mutationCapability4(name, description, properties, required) {
|
|
52847
53409
|
return {
|
|
52848
53410
|
name,
|
|
52849
53411
|
class: "mutation",
|
|
@@ -52898,7 +53460,7 @@ async function request2(source, path, options) {
|
|
|
52898
53460
|
throw new ProviderRateLimited("Zoho Bookings rate limit (429)", source.id, {
|
|
52899
53461
|
status: 429,
|
|
52900
53462
|
body: responseBody,
|
|
52901
|
-
retryAfterMs:
|
|
53463
|
+
retryAfterMs: retryAfterMs5(response.headers.get("retry-after"))
|
|
52902
53464
|
});
|
|
52903
53465
|
}
|
|
52904
53466
|
if (!response.ok) throw new Error(`zoho-bookings ${options.method} ${path} HTTP ${response.status}`);
|
|
@@ -52943,7 +53505,7 @@ function exactlyOne(args, keys, label) {
|
|
|
52943
53505
|
const present = keys.filter((key) => args[key] !== void 0 && args[key] !== null && args[key] !== "");
|
|
52944
53506
|
if (present.length !== 1) throw new Error(`zoho-bookings: exactly one ${label} is required`);
|
|
52945
53507
|
}
|
|
52946
|
-
function
|
|
53508
|
+
function retryAfterMs5(value) {
|
|
52947
53509
|
if (!value) return 6e4;
|
|
52948
53510
|
const seconds = Number(value);
|
|
52949
53511
|
return Number.isFinite(seconds) && seconds >= 0 ? Math.max(1e3, seconds * 1e3) : 6e4;
|
|
@@ -54082,11 +54644,11 @@ async function request3(source, path, options) {
|
|
|
54082
54644
|
});
|
|
54083
54645
|
}
|
|
54084
54646
|
if (response.status === 429) {
|
|
54085
|
-
const
|
|
54647
|
+
const retryAfterMs6 = parseRetryAfter(response.headers.get("retry-after"));
|
|
54086
54648
|
throw new ProviderRateLimited("Zoho Campaigns rate limit (429)", source.id, {
|
|
54087
54649
|
status: 429,
|
|
54088
54650
|
body: responseBody,
|
|
54089
|
-
retryAfterMs:
|
|
54651
|
+
retryAfterMs: retryAfterMs6
|
|
54090
54652
|
});
|
|
54091
54653
|
}
|
|
54092
54654
|
if (!response.ok) {
|
|
@@ -61746,6 +62308,7 @@ var CONNECTOR_ADAPTER_FACTORIES = [
|
|
|
61746
62308
|
defineFactoryAdapter(() => googleCloudStorageConnector, googleOAuthEnvMap),
|
|
61747
62309
|
defineFactoryAdapter(() => googlePubSubConnector, {}),
|
|
61748
62310
|
defineFactoryAdapter(() => azureBlobStorageConnector, {}),
|
|
62311
|
+
defineFactoryAdapter(() => azureServiceBusConnector, {}),
|
|
61749
62312
|
defineFactoryAdapter(() => backblazeConnector, {}),
|
|
61750
62313
|
defineFactoryAdapter(() => cloudinaryConnector, {}),
|
|
61751
62314
|
defineFactoryAdapter(() => codaConnector, {}),
|
|
@@ -62519,11 +63082,11 @@ function validateOutboundStartArgs(args) {
|
|
|
62519
63082
|
assertNonEmptyString(args.agentId, "agentId", 128);
|
|
62520
63083
|
assertE164(args.toNumber, "toNumber");
|
|
62521
63084
|
assertE164(args.fromNumber, "fromNumber");
|
|
62522
|
-
if (!
|
|
63085
|
+
if (!isRecord3(args.mission)) throw new Error("phony start_outbound_call requires mission");
|
|
62523
63086
|
const mission = args.mission;
|
|
62524
63087
|
assertNonEmptyString(mission.goal, "mission.goal", 2e3);
|
|
62525
63088
|
if (mission.goal.trim().length < 8) throw new Error("phony start_outbound_call mission.goal must be at least 8 characters");
|
|
62526
|
-
if (mission.successSchema !== void 0 && !
|
|
63089
|
+
if (mission.successSchema !== void 0 && !isRecord3(mission.successSchema)) {
|
|
62527
63090
|
throw new Error("phony start_outbound_call mission.successSchema must be an object when supplied");
|
|
62528
63091
|
}
|
|
62529
63092
|
if (mission.ivrHints !== void 0) {
|
|
@@ -62537,7 +63100,7 @@ function validateOutboundStartArgs(args) {
|
|
|
62537
63100
|
if (args.missionId !== void 0) assertNonEmptyString(args.missionId, "missionId", 128);
|
|
62538
63101
|
if (args.voiceCloneId !== void 0) assertNonEmptyString(args.voiceCloneId, "voiceCloneId", 128);
|
|
62539
63102
|
if (args.callerProfile !== void 0) {
|
|
62540
|
-
if (!
|
|
63103
|
+
if (!isRecord3(args.callerProfile)) throw new Error("phony start_outbound_call callerProfile must be an object");
|
|
62541
63104
|
if (args.callerProfile.userName !== void 0) assertNonEmptyString(args.callerProfile.userName, "callerProfile.userName", 120);
|
|
62542
63105
|
if (args.callerProfile.companyName !== void 0) {
|
|
62543
63106
|
assertNonEmptyString(args.callerProfile.companyName, "callerProfile.companyName", 120);
|
|
@@ -62564,7 +63127,7 @@ function assertOptionalInteger(value, field, min, max) {
|
|
|
62564
63127
|
throw new Error(`phony start_outbound_call ${field} must be an integer between ${min} and ${max}`);
|
|
62565
63128
|
}
|
|
62566
63129
|
}
|
|
62567
|
-
function
|
|
63130
|
+
function isRecord3(value) {
|
|
62568
63131
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
62569
63132
|
}
|
|
62570
63133
|
async function getJson(inv, token, url, label) {
|
|
@@ -62636,7 +63199,7 @@ var INGEST_FIELDS = [
|
|
|
62636
63199
|
];
|
|
62637
63200
|
|
|
62638
63201
|
// src/connectors/adapters/webhook.ts
|
|
62639
|
-
import { createHmac as
|
|
63202
|
+
import { createHmac as createHmac6 } from "crypto";
|
|
62640
63203
|
var webhookConnector = {
|
|
62641
63204
|
manifest: {
|
|
62642
63205
|
kind: "webhook",
|
|
@@ -62750,7 +63313,7 @@ function signHeaders(creds, body, idempotencyKey) {
|
|
|
62750
63313
|
"x-phony-idempotency-key": idempotencyKey
|
|
62751
63314
|
};
|
|
62752
63315
|
if (creds.kind === "hmac" && typeof creds.secret === "string" && creds.secret.length > 0) {
|
|
62753
|
-
const sig =
|
|
63316
|
+
const sig = createHmac6("sha256", creds.secret).update(`${ts}.${body}`).digest("hex");
|
|
62754
63317
|
headers["x-phony-signature"] = `sha256=${sig}`;
|
|
62755
63318
|
}
|
|
62756
63319
|
return headers;
|
|
@@ -141686,6 +142249,7 @@ export {
|
|
|
141686
142249
|
avalaraConnector,
|
|
141687
142250
|
azureAdConnector,
|
|
141688
142251
|
azureBlobStorageConnector,
|
|
142252
|
+
azureServiceBusConnector,
|
|
141689
142253
|
basecampConnector,
|
|
141690
142254
|
backblazeConnector,
|
|
141691
142255
|
biginByZohoConnector,
|
|
@@ -142254,4 +142818,4 @@ export {
|
|
|
142254
142818
|
demandbaseConnector,
|
|
142255
142819
|
adapters_exports
|
|
142256
142820
|
};
|
|
142257
|
-
//# sourceMappingURL=chunk-
|
|
142821
|
+
//# sourceMappingURL=chunk-EXPZGJ4A.js.map
|