@activepieces/piece-scrapeless 0.1.5 → 0.1.6

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.
Files changed (41) hide show
  1. package/package.json +7 -13
  2. package/src/index.js +75 -40
  3. package/src/index.d.ts +0 -2
  4. package/src/index.d.ts.map +0 -1
  5. package/src/index.js.map +0 -1
  6. package/src/lib/actions/crawl-crawl.d.ts +0 -5
  7. package/src/lib/actions/crawl-crawl.d.ts.map +0 -1
  8. package/src/lib/actions/crawl-crawl.js +0 -71
  9. package/src/lib/actions/crawl-crawl.js.map +0 -1
  10. package/src/lib/actions/crawl-scrape.d.ts +0 -4
  11. package/src/lib/actions/crawl-scrape.d.ts.map +0 -1
  12. package/src/lib/actions/crawl-scrape.js +0 -63
  13. package/src/lib/actions/crawl-scrape.js.map +0 -1
  14. package/src/lib/actions/google-search-api.d.ts +0 -6
  15. package/src/lib/actions/google-search-api.d.ts.map +0 -1
  16. package/src/lib/actions/google-search-api.js +0 -77
  17. package/src/lib/actions/google-search-api.js.map +0 -1
  18. package/src/lib/actions/google-trends-api.d.ts +0 -8
  19. package/src/lib/actions/google-trends-api.d.ts.map +0 -1
  20. package/src/lib/actions/google-trends-api.js +0 -95
  21. package/src/lib/actions/google-trends-api.js.map +0 -1
  22. package/src/lib/actions/universal-scraping-api.d.ts +0 -9
  23. package/src/lib/actions/universal-scraping-api.d.ts.map +0 -1
  24. package/src/lib/actions/universal-scraping-api.js +0 -84
  25. package/src/lib/actions/universal-scraping-api.js.map +0 -1
  26. package/src/lib/auth.d.ts +0 -2
  27. package/src/lib/auth.d.ts.map +0 -1
  28. package/src/lib/auth.js +0 -46
  29. package/src/lib/auth.js.map +0 -1
  30. package/src/lib/constants/index.d.ts +0 -9
  31. package/src/lib/constants/index.d.ts.map +0 -1
  32. package/src/lib/constants/index.js +0 -672
  33. package/src/lib/constants/index.js.map +0 -1
  34. package/src/lib/services/scrapeless-api-client.d.ts +0 -3
  35. package/src/lib/services/scrapeless-api-client.d.ts.map +0 -1
  36. package/src/lib/services/scrapeless-api-client.js +0 -11
  37. package/src/lib/services/scrapeless-api-client.js.map +0 -1
  38. package/src/lib/utils/validator.d.ts +0 -5
  39. package/src/lib/utils/validator.d.ts.map +0 -1
  40. package/src/lib/utils/validator.js +0 -34
  41. package/src/lib/utils/validator.js.map +0 -1
