@mondomob/gae-node-nestjs 11.0.2 → 12.0.0-alpha-2
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/.claude/settings.local.json +7 -0
- package/CHANGELOG.md +0 -13
- package/mondomob-gae-node-nestjs-12.0.0-alpha-1.tgz +0 -0
- package/mondomob-gae-node-nestjs-12.0.0-alpha-2.tgz +0 -0
- package/package.json +12 -12
- package/server-start.js +72 -1
- package/dist/_test/mocks.d.ts +0 -9
- package/dist/_test/mocks.js +0 -27
- package/dist/_test/mocks.js.map +0 -1
- package/dist/_test/request-scope-test-utils.d.ts +0 -3
- package/dist/_test/request-scope-test-utils.js +0 -18
- package/dist/_test/request-scope-test-utils.js.map +0 -1
- package/dist/auth/auth-user.model.d.ts +0 -9
- package/dist/auth/auth-user.model.js +0 -33
- package/dist/auth/auth-user.model.js.map +0 -1
- package/dist/auth/auth.callbacks.d.ts +0 -8
- package/dist/auth/auth.callbacks.js +0 -5
- package/dist/auth/auth.callbacks.js.map +0 -1
- package/dist/auth/auth.configurer.d.ts +0 -35
- package/dist/auth/auth.configurer.js +0 -212
- package/dist/auth/auth.configurer.js.map +0 -1
- package/dist/auth/auth.controller.d.ts +0 -27
- package/dist/auth/auth.controller.js +0 -312
- package/dist/auth/auth.controller.js.map +0 -1
- package/dist/auth/auth.guard.d.ts +0 -16
- package/dist/auth/auth.guard.js +0 -127
- package/dist/auth/auth.guard.js.map +0 -1
- package/dist/auth/auth.listener.d.ts +0 -5
- package/dist/auth/auth.listener.js +0 -5
- package/dist/auth/auth.listener.js.map +0 -1
- package/dist/auth/auth.repository.d.ts +0 -52
- package/dist/auth/auth.repository.js +0 -79
- package/dist/auth/auth.repository.js.map +0 -1
- package/dist/auth/auth.resolver.d.ts +0 -13
- package/dist/auth/auth.resolver.js +0 -86
- package/dist/auth/auth.resolver.js.map +0 -1
- package/dist/auth/auth.service.d.ts +0 -35
- package/dist/auth/auth.service.js +0 -299
- package/dist/auth/auth.service.js.map +0 -1
- package/dist/auth/auth.task.controller.d.ts +0 -13
- package/dist/auth/auth.task.controller.js +0 -76
- package/dist/auth/auth.task.controller.js.map +0 -1
- package/dist/auth/auth.task.service.d.ts +0 -8
- package/dist/auth/auth.task.service.js +0 -26
- package/dist/auth/auth.task.service.js.map +0 -1
- package/dist/auth/csrf.interceptor.d.ts +0 -11
- package/dist/auth/csrf.interceptor.js +0 -38
- package/dist/auth/csrf.interceptor.js.map +0 -1
- package/dist/auth/invite-user.service.d.ts +0 -45
- package/dist/auth/invite-user.service.js +0 -215
- package/dist/auth/invite-user.service.js.map +0 -1
- package/dist/auth/invite.callbacks.d.ts +0 -6
- package/dist/auth/invite.callbacks.js +0 -5
- package/dist/auth/invite.callbacks.js.map +0 -1
- package/dist/auth/login-identifier.repository.d.ts +0 -13
- package/dist/auth/login-identifier.repository.js +0 -28
- package/dist/auth/login-identifier.repository.js.map +0 -1
- package/dist/auth/password-reset.service.d.ts +0 -15
- package/dist/auth/password-reset.service.js +0 -81
- package/dist/auth/password-reset.service.js.map +0 -1
- package/dist/auth/user.service.d.ts +0 -27
- package/dist/auth/user.service.js +0 -94
- package/dist/auth/user.service.js.map +0 -1
- package/dist/configuration.d.ts +0 -84
- package/dist/configuration.js +0 -5
- package/dist/configuration.js.map +0 -1
- package/dist/configure.d.ts +0 -40
- package/dist/configure.js +0 -85
- package/dist/configure.js.map +0 -1
- package/dist/context/context-middleware.d.ts +0 -15
- package/dist/context/context-middleware.js +0 -37
- package/dist/context/context-middleware.js.map +0 -1
- package/dist/context/context-request-scope.d.ts +0 -8
- package/dist/context/context-request-scope.js +0 -29
- package/dist/context/context-request-scope.js.map +0 -1
- package/dist/context/index.d.ts +0 -2
- package/dist/context/index.js +0 -9
- package/dist/context/index.js.map +0 -1
- package/dist/datastore/context.d.ts +0 -36
- package/dist/datastore/context.js +0 -27
- package/dist/datastore/context.js.map +0 -1
- package/dist/datastore/datastore.provider.d.ts +0 -8
- package/dist/datastore/datastore.provider.js +0 -30
- package/dist/datastore/datastore.provider.js.map +0 -1
- package/dist/datastore/filters.d.ts +0 -19
- package/dist/datastore/filters.js +0 -27
- package/dist/datastore/filters.js.map +0 -1
- package/dist/datastore/loader.d.ts +0 -50
- package/dist/datastore/loader.js +0 -147
- package/dist/datastore/loader.js.map +0 -1
- package/dist/datastore/node-datastore-session.d.ts +0 -17
- package/dist/datastore/node-datastore-session.js +0 -87
- package/dist/datastore/node-datastore-session.js.map +0 -1
- package/dist/datastore/repository.d.ts +0 -45
- package/dist/datastore/repository.js +0 -150
- package/dist/datastore/repository.js.map +0 -1
- package/dist/datastore/transactional.d.ts +0 -4
- package/dist/datastore/transactional.js +0 -13
- package/dist/datastore/transactional.js.map +0 -1
- package/dist/error/NonFatalError.d.ts +0 -3
- package/dist/error/NonFatalError.js +0 -11
- package/dist/error/NonFatalError.js.map +0 -1
- package/dist/filter.d.ts +0 -5
- package/dist/filter.js +0 -40
- package/dist/filter.js.map +0 -1
- package/dist/gcloud/logging.d.ts +0 -1
- package/dist/gcloud/logging.js +0 -5
- package/dist/gcloud/logging.js.map +0 -1
- package/dist/gcloud/storage.provider.d.ts +0 -12
- package/dist/gcloud/storage.provider.js +0 -41
- package/dist/gcloud/storage.provider.js.map +0 -1
- package/dist/gcloud/tasks.d.ts +0 -10
- package/dist/gcloud/tasks.js +0 -68
- package/dist/gcloud/tasks.js.map +0 -1
- package/dist/graphql/GraphQLMiddleware.d.ts +0 -0
- package/dist/graphql/GraphQLMiddleware.js +0 -2
- package/dist/graphql/GraphQLMiddleware.js.map +0 -1
- package/dist/index.d.ts +0 -28
- package/dist/index.js +0 -65
- package/dist/index.js.map +0 -1
- package/dist/logging/index.d.ts +0 -1
- package/dist/logging/index.js +0 -8
- package/dist/logging/index.js.map +0 -1
- package/dist/logging/logging-internal.d.ts +0 -2
- package/dist/logging/logging-internal.js +0 -20
- package/dist/logging/logging-internal.js.map +0 -1
- package/dist/logging/logging-request-scope.d.ts +0 -15
- package/dist/logging/logging-request-scope.js +0 -39
- package/dist/logging/logging-request-scope.js.map +0 -1
- package/dist/logging/logging.d.ts +0 -34
- package/dist/logging/logging.js +0 -55
- package/dist/logging/logging.js.map +0 -1
- package/dist/mail/gmail/gmail.configurer.d.ts +0 -15
- package/dist/mail/gmail/gmail.configurer.js +0 -59
- package/dist/mail/gmail/gmail.configurer.js.map +0 -1
- package/dist/mail/gmail/gmail.controller.d.ts +0 -9
- package/dist/mail/gmail/gmail.controller.js +0 -62
- package/dist/mail/gmail/gmail.controller.js.map +0 -1
- package/dist/mail/gmail/gmail.sender.d.ts +0 -12
- package/dist/mail/gmail/gmail.sender.js +0 -62
- package/dist/mail/gmail/gmail.sender.js.map +0 -1
- package/dist/mail/gmail/stored.credentials.repository.d.ts +0 -12
- package/dist/mail/gmail/stored.credentials.repository.js +0 -23
- package/dist/mail/gmail/stored.credentials.repository.js.map +0 -1
- package/dist/mail/mail-logging.sender.d.ts +0 -9
- package/dist/mail/mail-logging.sender.js +0 -42
- package/dist/mail/mail-logging.sender.js.map +0 -1
- package/dist/mail/mail-subject.sender.d.ts +0 -12
- package/dist/mail/mail-subject.sender.js +0 -33
- package/dist/mail/mail-subject.sender.js.map +0 -1
- package/dist/mail/mail-whitelist.sender.d.ts +0 -14
- package/dist/mail/mail-whitelist.sender.js +0 -59
- package/dist/mail/mail-whitelist.sender.js.map +0 -1
- package/dist/mail/mail.diverter.d.ts +0 -13
- package/dist/mail/mail.diverter.js +0 -65
- package/dist/mail/mail.diverter.js.map +0 -1
- package/dist/mail/mail.sender.d.ts +0 -6
- package/dist/mail/mail.sender.js +0 -5
- package/dist/mail/mail.sender.js.map +0 -1
- package/dist/mail/smtp/smtp.sender.d.ts +0 -10
- package/dist/mail/smtp/smtp.sender.js +0 -65
- package/dist/mail/smtp/smtp.sender.js.map +0 -1
- package/dist/mail-templates/base.d.ts +0 -2
- package/dist/mail-templates/base.js +0 -328
- package/dist/mail-templates/base.js.map +0 -1
- package/dist/mail-templates/invite.d.ts +0 -1
- package/dist/mail-templates/invite.js +0 -19
- package/dist/mail-templates/invite.js.map +0 -1
- package/dist/module.d.ts +0 -16
- package/dist/module.js +0 -136
- package/dist/module.js.map +0 -1
- package/dist/request-scope/index.d.ts +0 -2
- package/dist/request-scope/index.js +0 -9
- package/dist/request-scope/index.js.map +0 -1
- package/dist/request-scope/request-scope-interceptor.d.ts +0 -5
- package/dist/request-scope/request-scope-interceptor.js +0 -3
- package/dist/request-scope/request-scope-interceptor.js.map +0 -1
- package/dist/request-scope/request-scope.d.ts +0 -12
- package/dist/request-scope/request-scope.js +0 -79
- package/dist/request-scope/request-scope.js.map +0 -1
- package/dist/request-scope/request-scope.middleware.d.ts +0 -15
- package/dist/request-scope/request-scope.middleware.js +0 -53
- package/dist/request-scope/request-scope.middleware.js.map +0 -1
- package/dist/search/search.service.d.ts +0 -52
- package/dist/search/search.service.js +0 -90
- package/dist/search/search.service.js.map +0 -1
- package/dist/search/searchable.repository.d.ts +0 -36
- package/dist/search/searchable.repository.js +0 -95
- package/dist/search/searchable.repository.js.map +0 -1
- package/dist/types.d.ts +0 -3
- package/dist/types.js +0 -9
- package/dist/types.js.map +0 -1
- package/dist/util/arrays.d.ts +0 -1
- package/dist/util/arrays.js +0 -10
- package/dist/util/arrays.js.map +0 -1
- package/dist/util/guards.d.ts +0 -1
- package/dist/util/guards.js +0 -7
- package/dist/util/guards.js.map +0 -1
- package/dist/util/index.d.ts +0 -1
- package/dist/util/index.js +0 -5
- package/dist/util/index.js.map +0 -1
- package/dist/util/nestjs.d.ts +0 -9
- package/dist/util/nestjs.js +0 -9
- package/dist/util/nestjs.js.map +0 -1
- package/dist/util/types.d.ts +0 -4
- package/dist/util/types.js +0 -8
- package/dist/util/types.js.map +0 -1
- package/dist/validator.d.ts +0 -1
- package/dist/validator.js +0 -5
- package/dist/validator.js.map +0 -1
- package/mondomob-gae-node-nestjs-11.0.2-alpha.tgz +0 -0
- package/mondomob-gae-node-nestjs-11.0.2-alpha1.tgz +0 -0
|
@@ -1,328 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.mainButton = exports.standardEmail = void 0;
|
|
4
|
-
const standardEmail = (title, content) => `
|
|
5
|
-
<!doctype html>
|
|
6
|
-
<html>
|
|
7
|
-
<head>
|
|
8
|
-
<meta name="viewport" content="width=device-width" />
|
|
9
|
-
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
|
10
|
-
<title>${title}</title>
|
|
11
|
-
<style>
|
|
12
|
-
/* -------------------------------------
|
|
13
|
-
GLOBAL RESETS
|
|
14
|
-
------------------------------------- */
|
|
15
|
-
img {
|
|
16
|
-
border: none;
|
|
17
|
-
-ms-interpolation-mode: bicubic;
|
|
18
|
-
max-width: 100%; }
|
|
19
|
-
|
|
20
|
-
body {
|
|
21
|
-
background-color: #f6f6f6;
|
|
22
|
-
font-family: sans-serif;
|
|
23
|
-
-webkit-font-smoothing: antialiased;
|
|
24
|
-
font-size: 14px;
|
|
25
|
-
line-height: 1.4;
|
|
26
|
-
margin: 0;
|
|
27
|
-
padding: 0;
|
|
28
|
-
-ms-text-size-adjust: 100%;
|
|
29
|
-
-webkit-text-size-adjust: 100%; }
|
|
30
|
-
|
|
31
|
-
table {
|
|
32
|
-
border-collapse: separate;
|
|
33
|
-
mso-table-lspace: 0pt;
|
|
34
|
-
mso-table-rspace: 0pt;
|
|
35
|
-
width: 100%; }
|
|
36
|
-
table td {
|
|
37
|
-
font-family: sans-serif;
|
|
38
|
-
font-size: 14px;
|
|
39
|
-
vertical-align: top; }
|
|
40
|
-
|
|
41
|
-
/* -------------------------------------
|
|
42
|
-
BODY & CONTAINER
|
|
43
|
-
------------------------------------- */
|
|
44
|
-
|
|
45
|
-
.body {
|
|
46
|
-
background-color: #f6f6f6;
|
|
47
|
-
width: 100%; }
|
|
48
|
-
|
|
49
|
-
/* Set a max-width, and make it display as block so it will automatically stretch to that width,
|
|
50
|
-
but will also shrink down on a phone or something */
|
|
51
|
-
.container {
|
|
52
|
-
display: block;
|
|
53
|
-
Margin: 0 auto !important;
|
|
54
|
-
/* makes it centered */
|
|
55
|
-
max-width: 580px;
|
|
56
|
-
padding: 10px;
|
|
57
|
-
width: 580px; }
|
|
58
|
-
|
|
59
|
-
/* This should also be a block element, so that it will fill 100% of the .container */
|
|
60
|
-
.content {
|
|
61
|
-
box-sizing: border-box;
|
|
62
|
-
display: block;
|
|
63
|
-
Margin: 0 auto;
|
|
64
|
-
max-width: 580px;
|
|
65
|
-
padding: 10px; }
|
|
66
|
-
|
|
67
|
-
/* -------------------------------------
|
|
68
|
-
HEADER, FOOTER, MAIN
|
|
69
|
-
------------------------------------- */
|
|
70
|
-
.main {
|
|
71
|
-
background: #fff;
|
|
72
|
-
border-radius: 4px;
|
|
73
|
-
width: 100%; }
|
|
74
|
-
|
|
75
|
-
.wrapper {
|
|
76
|
-
box-sizing: border-box;
|
|
77
|
-
padding: 20px; }
|
|
78
|
-
|
|
79
|
-
.footer {
|
|
80
|
-
clear: both;
|
|
81
|
-
padding-top: 10px;
|
|
82
|
-
text-align: center;
|
|
83
|
-
width: 100%; }
|
|
84
|
-
.footer td,
|
|
85
|
-
.footer p,
|
|
86
|
-
.footer span,
|
|
87
|
-
.footer a {
|
|
88
|
-
color: #999999;
|
|
89
|
-
font-size: 12px;
|
|
90
|
-
text-align: center; }
|
|
91
|
-
|
|
92
|
-
/* -------------------------------------
|
|
93
|
-
TYPOGRAPHY
|
|
94
|
-
------------------------------------- */
|
|
95
|
-
h1,
|
|
96
|
-
h2,
|
|
97
|
-
h3,
|
|
98
|
-
h4 {
|
|
99
|
-
color: #000000;
|
|
100
|
-
font-family: sans-serif;
|
|
101
|
-
font-weight: 400;
|
|
102
|
-
line-height: 1.4;
|
|
103
|
-
margin: 0;
|
|
104
|
-
Margin-bottom: 30px; }
|
|
105
|
-
|
|
106
|
-
h1 {
|
|
107
|
-
font-size: 35px;
|
|
108
|
-
font-weight: 300;
|
|
109
|
-
text-align: center; }
|
|
110
|
-
|
|
111
|
-
p,
|
|
112
|
-
ul,
|
|
113
|
-
ol {
|
|
114
|
-
font-family: sans-serif;
|
|
115
|
-
font-size: 14px;
|
|
116
|
-
font-weight: normal;
|
|
117
|
-
margin: 0;
|
|
118
|
-
Margin-bottom: 15px; }
|
|
119
|
-
p li,
|
|
120
|
-
ul li,
|
|
121
|
-
ol li {
|
|
122
|
-
list-style-position: inside;
|
|
123
|
-
margin-left: 5px; }
|
|
124
|
-
|
|
125
|
-
a {
|
|
126
|
-
color: #337ab7;
|
|
127
|
-
text-decoration: underline; }
|
|
128
|
-
|
|
129
|
-
/* -------------------------------------
|
|
130
|
-
BUTTONS
|
|
131
|
-
------------------------------------- */
|
|
132
|
-
.btn {
|
|
133
|
-
box-sizing: border-box;
|
|
134
|
-
width: 100%; }
|
|
135
|
-
.btn > tbody > tr > td {
|
|
136
|
-
padding-bottom: 15px; }
|
|
137
|
-
.btn table {
|
|
138
|
-
width: auto; }
|
|
139
|
-
.btn table td {
|
|
140
|
-
background-color: #ffffff;
|
|
141
|
-
border-radius: 4px;
|
|
142
|
-
text-align: center; }
|
|
143
|
-
.btn a {
|
|
144
|
-
background-color: #ffffff;
|
|
145
|
-
border: solid 1px #337ab7;
|
|
146
|
-
border-radius: 4px;
|
|
147
|
-
box-sizing: border-box;
|
|
148
|
-
color: #337ab7;
|
|
149
|
-
cursor: pointer;
|
|
150
|
-
display: inline-block;
|
|
151
|
-
font-size: 14px;
|
|
152
|
-
font-weight: bold;
|
|
153
|
-
margin: 0;
|
|
154
|
-
padding: 12px 25px;
|
|
155
|
-
text-decoration: none; }
|
|
156
|
-
|
|
157
|
-
.btn-primary table td {
|
|
158
|
-
background-color: #337ab7; }
|
|
159
|
-
|
|
160
|
-
.btn-primary a {
|
|
161
|
-
background-color: #337ab7;
|
|
162
|
-
border-color: #337ab7;
|
|
163
|
-
color: #ffffff; }
|
|
164
|
-
|
|
165
|
-
/* -------------------------------------
|
|
166
|
-
OTHER STYLES THAT MIGHT BE USEFUL
|
|
167
|
-
------------------------------------- */
|
|
168
|
-
.last {
|
|
169
|
-
margin-bottom: 0; }
|
|
170
|
-
|
|
171
|
-
.first {
|
|
172
|
-
margin-top: 0; }
|
|
173
|
-
|
|
174
|
-
.align-center {
|
|
175
|
-
text-align: center; }
|
|
176
|
-
|
|
177
|
-
.align-right {
|
|
178
|
-
text-align: right; }
|
|
179
|
-
|
|
180
|
-
.align-left {
|
|
181
|
-
text-align: left; }
|
|
182
|
-
|
|
183
|
-
.clear {
|
|
184
|
-
clear: both; }
|
|
185
|
-
|
|
186
|
-
.mt0 {
|
|
187
|
-
margin-top: 0; }
|
|
188
|
-
|
|
189
|
-
.mb0 {
|
|
190
|
-
margin-bottom: 0; }
|
|
191
|
-
|
|
192
|
-
.preheader {
|
|
193
|
-
color: transparent;
|
|
194
|
-
display: none;
|
|
195
|
-
height: 0;
|
|
196
|
-
max-height: 0;
|
|
197
|
-
max-width: 0;
|
|
198
|
-
opacity: 0;
|
|
199
|
-
overflow: hidden;
|
|
200
|
-
mso-hide: all;
|
|
201
|
-
visibility: hidden;
|
|
202
|
-
width: 0; }
|
|
203
|
-
|
|
204
|
-
.powered-by a {
|
|
205
|
-
text-decoration: none; }
|
|
206
|
-
|
|
207
|
-
hr {
|
|
208
|
-
border: 0;
|
|
209
|
-
border-bottom: 1px solid #f6f6f6;
|
|
210
|
-
Margin: 20px 0; }
|
|
211
|
-
|
|
212
|
-
/* -------------------------------------
|
|
213
|
-
RESPONSIVE AND MOBILE FRIENDLY STYLES
|
|
214
|
-
------------------------------------- */
|
|
215
|
-
@media only screen and (max-width: 620px) {
|
|
216
|
-
table[class=body] h1 {
|
|
217
|
-
font-size: 28px !important;
|
|
218
|
-
margin-bottom: 10px !important; }
|
|
219
|
-
table[class=body] p,
|
|
220
|
-
table[class=body] ul,
|
|
221
|
-
table[class=body] ol,
|
|
222
|
-
table[class=body] td,
|
|
223
|
-
table[class=body] span,
|
|
224
|
-
table[class=body] a {
|
|
225
|
-
font-size: 16px !important; }
|
|
226
|
-
table[class=body] .wrapper,
|
|
227
|
-
table[class=body] .article {
|
|
228
|
-
padding: 10px !important; }
|
|
229
|
-
table[class=body] .content {
|
|
230
|
-
padding: 0 !important; }
|
|
231
|
-
table[class=body] .container {
|
|
232
|
-
padding: 0 !important;
|
|
233
|
-
width: 100% !important; }
|
|
234
|
-
table[class=body] .main {
|
|
235
|
-
border-left-width: 0 !important;
|
|
236
|
-
border-radius: 0 !important;
|
|
237
|
-
border-right-width: 0 !important; }
|
|
238
|
-
table[class=body] .btn table {
|
|
239
|
-
width: 100% !important; }
|
|
240
|
-
table[class=body] .btn a {
|
|
241
|
-
width: 100% !important; }
|
|
242
|
-
table[class=body] .img-responsive {
|
|
243
|
-
height: auto !important;
|
|
244
|
-
max-width: 100% !important;
|
|
245
|
-
width: auto !important; }}
|
|
246
|
-
|
|
247
|
-
/* -------------------------------------
|
|
248
|
-
PRESERVE THESE STYLES IN THE HEAD
|
|
249
|
-
------------------------------------- */
|
|
250
|
-
@media all {
|
|
251
|
-
.ExternalClass {
|
|
252
|
-
width: 100%; }
|
|
253
|
-
.ExternalClass,
|
|
254
|
-
.ExternalClass p,
|
|
255
|
-
.ExternalClass span,
|
|
256
|
-
.ExternalClass font,
|
|
257
|
-
.ExternalClass td,
|
|
258
|
-
.ExternalClass div {
|
|
259
|
-
line-height: 100%; }
|
|
260
|
-
.apple-link a {
|
|
261
|
-
color: inherit !important;
|
|
262
|
-
font-family: inherit !important;
|
|
263
|
-
font-size: inherit !important;
|
|
264
|
-
font-weight: inherit !important;
|
|
265
|
-
line-height: inherit !important;
|
|
266
|
-
text-decoration: none !important; }
|
|
267
|
-
.btn-primary table td:hover {
|
|
268
|
-
background-color: #337ab7 !important; }
|
|
269
|
-
.btn-primary a:hover {
|
|
270
|
-
background-color: #337ab7 !important;
|
|
271
|
-
border-color: #337ab7 !important; } }
|
|
272
|
-
|
|
273
|
-
</style>
|
|
274
|
-
</head>
|
|
275
|
-
<body class="">
|
|
276
|
-
<table border="0" cellpadding="0" cellspacing="0" class="body">
|
|
277
|
-
<tr>
|
|
278
|
-
<td> </td>
|
|
279
|
-
<td class="container">
|
|
280
|
-
<!-- START CENTERED WHITE CONTAINER -->
|
|
281
|
-
<div class="content">
|
|
282
|
-
<table class="main">
|
|
283
|
-
|
|
284
|
-
<!-- START MAIN CONTENT AREA -->
|
|
285
|
-
<tr>
|
|
286
|
-
<td class="wrapper">
|
|
287
|
-
<table border="0" cellpadding="0" cellspacing="0">
|
|
288
|
-
<tr>
|
|
289
|
-
<td>
|
|
290
|
-
${content}
|
|
291
|
-
</td>
|
|
292
|
-
</tr>
|
|
293
|
-
</table>
|
|
294
|
-
</td>
|
|
295
|
-
</tr>
|
|
296
|
-
<!-- END MAIN CONTENT AREA -->
|
|
297
|
-
|
|
298
|
-
</table>
|
|
299
|
-
</div>
|
|
300
|
-
<!-- END CENTERED WHITE CONTAINER -->
|
|
301
|
-
</td>
|
|
302
|
-
<td> </td>
|
|
303
|
-
</tr>
|
|
304
|
-
</table>
|
|
305
|
-
</body>
|
|
306
|
-
</html>
|
|
307
|
-
|
|
308
|
-
`;
|
|
309
|
-
exports.standardEmail = standardEmail;
|
|
310
|
-
const mainButton = (text, link) => `
|
|
311
|
-
<table border="0" cellpadding="0" cellspacing="0" class="btn btn-primary">
|
|
312
|
-
<tbody>
|
|
313
|
-
<tr>
|
|
314
|
-
<td align="center">
|
|
315
|
-
<table border="0" cellpadding="0" cellspacing="0">
|
|
316
|
-
<tbody>
|
|
317
|
-
<tr>
|
|
318
|
-
<td><a href="${link}" target="_blank">${text}</a></td>
|
|
319
|
-
</tr>
|
|
320
|
-
</tbody>
|
|
321
|
-
</table>
|
|
322
|
-
</td>
|
|
323
|
-
</tr>
|
|
324
|
-
</tbody>
|
|
325
|
-
</table>
|
|
326
|
-
`;
|
|
327
|
-
exports.mainButton = mainButton;
|
|
328
|
-
//# sourceMappingURL=base.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"base.js","sourceRoot":"","sources":["../../src/mail-templates/base.ts"],"names":[],"mappings":";;;AAAO,MAAM,aAAa,GAAG,CAAC,KAAa,EAAE,OAAe,EAAE,EAAE,CAAU;;;;;;eAM3D,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4CAwRwB,OAAO;;;;;;;;;;;;;;;;;;CAkBlD,CAAC;AAhTW,QAAA,aAAa,iBAgTxB;AAEK,MAAM,UAAU,GAAG,CAAC,IAAY,EAAE,IAAY,EAAE,EAAE,CAAU;;;;;;;;uCAQ5B,IAAI,qBAAqB,IAAI;;;;;;;;CAQnE,CAAC;AAhBW,QAAA,UAAU,cAgBrB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const userInviteEmail: (title: string, link: string, invitationCopy: string, expiryCopy: string | undefined) => string;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.userInviteEmail = void 0;
|
|
4
|
-
const base_1 = require("./base");
|
|
5
|
-
const userInviteEmail = (title, link, invitationCopy, expiryCopy) => {
|
|
6
|
-
const content = `
|
|
7
|
-
<div>
|
|
8
|
-
<p>Welcome,</p>
|
|
9
|
-
<p>${invitationCopy} Please click the button below to activate your account.
|
|
10
|
-
${expiryCopy ? ` This link will expire in ${expiryCopy}.` : ''}</p>
|
|
11
|
-
</div>
|
|
12
|
-
<div>
|
|
13
|
-
${(0, base_1.mainButton)('Activate Account', link)}
|
|
14
|
-
</div>
|
|
15
|
-
`;
|
|
16
|
-
return (0, base_1.standardEmail)(title, content);
|
|
17
|
-
};
|
|
18
|
-
exports.userInviteEmail = userInviteEmail;
|
|
19
|
-
//# sourceMappingURL=invite.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"invite.js","sourceRoot":"","sources":["../../src/mail-templates/invite.ts"],"names":[],"mappings":";;;AAAA,iCAAmD;AAE5C,MAAM,eAAe,GAAG,CAC7B,KAAa,EACb,IAAY,EACZ,cAAsB,EACtB,UAA8B,EAC9B,EAAE;IACF,MAAM,OAAO,GAAY;;;aAGd,cAAc;UACjB,UAAU,CAAC,CAAC,CAAC,6BAA6B,UAAU,GAAG,CAAC,CAAC,CAAC,EAAE;;;cAGxD,IAAA,iBAAU,EAAC,kBAAkB,EAAE,IAAI,CAAC;;GAE/C,CAAC;IAEF,OAAO,IAAA,oBAAa,EAAC,KAAK,EAAE,OAAO,CAAC,CAAC;AACvC,CAAC,CAAC;AAlBW,QAAA,eAAe,mBAkB1B"}
|
package/dist/module.d.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { DynamicModule, ForwardReference, MiddlewareConsumer, NestModule } from '@nestjs/common';
|
|
2
|
-
import { Type } from '@nestjs/common/interfaces/type.interface';
|
|
3
|
-
import { RequestScopeInterceptor } from './request-scope';
|
|
4
|
-
type ClassType = new (...args: any[]) => any;
|
|
5
|
-
type ClassTypeOrReference = ClassType | ForwardReference;
|
|
6
|
-
export interface Options {
|
|
7
|
-
configurationModule: ClassTypeOrReference;
|
|
8
|
-
userModule: ClassTypeOrReference;
|
|
9
|
-
graphQLModule: DynamicModule;
|
|
10
|
-
requestScopeInterceptors?: Type<RequestScopeInterceptor>[];
|
|
11
|
-
}
|
|
12
|
-
export declare class GCloudModule implements NestModule {
|
|
13
|
-
configure(consumer: MiddlewareConsumer): void;
|
|
14
|
-
static forConfiguration(options: Options): DynamicModule;
|
|
15
|
-
}
|
|
16
|
-
export {};
|
package/dist/module.js
DELETED
|
@@ -1,136 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var GCloudModule_1;
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.GCloudModule = void 0;
|
|
5
|
-
const tslib_1 = require("tslib");
|
|
6
|
-
const common_1 = require("@nestjs/common");
|
|
7
|
-
const core_1 = require("@nestjs/core");
|
|
8
|
-
const auth_configurer_1 = require("./auth/auth.configurer");
|
|
9
|
-
const auth_controller_1 = require("./auth/auth.controller");
|
|
10
|
-
const auth_resolver_1 = require("./auth/auth.resolver");
|
|
11
|
-
const auth_guard_1 = require("./auth/auth.guard");
|
|
12
|
-
const auth_repository_1 = require("./auth/auth.repository");
|
|
13
|
-
const auth_service_1 = require("./auth/auth.service");
|
|
14
|
-
const invite_user_service_1 = require("./auth/invite-user.service");
|
|
15
|
-
const login_identifier_repository_1 = require("./auth/login-identifier.repository");
|
|
16
|
-
const password_reset_service_1 = require("./auth/password-reset.service");
|
|
17
|
-
const datastore_provider_1 = require("./datastore/datastore.provider");
|
|
18
|
-
const filter_1 = require("./filter");
|
|
19
|
-
const storage_provider_1 = require("./gcloud/storage.provider");
|
|
20
|
-
const context_1 = require("./context");
|
|
21
|
-
const gmail_configurer_1 = require("./mail/gmail/gmail.configurer");
|
|
22
|
-
const gmail_controller_1 = require("./mail/gmail/gmail.controller");
|
|
23
|
-
const gmail_sender_1 = require("./mail/gmail/gmail.sender");
|
|
24
|
-
const stored_credentials_repository_1 = require("./mail/gmail/stored.credentials.repository");
|
|
25
|
-
const mail_diverter_1 = require("./mail/mail.diverter");
|
|
26
|
-
const mail_logging_sender_1 = require("./mail/mail-logging.sender");
|
|
27
|
-
const mail_sender_1 = require("./mail/mail.sender");
|
|
28
|
-
const smtp_sender_1 = require("./mail/smtp/smtp.sender");
|
|
29
|
-
const search_service_1 = require("./search/search.service");
|
|
30
|
-
const mail_whitelist_sender_1 = require("./mail/mail-whitelist.sender");
|
|
31
|
-
const mail_subject_sender_1 = require("./mail/mail-subject.sender");
|
|
32
|
-
const request_scope_middleware_1 = require("./request-scope/request-scope.middleware");
|
|
33
|
-
const logging_request_scope_1 = require("./logging/logging-request-scope");
|
|
34
|
-
const auth_task_controller_1 = require("./auth/auth.task.controller");
|
|
35
|
-
const auth_task_service_1 = require("./auth/auth.task.service");
|
|
36
|
-
let GCloudModule = GCloudModule_1 = class GCloudModule {
|
|
37
|
-
configure(consumer) {
|
|
38
|
-
consumer.apply(context_1.ContextMiddleware, request_scope_middleware_1.RequestScopeMiddleware).forRoutes('*');
|
|
39
|
-
}
|
|
40
|
-
static forConfiguration(options) {
|
|
41
|
-
return {
|
|
42
|
-
module: GCloudModule_1,
|
|
43
|
-
imports: [options.configurationModule, options.userModule, options.graphQLModule],
|
|
44
|
-
providers: [
|
|
45
|
-
{
|
|
46
|
-
provide: request_scope_middleware_1.REQUEST_SCOPE_INTERCEPTORS,
|
|
47
|
-
useFactory: (...interceptors) => interceptors,
|
|
48
|
-
inject: [
|
|
49
|
-
context_1.ContextRequestScopeInterceptor,
|
|
50
|
-
logging_request_scope_1.LoggingRequestScopeInterceptor,
|
|
51
|
-
...(options.requestScopeInterceptors || []),
|
|
52
|
-
],
|
|
53
|
-
},
|
|
54
|
-
],
|
|
55
|
-
};
|
|
56
|
-
}
|
|
57
|
-
};
|
|
58
|
-
exports.GCloudModule = GCloudModule;
|
|
59
|
-
exports.GCloudModule = GCloudModule = GCloudModule_1 = tslib_1.__decorate([
|
|
60
|
-
(0, common_1.Global)(),
|
|
61
|
-
(0, common_1.Module)({
|
|
62
|
-
providers: [
|
|
63
|
-
storage_provider_1.StorageProvider,
|
|
64
|
-
datastore_provider_1.DatastoreProvider,
|
|
65
|
-
auth_repository_1.CredentialRepository,
|
|
66
|
-
login_identifier_repository_1.LoginIdentifierRepository,
|
|
67
|
-
auth_repository_1.PasswordResetRepository,
|
|
68
|
-
auth_repository_1.UserInviteRepository,
|
|
69
|
-
stored_credentials_repository_1.StoredCredentialsRepository,
|
|
70
|
-
auth_service_1.AuthService,
|
|
71
|
-
auth_configurer_1.AuthConfigurer,
|
|
72
|
-
auth_resolver_1.AuthResolver,
|
|
73
|
-
auth_task_service_1.AuthTaskService,
|
|
74
|
-
password_reset_service_1.PasswordResetService,
|
|
75
|
-
invite_user_service_1.InviteUserService,
|
|
76
|
-
search_service_1.SearchService,
|
|
77
|
-
gmail_configurer_1.GmailConfigurer,
|
|
78
|
-
{
|
|
79
|
-
provide: core_1.APP_FILTER,
|
|
80
|
-
useClass: filter_1.NotFoundFilter,
|
|
81
|
-
},
|
|
82
|
-
context_1.ContextMiddleware,
|
|
83
|
-
request_scope_middleware_1.RequestScopeMiddleware,
|
|
84
|
-
context_1.ContextRequestScopeInterceptor,
|
|
85
|
-
logging_request_scope_1.LoggingRequestScopeInterceptor,
|
|
86
|
-
{
|
|
87
|
-
provide: mail_sender_1.MAIL_SENDER,
|
|
88
|
-
useFactory: (config, gmailConfigurer) => {
|
|
89
|
-
var _a;
|
|
90
|
-
console.log(`Configuring mail sender with devHooks: `, config.devHooks);
|
|
91
|
-
let mailSender;
|
|
92
|
-
if (config.environment === 'development' && !((_a = config.devHooks) === null || _a === void 0 ? void 0 : _a.disableLocalMailLogger)) {
|
|
93
|
-
mailSender = new mail_logging_sender_1.MailLoggingSender();
|
|
94
|
-
}
|
|
95
|
-
else if (config.auth.smtp && config.auth.smtp.enabled) {
|
|
96
|
-
mailSender = new smtp_sender_1.SmtpSender(config);
|
|
97
|
-
}
|
|
98
|
-
else {
|
|
99
|
-
mailSender = new gmail_sender_1.GmailSender(gmailConfigurer, config);
|
|
100
|
-
}
|
|
101
|
-
if (config.devHooks) {
|
|
102
|
-
if (config.devHooks.emailWhitelist) {
|
|
103
|
-
mailSender = new mail_whitelist_sender_1.MailWhitelistSender(mailSender, config);
|
|
104
|
-
}
|
|
105
|
-
if (config.devHooks.divertEmailTo) {
|
|
106
|
-
mailSender = new mail_diverter_1.MailDiverter(mailSender, config);
|
|
107
|
-
}
|
|
108
|
-
if (config.devHooks.emailSubjectPrefix) {
|
|
109
|
-
mailSender = new mail_subject_sender_1.MailSubjectSender(mailSender, config);
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
return mailSender;
|
|
113
|
-
},
|
|
114
|
-
inject: ['Configuration', gmail_configurer_1.GmailConfigurer],
|
|
115
|
-
},
|
|
116
|
-
{
|
|
117
|
-
provide: core_1.APP_GUARD,
|
|
118
|
-
useClass: auth_guard_1.AuthGuard,
|
|
119
|
-
},
|
|
120
|
-
],
|
|
121
|
-
exports: [
|
|
122
|
-
storage_provider_1.StorageProvider,
|
|
123
|
-
datastore_provider_1.DatastoreProvider,
|
|
124
|
-
auth_repository_1.CredentialRepository,
|
|
125
|
-
login_identifier_repository_1.LoginIdentifierRepository,
|
|
126
|
-
auth_repository_1.UserInviteRepository,
|
|
127
|
-
auth_repository_1.PasswordResetRepository,
|
|
128
|
-
password_reset_service_1.PasswordResetService,
|
|
129
|
-
invite_user_service_1.InviteUserService,
|
|
130
|
-
mail_sender_1.MAIL_SENDER,
|
|
131
|
-
search_service_1.SearchService,
|
|
132
|
-
],
|
|
133
|
-
controllers: [auth_controller_1.AuthController, gmail_controller_1.GmailController, auth_task_controller_1.AuthTaskController],
|
|
134
|
-
})
|
|
135
|
-
], GCloudModule);
|
|
136
|
-
//# sourceMappingURL=module.js.map
|
package/dist/module.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"module.js","sourceRoot":"","sources":["../src/module.ts"],"names":[],"mappings":";;;;;AAAA,2CAAiH;AACjH,uCAAqD;AACrD,4DAAwD;AACxD,4DAAwD;AACxD,wDAAoD;AACpD,kDAA8C;AAC9C,4DAA6G;AAC7G,sDAAkD;AAClD,oEAA+D;AAC/D,oFAA+E;AAC/E,0EAAqE;AAErE,uEAAmE;AACnE,qCAA0C;AAC1C,gEAA4D;A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,EAAE,kCAAe,CAAC;aAC3C;YACD;gBACE,OAAO,EAAE,gBAAS;gBAClB,QAAQ,EAAE,sBAAS;aACpB;SACF;QACD,OAAO,EAAE;YACP,kCAAe;YACf,sCAAiB;YACjB,sCAAoB;YACpB,uDAAyB;YACzB,sCAAoB;YACpB,yCAAuB;YACvB,6CAAoB;YACpB,uCAAiB;YACjB,yBAAW;YACX,8BAAa;SACd;QACD,WAAW,EAAE,CAAC,gCAAc,EAAE,kCAAe,EAAE,yCAAkB,CAAC;KACnE,CAAC;GACW,YAAY,CAsBxB"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.clearRequestScopeValue = exports.setRequestScopeValue = exports.getRequestScopeValueOrDefault = exports.getRequestScopeValue = void 0;
|
|
4
|
-
var request_scope_1 = require("./request-scope");
|
|
5
|
-
Object.defineProperty(exports, "getRequestScopeValue", { enumerable: true, get: function () { return request_scope_1.getRequestScopeValue; } });
|
|
6
|
-
Object.defineProperty(exports, "getRequestScopeValueOrDefault", { enumerable: true, get: function () { return request_scope_1.getRequestScopeValueOrDefault; } });
|
|
7
|
-
Object.defineProperty(exports, "setRequestScopeValue", { enumerable: true, get: function () { return request_scope_1.setRequestScopeValue; } });
|
|
8
|
-
Object.defineProperty(exports, "clearRequestScopeValue", { enumerable: true, get: function () { return request_scope_1.clearRequestScopeValue; } });
|
|
9
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/request-scope/index.ts"],"names":[],"mappings":";;;AACA,iDAKyB;AAJvB,qHAAA,oBAAoB,OAAA;AACpB,8HAAA,6BAA6B,OAAA;AAC7B,qHAAA,oBAAoB,OAAA;AACpB,uHAAA,sBAAsB,OAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"request-scope-interceptor.js","sourceRoot":"","sources":["../../src/request-scope/request-scope-interceptor.ts"],"names":[],"mappings":""}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export declare class NoNamespaceException extends Error {
|
|
2
|
-
constructor(message?: string);
|
|
3
|
-
}
|
|
4
|
-
export declare class InvalidKeyException extends Error {
|
|
5
|
-
constructor(key: string);
|
|
6
|
-
}
|
|
7
|
-
export declare const isRequestScopeEnabled: () => boolean;
|
|
8
|
-
export declare const getRequestScopeValueOrDefault: <T>(key: string, defaultVal: T) => T;
|
|
9
|
-
export declare const getRequestScopeValue: <T>(key: string) => T | null;
|
|
10
|
-
export declare const getRequestScopeValueRequired: <T>(key: string) => T;
|
|
11
|
-
export declare const setRequestScopeValue: <T>(key: string, value: T) => T;
|
|
12
|
-
export declare const clearRequestScopeValue: (key: string) => void;
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.clearRequestScopeValue = exports.setRequestScopeValue = exports.getRequestScopeValueRequired = exports.getRequestScopeValue = exports.getRequestScopeValueOrDefault = exports.isRequestScopeEnabled = exports.InvalidKeyException = exports.NoNamespaceException = void 0;
|
|
4
|
-
const cls_hooked_1 = require("cls-hooked");
|
|
5
|
-
const shared_utils_1 = require("@nestjs/common/utils/shared.utils");
|
|
6
|
-
const request_scope_middleware_1 = require("./request-scope.middleware");
|
|
7
|
-
class NoNamespaceException extends Error {
|
|
8
|
-
constructor(message) {
|
|
9
|
-
super(message || 'No active context namespace exists');
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
exports.NoNamespaceException = NoNamespaceException;
|
|
13
|
-
class InvalidKeyException extends Error {
|
|
14
|
-
constructor(key) {
|
|
15
|
-
super(`No request scoped value exists for key: ${key}`);
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
exports.InvalidKeyException = InvalidKeyException;
|
|
19
|
-
const getActiveContextOptional = () => {
|
|
20
|
-
if (request_scope_middleware_1.RequestScopeMiddleware.isDisabled()) {
|
|
21
|
-
return null;
|
|
22
|
-
}
|
|
23
|
-
const context = (0, cls_hooked_1.getNamespace)(request_scope_middleware_1._REQUEST_STORAGE_NAMESPACE_KEY);
|
|
24
|
-
if (!context || !context.active) {
|
|
25
|
-
return null;
|
|
26
|
-
}
|
|
27
|
-
return context;
|
|
28
|
-
};
|
|
29
|
-
const getActiveContext = () => {
|
|
30
|
-
const context = getActiveContextOptional();
|
|
31
|
-
if (!context) {
|
|
32
|
-
throw new NoNamespaceException();
|
|
33
|
-
}
|
|
34
|
-
return context;
|
|
35
|
-
};
|
|
36
|
-
const getValueFromContext = (context, key) => {
|
|
37
|
-
const value = context.get(key);
|
|
38
|
-
return (0, shared_utils_1.isNil)(value) ? null : value;
|
|
39
|
-
};
|
|
40
|
-
const isRequestScopeEnabled = () => {
|
|
41
|
-
return getActiveContextOptional() !== null;
|
|
42
|
-
};
|
|
43
|
-
exports.isRequestScopeEnabled = isRequestScopeEnabled;
|
|
44
|
-
const getRequestScopeValueOrDefault = (key, defaultVal) => {
|
|
45
|
-
const context = getActiveContextOptional();
|
|
46
|
-
if (context) {
|
|
47
|
-
const value = getValueFromContext(context, key);
|
|
48
|
-
if (!(0, shared_utils_1.isNil)(value)) {
|
|
49
|
-
return value;
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
return defaultVal;
|
|
53
|
-
};
|
|
54
|
-
exports.getRequestScopeValueOrDefault = getRequestScopeValueOrDefault;
|
|
55
|
-
const getRequestScopeValue = (key) => {
|
|
56
|
-
const context = getActiveContext();
|
|
57
|
-
return getValueFromContext(context, key);
|
|
58
|
-
};
|
|
59
|
-
exports.getRequestScopeValue = getRequestScopeValue;
|
|
60
|
-
const getRequestScopeValueRequired = (key) => {
|
|
61
|
-
const nullable = (0, exports.getRequestScopeValue)(key);
|
|
62
|
-
if (nullable === null) {
|
|
63
|
-
throw new InvalidKeyException(key);
|
|
64
|
-
}
|
|
65
|
-
return nullable;
|
|
66
|
-
};
|
|
67
|
-
exports.getRequestScopeValueRequired = getRequestScopeValueRequired;
|
|
68
|
-
const setRequestScopeValue = (key, value) => {
|
|
69
|
-
const context = getActiveContext();
|
|
70
|
-
context.set(key, value);
|
|
71
|
-
return value;
|
|
72
|
-
};
|
|
73
|
-
exports.setRequestScopeValue = setRequestScopeValue;
|
|
74
|
-
const clearRequestScopeValue = (key) => {
|
|
75
|
-
const context = getActiveContext();
|
|
76
|
-
context.set(key, null);
|
|
77
|
-
};
|
|
78
|
-
exports.clearRequestScopeValue = clearRequestScopeValue;
|
|
79
|
-
//# sourceMappingURL=request-scope.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"request-scope.js","sourceRoot":"","sources":["../../src/request-scope/request-scope.ts"],"names":[],"mappings":";;;AAAA,2CAAqD;AACrD,oEAA0D;AAC1D,yEAAoG;AAEpG,MAAa,oBAAqB,SAAQ,KAAK;IAC7C,YAAY,OAAgB;QAC1B,KAAK,CAAC,OAAO,IAAI,oCAAoC,CAAC,CAAC;IACzD,CAAC;CACF;AAJD,oDAIC;AAED,MAAa,mBAAoB,SAAQ,KAAK;IAC5C,YAAY,GAAW;QACrB,KAAK,CAAC,2CAA2C,GAAG,EAAE,CAAC,CAAC;IAC1D,CAAC;CACF;AAJD,kDAIC;AAED,MAAM,wBAAwB,GAAG,GAAqB,EAAE;IAEtD,IAAI,iDAAsB,CAAC,UAAU,EAAE,EAAE,CAAC;QACxC,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,OAAO,GAAG,IAAA,yBAAY,EAAC,yDAA8B,CAAC,CAAC;IAE7D,IAAI,CAAC,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC;QAChC,OAAO,IAAI,CAAC;IACd,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC;AAEF,MAAM,gBAAgB,GAAG,GAAc,EAAE;IACvC,MAAM,OAAO,GAAG,wBAAwB,EAAE,CAAC;IAE3C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AAE,CAAC;QACtB,MAAM,IAAI,mBAAmB,CAAC,GAAG,CAAC,CAAC;IACrC,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC,CAAC;AANW,QAAA,4BAA4B,gCAMvC;AAEK,MAAM,oBAAoB,GAAG,CAAI,GAAW,EAAE,KAAQ,EAAK,EAAE;IAClE,MAAM,OAAO,GAAG,gBAAgB,EAAE,CAAC;IACnC,OAAO,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;IACxB,OAAO,KAAK,CAAC;AACf,CAAC,CAAC;AAJW,QAAA,oBAAoB,wBAI/B;AAEK,MAAM,sBAAsB,GAAG,CAAC,GAAW,EAAE,EAAE;IACpD,MAAM,OAAO,GAAG,gBAAgB,EAAE,CAAC;IACnC,OAAO,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;AACzB,CAAC,CAAC;AAHW,QAAA,sBAAsB,0BAGjC"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { NestMiddleware } from '@nestjs/common';
|
|
2
|
-
import { Request, Response } from 'express';
|
|
3
|
-
import { RequestScopeInterceptor } from './request-scope-interceptor';
|
|
4
|
-
import { Configuration } from '../configuration';
|
|
5
|
-
export declare const _REQUEST_STORAGE_NAMESPACE_KEY = "_GAE_NODE_NESTJS_REQUEST_STORAGE";
|
|
6
|
-
export declare const REQUEST_SCOPE_INTERCEPTORS = "REQ_SCOPE_INTERCEPTORS";
|
|
7
|
-
export declare class RequestScopeMiddleware implements NestMiddleware {
|
|
8
|
-
private readonly interceptors;
|
|
9
|
-
private readonly namespace?;
|
|
10
|
-
private static enabled;
|
|
11
|
-
constructor(configurationProvider: Configuration, interceptors: RequestScopeInterceptor[]);
|
|
12
|
-
use(req: Request, res: Response, next: () => void): void;
|
|
13
|
-
static isEnabled(): boolean;
|
|
14
|
-
static isDisabled(): boolean;
|
|
15
|
-
}
|