@activepieces/piece-typefully 0.0.1
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 +16 -0
- package/src/i18n/fr.json +63 -0
- package/src/i18n/translation.json +63 -0
- package/src/index.d.ts +2 -0
- package/src/index.d.ts.map +1 -0
- package/src/index.js +56 -0
- package/src/index.js.map +1 -0
- package/src/lib/actions/create-draft-advanced.action.d.ts +9 -0
- package/src/lib/actions/create-draft-advanced.action.d.ts.map +1 -0
- package/src/lib/actions/create-draft-advanced.action.js +71 -0
- package/src/lib/actions/create-draft-advanced.action.js.map +1 -0
- package/src/lib/actions/create-draft.action.d.ts +11 -0
- package/src/lib/actions/create-draft.action.d.ts.map +1 -0
- package/src/lib/actions/create-draft.action.js +93 -0
- package/src/lib/actions/create-draft.action.js.map +1 -0
- package/src/lib/actions/delete-draft.action.d.ts +5 -0
- package/src/lib/actions/delete-draft.action.d.ts.map +1 -0
- package/src/lib/actions/delete-draft.action.js +35 -0
- package/src/lib/actions/delete-draft.action.js.map +1 -0
- package/src/lib/actions/get-draft.action.d.ts +5 -0
- package/src/lib/actions/get-draft.action.d.ts.map +1 -0
- package/src/lib/actions/get-draft.action.js +34 -0
- package/src/lib/actions/get-draft.action.js.map +1 -0
- package/src/lib/actions/list-drafts.action.d.ts +7 -0
- package/src/lib/actions/list-drafts.action.d.ts.map +1 -0
- package/src/lib/actions/list-drafts.action.js +71 -0
- package/src/lib/actions/list-drafts.action.js.map +1 -0
- package/src/lib/actions/schedule-draft-next-slot.action.d.ts +5 -0
- package/src/lib/actions/schedule-draft-next-slot.action.d.ts.map +1 -0
- package/src/lib/actions/schedule-draft-next-slot.action.js +37 -0
- package/src/lib/actions/schedule-draft-next-slot.action.js.map +1 -0
- package/src/lib/auth.d.ts +2 -0
- package/src/lib/auth.d.ts.map +1 -0
- package/src/lib/auth.js +45 -0
- package/src/lib/auth.js.map +1 -0
- package/src/lib/common/client.d.ts +11 -0
- package/src/lib/common/client.d.ts.map +1 -0
- package/src/lib/common/client.js +32 -0
- package/src/lib/common/client.js.map +1 -0
- package/src/lib/common/props.d.ts +83 -0
- package/src/lib/common/props.d.ts.map +1 -0
- package/src/lib/common/props.js +181 -0
- package/src/lib/common/props.js.map +1 -0
- package/src/lib/common/types.d.ts +31 -0
- package/src/lib/common/types.d.ts.map +1 -0
- package/src/lib/common/types.js +3 -0
- package/src/lib/common/types.js.map +1 -0
- package/src/lib/triggers/draft-created.trigger.d.ts +11 -0
- package/src/lib/triggers/draft-created.trigger.d.ts.map +1 -0
- package/src/lib/triggers/draft-created.trigger.js +38 -0
- package/src/lib/triggers/draft-created.trigger.js.map +1 -0
- package/src/lib/triggers/draft-deleted.trigger.d.ts +11 -0
- package/src/lib/triggers/draft-deleted.trigger.d.ts.map +1 -0
- package/src/lib/triggers/draft-deleted.trigger.js +38 -0
- package/src/lib/triggers/draft-deleted.trigger.js.map +1 -0
- package/src/lib/triggers/draft-published.trigger.d.ts +11 -0
- package/src/lib/triggers/draft-published.trigger.d.ts.map +1 -0
- package/src/lib/triggers/draft-published.trigger.js +38 -0
- package/src/lib/triggers/draft-published.trigger.js.map +1 -0
- package/src/lib/triggers/draft-scheduled.trigger.d.ts +11 -0
- package/src/lib/triggers/draft-scheduled.trigger.d.ts.map +1 -0
- package/src/lib/triggers/draft-scheduled.trigger.js +38 -0
- package/src/lib/triggers/draft-scheduled.trigger.js.map +1 -0
- package/src/lib/triggers/draft-status-changed.trigger.d.ts +11 -0
- package/src/lib/triggers/draft-status-changed.trigger.d.ts.map +1 -0
- package/src/lib/triggers/draft-status-changed.trigger.js +38 -0
- package/src/lib/triggers/draft-status-changed.trigger.js.map +1 -0
- package/src/lib/triggers/draft-tags-changed.trigger.d.ts +11 -0
- package/src/lib/triggers/draft-tags-changed.trigger.d.ts.map +1 -0
- package/src/lib/triggers/draft-tags-changed.trigger.js +38 -0
- package/src/lib/triggers/draft-tags-changed.trigger.js.map +1 -0
package/package.json
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@activepieces/piece-typefully",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"main": "./src/index.js",
|
|
5
|
+
"types": "./src/index.d.ts",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"build": "tsc -p tsconfig.lib.json && cp package.json dist/",
|
|
8
|
+
"lint": "eslint 'src/**/*.ts'"
|
|
9
|
+
},
|
|
10
|
+
"dependencies": {
|
|
11
|
+
"@activepieces/pieces-common": "0.12.0",
|
|
12
|
+
"@activepieces/pieces-framework": "0.26.0",
|
|
13
|
+
"@activepieces/shared": "0.50.0",
|
|
14
|
+
"tslib": "2.6.2"
|
|
15
|
+
}
|
|
16
|
+
}
|
package/src/i18n/fr.json
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
{
|
|
2
|
+
"Write, schedule, and publish social media content.": "Rédigez, planifiez et publiez du contenu sur les réseaux sociaux.",
|
|
3
|
+
"You can obtain your API key from **Typefully Settings → API**.": "Vous pouvez obtenir votre clé API dans **Paramètres Typefully → API**.",
|
|
4
|
+
"Create Draft": "Créer un brouillon",
|
|
5
|
+
"Create a single-post draft with text and optional media URLs.": "Créer un brouillon avec du texte et des URL de médias optionnels.",
|
|
6
|
+
"Social Set": "Compte social",
|
|
7
|
+
"The social set (account) to use.": "Le compte social à utiliser.",
|
|
8
|
+
"Post Text": "Texte du post",
|
|
9
|
+
"The text content of the post.": "Le contenu texte du post.",
|
|
10
|
+
"Platforms": "Plateformes",
|
|
11
|
+
"Which platforms to publish to. If empty, uses the social set defaults.": "Sur quelles plateformes publier. Si vide, utilise les paramètres par défaut du compte.",
|
|
12
|
+
"X (Twitter)": "X (Twitter)",
|
|
13
|
+
"LinkedIn": "LinkedIn",
|
|
14
|
+
"Threads": "Threads",
|
|
15
|
+
"Bluesky": "Bluesky",
|
|
16
|
+
"Mastodon": "Mastodon",
|
|
17
|
+
"Draft Title": "Titre du brouillon",
|
|
18
|
+
"An optional title for the draft (visible only in Typefully).": "Un titre optionnel pour le brouillon (visible uniquement dans Typefully).",
|
|
19
|
+
"Tags": "Tags",
|
|
20
|
+
"Tags to apply to the draft.": "Tags à appliquer au brouillon.",
|
|
21
|
+
"Generate Share URL": "Générer un lien de partage",
|
|
22
|
+
"Generate a share URL for the draft.": "Générer un lien de partage pour le brouillon.",
|
|
23
|
+
"Publish At": "Date de publication",
|
|
24
|
+
"Schedule the draft for a specific date/time. Leave empty to save as draft.": "Planifier le brouillon pour une date/heure précise. Laisser vide pour enregistrer comme brouillon.",
|
|
25
|
+
"X Reply To URL": "URL de réponse X",
|
|
26
|
+
"URL of an X post to reply to.": "URL d'un post X auquel répondre.",
|
|
27
|
+
"Create Draft Advanced": "Créer un brouillon avancé",
|
|
28
|
+
"Create multi-post threads with full control. Supports different content and media per post using JSON format.": "Créer des threads multi-posts avec un contrôle total. Supporte différents contenus et médias par post au format JSON.",
|
|
29
|
+
"Posts (JSON)": "Posts (JSON)",
|
|
30
|
+
"A JSON array of post objects. Each post can have: text (string), platforms (array of strings), media_ids (array of strings). Example: [{\"text\": \"First post\"}, {\"text\": \"Second post\"}]": "Un tableau JSON d'objets post. Chaque post peut contenir : text (chaîne), platforms (tableau de chaînes), media_ids (tableau de chaînes). Exemple : [{\"text\": \"Premier post\"}, {\"text\": \"Deuxième post\"}]",
|
|
31
|
+
"An optional title for the draft.": "Un titre optionnel pour le brouillon.",
|
|
32
|
+
"Get Draft": "Obtenir un brouillon",
|
|
33
|
+
"Retrieve a specific draft by its ID.": "Récupérer un brouillon spécifique par son ID.",
|
|
34
|
+
"Draft ID": "ID du brouillon",
|
|
35
|
+
"The ID of the draft to retrieve.": "L'ID du brouillon à récupérer.",
|
|
36
|
+
"List Drafts": "Lister les brouillons",
|
|
37
|
+
"List drafts with optional filters.": "Lister les brouillons avec des filtres optionnels.",
|
|
38
|
+
"Status": "Statut",
|
|
39
|
+
"Filter by draft status.": "Filtrer par statut de brouillon.",
|
|
40
|
+
"Draft": "Brouillon",
|
|
41
|
+
"Scheduled": "Planifié",
|
|
42
|
+
"Published": "Publié",
|
|
43
|
+
"Publishing": "En cours de publication",
|
|
44
|
+
"Error": "Erreur",
|
|
45
|
+
"Order By": "Trier par",
|
|
46
|
+
"Sort order for the results.": "Ordre de tri des résultats.",
|
|
47
|
+
"Created At (newest first)": "Date de création (récent d'abord)",
|
|
48
|
+
"Created At (oldest first)": "Date de création (ancien d'abord)",
|
|
49
|
+
"Updated At (newest first)": "Date de modification (récent d'abord)",
|
|
50
|
+
"Updated At (oldest first)": "Date de modification (ancien d'abord)",
|
|
51
|
+
"Scheduled Date (newest first)": "Date planifiée (récent d'abord)",
|
|
52
|
+
"Scheduled Date (oldest first)": "Date planifiée (ancien d'abord)",
|
|
53
|
+
"Limit": "Limite",
|
|
54
|
+
"Maximum number of drafts to return (1-50).": "Nombre maximum de brouillons à retourner (1-50).",
|
|
55
|
+
"Delete Draft": "Supprimer un brouillon",
|
|
56
|
+
"Delete an existing draft.": "Supprimer un brouillon existant.",
|
|
57
|
+
"The ID of the draft to delete.": "L'ID du brouillon à supprimer.",
|
|
58
|
+
"Schedule Draft in Next Free Slot": "Planifier dans le prochain créneau",
|
|
59
|
+
"Schedule an existing draft to be published in the next available slot based on your publishing schedule.": "Planifier un brouillon existant pour publication dans le prochain créneau disponible selon votre calendrier de publication.",
|
|
60
|
+
"The ID of the draft to schedule.": "L'ID du brouillon à planifier.",
|
|
61
|
+
"New or Updated Draft": "Brouillon nouveau ou modifié",
|
|
62
|
+
"Triggers when a draft is created, updated, scheduled, or published in Typefully.": "Se déclenche quand un brouillon est créé, modifié, planifié ou publié dans Typefully."
|
|
63
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
{
|
|
2
|
+
"Write, schedule, and publish social media content.": "Write, schedule, and publish social media content.",
|
|
3
|
+
"You can obtain your API key from **Typefully Settings → API**.": "You can obtain your API key from **Typefully Settings → API**.",
|
|
4
|
+
"Create Draft": "Create Draft",
|
|
5
|
+
"Create a single-post draft with text and optional media URLs.": "Create a single-post draft with text and optional media URLs.",
|
|
6
|
+
"Social Set": "Social Set",
|
|
7
|
+
"The social set (account) to use.": "The social set (account) to use.",
|
|
8
|
+
"Post Text": "Post Text",
|
|
9
|
+
"The text content of the post.": "The text content of the post.",
|
|
10
|
+
"Platforms": "Platforms",
|
|
11
|
+
"Which platforms to publish to. If empty, uses the social set defaults.": "Which platforms to publish to. If empty, uses the social set defaults.",
|
|
12
|
+
"X (Twitter)": "X (Twitter)",
|
|
13
|
+
"LinkedIn": "LinkedIn",
|
|
14
|
+
"Threads": "Threads",
|
|
15
|
+
"Bluesky": "Bluesky",
|
|
16
|
+
"Mastodon": "Mastodon",
|
|
17
|
+
"Draft Title": "Draft Title",
|
|
18
|
+
"An optional title for the draft (visible only in Typefully).": "An optional title for the draft (visible only in Typefully).",
|
|
19
|
+
"Tags": "Tags",
|
|
20
|
+
"Tags to apply to the draft.": "Tags to apply to the draft.",
|
|
21
|
+
"Generate Share URL": "Generate Share URL",
|
|
22
|
+
"Generate a share URL for the draft.": "Generate a share URL for the draft.",
|
|
23
|
+
"Publish At": "Publish At",
|
|
24
|
+
"Schedule the draft for a specific date/time. Leave empty to save as draft.": "Schedule the draft for a specific date/time. Leave empty to save as draft.",
|
|
25
|
+
"X Reply To URL": "X Reply To URL",
|
|
26
|
+
"URL of an X post to reply to.": "URL of an X post to reply to.",
|
|
27
|
+
"Create Draft Advanced": "Create Draft Advanced",
|
|
28
|
+
"Create multi-post threads with full control. Supports different content and media per post using JSON format.": "Create multi-post threads with full control. Supports different content and media per post using JSON format.",
|
|
29
|
+
"Posts (JSON)": "Posts (JSON)",
|
|
30
|
+
"A JSON array of post objects. Each post can have: text (string), platforms (array of strings), media_ids (array of strings). Example: [{\"text\": \"First post\"}, {\"text\": \"Second post\"}]": "A JSON array of post objects. Each post can have: text (string), platforms (array of strings), media_ids (array of strings). Example: [{\"text\": \"First post\"}, {\"text\": \"Second post\"}]",
|
|
31
|
+
"An optional title for the draft.": "An optional title for the draft.",
|
|
32
|
+
"Get Draft": "Get Draft",
|
|
33
|
+
"Retrieve a specific draft by its ID.": "Retrieve a specific draft by its ID.",
|
|
34
|
+
"Draft ID": "Draft ID",
|
|
35
|
+
"The ID of the draft to retrieve.": "The ID of the draft to retrieve.",
|
|
36
|
+
"List Drafts": "List Drafts",
|
|
37
|
+
"List drafts with optional filters.": "List drafts with optional filters.",
|
|
38
|
+
"Status": "Status",
|
|
39
|
+
"Filter by draft status.": "Filter by draft status.",
|
|
40
|
+
"Draft": "Draft",
|
|
41
|
+
"Scheduled": "Scheduled",
|
|
42
|
+
"Published": "Published",
|
|
43
|
+
"Publishing": "Publishing",
|
|
44
|
+
"Error": "Error",
|
|
45
|
+
"Order By": "Order By",
|
|
46
|
+
"Sort order for the results.": "Sort order for the results.",
|
|
47
|
+
"Created At (newest first)": "Created At (newest first)",
|
|
48
|
+
"Created At (oldest first)": "Created At (oldest first)",
|
|
49
|
+
"Updated At (newest first)": "Updated At (newest first)",
|
|
50
|
+
"Updated At (oldest first)": "Updated At (oldest first)",
|
|
51
|
+
"Scheduled Date (newest first)": "Scheduled Date (newest first)",
|
|
52
|
+
"Scheduled Date (oldest first)": "Scheduled Date (oldest first)",
|
|
53
|
+
"Limit": "Limit",
|
|
54
|
+
"Maximum number of drafts to return (1-50).": "Maximum number of drafts to return (1-50).",
|
|
55
|
+
"Delete Draft": "Delete Draft",
|
|
56
|
+
"Delete an existing draft.": "Delete an existing draft.",
|
|
57
|
+
"The ID of the draft to delete.": "The ID of the draft to delete.",
|
|
58
|
+
"Schedule Draft in Next Free Slot": "Schedule Draft in Next Free Slot",
|
|
59
|
+
"Schedule an existing draft to be published in the next available slot based on your publishing schedule.": "Schedule an existing draft to be published in the next available slot based on your publishing schedule.",
|
|
60
|
+
"The ID of the draft to schedule.": "The ID of the draft to schedule.",
|
|
61
|
+
"New or Updated Draft": "New or Updated Draft",
|
|
62
|
+
"Triggers when a draft is created, updated, scheduled, or published in Typefully.": "Triggers when a draft is created, updated, scheduled, or published in Typefully."
|
|
63
|
+
}
|
package/src/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAkBA,eAAO,MAAM,SAAS,mHAiCpB,CAAC"}
|
package/src/index.js
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.typefully = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
+
const shared_1 = require("@activepieces/shared");
|
|
7
|
+
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
8
|
+
const auth_1 = require("./lib/auth");
|
|
9
|
+
const client_1 = require("./lib/common/client");
|
|
10
|
+
const create_draft_action_1 = require("./lib/actions/create-draft.action");
|
|
11
|
+
const create_draft_advanced_action_1 = require("./lib/actions/create-draft-advanced.action");
|
|
12
|
+
const get_draft_action_1 = require("./lib/actions/get-draft.action");
|
|
13
|
+
const list_drafts_action_1 = require("./lib/actions/list-drafts.action");
|
|
14
|
+
const delete_draft_action_1 = require("./lib/actions/delete-draft.action");
|
|
15
|
+
const schedule_draft_next_slot_action_1 = require("./lib/actions/schedule-draft-next-slot.action");
|
|
16
|
+
const draft_created_trigger_1 = require("./lib/triggers/draft-created.trigger");
|
|
17
|
+
const draft_scheduled_trigger_1 = require("./lib/triggers/draft-scheduled.trigger");
|
|
18
|
+
const draft_published_trigger_1 = require("./lib/triggers/draft-published.trigger");
|
|
19
|
+
const draft_status_changed_trigger_1 = require("./lib/triggers/draft-status-changed.trigger");
|
|
20
|
+
const draft_tags_changed_trigger_1 = require("./lib/triggers/draft-tags-changed.trigger");
|
|
21
|
+
const draft_deleted_trigger_1 = require("./lib/triggers/draft-deleted.trigger");
|
|
22
|
+
exports.typefully = (0, pieces_framework_1.createPiece)({
|
|
23
|
+
displayName: 'Typefully',
|
|
24
|
+
description: 'Write, schedule, and publish social media content.',
|
|
25
|
+
auth: auth_1.typefullyAuth,
|
|
26
|
+
minimumSupportedRelease: '0.36.1',
|
|
27
|
+
logoUrl: 'https://cdn.activepieces.com/pieces/typefully.png',
|
|
28
|
+
authors: ['bst1n', 'sanket-a11y'],
|
|
29
|
+
categories: [shared_1.PieceCategory.MARKETING],
|
|
30
|
+
actions: [
|
|
31
|
+
create_draft_action_1.createDraftAction,
|
|
32
|
+
create_draft_advanced_action_1.createDraftAdvancedAction,
|
|
33
|
+
get_draft_action_1.getDraftAction,
|
|
34
|
+
list_drafts_action_1.listDraftsAction,
|
|
35
|
+
delete_draft_action_1.deleteDraftAction,
|
|
36
|
+
schedule_draft_next_slot_action_1.scheduleDraftNextSlotAction,
|
|
37
|
+
(0, pieces_common_1.createCustomApiCallAction)({
|
|
38
|
+
auth: auth_1.typefullyAuth,
|
|
39
|
+
baseUrl: () => client_1.TYPEFULLY_API_URL,
|
|
40
|
+
authMapping: (auth) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
41
|
+
return {
|
|
42
|
+
Authorization: `Bearer ${auth.secret_text}`,
|
|
43
|
+
};
|
|
44
|
+
}),
|
|
45
|
+
}),
|
|
46
|
+
],
|
|
47
|
+
triggers: [
|
|
48
|
+
draft_created_trigger_1.draftCreatedTrigger,
|
|
49
|
+
draft_scheduled_trigger_1.draftScheduledTrigger,
|
|
50
|
+
draft_published_trigger_1.draftPublishedTrigger,
|
|
51
|
+
draft_status_changed_trigger_1.draftStatusChangedTrigger,
|
|
52
|
+
draft_tags_changed_trigger_1.draftTagsChangedTrigger,
|
|
53
|
+
draft_deleted_trigger_1.draftDeletedTrigger,
|
|
54
|
+
],
|
|
55
|
+
});
|
|
56
|
+
//# sourceMappingURL=index.js.map
|
package/src/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;AAAA,qEAA6D;AAC7D,iDAAqD;AACrD,+DAAwE;AACxE,qCAA2C;AAC3C,gDAAwD;AACxD,2EAAsE;AACtE,6FAAuF;AACvF,qEAAgE;AAChE,yEAAoE;AACpE,2EAAsE;AACtE,mGAA4F;AAC5F,gFAA2E;AAC3E,oFAA+E;AAC/E,oFAA+E;AAC/E,8FAAwF;AACxF,0FAAoF;AACpF,gFAA2E;AAE9D,QAAA,SAAS,GAAG,IAAA,8BAAW,EAAC;IACnC,WAAW,EAAE,WAAW;IACxB,WAAW,EAAE,oDAAoD;IACjE,IAAI,EAAE,oBAAa;IACnB,uBAAuB,EAAE,QAAQ;IACjC,OAAO,EAAE,mDAAmD;IAC5D,OAAO,EAAE,CAAC,OAAO,EAAE,aAAa,CAAC;IACjC,UAAU,EAAE,CAAC,sBAAa,CAAC,SAAS,CAAC;IACrC,OAAO,EAAE;QACP,uCAAiB;QACjB,wDAAyB;QACzB,iCAAc;QACd,qCAAgB;QAChB,uCAAiB;QACjB,6DAA2B;QAC3B,IAAA,yCAAyB,EAAC;YACxB,IAAI,EAAE,oBAAa;YACnB,OAAO,EAAE,GAAG,EAAE,CAAC,0BAAiB;YAChC,WAAW,EAAE,CAAO,IAAI,EAAE,EAAE;gBAC1B,OAAO;oBACL,aAAa,EAAE,UAAU,IAAI,CAAC,WAAW,EAAE;iBAC5C,CAAC;YACJ,CAAC,CAAA;SACF,CAAC;KACH;IACD,QAAQ,EAAE;QACR,2CAAmB;QACnB,+CAAqB;QACrB,+CAAqB;QACrB,wDAAyB;QACzB,oDAAuB;QACvB,2CAAmB;KACpB;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare const createDraftAdvancedAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").SecretTextProperty<true>, {
|
|
2
|
+
social_set_id: import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").SecretTextProperty<true>>;
|
|
3
|
+
platforms_json: import("@activepieces/pieces-framework").JsonProperty<true>;
|
|
4
|
+
draft_title: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
5
|
+
tags: import("@activepieces/pieces-framework").MultiSelectDropdownProperty<string, false, import("@activepieces/pieces-framework").SecretTextProperty<true>>;
|
|
6
|
+
share: import("@activepieces/pieces-framework").CheckboxProperty<false>;
|
|
7
|
+
publish_at: import("@activepieces/pieces-framework").DateTimeProperty<false>;
|
|
8
|
+
}>;
|
|
9
|
+
//# sourceMappingURL=create-draft-advanced.action.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-draft-advanced.action.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/create-draft-advanced.action.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,yBAAyB;;;;;;;EAoEpC,CAAC"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createDraftAdvancedAction = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
+
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
7
|
+
const auth_1 = require("../auth");
|
|
8
|
+
const client_1 = require("../common/client");
|
|
9
|
+
const props_1 = require("../common/props");
|
|
10
|
+
exports.createDraftAdvancedAction = (0, pieces_framework_1.createAction)({
|
|
11
|
+
auth: auth_1.typefullyAuth,
|
|
12
|
+
name: 'typefully_create_draft_advanced',
|
|
13
|
+
displayName: 'Create Draft Advanced',
|
|
14
|
+
description: 'Create multi-post threads with full control. Supports different content per platform and post using JSON format.',
|
|
15
|
+
props: {
|
|
16
|
+
social_set_id: props_1.socialSetDropdown,
|
|
17
|
+
platforms_json: pieces_framework_1.Property.Json({
|
|
18
|
+
displayName: 'Platforms (JSON)',
|
|
19
|
+
description: `A JSON object defining per-platform content. Each key is a platform name (x, linkedin, threads, bluesky, mastodon) with an object containing "enabled" (boolean) and "posts" (array of {text} objects). For threads/X, add multiple posts. X also supports "settings": {"reply_to_url": "..."}. Example: {"x": {"enabled": true, "posts": [{"text": "Tweet 1"}, {"text": "Tweet 2"}]}, "linkedin": {"enabled": true, "posts": [{"text": "LinkedIn post"}]}}`,
|
|
20
|
+
required: true,
|
|
21
|
+
}),
|
|
22
|
+
draft_title: pieces_framework_1.Property.ShortText({
|
|
23
|
+
displayName: 'Draft Title',
|
|
24
|
+
description: 'An optional title for the draft.',
|
|
25
|
+
required: false,
|
|
26
|
+
}),
|
|
27
|
+
tags: props_1.tagsMultiSelectDropdown,
|
|
28
|
+
share: pieces_framework_1.Property.Checkbox({
|
|
29
|
+
displayName: 'Generate Share URL',
|
|
30
|
+
description: 'Generate a share URL for the draft.',
|
|
31
|
+
required: false,
|
|
32
|
+
defaultValue: false,
|
|
33
|
+
}),
|
|
34
|
+
publish_at: pieces_framework_1.Property.DateTime({
|
|
35
|
+
displayName: 'Publish At',
|
|
36
|
+
description: 'Schedule the draft for a specific date/time. Leave empty to save as draft.',
|
|
37
|
+
required: false,
|
|
38
|
+
}),
|
|
39
|
+
},
|
|
40
|
+
run(context) {
|
|
41
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
42
|
+
const { social_set_id, platforms_json, draft_title, tags, share, publish_at, } = context.propsValue;
|
|
43
|
+
let platforms;
|
|
44
|
+
if (typeof platforms_json === 'string') {
|
|
45
|
+
platforms = JSON.parse(platforms_json);
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
platforms = platforms_json;
|
|
49
|
+
}
|
|
50
|
+
if (typeof platforms !== 'object' || platforms === null || Array.isArray(platforms)) {
|
|
51
|
+
throw new Error('Platforms must be a JSON object. Example: {"x": {"enabled": true, "posts": [{"text": "Hello"}]}}');
|
|
52
|
+
}
|
|
53
|
+
const body = { platforms };
|
|
54
|
+
if (draft_title)
|
|
55
|
+
body['draft_title'] = draft_title;
|
|
56
|
+
if (tags && tags.length > 0)
|
|
57
|
+
body['tags'] = tags;
|
|
58
|
+
if (share)
|
|
59
|
+
body['share'] = true;
|
|
60
|
+
if (publish_at)
|
|
61
|
+
body['publish_at'] = publish_at;
|
|
62
|
+
return yield (0, client_1.typefullyApiCall)({
|
|
63
|
+
apiKey: context.auth.secret_text,
|
|
64
|
+
method: pieces_common_1.HttpMethod.POST,
|
|
65
|
+
resourceUri: `/social-sets/${social_set_id}/drafts`,
|
|
66
|
+
body,
|
|
67
|
+
});
|
|
68
|
+
});
|
|
69
|
+
},
|
|
70
|
+
});
|
|
71
|
+
//# sourceMappingURL=create-draft-advanced.action.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-draft-advanced.action.js","sourceRoot":"","sources":["../../../../src/lib/actions/create-draft-advanced.action.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,+DAAyD;AACzD,kCAAwC;AACxC,6CAAoD;AACpD,2CAA6E;AAGhE,QAAA,yBAAyB,GAAG,IAAA,+BAAY,EAAC;IACrD,IAAI,EAAE,oBAAa;IACnB,IAAI,EAAE,iCAAiC;IACvC,WAAW,EAAE,uBAAuB;IACpC,WAAW,EACV,kHAAkH;IACnH,KAAK,EAAE;QACN,aAAa,EAAE,yBAAiB;QAChC,cAAc,EAAE,2BAAQ,CAAC,IAAI,CAAC;YAC7B,WAAW,EAAE,kBAAkB;YAC/B,WAAW,EAAE,6bAA6b;YAC1c,QAAQ,EAAE,IAAI;SACd,CAAC;QACF,WAAW,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC/B,WAAW,EAAE,aAAa;YAC1B,WAAW,EAAE,kCAAkC;YAC/C,QAAQ,EAAE,KAAK;SACf,CAAC;QACF,IAAI,EAAE,+BAAuB;QAC7B,KAAK,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YACxB,WAAW,EAAE,oBAAoB;YACjC,WAAW,EAAE,qCAAqC;YAClD,QAA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ACnD,IAAI;aACJ,CAAC,CAAC;QACJ,CAAC;KAAA;CACD,CAAC,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare const createDraftAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").SecretTextProperty<true>, {
|
|
2
|
+
social_set_id: import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").SecretTextProperty<true>>;
|
|
3
|
+
text: import("@activepieces/pieces-framework").LongTextProperty<true>;
|
|
4
|
+
platforms: import("@activepieces/pieces-framework").StaticMultiSelectDropdownProperty<string, true>;
|
|
5
|
+
draft_title: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
6
|
+
tags: import("@activepieces/pieces-framework").MultiSelectDropdownProperty<string, false, import("@activepieces/pieces-framework").SecretTextProperty<true>>;
|
|
7
|
+
share: import("@activepieces/pieces-framework").CheckboxProperty<false>;
|
|
8
|
+
publish_at: import("@activepieces/pieces-framework").DateTimeProperty<false>;
|
|
9
|
+
reply_to_url: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
10
|
+
}>;
|
|
11
|
+
//# sourceMappingURL=create-draft.action.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-draft.action.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/create-draft.action.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,iBAAiB;;;;;;;;;EA0F5B,CAAC"}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createDraftAction = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
+
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
7
|
+
const auth_1 = require("../auth");
|
|
8
|
+
const client_1 = require("../common/client");
|
|
9
|
+
const props_1 = require("../common/props");
|
|
10
|
+
const PLATFORM_OPTIONS = ['x', 'linkedin', 'threads', 'bluesky', 'mastodon'];
|
|
11
|
+
exports.createDraftAction = (0, pieces_framework_1.createAction)({
|
|
12
|
+
auth: auth_1.typefullyAuth,
|
|
13
|
+
name: 'typefully_create_draft',
|
|
14
|
+
displayName: 'Create Draft',
|
|
15
|
+
description: 'Create a single-post draft with text and optional media URLs.',
|
|
16
|
+
props: {
|
|
17
|
+
social_set_id: props_1.socialSetDropdown,
|
|
18
|
+
text: pieces_framework_1.Property.LongText({
|
|
19
|
+
displayName: 'Post Text',
|
|
20
|
+
description: 'The text content of the post.',
|
|
21
|
+
required: true,
|
|
22
|
+
}),
|
|
23
|
+
platforms: pieces_framework_1.Property.StaticMultiSelectDropdown({
|
|
24
|
+
displayName: 'Platforms',
|
|
25
|
+
description: 'Which platforms to publish to. At least one platform must be selected.',
|
|
26
|
+
required: true,
|
|
27
|
+
options: {
|
|
28
|
+
disabled: false,
|
|
29
|
+
options: [
|
|
30
|
+
{ label: 'X (Twitter)', value: 'x' },
|
|
31
|
+
{ label: 'LinkedIn', value: 'linkedin' },
|
|
32
|
+
{ label: 'Threads', value: 'threads' },
|
|
33
|
+
{ label: 'Bluesky', value: 'bluesky' },
|
|
34
|
+
{ label: 'Mastodon', value: 'mastodon' },
|
|
35
|
+
],
|
|
36
|
+
},
|
|
37
|
+
}),
|
|
38
|
+
draft_title: pieces_framework_1.Property.ShortText({
|
|
39
|
+
displayName: 'Draft Title',
|
|
40
|
+
description: 'An optional title for the draft (visible only in Typefully).',
|
|
41
|
+
required: false,
|
|
42
|
+
}),
|
|
43
|
+
tags: props_1.tagsMultiSelectDropdown,
|
|
44
|
+
share: pieces_framework_1.Property.Checkbox({
|
|
45
|
+
displayName: 'Generate Share URL',
|
|
46
|
+
description: 'Generate a share URL for the draft.',
|
|
47
|
+
required: false,
|
|
48
|
+
defaultValue: false,
|
|
49
|
+
}),
|
|
50
|
+
publish_at: pieces_framework_1.Property.DateTime({
|
|
51
|
+
displayName: 'Publish At',
|
|
52
|
+
description: 'Schedule the draft for a specific date/time. Leave empty to save as draft.',
|
|
53
|
+
required: false,
|
|
54
|
+
}),
|
|
55
|
+
reply_to_url: pieces_framework_1.Property.ShortText({
|
|
56
|
+
displayName: 'X Reply To URL',
|
|
57
|
+
description: 'URL of an X post to reply to.',
|
|
58
|
+
required: false,
|
|
59
|
+
}),
|
|
60
|
+
},
|
|
61
|
+
run(context) {
|
|
62
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
63
|
+
const { social_set_id, text, platforms, draft_title, tags, share, publish_at, reply_to_url, } = context.propsValue;
|
|
64
|
+
const platformsBody = {};
|
|
65
|
+
for (const platform of platforms) {
|
|
66
|
+
const platformConfig = {
|
|
67
|
+
enabled: true,
|
|
68
|
+
posts: [{ text }],
|
|
69
|
+
};
|
|
70
|
+
if (platform === 'x' && reply_to_url) {
|
|
71
|
+
platformConfig['settings'] = { reply_to_url };
|
|
72
|
+
}
|
|
73
|
+
platformsBody[platform] = platformConfig;
|
|
74
|
+
}
|
|
75
|
+
const body = { platforms: platformsBody };
|
|
76
|
+
if (draft_title)
|
|
77
|
+
body['draft_title'] = draft_title;
|
|
78
|
+
if (tags && tags.length > 0)
|
|
79
|
+
body['tags'] = tags;
|
|
80
|
+
if (share)
|
|
81
|
+
body['share'] = true;
|
|
82
|
+
if (publish_at)
|
|
83
|
+
body['publish_at'] = publish_at;
|
|
84
|
+
return yield (0, client_1.typefullyApiCall)({
|
|
85
|
+
apiKey: context.auth.secret_text,
|
|
86
|
+
method: pieces_common_1.HttpMethod.POST,
|
|
87
|
+
resourceUri: `/social-sets/${social_set_id}/drafts`,
|
|
88
|
+
body,
|
|
89
|
+
});
|
|
90
|
+
});
|
|
91
|
+
},
|
|
92
|
+
});
|
|
93
|
+
//# sourceMappingURL=create-draft.action.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-draft.action.js","sourceRoot":"","sources":["../../../../src/lib/actions/create-draft.action.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G,IAAI,CAAC;YAChC,IAAI,UAAU;gBAAE,IAAI,CAAC,YAAY,CAAC,GAAG,UAAU,CAAC;YAEhD,OAAO,MAAM,IAAA,yBAAgB,EAAiB;gBAC7C,MAAM,EAAE,OAAO,CAAC,IAAI,CAAC,WAAW;gBAChC,MAAM,EAAE,0BAAU,CAAC,IAAI;gBACvB,WAAW,EAAE,gBAAgB,aAAa,SAAS;gBACnD,IAAI;aACJ,CAAC,CAAC;QACJ,CAAC;KAAA;CACD,CAAC,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const deleteDraftAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").SecretTextProperty<true>, {
|
|
2
|
+
social_set_id: import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").SecretTextProperty<true>>;
|
|
3
|
+
draft_id: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
4
|
+
}>;
|
|
5
|
+
//# sourceMappingURL=delete-draft.action.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delete-draft.action.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/delete-draft.action.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,iBAAiB;;;EAwB5B,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.deleteDraftAction = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
+
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
7
|
+
const auth_1 = require("../auth");
|
|
8
|
+
const client_1 = require("../common/client");
|
|
9
|
+
const props_1 = require("../common/props");
|
|
10
|
+
exports.deleteDraftAction = (0, pieces_framework_1.createAction)({
|
|
11
|
+
auth: auth_1.typefullyAuth,
|
|
12
|
+
name: 'typefully_delete_draft',
|
|
13
|
+
displayName: 'Delete Draft',
|
|
14
|
+
description: 'Delete an existing draft.',
|
|
15
|
+
props: {
|
|
16
|
+
social_set_id: props_1.socialSetDropdown,
|
|
17
|
+
draft_id: pieces_framework_1.Property.ShortText({
|
|
18
|
+
displayName: 'Draft ID',
|
|
19
|
+
description: 'The ID of the draft to delete.',
|
|
20
|
+
required: true,
|
|
21
|
+
}),
|
|
22
|
+
},
|
|
23
|
+
run(context) {
|
|
24
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
25
|
+
const { social_set_id, draft_id } = context.propsValue;
|
|
26
|
+
yield (0, client_1.typefullyApiCall)({
|
|
27
|
+
apiKey: context.auth.secret_text,
|
|
28
|
+
method: pieces_common_1.HttpMethod.DELETE,
|
|
29
|
+
resourceUri: `/social-sets/${social_set_id}/drafts/${draft_id}`,
|
|
30
|
+
});
|
|
31
|
+
return { success: true, deleted_draft_id: draft_id };
|
|
32
|
+
});
|
|
33
|
+
},
|
|
34
|
+
});
|
|
35
|
+
//# sourceMappingURL=delete-draft.action.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delete-draft.action.js","sourceRoot":"","sources":["../../../../src/lib/actions/delete-draft.action.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,+DAAyD;AACzD,kCAAwC;AACxC,6CAAoD;AACpD,2CAAoD;AAEvC,QAAA,iBAAiB,GAAG,IAAA,+BAAY,EAAC;IAC7C,IAAI,EAAE,oBAAa;IACnB,IAAI,EAAE,wBAAwB;IAC9B,WAAW,EAAE,cAAc;IAC3B,WAAW,EAAE,2BAA2B;IACxC,KAAK,EAAE;QACN,aAAa,EAAE,yBAAiB;QAChC,QAAQ,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC5B,WAAW,EAAE,UAAU;YACvB,WAAW,EAAE,gCAAgC;YAC7C,QAAQ,EAAE,IAAI;SACd,CAAC;KACF;IACK,GAAG,CAAC,OAAO;;YAChB,MAAM,EAAE,aAAa,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC;YAEvD,MAAM,IAAA,yBAAgB,EAAC;gBACtB,MAAM,EAAE,OAAO,CAAC,IAAI,CAAC,WAAW;gBAChC,MAAM,EAAE,0BAAU,CAAC,MAAM;gBACzB,WAAW,EAAE,gBAAgB,aAAa,WAAW,QAAQ,EAAE;aAC/D,CAAC,CAAC;YAEH,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,gBAAgB,EAAE,QAAQ,EAAE,CAAC;QACtD,CAAC;KAAA;CACD,CAAC,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const getDraftAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").SecretTextProperty<true>, {
|
|
2
|
+
social_set_id: import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").SecretTextProperty<true>>;
|
|
3
|
+
draft_id: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
4
|
+
}>;
|
|
5
|
+
//# sourceMappingURL=get-draft.action.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-draft.action.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/get-draft.action.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,cAAc;;;EAsBzB,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getDraftAction = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
+
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
7
|
+
const auth_1 = require("../auth");
|
|
8
|
+
const client_1 = require("../common/client");
|
|
9
|
+
const props_1 = require("../common/props");
|
|
10
|
+
exports.getDraftAction = (0, pieces_framework_1.createAction)({
|
|
11
|
+
auth: auth_1.typefullyAuth,
|
|
12
|
+
name: 'typefully_get_draft',
|
|
13
|
+
displayName: 'Get Draft',
|
|
14
|
+
description: 'Retrieve a specific draft by its ID.',
|
|
15
|
+
props: {
|
|
16
|
+
social_set_id: props_1.socialSetDropdown,
|
|
17
|
+
draft_id: pieces_framework_1.Property.ShortText({
|
|
18
|
+
displayName: 'Draft ID',
|
|
19
|
+
description: 'The ID of the draft to retrieve.',
|
|
20
|
+
required: true,
|
|
21
|
+
}),
|
|
22
|
+
},
|
|
23
|
+
run(context) {
|
|
24
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
25
|
+
const { social_set_id, draft_id } = context.propsValue;
|
|
26
|
+
return yield (0, client_1.typefullyApiCall)({
|
|
27
|
+
apiKey: context.auth.secret_text,
|
|
28
|
+
method: pieces_common_1.HttpMethod.GET,
|
|
29
|
+
resourceUri: `/social-sets/${social_set_id}/drafts/${draft_id}`,
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
},
|
|
33
|
+
});
|
|
34
|
+
//# sourceMappingURL=get-draft.action.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-draft.action.js","sourceRoot":"","sources":["../../../../src/lib/actions/get-draft.action.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,+DAAyD;AACzD,kCAAwC;AACxC,6CAAoD;AACpD,2CAAoD;AAGvC,QAAA,cAAc,GAAG,IAAA,+BAAY,EAAC;IAC1C,IAAI,EAAE,oBAAa;IACnB,IAAI,EAAE,qBAAqB;IAC3B,WAAW,EAAE,WAAW;IACxB,WAAW,EAAE,sCAAsC;IACnD,KAAK,EAAE;QACN,aAAa,EAAE,yBAAiB;QAChC,QAAQ,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC5B,WAAW,EAAE,UAAU;YACvB,WAAW,EAAE,kCAAkC;YAC/C,QAAQ,EAAE,IAAI;SACd,CAAC;KACF;IACK,GAAG,CAAC,OAAO;;YAChB,MAAM,EAAE,aAAa,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC;YAEvD,OAAO,MAAM,IAAA,yBAAgB,EAAiB;gBAC7C,MAAM,EAAE,OAAO,CAAC,IAAI,CAAC,WAAW;gBAChC,MAAM,EAAE,0BAAU,CAAC,GAAG;gBACtB,WAAW,EAAE,gBAAgB,aAAa,WAAW,QAAQ,EAAE;aAC/D,CAAC,CAAC;QACJ,CAAC;KAAA;CACD,CAAC,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const listDraftsAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").SecretTextProperty<true>, {
|
|
2
|
+
social_set_id: import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").SecretTextProperty<true>>;
|
|
3
|
+
status: import("@activepieces/pieces-framework").StaticDropdownProperty<string, false>;
|
|
4
|
+
order_by: import("@activepieces/pieces-framework").StaticDropdownProperty<string, false>;
|
|
5
|
+
limit: import("@activepieces/pieces-framework").NumberProperty<false>;
|
|
6
|
+
}>;
|
|
7
|
+
//# sourceMappingURL=list-drafts.action.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-drafts.action.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/list-drafts.action.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,gBAAgB;;;;;EA2D3B,CAAC"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.listDraftsAction = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
+
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
7
|
+
const auth_1 = require("../auth");
|
|
8
|
+
const client_1 = require("../common/client");
|
|
9
|
+
const props_1 = require("../common/props");
|
|
10
|
+
exports.listDraftsAction = (0, pieces_framework_1.createAction)({
|
|
11
|
+
auth: auth_1.typefullyAuth,
|
|
12
|
+
name: 'typefully_list_drafts',
|
|
13
|
+
displayName: 'List Drafts',
|
|
14
|
+
description: 'List drafts with optional filters.',
|
|
15
|
+
props: {
|
|
16
|
+
social_set_id: props_1.socialSetDropdown,
|
|
17
|
+
status: pieces_framework_1.Property.StaticDropdown({
|
|
18
|
+
displayName: 'Status',
|
|
19
|
+
description: 'Filter by draft status.',
|
|
20
|
+
required: false,
|
|
21
|
+
options: {
|
|
22
|
+
disabled: false,
|
|
23
|
+
options: [
|
|
24
|
+
{ label: 'Draft', value: 'draft' },
|
|
25
|
+
{ label: 'Scheduled', value: 'scheduled' },
|
|
26
|
+
{ label: 'Published', value: 'published' },
|
|
27
|
+
{ label: 'Publishing', value: 'publishing' },
|
|
28
|
+
{ label: 'Error', value: 'error' },
|
|
29
|
+
],
|
|
30
|
+
},
|
|
31
|
+
}),
|
|
32
|
+
order_by: pieces_framework_1.Property.StaticDropdown({
|
|
33
|
+
displayName: 'Order By',
|
|
34
|
+
description: 'Sort order for the results.',
|
|
35
|
+
required: false,
|
|
36
|
+
options: {
|
|
37
|
+
disabled: false,
|
|
38
|
+
options: [
|
|
39
|
+
{ label: 'Created At (newest first)', value: '-created_at' },
|
|
40
|
+
{ label: 'Created At (oldest first)', value: 'created_at' },
|
|
41
|
+
{ label: 'Updated At (newest first)', value: '-updated_at' },
|
|
42
|
+
{ label: 'Updated At (oldest first)', value: 'updated_at' },
|
|
43
|
+
{ label: 'Scheduled Date (newest first)', value: '-scheduled_date' },
|
|
44
|
+
{ label: 'Scheduled Date (oldest first)', value: 'scheduled_date' },
|
|
45
|
+
],
|
|
46
|
+
},
|
|
47
|
+
}),
|
|
48
|
+
limit: pieces_framework_1.Property.Number({
|
|
49
|
+
displayName: 'Limit',
|
|
50
|
+
description: 'Maximum number of drafts to return (1-50).',
|
|
51
|
+
required: false,
|
|
52
|
+
defaultValue: 10,
|
|
53
|
+
}),
|
|
54
|
+
},
|
|
55
|
+
run(context) {
|
|
56
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
57
|
+
const { social_set_id, status, order_by, limit } = context.propsValue;
|
|
58
|
+
return yield (0, client_1.typefullyApiCall)({
|
|
59
|
+
apiKey: context.auth.secret_text,
|
|
60
|
+
method: pieces_common_1.HttpMethod.GET,
|
|
61
|
+
resourceUri: `/social-sets/${social_set_id}/drafts`,
|
|
62
|
+
query: {
|
|
63
|
+
status,
|
|
64
|
+
order_by,
|
|
65
|
+
limit: limit !== null && limit !== void 0 ? limit : 10,
|
|
66
|
+
},
|
|
67
|
+
});
|
|
68
|
+
});
|
|
69
|
+
},
|
|
70
|
+
});
|
|
71
|
+
//# sourceMappingURL=list-drafts.action.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-drafts.action.js","sourceRoot":"","sources":["../../../../src/lib/actions/list-drafts.action.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,+DAAyD;AACzD,kCAAwC;AACxC,6CAAoD;AACpD,2CAAoD;AAGvC,QAAA,gBAAgB,GAAG,IAAA,+BAAY,EAAC;IAC5C,IAAI,EAAE,oBAAa;IACnB,IAAI,EAAE,uBAAuB;IAC7B,WAAW,EAAE,aAAa;IAC1B,WAAW,EAAE,oCAAoC;IACjD,KAAK,EAAE;QACN,aAAa,EAAE,yBAAiB;QAChC,MAAM,EAAE,2BAAQ,CAAC,cAAc,CAAC;YAC/B,WAAW,EAAE,QAAQ;YACrB,WAAW,EAAE,yBAAyB;YACtC,QAAQ,EAAE,KAAK;YACf,OAAO,EAAE;gBACR,QAAQ,EAAE,KAAK;gBACf,OAAO,EAAE;oBACR,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE;oBAClC,EAAE,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,WAAW,EAAE;oBAC1C,EAAE,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,WAAW,EAAE;oBAC1C,EAAE,KAAK,EAA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AAK,aAAL,KAAK,cAAL,KAAK,GAAI,EAAE;iBAClB;aACD,CAAC,CAAC;QACJ,CAAC;KAAA;CACD,CAAC,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const scheduleDraftNextSlotAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").SecretTextProperty<true>, {
|
|
2
|
+
social_set_id: import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").SecretTextProperty<true>>;
|
|
3
|
+
draft_id: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
4
|
+
}>;
|
|
5
|
+
//# sourceMappingURL=schedule-draft-next-slot.action.d.ts.map
|