@8ms/helpers 2.0.32 → 2.0.34
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/.yarn/install-state.gz +0 -0
- package/api/ApiResponseClass.d.ts +1 -1
- package/api/ApiResponseClass.js +12 -12
- package/api/functions.d.ts +7 -0
- package/api/functions.js +28 -0
- package/api/index.d.ts +3 -22
- package/api/index.js +17 -42
- package/api/types.d.ts +17 -0
- package/api/types.js +19 -0
- package/brightData/serpApi/server.d.ts +10 -9
- package/brightData/serpApi/server.js +9 -10
- package/crud/index.d.ts +7 -6
- package/crud/index.js +6 -7
- package/date/format.d.ts +10 -2
- package/date/format.js +21 -5
- package/date/type.d.ts +15 -14
- package/date/type.js +14 -15
- package/environment/index.d.ts +11 -9
- package/environment/index.js +21 -23
- package/googleAds/keywordPlanner/server.d.ts +5 -4
- package/googleAds/keywordPlanner/server.js +5 -6
- package/googlePageSpeed/server.d.ts +14 -12
- package/googlePageSpeed/server.js +12 -14
- package/inngest/server.d.ts +7 -6
- package/inngest/server.js +6 -7
- package/littleWarden/server.d.ts +6 -5
- package/littleWarden/server.js +8 -9
- package/nextAuth/index.d.ts +6 -5
- package/nextAuth/index.js +5 -6
- package/package.json +1 -1
- package/webWorker/index.d.ts +6 -5
- package/webWorker/index.js +6 -7
package/.yarn/install-state.gz
CHANGED
|
Binary file
|
package/api/ApiResponseClass.js
CHANGED
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ApiResponseClass = void 0;
|
|
4
4
|
const util_1 = require("../util");
|
|
5
|
-
const
|
|
5
|
+
const types_1 = require("./types");
|
|
6
6
|
/**
|
|
7
7
|
* Class version of the API to enable quicker instances.
|
|
8
8
|
*/
|
|
9
9
|
class ApiResponseClass {
|
|
10
10
|
constructor({ body, error, state } = {}) {
|
|
11
|
-
this.state =
|
|
11
|
+
this.state = types_1.ApiState.IDLE;
|
|
12
12
|
this.body = null;
|
|
13
13
|
this.error = null;
|
|
14
14
|
this.fromJson = (input) => {
|
|
@@ -37,34 +37,34 @@ class ApiResponseClass {
|
|
|
37
37
|
return this.state;
|
|
38
38
|
};
|
|
39
39
|
this.isError = () => {
|
|
40
|
-
return this.state ===
|
|
40
|
+
return this.state === types_1.ApiState.ERROR;
|
|
41
41
|
};
|
|
42
42
|
this.isIdle = () => {
|
|
43
|
-
return this.state ===
|
|
43
|
+
return this.state === types_1.ApiState.IDLE;
|
|
44
44
|
};
|
|
45
45
|
this.isPending = () => {
|
|
46
|
-
return this.state ===
|
|
46
|
+
return this.state === types_1.ApiState.PENDING;
|
|
47
47
|
};
|
|
48
48
|
this.isSuccess = () => {
|
|
49
|
-
return this.state ===
|
|
49
|
+
return this.state === types_1.ApiState.SUCCESS;
|
|
50
50
|
};
|
|
51
51
|
this.setToIdle = () => {
|
|
52
|
-
this.state =
|
|
52
|
+
this.state = types_1.ApiState.IDLE;
|
|
53
53
|
return this;
|
|
54
54
|
};
|
|
55
55
|
this.setToPending = () => {
|
|
56
|
-
this.state =
|
|
56
|
+
this.state = types_1.ApiState.PENDING;
|
|
57
57
|
return this;
|
|
58
58
|
};
|
|
59
59
|
this.setToError = (error, body) => {
|
|
60
60
|
this.body = body || null;
|
|
61
61
|
this.error = error;
|
|
62
|
-
this.state =
|
|
62
|
+
this.state = types_1.ApiState.ERROR;
|
|
63
63
|
return this;
|
|
64
64
|
};
|
|
65
65
|
this.setToSuccess = (body) => {
|
|
66
66
|
this.body = body;
|
|
67
|
-
this.state =
|
|
67
|
+
this.state = types_1.ApiState.SUCCESS;
|
|
68
68
|
return this;
|
|
69
69
|
};
|
|
70
70
|
this.setBody = (body) => {
|
|
@@ -85,12 +85,12 @@ class ApiResponseClass {
|
|
|
85
85
|
return new ApiResponseClass({ body: validatedBody, state: this.state });
|
|
86
86
|
}
|
|
87
87
|
catch (error) {
|
|
88
|
-
return new ApiResponseClass({ error, state:
|
|
88
|
+
return new ApiResponseClass({ error, state: types_1.ApiState.ERROR });
|
|
89
89
|
}
|
|
90
90
|
};
|
|
91
91
|
this.body = body || null;
|
|
92
92
|
this.error = error || null;
|
|
93
|
-
this.state = state ||
|
|
93
|
+
this.state = state || types_1.ApiState.IDLE;
|
|
94
94
|
return this;
|
|
95
95
|
}
|
|
96
96
|
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ApiResponse } from "./types";
|
|
2
|
+
export declare const isCancelled: (apiResponse: ApiResponse) => boolean;
|
|
3
|
+
export declare const isError: (apiResponse: ApiResponse) => boolean;
|
|
4
|
+
export declare const isIdle: (apiResponse: ApiResponse) => boolean;
|
|
5
|
+
export declare const isPending: (apiResponse: ApiResponse) => boolean;
|
|
6
|
+
export declare const isSuccess: (apiResponse: ApiResponse) => boolean;
|
|
7
|
+
export declare const isValidationError: (apiResponse: ApiResponse) => boolean;
|
package/api/functions.js
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isValidationError = exports.isSuccess = exports.isPending = exports.isIdle = exports.isError = exports.isCancelled = void 0;
|
|
4
|
+
const types_1 = require("./types");
|
|
5
|
+
const isCancelled = (apiResponse) => {
|
|
6
|
+
return types_1.ApiState.CANCELLED === apiResponse.state;
|
|
7
|
+
};
|
|
8
|
+
exports.isCancelled = isCancelled;
|
|
9
|
+
const isError = (apiResponse) => {
|
|
10
|
+
return types_1.ApiState.ERROR === apiResponse.state;
|
|
11
|
+
};
|
|
12
|
+
exports.isError = isError;
|
|
13
|
+
const isIdle = (apiResponse) => {
|
|
14
|
+
return types_1.ApiState.IDLE === apiResponse.state;
|
|
15
|
+
};
|
|
16
|
+
exports.isIdle = isIdle;
|
|
17
|
+
const isPending = (apiResponse) => {
|
|
18
|
+
return types_1.ApiState.PENDING === apiResponse.state;
|
|
19
|
+
};
|
|
20
|
+
exports.isPending = isPending;
|
|
21
|
+
const isSuccess = (apiResponse) => {
|
|
22
|
+
return types_1.ApiState.SUCCESS === apiResponse.state;
|
|
23
|
+
};
|
|
24
|
+
exports.isSuccess = isSuccess;
|
|
25
|
+
const isValidationError = (apiResponse) => {
|
|
26
|
+
return types_1.ApiState.VALIDATION_ERROR === apiResponse.state;
|
|
27
|
+
};
|
|
28
|
+
exports.isValidationError = isValidationError;
|
package/api/index.d.ts
CHANGED
|
@@ -1,22 +1,3 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
|
|
4
|
-
ERROR = "ERROR",
|
|
5
|
-
IDLE = "IDLE",
|
|
6
|
-
PENDING = "PENDING",
|
|
7
|
-
SUCCESS = "SUCCESS",
|
|
8
|
-
VALIDATION_ERROR = "VALIDATION_ERROR"
|
|
9
|
-
}
|
|
10
|
-
export type ApiResponse<T = any, E = any> = {
|
|
11
|
-
body: T | null;
|
|
12
|
-
error: E | null;
|
|
13
|
-
state: ApiState;
|
|
14
|
-
};
|
|
15
|
-
export declare const defaultResponse: ApiResponse;
|
|
16
|
-
export declare const unexpectedError: string;
|
|
17
|
-
export declare const isCancelled: (apiResponse: ApiResponse) => boolean;
|
|
18
|
-
export declare const isError: (apiResponse: ApiResponse) => boolean;
|
|
19
|
-
export declare const isIdle: (apiResponse: ApiResponse) => boolean;
|
|
20
|
-
export declare const isPending: (apiResponse: ApiResponse) => boolean;
|
|
21
|
-
export declare const isSuccess: (apiResponse: ApiResponse) => boolean;
|
|
22
|
-
export declare const isValidationError: (apiResponse: ApiResponse) => boolean;
|
|
1
|
+
export * from "./ApiResponseClass";
|
|
2
|
+
export * from "./functions";
|
|
3
|
+
export * from "./types";
|
package/api/index.js
CHANGED
|
@@ -1,44 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.
|
|
3
|
-
|
|
4
|
-
var
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
exports.defaultResponse = {
|
|
16
|
-
body: null,
|
|
17
|
-
error: null,
|
|
18
|
-
state: ApiState.IDLE,
|
|
19
|
-
};
|
|
20
|
-
exports.unexpectedError = "An unexpected error occurred, please try again.";
|
|
21
|
-
const isCancelled = (apiResponse) => {
|
|
22
|
-
return ApiState.CANCELLED === apiResponse.state;
|
|
23
|
-
};
|
|
24
|
-
exports.isCancelled = isCancelled;
|
|
25
|
-
const isError = (apiResponse) => {
|
|
26
|
-
return ApiState.ERROR === apiResponse.state;
|
|
27
|
-
};
|
|
28
|
-
exports.isError = isError;
|
|
29
|
-
const isIdle = (apiResponse) => {
|
|
30
|
-
return ApiState.IDLE === apiResponse.state;
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
31
15
|
};
|
|
32
|
-
exports
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
exports.isPending = isPending;
|
|
37
|
-
const isSuccess = (apiResponse) => {
|
|
38
|
-
return ApiState.SUCCESS === apiResponse.state;
|
|
39
|
-
};
|
|
40
|
-
exports.isSuccess = isSuccess;
|
|
41
|
-
const isValidationError = (apiResponse) => {
|
|
42
|
-
return ApiState.VALIDATION_ERROR === apiResponse.state;
|
|
43
|
-
};
|
|
44
|
-
exports.isValidationError = isValidationError;
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./ApiResponseClass"), exports);
|
|
18
|
+
__exportStar(require("./functions"), exports);
|
|
19
|
+
__exportStar(require("./types"), exports);
|
package/api/types.d.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export { ApiResponseClass } from "./ApiResponseClass";
|
|
2
|
+
export declare const ApiState: {
|
|
3
|
+
readonly CANCELLED: "CANCELLED";
|
|
4
|
+
readonly ERROR: "ERROR";
|
|
5
|
+
readonly IDLE: "IDLE";
|
|
6
|
+
readonly PENDING: "PENDING";
|
|
7
|
+
readonly SUCCESS: "SUCCESS";
|
|
8
|
+
readonly VALIDATION_ERROR: "VALIDATION_ERROR";
|
|
9
|
+
};
|
|
10
|
+
export type ApiState = typeof ApiState[keyof typeof ApiState];
|
|
11
|
+
export type ApiResponse<T = any, E = any> = {
|
|
12
|
+
body: T | null;
|
|
13
|
+
error: E | null;
|
|
14
|
+
state: ApiState;
|
|
15
|
+
};
|
|
16
|
+
export declare const defaultResponse: ApiResponse;
|
|
17
|
+
export declare const unexpectedError: string;
|
package/api/types.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.unexpectedError = exports.defaultResponse = exports.ApiState = exports.ApiResponseClass = void 0;
|
|
4
|
+
var ApiResponseClass_1 = require("./ApiResponseClass");
|
|
5
|
+
Object.defineProperty(exports, "ApiResponseClass", { enumerable: true, get: function () { return ApiResponseClass_1.ApiResponseClass; } });
|
|
6
|
+
exports.ApiState = {
|
|
7
|
+
CANCELLED: "CANCELLED",
|
|
8
|
+
ERROR: "ERROR",
|
|
9
|
+
IDLE: "IDLE",
|
|
10
|
+
PENDING: "PENDING",
|
|
11
|
+
SUCCESS: "SUCCESS",
|
|
12
|
+
VALIDATION_ERROR: "VALIDATION_ERROR",
|
|
13
|
+
};
|
|
14
|
+
exports.defaultResponse = {
|
|
15
|
+
body: null,
|
|
16
|
+
error: null,
|
|
17
|
+
state: exports.ApiState.IDLE,
|
|
18
|
+
};
|
|
19
|
+
exports.unexpectedError = "An unexpected error occurred, please try again.";
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
export declare
|
|
2
|
-
GOOGLE_FLIGHTS
|
|
3
|
-
GOOGLE_HOTELS
|
|
4
|
-
GOOGLE_LENS
|
|
5
|
-
GOOGLE_MAPS
|
|
6
|
-
GOOGLE_REVIEWS
|
|
7
|
-
GOOGLE_SEARCH
|
|
8
|
-
GOOGLE_TRENDS
|
|
9
|
-
}
|
|
1
|
+
export declare const BrightDataSerpApiType: {
|
|
2
|
+
readonly GOOGLE_FLIGHTS: "GOOGLE_FLIGHTS";
|
|
3
|
+
readonly GOOGLE_HOTELS: "GOOGLE_HOTELS";
|
|
4
|
+
readonly GOOGLE_LENS: "GOOGLE_LENS";
|
|
5
|
+
readonly GOOGLE_MAPS: "GOOGLE_MAPS";
|
|
6
|
+
readonly GOOGLE_REVIEWS: "GOOGLE_REVIEWS";
|
|
7
|
+
readonly GOOGLE_SEARCH: "GOOGLE_SEARCH";
|
|
8
|
+
readonly GOOGLE_TRENDS: "GOOGLE_TRENDS";
|
|
9
|
+
};
|
|
10
|
+
export type BrightDataSerpApiType = typeof BrightDataSerpApiType[keyof typeof BrightDataSerpApiType];
|
|
10
11
|
export { buildGoogleSerpUrl } from "./buildGoogleSerpUrl";
|
|
11
12
|
export { buildGoogleTrendsUrl } from "./buildGoogleTrendsUrl";
|
|
12
13
|
export { getAsyncRequestId } from "./getAsyncRequestId";
|
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getRealtime = exports.getAsyncResults = exports.getAsyncRequestId = exports.buildGoogleTrendsUrl = exports.buildGoogleSerpUrl = exports.BrightDataSerpApiType = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
})(BrightDataSerpApiType || (exports.BrightDataSerpApiType = BrightDataSerpApiType = {}));
|
|
4
|
+
exports.BrightDataSerpApiType = {
|
|
5
|
+
GOOGLE_FLIGHTS: "GOOGLE_FLIGHTS",
|
|
6
|
+
GOOGLE_HOTELS: "GOOGLE_HOTELS",
|
|
7
|
+
GOOGLE_LENS: "GOOGLE_LENS",
|
|
8
|
+
GOOGLE_MAPS: "GOOGLE_MAPS",
|
|
9
|
+
GOOGLE_REVIEWS: "GOOGLE_REVIEWS",
|
|
10
|
+
GOOGLE_SEARCH: "GOOGLE_SEARCH",
|
|
11
|
+
GOOGLE_TRENDS: "GOOGLE_TRENDS",
|
|
12
|
+
};
|
|
14
13
|
var buildGoogleSerpUrl_1 = require("./buildGoogleSerpUrl");
|
|
15
14
|
Object.defineProperty(exports, "buildGoogleSerpUrl", { enumerable: true, get: function () { return buildGoogleSerpUrl_1.buildGoogleSerpUrl; } });
|
|
16
15
|
var buildGoogleTrendsUrl_1 = require("./buildGoogleTrendsUrl");
|
package/crud/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
export declare
|
|
2
|
-
CREATE
|
|
3
|
-
READ
|
|
4
|
-
UPDATE
|
|
5
|
-
DELETE
|
|
6
|
-
}
|
|
1
|
+
export declare const CrudState: {
|
|
2
|
+
readonly CREATE: "CREATE";
|
|
3
|
+
readonly READ: "READ";
|
|
4
|
+
readonly UPDATE: "UPDATE";
|
|
5
|
+
readonly DELETE: "DELETE";
|
|
6
|
+
};
|
|
7
|
+
export type CrudState = typeof CrudState[keyof typeof CrudState];
|
package/crud/index.js
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.CrudState = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
})(CrudState || (exports.CrudState = CrudState = {}));
|
|
4
|
+
exports.CrudState = {
|
|
5
|
+
CREATE: "CREATE",
|
|
6
|
+
READ: "READ",
|
|
7
|
+
UPDATE: "UPDATE",
|
|
8
|
+
DELETE: "DELETE",
|
|
9
|
+
};
|
package/date/format.d.ts
CHANGED
|
@@ -36,11 +36,19 @@ export declare const getMonthYearString: (input: InputDate) => string;
|
|
|
36
36
|
/**
|
|
37
37
|
* Shorthand to get the current date.
|
|
38
38
|
*/
|
|
39
|
-
export declare const getTodayYmdString: () => string;
|
|
39
|
+
export declare const getTodayYmdString: (setMidnight?: boolean) => string;
|
|
40
40
|
/**
|
|
41
41
|
* Shorthand to get the current date.
|
|
42
42
|
*/
|
|
43
|
-
export declare const
|
|
43
|
+
export declare const getTodayYmdHisString: (setMidnight?: boolean) => string;
|
|
44
|
+
/**
|
|
45
|
+
* Shorthand to get the current date.
|
|
46
|
+
*/
|
|
47
|
+
export declare const getTodayYmdNumber: (setMidnight?: boolean) => number;
|
|
48
|
+
/**
|
|
49
|
+
* Shorthand to get the current date.
|
|
50
|
+
*/
|
|
51
|
+
export declare const getTodayYmdHisNumber: (setMidnight?: boolean) => number;
|
|
44
52
|
/**
|
|
45
53
|
* Convert a Date into a YYYY number.
|
|
46
54
|
*/
|
package/date/format.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.parseExcelDate = exports.getYmdString = exports.getYmdNumber = exports.getYmdHisString = exports.getYmdHisNumber = exports.getYearNumber = exports.getTodayYmdNumber = exports.getTodayYmdString = exports.getMonthYearString = exports.getFullDateTime = exports.getFullDate = exports.getDayNumber = exports.format = exports.getDurationMinutes = exports.getDurationHours = void 0;
|
|
3
|
+
exports.parseExcelDate = exports.getYmdString = exports.getYmdNumber = exports.getYmdHisString = exports.getYmdHisNumber = exports.getYearNumber = exports.getTodayYmdHisNumber = exports.getTodayYmdNumber = exports.getTodayYmdHisString = exports.getTodayYmdString = exports.getMonthYearString = exports.getFullDateTime = exports.getFullDate = exports.getDayNumber = exports.format = exports.getDurationMinutes = exports.getDurationHours = void 0;
|
|
4
4
|
const calculation_1 = require("./calculation");
|
|
5
5
|
const luxon_1 = require("luxon");
|
|
6
6
|
/**
|
|
@@ -87,19 +87,35 @@ exports.getMonthYearString = getMonthYearString;
|
|
|
87
87
|
/**
|
|
88
88
|
* Shorthand to get the current date.
|
|
89
89
|
*/
|
|
90
|
-
const getTodayYmdString = () => {
|
|
91
|
-
const today = (0, calculation_1.getToday)();
|
|
90
|
+
const getTodayYmdString = (setMidnight) => {
|
|
91
|
+
const today = (0, calculation_1.getToday)(setMidnight);
|
|
92
92
|
return (0, exports.getYmdString)(today);
|
|
93
93
|
};
|
|
94
94
|
exports.getTodayYmdString = getTodayYmdString;
|
|
95
95
|
/**
|
|
96
96
|
* Shorthand to get the current date.
|
|
97
97
|
*/
|
|
98
|
-
const
|
|
99
|
-
const today = (0, calculation_1.getToday)();
|
|
98
|
+
const getTodayYmdHisString = (setMidnight) => {
|
|
99
|
+
const today = (0, calculation_1.getToday)(setMidnight);
|
|
100
|
+
return (0, exports.getYmdHisString)(today);
|
|
101
|
+
};
|
|
102
|
+
exports.getTodayYmdHisString = getTodayYmdHisString;
|
|
103
|
+
/**
|
|
104
|
+
* Shorthand to get the current date.
|
|
105
|
+
*/
|
|
106
|
+
const getTodayYmdNumber = (setMidnight) => {
|
|
107
|
+
const today = (0, calculation_1.getToday)(setMidnight);
|
|
100
108
|
return (0, exports.getYmdNumber)(today);
|
|
101
109
|
};
|
|
102
110
|
exports.getTodayYmdNumber = getTodayYmdNumber;
|
|
111
|
+
/**
|
|
112
|
+
* Shorthand to get the current date.
|
|
113
|
+
*/
|
|
114
|
+
const getTodayYmdHisNumber = (setMidnight) => {
|
|
115
|
+
const today = (0, calculation_1.getToday)(setMidnight);
|
|
116
|
+
return (0, exports.getYmdHisNumber)(today);
|
|
117
|
+
};
|
|
118
|
+
exports.getTodayYmdHisNumber = getTodayYmdHisNumber;
|
|
103
119
|
/**
|
|
104
120
|
* Convert a Date into a YYYY number.
|
|
105
121
|
*/
|
package/date/type.d.ts
CHANGED
|
@@ -19,17 +19,18 @@ export declare const defaultDateTime: "1901-01-01 00:00:00";
|
|
|
19
19
|
/**
|
|
20
20
|
* Used by Google Ads API.
|
|
21
21
|
*/
|
|
22
|
-
export declare
|
|
23
|
-
JANUARY
|
|
24
|
-
FEBRUARY
|
|
25
|
-
MARCH
|
|
26
|
-
APRIL
|
|
27
|
-
MAY
|
|
28
|
-
JUNE
|
|
29
|
-
JULY
|
|
30
|
-
AUGUST
|
|
31
|
-
SEPTEMBER
|
|
32
|
-
OCTOBER
|
|
33
|
-
NOVEMBER
|
|
34
|
-
DECEMBER
|
|
35
|
-
}
|
|
22
|
+
export declare const Month: {
|
|
23
|
+
readonly JANUARY: "JANUARY";
|
|
24
|
+
readonly FEBRUARY: "FEBRUARY";
|
|
25
|
+
readonly MARCH: "MARCH";
|
|
26
|
+
readonly APRIL: "APRIL";
|
|
27
|
+
readonly MAY: "MAY";
|
|
28
|
+
readonly JUNE: "JUNE";
|
|
29
|
+
readonly JULY: "JULY";
|
|
30
|
+
readonly AUGUST: "AUGUST";
|
|
31
|
+
readonly SEPTEMBER: "SEPTEMBER";
|
|
32
|
+
readonly OCTOBER: "OCTOBER";
|
|
33
|
+
readonly NOVEMBER: "NOVEMBER";
|
|
34
|
+
readonly DECEMBER: "DECEMBER";
|
|
35
|
+
};
|
|
36
|
+
export type Month = typeof Month[keyof typeof Month];
|
package/date/type.js
CHANGED
|
@@ -7,18 +7,17 @@ exports.defaultDateTime = "1901-01-01 00:00:00";
|
|
|
7
7
|
/**
|
|
8
8
|
* Used by Google Ads API.
|
|
9
9
|
*/
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
})(Month || (exports.Month = Month = {}));
|
|
10
|
+
exports.Month = {
|
|
11
|
+
JANUARY: "JANUARY",
|
|
12
|
+
FEBRUARY: "FEBRUARY",
|
|
13
|
+
MARCH: "MARCH",
|
|
14
|
+
APRIL: "APRIL",
|
|
15
|
+
MAY: "MAY",
|
|
16
|
+
JUNE: "JUNE",
|
|
17
|
+
JULY: "JULY",
|
|
18
|
+
AUGUST: "AUGUST",
|
|
19
|
+
SEPTEMBER: "SEPTEMBER",
|
|
20
|
+
OCTOBER: "OCTOBER",
|
|
21
|
+
NOVEMBER: "NOVEMBER",
|
|
22
|
+
DECEMBER: "DECEMBER",
|
|
23
|
+
};
|
package/environment/index.d.ts
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
export declare
|
|
2
|
-
DEVELOPMENT
|
|
3
|
-
STAGING
|
|
4
|
-
PRODUCTION
|
|
5
|
-
}
|
|
6
|
-
export
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
export declare const Environment: {
|
|
2
|
+
readonly DEVELOPMENT: "development";
|
|
3
|
+
readonly STAGING: "staging";
|
|
4
|
+
readonly PRODUCTION: "production";
|
|
5
|
+
};
|
|
6
|
+
export type Environment = typeof Environment[keyof typeof Environment];
|
|
7
|
+
export declare const Platform: {
|
|
8
|
+
readonly AWS: "AWS";
|
|
9
|
+
readonly VERCEL: "VERCEL";
|
|
10
|
+
};
|
|
11
|
+
export type Platform = typeof Platform[keyof typeof Platform];
|
|
10
12
|
/**
|
|
11
13
|
* Determine the environment we're using.
|
|
12
14
|
*/
|
package/environment/index.js
CHANGED
|
@@ -1,17 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.isLocalhost = exports.isProduction = exports.isStaging = exports.isDevelopment = exports.isServer = exports.isVercel = exports.isAws = exports.getEnvironment = exports.Platform = exports.Environment = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
Platform["VERCEL"] = "VERCEL";
|
|
14
|
-
})(Platform || (exports.Platform = Platform = {}));
|
|
4
|
+
exports.Environment = {
|
|
5
|
+
DEVELOPMENT: "development",
|
|
6
|
+
STAGING: "staging",
|
|
7
|
+
PRODUCTION: "production",
|
|
8
|
+
};
|
|
9
|
+
exports.Platform = {
|
|
10
|
+
AWS: "AWS",
|
|
11
|
+
VERCEL: "VERCEL",
|
|
12
|
+
};
|
|
15
13
|
/**
|
|
16
14
|
* Determine the environment we're using.
|
|
17
15
|
*/
|
|
@@ -38,16 +36,16 @@ const getEnvironment = () => {
|
|
|
38
36
|
.toLowerCase()
|
|
39
37
|
.trim();
|
|
40
38
|
switch (platformEnvironmentClean) {
|
|
41
|
-
case
|
|
42
|
-
response = Environment.PRODUCTION;
|
|
39
|
+
case "production":
|
|
40
|
+
response = exports.Environment.PRODUCTION;
|
|
43
41
|
break;
|
|
44
|
-
case
|
|
45
|
-
case
|
|
46
|
-
case
|
|
47
|
-
response = Environment.STAGING;
|
|
42
|
+
case "demo":
|
|
43
|
+
case "preview":
|
|
44
|
+
case "staging":
|
|
45
|
+
response = exports.Environment.STAGING;
|
|
48
46
|
break;
|
|
49
47
|
default:
|
|
50
|
-
response = Environment.DEVELOPMENT;
|
|
48
|
+
response = exports.Environment.DEVELOPMENT;
|
|
51
49
|
}
|
|
52
50
|
return response;
|
|
53
51
|
};
|
|
@@ -55,22 +53,22 @@ exports.getEnvironment = getEnvironment;
|
|
|
55
53
|
/**
|
|
56
54
|
* Check to see if we are working on AWS Lambda.
|
|
57
55
|
*/
|
|
58
|
-
const isAws = () => Platform.AWS === process.env["EMS_PLATFORM"];
|
|
56
|
+
const isAws = () => exports.Platform.AWS === process.env["EMS_PLATFORM"];
|
|
59
57
|
exports.isAws = isAws;
|
|
60
58
|
const isVercel = () => undefined !== process.env.NEXT_PUBLIC_VERCEL_GIT_COMMIT_REF;
|
|
61
59
|
exports.isVercel = isVercel;
|
|
62
60
|
/**
|
|
63
61
|
* Some code should only run on the server side to protect the data.
|
|
64
62
|
*/
|
|
65
|
-
exports.isServer = typeof window ===
|
|
63
|
+
exports.isServer = typeof window === "undefined";
|
|
66
64
|
/**
|
|
67
65
|
* Check the environment currently running.
|
|
68
66
|
*/
|
|
69
|
-
const isDevelopment = () => Environment.DEVELOPMENT === (0, exports.getEnvironment)();
|
|
67
|
+
const isDevelopment = () => exports.Environment.DEVELOPMENT === (0, exports.getEnvironment)();
|
|
70
68
|
exports.isDevelopment = isDevelopment;
|
|
71
|
-
const isStaging = () => Environment.STAGING === (0, exports.getEnvironment)();
|
|
69
|
+
const isStaging = () => exports.Environment.STAGING === (0, exports.getEnvironment)();
|
|
72
70
|
exports.isStaging = isStaging;
|
|
73
|
-
const isProduction = () => Environment.PRODUCTION === (0, exports.getEnvironment)();
|
|
71
|
+
const isProduction = () => exports.Environment.PRODUCTION === (0, exports.getEnvironment)();
|
|
74
72
|
exports.isProduction = isProduction;
|
|
75
73
|
/**
|
|
76
74
|
* Check to see if we are developing locally or on the hosted platform.
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { z } from "zod/v4";
|
|
2
|
-
export declare
|
|
3
|
-
GOOGLE_SEARCH_ONLY
|
|
4
|
-
GOOGLE_SEARCH_AND_PARTNERS
|
|
5
|
-
}
|
|
2
|
+
export declare const Network: {
|
|
3
|
+
readonly GOOGLE_SEARCH_ONLY: 2;
|
|
4
|
+
readonly GOOGLE_SEARCH_AND_PARTNERS: 3;
|
|
5
|
+
};
|
|
6
|
+
export type Network = typeof Network[keyof typeof Network];
|
|
6
7
|
export declare const requestSchema: z.ZodObject<{
|
|
7
8
|
countries: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
|
|
8
9
|
customerId: z.ZodOptional<z.ZodString>;
|
|
@@ -2,11 +2,10 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.responseSchema = exports.defaultRequest = exports.requestSchema = exports.Network = void 0;
|
|
4
4
|
const v4_1 = require("zod/v4");
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
})(Network || (exports.Network = Network = {}));
|
|
5
|
+
exports.Network = {
|
|
6
|
+
GOOGLE_SEARCH_ONLY: 2,
|
|
7
|
+
GOOGLE_SEARCH_AND_PARTNERS: 3,
|
|
8
|
+
};
|
|
10
9
|
exports.requestSchema = v4_1.z.object({
|
|
11
10
|
countries: v4_1.z.array(v4_1.z.number())
|
|
12
11
|
.optional(),
|
|
@@ -35,7 +34,7 @@ exports.defaultRequest = {
|
|
|
35
34
|
customerId: "",
|
|
36
35
|
historicalMetricsOptions: null,
|
|
37
36
|
includeAdultKeywords: false,
|
|
38
|
-
keywordPlanNetwork: Network.GOOGLE_SEARCH_ONLY,
|
|
37
|
+
keywordPlanNetwork: exports.Network.GOOGLE_SEARCH_ONLY,
|
|
39
38
|
queries: [],
|
|
40
39
|
language: null,
|
|
41
40
|
};
|
|
@@ -3,15 +3,17 @@ export type GooglePageSpeedConfig = {
|
|
|
3
3
|
apiKey: string;
|
|
4
4
|
};
|
|
5
5
|
export declare const googlePageSpeedClient: (key?: string, config?: GooglePageSpeedConfig, vaultId?: string, itemId?: string) => Promise<GooglePageSpeedNamespace>;
|
|
6
|
-
export declare
|
|
7
|
-
CATEGORY_UNSPECIFIED
|
|
8
|
-
ACCESSIBILITY
|
|
9
|
-
BEST_PRACTICES
|
|
10
|
-
PERFORMANCE
|
|
11
|
-
SEO
|
|
12
|
-
}
|
|
13
|
-
export
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
6
|
+
export declare const Category: {
|
|
7
|
+
readonly CATEGORY_UNSPECIFIED: "CATEGORY_UNSPECIFIED";
|
|
8
|
+
readonly ACCESSIBILITY: "ACCESSIBILITY";
|
|
9
|
+
readonly BEST_PRACTICES: "BEST_PRACTICES";
|
|
10
|
+
readonly PERFORMANCE: "PERFORMANCE";
|
|
11
|
+
readonly SEO: "SEO";
|
|
12
|
+
};
|
|
13
|
+
export type Category = typeof Category[keyof typeof Category];
|
|
14
|
+
export declare const Strategy: {
|
|
15
|
+
readonly STRATEGY_UNSPECIFIED: "STRATEGY_UNSPECIFIED";
|
|
16
|
+
readonly DESKTOP: "DESKTOP";
|
|
17
|
+
readonly MOBILE: "MOBILE";
|
|
18
|
+
};
|
|
19
|
+
export type Strategy = typeof Strategy[keyof typeof Strategy];
|
|
@@ -28,17 +28,15 @@ const googlePageSpeedClient = async (key = "default", config, vaultId, itemId) =
|
|
|
28
28
|
return namespace;
|
|
29
29
|
};
|
|
30
30
|
exports.googlePageSpeedClient = googlePageSpeedClient;
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
Strategy["MOBILE"] = "MOBILE";
|
|
44
|
-
})(Strategy || (exports.Strategy = Strategy = {}));
|
|
31
|
+
exports.Category = {
|
|
32
|
+
CATEGORY_UNSPECIFIED: "CATEGORY_UNSPECIFIED",
|
|
33
|
+
ACCESSIBILITY: "ACCESSIBILITY",
|
|
34
|
+
BEST_PRACTICES: "BEST_PRACTICES",
|
|
35
|
+
PERFORMANCE: "PERFORMANCE",
|
|
36
|
+
SEO: "SEO",
|
|
37
|
+
};
|
|
38
|
+
exports.Strategy = {
|
|
39
|
+
STRATEGY_UNSPECIFIED: "STRATEGY_UNSPECIFIED",
|
|
40
|
+
DESKTOP: "DESKTOP",
|
|
41
|
+
MOBILE: "MOBILE",
|
|
42
|
+
};
|
package/inngest/server.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
export declare
|
|
2
|
-
RUNNING
|
|
3
|
-
COMPLETED
|
|
4
|
-
FAILED
|
|
5
|
-
CANCELLED
|
|
6
|
-
}
|
|
1
|
+
export declare const InngestState: {
|
|
2
|
+
RUNNING: string;
|
|
3
|
+
COMPLETED: string;
|
|
4
|
+
FAILED: string;
|
|
5
|
+
CANCELLED: string;
|
|
6
|
+
};
|
|
7
|
+
export type InngestState = typeof InngestState[keyof typeof InngestState];
|
package/inngest/server.js
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.InngestState = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
})(InngestState || (exports.InngestState = InngestState = {}));
|
|
4
|
+
exports.InngestState = {
|
|
5
|
+
RUNNING: "Running",
|
|
6
|
+
COMPLETED: "Completed",
|
|
7
|
+
FAILED: "Failed",
|
|
8
|
+
CANCELLED: "Cancelled",
|
|
9
|
+
};
|
package/littleWarden/server.d.ts
CHANGED
|
@@ -3,11 +3,12 @@ export type LittleWardenConfig = {
|
|
|
3
3
|
apiKey: string;
|
|
4
4
|
};
|
|
5
5
|
export declare const littleWardenClient: (key?: string, config?: LittleWardenConfig, vaultId?: string, itemId?: string) => Promise<LittleWardenNamespace>;
|
|
6
|
-
export declare
|
|
7
|
-
ALL_GOOD
|
|
8
|
-
DANGER
|
|
9
|
-
WARNING
|
|
10
|
-
}
|
|
6
|
+
export declare const LittleWardenState: {
|
|
7
|
+
readonly ALL_GOOD: "all_good";
|
|
8
|
+
readonly DANGER: "danger";
|
|
9
|
+
readonly WARNING: "warning";
|
|
10
|
+
};
|
|
11
|
+
export type LittleWardenState = typeof LittleWardenState[keyof typeof LittleWardenState];
|
|
11
12
|
/**
|
|
12
13
|
* Check if the field is All Good.
|
|
13
14
|
*/
|
package/littleWarden/server.js
CHANGED
|
@@ -28,12 +28,11 @@ const littleWardenClient = async (key = "default", config, vaultId, itemId) => {
|
|
|
28
28
|
return namespace;
|
|
29
29
|
};
|
|
30
30
|
exports.littleWardenClient = littleWardenClient;
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
})(LittleWardenState || (exports.LittleWardenState = LittleWardenState = {}));
|
|
31
|
+
exports.LittleWardenState = {
|
|
32
|
+
ALL_GOOD: "all_good",
|
|
33
|
+
DANGER: "danger",
|
|
34
|
+
WARNING: "warning",
|
|
35
|
+
};
|
|
37
36
|
/**
|
|
38
37
|
* Check if the field is All Good.
|
|
39
38
|
*/
|
|
@@ -41,7 +40,7 @@ const isAllGood = ({ field }) => {
|
|
|
41
40
|
let response = false;
|
|
42
41
|
// Check that the status field exists
|
|
43
42
|
if (undefined !== field && undefined !== field["status"]) {
|
|
44
|
-
response = LittleWardenState.ALL_GOOD === field["status"];
|
|
43
|
+
response = exports.LittleWardenState.ALL_GOOD === field["status"];
|
|
45
44
|
}
|
|
46
45
|
return response;
|
|
47
46
|
};
|
|
@@ -53,7 +52,7 @@ const isWarning = ({ field }) => {
|
|
|
53
52
|
let response = false;
|
|
54
53
|
// Check that the status field exists
|
|
55
54
|
if (undefined !== field && undefined !== field["status"]) {
|
|
56
|
-
response = LittleWardenState.WARNING === field["status"];
|
|
55
|
+
response = exports.LittleWardenState.WARNING === field["status"];
|
|
57
56
|
}
|
|
58
57
|
return response;
|
|
59
58
|
};
|
|
@@ -65,7 +64,7 @@ const isDanger = ({ field }) => {
|
|
|
65
64
|
let response = false;
|
|
66
65
|
// Check that the status field exists
|
|
67
66
|
if (undefined !== field && undefined !== field["status"]) {
|
|
68
|
-
response = LittleWardenState.DANGER === field["status"];
|
|
67
|
+
response = exports.LittleWardenState.DANGER === field["status"];
|
|
69
68
|
}
|
|
70
69
|
return response;
|
|
71
70
|
};
|
package/nextAuth/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export { isSessionReady } from "./isSessionReady";
|
|
2
|
-
export declare
|
|
3
|
-
AUTHENTICATED
|
|
4
|
-
PENDING
|
|
5
|
-
UNAUTHENTICATED
|
|
6
|
-
}
|
|
2
|
+
export declare const NextAuthState: {
|
|
3
|
+
AUTHENTICATED: string;
|
|
4
|
+
PENDING: string;
|
|
5
|
+
UNAUTHENTICATED: string;
|
|
6
|
+
};
|
|
7
|
+
export type NextAuthState = typeof NextAuthState[keyof typeof NextAuthState];
|
package/nextAuth/index.js
CHANGED
|
@@ -3,9 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.NextAuthState = exports.isSessionReady = void 0;
|
|
4
4
|
var isSessionReady_1 = require("./isSessionReady");
|
|
5
5
|
Object.defineProperty(exports, "isSessionReady", { enumerable: true, get: function () { return isSessionReady_1.isSessionReady; } });
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
})(NextAuthState || (exports.NextAuthState = NextAuthState = {}));
|
|
6
|
+
exports.NextAuthState = {
|
|
7
|
+
AUTHENTICATED: "authenticated",
|
|
8
|
+
PENDING: "loading", // Defined by NextAuth
|
|
9
|
+
UNAUTHENTICATED: "unauthenticated",
|
|
10
|
+
};
|
package/package.json
CHANGED
package/webWorker/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
export declare
|
|
2
|
-
ERROR
|
|
3
|
-
SUCCESS
|
|
4
|
-
PROGRESS
|
|
5
|
-
}
|
|
1
|
+
export declare const WebWorkerState: {
|
|
2
|
+
ERROR: string;
|
|
3
|
+
SUCCESS: string;
|
|
4
|
+
PROGRESS: string;
|
|
5
|
+
};
|
|
6
|
+
export type WebWorkerState = typeof WebWorkerState[keyof typeof WebWorkerState];
|
package/webWorker/index.js
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
})(WebWorkerSta || (exports.WebWorkerSta = WebWorkerSta = {}));
|
|
3
|
+
exports.WebWorkerState = void 0;
|
|
4
|
+
exports.WebWorkerState = {
|
|
5
|
+
ERROR: "ERROR",
|
|
6
|
+
SUCCESS: "SUCCESS",
|
|
7
|
+
PROGRESS: "PROGRESS",
|
|
8
|
+
};
|