@devmoods/express-extras 0.17.9 → 0.18.1
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/bin/migrate +1 -1
- package/dist/auth.d.ts +5 -4
- package/dist/auth.js +1 -1
- package/dist/errors.js +1 -1
- package/dist/middleware.d.ts +7 -5
- package/dist/middleware.js +3 -8
- package/dist/migrate.js +2 -2
- package/dist/redis.d.ts +3 -285
- package/dist/sentry.d.ts +5 -5
- package/dist/sentry.js +1 -2
- package/package.json +24 -22
package/bin/migrate
CHANGED
package/dist/auth.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type Request, type RequestHandler, type Response } from 'express';
|
|
1
|
+
import { type Request, type RequestHandler, type Response, Router } from 'express';
|
|
2
2
|
import type { RedisClient } from './redis.js';
|
|
3
3
|
export declare function createAuthToken(payload: any, secret?: string): string;
|
|
4
4
|
export interface AuthLoginMethods<User = any> {
|
|
@@ -13,11 +13,12 @@ export interface AuthOptions<UserModel extends Record<string, any>> {
|
|
|
13
13
|
onResetRequested?(user: UserModel, temporaryToken: string): void | Promise<void>;
|
|
14
14
|
onPasswordChanged?(user: UserModel, newPassword: string): Promise<void>;
|
|
15
15
|
}
|
|
16
|
-
export
|
|
17
|
-
createRouter: () =>
|
|
16
|
+
export interface CreateAuth<UserModel extends Record<string, any>> {
|
|
17
|
+
createRouter: () => Router;
|
|
18
18
|
useCurrentUser: () => UserModel | undefined;
|
|
19
19
|
middleware: (authorize?: boolean) => RequestHandler;
|
|
20
|
-
}
|
|
20
|
+
}
|
|
21
|
+
export declare function createAuth<UserModel extends Record<string, any>>({ getUserByToken, methods: { emailAndPassword }, filterUser, redis, tokenExpiry, onResetRequested, onPasswordChanged, }: AuthOptions<UserModel>): CreateAuth<UserModel>;
|
|
21
22
|
/**
|
|
22
23
|
* Extract a Bearer token from the HTTP Authorization header
|
|
23
24
|
* of `req`.
|
package/dist/auth.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import * as crypto from 'node:crypto';
|
|
1
2
|
import * as bcrypt from 'bcrypt';
|
|
2
3
|
import { Router, } from 'express';
|
|
3
4
|
import jwt from 'jsonwebtoken';
|
|
4
|
-
import * as crypto from 'node:crypto';
|
|
5
5
|
import { v4 } from 'uuid';
|
|
6
6
|
import { setContext, useContext } from './context.js';
|
|
7
7
|
import { BadRequest, NotFound, Unauthorized } from './errors.js';
|
package/dist/errors.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { STATUS_CODES } from 'node:http';
|
|
1
2
|
import * as Sentry from '@sentry/node';
|
|
2
3
|
import { errors } from 'compose-middleware';
|
|
3
|
-
import { STATUS_CODES } from 'node:http';
|
|
4
4
|
import { IntegrityError } from './postgres.js';
|
|
5
5
|
export class ApiError extends Error {
|
|
6
6
|
}
|
package/dist/middleware.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
/// <reference types="connect" />
|
|
2
|
-
/// <reference types="qs" />
|
|
3
1
|
import bodyParser from 'body-parser';
|
|
4
2
|
import type { RequestHandler } from 'express';
|
|
5
3
|
import { type ErrorHandlerOptions } from './errors.js';
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
type UrlencodedParser = typeof bodyParser.urlencoded;
|
|
5
|
+
type JsonParser = typeof bodyParser.json;
|
|
6
|
+
export declare const urlencodedParser: UrlencodedParser;
|
|
7
|
+
export declare const jsonParser: JsonParser;
|
|
8
|
+
export { asyncMiddleware as route };
|
|
8
9
|
export interface BeforeMiddlewareOptions {
|
|
9
10
|
cookies?: boolean;
|
|
10
11
|
helmet?: boolean;
|
|
@@ -31,7 +32,8 @@ export interface AfterMiddlewareOptions {
|
|
|
31
32
|
* Currently attaches:
|
|
32
33
|
* - notFound()
|
|
33
34
|
*/
|
|
34
|
-
|
|
35
|
+
type After = ReturnType<typeof notFound>;
|
|
36
|
+
export declare function after(): After;
|
|
35
37
|
/**
|
|
36
38
|
* Alias of `route()`
|
|
37
39
|
*/
|
package/dist/middleware.js
CHANGED
|
@@ -5,8 +5,9 @@ import cookieParser from 'cookie-parser';
|
|
|
5
5
|
import helmet from 'helmet';
|
|
6
6
|
import { withRequestContext } from './context.js';
|
|
7
7
|
import { NotFound } from './errors.js';
|
|
8
|
-
const
|
|
9
|
-
export
|
|
8
|
+
export const urlencodedParser = bodyParser.urlencoded;
|
|
9
|
+
export const jsonParser = bodyParser.json;
|
|
10
|
+
export { asyncMiddleware as route };
|
|
10
11
|
/**
|
|
11
12
|
* Register middleware that must come before the app routes.
|
|
12
13
|
*/
|
|
@@ -52,12 +53,6 @@ export function notFound() {
|
|
|
52
53
|
next(NotFound(`Could not ${req.method} ${req.path}`));
|
|
53
54
|
};
|
|
54
55
|
}
|
|
55
|
-
/**
|
|
56
|
-
* Register middlewares that must come after the app routes.
|
|
57
|
-
*
|
|
58
|
-
* Currently attaches:
|
|
59
|
-
* - notFound()
|
|
60
|
-
*/
|
|
61
56
|
export function after() {
|
|
62
57
|
return notFound();
|
|
63
58
|
}
|
package/dist/migrate.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import chalk from 'chalk';
|
|
2
|
-
import meow from 'meow';
|
|
3
1
|
import { promises as fs } from 'node:fs';
|
|
4
2
|
import * as path from 'node:path';
|
|
3
|
+
import chalk from 'chalk';
|
|
4
|
+
import meow from 'meow';
|
|
5
5
|
import { createPostgres } from './postgres.js';
|
|
6
6
|
export async function cli() {
|
|
7
7
|
const cli = meow(`
|
package/dist/redis.d.ts
CHANGED
|
@@ -1,289 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
import { createClient } from 'redis';
|
|
2
2
|
export interface RedisOptions {
|
|
3
3
|
url?: string;
|
|
4
4
|
onError: (error: Error) => void;
|
|
5
5
|
}
|
|
6
|
-
export
|
|
7
|
-
|
|
8
|
-
CONFIG_GET: typeof import("@redis/graph/dist/commands/CONFIG_GET.js");
|
|
9
|
-
configGet: typeof import("@redis/graph/dist/commands/CONFIG_GET.js");
|
|
10
|
-
CONFIG_SET: typeof import("@redis/graph/dist/commands/CONFIG_SET.js");
|
|
11
|
-
configSet: typeof import("@redis/graph/dist/commands/CONFIG_SET.js");
|
|
12
|
-
DELETE: typeof import("@redis/graph/dist/commands/DELETE.js");
|
|
13
|
-
delete: typeof import("@redis/graph/dist/commands/DELETE.js");
|
|
14
|
-
EXPLAIN: typeof import("@redis/graph/dist/commands/EXPLAIN.js");
|
|
15
|
-
explain: typeof import("@redis/graph/dist/commands/EXPLAIN.js");
|
|
16
|
-
LIST: typeof import("@redis/graph/dist/commands/LIST.js");
|
|
17
|
-
list: typeof import("@redis/graph/dist/commands/LIST.js");
|
|
18
|
-
PROFILE: typeof import("@redis/graph/dist/commands/PROFILE.js");
|
|
19
|
-
profile: typeof import("@redis/graph/dist/commands/PROFILE.js");
|
|
20
|
-
QUERY: typeof import("@redis/graph/dist/commands/QUERY.js");
|
|
21
|
-
query: typeof import("@redis/graph/dist/commands/QUERY.js");
|
|
22
|
-
RO_QUERY: typeof import("@redis/graph/dist/commands/RO_QUERY.js");
|
|
23
|
-
roQuery: typeof import("@redis/graph/dist/commands/RO_QUERY.js");
|
|
24
|
-
SLOWLOG: typeof import("@redis/graph/dist/commands/SLOWLOG.js");
|
|
25
|
-
slowLog: typeof import("@redis/graph/dist/commands/SLOWLOG.js");
|
|
26
|
-
};
|
|
27
|
-
json: {
|
|
28
|
-
ARRAPPEND: typeof import("@redis/json/dist/commands/ARRAPPEND.js");
|
|
29
|
-
arrAppend: typeof import("@redis/json/dist/commands/ARRAPPEND.js");
|
|
30
|
-
ARRINDEX: typeof import("@redis/json/dist/commands/ARRINDEX.js");
|
|
31
|
-
arrIndex: typeof import("@redis/json/dist/commands/ARRINDEX.js");
|
|
32
|
-
ARRINSERT: typeof import("@redis/json/dist/commands/ARRINSERT.js");
|
|
33
|
-
arrInsert: typeof import("@redis/json/dist/commands/ARRINSERT.js");
|
|
34
|
-
ARRLEN: typeof import("@redis/json/dist/commands/ARRLEN.js");
|
|
35
|
-
arrLen: typeof import("@redis/json/dist/commands/ARRLEN.js");
|
|
36
|
-
ARRPOP: typeof import("@redis/json/dist/commands/ARRPOP.js");
|
|
37
|
-
arrPop: typeof import("@redis/json/dist/commands/ARRPOP.js");
|
|
38
|
-
ARRTRIM: typeof import("@redis/json/dist/commands/ARRTRIM.js");
|
|
39
|
-
arrTrim: typeof import("@redis/json/dist/commands/ARRTRIM.js");
|
|
40
|
-
DEBUG_MEMORY: typeof import("@redis/json/dist/commands/DEBUG_MEMORY.js");
|
|
41
|
-
debugMemory: typeof import("@redis/json/dist/commands/DEBUG_MEMORY.js");
|
|
42
|
-
DEL: typeof import("@redis/json/dist/commands/DEL.js");
|
|
43
|
-
del: typeof import("@redis/json/dist/commands/DEL.js");
|
|
44
|
-
FORGET: typeof import("@redis/json/dist/commands/FORGET.js");
|
|
45
|
-
forget: typeof import("@redis/json/dist/commands/FORGET.js");
|
|
46
|
-
GET: typeof import("@redis/json/dist/commands/GET.js");
|
|
47
|
-
get: typeof import("@redis/json/dist/commands/GET.js");
|
|
48
|
-
MGET: typeof import("@redis/json/dist/commands/MGET.js");
|
|
49
|
-
mGet: typeof import("@redis/json/dist/commands/MGET.js");
|
|
50
|
-
NUMINCRBY: typeof import("@redis/json/dist/commands/NUMINCRBY.js");
|
|
51
|
-
numIncrBy: typeof import("@redis/json/dist/commands/NUMINCRBY.js");
|
|
52
|
-
NUMMULTBY: typeof import("@redis/json/dist/commands/NUMMULTBY.js");
|
|
53
|
-
numMultBy: typeof import("@redis/json/dist/commands/NUMMULTBY.js");
|
|
54
|
-
OBJKEYS: typeof import("@redis/json/dist/commands/OBJKEYS.js");
|
|
55
|
-
objKeys: typeof import("@redis/json/dist/commands/OBJKEYS.js");
|
|
56
|
-
OBJLEN: typeof import("@redis/json/dist/commands/OBJLEN.js");
|
|
57
|
-
objLen: typeof import("@redis/json/dist/commands/OBJLEN.js");
|
|
58
|
-
RESP: typeof import("@redis/json/dist/commands/RESP.js");
|
|
59
|
-
resp: typeof import("@redis/json/dist/commands/RESP.js");
|
|
60
|
-
SET: typeof import("@redis/json/dist/commands/SET.js");
|
|
61
|
-
set: typeof import("@redis/json/dist/commands/SET.js");
|
|
62
|
-
STRAPPEND: typeof import("@redis/json/dist/commands/STRAPPEND.js");
|
|
63
|
-
strAppend: typeof import("@redis/json/dist/commands/STRAPPEND.js");
|
|
64
|
-
STRLEN: typeof import("@redis/json/dist/commands/STRLEN.js");
|
|
65
|
-
strLen: typeof import("@redis/json/dist/commands/STRLEN.js");
|
|
66
|
-
TYPE: typeof import("@redis/json/dist/commands/TYPE.js");
|
|
67
|
-
type: typeof import("@redis/json/dist/commands/TYPE.js");
|
|
68
|
-
};
|
|
69
|
-
ft: {
|
|
70
|
-
_LIST: typeof import("@redis/search/dist/commands/_LIST.js");
|
|
71
|
-
_list: typeof import("@redis/search/dist/commands/_LIST.js");
|
|
72
|
-
ALTER: typeof import("@redis/search/dist/commands/ALTER.js");
|
|
73
|
-
alter: typeof import("@redis/search/dist/commands/ALTER.js");
|
|
74
|
-
AGGREGATE_WITHCURSOR: typeof import("@redis/search/dist/commands/AGGREGATE_WITHCURSOR.js");
|
|
75
|
-
aggregateWithCursor: typeof import("@redis/search/dist/commands/AGGREGATE_WITHCURSOR.js");
|
|
76
|
-
AGGREGATE: typeof import("@redis/search/dist/commands/AGGREGATE.js");
|
|
77
|
-
aggregate: typeof import("@redis/search/dist/commands/AGGREGATE.js");
|
|
78
|
-
ALIASADD: typeof import("@redis/search/dist/commands/ALIASADD.js");
|
|
79
|
-
aliasAdd: typeof import("@redis/search/dist/commands/ALIASADD.js");
|
|
80
|
-
ALIASDEL: typeof import("@redis/search/dist/commands/ALIASDEL.js");
|
|
81
|
-
aliasDel: typeof import("@redis/search/dist/commands/ALIASDEL.js");
|
|
82
|
-
ALIASUPDATE: typeof import("@redis/search/dist/commands/ALIASUPDATE.js");
|
|
83
|
-
aliasUpdate: typeof import("@redis/search/dist/commands/ALIASUPDATE.js");
|
|
84
|
-
CONFIG_GET: typeof import("@redis/search/dist/commands/CONFIG_GET.js");
|
|
85
|
-
configGet: typeof import("@redis/search/dist/commands/CONFIG_GET.js");
|
|
86
|
-
CONFIG_SET: typeof import("@redis/search/dist/commands/CONFIG_SET.js");
|
|
87
|
-
configSet: typeof import("@redis/search/dist/commands/CONFIG_SET.js");
|
|
88
|
-
CREATE: typeof import("@redis/search/dist/commands/CREATE.js");
|
|
89
|
-
create: typeof import("@redis/search/dist/commands/CREATE.js");
|
|
90
|
-
CURSOR_DEL: typeof import("@redis/search/dist/commands/CURSOR_DEL.js");
|
|
91
|
-
cursorDel: typeof import("@redis/search/dist/commands/CURSOR_DEL.js");
|
|
92
|
-
CURSOR_READ: typeof import("@redis/search/dist/commands/CURSOR_READ.js");
|
|
93
|
-
cursorRead: typeof import("@redis/search/dist/commands/CURSOR_READ.js");
|
|
94
|
-
DICTADD: typeof import("@redis/search/dist/commands/DICTADD.js");
|
|
95
|
-
dictAdd: typeof import("@redis/search/dist/commands/DICTADD.js");
|
|
96
|
-
DICTDEL: typeof import("@redis/search/dist/commands/DICTDEL.js");
|
|
97
|
-
dictDel: typeof import("@redis/search/dist/commands/DICTDEL.js");
|
|
98
|
-
DICTDUMP: typeof import("@redis/search/dist/commands/DICTDUMP.js");
|
|
99
|
-
dictDump: typeof import("@redis/search/dist/commands/DICTDUMP.js");
|
|
100
|
-
DROPINDEX: typeof import("@redis/search/dist/commands/DROPINDEX.js");
|
|
101
|
-
dropIndex: typeof import("@redis/search/dist/commands/DROPINDEX.js");
|
|
102
|
-
EXPLAIN: typeof import("@redis/search/dist/commands/EXPLAIN.js");
|
|
103
|
-
explain: typeof import("@redis/search/dist/commands/EXPLAIN.js");
|
|
104
|
-
EXPLAINCLI: typeof import("@redis/search/dist/commands/EXPLAINCLI.js");
|
|
105
|
-
explainCli: typeof import("@redis/search/dist/commands/EXPLAINCLI.js");
|
|
106
|
-
INFO: typeof import("@redis/search/dist/commands/INFO.js");
|
|
107
|
-
info: typeof import("@redis/search/dist/commands/INFO.js");
|
|
108
|
-
PROFILESEARCH: typeof import("@redis/search/dist/commands/PROFILE_SEARCH.js");
|
|
109
|
-
profileSearch: typeof import("@redis/search/dist/commands/PROFILE_SEARCH.js");
|
|
110
|
-
PROFILEAGGREGATE: typeof import("@redis/search/dist/commands/PROFILE_AGGREGATE.js");
|
|
111
|
-
profileAggregate: typeof import("@redis/search/dist/commands/PROFILE_AGGREGATE.js");
|
|
112
|
-
SEARCH: typeof import("@redis/search/dist/commands/SEARCH.js");
|
|
113
|
-
search: typeof import("@redis/search/dist/commands/SEARCH.js");
|
|
114
|
-
SPELLCHECK: typeof import("@redis/search/dist/commands/SPELLCHECK.js");
|
|
115
|
-
spellCheck: typeof import("@redis/search/dist/commands/SPELLCHECK.js");
|
|
116
|
-
SUGADD: typeof import("@redis/search/dist/commands/SUGADD.js");
|
|
117
|
-
sugAdd: typeof import("@redis/search/dist/commands/SUGADD.js");
|
|
118
|
-
SUGDEL: typeof import("@redis/search/dist/commands/SUGDEL.js");
|
|
119
|
-
sugDel: typeof import("@redis/search/dist/commands/SUGDEL.js");
|
|
120
|
-
SUGGET_WITHPAYLOADS: typeof import("@redis/search/dist/commands/SUGGET_WITHPAYLOADS.js");
|
|
121
|
-
sugGetWithPayloads: typeof import("@redis/search/dist/commands/SUGGET_WITHPAYLOADS.js");
|
|
122
|
-
SUGGET_WITHSCORES_WITHPAYLOADS: typeof import("@redis/search/dist/commands/SUGGET_WITHSCORES_WITHPAYLOADS.js");
|
|
123
|
-
sugGetWithScoresWithPayloads: typeof import("@redis/search/dist/commands/SUGGET_WITHSCORES_WITHPAYLOADS.js");
|
|
124
|
-
SUGGET_WITHSCORES: typeof import("@redis/search/dist/commands/SUGGET_WITHSCORES.js");
|
|
125
|
-
sugGetWithScores: typeof import("@redis/search/dist/commands/SUGGET_WITHSCORES.js");
|
|
126
|
-
SUGGET: typeof import("@redis/search/dist/commands/SUGGET.js");
|
|
127
|
-
sugGet: typeof import("@redis/search/dist/commands/SUGGET.js");
|
|
128
|
-
SUGLEN: typeof import("@redis/search/dist/commands/SUGLEN.js");
|
|
129
|
-
sugLen: typeof import("@redis/search/dist/commands/SUGLEN.js");
|
|
130
|
-
SYNDUMP: typeof import("@redis/search/dist/commands/SYNDUMP.js");
|
|
131
|
-
synDump: typeof import("@redis/search/dist/commands/SYNDUMP.js");
|
|
132
|
-
SYNUPDATE: typeof import("@redis/search/dist/commands/SYNUPDATE.js");
|
|
133
|
-
synUpdate: typeof import("@redis/search/dist/commands/SYNUPDATE.js");
|
|
134
|
-
TAGVALS: typeof import("@redis/search/dist/commands/TAGVALS.js");
|
|
135
|
-
tagVals: typeof import("@redis/search/dist/commands/TAGVALS.js");
|
|
136
|
-
};
|
|
137
|
-
ts: {
|
|
138
|
-
ADD: typeof import("@redis/time-series/dist/commands/ADD.js");
|
|
139
|
-
add: typeof import("@redis/time-series/dist/commands/ADD.js");
|
|
140
|
-
ALTER: typeof import("@redis/time-series/dist/commands/ALTER.js");
|
|
141
|
-
alter: typeof import("@redis/time-series/dist/commands/ALTER.js");
|
|
142
|
-
CREATE: typeof import("@redis/time-series/dist/commands/CREATE.js");
|
|
143
|
-
create: typeof import("@redis/time-series/dist/commands/CREATE.js");
|
|
144
|
-
CREATERULE: typeof import("@redis/time-series/dist/commands/CREATERULE.js");
|
|
145
|
-
createRule: typeof import("@redis/time-series/dist/commands/CREATERULE.js");
|
|
146
|
-
DECRBY: typeof import("@redis/time-series/dist/commands/DECRBY.js");
|
|
147
|
-
decrBy: typeof import("@redis/time-series/dist/commands/DECRBY.js");
|
|
148
|
-
DEL: typeof import("@redis/time-series/dist/commands/DEL.js");
|
|
149
|
-
del: typeof import("@redis/time-series/dist/commands/DEL.js");
|
|
150
|
-
DELETERULE: typeof import("@redis/time-series/dist/commands/DELETERULE.js");
|
|
151
|
-
deleteRule: typeof import("@redis/time-series/dist/commands/DELETERULE.js");
|
|
152
|
-
GET: typeof import("@redis/time-series/dist/commands/GET.js");
|
|
153
|
-
get: typeof import("@redis/time-series/dist/commands/GET.js");
|
|
154
|
-
INCRBY: typeof import("@redis/time-series/dist/commands/INCRBY.js");
|
|
155
|
-
incrBy: typeof import("@redis/time-series/dist/commands/INCRBY.js");
|
|
156
|
-
INFO_DEBUG: typeof import("@redis/time-series/dist/commands/INFO_DEBUG.js");
|
|
157
|
-
infoDebug: typeof import("@redis/time-series/dist/commands/INFO_DEBUG.js");
|
|
158
|
-
INFO: typeof import("@redis/time-series/dist/commands/INFO.js");
|
|
159
|
-
info: typeof import("@redis/time-series/dist/commands/INFO.js");
|
|
160
|
-
MADD: typeof import("@redis/time-series/dist/commands/MADD.js");
|
|
161
|
-
mAdd: typeof import("@redis/time-series/dist/commands/MADD.js");
|
|
162
|
-
MGET: typeof import("@redis/time-series/dist/commands/MGET.js");
|
|
163
|
-
mGet: typeof import("@redis/time-series/dist/commands/MGET.js");
|
|
164
|
-
MGET_WITHLABELS: typeof import("@redis/time-series/dist/commands/MGET_WITHLABELS.js");
|
|
165
|
-
mGetWithLabels: typeof import("@redis/time-series/dist/commands/MGET_WITHLABELS.js");
|
|
166
|
-
QUERYINDEX: typeof import("@redis/time-series/dist/commands/QUERYINDEX.js");
|
|
167
|
-
queryIndex: typeof import("@redis/time-series/dist/commands/QUERYINDEX.js");
|
|
168
|
-
RANGE: typeof import("@redis/time-series/dist/commands/RANGE.js");
|
|
169
|
-
range: typeof import("@redis/time-series/dist/commands/RANGE.js");
|
|
170
|
-
REVRANGE: typeof import("@redis/time-series/dist/commands/REVRANGE.js");
|
|
171
|
-
revRange: typeof import("@redis/time-series/dist/commands/REVRANGE.js");
|
|
172
|
-
MRANGE: typeof import("@redis/time-series/dist/commands/MRANGE.js");
|
|
173
|
-
mRange: typeof import("@redis/time-series/dist/commands/MRANGE.js");
|
|
174
|
-
MRANGE_WITHLABELS: typeof import("@redis/time-series/dist/commands/MRANGE_WITHLABELS.js");
|
|
175
|
-
mRangeWithLabels: typeof import("@redis/time-series/dist/commands/MRANGE_WITHLABELS.js");
|
|
176
|
-
MREVRANGE: typeof import("@redis/time-series/dist/commands/MREVRANGE.js");
|
|
177
|
-
mRevRange: typeof import("@redis/time-series/dist/commands/MREVRANGE.js");
|
|
178
|
-
MREVRANGE_WITHLABELS: typeof import("@redis/time-series/dist/commands/MREVRANGE_WITHLABELS.js");
|
|
179
|
-
mRevRangeWithLabels: typeof import("@redis/time-series/dist/commands/MREVRANGE_WITHLABELS.js");
|
|
180
|
-
};
|
|
181
|
-
bf: {
|
|
182
|
-
ADD: typeof import("@redis/bloom/dist/commands/bloom/ADD.js");
|
|
183
|
-
add: typeof import("@redis/bloom/dist/commands/bloom/ADD.js");
|
|
184
|
-
CARD: typeof import("@redis/bloom/dist/commands/bloom/CARD.js");
|
|
185
|
-
card: typeof import("@redis/bloom/dist/commands/bloom/CARD.js");
|
|
186
|
-
EXISTS: typeof import("@redis/bloom/dist/commands/bloom/EXISTS.js");
|
|
187
|
-
exists: typeof import("@redis/bloom/dist/commands/bloom/EXISTS.js");
|
|
188
|
-
INFO: typeof import("@redis/bloom/dist/commands/bloom/INFO.js");
|
|
189
|
-
info: typeof import("@redis/bloom/dist/commands/bloom/INFO.js");
|
|
190
|
-
INSERT: typeof import("@redis/bloom/dist/commands/bloom/INSERT.js");
|
|
191
|
-
insert: typeof import("@redis/bloom/dist/commands/bloom/INSERT.js");
|
|
192
|
-
LOADCHUNK: typeof import("@redis/bloom/dist/commands/bloom/LOADCHUNK.js");
|
|
193
|
-
loadChunk: typeof import("@redis/bloom/dist/commands/bloom/LOADCHUNK.js");
|
|
194
|
-
MADD: typeof import("@redis/bloom/dist/commands/bloom/MADD.js");
|
|
195
|
-
mAdd: typeof import("@redis/bloom/dist/commands/bloom/MADD.js");
|
|
196
|
-
MEXISTS: typeof import("@redis/bloom/dist/commands/bloom/MEXISTS.js");
|
|
197
|
-
mExists: typeof import("@redis/bloom/dist/commands/bloom/MEXISTS.js");
|
|
198
|
-
RESERVE: typeof import("@redis/bloom/dist/commands/bloom/RESERVE.js");
|
|
199
|
-
reserve: typeof import("@redis/bloom/dist/commands/bloom/RESERVE.js");
|
|
200
|
-
SCANDUMP: typeof import("@redis/bloom/dist/commands/bloom/SCANDUMP.js");
|
|
201
|
-
scanDump: typeof import("@redis/bloom/dist/commands/bloom/SCANDUMP.js");
|
|
202
|
-
};
|
|
203
|
-
cms: {
|
|
204
|
-
INCRBY: typeof import("@redis/bloom/dist/commands/count-min-sketch/INCRBY.js");
|
|
205
|
-
incrBy: typeof import("@redis/bloom/dist/commands/count-min-sketch/INCRBY.js");
|
|
206
|
-
INFO: typeof import("@redis/bloom/dist/commands/count-min-sketch/INFO.js");
|
|
207
|
-
info: typeof import("@redis/bloom/dist/commands/count-min-sketch/INFO.js");
|
|
208
|
-
INITBYDIM: typeof import("@redis/bloom/dist/commands/count-min-sketch/INITBYDIM.js");
|
|
209
|
-
initByDim: typeof import("@redis/bloom/dist/commands/count-min-sketch/INITBYDIM.js");
|
|
210
|
-
INITBYPROB: typeof import("@redis/bloom/dist/commands/count-min-sketch/INITBYPROB.js");
|
|
211
|
-
initByProb: typeof import("@redis/bloom/dist/commands/count-min-sketch/INITBYPROB.js");
|
|
212
|
-
MERGE: typeof import("@redis/bloom/dist/commands/count-min-sketch/MERGE.js");
|
|
213
|
-
merge: typeof import("@redis/bloom/dist/commands/count-min-sketch/MERGE.js");
|
|
214
|
-
QUERY: typeof import("@redis/bloom/dist/commands/count-min-sketch/QUERY.js");
|
|
215
|
-
query: typeof import("@redis/bloom/dist/commands/count-min-sketch/QUERY.js");
|
|
216
|
-
};
|
|
217
|
-
cf: {
|
|
218
|
-
ADD: typeof import("@redis/bloom/dist/commands/cuckoo/ADD.js");
|
|
219
|
-
add: typeof import("@redis/bloom/dist/commands/cuckoo/ADD.js");
|
|
220
|
-
ADDNX: typeof import("@redis/bloom/dist/commands/cuckoo/ADDNX.js");
|
|
221
|
-
addNX: typeof import("@redis/bloom/dist/commands/cuckoo/ADDNX.js");
|
|
222
|
-
COUNT: typeof import("@redis/bloom/dist/commands/cuckoo/COUNT.js");
|
|
223
|
-
count: typeof import("@redis/bloom/dist/commands/cuckoo/COUNT.js");
|
|
224
|
-
DEL: typeof import("@redis/bloom/dist/commands/cuckoo/DEL.js");
|
|
225
|
-
del: typeof import("@redis/bloom/dist/commands/cuckoo/DEL.js");
|
|
226
|
-
EXISTS: typeof import("@redis/bloom/dist/commands/cuckoo/EXISTS.js");
|
|
227
|
-
exists: typeof import("@redis/bloom/dist/commands/cuckoo/EXISTS.js");
|
|
228
|
-
INFO: typeof import("@redis/bloom/dist/commands/cuckoo/INFO.js");
|
|
229
|
-
info: typeof import("@redis/bloom/dist/commands/cuckoo/INFO.js");
|
|
230
|
-
INSERT: typeof import("@redis/bloom/dist/commands/cuckoo/INSERT.js");
|
|
231
|
-
insert: typeof import("@redis/bloom/dist/commands/cuckoo/INSERT.js");
|
|
232
|
-
INSERTNX: typeof import("@redis/bloom/dist/commands/cuckoo/INSERTNX.js");
|
|
233
|
-
insertNX: typeof import("@redis/bloom/dist/commands/cuckoo/INSERTNX.js");
|
|
234
|
-
LOADCHUNK: typeof import("@redis/bloom/dist/commands/cuckoo/LOADCHUNK.js");
|
|
235
|
-
loadChunk: typeof import("@redis/bloom/dist/commands/cuckoo/LOADCHUNK.js");
|
|
236
|
-
RESERVE: typeof import("@redis/bloom/dist/commands/cuckoo/RESERVE.js");
|
|
237
|
-
reserve: typeof import("@redis/bloom/dist/commands/cuckoo/RESERVE.js");
|
|
238
|
-
SCANDUMP: typeof import("@redis/bloom/dist/commands/cuckoo/SCANDUMP.js");
|
|
239
|
-
scanDump: typeof import("@redis/bloom/dist/commands/cuckoo/SCANDUMP.js");
|
|
240
|
-
};
|
|
241
|
-
tDigest: {
|
|
242
|
-
ADD: typeof import("@redis/bloom/dist/commands/t-digest/ADD.js");
|
|
243
|
-
add: typeof import("@redis/bloom/dist/commands/t-digest/ADD.js");
|
|
244
|
-
BYRANK: typeof import("@redis/bloom/dist/commands/t-digest/BYRANK.js");
|
|
245
|
-
byRank: typeof import("@redis/bloom/dist/commands/t-digest/BYRANK.js");
|
|
246
|
-
BYREVRANK: typeof import("@redis/bloom/dist/commands/t-digest/BYREVRANK.js");
|
|
247
|
-
byRevRank: typeof import("@redis/bloom/dist/commands/t-digest/BYREVRANK.js");
|
|
248
|
-
CDF: typeof import("@redis/bloom/dist/commands/t-digest/CDF.js");
|
|
249
|
-
cdf: typeof import("@redis/bloom/dist/commands/t-digest/CDF.js");
|
|
250
|
-
CREATE: typeof import("@redis/bloom/dist/commands/t-digest/CREATE.js");
|
|
251
|
-
create: typeof import("@redis/bloom/dist/commands/t-digest/CREATE.js");
|
|
252
|
-
INFO: typeof import("@redis/bloom/dist/commands/t-digest/INFO.js");
|
|
253
|
-
info: typeof import("@redis/bloom/dist/commands/t-digest/INFO.js");
|
|
254
|
-
MAX: typeof import("@redis/bloom/dist/commands/t-digest/MAX.js");
|
|
255
|
-
max: typeof import("@redis/bloom/dist/commands/t-digest/MAX.js");
|
|
256
|
-
MERGE: typeof import("@redis/bloom/dist/commands/t-digest/MERGE.js");
|
|
257
|
-
merge: typeof import("@redis/bloom/dist/commands/t-digest/MERGE.js");
|
|
258
|
-
MIN: typeof import("@redis/bloom/dist/commands/t-digest/MIN.js");
|
|
259
|
-
min: typeof import("@redis/bloom/dist/commands/t-digest/MIN.js");
|
|
260
|
-
QUANTILE: typeof import("@redis/bloom/dist/commands/t-digest/QUANTILE.js");
|
|
261
|
-
quantile: typeof import("@redis/bloom/dist/commands/t-digest/QUANTILE.js");
|
|
262
|
-
RANK: typeof import("@redis/bloom/dist/commands/t-digest/RANK.js");
|
|
263
|
-
rank: typeof import("@redis/bloom/dist/commands/t-digest/RANK.js");
|
|
264
|
-
RESET: typeof import("@redis/bloom/dist/commands/t-digest/RESET.js");
|
|
265
|
-
reset: typeof import("@redis/bloom/dist/commands/t-digest/RESET.js");
|
|
266
|
-
REVRANK: typeof import("@redis/bloom/dist/commands/t-digest/REVRANK.js");
|
|
267
|
-
revRank: typeof import("@redis/bloom/dist/commands/t-digest/REVRANK.js");
|
|
268
|
-
TRIMMED_MEAN: typeof import("@redis/bloom/dist/commands/t-digest/TRIMMED_MEAN.js");
|
|
269
|
-
trimmedMean: typeof import("@redis/bloom/dist/commands/t-digest/TRIMMED_MEAN.js");
|
|
270
|
-
};
|
|
271
|
-
topK: {
|
|
272
|
-
ADD: typeof import("@redis/bloom/dist/commands/top-k/ADD.js");
|
|
273
|
-
add: typeof import("@redis/bloom/dist/commands/top-k/ADD.js");
|
|
274
|
-
COUNT: typeof import("@redis/bloom/dist/commands/top-k/COUNT.js");
|
|
275
|
-
count: typeof import("@redis/bloom/dist/commands/top-k/COUNT.js");
|
|
276
|
-
INCRBY: typeof import("@redis/bloom/dist/commands/top-k/INCRBY.js");
|
|
277
|
-
incrBy: typeof import("@redis/bloom/dist/commands/top-k/INCRBY.js");
|
|
278
|
-
INFO: typeof import("@redis/bloom/dist/commands/top-k/INFO.js");
|
|
279
|
-
info: typeof import("@redis/bloom/dist/commands/top-k/INFO.js");
|
|
280
|
-
LIST_WITHCOUNT: typeof import("@redis/bloom/dist/commands/top-k/LIST_WITHCOUNT.js");
|
|
281
|
-
listWithCount: typeof import("@redis/bloom/dist/commands/top-k/LIST_WITHCOUNT.js");
|
|
282
|
-
LIST: typeof import("@redis/bloom/dist/commands/top-k/LIST.js");
|
|
283
|
-
list: typeof import("@redis/bloom/dist/commands/top-k/LIST.js");
|
|
284
|
-
QUERY: typeof import("@redis/bloom/dist/commands/top-k/QUERY.js");
|
|
285
|
-
query: typeof import("@redis/bloom/dist/commands/top-k/QUERY.js");
|
|
286
|
-
RESERVE: typeof import("@redis/bloom/dist/commands/top-k/RESERVE.js");
|
|
287
|
-
reserve: typeof import("@redis/bloom/dist/commands/top-k/RESERVE.js");
|
|
288
|
-
};
|
|
289
|
-
} & import("redis").RedisModules, import("redis").RedisFunctions, import("redis").RedisScripts>;
|
|
6
|
+
export type RedisClient = ReturnType<typeof createClient>;
|
|
7
|
+
export declare function createRedis({ url, onError, }: RedisOptions): RedisClient;
|
package/dist/sentry.d.ts
CHANGED
|
@@ -20,21 +20,21 @@ export declare function createSentryOptions(app: Application | null, options?: S
|
|
|
20
20
|
transport?: ((transportOptions: import("@sentry/node/types/transports/http.js").NodeTransportOptions) => import("@sentry/types").Transport) | undefined;
|
|
21
21
|
stackParser?: import("@sentry/types").StackParser | import("@sentry/types").StackLineParser[] | undefined;
|
|
22
22
|
release?: string | undefined;
|
|
23
|
-
environment?: string | undefined;
|
|
24
23
|
debug?: boolean | undefined;
|
|
25
|
-
instrumenter?: import("@sentry/types").Instrumenter | undefined;
|
|
26
|
-
sampleRate?: number | undefined;
|
|
27
|
-
dsn: string | undefined;
|
|
28
24
|
enabled?: boolean | undefined;
|
|
29
25
|
attachStacktrace?: boolean | undefined;
|
|
30
26
|
autoSessionTracking?: boolean | undefined;
|
|
31
27
|
sendClientReports?: boolean | undefined;
|
|
28
|
+
dsn: string | undefined;
|
|
29
|
+
environment?: string | undefined;
|
|
32
30
|
dist?: string | undefined;
|
|
31
|
+
instrumenter?: import("@sentry/types").Instrumenter | undefined;
|
|
33
32
|
transportOptions?: Partial<import("@sentry/node/types/transports/http.js").NodeTransportOptions> | undefined;
|
|
34
33
|
tracesSampleRate: number;
|
|
35
34
|
enableTracing?: boolean | undefined;
|
|
36
35
|
initialScope?: import("@sentry/types").CaptureContext | undefined;
|
|
37
36
|
maxBreadcrumbs?: number | undefined;
|
|
37
|
+
sampleRate?: number | undefined;
|
|
38
38
|
maxValueLength?: number | undefined;
|
|
39
39
|
normalizeDepth?: number | undefined;
|
|
40
40
|
normalizeMaxBreadth?: number | undefined;
|
|
@@ -49,6 +49,7 @@ export declare function createSentryOptions(app: Application | null, options?: S
|
|
|
49
49
|
} | undefined;
|
|
50
50
|
allowUrls?: (string | RegExp)[] | undefined;
|
|
51
51
|
denyUrls?: (string | RegExp)[] | undefined;
|
|
52
|
+
tracePropagationTargets?: import("@sentry/types").TracePropagationTargets | undefined;
|
|
52
53
|
tracesSampler?: ((samplingContext: import("@sentry/types").SamplingContext) => number | boolean) | undefined;
|
|
53
54
|
beforeSend?: ((event: import("@sentry/types").ErrorEvent, hint: Sentry.EventHint) => Sentry.Event | PromiseLike<Sentry.Event | null> | null) | undefined;
|
|
54
55
|
beforeSendTransaction?: ((event: import("@sentry/types").TransactionEvent, hint: Sentry.EventHint) => Sentry.Event | PromiseLike<Sentry.Event | null> | null) | undefined;
|
|
@@ -57,7 +58,6 @@ export declare function createSentryOptions(app: Application | null, options?: S
|
|
|
57
58
|
profilesSampler?: ((samplingContext: import("@sentry/types").SamplingContext) => number | boolean) | undefined;
|
|
58
59
|
serverName?: string | undefined;
|
|
59
60
|
includeLocalVariables?: boolean | undefined;
|
|
60
|
-
tracePropagationTargets?: import("@sentry/types").TracePropagationTargets | undefined;
|
|
61
61
|
shouldCreateSpanForRequest?(this: void, url: string): boolean;
|
|
62
62
|
onFatalError?(this: void, error: Error): void;
|
|
63
63
|
};
|
package/dist/sentry.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import * as Sentry from '@sentry/node';
|
|
2
|
-
import * as Tracing from '@sentry/tracing';
|
|
3
2
|
/**
|
|
4
3
|
* Create a pre-configured Sentry client
|
|
5
4
|
*/
|
|
@@ -19,7 +18,7 @@ export function createSentryOptions(app, options = {}) {
|
|
|
19
18
|
dsn: process.env.SENTRY_DSN,
|
|
20
19
|
integrations: [
|
|
21
20
|
new Sentry.Integrations.Http({ tracing: true }),
|
|
22
|
-
app && new
|
|
21
|
+
app && new Sentry.Integrations.Express({ app }),
|
|
23
22
|
].filter(Boolean),
|
|
24
23
|
tracesSampleRate: 1.0,
|
|
25
24
|
...options,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@devmoods/express-extras",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.18.1",
|
|
4
4
|
"description": "Kubernetes-ready utilities for rapid Node.js application development",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -8,17 +8,6 @@
|
|
|
8
8
|
"bin": {
|
|
9
9
|
"migrate": "bin/migrate"
|
|
10
10
|
},
|
|
11
|
-
"scripts": {
|
|
12
|
-
"start": "ts-node --esm example/index.ts",
|
|
13
|
-
"clean": "rm -rf dist",
|
|
14
|
-
"lint": "eslint src",
|
|
15
|
-
"test": "NODE_ENV=test vitest",
|
|
16
|
-
"build": "npm run clean && tsc --project tsconfig.build.json",
|
|
17
|
-
"prepublishOnly": "npm run clean && npm run build",
|
|
18
|
-
"prettier": "prettier --write '**/*.{js,css,md,ts,tsx}'",
|
|
19
|
-
"import-sort": "import-sort --write '**/*.{js,jsx,ts,tsx}'",
|
|
20
|
-
"format": "yarn import-sort && yarn prettier"
|
|
21
|
-
},
|
|
22
11
|
"author": {
|
|
23
12
|
"name": "hanse",
|
|
24
13
|
"email": "hanse@koren.im"
|
|
@@ -35,11 +24,13 @@
|
|
|
35
24
|
"license": "ISC",
|
|
36
25
|
"devDependencies": {
|
|
37
26
|
"@devmoods/eslint-config": "^1.1.0",
|
|
38
|
-
"@types
|
|
27
|
+
"@sentry/types": "^7.57.0",
|
|
28
|
+
"@types/express-serve-static-core": "^4.17.35",
|
|
29
|
+
"@types/node": "20.3.2",
|
|
39
30
|
"@types/supertest": "2.0.12",
|
|
40
|
-
"@typescript-eslint/eslint-plugin": "^5.
|
|
41
|
-
"@typescript-eslint/parser": "^5.
|
|
42
|
-
"chalk": "^5.
|
|
31
|
+
"@typescript-eslint/eslint-plugin": "^5.60.1",
|
|
32
|
+
"@typescript-eslint/parser": "^5.60.1",
|
|
33
|
+
"chalk": "^5.3.0",
|
|
43
34
|
"eslint": "^8.43.0",
|
|
44
35
|
"eslint-plugin-jsx-a11y": "^6.7.1",
|
|
45
36
|
"eslint-plugin-prettier": "^4.2.1",
|
|
@@ -51,15 +42,15 @@
|
|
|
51
42
|
"prettier": "2.8.8",
|
|
52
43
|
"supertest": "6.3.3",
|
|
53
44
|
"ts-node": "10.9.1",
|
|
54
|
-
"typescript": "5.1.
|
|
45
|
+
"typescript": "5.1.6",
|
|
55
46
|
"vitest": "^0.32.2"
|
|
56
47
|
},
|
|
57
48
|
"dependencies": {
|
|
58
49
|
"@devmoods/fetch": "^3.3.0",
|
|
59
|
-
"@godaddy/terminus": "^4.12.
|
|
60
|
-
"@sentry/node": "^7.
|
|
61
|
-
"@sentry/tracing": "^7.55.2",
|
|
50
|
+
"@godaddy/terminus": "^4.12.1",
|
|
51
|
+
"@sentry/node": "^7.57.0",
|
|
62
52
|
"@types/bcrypt": "^5.0.0",
|
|
53
|
+
"@types/body-parser": "^1.19.2",
|
|
63
54
|
"@types/bunyan": "^1.8.8",
|
|
64
55
|
"@types/cls-hooked": "^4.3.4",
|
|
65
56
|
"@types/cookie-parser": "^1.4.3",
|
|
@@ -70,6 +61,7 @@
|
|
|
70
61
|
"@types/uuid": "^9.0.2",
|
|
71
62
|
"ajv": "^8.12.0",
|
|
72
63
|
"bcrypt": "^5.1.0",
|
|
64
|
+
"body-parser": "^1.20.2",
|
|
73
65
|
"bunyan": "^1.8.15",
|
|
74
66
|
"cls-hooked": "^4.2.2",
|
|
75
67
|
"compose-middleware": "^5.0.1",
|
|
@@ -80,7 +72,7 @@
|
|
|
80
72
|
"jsonwebtoken": "^9.0.0",
|
|
81
73
|
"meow": "^12.0.1",
|
|
82
74
|
"nodemailer": "^6.9.3",
|
|
83
|
-
"pg": "^8.11.
|
|
75
|
+
"pg": "^8.11.1",
|
|
84
76
|
"redis": "^4.6.7",
|
|
85
77
|
"sql-template-strings": "^2.2.2",
|
|
86
78
|
"uuid": "^9.0.0"
|
|
@@ -100,5 +92,15 @@
|
|
|
100
92
|
"@typescript-eslint/no-shadow": "off",
|
|
101
93
|
"react-hooks/rules-of-hooks": "off"
|
|
102
94
|
}
|
|
95
|
+
},
|
|
96
|
+
"scripts": {
|
|
97
|
+
"start": "ts-node --esm example/index.ts",
|
|
98
|
+
"clean": "rm -rf dist",
|
|
99
|
+
"lint": "eslint src",
|
|
100
|
+
"test": "NODE_ENV=test vitest",
|
|
101
|
+
"build": "pnpm run clean && tsc --project tsconfig.build.json",
|
|
102
|
+
"prettier": "prettier --write '**/*.{js,css,md,ts,tsx}'",
|
|
103
|
+
"import-sort": "import-sort --write '**/*.{js,jsx,ts,tsx}'",
|
|
104
|
+
"format": "pnpm run import-sort && pnpm run prettier"
|
|
103
105
|
}
|
|
104
|
-
}
|
|
106
|
+
}
|