apify 3.0.0-alpha.2 → 3.0.0-alpha.20

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/utils.js ADDED
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.printOutdatedSdkWarning = exports.logSystemInfo = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const log_1 = tslib_1.__importDefault(require("@apify/log"));
6
+ const consts_1 = require("@apify/consts");
7
+ const node_os_1 = require("node:os");
8
+ const semver_1 = tslib_1.__importDefault(require("semver"));
9
+ // @ts-expect-error if we enable resolveJsonModule, we end up with `src` folder in `dist`
10
+ const package_json_1 = require("apify-client/package.json");
11
+ // @ts-expect-error if we enable resolveJsonModule, we end up with `src` folder in `dist`
12
+ const package_json_2 = require("./package.json");
13
+ /**
14
+ * Logs info about system, node version and apify package version.
15
+ * @internal
16
+ */
17
+ function logSystemInfo() {
18
+ log_1.default.info('System info', {
19
+ apifyVersion: package_json_2.version,
20
+ apifyClientVersion: package_json_1.version,
21
+ osType: (0, node_os_1.type)(),
22
+ nodeVersion: process.version,
23
+ });
24
+ }
25
+ exports.logSystemInfo = logSystemInfo;
26
+ /**
27
+ * Prints a warning if this version of Apify SDK is outdated.
28
+ * @ignore
29
+ */
30
+ function printOutdatedSdkWarning() {
31
+ if (process.env[consts_1.ENV_VARS.DISABLE_OUTDATED_WARNING])
32
+ return;
33
+ const latestApifyVersion = process.env[consts_1.ENV_VARS.SDK_LATEST_VERSION];
34
+ if (!latestApifyVersion || !semver_1.default.lt(package_json_2.version, latestApifyVersion))
35
+ return;
36
+ log_1.default.warning(`You are using an outdated version (${package_json_2.version}) of Apify SDK. We recommend you to update to the latest version (${latestApifyVersion}).
37
+ Read more about Apify SDK versioning at: https://help.apify.com/en/articles/3184510-updates-and-versioning-of-apify-sdk`);
38
+ }
39
+ exports.printOutdatedSdkWarning = printOutdatedSdkWarning;
40
+ //# sourceMappingURL=utils.js.map
package/utils.js.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":";;;;AAAA,6DAA6B;AAC7B,0CAAyC;AACzC,qCAA+B;AAC/B,4DAA4B;AAE5B,yFAAyF;AACzF,4DAA0E;AAC1E,yFAAyF;AACzF,kDAA0D;AAE1D;;;GAGG;AACH,SAAgB,aAAa;IACzB,aAAG,CAAC,IAAI,CAAC,aAAa,EAAE;QACpB,YAAY,EAAZ,sBAAY;QACZ,kBAAkB,EAAlB,sBAAkB;QAClB,MAAM,EAAE,IAAA,cAAI,GAAE;QACd,WAAW,EAAE,OAAO,CAAC,OAAO;KAC/B,CAAC,CAAC;AACP,CAAC;AAPD,sCAOC;AAED;;;GAGG;AACH,SAAgB,uBAAuB;IACnC,IAAI,OAAO,CAAC,GAAG,CAAC,iBAAQ,CAAC,wBAAwB,CAAC;QAAE,OAAO;IAC3D,MAAM,kBAAkB,GAAG,OAAO,CAAC,GAAG,CAAC,iBAAQ,CAAC,kBAAkB,CAAC,CAAC;IACpE,IAAI,CAAC,kBAAkB,IAAI,CAAC,gBAAM,CAAC,EAAE,CAAC,sBAAY,EAAE,kBAAkB,CAAC;QAAE,OAAO;IAEhF,aAAG,CAAC,OAAO,CAAC,sCAAsC,sBAAY,qEAAqE,kBAAkB;iIACxB,CAAC,CAAC;AACnI,CAAC;AAPD,0DAOC"}