@8ms/helpers 2.3.26 → 2.3.28

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 (148) hide show
  1. package/dist/_class/index.d.mts +2 -0
  2. package/dist/_class/index.mjs +61 -0
  3. package/dist/adverity/index.d.mts +2 -0
  4. package/dist/adverity/index.mjs +64 -0
  5. package/dist/adverity/server/index.d.mts +18 -0
  6. package/dist/adverity/server/index.mjs +25 -0
  7. package/dist/api/index.d.mts +2 -0
  8. package/dist/api/index.mjs +3 -0
  9. package/dist/api-DGKJDAfb.mjs +139 -0
  10. package/dist/array/index.d.mts +11 -0
  11. package/dist/array/index.mjs +12 -0
  12. package/dist/atInternet/index.d.mts +20 -0
  13. package/dist/atInternet/index.mjs +18 -0
  14. package/dist/aws/ec2/server/index.d.mts +18 -0
  15. package/dist/aws/ec2/server/index.mjs +48 -0
  16. package/dist/aws/ecs/server/index.d.mts +59 -0
  17. package/dist/aws/ecs/server/index.mjs +113 -0
  18. package/dist/aws/glue/server/index.d.mts +19 -0
  19. package/dist/aws/glue/server/index.mjs +36 -0
  20. package/dist/aws/lambda/server/index.d.mts +28 -0
  21. package/dist/aws/lambda/server/index.mjs +57 -0
  22. package/dist/aws/s3/server/index.d.mts +124 -0
  23. package/dist/aws/s3/server/index.mjs +360 -0
  24. package/dist/aws/server/index.d.mts +2 -0
  25. package/dist/aws/server/index.mjs +3 -0
  26. package/dist/aws/ses/server/index.d.mts +105 -0
  27. package/dist/aws/ses/server/index.mjs +268 -0
  28. package/dist/aws/sqs/server/index.d.mts +41 -0
  29. package/dist/aws/sqs/server/index.mjs +56 -0
  30. package/dist/aws/ssm/server/index.d.mts +18 -0
  31. package/dist/aws/ssm/server/index.mjs +47 -0
  32. package/dist/axios/index.d.mts +22 -0
  33. package/dist/axios/index.mjs +50 -0
  34. package/dist/boolean/index.d.mts +7 -0
  35. package/dist/boolean/index.mjs +13 -0
  36. package/dist/brightData/serpApi/server/index.d.mts +93 -0
  37. package/dist/brightData/serpApi/server/index.mjs +229 -0
  38. package/dist/brightData/server/index.d.mts +2 -0
  39. package/dist/brightData/server/index.mjs +18 -0
  40. package/dist/brightData/webScraperIde/server/index.d.mts +19 -0
  41. package/dist/brightData/webScraperIde/server/index.mjs +50 -0
  42. package/dist/cache/server/index.d.mts +10 -0
  43. package/dist/cache/server/index.mjs +31 -0
  44. package/dist/chunk-DDarj8oW.mjs +7 -0
  45. package/dist/crud/index.d.mts +10 -0
  46. package/dist/crud/index.mjs +10 -0
  47. package/dist/crypto/index.d.mts +25 -0
  48. package/dist/crypto/index.mjs +57 -0
  49. package/dist/date/index.d.mts +2 -0
  50. package/dist/date/index.mjs +471 -0
  51. package/dist/drizzle/server/index.d.mts +22 -0
  52. package/dist/drizzle/server/index.mjs +69 -0
  53. package/dist/environment/index.d.mts +37 -0
  54. package/dist/environment/index.mjs +60 -0
  55. package/dist/eskimi/index.d.mts +52 -0
  56. package/dist/eskimi/index.mjs +90 -0
  57. package/dist/eskimi/server/index.d.mts +25 -0
  58. package/dist/eskimi/server/index.mjs +50 -0
  59. package/dist/file/index.d.mts +7 -0
  60. package/dist/file/index.mjs +20 -0
  61. package/dist/file/server/index.d.mts +8 -0
  62. package/dist/file/server/index.mjs +16 -0
  63. package/dist/geo/index.d.mts +26 -0
  64. package/dist/geo/index.mjs +1591 -0
  65. package/dist/getDecimal-CafxtLhH.mjs +40 -0
  66. package/dist/googleAds/keywordPlanner/server/index.d.mts +45 -0
  67. package/dist/googleAds/keywordPlanner/server/index.mjs +51 -0
  68. package/dist/googleAds/server/index.d.mts +27 -0
  69. package/dist/googleAds/server/index.mjs +48 -0
  70. package/dist/googleCloud/bigquery/server/index.d.mts +82 -0
  71. package/dist/googleCloud/bigquery/server/index.mjs +133 -0
  72. package/dist/googleCloud/server/index.d.mts +2 -0
  73. package/dist/googleCloud/server/index.mjs +24 -0
  74. package/dist/googleCloud/sheets/server/index.d.mts +22 -0
  75. package/dist/googleCloud/sheets/server/index.mjs +31 -0
  76. package/dist/googleCloud/storage/server/index.d.mts +31 -0
  77. package/dist/googleCloud/storage/server/index.mjs +79 -0
  78. package/dist/googlePageSpeed/server/index.d.mts +34 -0
  79. package/dist/googlePageSpeed/server/index.mjs +53 -0
  80. package/dist/googleSearchIncidents/server/index.d.mts +73 -0
  81. package/dist/googleSearchIncidents/server/index.mjs +55 -0
  82. package/dist/greenDomain/server/index.d.mts +25 -0
  83. package/dist/greenDomain/server/index.mjs +31 -0
  84. package/dist/index-1fBbJGQz.d.mts +246 -0
  85. package/dist/index-BHuvb_7y.d.mts +116 -0
  86. package/dist/index-BfyGIdDD.d.mts +18 -0
  87. package/dist/index-CqTOMR8f.d.mts +17 -0
  88. package/dist/index-DW9yJLtI.d.mts +67 -0
  89. package/dist/index-DmCSxHCc.d.mts +32 -0
  90. package/dist/index-DwB8X1lz.d.mts +32 -0
  91. package/dist/inngest/index.d.mts +10 -0
  92. package/dist/inngest/index.mjs +10 -0
  93. package/dist/json/index.d.mts +7 -0
  94. package/dist/json/index.mjs +27 -0
  95. package/dist/littleWarden/server/index.d.mts +56 -0
  96. package/dist/littleWarden/server/index.mjs +79 -0
  97. package/dist/lodash/index.d.mts +45 -0
  98. package/dist/lodash/index.mjs +177 -0
  99. package/dist/lumar/api/server/index.d.mts +66 -0
  100. package/dist/lumar/api/server/index.mjs +111 -0
  101. package/dist/lumar/graphql/server/index.d.mts +308 -0
  102. package/dist/lumar/graphql/server/index.mjs +172 -0
  103. package/dist/myTarget/server/index.d.mts +9 -0
  104. package/dist/myTarget/server/index.mjs +16 -0
  105. package/dist/nextAuth/index.d.mts +12 -0
  106. package/dist/nextAuth/index.mjs +15 -0
  107. package/dist/nextJs/client/index.d.mts +10 -0
  108. package/dist/nextJs/client/index.mjs +12 -0
  109. package/dist/nextJs/index.d.mts +19 -0
  110. package/dist/nextJs/index.mjs +12 -0
  111. package/dist/number/index.d.mts +54 -0
  112. package/dist/number/index.mjs +75 -0
  113. package/dist/object/index.d.mts +8 -0
  114. package/dist/object/index.mjs +22 -0
  115. package/dist/onePassword/server/index.d.mts +24 -0
  116. package/dist/onePassword/server/index.mjs +50 -0
  117. package/dist/openAi/server/index.d.mts +20 -0
  118. package/dist/openAi/server/index.mjs +46 -0
  119. package/dist/prisma/index.d.mts +7 -0
  120. package/dist/prisma/index.mjs +15 -0
  121. package/dist/prisma/server/index.d.mts +31 -0
  122. package/dist/prisma/server/index.mjs +64 -0
  123. package/dist/server-Bwy4JI8Z.mjs +33 -0
  124. package/dist/snapchat/server/index.d.mts +25 -0
  125. package/dist/snapchat/server/index.mjs +39 -0
  126. package/dist/sorting/index.d.mts +25 -0
  127. package/dist/sorting/index.mjs +50 -0
  128. package/dist/stream/server/index.d.mts +15 -0
  129. package/dist/stream/server/index.mjs +48 -0
  130. package/dist/string/index.d.mts +107 -0
  131. package/dist/string/index.mjs +187 -0
  132. package/dist/swr/client/index.d.mts +46 -0
  133. package/dist/swr/client/index.mjs +40 -0
  134. package/dist/upTimeRobot/server/index.d.mts +72 -0
  135. package/dist/upTimeRobot/server/index.mjs +82 -0
  136. package/dist/url/index.d.mts +29 -0
  137. package/dist/url/index.mjs +52 -0
  138. package/dist/url/server/index.d.mts +9 -0
  139. package/dist/url/server/index.mjs +35 -0
  140. package/dist/util/index.d.mts +50 -0
  141. package/dist/util/index.mjs +107 -0
  142. package/dist/util/server/index.d.mts +27 -0
  143. package/dist/util/server/index.mjs +61 -0
  144. package/dist/webWorker/index.d.mts +11 -0
  145. package/dist/webWorker/index.mjs +11 -0
  146. package/dist/xml/server/index.d.mts +4 -0
  147. package/dist/xml/server/index.mjs +17 -0
  148. package/package.json +189 -118
