@8ms/helpers 3.0.22 → 3.0.24

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 (208) hide show
  1. package/dist/_virtual/_rolldown/runtime.cjs +1 -1
  2. package/dist/adverity/adverity.d.cts +0 -1
  3. package/dist/adverity/adverity.d.mts +0 -1
  4. package/dist/adverity/server/getJobs.d.cts +2 -0
  5. package/dist/adverity/server/getJobs.d.mts +2 -0
  6. package/dist/api/ApiResponseClass.d.cts +1 -6
  7. package/dist/api/ApiResponseClass.d.mts +1 -6
  8. package/dist/api/api.d.cts +0 -1
  9. package/dist/api/api.d.mts +0 -1
  10. package/dist/api/deleteRequest.d.cts +0 -1
  11. package/dist/api/deleteRequest.d.mts +0 -1
  12. package/dist/api/functions.d.cts +0 -1
  13. package/dist/api/functions.d.mts +0 -1
  14. package/dist/api/get.d.cts +0 -1
  15. package/dist/api/get.d.mts +0 -1
  16. package/dist/api/post.d.cts +0 -1
  17. package/dist/api/post.d.mts +0 -1
  18. package/dist/atInternet/atInternet.d.cts +0 -1
  19. package/dist/atInternet/atInternet.d.mts +0 -1
  20. package/dist/aws/cloudWatchLog/server/AwsCloudWatchLog.d.cts +0 -1
  21. package/dist/aws/cloudWatchLog/server/AwsCloudWatchLog.d.mts +0 -1
  22. package/dist/aws/cloudWatchLog/server/logEvent.d.cts +1 -0
  23. package/dist/aws/cloudWatchLog/server/logEvent.d.mts +1 -0
  24. package/dist/aws/cloudWatchMetric/server/AwsCloudWatchMetric.d.cts +0 -1
  25. package/dist/aws/cloudWatchMetric/server/AwsCloudWatchMetric.d.mts +0 -1
  26. package/dist/aws/cloudWatchMetric/server/logMetric.d.cts +1 -1
  27. package/dist/aws/cloudWatchMetric/server/logMetric.d.mts +1 -1
  28. package/dist/aws/ec2/server/AwsEc2.d.cts +0 -1
  29. package/dist/aws/ec2/server/AwsEc2.d.mts +0 -1
  30. package/dist/aws/ecs/server/AwsEcs.d.cts +0 -1
  31. package/dist/aws/ecs/server/AwsEcs.d.mts +0 -1
  32. package/dist/aws/glue/server/AwsGlue.cjs +2 -1
  33. package/dist/aws/glue/server/AwsGlue.d.cts +0 -1
  34. package/dist/aws/glue/server/AwsGlue.d.mts +0 -1
  35. package/dist/aws/glue/server/AwsGlue.mjs +2 -1
  36. package/dist/aws/lambda/server/AwsLambda.cjs +10 -8
  37. package/dist/aws/lambda/server/AwsLambda.d.cts +0 -1
  38. package/dist/aws/lambda/server/AwsLambda.d.mts +0 -1
  39. package/dist/aws/lambda/server/AwsLambda.mjs +10 -8
  40. package/dist/aws/s3/server/AwsS3.cjs +3 -2
  41. package/dist/aws/s3/server/AwsS3.d.cts +1 -1
  42. package/dist/aws/s3/server/AwsS3.d.mts +1 -1
  43. package/dist/aws/s3/server/AwsS3.mjs +3 -2
  44. package/dist/aws/s3/server/payload.d.cts +0 -1
  45. package/dist/aws/s3/server/payload.d.mts +0 -1
  46. package/dist/aws/ses/server/AwsSes.cjs +4 -11
  47. package/dist/aws/ses/server/AwsSes.d.cts +3 -4
  48. package/dist/aws/ses/server/AwsSes.d.mts +3 -4
  49. package/dist/aws/ses/server/AwsSes.mjs +4 -11
  50. package/dist/aws/ses/server/SimpleEmail.cjs +10 -11
  51. package/dist/aws/ses/server/SimpleEmail.d.cts +3 -12
  52. package/dist/aws/ses/server/SimpleEmail.d.mts +3 -12
  53. package/dist/aws/ses/server/SimpleEmail.mjs +10 -11
  54. package/dist/aws/sqs/server/AwsSqs.d.cts +0 -1
  55. package/dist/aws/sqs/server/AwsSqs.d.mts +0 -1
  56. package/dist/aws/ssm/server/AwsSsm.cjs +5 -4
  57. package/dist/aws/ssm/server/AwsSsm.d.cts +0 -1
  58. package/dist/aws/ssm/server/AwsSsm.d.mts +0 -1
  59. package/dist/aws/ssm/server/AwsSsm.mjs +5 -4
  60. package/dist/brightData/serpApi/server/buildGoogleSerpUrl.cjs +0 -2
  61. package/dist/brightData/serpApi/server/buildGoogleSerpUrl.mjs +0 -2
  62. package/dist/brightData/serpApi/server/buildGoogleTrendsUrl.cjs +0 -1
  63. package/dist/brightData/serpApi/server/buildGoogleTrendsUrl.mjs +0 -1
  64. package/dist/brightData/serpApi/server/getAsyncRequestId.d.cts +1 -0
  65. package/dist/brightData/serpApi/server/getAsyncRequestId.d.mts +1 -0
  66. package/dist/brightData/serpApi/server/getAsyncResults.cjs +7 -4
  67. package/dist/brightData/serpApi/server/getAsyncResults.d.cts +1 -1
  68. package/dist/brightData/serpApi/server/getAsyncResults.d.mts +1 -1
  69. package/dist/brightData/serpApi/server/getAsyncResults.mjs +7 -4
  70. package/dist/brightData/serpApi/server/getRealtime.d.cts +0 -1
  71. package/dist/brightData/serpApi/server/getRealtime.d.mts +0 -1
  72. package/dist/brightData/webScraperIde/server/getBatch.d.cts +0 -1
  73. package/dist/brightData/webScraperIde/server/getBatch.d.mts +0 -1
  74. package/dist/brightData/webScraperIde/server/getRealtime.cjs +10 -6
  75. package/dist/brightData/webScraperIde/server/getRealtime.d.cts +0 -1
  76. package/dist/brightData/webScraperIde/server/getRealtime.d.mts +0 -1
  77. package/dist/brightData/webScraperIde/server/getRealtime.mjs +10 -6
  78. package/dist/date/calculation.cjs +27 -24
  79. package/dist/date/calculation.d.cts +0 -1
  80. package/dist/date/calculation.d.mts +0 -1
  81. package/dist/date/calculation.mjs +27 -24
  82. package/dist/date/date.d.cts +0 -1
  83. package/dist/date/date.d.mts +0 -1
  84. package/dist/date/financialYear.d.cts +0 -1
  85. package/dist/date/financialYear.d.mts +0 -1
  86. package/dist/date/format.d.cts +0 -1
  87. package/dist/date/format.d.mts +0 -1
  88. package/dist/drizzle/server/Drizzle.d.cts +0 -1
  89. package/dist/drizzle/server/Drizzle.d.mts +0 -1
  90. package/dist/emsApi/awsTs/get.cjs +2 -1
  91. package/dist/emsApi/awsTs/get.d.cts +1 -0
  92. package/dist/emsApi/awsTs/get.d.mts +1 -0
  93. package/dist/emsApi/awsTs/get.mjs +2 -1
  94. package/dist/emsApi/awsTs/post.cjs +2 -1
  95. package/dist/emsApi/awsTs/post.d.cts +1 -0
  96. package/dist/emsApi/awsTs/post.d.mts +1 -0
  97. package/dist/emsApi/awsTs/post.mjs +2 -1
  98. package/dist/emsApi/vercel/get.cjs +2 -1
  99. package/dist/emsApi/vercel/get.d.cts +1 -0
  100. package/dist/emsApi/vercel/get.d.mts +1 -0
  101. package/dist/emsApi/vercel/get.mjs +2 -1
  102. package/dist/emsApi/vercel/post.cjs +2 -1
  103. package/dist/emsApi/vercel/post.d.cts +1 -0
  104. package/dist/emsApi/vercel/post.d.mts +1 -0
  105. package/dist/emsApi/vercel/post.mjs +2 -1
  106. package/dist/eskimi/eskimi.d.cts +0 -1
  107. package/dist/eskimi/eskimi.d.mts +0 -1
  108. package/dist/googleAds/keywordPlanner/server/googleAdsKeywordPlanner.d.cts +0 -1
  109. package/dist/googleAds/keywordPlanner/server/googleAdsKeywordPlanner.d.mts +0 -1
  110. package/dist/googleAds/server/GoogleAds.d.cts +0 -1
  111. package/dist/googleAds/server/GoogleAds.d.mts +0 -1
  112. package/dist/googleCloud/bigquery/server/GoogleCloudBigquery.d.cts +0 -1
  113. package/dist/googleCloud/bigquery/server/GoogleCloudBigquery.d.mts +0 -1
  114. package/dist/googleCloud/bigquery/server/loadData.d.cts +1 -7
  115. package/dist/googleCloud/bigquery/server/loadData.d.mts +1 -7
  116. package/dist/googleCloud/sheets/server/GoogleCloudSheets.d.cts +1 -2
  117. package/dist/googleCloud/sheets/server/GoogleCloudSheets.d.mts +1 -2
  118. package/dist/googleCloud/storage/server/GoogleCloudStorage.d.cts +0 -1
  119. package/dist/googleCloud/storage/server/GoogleCloudStorage.d.mts +0 -1
  120. package/dist/googlePageSpeed/server/GooglePageSpeed.cjs +2 -1
  121. package/dist/googlePageSpeed/server/GooglePageSpeed.d.cts +0 -1
  122. package/dist/googlePageSpeed/server/GooglePageSpeed.d.mts +0 -1
  123. package/dist/googlePageSpeed/server/GooglePageSpeed.mjs +2 -1
  124. package/dist/googleSearchIncidents/server/googleSearchIncidents.d.cts +0 -1
  125. package/dist/googleSearchIncidents/server/googleSearchIncidents.d.mts +0 -1
  126. package/dist/greenDomain/server/greenDomain.cjs +2 -1
  127. package/dist/greenDomain/server/greenDomain.d.cts +0 -1
  128. package/dist/greenDomain/server/greenDomain.d.mts +0 -1
  129. package/dist/greenDomain/server/greenDomain.mjs +2 -1
  130. package/dist/littleWarden/server/LittleWarden.cjs +2 -1
  131. package/dist/littleWarden/server/LittleWarden.d.cts +0 -1
  132. package/dist/littleWarden/server/LittleWarden.d.mts +0 -1
  133. package/dist/littleWarden/server/LittleWarden.mjs +2 -1
  134. package/dist/littleWarden/server/littleWardenAttrs.d.cts +3 -10
  135. package/dist/littleWarden/server/littleWardenAttrs.d.mts +3 -10
  136. package/dist/lumar/api/server/buildRequest.cjs +0 -1
  137. package/dist/lumar/api/server/buildRequest.d.cts +1 -0
  138. package/dist/lumar/api/server/buildRequest.d.mts +1 -0
  139. package/dist/lumar/api/server/buildRequest.mjs +0 -1
  140. package/dist/lumar/api/server/getData.d.cts +1 -0
  141. package/dist/lumar/api/server/getData.d.mts +1 -0
  142. package/dist/lumar/graphql/server/getData.d.cts +1 -0
  143. package/dist/lumar/graphql/server/getData.d.mts +1 -0
  144. package/dist/lumar/graphql/server/queries/getCrawls.d.cts +1 -4
  145. package/dist/lumar/graphql/server/queries/getCrawls.d.mts +1 -4
  146. package/dist/lumar/graphql/server/queries/getReportDifferences.d.cts +1 -5
  147. package/dist/lumar/graphql/server/queries/getReportDifferences.d.mts +1 -5
  148. package/dist/lumar/graphql/server/queries/getRows.d.cts +1 -11
  149. package/dist/lumar/graphql/server/queries/getRows.d.mts +1 -11
  150. package/dist/lumar/graphql/server/queries/getTotals.d.cts +1 -7
  151. package/dist/lumar/graphql/server/queries/getTotals.d.mts +1 -7
  152. package/dist/myTarget/server/myTarget.d.cts +0 -1
  153. package/dist/myTarget/server/myTarget.d.mts +0 -1
  154. package/dist/nextAuth/nextAuth.d.cts +0 -1
  155. package/dist/nextAuth/nextAuth.d.mts +0 -1
  156. package/dist/nextJs/client/LazyLoad.d.cts +0 -1
  157. package/dist/nextJs/client/LazyLoad.d.mts +0 -1
  158. package/dist/onePassword/server/OnePassword.d.cts +0 -1
  159. package/dist/onePassword/server/OnePassword.d.mts +0 -1
  160. package/dist/openAi/server/OpenAi.d.cts +0 -1
  161. package/dist/openAi/server/OpenAi.d.mts +0 -1
  162. package/dist/prisma/server/Prisma.d.cts +0 -1
  163. package/dist/prisma/server/Prisma.d.mts +0 -1
  164. package/dist/snapchat/server/Snapchat.cjs +3 -2
  165. package/dist/snapchat/server/Snapchat.d.cts +0 -1
  166. package/dist/snapchat/server/Snapchat.d.mts +0 -1
  167. package/dist/snapchat/server/Snapchat.mjs +3 -2
  168. package/dist/stream/server/sort.d.cts +0 -1
  169. package/dist/stream/server/sort.d.mts +0 -1
  170. package/dist/swr/client/swr.d.cts +1 -0
  171. package/dist/swr/client/swr.d.mts +1 -0
  172. package/dist/upTimeRobot/server/UpTimeRobot.d.cts +0 -1
  173. package/dist/upTimeRobot/server/UpTimeRobot.d.mts +0 -1
  174. package/dist/util/defaultTo.cjs +6 -3
  175. package/dist/util/defaultTo.mjs +6 -3
  176. package/dist/util/server/getBrotliCompressed.d.cts +0 -1
  177. package/dist/util/server/getBrotliCompressed.d.mts +0 -1
  178. package/dist/util/server/getBrotliDecompressed.d.cts +0 -1
  179. package/dist/util/server/getBrotliDecompressed.d.mts +0 -1
  180. package/dist/util/server/getGzipCompressed.d.cts +0 -1
  181. package/dist/util/server/getGzipCompressed.d.mts +0 -1
  182. package/dist/util/server/getGzipDecompressed.d.cts +0 -1
  183. package/dist/util/server/getGzipDecompressed.d.mts +0 -1
  184. package/dist/xlsx/cell.cjs +102 -0
  185. package/dist/xlsx/cell.d.cts +38 -0
  186. package/dist/xlsx/cell.d.mts +38 -0
  187. package/dist/xlsx/cell.mjs +97 -0
  188. package/dist/xlsx/column.cjs +37 -0
  189. package/dist/xlsx/column.d.cts +23 -0
  190. package/dist/xlsx/column.d.mts +23 -0
  191. package/dist/xlsx/column.mjs +35 -0
  192. package/dist/xlsx/createXlsx.cjs +138 -0
  193. package/dist/xlsx/createXlsx.d.cts +18 -0
  194. package/dist/xlsx/createXlsx.d.mts +18 -0
  195. package/dist/xlsx/createXlsx.mjs +136 -0
  196. package/dist/xlsx/index.cjs +18 -0
  197. package/dist/xlsx/index.d.cts +6 -0
  198. package/dist/xlsx/index.d.mts +6 -0
  199. package/dist/xlsx/index.mjs +6 -0
  200. package/dist/xlsx/modifyXlsx.cjs +125 -0
  201. package/dist/xlsx/modifyXlsx.d.cts +24 -0
  202. package/dist/xlsx/modifyXlsx.d.mts +24 -0
  203. package/dist/xlsx/modifyXlsx.mjs +124 -0
  204. package/dist/xlsx/sheet.cjs +36 -0
  205. package/dist/xlsx/sheet.d.cts +29 -0
  206. package/dist/xlsx/sheet.d.mts +29 -0
  207. package/dist/xlsx/sheet.mjs +34 -0
  208. package/package.json +103 -57
