@8ms/helpers 2.2.9 → 2.2.12

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 (178) hide show
  1. package/.github/workflows/deploy_npmjs.yml +3 -0
  2. package/_class/BaseClass.js +43 -52
  3. package/_class/BaseNamespace.js +17 -20
  4. package/_class/index.js +2 -7
  5. package/adverity/getJobs.js +7 -11
  6. package/adverity/index.js +51 -54
  7. package/adverity/server.js +1 -5
  8. package/api/ApiResponseClass.js +84 -88
  9. package/api/functions.js +13 -22
  10. package/api/index.js +3 -19
  11. package/api/types.js +5 -9
  12. package/array/index.js +3 -11
  13. package/atInternet/index.js +10 -13
  14. package/aws/ec2/AwsEc2Namespace.js +34 -74
  15. package/aws/ec2/server.js +5 -9
  16. package/aws/ecs/AwsEcsNamespace.js +110 -150
  17. package/aws/ecs/server.js +5 -9
  18. package/aws/glue/AwsGlueNamespace.js +26 -66
  19. package/aws/glue/server.js +5 -9
  20. package/aws/isResponse200.js +3 -7
  21. package/aws/lambda/AwsLambdaNamespace.js +62 -102
  22. package/aws/lambda/server.js +6 -11
  23. package/aws/s3/AwsS3Namespace.js +347 -390
  24. package/aws/s3/payload.js +29 -32
  25. package/aws/s3/server.js +9 -14
  26. package/aws/server.js +5 -10
  27. package/aws/ses/AwsSesNamespace.js +36 -76
  28. package/aws/ses/SimpleEmail.js +267 -304
  29. package/aws/ses/server.js +6 -11
  30. package/aws/sqs/AwsSqsNamespace.js +49 -89
  31. package/aws/sqs/server.js +5 -9
  32. package/aws/ssm/AwsSsmNamespace.js +43 -79
  33. package/aws/ssm/server.js +5 -9
  34. package/axios/deleteRequest.js +8 -15
  35. package/axios/get.js +8 -15
  36. package/axios/index.js +3 -9
  37. package/axios/post.js +8 -15
  38. package/boolean/index.js +3 -10
  39. package/brightData/serpApi/buildGoogleSerpUrl.js +1 -5
  40. package/brightData/serpApi/buildGoogleTrendsUrl.js +1 -5
  41. package/brightData/serpApi/getAsyncRequestId.js +8 -12
  42. package/brightData/serpApi/getAsyncResults.js +8 -12
  43. package/brightData/serpApi/getRealtime.js +3 -7
  44. package/brightData/serpApi/server.js +6 -14
  45. package/brightData/server.js +2 -7
  46. package/brightData/webScraperIde/getBatch.js +3 -7
  47. package/brightData/webScraperIde/getRealtime.js +11 -15
  48. package/brightData/webScraperIde/server.js +2 -7
  49. package/cache/server.js +2 -7
  50. package/cache/test/cache.test.js +4 -6
  51. package/crud/index.js +1 -4
  52. package/crypto/getDecrypt.js +2 -39
  53. package/crypto/getEncrypt.js +2 -39
  54. package/crypto/getRandom.js +1 -5
  55. package/crypto/getSha256.js +4 -41
  56. package/crypto/index.js +4 -11
  57. package/date/calculation.js +70 -99
  58. package/date/financialYear.js +16 -23
  59. package/date/format.js +40 -61
  60. package/date/index.js +4 -20
  61. package/date/type.js +4 -7
  62. package/environment/index.js +15 -25
  63. package/eskimi/getAgeGroup.js +3 -7
  64. package/eskimi/getData.js +3 -7
  65. package/eskimi/getDevice.js +3 -7
  66. package/eskimi/getGender.js +3 -7
  67. package/eskimi/server.js +23 -26
  68. package/file/index.js +8 -46
  69. package/geo/countries.js +1 -4
  70. package/geo/index.js +2 -7
  71. package/geo/languages.js +1 -4
  72. package/google/bigQuery/GoogleBigQueryNamespace.js +108 -148
  73. package/google/bigQuery/loadData.js +1 -5
  74. package/google/bigQuery/server.js +8 -14
  75. package/google/server.js +1 -5
  76. package/google/sheets/GoogleSheetsNamespace.js +34 -74
  77. package/google/sheets/getAssociatedData.js +1 -5
  78. package/google/sheets/server.js +8 -14
  79. package/google/storage/GoogleCloudStorageNamespace.js +62 -102
  80. package/google/storage/server.js +6 -10
  81. package/googleAds/GoogleAdsNamespace.js +28 -68
  82. package/googleAds/keywordPlanner/server.js +32 -35
  83. package/googleAds/server.js +6 -10
  84. package/googlePageSpeed/GooglePageSpeedNamespace.js +21 -28
  85. package/googlePageSpeed/server.js +8 -12
  86. package/googleSearchIncidents/server.js +28 -32
  87. package/greenDomain/server.js +17 -21
  88. package/inngest/server.js +1 -4
  89. package/json/getJsonNewline.js +3 -7
  90. package/json/index.js +2 -7
  91. package/json/isJson.js +1 -5
  92. package/littleWarden/LittleWardenNamespace.js +24 -31
  93. package/littleWarden/getUrlStatus.js +3 -7
  94. package/littleWarden/server.js +14 -22
  95. package/lumar/api/buildRequest.js +14 -18
  96. package/lumar/api/getData.js +3 -7
  97. package/lumar/api/initClient.js +3 -7
  98. package/lumar/api/server.js +6 -12
  99. package/lumar/graphql/columns.js +1 -4
  100. package/lumar/graphql/getData.js +3 -7
  101. package/lumar/graphql/initClient.js +3 -7
  102. package/lumar/graphql/queries/crawl.js +1 -2
  103. package/lumar/graphql/queries/getCrawls.js +1 -3
  104. package/lumar/graphql/queries/getReportDifferences.js +3 -5
  105. package/lumar/graphql/queries/getRows.js +1 -3
  106. package/lumar/graphql/queries/getTotals.js +1 -3
  107. package/lumar/graphql/queries/row.js +1 -2
  108. package/lumar/graphql/reportTemplates.js +1 -4
  109. package/lumar/graphql/server.js +7 -15
  110. package/myTarget/server.js +3 -7
  111. package/nextAuth/index.js +2 -6
  112. package/nextAuth/isSessionReady.js +1 -5
  113. package/nextJs/client/LazyLoad.js +5 -12
  114. package/nextJs/client.js +1 -5
  115. package/nextJs/index.js +2 -7
  116. package/number/format.js +3 -7
  117. package/number/formatCurrency.js +1 -5
  118. package/number/getDecimal.js +3 -7
  119. package/number/getNumber.js +3 -7
  120. package/number/getPercentIncrease.js +4 -8
  121. package/number/getSafeDivide.js +6 -10
  122. package/number/index.js +6 -15
  123. package/object/index.js +1 -5
  124. package/object/replaceKeys.js +3 -7
  125. package/onePassword/OnePasswordNamespace.js +36 -76
  126. package/onePassword/server.js +3 -7
  127. package/openAi/OpenAiNamespace.js +32 -39
  128. package/openAi/server.js +6 -10
  129. package/package.json +224 -122
  130. package/prisma/PrismaNamespace.js +53 -93
  131. package/prisma/getDecimal.js +5 -12
  132. package/prisma/server.js +4 -9
  133. package/scripts/generate-exports.js +50 -0
  134. package/snapchat/SnapchatNamespace.js +20 -27
  135. package/snapchat/server.js +6 -10
  136. package/sorting/byNumberAscending.js +1 -5
  137. package/sorting/byNumberDescending.js +1 -5
  138. package/sorting/byStringAscending.js +1 -5
  139. package/sorting/byStringDescending.js +1 -5
  140. package/sorting/index.js +4 -11
  141. package/stream/server.js +1 -5
  142. package/stream/sort.js +1 -5
  143. package/string/getCapitalised.js +3 -7
  144. package/string/getClean.js +17 -21
  145. package/string/getFolder.js +3 -10
  146. package/string/getProperCase.js +4 -8
  147. package/string/getString.js +8 -15
  148. package/string/getStringFromStream.js +1 -5
  149. package/string/getUnescaped.js +3 -10
  150. package/string/getWithoutAccents.js +1 -5
  151. package/string/getWithoutHtmlTags.js +1 -5
  152. package/string/getWithoutPunctuation.js +1 -5
  153. package/string/getWithoutUnderscores.js +1 -5
  154. package/string/getWithoutWhitespaces.js +1 -5
  155. package/string/index.js +12 -27
  156. package/string/reservedWords.js +5 -9
  157. package/swr/index.js +9 -18
  158. package/upTimeRobot/UpTimeRobotNamespace.js +32 -42
  159. package/upTimeRobot/server.js +11 -15
  160. package/url/index.js +12 -23
  161. package/url/server.js +1 -5
  162. package/url/writeUrlContents.js +6 -46
  163. package/util/defaultTo.js +5 -12
  164. package/util/getBrotliCompressed.js +3 -10
  165. package/util/getBrotliDecompressed.js +3 -10
  166. package/util/getClean.js +5 -9
  167. package/util/getError.js +1 -5
  168. package/util/getGzipCompressed.js +3 -10
  169. package/util/getGzipDecompressed.js +3 -10
  170. package/util/getWithoutHash.js +1 -5
  171. package/util/getWithoutParameter.js +1 -5
  172. package/util/index.js +7 -17
  173. package/util/isUndefined.js +3 -7
  174. package/util/promiseChunks.js +6 -10
  175. package/util/server.js +4 -11
  176. package/util/sleep.js +1 -5
  177. package/webWorker/index.js +1 -4
  178. package/xml/getXml.js +3 -7
