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.
Files changed (221) hide show
  1. package/CHANGELOG.md +236 -84
  2. package/LICENSE.md +201 -0
  3. package/README.md +50 -535
  4. package/dist/.tsbuildinfo +1 -1
  5. package/dist/actor.js +3 -0
  6. package/dist/actor.js.map +1 -0
  7. package/dist/apify.js +3 -0
  8. package/dist/apify.js.map +1 -0
  9. package/dist/chunk-TJMCNXPV.js +242 -0
  10. package/dist/chunk-TJMCNXPV.js.map +1 -0
  11. package/dist/index.js +2 -3
  12. package/package.json +116 -89
  13. package/bin/dev.cmd +0 -3
  14. package/bin/dev.js +0 -21
  15. package/bin/dev.sh +0 -4
  16. package/bin/run.cmd +0 -3
  17. package/bin/run.js +0 -23
  18. package/dist/commands/actor/get-input.d.ts +0 -6
  19. package/dist/commands/actor/get-input.d.ts.map +0 -1
  20. package/dist/commands/actor/get-input.js +0 -14
  21. package/dist/commands/actor/get-input.js.map +0 -1
  22. package/dist/commands/actor/get-value.d.ts +0 -9
  23. package/dist/commands/actor/get-value.d.ts.map +0 -1
  24. package/dist/commands/actor/get-value.js +0 -27
  25. package/dist/commands/actor/get-value.js.map +0 -1
  26. package/dist/commands/actor/index.d.ts +0 -6
  27. package/dist/commands/actor/index.d.ts.map +0 -1
  28. package/dist/commands/actor/index.js +0 -13
  29. package/dist/commands/actor/index.js.map +0 -1
  30. package/dist/commands/actor/push-data.d.ts +0 -11
  31. package/dist/commands/actor/push-data.d.ts.map +0 -1
  32. package/dist/commands/actor/push-data.js +0 -56
  33. package/dist/commands/actor/push-data.js.map +0 -1
  34. package/dist/commands/actor/set-value.d.ts +0 -15
  35. package/dist/commands/actor/set-value.d.ts.map +0 -1
  36. package/dist/commands/actor/set-value.js +0 -76
  37. package/dist/commands/actor/set-value.js.map +0 -1
  38. package/dist/commands/call.d.ts +0 -16
  39. package/dist/commands/call.d.ts.map +0 -1
  40. package/dist/commands/call.js +0 -108
  41. package/dist/commands/call.js.map +0 -1
  42. package/dist/commands/check-version.d.ts +0 -11
  43. package/dist/commands/check-version.d.ts.map +0 -1
  44. package/dist/commands/check-version.js +0 -39
  45. package/dist/commands/check-version.js.map +0 -1
  46. package/dist/commands/create.d.ts +0 -15
  47. package/dist/commands/create.d.ts.map +0 -1
  48. package/dist/commands/create.js +0 -201
  49. package/dist/commands/create.js.map +0 -1
  50. package/dist/commands/edit-input-schema.d.ts +0 -11
  51. package/dist/commands/edit-input-schema.d.ts.map +0 -1
  52. package/dist/commands/edit-input-schema.js +0 -176
  53. package/dist/commands/edit-input-schema.js.map +0 -1
  54. package/dist/commands/info.d.ts +0 -6
  55. package/dist/commands/info.d.ts.map +0 -1
  56. package/dist/commands/info.js +0 -26
  57. package/dist/commands/info.js.map +0 -1
  58. package/dist/commands/init-wrap-scrapy.d.ts +0 -10
  59. package/dist/commands/init-wrap-scrapy.d.ts.map +0 -1
  60. package/dist/commands/init-wrap-scrapy.js +0 -41
  61. package/dist/commands/init-wrap-scrapy.js.map +0 -1
  62. package/dist/commands/init.d.ts +0 -12
  63. package/dist/commands/init.d.ts.map +0 -1
  64. package/dist/commands/init.js +0 -88
  65. package/dist/commands/init.js.map +0 -1
  66. package/dist/commands/login.d.ts +0 -10
  67. package/dist/commands/login.d.ts.map +0 -1
  68. package/dist/commands/login.js +0 -174
  69. package/dist/commands/login.js.map +0 -1
  70. package/dist/commands/logout.d.ts +0 -6
  71. package/dist/commands/logout.d.ts.map +0 -1
  72. package/dist/commands/logout.js +0 -20
  73. package/dist/commands/logout.js.map +0 -1
  74. package/dist/commands/pull.d.ts +0 -12
  75. package/dist/commands/pull.d.ts.map +0 -1
  76. package/dist/commands/pull.js +0 -148
  77. package/dist/commands/pull.js.map +0 -1
  78. package/dist/commands/push.d.ts +0 -18
  79. package/dist/commands/push.d.ts.map +0 -1
  80. package/dist/commands/push.js +0 -298
  81. package/dist/commands/push.js.map +0 -1
  82. package/dist/commands/run.d.ts +0 -13
  83. package/dist/commands/run.d.ts.map +0 -1
  84. package/dist/commands/run.js +0 -257
  85. package/dist/commands/run.js.map +0 -1
  86. package/dist/commands/secrets/add.d.ts +0 -10
  87. package/dist/commands/secrets/add.d.ts.map +0 -1
  88. package/dist/commands/secrets/add.js +0 -31
  89. package/dist/commands/secrets/add.js.map +0 -1
  90. package/dist/commands/secrets/index.d.ts +0 -6
  91. package/dist/commands/secrets/index.d.ts.map +0 -1
  92. package/dist/commands/secrets/index.js +0 -24
  93. package/dist/commands/secrets/index.js.map +0 -1
  94. package/dist/commands/secrets/rm.d.ts +0 -9
  95. package/dist/commands/secrets/rm.d.ts.map +0 -1
  96. package/dist/commands/secrets/rm.js +0 -27
  97. package/dist/commands/secrets/rm.js.map +0 -1
  98. package/dist/commands/task/index.d.ts +0 -6
  99. package/dist/commands/task/index.d.ts.map +0 -1
  100. package/dist/commands/task/index.js +0 -13
  101. package/dist/commands/task/index.js.map +0 -1
  102. package/dist/commands/task/run.d.ts +0 -16
  103. package/dist/commands/task/run.d.ts.map +0 -1
  104. package/dist/commands/task/run.js +0 -91
  105. package/dist/commands/task/run.js.map +0 -1
  106. package/dist/commands/validate-schema.d.ts +0 -10
  107. package/dist/commands/validate-schema.d.ts.map +0 -1
  108. package/dist/commands/validate-schema.js +0 -58
  109. package/dist/commands/validate-schema.js.map +0 -1
  110. package/dist/hooks/deprecations.d.ts +0 -4
  111. package/dist/hooks/deprecations.d.ts.map +0 -1
  112. package/dist/hooks/deprecations.js +0 -18
  113. package/dist/hooks/deprecations.js.map +0 -1
  114. package/dist/hooks/init.d.ts +0 -7
  115. package/dist/hooks/init.d.ts.map +0 -1
  116. package/dist/hooks/init.js +0 -17
  117. package/dist/hooks/init.js.map +0 -1
  118. package/dist/index.d.ts +0 -2
  119. package/dist/index.d.ts.map +0 -1
  120. package/dist/index.js.map +0 -1
  121. package/dist/lib/actor.d.ts +0 -27
  122. package/dist/lib/actor.d.ts.map +0 -1
  123. package/dist/lib/actor.js +0 -67
  124. package/dist/lib/actor.js.map +0 -1
  125. package/dist/lib/apify-oclif-help.d.ts +0 -15
  126. package/dist/lib/apify-oclif-help.d.ts.map +0 -1
  127. package/dist/lib/apify-oclif-help.js +0 -19
  128. package/dist/lib/apify-oclif-help.js.map +0 -1
  129. package/dist/lib/apify_command.d.ts +0 -22
  130. package/dist/lib/apify_command.d.ts.map +0 -1
  131. package/dist/lib/apify_command.js +0 -103
  132. package/dist/lib/apify_command.js.map +0 -1
  133. package/dist/lib/commands/run-on-cloud.d.ts +0 -19
  134. package/dist/lib/commands/run-on-cloud.d.ts.map +0 -1
  135. package/dist/lib/commands/run-on-cloud.js +0 -90
  136. package/dist/lib/commands/run-on-cloud.js.map +0 -1
  137. package/dist/lib/community.d.ts +0 -2
  138. package/dist/lib/community.d.ts.map +0 -1
  139. package/dist/lib/community.js +0 -4
  140. package/dist/lib/community.js.map +0 -1
  141. package/dist/lib/consts.d.ts +0 -53
  142. package/dist/lib/consts.d.ts.map +0 -1
  143. package/dist/lib/consts.js +0 -64
  144. package/dist/lib/consts.js.map +0 -1
  145. package/dist/lib/create-utils.d.ts +0 -8
  146. package/dist/lib/create-utils.d.ts.map +0 -1
  147. package/dist/lib/create-utils.js +0 -148
  148. package/dist/lib/create-utils.js.map +0 -1
  149. package/dist/lib/exec.d.ts +0 -4
  150. package/dist/lib/exec.d.ts.map +0 -1
  151. package/dist/lib/exec.js +0 -40
  152. package/dist/lib/exec.js.map +0 -1
  153. package/dist/lib/files.d.ts +0 -14
  154. package/dist/lib/files.d.ts.map +0 -1
  155. package/dist/lib/files.js +0 -58
  156. package/dist/lib/files.js.map +0 -1
  157. package/dist/lib/input_schema.d.ts +0 -26
  158. package/dist/lib/input_schema.d.ts.map +0 -1
  159. package/dist/lib/input_schema.js +0 -93
  160. package/dist/lib/input_schema.js.map +0 -1
  161. package/dist/lib/local_state.d.ts +0 -11
  162. package/dist/lib/local_state.d.ts.map +0 -1
  163. package/dist/lib/local_state.js +0 -27
  164. package/dist/lib/local_state.js.map +0 -1
  165. package/dist/lib/outputs.d.ts +0 -19
  166. package/dist/lib/outputs.d.ts.map +0 -1
  167. package/dist/lib/outputs.js +0 -45
  168. package/dist/lib/outputs.js.map +0 -1
  169. package/dist/lib/project_analyzer.d.ts +0 -4
  170. package/dist/lib/project_analyzer.d.ts.map +0 -1
  171. package/dist/lib/project_analyzer.js +0 -30
  172. package/dist/lib/project_analyzer.js.map +0 -1
  173. package/dist/lib/projects/CrawleeAnalyzer.d.ts +0 -4
  174. package/dist/lib/projects/CrawleeAnalyzer.d.ts.map +0 -1
  175. package/dist/lib/projects/CrawleeAnalyzer.js +0 -20
  176. package/dist/lib/projects/CrawleeAnalyzer.js.map +0 -1
  177. package/dist/lib/projects/OldApifySDKAnalyzer.d.ts +0 -4
  178. package/dist/lib/projects/OldApifySDKAnalyzer.d.ts.map +0 -1
  179. package/dist/lib/projects/OldApifySDKAnalyzer.js +0 -38
  180. package/dist/lib/projects/OldApifySDKAnalyzer.js.map +0 -1
  181. package/dist/lib/projects/scrapy/ScrapyProjectAnalyzer.d.ts +0 -17
  182. package/dist/lib/projects/scrapy/ScrapyProjectAnalyzer.d.ts.map +0 -1
  183. package/dist/lib/projects/scrapy/ScrapyProjectAnalyzer.js +0 -87
  184. package/dist/lib/projects/scrapy/ScrapyProjectAnalyzer.js.map +0 -1
  185. package/dist/lib/projects/scrapy/Spider.d.ts +0 -14
  186. package/dist/lib/projects/scrapy/Spider.d.ts.map +0 -1
  187. package/dist/lib/projects/scrapy/Spider.js +0 -33
  188. package/dist/lib/projects/scrapy/Spider.js.map +0 -1
  189. package/dist/lib/projects/scrapy/SpiderFileAnalyzer.d.ts +0 -7
  190. package/dist/lib/projects/scrapy/SpiderFileAnalyzer.d.ts.map +0 -1
  191. package/dist/lib/projects/scrapy/SpiderFileAnalyzer.js +0 -25
  192. package/dist/lib/projects/scrapy/SpiderFileAnalyzer.js.map +0 -1
  193. package/dist/lib/projects/scrapy/wrapScrapyProject.d.ts +0 -4
  194. package/dist/lib/projects/scrapy/wrapScrapyProject.d.ts.map +0 -1
  195. package/dist/lib/projects/scrapy/wrapScrapyProject.js +0 -109
  196. package/dist/lib/projects/scrapy/wrapScrapyProject.js.map +0 -1
  197. package/dist/lib/projects/shared.d.ts +0 -2
  198. package/dist/lib/projects/shared.d.ts.map +0 -1
  199. package/dist/lib/projects/shared.js +0 -13
  200. package/dist/lib/projects/shared.js.map +0 -1
  201. package/dist/lib/secrets.d.ts +0 -22
  202. package/dist/lib/secrets.d.ts.map +0 -1
  203. package/dist/lib/secrets.js +0 -104
  204. package/dist/lib/secrets.js.map +0 -1
  205. package/dist/lib/telemetry.d.ts +0 -21
  206. package/dist/lib/telemetry.d.ts.map +0 -1
  207. package/dist/lib/telemetry.js +0 -87
  208. package/dist/lib/telemetry.js.map +0 -1
  209. package/dist/lib/types.d.ts +0 -11
  210. package/dist/lib/types.d.ts.map +0 -1
  211. package/dist/lib/types.js +0 -2
  212. package/dist/lib/types.js.map +0 -1
  213. package/dist/lib/utils.d.ts +0 -105
  214. package/dist/lib/utils.d.ts.map +0 -1
  215. package/dist/lib/utils.js +0 -575
  216. package/dist/lib/utils.js.map +0 -1
  217. package/dist/lib/version_check.d.ts +0 -14
  218. package/dist/lib/version_check.d.ts.map +0 -1
  219. package/dist/lib/version_check.js +0 -90
  220. package/dist/lib/version_check.js.map +0 -1
  221. package/oclif.manifest.json +0 -815
