@8ms/helpers 3.0.8 → 3.0.10
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/dist/_virtual/_rolldown/runtime.cjs +0 -2
- package/dist/_virtual/_rolldown/runtime.mjs +1 -22
- package/dist/aws/s3/server/AwsS3.cjs +2 -2
- package/dist/aws/s3/server/AwsS3.mjs +2 -2
- package/dist/aws/ses/server/SimpleEmail.cjs +12 -9
- package/dist/aws/ses/server/SimpleEmail.d.cts +3 -31
- package/dist/aws/ses/server/SimpleEmail.d.mts +3 -31
- package/dist/aws/ses/server/SimpleEmail.mjs +12 -9
- package/dist/emsApi/awsTs/get.cjs +1 -1
- package/dist/emsApi/awsTs/get.d.cts +1 -1
- package/dist/emsApi/awsTs/get.d.mts +1 -1
- package/dist/emsApi/awsTs/get.mjs +1 -1
- package/dist/emsApi/vercel/get.cjs +1 -1
- package/dist/emsApi/vercel/get.d.cts +1 -1
- package/dist/emsApi/vercel/get.d.mts +1 -1
- package/dist/emsApi/vercel/get.mjs +1 -1
- package/dist/prisma/server/{PrismaNamespace.cjs → Prisma.cjs} +18 -12
- package/dist/prisma/server/{prisma.d.mts → Prisma.d.cts} +15 -11
- package/dist/prisma/server/{prisma.d.cts → Prisma.d.mts} +15 -11
- package/dist/prisma/server/{PrismaNamespace.mjs → Prisma.mjs} +18 -12
- package/dist/prisma/server/index.cjs +2 -4
- package/dist/prisma/server/index.d.cts +2 -3
- package/dist/prisma/server/index.d.mts +2 -3
- package/dist/prisma/server/index.mjs +2 -3
- package/package.json +5 -16
- package/dist/node_modules/data-uri-to-buffer/dist/index.cjs +0 -37
- package/dist/node_modules/data-uri-to-buffer/dist/index.mjs +0 -37
- package/dist/node_modules/fetch-blob/file.cjs +0 -31
- package/dist/node_modules/fetch-blob/file.mjs +0 -31
- package/dist/node_modules/fetch-blob/from.cjs +0 -8
- package/dist/node_modules/fetch-blob/from.mjs +0 -9
- package/dist/node_modules/fetch-blob/index.cjs +0 -171
- package/dist/node_modules/fetch-blob/index.mjs +0 -172
- package/dist/node_modules/fetch-blob/streams.cjs +0 -45
- package/dist/node_modules/fetch-blob/streams.mjs +0 -41
- package/dist/node_modules/formdata-polyfill/esm.min.cjs +0 -83
- package/dist/node_modules/formdata-polyfill/esm.min.mjs +0 -82
- package/dist/node_modules/node-domexception/index.cjs +0 -18
- package/dist/node_modules/node-domexception/index.mjs +0 -15
- package/dist/node_modules/web-streams-polyfill/dist/ponyfill.es2018.cjs +0 -3499
- package/dist/node_modules/web-streams-polyfill/dist/ponyfill.es2018.mjs +0 -3496
- package/dist/prisma/server/PrismaNamespace.d.cts +0 -11
- package/dist/prisma/server/PrismaNamespace.d.mts +0 -11
- package/dist/prisma/server/prisma.cjs +0 -21
- package/dist/prisma/server/prisma.mjs +0 -20
|
@@ -5,7 +5,6 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
5
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
6
|
var __getProtoOf = Object.getPrototypeOf;
|
|
7
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
|
|
9
8
|
var __copyProps = (to, from, except, desc) => {
|
|
10
9
|
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
11
10
|
key = keys[i];
|
|
@@ -21,5 +20,4 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
21
20
|
enumerable: true
|
|
22
21
|
}) : target, mod));
|
|
23
22
|
//#endregion
|
|
24
|
-
exports.__commonJSMin = __commonJSMin;
|
|
25
23
|
exports.__toESM = __toESM;
|
|
@@ -1,26 +1,5 @@
|
|
|
1
1
|
import { createRequire } from "node:module";
|
|
2
2
|
//#region \0rolldown/runtime.js
|
|
3
|
-
var __create = Object.create;
|
|
4
|
-
var __defProp = Object.defineProperty;
|
|
5
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
8
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
-
var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
12
|
-
key = keys[i];
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
14
|
-
get: ((k) => from[k]).bind(null, key),
|
|
15
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
16
|
-
});
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
21
|
-
value: mod,
|
|
22
|
-
enumerable: true
|
|
23
|
-
}) : target, mod));
|
|
24
3
|
var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
25
4
|
//#endregion
|
|
26
|
-
export {
|
|
5
|
+
export { __require };
|
|
@@ -7,12 +7,12 @@ require("../../../date/index.cjs");
|
|
|
7
7
|
const require_string_getFolder = require("../../../string/getFolder.cjs");
|
|
8
8
|
const require_string_getStringFromStream = require("../../../string/getStringFromStream.cjs");
|
|
9
9
|
require("../../../string/index.cjs");
|
|
10
|
-
const require_aws_server_isResponse200 = require("../../server/isResponse200.cjs");
|
|
11
|
-
require("../../server/index.cjs");
|
|
12
10
|
const require_util_server_getBrotliCompressed = require("../../../util/server/getBrotliCompressed.cjs");
|
|
13
11
|
const require_util_server_getBrotliDecompressed = require("../../../util/server/getBrotliDecompressed.cjs");
|
|
14
12
|
const require_util_server_getGzipCompressed = require("../../../util/server/getGzipCompressed.cjs");
|
|
15
13
|
const require_util_server_getGzipDecompressed = require("../../../util/server/getGzipDecompressed.cjs");
|
|
14
|
+
const require_aws_server_isResponse200 = require("../../server/isResponse200.cjs");
|
|
15
|
+
require("../../server/index.cjs");
|
|
16
16
|
const require_aws_s3_server_awsS3File = require("./awsS3File.cjs");
|
|
17
17
|
require("./index.cjs");
|
|
18
18
|
let ky = require("ky");
|
|
@@ -5,12 +5,12 @@ import "../../../date/index.mjs";
|
|
|
5
5
|
import { getFolder } from "../../../string/getFolder.mjs";
|
|
6
6
|
import { getStringFromStream } from "../../../string/getStringFromStream.mjs";
|
|
7
7
|
import "../../../string/index.mjs";
|
|
8
|
-
import { isResponse200 } from "../../server/isResponse200.mjs";
|
|
9
|
-
import "../../server/index.mjs";
|
|
10
8
|
import { getBrotliCompressed } from "../../../util/server/getBrotliCompressed.mjs";
|
|
11
9
|
import { getBrotliDecompressed } from "../../../util/server/getBrotliDecompressed.mjs";
|
|
12
10
|
import { getGzipCompressed } from "../../../util/server/getGzipCompressed.mjs";
|
|
13
11
|
import { getGzipDecompressed } from "../../../util/server/getGzipDecompressed.mjs";
|
|
12
|
+
import { isResponse200 } from "../../server/isResponse200.mjs";
|
|
13
|
+
import "../../server/index.mjs";
|
|
14
14
|
import { readFileDefault } from "./awsS3File.mjs";
|
|
15
15
|
import "./index.mjs";
|
|
16
16
|
import ky from "ky";
|
|
@@ -39,7 +39,7 @@ var SimpleEmail = class extends require__class_BaseClass.BaseClass {
|
|
|
39
39
|
this.attachments.push(attachment);
|
|
40
40
|
return this;
|
|
41
41
|
};
|
|
42
|
-
|
|
42
|
+
addAttachmentFromData = (filename, data, contentType) => {
|
|
43
43
|
return this.addAttachment({
|
|
44
44
|
filename,
|
|
45
45
|
data,
|
|
@@ -87,19 +87,19 @@ var SimpleEmail = class extends require__class_BaseClass.BaseClass {
|
|
|
87
87
|
Body: {
|
|
88
88
|
Html: {
|
|
89
89
|
Charset: "UTF-8",
|
|
90
|
-
Data: this.html
|
|
90
|
+
Data: this.html ?? ""
|
|
91
91
|
},
|
|
92
92
|
Text: {
|
|
93
93
|
Charset: "UTF-8",
|
|
94
|
-
Data: this.html
|
|
94
|
+
Data: this.html ?? ""
|
|
95
95
|
}
|
|
96
96
|
},
|
|
97
97
|
Subject: {
|
|
98
98
|
Charset: "UTF-8",
|
|
99
|
-
Data: this.subject
|
|
99
|
+
Data: this.subject ?? ""
|
|
100
100
|
}
|
|
101
101
|
},
|
|
102
|
-
Source: this.from
|
|
102
|
+
Source: this.from ?? ""
|
|
103
103
|
};
|
|
104
104
|
};
|
|
105
105
|
_getRawEmailParams = async () => {
|
|
@@ -138,8 +138,8 @@ var SimpleEmail = class extends require__class_BaseClass.BaseClass {
|
|
|
138
138
|
rawMessage += `--${boundary}--\r\n`;
|
|
139
139
|
return {
|
|
140
140
|
Destinations: allRecipients,
|
|
141
|
-
RawMessage: { Data: rawMessage },
|
|
142
|
-
Source: this.from
|
|
141
|
+
RawMessage: { Data: Buffer.from(rawMessage) },
|
|
142
|
+
Source: this.from ?? ""
|
|
143
143
|
};
|
|
144
144
|
};
|
|
145
145
|
_isTextFile = (contentType) => {
|
|
@@ -158,7 +158,7 @@ var SimpleEmail = class extends require__class_BaseClass.BaseClass {
|
|
|
158
158
|
if (this._isBase64(base64Data)) return Buffer.from(base64Data, "base64").toString("utf-8");
|
|
159
159
|
return attachment.data;
|
|
160
160
|
}
|
|
161
|
-
if (attachment.url) return await (await
|
|
161
|
+
if (attachment.url) return await (await fetch(attachment.url)).text();
|
|
162
162
|
throw new Error(`No valid data source provided for attachment: ${attachment.filename}`);
|
|
163
163
|
};
|
|
164
164
|
_getAttachmentData = async (attachment) => {
|
|
@@ -167,7 +167,10 @@ var SimpleEmail = class extends require__class_BaseClass.BaseClass {
|
|
|
167
167
|
if (this._isBase64(cleanData)) return cleanData;
|
|
168
168
|
return Buffer.from(attachment.data, "utf-8").toString("base64");
|
|
169
169
|
}
|
|
170
|
-
if (attachment.url)
|
|
170
|
+
if (attachment.url) {
|
|
171
|
+
const blobBytes = await (await fetch(attachment.url)).bytes();
|
|
172
|
+
return Buffer.from(blobBytes).toString("base64");
|
|
173
|
+
}
|
|
171
174
|
throw new Error(`No valid data source provided for attachment: ${attachment.filename}`);
|
|
172
175
|
};
|
|
173
176
|
_isBase64 = (str) => {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { BaseClass } from "../../../_class/BaseClass.cjs";
|
|
2
|
+
import { SendEmailCommandInput, SendRawEmailCommandInput } from "@aws-sdk/client-ses";
|
|
2
3
|
|
|
3
4
|
//#region src/aws/ses/server/SimpleEmail.d.ts
|
|
4
5
|
type AttachmentSource = {
|
|
@@ -41,7 +42,7 @@ declare class SimpleEmail extends BaseClass {
|
|
|
41
42
|
setSubject: (subject: string) => this;
|
|
42
43
|
setAttachments: (attachments: AttachmentSource[]) => this;
|
|
43
44
|
addAttachment: (attachment: AttachmentSource) => this;
|
|
44
|
-
|
|
45
|
+
addAttachmentFromData: (filename: string, data: string, contentType?: string) => this;
|
|
45
46
|
addAttachmentFromUrl: (filename: string, url: string, contentType?: string) => this;
|
|
46
47
|
clearAttachments: () => this;
|
|
47
48
|
pushBcc: (recipient: string | string[]) => this;
|
|
@@ -50,36 +51,7 @@ declare class SimpleEmail extends BaseClass {
|
|
|
50
51
|
setBcc: (recipient: string | string[]) => this;
|
|
51
52
|
setCc: (recipient: string | string[]) => this;
|
|
52
53
|
setTo: (recipient: string | string[]) => this;
|
|
53
|
-
getSendParam: () => Promise<
|
|
54
|
-
Destinations: string[];
|
|
55
|
-
RawMessage: {
|
|
56
|
-
Data: string;
|
|
57
|
-
};
|
|
58
|
-
Source: string | undefined;
|
|
59
|
-
} | {
|
|
60
|
-
Destination: {
|
|
61
|
-
BccAddresses: string[];
|
|
62
|
-
CcAddresses: string[];
|
|
63
|
-
ToAddresses: string[];
|
|
64
|
-
};
|
|
65
|
-
Message: {
|
|
66
|
-
Body: {
|
|
67
|
-
Html: {
|
|
68
|
-
Charset: string;
|
|
69
|
-
Data: string | undefined;
|
|
70
|
-
};
|
|
71
|
-
Text: {
|
|
72
|
-
Charset: string;
|
|
73
|
-
Data: string | undefined;
|
|
74
|
-
};
|
|
75
|
-
};
|
|
76
|
-
Subject: {
|
|
77
|
-
Charset: string;
|
|
78
|
-
Data: string | undefined;
|
|
79
|
-
};
|
|
80
|
-
};
|
|
81
|
-
Source: string | undefined;
|
|
82
|
-
}>;
|
|
54
|
+
getSendParam: () => Promise<SendEmailCommandInput | SendRawEmailCommandInput>;
|
|
83
55
|
private _getRawEmailParams;
|
|
84
56
|
private _isTextFile;
|
|
85
57
|
private _getAttachmentTextData;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { BaseClass } from "../../../_class/BaseClass.mjs";
|
|
2
|
+
import { SendEmailCommandInput, SendRawEmailCommandInput } from "@aws-sdk/client-ses";
|
|
2
3
|
|
|
3
4
|
//#region src/aws/ses/server/SimpleEmail.d.ts
|
|
4
5
|
type AttachmentSource = {
|
|
@@ -41,7 +42,7 @@ declare class SimpleEmail extends BaseClass {
|
|
|
41
42
|
setSubject: (subject: string) => this;
|
|
42
43
|
setAttachments: (attachments: AttachmentSource[]) => this;
|
|
43
44
|
addAttachment: (attachment: AttachmentSource) => this;
|
|
44
|
-
|
|
45
|
+
addAttachmentFromData: (filename: string, data: string, contentType?: string) => this;
|
|
45
46
|
addAttachmentFromUrl: (filename: string, url: string, contentType?: string) => this;
|
|
46
47
|
clearAttachments: () => this;
|
|
47
48
|
pushBcc: (recipient: string | string[]) => this;
|
|
@@ -50,36 +51,7 @@ declare class SimpleEmail extends BaseClass {
|
|
|
50
51
|
setBcc: (recipient: string | string[]) => this;
|
|
51
52
|
setCc: (recipient: string | string[]) => this;
|
|
52
53
|
setTo: (recipient: string | string[]) => this;
|
|
53
|
-
getSendParam: () => Promise<
|
|
54
|
-
Destinations: string[];
|
|
55
|
-
RawMessage: {
|
|
56
|
-
Data: string;
|
|
57
|
-
};
|
|
58
|
-
Source: string | undefined;
|
|
59
|
-
} | {
|
|
60
|
-
Destination: {
|
|
61
|
-
BccAddresses: string[];
|
|
62
|
-
CcAddresses: string[];
|
|
63
|
-
ToAddresses: string[];
|
|
64
|
-
};
|
|
65
|
-
Message: {
|
|
66
|
-
Body: {
|
|
67
|
-
Html: {
|
|
68
|
-
Charset: string;
|
|
69
|
-
Data: string | undefined;
|
|
70
|
-
};
|
|
71
|
-
Text: {
|
|
72
|
-
Charset: string;
|
|
73
|
-
Data: string | undefined;
|
|
74
|
-
};
|
|
75
|
-
};
|
|
76
|
-
Subject: {
|
|
77
|
-
Charset: string;
|
|
78
|
-
Data: string | undefined;
|
|
79
|
-
};
|
|
80
|
-
};
|
|
81
|
-
Source: string | undefined;
|
|
82
|
-
}>;
|
|
54
|
+
getSendParam: () => Promise<SendEmailCommandInput | SendRawEmailCommandInput>;
|
|
83
55
|
private _getRawEmailParams;
|
|
84
56
|
private _isTextFile;
|
|
85
57
|
private _getAttachmentTextData;
|
|
@@ -38,7 +38,7 @@ var SimpleEmail = class extends BaseClass {
|
|
|
38
38
|
this.attachments.push(attachment);
|
|
39
39
|
return this;
|
|
40
40
|
};
|
|
41
|
-
|
|
41
|
+
addAttachmentFromData = (filename, data, contentType) => {
|
|
42
42
|
return this.addAttachment({
|
|
43
43
|
filename,
|
|
44
44
|
data,
|
|
@@ -86,19 +86,19 @@ var SimpleEmail = class extends BaseClass {
|
|
|
86
86
|
Body: {
|
|
87
87
|
Html: {
|
|
88
88
|
Charset: "UTF-8",
|
|
89
|
-
Data: this.html
|
|
89
|
+
Data: this.html ?? ""
|
|
90
90
|
},
|
|
91
91
|
Text: {
|
|
92
92
|
Charset: "UTF-8",
|
|
93
|
-
Data: this.html
|
|
93
|
+
Data: this.html ?? ""
|
|
94
94
|
}
|
|
95
95
|
},
|
|
96
96
|
Subject: {
|
|
97
97
|
Charset: "UTF-8",
|
|
98
|
-
Data: this.subject
|
|
98
|
+
Data: this.subject ?? ""
|
|
99
99
|
}
|
|
100
100
|
},
|
|
101
|
-
Source: this.from
|
|
101
|
+
Source: this.from ?? ""
|
|
102
102
|
};
|
|
103
103
|
};
|
|
104
104
|
_getRawEmailParams = async () => {
|
|
@@ -137,8 +137,8 @@ var SimpleEmail = class extends BaseClass {
|
|
|
137
137
|
rawMessage += `--${boundary}--\r\n`;
|
|
138
138
|
return {
|
|
139
139
|
Destinations: allRecipients,
|
|
140
|
-
RawMessage: { Data: rawMessage },
|
|
141
|
-
Source: this.from
|
|
140
|
+
RawMessage: { Data: Buffer.from(rawMessage) },
|
|
141
|
+
Source: this.from ?? ""
|
|
142
142
|
};
|
|
143
143
|
};
|
|
144
144
|
_isTextFile = (contentType) => {
|
|
@@ -157,7 +157,7 @@ var SimpleEmail = class extends BaseClass {
|
|
|
157
157
|
if (this._isBase64(base64Data)) return Buffer.from(base64Data, "base64").toString("utf-8");
|
|
158
158
|
return attachment.data;
|
|
159
159
|
}
|
|
160
|
-
if (attachment.url) return await (await
|
|
160
|
+
if (attachment.url) return await (await fetch(attachment.url)).text();
|
|
161
161
|
throw new Error(`No valid data source provided for attachment: ${attachment.filename}`);
|
|
162
162
|
};
|
|
163
163
|
_getAttachmentData = async (attachment) => {
|
|
@@ -166,7 +166,10 @@ var SimpleEmail = class extends BaseClass {
|
|
|
166
166
|
if (this._isBase64(cleanData)) return cleanData;
|
|
167
167
|
return Buffer.from(attachment.data, "utf-8").toString("base64");
|
|
168
168
|
}
|
|
169
|
-
if (attachment.url)
|
|
169
|
+
if (attachment.url) {
|
|
170
|
+
const blobBytes = await (await fetch(attachment.url)).bytes();
|
|
171
|
+
return Buffer.from(blobBytes).toString("base64");
|
|
172
|
+
}
|
|
170
173
|
throw new Error(`No valid data source provided for attachment: ${attachment.filename}`);
|
|
171
174
|
};
|
|
172
175
|
_isBase64 = (str) => {
|
|
@@ -2,7 +2,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
2
2
|
const require_api_get = require("../../api/get.cjs");
|
|
3
3
|
const require_emsApi_awsTs_endpoint = require("./endpoint.cjs");
|
|
4
4
|
//#region src/emsApi/awsTs/get.ts
|
|
5
|
-
const getAwsTs = async (path,
|
|
5
|
+
const getAwsTs = async (path, config = {}) => {
|
|
6
6
|
return require_api_get.get(`${require_emsApi_awsTs_endpoint.getAwsTsEndpoint()}${path}`, {
|
|
7
7
|
...config,
|
|
8
8
|
headers: {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ApiResponseClass } from "../../api/ApiResponseClass.cjs";
|
|
2
2
|
import { Config } from "../../api/config.cjs";
|
|
3
3
|
//#region src/emsApi/awsTs/get.d.ts
|
|
4
|
-
declare const getAwsTs: (path: string,
|
|
4
|
+
declare const getAwsTs: (path: string, config?: Config) => Promise<ApiResponseClass<any, any>>;
|
|
5
5
|
//#endregion
|
|
6
6
|
export { getAwsTs };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ApiResponseClass } from "../../api/ApiResponseClass.mjs";
|
|
2
2
|
import { Config } from "../../api/config.mjs";
|
|
3
3
|
//#region src/emsApi/awsTs/get.d.ts
|
|
4
|
-
declare const getAwsTs: (path: string,
|
|
4
|
+
declare const getAwsTs: (path: string, config?: Config) => Promise<ApiResponseClass<any, any>>;
|
|
5
5
|
//#endregion
|
|
6
6
|
export { getAwsTs };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { get } from "../../api/get.mjs";
|
|
2
2
|
import { getAwsTsEndpoint } from "./endpoint.mjs";
|
|
3
3
|
//#region src/emsApi/awsTs/get.ts
|
|
4
|
-
const getAwsTs = async (path,
|
|
4
|
+
const getAwsTs = async (path, config = {}) => {
|
|
5
5
|
return get(`${getAwsTsEndpoint()}${path}`, {
|
|
6
6
|
...config,
|
|
7
7
|
headers: {
|
|
@@ -2,7 +2,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
2
2
|
const require_api_get = require("../../api/get.cjs");
|
|
3
3
|
const require_emsApi_vercel_endpoint = require("./endpoint.cjs");
|
|
4
4
|
//#region src/emsApi/vercel/get.ts
|
|
5
|
-
const getVercel = async (path,
|
|
5
|
+
const getVercel = async (path, config = {}) => {
|
|
6
6
|
return require_api_get.get(`${require_emsApi_vercel_endpoint.getVercelEndpoint()}${path}`, {
|
|
7
7
|
...config,
|
|
8
8
|
headers: {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ApiResponseClass } from "../../api/ApiResponseClass.cjs";
|
|
2
2
|
import { Config } from "../../api/config.cjs";
|
|
3
3
|
//#region src/emsApi/vercel/get.d.ts
|
|
4
|
-
declare const getVercel: (path: string,
|
|
4
|
+
declare const getVercel: (path: string, config?: Config) => Promise<ApiResponseClass<any, any>>;
|
|
5
5
|
//#endregion
|
|
6
6
|
export { getVercel };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ApiResponseClass } from "../../api/ApiResponseClass.mjs";
|
|
2
2
|
import { Config } from "../../api/config.mjs";
|
|
3
3
|
//#region src/emsApi/vercel/get.d.ts
|
|
4
|
-
declare const getVercel: (path: string,
|
|
4
|
+
declare const getVercel: (path: string, config?: Config) => Promise<ApiResponseClass<any, any>>;
|
|
5
5
|
//#endregion
|
|
6
6
|
export { getVercel };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { get } from "../../api/get.mjs";
|
|
2
2
|
import { getVercelEndpoint } from "./endpoint.mjs";
|
|
3
3
|
//#region src/emsApi/vercel/get.ts
|
|
4
|
-
const getVercel = async (path,
|
|
4
|
+
const getVercel = async (path, config = {}) => {
|
|
5
5
|
return get(`${getVercelEndpoint()}${path}`, {
|
|
6
6
|
...config,
|
|
7
7
|
headers: {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_util_getError = require("../../util/getError.cjs");
|
|
3
3
|
const require__class_BaseNamespace = require("../../_class/BaseNamespace.cjs");
|
|
4
|
-
//#region src/prisma/server/
|
|
5
|
-
var
|
|
6
|
-
|
|
4
|
+
//#region src/prisma/server/Prisma.ts
|
|
5
|
+
var Prisma = class extends require__class_BaseNamespace.BaseNamespace {
|
|
6
|
+
init = async (config) => {
|
|
7
7
|
if (!this.client) {
|
|
8
8
|
let adapter = null;
|
|
9
9
|
if (this.config.isPlanetScale) try {
|
|
@@ -26,19 +26,25 @@ var PrismaNamespace = class extends require__class_BaseNamespace.BaseNamespace {
|
|
|
26
26
|
}
|
|
27
27
|
try {
|
|
28
28
|
const { PrismaClient } = await import("@prisma/client");
|
|
29
|
-
if (this.config.isDebug)
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
29
|
+
if (this.config.isDebug) {
|
|
30
|
+
this.client = new PrismaClient({
|
|
31
|
+
adapter,
|
|
32
|
+
log: [{
|
|
33
|
+
emit: "event",
|
|
34
|
+
level: "query"
|
|
35
|
+
}]
|
|
36
|
+
});
|
|
37
|
+
this.config = config;
|
|
38
|
+
} else {
|
|
39
|
+
this.client = new PrismaClient({ adapter });
|
|
40
|
+
this.config = config;
|
|
41
|
+
}
|
|
37
42
|
} catch (e) {
|
|
38
43
|
throw new Error(`Prisma Client not installed - ${require_util_getError.getError(e)}`);
|
|
39
44
|
}
|
|
40
45
|
}
|
|
46
|
+
return this;
|
|
41
47
|
};
|
|
42
48
|
};
|
|
43
49
|
//#endregion
|
|
44
|
-
exports.
|
|
50
|
+
exports.Prisma = Prisma;
|
|
@@ -1,13 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { BaseNamespace } from "../../_class/BaseNamespace.cjs";
|
|
2
2
|
|
|
3
|
-
//#region src/prisma/server/
|
|
4
|
-
type PrismaConfig = {
|
|
5
|
-
url: string;
|
|
6
|
-
isDebug: boolean;
|
|
7
|
-
isPlanetScale: boolean;
|
|
8
|
-
isMysql: boolean;
|
|
9
|
-
isPostgres: boolean;
|
|
10
|
-
};
|
|
3
|
+
//#region src/prisma/server/Prisma.d.ts
|
|
11
4
|
/**
|
|
12
5
|
* Minimal interface representing a Prisma Client instance.
|
|
13
6
|
* Consumers of this library will have their own generated PrismaClient
|
|
@@ -19,6 +12,17 @@ interface PrismaClientLike {
|
|
|
19
12
|
$transaction(...args: any[]): Promise<any>;
|
|
20
13
|
[key: string]: any;
|
|
21
14
|
}
|
|
22
|
-
|
|
15
|
+
type PrismaConfig = {
|
|
16
|
+
isDebug: boolean;
|
|
17
|
+
isPlanetScale: boolean;
|
|
18
|
+
isMysql: boolean;
|
|
19
|
+
isPostgres: boolean;
|
|
20
|
+
url: string;
|
|
21
|
+
};
|
|
22
|
+
declare class Prisma extends BaseNamespace {
|
|
23
|
+
client: PrismaClientLike;
|
|
24
|
+
config: PrismaConfig;
|
|
25
|
+
init: (config: PrismaConfig) => Promise<this>;
|
|
26
|
+
}
|
|
23
27
|
//#endregion
|
|
24
|
-
export {
|
|
28
|
+
export { Prisma, PrismaClientLike };
|
|
@@ -1,13 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { BaseNamespace } from "../../_class/BaseNamespace.mjs";
|
|
2
2
|
|
|
3
|
-
//#region src/prisma/server/
|
|
4
|
-
type PrismaConfig = {
|
|
5
|
-
url: string;
|
|
6
|
-
isDebug: boolean;
|
|
7
|
-
isPlanetScale: boolean;
|
|
8
|
-
isMysql: boolean;
|
|
9
|
-
isPostgres: boolean;
|
|
10
|
-
};
|
|
3
|
+
//#region src/prisma/server/Prisma.d.ts
|
|
11
4
|
/**
|
|
12
5
|
* Minimal interface representing a Prisma Client instance.
|
|
13
6
|
* Consumers of this library will have their own generated PrismaClient
|
|
@@ -19,6 +12,17 @@ interface PrismaClientLike {
|
|
|
19
12
|
$transaction(...args: any[]): Promise<any>;
|
|
20
13
|
[key: string]: any;
|
|
21
14
|
}
|
|
22
|
-
|
|
15
|
+
type PrismaConfig = {
|
|
16
|
+
isDebug: boolean;
|
|
17
|
+
isPlanetScale: boolean;
|
|
18
|
+
isMysql: boolean;
|
|
19
|
+
isPostgres: boolean;
|
|
20
|
+
url: string;
|
|
21
|
+
};
|
|
22
|
+
declare class Prisma extends BaseNamespace {
|
|
23
|
+
client: PrismaClientLike;
|
|
24
|
+
config: PrismaConfig;
|
|
25
|
+
init: (config: PrismaConfig) => Promise<this>;
|
|
26
|
+
}
|
|
23
27
|
//#endregion
|
|
24
|
-
export {
|
|
28
|
+
export { Prisma, PrismaClientLike };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { getError } from "../../util/getError.mjs";
|
|
2
2
|
import { BaseNamespace } from "../../_class/BaseNamespace.mjs";
|
|
3
|
-
//#region src/prisma/server/
|
|
4
|
-
var
|
|
5
|
-
|
|
3
|
+
//#region src/prisma/server/Prisma.ts
|
|
4
|
+
var Prisma = class extends BaseNamespace {
|
|
5
|
+
init = async (config) => {
|
|
6
6
|
if (!this.client) {
|
|
7
7
|
let adapter = null;
|
|
8
8
|
if (this.config.isPlanetScale) try {
|
|
@@ -25,19 +25,25 @@ var PrismaNamespace = class extends BaseNamespace {
|
|
|
25
25
|
}
|
|
26
26
|
try {
|
|
27
27
|
const { PrismaClient } = await import("@prisma/client");
|
|
28
|
-
if (this.config.isDebug)
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
28
|
+
if (this.config.isDebug) {
|
|
29
|
+
this.client = new PrismaClient({
|
|
30
|
+
adapter,
|
|
31
|
+
log: [{
|
|
32
|
+
emit: "event",
|
|
33
|
+
level: "query"
|
|
34
|
+
}]
|
|
35
|
+
});
|
|
36
|
+
this.config = config;
|
|
37
|
+
} else {
|
|
38
|
+
this.client = new PrismaClient({ adapter });
|
|
39
|
+
this.config = config;
|
|
40
|
+
}
|
|
36
41
|
} catch (e) {
|
|
37
42
|
throw new Error(`Prisma Client not installed - ${getError(e)}`);
|
|
38
43
|
}
|
|
39
44
|
}
|
|
45
|
+
return this;
|
|
40
46
|
};
|
|
41
47
|
};
|
|
42
48
|
//#endregion
|
|
43
|
-
export {
|
|
49
|
+
export { Prisma };
|
|
@@ -1,5 +1,3 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const
|
|
3
|
-
|
|
4
|
-
exports.PrismaNamespace = require_prisma_server_PrismaNamespace.PrismaNamespace;
|
|
5
|
-
exports.prismaClient = require_prisma_server_prisma.prismaClient;
|
|
2
|
+
const require_prisma_server_Prisma = require("./Prisma.cjs");
|
|
3
|
+
exports.Prisma = require_prisma_server_Prisma.Prisma;
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
export { PrismaClientLike, PrismaConfig, PrismaNamespace, prismaClient };
|
|
1
|
+
import { Prisma, PrismaClientLike } from "./Prisma.cjs";
|
|
2
|
+
export { Prisma, PrismaClientLike };
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
export { PrismaClientLike, PrismaConfig, PrismaNamespace, prismaClient };
|
|
1
|
+
import { Prisma, PrismaClientLike } from "./Prisma.mjs";
|
|
2
|
+
export { Prisma, PrismaClientLike };
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
export { PrismaNamespace, prismaClient };
|
|
1
|
+
import { Prisma } from "./Prisma.mjs";
|
|
2
|
+
export { Prisma };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@8ms/helpers",
|
|
3
3
|
"license": "UNLICENSED",
|
|
4
|
-
"version": "3.0.
|
|
4
|
+
"version": "3.0.10",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "git+https://github.com/8millionstories-organisation/8ms-helpers-ts.git"
|
|
@@ -207,7 +207,6 @@
|
|
|
207
207
|
"jest": "^30.3.0",
|
|
208
208
|
"mysql2": "^3.22.2",
|
|
209
209
|
"next": "^16.2.3",
|
|
210
|
-
"node-fetch": "^3.3.2",
|
|
211
210
|
"pg": "^8.20.0",
|
|
212
211
|
"react": "^19.2.5",
|
|
213
212
|
"react-intersection-observer": "^10.0.3",
|
|
@@ -987,13 +986,9 @@
|
|
|
987
986
|
"import": "./dist/prisma/server/index.mjs",
|
|
988
987
|
"require": "./dist/prisma/server/index.cjs"
|
|
989
988
|
},
|
|
990
|
-
"./prisma/server/
|
|
991
|
-
"import": "./dist/prisma/server/
|
|
992
|
-
"require": "./dist/prisma/server/
|
|
993
|
-
},
|
|
994
|
-
"./prisma/server/PrismaNamespace": {
|
|
995
|
-
"import": "./dist/prisma/server/PrismaNamespace.mjs",
|
|
996
|
-
"require": "./dist/prisma/server/PrismaNamespace.cjs"
|
|
989
|
+
"./prisma/server/Prisma": {
|
|
990
|
+
"import": "./dist/prisma/server/Prisma.mjs",
|
|
991
|
+
"require": "./dist/prisma/server/Prisma.cjs"
|
|
997
992
|
},
|
|
998
993
|
"./snapchat/server": {
|
|
999
994
|
"import": "./dist/snapchat/server/index.mjs",
|
|
@@ -1218,12 +1213,6 @@
|
|
|
1218
1213
|
"./package.json": "./package.json"
|
|
1219
1214
|
},
|
|
1220
1215
|
"inlinedDependencies": {
|
|
1221
|
-
"@smithy/types": "4.14.2"
|
|
1222
|
-
"data-uri-to-buffer": "4.0.1",
|
|
1223
|
-
"fetch-blob": "3.2.0",
|
|
1224
|
-
"formdata-polyfill": "4.0.10",
|
|
1225
|
-
"node-domexception": "1.0.0",
|
|
1226
|
-
"node-fetch": "3.3.2",
|
|
1227
|
-
"web-streams-polyfill": "3.3.3"
|
|
1216
|
+
"@smithy/types": "4.14.2"
|
|
1228
1217
|
}
|
|
1229
1218
|
}
|