Skip to content

Commit 440199e

Browse files
committed
Merge branch 'master' into 17279-sage-new-components
2 parents 03755eb + 7f91bab commit 440199e

File tree

271 files changed

+11657
-1215
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

271 files changed

+11657
-1215
lines changed

.tool-versions

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
nodejs 18.18.0
1+
nodejs 20.13.1
22
pnpm 9.14.2
33
python 3.11.5
44
poetry 1.6.1
Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
1-
import { defineApp } from "@pipedream/types";
2-
3-
export default defineApp({
1+
export default {
42
type: "app",
5-
app: "freshsales",
3+
app: "accuweather",
64
propDefinitions: {},
75
methods: {
86
// this.$auth contains connected account data
97
authKeys() {
108
console.log(Object.keys(this.$auth));
119
},
1210
},
13-
});
11+
};
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"name": "@pipedream/accuweather",
3+
"version": "0.0.1",
4+
"description": "Pipedream AccuWeather Components",
5+
"main": "accuweather.app.mjs",
6+
"keywords": [
7+
"pipedream",
8+
"accuweather"
9+
],
10+
"homepage": "https://pipedream.com/apps/accuweather",
11+
"author": "Pipedream <[email protected]> (https://pipedream.com/)",
12+
"publishConfig": {
13+
"access": "public"
14+
}
15+
}
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: "alt_text_generator_ai",
4+
propDefinitions: {},
5+
methods: {
6+
// this.$auth contains connected account data
7+
authKeys() {
8+
console.log(Object.keys(this.$auth));
9+
},
10+
},
11+
};
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"name": "@pipedream/alt_text_generator_ai",
3+
"version": "0.0.1",
4+
"description": "Pipedream Alt Text Generator AI Components",
5+
"main": "alt_text_generator_ai.app.mjs",
6+
"keywords": [
7+
"pipedream",
8+
"alt_text_generator_ai"
9+
],
10+
"homepage": "https://pipedream.com/apps/alt_text_generator_ai",
11+
"author": "Pipedream <[email protected]> (https://pipedream.com/)",
12+
"publishConfig": {
13+
"access": "public"
14+
}
15+
}
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
import buysellads from "../../buysellads.app.mjs";
2+
3+
export default {
4+
key: "buysellads-get-creatives-daily-stats",
5+
name: "Get Creatives Daily Stats",
6+
description: "Returns the creative stats by day for line items. [See the documentation](https://docs.buysellads.com/advertiser-api/endpoints#creatives-daily-stats)",
7+
version: "0.0.1",
8+
type: "action",
9+
props: {
10+
buysellads,
11+
lineItemId: {
12+
propDefinition: [
13+
buysellads,
14+
"lineItemId",
15+
],
16+
},
17+
startDate: {
18+
propDefinition: [
19+
buysellads,
20+
"startDate",
21+
],
22+
},
23+
endDate: {
24+
propDefinition: [
25+
buysellads,
26+
"endDate",
27+
],
28+
},
29+
csvOutput: {
30+
propDefinition: [
31+
buysellads,
32+
"csvOutput",
33+
],
34+
},
35+
},
36+
async run({ $ }) {
37+
const response = await this.buysellads.listCreativesDailyStats({
38+
$,
39+
params: {
40+
lineitemId: this.lineItemId,
41+
startDate: this.startDate,
42+
endDate: this.endDate,
43+
type: this.csvOutput
44+
? "csv"
45+
: undefined,
46+
},
47+
});
48+
49+
const length = this.csvOutput
50+
? response.split("\n").length - 1
51+
: response.length;
52+
53+
$.export("$summary", `Successfully fetched ${length} creative stat${length === 1
54+
? ""
55+
: "s"}`);
56+
return response;
57+
},
58+
};
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
import buysellads from "../../buysellads.app.mjs";
2+
3+
export default {
4+
key: "buysellads-get-creatives",
5+
name: "Get Creatives",
6+
description: "Returns the creative stats for line items. [See the documentation](https://docs.buysellads.com/advertiser-api/endpoints#creatives)",
7+
version: "0.0.1",
8+
type: "action",
9+
props: {
10+
buysellads,
11+
lineItemId: {
12+
propDefinition: [
13+
buysellads,
14+
"lineItemId",
15+
],
16+
},
17+
startDate: {
18+
propDefinition: [
19+
buysellads,
20+
"startDate",
21+
],
22+
},
23+
endDate: {
24+
propDefinition: [
25+
buysellads,
26+
"endDate",
27+
],
28+
},
29+
csvOutput: {
30+
propDefinition: [
31+
buysellads,
32+
"csvOutput",
33+
],
34+
},
35+
},
36+
async run({ $ }) {
37+
const response = await this.buysellads.listCreatives({
38+
$,
39+
params: {
40+
lineitemId: this.lineItemId,
41+
startDate: this.startDate,
42+
endDate: this.endDate,
43+
type: this.csvOutput
44+
? "csv"
45+
: undefined,
46+
},
47+
});
48+
49+
const length = this.csvOutput
50+
? response.split("\n").length - 1
51+
: response.length;
52+
53+
$.export("$summary", `Successfully fetched ${length} creative${length === 1
54+
? ""
55+
: "s"}`);
56+
return response;
57+
},
58+
};
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
import buysellads from "../../buysellads.app.mjs";
2+
3+
export default {
4+
key: "buysellads-get-daily-stats",
5+
name: "Get Daily Stats",
6+
description: "Returns the daily stats for active line items. [See the documentation](https://docs.buysellads.com/advertiser-api/endpoints#daily-stats)",
7+
version: "0.0.1",
8+
type: "action",
9+
props: {
10+
buysellads,
11+
lineItemId: {
12+
propDefinition: [
13+
buysellads,
14+
"lineItemId",
15+
],
16+
},
17+
startDate: {
18+
propDefinition: [
19+
buysellads,
20+
"startDate",
21+
],
22+
},
23+
endDate: {
24+
propDefinition: [
25+
buysellads,
26+
"endDate",
27+
],
28+
},
29+
csvOutput: {
30+
propDefinition: [
31+
buysellads,
32+
"csvOutput",
33+
],
34+
},
35+
},
36+
async run({ $ }) {
37+
const response = await this.buysellads.listDailyStats({
38+
$,
39+
params: {
40+
lineitemId: this.lineItemId,
41+
startDate: this.startDate,
42+
endDate: this.endDate,
43+
type: this.csvOutput
44+
? "csv"
45+
: undefined,
46+
},
47+
});
48+
49+
const length = this.csvOutput
50+
? response.split("\n").length - 1
51+
: response.length;
52+
53+
$.export("$summary", `Successfully fetched ${length} daily stat${length === 1
54+
? ""
55+
: "s"}`);
56+
return response;
57+
},
58+
};
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
import buysellads from "../../buysellads.app.mjs";
2+
3+
export default {
4+
key: "buysellads-get-line-items",
5+
name: "Get Line Items",
6+
description: "Returns the details of active line items. [See the documentation](https://docs.buysellads.com/advertiser-api/endpoints#lineitems)",
7+
version: "0.0.1",
8+
type: "action",
9+
props: {
10+
buysellads,
11+
startDate: {
12+
propDefinition: [
13+
buysellads,
14+
"startDate",
15+
],
16+
},
17+
endDate: {
18+
propDefinition: [
19+
buysellads,
20+
"endDate",
21+
],
22+
},
23+
csvOutput: {
24+
propDefinition: [
25+
buysellads,
26+
"csvOutput",
27+
],
28+
},
29+
},
30+
async run({ $ }) {
31+
const response = await this.buysellads.listLineItems({
32+
$,
33+
params: {
34+
startDate: this.startDate,
35+
endDate: this.endDate,
36+
type: this.csvOutput
37+
? "csv"
38+
: undefined,
39+
},
40+
});
41+
42+
const length = this.csvOutput
43+
? response.split("\n").length - 1
44+
: response.length;
45+
46+
$.export("$summary", `Successfully fetched ${length} line item${length === 1
47+
? ""
48+
: "s"}`);
49+
return response;
50+
},
51+
};
Lines changed: 73 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,80 @@
1+
import { axios } from "@pipedream/platform";
2+
13
export default {
24
type: "app",
35
app: "buysellads",
4-
propDefinitions: {},
6+
propDefinitions: {
7+
lineItemId: {
8+
type: "string",
9+
label: "Line Item ID",
10+
description: "The ID of a line item",
11+
optional: true,
12+
async options() {
13+
const lineitems = await this.listLineItems();
14+
return lineitems?.map((lineitem) => ({
15+
label: lineitem.lineitem_name,
16+
value: lineitem.lineitem_id,
17+
})) || [];
18+
},
19+
},
20+
startDate: {
21+
type: "string",
22+
label: "Start Date",
23+
description: "The start date in `yyyy-mm-dd` format",
24+
optional: true,
25+
},
26+
endDate: {
27+
type: "string",
28+
label: "End Date",
29+
description: "The end date in `yyyy-mm-dd` format",
30+
optional: true,
31+
},
32+
csvOutput: {
33+
type: "boolean",
34+
label: "CSV Output",
35+
description: "Whether to return the response as CSV output",
36+
optional: true,
37+
},
38+
},
539
methods: {
6-
// this.$auth contains connected account data
7-
authKeys() {
8-
console.log(Object.keys(this.$auth));
40+
_baseUrl() {
41+
return "https://papi.buysellads.com";
42+
},
43+
_makeRequest({
44+
$ = this, path, params = {}, ...opts
45+
}) {
46+
return axios($, {
47+
url: `${this._baseUrl()}${path}`,
48+
params: {
49+
...params,
50+
key: this.$auth.api_key,
51+
},
52+
...opts,
53+
});
54+
},
55+
listLineItems(opts = {}) {
56+
return this._makeRequest({
57+
path: "/lineitems",
58+
...opts,
59+
});
60+
},
61+
listDailyStats(opts = {}) {
62+
return this._makeRequest({
63+
path: "/daily-stats",
64+
...opts,
65+
});
66+
},
67+
listCreatives(opts = {}) {
68+
return this._makeRequest({
69+
path: "/creatives",
70+
...opts,
71+
});
72+
},
73+
listCreativesDailyStats(opts = {}) {
74+
return this._makeRequest({
75+
path: "/creatives-daily-stats",
76+
...opts,
77+
});
978
},
1079
},
1180
};

0 commit comments

Comments
 (0)