@dereekb/firebase-server 13.11.10 → 13.11.12
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 +6 -3
- package/index.esm.js +6 -3
- package/mailgun/package.json +9 -9
- package/model/index.cjs.js +1125 -284
- package/model/index.esm.js +1116 -285
- package/model/package.json +12 -10
- package/model/src/lib/storagefile/extension/compress.image.d.ts +94 -0
- package/model/src/lib/storagefile/extension/compress.pdf.d.ts +78 -0
- package/model/src/lib/storagefile/extension/index.d.ts +2 -0
- package/model/src/lib/storagefile/index.d.ts +1 -0
- package/oidc/index.cjs.js +5 -2
- package/oidc/index.esm.js +5 -2
- package/oidc/package.json +10 -10
- package/package.json +10 -10
- package/test/package.json +11 -11
- package/zoho/package.json +9 -9
package/model/index.esm.js
CHANGED
|
@@ -6,17 +6,19 @@ import { hoursToMilliseconds, addHours, isFuture, addMinutes, addSeconds, addDay
|
|
|
6
6
|
import { Optional, Inject, Injectable, Module, Global } from '@nestjs/common';
|
|
7
7
|
import { ConfigModule } from '@nestjs/config';
|
|
8
8
|
import { BaseError } from 'make-error';
|
|
9
|
+
import sharp from 'sharp';
|
|
10
|
+
import { PDFName, PDFDocument, PDFRawStream, PDFArray } from '@cantoo/pdf-lib';
|
|
9
11
|
import archiver from 'archiver';
|
|
10
12
|
|
|
11
|
-
function _array_like_to_array$
|
|
13
|
+
function _array_like_to_array$9(arr, len) {
|
|
12
14
|
if (len == null || len > arr.length) len = arr.length;
|
|
13
15
|
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
14
16
|
return arr2;
|
|
15
17
|
}
|
|
16
|
-
function _array_with_holes$
|
|
18
|
+
function _array_with_holes$4(arr) {
|
|
17
19
|
if (Array.isArray(arr)) return arr;
|
|
18
20
|
}
|
|
19
|
-
function asyncGeneratorStep$
|
|
21
|
+
function asyncGeneratorStep$h(gen, resolve, reject, _next, _throw, key, arg) {
|
|
20
22
|
try {
|
|
21
23
|
var info = gen[key](arg);
|
|
22
24
|
var value = info.value;
|
|
@@ -30,22 +32,22 @@ function asyncGeneratorStep$f(gen, resolve, reject, _next, _throw, key, arg) {
|
|
|
30
32
|
Promise.resolve(value).then(_next, _throw);
|
|
31
33
|
}
|
|
32
34
|
}
|
|
33
|
-
function _async_to_generator$
|
|
35
|
+
function _async_to_generator$h(fn) {
|
|
34
36
|
return function() {
|
|
35
37
|
var self = this, args = arguments;
|
|
36
38
|
return new Promise(function(resolve, reject) {
|
|
37
39
|
var gen = fn.apply(self, args);
|
|
38
40
|
function _next(value) {
|
|
39
|
-
asyncGeneratorStep$
|
|
41
|
+
asyncGeneratorStep$h(gen, resolve, reject, _next, _throw, "next", value);
|
|
40
42
|
}
|
|
41
43
|
function _throw(err) {
|
|
42
|
-
asyncGeneratorStep$
|
|
44
|
+
asyncGeneratorStep$h(gen, resolve, reject, _next, _throw, "throw", err);
|
|
43
45
|
}
|
|
44
46
|
_next(undefined);
|
|
45
47
|
});
|
|
46
48
|
};
|
|
47
49
|
}
|
|
48
|
-
function _iterable_to_array_limit$
|
|
50
|
+
function _iterable_to_array_limit$4(arr, i) {
|
|
49
51
|
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
50
52
|
if (_i == null) return;
|
|
51
53
|
var _arr = [];
|
|
@@ -69,21 +71,21 @@ function _iterable_to_array_limit$3(arr, i) {
|
|
|
69
71
|
}
|
|
70
72
|
return _arr;
|
|
71
73
|
}
|
|
72
|
-
function _non_iterable_rest$
|
|
74
|
+
function _non_iterable_rest$4() {
|
|
73
75
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
74
76
|
}
|
|
75
|
-
function _sliced_to_array$
|
|
76
|
-
return _array_with_holes$
|
|
77
|
+
function _sliced_to_array$4(arr, i) {
|
|
78
|
+
return _array_with_holes$4(arr) || _iterable_to_array_limit$4(arr, i) || _unsupported_iterable_to_array$9(arr, i) || _non_iterable_rest$4();
|
|
77
79
|
}
|
|
78
|
-
function _unsupported_iterable_to_array$
|
|
80
|
+
function _unsupported_iterable_to_array$9(o, minLen) {
|
|
79
81
|
if (!o) return;
|
|
80
|
-
if (typeof o === "string") return _array_like_to_array$
|
|
82
|
+
if (typeof o === "string") return _array_like_to_array$9(o, minLen);
|
|
81
83
|
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
82
84
|
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
83
85
|
if (n === "Map" || n === "Set") return Array.from(n);
|
|
84
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$
|
|
86
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$9(o, minLen);
|
|
85
87
|
}
|
|
86
|
-
function _ts_generator$
|
|
88
|
+
function _ts_generator$h(thisArg, body) {
|
|
87
89
|
var f, y, t, _ = {
|
|
88
90
|
label: 0,
|
|
89
91
|
sent: function() {
|
|
@@ -212,9 +214,9 @@ var MAILGUN_NOTIFICATION_EMAIL_SEND_SERVICE_DEFAULT_MAX_BATCH_SIZE_PER_REQUEST =
|
|
|
212
214
|
var maxBatchSizePerRequest = inputMaxBatchSizePerRequest !== null && inputMaxBatchSizePerRequest !== void 0 ? inputMaxBatchSizePerRequest : MAILGUN_NOTIFICATION_EMAIL_SEND_SERVICE_DEFAULT_MAX_BATCH_SIZE_PER_REQUEST;
|
|
213
215
|
var sendService = {
|
|
214
216
|
buildSendInstanceForEmailNotificationMessages: function buildSendInstanceForEmailNotificationMessages(notificationMessages) {
|
|
215
|
-
return _async_to_generator$
|
|
217
|
+
return _async_to_generator$h(function() {
|
|
216
218
|
var templateMap, messageSendBatches, templateRequestArrays, templateRequests, sendFn;
|
|
217
|
-
return _ts_generator$
|
|
219
|
+
return _ts_generator$h(this, function(_state) {
|
|
218
220
|
switch(_state.label){
|
|
219
221
|
case 0:
|
|
220
222
|
templateMap = multiValueMapBuilder();
|
|
@@ -230,7 +232,7 @@ var MAILGUN_NOTIFICATION_EMAIL_SEND_SERVICE_DEFAULT_MAX_BATCH_SIZE_PER_REQUEST =
|
|
|
230
232
|
});
|
|
231
233
|
// build send batches
|
|
232
234
|
messageSendBatches = templateMap.entries().flatMap(function(param) {
|
|
233
|
-
var _param = _sliced_to_array$
|
|
235
|
+
var _param = _sliced_to_array$4(param, 2), templateType = _param[0], messages = _param[1];
|
|
234
236
|
return batch(messages, maxBatchSizePerRequest).map(function(x) {
|
|
235
237
|
return [
|
|
236
238
|
templateType,
|
|
@@ -241,10 +243,10 @@ var MAILGUN_NOTIFICATION_EMAIL_SEND_SERVICE_DEFAULT_MAX_BATCH_SIZE_PER_REQUEST =
|
|
|
241
243
|
return [
|
|
242
244
|
4,
|
|
243
245
|
Promise.all(messageSendBatches.map(function(param) {
|
|
244
|
-
var _param = _sliced_to_array$
|
|
245
|
-
return _async_to_generator$
|
|
246
|
+
var _param = _sliced_to_array$4(param, 2), sendTemplateName = _param[0], messages = _param[1];
|
|
247
|
+
return _async_to_generator$h(function() {
|
|
246
248
|
var sendTemplateNameToLowercase, builderForKey, input;
|
|
247
|
-
return _ts_generator$
|
|
249
|
+
return _ts_generator$h(this, function(_state) {
|
|
248
250
|
sendTemplateNameToLowercase = sendTemplateName.toLowerCase();
|
|
249
251
|
builderForKey = lowercaseKeysMessageBuilders[sendTemplateNameToLowercase];
|
|
250
252
|
if (!builderForKey) {
|
|
@@ -268,9 +270,9 @@ var MAILGUN_NOTIFICATION_EMAIL_SEND_SERVICE_DEFAULT_MAX_BATCH_SIZE_PER_REQUEST =
|
|
|
268
270
|
templateRequestArrays = _state.sent();
|
|
269
271
|
templateRequests = templateRequestArrays.flat();
|
|
270
272
|
sendFn = function sendFn() {
|
|
271
|
-
return _async_to_generator$
|
|
273
|
+
return _async_to_generator$h(function() {
|
|
272
274
|
var success, failed, result;
|
|
273
|
-
return _ts_generator$
|
|
275
|
+
return _ts_generator$h(this, function(_state) {
|
|
274
276
|
switch(_state.label){
|
|
275
277
|
case 0:
|
|
276
278
|
success = [];
|
|
@@ -462,15 +464,15 @@ var MAILGUN_NOTIFICATION_EMAIL_SEND_SERVICE_DEFAULT_MAX_BATCH_SIZE_PER_REQUEST =
|
|
|
462
464
|
});
|
|
463
465
|
}
|
|
464
466
|
|
|
465
|
-
function _array_like_to_array$
|
|
467
|
+
function _array_like_to_array$8(arr, len) {
|
|
466
468
|
if (len == null || len > arr.length) len = arr.length;
|
|
467
469
|
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
468
470
|
return arr2;
|
|
469
471
|
}
|
|
470
472
|
function _array_without_holes$6(arr) {
|
|
471
|
-
if (Array.isArray(arr)) return _array_like_to_array$
|
|
473
|
+
if (Array.isArray(arr)) return _array_like_to_array$8(arr);
|
|
472
474
|
}
|
|
473
|
-
function asyncGeneratorStep$
|
|
475
|
+
function asyncGeneratorStep$g(gen, resolve, reject, _next, _throw, key, arg) {
|
|
474
476
|
try {
|
|
475
477
|
var info = gen[key](arg);
|
|
476
478
|
var value = info.value;
|
|
@@ -484,16 +486,16 @@ function asyncGeneratorStep$e(gen, resolve, reject, _next, _throw, key, arg) {
|
|
|
484
486
|
Promise.resolve(value).then(_next, _throw);
|
|
485
487
|
}
|
|
486
488
|
}
|
|
487
|
-
function _async_to_generator$
|
|
489
|
+
function _async_to_generator$g(fn) {
|
|
488
490
|
return function() {
|
|
489
491
|
var self = this, args = arguments;
|
|
490
492
|
return new Promise(function(resolve, reject) {
|
|
491
493
|
var gen = fn.apply(self, args);
|
|
492
494
|
function _next(value) {
|
|
493
|
-
asyncGeneratorStep$
|
|
495
|
+
asyncGeneratorStep$g(gen, resolve, reject, _next, _throw, "next", value);
|
|
494
496
|
}
|
|
495
497
|
function _throw(err) {
|
|
496
|
-
asyncGeneratorStep$
|
|
498
|
+
asyncGeneratorStep$g(gen, resolve, reject, _next, _throw, "throw", err);
|
|
497
499
|
}
|
|
498
500
|
_next(undefined);
|
|
499
501
|
});
|
|
@@ -553,17 +555,17 @@ function _object_spread_props$b(target, source) {
|
|
|
553
555
|
return target;
|
|
554
556
|
}
|
|
555
557
|
function _to_consumable_array$6(arr) {
|
|
556
|
-
return _array_without_holes$6(arr) || _iterable_to_array$6(arr) || _unsupported_iterable_to_array$
|
|
558
|
+
return _array_without_holes$6(arr) || _iterable_to_array$6(arr) || _unsupported_iterable_to_array$8(arr) || _non_iterable_spread$6();
|
|
557
559
|
}
|
|
558
|
-
function _unsupported_iterable_to_array$
|
|
560
|
+
function _unsupported_iterable_to_array$8(o, minLen) {
|
|
559
561
|
if (!o) return;
|
|
560
|
-
if (typeof o === "string") return _array_like_to_array$
|
|
562
|
+
if (typeof o === "string") return _array_like_to_array$8(o, minLen);
|
|
561
563
|
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
562
564
|
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
563
565
|
if (n === "Map" || n === "Set") return Array.from(n);
|
|
564
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$
|
|
566
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$8(o, minLen);
|
|
565
567
|
}
|
|
566
|
-
function _ts_generator$
|
|
568
|
+
function _ts_generator$g(thisArg, body) {
|
|
567
569
|
var f, y, t, _ = {
|
|
568
570
|
label: 0,
|
|
569
571
|
sent: function() {
|
|
@@ -696,7 +698,7 @@ function _ts_generator$e(thisArg, body) {
|
|
|
696
698
|
* @param input - the notification, box, auth service, and recipient configuration
|
|
697
699
|
* @returns channel-specific recipient lists (email, text, notification summary) ready for delivery
|
|
698
700
|
*/ function expandNotificationRecipients(input) {
|
|
699
|
-
return _async_to_generator$
|
|
701
|
+
return _async_to_generator$g(function() {
|
|
700
702
|
var _ref, notificationUserAccessor, authService, notification, notificationBox, inputGlobalRecipients, recipientFlagOverride, inputNotificationSummaryIdForUid, inputOnlySendToExplicitlyEnabledRecipients, inputOnlyTextExplicitlyEnabledRecipients, notificationBoxId, notificationSummaryIdForUid, notificationTemplateType, recipientFlag, onlyTextExplicitlyEnabledRecipients, onlySendToExplicitlyEnabledRecipients, onlyEmailExplicitlyEnabledRecipients, onlySendNotificationSummaryExplicitlyEnabledRecipients, _allowedNotificationRecipients, canSendToGlobalRecipients, canSendToBoxRecipients, canSendToExplicitRecipients, initialExplicitRecipients, initialGlobalRecipients, explicitRecipients, globalRecipients, explicitAndGlobalRecipients, allBoxRecipientConfigs, recipientUids, relevantBoxRecipientConfigs, nonNotificationBoxUidRecipientConfigs, otherNotificationUserUidOptOuts, otherNotificationUserUidSendExclusions, notificationUserRecipientConfigs, nonNotificationBoxRecipientUids, notificationUserDocuments, notificationUsers, otherRecipientConfigs, explicitOtherRecipientEmailAddresses, explicitOtherRecipientTextNumbers, explicitOtherRecipientNotificationSummaryIds, allUserDetails, userDetailsMap, _internal, emails, emailUidsSet, texts, textUidsSet, notificationSummaries, notificationSummaryKeysSet, notificationSummaryUidsSet, result;
|
|
701
703
|
function checkShouldSendEmail(sendEmailEnabled) {
|
|
702
704
|
return !onlyEmailExplicitlyEnabledRecipients && sendEmailEnabled !== false || onlyEmailExplicitlyEnabledRecipients && sendEmailEnabled === true;
|
|
@@ -707,7 +709,7 @@ function _ts_generator$e(thisArg, body) {
|
|
|
707
709
|
function checkShouldSendNotificationSummary(sendNotificationSummaryEnabled) {
|
|
708
710
|
return !onlySendNotificationSummaryExplicitlyEnabledRecipients && sendNotificationSummaryEnabled !== false || onlySendNotificationSummaryExplicitlyEnabledRecipients && sendNotificationSummaryEnabled === true;
|
|
709
711
|
}
|
|
710
|
-
return _ts_generator$
|
|
712
|
+
return _ts_generator$g(this, function(_state) {
|
|
711
713
|
switch(_state.label){
|
|
712
714
|
case 0:
|
|
713
715
|
notificationUserAccessor = input.notificationUserAccessor, authService = input.authService, notification = input.notification, notificationBox = input.notificationBox, inputGlobalRecipients = input.globalRecipients, recipientFlagOverride = input.recipientFlagOverride, inputNotificationSummaryIdForUid = input.notificationSummaryIdForUid, inputOnlySendToExplicitlyEnabledRecipients = input.onlySendToExplicitlyEnabledRecipients, inputOnlyTextExplicitlyEnabledRecipients = input.onlyTextExplicitlyEnabledRecipients;
|
|
@@ -1221,18 +1223,18 @@ function _ts_generator$e(thisArg, body) {
|
|
|
1221
1223
|
return result;
|
|
1222
1224
|
}
|
|
1223
1225
|
|
|
1224
|
-
function _array_like_to_array$
|
|
1226
|
+
function _array_like_to_array$7(arr, len) {
|
|
1225
1227
|
if (len == null || len > arr.length) len = arr.length;
|
|
1226
1228
|
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
1227
1229
|
return arr2;
|
|
1228
1230
|
}
|
|
1229
|
-
function _array_with_holes$
|
|
1231
|
+
function _array_with_holes$3(arr) {
|
|
1230
1232
|
if (Array.isArray(arr)) return arr;
|
|
1231
1233
|
}
|
|
1232
1234
|
function _array_without_holes$5(arr) {
|
|
1233
|
-
if (Array.isArray(arr)) return _array_like_to_array$
|
|
1235
|
+
if (Array.isArray(arr)) return _array_like_to_array$7(arr);
|
|
1234
1236
|
}
|
|
1235
|
-
function asyncGeneratorStep$
|
|
1237
|
+
function asyncGeneratorStep$f(gen, resolve, reject, _next, _throw, key, arg) {
|
|
1236
1238
|
try {
|
|
1237
1239
|
var info = gen[key](arg);
|
|
1238
1240
|
var value = info.value;
|
|
@@ -1246,16 +1248,16 @@ function asyncGeneratorStep$d(gen, resolve, reject, _next, _throw, key, arg) {
|
|
|
1246
1248
|
Promise.resolve(value).then(_next, _throw);
|
|
1247
1249
|
}
|
|
1248
1250
|
}
|
|
1249
|
-
function _async_to_generator$
|
|
1251
|
+
function _async_to_generator$f(fn) {
|
|
1250
1252
|
return function() {
|
|
1251
1253
|
var self = this, args = arguments;
|
|
1252
1254
|
return new Promise(function(resolve, reject) {
|
|
1253
1255
|
var gen = fn.apply(self, args);
|
|
1254
1256
|
function _next(value) {
|
|
1255
|
-
asyncGeneratorStep$
|
|
1257
|
+
asyncGeneratorStep$f(gen, resolve, reject, _next, _throw, "next", value);
|
|
1256
1258
|
}
|
|
1257
1259
|
function _throw(err) {
|
|
1258
|
-
asyncGeneratorStep$
|
|
1260
|
+
asyncGeneratorStep$f(gen, resolve, reject, _next, _throw, "throw", err);
|
|
1259
1261
|
}
|
|
1260
1262
|
_next(undefined);
|
|
1261
1263
|
});
|
|
@@ -1282,7 +1284,7 @@ function _define_property$c(obj, key, value) {
|
|
|
1282
1284
|
function _iterable_to_array$5(iter) {
|
|
1283
1285
|
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
1284
1286
|
}
|
|
1285
|
-
function _iterable_to_array_limit$
|
|
1287
|
+
function _iterable_to_array_limit$3(arr, i) {
|
|
1286
1288
|
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
1287
1289
|
if (_i == null) return;
|
|
1288
1290
|
var _arr = [];
|
|
@@ -1306,7 +1308,7 @@ function _iterable_to_array_limit$2(arr, i) {
|
|
|
1306
1308
|
}
|
|
1307
1309
|
return _arr;
|
|
1308
1310
|
}
|
|
1309
|
-
function _non_iterable_rest$
|
|
1311
|
+
function _non_iterable_rest$3() {
|
|
1310
1312
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
1311
1313
|
}
|
|
1312
1314
|
function _non_iterable_spread$5() {
|
|
@@ -1346,21 +1348,21 @@ function _object_spread_props$a(target, source) {
|
|
|
1346
1348
|
}
|
|
1347
1349
|
return target;
|
|
1348
1350
|
}
|
|
1349
|
-
function _sliced_to_array$
|
|
1350
|
-
return _array_with_holes$
|
|
1351
|
+
function _sliced_to_array$3(arr, i) {
|
|
1352
|
+
return _array_with_holes$3(arr) || _iterable_to_array_limit$3(arr, i) || _unsupported_iterable_to_array$7(arr, i) || _non_iterable_rest$3();
|
|
1351
1353
|
}
|
|
1352
1354
|
function _to_consumable_array$5(arr) {
|
|
1353
|
-
return _array_without_holes$5(arr) || _iterable_to_array$5(arr) || _unsupported_iterable_to_array$
|
|
1355
|
+
return _array_without_holes$5(arr) || _iterable_to_array$5(arr) || _unsupported_iterable_to_array$7(arr) || _non_iterable_spread$5();
|
|
1354
1356
|
}
|
|
1355
|
-
function _unsupported_iterable_to_array$
|
|
1357
|
+
function _unsupported_iterable_to_array$7(o, minLen) {
|
|
1356
1358
|
if (!o) return;
|
|
1357
|
-
if (typeof o === "string") return _array_like_to_array$
|
|
1359
|
+
if (typeof o === "string") return _array_like_to_array$7(o, minLen);
|
|
1358
1360
|
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
1359
1361
|
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
1360
1362
|
if (n === "Map" || n === "Set") return Array.from(n);
|
|
1361
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$
|
|
1363
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$7(o, minLen);
|
|
1362
1364
|
}
|
|
1363
|
-
function _ts_generator$
|
|
1365
|
+
function _ts_generator$f(thisArg, body) {
|
|
1364
1366
|
var f, y, t, _ = {
|
|
1365
1367
|
label: 0,
|
|
1366
1368
|
sent: function() {
|
|
@@ -1528,16 +1530,16 @@ function _ts_generator$d(thisArg, body) {
|
|
|
1528
1530
|
*/ function createNotificationUserFactory(context) {
|
|
1529
1531
|
var firebaseServerActionTransformFunctionFactory = context.firebaseServerActionTransformFunctionFactory, notificationUserCollection = context.notificationUserCollection, authService = context.authService;
|
|
1530
1532
|
return firebaseServerActionTransformFunctionFactory(createNotificationUserParamsType, function(params) {
|
|
1531
|
-
return _async_to_generator$
|
|
1533
|
+
return _async_to_generator$f(function() {
|
|
1532
1534
|
var uid;
|
|
1533
|
-
return _ts_generator$
|
|
1535
|
+
return _ts_generator$f(this, function(_state) {
|
|
1534
1536
|
uid = params.uid;
|
|
1535
1537
|
return [
|
|
1536
1538
|
2,
|
|
1537
1539
|
function() {
|
|
1538
|
-
return _async_to_generator$
|
|
1540
|
+
return _async_to_generator$f(function() {
|
|
1539
1541
|
var userContext, userExistsInAuth, notificationUserDocument, newUserTemplate;
|
|
1540
|
-
return _ts_generator$
|
|
1542
|
+
return _ts_generator$f(this, function(_state) {
|
|
1541
1543
|
switch(_state.label){
|
|
1542
1544
|
case 0:
|
|
1543
1545
|
// assert they exist in the auth system
|
|
@@ -1595,23 +1597,23 @@ function _ts_generator$d(thisArg, body) {
|
|
|
1595
1597
|
*/ function updateNotificationUserFactory(context) {
|
|
1596
1598
|
var firestoreContext = context.firestoreContext, firebaseServerActionTransformFunctionFactory = context.firebaseServerActionTransformFunctionFactory, notificationUserCollection = context.notificationUserCollection, appNotificationTemplateTypeInfoRecordService = context.appNotificationTemplateTypeInfoRecordService;
|
|
1597
1599
|
return firebaseServerActionTransformFunctionFactory(updateNotificationUserParamsType, function(params) {
|
|
1598
|
-
return _async_to_generator$
|
|
1600
|
+
return _async_to_generator$f(function() {
|
|
1599
1601
|
var inputGc, inputDc, inputBc;
|
|
1600
|
-
return _ts_generator$
|
|
1602
|
+
return _ts_generator$f(this, function(_state) {
|
|
1601
1603
|
inputGc = params.gc, inputDc = params.dc, inputBc = params.bc;
|
|
1602
1604
|
return [
|
|
1603
1605
|
2,
|
|
1604
1606
|
function(notificationUserDocument) {
|
|
1605
|
-
return _async_to_generator$
|
|
1606
|
-
return _ts_generator$
|
|
1607
|
+
return _async_to_generator$f(function() {
|
|
1608
|
+
return _ts_generator$f(this, function(_state) {
|
|
1607
1609
|
switch(_state.label){
|
|
1608
1610
|
case 0:
|
|
1609
1611
|
return [
|
|
1610
1612
|
4,
|
|
1611
1613
|
firestoreContext.runTransaction(function(transaction) {
|
|
1612
|
-
return _async_to_generator$
|
|
1614
|
+
return _async_to_generator$f(function() {
|
|
1613
1615
|
var notificationUserDocumentInTransaction, notificationUser, updateTemplate, allKnownNotificationTypes, nextGc, _updateTemplate_bc, updateTemplateBc, withExclusions;
|
|
1614
|
-
return _ts_generator$
|
|
1616
|
+
return _ts_generator$f(this, function(_state) {
|
|
1615
1617
|
switch(_state.label){
|
|
1616
1618
|
case 0:
|
|
1617
1619
|
notificationUserDocumentInTransaction = notificationUserCollection.documentAccessorForTransaction(transaction).loadDocumentFrom(notificationUserDocument);
|
|
@@ -1717,14 +1719,14 @@ var MAX_NOTIFICATION_BOXES_TO_UPDATE_PER_BATCH = 50;
|
|
|
1717
1719
|
*/ function resyncNotificationUserFactory(context) {
|
|
1718
1720
|
var firestoreContext = context.firestoreContext, firebaseServerActionTransformFunctionFactory = context.firebaseServerActionTransformFunctionFactory, notificationBoxCollection = context.notificationBoxCollection, notificationUserCollection = context.notificationUserCollection, appNotificationTemplateTypeInfoRecordService = context.appNotificationTemplateTypeInfoRecordService;
|
|
1719
1721
|
return firebaseServerActionTransformFunctionFactory(resyncNotificationUserParamsType, function() {
|
|
1720
|
-
return _async_to_generator$
|
|
1721
|
-
return _ts_generator$
|
|
1722
|
+
return _async_to_generator$f(function() {
|
|
1723
|
+
return _ts_generator$f(this, function(_state) {
|
|
1722
1724
|
return [
|
|
1723
1725
|
2,
|
|
1724
1726
|
function(notificationUserDocument) {
|
|
1725
|
-
return _async_to_generator$
|
|
1727
|
+
return _async_to_generator$f(function() {
|
|
1726
1728
|
var notificationBoxesUpdated, hasMoreNotificationBoxesToSync, batchResult, result;
|
|
1727
|
-
return _ts_generator$
|
|
1729
|
+
return _ts_generator$f(this, function(_state) {
|
|
1728
1730
|
switch(_state.label){
|
|
1729
1731
|
case 0:
|
|
1730
1732
|
// run updates in batches
|
|
@@ -1739,9 +1741,9 @@ var MAX_NOTIFICATION_BOXES_TO_UPDATE_PER_BATCH = 50;
|
|
|
1739
1741
|
return [
|
|
1740
1742
|
4,
|
|
1741
1743
|
firestoreContext.runTransaction(function(transaction) {
|
|
1742
|
-
return _async_to_generator$
|
|
1744
|
+
return _async_to_generator$f(function() {
|
|
1743
1745
|
var notificationUserDocumentInTransaction, notificationUser, gc, notificationBoxConfigsToSync, notificationBoxConfigsToSyncInThisBatch, notificationBoxesUpdatedInBatch, hasUnsyncedNotificationBoxConfigs, notificationBoxConfigsToSyncInThisBatchMap, notificationBoxIdsToSyncInThisBatch, notificationBoxDocuments, notificationBoxDocumentSnapshotDataPairs, notificationBoxConfigsToRemoveFromNotificationUser, notificationUserNotificationBoxConfigsToMarkAsRemoved, nextRecipientsMap, notificationBoxIdsSynced, nextConfigs, ns, batchResult;
|
|
1744
|
-
return _ts_generator$
|
|
1746
|
+
return _ts_generator$f(this, function(_state) {
|
|
1745
1747
|
switch(_state.label){
|
|
1746
1748
|
case 0:
|
|
1747
1749
|
notificationUserDocumentInTransaction = notificationUserCollection.documentAccessorForTransaction(transaction).loadDocumentFrom(notificationUserDocument);
|
|
@@ -1782,9 +1784,9 @@ var MAX_NOTIFICATION_BOXES_TO_UPDATE_PER_BATCH = 50;
|
|
|
1782
1784
|
return [
|
|
1783
1785
|
4,
|
|
1784
1786
|
performAsyncTasks(notificationBoxDocumentSnapshotDataPairs, function(notificationBoxDocumentSnapshotDataPair) {
|
|
1785
|
-
return _async_to_generator$
|
|
1787
|
+
return _async_to_generator$f(function() {
|
|
1786
1788
|
var notificationBox, document, nb, notificationUserNotificationBoxConfig, recipientIndex, r, m, recipient, nextRecipient, recipientHasChange;
|
|
1787
|
-
return _ts_generator$
|
|
1789
|
+
return _ts_generator$f(this, function(_state) {
|
|
1788
1790
|
switch(_state.label){
|
|
1789
1791
|
case 0:
|
|
1790
1792
|
notificationBox = notificationBoxDocumentSnapshotDataPair.data, document = notificationBoxDocumentSnapshotDataPair.document;
|
|
@@ -1955,9 +1957,9 @@ var MAX_NOTIFICATION_BOXES_TO_UPDATE_PER_BATCH = 50;
|
|
|
1955
1957
|
var notificationUserCollection = context.notificationUserCollection;
|
|
1956
1958
|
var resyncNotificationUser = resyncNotificationUserFactory(context);
|
|
1957
1959
|
return function() {
|
|
1958
|
-
return _async_to_generator$
|
|
1960
|
+
return _async_to_generator$f(function() {
|
|
1959
1961
|
var notificationBoxesUpdated, resyncNotificationUserParams, resyncNotificationUserInstance, iterateResult, result;
|
|
1960
|
-
return _ts_generator$
|
|
1962
|
+
return _ts_generator$f(this, function(_state) {
|
|
1961
1963
|
switch(_state.label){
|
|
1962
1964
|
case 0:
|
|
1963
1965
|
notificationBoxesUpdated = 0;
|
|
@@ -1975,9 +1977,9 @@ var MAX_NOTIFICATION_BOXES_TO_UPDATE_PER_BATCH = 50;
|
|
|
1975
1977
|
iterateFirestoreDocumentSnapshotPairs({
|
|
1976
1978
|
documentAccessor: notificationUserCollection.documentAccessor(),
|
|
1977
1979
|
iterateSnapshotPair: function iterateSnapshotPair(snapshotPair) {
|
|
1978
|
-
return _async_to_generator$
|
|
1980
|
+
return _async_to_generator$f(function() {
|
|
1979
1981
|
var notificationUserDocument, result;
|
|
1980
|
-
return _ts_generator$
|
|
1982
|
+
return _ts_generator$f(this, function(_state) {
|
|
1981
1983
|
switch(_state.label){
|
|
1982
1984
|
case 0:
|
|
1983
1985
|
notificationUserDocument = snapshotPair.document;
|
|
@@ -2042,16 +2044,16 @@ var MAX_NOTIFICATION_BOXES_TO_UPDATE_PER_BATCH = 50;
|
|
|
2042
2044
|
*/ function createNotificationSummaryFactory(context) {
|
|
2043
2045
|
var firebaseServerActionTransformFunctionFactory = context.firebaseServerActionTransformFunctionFactory, notificationSummaryCollection = context.notificationSummaryCollection;
|
|
2044
2046
|
return firebaseServerActionTransformFunctionFactory(createNotificationSummaryParamsType, function(params) {
|
|
2045
|
-
return _async_to_generator$
|
|
2047
|
+
return _async_to_generator$f(function() {
|
|
2046
2048
|
var model;
|
|
2047
|
-
return _ts_generator$
|
|
2049
|
+
return _ts_generator$f(this, function(_state) {
|
|
2048
2050
|
model = params.model;
|
|
2049
2051
|
return [
|
|
2050
2052
|
2,
|
|
2051
2053
|
function() {
|
|
2052
|
-
return _async_to_generator$
|
|
2054
|
+
return _async_to_generator$f(function() {
|
|
2053
2055
|
var notificationSummaryId, notificationSummaryDocument, newSummaryTemplate;
|
|
2054
|
-
return _ts_generator$
|
|
2056
|
+
return _ts_generator$f(this, function(_state) {
|
|
2055
2057
|
switch(_state.label){
|
|
2056
2058
|
case 0:
|
|
2057
2059
|
notificationSummaryId = notificationSummaryIdForModel(model);
|
|
@@ -2087,16 +2089,16 @@ var MAX_NOTIFICATION_BOXES_TO_UPDATE_PER_BATCH = 50;
|
|
|
2087
2089
|
*/ function updateNotificationSummaryFactory(context) {
|
|
2088
2090
|
var firebaseServerActionTransformFunctionFactory = context.firebaseServerActionTransformFunctionFactory;
|
|
2089
2091
|
return firebaseServerActionTransformFunctionFactory(updateNotificationSummaryParamsType, function(params) {
|
|
2090
|
-
return _async_to_generator$
|
|
2092
|
+
return _async_to_generator$f(function() {
|
|
2091
2093
|
var setReadAtTime, flagAllRead;
|
|
2092
|
-
return _ts_generator$
|
|
2094
|
+
return _ts_generator$f(this, function(_state) {
|
|
2093
2095
|
setReadAtTime = params.setReadAtTime, flagAllRead = params.flagAllRead;
|
|
2094
2096
|
return [
|
|
2095
2097
|
2,
|
|
2096
2098
|
function(notificationSummaryDocument) {
|
|
2097
|
-
return _async_to_generator$
|
|
2099
|
+
return _async_to_generator$f(function() {
|
|
2098
2100
|
var updateTemplate;
|
|
2099
|
-
return _ts_generator$
|
|
2101
|
+
return _ts_generator$f(this, function(_state) {
|
|
2100
2102
|
switch(_state.label){
|
|
2101
2103
|
case 0:
|
|
2102
2104
|
if (setReadAtTime != null) {
|
|
@@ -2144,9 +2146,9 @@ var MAX_NOTIFICATION_BOXES_TO_UPDATE_PER_BATCH = 50;
|
|
|
2144
2146
|
*/ function createNotificationBoxInTransactionFactory(context) {
|
|
2145
2147
|
var notificationBoxCollection = context.notificationBoxCollection;
|
|
2146
2148
|
return function(params, transaction) {
|
|
2147
|
-
return _async_to_generator$
|
|
2149
|
+
return _async_to_generator$f(function() {
|
|
2148
2150
|
var inputNow, skipCreate, now, notificationBoxDocument, notificationBoxTemplate;
|
|
2149
|
-
return _ts_generator$
|
|
2151
|
+
return _ts_generator$f(this, function(_state) {
|
|
2150
2152
|
switch(_state.label){
|
|
2151
2153
|
case 0:
|
|
2152
2154
|
inputNow = params.now, skipCreate = params.skipCreate;
|
|
@@ -2196,24 +2198,24 @@ var MAX_NOTIFICATION_BOXES_TO_UPDATE_PER_BATCH = 50;
|
|
|
2196
2198
|
var firestoreContext = context.firestoreContext, notificationBoxCollection = context.notificationBoxCollection, firebaseServerActionTransformFunctionFactory = context.firebaseServerActionTransformFunctionFactory;
|
|
2197
2199
|
var createNotificationBoxInTransaction = createNotificationBoxInTransactionFactory(context);
|
|
2198
2200
|
return firebaseServerActionTransformFunctionFactory(createNotificationBoxParamsType, function(params) {
|
|
2199
|
-
return _async_to_generator$
|
|
2201
|
+
return _async_to_generator$f(function() {
|
|
2200
2202
|
var model;
|
|
2201
|
-
return _ts_generator$
|
|
2203
|
+
return _ts_generator$f(this, function(_state) {
|
|
2202
2204
|
model = params.model;
|
|
2203
2205
|
return [
|
|
2204
2206
|
2,
|
|
2205
2207
|
function() {
|
|
2206
|
-
return _async_to_generator$
|
|
2208
|
+
return _async_to_generator$f(function() {
|
|
2207
2209
|
var result;
|
|
2208
|
-
return _ts_generator$
|
|
2210
|
+
return _ts_generator$f(this, function(_state) {
|
|
2209
2211
|
switch(_state.label){
|
|
2210
2212
|
case 0:
|
|
2211
2213
|
return [
|
|
2212
2214
|
4,
|
|
2213
2215
|
firestoreContext.runTransaction(function(transaction) {
|
|
2214
|
-
return _async_to_generator$
|
|
2216
|
+
return _async_to_generator$f(function() {
|
|
2215
2217
|
var notificationBoxDocument;
|
|
2216
|
-
return _ts_generator$
|
|
2218
|
+
return _ts_generator$f(this, function(_state) {
|
|
2217
2219
|
switch(_state.label){
|
|
2218
2220
|
case 0:
|
|
2219
2221
|
return [
|
|
@@ -2259,13 +2261,13 @@ var MAX_NOTIFICATION_BOXES_TO_UPDATE_PER_BATCH = 50;
|
|
|
2259
2261
|
*/ function updateNotificationBoxFactory(context) {
|
|
2260
2262
|
var firebaseServerActionTransformFunctionFactory = context.firebaseServerActionTransformFunctionFactory;
|
|
2261
2263
|
return firebaseServerActionTransformFunctionFactory(updateNotificationBoxParamsType, function() {
|
|
2262
|
-
return _async_to_generator$
|
|
2263
|
-
return _ts_generator$
|
|
2264
|
+
return _async_to_generator$f(function() {
|
|
2265
|
+
return _ts_generator$f(this, function(_state) {
|
|
2264
2266
|
return [
|
|
2265
2267
|
2,
|
|
2266
2268
|
function(notificationBoxDocument) {
|
|
2267
|
-
return _async_to_generator$
|
|
2268
|
-
return _ts_generator$
|
|
2269
|
+
return _async_to_generator$f(function() {
|
|
2270
|
+
return _ts_generator$f(this, function(_state) {
|
|
2269
2271
|
// does nothing currently.
|
|
2270
2272
|
return [
|
|
2271
2273
|
2,
|
|
@@ -2290,9 +2292,9 @@ var MAX_NOTIFICATION_BOXES_TO_UPDATE_PER_BATCH = 50;
|
|
|
2290
2292
|
*/ function updateNotificationBoxRecipientExclusionInTransactionFactory(context) {
|
|
2291
2293
|
var notificationBoxCollection = context.notificationBoxCollection, notificationUserCollection = context.notificationUserCollection;
|
|
2292
2294
|
return function(input, transaction) {
|
|
2293
|
-
return _async_to_generator$
|
|
2295
|
+
return _async_to_generator$f(function() {
|
|
2294
2296
|
var params, inputUid, i, setExclusion, notificationBoxDocument, targetUid, result, notificationBox, targetRecipient, notificationUserDocument, notificationUser, targetExclusions, _updateNotificationUserNotificationSendExclusions, notificationUserUpdate;
|
|
2295
|
-
return _ts_generator$
|
|
2297
|
+
return _ts_generator$f(this, function(_state) {
|
|
2296
2298
|
switch(_state.label){
|
|
2297
2299
|
case 0:
|
|
2298
2300
|
params = input.params;
|
|
@@ -2322,10 +2324,10 @@ var MAX_NOTIFICATION_BOXES_TO_UPDATE_PER_BATCH = 50;
|
|
|
2322
2324
|
targetRecipient = notificationBox.r.find(function(x) {
|
|
2323
2325
|
return x.i === i;
|
|
2324
2326
|
});
|
|
2325
|
-
if (
|
|
2326
|
-
throw notificationBoxExclusionTargetInvalidError();
|
|
2327
|
-
} else {
|
|
2327
|
+
if (targetRecipient === null || targetRecipient === void 0 ? void 0 : targetRecipient.uid) {
|
|
2328
2328
|
targetUid = targetRecipient.uid;
|
|
2329
|
+
} else {
|
|
2330
|
+
throw notificationBoxExclusionTargetInvalidError();
|
|
2329
2331
|
}
|
|
2330
2332
|
_state.label = 3;
|
|
2331
2333
|
case 3:
|
|
@@ -2385,9 +2387,9 @@ var MAX_NOTIFICATION_BOXES_TO_UPDATE_PER_BATCH = 50;
|
|
|
2385
2387
|
var authService = context.authService, notificationBoxCollection = context.notificationBoxCollection, notificationUserCollection = context.notificationUserCollection;
|
|
2386
2388
|
var createNotificationBoxInTransaction = createNotificationBoxInTransactionFactory(context);
|
|
2387
2389
|
return function(input, transaction) {
|
|
2388
|
-
return _async_to_generator$
|
|
2390
|
+
return _async_to_generator$f(function() {
|
|
2389
2391
|
var params, allowCreateNotificationBoxIfItDoesNotExist, throwErrorIfNotificationBoxDoesNotExist, uid, i, insert, remove, inputC, setExclusion, findRecipientFn, notificationBoxDocument, notificationBox, createNotificationBox, result, notificationBoxTemplate, r, targetRecipientIndex, targetRecipient, nextRecipient, _ref, _ref1, c, nextI, _ref2, notificationUserId, notificationBoxId, notificationUserDocument, notificationUser, createNotificationUser, userContext, userExistsInAuth, notificationUserTemplate, _updateNotificationUserNotificationBoxRecipientConfig, updatedBc, updatedNotificationBoxRecipient, updatedB, newUserTemplate, updatedNotificationBox, notificationBoxWasCreated;
|
|
2390
|
-
return _ts_generator$
|
|
2392
|
+
return _ts_generator$f(this, function(_state) {
|
|
2391
2393
|
switch(_state.label){
|
|
2392
2394
|
case 0:
|
|
2393
2395
|
params = input.params, allowCreateNotificationBoxIfItDoesNotExist = input.allowCreateNotificationBoxIfItDoesNotExist, throwErrorIfNotificationBoxDoesNotExist = input.throwErrorIfNotificationBoxDoesNotExist;
|
|
@@ -2634,20 +2636,20 @@ var MAX_NOTIFICATION_BOXES_TO_UPDATE_PER_BATCH = 50;
|
|
|
2634
2636
|
var updateNotificationBoxRecipientInTransaction = updateNotificationBoxRecipientInTransactionFactory(context);
|
|
2635
2637
|
var updateNotificationBoxRecipientExclusionInTransaction = updateNotificationBoxRecipientExclusionInTransactionFactory(context);
|
|
2636
2638
|
return firebaseServerActionTransformFunctionFactory(updateNotificationBoxRecipientParamsType, function(params) {
|
|
2637
|
-
return _async_to_generator$
|
|
2638
|
-
return _ts_generator$
|
|
2639
|
+
return _async_to_generator$f(function() {
|
|
2640
|
+
return _ts_generator$f(this, function(_state) {
|
|
2639
2641
|
return [
|
|
2640
2642
|
2,
|
|
2641
2643
|
function(notificationBoxDocument) {
|
|
2642
|
-
return _async_to_generator$
|
|
2643
|
-
return _ts_generator$
|
|
2644
|
+
return _async_to_generator$f(function() {
|
|
2645
|
+
return _ts_generator$f(this, function(_state) {
|
|
2644
2646
|
switch(_state.label){
|
|
2645
2647
|
case 0:
|
|
2646
2648
|
return [
|
|
2647
2649
|
4,
|
|
2648
2650
|
firestoreContext.runTransaction(function(transaction) {
|
|
2649
|
-
return _async_to_generator$
|
|
2650
|
-
return _ts_generator$
|
|
2651
|
+
return _async_to_generator$f(function() {
|
|
2652
|
+
return _ts_generator$f(this, function(_state) {
|
|
2651
2653
|
switch(_state.label){
|
|
2652
2654
|
case 0:
|
|
2653
2655
|
if (!(params.setExclusion != null)) return [
|
|
@@ -2738,19 +2740,19 @@ var NOTIFICATION_TASK_TYPE_FAILURE_DELAY_MS = hoursToMilliseconds(NOTIFICATION_T
|
|
|
2738
2740
|
var createNotificationBoxInTransaction = createNotificationBoxInTransactionFactory(context);
|
|
2739
2741
|
var notificationUserAccessor = notificationUserCollection.documentAccessor();
|
|
2740
2742
|
return firebaseServerActionTransformFunctionFactory(sendNotificationParamsType, function(params) {
|
|
2741
|
-
return _async_to_generator$
|
|
2743
|
+
return _async_to_generator$f(function() {
|
|
2742
2744
|
var ignoreSendAtThrottle;
|
|
2743
|
-
return _ts_generator$
|
|
2745
|
+
return _ts_generator$f(this, function(_state) {
|
|
2744
2746
|
ignoreSendAtThrottle = params.ignoreSendAtThrottle;
|
|
2745
2747
|
return [
|
|
2746
2748
|
2,
|
|
2747
2749
|
function(inputNotificationDocument) {
|
|
2748
|
-
return _async_to_generator$
|
|
2750
|
+
return _async_to_generator$f(function() {
|
|
2749
2751
|
var now, notificationDocument, _ref, nextSat, throttled, tryRun, isNotificationTask, isLoggedEvent, notificationTaskHandler, notification, createdBox, notificationBoxNeedsInitialization, notificationBox, notificationBoxModelKey, deletedNotification, templateInstance, isConfiguredTemplateType, isKnownTemplateType, onlySendToExplicitlyEnabledRecipients, onlyTextExplicitlyEnabledRecipients, success, isUniqueNotificationTask, uniqueNotificationTaskConflict, sendEmailsResult, sendTextsResult, sendNotificationSummaryResult, loadMessageFunctionFailure, buildMessageFailure, notificationMarkedDone, notificationTaskCompletionType, notificationTaskPartsRunCount, notificationTaskLoopingProtectionTriggered, onSendAttemptedResult, onSendSuccessResult, notificationTemplateType, result;
|
|
2750
2752
|
function _runNotificationTaskNextPart(input) {
|
|
2751
|
-
return _async_to_generator$
|
|
2753
|
+
return _async_to_generator$f(function() {
|
|
2752
2754
|
var _notification_at, notification, notificationTaskHandler, previouslyCompleteSubTasks, item, cat, ut, tryRunNextPart, partNotificationTaskCompletionType, partNotificationMarkedDone, partTprReversal, partSuccess, nextCompleteSubTasks, unique, notificationTask, notificationTemplate, handleTaskResult, completion, updateMetadata, delayUntil, canRunNextCheckpoint, allCompletedSubTasks, _notification_at1, _notification_at2, tprChanged, subtaskTprChanged, _findMaxDate, minimumNextSatTime, e, saveTaskResult, latestNotification;
|
|
2753
|
-
return _ts_generator$
|
|
2755
|
+
return _ts_generator$f(this, function(_state) {
|
|
2754
2756
|
switch(_state.label){
|
|
2755
2757
|
case 0:
|
|
2756
2758
|
notification = input.notification, notificationTaskHandler = input.notificationTaskHandler, previouslyCompleteSubTasks = input.previouslyCompleteSubTasks;
|
|
@@ -2924,9 +2926,9 @@ var NOTIFICATION_TASK_TYPE_FAILURE_DELAY_MS = hoursToMilliseconds(NOTIFICATION_T
|
|
|
2924
2926
|
* Some of these parts may be able to be run immediately one after the other, instead of waiting for
|
|
2925
2927
|
* another sendNotification() to complete on it.
|
|
2926
2928
|
*/ function handleNotificationTask() {
|
|
2927
|
-
return _async_to_generator$
|
|
2929
|
+
return _async_to_generator$f(function() {
|
|
2928
2930
|
var MAX_NOTIFICATION_TASK_PARTS_RUN_ALLOWED, currentNotification, previouslyCompleteSubTasks, _result_nextCompleteSubTasks, result, tryRunNextPart, updatedNotificationData;
|
|
2929
|
-
return _ts_generator$
|
|
2931
|
+
return _ts_generator$f(this, function(_state) {
|
|
2930
2932
|
switch(_state.label){
|
|
2931
2933
|
case 0:
|
|
2932
2934
|
MAX_NOTIFICATION_TASK_PARTS_RUN_ALLOWED = 5;
|
|
@@ -3003,9 +3005,9 @@ var NOTIFICATION_TASK_TYPE_FAILURE_DELAY_MS = hoursToMilliseconds(NOTIFICATION_T
|
|
|
3003
3005
|
/**
|
|
3004
3006
|
* Handles a normal (non-task) notification.
|
|
3005
3007
|
*/ function handleNormalNotification() {
|
|
3006
|
-
return _async_to_generator$
|
|
3008
|
+
return _async_to_generator$f(function() {
|
|
3007
3009
|
var messageFunction, filterOutNoContentNotificationMessages, _ref, emailRecipients, textRecipients, notificationSummaryRecipients, es, ts, ns, ps, currentEsr, currentTsr, esr, emailRecipientsAlreadySentTo, emailInputContexts, emailMessages, sendInstance, e, e1, success1, failed, tsr, textRecipientsAlreadySentTo, textInputContexts, textMessages, sendInstance1, e2, e3, success2, failed1, notificationSummaryInputContexts, notificationSummaryMessages, sendInstance2, e4, e5, notificationTemplate, callbackDetails, onSendAttempted, onSendSuccess;
|
|
3008
|
-
return _ts_generator$
|
|
3010
|
+
return _ts_generator$f(this, function(_state) {
|
|
3009
3011
|
switch(_state.label){
|
|
3010
3012
|
case 0:
|
|
3011
3013
|
if (!(notification != null)) return [
|
|
@@ -3510,7 +3512,7 @@ var NOTIFICATION_TASK_TYPE_FAILURE_DELAY_MS = hoursToMilliseconds(NOTIFICATION_T
|
|
|
3510
3512
|
});
|
|
3511
3513
|
})();
|
|
3512
3514
|
}
|
|
3513
|
-
return _ts_generator$
|
|
3515
|
+
return _ts_generator$f(this, function(_state) {
|
|
3514
3516
|
switch(_state.label){
|
|
3515
3517
|
case 0:
|
|
3516
3518
|
now = new Date();
|
|
@@ -3519,12 +3521,12 @@ var NOTIFICATION_TASK_TYPE_FAILURE_DELAY_MS = hoursToMilliseconds(NOTIFICATION_T
|
|
|
3519
3521
|
return [
|
|
3520
3522
|
4,
|
|
3521
3523
|
firestoreContext.runTransaction(function(transaction) {
|
|
3522
|
-
return _async_to_generator$
|
|
3524
|
+
return _async_to_generator$f(function() {
|
|
3523
3525
|
var notificationBoxDocument, notificationDocumentInTransaction, _ref, initialNotificationBox, notification, notificationBox, model, isNotificationTask, isLoggedEvent, tryRun, throttled, nextSat, createdBox, deletedNotification, notificationBoxNeedsInitialization, isKnownTemplateType, isConfiguredTemplateType, onlySendToExplicitlyEnabledRecipients, onlyTextExplicitlyEnabledRecipients, templateInstance, notificationTaskHandler, t // notification task/template type
|
|
3524
3526
|
, delay, _notification_ois, _notification_ots, templateTypeInfo, retryAttempts, delay1, _, notificationBoxTemplate, isAtMaxAttempts, a;
|
|
3525
3527
|
function deleteNotification() {
|
|
3526
|
-
return _async_to_generator$
|
|
3527
|
-
return _ts_generator$
|
|
3528
|
+
return _async_to_generator$f(function() {
|
|
3529
|
+
return _ts_generator$f(this, function(_state) {
|
|
3528
3530
|
switch(_state.label){
|
|
3529
3531
|
case 0:
|
|
3530
3532
|
tryRun = false;
|
|
@@ -3542,7 +3544,7 @@ var NOTIFICATION_TASK_TYPE_FAILURE_DELAY_MS = hoursToMilliseconds(NOTIFICATION_T
|
|
|
3542
3544
|
});
|
|
3543
3545
|
})();
|
|
3544
3546
|
}
|
|
3545
|
-
return _ts_generator$
|
|
3547
|
+
return _ts_generator$f(this, function(_state) {
|
|
3546
3548
|
switch(_state.label){
|
|
3547
3549
|
case 0:
|
|
3548
3550
|
notificationBoxDocument = notificationBoxCollection.documentAccessorForTransaction(transaction).loadDocument(notificationDocument.parent);
|
|
@@ -3555,7 +3557,7 @@ var NOTIFICATION_TASK_TYPE_FAILURE_DELAY_MS = hoursToMilliseconds(NOTIFICATION_T
|
|
|
3555
3557
|
])
|
|
3556
3558
|
];
|
|
3557
3559
|
case 1:
|
|
3558
|
-
_ref = _sliced_to_array$
|
|
3560
|
+
_ref = _sliced_to_array$3.apply(void 0, [
|
|
3559
3561
|
_state.sent(),
|
|
3560
3562
|
2
|
|
3561
3563
|
]), initialNotificationBox = _ref[0], notification = _ref[1];
|
|
@@ -3950,18 +3952,18 @@ var NOTIFICATION_TASK_TYPE_FAILURE_DELAY_MS = hoursToMilliseconds(NOTIFICATION_T
|
|
|
3950
3952
|
var firebaseServerActionTransformFunctionFactory = context.firebaseServerActionTransformFunctionFactory, notificationCollectionGroup = context.notificationCollectionGroup;
|
|
3951
3953
|
var sendNotification = sendNotificationFactory(context);
|
|
3952
3954
|
return firebaseServerActionTransformFunctionFactory(sendQueuedNotificationsParamsType, function(params) {
|
|
3953
|
-
return _async_to_generator$
|
|
3955
|
+
return _async_to_generator$f(function() {
|
|
3954
3956
|
var _params_sendNotificationLoopsTaskExcessThreshold, maxSendNotificationLoops, maxLoops, sendNotificationLoopsTaskExcessThreshold;
|
|
3955
|
-
return _ts_generator$
|
|
3957
|
+
return _ts_generator$f(this, function(_state) {
|
|
3956
3958
|
maxSendNotificationLoops = params.maxSendNotificationLoops;
|
|
3957
3959
|
maxLoops = maxSendNotificationLoops !== null && maxSendNotificationLoops !== void 0 ? maxSendNotificationLoops : Number.MAX_SAFE_INTEGER;
|
|
3958
3960
|
sendNotificationLoopsTaskExcessThreshold = (_params_sendNotificationLoopsTaskExcessThreshold = params.sendNotificationLoopsTaskExcessThreshold) !== null && _params_sendNotificationLoopsTaskExcessThreshold !== void 0 ? _params_sendNotificationLoopsTaskExcessThreshold : SEND_QUEUE_NOTIFICATIONS_TASK_EXCESS_THRESHOLD;
|
|
3959
3961
|
return [
|
|
3960
3962
|
2,
|
|
3961
3963
|
function(input) {
|
|
3962
|
-
return _async_to_generator$
|
|
3964
|
+
return _async_to_generator$f(function() {
|
|
3963
3965
|
var _ref, _ref1, _ref2, maxParallelTasks, onSendNotificationResult, notificationLoopCount, notificationBoxesCreated, notificationsDeleted, notificationTasksVisited, notificationsVisited, notificationsSucceeded, notificationsDelayed, notificationsFailed, sendEmailsResult, sendTextsResult, sendNotificationSummaryResult, sendNotificationParams, sendNotificationInstance, excessLoopsDetected, sendQueuedNotifications, sendQueuedNotificationsResults, found, result;
|
|
3964
|
-
return _ts_generator$
|
|
3966
|
+
return _ts_generator$f(this, function(_state) {
|
|
3965
3967
|
switch(_state.label){
|
|
3966
3968
|
case 0:
|
|
3967
3969
|
maxParallelTasks = (_ref = (_ref1 = input === null || input === void 0 ? void 0 : input.maxParellelSendTasks) !== null && _ref1 !== void 0 ? _ref1 : params.maxParellelSendTasks) !== null && _ref !== void 0 ? _ref : 5;
|
|
@@ -3986,9 +3988,9 @@ var NOTIFICATION_TASK_TYPE_FAILURE_DELAY_MS = hoursToMilliseconds(NOTIFICATION_T
|
|
|
3986
3988
|
sendNotificationInstance = _state.sent();
|
|
3987
3989
|
excessLoopsDetected = false;
|
|
3988
3990
|
sendQueuedNotifications = function sendQueuedNotifications() {
|
|
3989
|
-
return _async_to_generator$
|
|
3991
|
+
return _async_to_generator$f(function() {
|
|
3990
3992
|
var query, notificationDocuments;
|
|
3991
|
-
return _ts_generator$
|
|
3993
|
+
return _ts_generator$f(this, function(_state) {
|
|
3992
3994
|
switch(_state.label){
|
|
3993
3995
|
case 0:
|
|
3994
3996
|
query = notificationCollectionGroup.queryDocument(notificationsPastSendAtTimeQuery());
|
|
@@ -4001,9 +4003,9 @@ var NOTIFICATION_TASK_TYPE_FAILURE_DELAY_MS = hoursToMilliseconds(NOTIFICATION_T
|
|
|
4001
4003
|
return [
|
|
4002
4004
|
2,
|
|
4003
4005
|
performAsyncTasks(notificationDocuments, function(notificationDocument) {
|
|
4004
|
-
return _async_to_generator$
|
|
4006
|
+
return _async_to_generator$f(function() {
|
|
4005
4007
|
var result;
|
|
4006
|
-
return _ts_generator$
|
|
4008
|
+
return _ts_generator$f(this, function(_state) {
|
|
4007
4009
|
switch(_state.label){
|
|
4008
4010
|
case 0:
|
|
4009
4011
|
return [
|
|
@@ -4119,17 +4121,17 @@ var NOTIFICATION_TASK_TYPE_FAILURE_DELAY_MS = hoursToMilliseconds(NOTIFICATION_T
|
|
|
4119
4121
|
*/ function cleanupSentNotificationsFactory(context) {
|
|
4120
4122
|
var firestoreContext = context.firestoreContext, firebaseServerActionTransformFunctionFactory = context.firebaseServerActionTransformFunctionFactory, notificationCollectionGroup = context.notificationCollectionGroup, notificationBoxCollection = context.notificationBoxCollection, notificationWeekCollectionFactory = context.notificationWeekCollectionFactory, notificationLoggedEventDayCollectionFactory = context.notificationLoggedEventDayCollectionFactory, notificationLoggedEventDayPagedItemsCollectionFactory = context.notificationLoggedEventDayPagedItemsCollectionFactory;
|
|
4121
4123
|
return firebaseServerActionTransformFunctionFactory(cleanupSentNotificationsParamsType, function() {
|
|
4122
|
-
return _async_to_generator$
|
|
4123
|
-
return _ts_generator$
|
|
4124
|
+
return _async_to_generator$f(function() {
|
|
4125
|
+
return _ts_generator$f(this, function(_state) {
|
|
4124
4126
|
return [
|
|
4125
4127
|
2,
|
|
4126
4128
|
function() {
|
|
4127
|
-
return _async_to_generator$
|
|
4129
|
+
return _async_to_generator$f(function() {
|
|
4128
4130
|
var notificationBoxesUpdatesCount, notificationsDeleted, notificationTasksDeletedCount, notificationWeeksCreated, notificationWeeksUpdated, notificationLoggedEventsCleanedUp, cleanupSentNotificationsResults, notificationBoxesUpdated, result;
|
|
4129
4131
|
function cleanupSentNotifications() {
|
|
4130
|
-
return _async_to_generator$
|
|
4132
|
+
return _async_to_generator$f(function() {
|
|
4131
4133
|
var query, notificationDocuments, notificationDocumentsGroupedByNotificationBox;
|
|
4132
|
-
return _ts_generator$
|
|
4134
|
+
return _ts_generator$f(this, function(_state) {
|
|
4133
4135
|
switch(_state.label){
|
|
4134
4136
|
case 0:
|
|
4135
4137
|
query = notificationCollectionGroup.queryDocument(notificationsReadyForCleanupQuery());
|
|
@@ -4145,9 +4147,9 @@ var NOTIFICATION_TASK_TYPE_FAILURE_DELAY_MS = hoursToMilliseconds(NOTIFICATION_T
|
|
|
4145
4147
|
return [
|
|
4146
4148
|
2,
|
|
4147
4149
|
performAsyncTasks(notificationDocumentsGroupedByNotificationBox, function(notificationDocumentsInSameBox) {
|
|
4148
|
-
return _async_to_generator$
|
|
4150
|
+
return _async_to_generator$f(function() {
|
|
4149
4151
|
var allPairs, allPairsWithDataAndMarkedDeleted, taskPairsWithDataAndMarkedDeleted, loggedEventPairsWithDataAndMarkedDeleted, normalPairsWithDataAndMarkedDeleted, _iteratorNormalCompletion, _didIteratorError, _iteratorError, _iterator, _step, pair, _pair_data, pairsGroupedByWeek, pairsGroupedByWeekInBatches, pairsGroupedByLoggedEventDay, pairsGroupedByLoggedEventDayInBatches, notificationBoxDocument, notificationWeekResults, loggedEventDayResults, writeBatch, writeBatchAccessor, weeksCreated, weeksUpdated, tasksDeleted, loggedEventsCleanedUp;
|
|
4150
|
-
return _ts_generator$
|
|
4152
|
+
return _ts_generator$f(this, function(_state) {
|
|
4151
4153
|
switch(_state.label){
|
|
4152
4154
|
case 0:
|
|
4153
4155
|
return [
|
|
@@ -4226,15 +4228,15 @@ var NOTIFICATION_TASK_TYPE_FAILURE_DELAY_MS = hoursToMilliseconds(NOTIFICATION_T
|
|
|
4226
4228
|
return [
|
|
4227
4229
|
4,
|
|
4228
4230
|
performAsyncTasks(pairsGroupedByWeekInBatches, function(param) {
|
|
4229
|
-
var _param = _sliced_to_array$
|
|
4230
|
-
return _async_to_generator$
|
|
4231
|
-
return _ts_generator$
|
|
4231
|
+
var _param = _sliced_to_array$3(param, 2), yearWeekCode = _param[0], notificationDocumentsInSameWeek = _param[1];
|
|
4232
|
+
return _async_to_generator$f(function() {
|
|
4233
|
+
return _ts_generator$f(this, function(_state) {
|
|
4232
4234
|
return [
|
|
4233
4235
|
2,
|
|
4234
4236
|
firestoreContext.runTransaction(function(transaction) {
|
|
4235
|
-
return _async_to_generator$
|
|
4237
|
+
return _async_to_generator$f(function() {
|
|
4236
4238
|
var _ref, notificationWeekDocument, notificationDocumentsInTransaction, notificationWeek, newItems, n;
|
|
4237
|
-
return _ts_generator$
|
|
4239
|
+
return _ts_generator$f(this, function(_state) {
|
|
4238
4240
|
switch(_state.label){
|
|
4239
4241
|
case 0:
|
|
4240
4242
|
notificationWeekDocument = notificationWeekCollectionFactory(notificationBoxDocument).documentAccessorForTransaction(transaction).loadDocumentForId("".concat(yearWeekCode));
|
|
@@ -4312,15 +4314,15 @@ var NOTIFICATION_TASK_TYPE_FAILURE_DELAY_MS = hoursToMilliseconds(NOTIFICATION_T
|
|
|
4312
4314
|
return [
|
|
4313
4315
|
4,
|
|
4314
4316
|
performAsyncTasks(pairsGroupedByLoggedEventDayInBatches, function(param) {
|
|
4315
|
-
var _param = _sliced_to_array$
|
|
4316
|
-
return _async_to_generator$
|
|
4317
|
-
return _ts_generator$
|
|
4317
|
+
var _param = _sliced_to_array$3(param, 2), dayId = _param[0], notificationDocumentsInSameDay = _param[1];
|
|
4318
|
+
return _async_to_generator$f(function() {
|
|
4319
|
+
return _ts_generator$f(this, function(_state) {
|
|
4318
4320
|
return [
|
|
4319
4321
|
2,
|
|
4320
4322
|
firestoreContext.runTransaction(function(transaction) {
|
|
4321
|
-
return _async_to_generator$
|
|
4323
|
+
return _async_to_generator$f(function() {
|
|
4322
4324
|
var dayCollection, dayDocument, notificationDocumentsInTransaction, pagedItems, _ref, dayWrapper, existingItems, newItems;
|
|
4323
|
-
return _ts_generator$
|
|
4325
|
+
return _ts_generator$f(this, function(_state) {
|
|
4324
4326
|
switch(_state.label){
|
|
4325
4327
|
case 0:
|
|
4326
4328
|
dayCollection = notificationLoggedEventDayCollectionFactory(notificationBoxDocument);
|
|
@@ -4337,7 +4339,7 @@ var NOTIFICATION_TASK_TYPE_FAILURE_DELAY_MS = hoursToMilliseconds(NOTIFICATION_T
|
|
|
4337
4339
|
])
|
|
4338
4340
|
];
|
|
4339
4341
|
case 1:
|
|
4340
|
-
_ref = _sliced_to_array$
|
|
4342
|
+
_ref = _sliced_to_array$3.apply(void 0, [
|
|
4341
4343
|
_state.sent(),
|
|
4342
4344
|
2
|
|
4343
4345
|
]), dayWrapper = _ref[0], existingItems = _ref[1];
|
|
@@ -4442,7 +4444,7 @@ var NOTIFICATION_TASK_TYPE_FAILURE_DELAY_MS = hoursToMilliseconds(NOTIFICATION_T
|
|
|
4442
4444
|
});
|
|
4443
4445
|
})();
|
|
4444
4446
|
}
|
|
4445
|
-
return _ts_generator$
|
|
4447
|
+
return _ts_generator$f(this, function(_state) {
|
|
4446
4448
|
switch(_state.label){
|
|
4447
4449
|
case 0:
|
|
4448
4450
|
notificationBoxesUpdatesCount = 0;
|
|
@@ -4515,9 +4517,9 @@ var NOTIFICATION_TASK_TYPE_FAILURE_DELAY_MS = hoursToMilliseconds(NOTIFICATION_T
|
|
|
4515
4517
|
*/ function cleanupOldNotificationLoggedEventDaysFactory(context) {
|
|
4516
4518
|
var firestoreContext = context.firestoreContext, firebaseServerActionTransformFunctionFactory = context.firebaseServerActionTransformFunctionFactory, notificationLoggedEventDayCollectionGroup = context.notificationLoggedEventDayCollectionGroup, notificationLoggedEventDayPagedItemsCollectionFactory = context.notificationLoggedEventDayPagedItemsCollectionFactory;
|
|
4517
4519
|
function deleteOldLoggedEventDay(dayDocument) {
|
|
4518
|
-
return _async_to_generator$
|
|
4520
|
+
return _async_to_generator$f(function() {
|
|
4519
4521
|
var pagesCollection, allPageDocs;
|
|
4520
|
-
return _ts_generator$
|
|
4522
|
+
return _ts_generator$f(this, function(_state) {
|
|
4521
4523
|
switch(_state.label){
|
|
4522
4524
|
case 0:
|
|
4523
4525
|
pagesCollection = notificationLoggedEventDayPagedItemsCollectionFactory(dayDocument);
|
|
@@ -4530,9 +4532,9 @@ var NOTIFICATION_TASK_TYPE_FAILURE_DELAY_MS = hoursToMilliseconds(NOTIFICATION_T
|
|
|
4530
4532
|
return [
|
|
4531
4533
|
2,
|
|
4532
4534
|
firestoreContext.runTransaction(function(transaction) {
|
|
4533
|
-
return _async_to_generator$
|
|
4535
|
+
return _async_to_generator$f(function() {
|
|
4534
4536
|
var pageTxAccessor, dayTxAccessor;
|
|
4535
|
-
return _ts_generator$
|
|
4537
|
+
return _ts_generator$f(this, function(_state) {
|
|
4536
4538
|
switch(_state.label){
|
|
4537
4539
|
case 0:
|
|
4538
4540
|
pageTxAccessor = pagesCollection.documentAccessorForTransaction(transaction);
|
|
@@ -4569,14 +4571,14 @@ var NOTIFICATION_TASK_TYPE_FAILURE_DELAY_MS = hoursToMilliseconds(NOTIFICATION_T
|
|
|
4569
4571
|
})();
|
|
4570
4572
|
}
|
|
4571
4573
|
return firebaseServerActionTransformFunctionFactory(cleanupOldNotificationLoggedEventDaysParamsType, function(params) {
|
|
4572
|
-
return _async_to_generator$
|
|
4573
|
-
return _ts_generator$
|
|
4574
|
+
return _async_to_generator$f(function() {
|
|
4575
|
+
return _ts_generator$f(this, function(_state) {
|
|
4574
4576
|
return [
|
|
4575
4577
|
2,
|
|
4576
4578
|
function() {
|
|
4577
|
-
return _async_to_generator$
|
|
4579
|
+
return _async_to_generator$f(function() {
|
|
4578
4580
|
var now, oldDaysQuery, oldDayDocuments, daysDeleted, pagesDeleted, deleteResults, result;
|
|
4579
|
-
return _ts_generator$
|
|
4581
|
+
return _ts_generator$f(this, function(_state) {
|
|
4580
4582
|
switch(_state.label){
|
|
4581
4583
|
case 0:
|
|
4582
4584
|
now = new Date();
|
|
@@ -4619,7 +4621,7 @@ var NOTIFICATION_TASK_TYPE_FAILURE_DELAY_MS = hoursToMilliseconds(NOTIFICATION_T
|
|
|
4619
4621
|
});
|
|
4620
4622
|
}
|
|
4621
4623
|
|
|
4622
|
-
function asyncGeneratorStep$
|
|
4624
|
+
function asyncGeneratorStep$e(gen, resolve, reject, _next, _throw, key, arg) {
|
|
4623
4625
|
try {
|
|
4624
4626
|
var info = gen[key](arg);
|
|
4625
4627
|
var value = info.value;
|
|
@@ -4633,16 +4635,16 @@ function asyncGeneratorStep$c(gen, resolve, reject, _next, _throw, key, arg) {
|
|
|
4633
4635
|
Promise.resolve(value).then(_next, _throw);
|
|
4634
4636
|
}
|
|
4635
4637
|
}
|
|
4636
|
-
function _async_to_generator$
|
|
4638
|
+
function _async_to_generator$e(fn) {
|
|
4637
4639
|
return function() {
|
|
4638
4640
|
var self = this, args = arguments;
|
|
4639
4641
|
return new Promise(function(resolve, reject) {
|
|
4640
4642
|
var gen = fn.apply(self, args);
|
|
4641
4643
|
function _next(value) {
|
|
4642
|
-
asyncGeneratorStep$
|
|
4644
|
+
asyncGeneratorStep$e(gen, resolve, reject, _next, _throw, "next", value);
|
|
4643
4645
|
}
|
|
4644
4646
|
function _throw(err) {
|
|
4645
|
-
asyncGeneratorStep$
|
|
4647
|
+
asyncGeneratorStep$e(gen, resolve, reject, _next, _throw, "throw", err);
|
|
4646
4648
|
}
|
|
4647
4649
|
_next(undefined);
|
|
4648
4650
|
});
|
|
@@ -4700,7 +4702,7 @@ function _object_spread_props$9(target, source) {
|
|
|
4700
4702
|
}
|
|
4701
4703
|
return target;
|
|
4702
4704
|
}
|
|
4703
|
-
function _ts_generator$
|
|
4705
|
+
function _ts_generator$e(thisArg, body) {
|
|
4704
4706
|
var f, y, t, _ = {
|
|
4705
4707
|
label: 0,
|
|
4706
4708
|
sent: function() {
|
|
@@ -4853,9 +4855,9 @@ var MAKE_TEMPLATE_FOR_NOTIFICATION_RELATED_MODEL_INITIALIZATION_FUNCTION_DELETE_
|
|
|
4853
4855
|
* @returns an object with `initialized` and `alreadyInitialized` boolean flags
|
|
4854
4856
|
* @throws notificationModelAlreadyInitializedError when `throwErrorIfAlreadyInitialized` is true
|
|
4855
4857
|
*/ function initializeNotificationModelInTransaction(input) {
|
|
4856
|
-
return _async_to_generator$
|
|
4858
|
+
return _async_to_generator$e(function() {
|
|
4857
4859
|
var makeTemplateFunction, throwErrorIfAlreadyInitialized, transaction, documentInTransaction, notificationBox, initialized, alreadyInitialized, flatModelKey, modelKey, modelCollectionName, _$input, template;
|
|
4858
|
-
return _ts_generator$
|
|
4860
|
+
return _ts_generator$e(this, function(_state) {
|
|
4859
4861
|
switch(_state.label){
|
|
4860
4862
|
case 0:
|
|
4861
4863
|
makeTemplateFunction = input.makeTemplateFunction, throwErrorIfAlreadyInitialized = input.throwErrorIfAlreadyInitialized, transaction = input.transaction, documentInTransaction = input.document, notificationBox = input.data;
|
|
@@ -4958,9 +4960,9 @@ var MAKE_TEMPLATE_FOR_NOTIFICATION_RELATED_MODEL_INITIALIZATION_FUNCTION_DELETE_
|
|
|
4958
4960
|
*/ function initializeNotificationBoxInTransactionFactory(context) {
|
|
4959
4961
|
var notificationBoxCollection = context.notificationBoxCollection, makeTemplateForNotificationBoxInitialization = context.makeTemplateForNotificationBoxInitialization;
|
|
4960
4962
|
return function(params, notificationBoxDocument, transaction) {
|
|
4961
|
-
return _async_to_generator$
|
|
4963
|
+
return _async_to_generator$e(function() {
|
|
4962
4964
|
var throwErrorIfAlreadyInitialized, notificationBoxDocumentInTransaction, notificationBox;
|
|
4963
|
-
return _ts_generator$
|
|
4965
|
+
return _ts_generator$e(this, function(_state) {
|
|
4964
4966
|
switch(_state.label){
|
|
4965
4967
|
case 0:
|
|
4966
4968
|
throwErrorIfAlreadyInitialized = params.throwErrorIfAlreadyInitialized;
|
|
@@ -4998,13 +5000,13 @@ var MAKE_TEMPLATE_FOR_NOTIFICATION_RELATED_MODEL_INITIALIZATION_FUNCTION_DELETE_
|
|
|
4998
5000
|
var firestoreContext = context.firestoreContext, firebaseServerActionTransformFunctionFactory = context.firebaseServerActionTransformFunctionFactory;
|
|
4999
5001
|
var initializeNotificationBoxInTransaction = initializeNotificationBoxInTransactionFactory(context);
|
|
5000
5002
|
return firebaseServerActionTransformFunctionFactory(initializeNotificationModelParamsType, function(params) {
|
|
5001
|
-
return _async_to_generator$
|
|
5002
|
-
return _ts_generator$
|
|
5003
|
+
return _async_to_generator$e(function() {
|
|
5004
|
+
return _ts_generator$e(this, function(_state) {
|
|
5003
5005
|
return [
|
|
5004
5006
|
2,
|
|
5005
5007
|
function(notificationBoxDocument) {
|
|
5006
|
-
return _async_to_generator$
|
|
5007
|
-
return _ts_generator$
|
|
5008
|
+
return _async_to_generator$e(function() {
|
|
5009
|
+
return _ts_generator$e(this, function(_state) {
|
|
5008
5010
|
switch(_state.label){
|
|
5009
5011
|
case 0:
|
|
5010
5012
|
return [
|
|
@@ -5041,17 +5043,17 @@ var MAKE_TEMPLATE_FOR_NOTIFICATION_RELATED_MODEL_INITIALIZATION_FUNCTION_DELETE_
|
|
|
5041
5043
|
var firestoreContext = context.firestoreContext, firebaseServerActionTransformFunctionFactory = context.firebaseServerActionTransformFunctionFactory, notificationBoxCollection = context.notificationBoxCollection;
|
|
5042
5044
|
var initializeNotificationBoxInTransaction = initializeNotificationBoxInTransactionFactory(context);
|
|
5043
5045
|
return firebaseServerActionTransformFunctionFactory(initializeAllApplicableNotificationBoxesParamsType, function() {
|
|
5044
|
-
return _async_to_generator$
|
|
5045
|
-
return _ts_generator$
|
|
5046
|
+
return _async_to_generator$e(function() {
|
|
5047
|
+
return _ts_generator$e(this, function(_state) {
|
|
5046
5048
|
return [
|
|
5047
5049
|
2,
|
|
5048
5050
|
function() {
|
|
5049
|
-
return _async_to_generator$
|
|
5051
|
+
return _async_to_generator$e(function() {
|
|
5050
5052
|
var notificationBoxesVisited, notificationBoxesSucceeded, notificationBoxesFailed, notificationBoxesAlreadyInitialized, initializeNotificationBoxParams, initializeNotificationBoxesResults, found, result;
|
|
5051
5053
|
function initializeNotificationBoxes() {
|
|
5052
|
-
return _async_to_generator$
|
|
5054
|
+
return _async_to_generator$e(function() {
|
|
5053
5055
|
var query, notificationBoxDocuments, result;
|
|
5054
|
-
return _ts_generator$
|
|
5056
|
+
return _ts_generator$e(this, function(_state) {
|
|
5055
5057
|
switch(_state.label){
|
|
5056
5058
|
case 0:
|
|
5057
5059
|
query = notificationBoxCollection.queryDocument(notificationBoxesFlaggedForNeedsInitializationQuery());
|
|
@@ -5064,8 +5066,8 @@ var MAKE_TEMPLATE_FOR_NOTIFICATION_RELATED_MODEL_INITIALIZATION_FUNCTION_DELETE_
|
|
|
5064
5066
|
return [
|
|
5065
5067
|
4,
|
|
5066
5068
|
performAsyncTasks(notificationBoxDocuments, function(notificationBoxDocument) {
|
|
5067
|
-
return _async_to_generator$
|
|
5068
|
-
return _ts_generator$
|
|
5069
|
+
return _async_to_generator$e(function() {
|
|
5070
|
+
return _ts_generator$e(this, function(_state) {
|
|
5069
5071
|
return [
|
|
5070
5072
|
2,
|
|
5071
5073
|
firestoreContext.runTransaction(function(transaction) {
|
|
@@ -5088,7 +5090,7 @@ var MAKE_TEMPLATE_FOR_NOTIFICATION_RELATED_MODEL_INITIALIZATION_FUNCTION_DELETE_
|
|
|
5088
5090
|
});
|
|
5089
5091
|
})();
|
|
5090
5092
|
}
|
|
5091
|
-
return _ts_generator$
|
|
5093
|
+
return _ts_generator$e(this, function(_state) {
|
|
5092
5094
|
switch(_state.label){
|
|
5093
5095
|
case 0:
|
|
5094
5096
|
notificationBoxesVisited = 0;
|
|
@@ -5160,9 +5162,9 @@ var MAKE_TEMPLATE_FOR_NOTIFICATION_RELATED_MODEL_INITIALIZATION_FUNCTION_DELETE_
|
|
|
5160
5162
|
*/ function initializeNotificationSummaryInTransactionFactory(context) {
|
|
5161
5163
|
var notificationSummaryCollection = context.notificationSummaryCollection, makeTemplateForNotificationSummaryInitialization = context.makeTemplateForNotificationSummaryInitialization;
|
|
5162
5164
|
return function(params, notificationSummaryDocument, transaction) {
|
|
5163
|
-
return _async_to_generator$
|
|
5165
|
+
return _async_to_generator$e(function() {
|
|
5164
5166
|
var throwErrorIfAlreadyInitialized, notificationSummaryDocumentInTransaction, notificationSummary;
|
|
5165
|
-
return _ts_generator$
|
|
5167
|
+
return _ts_generator$e(this, function(_state) {
|
|
5166
5168
|
switch(_state.label){
|
|
5167
5169
|
case 0:
|
|
5168
5170
|
throwErrorIfAlreadyInitialized = params.throwErrorIfAlreadyInitialized;
|
|
@@ -5200,13 +5202,13 @@ var MAKE_TEMPLATE_FOR_NOTIFICATION_RELATED_MODEL_INITIALIZATION_FUNCTION_DELETE_
|
|
|
5200
5202
|
var firestoreContext = context.firestoreContext, firebaseServerActionTransformFunctionFactory = context.firebaseServerActionTransformFunctionFactory;
|
|
5201
5203
|
var initializeNotificationSummaryInTransaction = initializeNotificationSummaryInTransactionFactory(context);
|
|
5202
5204
|
return firebaseServerActionTransformFunctionFactory(initializeNotificationModelParamsType, function(params) {
|
|
5203
|
-
return _async_to_generator$
|
|
5204
|
-
return _ts_generator$
|
|
5205
|
+
return _async_to_generator$e(function() {
|
|
5206
|
+
return _ts_generator$e(this, function(_state) {
|
|
5205
5207
|
return [
|
|
5206
5208
|
2,
|
|
5207
5209
|
function(notificationSummaryDocument) {
|
|
5208
|
-
return _async_to_generator$
|
|
5209
|
-
return _ts_generator$
|
|
5210
|
+
return _async_to_generator$e(function() {
|
|
5211
|
+
return _ts_generator$e(this, function(_state) {
|
|
5210
5212
|
switch(_state.label){
|
|
5211
5213
|
case 0:
|
|
5212
5214
|
return [
|
|
@@ -5243,17 +5245,17 @@ var MAKE_TEMPLATE_FOR_NOTIFICATION_RELATED_MODEL_INITIALIZATION_FUNCTION_DELETE_
|
|
|
5243
5245
|
var firestoreContext = context.firestoreContext, firebaseServerActionTransformFunctionFactory = context.firebaseServerActionTransformFunctionFactory, notificationSummaryCollection = context.notificationSummaryCollection;
|
|
5244
5246
|
var initializeNotificationSummaryInTransaction = initializeNotificationSummaryInTransactionFactory(context);
|
|
5245
5247
|
return firebaseServerActionTransformFunctionFactory(initializeAllApplicableNotificationSummariesParamsType, function() {
|
|
5246
|
-
return _async_to_generator$
|
|
5247
|
-
return _ts_generator$
|
|
5248
|
+
return _async_to_generator$e(function() {
|
|
5249
|
+
return _ts_generator$e(this, function(_state) {
|
|
5248
5250
|
return [
|
|
5249
5251
|
2,
|
|
5250
5252
|
function() {
|
|
5251
|
-
return _async_to_generator$
|
|
5253
|
+
return _async_to_generator$e(function() {
|
|
5252
5254
|
var notificationSummariesVisited, notificationSummariesSucceeded, notificationSummariesFailed, notificationSummariesAlreadyInitialized, initializeNotificationSummaryParams, initializeNotificationSummariesResults, found, result;
|
|
5253
5255
|
function initializeNotificationSummaries() {
|
|
5254
|
-
return _async_to_generator$
|
|
5256
|
+
return _async_to_generator$e(function() {
|
|
5255
5257
|
var query, notificationSummaryDocuments, result;
|
|
5256
|
-
return _ts_generator$
|
|
5258
|
+
return _ts_generator$e(this, function(_state) {
|
|
5257
5259
|
switch(_state.label){
|
|
5258
5260
|
case 0:
|
|
5259
5261
|
query = notificationSummaryCollection.queryDocument(notificationSummariesFlaggedForNeedsInitializationQuery());
|
|
@@ -5266,8 +5268,8 @@ var MAKE_TEMPLATE_FOR_NOTIFICATION_RELATED_MODEL_INITIALIZATION_FUNCTION_DELETE_
|
|
|
5266
5268
|
return [
|
|
5267
5269
|
4,
|
|
5268
5270
|
performAsyncTasks(notificationSummaryDocuments, function(notificationSummaryDocument) {
|
|
5269
|
-
return _async_to_generator$
|
|
5270
|
-
return _ts_generator$
|
|
5271
|
+
return _async_to_generator$e(function() {
|
|
5272
|
+
return _ts_generator$e(this, function(_state) {
|
|
5271
5273
|
return [
|
|
5272
5274
|
2,
|
|
5273
5275
|
firestoreContext.runTransaction(function(transaction) {
|
|
@@ -5290,7 +5292,7 @@ var MAKE_TEMPLATE_FOR_NOTIFICATION_RELATED_MODEL_INITIALIZATION_FUNCTION_DELETE_
|
|
|
5290
5292
|
});
|
|
5291
5293
|
})();
|
|
5292
5294
|
}
|
|
5293
|
-
return _ts_generator$
|
|
5295
|
+
return _ts_generator$e(this, function(_state) {
|
|
5294
5296
|
switch(_state.label){
|
|
5295
5297
|
case 0:
|
|
5296
5298
|
notificationSummariesVisited = 0;
|
|
@@ -5388,7 +5390,7 @@ typeof SuppressedError === "function" ? SuppressedError : function(error, suppre
|
|
|
5388
5390
|
* message factories for individual {@link NotificationTemplateType} values.
|
|
5389
5391
|
*/ var NOTIFICATION_TEMPLATE_SERVICE_CONFIGS_ARRAY_TOKEN = 'NOTIFICATION_TEMPLATE_SERVICE_CONFIGS_ARRAY';
|
|
5390
5392
|
|
|
5391
|
-
function asyncGeneratorStep$
|
|
5393
|
+
function asyncGeneratorStep$d(gen, resolve, reject, _next, _throw, key, arg) {
|
|
5392
5394
|
try {
|
|
5393
5395
|
var info = gen[key](arg);
|
|
5394
5396
|
var value = info.value;
|
|
@@ -5402,16 +5404,16 @@ function asyncGeneratorStep$b(gen, resolve, reject, _next, _throw, key, arg) {
|
|
|
5402
5404
|
Promise.resolve(value).then(_next, _throw);
|
|
5403
5405
|
}
|
|
5404
5406
|
}
|
|
5405
|
-
function _async_to_generator$
|
|
5407
|
+
function _async_to_generator$d(fn) {
|
|
5406
5408
|
return function() {
|
|
5407
5409
|
var self = this, args = arguments;
|
|
5408
5410
|
return new Promise(function(resolve, reject) {
|
|
5409
5411
|
var gen = fn.apply(self, args);
|
|
5410
5412
|
function _next(value) {
|
|
5411
|
-
asyncGeneratorStep$
|
|
5413
|
+
asyncGeneratorStep$d(gen, resolve, reject, _next, _throw, "next", value);
|
|
5412
5414
|
}
|
|
5413
5415
|
function _throw(err) {
|
|
5414
|
-
asyncGeneratorStep$
|
|
5416
|
+
asyncGeneratorStep$d(gen, resolve, reject, _next, _throw, "throw", err);
|
|
5415
5417
|
}
|
|
5416
5418
|
_next(undefined);
|
|
5417
5419
|
});
|
|
@@ -5448,7 +5450,7 @@ function _define_property$a(obj, key, value) {
|
|
|
5448
5450
|
}
|
|
5449
5451
|
return obj;
|
|
5450
5452
|
}
|
|
5451
|
-
function _ts_generator$
|
|
5453
|
+
function _ts_generator$d(thisArg, body) {
|
|
5452
5454
|
var f, y, t, _ = {
|
|
5453
5455
|
label: 0,
|
|
5454
5456
|
sent: function() {
|
|
@@ -5635,9 +5637,9 @@ NotificationTemplateService = __decorate([
|
|
|
5635
5637
|
type: type,
|
|
5636
5638
|
isConfiguredType: isKnownType,
|
|
5637
5639
|
loadMessageFunction: function loadMessageFunction(config) {
|
|
5638
|
-
return _async_to_generator$
|
|
5640
|
+
return _async_to_generator$d(function() {
|
|
5639
5641
|
var _ref, factory;
|
|
5640
|
-
return _ts_generator$
|
|
5642
|
+
return _ts_generator$d(this, function(_state) {
|
|
5641
5643
|
factory = (_ref = instanceConfig === null || instanceConfig === void 0 ? void 0 : instanceConfig.factory) !== null && _ref !== void 0 ? _ref : defaultFactory;
|
|
5642
5644
|
return [
|
|
5643
5645
|
2,
|
|
@@ -5649,7 +5651,7 @@ NotificationTemplateService = __decorate([
|
|
|
5649
5651
|
};
|
|
5650
5652
|
}
|
|
5651
5653
|
|
|
5652
|
-
function asyncGeneratorStep$
|
|
5654
|
+
function asyncGeneratorStep$c(gen, resolve, reject, _next, _throw, key, arg) {
|
|
5653
5655
|
try {
|
|
5654
5656
|
var info = gen[key](arg);
|
|
5655
5657
|
var value = info.value;
|
|
@@ -5663,16 +5665,16 @@ function asyncGeneratorStep$a(gen, resolve, reject, _next, _throw, key, arg) {
|
|
|
5663
5665
|
Promise.resolve(value).then(_next, _throw);
|
|
5664
5666
|
}
|
|
5665
5667
|
}
|
|
5666
|
-
function _async_to_generator$
|
|
5668
|
+
function _async_to_generator$c(fn) {
|
|
5667
5669
|
return function() {
|
|
5668
5670
|
var self = this, args = arguments;
|
|
5669
5671
|
return new Promise(function(resolve, reject) {
|
|
5670
5672
|
var gen = fn.apply(self, args);
|
|
5671
5673
|
function _next(value) {
|
|
5672
|
-
asyncGeneratorStep$
|
|
5674
|
+
asyncGeneratorStep$c(gen, resolve, reject, _next, _throw, "next", value);
|
|
5673
5675
|
}
|
|
5674
5676
|
function _throw(err) {
|
|
5675
|
-
asyncGeneratorStep$
|
|
5677
|
+
asyncGeneratorStep$c(gen, resolve, reject, _next, _throw, "throw", err);
|
|
5676
5678
|
}
|
|
5677
5679
|
_next(undefined);
|
|
5678
5680
|
});
|
|
@@ -5725,7 +5727,7 @@ function _object_spread_props$8(target, source) {
|
|
|
5725
5727
|
}
|
|
5726
5728
|
return target;
|
|
5727
5729
|
}
|
|
5728
|
-
function _ts_generator$
|
|
5730
|
+
function _ts_generator$c(thisArg, body) {
|
|
5729
5731
|
var f, y, t, _ = {
|
|
5730
5732
|
label: 0,
|
|
5731
5733
|
sent: function() {
|
|
@@ -5856,11 +5858,11 @@ function _ts_generator$a(thisArg, body) {
|
|
|
5856
5858
|
* }
|
|
5857
5859
|
* ```
|
|
5858
5860
|
*/ function createOrRunUniqueNotificationDocument(input) {
|
|
5859
|
-
return _async_to_generator$
|
|
5861
|
+
return _async_to_generator$c(function() {
|
|
5860
5862
|
var expediteService, expediteInstance, updateNextRunAtTime, inputNow, sat, pair, pairExists, result;
|
|
5861
5863
|
function runNotificationTask() {
|
|
5862
|
-
return _async_to_generator$
|
|
5863
|
-
return _ts_generator$
|
|
5864
|
+
return _async_to_generator$c(function() {
|
|
5865
|
+
return _ts_generator$c(this, function(_state) {
|
|
5864
5866
|
switch(_state.label){
|
|
5865
5867
|
case 0:
|
|
5866
5868
|
if (!(expediteService != null)) return [
|
|
@@ -5910,7 +5912,7 @@ function _ts_generator$a(thisArg, body) {
|
|
|
5910
5912
|
});
|
|
5911
5913
|
})();
|
|
5912
5914
|
}
|
|
5913
|
-
return _ts_generator$
|
|
5915
|
+
return _ts_generator$c(this, function(_state) {
|
|
5914
5916
|
switch(_state.label){
|
|
5915
5917
|
case 0:
|
|
5916
5918
|
expediteService = input.expediteService, expediteInstance = input.expediteInstance, updateNextRunAtTime = input.updateNextRunAtTime, inputNow = input.now;
|
|
@@ -6013,7 +6015,7 @@ function _class_call_check$6(instance, Constructor) {
|
|
|
6013
6015
|
}
|
|
6014
6016
|
;
|
|
6015
6017
|
|
|
6016
|
-
function asyncGeneratorStep$
|
|
6018
|
+
function asyncGeneratorStep$b(gen, resolve, reject, _next, _throw, key, arg) {
|
|
6017
6019
|
try {
|
|
6018
6020
|
var info = gen[key](arg);
|
|
6019
6021
|
var value = info.value;
|
|
@@ -6027,16 +6029,16 @@ function asyncGeneratorStep$9(gen, resolve, reject, _next, _throw, key, arg) {
|
|
|
6027
6029
|
Promise.resolve(value).then(_next, _throw);
|
|
6028
6030
|
}
|
|
6029
6031
|
}
|
|
6030
|
-
function _async_to_generator$
|
|
6032
|
+
function _async_to_generator$b(fn) {
|
|
6031
6033
|
return function() {
|
|
6032
6034
|
var self = this, args = arguments;
|
|
6033
6035
|
return new Promise(function(resolve, reject) {
|
|
6034
6036
|
var gen = fn.apply(self, args);
|
|
6035
6037
|
function _next(value) {
|
|
6036
|
-
asyncGeneratorStep$
|
|
6038
|
+
asyncGeneratorStep$b(gen, resolve, reject, _next, _throw, "next", value);
|
|
6037
6039
|
}
|
|
6038
6040
|
function _throw(err) {
|
|
6039
|
-
asyncGeneratorStep$
|
|
6041
|
+
asyncGeneratorStep$b(gen, resolve, reject, _next, _throw, "throw", err);
|
|
6040
6042
|
}
|
|
6041
6043
|
_next(undefined);
|
|
6042
6044
|
});
|
|
@@ -6088,7 +6090,7 @@ function _object_spread$8(target) {
|
|
|
6088
6090
|
}
|
|
6089
6091
|
return target;
|
|
6090
6092
|
}
|
|
6091
|
-
function _ts_generator$
|
|
6093
|
+
function _ts_generator$b(thisArg, body) {
|
|
6092
6094
|
var f, y, t, _ = {
|
|
6093
6095
|
label: 0,
|
|
6094
6096
|
sent: function() {
|
|
@@ -6216,8 +6218,8 @@ function _ts_generator$9(thisArg, body) {
|
|
|
6216
6218
|
return enqueued;
|
|
6217
6219
|
};
|
|
6218
6220
|
var send = function send(options) {
|
|
6219
|
-
return _async_to_generator$
|
|
6220
|
-
return _ts_generator$
|
|
6221
|
+
return _async_to_generator$b(function() {
|
|
6222
|
+
return _ts_generator$b(this, function(_state) {
|
|
6221
6223
|
return [
|
|
6222
6224
|
2,
|
|
6223
6225
|
runAsyncTasksForValues(_documentsToSend, function(x) {
|
|
@@ -6276,9 +6278,9 @@ function _ts_generator$9(thisArg, body) {
|
|
|
6276
6278
|
{
|
|
6277
6279
|
key: "sendNotification",
|
|
6278
6280
|
value: function sendNotification(notificationDocument, options) {
|
|
6279
|
-
return _async_to_generator$
|
|
6281
|
+
return _async_to_generator$b(function() {
|
|
6280
6282
|
var sendNotification;
|
|
6281
|
-
return _ts_generator$
|
|
6283
|
+
return _ts_generator$b(this, function(_state) {
|
|
6282
6284
|
switch(_state.label){
|
|
6283
6285
|
case 0:
|
|
6284
6286
|
return [
|
|
@@ -6339,13 +6341,13 @@ MutableNotificationExpediteService = __decorate([
|
|
|
6339
6341
|
];
|
|
6340
6342
|
}
|
|
6341
6343
|
|
|
6342
|
-
function _array_like_to_array$
|
|
6344
|
+
function _array_like_to_array$6(arr, len) {
|
|
6343
6345
|
if (len == null || len > arr.length) len = arr.length;
|
|
6344
6346
|
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
6345
6347
|
return arr2;
|
|
6346
6348
|
}
|
|
6347
6349
|
function _array_without_holes$4(arr) {
|
|
6348
|
-
if (Array.isArray(arr)) return _array_like_to_array$
|
|
6350
|
+
if (Array.isArray(arr)) return _array_like_to_array$6(arr);
|
|
6349
6351
|
}
|
|
6350
6352
|
function _class_call_check$4(instance, Constructor) {
|
|
6351
6353
|
if (!(instance instanceof Constructor)) {
|
|
@@ -6406,15 +6408,15 @@ function _object_spread_props$7(target, source) {
|
|
|
6406
6408
|
return target;
|
|
6407
6409
|
}
|
|
6408
6410
|
function _to_consumable_array$4(arr) {
|
|
6409
|
-
return _array_without_holes$4(arr) || _iterable_to_array$4(arr) || _unsupported_iterable_to_array$
|
|
6411
|
+
return _array_without_holes$4(arr) || _iterable_to_array$4(arr) || _unsupported_iterable_to_array$6(arr) || _non_iterable_spread$4();
|
|
6410
6412
|
}
|
|
6411
|
-
function _unsupported_iterable_to_array$
|
|
6413
|
+
function _unsupported_iterable_to_array$6(o, minLen) {
|
|
6412
6414
|
if (!o) return;
|
|
6413
|
-
if (typeof o === "string") return _array_like_to_array$
|
|
6415
|
+
if (typeof o === "string") return _array_like_to_array$6(o, minLen);
|
|
6414
6416
|
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
6415
6417
|
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
6416
6418
|
if (n === "Map" || n === "Set") return Array.from(n);
|
|
6417
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$
|
|
6419
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$6(o, minLen);
|
|
6418
6420
|
}
|
|
6419
6421
|
// MARK: Provider Factories
|
|
6420
6422
|
/**
|
|
@@ -6546,18 +6548,18 @@ GlobalNotificationModule = __decorate([
|
|
|
6546
6548
|
})
|
|
6547
6549
|
], GlobalNotificationModule);
|
|
6548
6550
|
|
|
6549
|
-
function _array_like_to_array$
|
|
6551
|
+
function _array_like_to_array$5(arr, len) {
|
|
6550
6552
|
if (len == null || len > arr.length) len = arr.length;
|
|
6551
6553
|
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
6552
6554
|
return arr2;
|
|
6553
6555
|
}
|
|
6554
|
-
function _array_with_holes$
|
|
6556
|
+
function _array_with_holes$2(arr) {
|
|
6555
6557
|
if (Array.isArray(arr)) return arr;
|
|
6556
6558
|
}
|
|
6557
6559
|
function _array_without_holes$3(arr) {
|
|
6558
|
-
if (Array.isArray(arr)) return _array_like_to_array$
|
|
6560
|
+
if (Array.isArray(arr)) return _array_like_to_array$5(arr);
|
|
6559
6561
|
}
|
|
6560
|
-
function asyncGeneratorStep$
|
|
6562
|
+
function asyncGeneratorStep$a(gen, resolve, reject, _next, _throw, key, arg) {
|
|
6561
6563
|
try {
|
|
6562
6564
|
var info = gen[key](arg);
|
|
6563
6565
|
var value = info.value;
|
|
@@ -6571,16 +6573,16 @@ function asyncGeneratorStep$8(gen, resolve, reject, _next, _throw, key, arg) {
|
|
|
6571
6573
|
Promise.resolve(value).then(_next, _throw);
|
|
6572
6574
|
}
|
|
6573
6575
|
}
|
|
6574
|
-
function _async_to_generator$
|
|
6576
|
+
function _async_to_generator$a(fn) {
|
|
6575
6577
|
return function() {
|
|
6576
6578
|
var self = this, args = arguments;
|
|
6577
6579
|
return new Promise(function(resolve, reject) {
|
|
6578
6580
|
var gen = fn.apply(self, args);
|
|
6579
6581
|
function _next(value) {
|
|
6580
|
-
asyncGeneratorStep$
|
|
6582
|
+
asyncGeneratorStep$a(gen, resolve, reject, _next, _throw, "next", value);
|
|
6581
6583
|
}
|
|
6582
6584
|
function _throw(err) {
|
|
6583
|
-
asyncGeneratorStep$
|
|
6585
|
+
asyncGeneratorStep$a(gen, resolve, reject, _next, _throw, "throw", err);
|
|
6584
6586
|
}
|
|
6585
6587
|
_next(undefined);
|
|
6586
6588
|
});
|
|
@@ -6602,7 +6604,7 @@ function _define_property$6(obj, key, value) {
|
|
|
6602
6604
|
function _iterable_to_array$3(iter) {
|
|
6603
6605
|
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
6604
6606
|
}
|
|
6605
|
-
function _iterable_to_array_limit$
|
|
6607
|
+
function _iterable_to_array_limit$2(arr, i) {
|
|
6606
6608
|
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
6607
6609
|
if (_i == null) return;
|
|
6608
6610
|
var _arr = [];
|
|
@@ -6626,7 +6628,7 @@ function _iterable_to_array_limit$1(arr, i) {
|
|
|
6626
6628
|
}
|
|
6627
6629
|
return _arr;
|
|
6628
6630
|
}
|
|
6629
|
-
function _non_iterable_rest$
|
|
6631
|
+
function _non_iterable_rest$2() {
|
|
6630
6632
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
6631
6633
|
}
|
|
6632
6634
|
function _non_iterable_spread$3() {
|
|
@@ -6666,21 +6668,21 @@ function _object_spread_props$6(target, source) {
|
|
|
6666
6668
|
}
|
|
6667
6669
|
return target;
|
|
6668
6670
|
}
|
|
6669
|
-
function _sliced_to_array$
|
|
6670
|
-
return _array_with_holes$
|
|
6671
|
+
function _sliced_to_array$2(arr, i) {
|
|
6672
|
+
return _array_with_holes$2(arr) || _iterable_to_array_limit$2(arr, i) || _unsupported_iterable_to_array$5(arr, i) || _non_iterable_rest$2();
|
|
6671
6673
|
}
|
|
6672
6674
|
function _to_consumable_array$3(arr) {
|
|
6673
|
-
return _array_without_holes$3(arr) || _iterable_to_array$3(arr) || _unsupported_iterable_to_array$
|
|
6675
|
+
return _array_without_holes$3(arr) || _iterable_to_array$3(arr) || _unsupported_iterable_to_array$5(arr) || _non_iterable_spread$3();
|
|
6674
6676
|
}
|
|
6675
|
-
function _unsupported_iterable_to_array$
|
|
6677
|
+
function _unsupported_iterable_to_array$5(o, minLen) {
|
|
6676
6678
|
if (!o) return;
|
|
6677
|
-
if (typeof o === "string") return _array_like_to_array$
|
|
6679
|
+
if (typeof o === "string") return _array_like_to_array$5(o, minLen);
|
|
6678
6680
|
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
6679
6681
|
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
6680
6682
|
if (n === "Map" || n === "Set") return Array.from(n);
|
|
6681
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$
|
|
6683
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$5(o, minLen);
|
|
6682
6684
|
}
|
|
6683
|
-
function _ts_generator$
|
|
6685
|
+
function _ts_generator$a(thisArg, body) {
|
|
6684
6686
|
var f, y, t, _ = {
|
|
6685
6687
|
label: 0,
|
|
6686
6688
|
sent: function() {
|
|
@@ -6808,9 +6810,9 @@ function _ts_generator$8(thisArg, body) {
|
|
|
6808
6810
|
var allowCreateNotificationSummaries = inputAllowCreateNotificationSummaries !== null && inputAllowCreateNotificationSummaries !== void 0 ? inputAllowCreateNotificationSummaries : true;
|
|
6809
6811
|
var sendService = {
|
|
6810
6812
|
buildSendInstanceForNotificationSummaryMessages: function buildSendInstanceForNotificationSummaryMessages(notificationMessages) {
|
|
6811
|
-
return _async_to_generator$
|
|
6813
|
+
return _async_to_generator$a(function() {
|
|
6812
6814
|
var messagesGroupedByNotificationSummaryMapBuilder, cutSubject, cutMessage, messagesGroups;
|
|
6813
|
-
return _ts_generator$
|
|
6815
|
+
return _ts_generator$a(this, function(_state) {
|
|
6814
6816
|
messagesGroupedByNotificationSummaryMapBuilder = multiValueMapBuilder();
|
|
6815
6817
|
notificationMessages.forEach(function(x) {
|
|
6816
6818
|
if (x.inputContext.recipient.s != null && x.item != null) {
|
|
@@ -6828,9 +6830,9 @@ function _ts_generator$8(thisArg, body) {
|
|
|
6828
6830
|
return [
|
|
6829
6831
|
2,
|
|
6830
6832
|
function() {
|
|
6831
|
-
return _async_to_generator$
|
|
6833
|
+
return _async_to_generator$a(function() {
|
|
6832
6834
|
var success, failed, ignored, sendResult;
|
|
6833
|
-
return _ts_generator$
|
|
6835
|
+
return _ts_generator$a(this, function(_state) {
|
|
6834
6836
|
switch(_state.label){
|
|
6835
6837
|
case 0:
|
|
6836
6838
|
success = [];
|
|
@@ -6839,17 +6841,17 @@ function _ts_generator$8(thisArg, body) {
|
|
|
6839
6841
|
return [
|
|
6840
6842
|
4,
|
|
6841
6843
|
runAsyncTasksForValues(messagesGroups, function(param) {
|
|
6842
|
-
var _param = _sliced_to_array$
|
|
6843
|
-
return _async_to_generator$
|
|
6844
|
-
return _ts_generator$
|
|
6844
|
+
var _param = _sliced_to_array$2(param, 2), notificationSummaryId = _param[0], messages = _param[1];
|
|
6845
|
+
return _async_to_generator$a(function() {
|
|
6846
|
+
return _ts_generator$a(this, function(_state) {
|
|
6845
6847
|
switch(_state.label){
|
|
6846
6848
|
case 0:
|
|
6847
6849
|
return [
|
|
6848
6850
|
4,
|
|
6849
6851
|
firestoreContext.runTransaction(function(transaction) {
|
|
6850
|
-
return _async_to_generator$
|
|
6852
|
+
return _async_to_generator$a(function() {
|
|
6851
6853
|
var _ref, notificationSummaryDocument, notificationSummary, updated, updateTemplate, existingMessages, existingMessageIds, messagesToSend, sortedN, n, createTemplate;
|
|
6852
|
-
return _ts_generator$
|
|
6854
|
+
return _ts_generator$a(this, function(_state) {
|
|
6853
6855
|
switch(_state.label){
|
|
6854
6856
|
case 0:
|
|
6855
6857
|
notificationSummaryDocument = notificationSummaryCollection.documentAccessorForTransaction(transaction).loadDocumentForId(notificationSummaryId);
|
|
@@ -6976,7 +6978,7 @@ function _ts_generator$8(thisArg, body) {
|
|
|
6976
6978
|
return sendService;
|
|
6977
6979
|
}
|
|
6978
6980
|
|
|
6979
|
-
function asyncGeneratorStep$
|
|
6981
|
+
function asyncGeneratorStep$9(gen, resolve, reject, _next, _throw, key, arg) {
|
|
6980
6982
|
try {
|
|
6981
6983
|
var info = gen[key](arg);
|
|
6982
6984
|
var value = info.value;
|
|
@@ -6990,22 +6992,22 @@ function asyncGeneratorStep$7(gen, resolve, reject, _next, _throw, key, arg) {
|
|
|
6990
6992
|
Promise.resolve(value).then(_next, _throw);
|
|
6991
6993
|
}
|
|
6992
6994
|
}
|
|
6993
|
-
function _async_to_generator$
|
|
6995
|
+
function _async_to_generator$9(fn) {
|
|
6994
6996
|
return function() {
|
|
6995
6997
|
var self = this, args = arguments;
|
|
6996
6998
|
return new Promise(function(resolve, reject) {
|
|
6997
6999
|
var gen = fn.apply(self, args);
|
|
6998
7000
|
function _next(value) {
|
|
6999
|
-
asyncGeneratorStep$
|
|
7001
|
+
asyncGeneratorStep$9(gen, resolve, reject, _next, _throw, "next", value);
|
|
7000
7002
|
}
|
|
7001
7003
|
function _throw(err) {
|
|
7002
|
-
asyncGeneratorStep$
|
|
7004
|
+
asyncGeneratorStep$9(gen, resolve, reject, _next, _throw, "throw", err);
|
|
7003
7005
|
}
|
|
7004
7006
|
_next(undefined);
|
|
7005
7007
|
});
|
|
7006
7008
|
};
|
|
7007
7009
|
}
|
|
7008
|
-
function _ts_generator$
|
|
7010
|
+
function _ts_generator$9(thisArg, body) {
|
|
7009
7011
|
var f, y, t, _ = {
|
|
7010
7012
|
label: 0,
|
|
7011
7013
|
sent: function() {
|
|
@@ -7123,14 +7125,14 @@ function _ts_generator$7(thisArg, body) {
|
|
|
7123
7125
|
*/ function ignoreSendNotificationTextSendService() {
|
|
7124
7126
|
var sendService = {
|
|
7125
7127
|
buildSendInstanceForTextNotificationMessages: function buildSendInstanceForTextNotificationMessages(notificationMessages) {
|
|
7126
|
-
return _async_to_generator$
|
|
7127
|
-
return _ts_generator$
|
|
7128
|
+
return _async_to_generator$9(function() {
|
|
7129
|
+
return _ts_generator$9(this, function(_state) {
|
|
7128
7130
|
return [
|
|
7129
7131
|
2,
|
|
7130
7132
|
function() {
|
|
7131
|
-
return _async_to_generator$
|
|
7133
|
+
return _async_to_generator$9(function() {
|
|
7132
7134
|
var success, failed, ignored, sendResult;
|
|
7133
|
-
return _ts_generator$
|
|
7135
|
+
return _ts_generator$9(this, function(_state) {
|
|
7134
7136
|
success = [];
|
|
7135
7137
|
failed = [];
|
|
7136
7138
|
ignored = notificationMessages.map(function(x) {
|
|
@@ -7156,7 +7158,7 @@ function _ts_generator$7(thisArg, body) {
|
|
|
7156
7158
|
return sendService;
|
|
7157
7159
|
}
|
|
7158
7160
|
|
|
7159
|
-
function asyncGeneratorStep$
|
|
7161
|
+
function asyncGeneratorStep$8(gen, resolve, reject, _next, _throw, key, arg) {
|
|
7160
7162
|
try {
|
|
7161
7163
|
var info = gen[key](arg);
|
|
7162
7164
|
var value = info.value;
|
|
@@ -7170,22 +7172,22 @@ function asyncGeneratorStep$6(gen, resolve, reject, _next, _throw, key, arg) {
|
|
|
7170
7172
|
Promise.resolve(value).then(_next, _throw);
|
|
7171
7173
|
}
|
|
7172
7174
|
}
|
|
7173
|
-
function _async_to_generator$
|
|
7175
|
+
function _async_to_generator$8(fn) {
|
|
7174
7176
|
return function() {
|
|
7175
7177
|
var self = this, args = arguments;
|
|
7176
7178
|
return new Promise(function(resolve, reject) {
|
|
7177
7179
|
var gen = fn.apply(self, args);
|
|
7178
7180
|
function _next(value) {
|
|
7179
|
-
asyncGeneratorStep$
|
|
7181
|
+
asyncGeneratorStep$8(gen, resolve, reject, _next, _throw, "next", value);
|
|
7180
7182
|
}
|
|
7181
7183
|
function _throw(err) {
|
|
7182
|
-
asyncGeneratorStep$
|
|
7184
|
+
asyncGeneratorStep$8(gen, resolve, reject, _next, _throw, "throw", err);
|
|
7183
7185
|
}
|
|
7184
7186
|
_next(undefined);
|
|
7185
7187
|
});
|
|
7186
7188
|
};
|
|
7187
7189
|
}
|
|
7188
|
-
function _ts_generator$
|
|
7190
|
+
function _ts_generator$8(thisArg, body) {
|
|
7189
7191
|
var f, y, t, _ = {
|
|
7190
7192
|
label: 0,
|
|
7191
7193
|
sent: function() {
|
|
@@ -7327,9 +7329,9 @@ function _ts_generator$6(thisArg, body) {
|
|
|
7327
7329
|
}
|
|
7328
7330
|
return {
|
|
7329
7331
|
handleNotificationTask: function handleNotificationTask(notificationTask) {
|
|
7330
|
-
return _async_to_generator$
|
|
7332
|
+
return _async_to_generator$8(function() {
|
|
7331
7333
|
var completedCheckpoints, fn, _nonCheckpointFlows_, _this, completedCheckpointsSet, nextCheckpoint, result;
|
|
7332
|
-
return _ts_generator$
|
|
7334
|
+
return _ts_generator$8(this, function(_state) {
|
|
7333
7335
|
switch(_state.label){
|
|
7334
7336
|
case 0:
|
|
7335
7337
|
completedCheckpoints = notificationTask.checkpoints;
|
|
@@ -7393,13 +7395,13 @@ function _ts_generator$6(thisArg, body) {
|
|
|
7393
7395
|
};
|
|
7394
7396
|
}
|
|
7395
7397
|
|
|
7396
|
-
function _array_like_to_array$
|
|
7398
|
+
function _array_like_to_array$4(arr, len) {
|
|
7397
7399
|
if (len == null || len > arr.length) len = arr.length;
|
|
7398
7400
|
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
7399
7401
|
return arr2;
|
|
7400
7402
|
}
|
|
7401
7403
|
function _array_without_holes$2(arr) {
|
|
7402
|
-
if (Array.isArray(arr)) return _array_like_to_array$
|
|
7404
|
+
if (Array.isArray(arr)) return _array_like_to_array$4(arr);
|
|
7403
7405
|
}
|
|
7404
7406
|
function _assert_this_initialized(self) {
|
|
7405
7407
|
if (self === void 0) {
|
|
@@ -7407,7 +7409,7 @@ function _assert_this_initialized(self) {
|
|
|
7407
7409
|
}
|
|
7408
7410
|
return self;
|
|
7409
7411
|
}
|
|
7410
|
-
function asyncGeneratorStep$
|
|
7412
|
+
function asyncGeneratorStep$7(gen, resolve, reject, _next, _throw, key, arg) {
|
|
7411
7413
|
try {
|
|
7412
7414
|
var info = gen[key](arg);
|
|
7413
7415
|
var value = info.value;
|
|
@@ -7421,16 +7423,16 @@ function asyncGeneratorStep$5(gen, resolve, reject, _next, _throw, key, arg) {
|
|
|
7421
7423
|
Promise.resolve(value).then(_next, _throw);
|
|
7422
7424
|
}
|
|
7423
7425
|
}
|
|
7424
|
-
function _async_to_generator$
|
|
7426
|
+
function _async_to_generator$7(fn) {
|
|
7425
7427
|
return function() {
|
|
7426
7428
|
var self = this, args = arguments;
|
|
7427
7429
|
return new Promise(function(resolve, reject) {
|
|
7428
7430
|
var gen = fn.apply(self, args);
|
|
7429
7431
|
function _next(value) {
|
|
7430
|
-
asyncGeneratorStep$
|
|
7432
|
+
asyncGeneratorStep$7(gen, resolve, reject, _next, _throw, "next", value);
|
|
7431
7433
|
}
|
|
7432
7434
|
function _throw(err) {
|
|
7433
|
-
asyncGeneratorStep$
|
|
7435
|
+
asyncGeneratorStep$7(gen, resolve, reject, _next, _throw, "throw", err);
|
|
7434
7436
|
}
|
|
7435
7437
|
_next(undefined);
|
|
7436
7438
|
});
|
|
@@ -7477,7 +7479,7 @@ function _inherits(subClass, superClass) {
|
|
|
7477
7479
|
});
|
|
7478
7480
|
if (superClass) _set_prototype_of(subClass, superClass);
|
|
7479
7481
|
}
|
|
7480
|
-
function _instanceof$
|
|
7482
|
+
function _instanceof$2(left, right) {
|
|
7481
7483
|
"@swc/helpers - instanceof";
|
|
7482
7484
|
if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
|
|
7483
7485
|
return !!right[Symbol.hasInstance](left);
|
|
@@ -7539,19 +7541,19 @@ function _set_prototype_of(o, p) {
|
|
|
7539
7541
|
return _set_prototype_of(o, p);
|
|
7540
7542
|
}
|
|
7541
7543
|
function _to_consumable_array$2(arr) {
|
|
7542
|
-
return _array_without_holes$2(arr) || _iterable_to_array$2(arr) || _unsupported_iterable_to_array$
|
|
7544
|
+
return _array_without_holes$2(arr) || _iterable_to_array$2(arr) || _unsupported_iterable_to_array$4(arr) || _non_iterable_spread$2();
|
|
7543
7545
|
}
|
|
7544
7546
|
function _type_of$1(obj) {
|
|
7545
7547
|
"@swc/helpers - typeof";
|
|
7546
7548
|
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
7547
7549
|
}
|
|
7548
|
-
function _unsupported_iterable_to_array$
|
|
7550
|
+
function _unsupported_iterable_to_array$4(o, minLen) {
|
|
7549
7551
|
if (!o) return;
|
|
7550
|
-
if (typeof o === "string") return _array_like_to_array$
|
|
7552
|
+
if (typeof o === "string") return _array_like_to_array$4(o, minLen);
|
|
7551
7553
|
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
7552
7554
|
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
7553
7555
|
if (n === "Map" || n === "Set") return Array.from(n);
|
|
7554
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$
|
|
7556
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$4(o, minLen);
|
|
7555
7557
|
}
|
|
7556
7558
|
function _is_native_reflect_construct() {
|
|
7557
7559
|
try {
|
|
@@ -7561,7 +7563,7 @@ function _is_native_reflect_construct() {
|
|
|
7561
7563
|
return !!result;
|
|
7562
7564
|
})();
|
|
7563
7565
|
}
|
|
7564
|
-
function _ts_generator$
|
|
7566
|
+
function _ts_generator$7(thisArg, body) {
|
|
7565
7567
|
var f, y, t, _ = {
|
|
7566
7568
|
label: 0,
|
|
7567
7569
|
sent: function() {
|
|
@@ -7717,9 +7719,9 @@ function _ts_generator$5(thisArg, body) {
|
|
|
7717
7719
|
}));
|
|
7718
7720
|
return {
|
|
7719
7721
|
process: function process(input) {
|
|
7720
|
-
return _async_to_generator$
|
|
7722
|
+
return _async_to_generator$7(function() {
|
|
7721
7723
|
var notificationTask, completedSubtasks, subtaskData, fn, _nonSubtaskFlows_, _this, completedSubtasksSet, nextSubtask, result, subtaskResult, subtaskCompletion, subtaskUpdateMetadata, delayUntil, canRunNextCheckpoint, allSubtasksDone, sfps, completedSubtasksSet1, incompleteSubtasks, sd, baseUpdateMetadata, updateMetadata, nextCanRunNextCheckpoint;
|
|
7722
|
-
return _ts_generator$
|
|
7724
|
+
return _ts_generator$7(this, function(_state) {
|
|
7723
7725
|
switch(_state.label){
|
|
7724
7726
|
case 0:
|
|
7725
7727
|
notificationTask = input.notificationTask, completedSubtasks = input.completedSubtasks, subtaskData = input.subtaskData;
|
|
@@ -7827,9 +7829,9 @@ function _ts_generator$5(thisArg, body) {
|
|
|
7827
7829
|
};
|
|
7828
7830
|
var useInputDataFactory = function useInputDataFactory(fn) {
|
|
7829
7831
|
return function(notificationTask) {
|
|
7830
|
-
return _async_to_generator$
|
|
7832
|
+
return _async_to_generator$7(function() {
|
|
7831
7833
|
var data, result, inputFunctionResult, e;
|
|
7832
|
-
return _ts_generator$
|
|
7834
|
+
return _ts_generator$7(this, function(_state) {
|
|
7833
7835
|
switch(_state.label){
|
|
7834
7836
|
case 0:
|
|
7835
7837
|
data = notificationTask.data;
|
|
@@ -7863,7 +7865,7 @@ function _ts_generator$5(thisArg, body) {
|
|
|
7863
7865
|
];
|
|
7864
7866
|
case 4:
|
|
7865
7867
|
e = _state.sent();
|
|
7866
|
-
if (_instanceof$
|
|
7868
|
+
if (_instanceof$2(e, NotificationTaskSubTaskMissingRequiredDataTermination)) {
|
|
7867
7869
|
// Task is complete if the required data no longer exists. Nothing to cleanup.
|
|
7868
7870
|
result = notificationTaskComplete();
|
|
7869
7871
|
} else {
|
|
@@ -7910,9 +7912,9 @@ function _ts_generator$5(thisArg, body) {
|
|
|
7910
7912
|
{
|
|
7911
7913
|
checkpoint: NOTIFICATION_TASK_SUBTASK_CHECKPOINT_PROCESSING,
|
|
7912
7914
|
fn: useInputDataFactory(function(notificationTask, inputFunctionResult, data) {
|
|
7913
|
-
return _async_to_generator$
|
|
7915
|
+
return _async_to_generator$7(function() {
|
|
7914
7916
|
var result, baseInput, target, processor, subtaskData, completedSubtasks, input;
|
|
7915
|
-
return _ts_generator$
|
|
7917
|
+
return _ts_generator$7(this, function(_state) {
|
|
7916
7918
|
switch(_state.label){
|
|
7917
7919
|
case 0:
|
|
7918
7920
|
baseInput = _object_spread_props$5(_object_spread$5({}, inputFunctionResult), {
|
|
@@ -7970,9 +7972,9 @@ function _ts_generator$5(thisArg, body) {
|
|
|
7970
7972
|
{
|
|
7971
7973
|
checkpoint: NOTIFICATION_TASK_SUBTASK_CHECKPOINT_CLEANUP,
|
|
7972
7974
|
fn: useInputDataFactory(function(notificationTask, inputFunctionResult, data) {
|
|
7973
|
-
return _async_to_generator$
|
|
7975
|
+
return _async_to_generator$7(function() {
|
|
7974
7976
|
var result, cleanupFunctionInput, target, cleanupInstructions, processor, _ref, subtaskData, completedSubtasks, input, _tmp, _cleanupInstructions_delayRetryUntil;
|
|
7975
|
-
return _ts_generator$
|
|
7977
|
+
return _ts_generator$7(this, function(_state) {
|
|
7976
7978
|
switch(_state.label){
|
|
7977
7979
|
case 0:
|
|
7978
7980
|
cleanupFunctionInput = _object_spread_props$5(_object_spread$5({}, inputFunctionResult), {
|
|
@@ -8103,6 +8105,835 @@ function _ts_generator$5(thisArg, body) {
|
|
|
8103
8105
|
return new NotificationTaskSubTaskMissingRequiredDataTermination();
|
|
8104
8106
|
}
|
|
8105
8107
|
|
|
8108
|
+
function asyncGeneratorStep$6(gen, resolve, reject, _next, _throw, key, arg) {
|
|
8109
|
+
try {
|
|
8110
|
+
var info = gen[key](arg);
|
|
8111
|
+
var value = info.value;
|
|
8112
|
+
} catch (error) {
|
|
8113
|
+
reject(error);
|
|
8114
|
+
return;
|
|
8115
|
+
}
|
|
8116
|
+
if (info.done) {
|
|
8117
|
+
resolve(value);
|
|
8118
|
+
} else {
|
|
8119
|
+
Promise.resolve(value).then(_next, _throw);
|
|
8120
|
+
}
|
|
8121
|
+
}
|
|
8122
|
+
function _async_to_generator$6(fn) {
|
|
8123
|
+
return function() {
|
|
8124
|
+
var self = this, args = arguments;
|
|
8125
|
+
return new Promise(function(resolve, reject) {
|
|
8126
|
+
var gen = fn.apply(self, args);
|
|
8127
|
+
function _next(value) {
|
|
8128
|
+
asyncGeneratorStep$6(gen, resolve, reject, _next, _throw, "next", value);
|
|
8129
|
+
}
|
|
8130
|
+
function _throw(err) {
|
|
8131
|
+
asyncGeneratorStep$6(gen, resolve, reject, _next, _throw, "throw", err);
|
|
8132
|
+
}
|
|
8133
|
+
_next(undefined);
|
|
8134
|
+
});
|
|
8135
|
+
};
|
|
8136
|
+
}
|
|
8137
|
+
function _ts_generator$6(thisArg, body) {
|
|
8138
|
+
var f, y, t, _ = {
|
|
8139
|
+
label: 0,
|
|
8140
|
+
sent: function() {
|
|
8141
|
+
if (t[0] & 1) throw t[1];
|
|
8142
|
+
return t[1];
|
|
8143
|
+
},
|
|
8144
|
+
trys: [],
|
|
8145
|
+
ops: []
|
|
8146
|
+
}, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype), d = Object.defineProperty;
|
|
8147
|
+
return d(g, "next", {
|
|
8148
|
+
value: verb(0)
|
|
8149
|
+
}), d(g, "throw", {
|
|
8150
|
+
value: verb(1)
|
|
8151
|
+
}), d(g, "return", {
|
|
8152
|
+
value: verb(2)
|
|
8153
|
+
}), typeof Symbol === "function" && d(g, Symbol.iterator, {
|
|
8154
|
+
value: function() {
|
|
8155
|
+
return this;
|
|
8156
|
+
}
|
|
8157
|
+
}), g;
|
|
8158
|
+
function verb(n) {
|
|
8159
|
+
return function(v) {
|
|
8160
|
+
return step([
|
|
8161
|
+
n,
|
|
8162
|
+
v
|
|
8163
|
+
]);
|
|
8164
|
+
};
|
|
8165
|
+
}
|
|
8166
|
+
function step(op) {
|
|
8167
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
8168
|
+
while(g && (g = 0, op[0] && (_ = 0)), _)try {
|
|
8169
|
+
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;
|
|
8170
|
+
if (y = 0, t) op = [
|
|
8171
|
+
op[0] & 2,
|
|
8172
|
+
t.value
|
|
8173
|
+
];
|
|
8174
|
+
switch(op[0]){
|
|
8175
|
+
case 0:
|
|
8176
|
+
case 1:
|
|
8177
|
+
t = op;
|
|
8178
|
+
break;
|
|
8179
|
+
case 4:
|
|
8180
|
+
_.label++;
|
|
8181
|
+
return {
|
|
8182
|
+
value: op[1],
|
|
8183
|
+
done: false
|
|
8184
|
+
};
|
|
8185
|
+
case 5:
|
|
8186
|
+
_.label++;
|
|
8187
|
+
y = op[1];
|
|
8188
|
+
op = [
|
|
8189
|
+
0
|
|
8190
|
+
];
|
|
8191
|
+
continue;
|
|
8192
|
+
case 7:
|
|
8193
|
+
op = _.ops.pop();
|
|
8194
|
+
_.trys.pop();
|
|
8195
|
+
continue;
|
|
8196
|
+
default:
|
|
8197
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
8198
|
+
_ = 0;
|
|
8199
|
+
continue;
|
|
8200
|
+
}
|
|
8201
|
+
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
8202
|
+
_.label = op[1];
|
|
8203
|
+
break;
|
|
8204
|
+
}
|
|
8205
|
+
if (op[0] === 6 && _.label < t[1]) {
|
|
8206
|
+
_.label = t[1];
|
|
8207
|
+
t = op;
|
|
8208
|
+
break;
|
|
8209
|
+
}
|
|
8210
|
+
if (t && _.label < t[2]) {
|
|
8211
|
+
_.label = t[2];
|
|
8212
|
+
_.ops.push(op);
|
|
8213
|
+
break;
|
|
8214
|
+
}
|
|
8215
|
+
if (t[2]) _.ops.pop();
|
|
8216
|
+
_.trys.pop();
|
|
8217
|
+
continue;
|
|
8218
|
+
}
|
|
8219
|
+
op = body.call(thisArg, _);
|
|
8220
|
+
} catch (e) {
|
|
8221
|
+
op = [
|
|
8222
|
+
6,
|
|
8223
|
+
e
|
|
8224
|
+
];
|
|
8225
|
+
y = 0;
|
|
8226
|
+
} finally{
|
|
8227
|
+
f = t = 0;
|
|
8228
|
+
}
|
|
8229
|
+
if (op[0] & 5) throw op[1];
|
|
8230
|
+
return {
|
|
8231
|
+
value: op[0] ? op[1] : void 0,
|
|
8232
|
+
done: true
|
|
8233
|
+
};
|
|
8234
|
+
}
|
|
8235
|
+
}
|
|
8236
|
+
var DEFAULT_COMPRESS_IMAGE_MAX_DIMENSION = 4096;
|
|
8237
|
+
var DEFAULT_COMPRESS_IMAGE_INITIAL_QUALITY = 85;
|
|
8238
|
+
var DEFAULT_COMPRESS_IMAGE_MIN_QUALITY = 50;
|
|
8239
|
+
var DEFAULT_COMPRESS_IMAGE_QUALITY_STEP = 10;
|
|
8240
|
+
var DEFAULT_COMPRESS_IMAGE_FORMAT = 'jpeg';
|
|
8241
|
+
/**
|
|
8242
|
+
* Compresses an image buffer toward a target byte size by resizing down to a max
|
|
8243
|
+
* dimension and iteratively lowering the encoder quality. Returns the best result
|
|
8244
|
+
* found; falls back to the original buffer if no encoding beat it.
|
|
8245
|
+
*
|
|
8246
|
+
* Throws on unreadable input — callers should catch errors and decide whether to
|
|
8247
|
+
* fall back to the original bytes.
|
|
8248
|
+
*
|
|
8249
|
+
* @param input - The image bytes to compress.
|
|
8250
|
+
* @param config - Target size and encoder parameters.
|
|
8251
|
+
* @returns The best-effort compressed result plus metadata about what was applied.
|
|
8252
|
+
*
|
|
8253
|
+
* @example
|
|
8254
|
+
* ```ts
|
|
8255
|
+
* const result = await compressImageBufferToTargetSize(buffer, {
|
|
8256
|
+
* targetSizeBytes: 2 * 1024 * 1024,
|
|
8257
|
+
* maxDimension: 2048
|
|
8258
|
+
* });
|
|
8259
|
+
* if (result.hitTarget) {
|
|
8260
|
+
* await file.upload(result.buffer);
|
|
8261
|
+
* }
|
|
8262
|
+
* ```
|
|
8263
|
+
*/ function compressImageBufferToTargetSize(input, config) {
|
|
8264
|
+
return _async_to_generator$6(function() {
|
|
8265
|
+
var _config_maxDimension, _config_initialQuality, _config_minQuality, _config_qualityStep, _config_format, _metadata_width, _metadata_height, targetSizeBytes, maxDimension, initialQuality, minQuality, qualityStep, format, metadata, originalWidth, originalHeight, originalSizeBytes, longestSide, resizeNeeded, scale, workingWidth, workingHeight, bestBuffer, bestSize, bestQuality, bestWidth, bestHeight, hitTarget, qualities, _iteratorNormalCompletion, _didIteratorError, _iteratorError, _iterator, _step, quality, encoded, err, result;
|
|
8266
|
+
return _ts_generator$6(this, function(_state) {
|
|
8267
|
+
switch(_state.label){
|
|
8268
|
+
case 0:
|
|
8269
|
+
targetSizeBytes = config.targetSizeBytes;
|
|
8270
|
+
maxDimension = (_config_maxDimension = config.maxDimension) !== null && _config_maxDimension !== void 0 ? _config_maxDimension : DEFAULT_COMPRESS_IMAGE_MAX_DIMENSION;
|
|
8271
|
+
initialQuality = (_config_initialQuality = config.initialQuality) !== null && _config_initialQuality !== void 0 ? _config_initialQuality : DEFAULT_COMPRESS_IMAGE_INITIAL_QUALITY;
|
|
8272
|
+
minQuality = (_config_minQuality = config.minQuality) !== null && _config_minQuality !== void 0 ? _config_minQuality : DEFAULT_COMPRESS_IMAGE_MIN_QUALITY;
|
|
8273
|
+
qualityStep = (_config_qualityStep = config.qualityStep) !== null && _config_qualityStep !== void 0 ? _config_qualityStep : DEFAULT_COMPRESS_IMAGE_QUALITY_STEP;
|
|
8274
|
+
format = (_config_format = config.format) !== null && _config_format !== void 0 ? _config_format : DEFAULT_COMPRESS_IMAGE_FORMAT;
|
|
8275
|
+
return [
|
|
8276
|
+
4,
|
|
8277
|
+
sharp(input).metadata()
|
|
8278
|
+
];
|
|
8279
|
+
case 1:
|
|
8280
|
+
metadata = _state.sent();
|
|
8281
|
+
originalWidth = (_metadata_width = metadata.width) !== null && _metadata_width !== void 0 ? _metadata_width : 0;
|
|
8282
|
+
originalHeight = (_metadata_height = metadata.height) !== null && _metadata_height !== void 0 ? _metadata_height : 0;
|
|
8283
|
+
originalSizeBytes = input.byteLength;
|
|
8284
|
+
longestSide = Math.max(originalWidth, originalHeight);
|
|
8285
|
+
resizeNeeded = longestSide > maxDimension && longestSide > 0;
|
|
8286
|
+
scale = resizeNeeded ? maxDimension / longestSide : 1;
|
|
8287
|
+
workingWidth = Math.max(1, Math.round(originalWidth * scale));
|
|
8288
|
+
workingHeight = Math.max(1, Math.round(originalHeight * scale));
|
|
8289
|
+
bestBuffer = input;
|
|
8290
|
+
bestSize = originalSizeBytes;
|
|
8291
|
+
bestQuality = 100;
|
|
8292
|
+
bestWidth = originalWidth;
|
|
8293
|
+
bestHeight = originalHeight;
|
|
8294
|
+
hitTarget = bestSize <= targetSizeBytes && !resizeNeeded;
|
|
8295
|
+
if (!!hitTarget) return [
|
|
8296
|
+
3,
|
|
8297
|
+
9
|
|
8298
|
+
];
|
|
8299
|
+
qualities = qualityIterationSteps({
|
|
8300
|
+
format: format,
|
|
8301
|
+
initialQuality: initialQuality,
|
|
8302
|
+
minQuality: minQuality,
|
|
8303
|
+
qualityStep: qualityStep
|
|
8304
|
+
});
|
|
8305
|
+
_iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
8306
|
+
_state.label = 2;
|
|
8307
|
+
case 2:
|
|
8308
|
+
_state.trys.push([
|
|
8309
|
+
2,
|
|
8310
|
+
7,
|
|
8311
|
+
8,
|
|
8312
|
+
9
|
|
8313
|
+
]);
|
|
8314
|
+
_iterator = qualities[Symbol.iterator]();
|
|
8315
|
+
_state.label = 3;
|
|
8316
|
+
case 3:
|
|
8317
|
+
if (!!(_iteratorNormalCompletion = (_step = _iterator.next()).done)) return [
|
|
8318
|
+
3,
|
|
8319
|
+
6
|
|
8320
|
+
];
|
|
8321
|
+
quality = _step.value;
|
|
8322
|
+
return [
|
|
8323
|
+
4,
|
|
8324
|
+
encodeImage({
|
|
8325
|
+
input: input,
|
|
8326
|
+
format: format,
|
|
8327
|
+
quality: quality,
|
|
8328
|
+
resizeNeeded: resizeNeeded,
|
|
8329
|
+
workingWidth: workingWidth,
|
|
8330
|
+
workingHeight: workingHeight
|
|
8331
|
+
})
|
|
8332
|
+
];
|
|
8333
|
+
case 4:
|
|
8334
|
+
encoded = _state.sent();
|
|
8335
|
+
if (encoded.byteLength < bestSize) {
|
|
8336
|
+
bestBuffer = encoded;
|
|
8337
|
+
bestSize = encoded.byteLength;
|
|
8338
|
+
bestQuality = quality;
|
|
8339
|
+
bestWidth = workingWidth;
|
|
8340
|
+
bestHeight = workingHeight;
|
|
8341
|
+
}
|
|
8342
|
+
if (bestSize <= targetSizeBytes) {
|
|
8343
|
+
hitTarget = true;
|
|
8344
|
+
return [
|
|
8345
|
+
3,
|
|
8346
|
+
6
|
|
8347
|
+
];
|
|
8348
|
+
}
|
|
8349
|
+
_state.label = 5;
|
|
8350
|
+
case 5:
|
|
8351
|
+
_iteratorNormalCompletion = true;
|
|
8352
|
+
return [
|
|
8353
|
+
3,
|
|
8354
|
+
3
|
|
8355
|
+
];
|
|
8356
|
+
case 6:
|
|
8357
|
+
return [
|
|
8358
|
+
3,
|
|
8359
|
+
9
|
|
8360
|
+
];
|
|
8361
|
+
case 7:
|
|
8362
|
+
err = _state.sent();
|
|
8363
|
+
_didIteratorError = true;
|
|
8364
|
+
_iteratorError = err;
|
|
8365
|
+
return [
|
|
8366
|
+
3,
|
|
8367
|
+
9
|
|
8368
|
+
];
|
|
8369
|
+
case 8:
|
|
8370
|
+
try {
|
|
8371
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
8372
|
+
_iterator.return();
|
|
8373
|
+
}
|
|
8374
|
+
} finally{
|
|
8375
|
+
if (_didIteratorError) {
|
|
8376
|
+
throw _iteratorError;
|
|
8377
|
+
}
|
|
8378
|
+
}
|
|
8379
|
+
return [
|
|
8380
|
+
7
|
|
8381
|
+
];
|
|
8382
|
+
case 9:
|
|
8383
|
+
result = {
|
|
8384
|
+
buffer: bestBuffer,
|
|
8385
|
+
originalSizeBytes: originalSizeBytes,
|
|
8386
|
+
compressedSizeBytes: bestSize,
|
|
8387
|
+
finalQuality: bestQuality,
|
|
8388
|
+
finalWidth: bestWidth,
|
|
8389
|
+
finalHeight: bestHeight,
|
|
8390
|
+
hitTarget: hitTarget
|
|
8391
|
+
};
|
|
8392
|
+
return [
|
|
8393
|
+
2,
|
|
8394
|
+
result
|
|
8395
|
+
];
|
|
8396
|
+
}
|
|
8397
|
+
});
|
|
8398
|
+
})();
|
|
8399
|
+
}
|
|
8400
|
+
function qualityIterationSteps(input) {
|
|
8401
|
+
var format = input.format, initialQuality = input.initialQuality, minQuality = input.minQuality, qualityStep = input.qualityStep;
|
|
8402
|
+
var steps = [];
|
|
8403
|
+
// PNG has no quality knob; a single pass at 0 (sentinel) applies any requested resize.
|
|
8404
|
+
if (format === 'png') {
|
|
8405
|
+
steps.push(0);
|
|
8406
|
+
} else {
|
|
8407
|
+
for(var quality = initialQuality; quality >= minQuality; quality -= qualityStep){
|
|
8408
|
+
steps.push(quality);
|
|
8409
|
+
}
|
|
8410
|
+
}
|
|
8411
|
+
return steps;
|
|
8412
|
+
}
|
|
8413
|
+
function encodeImage(input) {
|
|
8414
|
+
return _async_to_generator$6(function() {
|
|
8415
|
+
var pipeline, result, _;
|
|
8416
|
+
return _ts_generator$6(this, function(_state) {
|
|
8417
|
+
switch(_state.label){
|
|
8418
|
+
case 0:
|
|
8419
|
+
pipeline = sharp(input.input);
|
|
8420
|
+
if (input.resizeNeeded) {
|
|
8421
|
+
pipeline.resize({
|
|
8422
|
+
width: input.workingWidth,
|
|
8423
|
+
height: input.workingHeight,
|
|
8424
|
+
fit: 'inside',
|
|
8425
|
+
withoutEnlargement: true
|
|
8426
|
+
});
|
|
8427
|
+
}
|
|
8428
|
+
_ = input.format;
|
|
8429
|
+
switch(_){
|
|
8430
|
+
case 'jpeg':
|
|
8431
|
+
return [
|
|
8432
|
+
3,
|
|
8433
|
+
1
|
|
8434
|
+
];
|
|
8435
|
+
case 'webp':
|
|
8436
|
+
return [
|
|
8437
|
+
3,
|
|
8438
|
+
3
|
|
8439
|
+
];
|
|
8440
|
+
case 'png':
|
|
8441
|
+
return [
|
|
8442
|
+
3,
|
|
8443
|
+
5
|
|
8444
|
+
];
|
|
8445
|
+
}
|
|
8446
|
+
return [
|
|
8447
|
+
3,
|
|
8448
|
+
7
|
|
8449
|
+
];
|
|
8450
|
+
case 1:
|
|
8451
|
+
return [
|
|
8452
|
+
4,
|
|
8453
|
+
pipeline.jpeg({
|
|
8454
|
+
quality: input.quality,
|
|
8455
|
+
mozjpeg: true
|
|
8456
|
+
}).toBuffer()
|
|
8457
|
+
];
|
|
8458
|
+
case 2:
|
|
8459
|
+
result = _state.sent();
|
|
8460
|
+
return [
|
|
8461
|
+
3,
|
|
8462
|
+
7
|
|
8463
|
+
];
|
|
8464
|
+
case 3:
|
|
8465
|
+
return [
|
|
8466
|
+
4,
|
|
8467
|
+
pipeline.webp({
|
|
8468
|
+
quality: input.quality
|
|
8469
|
+
}).toBuffer()
|
|
8470
|
+
];
|
|
8471
|
+
case 4:
|
|
8472
|
+
result = _state.sent();
|
|
8473
|
+
return [
|
|
8474
|
+
3,
|
|
8475
|
+
7
|
|
8476
|
+
];
|
|
8477
|
+
case 5:
|
|
8478
|
+
return [
|
|
8479
|
+
4,
|
|
8480
|
+
pipeline.png({
|
|
8481
|
+
compressionLevel: 9
|
|
8482
|
+
}).toBuffer()
|
|
8483
|
+
];
|
|
8484
|
+
case 6:
|
|
8485
|
+
result = _state.sent();
|
|
8486
|
+
return [
|
|
8487
|
+
3,
|
|
8488
|
+
7
|
|
8489
|
+
];
|
|
8490
|
+
case 7:
|
|
8491
|
+
return [
|
|
8492
|
+
2,
|
|
8493
|
+
result
|
|
8494
|
+
];
|
|
8495
|
+
}
|
|
8496
|
+
});
|
|
8497
|
+
})();
|
|
8498
|
+
}
|
|
8499
|
+
|
|
8500
|
+
function _array_like_to_array$3(arr, len) {
|
|
8501
|
+
if (len == null || len > arr.length) len = arr.length;
|
|
8502
|
+
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
8503
|
+
return arr2;
|
|
8504
|
+
}
|
|
8505
|
+
function _array_with_holes$1(arr) {
|
|
8506
|
+
if (Array.isArray(arr)) return arr;
|
|
8507
|
+
}
|
|
8508
|
+
function asyncGeneratorStep$5(gen, resolve, reject, _next, _throw, key, arg) {
|
|
8509
|
+
try {
|
|
8510
|
+
var info = gen[key](arg);
|
|
8511
|
+
var value = info.value;
|
|
8512
|
+
} catch (error) {
|
|
8513
|
+
reject(error);
|
|
8514
|
+
return;
|
|
8515
|
+
}
|
|
8516
|
+
if (info.done) {
|
|
8517
|
+
resolve(value);
|
|
8518
|
+
} else {
|
|
8519
|
+
Promise.resolve(value).then(_next, _throw);
|
|
8520
|
+
}
|
|
8521
|
+
}
|
|
8522
|
+
function _async_to_generator$5(fn) {
|
|
8523
|
+
return function() {
|
|
8524
|
+
var self = this, args = arguments;
|
|
8525
|
+
return new Promise(function(resolve, reject) {
|
|
8526
|
+
var gen = fn.apply(self, args);
|
|
8527
|
+
function _next(value) {
|
|
8528
|
+
asyncGeneratorStep$5(gen, resolve, reject, _next, _throw, "next", value);
|
|
8529
|
+
}
|
|
8530
|
+
function _throw(err) {
|
|
8531
|
+
asyncGeneratorStep$5(gen, resolve, reject, _next, _throw, "throw", err);
|
|
8532
|
+
}
|
|
8533
|
+
_next(undefined);
|
|
8534
|
+
});
|
|
8535
|
+
};
|
|
8536
|
+
}
|
|
8537
|
+
function _instanceof$1(left, right) {
|
|
8538
|
+
"@swc/helpers - instanceof";
|
|
8539
|
+
if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
|
|
8540
|
+
return !!right[Symbol.hasInstance](left);
|
|
8541
|
+
} else {
|
|
8542
|
+
return left instanceof right;
|
|
8543
|
+
}
|
|
8544
|
+
}
|
|
8545
|
+
function _iterable_to_array_limit$1(arr, i) {
|
|
8546
|
+
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
8547
|
+
if (_i == null) return;
|
|
8548
|
+
var _arr = [];
|
|
8549
|
+
var _n = true;
|
|
8550
|
+
var _d = false;
|
|
8551
|
+
var _s, _e;
|
|
8552
|
+
try {
|
|
8553
|
+
for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){
|
|
8554
|
+
_arr.push(_s.value);
|
|
8555
|
+
if (i && _arr.length === i) break;
|
|
8556
|
+
}
|
|
8557
|
+
} catch (err) {
|
|
8558
|
+
_d = true;
|
|
8559
|
+
_e = err;
|
|
8560
|
+
} finally{
|
|
8561
|
+
try {
|
|
8562
|
+
if (!_n && _i["return"] != null) _i["return"]();
|
|
8563
|
+
} finally{
|
|
8564
|
+
if (_d) throw _e;
|
|
8565
|
+
}
|
|
8566
|
+
}
|
|
8567
|
+
return _arr;
|
|
8568
|
+
}
|
|
8569
|
+
function _non_iterable_rest$1() {
|
|
8570
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
8571
|
+
}
|
|
8572
|
+
function _sliced_to_array$1(arr, i) {
|
|
8573
|
+
return _array_with_holes$1(arr) || _iterable_to_array_limit$1(arr, i) || _unsupported_iterable_to_array$3(arr, i) || _non_iterable_rest$1();
|
|
8574
|
+
}
|
|
8575
|
+
function _unsupported_iterable_to_array$3(o, minLen) {
|
|
8576
|
+
if (!o) return;
|
|
8577
|
+
if (typeof o === "string") return _array_like_to_array$3(o, minLen);
|
|
8578
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
8579
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
8580
|
+
if (n === "Map" || n === "Set") return Array.from(n);
|
|
8581
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$3(o, minLen);
|
|
8582
|
+
}
|
|
8583
|
+
function _ts_generator$5(thisArg, body) {
|
|
8584
|
+
var f, y, t, _ = {
|
|
8585
|
+
label: 0,
|
|
8586
|
+
sent: function() {
|
|
8587
|
+
if (t[0] & 1) throw t[1];
|
|
8588
|
+
return t[1];
|
|
8589
|
+
},
|
|
8590
|
+
trys: [],
|
|
8591
|
+
ops: []
|
|
8592
|
+
}, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype), d = Object.defineProperty;
|
|
8593
|
+
return d(g, "next", {
|
|
8594
|
+
value: verb(0)
|
|
8595
|
+
}), d(g, "throw", {
|
|
8596
|
+
value: verb(1)
|
|
8597
|
+
}), d(g, "return", {
|
|
8598
|
+
value: verb(2)
|
|
8599
|
+
}), typeof Symbol === "function" && d(g, Symbol.iterator, {
|
|
8600
|
+
value: function() {
|
|
8601
|
+
return this;
|
|
8602
|
+
}
|
|
8603
|
+
}), g;
|
|
8604
|
+
function verb(n) {
|
|
8605
|
+
return function(v) {
|
|
8606
|
+
return step([
|
|
8607
|
+
n,
|
|
8608
|
+
v
|
|
8609
|
+
]);
|
|
8610
|
+
};
|
|
8611
|
+
}
|
|
8612
|
+
function step(op) {
|
|
8613
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
8614
|
+
while(g && (g = 0, op[0] && (_ = 0)), _)try {
|
|
8615
|
+
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;
|
|
8616
|
+
if (y = 0, t) op = [
|
|
8617
|
+
op[0] & 2,
|
|
8618
|
+
t.value
|
|
8619
|
+
];
|
|
8620
|
+
switch(op[0]){
|
|
8621
|
+
case 0:
|
|
8622
|
+
case 1:
|
|
8623
|
+
t = op;
|
|
8624
|
+
break;
|
|
8625
|
+
case 4:
|
|
8626
|
+
_.label++;
|
|
8627
|
+
return {
|
|
8628
|
+
value: op[1],
|
|
8629
|
+
done: false
|
|
8630
|
+
};
|
|
8631
|
+
case 5:
|
|
8632
|
+
_.label++;
|
|
8633
|
+
y = op[1];
|
|
8634
|
+
op = [
|
|
8635
|
+
0
|
|
8636
|
+
];
|
|
8637
|
+
continue;
|
|
8638
|
+
case 7:
|
|
8639
|
+
op = _.ops.pop();
|
|
8640
|
+
_.trys.pop();
|
|
8641
|
+
continue;
|
|
8642
|
+
default:
|
|
8643
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
8644
|
+
_ = 0;
|
|
8645
|
+
continue;
|
|
8646
|
+
}
|
|
8647
|
+
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
8648
|
+
_.label = op[1];
|
|
8649
|
+
break;
|
|
8650
|
+
}
|
|
8651
|
+
if (op[0] === 6 && _.label < t[1]) {
|
|
8652
|
+
_.label = t[1];
|
|
8653
|
+
t = op;
|
|
8654
|
+
break;
|
|
8655
|
+
}
|
|
8656
|
+
if (t && _.label < t[2]) {
|
|
8657
|
+
_.label = t[2];
|
|
8658
|
+
_.ops.push(op);
|
|
8659
|
+
break;
|
|
8660
|
+
}
|
|
8661
|
+
if (t[2]) _.ops.pop();
|
|
8662
|
+
_.trys.pop();
|
|
8663
|
+
continue;
|
|
8664
|
+
}
|
|
8665
|
+
op = body.call(thisArg, _);
|
|
8666
|
+
} catch (e) {
|
|
8667
|
+
op = [
|
|
8668
|
+
6,
|
|
8669
|
+
e
|
|
8670
|
+
];
|
|
8671
|
+
y = 0;
|
|
8672
|
+
} finally{
|
|
8673
|
+
f = t = 0;
|
|
8674
|
+
}
|
|
8675
|
+
if (op[0] & 5) throw op[1];
|
|
8676
|
+
return {
|
|
8677
|
+
value: op[0] ? op[1] : void 0,
|
|
8678
|
+
done: true
|
|
8679
|
+
};
|
|
8680
|
+
}
|
|
8681
|
+
}
|
|
8682
|
+
var DEFAULT_COMPRESS_PDF_IMAGE_MAX_DIMENSION = 2048;
|
|
8683
|
+
var DEFAULT_COMPRESS_PDF_IMAGE_QUALITY = 75;
|
|
8684
|
+
var DEFAULT_COMPRESS_PDF_IMAGE_SIZE_THRESHOLD_BYTES = 100 * 1024;
|
|
8685
|
+
/**
|
|
8686
|
+
* Recompresses image XObjects embedded in a PDF to shrink its overall size.
|
|
8687
|
+
*
|
|
8688
|
+
* Only DCTDecode (JPEG) image streams are touched in this implementation — the
|
|
8689
|
+
* dominant case for "phone photo PDFs". Images using other filters (FlateDecode,
|
|
8690
|
+
* CCITTFax, JBIG2, JPEG2000), indexed/CMYK color spaces, or that carry a
|
|
8691
|
+
* `/SMask` (soft mask) are skipped and counted in `imagesSkipped`.
|
|
8692
|
+
*
|
|
8693
|
+
* Throws on a malformed PDF — callers should catch and fall back to the original
|
|
8694
|
+
* bytes.
|
|
8695
|
+
*
|
|
8696
|
+
* @param input - The PDF bytes to compress.
|
|
8697
|
+
* @param config - Target size and image recompression parameters.
|
|
8698
|
+
* @returns The best-effort compressed PDF plus per-image counters.
|
|
8699
|
+
*
|
|
8700
|
+
* @example
|
|
8701
|
+
* ```ts
|
|
8702
|
+
* const result = await compressPdfImagesToTargetSize(buffer, {
|
|
8703
|
+
* targetSizeBytes: 6 * 1024 * 1024
|
|
8704
|
+
* });
|
|
8705
|
+
* const finalBytes = result.hitTarget ? result.buffer : buffer;
|
|
8706
|
+
* ```
|
|
8707
|
+
*/ function compressPdfImagesToTargetSize(input, config) {
|
|
8708
|
+
return _async_to_generator$5(function() {
|
|
8709
|
+
var _config_imageMaxDimension, _config_imageQuality, _config_imageSizeThresholdBytes, targetSizeBytes, imageMaxDimension, imageQuality, imageSizeThresholdBytes, originalSizeBytes, pdfDoc, indirectObjects, imagesCompressed, imagesSkipped, _iteratorNormalCompletion, _didIteratorError, _iteratorError, _iterator, _step, _step_value, ref, obj, candidate, compressedImage, err, outputBuffer, compressedSizeBytes, savedBytes, savedBuffer, result;
|
|
8710
|
+
return _ts_generator$5(this, function(_state) {
|
|
8711
|
+
switch(_state.label){
|
|
8712
|
+
case 0:
|
|
8713
|
+
targetSizeBytes = config.targetSizeBytes;
|
|
8714
|
+
imageMaxDimension = (_config_imageMaxDimension = config.imageMaxDimension) !== null && _config_imageMaxDimension !== void 0 ? _config_imageMaxDimension : DEFAULT_COMPRESS_PDF_IMAGE_MAX_DIMENSION;
|
|
8715
|
+
imageQuality = (_config_imageQuality = config.imageQuality) !== null && _config_imageQuality !== void 0 ? _config_imageQuality : DEFAULT_COMPRESS_PDF_IMAGE_QUALITY;
|
|
8716
|
+
imageSizeThresholdBytes = (_config_imageSizeThresholdBytes = config.imageSizeThresholdBytes) !== null && _config_imageSizeThresholdBytes !== void 0 ? _config_imageSizeThresholdBytes : DEFAULT_COMPRESS_PDF_IMAGE_SIZE_THRESHOLD_BYTES;
|
|
8717
|
+
originalSizeBytes = input.byteLength;
|
|
8718
|
+
return [
|
|
8719
|
+
4,
|
|
8720
|
+
PDFDocument.load(input, {
|
|
8721
|
+
ignoreEncryption: true,
|
|
8722
|
+
updateMetadata: false
|
|
8723
|
+
})
|
|
8724
|
+
];
|
|
8725
|
+
case 1:
|
|
8726
|
+
pdfDoc = _state.sent();
|
|
8727
|
+
indirectObjects = pdfDoc.context.enumerateIndirectObjects();
|
|
8728
|
+
imagesCompressed = 0;
|
|
8729
|
+
imagesSkipped = 0;
|
|
8730
|
+
_iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
8731
|
+
_state.label = 2;
|
|
8732
|
+
case 2:
|
|
8733
|
+
_state.trys.push([
|
|
8734
|
+
2,
|
|
8735
|
+
9,
|
|
8736
|
+
10,
|
|
8737
|
+
11
|
|
8738
|
+
]);
|
|
8739
|
+
_iterator = indirectObjects[Symbol.iterator]();
|
|
8740
|
+
_state.label = 3;
|
|
8741
|
+
case 3:
|
|
8742
|
+
if (!!(_iteratorNormalCompletion = (_step = _iterator.next()).done)) return [
|
|
8743
|
+
3,
|
|
8744
|
+
8
|
|
8745
|
+
];
|
|
8746
|
+
_step_value = _sliced_to_array$1(_step.value, 2), ref = _step_value[0], obj = _step_value[1];
|
|
8747
|
+
if (!_instanceof$1(obj, PDFRawStream)) {
|
|
8748
|
+
return [
|
|
8749
|
+
3,
|
|
8750
|
+
7
|
|
8751
|
+
];
|
|
8752
|
+
}
|
|
8753
|
+
candidate = isCompressibleImageStream(obj);
|
|
8754
|
+
if (!candidate) {
|
|
8755
|
+
return [
|
|
8756
|
+
3,
|
|
8757
|
+
7
|
|
8758
|
+
];
|
|
8759
|
+
}
|
|
8760
|
+
if (obj.contents.byteLength < imageSizeThresholdBytes) {
|
|
8761
|
+
// tiny image — not worth recompressing
|
|
8762
|
+
return [
|
|
8763
|
+
3,
|
|
8764
|
+
7
|
|
8765
|
+
];
|
|
8766
|
+
}
|
|
8767
|
+
_state.label = 4;
|
|
8768
|
+
case 4:
|
|
8769
|
+
_state.trys.push([
|
|
8770
|
+
4,
|
|
8771
|
+
6,
|
|
8772
|
+
,
|
|
8773
|
+
7
|
|
8774
|
+
]);
|
|
8775
|
+
return [
|
|
8776
|
+
4,
|
|
8777
|
+
compressImageBufferToTargetSize(Buffer.from(obj.contents), {
|
|
8778
|
+
targetSizeBytes: obj.contents.byteLength,
|
|
8779
|
+
maxDimension: imageMaxDimension,
|
|
8780
|
+
initialQuality: imageQuality,
|
|
8781
|
+
format: 'jpeg'
|
|
8782
|
+
})
|
|
8783
|
+
];
|
|
8784
|
+
case 5:
|
|
8785
|
+
compressedImage = _state.sent();
|
|
8786
|
+
if (compressedImage.compressedSizeBytes >= obj.contents.byteLength) {
|
|
8787
|
+
// no gain — leave it alone
|
|
8788
|
+
return [
|
|
8789
|
+
3,
|
|
8790
|
+
7
|
|
8791
|
+
];
|
|
8792
|
+
}
|
|
8793
|
+
replaceImageStream({
|
|
8794
|
+
pdfDoc: pdfDoc,
|
|
8795
|
+
ref: ref,
|
|
8796
|
+
newImageBytes: compressedImage.buffer,
|
|
8797
|
+
newWidth: compressedImage.finalWidth,
|
|
8798
|
+
newHeight: compressedImage.finalHeight
|
|
8799
|
+
});
|
|
8800
|
+
imagesCompressed += 1;
|
|
8801
|
+
return [
|
|
8802
|
+
3,
|
|
8803
|
+
7
|
|
8804
|
+
];
|
|
8805
|
+
case 6:
|
|
8806
|
+
_state.sent();
|
|
8807
|
+
imagesSkipped += 1;
|
|
8808
|
+
return [
|
|
8809
|
+
3,
|
|
8810
|
+
7
|
|
8811
|
+
];
|
|
8812
|
+
case 7:
|
|
8813
|
+
_iteratorNormalCompletion = true;
|
|
8814
|
+
return [
|
|
8815
|
+
3,
|
|
8816
|
+
3
|
|
8817
|
+
];
|
|
8818
|
+
case 8:
|
|
8819
|
+
return [
|
|
8820
|
+
3,
|
|
8821
|
+
11
|
|
8822
|
+
];
|
|
8823
|
+
case 9:
|
|
8824
|
+
err = _state.sent();
|
|
8825
|
+
_didIteratorError = true;
|
|
8826
|
+
_iteratorError = err;
|
|
8827
|
+
return [
|
|
8828
|
+
3,
|
|
8829
|
+
11
|
|
8830
|
+
];
|
|
8831
|
+
case 10:
|
|
8832
|
+
try {
|
|
8833
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
8834
|
+
_iterator.return();
|
|
8835
|
+
}
|
|
8836
|
+
} finally{
|
|
8837
|
+
if (_didIteratorError) {
|
|
8838
|
+
throw _iteratorError;
|
|
8839
|
+
}
|
|
8840
|
+
}
|
|
8841
|
+
return [
|
|
8842
|
+
7
|
|
8843
|
+
];
|
|
8844
|
+
case 11:
|
|
8845
|
+
outputBuffer = input;
|
|
8846
|
+
compressedSizeBytes = originalSizeBytes;
|
|
8847
|
+
if (!(imagesCompressed > 0)) return [
|
|
8848
|
+
3,
|
|
8849
|
+
13
|
|
8850
|
+
];
|
|
8851
|
+
return [
|
|
8852
|
+
4,
|
|
8853
|
+
pdfDoc.save({
|
|
8854
|
+
useObjectStreams: true
|
|
8855
|
+
})
|
|
8856
|
+
];
|
|
8857
|
+
case 12:
|
|
8858
|
+
savedBytes = _state.sent();
|
|
8859
|
+
savedBuffer = Buffer.from(savedBytes);
|
|
8860
|
+
if (savedBuffer.byteLength < originalSizeBytes) {
|
|
8861
|
+
outputBuffer = savedBuffer;
|
|
8862
|
+
compressedSizeBytes = savedBuffer.byteLength;
|
|
8863
|
+
}
|
|
8864
|
+
_state.label = 13;
|
|
8865
|
+
case 13:
|
|
8866
|
+
result = {
|
|
8867
|
+
buffer: outputBuffer,
|
|
8868
|
+
originalSizeBytes: originalSizeBytes,
|
|
8869
|
+
compressedSizeBytes: compressedSizeBytes,
|
|
8870
|
+
imagesCompressed: imagesCompressed,
|
|
8871
|
+
imagesSkipped: imagesSkipped,
|
|
8872
|
+
hitTarget: compressedSizeBytes <= targetSizeBytes
|
|
8873
|
+
};
|
|
8874
|
+
return [
|
|
8875
|
+
2,
|
|
8876
|
+
result
|
|
8877
|
+
];
|
|
8878
|
+
}
|
|
8879
|
+
});
|
|
8880
|
+
})();
|
|
8881
|
+
}
|
|
8882
|
+
var PDF_NAME_TYPE = PDFName.of('Type');
|
|
8883
|
+
var PDF_NAME_XOBJECT = PDFName.of('XObject');
|
|
8884
|
+
var PDF_NAME_SUBTYPE = PDFName.of('Subtype');
|
|
8885
|
+
var PDF_NAME_IMAGE = PDFName.of('Image');
|
|
8886
|
+
var PDF_NAME_FILTER = PDFName.of('Filter');
|
|
8887
|
+
var PDF_NAME_DCTDECODE = PDFName.of('DCTDecode');
|
|
8888
|
+
var PDF_NAME_SMASK = PDFName.of('SMask');
|
|
8889
|
+
var PDF_NAME_MASK = PDFName.of('Mask');
|
|
8890
|
+
function isCompressibleImageStream(stream) {
|
|
8891
|
+
var dict = stream.dict;
|
|
8892
|
+
// Must be Type /XObject (when present) and Subtype /Image
|
|
8893
|
+
var type = dict.get(PDF_NAME_TYPE);
|
|
8894
|
+
if (type !== undefined && !pdfNameEquals(type, PDF_NAME_XOBJECT)) {
|
|
8895
|
+
return false;
|
|
8896
|
+
}
|
|
8897
|
+
var subtype = dict.get(PDF_NAME_SUBTYPE);
|
|
8898
|
+
if (subtype === undefined || !pdfNameEquals(subtype, PDF_NAME_IMAGE)) {
|
|
8899
|
+
return false;
|
|
8900
|
+
}
|
|
8901
|
+
// Skip images with masks; replacing them risks breaking the mask alignment.
|
|
8902
|
+
if (dict.get(PDF_NAME_SMASK) !== undefined || dict.get(PDF_NAME_MASK) !== undefined) {
|
|
8903
|
+
return false;
|
|
8904
|
+
}
|
|
8905
|
+
// Only DCTDecode (JPEG) streams in v1.
|
|
8906
|
+
var filter = dict.get(PDF_NAME_FILTER);
|
|
8907
|
+
var isDct = false;
|
|
8908
|
+
if (filter !== undefined) {
|
|
8909
|
+
if (_instanceof$1(filter, PDFArray)) {
|
|
8910
|
+
isDct = filter.size() === 1 && pdfNameEquals(filter.get(0), PDF_NAME_DCTDECODE);
|
|
8911
|
+
} else {
|
|
8912
|
+
isDct = pdfNameEquals(filter, PDF_NAME_DCTDECODE);
|
|
8913
|
+
}
|
|
8914
|
+
}
|
|
8915
|
+
return isDct;
|
|
8916
|
+
}
|
|
8917
|
+
function pdfNameEquals(candidate, name) {
|
|
8918
|
+
return _instanceof$1(candidate, PDFName) && candidate.asString() === name.asString();
|
|
8919
|
+
}
|
|
8920
|
+
function replaceImageStream(input) {
|
|
8921
|
+
var pdfDoc = input.pdfDoc, ref = input.ref, newImageBytes = input.newImageBytes, newWidth = input.newWidth, newHeight = input.newHeight;
|
|
8922
|
+
var context = pdfDoc.context;
|
|
8923
|
+
var newDict = context.obj({
|
|
8924
|
+
Type: 'XObject',
|
|
8925
|
+
Subtype: 'Image',
|
|
8926
|
+
Width: newWidth,
|
|
8927
|
+
Height: newHeight,
|
|
8928
|
+
ColorSpace: 'DeviceRGB',
|
|
8929
|
+
BitsPerComponent: 8,
|
|
8930
|
+
Filter: 'DCTDecode',
|
|
8931
|
+
Length: newImageBytes.length
|
|
8932
|
+
});
|
|
8933
|
+
var newStream = PDFRawStream.of(newDict, newImageBytes);
|
|
8934
|
+
context.assign(ref, newStream);
|
|
8935
|
+
}
|
|
8936
|
+
|
|
8106
8937
|
/**
|
|
8107
8938
|
* Creates an error indicating that a storage file model has already been initialized.
|
|
8108
8939
|
*
|
|
@@ -12846,4 +13677,4 @@ function _ts_generator(thisArg, body) {
|
|
|
12846
13677
|
};
|
|
12847
13678
|
}
|
|
12848
13679
|
|
|
12849
|
-
export { AbstractAppNotificationModule, BASE_NOTIFICATION_SERVER_ACTION_CONTEXT_TOKEN, BASE_STORAGE_FILE_SERVER_ACTION_CONTEXT_TOKEN, DEFAULT_DOWNLOAD_MULTIPLE_STORAGE_FILES_MAX_PARALLEL_TASKS, GlobalNotificationModule, KNOWN_BUT_UNCONFIGURED_NOTIFICATION_TEMPLATE_TYPE_DELETE_AFTER_RETRY_ATTEMPTS, KNOWN_BUT_UNCONFIGURED_NOTIFICATION_TEMPLATE_TYPE_HOURS_DELAY, MAILGUN_NOTIFICATION_EMAIL_SEND_SERVICE_DEFAULT_MAX_BATCH_SIZE_PER_REQUEST, MAKE_TEMPLATE_FOR_NOTIFICATION_RELATED_MODEL_INITIALIZATION_FUNCTION_DELETE_RESPONSE, MAKE_TEMPLATE_FOR_STORAGEFILE_RELATED_MODEL_INITIALIZATION_FUNCTION_DELETE_RESPONSE, MutableNotificationExpediteService, NOTIFICATION_BOX_NOT_INITIALIZED_DELAY_MINUTES, NOTIFICATION_INIT_SERVER_ACTIONS_CONTEXT_CONFIG_TOKEN, NOTIFICATION_MAX_SEND_ATTEMPTS, NOTIFICATION_SERVER_ACTION_CONTEXT_TOKEN, NOTIFICATION_TASK_MINIMUM_SET_AT_THROTTLE_TIME_MINUTES, NOTIFICATION_TASK_TYPE_FAILURE_DELAY_HOURS, NOTIFICATION_TASK_TYPE_FAILURE_DELAY_MS, NOTIFICATION_TASK_TYPE_MAX_SEND_ATTEMPTS, NOTIFICATION_TEMPLATE_SERVICE_CONFIGS_ARRAY_TOKEN, NOTIFICATION_TEMPLATE_SERVICE_DEFAULTS_OVERRIDE_TOKEN, NotificationExpediteService, NotificationInitServerActions, NotificationSendService, NotificationServerActions, NotificationTaskService, NotificationTaskSubTaskMissingRequiredDataTermination, NotificationTemplateService, SEND_QUEUE_NOTIFICATIONS_TASK_EXCESS_THRESHOLD, STORAGE_FILE_INIT_SERVER_ACTIONS_CONTEXT_CONFIG_TOKEN, STORAGE_FILE_SERVER_ACTION_CONTEXT_TOKEN, StorageFileInitServerActions, StorageFileInitializeFromUploadService, StorageFileServerActions, UNKNOWN_NOTIFICATION_TASK_TYPE_DELETE_AFTER_RETRY_ATTEMPTS, UNKNOWN_NOTIFICATION_TASK_TYPE_HOURS_DELAY, UNKNOWN_NOTIFICATION_TEMPLATE_TYPE_DELETE_AFTER_RETRY_ATTEMPTS, UNKNOWN_NOTIFICATION_TEMPLATE_TYPE_HOURS_DELAY, _initializeStorageFileFromUploadFileFactory, _processStorageFileInTransactionFactory, _syncStorageFileWithGroupsInTransactionFactory, allStorageFileGroupStorageFileProcessingPurposeSubtaskProcessors, appNotificationModuleMetadata, appStorageFileModuleMetadata, cleanupOldNotificationLoggedEventDaysFactory, cleanupSentNotificationsFactory, createNotificationBoxFactory, createNotificationBoxInTransactionFactory, createNotificationIdRequiredError, createNotificationSummaryFactory, createNotificationUserFactory, createOrRunUniqueNotificationDocument, createStorageFileFactory, createStorageFileGroupFactory, createStorageFileGroupInTransactionFactory, createStorageFileGroupInputError, deleteAllQueuedStorageFilesFactory, deleteStorageFileFactory, downloadMultipleStorageFilesFactory, downloadStorageFileFactory, expandNotificationRecipients, exportMutableNotificationExpediteService, firestoreNotificationSummarySendService, ignoreSendNotificationTextSendService, initializeAllApplicableNotificationBoxesFactory, initializeAllApplicableNotificationSummariesFactory, initializeAllApplicableStorageFileGroupsFactory, initializeAllStorageFilesFromUploadsFactory, initializeNotificationBoxFactory, initializeNotificationBoxInTransactionFactory, initializeNotificationModelInTransaction, initializeNotificationSummaryFactory, initializeNotificationSummaryInTransactionFactory, initializeStorageFileFromUploadFactory, initializeStorageFileGroupFactory, initializeStorageFileGroupInTransactionFactory, initializeStorageFileModelInTransaction, mailgunNotificationEmailSendService, makeNewNotificationSummaryTemplate, markStorageFileForDeleteTemplate, notificationBoxDoesNotExist, notificationBoxExclusionTargetInvalidError, notificationBoxExistsForModelError, notificationBoxRecipientDoesNotExistsError, notificationBoxUnregistredModelTypeInitializationError, notificationExpediteServiceInstance, notificationInitServerActions, notificationInitServerActionsFactory, notificationModelAlreadyInitializedError, notificationServerActions, notificationServerActionsContextFactory, notificationServerActionsFactory, notificationTaskService, notificationTaskSubTaskMissingRequiredDataTermination, notificationTaskSubtaskNotificationTaskHandlerFactory, notificationTemplateServiceInstance, notificationUserBlockedFromBeingAddedToRecipientsError, notificationUserInvalidUidForCreateError, notificationUserLockedConfigFromBeingUpdatedError, processAllQueuedStorageFilesFactory, processStorageFileFactory, provideMutableNotificationExpediteService, queryAndFlagStorageFilesForDelete, regenerateAllFlaggedStorageFileGroupsContentFactory, regenerateStorageFileGroupContentFactory, resyncAllNotificationUsersFactory, resyncNotificationUserFactory, sendNotificationFactory, sendQueuedNotificationsFactory, storageFileAlreadyProcessedError, storageFileCannotBeDeletedYetError, storageFileGroupQueuedForInitializationError, storageFileGroupZipStorageFileProcessingPurposeSubtaskProcessor, storageFileInitServerActions, storageFileInitServerActionsFactory, storageFileInitializeFromUploadService, storageFileInitializeFromUploadServiceInitializerResultPermanentFailure, storageFileModelAlreadyInitializedError, storageFileNotFlaggedForDeletionError, storageFileNotFlaggedForGroupsSyncError, storageFileProcessingNotAllowedForInvalidStateError, storageFileProcessingNotAvailableForTypeError, storageFileProcessingNotQueuedForProcessingError, storageFileProcessingNotificationTaskHandler, storageFileProcessingNotificationTaskHandlerDefaultCleanup, storageFileServerActions, storageFileServerActionsContextFactory, storageFileServerActionsFactory, syncAllFlaggedStorageFilesWithGroupsFactory, syncStorageFileWithGroupsFactory, updateNotificationBoxFactory, updateNotificationBoxRecipientExclusionInTransactionFactory, updateNotificationBoxRecipientFactory, updateNotificationBoxRecipientInTransactionFactory, updateNotificationSummaryFactory, updateNotificationUserFactory, updateNotificationUserNotificationBoxRecipientConfig, updateStorageFileFactory, updateStorageFileGroupFactory, uploadedFileDoesNotExistError, uploadedFileInitializationDiscardedError, uploadedFileInitializationFailedError, uploadedFileIsNotAllowedToBeInitializedError };
|
|
13680
|
+
export { AbstractAppNotificationModule, BASE_NOTIFICATION_SERVER_ACTION_CONTEXT_TOKEN, BASE_STORAGE_FILE_SERVER_ACTION_CONTEXT_TOKEN, DEFAULT_COMPRESS_IMAGE_FORMAT, DEFAULT_COMPRESS_IMAGE_INITIAL_QUALITY, DEFAULT_COMPRESS_IMAGE_MAX_DIMENSION, DEFAULT_COMPRESS_IMAGE_MIN_QUALITY, DEFAULT_COMPRESS_IMAGE_QUALITY_STEP, DEFAULT_COMPRESS_PDF_IMAGE_MAX_DIMENSION, DEFAULT_COMPRESS_PDF_IMAGE_QUALITY, DEFAULT_COMPRESS_PDF_IMAGE_SIZE_THRESHOLD_BYTES, DEFAULT_DOWNLOAD_MULTIPLE_STORAGE_FILES_MAX_PARALLEL_TASKS, GlobalNotificationModule, KNOWN_BUT_UNCONFIGURED_NOTIFICATION_TEMPLATE_TYPE_DELETE_AFTER_RETRY_ATTEMPTS, KNOWN_BUT_UNCONFIGURED_NOTIFICATION_TEMPLATE_TYPE_HOURS_DELAY, MAILGUN_NOTIFICATION_EMAIL_SEND_SERVICE_DEFAULT_MAX_BATCH_SIZE_PER_REQUEST, MAKE_TEMPLATE_FOR_NOTIFICATION_RELATED_MODEL_INITIALIZATION_FUNCTION_DELETE_RESPONSE, MAKE_TEMPLATE_FOR_STORAGEFILE_RELATED_MODEL_INITIALIZATION_FUNCTION_DELETE_RESPONSE, MutableNotificationExpediteService, NOTIFICATION_BOX_NOT_INITIALIZED_DELAY_MINUTES, NOTIFICATION_INIT_SERVER_ACTIONS_CONTEXT_CONFIG_TOKEN, NOTIFICATION_MAX_SEND_ATTEMPTS, NOTIFICATION_SERVER_ACTION_CONTEXT_TOKEN, NOTIFICATION_TASK_MINIMUM_SET_AT_THROTTLE_TIME_MINUTES, NOTIFICATION_TASK_TYPE_FAILURE_DELAY_HOURS, NOTIFICATION_TASK_TYPE_FAILURE_DELAY_MS, NOTIFICATION_TASK_TYPE_MAX_SEND_ATTEMPTS, NOTIFICATION_TEMPLATE_SERVICE_CONFIGS_ARRAY_TOKEN, NOTIFICATION_TEMPLATE_SERVICE_DEFAULTS_OVERRIDE_TOKEN, NotificationExpediteService, NotificationInitServerActions, NotificationSendService, NotificationServerActions, NotificationTaskService, NotificationTaskSubTaskMissingRequiredDataTermination, NotificationTemplateService, SEND_QUEUE_NOTIFICATIONS_TASK_EXCESS_THRESHOLD, STORAGE_FILE_INIT_SERVER_ACTIONS_CONTEXT_CONFIG_TOKEN, STORAGE_FILE_SERVER_ACTION_CONTEXT_TOKEN, StorageFileInitServerActions, StorageFileInitializeFromUploadService, StorageFileServerActions, UNKNOWN_NOTIFICATION_TASK_TYPE_DELETE_AFTER_RETRY_ATTEMPTS, UNKNOWN_NOTIFICATION_TASK_TYPE_HOURS_DELAY, UNKNOWN_NOTIFICATION_TEMPLATE_TYPE_DELETE_AFTER_RETRY_ATTEMPTS, UNKNOWN_NOTIFICATION_TEMPLATE_TYPE_HOURS_DELAY, _initializeStorageFileFromUploadFileFactory, _processStorageFileInTransactionFactory, _syncStorageFileWithGroupsInTransactionFactory, allStorageFileGroupStorageFileProcessingPurposeSubtaskProcessors, appNotificationModuleMetadata, appStorageFileModuleMetadata, cleanupOldNotificationLoggedEventDaysFactory, cleanupSentNotificationsFactory, compressImageBufferToTargetSize, compressPdfImagesToTargetSize, createNotificationBoxFactory, createNotificationBoxInTransactionFactory, createNotificationIdRequiredError, createNotificationSummaryFactory, createNotificationUserFactory, createOrRunUniqueNotificationDocument, createStorageFileFactory, createStorageFileGroupFactory, createStorageFileGroupInTransactionFactory, createStorageFileGroupInputError, deleteAllQueuedStorageFilesFactory, deleteStorageFileFactory, downloadMultipleStorageFilesFactory, downloadStorageFileFactory, expandNotificationRecipients, exportMutableNotificationExpediteService, firestoreNotificationSummarySendService, ignoreSendNotificationTextSendService, initializeAllApplicableNotificationBoxesFactory, initializeAllApplicableNotificationSummariesFactory, initializeAllApplicableStorageFileGroupsFactory, initializeAllStorageFilesFromUploadsFactory, initializeNotificationBoxFactory, initializeNotificationBoxInTransactionFactory, initializeNotificationModelInTransaction, initializeNotificationSummaryFactory, initializeNotificationSummaryInTransactionFactory, initializeStorageFileFromUploadFactory, initializeStorageFileGroupFactory, initializeStorageFileGroupInTransactionFactory, initializeStorageFileModelInTransaction, mailgunNotificationEmailSendService, makeNewNotificationSummaryTemplate, markStorageFileForDeleteTemplate, notificationBoxDoesNotExist, notificationBoxExclusionTargetInvalidError, notificationBoxExistsForModelError, notificationBoxRecipientDoesNotExistsError, notificationBoxUnregistredModelTypeInitializationError, notificationExpediteServiceInstance, notificationInitServerActions, notificationInitServerActionsFactory, notificationModelAlreadyInitializedError, notificationServerActions, notificationServerActionsContextFactory, notificationServerActionsFactory, notificationTaskService, notificationTaskSubTaskMissingRequiredDataTermination, notificationTaskSubtaskNotificationTaskHandlerFactory, notificationTemplateServiceInstance, notificationUserBlockedFromBeingAddedToRecipientsError, notificationUserInvalidUidForCreateError, notificationUserLockedConfigFromBeingUpdatedError, processAllQueuedStorageFilesFactory, processStorageFileFactory, provideMutableNotificationExpediteService, queryAndFlagStorageFilesForDelete, regenerateAllFlaggedStorageFileGroupsContentFactory, regenerateStorageFileGroupContentFactory, resyncAllNotificationUsersFactory, resyncNotificationUserFactory, sendNotificationFactory, sendQueuedNotificationsFactory, storageFileAlreadyProcessedError, storageFileCannotBeDeletedYetError, storageFileGroupQueuedForInitializationError, storageFileGroupZipStorageFileProcessingPurposeSubtaskProcessor, storageFileInitServerActions, storageFileInitServerActionsFactory, storageFileInitializeFromUploadService, storageFileInitializeFromUploadServiceInitializerResultPermanentFailure, storageFileModelAlreadyInitializedError, storageFileNotFlaggedForDeletionError, storageFileNotFlaggedForGroupsSyncError, storageFileProcessingNotAllowedForInvalidStateError, storageFileProcessingNotAvailableForTypeError, storageFileProcessingNotQueuedForProcessingError, storageFileProcessingNotificationTaskHandler, storageFileProcessingNotificationTaskHandlerDefaultCleanup, storageFileServerActions, storageFileServerActionsContextFactory, storageFileServerActionsFactory, syncAllFlaggedStorageFilesWithGroupsFactory, syncStorageFileWithGroupsFactory, updateNotificationBoxFactory, updateNotificationBoxRecipientExclusionInTransactionFactory, updateNotificationBoxRecipientFactory, updateNotificationBoxRecipientInTransactionFactory, updateNotificationSummaryFactory, updateNotificationUserFactory, updateNotificationUserNotificationBoxRecipientConfig, updateStorageFileFactory, updateStorageFileGroupFactory, uploadedFileDoesNotExistError, uploadedFileInitializationDiscardedError, uploadedFileInitializationFailedError, uploadedFileIsNotAllowedToBeInitializedError };
|