@activepieces/piece-drip 0.2.0 → 0.2.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/package.json +5 -5
- package/src/index.d.ts +1 -1
- package/src/index.js +2 -2
- package/src/index.js.map +1 -1
- package/src/lib/actions/add-subscriber-to-campaign.action.d.ts +1 -1
- package/src/lib/actions/add-subscriber-to-campaign.action.js +8 -7
- package/src/lib/actions/add-subscriber-to-campaign.action.js.map +1 -1
- package/src/lib/actions/apply-tag-to-subscriber.action.d.ts +1 -1
- package/src/lib/actions/apply-tag-to-subscriber.action.js +6 -5
- package/src/lib/actions/apply-tag-to-subscriber.action.js.map +1 -1
- package/src/lib/actions/upsert-subscriber.action.d.ts +1 -1
- package/src/lib/actions/upsert-subscriber.action.js +13 -12
- package/src/lib/actions/upsert-subscriber.action.js.map +1 -1
- package/src/lib/common/index.d.ts +5 -5
- package/src/lib/common/index.js +9 -8
- package/src/lib/common/index.js.map +1 -1
- package/src/lib/trigger/new-subscriber.trigger.d.ts +1 -1
- package/src/lib/trigger/new-subscriber.trigger.js +8 -8
- package/src/lib/trigger/new-subscriber.trigger.js.map +1 -1
- package/src/lib/trigger/new-tag.trigger.d.ts +1 -1
- package/src/lib/trigger/new-tag.trigger.js +8 -8
- package/src/lib/trigger/new-tag.trigger.js.map +1 -1
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@activepieces/piece-drip",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"dependencies": {
|
|
5
|
-
"@sinclair/typebox": "0.
|
|
5
|
+
"@sinclair/typebox": "0.26.8",
|
|
6
6
|
"axios": "1.2.4",
|
|
7
|
-
"cron-validator": "1.3.1",
|
|
8
7
|
"nanoid": "3.3.4",
|
|
9
|
-
"@activepieces/framework": "0.
|
|
10
|
-
"@activepieces/shared": "0.
|
|
8
|
+
"@activepieces/pieces-framework": "0.3.13",
|
|
9
|
+
"@activepieces/shared": "0.3.11",
|
|
10
|
+
"@activepieces/pieces-common": "0.0.1",
|
|
11
11
|
"tslib": "2.4.1"
|
|
12
12
|
},
|
|
13
13
|
"main": "./src/index.js",
|
package/src/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const drip: import("@activepieces/framework").Piece;
|
|
1
|
+
export declare const drip: import("@activepieces/pieces-framework").Piece;
|
package/src/index.js
CHANGED
|
@@ -3,13 +3,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.drip = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const package_json_1 = tslib_1.__importDefault(require("../package.json"));
|
|
6
|
-
const
|
|
6
|
+
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
7
7
|
const add_subscriber_to_campaign_action_1 = require("./lib/actions/add-subscriber-to-campaign.action");
|
|
8
8
|
const apply_tag_to_subscriber_action_1 = require("./lib/actions/apply-tag-to-subscriber.action");
|
|
9
9
|
const upsert_subscriber_action_1 = require("./lib/actions/upsert-subscriber.action");
|
|
10
10
|
const new_subscriber_trigger_1 = require("./lib/trigger/new-subscriber.trigger");
|
|
11
11
|
const new_tag_trigger_1 = require("./lib/trigger/new-tag.trigger");
|
|
12
|
-
exports.drip = (0,
|
|
12
|
+
exports.drip = (0, pieces_framework_1.createPiece)({
|
|
13
13
|
name: 'drip',
|
|
14
14
|
displayName: 'Drip',
|
|
15
15
|
logoUrl: 'https://cdn.activepieces.com/pieces/drip.png',
|
package/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../packages/pieces/drip/src/index.ts"],"names":[],"mappings":";;;;AAAA,2EAA0C;AAC1C,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../packages/pieces/drip/src/index.ts"],"names":[],"mappings":";;;;AAAA,2EAA0C;AAC1C,qEAA6D;AAC7D,uGAA8F;AAC9F,iGAAwF;AACxF,qFAAoF;AACpF,iFAA8E;AAC9E,mEAAoE;AAGvD,QAAA,IAAI,GAAG,IAAA,8BAAW,EAAC;IAC/B,IAAI,EAAE,MAAM;IACZ,WAAW,EAAE,MAAM;IACnB,OAAO,EAAE,8CAA8C;IACvD,OAAO,EAAE,sBAAW,CAAC,OAAO;IAC5B,OAAO,EAAE,CAAC,sBAAsB,CAAC;IACjC,OAAO,EAAE,CAAC,yDAAwB,EAAE,+DAA2B,EAAE,qDAA0B,CAAC;IAC5F,QAAQ,EAAE,CAAC,+CAAsB,EAAE,qCAAmB,CAAC;CACvD,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const dripAddSubscriberToCampaign: import("@activepieces/framework").Action;
|
|
1
|
+
export declare const dripAddSubscriberToCampaign: import("@activepieces/pieces-framework").Action;
|
|
@@ -2,16 +2,17 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.dripAddSubscriberToCampaign = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const
|
|
5
|
+
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
+
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
6
7
|
const common_1 = require("../common");
|
|
7
|
-
exports.dripAddSubscriberToCampaign = (0,
|
|
8
|
+
exports.dripAddSubscriberToCampaign = (0, pieces_framework_1.createAction)({
|
|
8
9
|
name: 'add_subscriber_to_campaign',
|
|
9
10
|
description: 'Add a subscriber to a campaign (Email series)',
|
|
10
11
|
displayName: 'Add a subscriber to a campaign',
|
|
11
12
|
props: {
|
|
12
13
|
authentication: common_1.dripCommon.authentication,
|
|
13
14
|
account_id: common_1.dripCommon.account_id,
|
|
14
|
-
campaign_id:
|
|
15
|
+
campaign_id: pieces_framework_1.Property.Dropdown({
|
|
15
16
|
displayName: "Email Series Campaign",
|
|
16
17
|
refreshers: ["authentication", "account_id"],
|
|
17
18
|
required: true,
|
|
@@ -31,13 +32,13 @@ exports.dripAddSubscriberToCampaign = (0, framework_1.createAction)({
|
|
|
31
32
|
};
|
|
32
33
|
}
|
|
33
34
|
const request = {
|
|
34
|
-
method:
|
|
35
|
+
method: pieces_common_1.HttpMethod.GET,
|
|
35
36
|
url: `${common_1.dripCommon.baseUrl(props['account_id'])}/campaigns`,
|
|
36
37
|
headers: {
|
|
37
38
|
Authorization: `Basic ${Buffer.from(props["authentication"]).toString("base64")}`,
|
|
38
39
|
},
|
|
39
40
|
};
|
|
40
|
-
const response = yield
|
|
41
|
+
const response = yield pieces_common_1.httpClient.sendRequest(request);
|
|
41
42
|
const opts = response.body.campaigns.map((campaign) => {
|
|
42
43
|
return { value: campaign.id, label: campaign.name };
|
|
43
44
|
});
|
|
@@ -104,7 +105,7 @@ exports.dripAddSubscriberToCampaign = (0, framework_1.createAction)({
|
|
|
104
105
|
run(context) {
|
|
105
106
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
106
107
|
const request = {
|
|
107
|
-
method:
|
|
108
|
+
method: pieces_common_1.HttpMethod.POST,
|
|
108
109
|
url: `${common_1.dripCommon.baseUrl(context.propsValue["account_id"])}/campaigns/${context.propsValue["campaign_id"]}/subscribers`,
|
|
109
110
|
body: {
|
|
110
111
|
subscribers: [{
|
|
@@ -118,7 +119,7 @@ exports.dripAddSubscriberToCampaign = (0, framework_1.createAction)({
|
|
|
118
119
|
},
|
|
119
120
|
queryParams: {},
|
|
120
121
|
};
|
|
121
|
-
return yield
|
|
122
|
+
return yield pieces_common_1.httpClient.sendRequest(request);
|
|
122
123
|
});
|
|
123
124
|
}
|
|
124
125
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"add-subscriber-to-campaign.action.js","sourceRoot":"","sources":["../../../../../../../packages/pieces/drip/src/lib/actions/add-subscriber-to-campaign.action.ts"],"names":[],"mappings":";;;;AAAA,
|
|
1
|
+
{"version":3,"file":"add-subscriber-to-campaign.action.js","sourceRoot":"","sources":["../../../../../../../packages/pieces/drip/src/lib/actions/add-subscriber-to-campaign.action.ts"],"names":[],"mappings":";;;;AAAA,qEAAsE;AACtE,+DAAiF;AACjF,sCAAuC;AAE1B,QAAA,2BAA2B,GAAG,IAAA,+BAAY,EAAC;IACpD,IAAI,EAAE,4BAA4B;IAClC,WAAW,EAAE,+CAA+C;IAC5D,WAAW,EAAE,gCAAgC;IAC7C,KAAK,EAAE;QACH,cAAc,EAAE,mBAAU,CAAC,cAAc;QACzC,UAAU,EAAE,mBAAU,CAAC,UAAU;QACjC,WAAW,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YAC3B,WAAW,EAAE,uBAAuB;YACpC,UAAU,EAAE,CAAC,gBAAgB,EAAE,YAAY,CAAC;YAC5C,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE,CAAO,KAAK,EAAE,EAAE;gBACrB,IAAI,CAAC,KAAK,CAAC,gBAAgB,CAAC,EAAE;oBAC1B,OAAO;wBACH,QAAQ,EAAE,IAAI;wBACd,OAAO,EAAE,EAAE;wBACX,WAAW,EAAE,8BAA8B;qBAC9C,CAAA;iBACJ;gBACD,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,EAAE;oBACtB,OAAO;wBACH,QAAQ,EAAE,IAAI;wBACd,OAAO,EAAE,EAAE;wBACX,WAAW,EAAE,gCAAgC;qBAChD,CAAA;iBACJ;gBACD,MAAM,OAAO,GAAgB;oBACzB,MAAM,EAAE,0BAAU,CAAC,GAAG;oBACtB,GAAG,EAAE,GAAG,mBAAU,CAAC,OAAO,CAAC,KAAK,CAAC,YAAY,CAAW,CAAC,YAAY;oBACrE,OAAO,EAAE;wBACL,aAAa,EAAE,SAAS,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,gBAAgB,CAAW,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE;qBAC9F;iBACJ,CAAC;gBACF,MAAM,QAAQ,GAAG,MAAM,0BAAU,CAAC,WA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AAY;gBAC1B,YAAY,EAAE,iBAAiB;gBAC/B,gBAAgB,EAAE,IAAI;gBACtB,mBAAmB,EAAE,IAAI;gBACzB,aAAa,EAAE,IAAI;gBACnB,UAAU,EAAE,KAAK;gBACjB,iBAAiB,EAAE,IAAI;gBACvB,YAAY,EAAE,SAAS;gBACvB,YAAY,EAAE,cAAc;gBAC5B,aAAa,EAAE,KAAK;gBACpB,YAAY,EAAE,IAAI;gBAClB,SAAS,EAAE,IAAI;gBACf,OAAO,EAAE;oBACL,SAAS,EAAE,UAAU;iBACxB;aACJ;SACJ;KACJ;IAEK,GAAG,CAAC,OAAO;;YACb,MAAM,OAAO,GAAgB;gBACzB,MAAM,EAAE,0BAAU,CAAC,IAAI;gBACvB,GAAG,EAAE,GAAG,mBAAU,CAAC,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC,YAAY,CAAE,CAAC,cAAc,OAAO,CAAC,UAAU,CAAC,aAAa,CAAC,cAAc;gBAC1H,IAAI,EAAE;oBACF,WAAW,EAAE,CAAC;4BACV,KAAK,EAAE,OAAO,CAAC,UAAU,CAAC,YAAY,CAAC;4BACvC,IAAI,EAAE,OAAO,CAAC,UAAU,CAAC,MAAM,CAAC;4BAChC,aAAa,EAAE,OAAO,CAAC,UAAU,CAAC,eAAe,CAAC;yBACrD,CAAC;iBACL;gBACD,OAAO,EAAE;oBACL,eAAe,EAAE,mBAAU,CAAC,mBAAmB,CAAC,OAAO,CAAC,UAAU,CAAC,gBAAgB,CAAE,CAAC;iBACzF;gBACD,WAAW,EAAE,EAAE;aAClB,CAAC;YACF,OAAO,MAAM,0BAAU,CAAC,WAAW,CAAwB,OAAO,CAAC,CAAC;QACxE,CAAC;KAAA;CACJ,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const dripApplyTagToSubscriber: import("@activepieces/framework").Action;
|
|
1
|
+
export declare const dripApplyTagToSubscriber: import("@activepieces/pieces-framework").Action;
|
|
@@ -2,9 +2,10 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.dripApplyTagToSubscriber = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const
|
|
5
|
+
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
+
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
6
7
|
const common_1 = require("../common");
|
|
7
|
-
exports.dripApplyTagToSubscriber = (0,
|
|
8
|
+
exports.dripApplyTagToSubscriber = (0, pieces_framework_1.createAction)({
|
|
8
9
|
name: 'apply_tag_to_subscriber',
|
|
9
10
|
description: 'Apply a tag to a subscriber',
|
|
10
11
|
displayName: 'Apply a tag to subscriber',
|
|
@@ -12,7 +13,7 @@ exports.dripApplyTagToSubscriber = (0, framework_1.createAction)({
|
|
|
12
13
|
authentication: common_1.dripCommon.authentication,
|
|
13
14
|
account_id: common_1.dripCommon.account_id,
|
|
14
15
|
subscriber: common_1.dripCommon.subscriber,
|
|
15
|
-
tag:
|
|
16
|
+
tag: pieces_framework_1.Property.ShortText({
|
|
16
17
|
displayName: "Tag",
|
|
17
18
|
required: true,
|
|
18
19
|
description: "Tag to apply"
|
|
@@ -22,7 +23,7 @@ exports.dripApplyTagToSubscriber = (0, framework_1.createAction)({
|
|
|
22
23
|
run(context) {
|
|
23
24
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
24
25
|
const request = {
|
|
25
|
-
method:
|
|
26
|
+
method: pieces_common_1.HttpMethod.POST,
|
|
26
27
|
url: `${common_1.dripCommon.baseUrl(context.propsValue["account_id"])}/tags`,
|
|
27
28
|
body: {
|
|
28
29
|
tags: [{
|
|
@@ -35,7 +36,7 @@ exports.dripApplyTagToSubscriber = (0, framework_1.createAction)({
|
|
|
35
36
|
},
|
|
36
37
|
queryParams: {},
|
|
37
38
|
};
|
|
38
|
-
return yield
|
|
39
|
+
return yield pieces_common_1.httpClient.sendRequest(request);
|
|
39
40
|
});
|
|
40
41
|
}
|
|
41
42
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apply-tag-to-subscriber.action.js","sourceRoot":"","sources":["../../../../../../../packages/pieces/drip/src/lib/actions/apply-tag-to-subscriber.action.ts"],"names":[],"mappings":";;;;AAAA,
|
|
1
|
+
{"version":3,"file":"apply-tag-to-subscriber.action.js","sourceRoot":"","sources":["../../../../../../../packages/pieces/drip/src/lib/actions/apply-tag-to-subscriber.action.ts"],"names":[],"mappings":";;;;AAAA,qEAAsE;AACtE,+DAAiF;AACjF,sCAAuC;AAE1B,QAAA,wBAAwB,GAAG,IAAA,+BAAY,EAAC;IACjD,IAAI,EAAE,yBAAyB;IAC/B,WAAW,EAAE,6BAA6B;IAC1C,WAAW,EAAE,2BAA2B;IACxC,KAAK,EAAE;QACH,cAAc,EAAE,mBAAU,CAAC,cAAc;QACzC,UAAU,EAAE,mBAAU,CAAC,UAAU;QACjC,UAAU,EAAE,mBAAU,CAAC,UAAU;QACjC,GAAG,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACpB,WAAW,EAAE,KAAK;YAClB,QAAQ,EAAE,IAAI;YACd,WAAW,EAAE,cAAc;SAC9B,CAAC;KACL;IACD,UAAU,EAAE,EAAE;IACR,GAAG,CAAC,OAAO;;YACb,MAAM,OAAO,GAAgB;gBACzB,MAAM,EAAE,0BAAU,CAAC,IAAI;gBACvB,GAAG,EAAE,GAAG,mBAAU,CAAC,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC,YAAY,CAAE,CAAC,OAAO;gBACpE,IAAI,EAAE;oBACF,IAAI,EAAE,CAAC;4BACH,KAAK,EAAE,OAAO,CAAC,UAAU,CAAC,YAAY,CAAC;4BACvC,GAAG,EAAE,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC;yBACjC,CAAC;iBAEL;gBACD,OAAO,EAAE;oBACL,eAAe,EAAE,mBAAU,CAAC,mBAAmB,CAAC,OAAO,CAAC,UAAU,CAAC,gBAAgB,CAAE,CAAC;iBACzF;gBACD,WAAW,EAAE,EAAE;aAClB,CAAC;YACF,OAAO,MAAM,0BAAU,CAAC,WAAW,CAAwB,OAAO,CAAC,CAAC;QACxE,CAAC;KAAA;CACJ,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const dripUpsertSubscriberAction: import("@activepieces/framework").Action;
|
|
1
|
+
export declare const dripUpsertSubscriberAction: import("@activepieces/pieces-framework").Action;
|
|
@@ -2,9 +2,10 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.dripUpsertSubscriberAction = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const
|
|
5
|
+
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
+
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
6
7
|
const common_1 = require("../common");
|
|
7
|
-
exports.dripUpsertSubscriberAction = (0,
|
|
8
|
+
exports.dripUpsertSubscriberAction = (0, pieces_framework_1.createAction)({
|
|
8
9
|
name: 'upsert_subscriber',
|
|
9
10
|
description: 'Create or Update Subscriber',
|
|
10
11
|
displayName: 'Create or Update Subscriber',
|
|
@@ -14,14 +15,14 @@ exports.dripUpsertSubscriberAction = (0, framework_1.createAction)({
|
|
|
14
15
|
subscriber: common_1.dripCommon.subscriber,
|
|
15
16
|
tags: common_1.dripCommon.tags,
|
|
16
17
|
custom_fields: common_1.dripCommon.custom_fields,
|
|
17
|
-
first_name:
|
|
18
|
-
last_name:
|
|
19
|
-
zip:
|
|
20
|
-
country:
|
|
21
|
-
state:
|
|
22
|
-
city:
|
|
23
|
-
phone:
|
|
24
|
-
address:
|
|
18
|
+
first_name: pieces_framework_1.Property.ShortText({ displayName: "First Name", required: false }),
|
|
19
|
+
last_name: pieces_framework_1.Property.ShortText({ displayName: "Last Name", required: false }),
|
|
20
|
+
zip: pieces_framework_1.Property.ShortText({ displayName: 'Zip Code', description: "Postal code in which the subscriber resides", required: false }),
|
|
21
|
+
country: pieces_framework_1.Property.ShortText({ displayName: 'Country', description: "The country in which the subscriber resides", required: false }),
|
|
22
|
+
state: pieces_framework_1.Property.ShortText({ displayName: 'State', description: "The region in which the subscriber resides", required: false }),
|
|
23
|
+
city: pieces_framework_1.Property.ShortText({ displayName: 'City', description: "The city in which the subscriber resides", required: false }),
|
|
24
|
+
phone: pieces_framework_1.Property.ShortText({ displayName: 'Phone', description: "The subscriber's primary phone number", required: false }),
|
|
25
|
+
address: pieces_framework_1.Property.ShortText({ displayName: 'Address', description: "The subscriber's mailing address", required: false }),
|
|
25
26
|
},
|
|
26
27
|
sampleData: {
|
|
27
28
|
"links": {
|
|
@@ -69,7 +70,7 @@ exports.dripUpsertSubscriberAction = (0, framework_1.createAction)({
|
|
|
69
70
|
run(context) {
|
|
70
71
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
71
72
|
const request = {
|
|
72
|
-
method:
|
|
73
|
+
method: pieces_common_1.HttpMethod.POST,
|
|
73
74
|
url: `${common_1.dripCommon.baseUrl(context.propsValue["account_id"])}/subscribers`,
|
|
74
75
|
body: {
|
|
75
76
|
subscribers: [{
|
|
@@ -91,7 +92,7 @@ exports.dripUpsertSubscriberAction = (0, framework_1.createAction)({
|
|
|
91
92
|
},
|
|
92
93
|
queryParams: {},
|
|
93
94
|
};
|
|
94
|
-
return yield
|
|
95
|
+
return yield pieces_common_1.httpClient.sendRequest(request);
|
|
95
96
|
});
|
|
96
97
|
}
|
|
97
98
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"upsert-subscriber.action.js","sourceRoot":"","sources":["../../../../../../../packages/pieces/drip/src/lib/actions/upsert-subscriber.action.ts"],"names":[],"mappings":";;;;AAAA,
|
|
1
|
+
{"version":3,"file":"upsert-subscriber.action.js","sourceRoot":"","sources":["../../../../../../../packages/pieces/drip/src/lib/actions/upsert-subscriber.action.ts"],"names":[],"mappings":";;;;AAAA,qEAAsE;AACtE,+DAAiF;AACjF,sCAAuC;AAE1B,QAAA,0BAA0B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E,CAAC,cAAc;gBAC3E,IAAI,EAAE;oBACF,WAAW,EAAE,CAAC;4BACV,KAAK,EAAE,OAAO,CAAC,UAAU,CAAC,YAAY,CAAC;4BACvC,IAAI,EAAE,OAAO,CAAC,UAAU,CAAC,MAAM,CAAC;4BAChC,aAAa,EAAE,OAAO,CAAC,UAAU,CAAC,eAAe,CAAC;4BAClD,OAAO,EAAE,OAAO,CAAC,UAAU,CAAC,SAAS,CAAC;4BACtC,QAAQ,EAAE,OAAO,CAAC,UAAU,CAAC,SAAS,CAAC;4BACvC,IAAI,EAAE,OAAO,CAAC,UAAU,CAAC,MAAM,CAAC;4BAChC,KAAK,EAAE,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC;4BAClC,GAAG,EAAE,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC;4BAC9B,KAAK,EAAE,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC;4BAClC,UAAU,EAAE,OAAO,CAAC,UAAU,CAAC,YAAY,CAAC;4BAC5C,SAAS,EAAE,OAAO,CAAC,UAAU,CAAC,WAAW,CAAC;yBAC7C,CAAC;iBAEL;gBACD,OAAO,EAAE;oBACL,eAAe,EAAE,mBAAU,CAAC,mBAAmB,CAAC,OAAO,CAAC,UAAU,CAAC,gBAAgB,CAAE,CAAC;iBACzF;gBACD,WAAW,EAAE,EAAE;aAClB,CAAC;YACF,OAAO,MAAM,0BAAU,CAAC,WAAW,CAAwB,OAAO,CAAC,CAAC;QACxE,CAAC;KAAA;CACJ,CAAC,CAAC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
export declare const dripCommon: {
|
|
2
2
|
baseUrl: (accountId: string) => string;
|
|
3
|
-
authentication: import("@activepieces/framework").SecretTextProperty<true>;
|
|
4
|
-
account_id: import("@activepieces/framework").DropdownProperty<string, true>;
|
|
5
|
-
subscriber: import("@activepieces/framework").ShortTextProperty<true>;
|
|
6
|
-
tags: import("@activepieces/framework").ArrayProperty<false>;
|
|
7
|
-
custom_fields: import("@activepieces/framework").ObjectProperty<false>;
|
|
3
|
+
authentication: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
4
|
+
account_id: import("@activepieces/pieces-framework").DropdownProperty<string, true>;
|
|
5
|
+
subscriber: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
6
|
+
tags: import("@activepieces/pieces-framework").ArrayProperty<false>;
|
|
7
|
+
custom_fields: import("@activepieces/pieces-framework").ObjectProperty<false>;
|
|
8
8
|
authorizationHeader: (apiKey: string) => string;
|
|
9
9
|
};
|
package/src/lib/common/index.js
CHANGED
|
@@ -2,15 +2,16 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.dripCommon = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const
|
|
5
|
+
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
+
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
6
7
|
exports.dripCommon = {
|
|
7
8
|
baseUrl: (accountId) => { return `https://api.getdrip.com/v2/${accountId}`; },
|
|
8
|
-
authentication:
|
|
9
|
+
authentication: pieces_framework_1.Property.SecretText({
|
|
9
10
|
displayName: "API Key",
|
|
10
11
|
required: true,
|
|
11
12
|
description: "Get it from https://www.getdrip.com/user/edit"
|
|
12
13
|
}),
|
|
13
|
-
account_id:
|
|
14
|
+
account_id: pieces_framework_1.Property.Dropdown({
|
|
14
15
|
displayName: 'Account',
|
|
15
16
|
required: true,
|
|
16
17
|
refreshers: ["authentication"],
|
|
@@ -23,13 +24,13 @@ exports.dripCommon = {
|
|
|
23
24
|
};
|
|
24
25
|
}
|
|
25
26
|
const request = {
|
|
26
|
-
method:
|
|
27
|
+
method: pieces_common_1.HttpMethod.GET,
|
|
27
28
|
url: "https://api.getdrip.com/v2/accounts",
|
|
28
29
|
headers: {
|
|
29
30
|
Authorization: `Basic ${Buffer.from(props["authentication"]).toString("base64")}`,
|
|
30
31
|
},
|
|
31
32
|
};
|
|
32
|
-
const response = yield
|
|
33
|
+
const response = yield pieces_common_1.httpClient.sendRequest(request);
|
|
33
34
|
const opts = response.body.accounts.map((acc) => {
|
|
34
35
|
return { value: acc.id, label: acc.name };
|
|
35
36
|
});
|
|
@@ -39,13 +40,13 @@ exports.dripCommon = {
|
|
|
39
40
|
};
|
|
40
41
|
})
|
|
41
42
|
}),
|
|
42
|
-
subscriber:
|
|
43
|
-
tags:
|
|
43
|
+
subscriber: pieces_framework_1.Property.ShortText({ required: true, displayName: "Subscriber Email", description: "Email of the subscriber" }),
|
|
44
|
+
tags: pieces_framework_1.Property.Array({
|
|
44
45
|
displayName: "tags",
|
|
45
46
|
required: false,
|
|
46
47
|
description: "Tags to apply to subscriber"
|
|
47
48
|
}),
|
|
48
|
-
custom_fields:
|
|
49
|
+
custom_fields: pieces_framework_1.Property.Object({
|
|
49
50
|
displayName: "Custom Fields",
|
|
50
51
|
required: false,
|
|
51
52
|
description: "Custom field data about the subscriber"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../packages/pieces/drip/src/lib/common/index.ts"],"names":[],"mappings":";;;;AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../packages/pieces/drip/src/lib/common/index.ts"],"names":[],"mappings":";;;;AAAA,qEAAwD;AACxD,+DAAiF;AAEpE,QAAA,UAAU,GAAG;IACtB,OAAO,EAAE,CAAC,SAAiB,EAAE,EAAE,GAAG,OAAO,8BAA8B,SAAS,EAAE,CAAA,CAAC,CAAC;IACpF,cAAc,EAAE,2BAAQ,CAAC,UAAU,CAAC;QAChC,WAAW,EAAE,SAAS;QACtB,QAAQ,EAAE,IAAI;QACd,WAAW,EAAE,+CAA+C;KAC/D,CAAC;IACF,UAAU,EAAE,2BAAQ,CAAC,QAAQ,CAAC;QAC1B,WAAW,EAAE,SAAS;QACtB,QAAQ,EAAE,IAAI;QACd,UAAU,EAAE,CAAC,gBAAgB,CA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AAE,wCAAwC;KACxD,CAAC;IACF,mBAAmB,EAAE,CAAC,MAAc,EAAE,EAAE,CAAC,SAAS,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE;CAE7F,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const dripNewSubscriberEvent: import("@activepieces/framework").Trigger;
|
|
1
|
+
export declare const dripNewSubscriberEvent: import("@activepieces/pieces-framework").Trigger;
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.dripNewSubscriberEvent = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const
|
|
6
|
-
const
|
|
5
|
+
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
6
|
+
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
7
7
|
const common_1 = require("../common");
|
|
8
8
|
const triggerNameInStore = 'drip_new_subscriber_trigger';
|
|
9
|
-
exports.dripNewSubscriberEvent = (0,
|
|
9
|
+
exports.dripNewSubscriberEvent = (0, pieces_framework_1.createTrigger)({
|
|
10
10
|
name: 'new_subscriber',
|
|
11
11
|
displayName: 'New Subscriber',
|
|
12
12
|
description: 'Triggers when a subscriber is created in your Drip account.',
|
|
@@ -22,12 +22,12 @@ exports.dripNewSubscriberEvent = (0, framework_1.createTrigger)({
|
|
|
22
22
|
},
|
|
23
23
|
"occurred_at": "2013-06-21T10:31:58Z"
|
|
24
24
|
},
|
|
25
|
-
type:
|
|
25
|
+
type: pieces_framework_1.TriggerStrategy.WEBHOOK,
|
|
26
26
|
onEnable(context) {
|
|
27
27
|
var _a;
|
|
28
28
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
29
29
|
const request = {
|
|
30
|
-
method:
|
|
30
|
+
method: pieces_common_1.HttpMethod.POST,
|
|
31
31
|
url: `${common_1.dripCommon.baseUrl(context.propsValue["account_id"])}/webhooks`,
|
|
32
32
|
body: {
|
|
33
33
|
webhooks: [{ post_url: context.webhookUrl, events: ["subscriber.created"] }],
|
|
@@ -37,7 +37,7 @@ exports.dripNewSubscriberEvent = (0, framework_1.createTrigger)({
|
|
|
37
37
|
},
|
|
38
38
|
queryParams: {},
|
|
39
39
|
};
|
|
40
|
-
const { body } = yield
|
|
40
|
+
const { body } = yield pieces_common_1.httpClient.sendRequest(request);
|
|
41
41
|
yield ((_a = context.store) === null || _a === void 0 ? void 0 : _a.put(triggerNameInStore, {
|
|
42
42
|
webhookId: body.webhooks[0].id,
|
|
43
43
|
userId: context.propsValue["account_id"]
|
|
@@ -50,13 +50,13 @@ exports.dripNewSubscriberEvent = (0, framework_1.createTrigger)({
|
|
|
50
50
|
const response = yield ((_a = context.store) === null || _a === void 0 ? void 0 : _a.get(triggerNameInStore));
|
|
51
51
|
if (response !== null && response !== undefined) {
|
|
52
52
|
const request = {
|
|
53
|
-
method:
|
|
53
|
+
method: pieces_common_1.HttpMethod.DELETE,
|
|
54
54
|
url: `${common_1.dripCommon.baseUrl(response.userId)}/webhooks/${response.webhookId}`,
|
|
55
55
|
headers: {
|
|
56
56
|
'Authorization': common_1.dripCommon.authorizationHeader(context.propsValue["authentication"])
|
|
57
57
|
},
|
|
58
58
|
};
|
|
59
|
-
yield
|
|
59
|
+
yield pieces_common_1.httpClient.sendRequest(request);
|
|
60
60
|
}
|
|
61
61
|
});
|
|
62
62
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"new-subscriber.trigger.js","sourceRoot":"","sources":["../../../../../../../packages/pieces/drip/src/lib/trigger/new-subscriber.trigger.ts"],"names":[],"mappings":";;;;AAAA
|
|
1
|
+
{"version":3,"file":"new-subscriber.trigger.js","sourceRoot":"","sources":["../../../../../../../packages/pieces/drip/src/lib/trigger/new-subscriber.trigger.ts"],"names":[],"mappings":";;;;AAAA,+DAAkF;AAClF,qEAAgF;AAChF,sCAAuC;AAEvC,MAAM,kBAAkB,GAAG,6BA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AAS,CAAC,OAAO;;;YACrB,MAAM,QAAQ,GAAG,MAAM,CAAA,MAAA,OAAO,CAAC,KAAK,0CAAE,GAAG,CAAyB,kBAAkB,CAAC,CAAA,CAAC;YACtF,IAAI,QAAQ,KAAK,IAAI,IAAI,QAAQ,KAAK,SAAS,EAAE;gBAC/C,MAAM,OAAO,GAAgB;oBAC3B,MAAM,EAAE,0BAAU,CAAC,MAAM;oBACzB,GAAG,EAAE,GAAG,mBAAU,CAAC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,aAAa,QAAQ,CAAC,SAAS,EAAE;oBAC5E,OAAO,EAAE;wBACP,eAAe,EAAE,mBAAU,CAAC,mBAAmB,CAAC,OAAO,CAAC,UAAU,CAAC,gBAAgB,CAAE,CAAC;qBACvF;iBACF,CAAC;gBACF,MAAM,0BAAU,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;aACvC;;KACF;IACK,GAAG,CAAC,OAAO;;YACf,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QAChC,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const dripTagAppliedEvent: import("@activepieces/framework").Trigger;
|
|
1
|
+
export declare const dripTagAppliedEvent: import("@activepieces/pieces-framework").Trigger;
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.dripTagAppliedEvent = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const
|
|
6
|
-
const
|
|
5
|
+
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
6
|
+
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
7
7
|
const common_1 = require("../common");
|
|
8
8
|
const triggerNameInStore = 'drip_tag_applied_to_subscriber_trigger';
|
|
9
|
-
exports.dripTagAppliedEvent = (0,
|
|
9
|
+
exports.dripTagAppliedEvent = (0, pieces_framework_1.createTrigger)({
|
|
10
10
|
name: 'tag_applied_to_subscribers',
|
|
11
11
|
displayName: 'Tag Applied',
|
|
12
12
|
description: 'Triggers when a tag is applied.',
|
|
@@ -25,12 +25,12 @@ exports.dripTagAppliedEvent = (0, framework_1.createTrigger)({
|
|
|
25
25
|
},
|
|
26
26
|
"occurred_at": "2013-06-21T10:31:58Z"
|
|
27
27
|
},
|
|
28
|
-
type:
|
|
28
|
+
type: pieces_framework_1.TriggerStrategy.WEBHOOK,
|
|
29
29
|
onEnable(context) {
|
|
30
30
|
var _a;
|
|
31
31
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
32
32
|
const request = {
|
|
33
|
-
method:
|
|
33
|
+
method: pieces_common_1.HttpMethod.POST,
|
|
34
34
|
url: `${common_1.dripCommon.baseUrl(context.propsValue["account_id"])}/webhooks`,
|
|
35
35
|
body: {
|
|
36
36
|
webhooks: [{ post_url: context.webhookUrl, events: ["subscriber.applied_tag"] }],
|
|
@@ -40,7 +40,7 @@ exports.dripTagAppliedEvent = (0, framework_1.createTrigger)({
|
|
|
40
40
|
},
|
|
41
41
|
queryParams: {},
|
|
42
42
|
};
|
|
43
|
-
const { body } = yield
|
|
43
|
+
const { body } = yield pieces_common_1.httpClient.sendRequest(request);
|
|
44
44
|
yield ((_a = context.store) === null || _a === void 0 ? void 0 : _a.put(triggerNameInStore, {
|
|
45
45
|
webhookId: body.webhooks[0].id,
|
|
46
46
|
userId: context.propsValue["account_id"]
|
|
@@ -53,13 +53,13 @@ exports.dripTagAppliedEvent = (0, framework_1.createTrigger)({
|
|
|
53
53
|
const response = yield ((_a = context.store) === null || _a === void 0 ? void 0 : _a.get(triggerNameInStore));
|
|
54
54
|
if (response !== null && response !== undefined) {
|
|
55
55
|
const request = {
|
|
56
|
-
method:
|
|
56
|
+
method: pieces_common_1.HttpMethod.DELETE,
|
|
57
57
|
url: `${common_1.dripCommon.baseUrl(response.userId)}/webhooks/${response.webhookId}`,
|
|
58
58
|
headers: {
|
|
59
59
|
'Authorization': common_1.dripCommon.authorizationHeader(context.propsValue["authentication"])
|
|
60
60
|
},
|
|
61
61
|
};
|
|
62
|
-
yield
|
|
62
|
+
yield pieces_common_1.httpClient.sendRequest(request);
|
|
63
63
|
}
|
|
64
64
|
});
|
|
65
65
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"new-tag.trigger.js","sourceRoot":"","sources":["../../../../../../../packages/pieces/drip/src/lib/trigger/new-tag.trigger.ts"],"names":[],"mappings":";;;;AAAA
|
|
1
|
+
{"version":3,"file":"new-tag.trigger.js","sourceRoot":"","sources":["../../../../../../../packages/pieces/drip/src/lib/trigger/new-tag.trigger.ts"],"names":[],"mappings":";;;;AAAA,+DAAkF;AAClF,qEAAgF;AAChF,sCAAuC;AAEvC,MAAM,kBAAkB,GAAG,wCAAwC,CAAC;AACvD,QAAA,mBAAmB,GAAG,IAAA,gCAAa,EAAC;IAC/C,IAAI,EAAE,4BAA4B;IAClC,WAAW,EAAE,aAAa;IAC1B,WAAW,EAAE,iCAAiC;IAC9C,KAAK,EAAE;QACL,cAAc,EAAE,mBAAU,CAAC,cAAc;QACzC,UAAU,EAAE,mBAAU,CAAC,UAAU;KAClC;IACD,UAAU,EAAE;QACV,OAAO,EAAE,wBAAwB;QACjC,MAAM,EAAE;YACN,YAAY,EAAE,SAAS;YACvB,YAAY,EAAE,EAAE;YAChB,YAAY,EAAE;gBACZ,KAAK,EAAE,UAAU;aAClB;SACF;QACD,aAAa,EAAE,sBAAsB;KACtC;IACD,IAAI,EAAE,kCAAe,CAAC,OAAO;IACvB,QAAQ,CAAC,OAAO;;;YAEpB,MAAM,OAAO,GAAgB;gBAC3B,MAAM,EAAE,0BAAU,CAAC,IAAI;gBACvB,GAAG,EAAE,GAAG,mBAAU,CAAC,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC,YAAY,CAAE,CAAC,WAAW;gBACxE,IAAI,EAAE;oBACJ,QAAQ,EAAE,CAAC,EAAE,QAAQ,EAAE,OAAO,CA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