package/src/index.d.ts DELETED
@@ -1,2 +0,0 @@
1
- export declare const scrapeless: import("@activepieces/pieces-framework").Piece<import("@activepieces/pieces-framework").SecretTextProperty<true>>;
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,UAAU,mHA0BrB,CAAC"}
package/src/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AAExE,uEAAkE;AAClE,6DAA4D;AAC5D,2DAA0D;AAC1D,uEAAkE;AAClE,iFAA4E;AAC5E,+DAAwE;AACxE,iDAAqD;AACrD,qCAA+C;AAElC,QAAA,UAAU,GAAG,IAAA,8BAAW,EAAC;IACpC,WAAW,EAAE,YAAY;IACzB,WAAW,EACT,sGAAsG;IACxG,IAAI,EAAE,wBAAiB;IACvB,uBAAuB,EAAE,QAAQ;IACjC,OAAO,EAAE,oDAAoD;IAC7D,UAAU,EAAC,CAAC,sBAAa,CAAC,YAAY,CAAC;IACvC,OAAO,EAAE,CAAC,WAAW,CAAC;IACtB,OAAO,EAAE;QACP,mCAAe;QACf,6BAAc;QACd,2BAAa;QACb,mCAAe;QACf,6CAAoB;QACpB,IAAA,yCAAyB,EAAC;YACxB,IAAI,EAAC,wBAAiB;YACtB,OAAO,EAAC,GAAE,EAAE,CAAA,mCAAmC;YAC/C,WAAW,EAAC,CAAM,IAAI,EAAC,EAAE;gBACvB,OAAM;oBACJ,aAAa,EAAC,IAAI,CAAC,WAAW;iBAC/B,CAAA;YACH,CAAC,CAAA;SACF,CAAC;KACH;IACD,QAAQ,EAAE,EAAE;CACb,CAAC,CAAC"}
@@ -1,5 +0,0 @@
1
- export declare const crawlCrawlApi: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").SecretTextProperty<true>, {
2
- url: import("@activepieces/pieces-framework").ShortTextProperty<true>;
3
- limit: import("@activepieces/pieces-framework").NumberProperty<true>;
4
- }>;
5
- //# sourceMappingURL=crawl-crawl.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"crawl-crawl.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/crawl-crawl.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,aAAa;;;EAgExB,CAAC"}
@@ -1,71 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.crawlCrawlApi = void 0;
4
- const tslib_1 = require("tslib");
5
- const auth_1 = require("../auth");
6
- const pieces_framework_1 = require("@activepieces/pieces-framework");
7
- const scrapeless_api_client_1 = require("../services/scrapeless-api-client");
8
- exports.crawlCrawlApi = (0, pieces_framework_1.createAction)({
9
- auth: auth_1.scrapelessApiAuth,
10
- name: 'crawl_crawl',
11
- displayName: 'Crawl Data from All Pages',
12
- description: 'Crawls a website and its linked pages to extract comprehensive data.',
13
- audience: 'both',
14
- aiMetadata: { description: 'Crawls a website starting from the given URL, following linked subpages up to a configurable page limit, and returns the extracted content from all visited pages. Choose this when you need data across multiple pages of a site rather than a single page (use the scrape action for one page). Requires a starting URL and a subpage limit; read-only and idempotent with no side effects.', idempotent: true },
15
- props: {
16
- url: pieces_framework_1.Property.ShortText({
17
- displayName: 'URL to Crawl',
18
- description: 'The URL of the webpage to crawl.',
19
- required: true,
20
- }),
21
- limit: pieces_framework_1.Property.Number({
22
- displayName: 'Limit',
23
- description: 'Number Of Subpages',
24
- required: true,
25
- defaultValue: 5,
26
- })
27
- },
28
- run(_a) {
29
- return tslib_1.__awaiter(this, arguments, void 0, function* ({ propsValue, auth }) {
30
- try {
31
- const client = (0, scrapeless_api_client_1.createScrapelessClient)(auth.secret_text);
32
- const url = propsValue.url;
33
- const limit = propsValue.limit;
34
- const browserOptions = {
35
- "proxy_country": "ANY",
36
- "session_name": "Crawl",
37
- "session_recording": true,
38
- "session_ttl": 900,
39
- };
40
- const response = yield client.scrapingCrawl.crawl.crawlUrl(url, {
41
- browserOptions,
42
- limit
43
- });
44
- if (response.status === 'completed' && response.data) {
45
- return {
46
- success: true,
47
- data: response.data || null,
48
- };
49
- }
50
- else {
51
- return {
52
- success: false,
53
- error: 'Scraping failed',
54
- error_type: 'ScrapingFailed',
55
- timestamp: new Date().toISOString(),
56
- };
57
- }
58
- }
59
- catch (error) {
60
- const errorMessage = error instanceof Error ? error.message : 'Unknown error occurred';
61
- return {
62
- success: false,
63
- error: errorMessage,
64
- error_type: error instanceof Error ? error.constructor.name : 'UnknownError',
65
- timestamp: new Date().toISOString(),
66
- };
67
- }
68
- });
69
- },
70
- });
71
- //# sourceMappingURL=crawl-crawl.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"crawl-crawl.js","sourceRoot":"","sources":["../../../../src/lib/actions/crawl-crawl.ts"],"names":[],"mappings":";;;;AAAA,kCAA4C;AAC5C,qEAAwE;AACxE,6EAA2E;AAE9D,QAAA,aAAa,GAAG,IAAA,+BAAY,EAAC;IACxC,IAAI,EAAE,wBAAiB;IACvB,IAAI,EAAE,aAAa;IACnB,WAAW,EAAE,2BAA2B;IACxC,WAAW,EAAE,sEAAsE;IACnF,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE,EAAE,WAAW,EAAE,+XAA+X,EAAE,UAAU,EAAE,IAAI,EAAE;IAC9a,KAAK,EAAE;QACL,GAAG,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACtB,WAAW,EAAE,cAAc;YAC3B,WAAW,EAAE,kCAAkC;YAC/C,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,KAA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O,EAAE,KAAK;oBACd,KAAK,EAAE,YAAY;oBACnB,UAAU,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,cAAc;oBAC5E,SAAS,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;iBACpC,CAAC;YACJ,CAAC;QACH,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -1,4 +0,0 @@
1
- export declare const crawlScrapeApi: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").SecretTextProperty<true>, {
2
- url: import("@activepieces/pieces-framework").ShortTextProperty<true>;
3
- }>;
4
- //# sourceMappingURL=crawl-scrape.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"crawl-scrape.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/crawl-scrape.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,cAAc;;EAyDzB,CAAC"}
@@ -1,63 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.crawlScrapeApi = void 0;
4
- const tslib_1 = require("tslib");
5
- const pieces_framework_1 = require("@activepieces/pieces-framework");
6
- const auth_1 = require("../auth");
7
- const scrapeless_api_client_1 = require("../services/scrapeless-api-client");
8
- exports.crawlScrapeApi = (0, pieces_framework_1.createAction)({
9
- auth: auth_1.scrapelessApiAuth,
10
- name: 'crawl_scrape',
11
- displayName: 'Scrape Webpage Data',
12
- description: 'Extracts data from a single webpage.',
13
- audience: 'both',
14
- aiMetadata: { description: 'Scrapes a single webpage at the given URL via Scrapeless and returns its extracted content. Choose this when you need the data from one specific page; for following links across a whole site use the crawl action instead. Requires a target URL; read-only and idempotent (no side effects, though live page content may change between calls).', idempotent: true },
15
- props: {
16
- url: pieces_framework_1.Property.ShortText({
17
- displayName: 'URL to Crawl',
18
- description: 'The URL of the webpage to scrape.',
19
- required: true,
20
- })
21
- },
22
- run(_a) {
23
- return tslib_1.__awaiter(this, arguments, void 0, function* ({ propsValue, auth }) {
24
- try {
25
- const client = (0, scrapeless_api_client_1.createScrapelessClient)(auth.secret_text);
26
- const url = propsValue.url;
27
- const browserOptions = {
28
- "proxy_country": "ANY",
29
- "session_name": "Crawl",
30
- "session_recording": true,
31
- "session_ttl": 900,
32
- };
33
- const response = yield client.scrapingCrawl.scrape.scrapeUrl(url, {
34
- browserOptions
35
- });
36
- if (response.status === 'completed' && response.data) {
37
- return {
38
- success: true,
39
- data: response.data || null,
40
- };
41
- }
42
- else {
43
- return {
44
- success: false,
45
- error: 'Scraping failed',
46
- error_type: 'ScrapingFailed',
47
- timestamp: new Date().toISOString(),
48
- };
49
- }
50
- }
51
- catch (error) {
52
- const errorMessage = error instanceof Error ? error.message : 'Unknown error occurred';
53
- return {
54
- success: false,
55
- error: errorMessage,
56
- error_type: error instanceof Error ? error.constructor.name : 'UnknownError',
57
- timestamp: new Date().toISOString(),
58
- };
59
- }
60
- });
61
- },
62
- });
63
- //# sourceMappingURL=crawl-scrape.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"crawl-scrape.js","sourceRoot":"","sources":["../../../../src/lib/actions/crawl-scrape.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,kCAA4C;AAC5C,6EAA2E;AAE9D,QAAA,cAAc,GAAG,IAAA,+BAAY,EAAC;IACzC,IAAI,EAAE,wBAAiB;IACvB,IAAI,EAAE,cAAc;IACpB,WAAW,EAAE,qBAAqB;IAClC,WAAW,EAAE,sCAAsC;IACnD,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE,EAAE,WAAW,EAAE,oVAAoV,EAAE,UAAU,EAAE,IAAI,EAAE;IAGnY,KAAK,EAAE;QACL,GAAG,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACtB,WAAW,EAAE,cAAc;YAC3B,WAAW,EAAE,mCAAmC;YAChD,QAAQ,EAAE,IAAI;SACf,CAAC;KACH;IACK,GAAG;qEAAC,EAAE,UAAU,EAAE,IAAI,E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AC"}
@@ -1,6 +0,0 @@
1
- export declare const googleSearchApi: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").SecretTextProperty<true>, {
2
- q: import("@activepieces/pieces-framework").ShortTextProperty<true>;
3
- hl: import("@activepieces/pieces-framework").ShortTextProperty<false>;
4
- gl: import("@activepieces/pieces-framework").ShortTextProperty<false>;
5
- }>;
6
- //# sourceMappingURL=google-search-api.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"google-search-api.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/google-search-api.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,eAAe;;;;EAyE1B,CAAC"}
@@ -1,77 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.googleSearchApi = void 0;
4
- const tslib_1 = require("tslib");
5
- const pieces_framework_1 = require("@activepieces/pieces-framework");
6
- const auth_1 = require("../auth");
7
- const scrapeless_api_client_1 = require("../services/scrapeless-api-client");
8
- exports.googleSearchApi = (0, pieces_framework_1.createAction)({
9
- auth: auth_1.scrapelessApiAuth,
10
- name: 'google_search_api',
11
- displayName: 'Google Search',
12
- description: 'Retrieves search result data for any query.',
13
- audience: 'both',
14
- aiMetadata: { description: 'Runs a Google web search through Scrapeless and returns the structured results (organic listings, etc.) for a given query. Choose this to programmatically fetch live Google search results when you need ranked web matches rather than scraping a specific page; supports Google advanced operators (site:, inurl:, intitle:) inside the query and optional language/country localization. Read-only and idempotent: the same query returns the same results with no side effects.', idempotent: true },
15
- props: {
16
- q: pieces_framework_1.Property.ShortText({
17
- displayName: 'Search Query',
18
- description: 'Parameter defines the query you want to search. You can use anything that you would use in a regular Google search. e.g. inurl:, site:, intitle:. We also support advanced search query parameters such as as_dt and as_eq.',
19
- defaultValue: 'coffee',
20
- required: true,
21
- }),
22
- hl: pieces_framework_1.Property.ShortText({
23
- displayName: 'Language',
24
- description: "Parameter defines the language to use for the Google search. It's a two-letter language code. (e.g., en for English, es for Spanish, or fr for French).",
25
- defaultValue: 'en',
26
- required: false,
27
- }),
28
- gl: pieces_framework_1.Property.ShortText({
29
- displayName: 'Country',
30
- description: "Parameter defines the country to use for the Google search. It's a two-letter country code. (e.g., us for the United States, uk for United Kingdom, or fr for France).",
31
- defaultValue: 'us',
32
- required: false,
33
- }),
34
- },
35
- run(_a) {
36
- return tslib_1.__awaiter(this, arguments, void 0, function* ({ propsValue, auth }) {
37
- try {
38
- const client = (0, scrapeless_api_client_1.createScrapelessClient)(auth.secret_text);
39
- const input = {
40
- q: propsValue.q,
41
- hl: propsValue.hl,
42
- gl: propsValue.gl,
43
- };
44
- const response = yield client.deepserp.createTask({
45
- actor: 'scraper.google.search',
46
- input,
47
- });
48
- if (response.status === 200) {
49
- return {
50
- success: true,
51
- data: response.data || null,
52
- };
53
- }
54
- while (true) {
55
- yield new Promise(resolve => setTimeout(resolve, 1000));
56
- const result = yield client.deepserp.getTaskResult(response.data.taskId);
57
- if (result.status === 200) {
58
- return {
59
- success: true,
60
- data: result.data || null,
61
- };
62
- }
63
- }
64
- }
65
- catch (error) {
66
- const errorMessage = error instanceof Error ? error.message : 'Unknown error occurred';
67
- return {
68
- success: false,
69
- error: errorMessage,
70
- error_type: error instanceof Error ? error.constructor.name : 'UnknownError',
71
- timestamp: new Date().toISOString(),
72
- };
73
- }
74
- });
75
- },
76
- });
77
- //# sourceMappingURL=google-search-api.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"google-search-api.js","sourceRoot":"","sources":["../../../../src/lib/actions/google-search-api.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,kCAA4C;AAC5C,6EAA2E;AAE9D,QAAA,eAAe,GAAG,IAAA,+BAAY,EAAC;IAC1C,IAAI,EAAE,wBAAiB;IACvB,IAAI,EAAE,mBAAmB;IACzB,WAAW,EAAE,eAAe;IAC5B,WAAW,EAAE,6CAA6C;IAC1D,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE,EAAE,WAAW,EAAE,sdAAsd,E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AC,CAAC,CAAC;oBACxD,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,QAAQ,CAAC,aAAa,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;oBAEzE,IAAI,MAAM,CAAC,MAAM,KAAK,GAAG,EAAE,CAAC;wBAC1B,OAAO;4BACL,OAAO,EAAE,IAAI;4BACb,IAAI,EAAE,MAAM,CAAC,IAAI,IAAI,IAAI;yBAC1B,CAAA;oBACH,CAAC;gBACH,CAAC;YACH,CAAC;YAAC,OAAO,KAAc,EAAE,CAAC;gBACxB,MAAM,YAAY,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,wBAAwB,CAAC;gBAEvF,OAAO;oBACL,OAAO,EAAE,KAAK;oBACd,KAAK,EAAE,YAAY;oBACnB,UAAU,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,cAAc;oBAC5E,SAAS,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;iBACpC,CAAC;YACJ,CAAC;QACH,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -1,8 +0,0 @@
1
- export declare const googleTrendsApi: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").SecretTextProperty<true>, {
2
- q: import("@activepieces/pieces-framework").ShortTextProperty<true>;
3
- data_type: import("@activepieces/pieces-framework").StaticDropdownProperty<string, true>;
4
- date: import("@activepieces/pieces-framework").ShortTextProperty<true>;
5
- hl: import("@activepieces/pieces-framework").ShortTextProperty<false>;
6
- tz: import("@activepieces/pieces-framework").ShortTextProperty<false>;
7
- }>;
8
- //# sourceMappingURL=google-trends-api.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"google-trends-api.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/google-trends-api.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,eAAe;;;;;;EA4F1B,CAAC"}
@@ -1,95 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.googleTrendsApi = void 0;
4
- const tslib_1 = require("tslib");
5
- const auth_1 = require("../auth");
6
- const pieces_framework_1 = require("@activepieces/pieces-framework");
7
- const constants_1 = require("../constants");
8
- const scrapeless_api_client_1 = require("../services/scrapeless-api-client");
9
- exports.googleTrendsApi = (0, pieces_framework_1.createAction)({
10
- auth: auth_1.scrapelessApiAuth,
11
- name: 'google_trends_api',
12
- displayName: 'Google Trends',
13
- description: 'Access popular keyword and interest data from Google Trends.',
14
- audience: 'both',
15
- aiMetadata: { description: 'Fetches Google Trends data for one or more keywords via Scrapeless, with the data type selecting what to return (e.g. interest over time, compared breakdown by region, related queries). Choose this to analyze keyword popularity or interest trends over a date range. Note that interest_over_time and compared_breakdown_by_region accept up to 5 comma-separated queries while other data types accept only one. Read-only and idempotent with no side effects.', idempotent: true },
16
- props: {
17
- q: pieces_framework_1.Property.ShortText({
18
- displayName: 'Search Query',
19
- description: 'Parameter defines the query or queries you want to search. You can use anything that you would use in a regular Google Trends search. The maximum number of queries per search is 5 (this only applies to `interest_over_time` and `compared_breakdown_by_region` data_type, other types of data will only accept 1 query per search).',
20
- defaultValue: 'Mercedes-Benz,BMW X5',
21
- required: true,
22
- }),
23
- data_type: pieces_framework_1.Property.StaticDropdown({
24
- displayName: 'Data Type',
25
- description: 'Parameter defines the type of data you want to search. You can use anything that you would use in a regular Google Trends search. The maximum number of queries per search is 5 (this only applies to `interest_over_time` and `compared_breakdown_by_region` data_type, other types of data will only accept 1 query per search).',
26
- required: true,
27
- defaultValue: 'interest_over_time',
28
- options: {
29
- options: constants_1.googleTrendsDataTypeOptions,
30
- },
31
- }),
32
- date: pieces_framework_1.Property.ShortText({
33
- displayName: 'Date',
34
- description: "The supported dates are: `now 1-H`, `now 4-H`, `now 1-d`, `now 7-d`, `today 1-m`, `today 3-m`, `today 12-m`, `today 5-y`, `all`.You can also pass custom values:Dates from 2004 to present: `yyyy-mm-dd yyyy-mm-dd` (e.g. `2021-10-15 2022-05-25`)\nDates with hours within a week range: `yyyy-mm-ddThh yyyy-mm-ddThh` (e.g. `2022-05-19T10 2022-05-24T22`). Hours will be calculated depending on the tz (time zone) parameter.",
35
- required: true,
36
- defaultValue: 'today 1-m',
37
- }),
38
- hl: pieces_framework_1.Property.ShortText({
39
- displayName: 'Language',
40
- description: "Parameter defines the language to use for the Google Trends search. It's a two-letter language code. (e.g., `en` for English, `es` for Spanish, or `fr` for French).",
41
- required: false,
42
- defaultValue: 'en',
43
- }),
44
- tz: pieces_framework_1.Property.ShortText({
45
- displayName: 'Time zone',
46
- description: "time zone offset. default is `420`.",
47
- required: false,
48
- defaultValue: '420',
49
- }),
50
- },
51
- run(_a) {
52
- return tslib_1.__awaiter(this, arguments, void 0, function* ({ propsValue, auth }) {
53
- try {
54
- const client = (0, scrapeless_api_client_1.createScrapelessClient)(auth.secret_text);
55
- const input = {
56
- q: propsValue.q,
57
- data_type: propsValue.data_type,
58
- date: propsValue.date,
59
- hl: propsValue.hl,
60
- tz: propsValue.tz,
61
- };
62
- const response = yield client.deepserp.createTask({
63
- actor: 'scraper.google.trends',
64
- input,
65
- });
66
- if (response.status === 200) {
67
- return {
68
- success: true,
69
- data: response.data || null,
70
- };
71
- }
72
- while (true) {
73
- yield new Promise(resolve => setTimeout(resolve, 1000));
74
- const result = yield client.deepserp.getTaskResult(response.data.taskId);
75
- if (result.status === 200) {
76
- return {
77
- success: true,
78
- data: result.data || null,
79
- };
80
- }
81
- }
82
- }
83
- catch (error) {
84
- const errorMessage = error instanceof Error ? error.message : 'Unknown error occurred';
85
- return {
86
- success: false,
87
- error: errorMessage,
88
- error_type: error instanceof Error ? error.constructor.name : 'UnknownError',
89
- timestamp: new Date().toISOString(),
90
- };
91
- }
92
- });
93
- },
94
- });
95
- //# sourceMappingURL=google-trends-api.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"google-trends-api.js","source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gBAEvF,OAAO;oBACL,OAAO,EAAE,KAAK;oBACd,KAAK,EAAE,YAAY;oBACnB,UAAU,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,cAAc;oBAC5E,SAAS,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;iBACpC,CAAC;YACJ,CAAC;QACH,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -1,9 +0,0 @@
1
- export declare const universalScrapingApi: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").SecretTextProperty<true>, {
2
- url: import("@activepieces/pieces-framework").ShortTextProperty<true>;
3
- js_render: import("@activepieces/pieces-framework").CheckboxProperty<false>;
4
- headless: import("@activepieces/pieces-framework").CheckboxProperty<false>;
5
- country: import("@activepieces/pieces-framework").StaticDropdownProperty<string, false>;
6
- js_instructions: import("@activepieces/pieces-framework").JsonProperty<false>;
7
- block: import("@activepieces/pieces-framework").JsonProperty<false>;
8
- }>;
9
- //# sourceMappingURL=universal-scraping-api.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"universal-scraping-api.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/universal-scraping-api.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,oBAAoB;;;;;;;EA6E/B,CAAC"}
@@ -1,84 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.universalScrapingApi = void 0;
4
- const tslib_1 = require("tslib");
5
- const pieces_framework_1 = require("@activepieces/pieces-framework");
6
- const auth_1 = require("../auth");
7
- const constants_1 = require("../constants");
8
- const scrapeless_api_client_1 = require("../services/scrapeless-api-client");
9
- exports.universalScrapingApi = (0, pieces_framework_1.createAction)({
10
- auth: auth_1.scrapelessApiAuth,
11
- name: 'universal_scraping_api',
12
- displayName: 'Universal Scraping',
13
- description: 'Seamlessly accesses protected or dynamic pages by handling anti-scraping systems automatically.',
14
- audience: 'both',
15
- aiMetadata: { description: 'Scrapes a target URL through Scrapeless\'s web unlocker, which automatically bypasses anti-bot/anti-scraping protections and can render JavaScript-heavy pages headlessly via a chosen proxy country. Choose this over the basic scrape action when the page is protected, dynamic, or blocks ordinary scrapers; optional JS instructions and resource-blocking rules tune the render. Requires a target URL; read-only and idempotent with no side effects.', idempotent: true },
16
- props: {
17
- url: pieces_framework_1.Property.ShortText({
18
- displayName: 'Target URL',
19
- required: true,
20
- }),
21
- js_render: pieces_framework_1.Property.Checkbox({
22
- displayName: 'Js Render',
23
- required: false,
24
- defaultValue: true,
25
- }),
26
- headless: pieces_framework_1.Property.Checkbox({
27
- displayName: 'Headless',
28
- required: false,
29
- defaultValue: true,
30
- }),
31
- country: pieces_framework_1.Property.StaticDropdown({
32
- displayName: 'Country',
33
- required: false,
34
- defaultValue: 'ANY',
35
- options: {
36
- options: constants_1.proxyCountryOptions,
37
- },
38
- }),
39
- js_instructions: pieces_framework_1.Property.Json({
40
- displayName: 'Js Instructions',
41
- required: false,
42
- defaultValue: [{ "wait": 1000 }],
43
- }),
44
- block: pieces_framework_1.Property.Json({
45
- displayName: 'Block',
46
- required: false,
47
- defaultValue: { "resources": ["image", "font", "script"], "urls": ["https://example.com"] },
48
- }),
49
- },
50
- run(_a) {
51
- return tslib_1.__awaiter(this, arguments, void 0, function* ({ propsValue, auth }) {
52
- try {
53
- const client = (0, scrapeless_api_client_1.createScrapelessClient)(auth.secret_text);
54
- const input = {
55
- url: propsValue.url,
56
- js_render: propsValue.js_render,
57
- headless: propsValue.headless,
58
- js_instructions: propsValue.js_instructions,
59
- block: propsValue.block,
60
- };
61
- const proxy = {
62
- country: propsValue.country,
63
- };
64
- const response = yield client.universal.scrape({
65
- actor: 'unlocker.webunlocker',
66
- input,
67
- proxy,
68
- });
69
- return {
70
- success: true,
71
- data: response || null,
72
- };
73
- }
74
- catch (error) {
75
- const errorMessage = error instanceof Error ? error.message : 'Unknown error occurred';
76
- return {
77
- success: false,
78
- error: errorMessage,
79
- };
80
- }
81
- });
82
- },
83
- });
84
- //# sourceMappingURL=universal-scraping-api.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"universal-scraping-api.js","sourceRoot":"","sources":["../../../../src/lib/actions/universal-scraping-api.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,kCAA4C;AAC5C,4CAAmD;AACnD,6EAA2E;AAE9D,QAAA,oBAAoB,GAAG,IAAA,+BAAY,EAAC;IAC/C,IAAI,EAAE,wBAAiB;IACvB,IAAI,EAAE,wBAAwB;IAC9B,WAAW,EAAE,oBAAoB;IACjC,WAAW,EAAE,iGAAiG;IAC9G,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE,EAAE,WAAW,EAAE,8bAA8b,EAAE,UAAU,EAAE,IAAI,EAAE;IAC7e,KAAK,EAAE;QACL,GAAG,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACtB,WAAW,EAAE,YAAY;YACzB,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,SAAS,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YAC3B,WAAW,EAAE,WAAW;YACxB,QAAQ,EAAE,KAAK;YACf,YAAY,EAAE,IAAI;SACnB,CAAC;QACF,QAAQ,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YAC1B,WAAW,EAAE,UAAU;YACvB,QAAQ,EAAE,KAAK;YACf,YAAY,EAAE,IAAI;SACnB,CAAC;QACF,OAAO,EAAE,2BAAQ,CAAC,cAAc,CAAC;YAC/B,WAAW,EAAE,SAAS;YACtB,QAAQ,EAAE,KAAK;YACf,YAAY,EAAE,KAAK;YACnB,OAAO,EAAE;gBACP,OAAO,EAAE,+BAAmB;aAC7B;SACF,CAAC;QACF,eAAe,EAAE,2BAAQ,CAAC,IAAI,CAAC;YAC7B,WAAW,EAAE,iBAAiB;YAC9B,QAAQ,EAAE,KAAK;YACf,YAAY,EAAE,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;SACjC,CAAC;QACF,KAAK,E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ApiAuth: import("@activepieces/pieces-framework").SecretTextProperty<true>;
2
- //# sourceMappingURL=auth.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../../src/lib/auth.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,iBAAiB,mEAyC5B,CAAC"}
package/src/lib/auth.js DELETED
@@ -1,46 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.scrapelessApiAuth = void 0;
4
- const tslib_1 = require("tslib");
5
- const pieces_framework_1 = require("@activepieces/pieces-framework");
6
- const validator_1 = require("./utils/validator");
7
- exports.scrapelessApiAuth = pieces_framework_1.PieceAuth.SecretText({
8
- displayName: 'API Key',
9
- description: `You can obtain your API key from [Dashboard](https://app.scrapeless.com).`,
10
- required: true,
11
- validate: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth }) {
12
- try {
13
- // Validate API key format first
14
- const formatValidation = yield validator_1.ScrapelessValidator.validateApiKey(auth);
15
- if (!formatValidation.isValid) {
16
- return {
17
- valid: false,
18
- error: `${formatValidation.errors.join(', ')}`,
19
- };
20
- }
21
- return {
22
- valid: true,
23
- };
24
- }
25
- catch (error) {
26
- const errorMessage = error instanceof Error ? error.message : 'Unknown error occurred';
27
- if (errorMessage.includes('timeout')) {
28
- return {
29
- valid: false,
30
- error: 'API validation timed out. Please check your network connection and try again.',
31
- };
32
- }
33
- if (errorMessage.includes('network') || errorMessage.includes('ENOTFOUND')) {
34
- return {
35
- valid: false,
36
- error: 'Network error occurred. Please check your internet connection.',
37
- };
38
- }
39
- return {
40
- valid: false,
41
- error: `API key validation failed: ${errorMessage}`,
42
- };
43
- }
44
- }),
45
- });
46
- //# sourceMappingURL=auth.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"auth.js","sourceRoot":"","sources":["../../../src/lib/auth.ts"],"names":[],"mappings":";;;;AAAA,qEAA2D;AAC3D,iDAAwD;AAE3C,QAAA,iBAAiB,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declare const proxyCountryOptions: {
6
- label: string;
7
- value: string;
8
- }[];
9
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/constants/index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,2BAA2B;;;GAyBvC,CAAC;AAEF,eAAO,MAAM,mBAAmB;;;GAioB/B,CAAC"}