@activepieces/piece-mysendingbox 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/package.json +13 -0
- package/src/index.d.ts +6 -0
- package/src/index.js +59 -0
- package/src/index.js.map +1 -0
package/package.json
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@activepieces/piece-mysendingbox",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"scripts": {
|
|
5
|
+
"build": "tsc -p tsconfig.lib.json",
|
|
6
|
+
"lint": "eslint 'src/**/*.ts'"
|
|
7
|
+
},
|
|
8
|
+
"dependencies": {
|
|
9
|
+
"@activepieces/pieces-common": "workspace:*",
|
|
10
|
+
"@activepieces/pieces-framework": "workspace:*",
|
|
11
|
+
"@activepieces/shared": "workspace:*"
|
|
12
|
+
}
|
|
13
|
+
}
|
package/src/index.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const mySendingBoxPieceAuth: import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
2
|
+
apiKey: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
3
|
+
}>;
|
|
4
|
+
export declare const mysendingbox: import("@activepieces/pieces-framework").Piece<import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
5
|
+
apiKey: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
6
|
+
}>>;
|
package/src/index.js
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.mysendingbox = exports.mySendingBoxPieceAuth = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
+
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
7
|
+
const markdown = `
|
|
8
|
+
MySendingBox API keyis available under the developer portal.
|
|
9
|
+
(https://app.mysendingbox.fr/account/keys)`;
|
|
10
|
+
exports.mySendingBoxPieceAuth = pieces_framework_1.PieceAuth.CustomAuth({
|
|
11
|
+
description: markdown,
|
|
12
|
+
required: true,
|
|
13
|
+
props: {
|
|
14
|
+
apiKey: pieces_framework_1.PieceAuth.SecretText({
|
|
15
|
+
displayName: 'API Key',
|
|
16
|
+
required: true,
|
|
17
|
+
}),
|
|
18
|
+
},
|
|
19
|
+
validate: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth }) {
|
|
20
|
+
if (auth) {
|
|
21
|
+
yield pieces_common_1.httpClient.sendRequest({
|
|
22
|
+
method: pieces_common_1.HttpMethod.GET,
|
|
23
|
+
url: 'https://api.mysendingbox.fr/',
|
|
24
|
+
headers: {
|
|
25
|
+
Authorization: `Basic ${btoa(`${auth.apiKey}:`)}`,
|
|
26
|
+
},
|
|
27
|
+
});
|
|
28
|
+
return {
|
|
29
|
+
valid: true,
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
return {
|
|
33
|
+
valid: false,
|
|
34
|
+
error: 'Invalid Api Key',
|
|
35
|
+
};
|
|
36
|
+
}),
|
|
37
|
+
});
|
|
38
|
+
exports.mysendingbox = (0, pieces_framework_1.createPiece)({
|
|
39
|
+
displayName: 'Mysendingbox',
|
|
40
|
+
auth: exports.mySendingBoxPieceAuth,
|
|
41
|
+
minimumSupportedRelease: '0.78.0',
|
|
42
|
+
logoUrl: 'https://cdn.activepieces.com/pieces/mysendingbox.png',
|
|
43
|
+
authors: ['Blightwidow'],
|
|
44
|
+
actions: [
|
|
45
|
+
(0, pieces_common_1.createCustomApiCallAction)({
|
|
46
|
+
baseUrl: () => {
|
|
47
|
+
return 'https://api.mysendingbox.fr';
|
|
48
|
+
},
|
|
49
|
+
auth: exports.mySendingBoxPieceAuth,
|
|
50
|
+
authMapping: (auth) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
51
|
+
return ({
|
|
52
|
+
Authorization: `Basic ${btoa(`${auth.props.apiKey}:`)}`,
|
|
53
|
+
});
|
|
54
|
+
}),
|
|
55
|
+
}),
|
|
56
|
+
],
|
|
57
|
+
triggers: [],
|
|
58
|
+
});
|
|
59
|
+
//# sourceMappingURL=index.js.map
|
package/src/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/pieces/community/mysendingbox/src/index.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,+DAIqC;AAErC,MAAM,QAAQ,GAAG;;2CAE0B,CAAC;AAE/B,QAAA,qBAAqB,GAAG,4BAAS,CAAC,UAAU,CAAC;IACxD,WAAW,EAAE,QAAQ;IACrB,QAAQ,EAAE,IAAI;IACd,KAAK,EAAE;QACL,MAAM,EAAE,4BAAS,CAAC,UAAU,CAAC;YAC3B,WAAW,EAAE,SAAS;YACtB,QAAQ,EAAE,IAAI;SACf,CAAC;KACH;IACD,QAAQ,EAAE,KAAiB,EAAE,oDAAZ,EAAE,IAAI,EAAE;QACvB,IAAI,IAAI,EAAE,CAAC;YACT,MAAM,0BAAU,CAAC,WAAW,CAAC;gBAC3B,MAAM,EAAE,0BAAU,CAAC,GAAG;gBACtB,GAAG,EAAE,8BAA8B;gBACnC,OAAO,EAAE;oBACP,aAAa,EAAE,SAAS,IAAI,CAAC,GAAG,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE;iBAClD;aACF,CAAC,CAAC;YACH,OAAO;gBACL,KAAK,EAAE,IAAI;aACZ,CAAC;QACJ,CAAC;QACD,OAAO;YACL,KAAK,EAAE,KAAK;YACZ,KAAK,EAAE,iBAAiB;SACzB,CAAC;IACJ,CAAC,CAAA;CACF,CAAC,CAAC;AAEU,QAAA,YAAY,GAAG,IAAA,8BAAW,EAAC;IACtC,WAAW,EAAE,cAAc;IAC3B,IAAI,EAAE,6BAAqB;IAC3B,uBAAuB,EAAE,QAAQ;IACjC,OAAO,EAAE,sDAAsD;IAC/D,OAAO,EAAE,CAAC,aAAa,CAAC;IACxB,OAAO,EAAE;QACP,IAAA,yCAAyB,EAAC;YACxB,OAAO,EAAE,GAAG,EAAE;gBACZ,OAAO,6BAA6B,CAAC;YACvC,CAAC;YACD,IAAI,EAAE,6BAAqB;YAC3B,WAAW,EAAE,CAAO,IAAI,EAAE,EAAE;gBAAC,OAAA,CAAC;oBAC5B,aAAa,EAAE,SAAS,IAAI,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE;iBACxD,CAAC,CAAA;cAAA;SACH,CAAC;KACH;IACD,QAAQ,EAAE,EAAE;CACb,CAAC,CAAC"}
|