Skip to content

Commit 97853a1

Browse files
authored
[Components] Pipedream - new components (#18909)
1 parent 3188770 commit 97853a1

File tree

12 files changed

+373
-36
lines changed

12 files changed

+373
-36
lines changed

components/pipedream/actions/create-subscription/create-subscription.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export default {
44
key: "pipedream-create-subscription",
55
name: "Create a Subscription",
66
description: "Create a Subscription. [See Doc](https://pipedream.com/docs/api/rest/#subscriptions)",
7-
version: "0.1.1",
7+
version: "0.1.2",
88
annotations: {
99
destructiveHint: false,
1010
openWorldHint: true,

components/pipedream/actions/delete-subscription/delete-subscription.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export default {
44
key: "pipedream-delete-subscription",
55
name: "Delete a Subscription",
66
description: "Delete a Subscription. [See Doc](https://pipedream.com/docs/api/rest/#delete-a-subscription)",
7-
version: "0.1.1",
7+
version: "0.1.2",
88
annotations: {
99
destructiveHint: true,
1010
openWorldHint: true,

components/pipedream/actions/generate-component-code/generate-component-code.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export default {
55
key: "pipedream-generate-component-code",
66
name: "Generate Component Code",
77
description: "Generate component code using AI.",
8-
version: "0.0.2",
8+
version: "0.0.3",
99
annotations: {
1010
destructiveHint: false,
1111
openWorldHint: true,
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
import app from "../../pipedream.app.mjs";
2+
3+
export default {
4+
key: "pipedream-get-app",
5+
name: "Get App",
6+
description: "Get details for a specific Pipedream app. [See the documentation](https://pipedream.com/docs/rest-api/api-reference/apps/get-an-app)",
7+
version: "0.0.1",
8+
annotations: {
9+
destructiveHint: false,
10+
openWorldHint: true,
11+
readOnlyHint: true,
12+
idempotentHint: true,
13+
},
14+
type: "action",
15+
props: {
16+
app,
17+
appId: {
18+
propDefinition: [
19+
app,
20+
"appId",
21+
],
22+
},
23+
},
24+
async run({ $ }) {
25+
const {
26+
app,
27+
appId,
28+
} = this;
29+
30+
const response = await app.getApp({
31+
$,
32+
appId,
33+
});
34+
35+
$.export("$summary", `Successfully retrieved app with ID \`${response.data.id}\``);
36+
return response;
37+
},
38+
};
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
import app from "../../pipedream.app.mjs";
2+
3+
export default {
4+
key: "pipedream-get-component-from-global-registry",
5+
name: "Get Component From Global Registry",
6+
description: "Get details for a component from the Pipedream global registry. [See the documentation](https://pipedream.com/docs/rest-api/api-reference/components/get-a-component-from-the-global-registry)",
7+
version: "0.0.1",
8+
annotations: {
9+
destructiveHint: false,
10+
openWorldHint: true,
11+
readOnlyHint: true,
12+
idempotentHint: true,
13+
},
14+
type: "action",
15+
props: {
16+
app,
17+
key: {
18+
propDefinition: [
19+
app,
20+
"componentKey",
21+
],
22+
},
23+
},
24+
async run({ $ }) {
25+
const {
26+
app,
27+
key,
28+
} = this;
29+
30+
const response = await app.getComponentFromRegistry({
31+
$,
32+
key,
33+
});
34+
35+
if (response.data) {
36+
$.export("$summary", `Successfully fetched component with key \`${key}\``);
37+
} else {
38+
$.export("$summary", `Component \`${key}\` was not found`);
39+
}
40+
41+
return response;
42+
},
43+
};

components/pipedream/actions/get-component/get-component.mjs

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export default {
44
key: "pipedream-get-component",
55
name: "Get Component",
66
description: "Get info for a published component. [See docs](https://pipedream.com/docs/api/rest/#get-a-component)",
7-
version: "0.1.1",
7+
version: "0.1.2",
88
annotations: {
99
destructiveHint: false,
1010
openWorldHint: true,
@@ -28,13 +28,24 @@ export default {
2828
},
2929
},
3030
async run({ $ }) {
31-
const { data } = await this.pipedream.getComponent(this.componentKey, this.globalRegistry);
31+
const {
32+
pipedream,
33+
componentKey,
34+
globalRegistry,
35+
} = this;
3236

33-
if (data) {
34-
$.export("$summary", `Succesfully fetched ${this.componentKey}`);
35-
return data;
37+
const response = await pipedream.getComponent({
38+
$,
39+
key: componentKey,
40+
globalRegistry,
41+
});
42+
43+
if (response.data) {
44+
$.export("$summary", `Successfully fetched component with key \`${componentKey}\``);
45+
return response;
3646
}
3747

38-
console.log(`${this.componentKey} was not found`);
48+
$.export("$summary", `Component \`${componentKey}\` was not found`);
49+
return response;
3950
},
4051
};
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
import app from "../../pipedream.app.mjs";
2+
3+
export default {
4+
key: "pipedream-list-apps",
5+
name: "List Apps",
6+
description: "List all available Pipedream apps. [See the documentation](https://pipedream.com/docs/rest-api/api-reference/apps/list-apps)",
7+
version: "0.0.1",
8+
annotations: {
9+
destructiveHint: false,
10+
openWorldHint: true,
11+
readOnlyHint: true,
12+
idempotentHint: true,
13+
},
14+
type: "action",
15+
props: {
16+
app,
17+
q: {
18+
propDefinition: [
19+
app,
20+
"q",
21+
],
22+
},
23+
hasComponents: {
24+
propDefinition: [
25+
app,
26+
"hasComponents",
27+
],
28+
},
29+
hasActions: {
30+
propDefinition: [
31+
app,
32+
"hasActions",
33+
],
34+
},
35+
hasTriggers: {
36+
propDefinition: [
37+
app,
38+
"hasTriggers",
39+
],
40+
},
41+
},
42+
methods: {
43+
toNumber(value) {
44+
return value === "1" || value === 1 || value === "true" || value === true
45+
? "1"
46+
: value;
47+
},
48+
},
49+
async run({ $ }) {
50+
const {
51+
app,
52+
toNumber,
53+
q,
54+
hasComponents,
55+
hasActions,
56+
hasTriggers,
57+
} = this;
58+
59+
const response = await app.listApps({
60+
$,
61+
params: {
62+
q,
63+
has_components: toNumber(hasComponents),
64+
has_actions: toNumber(hasActions),
65+
has_triggers: toNumber(hasTriggers),
66+
},
67+
});
68+
69+
$.export("$summary", `Successfully retrieved ${response.page_info.count} app(s)`);
70+
return response;
71+
},
72+
};
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
import app from "../../pipedream.app.mjs";
2+
3+
export default {
4+
key: "pipedream-search-for-registry-components",
5+
name: "Search For Registry Components",
6+
description: "Search for components in the Pipedream global registry using a query string. [See the documentation](https://pipedream.com/docs/rest-api/api-reference/components/search-for-registry-components)",
7+
version: "0.0.1",
8+
annotations: {
9+
destructiveHint: false,
10+
openWorldHint: true,
11+
readOnlyHint: true,
12+
idempotentHint: true,
13+
},
14+
type: "action",
15+
props: {
16+
app,
17+
query: {
18+
propDefinition: [
19+
app,
20+
"query",
21+
],
22+
},
23+
appSlug: {
24+
label: "App Slug",
25+
description: "The slug of the app to search for components in",
26+
optional: true,
27+
propDefinition: [
28+
app,
29+
"appId",
30+
() => ({
31+
mapper: ({
32+
name_slug: value,
33+
name: label,
34+
}) => ({
35+
value,
36+
label,
37+
}),
38+
}),
39+
],
40+
},
41+
similarityThreshold: {
42+
propDefinition: [
43+
app,
44+
"similarityThreshold",
45+
],
46+
},
47+
debug: {
48+
propDefinition: [
49+
app,
50+
"debug",
51+
],
52+
},
53+
},
54+
async run({ $ }) {
55+
const {
56+
app,
57+
query,
58+
appSlug,
59+
similarityThreshold,
60+
debug,
61+
} = this;
62+
63+
const response = await app.searchComponents({
64+
$,
65+
params: {
66+
query,
67+
app: appSlug,
68+
similarity_threshold: similarityThreshold,
69+
debug,
70+
},
71+
});
72+
73+
$.export("$summary", "Successfully searched the global registry for components.");
74+
return response;
75+
},
76+
};

components/pipedream/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@pipedream/pipedream",
3-
"version": "0.4.2",
3+
"version": "0.5.0",
44
"description": "Pipedream Pipedream Components",
55
"main": "pipedream.app.mjs",
66
"keywords": [
@@ -10,7 +10,7 @@
1010
"homepage": "https://pipedream.com/apps/pipedream",
1111
"author": "Pipedream <support@pipedream.com> (https://pipedream.com/)",
1212
"dependencies": {
13-
"@pipedream/platform": "^1.4.1",
13+
"@pipedream/platform": "^3.1.0",
1414
"uuidv4": "^6.2.13"
1515
},
1616
"gitHead": "e12480b94cc03bed4808ebc6b13e7fdb3a1ba535",

0 commit comments

Comments
 (0)