firebase-functions 6.6.0 → 7.0.0-rc.0
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/lib/_virtual/rolldown_runtime.js +34 -0
- package/lib/bin/firebase-functions.js +78 -103
- package/lib/common/app.js +35 -55
- package/lib/common/change.js +54 -75
- package/lib/common/config.js +41 -41
- package/lib/common/debug.js +23 -47
- package/lib/common/encoding.js +59 -82
- package/lib/common/onInit.js +26 -28
- package/lib/common/options.js +22 -42
- package/lib/common/params.d.ts +6 -6
- package/lib/common/params.js +0 -23
- package/lib/common/providers/database.js +270 -300
- package/lib/common/providers/firestore.js +66 -92
- package/lib/common/providers/https.d.ts +0 -1
- package/lib/common/providers/https.js +537 -539
- package/lib/common/providers/identity.js +393 -444
- package/lib/common/providers/tasks.js +64 -98
- package/lib/common/timezone.js +544 -542
- package/lib/common/trace.d.ts +0 -1
- package/lib/common/trace.js +63 -55
- package/lib/common/utilities/assertions.d.ts +11 -0
- package/lib/common/utilities/assertions.js +18 -0
- package/lib/common/utilities/encoder.js +20 -37
- package/lib/common/utilities/path-pattern.js +106 -132
- package/lib/common/utilities/path.js +28 -27
- package/lib/common/utilities/utils.js +23 -45
- package/lib/esm/_virtual/rolldown_runtime.mjs +16 -0
- package/lib/esm/bin/firebase-functions.mjs +91 -0
- package/lib/esm/common/app.mjs +39 -0
- package/lib/esm/common/change.mjs +57 -0
- package/lib/esm/common/config.mjs +45 -0
- package/lib/esm/common/debug.mjs +28 -0
- package/lib/esm/common/encoding.mjs +69 -0
- package/lib/esm/common/onInit.mjs +33 -0
- package/lib/esm/common/options.mjs +22 -0
- package/lib/esm/common/params.mjs +1 -0
- package/lib/esm/common/providers/database.mjs +269 -0
- package/lib/esm/common/providers/firestore.mjs +78 -0
- package/lib/esm/common/providers/https.mjs +573 -0
- package/lib/esm/common/providers/identity.mjs +428 -0
- package/lib/esm/common/providers/tasks.mjs +67 -0
- package/lib/esm/common/timezone.mjs +544 -0
- package/lib/esm/common/trace.mjs +73 -0
- package/lib/esm/common/utilities/assertions.mjs +17 -0
- package/lib/esm/common/utilities/encoder.mjs +21 -0
- package/lib/esm/common/utilities/path-pattern.mjs +116 -0
- package/lib/esm/common/utilities/path.mjs +35 -0
- package/lib/esm/common/utilities/utils.mjs +29 -0
- package/lib/esm/function-configuration.mjs +1 -0
- package/lib/esm/logger/common.mjs +23 -0
- package/lib/esm/logger/compat.mjs +25 -0
- package/lib/esm/logger/index.mjs +131 -0
- package/lib/esm/params/index.mjs +160 -0
- package/lib/esm/params/types.mjs +400 -0
- package/lib/esm/runtime/loader.mjs +132 -0
- package/lib/esm/runtime/manifest.mjs +134 -0
- package/lib/esm/types/global.d.mjs +1 -0
- package/lib/esm/v1/cloud-functions.mjs +206 -0
- package/lib/esm/v1/config.mjs +14 -0
- package/lib/esm/v1/function-builder.mjs +252 -0
- package/lib/esm/v1/function-configuration.mjs +72 -0
- package/lib/esm/v1/index.mjs +27 -0
- package/lib/esm/v1/providers/analytics.mjs +212 -0
- package/lib/esm/v1/providers/auth.mjs +156 -0
- package/lib/esm/v1/providers/database.mjs +243 -0
- package/lib/esm/v1/providers/firestore.mjs +131 -0
- package/lib/esm/v1/providers/https.mjs +82 -0
- package/lib/esm/v1/providers/pubsub.mjs +175 -0
- package/lib/esm/v1/providers/remoteConfig.mjs +64 -0
- package/lib/esm/v1/providers/storage.mjs +163 -0
- package/lib/esm/v1/providers/tasks.mjs +63 -0
- package/lib/esm/v1/providers/testLab.mjs +94 -0
- package/lib/esm/v2/core.mjs +4 -0
- package/lib/esm/v2/index.mjs +28 -0
- package/lib/esm/v2/options.mjs +102 -0
- package/lib/esm/v2/providers/alerts/alerts.mjs +85 -0
- package/lib/esm/v2/providers/alerts/appDistribution.mjs +75 -0
- package/lib/esm/v2/providers/alerts/billing.mjs +51 -0
- package/lib/esm/v2/providers/alerts/crashlytics.mjs +122 -0
- package/lib/esm/v2/providers/alerts/index.mjs +22 -0
- package/lib/esm/v2/providers/alerts/performance.mjs +66 -0
- package/lib/esm/v2/providers/database.mjs +197 -0
- package/lib/esm/v2/providers/dataconnect.mjs +130 -0
- package/lib/esm/v2/providers/eventarc.mjs +51 -0
- package/lib/esm/v2/providers/firestore.mjs +294 -0
- package/lib/esm/v2/providers/https.mjs +210 -0
- package/lib/esm/v2/providers/identity.mjs +103 -0
- package/lib/esm/v2/providers/pubsub.mjs +148 -0
- package/lib/esm/v2/providers/remoteConfig.mjs +52 -0
- package/lib/esm/v2/providers/scheduler.mjs +84 -0
- package/lib/esm/v2/providers/storage.mjs +155 -0
- package/lib/esm/v2/providers/tasks.mjs +65 -0
- package/lib/esm/v2/providers/testLab.mjs +53 -0
- package/lib/esm/v2/trace.mjs +20 -0
- package/lib/function-configuration.d.ts +0 -0
- package/lib/function-configuration.js +0 -0
- package/lib/logger/common.js +21 -41
- package/lib/logger/compat.js +18 -33
- package/lib/logger/index.js +119 -130
- package/lib/params/index.d.ts +4 -2
- package/lib/params/index.js +150 -144
- package/lib/params/types.js +389 -423
- package/lib/runtime/loader.js +114 -148
- package/lib/runtime/manifest.js +106 -126
- package/lib/types/global.d.js +0 -0
- package/lib/v1/cloud-functions.d.ts +2 -2
- package/lib/v1/cloud-functions.js +193 -241
- package/lib/v1/config.d.ts +4 -7
- package/lib/v1/config.js +13 -75
- package/lib/v1/function-builder.js +239 -368
- package/lib/v1/function-configuration.js +70 -63
- package/lib/v1/index.js +118 -73
- package/lib/v1/providers/analytics.js +188 -235
- package/lib/v1/providers/auth.d.ts +2 -1
- package/lib/v1/providers/auth.js +159 -164
- package/lib/v1/providers/database.js +237 -242
- package/lib/v1/providers/firestore.js +131 -130
- package/lib/v1/providers/https.d.ts +2 -1
- package/lib/v1/providers/https.js +79 -86
- package/lib/v1/providers/pubsub.js +175 -172
- package/lib/v1/providers/remoteConfig.js +64 -68
- package/lib/v1/providers/storage.js +161 -163
- package/lib/v1/providers/tasks.d.ts +1 -1
- package/lib/v1/providers/tasks.js +65 -80
- package/lib/v1/providers/testLab.js +94 -94
- package/lib/v2/core.d.ts +1 -1
- package/lib/v2/core.js +5 -32
- package/lib/v2/index.d.ts +6 -3
- package/lib/v2/index.js +123 -75
- package/lib/v2/options.js +88 -114
- package/lib/v2/providers/alerts/alerts.js +76 -95
- package/lib/v2/providers/alerts/appDistribution.js +73 -78
- package/lib/v2/providers/alerts/billing.js +49 -53
- package/lib/v2/providers/alerts/crashlytics.js +110 -102
- package/lib/v2/providers/alerts/index.js +56 -53
- package/lib/v2/providers/alerts/performance.js +64 -74
- package/lib/v2/providers/database.js +177 -180
- package/lib/v2/providers/dataconnect.d.ts +95 -0
- package/lib/v2/providers/dataconnect.js +137 -0
- package/lib/v2/providers/eventarc.js +55 -77
- package/lib/v2/providers/firestore.js +262 -260
- package/lib/v2/providers/https.d.ts +3 -2
- package/lib/v2/providers/https.js +210 -247
- package/lib/v2/providers/identity.d.ts +2 -1
- package/lib/v2/providers/identity.js +96 -105
- package/lib/v2/providers/pubsub.js +149 -167
- package/lib/v2/providers/remoteConfig.js +54 -63
- package/lib/v2/providers/scheduler.js +84 -96
- package/lib/v2/providers/storage.js +147 -162
- package/lib/v2/providers/tasks.d.ts +1 -1
- package/lib/v2/providers/tasks.js +68 -95
- package/lib/v2/providers/testLab.js +55 -64
- package/lib/v2/trace.js +18 -19
- package/package.json +290 -226
- package/protos/compiledFirestore.mjs +3512 -0
- package/protos/update.sh +28 -7
|
@@ -1,65 +1,61 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
// copies or substantial portions of the Software.
|
|
15
|
-
//
|
|
16
|
-
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
-
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
-
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
-
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
-
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
-
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
-
// SOFTWARE.
|
|
23
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
|
-
exports.onOperation = exports.onPlanAutomatedUpdatePublished = exports.onPlanUpdatePublished = exports.planAutomatedUpdateAlert = exports.planUpdateAlert = void 0;
|
|
25
|
-
const trace_1 = require("../../trace");
|
|
26
|
-
const alerts_1 = require("./alerts");
|
|
27
|
-
const onInit_1 = require("../../../common/onInit");
|
|
1
|
+
const require_rolldown_runtime = require('../../../_virtual/rolldown_runtime.js');
|
|
2
|
+
const require_common_onInit = require('../../../common/onInit.js');
|
|
3
|
+
const require_v2_trace = require('../../trace.js');
|
|
4
|
+
const require_v2_providers_alerts_alerts = require('./alerts.js');
|
|
5
|
+
|
|
6
|
+
//#region src/v2/providers/alerts/billing.ts
|
|
7
|
+
var billing_exports = /* @__PURE__ */ require_rolldown_runtime.__export({
|
|
8
|
+
onOperation: () => onOperation,
|
|
9
|
+
onPlanAutomatedUpdatePublished: () => onPlanAutomatedUpdatePublished,
|
|
10
|
+
onPlanUpdatePublished: () => onPlanUpdatePublished,
|
|
11
|
+
planAutomatedUpdateAlert: () => planAutomatedUpdateAlert,
|
|
12
|
+
planUpdateAlert: () => planUpdateAlert
|
|
13
|
+
});
|
|
28
14
|
/** @internal */
|
|
29
|
-
|
|
15
|
+
const planUpdateAlert = "billing.planUpdate";
|
|
30
16
|
/** @internal */
|
|
31
|
-
|
|
17
|
+
const planAutomatedUpdateAlert = "billing.planAutomatedUpdate";
|
|
32
18
|
/**
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
19
|
+
* Declares a function that can handle a billing plan update event.
|
|
20
|
+
* @param optsOrHandler - Options or an event-handling function.
|
|
21
|
+
* @param handler - Event handler which is run every time a billing plan is updated.
|
|
22
|
+
* @returns A function that you can export and deploy.
|
|
23
|
+
*/
|
|
38
24
|
function onPlanUpdatePublished(optsOrHandler, handler) {
|
|
39
|
-
|
|
25
|
+
return onOperation(planUpdateAlert, optsOrHandler, handler);
|
|
40
26
|
}
|
|
41
|
-
exports.onPlanUpdatePublished = onPlanUpdatePublished;
|
|
42
27
|
/**
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
28
|
+
* Declares a function that can handle an automated billing plan update event.
|
|
29
|
+
* @param optsOrHandler - Options or an event-handling function.
|
|
30
|
+
* @param handler - Event handler which is run every time an automated billing plan update occurs.
|
|
31
|
+
* @returns A function that you can export and deploy.
|
|
32
|
+
*/
|
|
48
33
|
function onPlanAutomatedUpdatePublished(optsOrHandler, handler) {
|
|
49
|
-
|
|
34
|
+
return onOperation(planAutomatedUpdateAlert, optsOrHandler, handler);
|
|
50
35
|
}
|
|
51
|
-
exports.onPlanAutomatedUpdatePublished = onPlanAutomatedUpdatePublished;
|
|
52
36
|
/** @internal */
|
|
53
37
|
function onOperation(alertType, optsOrHandler, handler) {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
38
|
+
if (typeof optsOrHandler === "function") {
|
|
39
|
+
handler = optsOrHandler;
|
|
40
|
+
optsOrHandler = {};
|
|
41
|
+
}
|
|
42
|
+
const func = (raw) => {
|
|
43
|
+
return require_v2_trace.wrapTraceContext(require_common_onInit.withInit(handler))(require_v2_providers_alerts_alerts.convertAlertAndApp(raw));
|
|
44
|
+
};
|
|
45
|
+
func.run = handler;
|
|
46
|
+
func.__endpoint = require_v2_providers_alerts_alerts.getEndpointAnnotation(optsOrHandler, alertType);
|
|
47
|
+
return func;
|
|
64
48
|
}
|
|
49
|
+
|
|
50
|
+
//#endregion
|
|
51
|
+
Object.defineProperty(exports, 'billing_exports', {
|
|
52
|
+
enumerable: true,
|
|
53
|
+
get: function () {
|
|
54
|
+
return billing_exports;
|
|
55
|
+
}
|
|
56
|
+
});
|
|
65
57
|
exports.onOperation = onOperation;
|
|
58
|
+
exports.onPlanAutomatedUpdatePublished = onPlanAutomatedUpdatePublished;
|
|
59
|
+
exports.onPlanUpdatePublished = onPlanUpdatePublished;
|
|
60
|
+
exports.planAutomatedUpdateAlert = planAutomatedUpdateAlert;
|
|
61
|
+
exports.planUpdateAlert = planUpdateAlert;
|
|
@@ -1,133 +1,141 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
|
-
exports.getOptsAndApp = exports.onOperation = exports.onNewAnrIssuePublished = exports.onVelocityAlertPublished = exports.onStabilityDigestPublished = exports.onRegressionAlertPublished = exports.onNewNonfatalIssuePublished = exports.onNewFatalIssuePublished = exports.newAnrIssueAlert = exports.velocityAlert = exports.stabilityDigestAlert = exports.regressionAlert = exports.newNonfatalIssueAlert = exports.newFatalIssueAlert = void 0;
|
|
25
|
-
const trace_1 = require("../../trace");
|
|
26
|
-
const alerts_1 = require("./alerts");
|
|
27
|
-
const onInit_1 = require("../../../common/onInit");
|
|
1
|
+
const require_rolldown_runtime = require('../../../_virtual/rolldown_runtime.js');
|
|
2
|
+
const require_common_onInit = require('../../../common/onInit.js');
|
|
3
|
+
const require_v2_trace = require('../../trace.js');
|
|
4
|
+
const require_v2_providers_alerts_alerts = require('./alerts.js');
|
|
5
|
+
|
|
6
|
+
//#region src/v2/providers/alerts/crashlytics.ts
|
|
7
|
+
var crashlytics_exports = /* @__PURE__ */ require_rolldown_runtime.__export({
|
|
8
|
+
getOptsAndApp: () => getOptsAndApp,
|
|
9
|
+
newAnrIssueAlert: () => newAnrIssueAlert,
|
|
10
|
+
newFatalIssueAlert: () => newFatalIssueAlert,
|
|
11
|
+
newNonfatalIssueAlert: () => newNonfatalIssueAlert,
|
|
12
|
+
onNewAnrIssuePublished: () => onNewAnrIssuePublished,
|
|
13
|
+
onNewFatalIssuePublished: () => onNewFatalIssuePublished,
|
|
14
|
+
onNewNonfatalIssuePublished: () => onNewNonfatalIssuePublished,
|
|
15
|
+
onOperation: () => onOperation,
|
|
16
|
+
onRegressionAlertPublished: () => onRegressionAlertPublished,
|
|
17
|
+
onStabilityDigestPublished: () => onStabilityDigestPublished,
|
|
18
|
+
onVelocityAlertPublished: () => onVelocityAlertPublished,
|
|
19
|
+
regressionAlert: () => regressionAlert,
|
|
20
|
+
stabilityDigestAlert: () => stabilityDigestAlert,
|
|
21
|
+
velocityAlert: () => velocityAlert
|
|
22
|
+
});
|
|
28
23
|
/** @internal */
|
|
29
|
-
|
|
24
|
+
const newFatalIssueAlert = "crashlytics.newFatalIssue";
|
|
30
25
|
/** @internal */
|
|
31
|
-
|
|
26
|
+
const newNonfatalIssueAlert = "crashlytics.newNonfatalIssue";
|
|
32
27
|
/** @internal */
|
|
33
|
-
|
|
28
|
+
const regressionAlert = "crashlytics.regression";
|
|
34
29
|
/** @internal */
|
|
35
|
-
|
|
30
|
+
const stabilityDigestAlert = "crashlytics.stabilityDigest";
|
|
36
31
|
/** @internal */
|
|
37
|
-
|
|
32
|
+
const velocityAlert = "crashlytics.velocity";
|
|
38
33
|
/** @internal */
|
|
39
|
-
|
|
34
|
+
const newAnrIssueAlert = "crashlytics.newAnrIssue";
|
|
40
35
|
/**
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
36
|
+
* Declares a function that can handle a new fatal issue published to Crashlytics.
|
|
37
|
+
* @param appIdOrOptsOrHandler - A specific application, options, or an event-handling function.
|
|
38
|
+
* @param handler - Event handler that is triggered when a new fatal issue is published to Crashlytics.
|
|
39
|
+
* @returns A function that you can export and deploy.
|
|
40
|
+
*/
|
|
46
41
|
function onNewFatalIssuePublished(appIdOrOptsOrHandler, handler) {
|
|
47
|
-
|
|
42
|
+
return onOperation(newFatalIssueAlert, appIdOrOptsOrHandler, handler);
|
|
48
43
|
}
|
|
49
|
-
exports.onNewFatalIssuePublished = onNewFatalIssuePublished;
|
|
50
44
|
/**
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
45
|
+
* Declares a function that can handle a new non-fatal issue published to Crashlytics.
|
|
46
|
+
* @param appIdOrOptsOrHandler - A specific application, options, or an event-handling function.
|
|
47
|
+
* @param handler - Event handler that is triggered when a new non-fatal issue is published to Crashlytics.
|
|
48
|
+
* @returns A function that you can export and deploy.
|
|
49
|
+
*/
|
|
56
50
|
function onNewNonfatalIssuePublished(appIdOrOptsOrHandler, handler) {
|
|
57
|
-
|
|
51
|
+
return onOperation(newNonfatalIssueAlert, appIdOrOptsOrHandler, handler);
|
|
58
52
|
}
|
|
59
|
-
exports.onNewNonfatalIssuePublished = onNewNonfatalIssuePublished;
|
|
60
53
|
/**
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
54
|
+
* Declares a function that can handle a regression alert published to Crashlytics.
|
|
55
|
+
* @param appIdOrOptsOrHandler - A specific application, options, or an event-handling function.
|
|
56
|
+
* @param handler - Event handler that is triggered when a regression alert is published to Crashlytics.
|
|
57
|
+
* @returns A function that you can export and deploy.
|
|
58
|
+
*/
|
|
66
59
|
function onRegressionAlertPublished(appIdOrOptsOrHandler, handler) {
|
|
67
|
-
|
|
60
|
+
return onOperation(regressionAlert, appIdOrOptsOrHandler, handler);
|
|
68
61
|
}
|
|
69
|
-
exports.onRegressionAlertPublished = onRegressionAlertPublished;
|
|
70
62
|
/**
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
63
|
+
* Declares a function that can handle a stability digest published to Crashlytics.
|
|
64
|
+
* @param appIdOrOptsOrHandler - A specific application, options, or an event-handling function.
|
|
65
|
+
* @param handler - Event handler that is triggered when a stability digest is published to Crashlytics.
|
|
66
|
+
* @returns A function that you can export and deploy.
|
|
67
|
+
*/
|
|
76
68
|
function onStabilityDigestPublished(appIdOrOptsOrHandler, handler) {
|
|
77
|
-
|
|
69
|
+
return onOperation(stabilityDigestAlert, appIdOrOptsOrHandler, handler);
|
|
78
70
|
}
|
|
79
|
-
exports.onStabilityDigestPublished = onStabilityDigestPublished;
|
|
80
71
|
/**
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
72
|
+
* Declares a function that can handle a velocity alert published to Crashlytics.
|
|
73
|
+
* @param appIdOrOptsOrHandler - A specific application, options, or an event-handling function.
|
|
74
|
+
* @param handler - Event handler that is triggered when a velocity alert is published to Crashlytics.
|
|
75
|
+
* @returns A function that you can export and deploy.
|
|
76
|
+
*/
|
|
86
77
|
function onVelocityAlertPublished(appIdOrOptsOrHandler, handler) {
|
|
87
|
-
|
|
78
|
+
return onOperation(velocityAlert, appIdOrOptsOrHandler, handler);
|
|
88
79
|
}
|
|
89
|
-
exports.onVelocityAlertPublished = onVelocityAlertPublished;
|
|
90
80
|
/**
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
81
|
+
* Declares a function that can handle a new Application Not Responding issue published to Crashlytics.
|
|
82
|
+
* @param appIdOrOptsOrHandler - A specific application, options, or an event-handling function.
|
|
83
|
+
* @param handler - Event handler that is triggered when a new Application Not Responding issue is published to Crashlytics.
|
|
84
|
+
* @returns A function that you can export and deploy.
|
|
85
|
+
*/
|
|
96
86
|
function onNewAnrIssuePublished(appIdOrOptsOrHandler, handler) {
|
|
97
|
-
|
|
87
|
+
return onOperation(newAnrIssueAlert, appIdOrOptsOrHandler, handler);
|
|
98
88
|
}
|
|
99
|
-
exports.onNewAnrIssuePublished = onNewAnrIssuePublished;
|
|
100
89
|
/** @internal */
|
|
101
90
|
function onOperation(alertType, appIdOrOptsOrHandler, handler) {
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
91
|
+
if (typeof appIdOrOptsOrHandler === "function") {
|
|
92
|
+
handler = appIdOrOptsOrHandler;
|
|
93
|
+
appIdOrOptsOrHandler = {};
|
|
94
|
+
}
|
|
95
|
+
const [opts, appId] = getOptsAndApp(appIdOrOptsOrHandler);
|
|
96
|
+
const func = (raw) => {
|
|
97
|
+
return require_v2_trace.wrapTraceContext(require_common_onInit.withInit(handler))(require_v2_providers_alerts_alerts.convertAlertAndApp(raw));
|
|
98
|
+
};
|
|
99
|
+
func.run = handler;
|
|
100
|
+
func.__endpoint = require_v2_providers_alerts_alerts.getEndpointAnnotation(opts, alertType, appId);
|
|
101
|
+
return func;
|
|
113
102
|
}
|
|
114
|
-
exports.onOperation = onOperation;
|
|
115
103
|
/**
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
104
|
+
* Helper function to parse the function opts and appId.
|
|
105
|
+
* @internal
|
|
106
|
+
*/
|
|
119
107
|
function getOptsAndApp(appIdOrOpts) {
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
return [opts, appId];
|
|
108
|
+
let opts;
|
|
109
|
+
let appId;
|
|
110
|
+
if (typeof appIdOrOpts === "string") {
|
|
111
|
+
opts = {};
|
|
112
|
+
appId = appIdOrOpts;
|
|
113
|
+
} else {
|
|
114
|
+
appId = appIdOrOpts.appId;
|
|
115
|
+
opts = { ...appIdOrOpts };
|
|
116
|
+
delete opts.appId;
|
|
117
|
+
}
|
|
118
|
+
return [opts, appId];
|
|
132
119
|
}
|
|
120
|
+
|
|
121
|
+
//#endregion
|
|
122
|
+
Object.defineProperty(exports, 'crashlytics_exports', {
|
|
123
|
+
enumerable: true,
|
|
124
|
+
get: function () {
|
|
125
|
+
return crashlytics_exports;
|
|
126
|
+
}
|
|
127
|
+
});
|
|
133
128
|
exports.getOptsAndApp = getOptsAndApp;
|
|
129
|
+
exports.newAnrIssueAlert = newAnrIssueAlert;
|
|
130
|
+
exports.newFatalIssueAlert = newFatalIssueAlert;
|
|
131
|
+
exports.newNonfatalIssueAlert = newNonfatalIssueAlert;
|
|
132
|
+
exports.onNewAnrIssuePublished = onNewAnrIssuePublished;
|
|
133
|
+
exports.onNewFatalIssuePublished = onNewFatalIssuePublished;
|
|
134
|
+
exports.onNewNonfatalIssuePublished = onNewNonfatalIssuePublished;
|
|
135
|
+
exports.onOperation = onOperation;
|
|
136
|
+
exports.onRegressionAlertPublished = onRegressionAlertPublished;
|
|
137
|
+
exports.onStabilityDigestPublished = onStabilityDigestPublished;
|
|
138
|
+
exports.onVelocityAlertPublished = onVelocityAlertPublished;
|
|
139
|
+
exports.regressionAlert = regressionAlert;
|
|
140
|
+
exports.stabilityDigestAlert = stabilityDigestAlert;
|
|
141
|
+
exports.velocityAlert = velocityAlert;
|
|
@@ -1,53 +1,56 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
})
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
exports.
|
|
49
|
-
|
|
50
|
-
exports.
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
1
|
+
const require_rolldown_runtime = require('../../../_virtual/rolldown_runtime.js');
|
|
2
|
+
const require_v2_providers_alerts_alerts = require('./alerts.js');
|
|
3
|
+
const require_v2_providers_alerts_appDistribution = require('./appDistribution.js');
|
|
4
|
+
const require_v2_providers_alerts_billing = require('./billing.js');
|
|
5
|
+
const require_v2_providers_alerts_crashlytics = require('./crashlytics.js');
|
|
6
|
+
const require_v2_providers_alerts_performance = require('./performance.js');
|
|
7
|
+
|
|
8
|
+
//#region src/v2/providers/alerts/index.ts
|
|
9
|
+
var alerts_exports = /* @__PURE__ */ require_rolldown_runtime.__export({
|
|
10
|
+
appDistribution: () => require_v2_providers_alerts_appDistribution.appDistribution_exports,
|
|
11
|
+
billing: () => require_v2_providers_alerts_billing.billing_exports,
|
|
12
|
+
convertAlertAndApp: () => require_v2_providers_alerts_alerts.convertAlertAndApp,
|
|
13
|
+
crashlytics: () => require_v2_providers_alerts_crashlytics.crashlytics_exports,
|
|
14
|
+
eventType: () => require_v2_providers_alerts_alerts.eventType,
|
|
15
|
+
getEndpointAnnotation: () => require_v2_providers_alerts_alerts.getEndpointAnnotation,
|
|
16
|
+
getOptsAndAlertTypeAndApp: () => require_v2_providers_alerts_alerts.getOptsAndAlertTypeAndApp,
|
|
17
|
+
onAlertPublished: () => require_v2_providers_alerts_alerts.onAlertPublished,
|
|
18
|
+
performance: () => require_v2_providers_alerts_performance.performance_exports
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
//#endregion
|
|
22
|
+
Object.defineProperty(exports, 'alerts_exports', {
|
|
23
|
+
enumerable: true,
|
|
24
|
+
get: function () {
|
|
25
|
+
return alerts_exports;
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
Object.defineProperty(exports, 'appDistribution', {
|
|
29
|
+
enumerable: true,
|
|
30
|
+
get: function () {
|
|
31
|
+
return require_v2_providers_alerts_appDistribution.appDistribution_exports;
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
Object.defineProperty(exports, 'billing', {
|
|
35
|
+
enumerable: true,
|
|
36
|
+
get: function () {
|
|
37
|
+
return require_v2_providers_alerts_billing.billing_exports;
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
exports.convertAlertAndApp = require_v2_providers_alerts_alerts.convertAlertAndApp;
|
|
41
|
+
Object.defineProperty(exports, 'crashlytics', {
|
|
42
|
+
enumerable: true,
|
|
43
|
+
get: function () {
|
|
44
|
+
return require_v2_providers_alerts_crashlytics.crashlytics_exports;
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
exports.eventType = require_v2_providers_alerts_alerts.eventType;
|
|
48
|
+
exports.getEndpointAnnotation = require_v2_providers_alerts_alerts.getEndpointAnnotation;
|
|
49
|
+
exports.getOptsAndAlertTypeAndApp = require_v2_providers_alerts_alerts.getOptsAndAlertTypeAndApp;
|
|
50
|
+
exports.onAlertPublished = require_v2_providers_alerts_alerts.onAlertPublished;
|
|
51
|
+
Object.defineProperty(exports, 'performance', {
|
|
52
|
+
enumerable: true,
|
|
53
|
+
get: function () {
|
|
54
|
+
return require_v2_providers_alerts_performance.performance_exports;
|
|
55
|
+
}
|
|
56
|
+
});
|
|
@@ -1,85 +1,75 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
// The above copyright notice and this permission notice shall be included in all
|
|
14
|
-
// copies or substantial portions of the Software.
|
|
15
|
-
//
|
|
16
|
-
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
-
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
-
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
-
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
-
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
-
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
-
// SOFTWARE.
|
|
23
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
|
-
exports.convertPayload = exports.getOptsAndApp = exports.onThresholdAlertPublished = exports.thresholdAlert = void 0;
|
|
25
|
-
/**
|
|
26
|
-
* Cloud functions to handle Firebase Performance Monitoring events from Firebase Alerts.
|
|
27
|
-
* @packageDocumentation
|
|
28
|
-
*/
|
|
29
|
-
const onInit_1 = require("../../../common/onInit");
|
|
30
|
-
const trace_1 = require("../../trace");
|
|
31
|
-
const alerts_1 = require("./alerts");
|
|
1
|
+
const require_rolldown_runtime = require('../../../_virtual/rolldown_runtime.js');
|
|
2
|
+
const require_common_onInit = require('../../../common/onInit.js');
|
|
3
|
+
const require_v2_trace = require('../../trace.js');
|
|
4
|
+
const require_v2_providers_alerts_alerts = require('./alerts.js');
|
|
5
|
+
|
|
6
|
+
//#region src/v2/providers/alerts/performance.ts
|
|
7
|
+
var performance_exports = /* @__PURE__ */ require_rolldown_runtime.__export({
|
|
8
|
+
convertPayload: () => convertPayload,
|
|
9
|
+
getOptsAndApp: () => getOptsAndApp,
|
|
10
|
+
onThresholdAlertPublished: () => onThresholdAlertPublished,
|
|
11
|
+
thresholdAlert: () => thresholdAlert
|
|
12
|
+
});
|
|
32
13
|
/** @internal */
|
|
33
|
-
|
|
14
|
+
const thresholdAlert = "performance.threshold";
|
|
34
15
|
/**
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
16
|
+
* Declares a function that can handle receiving performance threshold alerts.
|
|
17
|
+
* @param appIdOrOptsOrHandler - A specific application, options, or an event-handling function.
|
|
18
|
+
* @param handler - Event handler which is run every time a threshold alert is received.
|
|
19
|
+
* @returns A function that you can export and deploy.
|
|
20
|
+
*/
|
|
40
21
|
function onThresholdAlertPublished(appIdOrOptsOrHandler, handler) {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
22
|
+
if (typeof appIdOrOptsOrHandler === "function") {
|
|
23
|
+
handler = appIdOrOptsOrHandler;
|
|
24
|
+
appIdOrOptsOrHandler = {};
|
|
25
|
+
}
|
|
26
|
+
const [opts, appId] = getOptsAndApp(appIdOrOptsOrHandler);
|
|
27
|
+
const func = (raw) => {
|
|
28
|
+
const event = require_v2_providers_alerts_alerts.convertAlertAndApp(raw);
|
|
29
|
+
const convertedPayload = convertPayload(event.data.payload);
|
|
30
|
+
event.data.payload = convertedPayload;
|
|
31
|
+
return require_v2_trace.wrapTraceContext(require_common_onInit.withInit(handler(event)));
|
|
32
|
+
};
|
|
33
|
+
func.run = handler;
|
|
34
|
+
func.__endpoint = require_v2_providers_alerts_alerts.getEndpointAnnotation(opts, thresholdAlert, appId);
|
|
35
|
+
return func;
|
|
55
36
|
}
|
|
56
|
-
exports.onThresholdAlertPublished = onThresholdAlertPublished;
|
|
57
37
|
/**
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
38
|
+
* Helper function to parse the function opts and appId.
|
|
39
|
+
* @internal
|
|
40
|
+
*/
|
|
61
41
|
function getOptsAndApp(appIdOrOpts) {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
42
|
+
if (typeof appIdOrOpts === "string") {
|
|
43
|
+
return [{}, appIdOrOpts];
|
|
44
|
+
}
|
|
45
|
+
const opts = { ...appIdOrOpts };
|
|
46
|
+
const appId = appIdOrOpts.appId;
|
|
47
|
+
delete opts.appId;
|
|
48
|
+
return [opts, appId];
|
|
69
49
|
}
|
|
70
|
-
exports.getOptsAndApp = getOptsAndApp;
|
|
71
50
|
/**
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
51
|
+
* Helper function to convert the raw payload of a {@link PerformanceEvent} to a {@link ThresholdAlertPayload}
|
|
52
|
+
* @internal
|
|
53
|
+
*/
|
|
75
54
|
function convertPayload(raw) {
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
55
|
+
const payload = { ...raw };
|
|
56
|
+
if (typeof payload.conditionPercentile !== "undefined" && payload.conditionPercentile === 0) {
|
|
57
|
+
delete payload.conditionPercentile;
|
|
58
|
+
}
|
|
59
|
+
if (typeof payload.appVersion !== "undefined" && payload.appVersion.length === 0) {
|
|
60
|
+
delete payload.appVersion;
|
|
61
|
+
}
|
|
62
|
+
return payload;
|
|
84
63
|
}
|
|
64
|
+
|
|
65
|
+
//#endregion
|
|
85
66
|
exports.convertPayload = convertPayload;
|
|
67
|
+
exports.getOptsAndApp = getOptsAndApp;
|
|
68
|
+
exports.onThresholdAlertPublished = onThresholdAlertPublished;
|
|
69
|
+
Object.defineProperty(exports, 'performance_exports', {
|
|
70
|
+
enumerable: true,
|
|
71
|
+
get: function () {
|
|
72
|
+
return performance_exports;
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
exports.thresholdAlert = thresholdAlert;
|