@@ -1 +0,0 @@
1
- {"version":3,"file":"push.d.ts","sourceRoot":"","sources":["../../src/commands/push.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AA6BvD,qBAAa,WAAY,SAAQ,YAAY,CAAC,OAAO,WAAW,CAAC;IAC7D,OAAgB,WAAW,SAI4H;IAEvJ,OAAgB,KAAK;;;;;;;MAgCnB;IAEF,OAAgB,IAAI;;MAMlB;IAGa,KAAK,CAAC,WAAW,EAAE,KAAK;IAIjC,GAAG;CA8NZ"}
@@ -1,298 +0,0 @@
1
- import { readFileSync, unlinkSync, statSync } from 'node:fs';
2
- import { join } from 'node:path';
3
- import process from 'node:process';
4
- import { fetchManifest } from '@apify/actor-templates';
5
- import { ACTOR_JOB_STATUSES, ACTOR_SOURCE_TYPES, MAX_MULTIFILE_BYTES } from '@apify/consts';
6
- import { Args, Flags } from '@oclif/core';
7
- import inquirer from 'inquirer';
8
- import isCI from 'is-ci';
9
- import open from 'open';
10
- import { ApifyCommand } from '../lib/apify_command.js';
11
- import { CommandExitCodes, DEPRECATED_LOCAL_CONFIG_NAME, LOCAL_CONFIG_PATH, UPLOADS_STORE_NAME } from '../lib/consts.js';
12
- import { sumFilesSizeInBytes } from '../lib/files.js';
13
- import { error, info, link, run, success, warning } from '../lib/outputs.js';
14
- import { transformEnvToEnvVars } from '../lib/secrets.js';
15
- import { createActZip, createSourceFiles, getActorLocalFilePaths, getLocalConfigOrThrow, getLocalUserInfo, getLoggedClientOrThrow, outputJobLog, } from '../lib/utils.js';
16
- const TEMP_ZIP_FILE_NAME = 'temp_file.zip';
17
- const DEFAULT_RUN_OPTIONS = {
18
- build: 'latest',
19
- memoryMbytes: 4096,
20
- timeoutSecs: 3600,
21
- };
22
- const DEFAULT_ACTOR_VERSION_NUMBER = '0.0';
23
- // It would be better to use `version-0.0` or similar,
24
- // or even have no default tag, but the platform complains when
25
- // Actor does not have a build with a `latest` tag, so until
26
- // that changes, we have to add it.
27
- const DEFAULT_BUILD_TAG = 'latest';
28
- export class PushCommand extends ApifyCommand {
29
- // TODO: Global handler in ApifyCommand
30
- async catch(caughtError) {
31
- throw caughtError;
32
- }
33
- async run() {
34
- const cwd = process.cwd();
35
- // Validate there are files before rest of the logic
36
- const filePathsToPush = await getActorLocalFilePaths(cwd);
37
- if (!filePathsToPush.length) {
38
- error({ message: 'You need to call this command from a folder that has an Actor in it!' });
39
- process.exitCode = CommandExitCodes.NoFilesToPush;
40
- return;
41
- }
42
- if (
43
- // Check that some of these files exist, cuz otherwise we cannot do much
44
- ![
45
- // old apify project
46
- DEPRECATED_LOCAL_CONFIG_NAME,
47
- // new apify project
48
- 'actor.json',
49
- '.actor/actor.json',
50
- // The .actor folder existing in general
51
- '.actor',
52
- ].some((filePath) => filePathsToPush.some((fp) => fp === filePath || fp.startsWith(filePath)))) {
53
- error({
54
- message: [
55
- 'A valid Actor could not be found in the current directory. Please make sure you are in the correct directory.',
56
- 'You can also turn this directory into an Actor by running `apify init`.',
57
- ].join('\n'),
58
- });
59
- process.exitCode = CommandExitCodes.NoFilesToPush;
60
- return;
61
- }
62
- const apifyClient = await getLoggedClientOrThrow();
63
- const localConfig = await getLocalConfigOrThrow(cwd);
64
- const userInfo = await getLocalUserInfo();
65
- const isOrganizationLoggedIn = !!userInfo.organizationOwnerUserId;
66
- const redirectUrlPart = isOrganizationLoggedIn ? `/organization/${userInfo.id}` : '';
67
- let actorId;
68
- let actor;
69
- let isActorCreatedNow = false;
70
- // User can override Actor version and build tag, attributes in localConfig will remain same.
71
- const version = this.flags.version || this.flags.versionNumber || localConfig?.version || DEFAULT_ACTOR_VERSION_NUMBER;
72
- let buildTag = this.flags.buildTag || localConfig.buildTag;
73
- // We can't add the default build tag to everything. If a user creates a new
74
- // version, e.g. for testing, but forgets to add a tag, it would use the default
75
- // tag and their production runs might be affected ❌
76
- // TODO: revisit this when we have better build tagging system on platform.
77
- if (!buildTag && version === DEFAULT_ACTOR_VERSION_NUMBER) {
78
- buildTag = DEFAULT_BUILD_TAG;
79
- }
80
- const waitForFinishMillis = Number.isNaN(this.flags.waitForFinish)
81
- ? undefined
82
- : Number.parseInt(this.flags.waitForFinish, 10) * 1000;
83
- // User can override actorId of pushing Actor.
84
- // It causes that we push Actor to this id but attributes in localConfig will remain same.
85
- const forceActorId = this.args.actorId;
86
- if (forceActorId) {
87
- actor = (await apifyClient.actor(forceActorId).get());
88
- if (!actor)
89
- throw new Error(`Cannot find Actor with ID '${forceActorId}' in your account.`);
90
- actorId = actor.id;
91
- }
92
- else {
93
- const usernameOrId = userInfo.username || userInfo.id;
94
- actor = (await apifyClient.actor(`${usernameOrId}/${localConfig.name}`).get());
95
- if (actor) {
96
- actorId = actor.id;
97
- }
98
- else {
99
- const { templates } = await fetchManifest();
100
- const actorTemplate = templates.find((t) => t.name === localConfig.template);
101
- const defaultRunOptions = (actorTemplate?.defaultRunOptions || DEFAULT_RUN_OPTIONS);
102
- const newActor = {
103
- name: localConfig.name,
104
- defaultRunOptions,
105
- versions: [{
106
- versionNumber: version,
107
- buildTag,
108
- // TODO: export enum from apify-client
109
- sourceType: ACTOR_SOURCE_TYPES.SOURCE_FILES,
110
- sourceFiles: [],
111
- }],
112
- };
113
- actor = await apifyClient.actors().create(newActor);
114
- actorId = actor.id;
115
- isActorCreatedNow = true;
116
- info({ message: `Created Actor with name ${localConfig.name} on Apify.` });
117
- }
118
- }
119
- info({ message: `Deploying Actor '${localConfig.name}' to Apify.` });
120
- const filesSize = await sumFilesSizeInBytes(filePathsToPush, cwd);
121
- const actorClient = apifyClient.actor(actorId);
122
- let sourceType;
123
- let sourceFiles;
124
- let tarballUrl;
125
- if (filesSize < MAX_MULTIFILE_BYTES) {
126
- const client = await actorClient.get();
127
- if (!isActorCreatedNow) {
128
- // Check when was files modified last
129
- const mostRecentModifiedFileMs = filePathsToPush.reduce((modifiedMs, filePath) => {
130
- const { mtimeMs, ctimeMs } = statSync(join(cwd, filePath));
131
- // Sometimes it's possible mtimeMs is some messed up value (like 2000/01/01 midnight), then we want to check created if it's newer
132
- const fileModifiedMs = mtimeMs > ctimeMs ? mtimeMs : ctimeMs;
133
- return modifiedMs > fileModifiedMs ? modifiedMs : fileModifiedMs;
134
- }, 0);
135
- const actorModifiedMs = client?.modifiedAt.valueOf();
136
- if (!this.flags.force && actorModifiedMs && mostRecentModifiedFileMs < actorModifiedMs && (localConfig?.name || forceActorId)) {
137
- throw new Error(`Actor with identifier "${localConfig?.name || forceActorId}" is already on the platform and was modified there since modified locally.
138
- Skipping push. Use --force to override.`);
139
- }
140
- }
141
- sourceFiles = await createSourceFiles(filePathsToPush, cwd);
142
- sourceType = ACTOR_SOURCE_TYPES.SOURCE_FILES;
143
- }
144
- else {
145
- // Create zip
146
- run({ message: 'Zipping Actor files' });
147
- await createActZip(TEMP_ZIP_FILE_NAME, filePathsToPush, cwd);
148
- // Upload it to Apify.keyValueStores
149
- const store = await apifyClient.keyValueStores().getOrCreate(UPLOADS_STORE_NAME);
150
- const key = `${actor.name}-${version}.zip`;
151
- const buffer = readFileSync(TEMP_ZIP_FILE_NAME);
152
- await apifyClient.keyValueStore(store.id).setRecord({
153
- key,
154
- // TODO: fix this type too
155
- value: buffer,
156
- contentType: 'application/zip',
157
- });
158
- unlinkSync(TEMP_ZIP_FILE_NAME);
159
- tarballUrl = `${apifyClient.baseUrl}/key-value-stores/${store.id}/records/${key}?disableRedirect=true`;
160
- sourceType = ACTOR_SOURCE_TYPES.TARBALL;
161
- }
162
- // Update Actor version
163
- const actorCurrentVersion = await actorClient.version(version).get();
164
- const envVars = localConfig.environmentVariables
165
- ? transformEnvToEnvVars(localConfig.environmentVariables)
166
- : undefined;
167
- if (actorCurrentVersion) {
168
- const actorVersionModifier = { tarballUrl, sourceFiles, buildTag, sourceType, envVars };
169
- // TODO: fix this type too -.-
170
- await actorClient.version(version).update(actorVersionModifier);
171
- run({ message: `Updated version ${version} for Actor ${actor.name}.` });
172
- }
173
- else {
174
- const actorNewVersion = {
175
- versionNumber: version,
176
- tarballUrl,
177
- sourceFiles,
178
- buildTag,
179
- sourceType,
180
- envVars,
181
- };
182
- await actorClient.versions().create({
183
- ...actorNewVersion,
184
- });
185
- run({ message: `Created version ${version} for Actor ${actor.name}.` });
186
- }
187
- // Build Actor on Apify and wait for build to finish
188
- run({ message: `Building Actor ${actor.name}` });
189
- let build = await actorClient.build(version, {
190
- useCache: true,
191
- waitForFinish: 2, // NOTE: We need to wait some time to Apify open stream and we can create connection
192
- });
193
- try {
194
- await outputJobLog(build, waitForFinishMillis);
195
- }
196
- catch (err) {
197
- warning({ message: 'Can not get log:' });
198
- console.error(err);
199
- }
200
- build = (await apifyClient.build(build.id).get());
201
- link({ message: 'Actor build detail', url: `https://console.apify.com${redirectUrlPart}/actors/${build.actId}#/builds/${build.buildNumber}` });
202
- // Disable open browser on CI, or if user passed --no-prompt flag
203
- if (!isCI && !this.flags.noPrompt) {
204
- const shouldOpenBrowser = await inquirer.prompt([
205
- { type: 'confirm', name: 'continue', message: 'Do you want to open the Actor detail in your browser?', default: true },
206
- ]);
207
- if (shouldOpenBrowser.continue) {
208
- await open(`https://console.apify.com${redirectUrlPart}/actors/${build.actId}`);
209
- }
210
- }
211
- if (build.status === ACTOR_JOB_STATUSES.SUCCEEDED) {
212
- success({ message: 'Actor was deployed to Apify cloud and built there.' });
213
- // @ts-expect-error FIX THESE TYPES 😢
214
- }
215
- else if (build.status === ACTOR_JOB_STATUSES.READY) {
216
- warning({ message: 'Build is waiting for allocation.' });
217
- // @ts-expect-error FIX THESE TYPES 😢
218
- }
219
- else if (build.status === ACTOR_JOB_STATUSES.RUNNING) {
220
- warning({ message: 'Build is still running.' });
221
- // @ts-expect-error FIX THESE TYPES 😢
222
- }
223
- else if (build.status === ACTOR_JOB_STATUSES.ABORTED || build.status === ACTOR_JOB_STATUSES.ABORTING) {
224
- warning({ message: 'Build was aborted!' });
225
- process.exitCode = CommandExitCodes.BuildAborted;
226
- // @ts-expect-error FIX THESE TYPES 😢
227
- }
228
- else if (build.status === ACTOR_JOB_STATUSES.TIMED_OUT || build.status === ACTOR_JOB_STATUSES.TIMING_OUT) {
229
- warning({ message: 'Build timed out!' });
230
- process.exitCode = CommandExitCodes.BuildTimedOut;
231
- }
232
- else {
233
- error({ message: 'Build failed!' });
234
- process.exitCode = CommandExitCodes.BuildFailed;
235
- }
236
- }
237
- }
238
- Object.defineProperty(PushCommand, "description", {
239
- enumerable: true,
240
- configurable: true,
241
- writable: true,
242
- value: 'Uploads the Actor to the Apify platform and builds it there.\n'
243
- + `The Actor settings are read from the "${LOCAL_CONFIG_PATH}" file in the current directory, but they can be overridden using command-line options.\n`
244
- + `NOTE: If the source files are smaller than ${MAX_MULTIFILE_BYTES / (1024 ** 2)} MB then they are uploaded as \n`
245
- + '"Multiple source files", otherwise they are uploaded as "Zip file".\n\n'
246
- + 'When there\'s an attempt to push files that are older than the Actor on the platform, the command will fail. Can be overwritten with --force flag.'
247
- });
248
- Object.defineProperty(PushCommand, "flags", {
249
- enumerable: true,
250
- configurable: true,
251
- writable: true,
252
- value: {
253
- 'version-number': Flags.string({
254
- description: 'DEPRECATED: Use flag version instead. Actor version number to which the files should be pushed. '
255
- + `By default, it is taken from the "${LOCAL_CONFIG_PATH}" file.`,
256
- required: false,
257
- deprecated: true,
258
- }),
259
- version: Flags.string({
260
- char: 'v',
261
- description: `Actor version number to which the files should be pushed. By default, it is taken from the "${LOCAL_CONFIG_PATH}" file.`,
262
- required: false,
263
- }),
264
- 'build-tag': Flags.string({
265
- char: 'b',
266
- description: `Build tag to be applied to the successful Actor build. By default, it is taken from the "${LOCAL_CONFIG_PATH}" file`,
267
- required: false,
268
- }),
269
- 'wait-for-finish': Flags.string({
270
- char: 'w',
271
- description: 'Seconds for waiting to build to finish, if no value passed, it waits forever.',
272
- required: false,
273
- }),
274
- 'no-prompt': Flags.boolean({
275
- description: 'Do not prompt for opening the Actor details in a browser. This will also not open the browser automatically.',
276
- default: false,
277
- required: false,
278
- }),
279
- force: Flags.boolean({
280
- description: 'Push an Actor even when the local files are older than the Actor on the platform.',
281
- default: false,
282
- required: false,
283
- }),
284
- }
285
- });
286
- Object.defineProperty(PushCommand, "args", {
287
- enumerable: true,
288
- configurable: true,
289
- writable: true,
290
- value: {
291
- actorId: Args.string({
292
- required: false,
293
- description: 'Name or ID of the Actor to push (e.g. "apify/hello-world" or "E2jjCZBezvAZnX8Rb"). '
294
- + `If not provided, the command will create or modify the Actor with the name specified in "${LOCAL_CONFIG_PATH}" file.`,
295
- }),
296
- }
297
- });
298
- //# sourceMappingURL=push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8G;YAC3H,OAAO,EAAE,KAAK;YACd,QAAQ,EAAE,KAAK;SAClB,CAAC;QACF,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC;YACjB,WAAW,EAAE,mFAAmF;YAChG,OAAO,EAAE,KAAK;YACd,QAAQ,EAAE,KAAK;SAClB,CAAC;KACL;GAAC;AAEc;;;;WAAO;QACnB,OAAO,EAAE,IAAI,CAAC,MAAM,CAAC;YACjB,QAAQ,EAAE,KAAK;YACf,WAAW,EAAE,qFAAqF;kBAC5F,4FAA4F,iBAAiB,SAAS;SAC/H,CAAC;KACL;GAAC"}
@@ -1,13 +0,0 @@
1
- import { ApifyCommand } from '../lib/apify_command.js';
2
- export declare class RunCommand extends ApifyCommand<typeof RunCommand> {
3
- static description: string;
4
- static flags: {
5
- purge: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
6
- 'purge-queue': import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
7
- 'purge-dataset': import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
8
- 'purge-key-value-store': import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
9
- entrypoint: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
10
- };
11
- run(): Promise<void>;
12
- }
13
- //# sourceMappingURL=run.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../src/commands/run.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAsBvD,qBAAa,UAAW,SAAQ,YAAY,CAAC,OAAO,UAAU,CAAC;IAC3D,OAAgB,WAAW,SAOwD;IAEnF,OAAgB,KAAK;;;;;;MA6BnB;IAEI,GAAG;CAyMZ"}
@@ -1,257 +0,0 @@
1
- import { existsSync, renameSync } from 'node:fs';
2
- import { stat } from 'node:fs/promises';
3
- import { join } from 'node:path';
4
- import process from 'node:process';
5
- import { APIFY_ENV_VARS } from '@apify/consts';
6
- import { Flags } from '@oclif/core';
7
- import { loadJsonFile } from 'load-json-file';
8
- import { minVersion } from 'semver';
9
- import { ApifyCommand } from '../lib/apify_command.js';
10
- import { DEFAULT_LOCAL_STORAGE_DIR, LANGUAGE, LEGACY_LOCAL_STORAGE_DIR, PROJECT_TYPES, SUPPORTED_NODEJS_VERSION } from '../lib/consts.js';
11
- import { execWithLog } from '../lib/exec.js';
12
- import { error, info, warning } from '../lib/outputs.js';
13
- import { ProjectAnalyzer } from '../lib/project_analyzer.js';
14
- import { ScrapyProjectAnalyzer } from '../lib/projects/scrapy/ScrapyProjectAnalyzer.js';
15
- import { replaceSecretsValue } from '../lib/secrets.js';
16
- import { checkIfStorageIsEmpty, detectLocalActorLanguage, getLocalConfigOrThrow, getLocalStorageDir, getLocalUserInfo, getNpmCmd, getPythonCommand, isNodeVersionSupported, isPythonVersionSupported, purgeDefaultDataset, purgeDefaultKeyValueStore, purgeDefaultQueue, } from '../lib/utils.js';
17
- export class RunCommand extends ApifyCommand {
18
- async run() {
19
- const cwd = process.cwd();
20
- const { proxy, id: userId, token } = await getLocalUserInfo();
21
- const localConfig = await getLocalConfigOrThrow(cwd);
22
- const packageJsonPath = join(cwd, 'package.json');
23
- const mainPyPath = join(cwd, 'src/__main__.py');
24
- const projectType = ProjectAnalyzer.getProjectType(cwd);
25
- const actualStoragePath = getLocalStorageDir();
26
- const packageJsonExists = existsSync(packageJsonPath);
27
- const mainPyExists = existsSync(mainPyPath);
28
- const isScrapyProject = projectType === PROJECT_TYPES.SCRAPY;
29
- const { language, languageVersion } = detectLocalActorLanguage(cwd);
30
- if (!packageJsonExists && !mainPyExists && !isScrapyProject) {
31
- throw new Error('Actor is of an unknown format.'
32
- + ` Make sure either the 'package.json' file or 'src/__main__.py' file exists or you are in a migrated Scrapy project.`);
33
- }
34
- // Defaults (for node, the start script, for python, the src module)
35
- let runType = language === LANGUAGE.NODEJS ? RunType.Script : RunType.Module;
36
- let entrypoint = language === LANGUAGE.NODEJS ? 'start' : 'src';
37
- if (this.flags.entrypoint) {
38
- entrypoint = this.flags.entrypoint;
39
- const entrypointPath = join(cwd, this.flags.entrypoint);
40
- const entrypointStat = await stat(entrypointPath).catch(() => null);
41
- // Directory -> We just try to run it as a module (in python, it needs to have a main.py file, in node.js, an index.(m)js file)
42
- if (entrypointStat?.isDirectory()) {
43
- runType = RunType.Module;
44
- // entrypoint -> ./src/file for example (running custom scripts)
45
- }
46
- else if (entrypointStat?.isFile()) {
47
- runType = RunType.DirectFile;
48
- // If it's not a file, or a directory, we just let it be a script
49
- }
50
- else {
51
- runType = RunType.Script;
52
- }
53
- }
54
- if (existsSync(LEGACY_LOCAL_STORAGE_DIR) && !existsSync(actualStoragePath)) {
55
- renameSync(LEGACY_LOCAL_STORAGE_DIR, actualStoragePath);
56
- warning({
57
- message: `The legacy 'apify_storage' directory was renamed to '${actualStoragePath}' to align it with Apify SDK v3.`
58
- + ' Contents were left intact.',
59
- });
60
- }
61
- let CRAWLEE_PURGE_ON_START = '0';
62
- // Purge stores
63
- // TODO: this needs to be cleaned up heavily - ideally logic should be in the project analyzers
64
- if (this.flags.purge) {
65
- switch (projectType) {
66
- case PROJECT_TYPES.PRE_CRAWLEE_APIFY_SDK: {
67
- await Promise.all([purgeDefaultQueue(), purgeDefaultKeyValueStore(), purgeDefaultDataset()]);
68
- info({ message: 'All default local stores were purged.' });
69
- break;
70
- }
71
- case PROJECT_TYPES.CRAWLEE:
72
- default: {
73
- CRAWLEE_PURGE_ON_START = '1';
74
- }
75
- }
76
- if (language === LANGUAGE.PYTHON) {
77
- await Promise.all([purgeDefaultQueue(), purgeDefaultKeyValueStore(), purgeDefaultDataset()]);
78
- info({ message: 'All default local stores were purged.' });
79
- }
80
- }
81
- // TODO: deprecate these flags
82
- if (this.flags.purgeQueue && !this.flags.purge) {
83
- await purgeDefaultQueue();
84
- info({ message: 'Default local request queue was purged.' });
85
- }
86
- if (this.flags.purgeDataset && !this.flags.purge) {
87
- await purgeDefaultDataset();
88
- info({ message: 'Default local dataset was purged.' });
89
- }
90
- if (this.flags.purgeKeyValueStore && !this.flags.purge) {
91
- await purgeDefaultKeyValueStore();
92
- info({ message: 'Default local key-value store was purged.' });
93
- }
94
- if (!this.flags.purge) {
95
- const isStorageEmpty = await checkIfStorageIsEmpty();
96
- if (!isStorageEmpty) {
97
- warning({
98
- message: 'The storage directory contains a previous state, the Actor will continue where it left off. '
99
- + 'To start from the initial state, use --purge parameter to clean the storage directory.',
100
- });
101
- }
102
- }
103
- // Attach env vars from local config files
104
- const localEnvVars = {
105
- [APIFY_ENV_VARS.LOCAL_STORAGE_DIR]: actualStoragePath,
106
- CRAWLEE_STORAGE_DIR: actualStoragePath,
107
- CRAWLEE_PURGE_ON_START,
108
- };
109
- if (proxy && proxy.password)
110
- localEnvVars[APIFY_ENV_VARS.PROXY_PASSWORD] = proxy.password;
111
- if (userId)
112
- localEnvVars[APIFY_ENV_VARS.USER_ID] = userId;
113
- if (token)
114
- localEnvVars[APIFY_ENV_VARS.TOKEN] = token;
115
- if (localConfig.environmentVariables) {
116
- const updatedEnv = replaceSecretsValue(localConfig.environmentVariables);
117
- Object.assign(localEnvVars, updatedEnv);
118
- }
119
- // NOTE: User can overwrite env vars
120
- const env = Object.assign(localEnvVars, process.env);
121
- if (!userId) {
122
- warning({
123
- message: 'You are not logged in with your Apify Account. Some features like Apify Proxy will not work. Call "apify login" to fix that.',
124
- });
125
- }
126
- if (language === LANGUAGE.NODEJS) { // Actor is written in Node.js
127
- const currentNodeVersion = languageVersion;
128
- const minimumSupportedNodeVersion = minVersion(SUPPORTED_NODEJS_VERSION);
129
- if (currentNodeVersion) {
130
- // --max-http-header-size=80000
131
- // Increases default size of headers. The original limit was 80kb, but from node 10+ they decided to lower it to 8kb.
132
- // However they did not think about all the sites there with large headers,
133
- // so we put back the old limit of 80kb, which seems to work just fine.
134
- if (isNodeVersionSupported(currentNodeVersion)) {
135
- env.NODE_OPTIONS = env.NODE_OPTIONS ? `${env.NODE_OPTIONS} --max-http-header-size=80000` : '--max-http-header-size=80000';
136
- }
137
- else {
138
- warning({
139
- message: `You are running Node.js version ${currentNodeVersion}, which is no longer supported. `
140
- + `Please upgrade to Node.js version ${minimumSupportedNodeVersion} or later.`,
141
- });
142
- }
143
- this.telemetryData.actorNodejsVersion = currentNodeVersion;
144
- this.telemetryData.actorLanguage = LANGUAGE.NODEJS;
145
- // We allow "module" type directly in node too (it will work for a folder that has an `index.js` file)
146
- if (runType === RunType.DirectFile || runType === RunType.Module) {
147
- await execWithLog('node', [entrypoint], { env, cwd });
148
- }
149
- else {
150
- // TODO(vladfrangu): what is this for? Some old template maybe?
151
- // && !existsSync(serverJsFile)
152
- // const serverJsFile = join(cwd, 'server.js');
153
- const packageJson = await loadJsonFile(packageJsonPath);
154
- if (!packageJson.scripts) {
155
- throw new Error('No scripts were found in package.json. Please set it up for your project. '
156
- + 'For more information about that call "apify help run".');
157
- }
158
- if (!packageJson.scripts[entrypoint]) {
159
- throw new Error(`The script "${entrypoint}" was not found in package.json. Please set it up for your project. `
160
- + 'For more information about that call "apify help run".');
161
- }
162
- await execWithLog(getNpmCmd(), ['run', entrypoint], { env, cwd });
163
- }
164
- }
165
- else {
166
- error({
167
- message: `No Node.js detected! Please install Node.js ${minimumSupportedNodeVersion} or higher to be able to run Node.js Actors locally.`,
168
- });
169
- }
170
- }
171
- else if (language === LANGUAGE.PYTHON) {
172
- const pythonVersion = languageVersion;
173
- this.telemetryData.actorPythonVersion = pythonVersion;
174
- this.telemetryData.actorLanguage = LANGUAGE.PYTHON;
175
- if (pythonVersion) {
176
- if (isPythonVersionSupported(pythonVersion)) {
177
- const pythonCommand = getPythonCommand(cwd);
178
- if (isScrapyProject && !this.flags.entrypoint) {
179
- const project = new ScrapyProjectAnalyzer(cwd);
180
- project.loadScrapyCfg();
181
- if (project.configuration.hasKey('apify', 'mainpy_location')) {
182
- entrypoint = project.configuration.get('apify', 'mainpy_location');
183
- }
184
- }
185
- if (runType === RunType.Module) {
186
- await execWithLog(pythonCommand, ['-m', entrypoint], { env, cwd });
187
- }
188
- else {
189
- await execWithLog(pythonCommand, [entrypoint], { env, cwd });
190
- }
191
- }
192
- else {
193
- error({ message: `Python Actors require Python 3.8 or higher, but you have Python ${pythonVersion}!` });
194
- error({ message: 'Please install Python 3.8 or higher to be able to run Python Actors locally.' });
195
- }
196
- }
197
- else {
198
- error({ message: 'No Python detected! Please install Python 3.8 or higher to be able to run Python Actors locally.' });
199
- }
200
- }
201
- }
202
- }
203
- Object.defineProperty(RunCommand, "description", {
204
- enumerable: true,
205
- configurable: true,
206
- writable: true,
207
- value: 'Runs the Actor locally in the current directory.\n'
208
- + 'It sets various APIFY_XYZ environment variables '
209
- + 'in order to provide a working execution environment for the Actor. For example, this causes '
210
- + 'the Actor input, as well as all other data in key-value stores, '
211
- + `datasets or request queues to be stored in the "${DEFAULT_LOCAL_STORAGE_DIR}" directory, `
212
- + 'rather than on the Apify platform.\n\n'
213
- + 'NOTE: You can override the command\'s default behavior for Node.js Actors by overriding the "start" script in the package.json file. '
214
- + 'You can set up your own main file or environment variables by changing it.'
215
- });
216
- Object.defineProperty(RunCommand, "flags", {
217
- enumerable: true,
218
- configurable: true,
219
- writable: true,
220
- value: {
221
- purge: Flags.boolean({
222
- char: 'p',
223
- description: 'Shortcut that combines the --purge-queue, --purge-dataset and --purge-key-value-store options.',
224
- required: false,
225
- }),
226
- 'purge-queue': Flags.boolean({
227
- description: 'Deletes the local directory containing the default request queue before the run starts.',
228
- required: false,
229
- }),
230
- 'purge-dataset': Flags.boolean({
231
- description: 'Deletes the local directory containing the default dataset before the run starts.',
232
- required: false,
233
- }),
234
- 'purge-key-value-store': Flags.boolean({
235
- description: 'Deletes all records from the default key-value store in the local directory before the run starts, except for the "INPUT" key.',
236
- required: false,
237
- }),
238
- entrypoint: Flags.string({
239
- description: [
240
- 'Optional entrypoint for running with injected environment variables.',
241
- '\n',
242
- 'For Python, it is the module name, or a path to a file.',
243
- '\n',
244
- 'For node.js, it is the npm script name, or a path to a JS/MJS file.',
245
- 'You can also pass in a directory name, provided that directory contains an "index.js" file.',
246
- ].join(' '),
247
- required: false,
248
- }),
249
- }
250
- });
251
- var RunType;
252
- (function (RunType) {
253
- RunType[RunType["DirectFile"] = 0] = "DirectFile";
254
- RunType[RunType["Module"] = 1] = "Module";
255
- RunType[RunType["Script"] = 2] = "Script";
256
- })(RunType || (RunType = {}));
257
- //# sourceMappingURL=run.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"run.js","sourceRoot":"","sources":["../../src/commands/run.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACjD,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACxC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,OAAO,MAAM,cAAc,CAAC;AAEnC,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAEpC,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,yBAAyB,EAAE,QAAQ,EAAE,wBAAwB,EAAE,aAAa,EAAE,wBAAwB,EAAE,MAAM,kBAAkB,CAAC;AAC1I,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAE,qBAAqB,EAAE,MAAM,iDAAiD,CAAC;AACxF,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;A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K;SAClB,CAAC;KACL;GAAC;AA6MN,IAAK,OAIJ;AAJD,WAAK,OAAO;IACR,iDAAU,CAAA;IACV,yCAAM,CAAA;IACN,yCAAM,CAAA;AACV,CAAC,EAJI,OAAO,KAAP,OAAO,QAIX"}
@@ -1,10 +0,0 @@
1
- import { ApifyCommand } from '../../lib/apify_command.js';
2
- export declare class SecretsAddCommand extends ApifyCommand<typeof SecretsAddCommand> {
3
- static description: string;
4
- static args: {
5
- name: import("@oclif/core/lib/interfaces/parser.js").Arg<string, Record<string, unknown>>;
6
- value: import("@oclif/core/lib/interfaces/parser.js").Arg<string, Record<string, unknown>>;
7
- };
8
- run(): Promise<void>;
9
- }
10
- //# sourceMappingURL=add.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"add.d.ts","sourceRoot":"","sources":["../../../src/commands/secrets/add.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAG1D,qBAAa,iBAAkB,SAAQ,YAAY,CAAC,OAAO,iBAAiB,CAAC;IACzE,OAAgB,WAAW,SAA4E;IAEvG,OAAgB,IAAI;;;MASlB;IAEI,GAAG;CAKZ"}