@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.
- package/.github/workflows/deploy_npmjs.yml +3 -0
- package/_class/BaseClass.js +43 -52
- package/_class/BaseNamespace.js +17 -20
- package/_class/index.js +2 -7
- package/adverity/getJobs.js +7 -11
- package/adverity/index.js +51 -54
- package/adverity/server.js +1 -5
- package/api/ApiResponseClass.js +84 -88
- package/api/functions.js +13 -22
- package/api/index.js +3 -19
- package/api/types.js +5 -9
- package/array/index.js +3 -11
- package/atInternet/index.js +10 -13
- package/aws/ec2/AwsEc2Namespace.js +34 -74
- package/aws/ec2/server.js +5 -9
- package/aws/ecs/AwsEcsNamespace.js +110 -150
- package/aws/ecs/server.js +5 -9
- package/aws/glue/AwsGlueNamespace.js +26 -66
- package/aws/glue/server.js +5 -9
- package/aws/isResponse200.js +3 -7
- package/aws/lambda/AwsLambdaNamespace.js +62 -102
- package/aws/lambda/server.js +6 -11
- package/aws/s3/AwsS3Namespace.js +347 -390
- package/aws/s3/payload.js +29 -32
- package/aws/s3/server.js +9 -14
- package/aws/server.js +5 -10
- package/aws/ses/AwsSesNamespace.js +36 -76
- package/aws/ses/SimpleEmail.js +267 -304
- package/aws/ses/server.js +6 -11
- package/aws/sqs/AwsSqsNamespace.js +49 -89
- package/aws/sqs/server.js +5 -9
- package/aws/ssm/AwsSsmNamespace.js +43 -79
- package/aws/ssm/server.js +5 -9
- package/axios/deleteRequest.js +8 -15
- package/axios/get.js +8 -15
- package/axios/index.js +3 -9
- package/axios/post.js +8 -15
- package/boolean/index.js +3 -10
- package/brightData/serpApi/buildGoogleSerpUrl.js +1 -5
- package/brightData/serpApi/buildGoogleTrendsUrl.js +1 -5
- package/brightData/serpApi/getAsyncRequestId.js +8 -12
- package/brightData/serpApi/getAsyncResults.js +8 -12
- package/brightData/serpApi/getRealtime.js +3 -7
- package/brightData/serpApi/server.js +6 -14
- package/brightData/server.js +2 -7
- package/brightData/webScraperIde/getBatch.js +3 -7
- package/brightData/webScraperIde/getRealtime.js +11 -15
- package/brightData/webScraperIde/server.js +2 -7
- package/cache/server.js +2 -7
- package/cache/test/cache.test.js +4 -6
- package/crud/index.js +1 -4
- package/crypto/getDecrypt.js +2 -39
- package/crypto/getEncrypt.js +2 -39
- package/crypto/getRandom.js +1 -5
- package/crypto/getSha256.js +4 -41
- package/crypto/index.js +4 -11
- package/date/calculation.js +70 -99
- package/date/financialYear.js +16 -23
- package/date/format.js +40 -61
- package/date/index.js +4 -20
- package/date/type.js +4 -7
- package/environment/index.js +15 -25
- package/eskimi/getAgeGroup.js +3 -7
- package/eskimi/getData.js +3 -7
- package/eskimi/getDevice.js +3 -7
- package/eskimi/getGender.js +3 -7
- package/eskimi/server.js +23 -26
- package/file/index.js +8 -46
- package/geo/countries.js +1 -4
- package/geo/index.js +2 -7
- package/geo/languages.js +1 -4
- package/google/bigQuery/GoogleBigQueryNamespace.js +108 -148
- package/google/bigQuery/loadData.js +1 -5
- package/google/bigQuery/server.js +8 -14
- package/google/server.js +1 -5
- package/google/sheets/GoogleSheetsNamespace.js +34 -74
- package/google/sheets/getAssociatedData.js +1 -5
- package/google/sheets/server.js +8 -14
- package/google/storage/GoogleCloudStorageNamespace.js +62 -102
- package/google/storage/server.js +6 -10
- package/googleAds/GoogleAdsNamespace.js +28 -68
- package/googleAds/keywordPlanner/server.js +32 -35
- package/googleAds/server.js +6 -10
- package/googlePageSpeed/GooglePageSpeedNamespace.js +21 -28
- package/googlePageSpeed/server.js +8 -12
- package/googleSearchIncidents/server.js +28 -32
- package/greenDomain/server.js +17 -21
- package/inngest/server.js +1 -4
- package/json/getJsonNewline.js +3 -7
- package/json/index.js +2 -7
- package/json/isJson.js +1 -5
- package/littleWarden/LittleWardenNamespace.js +24 -31
- package/littleWarden/getUrlStatus.js +3 -7
- package/littleWarden/server.js +14 -22
- package/lumar/api/buildRequest.js +14 -18
- package/lumar/api/getData.js +3 -7
- package/lumar/api/initClient.js +3 -7
- package/lumar/api/server.js +6 -12
- package/lumar/graphql/columns.js +1 -4
- package/lumar/graphql/getData.js +3 -7
- package/lumar/graphql/initClient.js +3 -7
- package/lumar/graphql/queries/crawl.js +1 -2
- package/lumar/graphql/queries/getCrawls.js +1 -3
- package/lumar/graphql/queries/getReportDifferences.js +3 -5
- package/lumar/graphql/queries/getRows.js +1 -3
- package/lumar/graphql/queries/getTotals.js +1 -3
- package/lumar/graphql/queries/row.js +1 -2
- package/lumar/graphql/reportTemplates.js +1 -4
- package/lumar/graphql/server.js +7 -15
- package/myTarget/server.js +3 -7
- package/nextAuth/index.js +2 -6
- package/nextAuth/isSessionReady.js +1 -5
- package/nextJs/client/LazyLoad.js +5 -12
- package/nextJs/client.js +1 -5
- package/nextJs/index.js +2 -7
- package/number/format.js +3 -7
- package/number/formatCurrency.js +1 -5
- package/number/getDecimal.js +3 -7
- package/number/getNumber.js +3 -7
- package/number/getPercentIncrease.js +4 -8
- package/number/getSafeDivide.js +6 -10
- package/number/index.js +6 -15
- package/object/index.js +1 -5
- package/object/replaceKeys.js +3 -7
- package/onePassword/OnePasswordNamespace.js +36 -76
- package/onePassword/server.js +3 -7
- package/openAi/OpenAiNamespace.js +32 -39
- package/openAi/server.js +6 -10
- package/package.json +224 -122
- package/prisma/PrismaNamespace.js +53 -93
- package/prisma/getDecimal.js +5 -12
- package/prisma/server.js +4 -9
- package/scripts/generate-exports.js +50 -0
- package/snapchat/SnapchatNamespace.js +20 -27
- package/snapchat/server.js +6 -10
- package/sorting/byNumberAscending.js +1 -5
- package/sorting/byNumberDescending.js +1 -5
- package/sorting/byStringAscending.js +1 -5
- package/sorting/byStringDescending.js +1 -5
- package/sorting/index.js +4 -11
- package/stream/server.js +1 -5
- package/stream/sort.js +1 -5
- package/string/getCapitalised.js +3 -7
- package/string/getClean.js +17 -21
- package/string/getFolder.js +3 -10
- package/string/getProperCase.js +4 -8
- package/string/getString.js +8 -15
- package/string/getStringFromStream.js +1 -5
- package/string/getUnescaped.js +3 -10
- package/string/getWithoutAccents.js +1 -5
- package/string/getWithoutHtmlTags.js +1 -5
- package/string/getWithoutPunctuation.js +1 -5
- package/string/getWithoutUnderscores.js +1 -5
- package/string/getWithoutWhitespaces.js +1 -5
- package/string/index.js +12 -27
- package/string/reservedWords.js +5 -9
- package/swr/index.js +9 -18
- package/upTimeRobot/UpTimeRobotNamespace.js +32 -42
- package/upTimeRobot/server.js +11 -15
- package/url/index.js +12 -23
- package/url/server.js +1 -5
- package/url/writeUrlContents.js +6 -46
- package/util/defaultTo.js +5 -12
- package/util/getBrotliCompressed.js +3 -10
- package/util/getBrotliDecompressed.js +3 -10
- package/util/getClean.js +5 -9
- package/util/getError.js +1 -5
- package/util/getGzipCompressed.js +3 -10
- package/util/getGzipDecompressed.js +3 -10
- package/util/getWithoutHash.js +1 -5
- package/util/getWithoutParameter.js +1 -5
- package/util/index.js +7 -17
- package/util/isUndefined.js +3 -7
- package/util/promiseChunks.js +6 -10
- package/util/server.js +4 -11
- package/util/sleep.js +1 -5
- package/webWorker/index.js +1 -4
- package/xml/getXml.js +3 -7
package/package.json
CHANGED
|
@@ -1,197 +1,299 @@
|
|
|
1
1
|
{
|
|
2
|
-
"name":
|
|
3
|
-
"license":
|
|
4
|
-
"version":
|
|
5
|
-
"repository":
|
|
2
|
+
"name": "@8ms/helpers",
|
|
3
|
+
"license": "UNLICENSED",
|
|
4
|
+
"version": "2.2.12",
|
|
5
|
+
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
|
-
"url":
|
|
7
|
+
"url": "git+https://github.com/8millionstories-organisation/8ms-helpers-ts.git"
|
|
8
8
|
},
|
|
9
|
-
"main":
|
|
10
|
-
"types":
|
|
11
|
-
"scripts":
|
|
9
|
+
"main": "index.js",
|
|
10
|
+
"types": "index.d.ts",
|
|
11
|
+
"scripts": {
|
|
12
12
|
"build": "tsc",
|
|
13
|
-
"jest":
|
|
13
|
+
"jest": "jest --watch"
|
|
14
14
|
},
|
|
15
|
-
"packageManager":
|
|
16
|
-
"engines":
|
|
15
|
+
"packageManager": "pnpm@9.15.0",
|
|
16
|
+
"engines": {
|
|
17
17
|
"node": "24"
|
|
18
18
|
},
|
|
19
|
-
"dependencies":
|
|
20
|
-
"axios":
|
|
19
|
+
"dependencies": {
|
|
20
|
+
"axios": "^1.13.5",
|
|
21
21
|
"lodash": "^4.17.23",
|
|
22
|
-
"luxon":
|
|
23
|
-
"zod":
|
|
22
|
+
"luxon": "^3.7.2",
|
|
23
|
+
"zod": "^4.3.6"
|
|
24
24
|
},
|
|
25
|
-
"peerDependencies":
|
|
26
|
-
"@1password/sdk":
|
|
27
|
-
"@aws-sdk/client-ec2":
|
|
28
|
-
"@aws-sdk/client-ecs":
|
|
29
|
-
"@aws-sdk/client-glue":
|
|
30
|
-
"@aws-sdk/client-lambda":
|
|
31
|
-
"@aws-sdk/client-s3":
|
|
32
|
-
"@aws-sdk/client-ses":
|
|
33
|
-
"@aws-sdk/client-sqs":
|
|
34
|
-
"@aws-sdk/client-ssm":
|
|
35
|
-
"@aws-sdk/lib-storage":
|
|
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":
|
|
38
|
-
"@google-cloud/common":
|
|
39
|
-
"@google-cloud/storage":
|
|
40
|
-
"@googleapis/sheets":
|
|
41
|
-
"@planetscale/database":
|
|
42
|
-
"@prisma/adapter-mariadb":
|
|
43
|
-
"@prisma/adapter-pg":
|
|
44
|
-
"@prisma/adapter-planetscale":
|
|
45
|
-
"@prisma/client":
|
|
46
|
-
"crypto-js":
|
|
47
|
-
"fs-extra":
|
|
48
|
-
"google-ads-api":
|
|
49
|
-
"googleapis-common":
|
|
50
|
-
"next":
|
|
51
|
-
"react":
|
|
52
|
-
"react-intersection-observer":
|
|
53
|
-
"stream-chain":
|
|
54
|
-
"stream-json":
|
|
55
|
-
"swr":
|
|
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":
|
|
148
|
-
"@aws-sdk/client-ec2":
|
|
149
|
-
"@aws-sdk/client-ecs":
|
|
150
|
-
"@aws-sdk/client-glue":
|
|
151
|
-
"@aws-sdk/client-lambda":
|
|
152
|
-
"@aws-sdk/client-s3":
|
|
153
|
-
"@aws-sdk/client-ses":
|
|
154
|
-
"@aws-sdk/client-sqs":
|
|
155
|
-
"@aws-sdk/client-ssm":
|
|
156
|
-
"@aws-sdk/lib-storage":
|
|
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":
|
|
159
|
-
"@babel/preset-env":
|
|
160
|
-
"@babel/preset-flow":
|
|
161
|
-
"@babel/preset-typescript":
|
|
162
|
-
"@google-cloud/bigquery":
|
|
163
|
-
"@google-cloud/common":
|
|
164
|
-
"@google-cloud/storage":
|
|
165
|
-
"@googleapis/sheets":
|
|
166
|
-
"@planetscale/database":
|
|
167
|
-
"@prisma/adapter-mariadb":
|
|
168
|
-
"@prisma/adapter-pg":
|
|
169
|
-
"@prisma/adapter-planetscale":
|
|
170
|
-
"@prisma/client":
|
|
171
|
-
"@types/babel__core":
|
|
172
|
-
"@types/crypto-js":
|
|
173
|
-
"@types/fs-extra":
|
|
174
|
-
"@types/jest":
|
|
175
|
-
"@types/lodash":
|
|
176
|
-
"@types/luxon":
|
|
177
|
-
"@types/node":
|
|
178
|
-
"@types/react":
|
|
179
|
-
"babel-jest":
|
|
180
|
-
"crypto-js":
|
|
181
|
-
"dotenv":
|
|
182
|
-
"fs-extra":
|
|
183
|
-
"google-ads-api":
|
|
184
|
-
"googleapis-common":
|
|
185
|
-
"jest":
|
|
186
|
-
"next":
|
|
187
|
-
"node-fetch":
|
|
188
|
-
"react":
|
|
189
|
-
"react-intersection-observer":
|
|
190
|
-
"stream-chain":
|
|
191
|
-
"stream-json":
|
|
192
|
-
"swr":
|
|
193
|
-
"ts-node":
|
|
194
|
-
"tslib":
|
|
195
|
-
"typescript":
|
|
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
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
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
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
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
|
-
|
|
67
|
-
|
|
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
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
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(`
|
|
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;
|
package/prisma/getDecimal.js
CHANGED
|
@@ -1,23 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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 ((
|
|
9
|
+
if (isArray(input?.d)) {
|
|
16
10
|
numberString = input.absoluteValue();
|
|
17
11
|
}
|
|
18
12
|
else {
|
|
19
13
|
numberString = input.toString();
|
|
20
14
|
}
|
|
21
|
-
return (
|
|
15
|
+
return getNumberDecimal(numberString, dp);
|
|
22
16
|
};
|
|
23
|
-
exports.getDecimal = getDecimal;
|
package/prisma/server.js
CHANGED
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
|
|
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
|
|
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
|
-
|
|
31
|
-
var getDecimal_1 = require("./getDecimal");
|
|
32
|
-
Object.defineProperty(exports, "getDecimal", { enumerable: true, get: function () { return getDecimal_1.getDecimal; } });
|
|
27
|
+
export { getDecimal } from "./getDecimal";
|