Skip to content

Commit d34e259

Browse files
authored
Merge branch 'master' into biz/dj-2678-make-environment-mandatory-in-connect-sdk
2 parents 186822e + b4caf02 commit d34e259

File tree

11 files changed

+100
-21
lines changed

11 files changed

+100
-21
lines changed

components/grain/grain.app.mjs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
export default {
2+
type: "app",
3+
app: "grain",
4+
propDefinitions: {},
5+
methods: {
6+
// this.$auth contains connected account data
7+
authKeys() {
8+
console.log(Object.keys(this.$auth));
9+
},
10+
},
11+
};

components/grain/package.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"name": "@pipedream/grain",
3+
"version": "0.0.1",
4+
"description": "Pipedream Grain Components",
5+
"main": "grain.app.mjs",
6+
"keywords": [
7+
"pipedream",
8+
"grain"
9+
],
10+
"homepage": "https://pipedream.com/apps/grain",
11+
"author": "Pipedream <[email protected]> (https://pipedream.com/)",
12+
"publishConfig": {
13+
"access": "public"
14+
}
15+
}

components/short/actions/create-a-link/create-a-link.mjs

Lines changed: 31 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,39 @@ import shortApp from "../../short.app.mjs";
22
import common from "../common/common.mjs";
33
import lodash from "lodash";
44

5+
const {
6+
props: { // eslint-disable-next-line no-unused-vars
7+
domain, ...props
8+
},
9+
} = common;
10+
511
export default {
612
key: "short-create-a-link",
7-
name: "Create a Short Link",
8-
description: "Create a Short Link. [See the docs](https://developers.short.io/reference/linkspost).",
9-
version: "0.0.1",
13+
name: "Create Link",
14+
description: "Create a Short Link. [See the documentation](https://developers.short.io/reference/linkspost).",
15+
version: "0.1.0",
1016
type: "action",
1117
props: {
1218
shortApp,
13-
...common.props,
19+
domainId: {
20+
propDefinition: [
21+
shortApp,
22+
"domainId",
23+
],
24+
},
25+
...props,
26+
folderId: {
27+
propDefinition: [
28+
shortApp,
29+
"folderId",
30+
({ domainId }) => ({
31+
domainId,
32+
}),
33+
],
34+
},
1435
},
1536
async run({ $ }) {
1637
const param = lodash.pick(this, [
17-
"domain",
1838
"originalURL",
1939
"path",
2040
"title",
@@ -32,8 +52,13 @@ export default {
3252
"utmContent",
3353
"cloaking",
3454
"redirectType",
55+
"folderId",
3556
]);
36-
const link = await this.shortApp.createLink($, param);
57+
const { hostname: domain } = await this.shortApp.getDomainInfo(this.domainId);
58+
const link = await this.shortApp.createLink($, {
59+
domain,
60+
...param,
61+
});
3762
$.export("$summary", `Successfully created the link: ${link.secureShortURL}`);
3863
return link;
3964
},

components/short/actions/delete-a-link/delete-a-link.mjs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ import shortApp from "../../short.app.mjs";
22

33
export default {
44
key: "short-delete-a-link",
5-
name: "Delete a Short Link",
6-
description: "Delete a Short Link. [See the docs](https://developers.short.io/reference/linksbylinkiddelete).",
7-
version: "0.0.1",
5+
name: "Delete Link",
6+
description: "Delete a Short Link. [See the documentation](https://developers.short.io/reference/linksbylinkiddelete).",
7+
version: "0.0.2",
88
type: "action",
99
props: {
1010
shortApp,

components/short/actions/domain-statistics/domain-statistics.mjs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ import lodash from "lodash";
33

44
export default {
55
key: "short-domain-statistics",
6-
name: "Domain Statistics.",
7-
description: "Returns detailed statistics for domain in given period. [See the docs](https://developers.short.io/reference/getdomaindomainid).",
8-
version: "0.0.1",
6+
name: "Get Domain Statistics",
7+
description: "Returns detailed statistics for a domain in given period. [See the documentation](https://developers.short.io/reference/getdomaindomainid).",
8+
version: "0.0.2",
99
type: "action",
1010
props: {
1111
shortApp,

components/short/actions/expire-a-link/expire-a-link.mjs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ import lodash from "lodash";
33

44
export default {
55
key: "short-expire-a-link",
6-
name: "Expire a Link.",
7-
description: "Expire a link by id. [See the docs](https://developers.short.io/reference/linksbylinkidpost).",
8-
version: "0.0.1",
6+
name: "Expire Link",
7+
description: "Expire a short link by id. [See the documentation](https://developers.short.io/reference/linksbylinkidpost).",
8+
version: "0.0.2",
99
type: "action",
1010
props: {
1111
shortApp,

components/short/actions/update-a-link/update-a-link.mjs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ import lodash from "lodash";
44

55
export default {
66
key: "short-update-a-link",
7-
name: "Update a Short Link.",
8-
description: "Update original url, title or path for existing URL by id. [See the docs](https://developers.short.io/reference/linksbylinkidpost).",
9-
version: "0.0.1",
7+
name: "Update Link",
8+
description: "Update original URL, title or path for existing URL by id. [See the documentation](https://developers.short.io/reference/linksbylinkidpost).",
9+
version: "0.0.2",
1010
type: "action",
1111
props: {
1212
shortApp,

components/short/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@pipedream/short",
3-
"version": "0.0.5",
3+
"version": "0.1.0",
44
"description": "Pipedream Short.io Components",
55
"main": "short.app.mjs",
66
"keywords": [

components/short/short.app.mjs

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,15 @@ export default {
2020
return this.listDomainsOpts(true);
2121
},
2222
},
23+
folderId: {
24+
type: "string",
25+
label: "Folder ID",
26+
description: "The folder to use.",
27+
optional: true,
28+
async options({ domainId }) {
29+
return this.listFolderOptions(domainId);
30+
},
31+
},
2332
originalURL: {
2433
type: "string",
2534
label: "Original URL",
@@ -325,5 +334,21 @@ export default {
325334
}));
326335
return response;
327336
},
337+
async getDomainInfo(domainId) {
338+
return axios(this, this._getRequestParams({
339+
path: `/domains/${domainId}`,
340+
}));
341+
},
342+
async listFolderOptions(domainId) {
343+
const response = await axios(this, this._getRequestParams({
344+
path: `/links/folders/${domainId}`,
345+
}));
346+
return response.linkFolders?.map(({
347+
id, name,
348+
}) => ({
349+
label: name,
350+
value: id,
351+
}));
352+
},
328353
},
329354
};

components/short/sources/new-link-created/new-link-created.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ import { DEFAULT_POLLING_SOURCE_TIMER_INTERVAL } from "@pipedream/platform";
33

44
export default {
55
key: "short-new-link-created",
6-
name: "New event for each link created.",
6+
name: "New Link Created",
77
description: "Emit new event when a link is created.",
8-
version: "0.0.3",
8+
version: "0.0.4",
99
type: "source",
1010
dedupe: "unique",
1111
props: {

0 commit comments

Comments
 (0)