@activepieces/piece-saastic 0.0.2 → 0.0.3
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 +3 -3
- package/src/index.js +18 -8
- package/src/index.js.map +1 -1
- package/src/lib/actions/create-charge.js +7 -7
- package/src/lib/actions/create-charge.js.map +1 -1
- package/src/lib/actions/create-customer.js +8 -8
- package/src/lib/actions/create-customer.js.map +1 -1
- package/src/lib/common/index.js +1 -1
- package/src/lib/common/index.js.map +1 -1
package/package.json
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@activepieces/piece-saastic",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.3",
|
|
4
4
|
"dependencies": {
|
|
5
5
|
"@activepieces/pieces-common": "latest",
|
|
6
6
|
"@activepieces/pieces-framework": "latest",
|
|
7
7
|
"@sinclair/typebox": "0.26.8",
|
|
8
|
-
"axios": "^1.
|
|
8
|
+
"axios": "^1.6.3",
|
|
9
9
|
"dayjs": "1.11.9",
|
|
10
10
|
"is-base64": "1.1.0",
|
|
11
11
|
"lodash": "4.17.21",
|
|
12
12
|
"nanoid": "3.3.6",
|
|
13
13
|
"semver": "7.5.4",
|
|
14
14
|
"tslib": "^2.6.2",
|
|
15
|
-
"@activepieces/shared": "0.10.
|
|
15
|
+
"@activepieces/shared": "0.10.66"
|
|
16
16
|
},
|
|
17
17
|
"main": "./src/index.js",
|
|
18
18
|
"type": "commonjs"
|
package/src/index.js
CHANGED
|
@@ -17,8 +17,8 @@ exports.saasticAuth = pieces_framework_1.PieceAuth.SecretText({
|
|
|
17
17
|
method: pieces_common_1.HttpMethod.GET,
|
|
18
18
|
authentication: {
|
|
19
19
|
type: pieces_common_1.AuthenticationType.BEARER_TOKEN,
|
|
20
|
-
token: auth.auth
|
|
21
|
-
}
|
|
20
|
+
token: auth.auth,
|
|
21
|
+
},
|
|
22
22
|
});
|
|
23
23
|
return {
|
|
24
24
|
valid: true,
|
|
@@ -27,18 +27,28 @@ exports.saasticAuth = pieces_framework_1.PieceAuth.SecretText({
|
|
|
27
27
|
catch (e) {
|
|
28
28
|
return {
|
|
29
29
|
valid: false,
|
|
30
|
-
error: 'Invalid API token'
|
|
30
|
+
error: 'Invalid API token',
|
|
31
31
|
};
|
|
32
32
|
}
|
|
33
|
-
})
|
|
33
|
+
}),
|
|
34
34
|
});
|
|
35
35
|
exports.saastic = (0, pieces_framework_1.createPiece)({
|
|
36
|
-
displayName:
|
|
36
|
+
displayName: 'Saastic',
|
|
37
37
|
auth: exports.saasticAuth,
|
|
38
38
|
minimumSupportedRelease: '0.9.0',
|
|
39
|
-
logoUrl:
|
|
40
|
-
authors: [
|
|
41
|
-
actions: [
|
|
39
|
+
logoUrl: 'https://cdn.activepieces.com/pieces/saastic.png',
|
|
40
|
+
authors: ['joselupianez'],
|
|
41
|
+
actions: [
|
|
42
|
+
create_customer_1.createCustomer,
|
|
43
|
+
create_charge_1.createCharge,
|
|
44
|
+
(0, pieces_common_1.createCustomApiCallAction)({
|
|
45
|
+
baseUrl: () => 'https://api.saastic.com',
|
|
46
|
+
auth: exports.saasticAuth,
|
|
47
|
+
authMapping: (auth) => ({
|
|
48
|
+
Authorization: `Bearer ${auth}`,
|
|
49
|
+
}),
|
|
50
|
+
}),
|
|
51
|
+
],
|
|
42
52
|
triggers: [],
|
|
43
53
|
});
|
|
44
54
|
//# sourceMappingURL=index.js.map
|
package/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/pieces/community/saastic/src/index.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,+DAKqC;AACrC,mEAA+D;AAC/D,+DAA2D;AAE9C,QAAA,WAAW,GAAG,4BAAS,CAAC,UAAU,CAAC;IAC9C,WAAW,EACT,oFAAoF;IACtF,WAAW,EAAE,SAAS;IACtB,QAAQ,EAAE,IAAI;IACd,QAAQ,EAAE,CAAO,IAAI,EAAE,EAAE;QACvB,IAAI;YACF,MAAM,0BAAU,CAAC,WAAW,CAEzB;gBACD,GAAG,EAAE,0CAA0C;gBAC/C,MAAM,EAAE,0BAAU,CAAC,GAAG;gBACtB,cAAc,EAAE;oBACd,IAAI,EAAE,kCAAkB,CAAC,YAAY;oBACrC,KAAK,EAAE,IAAI,CAAC,IAAc;iBAC3B;aACF,CAAC,CAAC;YACH,OAAO;gBACL,KAAK,EAAE,IAAI;aACZ,CAAC;SACH;QAAC,OAAO,CAAC,EAAE;YACV,OAAO;gBACL,KAAK,EAAE,KAAK;gBACZ,KAAK,EAAE,mBAAmB;aAC3B,CAAC;SACH;IACH,CAAC,CAAA;CACF,CAAC,CAAC;AAEU,QAAA,OAAO,GAAG,IAAA,8BAAW,EAAC;IACjC,WAAW,EAAE,SAAS;IACtB,IAAI,EAAE,mBAAW;IACjB,uBAAuB,EAAE,OAAO;IAChC,OAAO,EAAE,iDAAiD;IAC1D,OAAO,EAAE,CAAC,cAAc,CAAC;IACzB,OAAO,EAAE;QACP,gCAAc;QACd,4BAAY;QACZ,IAAA,yCAAyB,EAAC;YACxB,OAAO,EAAE,GAAG,EAAE,CAAC,yBAAyB;YACxC,IAAI,EAAE,mBAAW;YACjB,WAAW,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;gBACtB,aAAa,EAAE,UAAU,IAAI,EAAE;aAChC,CAAC;SACH,CAAC;KACH;IACD,QAAQ,EAAE,EAAE;CACb,CAAC,CAAC"}
|
|
@@ -14,7 +14,7 @@ exports.createCharge = (0, pieces_framework_1.createAction)({
|
|
|
14
14
|
props: {
|
|
15
15
|
email: pieces_framework_1.Property.LongText({
|
|
16
16
|
displayName: 'Email',
|
|
17
|
-
description:
|
|
17
|
+
description: "The customer's email address.",
|
|
18
18
|
required: true,
|
|
19
19
|
processors: [],
|
|
20
20
|
validators: [pieces_framework_1.Validators.email],
|
|
@@ -22,7 +22,7 @@ exports.createCharge = (0, pieces_framework_1.createAction)({
|
|
|
22
22
|
amount: pieces_framework_1.Property.Number({
|
|
23
23
|
displayName: 'Amount',
|
|
24
24
|
description: 'The amount charged in the smallest currency unit.',
|
|
25
|
-
required: false
|
|
25
|
+
required: false,
|
|
26
26
|
}),
|
|
27
27
|
currency: pieces_framework_1.Property.ShortText({
|
|
28
28
|
displayName: 'Currency',
|
|
@@ -33,8 +33,8 @@ exports.createCharge = (0, pieces_framework_1.createAction)({
|
|
|
33
33
|
charged_at: pieces_framework_1.Property.DateTime({
|
|
34
34
|
displayName: 'Charge date',
|
|
35
35
|
description: 'The date the customer was charged.',
|
|
36
|
-
required: false
|
|
37
|
-
})
|
|
36
|
+
required: false,
|
|
37
|
+
}),
|
|
38
38
|
},
|
|
39
39
|
run(context) {
|
|
40
40
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
@@ -45,7 +45,7 @@ exports.createCharge = (0, pieces_framework_1.createAction)({
|
|
|
45
45
|
email: context.propsValue.email || '',
|
|
46
46
|
amount: context.propsValue.amount || '',
|
|
47
47
|
currency: context.propsValue.currency || '',
|
|
48
|
-
charged_at: context.propsValue.charged_at || ''
|
|
48
|
+
charged_at: context.propsValue.charged_at || '',
|
|
49
49
|
},
|
|
50
50
|
authentication: {
|
|
51
51
|
type: pieces_common_1.AuthenticationType.BEARER_TOKEN,
|
|
@@ -55,9 +55,9 @@ exports.createCharge = (0, pieces_framework_1.createAction)({
|
|
|
55
55
|
};
|
|
56
56
|
yield pieces_common_1.httpClient.sendRequest(request);
|
|
57
57
|
return {
|
|
58
|
-
success: true
|
|
58
|
+
success: true,
|
|
59
59
|
};
|
|
60
60
|
});
|
|
61
|
-
}
|
|
61
|
+
},
|
|
62
62
|
});
|
|
63
63
|
//# sourceMappingURL=create-charge.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-charge.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"create-charge.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/saastic/src/lib/actions/create-charge.ts"],"names":[],"mappings":";;;;AAAA,qEAIwC;AACxC,+DAKqC;AACrC,sCAA0C;AAC1C,6BAAoC;AAEvB,QAAA,YAAY,GAAG,IAAA,+BAAY,EAAC;IACvC,IAAI,EAAE,eAAW;IACjB,IAAI,EAAE,eAAe;IACrB,WAAW,EAAE,0BAA0B;IACvC,WAAW,EAAE,4BAA4B;IAEzC,KAAK,EAAE;QACL,KAAK,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YACvB,WAAW,EAAE,OAAO;YACpB,WAAW,EAAE,+BAA+B;YAC5C,QAAQ,EAAE,IAAI;YACd,UAAU,EAAE,EAAE;YACd,UAAU,EAAE,CAAC,6BAAU,CAAC,KAAK,CAAC;SAC/B,CAAC;QACF,MAAM,EAAE,2BAAQ,CAAC,MAAM,CAAC;YACtB,WAAW,EAAE,QAAQ;YACrB,WAAW,EAAE,mDAAmD;YAChE,QAAQ,EAAE,KAAK;SAChB,CAAC;QACF,QAAQ,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC3B,WAAW,EAAE,UAAU;YACvB,WAAW,EAAE,wBAAwB;YACrC,QAAQ,EAAE,KAAK;YACf,YAAY,EAAE,KAAK;SACpB,CAAC;QACF,UAAU,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YAC5B,WAAW,EAAE,aAAa;YAC1B,WAAW,EAAE,oCAAoC;YACjD,QAAQ,EAAE,KAAK;SAChB,CAAC;KACH;IAEK,GAAG,CAAC,OAAO;;YACf,MAAM,OAAO,GAAgB;gBAC3B,MAAM,EAAE,0BAAU,CAAC,IAAI;gBACvB,GAAG,EAAE,GAAG,sBAAa,CAAC,OAAO,UAAU;gBACvC,IAAI,EAAE;oBACJ,KAAK,EAAE,OAAO,CAAC,UAAU,CAAC,KAAK,IAAI,EAAE;oBACrC,MAAM,EAAE,OAAO,CAAC,UAAU,CAAC,MAAM,IAAI,EAAE;oBACvC,QAAQ,EAAE,OAAO,CAAC,UAAU,CAAC,QAAQ,IAAI,EAAE;oBAC3C,UAAU,EAAE,OAAO,CAAC,UAAU,CAAC,UAAU,IAAI,EAAE;iBAChD;gBACD,cAAc,EAAE;oBACd,IAAI,EAAE,kCAAkB,CAAC,YAAY;oBACrC,KAAK,EAAE,OAAO,CAAC,IAAI;iBACpB;gBACD,WAAW,EAAE,EAAE;aAChB,CAAC;YAEF,MAAM,0BAAU,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;YAEtC,OAAO;gBACL,OAAO,EAAE,IAAI;aACd,CAAC;QACJ,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -14,24 +14,24 @@ exports.createCustomer = (0, pieces_framework_1.createAction)({
|
|
|
14
14
|
props: {
|
|
15
15
|
first_name: pieces_framework_1.Property.LongText({
|
|
16
16
|
displayName: 'First Name',
|
|
17
|
-
description:
|
|
17
|
+
description: "The customer's first name.",
|
|
18
18
|
required: true,
|
|
19
19
|
}),
|
|
20
20
|
last_name: pieces_framework_1.Property.LongText({
|
|
21
21
|
displayName: 'Last Name',
|
|
22
|
-
description:
|
|
22
|
+
description: "The customer's last name.",
|
|
23
23
|
required: true,
|
|
24
24
|
}),
|
|
25
25
|
email: pieces_framework_1.Property.LongText({
|
|
26
26
|
displayName: 'Email',
|
|
27
|
-
description:
|
|
27
|
+
description: "The customer's email address.",
|
|
28
28
|
required: true,
|
|
29
29
|
processors: [],
|
|
30
30
|
validators: [pieces_framework_1.Validators.email],
|
|
31
31
|
}),
|
|
32
32
|
phone: pieces_framework_1.Property.LongText({
|
|
33
33
|
displayName: 'Phone',
|
|
34
|
-
description:
|
|
34
|
+
description: "The customer's phone number. Ex: +15555555555",
|
|
35
35
|
required: false,
|
|
36
36
|
}),
|
|
37
37
|
signed_up_at: pieces_framework_1.Property.DateTime({
|
|
@@ -40,7 +40,7 @@ exports.createCustomer = (0, pieces_framework_1.createAction)({
|
|
|
40
40
|
required: false,
|
|
41
41
|
processors: [],
|
|
42
42
|
validators: [pieces_framework_1.Validators.datetimeIso],
|
|
43
|
-
})
|
|
43
|
+
}),
|
|
44
44
|
},
|
|
45
45
|
run(context) {
|
|
46
46
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
@@ -52,7 +52,7 @@ exports.createCustomer = (0, pieces_framework_1.createAction)({
|
|
|
52
52
|
last_name: context.propsValue.last_name || '',
|
|
53
53
|
email: context.propsValue.email || '',
|
|
54
54
|
phone: context.propsValue.phone || '',
|
|
55
|
-
signed_up_at: context.propsValue.signed_up_at || ''
|
|
55
|
+
signed_up_at: context.propsValue.signed_up_at || '',
|
|
56
56
|
},
|
|
57
57
|
authentication: {
|
|
58
58
|
type: pieces_common_1.AuthenticationType.BEARER_TOKEN,
|
|
@@ -62,9 +62,9 @@ exports.createCustomer = (0, pieces_framework_1.createAction)({
|
|
|
62
62
|
};
|
|
63
63
|
yield pieces_common_1.httpClient.sendRequest(request);
|
|
64
64
|
return {
|
|
65
|
-
success: true
|
|
65
|
+
success: true,
|
|
66
66
|
};
|
|
67
67
|
});
|
|
68
|
-
}
|
|
68
|
+
},
|
|
69
69
|
});
|
|
70
70
|
//# sourceMappingURL=create-customer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-customer.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"create-customer.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/saastic/src/lib/actions/create-customer.ts"],"names":[],"mappings":";;;;AAAA,qEAIwC;AACxC,+DAKqC;AACrC,sCAA0C;AAC1C,6BAAoC;AAEvB,QAAA,cAAc,GAAG,IAAA,+BAAY,EAAC;IACzC,IAAI,EAAE,eAAW;IACjB,IAAI,EAAE,iBAAiB;IACvB,WAAW,EAAE,6BAA6B;IAC1C,WAAW,EAAE,8BAA8B;IAE3C,KAAK,EAAE;QACL,UAAU,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YAC5B,WAAW,EAAE,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,cAAc,EAAE;oBACd,IAAI,EAAE,kCAAkB,CAAC,YAAY;oBACrC,KAAK,EAAE,OAAO,CAAC,IAAI;iBACpB;gBACD,WAAW,EAAE,EAAE;aAChB,CAAC;YACF,MAAM,0BAAU,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;YAEtC,OAAO;gBACL,OAAO,EAAE,IAAI;aACd,CAAC;QACJ,CAAC;KAAA;CACF,CAAC,CAAC"}
|
package/src/lib/common/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/saastic/src/lib/common/index.ts"],"names":[],"mappings":";;;AAAa,QAAA,aAAa,GAAG;IAC3B,OAAO,EAAE,gCAAgC;CAC1C,CAAC"}
|