@activepieces/piece-mastodon 0.0.1 → 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
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@activepieces/piece-mastodon",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.3",
|
|
4
4
|
"dependencies": {
|
|
5
|
-
"@sinclair/typebox": "0.26.
|
|
5
|
+
"@sinclair/typebox": "0.26.8",
|
|
6
6
|
"axios": "1.2.4",
|
|
7
7
|
"nanoid": "3.3.4",
|
|
8
|
-
"@activepieces/framework": "0.3.
|
|
9
|
-
"@activepieces/shared": "0.3.
|
|
8
|
+
"@activepieces/pieces-framework": "0.3.13",
|
|
9
|
+
"@activepieces/shared": "0.3.11",
|
|
10
|
+
"@activepieces/pieces-common": "0.0.1",
|
|
10
11
|
"tslib": "2.4.1"
|
|
11
12
|
},
|
|
12
13
|
"main": "./src/index.js",
|
package/src/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const mastodon: import("@activepieces/framework").Piece;
|
|
1
|
+
export declare const mastodon: import("@activepieces/pieces-framework").Piece;
|
package/src/index.js
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.mastodon = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const
|
|
5
|
+
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
6
|
const package_json_1 = tslib_1.__importDefault(require("../package.json"));
|
|
7
7
|
const post_status_1 = require("./lib/actions/post-status");
|
|
8
|
-
exports.mastodon = (0,
|
|
8
|
+
exports.mastodon = (0, pieces_framework_1.createPiece)({
|
|
9
9
|
name: 'mastodon',
|
|
10
10
|
displayName: 'Mastodon',
|
|
11
11
|
logoUrl: 'https://cdn.activepieces.com/pieces/mastodon.png',
|
package/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../packages/pieces/mastodon/src/index.ts"],"names":[],"mappings":";;;;AACA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../packages/pieces/mastodon/src/index.ts"],"names":[],"mappings":";;;;AACA,qEAA6D;AAC7D,2EAA0C;AAC1C,2DAAuD;AAE1C,QAAA,QAAQ,GAAG,IAAA,8BAAW,EAAC;IAClC,IAAI,EAAE,UAAU;IAChB,WAAW,EAAE,UAAU;IACvB,OAAO,EAAE,kDAAkD;IAC3D,OAAO,EAAE,sBAAW,CAAC,OAAO;IAC5B,uBAAuB,EAAE,OAAO;IAChC,OAAO,EAAE;QACP,UAAU;KACX;IACD,OAAO,EAAE;QACP,wBAAU;KACX;IACD,QAAQ,EAAE,EACT;CACF,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const postStatus: import("@activepieces/framework").Action;
|
|
1
|
+
export declare const postStatus: import("@activepieces/pieces-framework").Action;
|
|
@@ -2,23 +2,35 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.postStatus = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const
|
|
6
|
-
|
|
5
|
+
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
+
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
7
|
+
const markdownDescription = `
|
|
8
|
+
**Base Url**: The base url of your Mastodon instance (e.g \`https://mastodon.social\`)
|
|
9
|
+
|
|
10
|
+
**Access Token**: To get your access token, follow the steps below:
|
|
11
|
+
|
|
12
|
+
1. Go to your **Profile** -> **Preferences** -> **Development** -> **New Application**
|
|
13
|
+
2. Fill the Information
|
|
14
|
+
3. Click on **Create Application**
|
|
15
|
+
4. Copy access token from **Your access token**
|
|
16
|
+
`;
|
|
17
|
+
exports.postStatus = (0, pieces_framework_1.createAction)({
|
|
7
18
|
name: 'post_status',
|
|
8
19
|
displayName: 'Post Status',
|
|
9
20
|
description: 'Post a status to Mastodon',
|
|
10
21
|
sampleData: {},
|
|
11
22
|
props: {
|
|
12
|
-
authentication:
|
|
23
|
+
authentication: pieces_framework_1.Property.CustomAuth({
|
|
13
24
|
displayName: "Authentication",
|
|
25
|
+
description: markdownDescription,
|
|
14
26
|
props: {
|
|
15
|
-
base_url:
|
|
27
|
+
base_url: pieces_framework_1.Property.ShortText({
|
|
16
28
|
displayName: 'Base URL',
|
|
17
29
|
description: 'The base URL of your Mastodon instance',
|
|
18
30
|
defaultValue: "https://mastodon.social/",
|
|
19
31
|
required: true,
|
|
20
32
|
}),
|
|
21
|
-
access_token:
|
|
33
|
+
access_token: pieces_framework_1.Property.ShortText({
|
|
22
34
|
displayName: 'Access Token',
|
|
23
35
|
description: 'The access token for your Mastodon account, check the documentation for how to get this',
|
|
24
36
|
required: true
|
|
@@ -26,7 +38,7 @@ exports.postStatus = (0, framework_1.createAction)({
|
|
|
26
38
|
},
|
|
27
39
|
required: true
|
|
28
40
|
}),
|
|
29
|
-
status:
|
|
41
|
+
status: pieces_framework_1.Property.LongText({
|
|
30
42
|
displayName: 'Status',
|
|
31
43
|
description: 'The text of your status',
|
|
32
44
|
required: true,
|
|
@@ -38,11 +50,11 @@ exports.postStatus = (0, framework_1.createAction)({
|
|
|
38
50
|
const status = context.propsValue.status;
|
|
39
51
|
// Remove trailing slash from base_url
|
|
40
52
|
const baseUrl = context.propsValue.authentication.base_url.replace(/\/$/, "");
|
|
41
|
-
return yield
|
|
53
|
+
return yield pieces_common_1.httpClient.sendRequest({
|
|
42
54
|
url: `${baseUrl}/api/v1/statuses`,
|
|
43
|
-
method:
|
|
55
|
+
method: pieces_common_1.HttpMethod.POST,
|
|
44
56
|
authentication: {
|
|
45
|
-
type:
|
|
57
|
+
type: pieces_common_1.AuthenticationType.BEARER_TOKEN,
|
|
46
58
|
token,
|
|
47
59
|
},
|
|
48
60
|
body: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"post-status.js","sourceRoot":"","sources":["../../../../../../../packages/pieces/mastodon/src/lib/actions/post-status.ts"],"names":[],"mappings":";;;;AAAA,
|
|
1
|
+
{"version":3,"file":"post-status.js","sourceRoot":"","sources":["../../../../../../../packages/pieces/mastodon/src/lib/actions/post-status.ts"],"names":[],"mappings":";;;;AAAA,qEAAuE;AACvE,+DAAyF;AAGzF,MAAM,mBAAmB,GAAG;;;;;;;;;CAS3B,CAAC;AAEW,QAAA,UAAU,GAAG,IAAA,+BAAY,EAAC;IACnC,IAAI,EAAE,aAAa;IACnB,WAAW,EAAE,aAAa;IAC1B,WAAW,EAAE,2BAA2B;IACxC,UAAU,EAAE,EAAE;IACd,KAAK,EAAE;QACH,cAAc,EAAE,2BAAQ,CAAC,UAAU,CAAC;YAChC,WAAW,EAAE,gBAAgB;YAC7B,WAAW,EAAE,mBAAmB;YAChC,KAAK,EAAE;gBACH,QAAQ,EAAE,2BAAQ,CAAC,SAAS,CAAC;oBACzB,WAAW,EAAE,UAAU;oBACvB,WAAW,EAAE,wCAAwC;oBACrD,YAAY,EAAE,0BAA0B;oBACxC,QAAQ,EAAE,IAAI;iBACjB,CAAC;gBACF,YAAY,EAAE,2BAAQ,CAAC,SAAS,CAAC;oBAC7B,WAAW,EAAE,cAAc;oBAC3B,WAAW,EAAE,yFAAyF;oBACtG,QAAQ,EAAE,IAAI;iBACjB,CAAC;aACL;YACD,QAAQ,EAAE,IAAI;SACjB,CAAC;QACF,MAAM,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YACtB,WAAW,EAAE,QAAQ;YACrB,WAAW,EAAE,yBAAyB;YACtC,QAAQ,EAAE,IAAI;SACjB,CAAC;KACL;IACK,GAAG,CAAC,OAAO;;YACb,MAAM,KAAK,GAAG,OAAO,CAAC,UAAU,CAAC,cAAc,CAAC,YAAY,CAAC;YAC7D,MAAM,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,MAAM,CAAC;YACzC,sCAAsC;YACtC,MAAM,OAAO,GAAG,OAAO,CAAC,UAAU,CAAC,cAAc,CAAC,QAAQ,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;YAC9E,OAAO,MAAM,0BAAU,CAAC,WAAW,CAAC;gBAChC,GAAG,EAAE,GAAG,OAAO,kBAAkB;gBACjC,MAAM,EAAE,0BAAU,CAAC,IAAI;gBACvB,cAAc,EAAE;oBACZ,IAAI,EAAE,kCAAkB,CAAC,YAAY;oBACrC,KAAK;iBACR;gBACD,IAAI,EAAE;oBACF,MAAM;iBACT;aACJ,CAAC,CAAA;QACN,CAAC;KAAA;CACJ,CAAC,CAAC"}
|