@dereekb/firebase-server 13.2.2 → 13.3.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/index.cjs.js +7506 -1884
- package/index.esm.js +7505 -1890
- package/mailgun/index.cjs.js +333 -31
- package/mailgun/index.esm.js +333 -31
- package/mailgun/package.json +8 -8
- package/mailgun/src/lib/auth.mailgun.d.ts +22 -3
- package/model/index.cjs.js +11334 -3830
- package/model/index.esm.js +11338 -3834
- package/model/package.json +10 -10
- package/model/src/lib/mailgun/notification.send.service.mailgun.d.ts +27 -1
- package/model/src/lib/notification/notification.action.init.service.d.ts +93 -1
- package/model/src/lib/notification/notification.action.service.d.ts +151 -2
- package/model/src/lib/notification/notification.config.d.ts +19 -7
- package/model/src/lib/notification/notification.config.service.d.ts +44 -6
- package/model/src/lib/notification/notification.create.run.d.ts +33 -5
- package/model/src/lib/notification/notification.error.d.ts +63 -0
- package/model/src/lib/notification/notification.module.d.ts +11 -0
- package/model/src/lib/notification/notification.send.d.ts +8 -1
- package/model/src/lib/notification/notification.send.service.d.ts +7 -1
- package/model/src/lib/notification/notification.send.service.notificationsummary.d.ts +32 -2
- package/model/src/lib/notification/notification.send.service.text.d.ts +11 -3
- package/model/src/lib/notification/notification.task.service.d.ts +13 -1
- package/model/src/lib/notification/notification.task.service.handler.d.ts +27 -3
- package/model/src/lib/notification/notification.task.service.util.d.ts +16 -4
- package/model/src/lib/notification/notification.task.subtask.handler.d.ts +31 -1
- package/model/src/lib/notification/notification.util.d.ts +70 -0
- package/model/src/lib/storagefile/storagefile.action.init.service.d.ts +62 -1
- package/model/src/lib/storagefile/storagefile.action.server.d.ts +124 -2
- package/model/src/lib/storagefile/storagefile.error.d.ts +44 -0
- package/model/src/lib/storagefile/storagefile.module.d.ts +11 -0
- package/model/src/lib/storagefile/storagefile.task.service.handler.d.ts +4 -1
- package/model/src/lib/storagefile/storagefile.upload.service.d.ts +13 -1
- package/model/src/lib/storagefile/storagefile.upload.service.initializer.d.ts +43 -1
- package/model/src/lib/storagefile/storagefile.util.d.ts +8 -0
- package/oidc/index.cjs.default.js +1 -0
- package/oidc/index.cjs.js +5607 -0
- package/oidc/index.cjs.mjs +2 -0
- package/oidc/index.d.ts +1 -0
- package/oidc/index.esm.js +5560 -0
- package/oidc/package.json +26 -0
- package/oidc/src/index.d.ts +1 -0
- package/oidc/src/lib/controller/index.d.ts +3 -0
- package/oidc/src/lib/controller/oidc.interaction.controller.d.ts +54 -0
- package/oidc/src/lib/controller/oidc.provider.controller.d.ts +18 -0
- package/oidc/src/lib/controller/oidc.wellknown.controller.d.ts +36 -0
- package/oidc/src/lib/index.d.ts +6 -0
- package/oidc/src/lib/middleware/index.d.ts +3 -0
- package/oidc/src/lib/middleware/oauth-auth.decorator.d.ts +14 -0
- package/oidc/src/lib/middleware/oauth-auth.middleware.d.ts +21 -0
- package/oidc/src/lib/middleware/oauth-auth.module.d.ts +50 -0
- package/oidc/src/lib/model/index.d.ts +3 -0
- package/oidc/src/lib/model/jwks/index.d.ts +3 -0
- package/oidc/src/lib/model/jwks/jwks.d.ts +107 -0
- package/oidc/src/lib/model/jwks/jwks.id.d.ts +9 -0
- package/oidc/src/lib/model/jwks/jwks.query.d.ts +18 -0
- package/oidc/src/lib/model/model.d.ts +12 -0
- package/oidc/src/lib/model/oidc/index.d.ts +2 -0
- package/oidc/src/lib/model/oidc/oidcmodel.action.server.d.ts +62 -0
- package/oidc/src/lib/model/oidc/oidcmodel.module.d.ts +23 -0
- package/oidc/src/lib/oidc.config.d.ts +175 -0
- package/oidc/src/lib/oidc.module.d.ts +100 -0
- package/oidc/src/lib/service/index.d.ts +10 -0
- package/oidc/src/lib/service/oidc.account.d.ts +36 -0
- package/oidc/src/lib/service/oidc.account.service.d.ts +104 -0
- package/oidc/src/lib/service/oidc.adapter.service.d.ts +20 -0
- package/oidc/src/lib/service/oidc.auth.d.ts +26 -0
- package/oidc/src/lib/service/oidc.client.service.d.ts +57 -0
- package/oidc/src/lib/service/oidc.config.service.d.ts +100 -0
- package/oidc/src/lib/service/oidc.encryption.service.d.ts +53 -0
- package/oidc/src/lib/service/oidc.interaction.service.d.ts +44 -0
- package/oidc/src/lib/service/oidc.jwks.service.d.ts +105 -0
- package/oidc/src/lib/service/oidc.service.d.ts +55 -0
- package/package.json +21 -14
- package/src/lib/auth/auth.context.d.ts +22 -2
- package/src/lib/auth/auth.service.d.ts +5 -0
- package/src/lib/auth/auth.service.error.d.ts +2 -1
- package/src/lib/auth/auth.util.d.ts +15 -3
- package/src/lib/env/env.config.d.ts +42 -0
- package/src/lib/env/env.service.d.ts +17 -0
- package/src/lib/env/index.d.ts +1 -0
- package/src/lib/firestore/array.d.ts +11 -3
- package/src/lib/firestore/driver.accessor.batch.d.ts +27 -4
- package/src/lib/firestore/driver.accessor.d.ts +43 -0
- package/src/lib/firestore/driver.accessor.default.d.ts +20 -0
- package/src/lib/firestore/driver.accessor.transaction.d.ts +28 -4
- package/src/lib/firestore/driver.d.ts +14 -0
- package/src/lib/firestore/driver.query.d.ts +25 -0
- package/src/lib/firestore/increment.d.ts +13 -3
- package/src/lib/firestore/snapshot/index.d.ts +1 -1
- package/src/lib/firestore/snapshot/{snapshot.field.d.ts → snapshot.field.encrypt.d.ts} +13 -27
- package/src/lib/function/assert.d.ts +32 -16
- package/src/lib/function/context.d.ts +26 -0
- package/src/lib/function/error.auth.d.ts +15 -0
- package/src/lib/function/error.d.ts +68 -4
- package/src/lib/nest/app.d.ts +53 -9
- package/src/lib/nest/app.module.d.ts +90 -0
- package/src/lib/nest/auth/auth.module.d.ts +30 -4
- package/src/lib/nest/auth/auth.util.d.ts +38 -0
- package/src/lib/nest/controller/auth.context.server.d.ts +27 -0
- package/src/lib/nest/controller/index.d.ts +1 -0
- package/src/lib/nest/development/development.app.function.d.ts +45 -0
- package/src/lib/nest/development/development.assert.function.d.ts +19 -1
- package/src/lib/nest/development/development.function.d.ts +42 -3
- package/src/lib/nest/development/development.schedule.function.d.ts +29 -0
- package/src/lib/nest/development/development.schedule.function.error.d.ts +21 -0
- package/src/lib/nest/env/env.service.d.ts +9 -0
- package/src/lib/nest/env/env.util.d.ts +16 -0
- package/src/lib/nest/firebase/firebase.module.d.ts +13 -1
- package/src/lib/nest/firestore/firestore.module.d.ts +24 -8
- package/src/lib/nest/function/call.d.ts +75 -6
- package/src/lib/nest/function/context.d.ts +85 -2
- package/src/lib/nest/function/nest.d.ts +46 -0
- package/src/lib/nest/function/schedule.d.ts +49 -0
- package/src/lib/nest/function/v2/blocking.d.ts +92 -8
- package/src/lib/nest/function/v2/call.d.ts +38 -8
- package/src/lib/nest/function/v2/event.d.ts +67 -4
- package/src/lib/nest/function/v2/schedule.d.ts +36 -5
- package/src/lib/nest/index.d.ts +3 -0
- package/src/lib/nest/middleware/appcheck.d.ts +5 -0
- package/src/lib/nest/middleware/appcheck.middleware.d.ts +44 -14
- package/src/lib/nest/middleware/appcheck.module.d.ts +10 -1
- package/src/lib/nest/middleware/globalprefix.d.ts +31 -3
- package/src/lib/nest/middleware/index.d.ts +2 -1
- package/src/lib/nest/middleware/rawbody.middleware.d.ts +6 -0
- package/src/lib/nest/model/call.model.function.d.ts +69 -3
- package/src/lib/nest/model/create.model.function.d.ts +66 -0
- package/src/lib/nest/model/crud.assert.function.d.ts +27 -1
- package/src/lib/nest/model/delete.model.function.d.ts +55 -0
- package/src/lib/nest/model/permission.error.d.ts +15 -0
- package/src/lib/nest/model/read.model.function.d.ts +57 -0
- package/src/lib/nest/model/specifier.function.d.ts +58 -1
- package/src/lib/nest/model/update.model.function.d.ts +58 -0
- package/src/lib/nest/nest.provider.d.ts +24 -11
- package/src/lib/nest/nest.provider.server.d.ts +12 -0
- package/src/lib/nest/storage/storage.module.d.ts +30 -4
- package/src/lib/storage/driver.accessor.d.ts +33 -0
- package/src/lib/storage/driver.d.ts +14 -0
- package/src/lib/storage/storage.d.ts +11 -4
- package/src/lib/storage/storage.service.d.ts +10 -1
- package/src/lib/type.d.ts +7 -2
- package/test/index.cjs.js +4072 -757
- package/test/index.esm.js +4073 -761
- package/test/package.json +10 -10
- package/test/src/lib/firebase/firebase.admin.auth.d.ts +82 -1
- package/test/src/lib/firebase/firebase.admin.collection.d.ts +55 -3
- package/test/src/lib/firebase/firebase.admin.d.ts +64 -0
- package/test/src/lib/firebase/firebase.admin.function.d.ts +84 -0
- package/test/src/lib/firebase/firebase.admin.nest.d.ts +125 -17
- package/test/src/lib/firebase/firebase.admin.nest.function.callable.context.d.ts +44 -0
- package/test/src/lib/firebase/firebase.admin.nest.function.cloud.context.d.ts +41 -0
- package/test/src/lib/firebase/firebase.admin.nest.function.d.ts +98 -0
- package/test/src/lib/firebase/firebase.admin.test.server.d.ts +26 -0
- package/test/src/lib/firebase/firebase.d.ts +57 -2
- package/test/src/lib/firebase/firebase.function.d.ts +138 -0
- package/test/src/lib/firestore/firestore.admin.d.ts +6 -0
- package/test/src/lib/firestore/firestore.d.ts +30 -0
- package/test/src/lib/storage/storage.admin.d.ts +9 -3
- package/test/src/lib/storage/storage.d.ts +30 -0
- package/zoho/index.cjs.js +406 -73
- package/zoho/index.esm.js +406 -73
- package/zoho/package.json +8 -8
- package/zoho/src/lib/zoho.accounts.firebase.d.ts +13 -2
- package/zoho/src/lib/zoho.accounts.firebase.system.d.ts +29 -6
- package/index.cjs.js.map +0 -1
- package/index.esm.js.map +0 -1
- /package/src/lib/nest/middleware/{webhook.d.ts → webhook.module.d.ts} +0 -0
package/mailgun/index.cjs.js
CHANGED
|
@@ -2,40 +2,342 @@
|
|
|
2
2
|
|
|
3
3
|
var firebaseServer = require('@dereekb/firebase-server');
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
5
|
+
function _assert_this_initialized(self) {
|
|
6
|
+
if (self === void 0) {
|
|
7
|
+
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
8
|
+
}
|
|
9
|
+
return self;
|
|
10
|
+
}
|
|
11
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
12
|
+
try {
|
|
13
|
+
var info = gen[key](arg);
|
|
14
|
+
var value = info.value;
|
|
15
|
+
} catch (error) {
|
|
16
|
+
reject(error);
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
if (info.done) {
|
|
20
|
+
resolve(value);
|
|
21
|
+
} else {
|
|
22
|
+
Promise.resolve(value).then(_next, _throw);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
function _async_to_generator(fn) {
|
|
26
|
+
return function() {
|
|
27
|
+
var self = this, args = arguments;
|
|
28
|
+
return new Promise(function(resolve, reject) {
|
|
29
|
+
var gen = fn.apply(self, args);
|
|
30
|
+
function _next(value) {
|
|
31
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
|
32
|
+
}
|
|
33
|
+
function _throw(err) {
|
|
34
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
|
35
|
+
}
|
|
36
|
+
_next(undefined);
|
|
37
|
+
});
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
function _call_super(_this, derived, args) {
|
|
41
|
+
derived = _get_prototype_of(derived);
|
|
42
|
+
return _possible_constructor_return(_this, _is_native_reflect_construct() ? Reflect.construct(derived, args || [], _get_prototype_of(_this).constructor) : derived.apply(_this, args));
|
|
43
|
+
}
|
|
44
|
+
function _class_call_check(instance, Constructor) {
|
|
45
|
+
if (!(instance instanceof Constructor)) {
|
|
46
|
+
throw new TypeError("Cannot call a class as a function");
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
function _defineProperties(target, props) {
|
|
50
|
+
for(var i = 0; i < props.length; i++){
|
|
51
|
+
var descriptor = props[i];
|
|
52
|
+
descriptor.enumerable = descriptor.enumerable || false;
|
|
53
|
+
descriptor.configurable = true;
|
|
54
|
+
if ("value" in descriptor) descriptor.writable = true;
|
|
55
|
+
Object.defineProperty(target, descriptor.key, descriptor);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
function _create_class(Constructor, protoProps, staticProps) {
|
|
59
|
+
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
60
|
+
return Constructor;
|
|
61
|
+
}
|
|
62
|
+
function _define_property(obj, key, value) {
|
|
63
|
+
if (key in obj) {
|
|
64
|
+
Object.defineProperty(obj, key, {
|
|
65
|
+
value: value,
|
|
66
|
+
enumerable: true,
|
|
67
|
+
configurable: true,
|
|
68
|
+
writable: true
|
|
69
|
+
});
|
|
70
|
+
} else {
|
|
71
|
+
obj[key] = value;
|
|
72
|
+
}
|
|
73
|
+
return obj;
|
|
74
|
+
}
|
|
75
|
+
function _get_prototype_of(o) {
|
|
76
|
+
_get_prototype_of = Object.setPrototypeOf ? Object.getPrototypeOf : function getPrototypeOf(o) {
|
|
77
|
+
return o.__proto__ || Object.getPrototypeOf(o);
|
|
78
|
+
};
|
|
79
|
+
return _get_prototype_of(o);
|
|
80
|
+
}
|
|
81
|
+
function _inherits(subClass, superClass) {
|
|
82
|
+
if (typeof superClass !== "function" && superClass !== null) {
|
|
83
|
+
throw new TypeError("Super expression must either be null or a function");
|
|
84
|
+
}
|
|
85
|
+
subClass.prototype = Object.create(superClass && superClass.prototype, {
|
|
86
|
+
constructor: {
|
|
87
|
+
value: subClass,
|
|
88
|
+
writable: true,
|
|
89
|
+
configurable: true
|
|
20
90
|
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
91
|
+
});
|
|
92
|
+
if (superClass) _set_prototype_of(subClass, superClass);
|
|
93
|
+
}
|
|
94
|
+
function _object_spread(target) {
|
|
95
|
+
for(var i = 1; i < arguments.length; i++){
|
|
96
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
|
97
|
+
var ownKeys = Object.keys(source);
|
|
98
|
+
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
99
|
+
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
100
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
101
|
+
}));
|
|
102
|
+
}
|
|
103
|
+
ownKeys.forEach(function(key) {
|
|
104
|
+
_define_property(target, key, source[key]);
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
return target;
|
|
108
|
+
}
|
|
109
|
+
function ownKeys(object, enumerableOnly) {
|
|
110
|
+
var keys = Object.keys(object);
|
|
111
|
+
if (Object.getOwnPropertySymbols) {
|
|
112
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
113
|
+
keys.push.apply(keys, symbols);
|
|
114
|
+
}
|
|
115
|
+
return keys;
|
|
116
|
+
}
|
|
117
|
+
function _object_spread_props(target, source) {
|
|
118
|
+
source = source != null ? source : {};
|
|
119
|
+
if (Object.getOwnPropertyDescriptors) {
|
|
120
|
+
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
121
|
+
} else {
|
|
122
|
+
ownKeys(Object(source)).forEach(function(key) {
|
|
123
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
37
124
|
});
|
|
38
125
|
}
|
|
126
|
+
return target;
|
|
127
|
+
}
|
|
128
|
+
function _possible_constructor_return(self, call) {
|
|
129
|
+
if (call && (_type_of(call) === "object" || typeof call === "function")) {
|
|
130
|
+
return call;
|
|
131
|
+
}
|
|
132
|
+
return _assert_this_initialized(self);
|
|
133
|
+
}
|
|
134
|
+
function _set_prototype_of(o, p) {
|
|
135
|
+
_set_prototype_of = Object.setPrototypeOf || function setPrototypeOf(o, p) {
|
|
136
|
+
o.__proto__ = p;
|
|
137
|
+
return o;
|
|
138
|
+
};
|
|
139
|
+
return _set_prototype_of(o, p);
|
|
140
|
+
}
|
|
141
|
+
function _type_of(obj) {
|
|
142
|
+
"@swc/helpers - typeof";
|
|
143
|
+
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
39
144
|
}
|
|
145
|
+
function _is_native_reflect_construct() {
|
|
146
|
+
try {
|
|
147
|
+
var result = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
|
|
148
|
+
} catch (_) {}
|
|
149
|
+
return (_is_native_reflect_construct = function() {
|
|
150
|
+
return !!result;
|
|
151
|
+
})();
|
|
152
|
+
}
|
|
153
|
+
function _ts_generator(thisArg, body) {
|
|
154
|
+
var f, y, t, _ = {
|
|
155
|
+
label: 0,
|
|
156
|
+
sent: function() {
|
|
157
|
+
if (t[0] & 1) throw t[1];
|
|
158
|
+
return t[1];
|
|
159
|
+
},
|
|
160
|
+
trys: [],
|
|
161
|
+
ops: []
|
|
162
|
+
}, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype), d = Object.defineProperty;
|
|
163
|
+
return d(g, "next", {
|
|
164
|
+
value: verb(0)
|
|
165
|
+
}), d(g, "throw", {
|
|
166
|
+
value: verb(1)
|
|
167
|
+
}), d(g, "return", {
|
|
168
|
+
value: verb(2)
|
|
169
|
+
}), typeof Symbol === "function" && d(g, Symbol.iterator, {
|
|
170
|
+
value: function() {
|
|
171
|
+
return this;
|
|
172
|
+
}
|
|
173
|
+
}), g;
|
|
174
|
+
function verb(n) {
|
|
175
|
+
return function(v) {
|
|
176
|
+
return step([
|
|
177
|
+
n,
|
|
178
|
+
v
|
|
179
|
+
]);
|
|
180
|
+
};
|
|
181
|
+
}
|
|
182
|
+
function step(op) {
|
|
183
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
184
|
+
while(g && (g = 0, op[0] && (_ = 0)), _)try {
|
|
185
|
+
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;
|
|
186
|
+
if (y = 0, t) op = [
|
|
187
|
+
op[0] & 2,
|
|
188
|
+
t.value
|
|
189
|
+
];
|
|
190
|
+
switch(op[0]){
|
|
191
|
+
case 0:
|
|
192
|
+
case 1:
|
|
193
|
+
t = op;
|
|
194
|
+
break;
|
|
195
|
+
case 4:
|
|
196
|
+
_.label++;
|
|
197
|
+
return {
|
|
198
|
+
value: op[1],
|
|
199
|
+
done: false
|
|
200
|
+
};
|
|
201
|
+
case 5:
|
|
202
|
+
_.label++;
|
|
203
|
+
y = op[1];
|
|
204
|
+
op = [
|
|
205
|
+
0
|
|
206
|
+
];
|
|
207
|
+
continue;
|
|
208
|
+
case 7:
|
|
209
|
+
op = _.ops.pop();
|
|
210
|
+
_.trys.pop();
|
|
211
|
+
continue;
|
|
212
|
+
default:
|
|
213
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
214
|
+
_ = 0;
|
|
215
|
+
continue;
|
|
216
|
+
}
|
|
217
|
+
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
218
|
+
_.label = op[1];
|
|
219
|
+
break;
|
|
220
|
+
}
|
|
221
|
+
if (op[0] === 6 && _.label < t[1]) {
|
|
222
|
+
_.label = t[1];
|
|
223
|
+
t = op;
|
|
224
|
+
break;
|
|
225
|
+
}
|
|
226
|
+
if (t && _.label < t[2]) {
|
|
227
|
+
_.label = t[2];
|
|
228
|
+
_.ops.push(op);
|
|
229
|
+
break;
|
|
230
|
+
}
|
|
231
|
+
if (t[2]) _.ops.pop();
|
|
232
|
+
_.trys.pop();
|
|
233
|
+
continue;
|
|
234
|
+
}
|
|
235
|
+
op = body.call(thisArg, _);
|
|
236
|
+
} catch (e) {
|
|
237
|
+
op = [
|
|
238
|
+
6,
|
|
239
|
+
e
|
|
240
|
+
];
|
|
241
|
+
y = 0;
|
|
242
|
+
} finally{
|
|
243
|
+
f = t = 0;
|
|
244
|
+
}
|
|
245
|
+
if (op[0] & 5) throw op[1];
|
|
246
|
+
return {
|
|
247
|
+
value: op[0] ? op[1] : void 0,
|
|
248
|
+
done: true
|
|
249
|
+
};
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
/**
|
|
253
|
+
* Abstract {@link FirebaseServerNewUserService} implementation that sends a welcome/setup email
|
|
254
|
+
* to newly created users via Mailgun templates.
|
|
255
|
+
*
|
|
256
|
+
* Subclasses implement `buildNewUserMailgunContentRequest` to define the template, subject,
|
|
257
|
+
* and any custom variables. The user's email, display name, UID, and setup password are
|
|
258
|
+
* automatically injected as Mailgun user variables.
|
|
259
|
+
*
|
|
260
|
+
* @example
|
|
261
|
+
* ```ts
|
|
262
|
+
* class WelcomeEmailService extends AbstractMailgunContentFirebaseServerNewUserService {
|
|
263
|
+
* protected async buildNewUserMailgunContentRequest(user) {
|
|
264
|
+
* return {
|
|
265
|
+
* template: 'welcome',
|
|
266
|
+
* subject: 'Welcome!',
|
|
267
|
+
* from: 'noreply@example.com'
|
|
268
|
+
* };
|
|
269
|
+
* }
|
|
270
|
+
* }
|
|
271
|
+
* ```
|
|
272
|
+
*/ var AbstractMailgunContentFirebaseServerNewUserService = /*#__PURE__*/ function(AbstractFirebaseServerNewUserService) {
|
|
273
|
+
_inherits(AbstractMailgunContentFirebaseServerNewUserService, AbstractFirebaseServerNewUserService);
|
|
274
|
+
function AbstractMailgunContentFirebaseServerNewUserService(authService, mailgunService) {
|
|
275
|
+
_class_call_check(this, AbstractMailgunContentFirebaseServerNewUserService);
|
|
276
|
+
var _this;
|
|
277
|
+
_this = _call_super(this, AbstractMailgunContentFirebaseServerNewUserService, [
|
|
278
|
+
authService
|
|
279
|
+
]), _define_property(_this, "mailgunService", void 0);
|
|
280
|
+
_this.mailgunService = mailgunService;
|
|
281
|
+
return _this;
|
|
282
|
+
}
|
|
283
|
+
_create_class(AbstractMailgunContentFirebaseServerNewUserService, [
|
|
284
|
+
{
|
|
285
|
+
key: "sendSetupContentToUser",
|
|
286
|
+
value: function sendSetupContentToUser(user) {
|
|
287
|
+
return _async_to_generator(function() {
|
|
288
|
+
var userRecord, setupPassword, uid, displayName, email, baseRequest, baseRequestTo;
|
|
289
|
+
return _ts_generator(this, function(_state) {
|
|
290
|
+
switch(_state.label){
|
|
291
|
+
case 0:
|
|
292
|
+
return [
|
|
293
|
+
4,
|
|
294
|
+
user.userContext.loadRecord()
|
|
295
|
+
];
|
|
296
|
+
case 1:
|
|
297
|
+
userRecord = _state.sent();
|
|
298
|
+
setupPassword = user.claims.setupPassword;
|
|
299
|
+
uid = userRecord.uid, displayName = userRecord.displayName, email = userRecord.email;
|
|
300
|
+
if (!email) {
|
|
301
|
+
throw new Error('Email is not present/available for the user record "'.concat(userRecord.uid, '"'));
|
|
302
|
+
}
|
|
303
|
+
return [
|
|
304
|
+
4,
|
|
305
|
+
this.buildNewUserMailgunContentRequest(user)
|
|
306
|
+
];
|
|
307
|
+
case 2:
|
|
308
|
+
baseRequest = _state.sent();
|
|
309
|
+
baseRequestTo = baseRequest.to;
|
|
310
|
+
return [
|
|
311
|
+
4,
|
|
312
|
+
this.mailgunService.sendTemplateEmail(_object_spread_props(_object_spread({
|
|
313
|
+
batchSend: false
|
|
314
|
+
}, baseRequest), {
|
|
315
|
+
to: {
|
|
316
|
+
name: baseRequestTo === null || baseRequestTo === void 0 ? void 0 : baseRequestTo.name,
|
|
317
|
+
email: email,
|
|
318
|
+
userVariables: _object_spread_props(_object_spread({
|
|
319
|
+
setupPassword: setupPassword
|
|
320
|
+
}, baseRequestTo === null || baseRequestTo === void 0 ? void 0 : baseRequestTo.userVariables), {
|
|
321
|
+
displayName: displayName,
|
|
322
|
+
uid: uid
|
|
323
|
+
})
|
|
324
|
+
},
|
|
325
|
+
sendTestEmails: baseRequest.sendTestEmails || user.sendDetailsInTestEnvironment || undefined
|
|
326
|
+
}))
|
|
327
|
+
];
|
|
328
|
+
case 3:
|
|
329
|
+
_state.sent();
|
|
330
|
+
return [
|
|
331
|
+
2
|
|
332
|
+
];
|
|
333
|
+
}
|
|
334
|
+
});
|
|
335
|
+
}).call(this);
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
]);
|
|
339
|
+
return AbstractMailgunContentFirebaseServerNewUserService;
|
|
340
|
+
}
|
|
341
|
+
(firebaseServer.AbstractFirebaseServerNewUserService);
|
|
40
342
|
|
|
41
343
|
exports.AbstractMailgunContentFirebaseServerNewUserService = AbstractMailgunContentFirebaseServerNewUserService;
|