@keystrokehq/salesforce 0.0.10 → 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.
- package/dist/_official/index.d.mts +2 -2
- package/dist/_official/index.mjs +1 -1
- package/dist/accounts.d.mts +6 -6
- package/dist/accounts.mjs +1 -1
- package/dist/associations.d.mts +3 -3
- package/dist/associations.mjs +3 -3
- package/dist/campaign-members.d.mts +6 -6
- package/dist/campaign-members.mjs +1 -1
- package/dist/campaigns.d.mts +6 -6
- package/dist/campaigns.mjs +1 -1
- package/dist/cases.d.mts +6 -6
- package/dist/cases.mjs +1 -1
- package/dist/client.d.mts +1 -1
- package/dist/client.mjs +2 -2
- package/dist/connection.d.mts +1 -1
- package/dist/connection.mjs +1 -1
- package/dist/contacts.d.mts +6 -6
- package/dist/contacts.mjs +1 -1
- package/dist/dashboards.d.mts +4 -4
- package/dist/dashboards.mjs +2 -2
- package/dist/dist-Bbp6t-WQ.mjs +74 -0
- package/dist/factory-CxfYmb6l.mjs +7 -0
- package/dist/integration-B9QIZuPh.mjs +331 -0
- package/dist/{integration-B4z5pRJ7.d.mts → integration-CN_7-2E5.d.mts} +3 -4
- package/dist/leads.d.mts +6 -6
- package/dist/leads.mjs +1 -1
- package/dist/notes.d.mts +6 -6
- package/dist/notes.mjs +1 -1
- package/dist/objects.d.mts +3 -3
- package/dist/objects.mjs +2 -2
- package/dist/opportunities.d.mts +6 -6
- package/dist/opportunities.mjs +1 -1
- package/dist/opportunity-line-items.d.mts +6 -6
- package/dist/opportunity-line-items.mjs +1 -1
- package/dist/ownership.d.mts +2 -2
- package/dist/ownership.mjs +3 -3
- package/dist/reports.d.mts +5 -5
- package/dist/reports.mjs +2 -2
- package/dist/schemas/index.mjs +1 -1
- package/dist/{shared-Cp54E0DL.mjs → shared-P5lushwa.mjs} +2 -2
- package/dist/soql.d.mts +3 -3
- package/dist/soql.mjs +3 -3
- package/dist/tasks.d.mts +6 -6
- package/dist/tasks.mjs +1 -1
- package/dist/triggers.d.mts +59 -4
- package/dist/triggers.mjs +5 -5
- package/dist/users.d.mts +2 -2
- package/dist/users.mjs +2 -2
- package/package.json +5 -5
- package/dist/factory-Dt72AT6c.mjs +0 -8
- package/dist/integration-DFFhYLhB.mjs +0 -131
- /package/dist/{common-BUAhHMqn.mjs → common-wiFkMAq5.mjs} +0 -0
package/dist/reports.d.mts
CHANGED
|
@@ -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<"
|
|
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<"
|
|
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<"
|
|
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<"
|
|
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,6 +1,6 @@
|
|
|
1
1
|
import { createSalesforceClient } from "./client.mjs";
|
|
2
|
-
import { n as salesforceGenericObjectArraySchema, r as salesforceGenericObjectSchema } from "./common-
|
|
3
|
-
import { t as salesforceOperation } from "./factory-
|
|
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
|
package/dist/schemas/index.mjs
CHANGED
|
@@ -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-
|
|
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-
|
|
3
|
-
import { t as salesforceOperation } from "./factory-
|
|
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<"
|
|
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<"
|
|
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,7 +1,7 @@
|
|
|
1
1
|
import { createSalesforceClient } from "./client.mjs";
|
|
2
|
-
import { o as salesforceQueryResultSchema } from "./common-
|
|
3
|
-
import { t as salesforceOperation } from "./factory-
|
|
4
|
-
import { a as normalizeSalesforceQueryResult } from "./shared-
|
|
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
|
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<"
|
|
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<"
|
|
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<"
|
|
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<"
|
|
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<"
|
|
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
package/dist/triggers.d.mts
CHANGED
|
@@ -1,9 +1,64 @@
|
|
|
1
|
-
import { n as salesforce } from "./integration-
|
|
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 {
|
|
4
|
-
import {
|
|
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-
|
|
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-
|
|
4
|
-
import { a as normalizeSalesforceQueryResult } from "./shared-
|
|
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["
|
|
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<"
|
|
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,6 +1,6 @@
|
|
|
1
1
|
import { createSalesforceClient } from "./client.mjs";
|
|
2
|
-
import { r as salesforceGenericObjectSchema } from "./common-
|
|
3
|
-
import { t as salesforceOperation } from "./factory-
|
|
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
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@keystrokehq/salesforce",
|
|
3
|
-
"version": "0.0.
|
|
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.8",
|
|
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.
|
|
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/
|
|
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 };
|
|
File without changes
|