apify-cli 1.0.0-beta.99 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +236 -84
- package/LICENSE.md +201 -0
- package/README.md +50 -535
- package/dist/.tsbuildinfo +1 -1
- package/dist/actor.js +3 -0
- package/dist/actor.js.map +1 -0
- package/dist/apify.js +3 -0
- package/dist/apify.js.map +1 -0
- package/dist/chunk-TJMCNXPV.js +242 -0
- package/dist/chunk-TJMCNXPV.js.map +1 -0
- package/dist/index.js +2 -3
- package/package.json +116 -89
- package/bin/dev.cmd +0 -3
- package/bin/dev.js +0 -21
- package/bin/dev.sh +0 -4
- package/bin/run.cmd +0 -3
- package/bin/run.js +0 -23
- package/dist/commands/actor/get-input.d.ts +0 -6
- package/dist/commands/actor/get-input.d.ts.map +0 -1
- package/dist/commands/actor/get-input.js +0 -14
- package/dist/commands/actor/get-input.js.map +0 -1
- package/dist/commands/actor/get-value.d.ts +0 -9
- package/dist/commands/actor/get-value.d.ts.map +0 -1
- package/dist/commands/actor/get-value.js +0 -27
- package/dist/commands/actor/get-value.js.map +0 -1
- package/dist/commands/actor/index.d.ts +0 -6
- package/dist/commands/actor/index.d.ts.map +0 -1
- package/dist/commands/actor/index.js +0 -13
- package/dist/commands/actor/index.js.map +0 -1
- package/dist/commands/actor/push-data.d.ts +0 -11
- package/dist/commands/actor/push-data.d.ts.map +0 -1
- package/dist/commands/actor/push-data.js +0 -56
- package/dist/commands/actor/push-data.js.map +0 -1
- package/dist/commands/actor/set-value.d.ts +0 -15
- package/dist/commands/actor/set-value.d.ts.map +0 -1
- package/dist/commands/actor/set-value.js +0 -76
- package/dist/commands/actor/set-value.js.map +0 -1
- package/dist/commands/call.d.ts +0 -16
- package/dist/commands/call.d.ts.map +0 -1
- package/dist/commands/call.js +0 -108
- package/dist/commands/call.js.map +0 -1
- package/dist/commands/check-version.d.ts +0 -11
- package/dist/commands/check-version.d.ts.map +0 -1
- package/dist/commands/check-version.js +0 -39
- package/dist/commands/check-version.js.map +0 -1
- package/dist/commands/create.d.ts +0 -15
- package/dist/commands/create.d.ts.map +0 -1
- package/dist/commands/create.js +0 -201
- package/dist/commands/create.js.map +0 -1
- package/dist/commands/edit-input-schema.d.ts +0 -11
- package/dist/commands/edit-input-schema.d.ts.map +0 -1
- package/dist/commands/edit-input-schema.js +0 -176
- package/dist/commands/edit-input-schema.js.map +0 -1
- package/dist/commands/info.d.ts +0 -6
- package/dist/commands/info.d.ts.map +0 -1
- package/dist/commands/info.js +0 -26
- package/dist/commands/info.js.map +0 -1
- package/dist/commands/init-wrap-scrapy.d.ts +0 -10
- package/dist/commands/init-wrap-scrapy.d.ts.map +0 -1
- package/dist/commands/init-wrap-scrapy.js +0 -41
- package/dist/commands/init-wrap-scrapy.js.map +0 -1
- package/dist/commands/init.d.ts +0 -12
- package/dist/commands/init.d.ts.map +0 -1
- package/dist/commands/init.js +0 -88
- package/dist/commands/init.js.map +0 -1
- package/dist/commands/login.d.ts +0 -10
- package/dist/commands/login.d.ts.map +0 -1
- package/dist/commands/login.js +0 -174
- package/dist/commands/login.js.map +0 -1
- package/dist/commands/logout.d.ts +0 -6
- package/dist/commands/logout.d.ts.map +0 -1
- package/dist/commands/logout.js +0 -20
- package/dist/commands/logout.js.map +0 -1
- package/dist/commands/pull.d.ts +0 -12
- package/dist/commands/pull.d.ts.map +0 -1
- package/dist/commands/pull.js +0 -148
- package/dist/commands/pull.js.map +0 -1
- package/dist/commands/push.d.ts +0 -18
- package/dist/commands/push.d.ts.map +0 -1
- package/dist/commands/push.js +0 -298
- package/dist/commands/push.js.map +0 -1
- package/dist/commands/run.d.ts +0 -13
- package/dist/commands/run.d.ts.map +0 -1
- package/dist/commands/run.js +0 -257
- package/dist/commands/run.js.map +0 -1
- package/dist/commands/secrets/add.d.ts +0 -10
- package/dist/commands/secrets/add.d.ts.map +0 -1
- package/dist/commands/secrets/add.js +0 -31
- package/dist/commands/secrets/add.js.map +0 -1
- package/dist/commands/secrets/index.d.ts +0 -6
- package/dist/commands/secrets/index.d.ts.map +0 -1
- package/dist/commands/secrets/index.js +0 -24
- package/dist/commands/secrets/index.js.map +0 -1
- package/dist/commands/secrets/rm.d.ts +0 -9
- package/dist/commands/secrets/rm.d.ts.map +0 -1
- package/dist/commands/secrets/rm.js +0 -27
- package/dist/commands/secrets/rm.js.map +0 -1
- package/dist/commands/task/index.d.ts +0 -6
- package/dist/commands/task/index.d.ts.map +0 -1
- package/dist/commands/task/index.js +0 -13
- package/dist/commands/task/index.js.map +0 -1
- package/dist/commands/task/run.d.ts +0 -16
- package/dist/commands/task/run.d.ts.map +0 -1
- package/dist/commands/task/run.js +0 -91
- package/dist/commands/task/run.js.map +0 -1
- package/dist/commands/validate-schema.d.ts +0 -10
- package/dist/commands/validate-schema.d.ts.map +0 -1
- package/dist/commands/validate-schema.js +0 -58
- package/dist/commands/validate-schema.js.map +0 -1
- package/dist/hooks/deprecations.d.ts +0 -4
- package/dist/hooks/deprecations.d.ts.map +0 -1
- package/dist/hooks/deprecations.js +0 -18
- package/dist/hooks/deprecations.js.map +0 -1
- package/dist/hooks/init.d.ts +0 -7
- package/dist/hooks/init.d.ts.map +0 -1
- package/dist/hooks/init.js +0 -17
- package/dist/hooks/init.js.map +0 -1
- package/dist/index.d.ts +0 -2
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/lib/actor.d.ts +0 -27
- package/dist/lib/actor.d.ts.map +0 -1
- package/dist/lib/actor.js +0 -67
- package/dist/lib/actor.js.map +0 -1
- package/dist/lib/apify-oclif-help.d.ts +0 -15
- package/dist/lib/apify-oclif-help.d.ts.map +0 -1
- package/dist/lib/apify-oclif-help.js +0 -19
- package/dist/lib/apify-oclif-help.js.map +0 -1
- package/dist/lib/apify_command.d.ts +0 -22
- package/dist/lib/apify_command.d.ts.map +0 -1
- package/dist/lib/apify_command.js +0 -103
- package/dist/lib/apify_command.js.map +0 -1
- package/dist/lib/commands/run-on-cloud.d.ts +0 -19
- package/dist/lib/commands/run-on-cloud.d.ts.map +0 -1
- package/dist/lib/commands/run-on-cloud.js +0 -90
- package/dist/lib/commands/run-on-cloud.js.map +0 -1
- package/dist/lib/community.d.ts +0 -2
- package/dist/lib/community.d.ts.map +0 -1
- package/dist/lib/community.js +0 -4
- package/dist/lib/community.js.map +0 -1
- package/dist/lib/consts.d.ts +0 -53
- package/dist/lib/consts.d.ts.map +0 -1
- package/dist/lib/consts.js +0 -64
- package/dist/lib/consts.js.map +0 -1
- package/dist/lib/create-utils.d.ts +0 -8
- package/dist/lib/create-utils.d.ts.map +0 -1
- package/dist/lib/create-utils.js +0 -148
- package/dist/lib/create-utils.js.map +0 -1
- package/dist/lib/exec.d.ts +0 -4
- package/dist/lib/exec.d.ts.map +0 -1
- package/dist/lib/exec.js +0 -40
- package/dist/lib/exec.js.map +0 -1
- package/dist/lib/files.d.ts +0 -14
- package/dist/lib/files.d.ts.map +0 -1
- package/dist/lib/files.js +0 -58
- package/dist/lib/files.js.map +0 -1
- package/dist/lib/input_schema.d.ts +0 -26
- package/dist/lib/input_schema.d.ts.map +0 -1
- package/dist/lib/input_schema.js +0 -93
- package/dist/lib/input_schema.js.map +0 -1
- package/dist/lib/local_state.d.ts +0 -11
- package/dist/lib/local_state.d.ts.map +0 -1
- package/dist/lib/local_state.js +0 -27
- package/dist/lib/local_state.js.map +0 -1
- package/dist/lib/outputs.d.ts +0 -19
- package/dist/lib/outputs.d.ts.map +0 -1
- package/dist/lib/outputs.js +0 -45
- package/dist/lib/outputs.js.map +0 -1
- package/dist/lib/project_analyzer.d.ts +0 -4
- package/dist/lib/project_analyzer.d.ts.map +0 -1
- package/dist/lib/project_analyzer.js +0 -30
- package/dist/lib/project_analyzer.js.map +0 -1
- package/dist/lib/projects/CrawleeAnalyzer.d.ts +0 -4
- package/dist/lib/projects/CrawleeAnalyzer.d.ts.map +0 -1
- package/dist/lib/projects/CrawleeAnalyzer.js +0 -20
- package/dist/lib/projects/CrawleeAnalyzer.js.map +0 -1
- package/dist/lib/projects/OldApifySDKAnalyzer.d.ts +0 -4
- package/dist/lib/projects/OldApifySDKAnalyzer.d.ts.map +0 -1
- package/dist/lib/projects/OldApifySDKAnalyzer.js +0 -38
- package/dist/lib/projects/OldApifySDKAnalyzer.js.map +0 -1
- package/dist/lib/projects/scrapy/ScrapyProjectAnalyzer.d.ts +0 -17
- package/dist/lib/projects/scrapy/ScrapyProjectAnalyzer.d.ts.map +0 -1
- package/dist/lib/projects/scrapy/ScrapyProjectAnalyzer.js +0 -87
- package/dist/lib/projects/scrapy/ScrapyProjectAnalyzer.js.map +0 -1
- package/dist/lib/projects/scrapy/Spider.d.ts +0 -14
- package/dist/lib/projects/scrapy/Spider.d.ts.map +0 -1
- package/dist/lib/projects/scrapy/Spider.js +0 -33
- package/dist/lib/projects/scrapy/Spider.js.map +0 -1
- package/dist/lib/projects/scrapy/SpiderFileAnalyzer.d.ts +0 -7
- package/dist/lib/projects/scrapy/SpiderFileAnalyzer.d.ts.map +0 -1
- package/dist/lib/projects/scrapy/SpiderFileAnalyzer.js +0 -25
- package/dist/lib/projects/scrapy/SpiderFileAnalyzer.js.map +0 -1
- package/dist/lib/projects/scrapy/wrapScrapyProject.d.ts +0 -4
- package/dist/lib/projects/scrapy/wrapScrapyProject.d.ts.map +0 -1
- package/dist/lib/projects/scrapy/wrapScrapyProject.js +0 -109
- package/dist/lib/projects/scrapy/wrapScrapyProject.js.map +0 -1
- package/dist/lib/projects/shared.d.ts +0 -2
- package/dist/lib/projects/shared.d.ts.map +0 -1
- package/dist/lib/projects/shared.js +0 -13
- package/dist/lib/projects/shared.js.map +0 -1
- package/dist/lib/secrets.d.ts +0 -22
- package/dist/lib/secrets.d.ts.map +0 -1
- package/dist/lib/secrets.js +0 -104
- package/dist/lib/secrets.js.map +0 -1
- package/dist/lib/telemetry.d.ts +0 -21
- package/dist/lib/telemetry.d.ts.map +0 -1
- package/dist/lib/telemetry.js +0 -87
- package/dist/lib/telemetry.js.map +0 -1
- package/dist/lib/types.d.ts +0 -11
- package/dist/lib/types.d.ts.map +0 -1
- package/dist/lib/types.js +0 -2
- package/dist/lib/types.js.map +0 -1
- package/dist/lib/utils.d.ts +0 -105
- package/dist/lib/utils.d.ts.map +0 -1
- package/dist/lib/utils.js +0 -575
- package/dist/lib/utils.js.map +0 -1
- package/dist/lib/version_check.d.ts +0 -14
- package/dist/lib/version_check.d.ts.map +0 -1
- package/dist/lib/version_check.js +0 -90
- package/dist/lib/version_check.js.map +0 -1
- package/oclif.manifest.json +0 -815
package/dist/lib/files.js
DELETED
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import { existsSync, mkdirSync } from 'node:fs';
|
|
2
|
-
import { stat, unlink } from 'node:fs/promises';
|
|
3
|
-
import { join, sep } from 'node:path';
|
|
4
|
-
import { loadJsonFile } from 'load-json-file';
|
|
5
|
-
import { rimraf } from 'rimraf';
|
|
6
|
-
import { writeJsonFile } from 'write-json-file';
|
|
7
|
-
export const updateLocalJson = async (jsonFilePath, updateAttrs = {}, nestedObjectAttr = null) => {
|
|
8
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
9
|
-
const currentObject = await loadJsonFile(jsonFilePath);
|
|
10
|
-
let newObject;
|
|
11
|
-
if (nestedObjectAttr) {
|
|
12
|
-
newObject = currentObject;
|
|
13
|
-
newObject[nestedObjectAttr] = { ...currentObject[nestedObjectAttr], ...updateAttrs };
|
|
14
|
-
}
|
|
15
|
-
else {
|
|
16
|
-
newObject = { ...currentObject, ...updateAttrs };
|
|
17
|
-
}
|
|
18
|
-
await writeJsonFile(jsonFilePath, newObject);
|
|
19
|
-
};
|
|
20
|
-
/**
|
|
21
|
-
* If you pass /foo/bar as rootPath and /baz/raz as folderPath then it ensures that following folders exists:
|
|
22
|
-
*
|
|
23
|
-
* /foo/bar/baz
|
|
24
|
-
* /foo/bar/baz/raz
|
|
25
|
-
*
|
|
26
|
-
* If you pass only one parameter then rootPath is considered to be '.'
|
|
27
|
-
*/
|
|
28
|
-
export const ensureFolderExistsSync = (rootPath, folderPath) => {
|
|
29
|
-
if (!folderPath) {
|
|
30
|
-
folderPath = rootPath;
|
|
31
|
-
rootPath = '.';
|
|
32
|
-
}
|
|
33
|
-
const parts = folderPath.split(sep);
|
|
34
|
-
parts.reduce((currentPath, currentDir) => {
|
|
35
|
-
currentPath = join(currentPath, currentDir);
|
|
36
|
-
if (!existsSync(currentPath)) {
|
|
37
|
-
mkdirSync(currentPath);
|
|
38
|
-
}
|
|
39
|
-
return currentPath;
|
|
40
|
-
}, rootPath);
|
|
41
|
-
};
|
|
42
|
-
export const rimrafPromised = async (pathToBeRemoved) => {
|
|
43
|
-
await rimraf(pathToBeRemoved);
|
|
44
|
-
};
|
|
45
|
-
export const deleteFile = async (filePath) => {
|
|
46
|
-
const res = await stat(filePath);
|
|
47
|
-
if (res.isFile()) {
|
|
48
|
-
await unlink(filePath);
|
|
49
|
-
}
|
|
50
|
-
};
|
|
51
|
-
export const sumFilesSizeInBytes = async (pathToFiles, cwd) => {
|
|
52
|
-
const filesStats = await Promise.all(pathToFiles.map(async (filePath) => stat(join(cwd, filePath))));
|
|
53
|
-
const filesSizeBytes = filesStats
|
|
54
|
-
.map((stats) => stats.size)
|
|
55
|
-
.reduce((sum, fileSize) => sum + fileSize, 0);
|
|
56
|
-
return filesSizeBytes;
|
|
57
|
-
};
|
|
58
|
-
//# sourceMappingURL=files.js.map
|
package/dist/lib/files.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"files.js","sourceRoot":"","sources":["../../src/lib/files.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAChD,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAEtC,OAAO,EAAE,YAAY,EAAE,MAAM,gB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C,CAAC;AACjB,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,cAAc,GAAG,KAAK,EAAE,eAAkC,EAAE,EAAE;IACvE,MAAM,MAAM,CAAC,eAAe,CAAC,CAAC;AAClC,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,UAAU,GAAG,KAAK,EAAE,QAAgB,EAAE,EAAE;IACjD,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,CAAC;IACjC,IAAI,GAAG,CAAC,MAAM,EAAE,EAAE,CAAC;QACf,MAAM,MAAM,CAAC,QAAQ,CAAC,CAAC;IAC3B,CAAC;AACL,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,mBAAmB,GAAG,KAAK,EAAE,WAAqB,EAAE,GAAW,EAAE,EAAE;IAC5E,MAAM,UAAU,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,GAAG,CAAC,KAAK,EAAE,QAAQ,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;IAErG,MAAM,cAAc,GAAG,UAAU;SAC5B,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC;SAC1B,MAAM,CAAC,CAAC,GAAG,EAAE,QAAQ,EAAE,EAAE,CAAC,GAAG,GAAG,QAAQ,EAAE,CAAC,CAAC,CAAC;IAElD,OAAO,cAAc,CAAC;AAC1B,CAAC,CAAC"}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Return the input schema from the default location.
|
|
3
|
-
*
|
|
4
|
-
* When the input schema does not exist, null is returned for schema.
|
|
5
|
-
* In such a case, path would be set to the location
|
|
6
|
-
* where the input schema would be expected to be found (and e.g. can be created there).
|
|
7
|
-
*/
|
|
8
|
-
export declare const readInputSchema: ({ forcePath, cwd }?: {
|
|
9
|
-
forcePath?: string;
|
|
10
|
-
cwd: string;
|
|
11
|
-
}) => Promise<{
|
|
12
|
-
inputSchema: Record<string, unknown> | undefined;
|
|
13
|
-
inputSchemaPath: string;
|
|
14
|
-
} | {
|
|
15
|
-
inputSchema: Record<string, unknown>;
|
|
16
|
-
inputSchemaPath: null;
|
|
17
|
-
} | {
|
|
18
|
-
inputSchema: null;
|
|
19
|
-
inputSchemaPath: string;
|
|
20
|
-
}>;
|
|
21
|
-
/**
|
|
22
|
-
* Goes to the Actor directory and creates INPUT.json file from the input schema prefills.
|
|
23
|
-
|
|
24
|
-
*/
|
|
25
|
-
export declare const createPrefilledInputFileFromInputSchema: (actorFolderDir: string) => Promise<void>;
|
|
26
|
-
//# sourceMappingURL=input_schema.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"input_schema.d.ts","sourceRoot":"","sources":["../../src/lib/input_schema.ts"],"names":[],"mappings":"AAkBA;;;;;;GAMG;AACH,eAAO,MAAM,eAAe,wBAA8B;IAAE,SAAS,CAAC,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE;;;;;;;;;EA6C5F,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,uCAAuC,mBAA0B,MAAM,kBA2BnF,CAAC"}
|
package/dist/lib/input_schema.js
DELETED
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
import { existsSync } from 'node:fs';
|
|
2
|
-
import { join } from 'node:path';
|
|
3
|
-
import process from 'node:process';
|
|
4
|
-
import { KEY_VALUE_STORE_KEYS } from '@apify/consts';
|
|
5
|
-
import { validateInputSchema } from '@apify/input_schema';
|
|
6
|
-
import _ from 'underscore';
|
|
7
|
-
import { writeJsonFile } from 'write-json-file';
|
|
8
|
-
import { ACTOR_SPECIFICATION_FOLDER } from './consts.js';
|
|
9
|
-
import { warning } from './outputs.js';
|
|
10
|
-
import { Ajv, getJsonFileContent, getLocalConfig, getLocalKeyValueStorePath } from './utils.js';
|
|
11
|
-
const DEFAULT_INPUT_SCHEMA_PATHS = [
|
|
12
|
-
'.actor/INPUT_SCHEMA.json',
|
|
13
|
-
'./INPUT_SCHEMA.json',
|
|
14
|
-
];
|
|
15
|
-
/**
|
|
16
|
-
* Return the input schema from the default location.
|
|
17
|
-
*
|
|
18
|
-
* When the input schema does not exist, null is returned for schema.
|
|
19
|
-
* In such a case, path would be set to the location
|
|
20
|
-
* where the input schema would be expected to be found (and e.g. can be created there).
|
|
21
|
-
*/
|
|
22
|
-
export const readInputSchema = async ({ forcePath, cwd } = { cwd: process.cwd() }) => {
|
|
23
|
-
if (forcePath) {
|
|
24
|
-
return {
|
|
25
|
-
inputSchema: getJsonFileContent(forcePath),
|
|
26
|
-
inputSchemaPath: forcePath,
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
const localConfig = getLocalConfig(cwd);
|
|
30
|
-
if (typeof localConfig?.input === 'object') {
|
|
31
|
-
return {
|
|
32
|
-
inputSchema: localConfig.input,
|
|
33
|
-
inputSchemaPath: null,
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
if (typeof localConfig?.input === 'string') {
|
|
37
|
-
const fullPath = join(cwd, ACTOR_SPECIFICATION_FOLDER, localConfig.input);
|
|
38
|
-
return {
|
|
39
|
-
inputSchema: getJsonFileContent(fullPath),
|
|
40
|
-
inputSchemaPath: fullPath,
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
if (existsSync(join(cwd, DEFAULT_INPUT_SCHEMA_PATHS[0]))) {
|
|
44
|
-
return {
|
|
45
|
-
inputSchema: getJsonFileContent(join(cwd, DEFAULT_INPUT_SCHEMA_PATHS[0])),
|
|
46
|
-
inputSchemaPath: join(cwd, DEFAULT_INPUT_SCHEMA_PATHS[0]),
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
|
-
if (existsSync(join(cwd, DEFAULT_INPUT_SCHEMA_PATHS[1]))) {
|
|
50
|
-
return {
|
|
51
|
-
inputSchema: getJsonFileContent(join(cwd, DEFAULT_INPUT_SCHEMA_PATHS[1])),
|
|
52
|
-
inputSchemaPath: join(cwd, DEFAULT_INPUT_SCHEMA_PATHS[1]),
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
// If not input schema has been found so far, return the first default path
|
|
56
|
-
// where the input schema would be expected.
|
|
57
|
-
return {
|
|
58
|
-
inputSchema: null,
|
|
59
|
-
inputSchemaPath: join(cwd, DEFAULT_INPUT_SCHEMA_PATHS[0]),
|
|
60
|
-
};
|
|
61
|
-
};
|
|
62
|
-
/**
|
|
63
|
-
* Goes to the Actor directory and creates INPUT.json file from the input schema prefills.
|
|
64
|
-
|
|
65
|
-
*/
|
|
66
|
-
export const createPrefilledInputFileFromInputSchema = async (actorFolderDir) => {
|
|
67
|
-
let inputFile = {};
|
|
68
|
-
try {
|
|
69
|
-
const { inputSchema } = await readInputSchema({ cwd: actorFolderDir });
|
|
70
|
-
if (inputSchema) {
|
|
71
|
-
/**
|
|
72
|
-
* TODO: The logic is copied from @apify-packages/actor -> getPrefillFromInputSchema
|
|
73
|
-
* It is not possible to install the package here because it is private
|
|
74
|
-
* We should move it to @apify/input_schema and use it from there.
|
|
75
|
-
*/
|
|
76
|
-
const validator = new Ajv({ strict: false });
|
|
77
|
-
validateInputSchema(validator, inputSchema);
|
|
78
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
79
|
-
inputFile = _.mapObject(inputSchema.properties, (fieldSchema) => ((fieldSchema.type === 'boolean' || fieldSchema.editor === 'hidden')
|
|
80
|
-
? fieldSchema.default
|
|
81
|
-
: fieldSchema.prefill));
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
catch (err) {
|
|
85
|
-
warning({ message: `Could not create default input based on input schema, creating empty input instead. Cause: ${err.message}` });
|
|
86
|
-
}
|
|
87
|
-
finally {
|
|
88
|
-
const keyValueStorePath = getLocalKeyValueStorePath();
|
|
89
|
-
const inputJsonPath = join(actorFolderDir, keyValueStorePath, `${KEY_VALUE_STORE_KEYS.INPUT}.json`);
|
|
90
|
-
await writeJsonFile(inputJsonPath, inputFile);
|
|
91
|
-
}
|
|
92
|
-
};
|
|
93
|
-
//# sourceMappingURL=input_schema.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"input_schema.js","sourceRoot":"","sources":["../../src/lib/input_schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,OAAO,MAAM,cAAc,CAAC;AAEnC,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AACrD,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,CAAC,MAAM,YAAY,CAAC;AAC3B,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD,OAAO,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAC;AACzD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,GAAG,EAAE,kBAAkB,EAAE,cAAc,EAAE,yBAAyB,EAAE,MAAM,YAAY,CAAC;AAEhG,MAAM,0BAA0B,GAAG;IAC/B,0BAA0B;IAC1B,qBAAqB;CACxB,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,KAAK,EAAE,EAAE,SAAS,EAAE,GAAG,KAA0C,EAAE,GAAG,EAAE,OAAO,CAAC,GAAG,EAAE,EAAE,EAAE,EAAE;IACtH,IAAI,SAAS,EAAE,CAAC;QACZ,OAAO;YACH,WAAW,EAAE,kBAAkB,CAAC,SAAS,CAAC;YAC1C,eAAe,EAAE,SAAS;SAC7B,CAAC;IACN,CAAC;IAED,MAAM,WAAW,GAAG,cAAc,CAAC,GAAG,CAAC,CAAC;IAExC,IAAI,OAAO,WAAW,EAAE,KAAK,KAAK,QAAQ,EAAE,CAAC;QACzC,OAAO;YACH,WAAW,EAAE,WAAW,CAAC,KAAgC;YACzD,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AW,EAAE,GAAG,MAAM,eAAe,CAAC,EAAE,GAAG,EAAE,cAAc,EAAE,CAAC,CAAC;QAEvE,IAAI,WAAW,EAAE,CAAC;YACd;;;;eAIG;YACH,MAAM,SAAS,GAAG,IAAI,GAAG,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC;YAC7C,mBAAmB,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC;YAE5C,8DAA8D;YAC9D,SAAS,GAAG,CAAC,CAAC,SAAS,CAAC,WAAW,CAAC,UAAiB,EAAE,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC,CAAC,WAAW,CAAC,IAAI,KAAK,SAAS,IAAI,WAAW,CAAC,MAAM,KAAK,QAAQ,CAAC;gBACxI,CAAC,CAAC,WAAW,CAAC,OAAO;gBACrB,CAAC,CAAC,WAAW,CAAC,OAAO,CACxB,CAAC,CAAC;QACP,CAAC;IACL,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACX,OAAO,CAAC,EAAE,OAAO,EAAE,8FAA+F,GAAa,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;IACjJ,CAAC;YAAS,CAAC;QACP,MAAM,iBAAiB,GAAG,yBAAyB,EAAE,CAAC;QACtD,MAAM,aAAa,GAAG,IAAI,CAAC,cAAc,EAAE,iBAAiB,EAAE,GAAG,oBAAoB,CAAC,KAAK,OAAO,CAAC,CAAC;QACpG,MAAM,aAAa,CAAC,aAAa,EAAE,SAAS,CAAC,CAAC;IAClD,CAAC;AACL,CAAC,CAAC"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Returns state object from auth file or empty object.
|
|
3
|
-
* This method is synchronous/blocking to avoid different race conditions.
|
|
4
|
-
*/
|
|
5
|
-
export declare const getLocalState: () => Record<string, unknown>;
|
|
6
|
-
/**
|
|
7
|
-
* Extends local state by given values.
|
|
8
|
-
* This method is synchronous/blocking to avoid different race conditions.
|
|
9
|
-
*/
|
|
10
|
-
export declare const extendLocalState: (data: Record<string, unknown>) => void;
|
|
11
|
-
//# sourceMappingURL=local_state.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"local_state.d.ts","sourceRoot":"","sources":["../../src/lib/local_state.ts"],"names":[],"mappings":"AAOA;;;GAGG;AACH,eAAO,MAAM,aAAa,+BAMzB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,gBAAgB,SAAU,OAAO,MAAM,EAAE,OAAO,CAAC,SAM7D,CAAC"}
|
package/dist/lib/local_state.js
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { loadJsonFileSync } from 'load-json-file';
|
|
2
|
-
import { writeJsonFileSync } from 'write-json-file';
|
|
3
|
-
import { STATE_FILE_PATH, } from './consts.js';
|
|
4
|
-
/**
|
|
5
|
-
* Returns state object from auth file or empty object.
|
|
6
|
-
* This method is synchronous/blocking to avoid different race conditions.
|
|
7
|
-
*/
|
|
8
|
-
export const getLocalState = () => {
|
|
9
|
-
try {
|
|
10
|
-
return loadJsonFileSync(STATE_FILE_PATH()) || {};
|
|
11
|
-
}
|
|
12
|
-
catch (e) {
|
|
13
|
-
return {};
|
|
14
|
-
}
|
|
15
|
-
};
|
|
16
|
-
/**
|
|
17
|
-
* Extends local state by given values.
|
|
18
|
-
* This method is synchronous/blocking to avoid different race conditions.
|
|
19
|
-
*/
|
|
20
|
-
export const extendLocalState = (data) => {
|
|
21
|
-
const state = getLocalState();
|
|
22
|
-
writeJsonFileSync(STATE_FILE_PATH(), {
|
|
23
|
-
...state,
|
|
24
|
-
...data,
|
|
25
|
-
});
|
|
26
|
-
};
|
|
27
|
-
//# sourceMappingURL=local_state.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"local_state.js","sourceRoot":"","sources":["../../src/lib/local_state.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAEpD,OAAO,EACH,eAAe,GAClB,MAAM,aAAa,CAAC;AAErB;;;GAGG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,GAAG,EAAE;IAC9B,IAAI,CAAC;QACD,OAAO,gBAAgB,CAA0B,eAAe,EAAE,CAAC,IAAI,EAAE,CAAC;IAC9E,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACT,OAAO,EAAE,CAAC;IACd,CAAC;AACL,CAAC,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,IAA6B,EAAE,EAAE;IAC9D,MAAM,KAAK,GAAG,aAAa,EAAE,CAAC;IAC9B,iBAAiB,CAAC,eAAe,EAAE,EAAE;QACjC,GAAG,KAAK;QACR,GAAG,IAAI;KACV,CAAC,CAAC;AACP,CAAC,CAAC"}
|
package/dist/lib/outputs.d.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
export interface LogOptions {
|
|
2
|
-
stdoutOutput?: unknown[];
|
|
3
|
-
stderrOutput?: unknown[];
|
|
4
|
-
}
|
|
5
|
-
export interface SimpleLogOptions {
|
|
6
|
-
stdout?: boolean;
|
|
7
|
-
message: string;
|
|
8
|
-
}
|
|
9
|
-
export declare function simpleLog(options: SimpleLogOptions): void;
|
|
10
|
-
export declare function error(options: SimpleLogOptions): void;
|
|
11
|
-
export declare function warning(options: SimpleLogOptions): void;
|
|
12
|
-
export declare function success(options: SimpleLogOptions): void;
|
|
13
|
-
export declare function run(options: SimpleLogOptions): void;
|
|
14
|
-
export declare function info(options: SimpleLogOptions): void;
|
|
15
|
-
export interface SimpleLinkOptions extends SimpleLogOptions {
|
|
16
|
-
url: string;
|
|
17
|
-
}
|
|
18
|
-
export declare function link(options: SimpleLinkOptions): void;
|
|
19
|
-
//# sourceMappingURL=outputs.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"outputs.d.ts","sourceRoot":"","sources":["../../src/lib/outputs.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,UAAU;IACvB,YAAY,CAAC,EAAE,OAAO,EAAE,CAAC;IACzB,YAAY,CAAC,EAAE,OAAO,EAAE,CAAC;CAC5B;AAYD,MAAM,WAAW,gBAAgB;IAC7B,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;CACnB;AAED,wBAAgB,SAAS,CAAC,OAAO,EAAE,gBAAgB,QAIlD;AAED,wBAAgB,KAAK,CAAC,OAAO,EAAE,gBAAgB,QAI9C;AAED,wBAAgB,OAAO,CAAC,OAAO,EAAE,gBAAgB,QAIhD;AAED,wBAAgB,OAAO,CAAC,OAAO,EAAE,gBAAgB,QAIhD;AAED,wBAAgB,GAAG,CAAC,OAAO,EAAE,gBAAgB,QAI5C;AAED,wBAAgB,IAAI,CAAC,OAAO,EAAE,gBAAgB,QAI7C;AAED,MAAM,WAAW,iBAAkB,SAAQ,gBAAgB;IACvD,GAAG,EAAE,MAAM,CAAC;CACf;AAED,wBAAgB,IAAI,CAAC,OAAO,EAAE,iBAAiB,QAI9C"}
|
package/dist/lib/outputs.js
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import chalk from 'chalk';
|
|
2
|
-
function internalLog(options) {
|
|
3
|
-
if (options.stdoutOutput) {
|
|
4
|
-
console.log(...options.stdoutOutput);
|
|
5
|
-
}
|
|
6
|
-
if (options.stderrOutput) {
|
|
7
|
-
console.error(...options.stderrOutput);
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
export function simpleLog(options) {
|
|
11
|
-
internalLog({
|
|
12
|
-
[options.stdout ? 'stdoutOutput' : 'stderrOutput']: [options.message],
|
|
13
|
-
});
|
|
14
|
-
}
|
|
15
|
-
export function error(options) {
|
|
16
|
-
internalLog({
|
|
17
|
-
[options.stdout ? 'stdoutOutput' : 'stderrOutput']: [chalk.red('Error:'), options.message],
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
export function warning(options) {
|
|
21
|
-
internalLog({
|
|
22
|
-
[options.stdout ? 'stdoutOutput' : 'stderrOutput']: [chalk.rgb(254, 90, 29).bold('Warning:'), options.message],
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
export function success(options) {
|
|
26
|
-
internalLog({
|
|
27
|
-
[options.stdout ? 'stdoutOutput' : 'stderrOutput']: [chalk.green('Success:'), options.message],
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
export function run(options) {
|
|
31
|
-
internalLog({
|
|
32
|
-
[options.stdout ? 'stdoutOutput' : 'stderrOutput']: [chalk.gray('Run:'), options.message],
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
export function info(options) {
|
|
36
|
-
internalLog({
|
|
37
|
-
[options.stdout ? 'stdoutOutput' : 'stderrOutput']: [chalk.white('Info:'), options.message],
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
export function link(options) {
|
|
41
|
-
internalLog({
|
|
42
|
-
[options.stdout ? 'stdoutOutput' : 'stderrOutput']: [chalk.blue(options.message), options.url],
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
|
-
//# sourceMappingURL=outputs.js.map
|
package/dist/lib/outputs.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"outputs.js","sourceRoot":"","sources":["../../src/lib/outputs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAO1B,SAAS,WAAW,CAAC,OAAmB;IACpC,IAAI,OAAO,CAAC,YAAY,EAAE,CAAC;QACvB,OAAO,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;IACzC,CAAC;IAED,IAAI,OAAO,CAAC,YAAY,EAAE,CAAC;QACvB,OAAO,CAAC,KAAK,CAAC,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;IAC3C,CAAC;AACL,CAAC;AAOD,MAAM,UAAU,SAAS,CAAC,OAAyB;IAC/C,WAAW,CAAC;QAC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,CAAC;QACR,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,cAAc,CAAC,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,OAAO,CAAC;KAC9F,CAAC,CAAC;AACP,CAAC;AAMD,MAAM,UAAU,IAAI,CAAC,OAA0B;IAC3C,WAAW,CAAC;QACR,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,cAAc,CAAC,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,GAAG,CAAC;KACjG,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"project_analyzer.d.ts","sourceRoot":"","sources":["../../src/lib/project_analyzer.ts"],"names":[],"mappings":"AA4BA,qBAAa,eAAe;IACxB,MAAM,CAAC,cAAc,CAAC,QAAQ,EAAE,MAAM;CAWzC"}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { PROJECT_TYPES } from './consts.js';
|
|
2
|
-
import { CrawleeAnalyzer } from './projects/CrawleeAnalyzer.js';
|
|
3
|
-
import { OldApifySDKAnalyzer } from './projects/OldApifySDKAnalyzer.js';
|
|
4
|
-
import { ScrapyProjectAnalyzer } from './projects/scrapy/ScrapyProjectAnalyzer.js';
|
|
5
|
-
const analyzers = [
|
|
6
|
-
{
|
|
7
|
-
type: PROJECT_TYPES.SCRAPY,
|
|
8
|
-
analyzer: ScrapyProjectAnalyzer,
|
|
9
|
-
},
|
|
10
|
-
{
|
|
11
|
-
type: PROJECT_TYPES.CRAWLEE,
|
|
12
|
-
analyzer: CrawleeAnalyzer,
|
|
13
|
-
},
|
|
14
|
-
{
|
|
15
|
-
type: PROJECT_TYPES.PRE_CRAWLEE_APIFY_SDK,
|
|
16
|
-
analyzer: OldApifySDKAnalyzer,
|
|
17
|
-
},
|
|
18
|
-
];
|
|
19
|
-
export class ProjectAnalyzer {
|
|
20
|
-
static getProjectType(pathname) {
|
|
21
|
-
const analyzer = analyzers.find((a) => {
|
|
22
|
-
if (!a.analyzer.isApplicable) {
|
|
23
|
-
throw new Error(`Analyzer ${a.analyzer} does not have isApplicable method.`);
|
|
24
|
-
}
|
|
25
|
-
return a.analyzer.isApplicable(pathname);
|
|
26
|
-
});
|
|
27
|
-
return analyzer?.type || PROJECT_TYPES.UNKNOWN;
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
//# sourceMappingURL=project_analyzer.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"project_analyzer.js","sourceRoot":"","sources":["../../src/lib/project_analyzer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AACxE,OAAO,EAAE,qBAAqB,EAAE,MAAM,4CAA4C,CAAC;AAUnF,MAAM,SAAS,GAA0B;IACrC;QACI,IAAI,EAAE,aAAa,CAAC,MAAM;QAC1B,QAAQ,EAAE,qBAAqB;KAClC;IACD;QACI,IAAI,EAAE,aAAa,CAAC,OAAO;QAC3B,QAAQ,EAAE,eAAe;KAC5B;IACD;QACI,IAAI,EAAE,aAAa,CAAC,qBAAqB;QACzC,QAAQ,EAAE,mBAAmB;KAChC;CACJ,CAAC;AAEF,MAAM,OAAO,eAAe;IACxB,MAAM,CAAC,cAAc,CAAC,QAAgB;QAClC,MAAM,QAAQ,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE;YAClC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,YAAY,EAAE,CAAC;gBAC3B,MAAM,IAAI,KAAK,CAAC,YAAY,CAAC,CAAC,QAAQ,qCAAqC,CAAC,CAAC;YACjF,CAAC;YAED,OAAO,CAAC,CAAC,QAAQ,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC;QAC7C,CAAC,CAAC,CAAC;QAEH,OAAO,QAAQ,EAAE,IAAI,IAAI,aAAa,CAAC,OAAO,CAAC;IACnD,CAAC;CACJ"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CrawleeAnalyzer.d.ts","sourceRoot":"","sources":["../../../src/lib/projects/CrawleeAnalyzer.ts"],"names":[],"mappings":"AAKA,qBAAa,eAAe;IACxB,MAAM,CAAC,YAAY,CAAC,QAAQ,EAAE,MAAM;CAiBvC"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { existsSync, readFileSync } from 'node:fs';
|
|
2
|
-
import { join } from 'node:path';
|
|
3
|
-
import { CRAWLEE_PACKAGES } from './shared.js';
|
|
4
|
-
export class CrawleeAnalyzer {
|
|
5
|
-
static isApplicable(pathname) {
|
|
6
|
-
const hasPackageJson = existsSync(join(pathname, 'package.json'));
|
|
7
|
-
if (!hasPackageJson) {
|
|
8
|
-
return false;
|
|
9
|
-
}
|
|
10
|
-
const packageJson = readFileSync(join(pathname, 'package.json'), 'utf8');
|
|
11
|
-
try {
|
|
12
|
-
const packageJsonParsed = JSON.parse(packageJson);
|
|
13
|
-
return CRAWLEE_PACKAGES.some((pkg) => packageJsonParsed?.dependencies?.[pkg] !== undefined);
|
|
14
|
-
}
|
|
15
|
-
catch (err) {
|
|
16
|
-
return false;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
//# sourceMappingURL=CrawleeAnalyzer.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CrawleeAnalyzer.js","sourceRoot":"","sources":["../../../src/lib/projects/CrawleeAnalyzer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/C,MAAM,OAAO,eAAe;IACxB,MAAM,CAAC,YAAY,CAAC,QAAgB;QAChC,MAAM,cAAc,GAAG,UAAU,CAAC,IAAI,CAAC,QAAQ,EAAE,cAAc,CAAC,CAAC,CAAC;QAElE,IAAI,CAAC,cAAc,EAAE,CAAC;YAClB,OAAO,KAAK,CAAC;QACjB,CAAC;QAED,MAAM,WAAW,GAAG,YAAY,CAAC,IAAI,CAAC,QAAQ,EAAE,cAAc,CAAC,EAAE,MAAM,CAAC,CAAC;QAEzE,IAAI,CAAC;YACD,MAAM,iBAAiB,GAAG,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;YAElD,OAAO,gBAAgB,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,iBAAiB,EAAE,YAAY,EAAE,CAAC,GAAG,CAAC,KAAK,SAAS,CAAC,CAAC;QAChG,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACX,OAAO,KAAK,CAAC;QACjB,CAAC;IACL,CAAC;CACJ"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"OldApifySDKAnalyzer.d.ts","sourceRoot":"","sources":["../../../src/lib/projects/OldApifySDKAnalyzer.ts"],"names":[],"mappings":"AASA,qBAAa,mBAAmB;IAC5B,MAAM,CAAC,YAAY,CAAC,QAAQ,EAAE,MAAM;CAsCvC"}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { existsSync, readFileSync } from 'node:fs';
|
|
2
|
-
import { join } from 'node:path';
|
|
3
|
-
import { lt } from 'semver';
|
|
4
|
-
import { CRAWLEE_PACKAGES } from './shared.js';
|
|
5
|
-
const VERSION_WHEN_APIFY_MOVED_TO_CRAWLEE = '3.0.0';
|
|
6
|
-
export class OldApifySDKAnalyzer {
|
|
7
|
-
static isApplicable(pathname) {
|
|
8
|
-
const hasPackageJson = existsSync(join(pathname, 'package.json'));
|
|
9
|
-
if (!hasPackageJson) {
|
|
10
|
-
return false;
|
|
11
|
-
}
|
|
12
|
-
const packageJson = readFileSync(join(pathname, 'package.json'), 'utf8');
|
|
13
|
-
try {
|
|
14
|
-
const packageJsonParsed = JSON.parse(packageJson);
|
|
15
|
-
// If they have crawlee as a dependency, likely to use crawlee
|
|
16
|
-
if (CRAWLEE_PACKAGES.some((pkg) => packageJsonParsed?.dependencies?.[pkg] !== undefined)) {
|
|
17
|
-
return false;
|
|
18
|
-
}
|
|
19
|
-
const apifyVersion = packageJsonParsed?.dependencies?.apify;
|
|
20
|
-
if (!apifyVersion) {
|
|
21
|
-
return false;
|
|
22
|
-
}
|
|
23
|
-
// We cannot infer/crawlee v3
|
|
24
|
-
if (apifyVersion === '*') {
|
|
25
|
-
return false;
|
|
26
|
-
}
|
|
27
|
-
let actualVersion = apifyVersion;
|
|
28
|
-
if (apifyVersion.startsWith('~') || apifyVersion.startsWith('^')) {
|
|
29
|
-
actualVersion = apifyVersion.slice(1);
|
|
30
|
-
}
|
|
31
|
-
return lt(actualVersion, VERSION_WHEN_APIFY_MOVED_TO_CRAWLEE);
|
|
32
|
-
}
|
|
33
|
-
catch (err) {
|
|
34
|
-
return false;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
//# sourceMappingURL=OldApifySDKAnalyzer.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"OldApifySDKAnalyzer.js","sourceRoot":"","sources":["../../../src/lib/projects/OldApifySDKAnalyzer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAE5B,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/C,MAAM,mCAAmC,GAAG,OAAO,CAAC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
|
-
import ConfigParser from 'configparser';
|
|
2
|
-
export declare class ScrapyProjectAnalyzer {
|
|
3
|
-
pathname: string;
|
|
4
|
-
configuration: ConfigParser;
|
|
5
|
-
settings: {
|
|
6
|
-
BOT_NAME: string;
|
|
7
|
-
SPIDER_MODULES: string[];
|
|
8
|
-
} | null;
|
|
9
|
-
constructor(pathname: string);
|
|
10
|
-
static isApplicable(pathname: string): boolean;
|
|
11
|
-
init(): Promise<void>;
|
|
12
|
-
loadScrapyCfg(): void;
|
|
13
|
-
loadSettings(): Promise<void>;
|
|
14
|
-
getName(): string | undefined;
|
|
15
|
-
getAvailableSpiders(): import("./Spider.js").Spider[];
|
|
16
|
-
}
|
|
17
|
-
//# sourceMappingURL=ScrapyProjectAnalyzer.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ScrapyProjectAnalyzer.d.ts","sourceRoot":"","sources":["../../../../src/lib/projects/scrapy/ScrapyProjectAnalyzer.ts"],"names":[],"mappings":"AAGA,OAAO,YAAY,MAAM,cAAc,CAAC;AAKxC,qBAAa,qBAAqB;IAC9B,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,EAAE,YAAY,CAAS;IACpC,QAAQ,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,cAAc,EAAE,MAAM,EAAE,CAAA;KAAE,GAAG,IAAI,CAAQ;gBAE3D,QAAQ,EAAE,MAAM;IAM5B,MAAM,CAAC,YAAY,CAAC,QAAQ,EAAE,MAAM;IAI9B,IAAI;IAIV,aAAa;IAaP,YAAY;IAuBlB,OAAO;IAIP,mBAAmB;CAsBtB"}
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
import { existsSync, readdirSync } from 'node:fs';
|
|
2
|
-
import { join, resolve } from 'node:path';
|
|
3
|
-
import ConfigParser from 'configparser';
|
|
4
|
-
import inquirer from 'inquirer';
|
|
5
|
-
import { SpiderFileAnalyzer } from './SpiderFileAnalyzer.js';
|
|
6
|
-
export class ScrapyProjectAnalyzer {
|
|
7
|
-
constructor(pathname) {
|
|
8
|
-
Object.defineProperty(this, "pathname", {
|
|
9
|
-
enumerable: true,
|
|
10
|
-
configurable: true,
|
|
11
|
-
writable: true,
|
|
12
|
-
value: void 0
|
|
13
|
-
});
|
|
14
|
-
Object.defineProperty(this, "configuration", {
|
|
15
|
-
enumerable: true,
|
|
16
|
-
configurable: true,
|
|
17
|
-
writable: true,
|
|
18
|
-
value: null
|
|
19
|
-
});
|
|
20
|
-
Object.defineProperty(this, "settings", {
|
|
21
|
-
enumerable: true,
|
|
22
|
-
configurable: true,
|
|
23
|
-
writable: true,
|
|
24
|
-
value: null
|
|
25
|
-
});
|
|
26
|
-
this.pathname = pathname;
|
|
27
|
-
this.settings = null;
|
|
28
|
-
this.loadScrapyCfg();
|
|
29
|
-
}
|
|
30
|
-
static isApplicable(pathname) {
|
|
31
|
-
return existsSync(join(pathname, 'scrapy.cfg'));
|
|
32
|
-
}
|
|
33
|
-
async init() {
|
|
34
|
-
await this.loadSettings();
|
|
35
|
-
}
|
|
36
|
-
loadScrapyCfg() {
|
|
37
|
-
const config = new ConfigParser();
|
|
38
|
-
const scrapyCfgPath = resolve(join(this.pathname, 'scrapy.cfg'));
|
|
39
|
-
if (!existsSync(scrapyCfgPath)) {
|
|
40
|
-
throw new Error(`scrapy.cfg not found in "${scrapyCfgPath}".
|
|
41
|
-
Are you sure there is a Scrapy project there?`);
|
|
42
|
-
}
|
|
43
|
-
config.read(scrapyCfgPath);
|
|
44
|
-
this.configuration = config;
|
|
45
|
-
}
|
|
46
|
-
async loadSettings() {
|
|
47
|
-
const assumedBotName = this.configuration.get('settings', 'default').split('.')[0];
|
|
48
|
-
const settings = await inquirer.prompt([
|
|
49
|
-
{
|
|
50
|
-
type: 'input',
|
|
51
|
-
name: 'BOT_NAME',
|
|
52
|
-
message: 'Enter the Scrapy BOT_NAME (see settings.py):',
|
|
53
|
-
default: assumedBotName,
|
|
54
|
-
},
|
|
55
|
-
{
|
|
56
|
-
type: 'input',
|
|
57
|
-
name: 'SPIDER_MODULES',
|
|
58
|
-
message: 'What folder are the Scrapy spider modules stored in? (see SPIDER_MODULES in settings.py):',
|
|
59
|
-
default: [`${assumedBotName}.spiders`],
|
|
60
|
-
},
|
|
61
|
-
]);
|
|
62
|
-
if (typeof settings.SPIDER_MODULES === 'string')
|
|
63
|
-
settings.SPIDER_MODULES = [settings.SPIDER_MODULES];
|
|
64
|
-
this.settings = settings;
|
|
65
|
-
}
|
|
66
|
-
getName() {
|
|
67
|
-
return this.settings?.BOT_NAME;
|
|
68
|
-
}
|
|
69
|
-
getAvailableSpiders() {
|
|
70
|
-
const spiderPaths = this.settings?.SPIDER_MODULES;
|
|
71
|
-
if (!spiderPaths) {
|
|
72
|
-
throw new Error('SPIDER_MODULES path not found in settings.');
|
|
73
|
-
}
|
|
74
|
-
const spiders = [];
|
|
75
|
-
for (const spiderPath of spiderPaths) {
|
|
76
|
-
const spidersDir = join(this.pathname, spiderPath.replaceAll('.', '/'));
|
|
77
|
-
const files = readdirSync(spidersDir, { withFileTypes: true });
|
|
78
|
-
for (const file of files) {
|
|
79
|
-
if (file.isFile() && file.name.endsWith('.py') && file.name !== '__init__.py') {
|
|
80
|
-
spiders.push(...(new SpiderFileAnalyzer(join(spidersDir, file.name)).getSpiders()));
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
return spiders;
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
//# sourceMappingURL=ScrapyProjectAnalyzer.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ScrapyProjectAnalyzer.js","sourceRoot":"","sources":["../../../../src/lib/projects/scrapy/ScrapyProjectAnalyzer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAClD,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAE1C,OAAO,YAAY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I,CAAC,CAAC,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC;gBACxF,CAAC;YACL,CAAC;QACL,CAAC;QAED,OAAO,OAAO,CAAC;IACnB,CAAC;CACJ"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export declare class Spider {
|
|
2
|
-
name?: string;
|
|
3
|
-
class_name: string;
|
|
4
|
-
start_urls?: string;
|
|
5
|
-
pathname: string;
|
|
6
|
-
constructor(data: SpiderData);
|
|
7
|
-
}
|
|
8
|
-
export interface SpiderData {
|
|
9
|
-
name?: string;
|
|
10
|
-
class_name: string;
|
|
11
|
-
start_urls?: string;
|
|
12
|
-
pathname: string;
|
|
13
|
-
}
|
|
14
|
-
//# sourceMappingURL=Spider.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Spider.d.ts","sourceRoot":"","sources":["../../../../src/lib/projects/scrapy/Spider.ts"],"names":[],"mappings":"AAAA,qBAAa,MAAM;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;gBAEL,IAAI,EAAE,UAAU;CAM/B;AAED,MAAM,WAAW,UAAU;IACvB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;CACpB"}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
export class Spider {
|
|
2
|
-
constructor(data) {
|
|
3
|
-
Object.defineProperty(this, "name", {
|
|
4
|
-
enumerable: true,
|
|
5
|
-
configurable: true,
|
|
6
|
-
writable: true,
|
|
7
|
-
value: void 0
|
|
8
|
-
});
|
|
9
|
-
Object.defineProperty(this, "class_name", {
|
|
10
|
-
enumerable: true,
|
|
11
|
-
configurable: true,
|
|
12
|
-
writable: true,
|
|
13
|
-
value: void 0
|
|
14
|
-
});
|
|
15
|
-
Object.defineProperty(this, "start_urls", {
|
|
16
|
-
enumerable: true,
|
|
17
|
-
configurable: true,
|
|
18
|
-
writable: true,
|
|
19
|
-
value: void 0
|
|
20
|
-
});
|
|
21
|
-
Object.defineProperty(this, "pathname", {
|
|
22
|
-
enumerable: true,
|
|
23
|
-
configurable: true,
|
|
24
|
-
writable: true,
|
|
25
|
-
value: void 0
|
|
26
|
-
});
|
|
27
|
-
this.name = data.name;
|
|
28
|
-
this.class_name = data.class_name;
|
|
29
|
-
this.start_urls = data.start_urls;
|
|
30
|
-
this.pathname = data.pathname;
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
//# sourceMappingURL=Spider.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Spider.js","sourceRoot":"","sources":["../../../../src/lib/projects/scrapy/Spider.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,MAAM;IAMf,YAAY,IAAgB;QAL5B;;;;;WAAc;QACd;;;;;WAAmB;QACnB;;;;;WAAoB;QACpB;;;;;WAAiB;QAGb,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;QACtB,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC;QAClC,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC;QAClC,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC;IAClC,CAAC;CACJ"}
|