@activepieces/piece-dub 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 ADDED
@@ -0,0 +1,17 @@
1
+ {
2
+ "name": "@activepieces/piece-dub",
3
+ "version": "0.0.1",
4
+ "type": "commonjs",
5
+ "main": "./src/index.js",
6
+ "types": "./src/index.d.ts",
7
+ "dependencies": {
8
+ "@activepieces/pieces-common": "0.12.0",
9
+ "@activepieces/pieces-framework": "0.26.0",
10
+ "@activepieces/shared": "0.46.0",
11
+ "tslib": "2.6.2"
12
+ },
13
+ "scripts": {
14
+ "build": "tsc -p tsconfig.lib.json && cp package.json dist/",
15
+ "lint": "eslint 'src/**/*.ts'"
16
+ }
17
+ }
@@ -0,0 +1,150 @@
1
+ {
2
+ "Dub is the modern link attribution platform for creating, managing, and analysing short links, tracking conversions, and running affiliate programmes.": "Dub is the modern link attribution platform for creating, managing, and analysing short links, tracking conversions, and running affiliate programmes.",
3
+ "\nTo obtain your Dub API key:\n1. Go to [https://app.dub.co/settings/tokens](https://app.dub.co/settings/tokens)\n2. Click **Create API Key**\n3. Give your key a name and select the required scopes\n4. Copy the key — it starts with `dub_` (e.g. `dub_xxxxxxxxxxxxxxxx`)\n5. Paste it here\n\n> **Required scopes:** `links.read`, `links.write`, `webhooks.write` (for triggers)\n": "\nTo obtain your Dub API key:\n1. Go to [https://app.dub.co/settings/tokens](https://app.dub.co/settings/tokens)\n2. Click **Create API Key**\n3. Give your key a name and select the required scopes\n4. Copy the key — it starts with `dub_` (e.g. `dub_xxxxxxxxxxxxxxxx`)\n5. Paste it here\n\n> **Required scopes:** `links.read`, `links.write`, `webhooks.write` (for triggers)\n",
4
+ "Create Link": "Create Link",
5
+ "Get Link": "Get Link",
6
+ "List Links": "List Links",
7
+ "Update Link": "Update Link",
8
+ "Delete Link": "Delete Link",
9
+ "Custom API Call": "Custom API Call",
10
+ "Create a new shortened link in your Dub workspace.": "Create a new shortened link in your Dub workspace.",
11
+ "Retrieve details of a specific Dub link by its ID, external ID, or domain + key.": "Retrieve details of a specific Dub link by its ID, external ID, or domain + key.",
12
+ "Retrieve a paginated list of links in your Dub workspace.": "Retrieve a paginated list of links in your Dub workspace.",
13
+ "Update an existing Dub link. Only the fields you fill in will be updated.": "Update an existing Dub link. Only the fields you fill in will be updated.",
14
+ "Permanently delete a Dub link. This action cannot be undone.": "Permanently delete a Dub link. This action cannot be undone.",
15
+ "Make a custom API call to a specific endpoint": "Make a custom API call to a specific endpoint",
16
+ "Destination URL": "Destination URL",
17
+ "Domain": "Domain",
18
+ "Short Link Slug": "Short Link Slug",
19
+ "External ID": "External ID",
20
+ "Title": "Title",
21
+ "Description": "Description",
22
+ "OG Image URL": "OG Image URL",
23
+ "OG Video URL": "OG Video URL",
24
+ "Tag Names": "Tag Names",
25
+ "Folder ID": "Folder ID",
26
+ "Expires At": "Expires At",
27
+ "Expired URL": "Expired URL",
28
+ "Password": "Password",
29
+ "Track Conversions": "Track Conversions",
30
+ "Custom Link Previews": "Custom Link Previews",
31
+ "Cloaked URL (URL Rewriting)": "Cloaked URL (URL Rewriting)",
32
+ "Allow Search Engine Indexing": "Allow Search Engine Indexing",
33
+ "Archived": "Archived",
34
+ "iOS Redirect URL": "iOS Redirect URL",
35
+ "Android Redirect URL": "Android Redirect URL",
36
+ "Comments": "Comments",
37
+ "UTM Source": "UTM Source",
38
+ "UTM Medium": "UTM Medium",
39
+ "UTM Campaign": "UTM Campaign",
40
+ "UTM Term": "UTM Term",
41
+ "UTM Content": "UTM Content",
42
+ "Look Up By": "Look Up By",
43
+ "Link ID": "Link ID",
44
+ "Key (Slug)": "Key (Slug)",
45
+ "Domain Filter": "Domain Filter",
46
+ "Tag Name Filter": "Tag Name Filter",
47
+ "Search Query": "Search Query",
48
+ "User ID Filter": "User ID Filter",
49
+ "Include Archived Links": "Include Archived Links",
50
+ "Page": "Page",
51
+ "Page Size": "Page Size",
52
+ "Sort By": "Sort By",
53
+ "New Destination URL": "New Destination URL",
54
+ "New Slug": "New Slug",
55
+ "Method": "Method",
56
+ "Headers": "Headers",
57
+ "Query Parameters": "Query Parameters",
58
+ "Body Type": "Body Type",
59
+ "Body": "Body",
60
+ "Response is Binary ?": "Response is Binary ?",
61
+ "No Error on Failure": "No Error on Failure",
62
+ "Timeout (in seconds)": "Timeout (in seconds)",
63
+ "Follow redirects": "Follow redirects",
64
+ "The full destination URL the short link should redirect to.": "The full destination URL the short link should redirect to.",
65
+ "The domain to use for the short link (e.g. `dub.sh`). If omitted, the primary workspace domain is used.": "The domain to use for the short link (e.g. `dub.sh`). If omitted, the primary workspace domain is used.",
66
+ "Custom slug for the short link (e.g. `my-promo`). If omitted, a random 7-character slug is generated.": "Custom slug for the short link (e.g. `my-promo`). If omitted, a random 7-character slug is generated.",
67
+ "Your internal database ID for this link. Must be unique per workspace. Useful for looking up the link later.": "Your internal database ID for this link. Must be unique per workspace. Useful for looking up the link later.",
68
+ "A human-readable title for the link (used in the Dub dashboard).": "A human-readable title for the link (used in the Dub dashboard).",
69
+ "A short description of what the link points to.": "A short description of what the link points to.",
70
+ "Custom link preview image (og:image). Used when Custom Link Previews (`proxy`) is enabled.": "Custom link preview image (og:image). Used when Custom Link Previews (`proxy`) is enabled.",
71
+ "Custom link preview video (og:video). Used when Custom Link Previews (`proxy`) is enabled.": "Custom link preview video (og:video). Used when Custom Link Previews (`proxy`) is enabled.",
72
+ "List of tag names to attach to this link.": "List of tag names to attach to this link.",
73
+ "The unique ID of an existing folder to assign this link to.": "The unique ID of an existing folder to assign this link to.",
74
+ "ISO 8601 datetime when the link should expire (e.g. `2025-12-31T23:59:59Z`). Expired links redirect to the expiration URL.": "ISO 8601 datetime when the link should expire (e.g. `2025-12-31T23:59:59Z`). Expired links redirect to the expiration URL.",
75
+ "URL to redirect to after the link expires.": "URL to redirect to after the link expires.",
76
+ "Password-protect the link. Visitors must enter this password before being redirected.": "Password-protect the link. Visitors must enter this password before being redirected.",
77
+ "Whether to track conversions for this link.": "Whether to track conversions for this link.",
78
+ "Enable Custom Link Previews (og:title, og:description, og:image) for this link.": "Enable Custom Link Previews (og:title, og:description, og:image) for this link.",
79
+ "Cloak the destination URL — visitors see the short link URL in the browser.": "Cloak the destination URL — visitors see the short link URL in the browser.",
80
+ "Allow search engines to index this short link.": "Allow search engines to index this short link.",
81
+ "Archive this link immediately after creation.": "Archive this link immediately after creation.",
82
+ "Redirect iOS device visitors to this URL instead.": "Redirect iOS device visitors to this URL instead.",
83
+ "Redirect Android device visitors to this URL instead.": "Redirect Android device visitors to this URL instead.",
84
+ "Internal notes about this link (not shown to visitors).": "Internal notes about this link (not shown to visitors).",
85
+ "UTM source parameter (e.g. `newsletter`, `twitter`).": "UTM source parameter (e.g. `newsletter`, `twitter`).",
86
+ "UTM medium parameter (e.g. `email`, `social`).": "UTM medium parameter (e.g. `email`, `social`).",
87
+ "UTM campaign parameter (e.g. `spring-sale`).": "UTM campaign parameter (e.g. `spring-sale`).",
88
+ "UTM term parameter for paid search keywords.": "UTM term parameter for paid search keywords.",
89
+ "UTM content parameter for A/B testing.": "UTM content parameter for A/B testing.",
90
+ "How to identify the link you want to retrieve.": "How to identify the link you want to retrieve.",
91
+ "The Dub-generated link ID (e.g. `clv3g2...`). Used when Look Up By = Link ID.": "The Dub-generated link ID (e.g. `clv3g2...`). Used when Look Up By = Link ID.",
92
+ "Your internal ID for the link. Pass with prefix `ext_` (e.g. `ext_123456`). Used when Look Up By = External ID.": "Your internal ID for the link. Pass with prefix `ext_` (e.g. `ext_123456`). Used when Look Up By = External ID.",
93
+ "The domain of the link (e.g. `dub.sh`). Used when Look Up By = Domain + Key.": "The domain of the link (e.g. `dub.sh`). Used when Look Up By = Domain + Key.",
94
+ "The slug of the link (e.g. `my-promo`). Used when Look Up By = Domain + Key.": "The slug of the link (e.g. `my-promo`). Used when Look Up By = Domain + Key.",
95
+ "Filter by a specific domain (e.g. `dub.sh`). Leave empty to return all domains.": "Filter by a specific domain (e.g. `dub.sh`). Leave empty to return all domains.",
96
+ "Filter by one or more tag names.": "Filter by one or more tag names.",
97
+ "Search links by their URL, title, or slug.": "Search links by their URL, title, or slug.",
98
+ "Filter links created by a specific user ID.": "Filter links created by a specific user ID.",
99
+ "Whether to include archived links in the results.": "Whether to include archived links in the results.",
100
+ "Page number for pagination (starts at 1).": "Page number for pagination (starts at 1).",
101
+ "Number of links to return per page (1–100). Default is 100.": "Number of links to return per page (1–100). Default is 100.",
102
+ "Field to sort results by.": "Field to sort results by.",
103
+ "The ID of the link to update (e.g. `clv3g2...`). Find this from the Create Link or List Links actions.": "The ID of the link to update (e.g. `clv3g2...`). Find this from the Create Link or List Links actions.",
104
+ "Update the destination URL the link redirects to.": "Update the destination URL the link redirects to.",
105
+ "Update the short link slug (the part after the domain).": "Update the short link slug (the part after the domain).",
106
+ "Update the human-readable title.": "Update the human-readable title.",
107
+ "Update the link description.": "Update the link description.",
108
+ "Update the custom link preview image (og:image).": "Update the custom link preview image (og:image).",
109
+ "Update the custom link preview video (og:video).": "Update the custom link preview video (og:video).",
110
+ "Replace the link's tags with this new list of tag names. Send an empty array to clear all tags.": "Replace the link's tags with this new list of tag names. Send an empty array to clear all tags.",
111
+ "Move this link to a different folder by its ID.": "Move this link to a different folder by its ID.",
112
+ "ISO 8601 datetime when the link should expire. Set to empty to remove expiration.": "ISO 8601 datetime when the link should expire. Set to empty to remove expiration.",
113
+ "URL to redirect to after expiration.": "URL to redirect to after expiration.",
114
+ "Update the password for this link. Leave blank to remove password protection.": "Update the password for this link. Leave blank to remove password protection.",
115
+ "Enable or disable Custom Link Previews (og:title, og:description, og:image) for this link.": "Enable or disable Custom Link Previews (og:title, og:description, og:image) for this link.",
116
+ "Toggle URL cloaking.": "Toggle URL cloaking.",
117
+ "Archive or unarchive the link.": "Archive or unarchive the link.",
118
+ "Update the iOS-specific redirect URL.": "Update the iOS-specific redirect URL.",
119
+ "Update the Android-specific redirect URL.": "Update the Android-specific redirect URL.",
120
+ "Update internal notes for this link.": "Update internal notes for this link.",
121
+ "Update the UTM source parameter.": "Update the UTM source parameter.",
122
+ "Update the UTM medium parameter.": "Update the UTM medium parameter.",
123
+ "Update the UTM campaign parameter.": "Update the UTM campaign parameter.",
124
+ "Update the UTM term parameter.": "Update the UTM term parameter.",
125
+ "Update the UTM content parameter.": "Update the UTM content parameter.",
126
+ "The ID of the link to delete (e.g. `clv3g2...`). Find this from the Create Link or List Links actions.": "The ID of the link to delete (e.g. `clv3g2...`). Find this from the Create Link or List Links actions.",
127
+ "Authorization headers are injected automatically from your connection.": "Authorization headers are injected automatically from your connection.",
128
+ "Enable for files like PDFs, images, etc.": "Enable for files like PDFs, images, etc.",
129
+ "Domain + Key": "Domain + Key",
130
+ "Created At (newest first)": "Created At (newest first)",
131
+ "Clicks (most clicks first)": "Clicks (most clicks first)",
132
+ "Last Clicked": "Last Clicked",
133
+ "GET": "GET",
134
+ "POST": "POST",
135
+ "PATCH": "PATCH",
136
+ "PUT": "PUT",
137
+ "DELETE": "DELETE",
138
+ "HEAD": "HEAD",
139
+ "None": "None",
140
+ "JSON": "JSON",
141
+ "Form Data": "Form Data",
142
+ "Raw": "Raw",
143
+ "Link Clicked": "Link Clicked",
144
+ "Link Created": "Link Created",
145
+ "Triggers in real time whenever one of your Dub short links is clicked.": "Triggers in real time whenever one of your Dub short links is clicked.",
146
+ "Triggers in real time whenever a new short link is created in your Dub workspace.": "Triggers in real time whenever a new short link is created in your Dub workspace.",
147
+ "Markdown": "Markdown",
148
+ "## Setup Instructions\n\n1. Go to your Dub workspace and navigate to **Settings → [Webhooks](https://app.dub.co/settings/webhooks)**.\n2. Click **Create Webhook**.\n3. Give your webhook a name.\n4. Paste the following URL into the **URL** field:\n```text\n{{webhookUrl}}\n```\n5. Under **Events**, select **link.clicked**.\n6. Click **Create webhook**.": "## Setup Instructions\n\n1. Go to your Dub workspace and navigate to **Settings → [Webhooks](https://app.dub.co/settings/webhooks)**.\n2. Click **Create Webhook**.\n3. Give your webhook a name.\n4. Paste the following URL into the **URL** field:\n```text\n{{webhookUrl}}\n```\n5. Under **Events**, select **link.clicked**.\n6. Click **Create webhook**.",
149
+ "## Setup Instructions\n\n1. Go to your Dub workspace and navigate to **Settings → [Webhooks](https://app.dub.co/settings/webhooks)**.\n2. Click **Create Webhook**.\n3. Give your webhook a name.\n4. Paste the following URL into the **URL** field:\n```text\n{{webhookUrl}}\n```\n5. Under **Events**, select **link.created**.\n6. Click **Create webhook**.": "## Setup Instructions\n\n1. Go to your Dub workspace and navigate to **Settings → [Webhooks](https://app.dub.co/settings/webhooks)**.\n2. Click **Create Webhook**.\n3. Give your webhook a name.\n4. Paste the following URL into the **URL** field:\n```text\n{{webhookUrl}}\n```\n5. Under **Events**, select **link.created**.\n6. Click **Create webhook**."
150
+ }
package/src/index.d.ts ADDED
@@ -0,0 +1 @@
1
+ export declare const dub: import("@activepieces/pieces-framework").Piece<import("@activepieces/pieces-framework").SecretTextProperty<true>>;
package/src/index.js ADDED
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.dub = 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("./lib/auth");
8
+ const create_link_1 = require("./lib/actions/create-link");
9
+ const get_link_1 = require("./lib/actions/get-link");
10
+ const list_links_1 = require("./lib/actions/list-links");
11
+ const update_link_1 = require("./lib/actions/update-link");
12
+ const delete_link_1 = require("./lib/actions/delete-link");
13
+ const link_clicked_1 = require("./lib/triggers/link-clicked");
14
+ const link_created_1 = require("./lib/triggers/link-created");
15
+ const shared_1 = require("@activepieces/shared");
16
+ exports.dub = (0, pieces_framework_1.createPiece)({
17
+ displayName: 'Dub',
18
+ description: 'Dub is the modern link attribution platform for creating, managing, and analysing short links, tracking conversions, and running affiliate programmes.',
19
+ minimumSupportedRelease: '0.30.0',
20
+ logoUrl: 'https://cdn.activepieces.com/pieces/dub.png',
21
+ categories: [shared_1.PieceCategory.MARKETING, shared_1.PieceCategory.DEVELOPER_TOOLS],
22
+ auth: auth_1.dubAuth,
23
+ actions: [
24
+ create_link_1.createLink,
25
+ get_link_1.getLink,
26
+ list_links_1.listLinks,
27
+ update_link_1.updateLink,
28
+ delete_link_1.deleteLink,
29
+ (0, pieces_common_1.createCustomApiCallAction)({
30
+ auth: auth_1.dubAuth,
31
+ baseUrl: () => auth_1.DUB_API_BASE,
32
+ authMapping: (auth) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
33
+ return ({
34
+ Authorization: `Bearer ${auth.secret_text}`,
35
+ });
36
+ }),
37
+ }),
38
+ ],
39
+ authors: ['Harmatta'],
40
+ triggers: [link_clicked_1.linkClicked, link_created_1.linkCreated],
41
+ });
42
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;AAAA,qEAA6D;AAC7D,+DAAwE;AACxE,qCAAmD;AACnD,2DAAuD;AACvD,qDAAiD;AACjD,yDAAqD;AACrD,2DAAuD;AACvD,2DAAuD;AACvD,8DAA0D;AAC1D,8DAA0D;AAC1D,iDAAqD;AAExC,QAAA,GAAG,GAAG,IAAA,8BAAW,EAAC;IAC7B,WAAW,EAAE,KAAK;IAClB,WAAW,EACT,wJAAwJ;IAC1J,uBAAuB,EAAE,QAAQ;IACjC,OAAO,EAAE,6CAA6C;IACtD,UAAU,EAAE,CAAC,sBAAa,CAAC,SAAS,EAAE,sBAAa,CAAC,eAAe,CAAC;IACpE,IAAI,EAAE,cAAO;IACb,OAAO,EAAE;QACP,wBAAU;QACV,kBAAO;QACP,sBAAS;QACT,wBAAU;QACV,wBAAU;QACV,IAAA,yCAAyB,EAAC;YACxB,IAAI,EAAE,cAAO;YACb,OAAO,EAAE,GAAG,EAAE,CAAC,mBAAY;YAC3B,WAAW,EAAE,CAAO,IAAI,EAAE,EAAE;gBAAC,OAAA,CAAC;oBAC5B,aAAa,EAAE,UAAU,IAAI,CAAC,WAAW,EAAE;iBAC5C,CAAC,CAAA;cAAA;SACH,CAAC;KACH;IACD,OAAO,EAAE,CAAC,UAAU,CAAC;IACrB,QAAQ,EAAE,CAAC,0BAAW,EAAE,0BAAW,CAAC;CACrC,CAAC,CAAC"}
@@ -0,0 +1,28 @@
1
+ export declare const createLink: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").SecretTextProperty<true>, {
2
+ url: import("@activepieces/pieces-framework").ShortTextProperty<true>;
3
+ domain: import("@activepieces/pieces-framework").ShortTextProperty<false>;
4
+ key: import("@activepieces/pieces-framework").ShortTextProperty<false>;
5
+ externalId: import("@activepieces/pieces-framework").ShortTextProperty<false>;
6
+ title: import("@activepieces/pieces-framework").ShortTextProperty<false>;
7
+ description: import("@activepieces/pieces-framework").LongTextProperty<false>;
8
+ image: import("@activepieces/pieces-framework").ShortTextProperty<false>;
9
+ video: import("@activepieces/pieces-framework").ShortTextProperty<false>;
10
+ tags: import("@activepieces/pieces-framework").ArrayProperty<false>;
11
+ folderId: import("@activepieces/pieces-framework").ShortTextProperty<false>;
12
+ expiresAt: import("@activepieces/pieces-framework").ShortTextProperty<false>;
13
+ expiredUrl: import("@activepieces/pieces-framework").ShortTextProperty<false>;
14
+ password: import("@activepieces/pieces-framework").ShortTextProperty<false>;
15
+ trackConversion: import("@activepieces/pieces-framework").CheckboxProperty<false>;
16
+ proxy: import("@activepieces/pieces-framework").CheckboxProperty<false>;
17
+ rewrite: import("@activepieces/pieces-framework").CheckboxProperty<false>;
18
+ doIndex: import("@activepieces/pieces-framework").CheckboxProperty<false>;
19
+ archived: import("@activepieces/pieces-framework").CheckboxProperty<false>;
20
+ ios: import("@activepieces/pieces-framework").ShortTextProperty<false>;
21
+ android: import("@activepieces/pieces-framework").ShortTextProperty<false>;
22
+ comments: import("@activepieces/pieces-framework").LongTextProperty<false>;
23
+ utm_source: import("@activepieces/pieces-framework").ShortTextProperty<false>;
24
+ utm_medium: import("@activepieces/pieces-framework").ShortTextProperty<false>;
25
+ utm_campaign: import("@activepieces/pieces-framework").ShortTextProperty<false>;
26
+ utm_term: import("@activepieces/pieces-framework").ShortTextProperty<false>;
27
+ utm_content: import("@activepieces/pieces-framework").ShortTextProperty<false>;
28
+ }>;
@@ -0,0 +1,222 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createLink = 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
+ exports.createLink = (0, pieces_framework_1.createAction)({
9
+ name: 'create_link',
10
+ displayName: 'Create Link',
11
+ description: 'Create a new shortened link in your Dub workspace.',
12
+ auth: auth_1.dubAuth,
13
+ props: {
14
+ url: pieces_framework_1.Property.ShortText({
15
+ displayName: 'Destination URL',
16
+ description: 'The full destination URL the short link should redirect to.',
17
+ required: true,
18
+ }),
19
+ domain: pieces_framework_1.Property.ShortText({
20
+ displayName: 'Domain',
21
+ description: 'The domain to use for the short link (e.g. `dub.sh`). If omitted, the primary workspace domain is used.',
22
+ required: false,
23
+ }),
24
+ key: pieces_framework_1.Property.ShortText({
25
+ displayName: 'Short Link Slug',
26
+ description: 'Custom slug for the short link (e.g. `my-promo`). If omitted, a random 7-character slug is generated.',
27
+ required: false,
28
+ }),
29
+ externalId: pieces_framework_1.Property.ShortText({
30
+ displayName: 'External ID',
31
+ description: 'Your internal database ID for this link. Must be unique per workspace. Useful for looking up the link later.',
32
+ required: false,
33
+ }),
34
+ title: pieces_framework_1.Property.ShortText({
35
+ displayName: 'Title',
36
+ description: 'A human-readable title for the link (used in the Dub dashboard).',
37
+ required: false,
38
+ }),
39
+ description: pieces_framework_1.Property.LongText({
40
+ displayName: 'Description',
41
+ description: 'A short description of what the link points to.',
42
+ required: false,
43
+ }),
44
+ image: pieces_framework_1.Property.ShortText({
45
+ displayName: 'OG Image URL',
46
+ description: 'Custom link preview image (og:image). Used when Custom Link Previews (`proxy`) is enabled.',
47
+ required: false,
48
+ }),
49
+ video: pieces_framework_1.Property.ShortText({
50
+ displayName: 'OG Video URL',
51
+ description: 'Custom link preview video (og:video). Used when Custom Link Previews (`proxy`) is enabled.',
52
+ required: false,
53
+ }),
54
+ tags: pieces_framework_1.Property.Array({
55
+ displayName: 'Tag Names',
56
+ description: 'List of tag names to attach to this link.',
57
+ required: false,
58
+ }),
59
+ folderId: pieces_framework_1.Property.ShortText({
60
+ displayName: 'Folder ID',
61
+ description: 'The unique ID of an existing folder to assign this link to.',
62
+ required: false,
63
+ }),
64
+ expiresAt: pieces_framework_1.Property.ShortText({
65
+ displayName: 'Expires At',
66
+ description: 'ISO 8601 datetime when the link should expire (e.g. `2025-12-31T23:59:59Z`). Expired links redirect to the expiration URL.',
67
+ required: false,
68
+ }),
69
+ expiredUrl: pieces_framework_1.Property.ShortText({
70
+ displayName: 'Expired URL',
71
+ description: 'URL to redirect to after the link expires.',
72
+ required: false,
73
+ }),
74
+ password: pieces_framework_1.Property.ShortText({
75
+ displayName: 'Password',
76
+ description: 'Password-protect the link. Visitors must enter this password before being redirected.',
77
+ required: false,
78
+ }),
79
+ trackConversion: pieces_framework_1.Property.Checkbox({
80
+ displayName: 'Track Conversions',
81
+ description: 'Whether to track conversions for this link.',
82
+ required: false,
83
+ defaultValue: false,
84
+ }),
85
+ proxy: pieces_framework_1.Property.Checkbox({
86
+ displayName: 'Custom Link Previews',
87
+ description: 'Enable Custom Link Previews (og:title, og:description, og:image) for this link.',
88
+ required: false,
89
+ defaultValue: false,
90
+ }),
91
+ rewrite: pieces_framework_1.Property.Checkbox({
92
+ displayName: 'Cloaked URL (URL Rewriting)',
93
+ description: 'Cloak the destination URL — visitors see the short link URL in the browser.',
94
+ required: false,
95
+ defaultValue: false,
96
+ }),
97
+ doIndex: pieces_framework_1.Property.Checkbox({
98
+ displayName: 'Allow Search Engine Indexing',
99
+ description: 'Allow search engines to index this short link.',
100
+ required: false,
101
+ defaultValue: false,
102
+ }),
103
+ archived: pieces_framework_1.Property.Checkbox({
104
+ displayName: 'Archived',
105
+ description: 'Archive this link immediately after creation.',
106
+ required: false,
107
+ defaultValue: false,
108
+ }),
109
+ ios: pieces_framework_1.Property.ShortText({
110
+ displayName: 'iOS Redirect URL',
111
+ description: 'Redirect iOS device visitors to this URL instead.',
112
+ required: false,
113
+ }),
114
+ android: pieces_framework_1.Property.ShortText({
115
+ displayName: 'Android Redirect URL',
116
+ description: 'Redirect Android device visitors to this URL instead.',
117
+ required: false,
118
+ }),
119
+ comments: pieces_framework_1.Property.LongText({
120
+ displayName: 'Comments',
121
+ description: 'Internal notes about this link (not shown to visitors).',
122
+ required: false,
123
+ }),
124
+ // UTM parameters
125
+ utm_source: pieces_framework_1.Property.ShortText({
126
+ displayName: 'UTM Source',
127
+ description: 'UTM source parameter (e.g. `newsletter`, `twitter`).',
128
+ required: false,
129
+ }),
130
+ utm_medium: pieces_framework_1.Property.ShortText({
131
+ displayName: 'UTM Medium',
132
+ description: 'UTM medium parameter (e.g. `email`, `social`).',
133
+ required: false,
134
+ }),
135
+ utm_campaign: pieces_framework_1.Property.ShortText({
136
+ displayName: 'UTM Campaign',
137
+ description: 'UTM campaign parameter (e.g. `spring-sale`).',
138
+ required: false,
139
+ }),
140
+ utm_term: pieces_framework_1.Property.ShortText({
141
+ displayName: 'UTM Term',
142
+ description: 'UTM term parameter for paid search keywords.',
143
+ required: false,
144
+ }),
145
+ utm_content: pieces_framework_1.Property.ShortText({
146
+ displayName: 'UTM Content',
147
+ description: 'UTM content parameter for A/B testing.',
148
+ required: false,
149
+ }),
150
+ },
151
+ run(context) {
152
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
153
+ const { auth, propsValue } = context;
154
+ // Build body, omitting undefined/null/empty values
155
+ const body = {
156
+ url: propsValue.url,
157
+ };
158
+ if (propsValue.domain)
159
+ body['domain'] = propsValue.domain;
160
+ if (propsValue.key)
161
+ body['key'] = propsValue.key;
162
+ if (propsValue.externalId)
163
+ body['externalId'] = propsValue.externalId;
164
+ if (propsValue.title)
165
+ body['title'] = propsValue.title;
166
+ if (propsValue.description)
167
+ body['description'] = propsValue.description;
168
+ if (propsValue.image)
169
+ body['image'] = propsValue.image;
170
+ if (propsValue.video)
171
+ body['video'] = propsValue.video;
172
+ if (propsValue.tags && propsValue.tags.length > 0) {
173
+ body['tagNames'] = propsValue.tags;
174
+ }
175
+ if (propsValue.folderId)
176
+ body['folderId'] = propsValue.folderId;
177
+ if (propsValue.expiresAt)
178
+ body['expiresAt'] = propsValue.expiresAt;
179
+ if (propsValue.expiredUrl)
180
+ body['expiredUrl'] = propsValue.expiredUrl;
181
+ if (propsValue.password)
182
+ body['password'] = propsValue.password;
183
+ if (propsValue.trackConversion)
184
+ body['trackConversion'] = propsValue.trackConversion;
185
+ if (propsValue.proxy)
186
+ body['proxy'] = propsValue.proxy;
187
+ if (propsValue.rewrite)
188
+ body['rewrite'] = propsValue.rewrite;
189
+ if (propsValue.doIndex)
190
+ body['doIndex'] = propsValue.doIndex;
191
+ if (propsValue.archived)
192
+ body['archived'] = propsValue.archived;
193
+ if (propsValue.ios)
194
+ body['ios'] = propsValue.ios;
195
+ if (propsValue.android)
196
+ body['android'] = propsValue.android;
197
+ if (propsValue.comments)
198
+ body['comments'] = propsValue.comments;
199
+ if (propsValue.utm_source)
200
+ body['utm_source'] = propsValue.utm_source;
201
+ if (propsValue.utm_medium)
202
+ body['utm_medium'] = propsValue.utm_medium;
203
+ if (propsValue.utm_campaign)
204
+ body['utm_campaign'] = propsValue.utm_campaign;
205
+ if (propsValue.utm_term)
206
+ body['utm_term'] = propsValue.utm_term;
207
+ if (propsValue.utm_content)
208
+ body['utm_content'] = propsValue.utm_content;
209
+ const response = yield pieces_common_1.httpClient.sendRequest({
210
+ method: pieces_common_1.HttpMethod.POST,
211
+ url: `${auth_1.DUB_API_BASE}/links`,
212
+ headers: {
213
+ Authorization: `Bearer ${auth.secret_text}`,
214
+ 'Content-Type': 'application/json',
215
+ },
216
+ body,
217
+ });
218
+ return response.body;
219
+ });
220
+ },
221
+ });
222
+ //# sourceMappingURL=create-link.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-link.js","sourceRoot":"","sources":["../../../../src/lib/actions/create-link.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,+DAAqE;AACrE,kCAAgD;AAGnC,QAAA,UAAU,GAAG,IAAA,+BAAY,EAAC;IACrC,IAAI,EAAE,aAAa;IACnB,WAAW,EAAE,aAAa;IAC1B,WAAW,EAAE,oDAAoD;IACjE,IAAI,EAAE,cAAO;IACb,KAAK,EAAE;QACL,GAAG,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACtB,WAAW,EAAE,iBAAiB;YAC9B,WAAW,EAAE,6DAA6D;YAC1E,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,MAAM,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACzB,WAAW,EAAE,QAAQ;YACrB,WAAW,EACT,yGAAyG;YAC3G,QAAQ,EAAE,KAAK;SAChB,CAAC;QACF,GAAG,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACtB,WAAW,EAAE,iBAAiB;YAC9B,WAAW,EACT,uGAAuG;YACzG,QAAQ,EAAE,KAAK;SAChB,CAAC;QACF,UAAU,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC7B,WAAW,EAAE,aAAa;YAC1B,WAAW,EACT,8GAA8G;YAChH,QAAQ,EAAE,KAAK;SAChB,CAAC;QACF,KAAK,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACxB,WAAW,EAAE,OAAO;YACpB,WAAW,EAAE,kEAAkE;YAC/E,QAAQ,EAAE,KAAK;SAChB,CAAC;QACF,WAAW,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YAC7B,WAAW,EAAE,aAAa;YAC1B,WAAW,EAAE,iDAAiD;YAC9D,QAAQ,EAAE,KAAK;SAChB,CAAC;QACF,KAAK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U;gBAAE,IAAI,CAAC,YAAY,CAAC,GAAG,UAAU,CAAC,UAAU,CAAC;YACtE,IAAI,UAAU,CAAC,UAAU;gBAAE,IAAI,CAAC,YAAY,CAAC,GAAG,UAAU,CAAC,UAAU,CAAC;YACtE,IAAI,UAAU,CAAC,YAAY;gBAAE,IAAI,CAAC,cAAc,CAAC,GAAG,UAAU,CAAC,YAAY,CAAC;YAC5E,IAAI,UAAU,CAAC,QAAQ;gBAAE,IAAI,CAAC,UAAU,CAAC,GAAG,UAAU,CAAC,QAAQ,CAAC;YAChE,IAAI,UAAU,CAAC,WAAW;gBAAE,IAAI,CAAC,aAAa,CAAC,GAAG,UAAU,CAAC,WAAW,CAAC;YAEzE,MAAM,QAAQ,GAAG,MAAM,0BAAU,CAAC,WAAW,CAAU;gBACrD,MAAM,EAAE,0BAAU,CAAC,IAAI;gBACvB,GAAG,EAAE,GAAG,mBAAY,QAAQ;gBAC5B,OAAO,EAAE;oBACP,aAAa,EAAE,UAAU,IAAI,CAAC,WAAW,EAAE;oBAC3C,cAAc,EAAE,kBAAkB;iBACnC;gBACD,IAAI;aACL,CAAC,CAAC;YAEH,OAAO,QAAQ,CAAC,IAAI,CAAC;QACvB,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ export declare const deleteLink: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").SecretTextProperty<true>, {
2
+ linkId: import("@activepieces/pieces-framework").ShortTextProperty<true>;
3
+ }>;
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.deleteLink = 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
+ exports.deleteLink = (0, pieces_framework_1.createAction)({
9
+ name: 'delete_link',
10
+ displayName: 'Delete Link',
11
+ description: 'Permanently delete a Dub link. This action cannot be undone.',
12
+ auth: auth_1.dubAuth,
13
+ props: {
14
+ linkId: pieces_framework_1.Property.ShortText({
15
+ displayName: 'Link ID',
16
+ description: 'The ID of the link to delete (e.g. `clv3g2...`). Find this from the Create Link or List Links actions.',
17
+ required: true,
18
+ }),
19
+ },
20
+ run(context) {
21
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
22
+ const { auth, propsValue } = context;
23
+ const response = yield pieces_common_1.httpClient.sendRequest({
24
+ method: pieces_common_1.HttpMethod.DELETE,
25
+ url: `${auth_1.DUB_API_BASE}/links/${propsValue.linkId}`,
26
+ headers: {
27
+ Authorization: `Bearer ${auth.secret_text}`,
28
+ 'Content-Type': 'application/json',
29
+ },
30
+ });
31
+ return response.body;
32
+ });
33
+ },
34
+ });
35
+ //# sourceMappingURL=delete-link.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"delete-link.js","sourceRoot":"","sources":["../../../../src/lib/actions/delete-link.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,+DAAqE;AACrE,kCAAgD;AAEnC,QAAA,UAAU,GAAG,IAAA,+BAAY,EAAC;IACrC,IAAI,EAAE,aAAa;IACnB,WAAW,EAAE,aAAa;IAC1B,WAAW,EAAE,8DAA8D;IAC3E,IAAI,EAAE,cAAO;IACb,KAAK,EAAE;QACL,MAAM,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACzB,WAAW,EAAE,SAAS;YACtB,WAAW,EAAE,wGAAwG;YACrH,QAAQ,EAAE,IAAI;SACf,CAAC;KACH;IACK,GAAG,CAAC,OAAO;;YACf,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,GAAG,OAAO,CAAC;YAErC,MAAM,QAAQ,GAAG,MAAM,0BAAU,CAAC,WAAW,CAAiB;gBAC5D,MAAM,EAAE,0BAAU,CAAC,MAAM;gBACzB,GAAG,EAAE,GAAG,mBAAY,UAAU,UAAU,CAAC,MAAM,EAAE;gBACjD,OAAO,EAAE;oBACP,aAAa,EAAE,UAAU,IAAI,CAAC,WAAW,EAAE;oBAC3C,cAAc,EAAE,kBAAkB;iBACnC;aACF,CAAC,CAAC;YAEH,OAAO,QAAQ,CAAC,IAAI,CAAC;QACvB,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -0,0 +1,7 @@
1
+ export declare const getLink: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").SecretTextProperty<true>, {
2
+ lookupMethod: import("@activepieces/pieces-framework").StaticDropdownProperty<string, true>;
3
+ linkId: import("@activepieces/pieces-framework").ShortTextProperty<false>;
4
+ externalId: import("@activepieces/pieces-framework").ShortTextProperty<false>;
5
+ domain: import("@activepieces/pieces-framework").ShortTextProperty<false>;
6
+ key: import("@activepieces/pieces-framework").ShortTextProperty<false>;
7
+ }>;
@@ -0,0 +1,84 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getLink = 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
+ exports.getLink = (0, pieces_framework_1.createAction)({
9
+ name: 'get_link',
10
+ displayName: 'Get Link',
11
+ description: 'Retrieve details of a specific Dub link by its ID, external ID, or domain + key.',
12
+ auth: auth_1.dubAuth,
13
+ props: {
14
+ lookupMethod: pieces_framework_1.Property.StaticDropdown({
15
+ displayName: 'Look Up By',
16
+ description: 'How to identify the link you want to retrieve.',
17
+ required: true,
18
+ defaultValue: 'linkId',
19
+ options: {
20
+ options: [
21
+ { label: 'Link ID', value: 'linkId' },
22
+ { label: 'External ID', value: 'externalId' },
23
+ { label: 'Domain + Key', value: 'domainKey' },
24
+ ],
25
+ },
26
+ }),
27
+ linkId: pieces_framework_1.Property.ShortText({
28
+ displayName: 'Link ID',
29
+ description: 'The Dub-generated link ID (e.g. `clv3g2...`). Used when Look Up By = Link ID.',
30
+ required: false,
31
+ }),
32
+ externalId: pieces_framework_1.Property.ShortText({
33
+ displayName: 'External ID',
34
+ description: 'Your internal ID for the link. Pass with prefix `ext_` (e.g. `ext_123456`). Used when Look Up By = External ID.',
35
+ required: false,
36
+ }),
37
+ domain: pieces_framework_1.Property.ShortText({
38
+ displayName: 'Domain',
39
+ description: 'The domain of the link (e.g. `dub.sh`). Used when Look Up By = Domain + Key.',
40
+ required: false,
41
+ }),
42
+ key: pieces_framework_1.Property.ShortText({
43
+ displayName: 'Key (Slug)',
44
+ description: 'The slug of the link (e.g. `my-promo`). Used when Look Up By = Domain + Key.',
45
+ required: false,
46
+ }),
47
+ },
48
+ run(context) {
49
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
50
+ const { auth, propsValue } = context;
51
+ const { lookupMethod, linkId, externalId, domain, key } = propsValue;
52
+ let url;
53
+ switch (lookupMethod) {
54
+ case 'linkId':
55
+ if (!linkId)
56
+ throw new Error('Link ID is required when Look Up By = Link ID.');
57
+ url = `${auth_1.DUB_API_BASE}/links/${linkId}`;
58
+ break;
59
+ case 'externalId':
60
+ if (!externalId)
61
+ throw new Error('External ID is required when Look Up By = External ID.');
62
+ url = `${auth_1.DUB_API_BASE}/links/info?externalId=${encodeURIComponent(externalId)}`;
63
+ break;
64
+ case 'domainKey':
65
+ if (!domain || !key)
66
+ throw new Error('Both Domain and Key are required when Look Up By = Domain + Key.');
67
+ url = `${auth_1.DUB_API_BASE}/links/info?domain=${encodeURIComponent(domain)}&key=${encodeURIComponent(key)}`;
68
+ break;
69
+ default:
70
+ throw new Error(`Unsupported lookup method: ${lookupMethod}`);
71
+ }
72
+ const response = yield pieces_common_1.httpClient.sendRequest({
73
+ method: pieces_common_1.HttpMethod.GET,
74
+ url,
75
+ headers: {
76
+ Authorization: `Bearer ${auth.secret_text}`,
77
+ 'Content-Type': 'application/json',
78
+ },
79
+ });
80
+ return response.body;
81
+ });
82
+ },
83
+ });
84
+ //# sourceMappingURL=get-link.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-link.js","sourceRoot":"","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