@@ -0,0 +1,67 @@
1
+ import { z } from "zod/v4";
2
+
3
+ //#region src/api/ApiResponseClass.d.ts
4
+ type ConstructorProps = {
5
+ body?: any;
6
+ error?: any;
7
+ state?: ApiState;
8
+ };
9
+ /**
10
+ * Class version of the API to enable quicker instances.
11
+ */
12
+ declare class ApiResponseClass<T = any, E = any> {
13
+ state: ApiState;
14
+ body: T | null;
15
+ error: E | null;
16
+ constructor({
17
+ body,
18
+ error,
19
+ state
20
+ }?: ConstructorProps);
21
+ fromJson: (input: ApiResponse) => this;
22
+ getBody: () => any;
23
+ getBodyDefaultTo: (keys: any | any[], defaultValue: any) => any;
24
+ getError: () => any;
25
+ getJson: () => ApiResponse<T, E>;
26
+ getApiState: () => ApiState;
27
+ isError: () => boolean;
28
+ isIdle: () => boolean;
29
+ isPending: () => boolean;
30
+ isSuccess: () => boolean;
31
+ setToIdle: () => this;
32
+ setToPending: () => this;
33
+ setToError: (error: any, body?: any) => this;
34
+ setToSuccess: (body: any) => this;
35
+ setBody: (body: any) => this;
36
+ setError: (error: any) => this;
37
+ setApiState: (state: ApiState) => this;
38
+ validateZod: <T_1>(schema: z.ZodSchema<T_1>) => ApiResponseClass<T_1, E>;
39
+ }
40
+ //#endregion
41
+ //#region src/api/api.d.ts
42
+ declare const apiState: {
43
+ readonly CANCELLED: "CANCELLED";
44
+ readonly ERROR: "ERROR";
45
+ readonly IDLE: "IDLE";
46
+ readonly PENDING: "PENDING";
47
+ readonly SUCCESS: "SUCCESS";
48
+ readonly VALIDATION_ERROR: "VALIDATION_ERROR";
49
+ };
50
+ type ApiState = typeof apiState[keyof typeof apiState];
51
+ type ApiResponse<T = any, E = any> = {
52
+ body: T | null;
53
+ error: E | null;
54
+ state: ApiState;
55
+ };
56
+ declare const defaultResponse: ApiResponse;
57
+ declare const unexpectedError: string;
58
+ //#endregion
59
+ //#region src/api/functions.d.ts
60
+ declare const isCancelled: (apiResponse: ApiResponse) => boolean;
61
+ declare const isError: (apiResponse: ApiResponse) => boolean;
62
+ declare const isIdle: (apiResponse: ApiResponse) => boolean;
63
+ declare const isPending: (apiResponse: ApiResponse) => boolean;
64
+ declare const isSuccess: (apiResponse: ApiResponse) => boolean;
65
+ declare const isValidationError: (apiResponse: ApiResponse) => boolean;
66
+ //#endregion
67
+ export { isSuccess as a, ApiState as c, unexpectedError as d, ApiResponseClass as f, isPending as i, apiState as l, isError as n, isValidationError as o, isIdle as r, ApiResponse as s, isCancelled as t, defaultResponse as u };
@@ -0,0 +1,32 @@
1
+ //#region src/googleCloud/server/googleCloud.d.ts
2
+ type GoogleCloudConfig = {
3
+ type: string;
4
+ project_id: string;
5
+ private_key_id: string;
6
+ private_key: string;
7
+ client_email: string;
8
+ client_id: string;
9
+ auth_uri: string;
10
+ token_uri: string;
11
+ auth_provider_x509_cert_url: string;
12
+ client_x509_cert_url: string;
13
+ };
14
+ /**
15
+ * Using the response from Parameter Store and format it ready to be used with Google API.
16
+ */
17
+ declare const getConfig: (parameter: GoogleCloudConfig, projectId?: string) => {
18
+ credentials: {
19
+ type: string;
20
+ project_id: string;
21
+ private_key_id: string;
22
+ private_key: string;
23
+ client_email: string;
24
+ client_id: string;
25
+ auth_uri: string;
26
+ token_uri: string;
27
+ auth_provider_x509_cert_url: string;
28
+ client_x509_cert_url: string;
29
+ };
30
+ };
31
+ //#endregion
32
+ export { getConfig as n, GoogleCloudConfig as t };
@@ -0,0 +1,32 @@
1
+ //#region src/_class/BaseClass.d.ts
2
+ declare class BaseClass {
3
+ /**
4
+ * Shortcut to set a value to an array and return the instance.
5
+ */
6
+ protected _setArray: (fields: any | any[], input: any | any[]) => this;
7
+ /**
8
+ * Shortcut to set a value and return the instance.
9
+ */
10
+ protected _setValue: (fields: any | any[], input: any) => this;
11
+ /**
12
+ * Shortcut to add a value to an existing array.
13
+ */
14
+ protected _push: (fields: any | any[], input: any | any[]) => this;
15
+ /**
16
+ * Shortcut to get a value, but default if the fields don't exist.
17
+ */
18
+ protected _get: (fields: any | any[], defaultValue?: any) => any;
19
+ }
20
+ //#endregion
21
+ //#region src/_class/BaseNamespace.d.ts
22
+ declare class BaseNamespace {
23
+ client: any;
24
+ key: string;
25
+ config: any;
26
+ constructor(key: string, config: any);
27
+ ensureInit: () => Promise<void>;
28
+ reset: () => void;
29
+ getClient: () => Promise<any>;
30
+ }
31
+ //#endregion
32
+ export { BaseClass as n, BaseNamespace as t };
@@ -0,0 +1,10 @@
1
+ //#region src/inngest/inngest.d.ts
2
+ declare const inngestState: {
3
+ RUNNING: string;
4
+ COMPLETED: string;
5
+ FAILED: string;
6
+ CANCELLED: string;
7
+ };
8
+ type InngestState = typeof inngestState[keyof typeof inngestState];
9
+ //#endregion
10
+ export { InngestState, inngestState };
@@ -0,0 +1,10 @@
1
+ //#region src/inngest/inngest.ts
2
+ const inngestState = {
3
+ RUNNING: "Running",
4
+ COMPLETED: "Completed",
5
+ FAILED: "Failed",
6
+ CANCELLED: "Cancelled"
7
+ };
8
+
9
+ //#endregion
10
+ export { inngestState };
@@ -0,0 +1,7 @@
1
+ //#region src/json/getJsonNewline.d.ts
2
+ declare const getJsonNewline: (data: any) => string;
3
+ //#endregion
4
+ //#region src/json/isJson.d.ts
5
+ declare const isJson: (input: any) => boolean;
6
+ //#endregion
7
+ export { getJsonNewline, isJson };
@@ -0,0 +1,27 @@
1
+ import { getArray } from "../array/index.mjs";
2
+
3
+ //#region src/json/getJsonNewline.ts
4
+ const getJsonNewline = (data) => {
5
+ return getArray(data).map((row) => JSON.stringify(row)).join("\n");
6
+ };
7
+
8
+ //#endregion
9
+ //#region src/json/isJson.ts
10
+ const isJson = (input) => {
11
+ if (typeof input !== "string") try {
12
+ const stringified = JSON.stringify(input);
13
+ JSON.parse(stringified);
14
+ return true;
15
+ } catch (e) {
16
+ return false;
17
+ }
18
+ try {
19
+ JSON.parse(input);
20
+ return true;
21
+ } catch (e) {
22
+ return false;
23
+ }
24
+ };
25
+
26
+ //#endregion
27
+ export { getJsonNewline, isJson };
@@ -0,0 +1,56 @@
1
+ import { t as BaseNamespace } from "../../index-DwB8X1lz.mjs";
2
+
3
+ //#region src/littleWarden/server/LittleWardenNamespace.d.ts
4
+ /**
5
+ * Based on https://developers.google.com/speed/docs/insights/rest/v5/pagespeedapi/runpagespeed
6
+ */
7
+ declare class LittleWardenNamespace extends BaseNamespace {
8
+ client: boolean;
9
+ config: LittleWardenConfig;
10
+ ensureInit: () => Promise<void>;
11
+ getReport: (urlId: string) => Promise<any>;
12
+ }
13
+ //#endregion
14
+ //#region src/littleWarden/server/getUrlStatus.d.ts
15
+ /**
16
+ * Get the URL Status for a given URL ID from Little Warden.
17
+ */
18
+ declare const getUrlStatus: (apiKey: string, urlId: string) => Promise<any>;
19
+ //#endregion
20
+ //#region src/littleWarden/server/littleWarden.d.ts
21
+ type LittleWardenConfig = {
22
+ apiKey: string;
23
+ };
24
+ declare const littleWardenClient: (key?: string, config?: LittleWardenConfig, vaultId?: string, itemId?: string) => Promise<LittleWardenNamespace>;
25
+ declare const littleWardenState: {
26
+ readonly ALL_GOOD: "all_good";
27
+ readonly DANGER: "danger";
28
+ readonly WARNING: "warning";
29
+ };
30
+ type LittleWardenState = typeof littleWardenState[keyof typeof littleWardenState];
31
+ /**
32
+ * Check if the field is All Good.
33
+ */
34
+ declare const isAllGood: ({
35
+ field
36
+ }: {
37
+ field: any;
38
+ }) => boolean;
39
+ /**
40
+ * Check if the field is Warning.
41
+ */
42
+ declare const isWarning: ({
43
+ field
44
+ }: {
45
+ field: any;
46
+ }) => boolean;
47
+ /**
48
+ * Check if the field is Danger.
49
+ */
50
+ declare const isDanger: ({
51
+ field
52
+ }: {
53
+ field: any;
54
+ }) => boolean;
55
+ //#endregion
56
+ export { LittleWardenConfig, LittleWardenNamespace, LittleWardenState, getUrlStatus, isAllGood, isDanger, isWarning, littleWardenClient, littleWardenState };
@@ -0,0 +1,79 @@
1
+ import { BaseNamespace } from "../../_class/index.mjs";
2
+ import "../../api-DGKJDAfb.mjs";
3
+ import { get } from "../../axios/index.mjs";
4
+ import { onePasswordClient } from "../../onePassword/server/index.mjs";
5
+
6
+ //#region src/littleWarden/server/LittleWardenNamespace.ts
7
+ /**
8
+ * Based on https://developers.google.com/speed/docs/insights/rest/v5/pagespeedapi/runpagespeed
9
+ */
10
+ var LittleWardenNamespace = class extends BaseNamespace {
11
+ ensureInit = async () => {
12
+ if (!this.client) try {
13
+ this.client = true;
14
+ } catch (e) {
15
+ throw new Error("Google PageSpeed Client not installed");
16
+ }
17
+ };
18
+ getReport = async (urlId) => {
19
+ const apiResponse = await get(`https://littlewarden.com/api/sites/${urlId}`, { headers: { "Authorization": `Token token="${this.config.apiKey}"` } });
20
+ if (apiResponse.isSuccess()) return apiResponse.getBody();
21
+ return null;
22
+ };
23
+ };
24
+
25
+ //#endregion
26
+ //#region src/littleWarden/server/getUrlStatus.ts
27
+ /**
28
+ * Get the URL Status for a given URL ID from Little Warden.
29
+ */
30
+ const getUrlStatus = async (apiKey, urlId) => {
31
+ return (await get(`https://littlewarden.com/api/sites/${urlId}`, { headers: { "Authorization": `Token token="${apiKey}"` } })).getBodyDefaultTo(["data", "site"], {});
32
+ };
33
+
34
+ //#endregion
35
+ //#region src/littleWarden/server/littleWarden.ts
36
+ const littleWardenNamespaces = /* @__PURE__ */ new Map();
37
+ const littleWardenClient = async (key = "default", config, vaultId, itemId) => {
38
+ if (littleWardenNamespaces.has(key)) return littleWardenNamespaces.get(key);
39
+ let instanceConfig;
40
+ if (config) instanceConfig = config;
41
+ else if (vaultId && itemId) instanceConfig = await (await onePasswordClient()).getJsonNote(vaultId, itemId);
42
+ else if (process.env.LITTLE_WARDEN_VAULT_ID && process.env.LITTLE_WARDEN_ITEM_ID) instanceConfig = await (await onePasswordClient()).getJsonNote(process.env.LITTLE_WARDEN_VAULT_ID, process.env.LITTLE_WARDEN_ITEM_ID);
43
+ else throw new Error(`Config required for namespace '${key}'`);
44
+ const namespace = new LittleWardenNamespace(key, instanceConfig);
45
+ littleWardenNamespaces.set(key, namespace);
46
+ return namespace;
47
+ };
48
+ const littleWardenState = {
49
+ ALL_GOOD: "all_good",
50
+ DANGER: "danger",
51
+ WARNING: "warning"
52
+ };
53
+ /**
54
+ * Check if the field is All Good.
55
+ */
56
+ const isAllGood = ({ field }) => {
57
+ let response = false;
58
+ if (void 0 !== field && void 0 !== field["status"]) response = littleWardenState.ALL_GOOD === field["status"];
59
+ return response;
60
+ };
61
+ /**
62
+ * Check if the field is Warning.
63
+ */
64
+ const isWarning = ({ field }) => {
65
+ let response = false;
66
+ if (void 0 !== field && void 0 !== field["status"]) response = littleWardenState.WARNING === field["status"];
67
+ return response;
68
+ };
69
+ /**
70
+ * Check if the field is Danger.
71
+ */
72
+ const isDanger = ({ field }) => {
73
+ let response = false;
74
+ if (void 0 !== field && void 0 !== field["status"]) response = littleWardenState.DANGER === field["status"];
75
+ return response;
76
+ };
77
+
78
+ //#endregion
79
+ export { LittleWardenNamespace, getUrlStatus, isAllGood, isDanger, isWarning, littleWardenClient, littleWardenState };
@@ -0,0 +1,45 @@
1
+ //#region src/lodash/chunk.d.ts
2
+ declare const chunk: <T>(array: T[], size: number) => T[][];
3
+ //#endregion
4
+ //#region src/lodash/flatten.d.ts
5
+ declare const flatten: <T>(array: T[][]) => T[];
6
+ //#endregion
7
+ //#region src/lodash/set.d.ts
8
+ declare const set: <T extends object>(obj: T, path: string | string[], value: unknown) => T;
9
+ //#endregion
10
+ //#region src/lodash/trim.d.ts
11
+ declare const trim: (str: string, chars?: string) => string;
12
+ //#endregion
13
+ //#region src/lodash/isDate.d.ts
14
+ declare const isDate: (value: unknown) => value is Date;
15
+ //#endregion
16
+ //#region src/lodash/isEmpty.d.ts
17
+ declare const isEmpty: (value: unknown) => boolean;
18
+ //#endregion
19
+ //#region src/lodash/isEqual.d.ts
20
+ declare const isEqual: (a: unknown, b: unknown) => boolean;
21
+ //#endregion
22
+ //#region src/lodash/isFunction.d.ts
23
+ declare const isFunction: (value: any) => value is Function;
24
+ //#endregion
25
+ //#region src/lodash/isObject.d.ts
26
+ declare const isObject: (value: unknown) => value is object;
27
+ //#endregion
28
+ //#region src/lodash/merge.d.ts
29
+ declare const merge: <T extends object>(target: T, ...sources: any[]) => T;
30
+ //#endregion
31
+ //#region src/lodash/orderBy.d.ts
32
+ type OrderDirection = "asc" | "desc";
33
+ type Iteratee<T> = ((item: T) => unknown) | string;
34
+ declare const orderBy: <T>(collection: T[] | Record<string, T>, iteratees: Iteratee<T> | Iteratee<T>[], orders?: OrderDirection | OrderDirection[]) => T[];
35
+ //#endregion
36
+ //#region src/lodash/unescape.d.ts
37
+ declare const unescape: (str: string) => string;
38
+ //#endregion
39
+ //#region src/lodash/uniq.d.ts
40
+ declare const uniq: (arr: any[]) => any[];
41
+ //#endregion
42
+ //#region src/lodash/uniqBy.d.ts
43
+ declare const uniqBy: <T>(collection: T[], iteratee: ((item: T) => unknown) | string) => T[];
44
+ //#endregion
45
+ export { chunk, flatten, isDate, isEmpty, isEqual, isFunction, isObject, merge, orderBy, set, trim, unescape, uniq, uniqBy };
@@ -0,0 +1,177 @@
1
+ //#region src/lodash/chunk.ts
2
+ const chunk = (array, size) => {
3
+ const result = [];
4
+ for (let i = 0; i < array.length; i += size) result.push(array.slice(i, i + size));
5
+ return result;
6
+ };
7
+
8
+ //#endregion
9
+ //#region src/lodash/flatten.ts
10
+ const flatten = (array) => [].concat(...array);
11
+
12
+ //#endregion
13
+ //#region src/lodash/set.ts
14
+ const set = (obj, path, value) => {
15
+ if (obj == null) return obj;
16
+ const keys = Array.isArray(path) ? path : path.replace(/\[(\d+)\]/g, ".$1").split(".").filter(Boolean);
17
+ let current = obj;
18
+ for (let i = 0; i < keys.length - 1; i++) {
19
+ const key = keys[i];
20
+ const nextKey = keys[i + 1];
21
+ const nextIsIndex = /^\d+$/.test(nextKey);
22
+ if (current[key] == null || typeof current[key] !== "object") current[key] = nextIsIndex ? [] : {};
23
+ current = current[key];
24
+ }
25
+ current[keys[keys.length - 1]] = value;
26
+ return obj;
27
+ };
28
+
29
+ //#endregion
30
+ //#region src/lodash/trim.ts
31
+ const trim = (str, chars) => {
32
+ if (!chars) return str.trim();
33
+ const escaped = chars.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
34
+ const pattern = new RegExp(`^[${escaped}]+|[${escaped}]+$`, "g");
35
+ return str.replace(pattern, "");
36
+ };
37
+
38
+ //#endregion
39
+ //#region src/lodash/isDate.ts
40
+ const isDate = (value) => {
41
+ return value instanceof Date && !isNaN(value.getTime());
42
+ };
43
+
44
+ //#endregion
45
+ //#region src/lodash/isEmpty.ts
46
+ const isEmpty = (value) => {
47
+ if (value == null) return true;
48
+ if (typeof value === "boolean" || typeof value === "number") return true;
49
+ if (typeof value === "string" || Array.isArray(value)) return value.length === 0;
50
+ if (value instanceof Map || value instanceof Set) return value.size === 0;
51
+ if (typeof value === "object") return Object.keys(value).length === 0;
52
+ return true;
53
+ };
54
+
55
+ //#endregion
56
+ //#region src/lodash/isEqual.ts
57
+ const isEqual = (a, b) => {
58
+ if (a === b) return true;
59
+ if (a == null || b == null) return a === b;
60
+ if (typeof a !== typeof b) return false;
61
+ if (a instanceof Date && b instanceof Date) return a.getTime() === b.getTime();
62
+ if (a instanceof RegExp && b instanceof RegExp) return a.toString() === b.toString();
63
+ if (Array.isArray(a) && Array.isArray(b)) {
64
+ if (a.length !== b.length) return false;
65
+ return a.every((item, i) => isEqual(item, b[i]));
66
+ }
67
+ if (Array.isArray(a) !== Array.isArray(b)) return false;
68
+ if (a instanceof Map && b instanceof Map) {
69
+ if (a.size !== b.size) return false;
70
+ for (const [key, val] of a) if (!b.has(key) || !isEqual(val, b.get(key))) return false;
71
+ return true;
72
+ }
73
+ if (a instanceof Set && b instanceof Set) {
74
+ if (a.size !== b.size) return false;
75
+ for (const val of a) if (!b.has(val)) return false;
76
+ return true;
77
+ }
78
+ if (typeof a === "object" && typeof b === "object") {
79
+ const keysA = Object.keys(a);
80
+ const keysB = Object.keys(b);
81
+ if (keysA.length !== keysB.length) return false;
82
+ return keysA.every((key) => Object.prototype.hasOwnProperty.call(b, key) && isEqual(a[key], b[key]));
83
+ }
84
+ return false;
85
+ };
86
+
87
+ //#endregion
88
+ //#region src/lodash/isFunction.ts
89
+ const isFunction = (value) => typeof value === "function";
90
+
91
+ //#endregion
92
+ //#region src/lodash/isObject.ts
93
+ const isObject = (value) => {
94
+ const type = typeof value;
95
+ return value != null && (type === "object" || type === "function");
96
+ };
97
+
98
+ //#endregion
99
+ //#region src/lodash/merge.ts
100
+ const merge = (target, ...sources) => {
101
+ for (const source of sources) {
102
+ if (source == null) continue;
103
+ for (const key of Object.keys(source)) {
104
+ const sourceVal = source[key];
105
+ const targetVal = target[key];
106
+ if (Array.isArray(sourceVal) && Array.isArray(targetVal)) {
107
+ const merged = [...targetVal];
108
+ for (let i = 0; i < sourceVal.length; i++) if (sourceVal[i] != null && typeof sourceVal[i] === "object") merged[i] = merge(targetVal[i] ?? {}, sourceVal[i]);
109
+ else merged[i] = sourceVal[i];
110
+ target[key] = merged;
111
+ } else if (sourceVal != null && typeof sourceVal === "object" && !Array.isArray(sourceVal) && !(sourceVal instanceof Date)) target[key] = merge(targetVal != null && typeof targetVal === "object" ? targetVal : {}, sourceVal);
112
+ else if (sourceVal !== void 0) target[key] = sourceVal;
113
+ }
114
+ }
115
+ return target;
116
+ };
117
+
118
+ //#endregion
119
+ //#region src/lodash/orderBy.ts
120
+ const orderBy = (collection, iteratees, orders = "asc") => {
121
+ const arr = Array.isArray(collection) ? collection : Object.values(collection);
122
+ const keys = Array.isArray(iteratees) ? iteratees : [iteratees];
123
+ const dirs = Array.isArray(orders) ? orders : [orders];
124
+ const getValue = (item, key) => {
125
+ if (typeof key === "function") return key(item);
126
+ return key.split(".").reduce((acc, part) => acc?.[part], item);
127
+ };
128
+ return [...arr].sort((a, b) => {
129
+ for (let i = 0; i < keys.length; i++) {
130
+ const dir = dirs[i] === "desc" ? -1 : 1;
131
+ const aVal = getValue(a, keys[i]);
132
+ const bVal = getValue(b, keys[i]);
133
+ if (aVal === bVal) continue;
134
+ if (aVal == null) return 1;
135
+ if (bVal == null) return -1;
136
+ if (typeof aVal === "string" && typeof bVal === "string") return aVal.localeCompare(bVal) * dir;
137
+ return (aVal < bVal ? -1 : 1) * dir;
138
+ }
139
+ return 0;
140
+ });
141
+ };
142
+
143
+ //#endregion
144
+ //#region src/lodash/unescape.ts
145
+ const unescape = (str) => {
146
+ const htmlEntities = {
147
+ "&amp;": "&",
148
+ "&lt;": "<",
149
+ "&gt;": ">",
150
+ "&quot;": "\"",
151
+ "&#39;": "'"
152
+ };
153
+ return str.replace(/&(?:amp|lt|gt|quot|#39);/g, (match) => htmlEntities[match]);
154
+ };
155
+
156
+ //#endregion
157
+ //#region src/lodash/uniq.ts
158
+ const uniq = (arr) => [...new Set(arr)];
159
+
160
+ //#endregion
161
+ //#region src/lodash/uniqBy.ts
162
+ const uniqBy = (collection, iteratee) => {
163
+ const seen = /* @__PURE__ */ new Set();
164
+ const getValue = (item) => {
165
+ if (typeof iteratee === "function") return iteratee(item);
166
+ return iteratee.split(".").reduce((acc, part) => acc?.[part], item);
167
+ };
168
+ return collection.filter((item) => {
169
+ const key = getValue(item);
170
+ if (seen.has(key)) return false;
171
+ seen.add(key);
172
+ return true;
173
+ });
174
+ };
175
+
176
+ //#endregion
177
+ export { chunk, flatten, isDate, isEmpty, isEqual, isFunction, isObject, merge, orderBy, set, trim, unescape, uniq, uniqBy };
@@ -0,0 +1,66 @@
1
+ import { f as ApiResponseClass } from "../../../index-DW9yJLtI.mjs";
2
+
3
+ //#region src/lumar/api/server/lumarApi.d.ts
4
+ type Filter = {
5
+ field: string;
6
+ operand: string;
7
+ value: string;
8
+ };
9
+ declare const operand: {
10
+ readonly EQUALS: "eql";
11
+ readonly CONTAINS: "cont";
12
+ readonly LESS_THAN: "lt";
13
+ readonly LESS_THAN_OR_EQUAL: "lte";
14
+ readonly GREATER_THAN: "gt";
15
+ readonly GREATER_THAN_OR_EQUAL: "gte";
16
+ readonly REGEX: "rgx";
17
+ readonly NOT_REGEX: "nrgx";
18
+ };
19
+ type Operand = typeof operand[keyof typeof operand];
20
+ declare const order: {
21
+ readonly ASCENDING: "asc";
22
+ readonly DESCENDING: "desc";
23
+ };
24
+ type Order = typeof order[keyof typeof order];
25
+ type OrderRow = {
26
+ direction: Order;
27
+ field: string;
28
+ };
29
+ declare const report: {
30
+ readonly CRAWL_STATISTICS: "crawl_statistics";
31
+ readonly CUSTOM: "custom";
32
+ readonly LIST_PROJECTS: "list_projects";
33
+ readonly LIST_CRAWLS: "list_crawls";
34
+ readonly LIST_REPORTS: "list_reports";
35
+ readonly REPORT_ROWS: "report_rows";
36
+ readonly REPORT_STATISTICS: "report_statistics";
37
+ readonly REPORT_SUMMARY: "report_summary";
38
+ };
39
+ type Report = typeof report[keyof typeof report];
40
+ //#endregion
41
+ //#region src/lumar/api/server/buildRequest.d.ts
42
+ type BuildRequestProps = {
43
+ crawlId?: number;
44
+ customPath?: string;
45
+ filters?: Filter[];
46
+ limit?: number;
47
+ orders?: OrderRow[];
48
+ page?: number;
49
+ projectId?: number;
50
+ report?: Report;
51
+ subReport?: string;
52
+ };
53
+ declare const buildRequest: (props: BuildRequestProps) => string;
54
+ //#endregion
55
+ //#region src/lumar/api/server/getData.d.ts
56
+ declare const getData: (url: string, accessToken: string) => Promise<ApiResponseClass<any, any>>;
57
+ //#endregion
58
+ //#region src/lumar/api/server/initClient.d.ts
59
+ /**
60
+ * http://api-docs.deepcrawl.com/
61
+ * Renew the Lumar user token.
62
+ * Token lasts for 6 hours.
63
+ */
64
+ declare const initClient: (apiId: string, apiKey: string) => Promise<any>;
65
+ //#endregion
66
+ export { BuildRequestProps, Filter, Operand, Order, OrderRow, Report, buildRequest, getData, initClient, operand, order, report };