telescope-prisma-client 0.0.179 → 0.0.181
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/index.d.ts +106 -0
- package/dist/index.js +5 -17
- package/dist/middlewares/prismaFilterDeletedAtMiddleware.js +17 -46
- package/dist/middlewares/prismaSoftDeleteMiddleware.js +17 -47
- package/dist/schema.prisma +205 -123
- package/package.json +3 -3
- package/schema.prisma +205 -123
- package/tsconfig.json +1 -1
- package/dist/generatedClient/client.d.ts +0 -1
- package/dist/generatedClient/client.js +0 -4
- package/dist/generatedClient/default.d.ts +0 -1
- package/dist/generatedClient/default.js +0 -1
- package/dist/generatedClient/edge.d.ts +0 -1
- package/dist/generatedClient/edge.js +0 -1600
- package/dist/generatedClient/index-browser.js +0 -1563
- package/dist/generatedClient/index.d.ts +0 -99509
- package/dist/generatedClient/index.js +0 -1641
- package/dist/generatedClient/libquery_engine-darwin-arm64.dylib.node +0 -0
- package/dist/generatedClient/libquery_engine-darwin.dylib.node +0 -0
- package/dist/generatedClient/libquery_engine-debian-openssl-3.0.x.so.node +0 -0
- package/dist/generatedClient/libquery_engine-linux-musl-openssl-3.0.x.so.node +0 -0
- package/dist/generatedClient/libquery_engine-linux-musl.so.node +0 -0
- package/dist/generatedClient/libquery_engine-rhel-openssl-1.0.x.so.node +0 -0
- package/dist/generatedClient/package.json +0 -103
- package/dist/generatedClient/runtime/edge-esm.js +0 -31
- package/dist/generatedClient/runtime/edge.js +0 -31
- package/dist/generatedClient/runtime/index-browser.d.ts +0 -367
- package/dist/generatedClient/runtime/index-browser.js +0 -13
- package/dist/generatedClient/runtime/library.d.ts +0 -3473
- package/dist/generatedClient/runtime/library.js +0 -143
- package/dist/generatedClient/runtime/react-native.js +0 -80
- package/dist/generatedClient/runtime/wasm-compiler-edge.js +0 -83
- package/dist/generatedClient/runtime/wasm-engine-edge.js +0 -35
- package/dist/generatedClient/runtime/wasm.js +0 -32
- package/dist/generatedClient/schema.prisma +0 -1236
- package/dist/generatedClient/wasm.d.ts +0 -1
- package/dist/generatedClient/wasm.js +0 -1563
package/dist/index.d.ts
CHANGED
|
@@ -172,5 +172,111 @@ declare global {
|
|
|
172
172
|
type?: string;
|
|
173
173
|
};
|
|
174
174
|
type EmailAttendees = EmailAttendee[];
|
|
175
|
+
type MailReachTestResult = {
|
|
176
|
+
id: number;
|
|
177
|
+
email: string;
|
|
178
|
+
desc: string;
|
|
179
|
+
first_name: string | null;
|
|
180
|
+
provider: 'gmail' | 'outlook' | 'yahoo';
|
|
181
|
+
received_in: string | null;
|
|
182
|
+
raw_headers: unknown[] | null;
|
|
183
|
+
};
|
|
184
|
+
type MailReachFirstMessageContent = {
|
|
185
|
+
id: number;
|
|
186
|
+
created_at: string;
|
|
187
|
+
updated_at: string;
|
|
188
|
+
message_id: string;
|
|
189
|
+
raw_spf: string;
|
|
190
|
+
raw_dkim: string;
|
|
191
|
+
raw_dmarc: string | null;
|
|
192
|
+
from_email: string;
|
|
193
|
+
from_name: string;
|
|
194
|
+
subject: string;
|
|
195
|
+
content_html: string;
|
|
196
|
+
content_text: string;
|
|
197
|
+
account_id: number;
|
|
198
|
+
received_in: string;
|
|
199
|
+
test_id: number;
|
|
200
|
+
authentication_results: string;
|
|
201
|
+
content_html_cleaned: string;
|
|
202
|
+
attachments?: string[];
|
|
203
|
+
sending_ip: string;
|
|
204
|
+
raw_headers: string;
|
|
205
|
+
unsubscribe_header_detected: boolean;
|
|
206
|
+
};
|
|
207
|
+
type MailReachAnalysisResults = {
|
|
208
|
+
type: string;
|
|
209
|
+
spammy: boolean;
|
|
210
|
+
nextsteps: string[];
|
|
211
|
+
spamwords: string[];
|
|
212
|
+
error_count: number;
|
|
213
|
+
string_size: number;
|
|
214
|
+
blank_subject: boolean;
|
|
215
|
+
links_results: {
|
|
216
|
+
error: boolean;
|
|
217
|
+
broken_links: number;
|
|
218
|
+
redirect_links: number;
|
|
219
|
+
};
|
|
220
|
+
number_images: number;
|
|
221
|
+
number_html_tags: number;
|
|
222
|
+
images_text_ratio: number;
|
|
223
|
+
number_secured_links: number;
|
|
224
|
+
number_shortened_links: number;
|
|
225
|
+
number_unsecured_links: number;
|
|
226
|
+
attachments: string[];
|
|
227
|
+
};
|
|
228
|
+
type MailReachDomain = {
|
|
229
|
+
id?: number | null;
|
|
230
|
+
created_at?: string | null;
|
|
231
|
+
updated_at?: string | null;
|
|
232
|
+
domain?: string | null;
|
|
233
|
+
creation_date?: string | null;
|
|
234
|
+
last_check_at?: string | null;
|
|
235
|
+
spf_valid?: boolean | null;
|
|
236
|
+
spf_value?: string | null;
|
|
237
|
+
dkim_valid?: boolean | null;
|
|
238
|
+
dkim_selector?: string | null;
|
|
239
|
+
dkim_value?: string | null;
|
|
240
|
+
dmarc_valid?: boolean | null;
|
|
241
|
+
dmarc_value?: string | null;
|
|
242
|
+
domain_http_response?: boolean | null;
|
|
243
|
+
domain_https?: boolean | null;
|
|
244
|
+
mx_records?: string[][] | null;
|
|
245
|
+
};
|
|
246
|
+
type MailReachTld = {
|
|
247
|
+
id: number;
|
|
248
|
+
created_at: string;
|
|
249
|
+
updated_at: string;
|
|
250
|
+
name: string;
|
|
251
|
+
badness_index: number;
|
|
252
|
+
badness_ratio: number;
|
|
253
|
+
};
|
|
254
|
+
type MailReachSpamTestResponse = {
|
|
255
|
+
public_full_id: string;
|
|
256
|
+
results: MailReachTestResult[];
|
|
257
|
+
paid: boolean;
|
|
258
|
+
created_at: string;
|
|
259
|
+
first_message_content: MailReachFirstMessageContent | null;
|
|
260
|
+
test_type: string | null;
|
|
261
|
+
completed: boolean;
|
|
262
|
+
score: number | null;
|
|
263
|
+
btob_score: number | null;
|
|
264
|
+
btoc_score: number | null;
|
|
265
|
+
analysis_results?: MailReachAnalysisResults;
|
|
266
|
+
final_score: number | null;
|
|
267
|
+
domain?: MailReachDomain;
|
|
268
|
+
public_id: string;
|
|
269
|
+
summary: Record<string, number>;
|
|
270
|
+
tld: MailReachTld;
|
|
271
|
+
blacklist_links: string[];
|
|
272
|
+
blacklist_sending_ip: string[];
|
|
273
|
+
sending_provider: string | null;
|
|
274
|
+
sending_reverse_dns_value: string | null;
|
|
275
|
+
automated: boolean;
|
|
276
|
+
automated_test_id: string | null;
|
|
277
|
+
spam?: boolean | null;
|
|
278
|
+
seedlist: number;
|
|
279
|
+
autofix_completed?: boolean;
|
|
280
|
+
};
|
|
175
281
|
}
|
|
176
282
|
}
|
package/dist/index.js
CHANGED
|
@@ -1,15 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
14
3
|
if (k2 === undefined) k2 = k;
|
|
15
4
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
@@ -27,13 +16,12 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
27
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
17
|
exports.createPrismaClient = void 0;
|
|
29
18
|
// The idea is to simply extend the generated client
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
19
|
+
const index_1 = require("./generatedClient/index");
|
|
20
|
+
const prismaFilterDeletedAtMiddleware_1 = require("./middlewares/prismaFilterDeletedAtMiddleware");
|
|
21
|
+
const prismaSoftDeleteMiddleware_1 = require("./middlewares/prismaSoftDeleteMiddleware");
|
|
33
22
|
__exportStar(require("./generatedClient/index"), exports);
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
var prisma = new index_1.PrismaClient(__assign({ log: ['warn', 'error'], datasources: {
|
|
23
|
+
const createPrismaClient = (dbUrl, options = {}) => {
|
|
24
|
+
const prisma = new index_1.PrismaClient(Object.assign({ log: ['warn', 'error'], datasources: {
|
|
37
25
|
db: {
|
|
38
26
|
url: dbUrl,
|
|
39
27
|
},
|
|
@@ -8,55 +8,26 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
13
|
-
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
-
function step(op) {
|
|
16
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
18
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
-
switch (op[0]) {
|
|
21
|
-
case 0: case 1: t = op; break;
|
|
22
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
-
default:
|
|
26
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
-
if (t[2]) _.ops.pop();
|
|
31
|
-
_.trys.pop(); continue;
|
|
32
|
-
}
|
|
33
|
-
op = body.call(thisArg, _);
|
|
34
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
12
|
exports.filterDeletedAtMiddleware = void 0;
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
if (
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
if (params.
|
|
49
|
-
if (params.args.where) {
|
|
50
|
-
|
|
51
|
-
params.args.where['deleted_at'] = null;
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
else {
|
|
55
|
-
params.args['where'] = { deleted_at: null };
|
|
13
|
+
const config_1 = require("../config");
|
|
14
|
+
const filterDeletedAtMiddleware = (params, next) => __awaiter(void 0, void 0, void 0, function* () {
|
|
15
|
+
if (config_1.config.softDelete.tables.includes(params.model)) {
|
|
16
|
+
if (params.action === 'findUnique' || params.action === 'findFirst' || params.action === 'findFirstOrThrow') {
|
|
17
|
+
params.action = 'findFirst';
|
|
18
|
+
params.args.where['deleted_at'] = null;
|
|
19
|
+
}
|
|
20
|
+
if (params.action === 'findMany') {
|
|
21
|
+
if (params.args.where) {
|
|
22
|
+
if (params.args.where.deleted_at == undefined) {
|
|
23
|
+
params.args.where['deleted_at'] = null;
|
|
56
24
|
}
|
|
57
25
|
}
|
|
26
|
+
else {
|
|
27
|
+
params.args['where'] = { deleted_at: null };
|
|
28
|
+
}
|
|
58
29
|
}
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
});
|
|
30
|
+
}
|
|
31
|
+
return next(params);
|
|
32
|
+
});
|
|
62
33
|
exports.filterDeletedAtMiddleware = filterDeletedAtMiddleware;
|
|
@@ -8,56 +8,26 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
13
|
-
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
-
function step(op) {
|
|
16
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
18
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
-
switch (op[0]) {
|
|
21
|
-
case 0: case 1: t = op; break;
|
|
22
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
-
default:
|
|
26
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
-
if (t[2]) _.ops.pop();
|
|
31
|
-
_.trys.pop(); continue;
|
|
32
|
-
}
|
|
33
|
-
op = body.call(thisArg, _);
|
|
34
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
12
|
exports.softDeleteMiddleware = void 0;
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
if (
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
13
|
+
const config_1 = require("../config");
|
|
14
|
+
const softDeleteMiddleware = (params, next) => __awaiter(void 0, void 0, void 0, function* () {
|
|
15
|
+
if (config_1.config.softDelete.tables.includes(params.model)) {
|
|
16
|
+
const deleted_at = new Date();
|
|
17
|
+
if (params.action == 'delete') {
|
|
18
|
+
params.action = 'update';
|
|
19
|
+
params.args['data'] = { deleted_at };
|
|
20
|
+
}
|
|
21
|
+
if (params.action == 'deleteMany') {
|
|
22
|
+
params.action = 'updateMany';
|
|
23
|
+
if (params.args.data != undefined) {
|
|
24
|
+
params.args.data['deleted_at'] = deleted_at;
|
|
49
25
|
}
|
|
50
|
-
|
|
51
|
-
params.
|
|
52
|
-
if (params.args.data != undefined) {
|
|
53
|
-
params.args.data['deleted_at'] = deleted_at;
|
|
54
|
-
}
|
|
55
|
-
else {
|
|
56
|
-
params.args['data'] = { deleted_at: deleted_at };
|
|
57
|
-
}
|
|
26
|
+
else {
|
|
27
|
+
params.args['data'] = { deleted_at };
|
|
58
28
|
}
|
|
59
29
|
}
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
});
|
|
30
|
+
}
|
|
31
|
+
return next(params);
|
|
32
|
+
});
|
|
63
33
|
exports.softDeleteMiddleware = softDeleteMiddleware;
|