@jskit-ai/connectors-catalog 0.2.40 → 0.2.42

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (81) hide show
  1. package/CHANGELOG.md +1 -0
  2. package/docs/linkedin.md +3 -1
  3. package/docs/oura.md +4 -1
  4. package/package.json +3 -3
  5. package/patterns/api-key-connection/PATTERN.md +4 -1
  6. package/patterns/api-key-connection/example/connections.js +3 -3
  7. package/patterns/firebase-messaging/example/server/notifications.js +3 -3
  8. package/patterns/oauth-connection/PATTERN.md +3 -1
  9. package/src/server/sideEffect.js +1 -1
  10. package/test/airtable.test.js +1 -0
  11. package/test/algolia.test.js +4 -4
  12. package/test/amazon-redshift.test.js +7 -7
  13. package/test/amplitude.test.js +3 -3
  14. package/test/apify.test.js +1 -0
  15. package/test/apollo-io.test.js +1 -0
  16. package/test/asana.test.js +1 -1
  17. package/test/ashby.test.js +1 -1
  18. package/test/atlassian.test.js +3 -3
  19. package/test/attention.test.js +1 -1
  20. package/test/aws.test.js +13 -13
  21. package/test/brevo.test.js +1 -1
  22. package/test/calendly.test.js +3 -3
  23. package/test/canva.test.js +3 -3
  24. package/test/chargebee.test.js +4 -4
  25. package/test/clickhouse.test.js +10 -10
  26. package/test/confidence.test.js +5 -5
  27. package/test/databricks.test.js +7 -7
  28. package/test/dbt-semantic-layer.test.js +3 -3
  29. package/test/designMcp.test.js +4 -4
  30. package/test/elevenlabs.test.js +1 -0
  31. package/test/firebase-cloud-messaging.test.js +4 -4
  32. package/test/firecrawl.test.js +1 -0
  33. package/test/gemini-enterprise.test.js +4 -4
  34. package/test/github-api.test.js +3 -2
  35. package/test/gitlab-api.test.js +5 -4
  36. package/test/gong.test.js +4 -4
  37. package/test/google-ads.test.js +9 -9
  38. package/test/google-maps-platform.test.js +3 -3
  39. package/test/google.test.js +5 -5
  40. package/test/granola.test.js +5 -5
  41. package/test/hex.test.js +3 -3
  42. package/test/heygen.test.js +3 -3
  43. package/test/hubspot.test.js +2 -2
  44. package/test/inngest.test.js +4 -4
  45. package/test/lightspeed.test.js +6 -6
  46. package/test/linear.test.js +3 -3
  47. package/test/linkedin.test.js +6 -6
  48. package/test/logo-dev.test.js +1 -1
  49. package/test/mailgun.test.js +1 -1
  50. package/test/mapbox.test.js +3 -3
  51. package/test/mcp.test.js +5 -5
  52. package/test/microsoft-fabric.test.js +7 -7
  53. package/test/microsoft.test.js +5 -5
  54. package/test/n8nOAuth.test.js +4 -4
  55. package/test/notionOAuth.test.js +6 -6
  56. package/test/oura.test.js +5 -5
  57. package/test/paddlePermissions.test.js +2 -1
  58. package/test/pipedriveOAuth.test.js +1 -1
  59. package/test/posthog.test.js +4 -4
  60. package/test/prestashop.test.js +6 -6
  61. package/test/resend.test.js +1 -1
  62. package/test/salesforce.test.js +8 -8
  63. package/test/semrush.test.js +10 -10
  64. package/test/shopify.test.js +10 -10
  65. package/test/slack.test.js +5 -5
  66. package/test/snowflake.test.js +7 -7
  67. package/test/tally.test.js +1 -0
  68. package/test/telegram.test.js +1 -1
  69. package/test/tiktok.test.js +7 -7
  70. package/test/tokens.test.js +18 -18
  71. package/test/twilio.test.js +5 -5
  72. package/test/twitch.test.js +4 -4
  73. package/test/wave.test.js +5 -5
  74. package/test/wix.test.js +4 -4
  75. package/test/wordpress-com.test.js +3 -3
  76. package/test/wordpress.test.js +5 -5
  77. package/test/workday.test.js +4 -4
  78. package/test/x-twitter.test.js +5 -5
  79. package/test/xero.test.js +18 -18
  80. package/test/zoho-books.test.js +5 -5
  81. package/test/zoho-crm.test.js +5 -5
@@ -125,7 +125,7 @@ async function fixture(t, entry) {
125
125
  }
126
126
  };
127
127
  const input = { context: { applicationId: "app-one", subjectId: "account-one" }, integrationId: "source" };
128
- return { service: createConnectionService({ ...options, sideEffects: "live" }), options, directory, protection, input, state, requests };
128
+ return { service: createConnectionService({ ...options, appEnv: "production" }), options, directory, protection, input, state, requests };
129
129
  }
130
130
 
