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