@8ms/helpers 3.2.4 → 3.2.5
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/dist/aws/lambda/server/AwsLambda.cjs +1 -1
- package/dist/aws/lambda/server/AwsLambda.mjs +1 -1
- package/dist/brightData/serpApi/server/getAsyncRequestId.cjs +1 -1
- package/dist/brightData/serpApi/server/getAsyncRequestId.mjs +1 -1
- package/dist/brightData/serpApi/server/getAsyncResults.cjs +1 -1
- package/dist/brightData/serpApi/server/getAsyncResults.mjs +1 -1
- package/dist/environment/_shared/environment.cjs +8 -4
- package/dist/environment/_shared/environment.d.cts +1 -0
- package/dist/environment/_shared/environment.d.mts +1 -0
- package/dist/environment/_shared/environment.mjs +8 -5
- package/dist/environment/_shared/index.cjs +1 -0
- package/dist/environment/_shared/index.d.cts +2 -2
- package/dist/environment/_shared/index.d.mts +2 -2
- package/dist/environment/_shared/index.mjs +2 -2
- package/dist/environment/client/index.cjs +1 -0
- package/dist/environment/client/index.d.cts +2 -2
- package/dist/environment/client/index.d.mts +2 -2
- package/dist/environment/client/index.mjs +2 -2
- package/dist/environment/server/index.cjs +1 -0
- package/dist/environment/server/index.d.cts +2 -2
- package/dist/environment/server/index.d.mts +2 -2
- package/dist/environment/server/index.mjs +2 -2
- package/package.json +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require__class__shared_BaseNamespace = require("../../../_class/_shared/BaseNamespace.cjs");
|
|
3
3
|
const require_api__shared_ApiResponseClass = require("../../../api/_shared/ApiResponseClass.cjs");
|
|
4
|
-
const require_aws_server_isResponse200 = require("../../server/isResponse200.cjs");
|
|
5
4
|
require("../../../api/_shared/index.cjs");
|
|
5
|
+
const require_aws_server_isResponse200 = require("../../server/isResponse200.cjs");
|
|
6
6
|
//#region src/aws/lambda/server/AwsLambda.ts
|
|
7
7
|
var AwsLambda = class extends require__class__shared_BaseNamespace.BaseNamespace {
|
|
8
8
|
init = async (config, region) => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { BaseNamespace } from "../../../_class/_shared/BaseNamespace.mjs";
|
|
2
2
|
import { ApiResponseClass } from "../../../api/_shared/ApiResponseClass.mjs";
|
|
3
|
-
import { isResponse200 } from "../../server/isResponse200.mjs";
|
|
4
3
|
import "../../../api/_shared/index.mjs";
|
|
4
|
+
import { isResponse200 } from "../../server/isResponse200.mjs";
|
|
5
5
|
//#region src/aws/lambda/server/AwsLambda.ts
|
|
6
6
|
var AwsLambda = class extends BaseNamespace {
|
|
7
7
|
init = async (config, region) => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_brightData_server_brightData = require("../../server/brightData.cjs");
|
|
3
2
|
const require_api__shared_post = require("../../../api/_shared/post.cjs");
|
|
3
|
+
const require_brightData_server_brightData = require("../../server/brightData.cjs");
|
|
4
4
|
const require_brightData_serpApi_server_brightDataSerpApi = require("./brightDataSerpApi.cjs");
|
|
5
5
|
require("./index.cjs");
|
|
6
6
|
//#region src/brightData/serpApi/server/getAsyncRequestId.ts
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { getCustomerId, getZone } from "../../server/brightData.mjs";
|
|
2
1
|
import { post } from "../../../api/_shared/post.mjs";
|
|
2
|
+
import { getCustomerId, getZone } from "../../server/brightData.mjs";
|
|
3
3
|
import { brightDataSerpApiType } from "./brightDataSerpApi.mjs";
|
|
4
4
|
import "./index.mjs";
|
|
5
5
|
//#region src/brightData/serpApi/server/getAsyncRequestId.ts
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_api__shared_ApiResponseClass = require("../../../api/_shared/ApiResponseClass.cjs");
|
|
3
3
|
const require_api__shared_get = require("../../../api/_shared/get.cjs");
|
|
4
|
-
const require_brightData_server_brightData = require("../../server/brightData.cjs");
|
|
5
4
|
require("../../../api/_shared/index.cjs");
|
|
5
|
+
const require_brightData_server_brightData = require("../../server/brightData.cjs");
|
|
6
6
|
//#region src/brightData/serpApi/server/getAsyncResults.ts
|
|
7
7
|
/**
|
|
8
8
|
* Using the request ID from getAsyncRequestId fetch to see if the data is available.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ApiResponseClass } from "../../../api/_shared/ApiResponseClass.mjs";
|
|
2
2
|
import { get } from "../../../api/_shared/get.mjs";
|
|
3
|
-
import { getCustomerId, getZone } from "../../server/brightData.mjs";
|
|
4
3
|
import "../../../api/_shared/index.mjs";
|
|
4
|
+
import { getCustomerId, getZone } from "../../server/brightData.mjs";
|
|
5
5
|
//#region src/brightData/serpApi/server/getAsyncResults.ts
|
|
6
6
|
/**
|
|
7
7
|
* Using the request ID from getAsyncRequestId fetch to see if the data is available.
|
|
@@ -34,12 +34,15 @@ const getEnvironment = () => {
|
|
|
34
34
|
}
|
|
35
35
|
return response;
|
|
36
36
|
};
|
|
37
|
+
const getPlatform = () => {
|
|
38
|
+
return (process.env?.["EMS_PLATFORM"] ?? process.env?.["NEXT_PUBLIC_EMS_PLATFORM"] ?? "").toUpperCase();
|
|
39
|
+
};
|
|
37
40
|
/**
|
|
38
41
|
* Check to see if we are working on AWS Lambda.
|
|
39
42
|
*/
|
|
40
|
-
const isAws = () => platform.AWS ===
|
|
41
|
-
const isVercel = () => platform.VERCEL ===
|
|
42
|
-
const isGoogleCloud = () => platform.GCP ===
|
|
43
|
+
const isAws = () => platform.AWS === getPlatform();
|
|
44
|
+
const isVercel = () => platform.VERCEL === getPlatform();
|
|
45
|
+
const isGoogleCloud = () => platform.GCP === getPlatform();
|
|
43
46
|
/**
|
|
44
47
|
* Some code should only run on the server side to protect the data.
|
|
45
48
|
*/
|
|
@@ -53,10 +56,11 @@ const isProduction = () => environment.PRODUCTION === getEnvironment();
|
|
|
53
56
|
/**
|
|
54
57
|
* Check to see if we are developing locally or on the hosted platform.
|
|
55
58
|
*/
|
|
56
|
-
const isLocalhost = () => platform.LOCALHOST ===
|
|
59
|
+
const isLocalhost = () => platform.LOCALHOST === getPlatform();
|
|
57
60
|
//#endregion
|
|
58
61
|
exports.environment = environment;
|
|
59
62
|
exports.getEnvironment = getEnvironment;
|
|
63
|
+
exports.getPlatform = getPlatform;
|
|
60
64
|
exports.isAws = isAws;
|
|
61
65
|
exports.isDevelopment = isDevelopment;
|
|
62
66
|
exports.isGoogleCloud = isGoogleCloud;
|
|
@@ -16,6 +16,7 @@ export type Platform = typeof platform[keyof typeof platform];
|
|
|
16
16
|
* Determine the environment we're using.
|
|
17
17
|
*/
|
|
18
18
|
export declare const getEnvironment: () => Environment;
|
|
19
|
+
export declare const getPlatform: () => string;
|
|
19
20
|
/**
|
|
20
21
|
* Check to see if we are working on AWS Lambda.
|
|
21
22
|
*/
|
|
@@ -16,6 +16,7 @@ export type Platform = typeof platform[keyof typeof platform];
|
|
|
16
16
|
* Determine the environment we're using.
|
|
17
17
|
*/
|
|
18
18
|
export declare const getEnvironment: () => Environment;
|
|
19
|
+
export declare const getPlatform: () => string;
|
|
19
20
|
/**
|
|
20
21
|
* Check to see if we are working on AWS Lambda.
|
|
21
22
|
*/
|
|
@@ -33,12 +33,15 @@ const getEnvironment = () => {
|
|
|
33
33
|
}
|
|
34
34
|
return response;
|
|
35
35
|
};
|
|
36
|
+
const getPlatform = () => {
|
|
37
|
+
return (process.env?.["EMS_PLATFORM"] ?? process.env?.["NEXT_PUBLIC_EMS_PLATFORM"] ?? "").toUpperCase();
|
|
38
|
+
};
|
|
36
39
|
/**
|
|
37
40
|
* Check to see if we are working on AWS Lambda.
|
|
38
41
|
*/
|
|
39
|
-
const isAws = () => platform.AWS ===
|
|
40
|
-
const isVercel = () => platform.VERCEL ===
|
|
41
|
-
const isGoogleCloud = () => platform.GCP ===
|
|
42
|
+
const isAws = () => platform.AWS === getPlatform();
|
|
43
|
+
const isVercel = () => platform.VERCEL === getPlatform();
|
|
44
|
+
const isGoogleCloud = () => platform.GCP === getPlatform();
|
|
42
45
|
/**
|
|
43
46
|
* Some code should only run on the server side to protect the data.
|
|
44
47
|
*/
|
|
@@ -52,6 +55,6 @@ const isProduction = () => environment.PRODUCTION === getEnvironment();
|
|
|
52
55
|
/**
|
|
53
56
|
* Check to see if we are developing locally or on the hosted platform.
|
|
54
57
|
*/
|
|
55
|
-
const isLocalhost = () => platform.LOCALHOST ===
|
|
58
|
+
const isLocalhost = () => platform.LOCALHOST === getPlatform();
|
|
56
59
|
//#endregion
|
|
57
|
-
export { environment, getEnvironment, isAws, isDevelopment, isGoogleCloud, isLocalhost, isProduction, isServer, isStaging, isVercel, platform };
|
|
60
|
+
export { environment, getEnvironment, getPlatform, isAws, isDevelopment, isGoogleCloud, isLocalhost, isProduction, isServer, isStaging, isVercel, platform };
|
|
@@ -2,6 +2,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
2
2
|
const require_environment__shared_environment = require("./environment.cjs");
|
|
3
3
|
exports.environment = require_environment__shared_environment.environment;
|
|
4
4
|
exports.getEnvironment = require_environment__shared_environment.getEnvironment;
|
|
5
|
+
exports.getPlatform = require_environment__shared_environment.getPlatform;
|
|
5
6
|
exports.isAws = require_environment__shared_environment.isAws;
|
|
6
7
|
exports.isDevelopment = require_environment__shared_environment.isDevelopment;
|
|
7
8
|
exports.isGoogleCloud = require_environment__shared_environment.isGoogleCloud;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Environment, Platform, environment, getEnvironment, isAws, isDevelopment, isGoogleCloud, isLocalhost, isProduction, isServer, isStaging, isVercel, platform } from "./environment.cjs";
|
|
2
|
-
export { Environment, Platform, environment, getEnvironment, isAws, isDevelopment, isGoogleCloud, isLocalhost, isProduction, isServer, isStaging, isVercel, platform };
|
|
1
|
+
import { Environment, Platform, environment, getEnvironment, getPlatform, isAws, isDevelopment, isGoogleCloud, isLocalhost, isProduction, isServer, isStaging, isVercel, platform } from "./environment.cjs";
|
|
2
|
+
export { Environment, Platform, environment, getEnvironment, getPlatform, isAws, isDevelopment, isGoogleCloud, isLocalhost, isProduction, isServer, isStaging, isVercel, platform };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Environment, Platform, environment, getEnvironment, isAws, isDevelopment, isGoogleCloud, isLocalhost, isProduction, isServer, isStaging, isVercel, platform } from "./environment.mjs";
|
|
2
|
-
export { Environment, Platform, environment, getEnvironment, isAws, isDevelopment, isGoogleCloud, isLocalhost, isProduction, isServer, isStaging, isVercel, platform };
|
|
1
|
+
import { Environment, Platform, environment, getEnvironment, getPlatform, isAws, isDevelopment, isGoogleCloud, isLocalhost, isProduction, isServer, isStaging, isVercel, platform } from "./environment.mjs";
|
|
2
|
+
export { Environment, Platform, environment, getEnvironment, getPlatform, isAws, isDevelopment, isGoogleCloud, isLocalhost, isProduction, isServer, isStaging, isVercel, platform };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { environment, getEnvironment, isAws, isDevelopment, isGoogleCloud, isLocalhost, isProduction, isServer, isStaging, isVercel, platform } from "./environment.mjs";
|
|
2
|
-
export { environment, getEnvironment, isAws, isDevelopment, isGoogleCloud, isLocalhost, isProduction, isServer, isStaging, isVercel, platform };
|
|
1
|
+
import { environment, getEnvironment, getPlatform, isAws, isDevelopment, isGoogleCloud, isLocalhost, isProduction, isServer, isStaging, isVercel, platform } from "./environment.mjs";
|
|
2
|
+
export { environment, getEnvironment, getPlatform, isAws, isDevelopment, isGoogleCloud, isLocalhost, isProduction, isServer, isStaging, isVercel, platform };
|
|
@@ -2,6 +2,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
2
2
|
const require_environment__shared_environment = require("../_shared/environment.cjs");
|
|
3
3
|
exports.environment = require_environment__shared_environment.environment;
|
|
4
4
|
exports.getEnvironment = require_environment__shared_environment.getEnvironment;
|
|
5
|
+
exports.getPlatform = require_environment__shared_environment.getPlatform;
|
|
5
6
|
exports.isAws = require_environment__shared_environment.isAws;
|
|
6
7
|
exports.isDevelopment = require_environment__shared_environment.isDevelopment;
|
|
7
8
|
exports.isGoogleCloud = require_environment__shared_environment.isGoogleCloud;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Environment, Platform, environment, getEnvironment, isAws, isDevelopment, isGoogleCloud, isLocalhost, isProduction, isServer, isStaging, isVercel, platform } from "../_shared/environment.cjs";
|
|
2
|
-
export { Environment, Platform, environment, getEnvironment, isAws, isDevelopment, isGoogleCloud, isLocalhost, isProduction, isServer, isStaging, isVercel, platform };
|
|
1
|
+
import { Environment, Platform, environment, getEnvironment, getPlatform, isAws, isDevelopment, isGoogleCloud, isLocalhost, isProduction, isServer, isStaging, isVercel, platform } from "../_shared/environment.cjs";
|
|
2
|
+
export { Environment, Platform, environment, getEnvironment, getPlatform, isAws, isDevelopment, isGoogleCloud, isLocalhost, isProduction, isServer, isStaging, isVercel, platform };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Environment, Platform, environment, getEnvironment, isAws, isDevelopment, isGoogleCloud, isLocalhost, isProduction, isServer, isStaging, isVercel, platform } from "../_shared/environment.mjs";
|
|
2
|
-
export { Environment, Platform, environment, getEnvironment, isAws, isDevelopment, isGoogleCloud, isLocalhost, isProduction, isServer, isStaging, isVercel, platform };
|
|
1
|
+
import { Environment, Platform, environment, getEnvironment, getPlatform, isAws, isDevelopment, isGoogleCloud, isLocalhost, isProduction, isServer, isStaging, isVercel, platform } from "../_shared/environment.mjs";
|
|
2
|
+
export { Environment, Platform, environment, getEnvironment, getPlatform, isAws, isDevelopment, isGoogleCloud, isLocalhost, isProduction, isServer, isStaging, isVercel, platform };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { environment, getEnvironment, isAws, isDevelopment, isGoogleCloud, isLocalhost, isProduction, isServer, isStaging, isVercel, platform } from "../_shared/environment.mjs";
|
|
2
|
-
export { environment, getEnvironment, isAws, isDevelopment, isGoogleCloud, isLocalhost, isProduction, isServer, isStaging, isVercel, platform };
|
|
1
|
+
import { environment, getEnvironment, getPlatform, isAws, isDevelopment, isGoogleCloud, isLocalhost, isProduction, isServer, isStaging, isVercel, platform } from "../_shared/environment.mjs";
|
|
2
|
+
export { environment, getEnvironment, getPlatform, isAws, isDevelopment, isGoogleCloud, isLocalhost, isProduction, isServer, isStaging, isVercel, platform };
|
|
@@ -2,6 +2,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
2
2
|
const require_environment__shared_environment = require("../_shared/environment.cjs");
|
|
3
3
|
exports.environment = require_environment__shared_environment.environment;
|
|
4
4
|
exports.getEnvironment = require_environment__shared_environment.getEnvironment;
|
|
5
|
+
exports.getPlatform = require_environment__shared_environment.getPlatform;
|
|
5
6
|
exports.isAws = require_environment__shared_environment.isAws;
|
|
6
7
|
exports.isDevelopment = require_environment__shared_environment.isDevelopment;
|
|
7
8
|
exports.isGoogleCloud = require_environment__shared_environment.isGoogleCloud;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Environment, Platform, environment, getEnvironment, isAws, isDevelopment, isGoogleCloud, isLocalhost, isProduction, isServer, isStaging, isVercel, platform } from "../_shared/environment.cjs";
|
|
2
|
-
export { Environment, Platform, environment, getEnvironment, isAws, isDevelopment, isGoogleCloud, isLocalhost, isProduction, isServer, isStaging, isVercel, platform };
|
|
1
|
+
import { Environment, Platform, environment, getEnvironment, getPlatform, isAws, isDevelopment, isGoogleCloud, isLocalhost, isProduction, isServer, isStaging, isVercel, platform } from "../_shared/environment.cjs";
|
|
2
|
+
export { Environment, Platform, environment, getEnvironment, getPlatform, isAws, isDevelopment, isGoogleCloud, isLocalhost, isProduction, isServer, isStaging, isVercel, platform };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Environment, Platform, environment, getEnvironment, isAws, isDevelopment, isGoogleCloud, isLocalhost, isProduction, isServer, isStaging, isVercel, platform } from "../_shared/environment.mjs";
|
|
2
|
-
export { Environment, Platform, environment, getEnvironment, isAws, isDevelopment, isGoogleCloud, isLocalhost, isProduction, isServer, isStaging, isVercel, platform };
|
|
1
|
+
import { Environment, Platform, environment, getEnvironment, getPlatform, isAws, isDevelopment, isGoogleCloud, isLocalhost, isProduction, isServer, isStaging, isVercel, platform } from "../_shared/environment.mjs";
|
|
2
|
+
export { Environment, Platform, environment, getEnvironment, getPlatform, isAws, isDevelopment, isGoogleCloud, isLocalhost, isProduction, isServer, isStaging, isVercel, platform };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { environment, getEnvironment, isAws, isDevelopment, isGoogleCloud, isLocalhost, isProduction, isServer, isStaging, isVercel, platform } from "../_shared/environment.mjs";
|
|
2
|
-
export { environment, getEnvironment, isAws, isDevelopment, isGoogleCloud, isLocalhost, isProduction, isServer, isStaging, isVercel, platform };
|
|
1
|
+
import { environment, getEnvironment, getPlatform, isAws, isDevelopment, isGoogleCloud, isLocalhost, isProduction, isServer, isStaging, isVercel, platform } from "../_shared/environment.mjs";
|
|
2
|
+
export { environment, getEnvironment, getPlatform, isAws, isDevelopment, isGoogleCloud, isLocalhost, isProduction, isServer, isStaging, isVercel, platform };
|