@activepieces/piece-drip 0.2.1 → 0.3.0
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 +7 -7
- package/src/index.d.ts +2 -1
- package/src/index.js +8 -5
- package/src/index.js.map +1 -1
- package/src/lib/actions/add-subscriber-to-campaign.action.d.ts +7 -1
- package/src/lib/actions/add-subscriber-to-campaign.action.js +14 -13
- package/src/lib/actions/add-subscriber-to-campaign.action.js.map +1 -1
- package/src/lib/actions/apply-tag-to-subscriber.action.d.ts +5 -1
- package/src/lib/actions/apply-tag-to-subscriber.action.js +7 -6
- package/src/lib/actions/apply-tag-to-subscriber.action.js.map +1 -1
- package/src/lib/actions/upsert-subscriber.action.d.ts +14 -1
- package/src/lib/actions/upsert-subscriber.action.js +16 -15
- package/src/lib/actions/upsert-subscriber.action.js.map +1 -1
- package/src/lib/common/index.d.ts +0 -1
- package/src/lib/common/index.js +4 -9
- package/src/lib/common/index.js.map +1 -1
- package/src/lib/trigger/new-subscriber.trigger.d.ts +4 -1
- package/src/lib/trigger/new-subscriber.trigger.js +10 -10
- package/src/lib/trigger/new-subscriber.trigger.js.map +1 -1
- package/src/lib/trigger/new-tag.trigger.d.ts +4 -1
- package/src/lib/trigger/new-tag.trigger.js +5 -4
- package/src/lib/trigger/new-tag.trigger.js.map +1 -1
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@activepieces/piece-drip",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"dependencies": {
|
|
5
|
-
"@sinclair/typebox": "0.26.
|
|
5
|
+
"@sinclair/typebox": "^0.26.3",
|
|
6
6
|
"axios": "1.2.4",
|
|
7
|
-
"nanoid": "3.3.4",
|
|
8
|
-
"@activepieces/pieces-
|
|
9
|
-
"@activepieces/
|
|
10
|
-
"@activepieces/
|
|
11
|
-
"tslib": "
|
|
7
|
+
"nanoid": "^3.3.4",
|
|
8
|
+
"@activepieces/pieces-common": "0.1.0",
|
|
9
|
+
"@activepieces/pieces-framework": "0.4.0",
|
|
10
|
+
"@activepieces/shared": "0.4.0",
|
|
11
|
+
"tslib": "1.14.1"
|
|
12
12
|
},
|
|
13
13
|
"main": "./src/index.js",
|
|
14
14
|
"types": "./src/index.d.ts"
|
package/src/index.d.ts
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export declare const
|
|
1
|
+
export declare const dripAuth: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
2
|
+
export declare const drip: import("@activepieces/pieces-framework").Piece<import("@activepieces/pieces-framework").SecretTextProperty<true>>;
|
package/src/index.js
CHANGED
|
@@ -1,20 +1,23 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.drip = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const package_json_1 = tslib_1.__importDefault(require("../package.json"));
|
|
3
|
+
exports.drip = exports.dripAuth = void 0;
|
|
6
4
|
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
7
5
|
const add_subscriber_to_campaign_action_1 = require("./lib/actions/add-subscriber-to-campaign.action");
|
|
8
6
|
const apply_tag_to_subscriber_action_1 = require("./lib/actions/apply-tag-to-subscriber.action");
|
|
9
7
|
const upsert_subscriber_action_1 = require("./lib/actions/upsert-subscriber.action");
|
|
10
8
|
const new_subscriber_trigger_1 = require("./lib/trigger/new-subscriber.trigger");
|
|
11
9
|
const new_tag_trigger_1 = require("./lib/trigger/new-tag.trigger");
|
|
10
|
+
exports.dripAuth = pieces_framework_1.PieceAuth.SecretText({
|
|
11
|
+
displayName: "API Key",
|
|
12
|
+
required: true,
|
|
13
|
+
description: "Get it from https://www.getdrip.com/user/edit"
|
|
14
|
+
});
|
|
12
15
|
exports.drip = (0, pieces_framework_1.createPiece)({
|
|
13
|
-
name: 'drip',
|
|
14
16
|
displayName: 'Drip',
|
|
17
|
+
minimumSupportedRelease: '0.5.0',
|
|
15
18
|
logoUrl: 'https://cdn.activepieces.com/pieces/drip.png',
|
|
16
|
-
version: package_json_1.default.version,
|
|
17
19
|
authors: ['AbdulTheActivePiecer'],
|
|
20
|
+
auth: exports.dripAuth,
|
|
18
21
|
actions: [apply_tag_to_subscriber_action_1.dripApplyTagToSubscriber, add_subscriber_to_campaign_action_1.dripAddSubscriberToCampaign, upsert_subscriber_action_1.dripUpsertSubscriberAction],
|
|
19
22
|
triggers: [new_subscriber_trigger_1.dripNewSubscriberEvent, new_tag_trigger_1.dripTagAppliedEvent],
|
|
20
23
|
});
|
package/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../packages/pieces/drip/src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../packages/pieces/drip/src/index.ts"],"names":[],"mappings":";;;AAAA,qEAAwE;AACxE,uGAA8F;AAC9F,iGAAwF;AACxF,qFAAoF;AACpF,iFAA8E;AAC9E,mEAAoE;AAEvD,QAAA,QAAQ,GAAG,4BAAS,CAAC,UAAU,CAAC;IACzC,WAAW,EAAE,SAAS;IACtB,QAAQ,EAAE,IAAI;IACd,WAAW,EAAE,+CAA+C;CAC/D,CAAC,CAAA;AAEW,QAAA,IAAI,GAAG,IAAA,8BAAW,EAAC;IAC/B,WAAW,EAAE,MAAM;IACf,uBAAuB,EAAE,OAAO;IACjC,OAAO,EAAE,8CAA8C;IAC1D,OAAO,EAAE,CAAC,sBAAsB,CAAC;IAC9B,IAAI,EAAE,gBAAQ;IACjB,OAAO,EAAE,CAAC,yDAAwB,EAAE,+DAA2B,EAAE,qDAA0B,CAAC;IAC5F,QAAQ,EAAE,CAAC,+CAAsB,EAAE,qCAAmB,CAAC;CACvD,CAAC,CAAC"}
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
export declare const dripAddSubscriberToCampaign: import("@activepieces/pieces-framework").
|
|
1
|
+
export declare const dripAddSubscriberToCampaign: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").SecretTextProperty<true>, {
|
|
2
|
+
account_id: import("@activepieces/pieces-framework").DropdownProperty<string, true>;
|
|
3
|
+
campaign_id: import("@activepieces/pieces-framework").DropdownProperty<string, true>;
|
|
4
|
+
subscriber: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
5
|
+
tags: import("@activepieces/pieces-framework").ArrayProperty<false>;
|
|
6
|
+
custom_fields: import("@activepieces/pieces-framework").ObjectProperty<false>;
|
|
7
|
+
}>;
|
|
@@ -5,26 +5,27 @@ const tslib_1 = require("tslib");
|
|
|
5
5
|
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
6
|
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
7
7
|
const common_1 = require("../common");
|
|
8
|
+
const __1 = require("../../");
|
|
8
9
|
exports.dripAddSubscriberToCampaign = (0, pieces_framework_1.createAction)({
|
|
10
|
+
auth: __1.dripAuth,
|
|
9
11
|
name: 'add_subscriber_to_campaign',
|
|
10
12
|
description: 'Add a subscriber to a campaign (Email series)',
|
|
11
13
|
displayName: 'Add a subscriber to a campaign',
|
|
12
14
|
props: {
|
|
13
|
-
authentication: common_1.dripCommon.authentication,
|
|
14
15
|
account_id: common_1.dripCommon.account_id,
|
|
15
16
|
campaign_id: pieces_framework_1.Property.Dropdown({
|
|
16
17
|
displayName: "Email Series Campaign",
|
|
17
|
-
refreshers: ["
|
|
18
|
+
refreshers: ["account_id"],
|
|
18
19
|
required: true,
|
|
19
|
-
options: (
|
|
20
|
-
if (!
|
|
20
|
+
options: ({ auth, account_id }) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
21
|
+
if (!auth) {
|
|
21
22
|
return {
|
|
22
23
|
disabled: true,
|
|
23
24
|
options: [],
|
|
24
25
|
placeholder: "Please fill in API key first"
|
|
25
26
|
};
|
|
26
27
|
}
|
|
27
|
-
if (!
|
|
28
|
+
if (!account_id) {
|
|
28
29
|
return {
|
|
29
30
|
disabled: true,
|
|
30
31
|
options: [],
|
|
@@ -33,9 +34,9 @@ exports.dripAddSubscriberToCampaign = (0, pieces_framework_1.createAction)({
|
|
|
33
34
|
}
|
|
34
35
|
const request = {
|
|
35
36
|
method: pieces_common_1.HttpMethod.GET,
|
|
36
|
-
url: `${common_1.dripCommon.baseUrl(
|
|
37
|
+
url: `${common_1.dripCommon.baseUrl(account_id)}/campaigns`,
|
|
37
38
|
headers: {
|
|
38
|
-
Authorization: `Basic ${Buffer.from(
|
|
39
|
+
Authorization: `Basic ${Buffer.from(auth).toString("base64")}`,
|
|
39
40
|
},
|
|
40
41
|
};
|
|
41
42
|
const response = yield pieces_common_1.httpClient.sendRequest(request);
|
|
@@ -102,20 +103,20 @@ exports.dripAddSubscriberToCampaign = (0, pieces_framework_1.createAction)({
|
|
|
102
103
|
}
|
|
103
104
|
]
|
|
104
105
|
},
|
|
105
|
-
run(
|
|
106
|
+
run({ auth, propsValue }) {
|
|
106
107
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
107
108
|
const request = {
|
|
108
109
|
method: pieces_common_1.HttpMethod.POST,
|
|
109
|
-
url: `${common_1.dripCommon.baseUrl(
|
|
110
|
+
url: `${common_1.dripCommon.baseUrl(propsValue.account_id)}/campaigns/${propsValue.campaign_id}/subscribers`,
|
|
110
111
|
body: {
|
|
111
112
|
subscribers: [{
|
|
112
|
-
email:
|
|
113
|
-
tags:
|
|
114
|
-
custom_fields:
|
|
113
|
+
email: propsValue.subscriber,
|
|
114
|
+
tags: propsValue.tags,
|
|
115
|
+
custom_fields: propsValue.custom_fields
|
|
115
116
|
}]
|
|
116
117
|
},
|
|
117
118
|
headers: {
|
|
118
|
-
'Authorization': common_1.dripCommon.authorizationHeader(
|
|
119
|
+
'Authorization': common_1.dripCommon.authorizationHeader(auth)
|
|
119
120
|
},
|
|
120
121
|
queryParams: {},
|
|
121
122
|
};
|
|
@@ -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,qEAAsE;AACtE,+DAAiF;AACjF,sCAAuC;
|
|
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;AACvC,8BAAiC;AAEpB,QAAA,2BAA2B,GAAG,IAAA,+BAAY,EAAC;IACpD,IAAI,EAAE,YAAQ;IACV,IAAI,EAAE,4BAA4B;IAClC,WAAW,EAAE,+CAA+C;IAC5D,WAAW,EAAE,gCAAgC;IAC7C,KAAK,EAAE;QACH,UAAU,EAAE,mBAAU,CAAC,UAAU;QACjC,WAAW,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YAC3B,WAAW,EAAE,uBAAuB;YACpC,UAAU,EAAE,CAAC,YAAY,CAAC;YAC1B,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE,CAAO,EAAE,IAAI,EAAE,UAAU,EAAE,EAAE,EAAE;gBACpC,IAAI,CAAC,IAAI,EAAE;oBACP,OAAO;wBACH,QAAQ,EAAE,IAAI;wBACd,OAAO,EAAE,EAAE;wBACX,WAAW,EAAE,8BAA8B;qBAC9C,CAAA;iBACJ;gBACD,IAAI,CAAC,UAAU,EAAE;oBACb,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,UAAoB,CAAC,YAAY;oBAC5D,OAAO,EAAE;wBACL,aAAa,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,eAAe;gBAC5B,YAAY,EAAE,CAAC;gBACf,cAAc,EAAE,IAAI;gBACpB,eAAe,EAAE,EAAE;gBACnB,MAAM,EAAE,EAAE;gBACV,YAAY,EAAE,sBAAsB;gBACpC,YAAY,EAAE,YAAY;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,EAAE,IAAI,EAAE,UAAU,EAAE;;YAC1B,MAAM,OAAO,GAAgB;gBACzB,MAAM,EAAE,0BAAU,CAAC,IAAI;gBACvB,GAAG,EAAE,GAAG,mBAAU,CAAC,OAAO,CAAC,UAAU,CAAC,UAAU,CAAC,cAAc,UAAU,CAAC,WAAW,cAAc;gBACnG,IAAI,EAAE;oBACF,WAAW,EAAE,CAAC;4BACV,KAAK,EAAE,UAAU,CAAC,UAAU;4BAC5B,IAAI,EAAE,UAAU,CAAC,IAAI;4BACrB,aAAa,EAAE,UAAU,CAAC,aAAa;yBAC1C,CAAC;iBACL;gBACD,OAAO,EAAE;oBACL,eAAe,EAAE,mBAAU,CAAC,mBAAmB,CAAC,IAAI,CAAC;iBACxD;gBACD,WAAW,EAAE,EAAE;aAClB,CAAC;YACF,OAAO,MAAM,0BAAU,CAAC,WAAW,CAAwB,OAAO,CAAC,CAAC;QACxE,CAAC;KAAA;CAER,CAAC,CAAC"}
|
|
@@ -1 +1,5 @@
|
|
|
1
|
-
export declare const dripApplyTagToSubscriber: import("@activepieces/pieces-framework").
|
|
1
|
+
export declare const dripApplyTagToSubscriber: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").SecretTextProperty<true>, {
|
|
2
|
+
account_id: import("@activepieces/pieces-framework").DropdownProperty<string, true>;
|
|
3
|
+
subscriber: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
4
|
+
tag: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
5
|
+
}>;
|
|
@@ -5,12 +5,13 @@ const tslib_1 = require("tslib");
|
|
|
5
5
|
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
6
|
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
7
7
|
const common_1 = require("../common");
|
|
8
|
+
const __1 = require("../../");
|
|
8
9
|
exports.dripApplyTagToSubscriber = (0, pieces_framework_1.createAction)({
|
|
10
|
+
auth: __1.dripAuth,
|
|
9
11
|
name: 'apply_tag_to_subscriber',
|
|
10
12
|
description: 'Apply a tag to a subscriber',
|
|
11
13
|
displayName: 'Apply a tag to subscriber',
|
|
12
14
|
props: {
|
|
13
|
-
authentication: common_1.dripCommon.authentication,
|
|
14
15
|
account_id: common_1.dripCommon.account_id,
|
|
15
16
|
subscriber: common_1.dripCommon.subscriber,
|
|
16
17
|
tag: pieces_framework_1.Property.ShortText({
|
|
@@ -20,19 +21,19 @@ exports.dripApplyTagToSubscriber = (0, pieces_framework_1.createAction)({
|
|
|
20
21
|
})
|
|
21
22
|
},
|
|
22
23
|
sampleData: {},
|
|
23
|
-
run(
|
|
24
|
+
run({ auth, propsValue }) {
|
|
24
25
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
25
26
|
const request = {
|
|
26
27
|
method: pieces_common_1.HttpMethod.POST,
|
|
27
|
-
url: `${common_1.dripCommon.baseUrl(
|
|
28
|
+
url: `${common_1.dripCommon.baseUrl(propsValue.account_id)}/tags`,
|
|
28
29
|
body: {
|
|
29
30
|
tags: [{
|
|
30
|
-
email:
|
|
31
|
-
tag:
|
|
31
|
+
email: propsValue.subscriber,
|
|
32
|
+
tag: propsValue.tag
|
|
32
33
|
}]
|
|
33
34
|
},
|
|
34
35
|
headers: {
|
|
35
|
-
'Authorization': common_1.dripCommon.authorizationHeader(
|
|
36
|
+
'Authorization': common_1.dripCommon.authorizationHeader(auth)
|
|
36
37
|
},
|
|
37
38
|
queryParams: {},
|
|
38
39
|
};
|
|
@@ -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,qEAAsE;AACtE,+DAAiF;AACjF,sCAAuC;
|
|
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;AACvC,8BAAiC;AAEpB,QAAA,wBAAwB,GAAG,IAAA,+BAAY,EAAC;IACjD,IAAI,EAAE,YAAQ;IACV,IAAI,EAAE,yBAAyB;IAC/B,WAAW,EAAE,6BAA6B;IAC1C,WAAW,EAAE,2BAA2B;IACxC,KAAK,EAAE;QACH,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,EAAE,IAAI,EAAE,UAAU,EAAE;;YAC1B,MAAM,OAAO,GAAgB;gBACzB,MAAM,EAAE,0BAAU,CAAC,IAAI;gBACvB,GAAG,EAAE,GAAG,mBAAU,CAAC,OAAO,CAAC,UAAU,CAAC,UAAU,CAAC,OAAO;gBACxD,IAAI,EAAE;oBACF,IAAI,EAAE,CAAC;4BACH,KAAK,EAAE,UAAU,CAAC,UAAU;4BAC5B,GAAG,EAAE,UAAU,CAAC,GAAG;yBACtB,CAAC;iBAEL;gBACD,OAAO,EAAE;oBACL,eAAe,EAAE,mBAAU,CAAC,mBAAmB,CAAC,IAAI,CAAC;iBACxD;gBACD,WAAW,EAAE,EAAE;aAClB,CAAC;YACF,OAAO,MAAM,0BAAU,CAAC,WAAW,CAAwB,OAAO,CAAC,CAAC;QACxE,CAAC;KAAA;CACR,CAAC,CAAC"}
|
|
@@ -1 +1,14 @@
|
|
|
1
|
-
export declare const dripUpsertSubscriberAction: import("@activepieces/pieces-framework").
|
|
1
|
+
export declare const dripUpsertSubscriberAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").SecretTextProperty<true>, {
|
|
2
|
+
account_id: import("@activepieces/pieces-framework").DropdownProperty<string, true>;
|
|
3
|
+
subscriber: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
4
|
+
tags: import("@activepieces/pieces-framework").ArrayProperty<false>;
|
|
5
|
+
custom_fields: import("@activepieces/pieces-framework").ObjectProperty<false>;
|
|
6
|
+
first_name: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
7
|
+
last_name: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
8
|
+
zip: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
9
|
+
country: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
10
|
+
state: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
11
|
+
city: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
12
|
+
phone: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
13
|
+
address: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
14
|
+
}>;
|
|
@@ -5,12 +5,13 @@ const tslib_1 = require("tslib");
|
|
|
5
5
|
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
6
|
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
7
7
|
const common_1 = require("../common");
|
|
8
|
+
const __1 = require("../../");
|
|
8
9
|
exports.dripUpsertSubscriberAction = (0, pieces_framework_1.createAction)({
|
|
10
|
+
auth: __1.dripAuth,
|
|
9
11
|
name: 'upsert_subscriber',
|
|
10
12
|
description: 'Create or Update Subscriber',
|
|
11
13
|
displayName: 'Create or Update Subscriber',
|
|
12
14
|
props: {
|
|
13
|
-
authentication: common_1.dripCommon.authentication,
|
|
14
15
|
account_id: common_1.dripCommon.account_id,
|
|
15
16
|
subscriber: common_1.dripCommon.subscriber,
|
|
16
17
|
tags: common_1.dripCommon.tags,
|
|
@@ -67,28 +68,28 @@ exports.dripUpsertSubscriberAction = (0, pieces_framework_1.createAction)({
|
|
|
67
68
|
}
|
|
68
69
|
]
|
|
69
70
|
},
|
|
70
|
-
run(
|
|
71
|
+
run({ auth, propsValue }) {
|
|
71
72
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
72
73
|
const request = {
|
|
73
74
|
method: pieces_common_1.HttpMethod.POST,
|
|
74
|
-
url: `${common_1.dripCommon.baseUrl(
|
|
75
|
+
url: `${common_1.dripCommon.baseUrl(propsValue.account_id)}/subscribers`,
|
|
75
76
|
body: {
|
|
76
77
|
subscribers: [{
|
|
77
|
-
email:
|
|
78
|
-
tags:
|
|
79
|
-
custom_fields:
|
|
80
|
-
country:
|
|
81
|
-
address1:
|
|
82
|
-
city:
|
|
83
|
-
state:
|
|
84
|
-
zip:
|
|
85
|
-
phone:
|
|
86
|
-
first_name:
|
|
87
|
-
last_name:
|
|
78
|
+
email: propsValue.subscriber,
|
|
79
|
+
tags: propsValue.tags,
|
|
80
|
+
custom_fields: propsValue.custom_fields,
|
|
81
|
+
country: propsValue.country,
|
|
82
|
+
address1: propsValue.address,
|
|
83
|
+
city: propsValue.city,
|
|
84
|
+
state: propsValue.state,
|
|
85
|
+
zip: propsValue.zip,
|
|
86
|
+
phone: propsValue.phone,
|
|
87
|
+
first_name: propsValue.first_name,
|
|
88
|
+
last_name: propsValue.last_name
|
|
88
89
|
}]
|
|
89
90
|
},
|
|
90
91
|
headers: {
|
|
91
|
-
'Authorization': common_1.dripCommon.authorizationHeader(
|
|
92
|
+
'Authorization': common_1.dripCommon.authorizationHeader(auth)
|
|
92
93
|
},
|
|
93
94
|
queryParams: {},
|
|
94
95
|
};
|
|
@@ -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,qEAAsE;AACtE,+DAAiF;AACjF,sCAAuC;
|
|
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;AACvC,8BAAiC;AAEpB,QAAA,0BAA0B,GAAG,IAAA,+BAAY,EAAC;IACnD,IAAI,EAAE,YAAQ;IACV,IAAI,EAAE,mBAAmB;IACzB,WAAW,EAAE,6BAA6B;IAC1C,WAAW,EAAE,6BAA6B;IAC1C,KAAK,EAAE;QACH,UAAU,EAAE,mBAAU,CAAC,UAAU;QACjC,UAAU,EAAE,mBAAU,CAAC,UAAU;QACjC,IAAI,EAAE,mBAAU,CAAC,IAAI;QACrB,aAAa,EAAE,mBAAU,CAAC,aAAa;QACvC,UAAU,EAAE,2BAAQ,CAAC,SAAS,CAAC,EAAE,WAAW,EAAE,YAAY,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;QAC9E,SAAS,EAAE,2BAAQ,CAAC,SAAS,CAAC,EAAE,WAAW,EAAE,WAAW,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;QAC5E,GAAG,EAAE,2BAAQ,CAAC,SAAS,CAAC,EAAE,WAAW,EAAE,UAAU,EAAE,WAAW,EAAE,6CAA6C,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;QACjI,OAA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O,CAAC,CAAC;QACxE,CAAC;KAAA;CACR,CAAC,CAAC"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
export declare const dripCommon: {
|
|
2
2
|
baseUrl: (accountId: string) => string;
|
|
3
|
-
authentication: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
4
3
|
account_id: import("@activepieces/pieces-framework").DropdownProperty<string, true>;
|
|
5
4
|
subscriber: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
6
5
|
tags: import("@activepieces/pieces-framework").ArrayProperty<false>;
|
package/src/lib/common/index.js
CHANGED
|
@@ -6,17 +6,12 @@ const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
|
6
6
|
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
7
7
|
exports.dripCommon = {
|
|
8
8
|
baseUrl: (accountId) => { return `https://api.getdrip.com/v2/${accountId}`; },
|
|
9
|
-
authentication: pieces_framework_1.Property.SecretText({
|
|
10
|
-
displayName: "API Key",
|
|
11
|
-
required: true,
|
|
12
|
-
description: "Get it from https://www.getdrip.com/user/edit"
|
|
13
|
-
}),
|
|
14
9
|
account_id: pieces_framework_1.Property.Dropdown({
|
|
15
10
|
displayName: 'Account',
|
|
16
11
|
required: true,
|
|
17
|
-
refreshers: [
|
|
18
|
-
options: (
|
|
19
|
-
if (!
|
|
12
|
+
refreshers: [],
|
|
13
|
+
options: ({ auth }) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
14
|
+
if (!auth) {
|
|
20
15
|
return {
|
|
21
16
|
disabled: true,
|
|
22
17
|
options: [],
|
|
@@ -27,7 +22,7 @@ exports.dripCommon = {
|
|
|
27
22
|
method: pieces_common_1.HttpMethod.GET,
|
|
28
23
|
url: "https://api.getdrip.com/v2/accounts",
|
|
29
24
|
headers: {
|
|
30
|
-
Authorization: `Basic ${Buffer.from(
|
|
25
|
+
Authorization: `Basic ${Buffer.from(auth).toString("base64")}`,
|
|
31
26
|
},
|
|
32
27
|
};
|
|
33
28
|
const response = yield pieces_common_1.httpClient.sendRequest(request);
|
|
@@ -1 +1 @@
|
|
|
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,
|
|
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,UAAU,EAAE,2BAAQ,CAAC,QAAQ,CAAC;QAC1B,WAAW,EAAE,SAAS;QACtB,QAAQ,EAAE,IAAI;QACd,UAAU,EAAE,EAAE;QACd,OAAO,EAAE,CAAO,EAAE,IAAI,EAAE,EAAE,EAAE;YACxB,IAAI,CAAC,IAAI,EAAE;gBACP,OAAO;oBACH,QAAQ,EAAE,IAAI;oBACd,OAAO,EAAE,EAAE;oBACX,WAAW,EAAE,8BAA8B;iBAC9C,CAAA;aACJ;YAED,MAAM,OAAO,GAAgB;gBACzB,MAAM,EAAE,0BAAU,CAAC,GAAG;gBACtB,GAAG,EAAE,qCAAqC;gBAC1C,OAAO,EAAE;oBACL,aAAa,EAAE,SAAS,MAAM,CAAC,IAAI,CAAC,IAAc,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE;iBAC3E;aACJ,CAAC;YACF,MAAM,QAAQ,GAAG,MAAM,0BAAU,CAAC,WAAW,CAA+C,OAAO,CAAC,CAAC;YACrG,MAAM,IAAI,GAAG,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE;gBAC5C,OAAO,EAAE,KAAK,EAAE,GAAG,CAAC,EAAE,EAAE,KAAK,EAAE,GAAG,CAAC,IAAI,EAAE,CAAC;YAC9C,CAAC,CAAC,CAAC;YACH,OAAO;gBACH,QAAQ,EAAE,KAAK;gBACf,OAAO,EAAE,IAAI;aAChB,CAAA;QACL,CAAC,CAAA;KAEJ,CAAC;IACF,UAAU,EAAE,2BAAQ,CAAC,SAAS,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,kBAAkB,EAAE,WAAW,EAAE,yBAAyB,EAAE,CAAC;IAC3H,IAAI,EAAE,2BAAQ,CAAC,KAAK,CAAC;QACjB,WAAW,EAAE,MAAM;QACnB,QAAQ,EAAE,KAAK;QACf,WAAW,EAAE,6BAA6B;KAC7C,CAAC;IACF,aAAa,EAAE,2BAAQ,CAAC,MAAM,CAAC;QAC3B,WAAW,EAAE,eAAe;QAC5B,QAAQ,EAAE,KAAK;QACf,WAAW,EAAE,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,4 @@
|
|
|
1
|
-
|
|
1
|
+
import { TriggerStrategy } from "@activepieces/pieces-framework";
|
|
2
|
+
export declare const dripNewSubscriberEvent: import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.WEBHOOK, import("@activepieces/pieces-framework").SecretTextProperty<true>, {
|
|
3
|
+
account_id: import("@activepieces/pieces-framework").DropdownProperty<string, true>;
|
|
4
|
+
}>;
|
|
@@ -5,13 +5,14 @@ const tslib_1 = require("tslib");
|
|
|
5
5
|
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
6
6
|
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
7
7
|
const common_1 = require("../common");
|
|
8
|
+
const __1 = require("../../");
|
|
8
9
|
const triggerNameInStore = 'drip_new_subscriber_trigger';
|
|
9
10
|
exports.dripNewSubscriberEvent = (0, pieces_framework_1.createTrigger)({
|
|
11
|
+
auth: __1.dripAuth,
|
|
10
12
|
name: 'new_subscriber',
|
|
11
13
|
displayName: 'New Subscriber',
|
|
12
14
|
description: 'Triggers when a subscriber is created in your Drip account.',
|
|
13
15
|
props: {
|
|
14
|
-
authentication: common_1.dripCommon.authentication,
|
|
15
16
|
account_id: common_1.dripCommon.account_id
|
|
16
17
|
},
|
|
17
18
|
sampleData: {
|
|
@@ -23,25 +24,24 @@ exports.dripNewSubscriberEvent = (0, pieces_framework_1.createTrigger)({
|
|
|
23
24
|
"occurred_at": "2013-06-21T10:31:58Z"
|
|
24
25
|
},
|
|
25
26
|
type: pieces_framework_1.TriggerStrategy.WEBHOOK,
|
|
26
|
-
onEnable(
|
|
27
|
-
var _a;
|
|
27
|
+
onEnable({ auth, propsValue, webhookUrl, store }) {
|
|
28
28
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
29
29
|
const request = {
|
|
30
30
|
method: pieces_common_1.HttpMethod.POST,
|
|
31
|
-
url: `${common_1.dripCommon.baseUrl(
|
|
31
|
+
url: `${common_1.dripCommon.baseUrl(propsValue.account_id)}/webhooks`,
|
|
32
32
|
body: {
|
|
33
|
-
webhooks: [{ post_url:
|
|
33
|
+
webhooks: [{ post_url: webhookUrl, events: ["subscriber.created"] }],
|
|
34
34
|
},
|
|
35
35
|
headers: {
|
|
36
|
-
'Authorization': common_1.dripCommon.authorizationHeader(
|
|
36
|
+
'Authorization': common_1.dripCommon.authorizationHeader(auth)
|
|
37
37
|
},
|
|
38
38
|
queryParams: {},
|
|
39
39
|
};
|
|
40
40
|
const { body } = yield pieces_common_1.httpClient.sendRequest(request);
|
|
41
|
-
yield
|
|
41
|
+
yield store.put(triggerNameInStore, {
|
|
42
42
|
webhookId: body.webhooks[0].id,
|
|
43
|
-
userId:
|
|
44
|
-
})
|
|
43
|
+
userId: propsValue.account_id
|
|
44
|
+
});
|
|
45
45
|
});
|
|
46
46
|
},
|
|
47
47
|
onDisable(context) {
|
|
@@ -53,7 +53,7 @@ exports.dripNewSubscriberEvent = (0, pieces_framework_1.createTrigger)({
|
|
|
53
53
|
method: pieces_common_1.HttpMethod.DELETE,
|
|
54
54
|
url: `${common_1.dripCommon.baseUrl(response.userId)}/webhooks/${response.webhookId}`,
|
|
55
55
|
headers: {
|
|
56
|
-
'Authorization': common_1.dripCommon.authorizationHeader(context.
|
|
56
|
+
'Authorization': common_1.dripCommon.authorizationHeader(context.auth)
|
|
57
57
|
},
|
|
58
58
|
};
|
|
59
59
|
yield pieces_common_1.httpClient.sendRequest(request);
|
|
@@ -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,+DAAkF;AAClF,qEAAgF;AAChF,sCAAuC;
|
|
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;AACvC,8BAAkC;AAElC,MAAM,kBAAkB,GAAG,6BAA6B,CAAC;AAC5C,QAAA,sBAAsB,GAAG,IAAA,gCAAa,EAAC;IAClD,IAAI,EAAE,YAAQ;IACZ,IAAI,EAAE,gBAAgB;IACtB,WAAW,EAAE,gBAAgB;IAC7B,WAAW,EAAE,6DAA6D;IAC1E,KAAK,EAAE;QACL,UAAU,EAAE,mBAAU,CAAC,UAAU;KAClC;IACD,UAAU,EAAE;QACV,OAAO,EAAE,oBAAoB;QAC7B,MAAM,EAAE;YACN,YAAY,EAAE,SAAS;YACvB,YAAY,EAAE,EAAE;SACjB;QACD,aAAa,EAAE,sBAAsB;KACtC;IACD,IAA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AI,CAAC;qBAC9D;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;CACJ,CAAC,CAAC"}
|
|
@@ -1 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import { TriggerStrategy } from "@activepieces/pieces-framework";
|
|
2
|
+
export declare const dripTagAppliedEvent: import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.WEBHOOK, import("@activepieces/pieces-framework").SecretTextProperty<true>, {
|
|
3
|
+
account_id: import("@activepieces/pieces-framework").DropdownProperty<string, true>;
|
|
4
|
+
}>;
|
|
@@ -5,13 +5,14 @@ const tslib_1 = require("tslib");
|
|
|
5
5
|
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
6
6
|
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
7
7
|
const common_1 = require("../common");
|
|
8
|
+
const __1 = require("../../");
|
|
8
9
|
const triggerNameInStore = 'drip_tag_applied_to_subscriber_trigger';
|
|
9
10
|
exports.dripTagAppliedEvent = (0, pieces_framework_1.createTrigger)({
|
|
11
|
+
auth: __1.dripAuth,
|
|
10
12
|
name: 'tag_applied_to_subscribers',
|
|
11
13
|
displayName: 'Tag Applied',
|
|
12
14
|
description: 'Triggers when a tag is applied.',
|
|
13
15
|
props: {
|
|
14
|
-
authentication: common_1.dripCommon.authentication,
|
|
15
16
|
account_id: common_1.dripCommon.account_id
|
|
16
17
|
},
|
|
17
18
|
sampleData: {
|
|
@@ -31,12 +32,12 @@ exports.dripTagAppliedEvent = (0, pieces_framework_1.createTrigger)({
|
|
|
31
32
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
32
33
|
const request = {
|
|
33
34
|
method: pieces_common_1.HttpMethod.POST,
|
|
34
|
-
url: `${common_1.dripCommon.baseUrl(context.propsValue
|
|
35
|
+
url: `${common_1.dripCommon.baseUrl(context.propsValue.account_id)}/webhooks`,
|
|
35
36
|
body: {
|
|
36
37
|
webhooks: [{ post_url: context.webhookUrl, events: ["subscriber.applied_tag"] }],
|
|
37
38
|
},
|
|
38
39
|
headers: {
|
|
39
|
-
'Authorization': common_1.dripCommon.authorizationHeader(context.
|
|
40
|
+
'Authorization': common_1.dripCommon.authorizationHeader(context.auth)
|
|
40
41
|
},
|
|
41
42
|
queryParams: {},
|
|
42
43
|
};
|
|
@@ -56,7 +57,7 @@ exports.dripTagAppliedEvent = (0, pieces_framework_1.createTrigger)({
|
|
|
56
57
|
method: pieces_common_1.HttpMethod.DELETE,
|
|
57
58
|
url: `${common_1.dripCommon.baseUrl(response.userId)}/webhooks/${response.webhookId}`,
|
|
58
59
|
headers: {
|
|
59
|
-
'Authorization': common_1.dripCommon.authorizationHeader(context.
|
|
60
|
+
'Authorization': common_1.dripCommon.authorizationHeader(context.auth)
|
|
60
61
|
},
|
|
61
62
|
};
|
|
62
63
|
yield pieces_common_1.httpClient.sendRequest(request);
|
|
@@ -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,+DAAkF;AAClF,qEAAgF;AAChF,sCAAuC;
|
|
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;AACvC,8BAAkC;AAElC,MAAM,kBAAkB,GAAG,wCAAwC,CAAC;AACvD,QAAA,mBAAmB,GAAG,IAAA,gCAAa,EAAC;IAC/C,IAAI,EAAE,YAAQ;IACZ,IAAI,EAAE,4BAA4B;IAClC,WAAW,EAAE,aAAa;IAC1B,WAAW,EAAE,iCAAiC;IAC9C,KAAK,EAAE;QACL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