@@ -6,13 +6,7 @@ type GetTotals = {
6
6
  reportTemplateCode: string;
7
7
  reportTypeCode: string;
8
8
  };
9
- declare const getTotals: ({
10
- crawlId,
11
- filter,
12
- filterKey,
13
- reportTemplateCode,
14
- reportTypeCode
15
- }: GetTotals) => {
9
+ declare const getTotals: ({ crawlId, filter, filterKey, reportTemplateCode, reportTypeCode }: GetTotals) => {
16
10
  id: string;
17
11
  crawlId: number;
18
12
  filter: object;
@@ -6,13 +6,7 @@ type GetTotals = {
6
6
  reportTemplateCode: string;
7
7
  reportTypeCode: string;
8
8
  };
9
- declare const getTotals: ({
10
- crawlId,
11
- filter,
12
- filterKey,
13
- reportTemplateCode,
14
- reportTypeCode
15
- }: GetTotals) => {
9
+ declare const getTotals: ({ crawlId, filter, filterKey, reportTemplateCode, reportTypeCode }: GetTotals) => {
16
10
  id: string;
17
11
  crawlId: number;
18
12
  filter: object;
@@ -1,5 +1,4 @@
1
1
  import { ApiResponse } from "../../api/api.cjs";
2
-
3
2
  //#region src/myTarget/server/myTarget.d.ts
4
3
  /**
5
4
  * Make the request to MyTarget API using the access token.
@@ -1,5 +1,4 @@
1
1
  import { ApiResponse } from "../../api/api.mjs";
2
-
3
2
  //#region src/myTarget/server/myTarget.d.ts
4
3
  /**
5
4
  * Make the request to MyTarget API using the access token.
@@ -1,5 +1,4 @@
1
1
  import { isSessionReady } from "./isSessionReady.cjs";
2
-
3
2
  //#region src/nextAuth/nextAuth.d.ts
4
3
  declare const NextAuthState: {
5
4
  readonly AUTHENTICATED: "authenticated";
@@ -1,5 +1,4 @@
1
1
  import { isSessionReady } from "./isSessionReady.mjs";
2
-
3
2
  //#region src/nextAuth/nextAuth.d.ts
4
3
  declare const NextAuthState: {
5
4
  readonly AUTHENTICATED: "authenticated";
@@ -1,6 +1,5 @@
1
1
  import { IntersectionOptions } from "react-intersection-observer";
2
2
  import React, { ReactNode } from "react";
3
-
4
3
  //#region src/nextJs/client/LazyLoad.d.ts
5
4
  type LazyLoadProps = IntersectionOptions & {
6
5
  children: ReactNode;
@@ -1,6 +1,5 @@
1
1
  import { IntersectionOptions } from "react-intersection-observer";
2
2
  import React, { ReactNode } from "react";
3
-
4
3
  //#region src/nextJs/client/LazyLoad.d.ts
5
4
  type LazyLoadProps = IntersectionOptions & {
6
5
  children: ReactNode;
@@ -1,6 +1,5 @@
1
1
  import { BaseNamespace } from "../../_class/BaseNamespace.cjs";
2
2
  import { Client } from "@1password/sdk";
3
-
4
3
  //#region src/onePassword/server/OnePassword.d.ts
5
4
  type OnePasswordConfig = {
6
5
  serviceAccountToken: string;
@@ -1,6 +1,5 @@
1
1
  import { BaseNamespace } from "../../_class/BaseNamespace.mjs";
2
2
  import { Client } from "@1password/sdk";
3
-
4
3
  //#region src/onePassword/server/OnePassword.d.ts
5
4
  type OnePasswordConfig = {
6
5
  serviceAccountToken: string;
@@ -1,5 +1,4 @@
1
1
  import { BaseNamespace } from "../../_class/BaseNamespace.cjs";
2
-
3
2
  //#region src/openAi/server/OpenAi.d.ts
4
3
  type OpenAiConfig = {
5
4
  apiKey: string;
@@ -1,5 +1,4 @@
1
1
  import { BaseNamespace } from "../../_class/BaseNamespace.mjs";
2
-
3
2
  //#region src/openAi/server/OpenAi.d.ts
4
3
  type OpenAiConfig = {
5
4
  apiKey: string;
@@ -1,5 +1,4 @@
1
1
  import { BaseNamespace } from "../../_class/BaseNamespace.cjs";
2
-
3
2
  //#region src/prisma/server/Prisma.d.ts
4
3
  /**
5
4
  * Minimal interface representing a Prisma Client instance.
@@ -1,5 +1,4 @@
1
1
  import { BaseNamespace } from "../../_class/BaseNamespace.mjs";
2
-
3
2
  //#region src/prisma/server/Prisma.d.ts
4
3
  /**
5
4
  * Minimal interface representing a Prisma Client instance.
@@ -10,9 +10,10 @@ var Snapchat = class extends require__class_BaseNamespace.BaseNamespace {
10
10
  init = async (config) => {
11
11
  if (!this.client) {
12
12
  this.config = config;
13
- const apiResponse = await require_api_post.post(`https://accounts.snapchat.com/login/oauth2/access_token?client_id=${this.config.clientId}&client_secret=${this.config.clientSecret}&grant_type=refresh_token&refresh_token=${this.config.refreshToken}`);
13
+ const url = `https://accounts.snapchat.com/login/oauth2/access_token?client_id=${this.config.clientId}&client_secret=${this.config.clientSecret}&grant_type=refresh_token&refresh_token=${this.config.refreshToken}`;
14
+ const apiResponse = await require_api_post.post(url);
14
15
  if (apiResponse.isSuccess()) this.client = {
15
- expires: luxon.DateTime.now().toUnixInteger() + 10800 * 1e3,
16
+ expires: luxon.DateTime.now().toUnixInteger() + 108e5,
16
17
  refreshToken: apiResponse.getBodyDefaultTo(["data", "access_token"], null)
17
18
  };
18
19
  }
@@ -1,5 +1,4 @@
1
1
  import { BaseNamespace } from "../../_class/BaseNamespace.cjs";
2
-
3
2
  //#region src/snapchat/server/Snapchat.d.ts
4
3
  type SnapchatConfig = {
5
4
  clientId: string;
@@ -1,5 +1,4 @@
1
1
  import { BaseNamespace } from "../../_class/BaseNamespace.mjs";
2
-
3
2
  //#region src/snapchat/server/Snapchat.d.ts
4
3
  type SnapchatConfig = {
5
4
  clientId: string;
@@ -9,9 +9,10 @@ var Snapchat = class extends BaseNamespace {
9
9
  init = async (config) => {
10
10
  if (!this.client) {
11
11
  this.config = config;
12
- const apiResponse = await post(`https://accounts.snapchat.com/login/oauth2/access_token?client_id=${this.config.clientId}&client_secret=${this.config.clientSecret}&grant_type=refresh_token&refresh_token=${this.config.refreshToken}`);
12
+ const url = `https://accounts.snapchat.com/login/oauth2/access_token?client_id=${this.config.clientId}&client_secret=${this.config.clientSecret}&grant_type=refresh_token&refresh_token=${this.config.refreshToken}`;
13
+ const apiResponse = await post(url);
13
14
  if (apiResponse.isSuccess()) this.client = {
14
- expires: DateTime.now().toUnixInteger() + 10800 * 1e3,
15
+ expires: DateTime.now().toUnixInteger() + 108e5,
15
16
  refreshToken: apiResponse.getBodyDefaultTo(["data", "access_token"], null)
16
17
  };
17
18
  }
@@ -1,5 +1,4 @@
1
1
  import { Transform, TransformCallback, TransformOptions } from "node:stream";
2
-
3
2
  //#region src/stream/server/sort.d.ts
4
3
  declare class SortStreamer<T> extends Transform {
5
4
  private a;
@@ -1,5 +1,4 @@
1
1
  import { Transform, TransformCallback, TransformOptions } from "node:stream";
2
-
3
2
  //#region src/stream/server/sort.d.ts
4
3
  declare class SortStreamer<T> extends Transform {
5
4
  private a;
@@ -1,4 +1,5 @@
1
1
  import { ApiState } from "../../api/api.cjs";
2
+ import "../../api/index.cjs";
2
3
  //#region src/swr/client/swr.d.ts
3
4
  type Swr = {
4
5
  data: any;
@@ -1,4 +1,5 @@
1
1
  import { ApiState } from "../../api/api.mjs";
2
+ import "../../api/index.mjs";
2
3
  //#region src/swr/client/swr.d.ts
3
4
  type Swr = {
4
5
  data: any;
@@ -1,5 +1,4 @@
1
1
  import { BaseNamespace } from "../../_class/BaseNamespace.cjs";
2
-
3
2
  //#region src/upTimeRobot/server/UpTimeRobot.d.ts
4
3
  type UpTimeRobotConfig = {
5
4
  apiKey: string;
@@ -1,5 +1,4 @@
1
1
  import { BaseNamespace } from "../../_class/BaseNamespace.mjs";
2
-
3
2
  //#region src/upTimeRobot/server/UpTimeRobot.d.ts
4
3
  type UpTimeRobotConfig = {
5
4
  apiKey: string;
@@ -11,9 +11,12 @@ const defaultTo = (instance, keys, defaultValue = null) => {
11
11
  let pointer = instance;
12
12
  if ("undefined" === typeof instance || null === pointer) found = false;
13
13
  else keysArray.forEach((key) => {
14
- if (found) if (require_lodash_isObject.isObject(pointer)) if ("undefined" === typeof pointer[key] || null === pointer[key]) found = false;
15
- else pointer = pointer[key];
16
- else found = false;
14
+ if (found) {
15
+ if (require_lodash_isObject.isObject(pointer)) {
16
+ if ("undefined" === typeof pointer[key] || null === pointer[key]) found = false;
17
+ else pointer = pointer[key];
18
+ } else found = false;
19
+ }
17
20
  });
18
21
  return found ? pointer : defaultValue;
19
22
  };
@@ -10,9 +10,12 @@ const defaultTo = (instance, keys, defaultValue = null) => {
10
10
  let pointer = instance;
11
11
  if ("undefined" === typeof instance || null === pointer) found = false;
12
12
  else keysArray.forEach((key) => {
13
- if (found) if (isObject(pointer)) if ("undefined" === typeof pointer[key] || null === pointer[key]) found = false;
14
- else pointer = pointer[key];
15
- else found = false;
13
+ if (found) {
14
+ if (isObject(pointer)) {
15
+ if ("undefined" === typeof pointer[key] || null === pointer[key]) found = false;
16
+ else pointer = pointer[key];
17
+ } else found = false;
18
+ }
16
19
  });
17
20
  return found ? pointer : defaultValue;
18
21
  };
@@ -1,5 +1,4 @@
1
1
  import { BrotliOptions } from "zlib";
2
-
3
2
  //#region src/util/server/getBrotliCompressed.d.ts
4
3
  /**
5
4
  * Compress a given input using Brotli.
@@ -1,5 +1,4 @@
1
1
  import { BrotliOptions } from "zlib";
2
-
3
2
  //#region src/util/server/getBrotliCompressed.d.ts
4
3
  /**
5
4
  * Compress a given input using Brotli.
@@ -1,5 +1,4 @@
1
1
  import { BrotliOptions } from "zlib";
2
-
3
2
  //#region src/util/server/getBrotliDecompressed.d.ts
4
3
  /**
5
4
  * Decompress a given Brotli input into a string.
@@ -1,5 +1,4 @@
1
1
  import { BrotliOptions } from "zlib";
2
-
3
2
  //#region src/util/server/getBrotliDecompressed.d.ts
4
3
  /**
5
4
  * Decompress a given Brotli input into a string.
@@ -1,5 +1,4 @@
1
1
  import { ZlibOptions } from "zlib";
2
-
3
2
  //#region src/util/server/getGzipCompressed.d.ts
4
3
  /**
5
4
  * Compress a given input using Gzip.
@@ -1,5 +1,4 @@
1
1
  import { ZlibOptions } from "zlib";
2
-
3
2
  //#region src/util/server/getGzipCompressed.d.ts
4
3
  /**
5
4
  * Compress a given input using Gzip.
@@ -1,5 +1,4 @@
1
1
  import { ZlibOptions } from "zlib";
2
-
3
2
  //#region src/util/server/getGzipDecompressed.d.ts
4
3
  /**
5
4
  * Decompress a given Gzip input into a string.
@@ -1,5 +1,4 @@
1
1
  import { ZlibOptions } from "zlib";
2
-
3
2
  //#region src/util/server/getGzipDecompressed.d.ts
4
3
  /**
5
4
  * Decompress a given Gzip input into a string.
@@ -0,0 +1,102 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_xlsx_column = require("./column.cjs");
3
+ //#region src/xlsx/cell.ts
4
+ /**
5
+ * Parse the 1-based column number out of an Excel cell reference.
6
+ *
7
+ * Examples: "A1" → 1, "B3" → 2, "AA1" → 27.
8
+ */
9
+ const getCellColNum = (ref) => {
10
+ const letters = ref.match(/^([A-Z]+)/)?.[1] ?? "A";
11
+ let colNum = 0;
12
+ for (const char of letters) colNum = colNum * 26 + (char.charCodeAt(0) - 64);
13
+ return colNum;
14
+ };
15
+ /**
16
+ * Excel only understands finite numbers inside a <v> element — NaN or Infinity
17
+ * produce a file it offers to "repair". Those fall back to text instead.
18
+ */
19
+ const getCellValue = (value) => {
20
+ if (null === value || void 0 === value) return "";
21
+ if ("number" === typeof value) return Number.isFinite(value) ? value : String(value);
22
+ return value;
23
+ };
24
+ /**
25
+ * Escape the reserved XML characters so a plain string is safe to embed in an
26
+ * attribute value or a text node.
27
+ */
28
+ const getEscapedXml = (text) => {
29
+ return text.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;");
30
+ };
31
+ /**
32
+ * Build the raw <c> (cell) XML for a single spreadsheet cell.
33
+ *
34
+ * Numbers use the <v> value element; strings are written as an inline string so
35
+ * there is no shared-strings table to maintain.
36
+ *
37
+ * styleAttr must be either empty or a pre-formatted attribute such as ` s="3"`.
38
+ */
39
+ const buildCellXml = (ref, value, styleAttr) => {
40
+ if ("number" === typeof value) return `<c r="${ref}"${styleAttr}><v>${value}</v></c>`;
41
+ return `<c r="${ref}"${styleAttr} t="inlineStr"><is><t>${getEscapedXml(String(value))}</t></is></c>`;
42
+ };
43
+ /**
44
+ * Insert a <c> snippet into raw row XML, keeping the cells in ascending column
45
+ * order. If a cell with a higher column number already exists the new cell goes
46
+ * before it, otherwise it is appended.
47
+ */
48
+ const insertCellInRow = (rowContent, ref, cellXml) => {
49
+ const newCol = getCellColNum(ref);
50
+ const cellPat = /<c r="([A-Z]+\d+)"(?:[^>]*\/>|[^>]*>[\s\S]*?<\/c>)/g;
51
+ const cells = [];
52
+ let match;
53
+ while (null !== (match = cellPat.exec(rowContent))) cells.push({
54
+ full: match[0],
55
+ col: getCellColNum(match[1])
56
+ });
57
+ const cellAfter = cells.find((cell) => {
58
+ return cell.col > newCol;
59
+ });
60
+ if (cellAfter) return rowContent.replace(cellAfter.full, () => {
61
+ return `${cellXml}${cellAfter.full}`;
62
+ });
63
+ return rowContent + cellXml;
64
+ };
65
+ /**
66
+ * Set a cell value in raw worksheet XML.
67
+ *
68
+ * - If the cell exists, its content is replaced and its style attribute (s="N")
69
+ * is preserved, so a template's formatting survives.
70
+ * - If the row exists but the cell does not, the cell is inserted in column order.
71
+ * - If neither exists, a new row is appended before </sheetData>.
72
+ */
73
+ const setCell = (xml, row, col, value) => {
74
+ const ref = `${require_xlsx_column.getColumLetter(col)}${row}`;
75
+ const cellPat = new RegExp(`<c r="${ref}"([^>]*?)(?:\\s*/>|>[\\s\\S]*?<\\/c>)`);
76
+ const cellMatch = cellPat.exec(xml);
77
+ if (cellMatch) {
78
+ const style = /\bs="(\d+)"/.exec(cellMatch[1]);
79
+ const cellXml = buildCellXml(ref, value, style ? ` s="${style[1]}"` : "");
80
+ return xml.replace(cellPat, () => {
81
+ return cellXml;
82
+ });
83
+ }
84
+ const rowPat = new RegExp(`(<row[^>]+r="${row}"[^>]*>)([\\s\\S]*?)(<\/row>)`);
85
+ const rowMatch = rowPat.exec(xml);
86
+ if (rowMatch) {
87
+ const content = insertCellInRow(rowMatch[2], ref, buildCellXml(ref, value, ""));
88
+ return xml.replace(rowPat, () => {
89
+ return `${rowMatch[1]}${content}${rowMatch[3]}`;
90
+ });
91
+ }
92
+ const newRow = `<row r="${row}">${buildCellXml(ref, value, "")}</row>`;
93
+ return xml.replace("</sheetData>", () => {
94
+ return `${newRow}</sheetData>`;
95
+ });
96
+ };
97
+ //#endregion
98
+ exports.buildCellXml = buildCellXml;
99
+ exports.getCellColNum = getCellColNum;
100
+ exports.getCellValue = getCellValue;
101
+ exports.getEscapedXml = getEscapedXml;
102
+ exports.setCell = setCell;
@@ -0,0 +1,38 @@
1
+ //#region src/xlsx/cell.d.ts
2
+ type XlsxCellValue = string | number | null | undefined;
3
+ /**
4
+ * Parse the 1-based column number out of an Excel cell reference.
5
+ *
6
+ * Examples: "A1" → 1, "B3" → 2, "AA1" → 27.
7
+ */
8
+ declare const getCellColNum: (ref: string) => number;
9
+ /**
10
+ * Excel only understands finite numbers inside a <v> element — NaN or Infinity
11
+ * produce a file it offers to "repair". Those fall back to text instead.
12
+ */
13
+ declare const getCellValue: (value: XlsxCellValue) => string | number;
14
+ /**
15
+ * Escape the reserved XML characters so a plain string is safe to embed in an
16
+ * attribute value or a text node.
17
+ */
18
+ declare const getEscapedXml: (text: string) => string;
19
+ /**
20
+ * Build the raw <c> (cell) XML for a single spreadsheet cell.
21
+ *
22
+ * Numbers use the <v> value element; strings are written as an inline string so
23
+ * there is no shared-strings table to maintain.
24
+ *
25
+ * styleAttr must be either empty or a pre-formatted attribute such as ` s="3"`.
26
+ */
27
+ declare const buildCellXml: (ref: string, value: string | number, styleAttr: string) => string;
28
+ /**
29
+ * Set a cell value in raw worksheet XML.
30
+ *
31
+ * - If the cell exists, its content is replaced and its style attribute (s="N")
32
+ * is preserved, so a template's formatting survives.
33
+ * - If the row exists but the cell does not, the cell is inserted in column order.
34
+ * - If neither exists, a new row is appended before </sheetData>.
35
+ */
36
+ declare const setCell: (xml: string, row: number, col: number, value: string | number) => string;
37
+ //#endregion
38
+ export { XlsxCellValue, buildCellXml, getCellColNum, getCellValue, getEscapedXml, setCell };
@@ -0,0 +1,38 @@
1
+ //#region src/xlsx/cell.d.ts
2
+ type XlsxCellValue = string | number | null | undefined;
3
+ /**
4
+ * Parse the 1-based column number out of an Excel cell reference.
5
+ *
6
+ * Examples: "A1" → 1, "B3" → 2, "AA1" → 27.
7
+ */
8
+ declare const getCellColNum: (ref: string) => number;
9
+ /**
10
+ * Excel only understands finite numbers inside a <v> element — NaN or Infinity
11
+ * produce a file it offers to "repair". Those fall back to text instead.
12
+ */
13
+ declare const getCellValue: (value: XlsxCellValue) => string | number;
14
+ /**
15
+ * Escape the reserved XML characters so a plain string is safe to embed in an
16
+ * attribute value or a text node.
17
+ */
18
+ declare const getEscapedXml: (text: string) => string;
19
+ /**
20
+ * Build the raw <c> (cell) XML for a single spreadsheet cell.
21
+ *
22
+ * Numbers use the <v> value element; strings are written as an inline string so
23
+ * there is no shared-strings table to maintain.
24
+ *
25
+ * styleAttr must be either empty or a pre-formatted attribute such as ` s="3"`.
26
+ */
27
+ declare const buildCellXml: (ref: string, value: string | number, styleAttr: string) => string;
28
+ /**
29
+ * Set a cell value in raw worksheet XML.
30
+ *
31
+ * - If the cell exists, its content is replaced and its style attribute (s="N")
32
+ * is preserved, so a template's formatting survives.
33
+ * - If the row exists but the cell does not, the cell is inserted in column order.
34
+ * - If neither exists, a new row is appended before </sheetData>.
35
+ */
36
+ declare const setCell: (xml: string, row: number, col: number, value: string | number) => string;
37
+ //#endregion
38
+ export { XlsxCellValue, buildCellXml, getCellColNum, getCellValue, getEscapedXml, setCell };
@@ -0,0 +1,97 @@
1
+ import { getColumLetter } from "./column.mjs";
2
+ //#region src/xlsx/cell.ts
3
+ /**
4
+ * Parse the 1-based column number out of an Excel cell reference.
5
+ *
6
+ * Examples: "A1" → 1, "B3" → 2, "AA1" → 27.
7
+ */
8
+ const getCellColNum = (ref) => {
9
+ const letters = ref.match(/^([A-Z]+)/)?.[1] ?? "A";
10
+ let colNum = 0;
11
+ for (const char of letters) colNum = colNum * 26 + (char.charCodeAt(0) - 64);
12
+ return colNum;
13
+ };
14
+ /**
15
+ * Excel only understands finite numbers inside a <v> element — NaN or Infinity
16
+ * produce a file it offers to "repair". Those fall back to text instead.
17
+ */
18
+ const getCellValue = (value) => {
19
+ if (null === value || void 0 === value) return "";
20
+ if ("number" === typeof value) return Number.isFinite(value) ? value : String(value);
21
+ return value;
22
+ };
23
+ /**
24
+ * Escape the reserved XML characters so a plain string is safe to embed in an
25
+ * attribute value or a text node.
26
+ */
27
+ const getEscapedXml = (text) => {
28
+ return text.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;");
29
+ };
30
+ /**
31
+ * Build the raw <c> (cell) XML for a single spreadsheet cell.
32
+ *
33
+ * Numbers use the <v> value element; strings are written as an inline string so
34
+ * there is no shared-strings table to maintain.
35
+ *
36
+ * styleAttr must be either empty or a pre-formatted attribute such as ` s="3"`.
37
+ */
38
+ const buildCellXml = (ref, value, styleAttr) => {
39
+ if ("number" === typeof value) return `<c r="${ref}"${styleAttr}><v>${value}</v></c>`;
40
+ return `<c r="${ref}"${styleAttr} t="inlineStr"><is><t>${getEscapedXml(String(value))}</t></is></c>`;
41
+ };
42
+ /**
43
+ * Insert a <c> snippet into raw row XML, keeping the cells in ascending column
44
+ * order. If a cell with a higher column number already exists the new cell goes
45
+ * before it, otherwise it is appended.
46
+ */
47
+ const insertCellInRow = (rowContent, ref, cellXml) => {
48
+ const newCol = getCellColNum(ref);
49
+ const cellPat = /<c r="([A-Z]+\d+)"(?:[^>]*\/>|[^>]*>[\s\S]*?<\/c>)/g;
50
+ const cells = [];
51
+ let match;
52
+ while (null !== (match = cellPat.exec(rowContent))) cells.push({
53
+ full: match[0],
54
+ col: getCellColNum(match[1])
55
+ });
56
+ const cellAfter = cells.find((cell) => {
57
+ return cell.col > newCol;
58
+ });
59
+ if (cellAfter) return rowContent.replace(cellAfter.full, () => {
60
+ return `${cellXml}${cellAfter.full}`;
61
+ });
62
+ return rowContent + cellXml;
63
+ };
64
+ /**
65
+ * Set a cell value in raw worksheet XML.
66
+ *
67
+ * - If the cell exists, its content is replaced and its style attribute (s="N")
68
+ * is preserved, so a template's formatting survives.
69
+ * - If the row exists but the cell does not, the cell is inserted in column order.
70
+ * - If neither exists, a new row is appended before </sheetData>.
71
+ */
72
+ const setCell = (xml, row, col, value) => {
73
+ const ref = `${getColumLetter(col)}${row}`;
74
+ const cellPat = new RegExp(`<c r="${ref}"([^>]*?)(?:\\s*/>|>[\\s\\S]*?<\\/c>)`);
75
+ const cellMatch = cellPat.exec(xml);
76
+ if (cellMatch) {
77
+ const style = /\bs="(\d+)"/.exec(cellMatch[1]);
78
+ const cellXml = buildCellXml(ref, value, style ? ` s="${style[1]}"` : "");
79
+ return xml.replace(cellPat, () => {
80
+ return cellXml;
81
+ });
82
+ }
83
+ const rowPat = new RegExp(`(<row[^>]+r="${row}"[^>]*>)([\\s\\S]*?)(<\/row>)`);
84
+ const rowMatch = rowPat.exec(xml);
85
+ if (rowMatch) {
86
+ const content = insertCellInRow(rowMatch[2], ref, buildCellXml(ref, value, ""));
87
+ return xml.replace(rowPat, () => {
88
+ return `${rowMatch[1]}${content}${rowMatch[3]}`;
89
+ });
90
+ }
91
+ const newRow = `<row r="${row}">${buildCellXml(ref, value, "")}</row>`;
92
+ return xml.replace("</sheetData>", () => {
93
+ return `${newRow}</sheetData>`;
94
+ });
95
+ };
96
+ //#endregion
97
+ export { buildCellXml, getCellColNum, getCellValue, getEscapedXml, setCell };
@@ -0,0 +1,37 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_xlsx_cell = require("./cell.cjs");
3
+ //#region src/xlsx/column.ts
4
+ /** Bounds for widths derived from content, so nothing is cramped or absurd. */
5
+ const COLUMN_WIDTH_MIN = 10;
6
+ const COLUMN_WIDTH_MAX = 60;
7
+ /**
8
+ * Convert a 1-based column number to an Excel column letter string.
9
+ *
10
+ * Examples: 1 → "A", 2 → "B", 26 → "Z", 27 → "AA", 28 → "AB".
11
+ */
12
+ const getColumLetter = (colNum) => {
13
+ let result = "";
14
+ let remaining = colNum;
15
+ while (remaining > 0) {
16
+ remaining--;
17
+ result = String.fromCharCode(65 + remaining % 26) + result;
18
+ remaining = Math.floor(remaining / 26);
19
+ }
20
+ return result;
21
+ };
22
+ /**
23
+ * Width in Excel character units, taken from the widest value in the column
24
+ * (header included) and clamped. Heading lines are excluded on purpose: they sit
25
+ * in column A and overflow into the empty cells beside them, so letting them
26
+ * drive the width would stretch the first column for no benefit.
27
+ */
28
+ const getColumnWidth = (column, data) => {
29
+ if (column?.width) return column.width;
30
+ const longest = data.reduce((widest, row) => {
31
+ return Math.max(widest, String(require_xlsx_cell.getCellValue(row?.[column.id])).length);
32
+ }, column.displayName.length);
33
+ return Math.min(COLUMN_WIDTH_MAX, Math.max(COLUMN_WIDTH_MIN, longest + 2));
34
+ };
35
+ //#endregion
36
+ exports.getColumLetter = getColumLetter;
37
+ exports.getColumnWidth = getColumnWidth;
@@ -0,0 +1,23 @@
1
+ import { XlsxCellValue } from "./cell.cjs";
2
+ //#region src/xlsx/column.d.ts
3
+ type XlsxColumn = {
4
+ id: string;
5
+ displayName: string;
6
+ /** Column width in Excel character units. Derived from the content when omitted. */
7
+ width?: number;
8
+ };
9
+ /**
10
+ * Convert a 1-based column number to an Excel column letter string.
11
+ *
12
+ * Examples: 1 → "A", 2 → "B", 26 → "Z", 27 → "AA", 28 → "AB".
13
+ */
14
+ declare const getColumLetter: (colNum: number) => string;
15
+ /**
16
+ * Width in Excel character units, taken from the widest value in the column
17
+ * (header included) and clamped. Heading lines are excluded on purpose: they sit
18
+ * in column A and overflow into the empty cells beside them, so letting them
19
+ * drive the width would stretch the first column for no benefit.
20
+ */
21
+ declare const getColumnWidth: (column: XlsxColumn, data: Record<string, XlsxCellValue>[]) => number;
22
+ //#endregion
23
+ export { XlsxColumn, getColumLetter, getColumnWidth };