@keystrokehq/salesforce 0.0.9 → 0.0.11

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 (53) hide show
  1. package/dist/_official/index.d.mts +2 -2
  2. package/dist/_official/index.mjs +1 -1
  3. package/dist/_runtime/index.mjs +65 -65
  4. package/dist/accounts.d.mts +6 -6
  5. package/dist/accounts.mjs +1 -1
  6. package/dist/associations.d.mts +3 -3
  7. package/dist/associations.mjs +5 -5
  8. package/dist/campaign-members.d.mts +6 -6
  9. package/dist/campaign-members.mjs +1 -1
  10. package/dist/campaigns.d.mts +6 -6
  11. package/dist/campaigns.mjs +1 -1
  12. package/dist/cases.d.mts +6 -6
  13. package/dist/cases.mjs +1 -1
  14. package/dist/client.d.mts +1 -1
  15. package/dist/client.mjs +2 -2
  16. package/dist/connection.d.mts +1 -1
  17. package/dist/connection.mjs +1 -1
  18. package/dist/contacts.d.mts +6 -6
  19. package/dist/contacts.mjs +1 -1
  20. package/dist/dashboards.d.mts +4 -4
  21. package/dist/dashboards.mjs +5 -5
  22. package/dist/dist-Bbp6t-WQ.mjs +74 -0
  23. package/dist/factory-CxfYmb6l.mjs +7 -0
  24. package/dist/integration-B9QIZuPh.mjs +331 -0
  25. package/dist/{integration-B4z5pRJ7.d.mts → integration-CN_7-2E5.d.mts} +3 -4
  26. package/dist/leads.d.mts +6 -6
  27. package/dist/leads.mjs +1 -1
  28. package/dist/notes.d.mts +6 -6
  29. package/dist/notes.mjs +1 -1
  30. package/dist/objects.d.mts +3 -3
  31. package/dist/objects.mjs +4 -4
  32. package/dist/opportunities.d.mts +6 -6
  33. package/dist/opportunities.mjs +1 -1
  34. package/dist/opportunity-line-items.d.mts +6 -6
  35. package/dist/opportunity-line-items.mjs +1 -1
  36. package/dist/ownership.d.mts +2 -2
  37. package/dist/ownership.mjs +4 -4
  38. package/dist/reports.d.mts +5 -5
  39. package/dist/reports.mjs +6 -6
  40. package/dist/schemas/index.mjs +1 -1
  41. package/dist/{shared-Cp54E0DL.mjs → shared-P5lushwa.mjs} +2 -2
  42. package/dist/soql.d.mts +3 -3
  43. package/dist/soql.mjs +5 -5
  44. package/dist/tasks.d.mts +6 -6
  45. package/dist/tasks.mjs +1 -1
  46. package/dist/triggers.d.mts +59 -4
  47. package/dist/triggers.mjs +5 -5
  48. package/dist/users.d.mts +2 -2
  49. package/dist/users.mjs +3 -3
  50. package/package.json +5 -5
  51. package/dist/factory-Dt72AT6c.mjs +0 -8
  52. package/dist/integration-DFFhYLhB.mjs +0 -131
  53. /package/dist/{common-BUAhHMqn.mjs → common-wiFkMAq5.mjs} +0 -0
@@ -1,5 +1,5 @@
1
- import * as zod from "zod";
2
1
  import * as _keystrokehq_core0 from "@keystrokehq/core";
2
+ import * as zod from "zod";
3
3
  import * as _keystrokehq_core_credential_set0 from "@keystrokehq/core/credential-set";
4
4
  import * as zod_v4_core0 from "zod/v4/core";
5
5
 
@@ -13,7 +13,7 @@ declare const getOpportunityLineItem: _keystrokehq_core0.Operation<zod.ZodObject
13
13
  type: zod.ZodString;
14
14
  url: zod.ZodString;
15
15
  }, zod_v4_core0.$strip>>;
