@dereekb/firebase-server 13.43.0 → 14.0.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/calcom/index.esm.js +57 -96
- package/calcom/package.json +11 -11
- package/discord/index.esm.js +48 -74
- package/discord/package.json +11 -11
- package/index.esm.js +336 -583
- package/mailgun/index.esm.js +20 -32
- package/mailgun/package.json +9 -9
- package/mcp/index.esm.js +131 -185
- package/mcp/package.json +14 -14
- package/model/index.esm.js +699 -692
- package/model/package.json +14 -14
- package/model/src/lib/formspace/formspace.action.server.d.ts +79 -5
- package/model/src/lib/formspace/formspace.error.d.ts +21 -0
- package/model/src/lib/formspace/formspace.task.service.handler.d.ts +3 -2
- package/model/src/lib/storagefile/storagefile.task.service.handler.d.ts +3 -3
- package/oidc/index.esm.js +144 -251
- package/oidc/package.json +14 -14
- package/package.json +24 -24
- package/src/lib/function/type.d.ts +0 -9
- package/src/lib/nest/app.d.ts +0 -4
- package/src/lib/nest/development/development.app.function.d.ts +2 -2
- package/src/lib/nest/model/analytics.handler.d.ts +0 -8
- package/src/lib/nest/model/api.details.d.ts +0 -8
- package/src/lib/nest/nest.provider.d.ts +0 -8
- package/test/index.esm.js +239 -395
- package/test/package.json +17 -17
- package/test/src/lib/firebase/firebase.admin.auth.d.ts +4 -25
- package/test/src/lib/firebase/firebase.admin.nest.d.ts +0 -4
- package/test/src/lib/firebase/firebase.admin.nest.function.d.ts +7 -7
- package/test/src/lib/firebase/firebase.function.d.ts +20 -81
- package/test/src/lib/firebase/firebase.test.d.ts +0 -9
- package/twilio/index.esm.js +11 -14
- package/twilio/package.json +8 -8
- package/zoho/index.esm.js +72 -132
- package/zoho/package.json +12 -12
- package/zoho/src/lib/zoho.accounts.firebase.system.d.ts +0 -10
package/test/package.json
CHANGED
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dereekb/firebase-server/test",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "14.0.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"peerDependencies": {
|
|
6
|
-
"@dereekb/analytics": "
|
|
7
|
-
"@dereekb/date": "
|
|
8
|
-
"@dereekb/firebase": "
|
|
9
|
-
"@dereekb/firebase-server": "
|
|
10
|
-
"@dereekb/firebase-server/oidc": "
|
|
11
|
-
"@dereekb/model": "
|
|
12
|
-
"@dereekb/nestjs": "
|
|
13
|
-
"@dereekb/rxjs": "
|
|
14
|
-
"@dereekb/util": "
|
|
6
|
+
"@dereekb/analytics": "14.0.0",
|
|
7
|
+
"@dereekb/date": "14.0.0",
|
|
8
|
+
"@dereekb/firebase": "14.0.0",
|
|
9
|
+
"@dereekb/firebase-server": "14.0.0",
|
|
10
|
+
"@dereekb/firebase-server/oidc": "14.0.0",
|
|
11
|
+
"@dereekb/model": "14.0.0",
|
|
12
|
+
"@dereekb/nestjs": "14.0.0",
|
|
13
|
+
"@dereekb/rxjs": "14.0.0",
|
|
14
|
+
"@dereekb/util": "14.0.0",
|
|
15
15
|
"@google-cloud/firestore": "^7.11.6",
|
|
16
|
-
"@google-cloud/storage": "^7.
|
|
17
|
-
"@nestjs/common": "^
|
|
18
|
-
"@nestjs/testing": "^
|
|
19
|
-
"firebase-admin": "^13.
|
|
20
|
-
"firebase-functions": "^7.2
|
|
21
|
-
"firebase-functions-test": "3.
|
|
16
|
+
"@google-cloud/storage": "^7.22.0",
|
|
17
|
+
"@nestjs/common": "^12.0.1",
|
|
18
|
+
"@nestjs/testing": "^12.0.1",
|
|
19
|
+
"firebase-admin": "^13.10.0",
|
|
20
|
+
"firebase-functions": "^7.3.2",
|
|
21
|
+
"firebase-functions-test": "3.5.0",
|
|
22
22
|
"jsonwebtoken": "^9.0.3",
|
|
23
23
|
"make-error": "^1.3.6",
|
|
24
24
|
"supertest": "^7.2.2"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
|
-
"@dereekb/nestjs": "
|
|
27
|
+
"@dereekb/nestjs": "14.0.0"
|
|
28
28
|
},
|
|
29
29
|
"exports": {
|
|
30
30
|
"./package.json": "./package.json",
|
|
@@ -3,18 +3,17 @@ import { type Factory, type GetterOrValue, type PromiseOrValue, type EmailAddres
|
|
|
3
3
|
import { AbstractChildTestContextFixture, type TestContextFixture } from '@dereekb/util/test';
|
|
4
4
|
import { type FirebaseAdminTestContext } from './firebase.admin';
|
|
5
5
|
import { type CreateRequest, type UserRecord, type DecodedIdToken, type Auth } from 'firebase-admin/auth';
|
|
6
|
-
import { type EventContext } from 'firebase-functions/v1';
|
|
7
6
|
import { type CallableContextOptions, type ContextOptions, type WrappedFunction, type WrappedScheduledFunction, type WrappedV2Function } from 'firebase-functions-test/lib/main';
|
|
8
|
-
import { type WrappedBlockingFunction, type WrappedBlockingFunctionWithHandler, type WrappedCallableRequest, type WrappedCallableRequestOutput, type WrappedCallableRequestParams, type WrappedCloudFunction
|
|
7
|
+
import { type WrappedBlockingFunction, type WrappedBlockingFunctionWithHandler, type WrappedCallableRequest, type WrappedCallableRequestOutput, type WrappedCallableRequestParams, type WrappedCloudFunction } from './firebase.function';
|
|
9
8
|
import { type ScheduledEvent } from 'firebase-functions/scheduler';
|
|
10
9
|
import { type AuthData } from '@dereekb/firebase-server';
|
|
11
10
|
import { type AuthBlockingEvent } from 'firebase-functions/identity';
|
|
12
11
|
/**
|
|
13
12
|
* Union of all cloud function wrapper types that can be invoked via {@link AuthorizedUserTestContext.callCloudFunction}.
|
|
14
13
|
*
|
|
15
|
-
* Includes gen
|
|
14
|
+
* Includes gen 2 wrapped functions, blocking functions, and scheduled functions.
|
|
16
15
|
*/
|
|
17
|
-
export type CallCloudFunction =
|
|
16
|
+
export type CallCloudFunction = WrappedScheduledFunction | WrappedFunction<any> | WrappedBlockingFunctionWithHandler<any, any> | WrappedBlockingFunction | WrappedV2Function<any>;
|
|
18
17
|
/**
|
|
19
18
|
* Infers the input parameter type for a given wrapped cloud function type.
|
|
20
19
|
*
|
|
@@ -44,7 +43,7 @@ export interface AuthorizedUserTestContext {
|
|
|
44
43
|
callWrappedFunction<F extends WrappedCallableRequest<any, any>>(fn: F, params: WrappedCallableRequestParams<F>, skipJsonConversion?: boolean): Promise<WrappedCallableRequestOutput<F>>;
|
|
45
44
|
callWrappedFunctionWithoutUserContext<F extends WrappedCallableRequest<any, any>>(fn: F, params: WrappedCallableRequestParams<F>, options?: CallableContextOptions): Promise<WrappedCallableRequestOutput<F>>;
|
|
46
45
|
/**
|
|
47
|
-
* Used for calling any non-callable gen 2 function (e.g. scheduled functions, cloud functions, blocking functions)
|
|
46
|
+
* Used for calling any non-callable gen 2 function (e.g. scheduled functions, cloud functions, blocking functions).
|
|
48
47
|
*
|
|
49
48
|
* @param fn
|
|
50
49
|
* @param params
|
|
@@ -55,7 +54,6 @@ export interface AuthorizedUserTestContext {
|
|
|
55
54
|
callCloudFunction<F extends WrappedBlockingFunctionWithHandler<E, O>, E extends object, O>(fn: F, params: E): Promise<O>;
|
|
56
55
|
callCloudFunction<F extends WrappedBlockingFunction>(fn: F): Promise<void>;
|
|
57
56
|
callCloudFunction<F extends WrappedV2Function<any>>(fn: F, params: CallCloudFunctionParams<F>, skipJsonConversion?: boolean): Promise<WrappedCallableRequestOutput<F>>;
|
|
58
|
-
callCloudFunction<F extends WrappedCloudFunctionV1<any>, O = unknown>(fn: F, params: CallCloudFunctionParams<F>, skipJsonConversion?: boolean): Promise<O>;
|
|
59
57
|
callCloudFunction<F extends WrappedFunction<any>, O = unknown>(fn: F, params: CallCloudFunctionParams<F>, skipJsonConversion?: boolean): Promise<O>;
|
|
60
58
|
}
|
|
61
59
|
/**
|
|
@@ -91,7 +89,6 @@ export declare class AuthorizedUserTestContextFixture<PI extends FirebaseAdminTe
|
|
|
91
89
|
callCloudFunction<F extends WrappedBlockingFunctionWithHandler<E, O>, E extends object, O>(fn: F, params: E): Promise<O>;
|
|
92
90
|
callCloudFunction<F extends WrappedBlockingFunction>(fn: F): Promise<void>;
|
|
93
91
|
callCloudFunction<F extends WrappedV2Function<any>>(fn: F, params: CallCloudFunctionParams<F>, skipJsonConversion?: boolean): Promise<WrappedCallableRequestOutput<F>>;
|
|
94
|
-
callCloudFunction<F extends WrappedCloudFunctionV1<any>, O = unknown>(fn: F, params: CallCloudFunctionParams<F>, skipJsonConversion?: boolean): Promise<O>;
|
|
95
92
|
callCloudFunction<F extends WrappedFunction<any>, O = unknown>(fn: F, params: CallCloudFunctionParams<F>, skipJsonConversion?: boolean): Promise<O>;
|
|
96
93
|
}
|
|
97
94
|
/**
|
|
@@ -147,7 +144,6 @@ export declare class AuthorizedUserTestContextInstance<PI extends FirebaseAdminT
|
|
|
147
144
|
callCloudFunction<F extends WrappedBlockingFunction>(fn: F): Promise<void>;
|
|
148
145
|
callCloudFunction<F extends WrappedScheduledFunction, O = unknown>(fn: F): Promise<O>;
|
|
149
146
|
callCloudFunction<F extends WrappedV2Function<any>>(fn: F, params: CallCloudFunctionParams<F>, skipJsonConversion?: boolean): Promise<WrappedCallableRequestOutput<F>>;
|
|
150
|
-
callCloudFunction<F extends WrappedCloudFunctionV1<any>, O = unknown>(fn: F, params: CallCloudFunctionParams<F>, skipJsonConversion?: boolean): Promise<O>;
|
|
151
147
|
callCloudFunction<F extends WrappedFunction<any>, O = unknown>(fn: F, params: CallCloudFunctionParams<F>, skipJsonConversion?: boolean): Promise<O>;
|
|
152
148
|
/**
|
|
153
149
|
* Calls a wrapped gen 2 auth blocking function with the input params and context options from makeContextOptions().
|
|
@@ -170,16 +166,6 @@ export declare class AuthorizedUserTestContextInstance<PI extends FirebaseAdminT
|
|
|
170
166
|
eventOverride?: Partial<AuthBlockingEvent>;
|
|
171
167
|
skipJsonConversion?: boolean;
|
|
172
168
|
}): Promise<void>;
|
|
173
|
-
/**
|
|
174
|
-
* @param fn
|
|
175
|
-
* @param params
|
|
176
|
-
* @param contextOptions
|
|
177
|
-
* @param skipJsonConversion
|
|
178
|
-
* @returns
|
|
179
|
-
*
|
|
180
|
-
* @deprecated gen 1
|
|
181
|
-
*/
|
|
182
|
-
callEventCloudFunction<F extends WrappedFunction<any>, O = unknown>(fn: F, params: CallCloudFunctionParams<F>, contextOptions?: CallEventFunctionEventContext, skipJsonConversion?: boolean): Promise<O>;
|
|
183
169
|
}
|
|
184
170
|
/**
|
|
185
171
|
* Generated user details. Used by AuthorizedUserTestContextParams.
|
|
@@ -361,10 +347,3 @@ export declare function decodeEncodedCreateCustomTokenResult(token: TestEncodedF
|
|
|
361
347
|
* @see {@link createEncodedTestFirestoreTokenForUserRecord}
|
|
362
348
|
*/
|
|
363
349
|
export declare function testFirestoreClaimsFromUserRecord(userRecord: UserRecord): object;
|
|
364
|
-
/**
|
|
365
|
-
* Partial event context for gen 1 event-triggered cloud functions, with the `auth` field omitted
|
|
366
|
-
* since it is injected automatically by the test context.
|
|
367
|
-
*
|
|
368
|
-
* @deprecated Used only with gen 1 event cloud functions via {@link AuthorizedUserTestContextInstance.callEventCloudFunction}.
|
|
369
|
-
*/
|
|
370
|
-
export type CallEventFunctionEventContext = Partial<Omit<EventContext, 'auth'>>;
|
|
@@ -155,10 +155,6 @@ export type FirebaseAdminNestTestContextFactory<PI extends FirebaseAdminTestCont
|
|
|
155
155
|
* @returns A new factory that nests the NestJS context inside the parent.
|
|
156
156
|
*/
|
|
157
157
|
export declare function firebaseAdminNestContextFixture<PI extends FirebaseAdminTestContextInstance = FirebaseAdminTestContextInstance, PF extends TestContextFixture<PI> = TestContextFixture<PI>, I extends FirebaseAdminNestTestContextInstance<PI> = FirebaseAdminNestTestContextInstance<PI>, C extends FirebaseAdminNestTestContextFixture<PI, PF, I> = FirebaseAdminNestTestContextFixture<PI, PF, I>>(config: FirebaseAdminNestTestConfig<PI, PF, I, C>, factory: TestContextFactory<PF>): FirebaseAdminNestTestContextFactory<PI, PF, I, C>;
|
|
158
|
-
/**
|
|
159
|
-
* @deprecated Use `FirebaseNestServerRootModule` from `@dereekb/firebase-server` instead.
|
|
160
|
-
*/
|
|
161
|
-
export { FirebaseNestServerRootModule as FirebaseAdminNestRootModule } from '@dereekb/firebase-server';
|
|
162
158
|
/**
|
|
163
159
|
* Wires up a NestJS {@link TestingModule} inside an already-created parent fixture.
|
|
164
160
|
*
|
|
@@ -3,7 +3,7 @@ import { type BuildTestsWithContextFunction, type TestContextFactory, type TestC
|
|
|
3
3
|
import { type FirebaseAdminNestTestConfig, type FirebaseAdminNestTestContext, FirebaseAdminNestTestContextFixture, FirebaseAdminNestTestContextInstance } from './firebase.admin.nest';
|
|
4
4
|
import { type FirebaseAdminFunctionTestContextInstance } from './firebase.admin.function';
|
|
5
5
|
import { type NestApplicationBlockingFunctionFactory, type NestApplicationCallableHttpFunctionFactory, type NestApplicationCloudEventFunctionFactory, type NestApplicationScheduleFunctionFactory } from '@dereekb/firebase-server';
|
|
6
|
-
import { type FirebaseAdminCloudFunctionWrapper, type FirebaseAdminCloudFunctionWrapperSource, type
|
|
6
|
+
import { type FirebaseAdminCloudFunctionWrapper, type FirebaseAdminCloudFunctionWrapperSource, type WrappedCloudFunction, type WrappedCallableRequest } from './firebase.function';
|
|
7
7
|
import { type CloudEvent } from 'firebase-functions/v2';
|
|
8
8
|
type WrapCloudFunctionForNestTestsInputNonEventTypes = NestApplicationScheduleFunctionFactory | NestApplicationBlockingFunctionFactory<any, unknown>;
|
|
9
9
|
/**
|
|
@@ -15,16 +15,16 @@ type WrapCloudFunctionForNestTestsInputNonEventTypes = NestApplicationScheduleFu
|
|
|
15
15
|
*/
|
|
16
16
|
export type WrapCloudFunctionForNestTestsInput<I extends object> = I extends CloudEvent<any> ? NestApplicationCloudEventFunctionFactory<I> | WrapCloudFunctionForNestTestsInputNonEventTypes : WrapCloudFunctionForNestTestsInputNonEventTypes;
|
|
17
17
|
/**
|
|
18
|
-
* Creates a lazy getter that wraps a NestJS-hosted Cloud Function
|
|
18
|
+
* Creates a lazy getter that wraps a NestJS-hosted Cloud Function for testing.
|
|
19
19
|
*
|
|
20
20
|
* The returned getter defers wrapping until first invocation, so the NestJS application
|
|
21
21
|
* is resolved at call time rather than at setup time.
|
|
22
22
|
*
|
|
23
23
|
* @param wrapper - The test context providing the function wrapper and NestJS app promise.
|
|
24
24
|
* @param fn - The NestJS application function factory to wrap.
|
|
25
|
-
* @returns A getter that produces a {@link
|
|
25
|
+
* @returns A getter that produces a {@link WrappedCloudFunction} on each call.
|
|
26
26
|
*/
|
|
27
|
-
export declare function wrapCloudFunctionForNestTestsGetter<I extends object>(wrapper: FirebaseAdminFunctionNestTestContext, fn: WrapCloudFunctionForNestTestsInput<I>): Getter<
|
|
27
|
+
export declare function wrapCloudFunctionForNestTestsGetter<I extends object>(wrapper: FirebaseAdminFunctionNestTestContext, fn: WrapCloudFunctionForNestTestsInput<I>): Getter<WrappedCloudFunction<I>>;
|
|
28
28
|
/**
|
|
29
29
|
* Input type for {@link wrapCallableRequestForNestTestsGetter}. Accepts a NestJS application
|
|
30
30
|
* callable HTTP function factory that produces a gen-2 callable function from a NestJS app promise.
|
|
@@ -54,12 +54,12 @@ export interface FirebaseAdminFunctionNestTestContext extends FirebaseAdminNestT
|
|
|
54
54
|
* Fixture that combines NestJS testing module access with Cloud Function wrapping capabilities.
|
|
55
55
|
*
|
|
56
56
|
* Extends {@link FirebaseAdminNestTestContextFixture} and adds convenience methods for wrapping
|
|
57
|
-
* both
|
|
57
|
+
* both cloud functions and gen-2 callable requests directly from the fixture, delegating
|
|
58
58
|
* to the standalone {@link wrapCloudFunctionForNestTestsGetter} and {@link wrapCallableRequestForNestTestsGetter} helpers.
|
|
59
59
|
*/
|
|
60
60
|
export declare class FirebaseAdminFunctionNestTestContextFixture<PI extends FirebaseAdminFunctionTestContextInstance = FirebaseAdminFunctionTestContextInstance, PF extends TestContextFixture<PI> = TestContextFixture<PI>, I extends FirebaseAdminFunctionNestTestContextInstance<PI> = FirebaseAdminFunctionNestTestContextInstance<PI>> extends FirebaseAdminNestTestContextFixture<PI, PF, I> implements FirebaseAdminFunctionNestTestContext {
|
|
61
|
-
wrapCloudFunctionForNestTests<I extends object>(fn: WrapCloudFunctionForNestTestsInput<I>):
|
|
62
|
-
wrapCloudFunctionForNestTestsGetter<I extends object>(fn: WrapCloudFunctionForNestTestsInput<I>): Getter<
|
|
61
|
+
wrapCloudFunctionForNestTests<I extends object>(fn: WrapCloudFunctionForNestTestsInput<I>): WrappedCloudFunction<I>;
|
|
62
|
+
wrapCloudFunctionForNestTestsGetter<I extends object>(fn: WrapCloudFunctionForNestTestsInput<I>): Getter<WrappedCloudFunction<I>>;
|
|
63
63
|
wrapCallableRequestForNestTests<I, O = unknown>(fn: WrapCallableRequestForNestTestsInput<I, O>): WrappedCallableRequest<I, O>;
|
|
64
64
|
wrapCallableRequestForNestTestsGetter<I, O = unknown>(fn: WrapCallableRequestForNestTestsInput<I, O>): Getter<WrappedCallableRequest<I, O>>;
|
|
65
65
|
get fnWrapper(): FirebaseAdminCloudFunctionWrapper;
|
|
@@ -1,25 +1,9 @@
|
|
|
1
|
-
import { type BlockingFunction
|
|
1
|
+
import { type BlockingFunction } from 'firebase-functions/v1';
|
|
2
2
|
import { type CloudFunction as CloudFunctionV2, type CloudEvent } from 'firebase-functions/v2';
|
|
3
|
-
import { type CallableContextOptions, type
|
|
3
|
+
import { type CallableContextOptions, type WrappedV2Function } from 'firebase-functions-test/lib/main';
|
|
4
4
|
import { type Getter, type PromiseOrValue } from '@dereekb/util';
|
|
5
5
|
import { type FeaturesList } from 'firebase-functions-test/lib/features';
|
|
6
6
|
import { type BlockingFunctionMaybeWithHandler, type CallableHttpFunction } from '@dereekb/firebase-server';
|
|
7
|
-
/**
|
|
8
|
-
* Type fix used for compatability with firebase-functions/v2 the CloudFunction types in unions.
|
|
9
|
-
*
|
|
10
|
-
* The v1 `CloudFunction` type includes a `__trigger` property whose shape conflicts with the v2
|
|
11
|
-
* `CloudFunction` type, making them impossible to use in the same union. This type omits the
|
|
12
|
-
* conflicting property and replaces it with an optional `any`, allowing v1 functions to participate
|
|
13
|
-
* in shared union types alongside v2 functions.
|
|
14
|
-
*/
|
|
15
|
-
export type CloudFunctionV1TypeFix<T> = Omit<CloudFunctionV1Input<T>, '__trigger'> & {
|
|
16
|
-
__trigger?: any;
|
|
17
|
-
};
|
|
18
|
-
/**
|
|
19
|
-
* Alias for {@link CloudFunctionV1TypeFix} representing a gen 1 Firebase Cloud Function
|
|
20
|
-
* with the union-compatibility fix applied.
|
|
21
|
-
*/
|
|
22
|
-
export type CloudFunctionV1<T> = CloudFunctionV1TypeFix<T>;
|
|
23
7
|
/**
|
|
24
8
|
* Wrapped callable function that only takes in data and options that are used to simulate a Firebase request, then returns the result.
|
|
25
9
|
*/
|
|
@@ -39,11 +23,11 @@ export type WrappedCallableRequestParams<W extends WrappedCallableRequest<any, a
|
|
|
39
23
|
*/
|
|
40
24
|
export type WrappedCallableRequestOutput<W extends WrappedCallableRequest<any, any>> = W extends WrappedCallableRequest<infer _, infer O> ? O : unknown;
|
|
41
25
|
/**
|
|
42
|
-
*
|
|
26
|
+
* {@link WrapCallableRequest} input.
|
|
43
27
|
*/
|
|
44
28
|
export type WrapCallableRequestInput<I, O = unknown> = CallableHttpFunction<I, O>;
|
|
45
29
|
/**
|
|
46
|
-
* Function to wrap a CallableHttpFunction into a
|
|
30
|
+
* Function to wrap a CallableHttpFunction into a {@link WrappedCallableRequest} type.
|
|
47
31
|
*/
|
|
48
32
|
export type WrapCallableRequest = <I, O>(callable: WrapCallableRequestInput<I, O>) => WrappedCallableRequest<I, O>;
|
|
49
33
|
/**
|
|
@@ -106,12 +90,14 @@ export type WrapGen2CloudOrBlockingFunction = WrapCloudFunctionV2 | WrapBlocking
|
|
|
106
90
|
*/
|
|
107
91
|
export type WrappedCloudFunction<I extends object, O = unknown> = (input: I, context?: CallableContextOptions) => Promise<O>;
|
|
108
92
|
/**
|
|
109
|
-
* Unified wrapping function type that can wrap
|
|
93
|
+
* Unified wrapping function type that can wrap a gen 2 cloud function or a blocking function.
|
|
110
94
|
*
|
|
111
|
-
*
|
|
112
|
-
*
|
|
95
|
+
* Overloaded across {@link WrapCloudFunctionV2} and {@link WrapBlockingFunction} so a single
|
|
96
|
+
* `wrapCloudFunction` call accepts either variant. This is the callable counterpart of
|
|
97
|
+
* {@link WrapGen2CloudOrBlockingFunction}, which is a union of the same two types.
|
|
113
98
|
*/
|
|
114
|
-
export
|
|
99
|
+
export interface WrapCloudFunction extends WrapCloudFunctionV2, WrapBlockingFunction {
|
|
100
|
+
}
|
|
115
101
|
/**
|
|
116
102
|
* Provides access to a {@link FirebaseAdminCloudFunctionWrapper} via the `fnWrapper` property.
|
|
117
103
|
*
|
|
@@ -122,10 +108,6 @@ export interface FirebaseAdminCloudFunctionWrapperSource {
|
|
|
122
108
|
readonly fnWrapper: FirebaseAdminCloudFunctionWrapper;
|
|
123
109
|
}
|
|
124
110
|
export interface FirebaseAdminCloudFunctionWrapper {
|
|
125
|
-
/**
|
|
126
|
-
* @deprecated deprecated gen 1 firebase function type. Use wrapV2CallableRequest and wrapV2CloudFunction instead.
|
|
127
|
-
*/
|
|
128
|
-
readonly wrapV1CloudFunction: WrapCloudFunctionV1;
|
|
129
111
|
/**
|
|
130
112
|
* @deprecated use wrapCallableRequest
|
|
131
113
|
*/
|
|
@@ -135,7 +117,7 @@ export interface FirebaseAdminCloudFunctionWrapper {
|
|
|
135
117
|
*/
|
|
136
118
|
readonly wrapV2CloudFunction: WrapCloudFunctionV2;
|
|
137
119
|
/**
|
|
138
|
-
*
|
|
120
|
+
* WrapCallableRequest function. Use for wrapping a CallableHttpFunction.
|
|
139
121
|
*/
|
|
140
122
|
readonly wrapCallableRequest: WrapCallableRequest;
|
|
141
123
|
/**
|
|
@@ -143,19 +125,19 @@ export interface FirebaseAdminCloudFunctionWrapper {
|
|
|
143
125
|
*/
|
|
144
126
|
readonly wrapBlockingFunction: WrapBlockingFunction;
|
|
145
127
|
/**
|
|
146
|
-
* WrapCloudFunction function. Use for wrapping a gen 2 CloudFunction
|
|
128
|
+
* WrapCloudFunction function. Use for wrapping a gen 2 CloudFunction.
|
|
147
129
|
*/
|
|
148
130
|
readonly wrapCloudFunction: WrapCloudFunction;
|
|
149
131
|
}
|
|
150
132
|
/**
|
|
151
133
|
* Creates a {@link FirebaseAdminCloudFunctionWrapper} from a `firebase-functions-test` {@link FeaturesList} instance.
|
|
152
134
|
*
|
|
153
|
-
* The returned wrapper provides methods to wrap gen
|
|
154
|
-
*
|
|
155
|
-
*
|
|
135
|
+
* The returned wrapper provides methods to wrap gen 2 cloud functions, callable requests, and
|
|
136
|
+
* blocking functions for use in integration tests. Each method delegates to the underlying
|
|
137
|
+
* `FeaturesList.wrap()` with appropriate type coercion.
|
|
156
138
|
*
|
|
157
139
|
* @param instance - The initialized `firebase-functions-test` features list whose `wrap()` is delegated to.
|
|
158
|
-
* @returns A wrapper object exposing typed `wrap*` helpers for gen
|
|
140
|
+
* @returns A wrapper object exposing typed `wrap*` helpers for gen 2, callable, and blocking functions.
|
|
159
141
|
*
|
|
160
142
|
* @example
|
|
161
143
|
* ```ts
|
|
@@ -184,14 +166,14 @@ export declare function firebaseAdminCloudFunctionWrapper(instance: FeaturesList
|
|
|
184
166
|
*/
|
|
185
167
|
export declare function wrapCloudFunctionV2ForTests<E extends CloudEvent<unknown>, T extends WrapCloudFunctionV2Input<E> = WrapCloudFunctionV2Input<E>>(wrapper: FirebaseAdminCloudFunctionWrapper, getter: Getter<T>): Getter<WrappedCloudFunctionV2<E>>;
|
|
186
168
|
/**
|
|
187
|
-
* Creates a lazy getter that wraps
|
|
188
|
-
*
|
|
169
|
+
* Creates a lazy getter that wraps a cloud function for testing using the unified
|
|
170
|
+
* {@link WrapCloudFunction} interface.
|
|
189
171
|
*
|
|
190
172
|
* This is the most general wrapper — use it when you do not need to distinguish between
|
|
191
|
-
*
|
|
173
|
+
* cloud functions and blocking functions in your test setup.
|
|
192
174
|
*
|
|
193
175
|
* @param wrapper - The cloud function wrapper providing the unified `wrapCloudFunction` accessor.
|
|
194
|
-
* @param getter - Lazy accessor for the cloud function under test
|
|
176
|
+
* @param getter - Lazy accessor for the cloud function under test; re-evaluated on every getter call.
|
|
195
177
|
* @returns A getter that, when invoked, returns a freshly wrapped cloud function exposing the unified `WrappedCloudFunction` signature.
|
|
196
178
|
*
|
|
197
179
|
* @example
|
|
@@ -218,46 +200,3 @@ export declare function wrapCloudFunctionTests<I extends object>(wrapper: Fireba
|
|
|
218
200
|
* ```
|
|
219
201
|
*/
|
|
220
202
|
export declare function wrapCallableRequestForTests<I, O = unknown, T extends WrapCallableRequestInput<I, O> = WrapCallableRequestInput<I, O>>(wrapper: FirebaseAdminCloudFunctionWrapper, getter: Getter<T>): Getter<WrappedCallableRequest<I, O>>;
|
|
221
|
-
/**
|
|
222
|
-
* @deprecated deprecated gen 1 firebase function type
|
|
223
|
-
*/
|
|
224
|
-
export type WrappedCloudFunctionV1<T> = WrappedScheduledFunction | WrappedFunction<T>;
|
|
225
|
-
/**
|
|
226
|
-
* @deprecated deprecated gen 1 firebase function type
|
|
227
|
-
*/
|
|
228
|
-
export type WrapCloudFunctionV1 = <T>(cloudFunction: CloudFunctionV1<T>) => WrappedCloudFunctionV1<T>;
|
|
229
|
-
/**
|
|
230
|
-
* @deprecated deprecated gen 1 firebase function type
|
|
231
|
-
*/
|
|
232
|
-
export type WrapCloudFunctionV1Input<T> = CloudFunctionV1<T>;
|
|
233
|
-
/**
|
|
234
|
-
* Creates a lazy getter that wraps a gen 1 cloud function for testing each time it is called.
|
|
235
|
-
*
|
|
236
|
-
* The returned getter re-wraps on every invocation, so it always reflects the latest function
|
|
237
|
-
* reference from the provided getter — useful when the function under test is re-created between tests.
|
|
238
|
-
*
|
|
239
|
-
* @param wrapper - The cloud function wrapper providing gen 1 wrap support.
|
|
240
|
-
* @param getter - Lazy accessor for the gen 1 cloud function under test; re-evaluated on every getter call.
|
|
241
|
-
* @returns A getter that, when invoked, returns a freshly wrapped gen 1 cloud function ready for invocation in tests.
|
|
242
|
-
*
|
|
243
|
-
* @deprecated Prefer gen 2 functions and {@link wrapCloudFunctionV2ForTests} or {@link wrapCloudFunctionTests}.
|
|
244
|
-
*
|
|
245
|
-
* @example
|
|
246
|
-
* ```ts
|
|
247
|
-
* const getWrapped = wrapCloudFunctionV1ForTests(wrapper, () => myV1Function);
|
|
248
|
-
* const result = await getWrapped()({ /* event data *\/ });
|
|
249
|
-
* ```
|
|
250
|
-
*/
|
|
251
|
-
export declare function wrapCloudFunctionV1ForTests<I, T extends WrapCloudFunctionV1Input<I> = WrapCloudFunctionV1Input<I>>(wrapper: FirebaseAdminCloudFunctionWrapper, getter: Getter<T>): Getter<WrappedCloudFunctionV1<I>>;
|
|
252
|
-
/**
|
|
253
|
-
* @deprecated use WrappedCallableRequest instead.
|
|
254
|
-
*/
|
|
255
|
-
export type WrappedV2CallableRequestDataOnly<I, O = unknown> = WrappedCallableRequest<I, O>;
|
|
256
|
-
/**
|
|
257
|
-
* @deprecated use WrapCallableRequest instead.
|
|
258
|
-
*/
|
|
259
|
-
export type WrapCallableRequestV2Input<I, O = unknown> = WrapCallableRequestInput<I, O>;
|
|
260
|
-
/**
|
|
261
|
-
* @deprecated use WrapCallableRequest instead.
|
|
262
|
-
*/
|
|
263
|
-
export type WrapCallableRequestV2 = WrapCallableRequest;
|
|
@@ -19,12 +19,3 @@ export declare class ExpectedHttpErrorWithSpecificServerErrorCode extends BaseEr
|
|
|
19
19
|
* @returns An assertion function suitable for use with `ExpectFailAssertionFunction` that verifies both the error type and its server error code.
|
|
20
20
|
*/
|
|
21
21
|
export declare function expectFailAssertHttpErrorServerErrorCode(expectedCode: string): ExpectFailAssertionFunction;
|
|
22
|
-
/**
|
|
23
|
-
* @deprecated Use ExpectedHttpErrorWithSpecificServerErrorCode from shared instead. This is kept for backwards compatibility.
|
|
24
|
-
*/
|
|
25
|
-
export declare class JestExpectedHttpErrorWithSpecificServerErrorCode extends ExpectedHttpErrorWithSpecificServerErrorCode {
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* @deprecated Use expectFailAssertHttpErrorServerErrorCode from shared instead. This is kept for backwards compatibility.
|
|
29
|
-
*/
|
|
30
|
-
export declare const jestExpectFailAssertHttpErrorServerErrorCode: typeof expectFailAssertHttpErrorServerErrorCode;
|
package/twilio/index.esm.js
CHANGED
|
@@ -16,11 +16,8 @@ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
|
16
16
|
reject(error);
|
|
17
17
|
return;
|
|
18
18
|
}
|
|
19
|
-
if (info.done)
|
|
20
|
-
|
|
21
|
-
} else {
|
|
22
|
-
Promise.resolve(value).then(_next, _throw);
|
|
23
|
-
}
|
|
19
|
+
if (info.done) resolve(value);
|
|
20
|
+
else Promise.resolve(value).then(_next, _throw);
|
|
24
21
|
}
|
|
25
22
|
function _async_to_generator(fn) {
|
|
26
23
|
return function() {
|
|
@@ -62,19 +59,11 @@ function _iterable_to_array_limit(arr, i) {
|
|
|
62
59
|
return _arr;
|
|
63
60
|
}
|
|
64
61
|
function _non_iterable_rest() {
|
|
65
|
-
throw new TypeError("Invalid attempt to destructure non-iterable instance
|
|
62
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
66
63
|
}
|
|
67
64
|
function _sliced_to_array(arr, i) {
|
|
68
65
|
return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();
|
|
69
66
|
}
|
|
70
|
-
function _unsupported_iterable_to_array(o, minLen) {
|
|
71
|
-
if (!o) return;
|
|
72
|
-
if (typeof o === "string") return _array_like_to_array(o, minLen);
|
|
73
|
-
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
74
|
-
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
75
|
-
if (n === "Map" || n === "Set") return Array.from(n);
|
|
76
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
77
|
-
}
|
|
78
67
|
function _ts_generator(thisArg, body) {
|
|
79
68
|
var f, y, t, _ = {
|
|
80
69
|
label: 0,
|
|
@@ -174,6 +163,14 @@ function _ts_generator(thisArg, body) {
|
|
|
174
163
|
};
|
|
175
164
|
}
|
|
176
165
|
}
|
|
166
|
+
function _unsupported_iterable_to_array(o, minLen) {
|
|
167
|
+
if (!o) return;
|
|
168
|
+
if (typeof o === "string") return _array_like_to_array(o, minLen);
|
|
169
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
170
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
171
|
+
if (n === "Map" || n === "Set") return Array.from(n);
|
|
172
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
173
|
+
}
|
|
177
174
|
/**
|
|
178
175
|
* Default max-batch-size used by {@link twilioNotificationTextSendService}.
|
|
179
176
|
*/ var DEFAULT_TWILIO_NOTIFICATION_TEXT_SEND_SERVICE_MAX_BATCH_SIZE_PER_REQUEST = 50;
|
package/twilio/package.json
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dereekb/firebase-server/twilio",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "14.0.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"peerDependencies": {
|
|
6
|
-
"@dereekb/date": "
|
|
7
|
-
"@dereekb/firebase": "
|
|
8
|
-
"@dereekb/firebase-server": "
|
|
9
|
-
"@dereekb/model": "
|
|
10
|
-
"@dereekb/nestjs": "
|
|
11
|
-
"@dereekb/rxjs": "
|
|
12
|
-
"@dereekb/util": "
|
|
6
|
+
"@dereekb/date": "14.0.0",
|
|
7
|
+
"@dereekb/firebase": "14.0.0",
|
|
8
|
+
"@dereekb/firebase-server": "14.0.0",
|
|
9
|
+
"@dereekb/model": "14.0.0",
|
|
10
|
+
"@dereekb/nestjs": "14.0.0",
|
|
11
|
+
"@dereekb/rxjs": "14.0.0",
|
|
12
|
+
"@dereekb/util": "14.0.0"
|
|
13
13
|
},
|
|
14
14
|
"exports": {
|
|
15
15
|
"./package.json": "./package.json",
|