@activepieces/piece-digital-pilot 0.0.1

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/README.md ADDED
@@ -0,0 +1,7 @@
1
+ # pieces-digital-pilot
2
+
3
+ This library was generated with [Nx](https://nx.dev).
4
+
5
+ ## Building
6
+
7
+ Run `nx build pieces-digital-pilot` to build the library.
package/package.json ADDED
@@ -0,0 +1,25 @@
1
+ {
2
+ "name": "@activepieces/piece-digital-pilot",
3
+ "version": "0.0.1",
4
+ "type": "commonjs",
5
+ "main": "./src/index.js",
6
+ "types": "./src/index.d.ts",
7
+ "dependencies": {
8
+ "@sinclair/typebox": "0.34.11",
9
+ "axios": "1.13.1",
10
+ "axios-retry": "4.4.1",
11
+ "deepmerge-ts": "7.1.0",
12
+ "mime-types": "2.1.35",
13
+ "nanoid": "3.3.8",
14
+ "semver": "7.6.0",
15
+ "socket.io-client": "4.8.1",
16
+ "tslib": "^2.3.0",
17
+ "zod": "4.1.13",
18
+ "@activepieces/pieces-common": "0.10.1",
19
+ "@activepieces/pieces-framework": "0.22.2",
20
+ "@activepieces/shared": "0.30.3"
21
+ },
22
+ "resolutions": {
23
+ "rollup": "npm:@rollup/wasm-node"
24
+ }
25
+ }
package/src/index.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ export declare const digitalPilotAuth: import("@activepieces/pieces-framework").SecretTextProperty<true>;
2
+ export declare const digitalPilot: import("@activepieces/pieces-framework").Piece<import("@activepieces/pieces-framework").SecretTextProperty<true>>;
package/src/index.js ADDED
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.digitalPilot = exports.digitalPilotAuth = void 0;
4
+ const pieces_framework_1 = require("@activepieces/pieces-framework");
5
+ const add_target_account_1 = require("./lib/actions/add-target-account");
6
+ const remove_target_account_1 = require("./lib/actions/remove-target-account");
7
+ const new_high_intent_visit_1 = require("./lib/triggers/new-high-intent-visit");
8
+ const new_target_account_visit_1 = require("./lib/triggers/new-target-account-visit");
9
+ exports.digitalPilotAuth = pieces_framework_1.PieceAuth.SecretText({
10
+ displayName: 'API Key',
11
+ description: 'Enter your DigitalPilot API key',
12
+ required: true,
13
+ });
14
+ exports.digitalPilot = (0, pieces_framework_1.createPiece)({
15
+ displayName: 'DigitalPilot',
16
+ auth: exports.digitalPilotAuth,
17
+ minimumSupportedRelease: '0.36.1',
18
+ logoUrl: 'https://cdn.activepieces.com/pieces/digital-pilot.png',
19
+ authors: ["onyedikachi-david"],
20
+ actions: [add_target_account_1.addTargetAccountAction, remove_target_account_1.removeTargetAccountAction],
21
+ triggers: [new_high_intent_visit_1.newHighIntentVisitTrigger, new_target_account_visit_1.newTargetAccountVisitTrigger],
22
+ });
23
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/pieces/community/digital-pilot/src/index.ts"],"names":[],"mappings":";;;AAAA,qEAAwE;AACxE,yEAA0E;AAC1E,+EAAgF;AAChF,gFAAiF;AACjF,sFAAuF;AAE1E,QAAA,gBAAgB,GAAG,4BAAS,CAAC,UAAU,CAAC;IACnD,WAAW,EAAE,SAAS;IACtB,WAAW,EAAE,iCAAiC;IAC9C,QAAQ,EAAE,IAAI;CACf,CAAC,CAAC;AAEU,QAAA,YAAY,GAAG,IAAA,8BAAW,EAAC;IACtC,WAAW,EAAE,cAAc;IAC3B,IAAI,EAAE,wBAAgB;IACtB,uBAAuB,EAAE,QAAQ;IACjC,OAAO,EAAE,uDAAuD;IAChE,OAAO,EAAE,CAAC,mBAAmB,CAAC;IAC9B,OAAO,EAAE,CAAC,2CAAsB,EAAE,iDAAyB,CAAC;IAC5D,QAAQ,EAAE,CAAC,iDAAyB,EAAE,uDAA4B,CAAC;CACpE,CAAC,CAAC"}
@@ -0,0 +1,5 @@
1
+ export declare const addTargetAccountAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").SecretTextProperty<true>, {
2
+ tagId: import("@activepieces/pieces-framework").ShortTextProperty<true>;
3
+ listId: import("@activepieces/pieces-framework").ShortTextProperty<true>;
4
+ domain: import("@activepieces/pieces-framework").ShortTextProperty<true>;
5
+ }>;
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.addTargetAccountAction = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const pieces_framework_1 = require("@activepieces/pieces-framework");
6
+ const index_1 = require("../../index");
7
+ const common_1 = require("../common");
8
+ exports.addTargetAccountAction = (0, pieces_framework_1.createAction)({
9
+ auth: index_1.digitalPilotAuth,
10
+ name: 'add_target_account',
11
+ displayName: 'Add Target Account',
12
+ description: 'Add a target account to a list',
13
+ props: {
14
+ tagId: common_1.tagIdProp,
15
+ listId: common_1.listIdProp,
16
+ domain: pieces_framework_1.Property.ShortText({
17
+ displayName: 'Domain',
18
+ description: 'Account domain name (e.g., example.com)',
19
+ required: true,
20
+ }),
21
+ },
22
+ run(context) {
23
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
24
+ const client = (0, common_1.makeClient)(context.auth.secret_text);
25
+ yield client.addTargetAccount(context.propsValue.tagId, context.propsValue.listId, context.propsValue.domain);
26
+ return {
27
+ success: true,
28
+ message: 'Target account added successfully',
29
+ };
30
+ });
31
+ },
32
+ });
33
+ //# sourceMappingURL=add-target-account.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"add-target-account.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/digital-pilot/src/lib/actions/add-target-account.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,uCAA+C;AAC/C,sCAA8D;AAEjD,QAAA,sBAAsB,GAAG,IAAA,+BAAY,EAAC;IACjD,IAAI,EAAE,wBAAgB;IACtB,IAAI,EAAE,oBAAoB;IAC1B,WAAW,EAAE,oBAAoB;IACjC,WAAW,EAAE,gCAAgC;IAC7C,KAAK,EAAE;QACL,KAAK,EAAE,kBAAS;QAChB,MAAM,EAAE,mBAAU;QAClB,MAAM,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACzB,WAAW,EAAE,QAAQ;YACrB,WAAW,EAAE,yCAAyC;YACtD,QAAQ,EAAE,IAAI;SACf,CAAC;KACH;IACK,GAAG,CAAC,OAAO;;YACf,MAAM,MAAM,GAAG,IAAA,mBAAU,EAAC,OAAO,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;YACpD,MAAM,MAAM,CAAC,gBAAgB,CAC3B,OAAO,CAAC,UAAU,CAAC,KAAe,EAClC,OAAO,CAAC,UAAU,CAAC,MAAgB,EACnC,OAAO,CAAC,UAAU,CAAC,MAAM,CAC1B,CAAC;YACF,OAAO;gBACL,OAAO,EAAE,IAAI;gBACb,OAAO,EAAE,mCAAmC;aAC7C,CAAC;QACJ,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { addTargetAccountAction } from './add-target-account';
2
+ export { removeTargetAccountAction } from './remove-target-account';
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.removeTargetAccountAction = exports.addTargetAccountAction = void 0;
4
+ var add_target_account_1 = require("./add-target-account");
5
+ Object.defineProperty(exports, "addTargetAccountAction", { enumerable: true, get: function () { return add_target_account_1.addTargetAccountAction; } });
6
+ var remove_target_account_1 = require("./remove-target-account");
7
+ Object.defineProperty(exports, "removeTargetAccountAction", { enumerable: true, get: function () { return remove_target_account_1.removeTargetAccountAction; } });
8
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/digital-pilot/src/lib/actions/index.ts"],"names":[],"mappings":";;;AAAA,2DAA8D;AAArD,4HAAA,sBAAsB,OAAA;AAC/B,iEAAoE;AAA3D,kIAAA,yBAAyB,OAAA"}
@@ -0,0 +1,5 @@
1
+ export declare const removeTargetAccountAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").SecretTextProperty<true>, {
2
+ tagId: import("@activepieces/pieces-framework").ShortTextProperty<true>;
3
+ listId: import("@activepieces/pieces-framework").ShortTextProperty<true>;
4
+ domain: import("@activepieces/pieces-framework").ShortTextProperty<true>;
5
+ }>;
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.removeTargetAccountAction = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const pieces_framework_1 = require("@activepieces/pieces-framework");
6
+ const index_1 = require("../../index");
7
+ const common_1 = require("../common");
8
+ exports.removeTargetAccountAction = (0, pieces_framework_1.createAction)({
9
+ auth: index_1.digitalPilotAuth,
10
+ name: 'remove_target_account',
11
+ displayName: 'Remove Target Account',
12
+ description: 'Remove a target account from a list',
13
+ props: {
14
+ tagId: common_1.tagIdProp,
15
+ listId: common_1.listIdProp,
16
+ domain: pieces_framework_1.Property.ShortText({
17
+ displayName: 'Domain',
18
+ description: 'Account domain name (e.g., example.com)',
19
+ required: true,
20
+ }),
21
+ },
22
+ run(context) {
23
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
24
+ const client = (0, common_1.makeClient)(context.auth.secret_text);
25
+ yield client.removeTargetAccount(context.propsValue.tagId, context.propsValue.listId, context.propsValue.domain);
26
+ return {
27
+ success: true,
28
+ message: 'Target account removed successfully',
29
+ };
30
+ });
31
+ },
32
+ });
33
+ //# sourceMappingURL=remove-target-account.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"remove-target-account.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/digital-pilot/src/lib/actions/remove-target-account.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,uCAA+C;AAC/C,sCAA8D;AAEjD,QAAA,yBAAyB,GAAG,IAAA,+BAAY,EAAC;IACpD,IAAI,EAAE,wBAAgB;IACtB,IAAI,EAAE,uBAAuB;IAC7B,WAAW,EAAE,uBAAuB;IACpC,WAAW,EAAE,qCAAqC;IAClD,KAAK,EAAE;QACL,KAAK,EAAE,kBAAS;QAChB,MAAM,EAAE,mBAAU;QAClB,MAAM,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACzB,WAAW,EAAE,QAAQ;YACrB,WAAW,EAAE,yCAAyC;YACtD,QAAQ,EAAE,IAAI;SACf,CAAC;KACH;IACK,GAAG,CAAC,OAAO;;YACf,MAAM,MAAM,GAAG,IAAA,mBAAU,EAAC,OAAO,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;YACpD,MAAM,MAAM,CAAC,mBAAmB,CAC9B,OAAO,CAAC,UAAU,CAAC,KAAe,EAClC,OAAO,CAAC,UAAU,CAAC,MAAgB,EACnC,OAAO,CAAC,UAAU,CAAC,MAAM,CAC1B,CAAC;YACF,OAAO;gBACL,OAAO,EAAE,IAAI;gBACb,OAAO,EAAE,qCAAqC;aAC/C,CAAC;QACJ,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -0,0 +1,12 @@
1
+ export interface DigitalPilotClient {
2
+ addTargetAccount(tagId: string, listId: string, domain: string): Promise<void>;
3
+ removeTargetAccount(tagId: string, listId: string, domain: string): Promise<void>;
4
+ createWebhook(tagId: string, webhookURL: string, subscriptions: 'target_accounts' | 'high_intent'): Promise<WebhookResponse>;
5
+ deleteWebhook(tagId: string, webhookURL?: string, webhookID?: string): Promise<void>;
6
+ }
7
+ export interface WebhookResponse {
8
+ id: string;
9
+ url: string;
10
+ subscriptions: string;
11
+ }
12
+ export declare function makeClient(auth: string): DigitalPilotClient;
@@ -0,0 +1,185 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.makeClient = makeClient;
4
+ const tslib_1 = require("tslib");
5
+ const pieces_common_1 = require("@activepieces/pieces-common");
6
+ const BASE_URL = 'https://api.digitalpilot.app/v1';
7
+ class DigitalPilotClientImpl {
8
+ constructor(apiKey) {
9
+ this.apiKey = apiKey;
10
+ }
11
+ addTargetAccount(tagId, listId, domain) {
12
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
13
+ const request = {
14
+ method: pieces_common_1.HttpMethod.POST,
15
+ url: `${BASE_URL}/tags/${tagId}/target-accounts/${listId}`,
16
+ headers: {
17
+ 'Content-Type': 'application/json',
18
+ },
19
+ body: {
20
+ domain,
21
+ },
22
+ authentication: {
23
+ type: pieces_common_1.AuthenticationType.BEARER_TOKEN,
24
+ token: this.apiKey,
25
+ },
26
+ };
27
+ const response = yield pieces_common_1.httpClient.sendRequest(request);
28
+ if (response.status === 200) {
29
+ return;
30
+ }
31
+ let errorMessage = 'Unknown error occurred';
32
+ switch (response.status) {
33
+ case 400:
34
+ errorMessage = 'Invalid input. Please check your parameters.';
35
+ break;
36
+ case 401:
37
+ errorMessage = 'Authentication failed. Please check your API key.';
38
+ break;
39
+ case 404:
40
+ errorMessage = 'Tag or list not found. Please verify your selection.';
41
+ break;
42
+ case 429:
43
+ errorMessage = 'Rate limit exceeded. Please try again later.';
44
+ break;
45
+ case 500:
46
+ errorMessage = 'DigitalPilot server error. Please try again later.';
47
+ break;
48
+ }
49
+ throw new Error(errorMessage);
50
+ });
51
+ }
52
+ removeTargetAccount(tagId, listId, domain) {
53
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
54
+ const request = {
55
+ method: pieces_common_1.HttpMethod.DELETE,
56
+ url: `${BASE_URL}/tags/${tagId}/target-accounts/${listId}`,
57
+ headers: {
58
+ 'Content-Type': 'application/json',
59
+ },
60
+ body: {
61
+ domain,
62
+ },
63
+ authentication: {
64
+ type: pieces_common_1.AuthenticationType.BEARER_TOKEN,
65
+ token: this.apiKey,
66
+ },
67
+ };
68
+ const response = yield pieces_common_1.httpClient.sendRequest(request);
69
+ if (response.status === 200) {
70
+ return;
71
+ }
72
+ let errorMessage = 'Unknown error occurred';
73
+ switch (response.status) {
74
+ case 400:
75
+ errorMessage = 'Invalid input. Please check your parameters.';
76
+ break;
77
+ case 401:
78
+ errorMessage = 'Authentication failed. Please check your API key.';
79
+ break;
80
+ case 404:
81
+ errorMessage = 'Tag or list not found. Please verify your selection.';
82
+ break;
83
+ case 429:
84
+ errorMessage = 'Rate limit exceeded. Please try again later.';
85
+ break;
86
+ case 500:
87
+ errorMessage = 'DigitalPilot server error. Please try again later.';
88
+ break;
89
+ }
90
+ throw new Error(errorMessage);
91
+ });
92
+ }
93
+ createWebhook(tagId, webhookURL, subscriptions) {
94
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
95
+ const request = {
96
+ method: pieces_common_1.HttpMethod.POST,
97
+ url: `${BASE_URL}/tags/${tagId}/webhooks`,
98
+ headers: {
99
+ 'Content-Type': 'application/json',
100
+ },
101
+ body: {
102
+ webhookURL,
103
+ subscriptions,
104
+ },
105
+ authentication: {
106
+ type: pieces_common_1.AuthenticationType.BEARER_TOKEN,
107
+ token: this.apiKey,
108
+ },
109
+ };
110
+ const response = yield pieces_common_1.httpClient.sendRequest(request);
111
+ if (response.status === 200) {
112
+ return response.body;
113
+ }
114
+ let errorMessage = 'Failed to register webhook';
115
+ switch (response.status) {
116
+ case 400:
117
+ errorMessage = 'Invalid webhook parameters. Please check your inputs.';
118
+ break;
119
+ case 401:
120
+ errorMessage = 'Authentication failed. Please check your API key.';
121
+ break;
122
+ case 404:
123
+ errorMessage = 'Tag not found. Please verify your selection.';
124
+ break;
125
+ case 429:
126
+ errorMessage = 'Rate limit exceeded. Please try again later.';
127
+ break;
128
+ case 500:
129
+ errorMessage = 'DigitalPilot server error. Please try again later.';
130
+ break;
131
+ }
132
+ throw new Error(errorMessage);
133
+ });
134
+ }
135
+ deleteWebhook(tagId, webhookURL, webhookID) {
136
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
137
+ const body = {};
138
+ if (webhookURL) {
139
+ body.webhookURL = webhookURL;
140
+ }
141
+ if (webhookID) {
142
+ body.webhookID = webhookID;
143
+ }
144
+ const request = {
145
+ method: pieces_common_1.HttpMethod.DELETE,
146
+ url: `${BASE_URL}/tags/${tagId}/webhooks`,
147
+ headers: {
148
+ 'Content-Type': 'application/json',
149
+ },
150
+ body,
151
+ authentication: {
152
+ type: pieces_common_1.AuthenticationType.BEARER_TOKEN,
153
+ token: this.apiKey,
154
+ },
155
+ };
156
+ const response = yield pieces_common_1.httpClient.sendRequest(request);
157
+ if (response.status === 200) {
158
+ return;
159
+ }
160
+ let errorMessage = 'Failed to delete webhook';
161
+ switch (response.status) {
162
+ case 400:
163
+ errorMessage = 'Invalid webhook parameters.';
164
+ break;
165
+ case 401:
166
+ errorMessage = 'Authentication failed. Please check your API key.';
167
+ break;
168
+ case 404:
169
+ errorMessage = 'Webhook not found.';
170
+ break;
171
+ case 429:
172
+ errorMessage = 'Rate limit exceeded.';
173
+ break;
174
+ case 500:
175
+ errorMessage = 'DigitalPilot server error.';
176
+ break;
177
+ }
178
+ console.warn(`Webhook deletion warning: ${errorMessage}`);
179
+ });
180
+ }
181
+ }
182
+ function makeClient(auth) {
183
+ return new DigitalPilotClientImpl(auth);
184
+ }
185
+ //# sourceMappingURL=client.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/digital-pilot/src/lib/common/client.ts"],"names":[],"mappings":";;AAiOA,gCAEC;;AAnOD,+DAKqC;AAErC,MAAM,QAAQ,GAAG,iCAAiC,CAAC;AAenD,MAAM,sBAAsB;IAC1B,YAA6B,MAAc;QAAd,WAAM,GAAN,MAAM,CAAQ;IAAG,CAAC;IAEzC,gBAAgB,CACpB,KAAa,EACb,MAAc,EACd,MAAc;;YAEd,MAAM,OAAO,GAAgB;gBAC3B,MAAM,EAAE,0BAAU,CAAC,IAAI;gBACvB,GAAG,EAAE,GAAG,QAAQ,SAAS,KAAK,oBAAoB,MAAM,EAAE;gBAC1D,OAAO,EAAE;oBACP,cAAc,EAAE,kBAAkB;iBACnC;gBACD,IAAI,EAAE;oBACJ,MAAM;iBACP;gBACD,cAAc,EAAE;oBACd,IAAI,EAAE,kCAAkB,CAAC,YAAY;oB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ACN,YAAY,GAAG,oBAAoB,CAAC;oBACpC,MAAM;gBACR,KAAK,GAAG;oBACN,YAAY,GAAG,sBAAsB,CAAC;oBACtC,MAAM;gBACR,KAAK,GAAG;oBACN,YAAY,GAAG,4BAA4B,CAAC;oBAC5C,MAAM;YACV,CAAC;YAED,OAAO,CAAC,IAAI,CAAC,6BAA6B,YAAY,EAAE,CAAC,CAAC;QAC5D,CAAC;KAAA;CACF;AAED,SAAgB,UAAU,CAAC,IAAY;IACrC,OAAO,IAAI,sBAAsB,CAAC,IAAI,CAAC,CAAC;AAC1C,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { makeClient, type DigitalPilotClient } from './client';
2
+ export { tagIdProp, listIdProp } from './props';
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.listIdProp = exports.tagIdProp = exports.makeClient = void 0;
4
+ var client_1 = require("./client");
5
+ Object.defineProperty(exports, "makeClient", { enumerable: true, get: function () { return client_1.makeClient; } });
6
+ var props_1 = require("./props");
7
+ Object.defineProperty(exports, "tagIdProp", { enumerable: true, get: function () { return props_1.tagIdProp; } });
8
+ Object.defineProperty(exports, "listIdProp", { enumerable: true, get: function () { return props_1.listIdProp; } });
9
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/digital-pilot/src/lib/common/index.ts"],"names":[],"mappings":";;;AAAA,mCAA+D;AAAtD,oGAAA,UAAU,OAAA;AACnB,iCAAgD;AAAvC,kGAAA,SAAS,OAAA;AAAE,mGAAA,UAAU,OAAA"}
@@ -0,0 +1,2 @@
1
+ export declare const tagIdProp: import("@activepieces/pieces-framework").ShortTextProperty<true>;
2
+ export declare const listIdProp: import("@activepieces/pieces-framework").ShortTextProperty<true>;
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.listIdProp = exports.tagIdProp = void 0;
4
+ const pieces_framework_1 = require("@activepieces/pieces-framework");
5
+ exports.tagIdProp = pieces_framework_1.Property.ShortText({
6
+ displayName: 'Tag ID',
7
+ description: 'The ID of the tag',
8
+ required: true,
9
+ });
10
+ exports.listIdProp = pieces_framework_1.Property.ShortText({
11
+ displayName: 'List ID',
12
+ description: 'The ID of the list',
13
+ required: true,
14
+ });
15
+ //# sourceMappingURL=props.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"props.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/digital-pilot/src/lib/common/props.ts"],"names":[],"mappings":";;;AAAA,qEAA0D;AAE7C,QAAA,SAAS,GAAG,2BAAQ,CAAC,SAAS,CAAC;IAC1C,WAAW,EAAE,QAAQ;IACrB,WAAW,EAAE,mBAAmB;IAChC,QAAQ,EAAE,IAAI;CACf,CAAC,CAAC;AAEU,QAAA,UAAU,GAAG,2BAAQ,CAAC,SAAS,CAAC;IAC3C,WAAW,EAAE,SAAS;IACtB,WAAW,EAAE,oBAAoB;IACjC,QAAQ,EAAE,IAAI;CACf,CAAC,CAAC"}
@@ -0,0 +1,8 @@
1
+ import { TriggerStrategy } from '@activepieces/pieces-framework';
2
+ export declare const newHighIntentVisitTrigger: import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.WEBHOOK, import("@activepieces/pieces-framework").SecretTextProperty<true>, {
3
+ tagId: import("@activepieces/pieces-framework").ShortTextProperty<true>;
4
+ }> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.POLLING, import("@activepieces/pieces-framework").SecretTextProperty<true>, {
5
+ tagId: import("@activepieces/pieces-framework").ShortTextProperty<true>;
6
+ }> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.APP_WEBHOOK, import("@activepieces/pieces-framework").SecretTextProperty<true>, {
7
+ tagId: import("@activepieces/pieces-framework").ShortTextProperty<true>;
8
+ }>;
@@ -0,0 +1,47 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.newHighIntentVisitTrigger = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const pieces_framework_1 = require("@activepieces/pieces-framework");
6
+ const index_1 = require("../../index");
7
+ const common_1 = require("../common");
8
+ exports.newHighIntentVisitTrigger = (0, pieces_framework_1.createTrigger)({
9
+ auth: index_1.digitalPilotAuth,
10
+ name: 'new_high_intent_visit',
11
+ displayName: 'New High Intent Visit',
12
+ description: 'Triggers when a business exhibits high intent behavior on your website',
13
+ type: pieces_framework_1.TriggerStrategy.WEBHOOK,
14
+ props: {
15
+ tagId: common_1.tagIdProp,
16
+ },
17
+ sampleData: {
18
+ domain: 'example.com',
19
+ timestamp: '2024-01-15T10:30:00Z',
20
+ intent_score: 85,
21
+ page_views: 12,
22
+ time_on_site: 450,
23
+ },
24
+ onEnable(context) {
25
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
26
+ const client = (0, common_1.makeClient)(context.auth.secret_text);
27
+ const webhookUrl = context.webhookUrl;
28
+ const webhook = yield client.createWebhook(context.propsValue.tagId, webhookUrl, 'high_intent');
29
+ yield context.store.put('_webhook_id', webhook.id);
30
+ });
31
+ },
32
+ onDisable(context) {
33
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
34
+ const client = (0, common_1.makeClient)(context.auth.secret_text);
35
+ const webhookId = yield context.store.get('_webhook_id');
36
+ if (webhookId) {
37
+ yield client.deleteWebhook(context.propsValue.tagId, undefined, webhookId);
38
+ }
39
+ });
40
+ },
41
+ run(context) {
42
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
43
+ return [context.payload.body];
44
+ });
45
+ },
46
+ });
47
+ //# sourceMappingURL=new-high-intent-visit.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"new-high-intent-visit.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/digital-pilot/src/lib/triggers/new-high-intent-visit.ts"],"names":[],"mappings":";;;;AAAA,qEAAgF;AAChF,uCAA+C;AAC/C,sCAAkD;AAErC,QAAA,yBAAyB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0,0 +1,8 @@
1
+ import { TriggerStrategy } from '@activepieces/pieces-framework';
2
+ export declare const newTargetAccountVisitTrigger: import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.WEBHOOK, import("@activepieces/pieces-framework").SecretTextProperty<true>, {
3
+ tagId: import("@activepieces/pieces-framework").ShortTextProperty<true>;
4
+ }> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.POLLING, import("@activepieces/pieces-framework").SecretTextProperty<true>, {
5
+ tagId: import("@activepieces/pieces-framework").ShortTextProperty<true>;
6
+ }> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.APP_WEBHOOK, import("@activepieces/pieces-framework").SecretTextProperty<true>, {
7
+ tagId: import("@activepieces/pieces-framework").ShortTextProperty<true>;
8
+ }>;
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.newTargetAccountVisitTrigger = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const pieces_framework_1 = require("@activepieces/pieces-framework");
6
+ const index_1 = require("../../index");
7
+ const common_1 = require("../common");
8
+ exports.newTargetAccountVisitTrigger = (0, pieces_framework_1.createTrigger)({
9
+ auth: index_1.digitalPilotAuth,
10
+ name: 'new_target_account_visit',
11
+ displayName: 'New Target Account Visit',
12
+ description: 'Triggers when a business you\'ve identified as a high-priority target account browses your site',
13
+ type: pieces_framework_1.TriggerStrategy.WEBHOOK,
14
+ props: {
15
+ tagId: common_1.tagIdProp,
16
+ },
17
+ sampleData: {
18
+ domain: 'acme-corp.com',
19
+ timestamp: '2024-01-15T14:22:00Z',
20
+ page_views: 8,
21
+ time_on_site: 320,
22
+ pages_visited: [
23
+ '/products',
24
+ '/pricing',
25
+ '/contact'
26
+ ],
27
+ },
28
+ onEnable(context) {
29
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
30
+ const client = (0, common_1.makeClient)(context.auth.secret_text);
31
+ const webhookUrl = context.webhookUrl;
32
+ const webhook = yield client.createWebhook(context.propsValue.tagId, webhookUrl, 'target_accounts');
33
+ yield context.store.put('_webhook_id', webhook.id);
34
+ });
35
+ },
36
+ onDisable(context) {
37
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
38
+ const client = (0, common_1.makeClient)(context.auth.secret_text);
39
+ const webhookId = yield context.store.get('_webhook_id');
40
+ if (webhookId) {
41
+ yield client.deleteWebhook(context.propsValue.tagId, undefined, webhookId);
42
+ }
43
+ });
44
+ },
45
+ run(context) {
46
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
47
+ return [context.payload.body];
48
+ });
49
+ },
50
+ });
51
+ //# sourceMappingURL=new-target-account-visit.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"new-target-account-visit.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/digital-pilot/src/lib/triggers/new-target-account-visit.ts"],"names":[],"mappings":";;;;AAAA,qEAAgF;AAChF,uCAA+C;AAC/C,sCAAkD;AAErC,QAAA,4BAA4B,GAAG,IAAA,gCAAa,EAAC;IACxD,IAAI,EAAE,wBAAgB;IACtB,IAAI,EAAE,0BAA0B;IAChC,WAAW,EAAE,0BAA0B;IACvC,WAAW,EAAE,iGAAiG;IAC9G,IAAI,EAAE,kCAAe,CAAC,OAAO;IAC7B,KAAK,EAAE;QACL,KAAK,EAAE,kBAAS;KACjB;IACD,UAAU,EAAE;QACV,MAAM,EAAE,eAAe;QACvB,SAAS,EAAE,sBAAsB;QACjC,UAAU,EAAE,CAAC;QACb,YAAY,EAAE,GAAG;QACjB,aAAa,EAAE;YACb,WAAW;YACX,UAAU;YACV,UAAU;SACX;KACF;IAEK,QAAQ,CAAC,OAAO;;YACpB,MAAM,MAAM,GAAG,IAAA,mBAAU,EAAC,OAAO,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;YACpD,MAAM,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC;YAEtC,MAAM,OAAO,GAAG,MAAM,MAAM,CAAC,aAAa,CACxC,OAAO,CAAC,UAAU,CAAC,K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