16
- }, zod_v4_core0.$catchall<zod.ZodUnknown>>, readonly [_keystrokehq_core0.CredentialSet<"keystroke:salesforce", zod.ZodObject<{
16
+ }, zod_v4_core0.$catchall<zod.ZodUnknown>>, readonly [_keystrokehq_core0.CredentialSet<"salesforce", zod.ZodObject<{
17
17
  SALESFORCE_ACCESS_TOKEN: zod.ZodString;
18
18
  SALESFORCE_INSTANCE_URL: zod.ZodURL;
19
19
  }, zod_v4_core0.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<zod.ZodObject<{
@@ -40,7 +40,7 @@ declare const listOpportunityLineItems: _keystrokehq_core0.Operation<zod.ZodObje
40
40
  url: zod.ZodString;
41
41
  }, zod_v4_core0.$strip>>;
42
42
  }, zod_v4_core0.$catchall<zod.ZodUnknown>>>;
43
- }, zod_v4_core0.$strip>, readonly [_keystrokehq_core0.CredentialSet<"keystroke:salesforce", zod.ZodObject<{
43
+ }, zod_v4_core0.$strip>, readonly [_keystrokehq_core0.CredentialSet<"salesforce", zod.ZodObject<{
44
44
  SALESFORCE_ACCESS_TOKEN: zod.ZodString;
45
45
  SALESFORCE_INSTANCE_URL: zod.ZodURL;
46
46
  }, zod_v4_core0.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<zod.ZodObject<{
@@ -56,7 +56,7 @@ declare const createOpportunityLineItem: _keystrokehq_core0.Operation<zod.ZodObj
56
56
  type: zod.ZodString;
57
57
  url: zod.ZodString;
58
58
  }, zod_v4_core0.$strip>>;
59
- }, zod_v4_core0.$catchall<zod.ZodUnknown>>, readonly [_keystrokehq_core0.CredentialSet<"keystroke:salesforce", zod.ZodObject<{
59
+ }, zod_v4_core0.$catchall<zod.ZodUnknown>>, readonly [_keystrokehq_core0.CredentialSet<"salesforce", zod.ZodObject<{
60
60
  SALESFORCE_ACCESS_TOKEN: zod.ZodString;
61
61
  SALESFORCE_INSTANCE_URL: zod.ZodURL;
62
62
  }, zod_v4_core0.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<zod.ZodObject<{
@@ -73,7 +73,7 @@ declare const updateOpportunityLineItem: _keystrokehq_core0.Operation<zod.ZodObj
73
73
  type: zod.ZodString;
74
74
  url: zod.ZodString;
75
75
  }, zod_v4_core0.$strip>>;
76
- }, zod_v4_core0.$catchall<zod.ZodUnknown>>, readonly [_keystrokehq_core0.CredentialSet<"keystroke:salesforce", zod.ZodObject<{
76
+ }, zod_v4_core0.$catchall<zod.ZodUnknown>>, readonly [_keystrokehq_core0.CredentialSet<"salesforce", zod.ZodObject<{
77
77
  SALESFORCE_ACCESS_TOKEN: zod.ZodString;
78
78
  SALESFORCE_INSTANCE_URL: zod.ZodURL;
79
79
  }, zod_v4_core0.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<zod.ZodObject<{
@@ -86,7 +86,7 @@ declare const deleteOpportunityLineItem: _keystrokehq_core0.Operation<zod.ZodObj
86
86
  success: zod.ZodBoolean;
87
87
  id: zod.ZodOptional<zod.ZodString>;
88
88
  errors: zod.ZodOptional<zod.ZodArray<zod.ZodString>>;
89
- }, zod_v4_core0.$strip>, readonly [_keystrokehq_core0.CredentialSet<"keystroke:salesforce", zod.ZodObject<{
89
+ }, zod_v4_core0.$strip>, readonly [_keystrokehq_core0.CredentialSet<"salesforce", zod.ZodObject<{
90
90
  SALESFORCE_ACCESS_TOKEN: zod.ZodString;
91
91
  SALESFORCE_INSTANCE_URL: zod.ZodURL;
92
92
  }, zod_v4_core0.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<zod.ZodObject<{
@@ -1,4 +1,4 @@
1
- import { n as createSalesforceCrudOperations } from "./shared-Cp54E0DL.mjs";
1
+ import { n as createSalesforceCrudOperations } from "./shared-P5lushwa.mjs";
2
2
 
3
3
  //#region src/opportunity-line-items.ts
4
4
  const opportunityLineItemCrud = createSalesforceCrudOperations({
@@ -1,5 +1,5 @@
1
- import { z } from "zod";
2
1
  import * as _keystrokehq_core0 from "@keystrokehq/core";
2
+ import { z } from "zod";
3
3
  import * as _keystrokehq_core_credential_set0 from "@keystrokehq/core/credential-set";
4
4
 
5
5
  //#region src/ownership.d.ts
@@ -14,7 +14,7 @@ declare const transferRecordOwnership: _keystrokehq_core0.Operation<z.ZodObject<
14
14
  type: z.ZodString;
15
15
  url: z.ZodString;
16
16
  }, z.core.$strip>>;
17
- }, z.core.$catchall<z.ZodUnknown>>, readonly [_keystrokehq_core0.CredentialSet<"keystroke:salesforce", z.ZodObject<{
17
+ }, z.core.$catchall<z.ZodUnknown>>, readonly [_keystrokehq_core0.CredentialSet<"salesforce", z.ZodObject<{
18
18
  SALESFORCE_ACCESS_TOKEN: z.ZodString;
19
19
  SALESFORCE_INSTANCE_URL: z.ZodURL;
20
20
  }, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
@@ -1,7 +1,7 @@
1
1
  import { createSalesforceClient } from "./client.mjs";
2
- import { i as salesforceIdSchema, s as salesforceRecordSchema } from "./common-BUAhHMqn.mjs";
3
- import { t as salesforceOperation } from "./factory-Dt72AT6c.mjs";
4
- import { a as normalizeSalesforceQueryResult, i as getSelectFields, o as salesforceFieldListSchema, r as ensureMutationSuccess, t as buildSelectQuery } from "./shared-Cp54E0DL.mjs";
2
+ import { i as salesforceIdSchema, s as salesforceRecordSchema } from "./common-wiFkMAq5.mjs";
3
+ import { t as salesforceOperation } from "./factory-CxfYmb6l.mjs";
4
+ import { a as normalizeSalesforceQueryResult, i as getSelectFields, o as salesforceFieldListSchema, r as ensureMutationSuccess, t as buildSelectQuery } from "./shared-P5lushwa.mjs";
5
5
  import { z } from "zod";
6
6
 
7
7
  //#region src/ownership.ts
@@ -24,7 +24,7 @@ async function getRecord(client, objectName, recordId, returnFields) {
24
24
  return salesforceRecordSchema.parse(record);
25
25
  }
26
26
  const transferRecordOwnership = salesforceOperation({
27
- id: "transfer_record_ownership",
27
+ id: "salesforce.transfer-record-ownership",
28
28
  name: "Transfer Salesforce Record Ownership",
29
29
  description: "Transfer a Salesforce record by updating its OwnerId to a new user",
30
30
  input: z.object({
@@ -1,16 +1,16 @@
1
- import { z } from "zod";
2
1
  import * as _keystrokehq_core0 from "@keystrokehq/core";
2
+ import { z } from "zod";
3
3
  import * as _keystrokehq_core_credential_set0 from "@keystrokehq/core/credential-set";
4
4
 
5
5
  //#region src/reports.d.ts
6
- declare const listReports: _keystrokehq_core0.Operation<z.ZodObject<{}, z.core.$strip>, z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>, readonly [_keystrokehq_core0.CredentialSet<"keystroke:salesforce", z.ZodObject<{
6
+ declare const listReports: _keystrokehq_core0.Operation<z.ZodObject<{}, z.core.$strip>, z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>, readonly [_keystrokehq_core0.CredentialSet<"salesforce", z.ZodObject<{
7
7
  SALESFORCE_ACCESS_TOKEN: z.ZodString;
8
8
  SALESFORCE_INSTANCE_URL: z.ZodURL;
9
9
  }, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
10
10
  SALESFORCE_ACCESS_TOKEN: z.ZodString;
11
11
  SALESFORCE_INSTANCE_URL: z.ZodURL;
12
12
  }, z.core.$strip>>[] | undefined>], undefined>;
13
- declare const listReportTypes: _keystrokehq_core0.Operation<z.ZodObject<{}, z.core.$strip>, z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>, readonly [_keystrokehq_core0.CredentialSet<"keystroke:salesforce", z.ZodObject<{
13
+ declare const listReportTypes: _keystrokehq_core0.Operation<z.ZodObject<{}, z.core.$strip>, z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>, readonly [_keystrokehq_core0.CredentialSet<"salesforce", z.ZodObject<{
14
14
  SALESFORCE_ACCESS_TOKEN: z.ZodString;
15
15
  SALESFORCE_INSTANCE_URL: z.ZodURL;
16
16
  }, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
@@ -19,7 +19,7 @@ declare const listReportTypes: _keystrokehq_core0.Operation<z.ZodObject<{}, z.co
19
19
  }, z.core.$strip>>[] | undefined>], undefined>;
20
20
  declare const getReportMetadata: _keystrokehq_core0.Operation<z.ZodObject<{
21
21
  reportId: z.ZodString;
22
- }, z.core.$strip>, z.ZodRecord<z.ZodString, z.ZodUnknown>, readonly [_keystrokehq_core0.CredentialSet<"keystroke:salesforce", z.ZodObject<{
22
+ }, z.core.$strip>, z.ZodRecord<z.ZodString, z.ZodUnknown>, readonly [_keystrokehq_core0.CredentialSet<"salesforce", z.ZodObject<{
23
23
  SALESFORCE_ACCESS_TOKEN: z.ZodString;
24
24
  SALESFORCE_INSTANCE_URL: z.ZodURL;
25
25
  }, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
@@ -29,7 +29,7 @@ declare const getReportMetadata: _keystrokehq_core0.Operation<z.ZodObject<{
29
29
  declare const runReport: _keystrokehq_core0.Operation<z.ZodObject<{
30
30
  reportId: z.ZodString;
31
31
  includeDetails: z.ZodOptional<z.ZodBoolean>;
32
- }, z.core.$strip>, z.ZodRecord<z.ZodString, z.ZodUnknown>, readonly [_keystrokehq_core0.CredentialSet<"keystroke:salesforce", z.ZodObject<{
32
+ }, z.core.$strip>, z.ZodRecord<z.ZodString, z.ZodUnknown>, readonly [_keystrokehq_core0.CredentialSet<"salesforce", z.ZodObject<{
33
33
  SALESFORCE_ACCESS_TOKEN: z.ZodString;
34
34
  SALESFORCE_INSTANCE_URL: z.ZodURL;
35
35
  }, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
package/dist/reports.mjs CHANGED
@@ -1,12 +1,12 @@
1
1
  import { createSalesforceClient } from "./client.mjs";
2
- import { n as salesforceGenericObjectArraySchema, r as salesforceGenericObjectSchema } from "./common-BUAhHMqn.mjs";
3
- import { t as salesforceOperation } from "./factory-Dt72AT6c.mjs";
2
+ import { n as salesforceGenericObjectArraySchema, r as salesforceGenericObjectSchema } from "./common-wiFkMAq5.mjs";
3
+ import { t as salesforceOperation } from "./factory-CxfYmb6l.mjs";
4
4
  import { z } from "zod";
5
5
 
6
6
  //#region src/reports.ts
7
7
  const SALESFORCE_API_VERSION = "v61.0";
8
8
  const listReports = salesforceOperation({
9
- id: "list_reports",
9
+ id: "salesforce.list-reports",
10
10
  name: "List Salesforce Reports",
11
11
  description: "List report definitions available in Salesforce analytics",
12
12
  input: z.object({}),
@@ -17,7 +17,7 @@ const listReports = salesforceOperation({
17
17
  }
18
18
  });
19
19
  const listReportTypes = salesforceOperation({
20
- id: "list_report_types",
20
+ id: "salesforce.list-report-types",
21
21
  name: "List Salesforce Report Types",
22
22
  description: "List Salesforce analytics report types available to the connected account",
23
23
  input: z.object({}),
@@ -28,7 +28,7 @@ const listReportTypes = salesforceOperation({
28
28
  }
29
29
  });
30
30
  const getReportMetadata = salesforceOperation({
31
- id: "get_report_metadata",
31
+ id: "salesforce.get-report-metadata",
32
32
  name: "Get Salesforce Report Metadata",
33
33
  description: "Fetch metadata for a Salesforce analytics report",
34
34
  input: z.object({ reportId: z.string().min(1) }),
@@ -39,7 +39,7 @@ const getReportMetadata = salesforceOperation({
39
39
  }
40
40
  });
41
41
  const runReport = salesforceOperation({
42
- id: "run_report",
42
+ id: "salesforce.run-report",
43
43
  name: "Run Salesforce Report",
44
44
  description: "Run a Salesforce analytics report and return the result payload",
45
45
  input: z.object({
@@ -1,3 +1,3 @@
1
- import { a as salesforceMutationResultSchema, i as salesforceIdSchema, n as salesforceGenericObjectArraySchema, o as salesforceQueryResultSchema, r as salesforceGenericObjectSchema, s as salesforceRecordSchema, t as salesforceAttributesSchema } from "../common-BUAhHMqn.mjs";
1
+ import { a as salesforceMutationResultSchema, i as salesforceIdSchema, n as salesforceGenericObjectArraySchema, o as salesforceQueryResultSchema, r as salesforceGenericObjectSchema, s as salesforceRecordSchema, t as salesforceAttributesSchema } from "../common-wiFkMAq5.mjs";
2
2
 
3
3
  export { salesforceAttributesSchema, salesforceGenericObjectArraySchema, salesforceGenericObjectSchema, salesforceIdSchema, salesforceMutationResultSchema, salesforceQueryResultSchema, salesforceRecordSchema };
@@ -1,6 +1,6 @@
1
1
  import { createSalesforceClient } from "./client.mjs";
2
- import { a as salesforceMutationResultSchema, i as salesforceIdSchema, o as salesforceQueryResultSchema, s as salesforceRecordSchema } from "./common-BUAhHMqn.mjs";
3
- import { t as salesforceOperation } from "./factory-Dt72AT6c.mjs";
2
+ import { a as salesforceMutationResultSchema, i as salesforceIdSchema, o as salesforceQueryResultSchema, s as salesforceRecordSchema } from "./common-wiFkMAq5.mjs";
3
+ import { t as salesforceOperation } from "./factory-CxfYmb6l.mjs";
4
4
  import { z } from "zod";
5
5
 
6
6
  //#region src/shared.ts
package/dist/soql.d.mts CHANGED
@@ -1,5 +1,5 @@
1
- import { z } from "zod";
2
1
  import * as _keystrokehq_core0 from "@keystrokehq/core";
2
+ import { z } from "zod";
3
3
  import * as _keystrokehq_core_credential_set0 from "@keystrokehq/core/credential-set";
4
4
 
5
5
  //#region src/soql.d.ts
@@ -16,7 +16,7 @@ declare const runSoqlQuery: _keystrokehq_core0.Operation<z.ZodObject<{
16
16
  url: z.ZodString;
17
17
  }, z.core.$strip>>;
18
18
  }, z.core.$catchall<z.ZodUnknown>>>;
19
- }, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"keystroke:salesforce", z.ZodObject<{
19
+ }, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"salesforce", z.ZodObject<{
20
20
  SALESFORCE_ACCESS_TOKEN: z.ZodString;
21
21
  SALESFORCE_INSTANCE_URL: z.ZodURL;
22
22
  }, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
@@ -36,7 +36,7 @@ declare const queryMore: _keystrokehq_core0.Operation<z.ZodObject<{
36
36
  url: z.ZodString;
37
37
  }, z.core.$strip>>;
38
38
  }, z.core.$catchall<z.ZodUnknown>>>;
39
- }, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"keystroke:salesforce", z.ZodObject<{
39
+ }, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"salesforce", z.ZodObject<{
40
40
  SALESFORCE_ACCESS_TOKEN: z.ZodString;
41
41
  SALESFORCE_INSTANCE_URL: z.ZodURL;
42
42
  }, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
package/dist/soql.mjs CHANGED
@@ -1,12 +1,12 @@
1
1
  import { createSalesforceClient } from "./client.mjs";
2
- import { o as salesforceQueryResultSchema } from "./common-BUAhHMqn.mjs";
3
- import { t as salesforceOperation } from "./factory-Dt72AT6c.mjs";
4
- import { a as normalizeSalesforceQueryResult } from "./shared-Cp54E0DL.mjs";
2
+ import { o as salesforceQueryResultSchema } from "./common-wiFkMAq5.mjs";
3
+ import { t as salesforceOperation } from "./factory-CxfYmb6l.mjs";
4
+ import { a as normalizeSalesforceQueryResult } from "./shared-P5lushwa.mjs";
5
5
  import { z } from "zod";
6
6
 
7
7
  //#region src/soql.ts
8
8
  const runSoqlQuery = salesforceOperation({
9
- id: "run_soql_query",
9
+ id: "salesforce.run-soql-query",
10
10
  name: "Run Salesforce SOQL Query",
11
11
  description: "Run an arbitrary SOQL query against Salesforce",
12
12
  input: z.object({ query: z.string().min(1) }),
@@ -16,7 +16,7 @@ const runSoqlQuery = salesforceOperation({
16
16
  }
17
17
  });
18
18
  const queryMore = salesforceOperation({
19
- id: "query_more",
19
+ id: "salesforce.query-more",
20
20
  name: "Run Salesforce Query More",
21
21
  description: "Fetch the next page of a Salesforce query result using nextRecordsUrl",
22
22
  input: z.object({ nextRecordsUrl: z.string().min(1) }),
package/dist/tasks.d.mts CHANGED
@@ -1,5 +1,5 @@
1
- import * as zod from "zod";
2
1
  import * as _keystrokehq_core0 from "@keystrokehq/core";
2
+ import * as zod from "zod";
3
3
  import * as _keystrokehq_core_credential_set0 from "@keystrokehq/core/credential-set";
4
4
  import * as zod_v4_core0 from "zod/v4/core";
5
5
 
@@ -13,7 +13,7 @@ declare const getTask: _keystrokehq_core0.Operation<zod.ZodObject<{
13
13
  type: zod.ZodString;
14
14
  url: zod.ZodString;
15
15
  }, zod_v4_core0.$strip>>;
16
- }, zod_v4_core0.$catchall<zod.ZodUnknown>>, readonly [_keystrokehq_core0.CredentialSet<"keystroke:salesforce", zod.ZodObject<{
16
+ }, zod_v4_core0.$catchall<zod.ZodUnknown>>, readonly [_keystrokehq_core0.CredentialSet<"salesforce", zod.ZodObject<{
17
17
  SALESFORCE_ACCESS_TOKEN: zod.ZodString;
18
18
  SALESFORCE_INSTANCE_URL: zod.ZodURL;
19
19
  }, zod_v4_core0.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<zod.ZodObject<{
@@ -40,7 +40,7 @@ declare const listTasks: _keystrokehq_core0.Operation<zod.ZodObject<{
40
40
  url: zod.ZodString;
41
41
  }, zod_v4_core0.$strip>>;
42
42
  }, zod_v4_core0.$catchall<zod.ZodUnknown>>>;
43
- }, zod_v4_core0.$strip>, readonly [_keystrokehq_core0.CredentialSet<"keystroke:salesforce", zod.ZodObject<{
43
+ }, zod_v4_core0.$strip>, readonly [_keystrokehq_core0.CredentialSet<"salesforce", zod.ZodObject<{
44
44
  SALESFORCE_ACCESS_TOKEN: zod.ZodString;
45
45
  SALESFORCE_INSTANCE_URL: zod.ZodURL;
46
46
  }, zod_v4_core0.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<zod.ZodObject<{
@@ -56,7 +56,7 @@ declare const createTask: _keystrokehq_core0.Operation<zod.ZodObject<{
56
56
  type: zod.ZodString;
57
57
  url: zod.ZodString;
58
58
  }, zod_v4_core0.$strip>>;
59
- }, zod_v4_core0.$catchall<zod.ZodUnknown>>, readonly [_keystrokehq_core0.CredentialSet<"keystroke:salesforce", zod.ZodObject<{
59
+ }, zod_v4_core0.$catchall<zod.ZodUnknown>>, readonly [_keystrokehq_core0.CredentialSet<"salesforce", zod.ZodObject<{
60
60
  SALESFORCE_ACCESS_TOKEN: zod.ZodString;
61
61
  SALESFORCE_INSTANCE_URL: zod.ZodURL;
62
62
  }, zod_v4_core0.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<zod.ZodObject<{
@@ -73,7 +73,7 @@ declare const updateTask: _keystrokehq_core0.Operation<zod.ZodObject<{
73
73
  type: zod.ZodString;
74
74
  url: zod.ZodString;
75
75
  }, zod_v4_core0.$strip>>;
76
- }, zod_v4_core0.$catchall<zod.ZodUnknown>>, readonly [_keystrokehq_core0.CredentialSet<"keystroke:salesforce", zod.ZodObject<{
76
+ }, zod_v4_core0.$catchall<zod.ZodUnknown>>, readonly [_keystrokehq_core0.CredentialSet<"salesforce", zod.ZodObject<{
77
77
  SALESFORCE_ACCESS_TOKEN: zod.ZodString;
78
78
  SALESFORCE_INSTANCE_URL: zod.ZodURL;
79
79
  }, zod_v4_core0.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<zod.ZodObject<{
@@ -86,7 +86,7 @@ declare const deleteTask: _keystrokehq_core0.Operation<zod.ZodObject<{
86
86
  success: zod.ZodBoolean;
87
87
  id: zod.ZodOptional<zod.ZodString>;
88
88
  errors: zod.ZodOptional<zod.ZodArray<zod.ZodString>>;
89
- }, zod_v4_core0.$strip>, readonly [_keystrokehq_core0.CredentialSet<"keystroke:salesforce", zod.ZodObject<{
89
+ }, zod_v4_core0.$strip>, readonly [_keystrokehq_core0.CredentialSet<"salesforce", zod.ZodObject<{
90
90
  SALESFORCE_ACCESS_TOKEN: zod.ZodString;
91
91
  SALESFORCE_INSTANCE_URL: zod.ZodURL;
92
92
  }, zod_v4_core0.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<zod.ZodObject<{
package/dist/tasks.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { n as createSalesforceCrudOperations } from "./shared-Cp54E0DL.mjs";
1
+ import { n as createSalesforceCrudOperations } from "./shared-P5lushwa.mjs";
2
2
 
3
3
  //#region src/tasks.ts
4
4
  const taskCrud = createSalesforceCrudOperations({
@@ -1,9 +1,64 @@
1
- import { n as salesforce } from "./integration-B4z5pRJ7.mjs";
1
+ import { n as salesforce } from "./integration-CN_7-2E5.mjs";
2
+ import { BoundTrigger, Operation, TriggerBindOptions, TriggerManifest } from "@keystrokehq/core";
2
3
  import { z } from "zod";
3
- import { BoundTrigger } from "@keystrokehq/core";
4
- import { IntegrationTriggerBindingOptions, createPollingTriggerBindingFactory } from "@keystrokehq/integration-authoring";
5
- import { PollingTriggerManifest } from "@keystrokehq/core/trigger";
4
+ import { PollingTriggerManifest, pollingTrigger } from "@keystrokehq/core/trigger";
5
+ import { AnyCredentialSet, InferCredentialSetAuth } from "@keystrokehq/core/credential-set";
6
6
 
7
+ //#region ../../packages/integration-authoring/dist/index.d.mts
8
+ //#endregion
9
+ //#region src/triggers/types.d.ts
10
+ interface IntegrationTriggerMetadata {
11
+ readonly id?: string;
12
+ readonly description?: string;
13
+ }
14
+ interface IntegrationTriggerBindingOptions<TPayload, TOutput = TPayload, TRequest = undefined> extends IntegrationTriggerMetadata {
15
+ readonly transform?: TriggerBindOptions<TPayload, TOutput, TRequest>['transform'];
16
+ }
17
+ type IntegrationTriggerBindingFactory<TAuthorPayload, TCredentialSets extends readonly AnyCredentialSet[] | undefined, TManifest extends TriggerManifest = TriggerManifest, TRuntimePayload = TAuthorPayload, TRequest = undefined> = <TOutput = TAuthorPayload>(options?: IntegrationTriggerBindingOptions<TAuthorPayload, TOutput, TRequest>) => BoundTrigger<TRuntimePayload, TCredentialSets, TManifest, TOutput, TRequest>; //#endregion
18
+ //#region src/triggers/shared.d.ts
19
+ type MappedPayloadFn<TPayload, TMappedPayload> = (payload: TPayload) => TMappedPayload | null; //#endregion
20
+ //#region src/triggers/polling.d.ts
21
+ type PollingPrimitiveConfig<TResponseSchema extends z.ZodTypeAny, TCredentialSets extends readonly AnyCredentialSet[] = readonly []> = Parameters<typeof pollingTrigger<TResponseSchema, TCredentialSets>>[0];
22
+ /**
23
+ * Authoring config for an integration polling trigger binding.
24
+ *
25
+ * Notes about the new core surface:
26
+ * - Polling no longer supports any form of `idempotencyKey` (only webhook does).
27
+ * - `filter` must be a pure Zod schema (no `.refine`, `.transform`, etc.).
28
+ * - `mapPayload` curates the validated polling response into the friendlier
29
+ * shape surfaced to authors. It is applied as a default `transform` at bind
30
+ * time; authors can still pass their own `transform` to override or compose.
31
+ */
32
+ interface IntegrationPollingTriggerBindingConfig<TResponseSchema extends z.ZodTypeAny, TEvent = z.output<TResponseSchema>, TCredentialSets extends readonly AnyCredentialSet[] = readonly []> {
33
+ readonly defaultId: string;
34
+ readonly defaultDescription: string;
35
+ readonly schedule: PollingPrimitiveConfig<TResponseSchema, TCredentialSets>['schedule'];
36
+ readonly response: TResponseSchema;
37
+ readonly poll: PollingPrimitiveConfig<TResponseSchema, TCredentialSets>['poll'];
38
+ readonly credentialSets?: TCredentialSets;
39
+ readonly filter?: z.ZodTypeAny;
40
+ readonly mapPayload?: MappedPayloadFn<z.output<TResponseSchema>, TEvent>;
41
+ }
42
+ declare function createPollingTriggerBindingFactory<TResponseSchema extends z.ZodTypeAny, TEvent = z.output<TResponseSchema>, TCredentialSets extends readonly AnyCredentialSet[] = readonly []>(config: IntegrationPollingTriggerBindingConfig<TResponseSchema, TEvent, TCredentialSets>): IntegrationTriggerBindingFactory<TEvent, TCredentialSets, PollingTriggerManifest, z.output<TResponseSchema>>; //#endregion
43
+ //#region src/triggers/webhook.d.ts
44
+ /**
45
+ * Authoring config for an integration webhook trigger binding.
46
+ *
47
+ * Notes about the new core surface:
48
+ * - The platform owns the HTTP surface for `source: { type: 'custom' }` webhooks
49
+ * and authenticates with a Keystroke-issued secret. There is no `path`,
50
+ * `method`, `verify`, or `response` here anymore.
51
+ * - `filter` must be a pure Zod schema (no `.refine`, `.transform`, etc.).
52
+ * Use it to narrow the raw payload to the events this binding is interested
53
+ * in. Filtering happens server-side before any VM hop.
54
+ * - `idempotencyKey` is declarative (`IdempotencyKeyConfig`) — point it at a
55
+ * payload path or a header. Function-style idempotency is no longer
56
+ * supported.
57
+ * - `mapPayload` curates the validated raw payload into the friendlier shape
58
+ * surfaced to authors. It is applied as a default `transform` at bind time;
59
+ * authors can still pass their own `transform` to override or compose.
60
+ */
61
+ //#endregion
7
62
  //#region src/triggers.d.ts
8
63
  type Schedule = Parameters<typeof createPollingTriggerBindingFactory>[0]['schedule'];
9
64
  type SalesforcePollingCredentialSets = readonly [typeof salesforce];
package/dist/triggers.mjs CHANGED
@@ -1,9 +1,9 @@
1
- import { t as salesforce } from "./integration-DFFhYLhB.mjs";
1
+ import { t as salesforce } from "./integration-B9QIZuPh.mjs";
2
+ import { n as createPollingTriggerBindingFactory } from "./dist-Bbp6t-WQ.mjs";
2
3
  import { createSalesforceClient } from "./client.mjs";
3
- import { s as salesforceRecordSchema } from "./common-BUAhHMqn.mjs";
4
- import { a as normalizeSalesforceQueryResult } from "./shared-Cp54E0DL.mjs";
4
+ import { s as salesforceRecordSchema } from "./common-wiFkMAq5.mjs";
5
+ import { a as normalizeSalesforceQueryResult } from "./shared-P5lushwa.mjs";
5
6
  import { z } from "zod";
6
- import { createPollingTriggerBindingFactory } from "@keystrokehq/integration-authoring";
7
7
 
8
8
  //#region src/triggers.ts
9
9
  const salesforcePollingResponseSchema = z.object({
@@ -87,7 +87,7 @@ function createSalesforcePollingBindingFactory(config) {
87
87
  response: salesforcePollingResponseSchema,
88
88
  filter: nonEmptyRecordsFilterSchema,
89
89
  poll: async (ctx) => {
90
- const credentials = ctx.credentials["keystroke:salesforce"];
90
+ const credentials = ctx.credentials["salesforce"];
91
91
  const client = createPollingClient(credentials);
92
92
  const query = buildSalesforcePollingQuery({
93
93
  objectName: config.objectName,
package/dist/users.d.mts CHANGED
@@ -1,9 +1,9 @@
1
- import { z } from "zod";
2
1
  import * as _keystrokehq_core0 from "@keystrokehq/core";
2
+ import { z } from "zod";
3
3
  import * as _keystrokehq_core_credential_set0 from "@keystrokehq/core/credential-set";
4
4
 
5
5
  //#region src/users.d.ts
6
- declare const getCurrentUserInfo: _keystrokehq_core0.Operation<z.ZodObject<{}, z.core.$strip>, z.ZodRecord<z.ZodString, z.ZodUnknown>, readonly [_keystrokehq_core0.CredentialSet<"keystroke:salesforce", z.ZodObject<{
6
+ declare const getCurrentUserInfo: _keystrokehq_core0.Operation<z.ZodObject<{}, z.core.$strip>, z.ZodRecord<z.ZodString, z.ZodUnknown>, readonly [_keystrokehq_core0.CredentialSet<"salesforce", z.ZodObject<{
7
7
  SALESFORCE_ACCESS_TOKEN: z.ZodString;
8
8
  SALESFORCE_INSTANCE_URL: z.ZodURL;
9
9
  }, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
package/dist/users.mjs CHANGED
@@ -1,11 +1,11 @@
1
1
  import { createSalesforceClient } from "./client.mjs";
2
- import { r as salesforceGenericObjectSchema } from "./common-BUAhHMqn.mjs";
3
- import { t as salesforceOperation } from "./factory-Dt72AT6c.mjs";
2
+ import { r as salesforceGenericObjectSchema } from "./common-wiFkMAq5.mjs";
3
+ import { t as salesforceOperation } from "./factory-CxfYmb6l.mjs";
4
4
  import { z } from "zod";
5
5
 
6
6
  //#region src/users.ts
7
7
  const getCurrentUserInfo = salesforceOperation({
8
- id: "get_current_user_info",
8
+ id: "salesforce.get-current-user-info",
9
9
  name: "Get Salesforce Current User Info",
10
10
  description: "Fetch the current Salesforce user identity and profile information for the connected account",
11
11
  input: z.object({}),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@keystrokehq/salesforce",
3
- "version": "0.0.9",
3
+ "version": "0.0.11",
4
4
  "private": false,
5
5
  "sideEffects": false,
6
6
  "type": "module",
@@ -112,8 +112,6 @@
112
112
  ],
113
113
  "dependencies": {
114
114
  "@jsforce/jsforce-node": "^3.10.14",
115
- "@keystrokehq/credential-connection": "^1.0.0",
116
- "@keystrokehq/integration-authoring": "^0.0.7",
117
115
  "zod": "^4.3.6"
118
116
  },
119
117
  "peerDependencies": {
@@ -124,9 +122,11 @@
124
122
  "tsdown": "^0.20.3",
125
123
  "typescript": "^5.9.3",
126
124
  "vitest": "^4.0.18",
127
- "@keystrokehq/core": "^0.0.8",
125
+ "@keystrokehq/core": "^0.0.12",
126
+ "@keystrokehq/typescript-config": "0.0.0",
127
+ "@keystrokehq/integration-authoring": "0.0.9",
128
128
  "@keystrokehq/test-utils": "0.0.0",
129
- "@keystrokehq/typescript-config": "0.0.0"
129
+ "@keystrokehq/credential-connection": "1.0.0"
130
130
  },
131
131
  "keywords": [
132
132
  "salesforce",
@@ -1,8 +0,0 @@
1
- import { t as salesforce } from "./integration-DFFhYLhB.mjs";
2
- import { createOfficialOperationFactory } from "@keystrokehq/integration-authoring/official";
3
-
4
- //#region src/factory.ts
5
- const salesforceOperation = createOfficialOperationFactory(salesforce);
6
-
7
- //#endregion
8
- export { salesforceOperation as t };
@@ -1,131 +0,0 @@
1
- import { defineOfficialIntegration, officialCredentialSetId } from "@keystrokehq/integration-authoring/official";
2
- import { z } from "zod";
3
- import { CredentialSet } from "@keystrokehq/core";
4
- import { oauthDefaults } from "@keystrokehq/credential-connection";
5
-
6
- //#region src/_official/provider-app.ts
7
- const salesforceAppCredentialSet = new CredentialSet({
8
- id: officialCredentialSetId("salesforce-app"),
9
- exposure: "platform-only",
10
- name: "Salesforce Connected App",
11
- auth: z.object({
12
- clientId: z.string().min(1),
13
- clientSecret: z.string().min(1)
14
- })
15
- });
16
- const salesforceOfficialProviderSeed = {
17
- provider: "salesforce",
18
- appRef: "salesforce-platform",
19
- displayName: "Salesforce Platform",
20
- credentialSetName: "Keystroke Salesforce Platform App",
21
- envShape: {
22
- KEYSTROKE_OFFICIAL_SALESFORCE_CLIENT_ID: z.string().optional(),
23
- KEYSTROKE_OFFICIAL_SALESFORCE_CLIENT_SECRET: z.string().optional(),
24
- KEYSTROKE_OFFICIAL_SALESFORCE_ENVIRONMENT: z.enum(["production", "sandbox"]).optional(),
25
- KEYSTROKE_OFFICIAL_SALESFORCE_LOGIN_BASE_URL: z.string().url().optional()
26
- },
27
- requiredEnvKeys: ["KEYSTROKE_OFFICIAL_SALESFORCE_CLIENT_ID", "KEYSTROKE_OFFICIAL_SALESFORCE_CLIENT_SECRET"],
28
- externalAppIdEnvKey: "KEYSTROKE_OFFICIAL_SALESFORCE_CLIENT_ID",
29
- buildCredentials: (env) => ({
30
- clientId: env.KEYSTROKE_OFFICIAL_SALESFORCE_CLIENT_ID,
31
- clientSecret: env.KEYSTROKE_OFFICIAL_SALESFORCE_CLIENT_SECRET
32
- }),
33
- buildMetadata: (env) => env.KEYSTROKE_OFFICIAL_SALESFORCE_ENVIRONMENT || env.KEYSTROKE_OFFICIAL_SALESFORCE_LOGIN_BASE_URL ? {
34
- ...env.KEYSTROKE_OFFICIAL_SALESFORCE_ENVIRONMENT ? { environment: env.KEYSTROKE_OFFICIAL_SALESFORCE_ENVIRONMENT } : {},
35
- ...env.KEYSTROKE_OFFICIAL_SALESFORCE_LOGIN_BASE_URL ? { loginBaseUrl: env.KEYSTROKE_OFFICIAL_SALESFORCE_LOGIN_BASE_URL } : {}
36
- } : void 0
37
- };
38
-
39
- //#endregion
40
- //#region src/oauth-connection.ts
41
- function getMetadataValue(metadata, key) {
42
- if (!metadata || typeof metadata !== "object" || !(key in metadata)) return;
43
- const value = metadata[key];
44
- if (typeof value === "string" || typeof value === "boolean") return value;
45
- }
46
- function resolveSalesforceLoginBaseUrl(metadata) {
47
- const explicitBaseUrl = getMetadataValue(metadata, "loginBaseUrl");
48
- if (typeof explicitBaseUrl === "string" && explicitBaseUrl.length > 0) return explicitBaseUrl;
49
- if (getMetadataValue(metadata, "environment") === "sandbox") return "https://test.salesforce.com";
50
- if (getMetadataValue(metadata, "sandbox") === true) return "https://test.salesforce.com";
51
- return "https://login.salesforce.com";
52
- }
53
- function buildSalesforceUrl(metadata, path) {
54
- return new URL(path, resolveSalesforceLoginBaseUrl(metadata)).toString();
55
- }
56
- const salesforceOAuthConnection = {
57
- kind: "oauth",
58
- tokenType: "refreshable",
59
- authUrl: "https://login.salesforce.com/services/oauth2/authorize",
60
- tokenUrl: "https://login.salesforce.com/services/oauth2/token",
61
- revokeUrl: null,
62
- scopes: [
63
- "api",
64
- "refresh_token",
65
- "offline_access"
66
- ],
67
- vault: {
68
- accessToken: "SALESFORCE_ACCESS_TOKEN",
69
- instanceUrl: "SALESFORCE_INSTANCE_URL"
70
- },
71
- buildAuthUrl({ oauthClient, redirectUri, state, connection, requestedScopes }) {
72
- const scopes = requestedScopes ?? connection.scopes;
73
- const url = new URL(buildSalesforceUrl(oauthClient.metadata, "/services/oauth2/authorize"));
74
- url.searchParams.set("client_id", oauthClient.clientId);
75
- url.searchParams.set("scope", scopes.join(" "));
76
- url.searchParams.set("redirect_uri", redirectUri);
77
- url.searchParams.set("state", state);
78
- url.searchParams.set("response_type", "code");
79
- return url.toString();
80
- },
81
- async exchangeCode({ oauthClient, code, redirectUri }) {
82
- if (!code) throw new Error("Missing authorization code");
83
- return oauthDefaults.exchangeToken({
84
- tokenUrl: buildSalesforceUrl(oauthClient.metadata, "/services/oauth2/token"),
85
- body: new URLSearchParams({
86
- code,
87
- client_id: oauthClient.clientId,
88
- client_secret: oauthClient.clientSecret,
89
- redirect_uri: redirectUri,
90
- grant_type: "authorization_code"
91
- })
92
- });
93
- },
94
- async refreshToken({ oauthClient, refreshToken }) {
95
- return oauthDefaults.exchangeToken({
96
- tokenUrl: buildSalesforceUrl(oauthClient.metadata, "/services/oauth2/token"),
97
- body: new URLSearchParams({
98
- grant_type: "refresh_token",
99
- refresh_token: refreshToken,
100
- client_id: oauthClient.clientId,
101
- client_secret: oauthClient.clientSecret
102
- })
103
- });
104
- }
105
- };
106
-
107
- //#endregion
108
- //#region src/integration.ts
109
- const salesforceAuthSchema = z.object({
110
- SALESFORCE_ACCESS_TOKEN: z.string().min(1),
111
- SALESFORCE_INSTANCE_URL: z.url()
112
- });
113
- const salesforceOfficialIntegration = {
114
- id: "salesforce",
115
- name: "Salesforce",
116
- description: "Salesforce CRM and platform automation",
117
- auth: salesforceAuthSchema,
118
- proxy: { hosts: ["*.salesforce.com", "*.force.com"] },
119
- connections: [{
120
- id: "oauth",
121
- ...salesforceOAuthConnection
122
- }]
123
- };
124
- const salesforceBundle = defineOfficialIntegration({
125
- ...salesforceOfficialIntegration,
126
- internal: { providerApp: salesforceAppCredentialSet }
127
- });
128
- const salesforce = salesforceBundle.credentialSet;
129
-
130
- //#endregion
131
- export { salesforceOfficialProviderSeed as a, salesforceAppCredentialSet as i, salesforceBundle as n, salesforceOfficialIntegration as r, salesforce as t };