Skip to content

Commit ed9c6eb

Browse files
authored
fix: minor issues (#45)
* chore: copy changes * fix: remove crypto import, prettier fix * fix: scrape single url name * fix: remove default ids * chore: json input field placement
1 parent 79ad687 commit ed9c6eb

File tree

10 files changed

+53
-58
lines changed

10 files changed

+53
-58
lines changed

nodes/Apify/resources/actor-runs/get-run/properties.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export const properties: INodeProperties[] = [
2020
displayName: 'Run ID',
2121
name: 'runId',
2222
required: true,
23-
default: '3KH8gEpp4d8uQSe8T',
23+
default: '',
2424
type: 'string',
2525
displayOptions: {
2626
show: {

nodes/Apify/resources/actor-tasks/run-task/properties.ts

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,34 @@ export const properties: INodeProperties[] = [
3030
},
3131
},
3232
},
33+
{
34+
displayName: 'Use Custom Body',
35+
name: 'useCustomBody',
36+
type: 'boolean',
37+
description: 'Whether to use a custom body',
38+
// default to false since Task should use task-defined input for its Actor
39+
default: false,
40+
displayOptions: {
41+
show: {
42+
resource: ['Actor tasks'],
43+
operation: ['Run task'],
44+
},
45+
},
46+
},
47+
{
48+
displayName: 'Input (JSON)',
49+
name: 'customBody',
50+
type: 'json',
51+
default: '{}',
52+
description: 'Custom body to send',
53+
displayOptions: {
54+
show: {
55+
useCustomBody: [true],
56+
resource: ['Actor tasks'],
57+
operation: ['Run task'],
58+
},
59+
},
60+
},
3361
{
3462
displayName: 'Wait for Finish',
3563
name: 'waitForFinish',

nodes/Apify/resources/actors/run-actor/properties.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,20 @@ export const properties: INodeProperties[] = [
4242
},
4343
},
4444
},
45+
{
46+
displayName: 'Input JSON',
47+
name: 'customBody',
48+
type: 'json',
49+
default: '{}',
50+
description:
51+
'Input for the Actor run. If empty, the run uses the input specified in the default run configuration.',
52+
displayOptions: {
53+
show: {
54+
resource: ['Actors'],
55+
operation: ['Run actor'],
56+
},
57+
},
58+
},
4559
{
4660
displayName: 'Timeout',
4761
name: 'timeout',

nodes/Apify/resources/actors/scrape-single-url/index.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,11 @@ import { runHooks } from './hooks';
66
export const scrapeSingleUrlName = 'Scrape single URL';
77

88
const rawOption: INodePropertyOptions = {
9-
name: scrapeSingleUrlName,
9+
name: 'Scrape Single URL',
1010
value: scrapeSingleUrlName,
1111
action: scrapeSingleUrlName,
12-
description: 'Scrape a single URL using the Apify Website Content Crawler Actor',
12+
description:
13+
'Scrape a single URL using the Apify Website Content Crawler Actor and get its content as text, markdown, and HTML',
1314
};
1415

1516
const { properties, option } = runHooks(rawOption, rawProperties);

nodes/Apify/resources/actors/scrape-single-url/properties.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export const properties: INodeProperties[] = [
44
{
55
displayName: 'URL',
66
name: 'url',
7-
description: 'URL to be scraped',
7+
description: 'URL to be scraped. Must start with http:// or https:// and be a valid URL.',
88
default: 'https://docs.apify.com/academy/web-scraping-for-beginners',
99
type: 'string',
1010
displayOptions: {

nodes/Apify/resources/datasets/get-items/properties.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export const properties: INodeProperties[] = [
2121
name: 'datasetId',
2222
required: true,
2323
description: 'Dataset ID or `username~dataset-name`',
24-
default: 'WkzbQMuFYuamGv3YF',
24+
default: '',
2525
type: 'string',
2626
displayOptions: {
2727
show: {

nodes/Apify/resources/genericFunctions.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import {
77
type ILoadOptionsFunctions,
88
type IRequestOptions,
99
} from 'n8n-workflow';
10-
import { createHash } from 'node:crypto';
1110

1211
type IApiRequestOptions = IRequestOptions & { uri?: string };
1312

@@ -144,10 +143,9 @@ export function generateIdempotencyKey(
144143
actorOrTaskId: string,
145144
eventTypes: string[],
146145
): string {
147-
const hash = createHash('sha256');
148-
const sortedEventTypes = eventTypes.sort();
149-
hash.update(`${resource}:${actorOrTaskId}:${sortedEventTypes.join(',')}`);
150-
return hash.digest('hex');
146+
const sortedEventTypes = [...eventTypes].sort();
147+
const raw = `${resource}:${actorOrTaskId}:${sortedEventTypes.join(',')}`;
148+
return Buffer.from(raw).toString('base64');
151149
}
152150

153151
export function compose(...fns: Function[]) {

nodes/Apify/resources/index.ts

Lines changed: 0 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -45,51 +45,6 @@ const resourceSelect: INodeProperties[] = [
4545
},
4646
];
4747

48-
// TODO: consider moving this to the operation specific properties
49-
const extraProperties: INodeProperties[] = [
50-
{
51-
displayName: 'Use Custom Body',
52-
name: 'useCustomBody',
53-
type: 'boolean',
54-
description: 'Whether to use a custom body',
55-
// default to false since Task should use task-defined input for its Actor
56-
default: false,
57-
displayOptions: {
58-
show: {
59-
resource: ['Actor tasks'],
60-
operation: ['Run task'],
61-
},
62-
},
63-
},
64-
{
65-
displayName: 'Override Default Input',
66-
name: 'customBody',
67-
type: 'json',
68-
default: '{}',
69-
description: 'Override default input for the Actor',
70-
displayOptions: {
71-
show: {
72-
resource: ['Actors'],
73-
operation: ['Run actor'],
74-
},
75-
},
76-
},
77-
{
78-
displayName: 'Input (JSON)',
79-
name: 'customBody',
80-
type: 'json',
81-
default: '{}',
82-
description: 'Custom body to send',
83-
displayOptions: {
84-
show: {
85-
useCustomBody: [true],
86-
resource: ['Actor tasks'],
87-
operation: ['Run task'],
88-
},
89-
},
90-
},
91-
];
92-
9348
const rawProperties: INodeProperties[] = [
9449
...authenticationProperties,
9550
...resourceSelect,
@@ -98,7 +53,6 @@ const rawProperties: INodeProperties[] = [
9853
...actorRuns.properties,
9954
...datasets.properties,
10055
...keyValueStores.properties,
101-
...extraProperties,
10256
];
10357

10458
const { properties, methods: selfMethods } = runHooks(rawProperties);

nodes/Apify/resources/key-value-stores/get-key-value-store-record/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const name = 'Get Key-Value Store Record';
88
const rawOption: INodePropertyOptions = {
99
name: name,
1010
value: name,
11-
action: name,
11+
action: 'Get key-value store record',
1212
description: 'Gets a value stored in the key-value store under a specific key',
1313
};
1414

nodes/Apify/resources/key-value-stores/get-key-value-store-record/properties.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export const properties: INodeProperties[] = [
2121
name: 'storeId',
2222
required: true,
2323
description: 'The ID of the Key-Value Store',
24-
default: 'dmXls2mjfQVdzfrC6',
24+
default: '',
2525
type: 'string',
2626
displayOptions: {
2727
show: {

0 commit comments

Comments
 (0)