@dereekb/firebase-server 11.1.8 → 12.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +13 -0
- package/mailgun/package.json +3 -2
- package/mailgun/src/lib/auth.mailgun.js.map +1 -1
- package/model/package.json +3 -2
- package/model/src/lib/mailgun/notification.send.service.mailgun.js +2 -2
- package/model/src/lib/mailgun/notification.send.service.mailgun.js.map +1 -1
- package/model/src/lib/notification/notification.action.init.server.js +14 -12
- package/model/src/lib/notification/notification.action.init.server.js.map +1 -1
- package/model/src/lib/notification/notification.action.server.js +20 -18
- package/model/src/lib/notification/notification.action.server.js.map +1 -1
- package/model/src/lib/notification/notification.config.service.js +4 -3
- package/model/src/lib/notification/notification.config.service.js.map +1 -1
- package/model/src/lib/notification/notification.error.d.ts +9 -9
- package/model/src/lib/notification/notification.error.js +9 -10
- package/model/src/lib/notification/notification.error.js.map +1 -1
- package/model/src/lib/notification/notification.module.d.ts +11 -11
- package/model/src/lib/notification/notification.module.js +4 -5
- package/model/src/lib/notification/notification.module.js.map +1 -1
- package/model/src/lib/notification/notification.send.service.notificationsummary.js +1 -2
- package/model/src/lib/notification/notification.send.service.notificationsummary.js.map +1 -1
- package/model/src/lib/notification/notification.send.service.text.js +1 -2
- package/model/src/lib/notification/notification.send.service.text.js.map +1 -1
- package/model/src/lib/notification/notification.util.js +7 -8
- package/model/src/lib/notification/notification.util.js.map +1 -1
- package/package.json +9 -9
- package/src/lib/auth/auth.context.js +1 -2
- package/src/lib/auth/auth.context.js.map +1 -1
- package/src/lib/auth/auth.service.d.ts +3 -3
- package/src/lib/auth/auth.service.js +2 -2
- package/src/lib/auth/auth.service.js.map +1 -1
- package/src/lib/auth/auth.util.js +1 -2
- package/src/lib/auth/auth.util.js.map +1 -1
- package/src/lib/firestore/driver.accessor.batch.js +3 -3
- package/src/lib/firestore/driver.accessor.batch.js.map +1 -1
- package/src/lib/firestore/driver.accessor.default.js +3 -3
- package/src/lib/firestore/driver.accessor.default.js.map +1 -1
- package/src/lib/firestore/driver.accessor.js +3 -4
- package/src/lib/firestore/driver.accessor.js.map +1 -1
- package/src/lib/firestore/driver.accessor.transaction.js +3 -3
- package/src/lib/firestore/driver.accessor.transaction.js.map +1 -1
- package/src/lib/firestore/driver.js +1 -2
- package/src/lib/firestore/driver.js.map +1 -1
- package/src/lib/firestore/driver.query.js +3 -3
- package/src/lib/firestore/driver.query.js.map +1 -1
- package/src/lib/firestore/increment.js +1 -2
- package/src/lib/firestore/increment.js.map +1 -1
- package/src/lib/function/assert.d.ts +2 -2
- package/src/lib/function/assert.js +4 -5
- package/src/lib/function/assert.js.map +1 -1
- package/src/lib/function/context.d.ts +4 -4
- package/src/lib/function/context.js +2 -3
- package/src/lib/function/context.js.map +1 -1
- package/src/lib/function/error.auth.d.ts +1 -1
- package/src/lib/function/error.auth.js +3 -3
- package/src/lib/function/error.auth.js.map +1 -1
- package/src/lib/function/error.d.ts +1 -1
- package/src/lib/function/error.js +33 -33
- package/src/lib/function/error.js.map +1 -1
- package/src/lib/function/type.d.ts +4 -0
- package/src/lib/nest/app.d.ts +7 -5
- package/src/lib/nest/app.js +2 -2
- package/src/lib/nest/app.js.map +1 -1
- package/src/lib/nest/auth/auth.module.js +5 -4
- package/src/lib/nest/auth/auth.module.js.map +1 -1
- package/src/lib/nest/auth/auth.util.js +14 -15
- package/src/lib/nest/auth/auth.util.js.map +1 -1
- package/src/lib/nest/development/development.app.function.js +1 -2
- package/src/lib/nest/development/development.app.function.js.map +1 -1
- package/src/lib/nest/development/development.function.d.ts +2 -2
- package/src/lib/nest/development/development.function.js +2 -3
- package/src/lib/nest/development/development.function.js.map +1 -1
- package/src/lib/nest/development/development.schedule.function.error.d.ts +3 -3
- package/src/lib/nest/development/development.schedule.function.error.js +4 -4
- package/src/lib/nest/development/development.schedule.function.error.js.map +1 -1
- package/src/lib/nest/development/development.schedule.function.js +1 -2
- package/src/lib/nest/development/development.schedule.function.js.map +1 -1
- package/src/lib/nest/env/env.service.d.ts +1 -1
- package/src/lib/nest/env/env.service.js +2 -1
- package/src/lib/nest/env/env.service.js.map +1 -1
- package/src/lib/nest/env/env.util.js +2 -3
- package/src/lib/nest/env/env.util.js.map +1 -1
- package/src/lib/nest/firebase/firebase.module.js +2 -2
- package/src/lib/nest/firebase/firebase.module.js.map +1 -1
- package/src/lib/nest/firestore/firestore.module.js +7 -5
- package/src/lib/nest/firestore/firestore.module.js.map +1 -1
- package/src/lib/nest/function/call.js +2 -3
- package/src/lib/nest/function/call.js.map +1 -1
- package/src/lib/nest/function/context.d.ts +1 -1
- package/src/lib/nest/function/context.js +6 -6
- package/src/lib/nest/function/context.js.map +1 -1
- package/src/lib/nest/function/nest.js +2 -3
- package/src/lib/nest/function/nest.js.map +1 -1
- package/src/lib/nest/function/schedule.js +1 -2
- package/src/lib/nest/function/schedule.js.map +1 -1
- package/src/lib/nest/function/v1/call.d.ts +29 -1
- package/src/lib/nest/function/v1/call.js +21 -5
- package/src/lib/nest/function/v1/call.js.map +1 -1
- package/src/lib/nest/function/v1/event.d.ts +39 -2
- package/src/lib/nest/function/v1/event.js +6 -3
- package/src/lib/nest/function/v1/event.js.map +1 -1
- package/src/lib/nest/function/v1/schedule.d.ts +19 -1
- package/src/lib/nest/function/v1/schedule.js +15 -5
- package/src/lib/nest/function/v1/schedule.js.map +1 -1
- package/src/lib/nest/function/v2/blocking.d.ts +33 -7
- package/src/lib/nest/function/v2/blocking.js +14 -2
- package/src/lib/nest/function/v2/blocking.js.map +1 -1
- package/src/lib/nest/function/v2/call.d.ts +9 -6
- package/src/lib/nest/function/v2/call.js +8 -9
- package/src/lib/nest/function/v2/call.js.map +1 -1
- package/src/lib/nest/function/v2/event.d.ts +14 -6
- package/src/lib/nest/function/v2/event.js +1 -2
- package/src/lib/nest/function/v2/event.js.map +1 -1
- package/src/lib/nest/function/v2/schedule.d.ts +8 -5
- package/src/lib/nest/function/v2/schedule.js +5 -6
- package/src/lib/nest/function/v2/schedule.js.map +1 -1
- package/src/lib/nest/function/v2/taskqueue.js +1 -2
- package/src/lib/nest/function/v2/taskqueue.js.map +1 -1
- package/src/lib/nest/middleware/appcheck.middleware.js +4 -3
- package/src/lib/nest/middleware/appcheck.middleware.js.map +1 -1
- package/src/lib/nest/middleware/appcheck.module.js +2 -1
- package/src/lib/nest/middleware/appcheck.module.js.map +1 -1
- package/src/lib/nest/middleware/rawbody.middleware.js +2 -1
- package/src/lib/nest/middleware/rawbody.middleware.js.map +1 -1
- package/src/lib/nest/middleware/webhook.js +2 -1
- package/src/lib/nest/middleware/webhook.js.map +1 -1
- package/src/lib/nest/model/call.model.function.d.ts +1 -1
- package/src/lib/nest/model/call.model.function.js +4 -5
- package/src/lib/nest/model/call.model.function.js.map +1 -1
- package/src/lib/nest/model/create.model.function.d.ts +1 -1
- package/src/lib/nest/model/create.model.function.js +4 -5
- package/src/lib/nest/model/create.model.function.js.map +1 -1
- package/src/lib/nest/model/delete.model.function.d.ts +1 -1
- package/src/lib/nest/model/delete.model.function.js +4 -5
- package/src/lib/nest/model/delete.model.function.js.map +1 -1
- package/src/lib/nest/model/read.model.function.d.ts +1 -1
- package/src/lib/nest/model/read.model.function.js +4 -5
- package/src/lib/nest/model/read.model.function.js.map +1 -1
- package/src/lib/nest/model/specifier.function.d.ts +1 -1
- package/src/lib/nest/model/specifier.function.js +4 -5
- package/src/lib/nest/model/specifier.function.js.map +1 -1
- package/src/lib/nest/model/update.model.function.d.ts +1 -1
- package/src/lib/nest/model/update.model.function.js +4 -5
- package/src/lib/nest/model/update.model.function.js.map +1 -1
- package/src/lib/nest/storage/storage.module.js +9 -7
- package/src/lib/nest/storage/storage.module.js.map +1 -1
- package/src/lib/storage/driver.accessor.d.ts +1 -1
- package/src/lib/storage/driver.accessor.js +7 -7
- package/src/lib/storage/driver.accessor.js.map +1 -1
- package/src/lib/storage/driver.js +1 -2
- package/src/lib/storage/driver.js.map +1 -1
- package/src/lib/storage/storage.js +2 -2
- package/src/lib/storage/storage.js.map +1 -1
- package/test/package.json +3 -2
- package/test/src/lib/firebase/firebase.admin.auth.d.ts +53 -5
- package/test/src/lib/firebase/firebase.admin.auth.js +38 -10
- package/test/src/lib/firebase/firebase.admin.auth.js.map +1 -1
- package/test/src/lib/firebase/firebase.admin.collection.js +2 -2
- package/test/src/lib/firebase/firebase.admin.collection.js.map +1 -1
- package/test/src/lib/firebase/firebase.admin.function.js +7 -5
- package/test/src/lib/firebase/firebase.admin.function.js.map +1 -1
- package/test/src/lib/firebase/firebase.admin.js +3 -3
- package/test/src/lib/firebase/firebase.admin.js.map +1 -1
- package/test/src/lib/firebase/firebase.admin.nest.function.callable.context.d.ts +40 -0
- package/test/src/lib/firebase/firebase.admin.nest.function.callable.context.js +42 -0
- package/test/src/lib/firebase/firebase.admin.nest.function.callable.context.js.map +1 -0
- package/test/src/lib/firebase/firebase.admin.nest.function.cloud.context.d.ts +44 -0
- package/test/src/lib/firebase/{firebase.admin.nest.function.context.js → firebase.admin.nest.function.cloud.context.js} +4 -7
- package/test/src/lib/firebase/firebase.admin.nest.function.cloud.context.js.map +1 -0
- package/test/src/lib/firebase/firebase.admin.nest.function.d.ts +13 -9
- package/test/src/lib/firebase/firebase.admin.nest.function.js +15 -5
- package/test/src/lib/firebase/firebase.admin.nest.function.js.map +1 -1
- package/test/src/lib/firebase/firebase.admin.nest.js +4 -4
- package/test/src/lib/firebase/firebase.admin.nest.js.map +1 -1
- package/test/src/lib/firebase/firebase.admin.test.server.js +2 -3
- package/test/src/lib/firebase/firebase.admin.test.server.js.map +1 -1
- package/test/src/lib/firebase/firebase.function.d.ts +89 -9
- package/test/src/lib/firebase/firebase.function.js +40 -17
- package/test/src/lib/firebase/firebase.function.js.map +1 -1
- package/test/src/lib/firebase/firebase.jest.js +2 -2
- package/test/src/lib/firebase/firebase.jest.js.map +1 -1
- package/test/src/lib/firebase/firebase.js +7 -8
- package/test/src/lib/firebase/firebase.js.map +1 -1
- package/test/src/lib/firebase/index.d.ts +2 -1
- package/test/src/lib/firebase/index.js +2 -1
- package/test/src/lib/firebase/index.js.map +1 -1
- package/test/src/lib/firestore/firestore.js +2 -2
- package/test/src/lib/firestore/firestore.js.map +1 -1
- package/test/src/lib/storage/storage.js +2 -2
- package/test/src/lib/storage/storage.js.map +1 -1
- package/zoho/package.json +3 -2
- package/zoho/src/lib/zoho.accounts.firebase.js +1 -2
- package/zoho/src/lib/zoho.accounts.firebase.js.map +1 -1
- package/zoho/src/lib/zoho.accounts.firebase.system.js +3 -3
- package/zoho/src/lib/zoho.accounts.firebase.system.js.map +1 -1
- package/test/src/lib/firebase/firebase.admin.nest.function.context.d.ts +0 -39
- package/test/src/lib/firebase/firebase.admin.nest.function.context.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nest.js","sourceRoot":"","sources":["../../../../../../../packages/firebase-server/src/lib/nest/function/nest.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"nest.js","sourceRoot":"","sources":["../../../../../../../packages/firebase-server/src/lib/nest/function/nest.ts"],"names":[],"mappings":";;AAgBA,sDAKC;AAED,0FAKC;AAZD,SAAgB,qBAAqB,CAAO,IAAO,EAAE,OAAU;IAC7D,OAAO;QACL,GAAG,OAAO;QACV,IAAI;KACL,CAAC;AACJ,CAAC;AAED,SAAgB,uCAAuC,CAAI,WAAoC,EAAE,OAAU;IACzG,OAAO;QACL,GAAG,OAAO;QACV,eAAe,EAAE,WAAW;KAC7B,CAAC;AACJ,CAAC"}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.setNestContextOnScheduleRequest =
|
|
3
|
+
exports.setNestContextOnScheduleRequest = setNestContextOnScheduleRequest;
|
|
4
4
|
function setNestContextOnScheduleRequest(makeNestContext, request) {
|
|
5
5
|
request.nest = makeNestContext(request.nestApplication);
|
|
6
6
|
return request;
|
|
7
7
|
}
|
|
8
|
-
exports.setNestContextOnScheduleRequest = setNestContextOnScheduleRequest;
|
|
9
8
|
//# sourceMappingURL=schedule.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schedule.js","sourceRoot":"","sources":["../../../../../../../packages/firebase-server/src/lib/nest/function/schedule.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"schedule.js","sourceRoot":"","sources":["../../../../../../../packages/firebase-server/src/lib/nest/function/schedule.ts"],"names":[],"mappings":";;AA+DA,0EAGC;AAHD,SAAgB,+BAA+B,CAAO,eAAmC,EAAE,OAAgD;IACxI,OAA2E,CAAC,IAAI,GAAG,eAAe,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC;IAC7H,OAAO,OAA4D,CAAC;AACtE,CAAC"}
|
|
@@ -1,29 +1,57 @@
|
|
|
1
|
-
import * as functions from 'firebase-functions';
|
|
1
|
+
import * as functions from 'firebase-functions/v1';
|
|
2
2
|
import { type INestApplicationContext } from '@nestjs/common';
|
|
3
3
|
import { type RunnableHttpFunction } from '../../../function/type';
|
|
4
4
|
import { type MakeNestContext, type NestApplicationFunctionFactory } from '../../nest.provider';
|
|
5
5
|
import { type OnCallWithNestApplication, type OnCallWithNestApplicationRequest, type OnCallWithNestContext } from '../call';
|
|
6
|
+
/**
|
|
7
|
+
* @deprecated deprecated gen 1 firebase function type
|
|
8
|
+
*
|
|
9
|
+
* @param nestApplication
|
|
10
|
+
* @param data
|
|
11
|
+
* @param context
|
|
12
|
+
* @returns
|
|
13
|
+
*/
|
|
6
14
|
export declare function makeOnCallWithNestApplicationRequest<I>(nestApplication: INestApplicationContext, data: I, context: functions.https.CallableContext): OnCallWithNestApplicationRequest<I>;
|
|
15
|
+
/**
|
|
16
|
+
* @deprecated deprecated gen 1 firebase function type
|
|
17
|
+
*
|
|
18
|
+
* @see NestApplicationCallableHttpFunctionFactory
|
|
19
|
+
*/
|
|
7
20
|
export type NestApplicationRunnableHttpFunctionFactory<I> = NestApplicationFunctionFactory<RunnableHttpFunction<I>>;
|
|
8
21
|
/**
|
|
9
22
|
* Factory function for generating a NestApplicationFunctionFactory for a HttpsFunctions/Runnable firebase function.
|
|
23
|
+
*
|
|
24
|
+
* @deprecated deprecated gen 1 firebase function type
|
|
10
25
|
*/
|
|
11
26
|
export type OnCallWithNestApplicationFactory = <I = unknown, O = unknown>(fn: OnCallWithNestApplication<I, O>) => NestApplicationRunnableHttpFunctionFactory<I>;
|
|
27
|
+
/**
|
|
28
|
+
* @deprecated deprecated gen 1 firebase function type
|
|
29
|
+
*/
|
|
12
30
|
export type OnCallWithNestApplicationFactoryConfigFunctionBuilderFunction = (builder: functions.FunctionBuilder) => functions.FunctionBuilder;
|
|
13
31
|
/**
|
|
14
32
|
* Creates a factory for generating OnCallWithNestApplication functions.
|
|
15
33
|
*
|
|
34
|
+
* @deprecated move to firebase-functions v2 implementation that uses onCallHandlerWithNestApplicationFactory() instead.
|
|
35
|
+
*
|
|
36
|
+
* @see onCallHandlerWithNestApplicationFactory()
|
|
37
|
+
*
|
|
16
38
|
* @param nestAppPromiseGetter
|
|
17
39
|
* @returns
|
|
18
40
|
*/
|
|
19
41
|
export declare function onCallWithNestApplicationFactory(builderFunction?: OnCallWithNestApplicationFactoryConfigFunctionBuilderFunction): OnCallWithNestApplicationFactory;
|
|
20
42
|
/**
|
|
21
43
|
* Factory function for generating HttpsFunctions/Runnable firebase function that returns the value from the input OnCallWithNestContext function.
|
|
44
|
+
*
|
|
45
|
+
* @deprecated deprecated gen 1 firebase function type
|
|
22
46
|
*/
|
|
23
47
|
export type OnCallWithNestContextFactory<N> = <I = unknown, O = unknown>(fn: OnCallWithNestContext<N, I, O>) => NestApplicationRunnableHttpFunctionFactory<I>;
|
|
24
48
|
/**
|
|
25
49
|
* Creates a factory for generating OnCallWithNestContext functions with a nest context object that is generated by the input function.
|
|
26
50
|
*
|
|
51
|
+
* @deprecated move to firebase-functions v2 implementation that uses onCallHandlerWithNestContextFactory() instead.
|
|
52
|
+
*
|
|
53
|
+
* @see onCallHandlerWithNestContextFactory()
|
|
54
|
+
*
|
|
27
55
|
* @param appFactory
|
|
28
56
|
* @param makeNestContext
|
|
29
57
|
* @returns
|
|
@@ -1,20 +1,34 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
|
|
3
|
+
exports.makeOnCallWithNestApplicationRequest = makeOnCallWithNestApplicationRequest;
|
|
4
|
+
exports.onCallWithNestApplicationFactory = onCallWithNestApplicationFactory;
|
|
5
|
+
exports.onCallWithNestContextFactory = onCallWithNestContextFactory;
|
|
6
|
+
const functions = require("firebase-functions/v1");
|
|
5
7
|
const call_1 = require("../call");
|
|
6
8
|
const util_1 = require("@dereekb/util");
|
|
9
|
+
/**
|
|
10
|
+
* @deprecated deprecated gen 1 firebase function type
|
|
11
|
+
*
|
|
12
|
+
* @param nestApplication
|
|
13
|
+
* @param data
|
|
14
|
+
* @param context
|
|
15
|
+
* @returns
|
|
16
|
+
*/
|
|
7
17
|
function makeOnCallWithNestApplicationRequest(nestApplication, data, context) {
|
|
8
18
|
return {
|
|
9
19
|
...context,
|
|
20
|
+
acceptsStreaming: false,
|
|
10
21
|
nestApplication,
|
|
11
22
|
data
|
|
12
23
|
};
|
|
13
24
|
}
|
|
14
|
-
exports.makeOnCallWithNestApplicationRequest = makeOnCallWithNestApplicationRequest;
|
|
15
25
|
/**
|
|
16
26
|
* Creates a factory for generating OnCallWithNestApplication functions.
|
|
17
27
|
*
|
|
28
|
+
* @deprecated move to firebase-functions v2 implementation that uses onCallHandlerWithNestApplicationFactory() instead.
|
|
29
|
+
*
|
|
30
|
+
* @see onCallHandlerWithNestApplicationFactory()
|
|
31
|
+
*
|
|
18
32
|
* @param nestAppPromiseGetter
|
|
19
33
|
* @returns
|
|
20
34
|
*/
|
|
@@ -24,10 +38,13 @@ function onCallWithNestApplicationFactory(builderFunction = (0, util_1.mapIdenti
|
|
|
24
38
|
return (nestAppPromiseGetter) => functionsBuilder.https.onCall((data, context) => nestAppPromiseGetter().then((x) => fn(makeOnCallWithNestApplicationRequest(x, data, context))));
|
|
25
39
|
};
|
|
26
40
|
}
|
|
27
|
-
exports.onCallWithNestApplicationFactory = onCallWithNestApplicationFactory;
|
|
28
41
|
/**
|
|
29
42
|
* Creates a factory for generating OnCallWithNestContext functions with a nest context object that is generated by the input function.
|
|
30
43
|
*
|
|
44
|
+
* @deprecated move to firebase-functions v2 implementation that uses onCallHandlerWithNestContextFactory() instead.
|
|
45
|
+
*
|
|
46
|
+
* @see onCallHandlerWithNestContextFactory()
|
|
47
|
+
*
|
|
31
48
|
* @param appFactory
|
|
32
49
|
* @param makeNestContext
|
|
33
50
|
* @returns
|
|
@@ -35,5 +52,4 @@ exports.onCallWithNestApplicationFactory = onCallWithNestApplicationFactory;
|
|
|
35
52
|
function onCallWithNestContextFactory(appFactory, makeNestContext) {
|
|
36
53
|
return (fn) => appFactory((request) => fn((0, call_1.setNestContextOnRequest)(makeNestContext, request)));
|
|
37
54
|
}
|
|
38
|
-
exports.onCallWithNestContextFactory = onCallWithNestContextFactory;
|
|
39
55
|
//# sourceMappingURL=call.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"call.js","sourceRoot":"","sources":["../../../../../../../../packages/firebase-server/src/lib/nest/function/v1/call.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"call.js","sourceRoot":"","sources":["../../../../../../../../packages/firebase-server/src/lib/nest/function/v1/call.ts"],"names":[],"mappings":";;AAeA,oFAOC;AAgCD,4EAKC;AAoBD,oEAEC;AAjFD,mDAAmD;AAInD,kCAAqJ;AACrJ,wCAAoD;AAEpD;;;;;;;GAOG;AACH,SAAgB,oCAAoC,CAAI,eAAwC,EAAE,IAAO,EAAE,OAAwC;IACjJ,OAAO;QACL,GAAG,OAAO;QACV,gBAAgB,EAAE,KAAK;QACvB,eAAe;QACf,IAAI;KACL,CAAC;AACJ,CAAC;AAsBD;;;;;;;;;GASG;AACH,SAAgB,gCAAgC,CAAC,kBAAiF,IAAA,0BAAmB,GAAE;IACrJ,MAAM,gBAAgB,GAAG,eAAe,CAAC,SAAS,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC;IAChE,OAAO,CAAO,EAAmC,EAAE,EAAE;QACnD,OAAO,CAAC,oBAAkD,EAAE,EAAE,CAAC,gBAAgB,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,IAAO,EAAE,OAAwC,EAAE,EAAE,CAAC,oBAAoB,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC,oCAAoC,CAAC,CAAC,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;IACtP,CAAC,CAAC;AACJ,CAAC;AASD;;;;;;;;;;GAUG;AACH,SAAgB,4BAA4B,CAAI,UAA4C,EAAE,eAAmC;IAC/H,OAAO,CAAO,EAAkC,EAAE,EAAE,CAAC,UAAU,CAAO,CAAC,OAAO,EAAE,EAAE,CAAC,EAAE,CAAC,IAAA,8BAAuB,EAAC,eAAe,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC;AAC5I,CAAC"}
|
|
@@ -1,41 +1,78 @@
|
|
|
1
1
|
import { type PromiseOrValue } from '@dereekb/util';
|
|
2
|
-
import type * as functions from 'firebase-functions';
|
|
3
|
-
import { type EventContext } from 'firebase-functions';
|
|
2
|
+
import type * as functions from 'firebase-functions/v1';
|
|
3
|
+
import { type EventContext } from 'firebase-functions/v1';
|
|
4
4
|
import { type MakeNestContext, type NestApplicationFunctionFactory } from '../../nest.provider';
|
|
5
5
|
import { type NestApplicationContextRequest, type NestContextRequest } from '../nest';
|
|
6
|
+
/**
|
|
7
|
+
* @deprecated deprecated gen 1 firebase function type
|
|
8
|
+
*/
|
|
6
9
|
export type EventContextWithData<I> = EventContext & {
|
|
7
10
|
data: I;
|
|
8
11
|
};
|
|
12
|
+
/**
|
|
13
|
+
* @deprecated deprecated gen 1 firebase function type
|
|
14
|
+
*/
|
|
9
15
|
export type FirebaseEventNestApplicationRequest<I> = NestApplicationContextRequest<EventContextWithData<I>>;
|
|
16
|
+
/**
|
|
17
|
+
* @deprecated deprecated gen 1 firebase function type
|
|
18
|
+
*/
|
|
10
19
|
export type FirebaseEventNestContextRequest<N, I> = NestContextRequest<N, EventContextWithData<I>>;
|
|
20
|
+
/**
|
|
21
|
+
* @deprecated deprecated gen 1 firebase function type
|
|
22
|
+
*/
|
|
11
23
|
export type FirebaseEventContextHandler<I = unknown, O = unknown> = (data: I, context: EventContext) => PromiseOrValue<O>;
|
|
24
|
+
/**
|
|
25
|
+
* @deprecated deprecated gen 1 firebase function type
|
|
26
|
+
*/
|
|
12
27
|
export type NestApplicationEventHandler<I = unknown, O = unknown> = (event: FirebaseEventNestApplicationRequest<I>) => PromiseOrValue<O>;
|
|
28
|
+
/**
|
|
29
|
+
* @deprecated deprecated gen 1 firebase function type
|
|
30
|
+
*/
|
|
13
31
|
export type NestApplicationEventHandlerBuilder<I = unknown, O = unknown> = (handler: NestApplicationEventHandler<I, O>) => FirebaseEventContextHandler<I, O>;
|
|
32
|
+
/**
|
|
33
|
+
* @deprecated deprecated gen 1 firebase function type
|
|
34
|
+
*/
|
|
14
35
|
export type OnEventWithNestApplicationBuilder<I = unknown, O = unknown> = (nest: NestApplicationEventHandlerBuilder<I, O>) => functions.CloudFunction<I>;
|
|
15
36
|
/**
|
|
37
|
+
* @deprecated deprecated gen 1 firebase function type
|
|
38
|
+
*
|
|
16
39
|
* Factory function for generating a CloudFunctionHandler via a NestApplicationCloudFunctionHandler.
|
|
17
40
|
*/
|
|
18
41
|
export type OnEventWithNestApplicationFactory = <I, O>(fn: OnEventWithNestApplicationBuilder<I, O>) => NestApplicationFunctionFactory<functions.CloudFunction<I>>;
|
|
19
42
|
/**
|
|
20
43
|
* Creates a factory for generating OnEventWithNestApplicationBuilder values.
|
|
21
44
|
*
|
|
45
|
+
* @deprecated deprecated gen 1 firebase function type
|
|
46
|
+
*
|
|
22
47
|
* @param nestAppPromiseGetter
|
|
23
48
|
* @returns
|
|
24
49
|
*/
|
|
25
50
|
export declare function onEventWithNestApplicationFactory(): OnEventWithNestApplicationFactory;
|
|
51
|
+
/**
|
|
52
|
+
* @deprecated deprecated gen 1 firebase function type
|
|
53
|
+
*/
|
|
26
54
|
export type NestContextEventHandler<N, I = unknown, O = unknown> = (request: FirebaseEventNestContextRequest<N, I>) => Promise<O>;
|
|
55
|
+
/**
|
|
56
|
+
* @deprecated deprecated gen 1 firebase function type
|
|
57
|
+
*/
|
|
27
58
|
export type NestContextEventHandlerBuilder<N, I = unknown, O = unknown> = (handler: NestContextEventHandler<N, I, O>) => FirebaseEventContextHandler<I, O>;
|
|
28
59
|
/**
|
|
29
60
|
* Runnable function that is passed an arbitrary nest context object in addition to the usual data/context provided by firebase.
|
|
61
|
+
*
|
|
62
|
+
* @deprecated deprecated gen 1 firebase function type
|
|
30
63
|
*/
|
|
31
64
|
export type OnEventWithNestContextBuilder<N, I = unknown, O = unknown> = (nest: NestContextEventHandlerBuilder<N, I, O>) => functions.CloudFunction<I>;
|
|
32
65
|
/**
|
|
33
66
|
* Factory function for generating a firebase CloudFunction for a specific event.
|
|
67
|
+
*
|
|
68
|
+
* @deprecated deprecated gen 1 firebase function type
|
|
34
69
|
*/
|
|
35
70
|
export type OnEventWithNestContextFactory<N> = <I, O = unknown>(fn: OnEventWithNestContextBuilder<N, I, O>) => NestApplicationFunctionFactory<functions.CloudFunction<I>>;
|
|
36
71
|
/**
|
|
37
72
|
* Creates a factory for generating OnCallWithNestContext functions with a nest context object that is generated by the input function.
|
|
38
73
|
*
|
|
74
|
+
* @deprecated deprecated gen 1 firebase function type
|
|
75
|
+
*
|
|
39
76
|
* @param appFactory
|
|
40
77
|
* @param makeNestContext
|
|
41
78
|
* @returns
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.onEventWithNestApplicationFactory = onEventWithNestApplicationFactory;
|
|
4
|
+
exports.onEventWithNestContextFactory = onEventWithNestContextFactory;
|
|
4
5
|
/**
|
|
5
6
|
* Creates a factory for generating OnEventWithNestApplicationBuilder values.
|
|
6
7
|
*
|
|
8
|
+
* @deprecated deprecated gen 1 firebase function type
|
|
9
|
+
*
|
|
7
10
|
* @param nestAppPromiseGetter
|
|
8
11
|
* @returns
|
|
9
12
|
*/
|
|
@@ -22,10 +25,11 @@ function onEventWithNestApplicationFactory() {
|
|
|
22
25
|
};
|
|
23
26
|
};
|
|
24
27
|
}
|
|
25
|
-
exports.onEventWithNestApplicationFactory = onEventWithNestApplicationFactory;
|
|
26
28
|
/**
|
|
27
29
|
* Creates a factory for generating OnCallWithNestContext functions with a nest context object that is generated by the input function.
|
|
28
30
|
*
|
|
31
|
+
* @deprecated deprecated gen 1 firebase function type
|
|
32
|
+
*
|
|
29
33
|
* @param appFactory
|
|
30
34
|
* @param makeNestContext
|
|
31
35
|
* @returns
|
|
@@ -45,5 +49,4 @@ function onEventWithNestContextFactory(makeNestContext) {
|
|
|
45
49
|
};
|
|
46
50
|
};
|
|
47
51
|
}
|
|
48
|
-
exports.onEventWithNestContextFactory = onEventWithNestContextFactory;
|
|
49
52
|
//# sourceMappingURL=event.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"event.js","sourceRoot":"","sources":["../../../../../../../../packages/firebase-server/src/lib/nest/function/v1/event.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"event.js","sourceRoot":"","sources":["../../../../../../../../packages/firebase-server/src/lib/nest/function/v1/event.ts"],"names":[],"mappings":";;AA2DA,8EAkBC;AAmCD,sEAmBC;AAhFD;;;;;;;GAOG;AACH,SAAgB,iCAAiC;IAC/C,OAAO,CAAO,EAA2C,EAAE,EAAE;QAC3D,OAAO,CAAC,oBAAkD,EAAE,EAAE;YAC5D,MAAM,cAAc,GAA6C,CAAC,OAAO,EAAE,EAAE;gBAC3E,MAAM,SAAS,GAAsC,CAAC,IAAI,EAAE,OAAO,EAAE,EAAE,CACrE,oBAAoB,EAAE,CAAC,IAAI,CAAC,CAAC,eAAe,EAAE,EAAE,CAC9C,OAAO,CAAC;oBACN,GAAG,OAAO;oBACV,IAAI;oBACJ,eAAe;iBAChB,CAAC,CACH,CAAC;gBACJ,OAAO,SAAS,CAAC;YACnB,CAAC,CAAC;YAEF,OAAO,EAAE,CAAC,cAAc,CAAC,CAAC;QAC5B,CAAC,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC;AA0BD;;;;;;;;GAQG;AACH,SAAgB,6BAA6B,CAAI,eAAmC;IAClF,OAAO,CAAiB,EAA0C,EAAE,EAAE;QACpE,OAAO,CAAC,oBAAkD,EAAE,EAAE;YAC5D,MAAM,cAAc,GAA4C,CAAC,OAAO,EAAE,EAAE;gBAC1E,MAAM,SAAS,GAAsC,CAAC,IAAI,EAAE,OAAO,EAAE,EAAE,CACrE,oBAAoB,EAAE,CAAC,IAAI,CAAC,CAAC,eAAe,EAAE,EAAE,CAC9C,OAAO,CAAC;oBACN,GAAG,OAAO;oBACV,IAAI;oBACJ,IAAI,EAAE,eAAe,CAAC,eAAe,CAAC;iBACvC,CAAC,CACH,CAAC;gBAEJ,OAAO,SAAS,CAAC;YACnB,CAAC,CAAC;YAEF,OAAO,EAAE,CAAC,cAAc,CAAC,CAAC;QAC5B,CAAC,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -1,27 +1,45 @@
|
|
|
1
|
-
import * as functions from 'firebase-functions';
|
|
1
|
+
import * as functions from 'firebase-functions/v1';
|
|
2
2
|
import { type INestApplicationContext } from '@nestjs/common';
|
|
3
3
|
import { type MakeNestContext } from '../../nest.provider';
|
|
4
4
|
import { type NestApplicationScheduleConfiguredFunctionFactory, type OnScheduleConfig, type OnScheduleWithNestApplication, type OnScheduleWithNestApplicationRequest, type OnScheduleWithNestContext } from '../schedule';
|
|
5
|
+
/**
|
|
6
|
+
* @deprecated deprecated gen 1 firebase function type
|
|
7
|
+
*
|
|
8
|
+
* @param nestApplication
|
|
9
|
+
* @param scheduleContext
|
|
10
|
+
* @returns
|
|
11
|
+
*/
|
|
5
12
|
export declare function makeOnScheduleWithNestApplicationRequest(nestApplication: INestApplicationContext, scheduleContext?: functions.EventContext): OnScheduleWithNestApplicationRequest<functions.EventContext>;
|
|
13
|
+
/**
|
|
14
|
+
* @deprecated deprecated gen 1 firebase function type
|
|
15
|
+
*/
|
|
6
16
|
export type NestApplicationScheduleCloudFunctionFactory<I = unknown> = NestApplicationScheduleConfiguredFunctionFactory<functions.CloudFunction<I>>;
|
|
7
17
|
/**
|
|
8
18
|
* Factory function for generating a NestApplicationFunctionFactory for a HttpsFunctions/Runnable firebase function.
|
|
19
|
+
*
|
|
20
|
+
* @deprecated deprecated gen 1 firebase function type
|
|
9
21
|
*/
|
|
10
22
|
export type OnScheduleWithNestApplicationFactory = (schedule: OnScheduleConfig, fn: OnScheduleWithNestApplication<functions.EventContext>) => NestApplicationScheduleCloudFunctionFactory;
|
|
11
23
|
/**
|
|
12
24
|
* Creates a factory for generating OnCallWithNestApplication functions.
|
|
13
25
|
*
|
|
26
|
+
* @deprecated deprecated gen 1 firebase function type
|
|
27
|
+
*
|
|
14
28
|
* @param nestAppPromiseGetter
|
|
15
29
|
* @returns
|
|
16
30
|
*/
|
|
17
31
|
export declare function onScheduleWithNestApplicationFactory(baseSchedule?: OnScheduleConfig): OnScheduleWithNestApplicationFactory;
|
|
18
32
|
/**
|
|
19
33
|
* Factory function for generating HttpsFunctions/Runnable firebase function that returns the value from the input OnCallWithNestContext function.
|
|
34
|
+
*
|
|
35
|
+
* @deprecated deprecated gen 1 firebase function type
|
|
20
36
|
*/
|
|
21
37
|
export type OnScheduleWithNestContextFactory<N> = (schedule: OnScheduleConfig, fn: OnScheduleWithNestContext<N, functions.EventContext>) => NestApplicationScheduleCloudFunctionFactory;
|
|
22
38
|
/**
|
|
23
39
|
* Creates a factory for generating OnCallWithNestContext functions with a nest context object that is generated by the input function.
|
|
24
40
|
*
|
|
41
|
+
* @deprecated deprecated gen 1 firebase function type
|
|
42
|
+
*
|
|
25
43
|
* @param appFactory
|
|
26
44
|
* @param makeNestContext
|
|
27
45
|
* @returns
|
|
@@ -1,19 +1,29 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
|
|
3
|
+
exports.makeOnScheduleWithNestApplicationRequest = makeOnScheduleWithNestApplicationRequest;
|
|
4
|
+
exports.onScheduleWithNestApplicationFactory = onScheduleWithNestApplicationFactory;
|
|
5
|
+
exports.onScheduleWithNestContextFactory = onScheduleWithNestContextFactory;
|
|
6
|
+
const functions = require("firebase-functions/v1");
|
|
5
7
|
const schedule_1 = require("../schedule");
|
|
6
8
|
const util_1 = require("@dereekb/util");
|
|
9
|
+
/**
|
|
10
|
+
* @deprecated deprecated gen 1 firebase function type
|
|
11
|
+
*
|
|
12
|
+
* @param nestApplication
|
|
13
|
+
* @param scheduleContext
|
|
14
|
+
* @returns
|
|
15
|
+
*/
|
|
7
16
|
function makeOnScheduleWithNestApplicationRequest(nestApplication, scheduleContext) {
|
|
8
17
|
return {
|
|
9
18
|
nestApplication,
|
|
10
19
|
scheduleContext
|
|
11
20
|
};
|
|
12
21
|
}
|
|
13
|
-
exports.makeOnScheduleWithNestApplicationRequest = makeOnScheduleWithNestApplicationRequest;
|
|
14
22
|
/**
|
|
15
23
|
* Creates a factory for generating OnCallWithNestApplication functions.
|
|
16
24
|
*
|
|
25
|
+
* @deprecated deprecated gen 1 firebase function type
|
|
26
|
+
*
|
|
17
27
|
* @param nestAppPromiseGetter
|
|
18
28
|
* @returns
|
|
19
29
|
*/
|
|
@@ -43,10 +53,11 @@ function onScheduleWithNestApplicationFactory(baseSchedule) {
|
|
|
43
53
|
};
|
|
44
54
|
};
|
|
45
55
|
}
|
|
46
|
-
exports.onScheduleWithNestApplicationFactory = onScheduleWithNestApplicationFactory;
|
|
47
56
|
/**
|
|
48
57
|
* Creates a factory for generating OnCallWithNestContext functions with a nest context object that is generated by the input function.
|
|
49
58
|
*
|
|
59
|
+
* @deprecated deprecated gen 1 firebase function type
|
|
60
|
+
*
|
|
50
61
|
* @param appFactory
|
|
51
62
|
* @param makeNestContext
|
|
52
63
|
* @returns
|
|
@@ -54,5 +65,4 @@ exports.onScheduleWithNestApplicationFactory = onScheduleWithNestApplicationFact
|
|
|
54
65
|
function onScheduleWithNestContextFactory(appFactory, makeNestContext) {
|
|
55
66
|
return (schedule, fn) => appFactory(schedule, (request) => fn((0, schedule_1.setNestContextOnScheduleRequest)(makeNestContext, request)));
|
|
56
67
|
}
|
|
57
|
-
exports.onScheduleWithNestContextFactory = onScheduleWithNestContextFactory;
|
|
58
68
|
//# sourceMappingURL=schedule.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schedule.js","sourceRoot":"","sources":["../../../../../../../../packages/firebase-server/src/lib/nest/function/v1/schedule.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"schedule.js","sourceRoot":"","sources":["../../../../../../../../packages/firebase-server/src/lib/nest/function/v1/schedule.ts"],"names":[],"mappings":";;AAcA,4FAKC;AA0BD,oFA2BC;AAkBD,4EAEC;AA5FD,mDAAmD;AAGnD,0CAA2S;AAC3S,wCAAwG;AAGxG;;;;;;GAMG;AACH,SAAgB,wCAAwC,CAAC,eAAwC,EAAE,eAAwC;IACzI,OAAO;QACL,eAAe;QACf,eAAe;KAChB,CAAC;AACJ,CAAC;AAkBD;;;;;;;GAOG;AACH,SAAgB,oCAAoC,CAAC,YAA+B;IAClF,OAAO,CAAO,aAA+B,EAAE,EAAyD,EAAE,EAAE;QAC1G,MAAM,QAAQ,GAAG,IAAA,mBAAY,EAAmB,CAAC,YAAY,EAAE,aAAa,CAAC,CAAqB,CAAC;QACnG,IAAI,IAAoB,CAAC;QAEzB,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;YACnB,MAAM,IAAI,KAAK,CAAC,qDAAqD,CAAC,CAAC;QACzE,CAAC;aAAM,IAAI,OAAO,QAAQ,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;YAC7C,IAAI,GAAG,IAAA,2CAAoC,EAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;QAC7D,CAAC;aAAM,CAAC;YACN,IAAI,GAAG,QAAQ,CAAC,IAAI,CAAC;QACvB,CAAC;QAED,OAAO,CAAC,oBAAkD,EAAE,EAAE;YAC5D,IAAI,OAAO,GAAG,SAAS,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;YAEpE,IAAI,QAAQ,CAAC,QAAQ,EAAE,CAAC;gBACtB,OAAO,GAAG,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;YAChD,CAAC;YAED,MAAM,MAAM,GAAG,CAAC,eAAwC,EAAE,EAAE,CAAC,oBAAoB,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC,wCAAwC,CAAC,CAAC,EAAE,eAAe,CAAC,CAAC,CAAC,CAAC;YAClK,MAAM,GAAG,GAAoG,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;YACnI,GAAG,CAAC,SAAS,GAAG,QAAQ,CAAC;YACzB,GAAG,CAAC,OAAO,GAAG,MAAM,CAAC;YACrB,OAAO,GAAkF,CAAC;QAC5F,CAAC,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC;AASD;;;;;;;;GAQG;AACH,SAAgB,gCAAgC,CAAI,UAAgD,EAAE,eAAmC;IACvI,OAAO,CAAC,QAA0B,EAAE,EAAwD,EAAE,EAAE,CAAC,UAAU,CAAC,QAAQ,EAAE,CAAC,OAAqE,EAAE,EAAE,CAAC,EAAE,CAAC,IAAA,0CAA+B,EAAC,eAAe,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC;AAClQ,CAAC"}
|
|
@@ -1,16 +1,42 @@
|
|
|
1
|
-
import { type PromiseOrValue } from '@dereekb/util';
|
|
2
|
-
import { type BlockingFunction } from 'firebase-functions';
|
|
1
|
+
import { type Maybe, type PromiseOrValue } from '@dereekb/util';
|
|
3
2
|
import { type MakeNestContext, type NestApplicationFunctionFactory } from '../../nest.provider';
|
|
4
3
|
import { type NestContextRequest } from '../nest';
|
|
4
|
+
import { type BlockingFunction } from 'firebase-functions/v1';
|
|
5
|
+
import { type BlockingOptions } from 'firebase-functions/identity';
|
|
5
6
|
export type BlockingFunctionNestContextRequest<N, E extends object> = NestContextRequest<N, E>;
|
|
6
|
-
export type BlockingFunctionHandler<E extends object, O
|
|
7
|
-
export type
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
export type BlockingFunctionHandler<E extends object, O> = (event: E) => PromiseOrValue<O | void>;
|
|
8
|
+
export type BlockingFunctionHandlerRef<E extends object, O> = {
|
|
9
|
+
__handler: BlockingFunctionHandler<E, O>;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* BlockingFunction extension that also contains the handler and typing info.
|
|
13
|
+
*/
|
|
14
|
+
export type BlockingFunctionWithHandler<E extends object, O> = BlockingFunction & BlockingFunctionHandlerRef<E, O>;
|
|
15
|
+
export type BlockingFunctionMaybeWithHandler<E extends object, O> = BlockingFunction & Partial<BlockingFunctionHandlerRef<E, O>>;
|
|
16
|
+
export interface BlockingFunctionBuilder<E extends object, O> {
|
|
17
|
+
(handler: (event: E) => PromiseOrValue<O | void>): BlockingFunction;
|
|
18
|
+
(opts: BlockingOptions, handler: (event: E) => PromiseOrValue<O | void>): BlockingFunction;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Creates a BlockingFunctionWithHandler from the input.
|
|
22
|
+
*
|
|
23
|
+
* @param blockingFunctionBuilder
|
|
24
|
+
* @param handler
|
|
25
|
+
* @returns
|
|
26
|
+
*/
|
|
27
|
+
export declare function makeBlockingFunctionWithHandler<E extends object, O>(blockingFunctionBuilder: BlockingFunctionBuilder<E, O>, handler: BlockingFunctionHandler<E, O>, opts?: Maybe<BlockingOptions>): BlockingFunctionWithHandler<E, O>;
|
|
28
|
+
export type NestContextBlockingFunctionHandler<N, E extends object, O> = (request: BlockingFunctionNestContextRequest<N, E>) => PromiseOrValue<O | void>;
|
|
29
|
+
export type NestContextBlockingFunctionHandlerBuilder<N, E extends object, O> = (handler: NestContextBlockingFunctionHandler<N, E, O>) => BlockingFunctionHandler<E, O>;
|
|
30
|
+
export type BlockingFunctionHandlerWithNestContextBuilder<N, E extends object, O> = (nest: NestContextBlockingFunctionHandlerBuilder<N, E, O>) => BlockingFunctionMaybeWithHandler<E, O>;
|
|
31
|
+
export type BlockingFunctionHandlerWithNestContextBuilderForBuilder<N, B extends BlockingFunctionBuilder<any, any>> = B extends BlockingFunctionBuilder<infer E, infer O> ? BlockingFunctionHandlerWithNestContextBuilder<N, E, O> : never;
|
|
32
|
+
/**
|
|
33
|
+
* Factory produced by BlockingFunctionHandlerWithNestContextFactory.
|
|
34
|
+
*/
|
|
35
|
+
export type NestApplicationBlockingFunctionFactory<E extends object, O> = NestApplicationFunctionFactory<BlockingFunctionMaybeWithHandler<E, O>>;
|
|
10
36
|
/**
|
|
11
37
|
* Factory function for generating a firebase BlockingFunction for a specific event.
|
|
12
38
|
*/
|
|
13
|
-
export type BlockingFunctionHandlerWithNestContextFactory<N> = <E extends object, O
|
|
39
|
+
export type BlockingFunctionHandlerWithNestContextFactory<N> = <E extends object, O>(fn: BlockingFunctionHandlerWithNestContextBuilder<N, E, O>) => NestApplicationBlockingFunctionFactory<E, O>;
|
|
14
40
|
/**
|
|
15
41
|
* Creates a BlockingFunctionHandlerWithNestContextFactory.
|
|
16
42
|
*
|
|
@@ -1,6 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.makeBlockingFunctionWithHandler = makeBlockingFunctionWithHandler;
|
|
4
|
+
exports.blockingFunctionHandlerWithNestContextFactory = blockingFunctionHandlerWithNestContextFactory;
|
|
5
|
+
/**
|
|
6
|
+
* Creates a BlockingFunctionWithHandler from the input.
|
|
7
|
+
*
|
|
8
|
+
* @param blockingFunctionBuilder
|
|
9
|
+
* @param handler
|
|
10
|
+
* @returns
|
|
11
|
+
*/
|
|
12
|
+
function makeBlockingFunctionWithHandler(blockingFunctionBuilder, handler, opts) {
|
|
13
|
+
const blockingFn = opts != null ? blockingFunctionBuilder(opts, handler) : blockingFunctionBuilder(handler);
|
|
14
|
+
blockingFn.__handler = handler;
|
|
15
|
+
return blockingFn;
|
|
16
|
+
}
|
|
4
17
|
/**
|
|
5
18
|
* Creates a BlockingFunctionHandlerWithNestContextFactory.
|
|
6
19
|
*
|
|
@@ -22,5 +35,4 @@ function blockingFunctionHandlerWithNestContextFactory(makeNestContext) {
|
|
|
22
35
|
};
|
|
23
36
|
};
|
|
24
37
|
}
|
|
25
|
-
exports.blockingFunctionHandlerWithNestContextFactory = blockingFunctionHandlerWithNestContextFactory;
|
|
26
38
|
//# sourceMappingURL=blocking.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"blocking.js","sourceRoot":"","sources":["../../../../../../../../packages/firebase-server/src/lib/nest/function/v2/blocking.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"blocking.js","sourceRoot":"","sources":["../../../../../../../../packages/firebase-server/src/lib/nest/function/v2/blocking.ts"],"names":[],"mappings":";;AA8BA,0EAIC;AAyBD,sGAkBC;AAtDD;;;;;;GAMG;AACH,SAAgB,+BAA+B,CAAsB,uBAAsD,EAAE,OAAsC,EAAE,IAA6B;IAChM,MAAM,UAAU,GAAG,IAAI,IAAI,IAAI,CAAC,CAAC,CAAC,uBAAuB,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,uBAAuB,CAAC,OAAO,CAAC,CAAC;IAC3G,UAAgD,CAAC,SAAS,GAAG,OAAO,CAAC;IACtE,OAAO,UAA+C,CAAC;AACzD,CAAC;AAkBD;;;;;;GAMG;AACH,SAAgB,6CAA6C,CAAI,eAAmC;IAClG,OAAO,CAAsB,EAA0D,EAAE,EAAE;QACzF,OAAO,CAAC,oBAAkD,EAAE,EAAE;YAC5D,MAAM,cAAc,GAAuD,CAAC,OAAoD,EAAE,EAAE;gBAClI,MAAM,SAAS,GAAkC,CAAC,KAAQ,EAAE,EAAE,CAC5D,oBAAoB,EAAE,CAAC,IAAI,CAAC,CAAC,eAAe,EAAE,EAAE,CAC9C,OAAO,CAAC;oBACN,GAAG,KAAK;oBACR,IAAI,EAAE,eAAe,CAAC,eAAe,CAAC;iBACvC,CAAC,CACH,CAAC;gBAEJ,OAAO,SAAS,CAAC;YACnB,CAAC,CAAC;YAEF,OAAO,EAAE,CAAC,cAAc,CAAC,CAAC;QAC5B,CAAC,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -2,22 +2,25 @@ import { https } from 'firebase-functions/v2';
|
|
|
2
2
|
import { type CallableHttpFunction } from '../../../function/type';
|
|
3
3
|
import { type MakeNestContext, type NestApplicationFunctionFactory } from '../../nest.provider';
|
|
4
4
|
import { type OnCallWithNestApplication, type OnCallWithNestContext } from '../call';
|
|
5
|
-
|
|
5
|
+
/**
|
|
6
|
+
* A NestApplicationFunctionFactory for a CallableHttpFunction.
|
|
7
|
+
*/
|
|
8
|
+
export type NestApplicationCallableHttpFunctionFactory<I = unknown, O = unknown> = NestApplicationFunctionFactory<CallableHttpFunction<I, O>>;
|
|
6
9
|
/**
|
|
7
10
|
* Factory function for generating a NestApplicationFunctionFactory for a HttpsFunctions/Runnable firebase function.
|
|
8
11
|
*/
|
|
9
|
-
export type OnCallHandlerWithNestApplicationFactory = <I, O>(fn: OnCallWithNestApplication<I, O>) => NestApplicationCallableHttpFunctionFactory<I, O>;
|
|
12
|
+
export type OnCallHandlerWithNestApplicationFactory = <I = unknown, O = unknown>(fn: OnCallWithNestApplication<I, O>, opts?: https.CallableOptions<I>) => NestApplicationCallableHttpFunctionFactory<I, O>;
|
|
10
13
|
/**
|
|
11
|
-
* Creates a factory for generating OnCallWithNestApplication functions.
|
|
14
|
+
* Creates a factory for generating OnCallWithNestApplication (firebase-functions v2) functions.
|
|
12
15
|
*
|
|
13
|
-
* @param
|
|
16
|
+
* @param opts
|
|
14
17
|
* @returns
|
|
15
18
|
*/
|
|
16
|
-
export declare function onCallHandlerWithNestApplicationFactory(
|
|
19
|
+
export declare function onCallHandlerWithNestApplicationFactory(defaultOpts?: https.CallableOptions): OnCallHandlerWithNestApplicationFactory;
|
|
17
20
|
/**
|
|
18
21
|
* Factory function for generating HttpsFunctions/Runnable firebase function that returns the value from the input OnCallWithNestContext function.
|
|
19
22
|
*/
|
|
20
|
-
export type OnCallHandlerWithNestContextFactory<C> = <I, O>(fn: OnCallWithNestContext<C, I, O>) => NestApplicationCallableHttpFunctionFactory<I>;
|
|
23
|
+
export type OnCallHandlerWithNestContextFactory<C> = <I = unknown, O = unknown>(fn: OnCallWithNestContext<C, I, O>, opts?: https.CallableOptions<I>) => NestApplicationCallableHttpFunctionFactory<I, O>;
|
|
21
24
|
/**
|
|
22
25
|
* Creates a factory for generating OnCallWithNestContext functions with a nest context object that is generated by the input function.
|
|
23
26
|
*
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.onCallHandlerWithNestApplicationFactory = onCallHandlerWithNestApplicationFactory;
|
|
4
|
+
exports.onCallHandlerWithNestContextFactory = onCallHandlerWithNestContextFactory;
|
|
4
5
|
const v2_1 = require("firebase-functions/v2");
|
|
5
6
|
const call_1 = require("../call");
|
|
6
7
|
/**
|
|
7
|
-
* Creates a factory for generating OnCallWithNestApplication functions.
|
|
8
|
+
* Creates a factory for generating OnCallWithNestApplication (firebase-functions v2) functions.
|
|
8
9
|
*
|
|
9
|
-
* @param
|
|
10
|
+
* @param opts
|
|
10
11
|
* @returns
|
|
11
12
|
*/
|
|
12
|
-
function onCallHandlerWithNestApplicationFactory(
|
|
13
|
-
return (fn) => {
|
|
14
|
-
return (nestAppPromiseGetter) => v2_1.https.onCall(opts, (request) => nestAppPromiseGetter().then((nestApplication) => fn({
|
|
13
|
+
function onCallHandlerWithNestApplicationFactory(defaultOpts = {}) {
|
|
14
|
+
return (fn, opts) => {
|
|
15
|
+
return (nestAppPromiseGetter) => v2_1.https.onCall({ ...defaultOpts, ...opts }, (request) => nestAppPromiseGetter().then((nestApplication) => fn({
|
|
15
16
|
...request,
|
|
16
17
|
nestApplication
|
|
17
18
|
})));
|
|
18
19
|
};
|
|
19
20
|
}
|
|
20
|
-
exports.onCallHandlerWithNestApplicationFactory = onCallHandlerWithNestApplicationFactory;
|
|
21
21
|
/**
|
|
22
22
|
* Creates a factory for generating OnCallWithNestContext functions with a nest context object that is generated by the input function.
|
|
23
23
|
*
|
|
@@ -26,7 +26,6 @@ exports.onCallHandlerWithNestApplicationFactory = onCallHandlerWithNestApplicati
|
|
|
26
26
|
* @returns
|
|
27
27
|
*/
|
|
28
28
|
function onCallHandlerWithNestContextFactory(appFactory, makeNestContext) {
|
|
29
|
-
return (fn) => appFactory((request) => fn((0, call_1.setNestContextOnRequest)(makeNestContext, request)));
|
|
29
|
+
return (fn, opts) => appFactory((request) => fn((0, call_1.setNestContextOnRequest)(makeNestContext, request)), opts);
|
|
30
30
|
}
|
|
31
|
-
exports.onCallHandlerWithNestContextFactory = onCallHandlerWithNestContextFactory;
|
|
32
31
|
//# sourceMappingURL=call.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"call.js","sourceRoot":"","sources":["../../../../../../../../packages/firebase-server/src/lib/nest/function/v2/call.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"call.js","sourceRoot":"","sources":["../../../../../../../../packages/firebase-server/src/lib/nest/function/v2/call.ts"],"names":[],"mappings":";;AAyBA,0FAYC;AAcD,kFAEC;AApDD,8CAA8C;AAG9C,kCAA8G;AAe9G;;;;;GAKG;AACH,SAAgB,uCAAuC,CAAC,cAAqC,EAAE;IAC7F,OAAO,CAA2B,EAAmC,EAAE,IAA+B,EAAE,EAAE;QACxG,OAAO,CAAC,oBAAkD,EAAE,EAAE,CAC5D,UAAK,CAAC,MAAM,CAAC,EAAE,GAAG,WAAW,EAAE,GAAG,IAAI,EAAE,EAAE,CAAC,OAA2B,EAAE,EAAE,CACxE,oBAAoB,EAAE,CAAC,IAAI,CAAC,CAAC,eAAe,EAAE,EAAE,CAC9C,EAAE,CAAC;YACD,GAAG,OAAO;YACV,eAAe;SAChB,CAAC,CACH,CACF,CAAC;IACN,CAAC,CAAC;AACJ,CAAC;AAOD;;;;;;GAMG;AACH,SAAgB,mCAAmC,CAAI,UAAmD,EAAE,eAAmC;IAC7I,OAAO,CAAO,EAAkC,EAAE,IAA+B,EAAE,EAAE,CAAC,UAAU,CAAO,CAAC,OAAO,EAAE,EAAE,CAAC,EAAE,CAAC,IAAA,8BAAuB,EAAC,eAAe,EAAE,OAAO,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC;AACnL,CAAC"}
|
|
@@ -2,16 +2,24 @@ import { type PromiseOrValue } from '@dereekb/util';
|
|
|
2
2
|
import { type CloudEvent, type CloudFunction } from 'firebase-functions/v2';
|
|
3
3
|
import { type MakeNestContext, type NestApplicationFunctionFactory } from '../../nest.provider';
|
|
4
4
|
import { type NestContextRequest } from '../nest';
|
|
5
|
-
export type CloudEventNestContextRequest<N, E extends CloudEvent<
|
|
6
|
-
export type CloudEventHandler<E extends CloudEvent<
|
|
7
|
-
export
|
|
8
|
-
|
|
5
|
+
export type CloudEventNestContextRequest<N, E extends CloudEvent<any>> = NestContextRequest<N, E>;
|
|
6
|
+
export type CloudEventHandler<E extends CloudEvent<any>, O = unknown> = (event: E) => PromiseOrValue<O>;
|
|
7
|
+
export interface CloudFunctionBuilder<E extends CloudEvent<any>, O = unknown> {
|
|
8
|
+
(handler: (event: E) => PromiseOrValue<O>): CloudFunction<E>;
|
|
9
|
+
}
|
|
10
|
+
export type NestContextCloudEventHandler<N, E extends CloudEvent<any>, O = unknown> = (request: CloudEventNestContextRequest<N, E>) => PromiseOrValue<O>;
|
|
11
|
+
export type NestContextCloudEventHandlerBuilder<N, E extends CloudEvent<any>, O = unknown> = (handler: NestContextCloudEventHandler<N, E, O>) => CloudEventHandler<E, O>;
|
|
9
12
|
export type NestContextCloudEventHandlerWithData<N, I, O = unknown> = NestContextCloudEventHandler<N, CloudEvent<I>, O>;
|
|
10
|
-
export type CloudEventHandlerWithNestContextBuilder<N, E extends CloudEvent<
|
|
13
|
+
export type CloudEventHandlerWithNestContextBuilder<N, E extends CloudEvent<any>, O = unknown> = (nest: NestContextCloudEventHandlerBuilder<N, E, O>) => CloudFunction<E>;
|
|
14
|
+
export type CloudEventHandlerWithNestContextBuilderForBuilder<N, B extends CloudFunctionBuilder<any, any>> = B extends CloudFunctionBuilder<infer E, infer O> ? CloudEventHandlerWithNestContextBuilder<N, E, O> : never;
|
|
15
|
+
/**
|
|
16
|
+
* Factory produced by CloudEventHandlerWithNestContextFactory.
|
|
17
|
+
*/
|
|
18
|
+
export type NestApplicationCloudEventFunctionFactory<E extends CloudEvent<any>> = NestApplicationFunctionFactory<CloudFunction<E>>;
|
|
11
19
|
/**
|
|
12
20
|
* Factory function for generating a firebase CloudFunction for a specific event.
|
|
13
21
|
*/
|
|
14
|
-
export type CloudEventHandlerWithNestContextFactory<N> = <E extends CloudEvent<
|
|
22
|
+
export type CloudEventHandlerWithNestContextFactory<N> = <E extends CloudEvent<any>, O = unknown>(fn: CloudEventHandlerWithNestContextBuilder<N, E, O>) => NestApplicationCloudEventFunctionFactory<E>;
|
|
15
23
|
/**
|
|
16
24
|
* Creates a CloudEventHandlerWithNestContextFactory.
|
|
17
25
|
*
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.cloudEventHandlerWithNestContextFactory =
|
|
3
|
+
exports.cloudEventHandlerWithNestContextFactory = cloudEventHandlerWithNestContextFactory;
|
|
4
4
|
/**
|
|
5
5
|
* Creates a CloudEventHandlerWithNestContextFactory.
|
|
6
6
|
*
|
|
@@ -22,5 +22,4 @@ function cloudEventHandlerWithNestContextFactory(makeNestContext) {
|
|
|
22
22
|
};
|
|
23
23
|
};
|
|
24
24
|
}
|
|
25
|
-
exports.cloudEventHandlerWithNestContextFactory = cloudEventHandlerWithNestContextFactory;
|
|
26
25
|
//# sourceMappingURL=event.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"event.js","sourceRoot":"","sources":["../../../../../../../../packages/firebase-server/src/lib/nest/function/v2/event.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"event.js","sourceRoot":"","sources":["../../../../../../../../packages/firebase-server/src/lib/nest/function/v2/event.ts"],"names":[],"mappings":";;AAuCA,0FAiBC;AAxBD;;;;;;GAMG;AACH,SAAgB,uCAAuC,CAAI,eAAmC;IAC5F,OAAO,CAAyC,EAAoD,EAAE,EAAE;QACtG,OAAO,CAAC,oBAAkD,EAAE,EAAE;YAC5D,MAAM,cAAc,GAAiD,CAAC,OAA8C,EAAE,EAAE;gBACtH,MAAM,SAAS,GAA4B,CAAC,KAAQ,EAAE,EAAE,CACtD,oBAAoB,EAAE,CAAC,IAAI,CAAC,CAAC,eAAe,EAAE,EAAE,CAC9C,OAAO,CAAC;oBACN,GAAG,KAAK;oBACR,IAAI,EAAE,eAAe,CAAC,eAAe,CAAC;iBACvC,CAAC,CACH,CAAC;gBACJ,OAAO,SAAS,CAAC;YACnB,CAAC,CAAC;YAEF,OAAO,EAAE,CAAC,cAAc,CAAC,CAAC;QAC5B,CAAC,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC"}
|