131
131
  for (const entry of cases) {
@@ -145,7 +145,7 @@ for (const entry of cases) {
145
145
  assert.equal(first.init.redirect, "error");
146
146
  for (const [header, value] of Object.entries(entry.extraHeaders || {})) assert.equal(first.headers.get(header), value);
147
147
  for (const name of await readdir(directory)) assert.equal((await readFile(path.join(directory, name), "utf8")).includes(state.key), false);
148
- const restarted = createConnectionService({ sideEffects: "live", ...options, store: createFileConnectionStore({ directory, protection }) });
148
+ const restarted = createConnectionService({ appEnv: "production", ...options, store: createFileConnectionStore({ directory, protection }) });
149
149
  assert.equal((await restarted.status(input)).status, "connected");
150
150
  state.response = entry.operationResponse || entry.response;
151
151
  state.key = entry.rotatedKey || "rotated-fixture-key";
@@ -224,7 +224,7 @@ test("Clay advances only explicitly requested query pages and validates each res
224
224
  test("Clay search policy, billing failure and interrupted iterators never replay a request", async (t) => {
225
225
  const { service, options, input, state, requests } = await fixture(t, cases.find(({ provider }) => provider === clayProvider));
226
226
  await service.connectApiKey(input);
227
- const restricted = createConnectionService({ sideEffects: "live", ...options, authorize: async (owner, request) =>
227
+ const restricted = createConnectionService({ appEnv: "production", ...options, authorize: async (owner, request) =>
228
228
  request.operation === "searches.create" || request.operation === "searches.next" && request.input.searchId !== "search-1" ? null : owner });
229
229
  await assert.rejects(restricted.invoke({ ...input, operation: "searches.create", input: { query: "anything" } }), { code: "connector_access_denied" });
230
230
  await assert.rejects(restricted.invoke({ ...input, operation: "searches.next", input: { searchId: "another-search" } }), { code: "connector_access_denied" });
@@ -240,7 +240,7 @@ test("Clay search policy, billing failure and interrupted iterators never replay
240
240
  let started;
241
241
  const pendingRequest = new Promise((resolve) => { started = resolve; });
242
242
  let attempts = 0;
243
- const interrupted = createConnectionService({ sideEffects: "live", ...options, fetchImpl: async (_url, init) => {
243
+ const interrupted = createConnectionService({ appEnv: "production", ...options, fetchImpl: async (_url, init) => {
244
244
  attempts += 1;
245
245
  init.signal.throwIfAborted();
246
246
  started();
@@ -283,7 +283,7 @@ test("Clay runs approved routines and queries Enterprise tables without replay o
283
283
  ["routines.run", { routineId: "x", items: [{ id: "x" }] }], ["tables.query", { query: { tables: [] } }],
284
284
  ["tables.query", { query, limit: 101 }], ["tables.query", { query: { ...query, url: "https://other.test" } }]])
285
285
  await assert.rejects(invoke(operation, values), { code: "connector_input_invalid" });
286
- const restricted = createConnectionService({ sideEffects: "live", ...options, authorize: async (owner, request) => request.operation === "routines.run" ? null : owner });
286
+ const restricted = createConnectionService({ appEnv: "production", ...options, authorize: async (owner, request) => request.operation === "routines.run" ? null : owner });
287
287
  await assert.rejects(restricted.invoke({ ...input, operation: "routines.run", input: { routineId: "x", items } }), { code: "connector_access_denied" });
288
288
  assert.equal(requests.length, count);
289
289
  state.response = { status: "complete" };
@@ -302,7 +302,7 @@ test("regional connections require re-verification before changing their provide
302
302
  await service.connectApiKey(input);
303
303
  const config = structuredClone(options.configuration);
304
304
  config.integrations.source.settings = { [setting]: alternative };
305
- const changed = createConnectionService({ sideEffects: "live", ...options, configuration: config });
305
+ const changed = createConnectionService({ appEnv: "production", ...options, configuration: config });
306
306
  assert.equal((await changed.status(input)).status, "reconnect-required");
307
307
  await assert.rejects(changed.invoke({ ...input, operation: provider.checkOperation }), { code: "connector_reconnect_required" });
308
308
  assert.equal(requests.length, 1);
@@ -313,7 +313,7 @@ test("regional connections require re-verification before changing their provide
313
313
  assert.equal((await service.status(input)).status, "reconnect-required");
314
314
  config.integrations.source.settings[setting] = "https://attacker.invalid";
315
315
  const count = requests.length;
316
- assert.throws(() => createConnectionService({ sideEffects: "live", ...options, configuration: config }), { code: "integration_configuration_invalid" });
316
+ assert.throws(() => createConnectionService({ appEnv: "production", ...options, configuration: config }), { code: "integration_configuration_invalid" });
317
317
  assert.equal(requests.length, count);
318
318
  }
319
319
  });
@@ -327,7 +327,7 @@ test("Storyblok supports all space regions and requires explicit draft reads wit
327
327
  ]) {
328
328
  const config = structuredClone(options.configuration);
329
329
  config.integrations.source.settings = { region };
330
- const regional = createConnectionService({ sideEffects: "live", ...options, configuration: config });
330
+ const regional = createConnectionService({ appEnv: "production", ...options, configuration: config });
331
331
  state.response = entry.response;
332
332
  await regional.connectApiKey(input);
333
333
  assert.equal(requests.at(-1).url.host, host);
@@ -369,7 +369,7 @@ test("Storyblok delivers one page with resolved content and keeps private previe
369
369
  assert.equal(request.url.pathname, "/v2/cdn/stories/bookings/groom%20%26%20wash");
370
370
  assert.deepEqual(Object.fromEntries(request.url.searchParams), { version: "published", cv: "42",
371
371
  resolve_relations: "page.author", resolve_links: "url", resolve_assets: "1", token: f.state.key });
372
- const restricted = createConnectionService({ sideEffects: "live", ...f.options, authorize: async (owner, request) => request.input?.version === "draft" ? null : owner });
372
+ const restricted = createConnectionService({ appEnv: "production", ...f.options, authorize: async (owner, request) => request.input?.version === "draft" ? null : owner });
373
373
  const before = f.requests.length;
374
374
  await assert.rejects(restricted.invoke({ ...f.input, operation: "stories.get", input: { id: "home", version: "draft" } }), { code: "connector_access_denied" });
375
375
  for (const id of ["../private", "a/../private", "a//b", "/home"]) {
@@ -583,7 +583,7 @@ test("Lexware reads accounting resources and creates explicit draft invoices wit
583
583
  { ...draft, voucherDate: "2026-02-30T00:00:00Z" }, { ...draft, lineItems: [{ ...draft.lineItems[0], netAmount: -1 }] },
584
584
  { ...draft, lineItems: [{ ...draft.lineItems[0], taxRatePercentage: 101 }] }, { ...draft, lineItems: [{ ...draft.lineItems[0], currency: "USD" }] }])
585
585
  await assert.rejects(service.invoke({ ...input, operation: "invoices.createDraft", input: invalid }), { code: "connector_input_invalid" });
586
- const restricted = createConnectionService({ sideEffects: "live", ...options, authorize: async (owner, request) => request.operation === "invoices.createDraft" ? null : owner });
586
+ const restricted = createConnectionService({ appEnv: "production", ...options, authorize: async (owner, request) => request.operation === "invoices.createDraft" ? null : owner });
587
587
  await assert.rejects(restricted.invoke({ ...input, operation: "invoices.createDraft", input: draft }), { code: "connector_access_denied" });
588
588
  assert.equal(requests.length, before);
589
589
  state.response = {};
@@ -779,10 +779,10 @@ test("Contentful uses the selected delivery space and rejects invalid settings b
779
779
  } });
780
780
  for (const settings of [{}, { spaceId: "../other" }, { spaceId: "space-one", environmentId: "../../other" },
781
781
  { spaceId: "space-one", region: "elsewhere" }]) {
782
- assert.throws(() => createConnectionService({ ...configured(settings), sideEffects: "live" }));
782
+ assert.throws(() => createConnectionService({ ...configured(settings), appEnv: "production" }));
783
783
  }
784
784
  assert.equal(requests.length, 0);
785
- const service = createConnectionService({ ...configured({ spaceId: "space-one", environmentId: "preview-2", region: "eu" }), sideEffects: "live" });
785
+ const service = createConnectionService({ ...configured({ spaceId: "space-one", environmentId: "preview-2", region: "eu" }), appEnv: "production" });
786
786
  await service.connectApiKey(input);
787
787
  assert.equal(requests[0].url.href, "https://cdn.eu.contentful.com/spaces/space-one/environments/preview-2/entries?limit=1&skip=0");
788
788
  assert.equal(requests[0].headers.get("authorization"), "Bearer private-fixture-key");
@@ -863,7 +863,7 @@ test("HubSpot leads become linked deals and advance through a pipeline with app-
863
863
  const entry = cases.find(item => item.provider.id === "hubspot");
864
864
  const f = await fixture(t, { ...entry, scopes: hubspotProvider.scopes.map(scope => scope.value) });
865
865
  const calls = [];
866
- const service = createConnectionService({ sideEffects: "live", ...f.options,
866
+ const service = createConnectionService({ appEnv: "production", ...f.options,
867
867
  authorize: async (owner, request) => request.operation === "deals.update" && request.input.id !== "202" ? null : owner,
868
868
  fetchImpl: async (address, init) => {
869
869
  const url = new URL(address), body = init.body ? JSON.parse(init.body) : undefined;
@@ -906,7 +906,7 @@ test("HubSpot leads become linked deals and advance through a pipeline with app-
906
906
  ["deals.associateContact", { contactId: "101/other", dealId: "202" }]
907
907
  ]) await assert.rejects(invoke(operation, input));
908
908
  assert.equal(calls.length, before);
909
- const limited = createConnectionService({ sideEffects: "live", ...f.options, configuration: { ...f.options.configuration,
909
+ const limited = createConnectionService({ appEnv: "production", ...f.options, configuration: { ...f.options.configuration,
910
910
  integrations: { source: { ...f.options.configuration.integrations.source, scopes: ["crm.objects.contacts.read"] } } } });
911
911
  await assert.rejects(limited.invoke({ ...f.input, operation: "deals.create", input: { properties: { dealname: "Denied", dealstage: "won" } } }), { code: "connector_scope_missing" });
912
912
  assert.equal(hubspotProvider.operations["contacts.create"].validateResult({ status: "error" }), false);
@@ -917,7 +917,7 @@ test("incident.io incident recovery covers follow-ups, alerts, schedules and cat
917
917
  const f = await fixture(t, cases.find(item => item.provider.id === "incident-io"));
918
918
  const calls = [];
919
919
  let rejected = false;
920
- const service = createConnectionService({ sideEffects: "live", ...f.options,
920
+ const service = createConnectionService({ appEnv: "production", ...f.options,
921
921
  authorize: async (owner, request) => request.operation === "alerts.resolve" && request.input.id !== "alert-one" ? null : owner,
922
922
  fetchImpl: async (address, init) => {
923
923
  const url = new URL(address), body = init.body ? JSON.parse(init.body) : undefined;
@@ -1005,7 +1005,7 @@ test("Notion reads content and data sources then creates and updates a note with
1005
1005
  for (const [op, values] of [["pages.get", { id: "../users" }], ["blocks.append", { id, children: [] }],
1006
1006
  ["blocks.append", { id, children: Array(101).fill(children[0]) }], ["pages.update", { id, properties: { x: "x".repeat(65536) } }]])
1007
1007
  await assert.rejects(invoke(op, values), { code: "connector_input_invalid" });
1008
- const restricted = createConnectionService({ sideEffects: "live", ...options, authorize: async (owner, request) => request.operation === "pages.create" ? null : owner });
1008
+ const restricted = createConnectionService({ appEnv: "production", ...options, authorize: async (owner, request) => request.operation === "pages.create" ? null : owner });
1009
1009
  await assert.rejects(restricted.invoke({ ...input, operation: "pages.create", input: { parentId: id, parentType: "page_id", properties } }), { code: "connector_access_denied" });
1010
1010
  assert.equal(requests.length, before);
1011
1011
  for (const status of [403, 404, 429, 500]) { state.status = status; const count = requests.length; await assert.rejects(invoke("blocks.append", { id, children })); assert.equal(requests.length, count + 1); }
@@ -1036,7 +1036,7 @@ test("Pipedrive token CRM reads and writes use its configured company and preser
1036
1036
  const count = requests.length;
1037
1037
  for (const [op, values] of [["deals.get", { id: "../other" }], ["leads.create", { title: "No contact" }], ["deals.update", { id: 1 }], ["persons.create", { name: "X", emails: Array(21).fill({ value: "x@y.test" }) }]])
1038
1038
  await assert.rejects(invoke(op, values), { code: "connector_input_invalid" });
1039
- const denied = createConnectionService({ sideEffects: "live", ...options, authorize: async (owner, request) => request.operation === "deals.create" ? null : owner });
1039
+ const denied = createConnectionService({ appEnv: "production", ...options, authorize: async (owner, request) => request.operation === "deals.create" ? null : owner });
1040
1040
  await assert.rejects(denied.invoke({ ...input, operation: "deals.create", input: { title: "Denied" } }), { code: "connector_access_denied" });
1041
1041
  assert.equal(requests.length, count);
1042
1042
  for (const status of [403, 429, 500]) { state.status = status; const before = requests.length; await assert.rejects(invoke("deals.create", { title: "Explicit" })); assert.equal(requests.length, before + 1); }
@@ -1072,7 +1072,7 @@ test("Replicate submits, polls and cancels model predictions without losing medi
1072
1072
  const count = requests.length;
1073
1073
  for (const [op, values] of [["predictions.get", { id: "../other" }], ["models.predict", { owner: "fixture", name: "model", input: { prompt: "x".repeat(262145) } }], ["predictions.create", { version: "unversioned", input: {} }]])
1074
1074
  await assert.rejects(invoke(op, values), { code: "connector_input_invalid" });
1075
- const denied = createConnectionService({ sideEffects: "live", ...options, authorize: async (owner, request) => request.operation === "predictions.cancel" ? null : owner });
1075
+ const denied = createConnectionService({ appEnv: "production", ...options, authorize: async (owner, request) => request.operation === "predictions.cancel" ? null : owner });
1076
1076
  await assert.rejects(denied.invoke({ ...input, operation: "predictions.cancel", input: { id: "job1" } }), { code: "connector_access_denied" });
1077
1077
  assert.equal(requests.length, count);
1078
1078
  for (const status of [403, 429, 500]) { state.status = status; const before = requests.length; await assert.rejects(invoke("models.predict", { owner: "fixture", name: "model", input: {} })); assert.equal(requests.length, before + 1); }
@@ -78,7 +78,7 @@ test("Twilio rejects invalid or ambiguous sends before transport and preserves t
78
78
  ]) await assert.rejects(service.invoke({ ...input, operation: "calls.create", input: invalid }), { code: "connector_input_invalid" });
79
79
  await assert.rejects(service.invoke({ ...input, operation: "messages.get", input: { resourceSid: "../Accounts" } }), { code: "connector_input_invalid" });
80
80
  assert.equal(requests.length, 1);
81
- const denied = createConnectionService({ sideEffects: "live", ...options, authorize: async () => { throw new Error("App policy denied destination"); } });
81
+ const denied = createConnectionService({ appEnv: "production", ...options, authorize: async () => { throw new Error("App policy denied destination"); } });
82
82
  await assert.rejects(denied.invoke({ ...input, operation: "messages.send", input: base }), /App policy denied destination/u);
83
83
  assert.equal(requests.length, 1);
84
84
  state.response = { sid: "invalid", account_sid: accountSid, status: "queued" };
@@ -105,7 +105,7 @@ async function fixture(t, region = "us1") {
105
105
  return Response.json(state.response, { status: state.status });
106
106
  }
107
107
  };
108
- return { service: createConnectionService({ ...options, sideEffects: "live" }), options, requests, directory, protection, state };
108
+ return { service: createConnectionService({ ...options, appEnv: "production" }), options, requests, directory, protection, state };
109
109
  }
110
110
 
111
111
  for (const [region, host] of [["us1", "api.twilio.com"], ["ie1", "api.dublin.ie1.twilio.com"], ["au1", "api.sydney.au1.twilio.com"]]) {
@@ -125,7 +125,7 @@ for (const [region, host] of [["us1", "api.twilio.com"], ["ie1", "api.dublin.ie1
125
125
  assert.equal(stored.includes(state.secret), false);
126
126
  assert.equal(stored.includes(authorization), false);
127
127
  }
128
- const restarted = createConnectionService({ sideEffects: "live", ...options, store: createFileConnectionStore({ directory, protection }) });
128
+ const restarted = createConnectionService({ appEnv: "production", ...options, store: createFileConnectionStore({ directory, protection }) });
129
129
  assert.deepEqual(await restarted.status(input), connected);
130
130
  state.secret = "rotated-fixture-secret";
131
131
  assert.deepEqual(await restarted.invoke({ ...input, operation: "calls.list" }), calls);
@@ -164,11 +164,11 @@ test("Twilio requires re-verification after account, API key identity or region
164
164
  for (const [field, value] of [["accountSid", `AC${"d".repeat(32)}`], ["apiKeySid", `SK${"e".repeat(32)}`], ["region", "ie1"]]) {
165
165
  const configuration = structuredClone(options.configuration);
166
166
  configuration.integrations.voice.settings[field] = value;
167
- const changed = createConnectionService({ sideEffects: "live", ...options, configuration });
167
+ const changed = createConnectionService({ appEnv: "production", ...options, configuration });
168
168
  assert.equal((await changed.status(input)).status, "reconnect-required");
169
169
  await assert.rejects(changed.invoke({ ...input, operation: "calls.list" }), { code: "connector_reconnect_required" });
170
170
  }
171
- const wrongDestination = createConnectionService({ sideEffects: "live", ...options, providers: [{ ...twilioProvider, operations: {
171
+ const wrongDestination = createConnectionService({ appEnv: "production", ...options, providers: [{ ...twilioProvider, operations: {
172
172
  "calls.list": { scopes: [], request: () => ({ method: "GET", url: `https://api.dublin.ie1.twilio.com/2010-04-01/Accounts/${accountSid}/Calls.json` }) }
173
173
  } }] });
174
174
  await assert.rejects(wrongDestination.invoke({ ...input, operation: "calls.list" }), { code: "connector_destination_invalid" });
@@ -67,7 +67,7 @@ async function fixture(t, granted = scopes) {
67
67
  return Response.json(url.pathname === "/helix/users" ? state.profile : state.followed, { status: state.apiStatus });
68
68
  }
69
69
  };
70
- const service = createConnectionService({ ...options, sideEffects: "live" });
70
+ const service = createConnectionService({ ...options, appEnv: "production" });
71
71
  async function start() {
72
72
  const { authorizationUrl } = await service.beginAuthorization(input);
73
73
  const url = new URL(authorizationUrl);
@@ -101,7 +101,7 @@ test("Twitch exchanges code consent, validates client ownership, and persists en
101
101
  const text = await readFile(path.join(directory, name), "utf8");
102
102
  for (const secret of ["fixture-client-secret", "fixture-access-1", "fixture-refresh-1"]) assert.equal(text.includes(secret), false);
103
103
  }
104
- const restarted = createConnectionService({ sideEffects: "live", ...options, store: createFileConnectionStore({ directory, protection }) });
104
+ const restarted = createConnectionService({ appEnv: "production", ...options, store: createFileConnectionStore({ directory, protection }) });
105
105
  assert.deepEqual(await restarted.status(input), { ...connected, callbackUrl: callback });
106
106
  assert.deepEqual(await restarted.invoke({ ...input, operation: "profile.read" }), state.profile);
107
107
  assert.deepEqual(requests.slice(-2).map(({ url }) => url.pathname), ["/oauth2/validate", "/helix/users"]);
@@ -112,7 +112,7 @@ test("Twitch exchanges code consent, validates client ownership, and persists en
112
112
  const changed = structuredClone(options.configuration);
113
113
  changed.registrations.twitch.clientId = "other-client";
114
114
  const count = requests.length;
115
- await assert.rejects(createConnectionService({ sideEffects: "live", ...options, configuration: changed }).invoke({ ...input, operation: "profile.read" }), { code: "connector_reconnect_required" });
115
+ await assert.rejects(createConnectionService({ appEnv: "production", ...options, configuration: changed }).invoke({ ...input, operation: "profile.read" }), { code: "connector_reconnect_required" });
116
116
  assert.equal(requests.length, count);
117
117
  await restarted.disconnect(input);
118
118
  assert.equal((await service.status(input)).status, "disconnected");
@@ -154,7 +154,7 @@ test("Twitch serializes refresh rotation, encodes reserved token characters and
154
154
  await Promise.all([service.invoke({ ...input, operation: "channels.followed" }), service.invoke({ ...input, operation: "channels.followed" })]);
155
155
  assert.equal(state.tokenCount, 2);
156
156
  assert.deepEqual((await service.status(input)).grantedScopes, ["user:read:follows"]);
157
- const restarted = createConnectionService({ ...options, sideEffects: "live" });
157
+ const restarted = createConnectionService({ ...options, appEnv: "production" });
158
158
  state.time += 40_000;
159
159
  state.tokenScope = scopes;
160
160
  await restarted.invoke({ ...input, operation: "token.validate" });
package/test/wave.test.js CHANGED
@@ -68,7 +68,7 @@ async function fixture(t, requestedScopes = scopes) {
68
68
  return Response.json(state.responses?.shift() || state.response || value, { status: state.status });
69
69
  }
70
70
  };
71
- const service = createConnectionService({ ...options, sideEffects: "live" });
71
+ const service = createConnectionService({ ...options, appEnv: "production" });
72
72
  async function start() {
73
73
  const result = await service.beginAuthorization(input);
74
74
  const url = new URL(result.authorizationUrl);
@@ -101,7 +101,7 @@ test("Wave code consent verifies the user and persists encrypted state for CLI r
101
101
  const text = await readFile(path.join(directory, file), "utf8");
102
102
  for (const secret of ["fixture-wave-secret", "fixture-wave-code", "fixture-access-1", "fixture-refresh-1"]) assert.equal(text.includes(secret), false);
103
103
  }
104
- const restarted = createConnectionService({ ...options, sideEffects: "live" });
104
+ const restarted = createConnectionService({ ...options, appEnv: "production" });
105
105
  assert.deepEqual(await restarted.status(input), { ...connected, callbackUrl: callback });
106
106
  assert.deepEqual(await restarted.invoke({ ...input, operation: "user.read" }), user);
107
107
  });
@@ -173,7 +173,7 @@ test("Wave serializes refresh with the original callback and preserves rotated g
173
173
  await assert.rejects(service.invoke({ ...input, operation: "user.read" }), { code: "connector_rate_limited" });
174
174
  assert.equal(state.tokenCount, 3);
175
175
  state.status = 200;
176
- const restarted = createConnectionService({ ...options, sideEffects: "live" });
176
+ const restarted = createConnectionService({ ...options, appEnv: "production" });
177
177
  await restarted.invoke({ ...input, operation: "user.read" });
178
178
  assert.equal(state.tokenCount, 3);
179
179
  assert.deepEqual((await restarted.status(input)).grantedScopes, ["user:read", "business:read"]);
@@ -188,12 +188,12 @@ test("Wave rejects cross-owner access, changed callbacks and denied host policy
188
188
  }
189
189
  bindings["env:WAVE_CALLBACK"] = "https://new.example.test/callback";
190
190
  assert.equal((await service.status(input)).status, "reconnect-required");
191
- await assert.rejects(createConnectionService({ ...options, sideEffects: "live" }).invoke({ ...input, operation: "user.read" }), { code: "connector_reconnect_required" });
191
+ await assert.rejects(createConnectionService({ ...options, appEnv: "production" }).invoke({ ...input, operation: "user.read" }), { code: "connector_reconnect_required" });
192
192
  delete bindings["env:WAVE_CALLBACK"];
193
193
  assert.equal((await service.status(input)).status, "reconnect-required");
194
194
  bindings["env:WAVE_CALLBACK"] = callback;
195
195
  assert.equal((await service.status(input)).status, "connected");
196
- const denied = createConnectionService({ sideEffects: "live", ...options, authorize: async () => null });
196
+ const denied = createConnectionService({ appEnv: "production", ...options, authorize: async () => null });
197
197
  await assert.rejects(denied.invoke({ ...input, operation: "customers.list", input: { businessId } }), { code: "connector_access_denied" });
198
198
  assert.equal(requests.length, count);
199
199
  });
package/test/wix.test.js CHANGED
@@ -64,7 +64,7 @@ async function fixture(t, settings = {}) {
64
64
  return Response.json(state.response, { status: state.status });
65
65
  }
66
66
  };
67
- return { service: createConnectionService({ ...options, sideEffects: "live" }), options, configuration, directory, protection, requests, state };
67
+ return { service: createConnectionService({ ...options, appEnv: "production" }), options, configuration, directory, protection, requests, state };
68
68
  }
69
69
 
70
70
  test("Wix validates account settings and secret references without opening an OAuth journey", async (t) => {
@@ -97,7 +97,7 @@ test("Wix verifies with account headers, encrypts its file grant and resolves ro
97
97
  assert.deepEqual(JSON.parse(first.init.body), { query: { cursorPaging: { limit: 20 } } });
98
98
  for (const name of await readdir(directory)) assert.equal((await readFile(path.join(directory, name), "utf8")).includes(state.key), false);
99
99
  state.key = "rotated-wix-key";
100
- const restarted = createConnectionService({ sideEffects: "live", ...options, store: createFileConnectionStore({ directory, protection }) });
100
+ const restarted = createConnectionService({ appEnv: "production", ...options, store: createFileConnectionStore({ directory, protection }) });
101
101
  assert.equal((await restarted.status(input)).status, "reconnect-required");
102
102
  assert.deepEqual(await restarted.invoke({ ...input, operation: "sites.list" }), sites);
103
103
  assert.equal(requests.at(-1).headers.get("authorization"), state.key);
@@ -141,7 +141,7 @@ test("Wix preserves owner isolation, host policy and account binding", async (t)
141
141
  }
142
142
  state.deny = true; await assert.rejects(service.invoke({ ...input, operation: "sites.list" })); state.deny = false;
143
143
  const changed = structuredClone(configuration); changed.integrations.wix.settings.accountId = siteId;
144
- const moved = createConnectionService({ sideEffects: "live", ...options, configuration: changed });
144
+ const moved = createConnectionService({ appEnv: "production", ...options, configuration: changed });
145
145
  assert.equal((await moved.status(input)).status, "reconnect-required");
146
146
  await assert.rejects(moved.invoke({ ...input, operation: "sites.list" }), { code: "connector_reconnect_required" });
147
147
  assert.equal(requests.length, before);
@@ -160,7 +160,7 @@ test("Wix sanitizes provider failures, rejects invalid verification and preserve
160
160
  }
161
161
  state.stall = true; const controller = new AbortController(); controller.abort();
162
162
  await assert.rejects(service.invoke({ ...input, operation: "sites.list", signal: controller.signal }), { code: "connector_cancelled" });
163
- const timed = createConnectionService({ sideEffects: "live", ...options, providers: [{ ...provider, requestTimeoutMs: 20 }] });
163
+ const timed = createConnectionService({ appEnv: "production", ...options, providers: [{ ...provider, requestTimeoutMs: 20 }] });
164
164
  const keepAlive = setTimeout(() => {}, 1000);
165
165
  try { await assert.rejects(timed.invoke({ ...input, operation: "sites.list" }), { code: "connector_provider_timeout" }); }
166
166
  finally { clearTimeout(keepAlive); }
@@ -41,7 +41,7 @@ async function fixture(t, scopes = profile.token_scope) {
41
41
  return Response.json(state.response ?? state.profile, { status: state.status });
42
42
  }
43
43
  };
44
- const service = createConnectionService(options);
44
+ const service = createConnectionService({ appEnv: "test", ...options });
45
45
  async function start(using = service) {
46
46
  const { authorizationUrl } = await using.beginAuthorization(input);
47
47
  const url = new URL(authorizationUrl);
@@ -79,7 +79,7 @@ test("WordPress.com verifies the issued client and scope grant, persists private
79
79
  const file = await readFile(path.join(directory, name), "utf8");
80
80
  for (const secret of ["fixture-client-secret", "fixture-access-token", "fixture-code"]) assert.equal(file.includes(secret), false);
81
81
  }
82
- const restarted = createConnectionService({ ...options, store: createFileConnectionStore({ directory, protection }) });
82
+ const restarted = createConnectionService({ appEnv: "test", ...options, store: createFileConnectionStore({ directory, protection }) });
83
83
  assert.deepEqual(await restarted.status(input), { ...connected, callbackUrl: callback });
84
84
  // No expiry or refresh token is documented in this code-exchange response.
85
85
  state.time += 1000 * 60 * 60 * 24 * 90;
@@ -140,7 +140,7 @@ test("WordPress.com consent cancellation, denial and registration changes consum
140
140
  const stale = await start();
141
141
  const config = structuredClone(options.configuration);
142
142
  config.registrations.wordpress.clientId = "98765";
143
- const changed = createConnectionService({ ...options, configuration: config });
143
+ const changed = createConnectionService({ appEnv: "test", ...options, configuration: config });
144
144
  await assert.rejects(changed.completeAuthorization({ ...input, callbackUrl: stale.callbackUrl }), { code: "connector_attempt_invalid" });
145
145
  assert.equal(requests.length, 0);
146
146
  });
@@ -44,7 +44,7 @@ async function fixture(t, spec) {
44
44
  return Response.json(state.response, { status: state.status, headers: { Link: '<https://other-site.example/next>; rel="next"' } });
45
45
  }
46
46
  };
47
- return { service: createConnectionService({ ...options, sideEffects: "live" }), options, directory, protection, requests, state };
47
+ return { service: createConnectionService({ ...options, appEnv: "production" }), options, directory, protection, requests, state };
48
48
  }
49
49
 
50
50
  for (const spec of cases) {
@@ -66,7 +66,7 @@ for (const spec of cases) {
66
66
  assert.equal(text.includes(state.secret), false);
67
67
  assert.equal(text.includes(authorization), false);
68
68
  }
69
- const restarted = createConnectionService({ ...options, store: createFileConnectionStore({ directory, protection }) });
69
+ const restarted = createConnectionService({ appEnv: "test", ...options, store: createFileConnectionStore({ directory, protection }) });
70
70
  assert.deepEqual(await restarted.status(input), connected);
71
71
  state.secret = "rotated-secret";
72
72
  assert.deepEqual(await restarted.invoke({ ...input, operation: spec.provider.checkOperation }), spec.response);
@@ -115,11 +115,11 @@ for (const spec of cases) {
115
115
  [spec.identityField, spec.identityField === "consumerKey" ? "ck_other123" : "otheruser"]]) {
116
116
  const configuration = structuredClone(options.configuration);
117
117
  configuration.integrations.site.settings[field] = value;
118
- const changed = createConnectionService({ ...options, configuration });
118
+ const changed = createConnectionService({ appEnv: "test", ...options, configuration });
119
119
  assert.equal((await changed.status(input)).status, "reconnect-required");
120
120
  await assert.rejects(changed.invoke({ ...input, operation: spec.provider.checkOperation }), { code: "connector_reconnect_required" });
121
121
  }
122
- const wrongHost = createConnectionService({ ...options, providers: [{ ...spec.provider, operations: {
122
+ const wrongHost = createConnectionService({ appEnv: "test", ...options, providers: [{ ...spec.provider, operations: {
123
123
  [spec.provider.checkOperation]: { scopes: [], request: () => ({ method: "GET", url: `https://other-site.example${spec.requestPath}` }) }
124
124
  } }] });
125
125
  await assert.rejects(wrongHost.invoke({ ...input, operation: spec.provider.checkOperation }), { code: "connector_destination_invalid" });
@@ -252,7 +252,7 @@ test("WordPress publishes sparse post/page edits and requests trash without perm
252
252
  }
253
253
  state.status = 200; state.response = { id: "42", title: { rendered: "Malformed" } };
254
254
  await assert.rejects(service.invoke({ ...input, operation: "pages.get", input: { id: 42 } }), { code: "connector_response_invalid" });
255
- const denied = createConnectionService({ ...options, authorize: async () => { throw new Error("Denied"); } });
255
+ const denied = createConnectionService({ appEnv: "test", ...options, authorize: async () => { throw new Error("Denied"); } });
256
256
  const before = requests.length;
257
257
  await assert.rejects(denied.invoke({ ...input, operation: "posts.create", input: { title: "Denied" } }));
258
258
  assert.equal(requests.length, before);
@@ -70,7 +70,7 @@ async function fixture(t, { prefix = "/ccx", version = "v1", method = "client_se
70
70
  return Response.json(state.value === undefined ? url.pathname.endsWith("/me") ? me : { data: [me], total: 1 } : state.value, { status: state.status });
71
71
  }
72
72
  };
73
- const service = createConnectionService(options);
73
+ const service = createConnectionService({ appEnv: "test", ...options });
74
74
  const start = async () => {
75
75
  const { authorizationUrl } = await service.beginAuthorization(args); const url = new URL(authorizationUrl);
76
76
  const returned = new URL(callback); returned.searchParams.set("state", url.searchParams.get("state")); returned.searchParams.set("code", "private-code");
@@ -91,7 +91,7 @@ test("Workday confidential consent uses the tenant's distinct authorization host
91
91
  const result = await f.service.completeAuthorization({ ...args, callbackUrl: start.callbackUrl });
92
92
  assert.equal(result.status, "connected"); assert.deepEqual(result.grantedScopes, []); assert.equal(JSON.stringify(result).includes("private"), false);
93
93
  assert.equal(f.requests.at(-1).url.pathname, "/ccx/api/staffing/v7/acme_corp/workers/me");
94
- const restarted = createConnectionService(f.options); assert.equal((await restarted.status(args)).status, "connected");
94
+ const restarted = createConnectionService({ appEnv: "test", ...f.options }); assert.equal((await restarted.status(args)).status, "connected");
95
95
  assert.deepEqual(await restarted.invoke({ ...args, operation: "workers.me" }), me);
96
96
  for (const file of await readdir(f.directory)) {
97
97
  const value = await readFile(path.join(f.directory, file), "utf8");
@@ -124,7 +124,7 @@ test("Workday rejects invalid paging and caller endpoint or identity overrides b
124
124
  await assert.rejects(f.service.invoke({ ...args, operation: "workers.list", input }));
125
125
  }
126
126
  await assert.rejects(f.service.invoke({ ...args, operation: "workers.me", input: { id: "other" } }));
127
- const denied = createConnectionService({ ...f.options, authorize: async () => { throw new Error("Denied by host"); } });
127
+ const denied = createConnectionService({ appEnv: "test", ...f.options, authorize: async () => { throw new Error("Denied by host"); } });
128
128
  await assert.rejects(denied.invoke({ ...args, operation: "workers.me" }), /Denied by host/u);
129
129
  assert.equal(f.requests.length, count);
130
130
  });
@@ -141,7 +141,7 @@ test("Workday binds connections and pending attempts to owner, application and a
141
141
  (settings) => { for (const key of ["restApiEndpoint", "tokenEndpoint"]) settings[key] = settings[key].replace("wd5-services1", "wd5-services2"); }
142
142
  ]) {
143
143
  const configuration = structuredClone(f.options.configuration); change(configuration.integrations.workday.settings);
144
- const changed = createConnectionService({ ...f.options, configuration });
144
+ const changed = createConnectionService({ appEnv: "test", ...f.options, configuration });
145
145
  assert.equal((await changed.status(args)).status, "reconnect-required");
146
146
  await assert.rejects(changed.invoke({ ...args, operation: "workers.me" }), { code: "connector_reconnect_required" });
147
147
  const start = await f.start(); await assert.rejects(changed.completeAuthorization({ ...args, callbackUrl: start.callbackUrl }), { code: "connector_attempt_invalid" });
@@ -39,7 +39,7 @@ async function fixture(t) {
39
39
  return Response.json(state.response, { status: state.status });
40
40
  }
41
41
  };
42
- return { service: createConnectionService(options), options, requests, directory, protection, state };
42
+ return { service: createConnectionService({ appEnv: "test", ...options }), options, requests, directory, protection, state };
43
43
  }
44
44
 
45
45
  test("X verifies public lookup using an app token and preserves file ownership, rotation and disconnect", async (t) => {
@@ -55,7 +55,7 @@ test("X verifies public lookup using an app token and preserves file ownership,
55
55
  const stored = await readFile(path.join(directory, name), "utf8");
56
56
  assert.doesNotThrow(() => JSON.parse(stored)); assert.equal(stored.includes(state.key), false);
57
57
  }
58
- const restarted = createConnectionService({ ...options, store: createFileConnectionStore({ directory, protection }) });
58
+ const restarted = createConnectionService({ appEnv: "test", ...options, store: createFileConnectionStore({ directory, protection }) });
59
59
  assert.deepEqual(await restarted.status(input), connected);
60
60
  state.key = "rotated-app-token";
61
61
  assert.deepEqual(await restarted.invoke({ ...input, operation: "users.lookup", input: { username: "example" } }), profile);
@@ -185,7 +185,7 @@ test("X transport errors distinguish billing, missing resources, access and capa
185
185
  test("X host authorization precedes token resolution and API calls", async (t) => {
186
186
  const { service, options, state, requests } = await fixture(t);
187
187
  await service.connectApiKey(verification);
188
- const denied = createConnectionService({ ...options, authorize: async (_owner, request) => {
188
+ const denied = createConnectionService({ appEnv: "test", ...options, authorize: async (_owner, request) => {
189
189
  assert.equal(request.operation, "users.posts"); assert.equal(request.input.userId, profile.data.id);
190
190
  throw new ConnectorError("connector_permission_denied", "Denied", { statusCode: 403 });
191
191
  } });
@@ -199,14 +199,14 @@ test("X cancellation and timeout do not replay reads or discard a valid connecti
199
199
  await service.connectApiKey(verification); state.wait = true;
200
200
  const controller = new AbortController();
201
201
  const operation = { ...input, operation: "users.lookup", input: { username: "example" } };
202
- const cancellableService = createConnectionService({ ...options, fetchImpl: (address, init) => {
202
+ const cancellableService = createConnectionService({ appEnv: "test", ...options, fetchImpl: (address, init) => {
203
203
  const request = options.fetchImpl(address, init);
204
204
  controller.abort();
205
205
  return request;
206
206
  } });
207
207
  const pending = cancellableService.invoke({ ...operation, signal: controller.signal });
208
208
  await assert.rejects(pending, { code: "connector_cancelled" });
209
- const timeoutService = createConnectionService({ ...options, providers: [{ ...xTwitterProvider, requestTimeoutMs: 20 }] });
209
+ const timeoutService = createConnectionService({ appEnv: "test", ...options, providers: [{ ...xTwitterProvider, requestTimeoutMs: 20 }] });
210
210
  const keepAlive = setTimeout(() => {}, 1000);
211
211
  try { await assert.rejects(timeoutService.invoke(operation), { code: "connector_provider_timeout" }); }
212
212
  finally { clearTimeout(keepAlive); }