@8ms/helpers 1.13.0 → 1.15.0
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/date/format.d.ts +3 -3
- package/date/format.js +3 -3
- package/package.json +40 -41
- package/prisma/initClient.d.ts +6 -0
- package/prisma/initClient.js +7 -2
package/date/format.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { DateType } from
|
|
2
|
-
import { GetMidnight } from
|
|
3
|
-
import { GetTimeZoned } from
|
|
1
|
+
import { DateType } from "./date";
|
|
2
|
+
import { GetMidnight } from "./getMidnight";
|
|
3
|
+
import { GetTimeZoned } from "./getTimeZoned";
|
|
4
4
|
type Format = GetTimeZoned & GetMidnight & {
|
|
5
5
|
dateFormat?: string;
|
|
6
6
|
input: DateType;
|
package/date/format.js
CHANGED
|
@@ -12,9 +12,9 @@ const getDate_1 = __importDefault(require("./getDate"));
|
|
|
12
12
|
const format = (props) => {
|
|
13
13
|
const dateInstance = (0, getDate_1.default)({
|
|
14
14
|
input: props.input,
|
|
15
|
-
setMidnight: props?.setMidnight
|
|
16
|
-
setTimeZone: props?.setTimeZone
|
|
15
|
+
setMidnight: props?.setMidnight,
|
|
16
|
+
setTimeZone: props?.setTimeZone,
|
|
17
17
|
});
|
|
18
|
-
return (0, date_fns_1.format)(dateInstance, props?.dateFormat ||
|
|
18
|
+
return (0, date_fns_1.format)(dateInstance, props?.dateFormat || "yyyy-MM-dd");
|
|
19
19
|
};
|
|
20
20
|
exports.default = format;
|
package/package.json
CHANGED
|
@@ -1,52 +1,51 @@
|
|
|
1
1
|
{
|
|
2
|
-
"name":
|
|
3
|
-
"license":
|
|
4
|
-
"version":
|
|
5
|
-
"repository":
|
|
2
|
+
"name": "@8ms/helpers",
|
|
3
|
+
"license": "UNLICENSED",
|
|
4
|
+
"version": "1.15.0",
|
|
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
|
-
"dependencies":
|
|
16
|
-
"axios":
|
|
17
|
-
"crypto-js":
|
|
18
|
-
"date-fns":
|
|
15
|
+
"dependencies": {
|
|
16
|
+
"axios": "1.6.8",
|
|
17
|
+
"crypto-js": "4.2.0",
|
|
18
|
+
"date-fns": "3.6.0",
|
|
19
19
|
"date-fns-tz": "3.1.3",
|
|
20
|
-
"lodash":
|
|
21
|
-
"zod":
|
|
20
|
+
"lodash": "4.17.21",
|
|
21
|
+
"zod": "3.23.5"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
|
-
"@aws-sdk/client-s3":
|
|
25
|
-
"@aws-sdk/client-ses":
|
|
26
|
-
"@aws-sdk/client-sqs":
|
|
27
|
-
"@aws-sdk/client-ssm":
|
|
28
|
-
"@aws-sdk/lib-storage":
|
|
24
|
+
"@aws-sdk/client-s3": "3.567.0",
|
|
25
|
+
"@aws-sdk/client-ses": "3.567.0",
|
|
26
|
+
"@aws-sdk/client-sqs": "3.567.0",
|
|
27
|
+
"@aws-sdk/client-ssm": "3.567.0",
|
|
28
|
+
"@aws-sdk/lib-storage": "3.567.0",
|
|
29
29
|
"@aws-sdk/s3-request-presigner": "3.567.0",
|
|
30
|
-
"@babel/preset-env":
|
|
31
|
-
"@babel/preset-flow":
|
|
32
|
-
"@babel/preset-typescript":
|
|
33
|
-
"@google-cloud/bigquery":
|
|
34
|
-
"@google-cloud/storage":
|
|
35
|
-
"@planetscale/database":
|
|
36
|
-
"@prisma/adapter-planetscale":
|
|
37
|
-
"@prisma/client":
|
|
38
|
-
"@types/jest":
|
|
39
|
-
"@types/lodash":
|
|
40
|
-
"@types/node":
|
|
41
|
-
"babel-jest":
|
|
42
|
-
"jest":
|
|
43
|
-
"node-fetch":
|
|
44
|
-
"stream-chain":
|
|
45
|
-
"stream-json":
|
|
46
|
-
"timezone-mock":
|
|
47
|
-
"ts-node":
|
|
48
|
-
"tslib":
|
|
49
|
-
"typescript":
|
|
50
|
-
"undici": "^6.16.1"
|
|
30
|
+
"@babel/preset-env": "7.24.5",
|
|
31
|
+
"@babel/preset-flow": "7.24.1",
|
|
32
|
+
"@babel/preset-typescript": "7.24.1",
|
|
33
|
+
"@google-cloud/bigquery": "7.6.1",
|
|
34
|
+
"@google-cloud/storage": "7.10.2",
|
|
35
|
+
"@planetscale/database": "1.18.0",
|
|
36
|
+
"@prisma/adapter-planetscale": "5.14.0",
|
|
37
|
+
"@prisma/client": "5.13.0",
|
|
38
|
+
"@types/jest": "29.5.12",
|
|
39
|
+
"@types/lodash": "4.17.0",
|
|
40
|
+
"@types/node": "20.12.8",
|
|
41
|
+
"babel-jest": "29.7.0",
|
|
42
|
+
"jest": "29.7.0",
|
|
43
|
+
"node-fetch": "3.3.2",
|
|
44
|
+
"stream-chain": "2.2.5",
|
|
45
|
+
"stream-json": "1.8.0",
|
|
46
|
+
"timezone-mock": "1.3.6",
|
|
47
|
+
"ts-node": "10.9.2",
|
|
48
|
+
"tslib": "2.6.2",
|
|
49
|
+
"typescript": "5.4.5"
|
|
51
50
|
}
|
|
52
51
|
}
|
package/prisma/initClient.d.ts
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Prevent too many connections
|
|
3
|
+
* https://github.com/prisma/prisma/issues/1983#issuecomment-620621213
|
|
4
|
+
* https://next-auth.js.org/schemas/adapters
|
|
5
|
+
* Library: @prisma/client, prisma-query-log
|
|
6
|
+
*/
|
|
1
7
|
declare const initClient: ({ debug }?: {
|
|
2
8
|
debug?: boolean;
|
|
3
9
|
}) => void;
|
package/prisma/initClient.js
CHANGED
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Prevent too many connections
|
|
4
|
+
* https://github.com/prisma/prisma/issues/1983#issuecomment-620621213
|
|
5
|
+
* https://next-auth.js.org/schemas/adapters
|
|
6
|
+
* Library: @prisma/client, prisma-query-log
|
|
7
|
+
*/
|
|
2
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
9
|
global.prisma = null;
|
|
4
10
|
const initClient = ({ debug } = { debug: false }) => {
|
|
@@ -6,9 +12,8 @@ const initClient = ({ debug } = { debug: false }) => {
|
|
|
6
12
|
const { Client } = require("@planetscale/database");
|
|
7
13
|
const { PrismaClient } = require("@prisma/client");
|
|
8
14
|
const { PrismaPlanetScale } = require("@prisma/adapter-planetscale");
|
|
9
|
-
const { fetch: undiciFetch } = require("undici");
|
|
10
15
|
const client = new Client({
|
|
11
|
-
url: process.env.DATABASE_URL
|
|
16
|
+
url: process.env.DATABASE_URL
|
|
12
17
|
});
|
|
13
18
|
const adapter = new PrismaPlanetScale(client);
|
|
14
19
|
// Show the full query if debugging
|