package/package.json CHANGED
@@ -1,197 +1,299 @@
1
1
  {
2
- "name": "@8ms/helpers",
3
- "license": "UNLICENSED",
4
- "version": "2.2.9",
5
- "repository": {
2
+ "name": "@8ms/helpers",
3
+ "license": "UNLICENSED",
4
+ "version": "2.2.12",
5
+ "repository": {
6
6
  "type": "git",
7
- "url": "git+https://github.com/8millionstories-organisation/8ms-helpers-ts.git"
7
+ "url": "git+https://github.com/8millionstories-organisation/8ms-helpers-ts.git"
8
8
  },
9
- "main": "index.js",
10
- "types": "index.d.ts",
11
- "scripts": {
9
+ "main": "index.js",
10
+ "types": "index.d.ts",
11
+ "scripts": {
12
12
  "build": "tsc",
13
- "jest": "jest --watch"
13
+ "jest": "jest --watch"
14
14
  },
15
- "packageManager": "pnpm@9.15.0",
16
- "engines": {
15
+ "packageManager": "pnpm@9.15.0",
16
+ "engines": {
17
17
  "node": "24"
18
18
  },
19
- "dependencies": {
20
- "axios": "^1.13.5",
19
+ "dependencies": {
20
+ "axios": "^1.13.5",
21
21
  "lodash": "^4.17.23",
22
- "luxon": "^3.7.2",
23
- "zod": "^4.3.6"
22
+ "luxon": "^3.7.2",
23
+ "zod": "^4.3.6"
24
24
  },
25
- "peerDependencies": {
26
- "@1password/sdk": "<1.0.0",
27
- "@aws-sdk/client-ec2": "^3.0.0",
28
- "@aws-sdk/client-ecs": "^3.0.0",
29
- "@aws-sdk/client-glue": "^3.0.0",
30
- "@aws-sdk/client-lambda": "^3.0.0",
31
- "@aws-sdk/client-s3": "^3.0.0",
32
- "@aws-sdk/client-ses": "^3.0.0",
33
- "@aws-sdk/client-sqs": "^3.0.0",
34
- "@aws-sdk/client-ssm": "^3.0.0",
35
- "@aws-sdk/lib-storage": "^3.0.0",
25
+ "peerDependencies": {
26
+ "@1password/sdk": "<1.0.0",
27
+ "@aws-sdk/client-ec2": "^3.0.0",
28
+ "@aws-sdk/client-ecs": "^3.0.0",
29
+ "@aws-sdk/client-glue": "^3.0.0",
30
+ "@aws-sdk/client-lambda": "^3.0.0",
31
+ "@aws-sdk/client-s3": "^3.0.0",
32
+ "@aws-sdk/client-ses": "^3.0.0",
33
+ "@aws-sdk/client-sqs": "^3.0.0",
34
+ "@aws-sdk/client-ssm": "^3.0.0",
35
+ "@aws-sdk/lib-storage": "^3.0.0",
36
36
  "@aws-sdk/s3-request-presigner": "^3.0.0",
37
- "@google-cloud/bigquery": "^8.0.0",
38
- "@google-cloud/common": "^6.0.0",
39
- "@google-cloud/storage": "^7.0.0",
40
- "@googleapis/sheets": "^13.0.0",
41
- "@planetscale/database": "^1.0.0",
42
- "@prisma/adapter-mariadb": "^7.0.0",
43
- "@prisma/adapter-pg": "^7.0.0",
44
- "@prisma/adapter-planetscale": "^7.0.0",
45
- "@prisma/client": "^7.0.0",
46
- "crypto-js": "^4.0.0",
47
- "fs-extra": "^11.0.0",
48
- "google-ads-api": "^23.0.0",
49
- "googleapis-common": "^8.0.0",
50
- "next": "^16.0.0",
51
- "react": "^19.0.0",
52
- "react-intersection-observer": "^10.0.0",
53
- "stream-chain": "^3.0.0",
54
- "stream-json": "^1.0.0",
55
- "swr": "^2.0.0"
37
+ "@google-cloud/bigquery": "^8.0.0",
38
+ "@google-cloud/common": "^6.0.0",
39
+ "@google-cloud/storage": "^7.0.0",
40
+ "@googleapis/sheets": "^13.0.0",
41
+ "@planetscale/database": "^1.0.0",
42
+ "@prisma/adapter-mariadb": "^7.0.0",
43
+ "@prisma/adapter-pg": "^7.0.0",
44
+ "@prisma/adapter-planetscale": "^7.0.0",
45
+ "@prisma/client": "^7.0.0",
46
+ "crypto-js": "^4.0.0",
47
+ "fs-extra": "^11.0.0",
48
+ "google-ads-api": "^23.0.0",
49
+ "googleapis-common": "^8.0.0",
50
+ "next": "^16.0.0",
51
+ "react": "^19.0.0",
52
+ "react-intersection-observer": "^10.0.0",
53
+ "stream-chain": "^3.0.0",
54
+ "stream-json": "^1.0.0",
55
+ "swr": "^2.0.0"
56
56
  },
57
57
  "peerDependenciesMeta": {
58
- "@1password/sdk": {
58
+ "@1password/sdk": {
59
59
  "optional": true
60
60
  },
61
- "@aws-sdk/client-ec2": {
61
+ "@aws-sdk/client-ec2": {
62
62
  "optional": true
63
63
  },
64
- "@aws-sdk/client-ecs": {
64
+ "@aws-sdk/client-ecs": {
65
65
  "optional": true
66
66
  },
67
- "@aws-sdk/client-glue": {
67
+ "@aws-sdk/client-glue": {
68
68
  "optional": true
69
69
  },
70
- "@aws-sdk/client-lambda": {
70
+ "@aws-sdk/client-lambda": {
71
71
  "optional": true
72
72
  },
73
- "@aws-sdk/client-s3": {
73
+ "@aws-sdk/client-s3": {
74
74
  "optional": true
75
75
  },
76
- "@aws-sdk/client-ses": {
76
+ "@aws-sdk/client-ses": {
77
77
  "optional": true
78
78
  },
79
- "@aws-sdk/client-sqs": {
79
+ "@aws-sdk/client-sqs": {
80
80
  "optional": true
81
81
  },
82
- "@aws-sdk/client-ssm": {
82
+ "@aws-sdk/client-ssm": {
83
83
  "optional": true
84
84
  },
85
- "@aws-sdk/lib-storage": {
85
+ "@aws-sdk/lib-storage": {
86
86
  "optional": true
87
87
  },
88
88
  "@aws-sdk/s3-request-presigner": {
89
89
  "optional": true
90
90
  },
91
- "@google-cloud/bigquery": {
91
+ "@google-cloud/bigquery": {
92
92
  "optional": true
93
93
  },
94
- "@google-cloud/common": {
94
+ "@google-cloud/common": {
95
95
  "optional": true
96
96
  },
97
- "@google-cloud/storage": {
97
+ "@google-cloud/storage": {
98
98
  "optional": true
99
99
  },
100
- "@googleapis/sheets": {
100
+ "@googleapis/sheets": {
101
101
  "optional": true
102
102
  },
103
- "@planetscale/database": {
103
+ "@planetscale/database": {
104
104
  "optional": true
105
105
  },
106
- "@prisma/adapter-mariadb": {
106
+ "@prisma/adapter-mariadb": {
107
107
  "optional": true
108
108
  },
109
- "@prisma/adapter-pg": {
109
+ "@prisma/adapter-pg": {
110
110
  "optional": true
111
111
  },
112
- "@prisma/adapter-planetscale": {
112
+ "@prisma/adapter-planetscale": {
113
113
  "optional": true
114
114
  },
115
- "@prisma/client": {
115
+ "@prisma/client": {
116
116
  "optional": true
117
117
  },
118
- "crypto-js": {
118
+ "crypto-js": {
119
119
  "optional": true
120
120
  },
121
- "fs-extra": {
121
+ "fs-extra": {
122
122
  "optional": true
123
123
  },
124
- "google-ads-api": {
124
+ "google-ads-api": {
125
125
  "optional": true
126
126
  },
127
- "googleapis-common": {
127
+ "googleapis-common": {
128
128
  "optional": true
129
129
  },
130
- "next": {
130
+ "next": {
131
131
  "optional": true
132
132
  },
133
- "react": {
133
+ "react": {
134
134
  "optional": true
135
135
  },
136
- "stream-chain": {
136
+ "stream-chain": {
137
137
  "optional": true
138
138
  },
139
- "stream-json": {
139
+ "stream-json": {
140
140
  "optional": true
141
141
  },
142
- "swr": {
142
+ "swr": {
143
143
  "optional": true
144
144
  }
145
145
  },
146
- "devDependencies": {
147
- "@1password/sdk": "^0.4.0",
148
- "@aws-sdk/client-ec2": "^3.992.0",
149
- "@aws-sdk/client-ecs": "^3.992.0",
150
- "@aws-sdk/client-glue": "^3.992.0",
151
- "@aws-sdk/client-lambda": "^3.992.0",
152
- "@aws-sdk/client-s3": "^3.992.0",
153
- "@aws-sdk/client-ses": "^3.992.0",
154
- "@aws-sdk/client-sqs": "^3.992.0",
155
- "@aws-sdk/client-ssm": "^3.992.0",
156
- "@aws-sdk/lib-storage": "^3.992.0",
146
+ "devDependencies": {
147
+ "@1password/sdk": "^0.4.0",
148
+ "@aws-sdk/client-ec2": "^3.992.0",
149
+ "@aws-sdk/client-ecs": "^3.992.0",
150
+ "@aws-sdk/client-glue": "^3.992.0",
151
+ "@aws-sdk/client-lambda": "^3.992.0",
152
+ "@aws-sdk/client-s3": "^3.992.0",
153
+ "@aws-sdk/client-ses": "^3.992.0",
154
+ "@aws-sdk/client-sqs": "^3.992.0",
155
+ "@aws-sdk/client-ssm": "^3.992.0",
156
+ "@aws-sdk/lib-storage": "^3.992.0",
157
157
  "@aws-sdk/s3-request-presigner": "^3.992.0",
158
- "@babel/core": "7.29.0",
159
- "@babel/preset-env": "7.29.0",
160
- "@babel/preset-flow": "7.27.1",
161
- "@babel/preset-typescript": "7.28.5",
162
- "@google-cloud/bigquery": "^8.1.1",
163
- "@google-cloud/common": "^6.0.0",
164
- "@google-cloud/storage": "^7.19.0",
165
- "@googleapis/sheets": "^13.0.1",
166
- "@planetscale/database": "^1.19.0",
167
- "@prisma/adapter-mariadb": "^7.4.0",
168
- "@prisma/adapter-pg": "^7.4.0",
169
- "@prisma/adapter-planetscale": "^7.4.0",
170
- "@prisma/client": "^7.4.0",
171
- "@types/babel__core": "^7.20.5",
172
- "@types/crypto-js": "^4.2.2",
173
- "@types/fs-extra": "11.0.4",
174
- "@types/jest": "30.0.0",
175
- "@types/lodash": "^4.17.23",
176
- "@types/luxon": "3.7.1",
177
- "@types/node": "^24.10.13",
178
- "@types/react": "^19.2.14",
179
- "babel-jest": "30.2.0",
180
- "crypto-js": "^4.2.0",
181
- "dotenv": "^17.3.1",
182
- "fs-extra": "11.3.3",
183
- "google-ads-api": "^23.0.0",
184
- "googleapis-common": "^8.0.0",
185
- "jest": "30.2.0",
186
- "next": "^16.1.6",
187
- "node-fetch": "3.3.2",
188
- "react": "^19.2.4",
189
- "react-intersection-observer": "^10.0.2",
190
- "stream-chain": "^3.4.0",
191
- "stream-json": "^1.9.1",
192
- "swr": "^2.4.0",
193
- "ts-node": "10.9.2",
194
- "tslib": "2.8.1",
195
- "typescript": "^5.9.3"
158
+ "@babel/core": "7.29.0",
159
+ "@babel/preset-env": "7.29.0",
160
+ "@babel/preset-flow": "7.27.1",
161
+ "@babel/preset-typescript": "7.28.5",
162
+ "@google-cloud/bigquery": "^8.1.1",
163
+ "@google-cloud/common": "^6.0.0",
164
+ "@google-cloud/storage": "^7.19.0",
165
+ "@googleapis/sheets": "^13.0.1",
166
+ "@planetscale/database": "^1.19.0",
167
+ "@prisma/adapter-mariadb": "^7.4.0",
168
+ "@prisma/adapter-pg": "^7.4.0",
169
+ "@prisma/adapter-planetscale": "^7.4.0",
170
+ "@prisma/client": "^7.4.0",
171
+ "@types/babel__core": "^7.20.5",
172
+ "@types/crypto-js": "^4.2.2",
173
+ "@types/fs-extra": "11.0.4",
174
+ "@types/jest": "30.0.0",
175
+ "@types/lodash": "^4.17.23",
176
+ "@types/luxon": "3.7.1",
177
+ "@types/node": "^24.10.13",
178
+ "@types/react": "^19.2.14",
179
+ "babel-jest": "30.2.0",
180
+ "crypto-js": "^4.2.0",
181
+ "dotenv": "^17.3.1",
182
+ "fs-extra": "11.3.3",
183
+ "google-ads-api": "^23.0.0",
184
+ "googleapis-common": "^8.0.0",
185
+ "jest": "30.2.0",
186
+ "next": "^16.1.6",
187
+ "node-fetch": "3.3.2",
188
+ "react": "^19.2.4",
189
+ "react-intersection-observer": "^10.0.2",
190
+ "stream-chain": "^3.4.0",
191
+ "stream-json": "^1.9.1",
192
+ "swr": "^2.4.0",
193
+ "ts-node": "10.9.2",
194
+ "tslib": "2.8.1",
195
+ "typescript": "^5.9.3"
196
+ },
197
+ "exports": {
198
+ ".": {
199
+ "types": "./index.d.ts",
200
+ "default": "./index.js"
201
+ },
202
+ "./_class": {
203
+ "types": "./_class/index.d.ts",
204
+ "default": "./_class/index.js"
205
+ },
206
+ "./adverity": {
207
+ "types": "./adverity/index.d.ts",
208
+ "default": "./adverity/index.js"
209
+ },
210
+ "./api": {
211
+ "types": "./api/index.d.ts",
212
+ "default": "./api/index.js"
213
+ },
214
+ "./array": {
215
+ "types": "./array/index.d.ts",
216
+ "default": "./array/index.js"
217
+ },
218
+ "./atInternet": {
219
+ "types": "./atInternet/index.d.ts",
220
+ "default": "./atInternet/index.js"
221
+ },
222
+ "./axios": {
223
+ "types": "./axios/index.d.ts",
224
+ "default": "./axios/index.js"
225
+ },
226
+ "./boolean": {
227
+ "types": "./boolean/index.d.ts",
228
+ "default": "./boolean/index.js"
229
+ },
230
+ "./crud": {
231
+ "types": "./crud/index.d.ts",
232
+ "default": "./crud/index.js"
233
+ },
234
+ "./crypto": {
235
+ "types": "./crypto/index.d.ts",
236
+ "default": "./crypto/index.js"
237
+ },
238
+ "./date": {
239
+ "types": "./date/index.d.ts",
240
+ "default": "./date/index.js"
241
+ },
242
+ "./environment": {
243
+ "types": "./environment/index.d.ts",
244
+ "default": "./environment/index.js"
245
+ },
246
+ "./file": {
247
+ "types": "./file/index.d.ts",
248
+ "default": "./file/index.js"
249
+ },
250
+ "./geo": {
251
+ "types": "./geo/index.d.ts",
252
+ "default": "./geo/index.js"
253
+ },
254
+ "./json": {
255
+ "types": "./json/index.d.ts",
256
+ "default": "./json/index.js"
257
+ },
258
+ "./nextAuth": {
259
+ "types": "./nextAuth/index.d.ts",
260
+ "default": "./nextAuth/index.js"
261
+ },
262
+ "./nextJs": {
263
+ "types": "./nextJs/index.d.ts",
264
+ "default": "./nextJs/index.js"
265
+ },
266
+ "./number": {
267
+ "types": "./number/index.d.ts",
268
+ "default": "./number/index.js"
269
+ },
270
+ "./object": {
271
+ "types": "./object/index.d.ts",
272
+ "default": "./object/index.js"
273
+ },
274
+ "./sorting": {
275
+ "types": "./sorting/index.d.ts",
276
+ "default": "./sorting/index.js"
277
+ },
278
+ "./string": {
279
+ "types": "./string/index.d.ts",
280
+ "default": "./string/index.js"
281
+ },
282
+ "./swr": {
283
+ "types": "./swr/index.d.ts",
284
+ "default": "./swr/index.js"
285
+ },
286
+ "./url": {
287
+ "types": "./url/index.d.ts",
288
+ "default": "./url/index.js"
289
+ },
290
+ "./util": {
291
+ "types": "./util/index.d.ts",
292
+ "default": "./util/index.js"
293
+ },
294
+ "./webWorker": {
295
+ "types": "./webWorker/index.d.ts",
296
+ "default": "./webWorker/index.js"
297
+ }
196
298
  }
197
299
  }
@@ -1,102 +1,62 @@
1
- "use strict";
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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || (function () {
19
- var ownKeys = function(o) {
20
- ownKeys = Object.getOwnPropertyNames || function (o) {
21
- var ar = [];
22
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
- return ar;
24
- };
25
- return ownKeys(o);
26
- };
27
- return function (mod) {
28
- if (mod && mod.__esModule) return mod;
29
- var result = {};
30
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
- __setModuleDefault(result, mod);
32
- return result;
33
- };
34
- })();
35
- Object.defineProperty(exports, "__esModule", { value: true });
36
- exports.PrismaNamespace = void 0;
37
- const _class_1 = require("../_class");
38
- const getError_1 = require("../util/getError");
39
- class PrismaNamespace extends _class_1.BaseNamespace {
40
- constructor() {
41
- super(...arguments);
42
- // Async setup to only initialise where required
43
- this.ensureInit = async () => {
44
- if (!this.client) {
45
- let adapter = null;
46
- if (this.config.isPlanetScale) {
47
- try {
48
- const { PrismaPlanetScale } = await Promise.resolve().then(() => __importStar(require("@prisma/adapter-planetscale")));
49
- adapter = new PrismaPlanetScale({
50
- url: this.config.url,
51
- });
52
- }
53
- catch (e) {
54
- throw new Error(`PlanetScale adapter not installed - ${(0, getError_1.getError)(e)}`);
55
- }
1
+ import { BaseNamespace } from "../_class";
2
+ import { getError } from "../util/getError";
3
+ export class PrismaNamespace extends BaseNamespace {
4
+ // Async setup to only initialise where required
5
+ ensureInit = async () => {
6
+ if (!this.client) {
7
+ let adapter = null;
8
+ if (this.config.isPlanetScale) {
9
+ try {
10
+ const { PrismaPlanetScale } = await import("@prisma/adapter-planetscale");
11
+ adapter = new PrismaPlanetScale({
12
+ url: this.config.url,
13
+ });
14
+ }
15
+ catch (e) {
16
+ throw new Error(`PlanetScale adapter not installed - ${getError(e)}`);
56
17
  }
57
- if (this.config.isMysql) {
58
- try {
59
- const { PrismaMariaDb } = await Promise.resolve().then(() => __importStar(require("@prisma/adapter-mariadb")));
60
- adapter = new PrismaMariaDb(this.config.url);
61
- }
62
- catch (e) {
63
- throw new Error(`MariaDB adapter not installed - ${(0, getError_1.getError)(e)}`);
64
- }
18
+ }
19
+ if (this.config.isMysql) {
20
+ try {
21
+ const { PrismaMariaDb } = await import("@prisma/adapter-mariadb");
22
+ adapter = new PrismaMariaDb(this.config.url);
65
23
  }
66
- else {
67
- // Prisma v7 requires a driver adapter use the one matching your database
68
- // e.g. @prisma/adapter-pg for Postgres, @prisma/adapter-mysql2 for MySQL
69
- try {
70
- const { PrismaPg } = await Promise.resolve().then(() => __importStar(require("@prisma/adapter-pg")));
71
- adapter = new PrismaPg({
72
- connectionString: process.env.DATABASE_URL,
73
- });
74
- }
75
- catch (e) {
76
- throw new Error(`Postgres adapter not installed - ${(0, getError_1.getError)(e)}`);
77
- }
24
+ catch (e) {
25
+ throw new Error(`MariaDB adapter not installed - ${getError(e)}`);
78
26
  }
27
+ }
28
+ else {
29
+ // Prisma v7 requires a driver adapter — use the one matching your database
30
+ // e.g. @prisma/adapter-pg for Postgres, @prisma/adapter-mysql2 for MySQL
79
31
  try {
80
- // In Prisma v7, the client is generated to a custom output path
81
- // @ts-ignore
82
- const { PrismaClient } = await Promise.resolve().then(() => __importStar(require("../../generated/prisma/client")));
83
- // Show the full query if debugging
84
- if (this.config.isDebug) {
85
- this.client = new PrismaClient({
86
- adapter,
87
- log: [{ emit: "event", level: "query" }],
88
- });
89
- }
90
- // Standard prisma
91
- else {
92
- this.client = new PrismaClient({ adapter });
93
- }
32
+ const { PrismaPg } = await import("@prisma/adapter-pg");
33
+ adapter = new PrismaPg({
34
+ connectionString: process.env.DATABASE_URL,
35
+ });
94
36
  }
95
37
  catch (e) {
96
- throw new Error(`Prisma Client not installed - ${(0, getError_1.getError)(e)}`);
38
+ throw new Error(`Postgres adapter not installed - ${getError(e)}`);
39
+ }
40
+ }
41
+ try {
42
+ // In Prisma v7, the client is generated to a custom output path
43
+ // @ts-ignore
44
+ const { PrismaClient } = await import("../../generated/prisma/client");
45
+ // Show the full query if debugging
46
+ if (this.config.isDebug) {
47
+ this.client = new PrismaClient({
48
+ adapter,
49
+ log: [{ emit: "event", level: "query" }],
50
+ });
51
+ }
52
+ // Standard prisma
53
+ else {
54
+ this.client = new PrismaClient({ adapter });
97
55
  }
98
56
  }
99
- };
100
- }
57
+ catch (e) {
58
+ throw new Error(`Prisma Client not installed - ${getError(e)}`);
59
+ }
60
+ }
61
+ };
101
62
  }
102
- exports.PrismaNamespace = PrismaNamespace;
@@ -1,23 +1,16 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.getDecimal = void 0;
7
- const getDecimal_1 = require("../number/getDecimal");
8
- const isArray_1 = __importDefault(require("lodash/isArray"));
1
+ import { getDecimal as getNumberDecimal } from "../number/getDecimal";
2
+ import isArray from "lodash/isArray";
9
3
  /**
10
4
  * Fetch the number from a prisma decimal (comes through as an object).
11
5
  */
12
- const getDecimal = (input, dp = 2) => {
6
+ export const getDecimal = (input, dp = 2) => {
13
7
  let numberString = "";
14
8
  // Prisma value
15
- if ((0, isArray_1.default)(input?.d)) {
9
+ if (isArray(input?.d)) {
16
10
  numberString = input.absoluteValue();
17
11
  }
18
12
  else {
19
13
  numberString = input.toString();
20
14
  }
21
- return (0, getDecimal_1.getDecimal)(numberString, dp);
15
+ return getNumberDecimal(numberString, dp);
22
16
  };
23
- exports.getDecimal = getDecimal;
package/prisma/server.js CHANGED
@@ -1,10 +1,7 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getDecimal = exports.prismaClient = void 0;
4
- const PrismaNamespace_1 = require("./PrismaNamespace");
1
+ import { PrismaNamespace } from "./PrismaNamespace";
5
2
  const prismaNamespaces = new Map();
6
3
  // Main client that is used by system
7
- const prismaClient = async (key = "default", config) => {
4
+ export const prismaClient = async (key = "default", config) => {
8
5
  if (prismaNamespaces.has(key)) {
9
6
  return prismaNamespaces.get(key);
10
7
  }
@@ -22,11 +19,9 @@ const prismaClient = async (key = "default", config) => {
22
19
  throw new Error(`Config required for namespace '${key}'`);
23
20
  }
24
21
  }
25
- const namespace = new PrismaNamespace_1.PrismaNamespace(key, config);
22
+ const namespace = new PrismaNamespace(key, config);
26
23
  await namespace.ensureInit();
27
24
  prismaNamespaces.set(key, namespace);
28
25
  return namespace;
29
26
  };
30
- exports.prismaClient = prismaClient;
31
- var getDecimal_1 = require("./getDecimal");
32
- Object.defineProperty(exports, "getDecimal", { enumerable: true, get: function () { return getDecimal_1.getDecimal; } });
27
+ export { getDecimal } from "./getDecimal";