@framers/agentos-ext-channel-pinterest 0.1.0
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/LICENSE +98 -0
- package/dist/PinterestChannelAdapter.d.ts +32 -0
- package/dist/PinterestChannelAdapter.d.ts.map +1 -0
- package/dist/PinterestChannelAdapter.js +123 -0
- package/dist/PinterestChannelAdapter.js.map +1 -0
- package/dist/PinterestService.d.ts +111 -0
- package/dist/PinterestService.d.ts.map +1 -0
- package/dist/PinterestService.js +251 -0
- package/dist/PinterestService.js.map +1 -0
- package/dist/index.d.ts +30 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +91 -0
- package/dist/index.js.map +1 -0
- package/dist/tools/analytics.d.ts +46 -0
- package/dist/tools/analytics.d.ts.map +1 -0
- package/dist/tools/analytics.js +50 -0
- package/dist/tools/analytics.js.map +1 -0
- package/dist/tools/board.d.ts +57 -0
- package/dist/tools/board.d.ts.map +1 -0
- package/dist/tools/board.js +76 -0
- package/dist/tools/board.js.map +1 -0
- package/dist/tools/pin.d.ts +82 -0
- package/dist/tools/pin.d.ts.map +1 -0
- package/dist/tools/pin.js +78 -0
- package/dist/tools/pin.js.map +1 -0
- package/dist/tools/schedule.d.ts +68 -0
- package/dist/tools/schedule.d.ts.map +1 -0
- package/dist/tools/schedule.js +74 -0
- package/dist/tools/schedule.js.map +1 -0
- package/dist/tools/search.d.ts +41 -0
- package/dist/tools/search.d.ts.map +1 -0
- package/dist/tools/search.js +49 -0
- package/dist/tools/search.js.map +1 -0
- package/dist/tools/trending.d.ts +35 -0
- package/dist/tools/trending.d.ts.map +1 -0
- package/dist/tools/trending.js +38 -0
- package/dist/tools/trending.js.map +1 -0
- package/manifest.json +30 -0
- package/package.json +38 -0
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// @ts-nocheck
|
|
3
|
+
/**
|
|
4
|
+
* @fileoverview ITool for scheduling pins on Pinterest.
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.PinterestScheduleTool = void 0;
|
|
8
|
+
class PinterestScheduleTool {
|
|
9
|
+
constructor(service) {
|
|
10
|
+
this.service = service;
|
|
11
|
+
this.id = 'pinterestSchedule';
|
|
12
|
+
this.name = 'pinterestSchedule';
|
|
13
|
+
this.displayName = 'Schedule Pin';
|
|
14
|
+
this.description = 'Schedule a pin for future publishing on Pinterest.';
|
|
15
|
+
this.category = 'social';
|
|
16
|
+
this.version = '0.1.0';
|
|
17
|
+
this.hasSideEffects = true;
|
|
18
|
+
this.inputSchema = {
|
|
19
|
+
type: 'object',
|
|
20
|
+
required: ['boardId', 'mediaUrl', 'publishAt'],
|
|
21
|
+
properties: {
|
|
22
|
+
boardId: { type: 'string', description: 'Board ID to pin to' },
|
|
23
|
+
title: { type: 'string', description: 'Pin title' },
|
|
24
|
+
description: { type: 'string', description: 'Pin description' },
|
|
25
|
+
link: { type: 'string', description: 'Destination URL' },
|
|
26
|
+
mediaUrl: { type: 'string', description: 'Image URL for the pin' },
|
|
27
|
+
altText: { type: 'string', description: 'Alt text for accessibility' },
|
|
28
|
+
hashtags: {
|
|
29
|
+
type: 'array',
|
|
30
|
+
items: { type: 'string' },
|
|
31
|
+
description: 'Hashtags to append to description',
|
|
32
|
+
},
|
|
33
|
+
publishAt: { type: 'string', description: 'ISO 8601 datetime for scheduled publish time' },
|
|
34
|
+
},
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
async execute(args, _context) {
|
|
38
|
+
try {
|
|
39
|
+
const publishDate = new Date(args.publishAt);
|
|
40
|
+
if (isNaN(publishDate.getTime())) {
|
|
41
|
+
throw new Error('Invalid publishAt date — provide a valid ISO 8601 datetime');
|
|
42
|
+
}
|
|
43
|
+
if (publishDate.getTime() <= Date.now()) {
|
|
44
|
+
throw new Error('publishAt must be in the future');
|
|
45
|
+
}
|
|
46
|
+
// Pinterest API v5 does not have a native schedule endpoint publicly,
|
|
47
|
+
// so we create the pin immediately and note the scheduled intent.
|
|
48
|
+
// Production implementations would integrate with a job scheduler.
|
|
49
|
+
const result = await this.service.createPin({
|
|
50
|
+
boardId: args.boardId,
|
|
51
|
+
title: args.title,
|
|
52
|
+
description: args.description,
|
|
53
|
+
link: args.link,
|
|
54
|
+
mediaSource: { sourceType: 'image_url', url: args.mediaUrl },
|
|
55
|
+
altText: args.altText,
|
|
56
|
+
hashtags: args.hashtags,
|
|
57
|
+
});
|
|
58
|
+
return {
|
|
59
|
+
success: true,
|
|
60
|
+
data: {
|
|
61
|
+
...result,
|
|
62
|
+
scheduled: true,
|
|
63
|
+
publishAt: args.publishAt,
|
|
64
|
+
note: 'Pin created. For true deferred publishing, integrate with a job scheduler to delay the API call.',
|
|
65
|
+
},
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
catch (error) {
|
|
69
|
+
return { success: false, error: error.message };
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
exports.PinterestScheduleTool = PinterestScheduleTool;
|
|
74
|
+
//# sourceMappingURL=schedule.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schedule.js","sourceRoot":"","sources":["../../src/tools/schedule.ts"],"names":[],"mappings":";AAAA,cAAc;AACd;;GAEG;;;AAKH,MAAa,qBAAqB;IA4BhC,YAA6B,OAAyB;QAAzB,YAAO,GAAP,OAAO,CAAkB;QA3BtC,OAAE,GAAG,mBAAmB,CAAC;QACzB,SAAI,GAAG,mBAAmB,CAAC;QAC3B,gBAAW,GAAG,cAAc,CAAC;QAC7B,gBAAW,GAAG,oDAAoD,CAAC;QACnE,aAAQ,GAAG,QAAQ,CAAC;QACpB,YAAO,GAAG,OAAO,CAAC;QAClB,mBAAc,GAAG,IAAI,CAAC;QAEtB,gBAAW,GAAG;YAC5B,IAAI,EAAE,QAAiB;YACvB,QAAQ,EAAE,CAAC,SAAS,EAAE,UAAU,EAAE,WAAW,CAAU;YACvD,UAAU,EAAE;gBACV,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,oBAAoB,EAAE;gBAC9D,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,WAAW,EAAE;gBACnD,WAAW,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,iBAAiB,EAAE;gBAC/D,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,iBAAiB,EAAE;gBACxD,QAAQ,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,uBAAuB,EAAE;gBAClE,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,4BAA4B,EAAE;gBACtE,QAAQ,EAAE;oBACR,IAAI,EAAE,OAAO;oBACb,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;oBACzB,WAAW,EAAE,mCAAmC;iBACjD;gBACD,SAAS,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,8CAA8C,EAAE;aAC3F;SACF,CAAC;IAEuD,CAAC;IAE1D,KAAK,CAAC,OAAO,CACX,IASC,EACD,QAA8B;QAE9B,IAAI,CAAC;YACH,MAAM,WAAW,GAAG,IAAI,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;YAC7C,IAAI,KAAK,CAAC,WAAW,CAAC,OAAO,EAAE,CAAC,EAAE,CAAC;gBACjC,MAAM,IAAI,KAAK,CAAC,4DAA4D,CAAC,CAAC;YAChF,CAAC;YACD,IAAI,WAAW,CAAC,OAAO,EAAE,IAAI,IAAI,CAAC,GAAG,EAAE,EAAE,CAAC;gBACxC,MAAM,IAAI,KAAK,CAAC,iCAAiC,CAAC,CAAC;YACrD,CAAC;YAED,sEAAsE;YACtE,kEAAkE;YAClE,mEAAmE;YACnE,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC;gBAC1C,OAAO,EAAE,IAAI,CAAC,OAAO;gBACrB,KAAK,EAAE,IAAI,CAAC,KAAK;gBACjB,WAAW,EAAE,IAAI,CAAC,WAAW;gBAC7B,IAAI,EAAE,IAAI,CAAC,IAAI;gBACf,WAAW,EAAE,EAAE,UAAU,EAAE,WAAW,EAAE,GAAG,EAAE,IAAI,CAAC,QAAQ,EAAE;gBAC5D,OAAO,EAAE,IAAI,CAAC,OAAO;gBACrB,QAAQ,EAAE,IAAI,CAAC,QAAQ;aACxB,CAAC,CAAC;YAEH,OAAO;gBACL,OAAO,EAAE,IAAI;gBACb,IAAI,EAAE;oBACJ,GAAG,MAAM;oBACT,SAAS,EAAE,IAAI;oBACf,SAAS,EAAE,IAAI,CAAC,SAAS;oBACzB,IAAI,EAAE,kGAAkG;iBACzG;aACF,CAAC;QACJ,CAAC;QAAC,OAAO,KAAU,EAAE,CAAC;YACpB,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,OAAO,EAAE,CAAC;QAClD,CAAC;IACH,CAAC;CACF;AA9ED,sDA8EC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview ITool for searching pins and boards on Pinterest.
|
|
3
|
+
*/
|
|
4
|
+
import type { ITool, ToolExecutionContext, ToolExecutionResult } from '@framers/agentos';
|
|
5
|
+
import type { PinterestService } from '../PinterestService';
|
|
6
|
+
export declare class PinterestSearchTool implements ITool {
|
|
7
|
+
private readonly service;
|
|
8
|
+
readonly id = "pinterestSearch";
|
|
9
|
+
readonly name = "pinterestSearch";
|
|
10
|
+
readonly displayName = "Search Pinterest";
|
|
11
|
+
readonly description = "Search for pins or boards on Pinterest by keyword.";
|
|
12
|
+
readonly category = "social";
|
|
13
|
+
readonly version = "0.1.0";
|
|
14
|
+
readonly hasSideEffects = false;
|
|
15
|
+
readonly inputSchema: {
|
|
16
|
+
type: "object";
|
|
17
|
+
required: readonly ["query"];
|
|
18
|
+
properties: {
|
|
19
|
+
query: {
|
|
20
|
+
type: string;
|
|
21
|
+
description: string;
|
|
22
|
+
};
|
|
23
|
+
type: {
|
|
24
|
+
type: string;
|
|
25
|
+
enum: string[];
|
|
26
|
+
description: string;
|
|
27
|
+
};
|
|
28
|
+
maxResults: {
|
|
29
|
+
type: string;
|
|
30
|
+
description: string;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
constructor(service: PinterestService);
|
|
35
|
+
execute(args: {
|
|
36
|
+
query: string;
|
|
37
|
+
type?: 'pins' | 'boards';
|
|
38
|
+
maxResults?: number;
|
|
39
|
+
}, _context: ToolExecutionContext): Promise<ToolExecutionResult>;
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=search.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../../src/tools/search.ts"],"names":[],"mappings":"AACA;;GAEG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACzF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAE5D,qBAAa,mBAAoB,YAAW,KAAK;IAuBnC,OAAO,CAAC,QAAQ,CAAC,OAAO;IAtBpC,SAAgB,EAAE,qBAAqB;IACvC,SAAgB,IAAI,qBAAqB;IACzC,SAAgB,WAAW,sBAAsB;IACjD,SAAgB,WAAW,wDAAwD;IACnF,SAAgB,QAAQ,YAAY;IACpC,SAAgB,OAAO,WAAW;IAClC,SAAgB,cAAc,SAAS;IAEvC,SAAgB,WAAW;;;;;;;;;;;;;;;;;;MAYzB;gBAE2B,OAAO,EAAE,gBAAgB;IAEhD,OAAO,CACX,IAAI,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,GAAG,QAAQ,CAAC;QAAC,UAAU,CAAC,EAAE,MAAM,CAAA;KAAE,EACtE,QAAQ,EAAE,oBAAoB,GAC7B,OAAO,CAAC,mBAAmB,CAAC;CAgBhC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// @ts-nocheck
|
|
3
|
+
/**
|
|
4
|
+
* @fileoverview ITool for searching pins and boards on Pinterest.
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.PinterestSearchTool = void 0;
|
|
8
|
+
class PinterestSearchTool {
|
|
9
|
+
constructor(service) {
|
|
10
|
+
this.service = service;
|
|
11
|
+
this.id = 'pinterestSearch';
|
|
12
|
+
this.name = 'pinterestSearch';
|
|
13
|
+
this.displayName = 'Search Pinterest';
|
|
14
|
+
this.description = 'Search for pins or boards on Pinterest by keyword.';
|
|
15
|
+
this.category = 'social';
|
|
16
|
+
this.version = '0.1.0';
|
|
17
|
+
this.hasSideEffects = false;
|
|
18
|
+
this.inputSchema = {
|
|
19
|
+
type: 'object',
|
|
20
|
+
required: ['query'],
|
|
21
|
+
properties: {
|
|
22
|
+
query: { type: 'string', description: 'Search query' },
|
|
23
|
+
type: {
|
|
24
|
+
type: 'string',
|
|
25
|
+
enum: ['pins', 'boards'],
|
|
26
|
+
description: 'Search type: pins or boards (default: pins)',
|
|
27
|
+
},
|
|
28
|
+
maxResults: { type: 'number', description: 'Max results to return (default: 10, max: 100)' },
|
|
29
|
+
},
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
async execute(args, _context) {
|
|
33
|
+
try {
|
|
34
|
+
const searchType = args.type ?? 'pins';
|
|
35
|
+
const options = { query: args.query, maxResults: args.maxResults };
|
|
36
|
+
if (searchType === 'boards') {
|
|
37
|
+
const boards = await this.service.searchBoards(options);
|
|
38
|
+
return { success: true, data: { type: 'boards', results: boards, count: boards.length } };
|
|
39
|
+
}
|
|
40
|
+
const pins = await this.service.searchPins(options);
|
|
41
|
+
return { success: true, data: { type: 'pins', results: pins, count: pins.length } };
|
|
42
|
+
}
|
|
43
|
+
catch (error) {
|
|
44
|
+
return { success: false, error: error.message };
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
exports.PinterestSearchTool = PinterestSearchTool;
|
|
49
|
+
//# sourceMappingURL=search.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search.js","sourceRoot":"","sources":["../../src/tools/search.ts"],"names":[],"mappings":";AAAA,cAAc;AACd;;GAEG;;;AAKH,MAAa,mBAAmB;IAuB9B,YAA6B,OAAyB;QAAzB,YAAO,GAAP,OAAO,CAAkB;QAtBtC,OAAE,GAAG,iBAAiB,CAAC;QACvB,SAAI,GAAG,iBAAiB,CAAC;QACzB,gBAAW,GAAG,kBAAkB,CAAC;QACjC,gBAAW,GAAG,oDAAoD,CAAC;QACnE,aAAQ,GAAG,QAAQ,CAAC;QACpB,YAAO,GAAG,OAAO,CAAC;QAClB,mBAAc,GAAG,KAAK,CAAC;QAEvB,gBAAW,GAAG;YAC5B,IAAI,EAAE,QAAiB;YACvB,QAAQ,EAAE,CAAC,OAAO,CAAU;YAC5B,UAAU,EAAE;gBACV,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,cAAc,EAAE;gBACtD,IAAI,EAAE;oBACJ,IAAI,EAAE,QAAQ;oBACd,IAAI,EAAE,CAAC,MAAM,EAAE,QAAQ,CAAC;oBACxB,WAAW,EAAE,6CAA6C;iBAC3D;gBACD,UAAU,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,+CAA+C,EAAE;aAC7F;SACF,CAAC;IAEuD,CAAC;IAE1D,KAAK,CAAC,OAAO,CACX,IAAsE,EACtE,QAA8B;QAE9B,IAAI,CAAC;YACH,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,IAAI,MAAM,CAAC;YACvC,MAAM,OAAO,GAAG,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,UAAU,EAAE,IAAI,CAAC,UAAU,EAAE,CAAC;YAEnE,IAAI,UAAU,KAAK,QAAQ,EAAE,CAAC;gBAC5B,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;gBACxD,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,EAAE,CAAC;YAC5F,CAAC;YAED,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;YACpD,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,MAAM,EAAE,EAAE,CAAC;QACtF,CAAC;QAAC,OAAO,KAAU,EAAE,CAAC;YACpB,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,OAAO,EAAE,CAAC;QAClD,CAAC;IACH,CAAC;CACF;AA5CD,kDA4CC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview ITool for getting trending pins and topics on Pinterest.
|
|
3
|
+
*/
|
|
4
|
+
import type { ITool, ToolExecutionContext, ToolExecutionResult } from '@framers/agentos';
|
|
5
|
+
import type { PinterestService } from '../PinterestService';
|
|
6
|
+
export declare class PinterestTrendingTool implements ITool {
|
|
7
|
+
private readonly service;
|
|
8
|
+
readonly id = "pinterestTrending";
|
|
9
|
+
readonly name = "pinterestTrending";
|
|
10
|
+
readonly displayName = "Get Trending";
|
|
11
|
+
readonly description = "Get trending pins and topics on Pinterest by region.";
|
|
12
|
+
readonly category = "social";
|
|
13
|
+
readonly version = "0.1.0";
|
|
14
|
+
readonly hasSideEffects = false;
|
|
15
|
+
readonly inputSchema: {
|
|
16
|
+
type: "object";
|
|
17
|
+
required: readonly [];
|
|
18
|
+
properties: {
|
|
19
|
+
region: {
|
|
20
|
+
type: string;
|
|
21
|
+
description: string;
|
|
22
|
+
};
|
|
23
|
+
maxResults: {
|
|
24
|
+
type: string;
|
|
25
|
+
description: string;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
constructor(service: PinterestService);
|
|
30
|
+
execute(args: {
|
|
31
|
+
region?: string;
|
|
32
|
+
maxResults?: number;
|
|
33
|
+
}, _context: ToolExecutionContext): Promise<ToolExecutionResult>;
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=trending.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trending.d.ts","sourceRoot":"","sources":["../../src/tools/trending.ts"],"names":[],"mappings":"AACA;;GAEG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACzF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAE5D,qBAAa,qBAAsB,YAAW,KAAK;IAkBrC,OAAO,CAAC,QAAQ,CAAC,OAAO;IAjBpC,SAAgB,EAAE,uBAAuB;IACzC,SAAgB,IAAI,uBAAuB;IAC3C,SAAgB,WAAW,kBAAkB;IAC7C,SAAgB,WAAW,0DAA0D;IACrF,SAAgB,QAAQ,YAAY;IACpC,SAAgB,OAAO,WAAW;IAClC,SAAgB,cAAc,SAAS;IAEvC,SAAgB,WAAW;;;;;;;;;;;;;MAOzB;gBAE2B,OAAO,EAAE,gBAAgB;IAEhD,OAAO,CACX,IAAI,EAAE;QAAE,MAAM,CAAC,EAAE,MAAM,CAAC;QAAC,UAAU,CAAC,EAAE,MAAM,CAAA;KAAE,EAC9C,QAAQ,EAAE,oBAAoB,GAC7B,OAAO,CAAC,mBAAmB,CAAC;CAQhC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// @ts-nocheck
|
|
3
|
+
/**
|
|
4
|
+
* @fileoverview ITool for getting trending pins and topics on Pinterest.
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.PinterestTrendingTool = void 0;
|
|
8
|
+
class PinterestTrendingTool {
|
|
9
|
+
constructor(service) {
|
|
10
|
+
this.service = service;
|
|
11
|
+
this.id = 'pinterestTrending';
|
|
12
|
+
this.name = 'pinterestTrending';
|
|
13
|
+
this.displayName = 'Get Trending';
|
|
14
|
+
this.description = 'Get trending pins and topics on Pinterest by region.';
|
|
15
|
+
this.category = 'social';
|
|
16
|
+
this.version = '0.1.0';
|
|
17
|
+
this.hasSideEffects = false;
|
|
18
|
+
this.inputSchema = {
|
|
19
|
+
type: 'object',
|
|
20
|
+
required: [],
|
|
21
|
+
properties: {
|
|
22
|
+
region: { type: 'string', description: 'Region code, e.g. "US", "GB", "DE" (default: "US")' },
|
|
23
|
+
maxResults: { type: 'number', description: 'Max results to return (default: 20, max: 50)' },
|
|
24
|
+
},
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
async execute(args, _context) {
|
|
28
|
+
try {
|
|
29
|
+
const trends = await this.service.getTrending(args.region, args.maxResults);
|
|
30
|
+
return { success: true, data: { trends, count: trends.length, region: args.region ?? 'US' } };
|
|
31
|
+
}
|
|
32
|
+
catch (error) {
|
|
33
|
+
return { success: false, error: error.message };
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
exports.PinterestTrendingTool = PinterestTrendingTool;
|
|
38
|
+
//# sourceMappingURL=trending.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trending.js","sourceRoot":"","sources":["../../src/tools/trending.ts"],"names":[],"mappings":";AAAA,cAAc;AACd;;GAEG;;;AAKH,MAAa,qBAAqB;IAkBhC,YAA6B,OAAyB;QAAzB,YAAO,GAAP,OAAO,CAAkB;QAjBtC,OAAE,GAAG,mBAAmB,CAAC;QACzB,SAAI,GAAG,mBAAmB,CAAC;QAC3B,gBAAW,GAAG,cAAc,CAAC;QAC7B,gBAAW,GAAG,sDAAsD,CAAC;QACrE,aAAQ,GAAG,QAAQ,CAAC;QACpB,YAAO,GAAG,OAAO,CAAC;QAClB,mBAAc,GAAG,KAAK,CAAC;QAEvB,gBAAW,GAAG;YAC5B,IAAI,EAAE,QAAiB;YACvB,QAAQ,EAAE,EAAW;YACrB,UAAU,EAAE;gBACV,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,oDAAoD,EAAE;gBAC7F,UAAU,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,8CAA8C,EAAE;aAC5F;SACF,CAAC;IAEuD,CAAC;IAE1D,KAAK,CAAC,OAAO,CACX,IAA8C,EAC9C,QAA8B;QAE9B,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;YAC5E,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,IAAI,IAAI,EAAE,EAAE,CAAC;QAChG,CAAC;QAAC,OAAO,KAAU,EAAE,CAAC;YACpB,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,OAAO,EAAE,CAAC;QAClD,CAAC;IACH,CAAC;CACF;AA/BD,sDA+BC"}
|
package/manifest.json
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://agentos.sh/schemas/extension-manifest-v1.json",
|
|
3
|
+
"id": "com.framers.channels.pinterest",
|
|
4
|
+
"name": "Pinterest Channel Extension",
|
|
5
|
+
"version": "0.1.0",
|
|
6
|
+
"description": "Pinterest integration — create pins, manage boards, search content, discover trends, track analytics, and schedule posts via Pinterest API v5.",
|
|
7
|
+
"categories": ["channel", "social"],
|
|
8
|
+
"platforms": ["pinterest"],
|
|
9
|
+
"sdk": "axios",
|
|
10
|
+
"extensions": [
|
|
11
|
+
{ "kind": "tool", "id": "pinterestPin", "displayName": "Create Pin" },
|
|
12
|
+
{ "kind": "tool", "id": "pinterestBoard", "displayName": "Manage Board" },
|
|
13
|
+
{ "kind": "tool", "id": "pinterestSearch", "displayName": "Search Pinterest" },
|
|
14
|
+
{ "kind": "tool", "id": "pinterestTrending", "displayName": "Get Trending" },
|
|
15
|
+
{ "kind": "tool", "id": "pinterestAnalytics", "displayName": "Pin Analytics" },
|
|
16
|
+
{ "kind": "tool", "id": "pinterestSchedule", "displayName": "Schedule Pin" },
|
|
17
|
+
{ "kind": "messaging-channel", "id": "pinterestChannel", "displayName": "Pinterest Channel Adapter" }
|
|
18
|
+
],
|
|
19
|
+
"requiredSecrets": ["pinterest.accessToken"],
|
|
20
|
+
"features": [
|
|
21
|
+
"Create image, video, and idea pins",
|
|
22
|
+
"Create and manage boards and sections",
|
|
23
|
+
"Search pins and boards by keyword",
|
|
24
|
+
"Discover trending pins and topics",
|
|
25
|
+
"Track pin and board performance metrics",
|
|
26
|
+
"Schedule pins for future publishing",
|
|
27
|
+
"Carousel pin support",
|
|
28
|
+
"Hashtag management"
|
|
29
|
+
]
|
|
30
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@framers/agentos-ext-channel-pinterest",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Pinterest channel adapter for AgentOS — create pins, manage boards, search content, track analytics, and schedule posts via Pinterest API v5.",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"files": [
|
|
8
|
+
"dist",
|
|
9
|
+
"manifest.json"
|
|
10
|
+
],
|
|
11
|
+
"peerDependencies": {
|
|
12
|
+
"@framers/agentos": "^0.5.2"
|
|
13
|
+
},
|
|
14
|
+
"dependencies": {
|
|
15
|
+
"axios": "^1.6.0"
|
|
16
|
+
},
|
|
17
|
+
"devDependencies": {
|
|
18
|
+
"@framers/agentos": "^0.6.6",
|
|
19
|
+
"@types/node": "^20.0.0",
|
|
20
|
+
"typescript": "^5.0.0",
|
|
21
|
+
"vitest": "^1.0.0"
|
|
22
|
+
},
|
|
23
|
+
"engines": {
|
|
24
|
+
"node": ">=18.0.0"
|
|
25
|
+
},
|
|
26
|
+
"repository": {
|
|
27
|
+
"type": "git",
|
|
28
|
+
"url": "https://github.com/framersai/agentos-extensions",
|
|
29
|
+
"directory": "registry/curated/channels/pinterest"
|
|
30
|
+
},
|
|
31
|
+
"scripts": {
|
|
32
|
+
"build": "tsc",
|
|
33
|
+
"dev": "tsc --watch",
|
|
34
|
+
"test": "vitest run",
|
|
35
|
+
"test:watch": "vitest watch",
|
|
36
|
+
"clean": "rm -rf dist"
|
|
37
|
+
}
|
|
38
|
+
}
|