@firebase/functions 0.11.9 → 0.11.10

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.
@@ -1,122 +1,122 @@
1
- /**
2
- * @license
3
- * Copyright 2018 Google LLC
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
16
- */
17
- import { FirebaseApp } from '@firebase/app';
18
- /**
19
- * An `HttpsCallableResult` wraps a single result from a function call.
20
- * @public
21
- */
22
- export interface HttpsCallableResult<ResponseData = unknown> {
23
- /**
24
- * Data returned from callable function.
25
- */
26
- readonly data: ResponseData;
27
- }
28
- /**
29
- * A reference to a "callable" HTTP trigger in Google Cloud Functions.
30
- * @param data - Data to be passed to callable function.
31
- * @public
32
- */
33
- export declare type HttpsCallable<RequestData = unknown, ResponseData = unknown> = (data?: RequestData | null) => Promise<HttpsCallableResult<ResponseData>>;
34
- /**
35
- * An interface for metadata about how calls should be executed.
36
- * @public
37
- */
38
- export interface HttpsCallableOptions {
39
- /**
40
- * Time in milliseconds after which to cancel if there is no response.
41
- * Default is 70000.
42
- */
43
- timeout?: number;
44
- /**
45
- * If set to true, uses limited-use App Check token for callable function requests from this
46
- * instance of {@link Functions}. You must use limited-use tokens to call functions with
47
- * replay protection enabled. By default, this is false.
48
- */
49
- limitedUseAppCheckTokens?: boolean;
50
- }
51
- /**
52
- * A `Functions` instance.
53
- * @public
54
- */
55
- export interface Functions {
56
- /**
57
- * The {@link @firebase/app#FirebaseApp} this `Functions` instance is associated with.
58
- */
59
- app: FirebaseApp;
60
- /**
61
- * The region the callable Cloud Functions are located in.
62
- * Default is `us-central-1`.
63
- */
64
- region: string;
65
- /**
66
- * A custom domain hosting the callable Cloud Functions.
67
- * ex: https://mydomain.com
68
- */
69
- customDomain: string | null;
70
- }
71
- /**
72
- * Functions error code string appended after "functions/" product prefix.
73
- * See {@link FunctionsErrorCode} for full documentation of codes.
74
- * @public
75
- */
76
- export declare type FunctionsErrorCodeCore = 'ok' | 'cancelled' | 'unknown' | 'invalid-argument' | 'deadline-exceeded' | 'not-found' | 'already-exists' | 'permission-denied' | 'resource-exhausted' | 'failed-precondition' | 'aborted' | 'out-of-range' | 'unimplemented' | 'internal' | 'unavailable' | 'data-loss' | 'unauthenticated';
77
- /**
78
- * The set of Firebase Functions status codes. The codes are the same at the
79
- * ones exposed by gRPC here:
80
- * https://github.com/grpc/grpc/blob/master/doc/statuscodes.md
81
- *
82
- * Possible values:
83
- * - 'cancelled': The operation was cancelled (typically by the caller).
84
- * - 'unknown': Unknown error or an error from a different error domain.
85
- * - 'invalid-argument': Client specified an invalid argument. Note that this
86
- * differs from 'failed-precondition'. 'invalid-argument' indicates
87
- * arguments that are problematic regardless of the state of the system
88
- * (e.g. an invalid field name).
89
- * - 'deadline-exceeded': Deadline expired before operation could complete.
90
- * For operations that change the state of the system, this error may be
91
- * returned even if the operation has completed successfully. For example,
92
- * a successful response from a server could have been delayed long enough
93
- * for the deadline to expire.
94
- * - 'not-found': Some requested document was not found.
95
- * - 'already-exists': Some document that we attempted to create already
96
- * exists.
97
- * - 'permission-denied': The caller does not have permission to execute the
98
- * specified operation.
99
- * - 'resource-exhausted': Some resource has been exhausted, perhaps a
100
- * per-user quota, or perhaps the entire file system is out of space.
101
- * - 'failed-precondition': Operation was rejected because the system is not
102
- * in a state required for the operation's execution.
103
- * - 'aborted': The operation was aborted, typically due to a concurrency
104
- * issue like transaction aborts, etc.
105
- * - 'out-of-range': Operation was attempted past the valid range.
106
- * - 'unimplemented': Operation is not implemented or not supported/enabled.
107
- * - 'internal': Internal errors. Means some invariants expected by
108
- * underlying system has been broken. If you see one of these errors,
109
- * something is very broken.
110
- * - 'unavailable': The service is currently unavailable. This is most likely
111
- * a transient condition and may be corrected by retrying with a backoff.
112
- * - 'data-loss': Unrecoverable data loss or corruption.
113
- * - 'unauthenticated': The request does not have valid authentication
114
- * credentials for the operation.
115
- * @public
116
- */
117
- export declare type FunctionsErrorCode = `functions/${FunctionsErrorCodeCore}`;
118
- declare module '@firebase/component' {
119
- interface NameServiceMapping {
120
- 'functions': Functions;
121
- }
122
- }
1
+ /**
2
+ * @license
3
+ * Copyright 2018 Google LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ import { FirebaseApp } from '@firebase/app';
18
+ /**
19
+ * An `HttpsCallableResult` wraps a single result from a function call.
20
+ * @public
21
+ */
22
+ export interface HttpsCallableResult<ResponseData = unknown> {
23
+ /**
24
+ * Data returned from callable function.
25
+ */
26
+ readonly data: ResponseData;
27
+ }
28
+ /**
29
+ * A reference to a "callable" HTTP trigger in Google Cloud Functions.
30
+ * @param data - Data to be passed to callable function.
31
+ * @public
32
+ */
33
+ export type HttpsCallable<RequestData = unknown, ResponseData = unknown> = (data?: RequestData | null) => Promise<HttpsCallableResult<ResponseData>>;
34
+ /**
35
+ * An interface for metadata about how calls should be executed.
36
+ * @public
37
+ */
38
+ export interface HttpsCallableOptions {
39
+ /**
40
+ * Time in milliseconds after which to cancel if there is no response.
41
+ * Default is 70000.
42
+ */
43
+ timeout?: number;
44
+ /**
45
+ * If set to true, uses limited-use App Check token for callable function requests from this
46
+ * instance of {@link Functions}. You must use limited-use tokens to call functions with
47
+ * replay protection enabled. By default, this is false.
48
+ */
49
+ limitedUseAppCheckTokens?: boolean;
50
+ }
51
+ /**
52
+ * A `Functions` instance.
53
+ * @public
54
+ */
55
+ export interface Functions {
56
+ /**
57
+ * The {@link @firebase/app#FirebaseApp} this `Functions` instance is associated with.
58
+ */
59
+ app: FirebaseApp;
60
+ /**
61
+ * The region the callable Cloud Functions are located in.
62
+ * Default is `us-central-1`.
63
+ */
64
+ region: string;
65
+ /**
66
+ * A custom domain hosting the callable Cloud Functions.
67
+ * ex: https://mydomain.com
68
+ */
69
+ customDomain: string | null;
70
+ }
71
+ /**
72
+ * Functions error code string appended after "functions/" product prefix.
73
+ * See {@link FunctionsErrorCode} for full documentation of codes.
74
+ * @public
75
+ */
76
+ export type FunctionsErrorCodeCore = 'ok' | 'cancelled' | 'unknown' | 'invalid-argument' | 'deadline-exceeded' | 'not-found' | 'already-exists' | 'permission-denied' | 'resource-exhausted' | 'failed-precondition' | 'aborted' | 'out-of-range' | 'unimplemented' | 'internal' | 'unavailable' | 'data-loss' | 'unauthenticated';
77
+ /**
78
+ * The set of Firebase Functions status codes. The codes are the same at the
79
+ * ones exposed by gRPC here:
80
+ * https://github.com/grpc/grpc/blob/master/doc/statuscodes.md
81
+ *
82
+ * Possible values:
83
+ * - 'cancelled': The operation was cancelled (typically by the caller).
84
+ * - 'unknown': Unknown error or an error from a different error domain.
85
+ * - 'invalid-argument': Client specified an invalid argument. Note that this
86
+ * differs from 'failed-precondition'. 'invalid-argument' indicates
87
+ * arguments that are problematic regardless of the state of the system
88
+ * (e.g. an invalid field name).
89
+ * - 'deadline-exceeded': Deadline expired before operation could complete.
90
+ * For operations that change the state of the system, this error may be
91
+ * returned even if the operation has completed successfully. For example,
92
+ * a successful response from a server could have been delayed long enough
93
+ * for the deadline to expire.
94
+ * - 'not-found': Some requested document was not found.
95
+ * - 'already-exists': Some document that we attempted to create already
96
+ * exists.
97
+ * - 'permission-denied': The caller does not have permission to execute the
98
+ * specified operation.
99
+ * - 'resource-exhausted': Some resource has been exhausted, perhaps a
100
+ * per-user quota, or perhaps the entire file system is out of space.
101
+ * - 'failed-precondition': Operation was rejected because the system is not
102
+ * in a state required for the operation's execution.
103
+ * - 'aborted': The operation was aborted, typically due to a concurrency
104
+ * issue like transaction aborts, etc.
105
+ * - 'out-of-range': Operation was attempted past the valid range.
106
+ * - 'unimplemented': Operation is not implemented or not supported/enabled.
107
+ * - 'internal': Internal errors. Means some invariants expected by
108
+ * underlying system has been broken. If you see one of these errors,
109
+ * something is very broken.
110
+ * - 'unavailable': The service is currently unavailable. This is most likely
111
+ * a transient condition and may be corrected by retrying with a backoff.
112
+ * - 'data-loss': Unrecoverable data loss or corruption.
113
+ * - 'unauthenticated': The request does not have valid authentication
114
+ * credentials for the operation.
115
+ * @public
116
+ */
117
+ export type FunctionsErrorCode = `functions/${FunctionsErrorCodeCore}`;
118
+ declare module '@firebase/component' {
119
+ interface NameServiceMapping {
120
+ 'functions': Functions;
121
+ }
122
+ }
@@ -1,14 +1,14 @@
1
- /**
2
- * Takes data and encodes it in a JSON-friendly way, such that types such as
3
- * Date are preserved.
4
- * @internal
5
- * @param data - Data to encode.
6
- */
7
- export declare function encode(data: unknown): unknown;
8
- /**
9
- * Takes data that's been encoded in a JSON-friendly form and returns a form
10
- * with richer datatypes, such as Dates, etc.
11
- * @internal
12
- * @param json - JSON to convert.
13
- */
14
- export declare function decode(json: unknown): unknown;
1
+ /**
2
+ * Takes data and encodes it in a JSON-friendly way, such that types such as
3
+ * Date are preserved.
4
+ * @internal
5
+ * @param data - Data to encode.
6
+ */
7
+ export declare function encode(data: unknown): unknown;
8
+ /**
9
+ * Takes data that's been encoded in a JSON-friendly form and returns a form
10
+ * with richer datatypes, such as Dates, etc.
11
+ * @internal
12
+ * @param json - JSON to convert.
13
+ */
14
+ export declare function decode(json: unknown): unknown;
@@ -1 +1 @@
1
- export {};
1
+ export {};
@@ -1,85 +1,85 @@
1
- /**
2
- * @license
3
- * Copyright 2017 Google LLC
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
16
- */
17
- import { FirebaseApp, _FirebaseService } from '@firebase/app';
18
- import { HttpsCallable, HttpsCallableOptions } from './public-types';
19
- import { ContextProvider } from './context';
20
- import { Provider } from '@firebase/component';
21
- import { FirebaseAuthInternalName } from '@firebase/auth-interop-types';
22
- import { MessagingInternalComponentName } from '@firebase/messaging-interop-types';
23
- import { AppCheckInternalComponentName } from '@firebase/app-check-interop-types';
24
- export declare const DEFAULT_REGION = "us-central1";
25
- /**
26
- * Describes the shape of the HttpResponse body.
27
- * It makes functions that would otherwise take {} able to access the
28
- * possible elements in the body more easily
29
- */
30
- export interface HttpResponseBody {
31
- data?: unknown;
32
- result?: unknown;
33
- error?: {
34
- message?: unknown;
35
- status?: unknown;
36
- details?: unknown;
37
- };
38
- }
39
- /**
40
- * The main class for the Firebase Functions SDK.
41
- * @internal
42
- */
43
- export declare class FunctionsService implements _FirebaseService {
44
- readonly app: FirebaseApp;
45
- readonly contextProvider: ContextProvider;
46
- emulatorOrigin: string | null;
47
- cancelAllRequests: Promise<void>;
48
- deleteService: () => Promise<void>;
49
- region: string;
50
- customDomain: string | null;
51
- /**
52
- * Creates a new Functions service for the given app.
53
- * @param app - The FirebaseApp to use.
54
- */
55
- constructor(app: FirebaseApp, authProvider: Provider<FirebaseAuthInternalName>, messagingProvider: Provider<MessagingInternalComponentName>, appCheckProvider: Provider<AppCheckInternalComponentName>, regionOrCustomDomain?: string);
56
- _delete(): Promise<void>;
57
- /**
58
- * Returns the URL for a callable with the given name.
59
- * @param name - The name of the callable.
60
- * @internal
61
- */
62
- _url(name: string): string;
63
- }
64
- /**
65
- * Modify this instance to communicate with the Cloud Functions emulator.
66
- *
67
- * Note: this must be called before this instance has been used to do any operations.
68
- *
69
- * @param host The emulator host (ex: localhost)
70
- * @param port The emulator port (ex: 5001)
71
- * @public
72
- */
73
- export declare function connectFunctionsEmulator(functionsInstance: FunctionsService, host: string, port: number): void;
74
- /**
75
- * Returns a reference to the callable https trigger with the given name.
76
- * @param name - The name of the trigger.
77
- * @public
78
- */
79
- export declare function httpsCallable<RequestData, ResponseData>(functionsInstance: FunctionsService, name: string, options?: HttpsCallableOptions): HttpsCallable<RequestData, ResponseData>;
80
- /**
81
- * Returns a reference to the callable https trigger with the given url.
82
- * @param url - The url of the trigger.
83
- * @public
84
- */
85
- export declare function httpsCallableFromURL<RequestData, ResponseData>(functionsInstance: FunctionsService, url: string, options?: HttpsCallableOptions): HttpsCallable<RequestData, ResponseData>;
1
+ /**
2
+ * @license
3
+ * Copyright 2017 Google LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ import { FirebaseApp, _FirebaseService } from '@firebase/app';
18
+ import { HttpsCallable, HttpsCallableOptions } from './public-types';
19
+ import { ContextProvider } from './context';
20
+ import { Provider } from '@firebase/component';
21
+ import { FirebaseAuthInternalName } from '@firebase/auth-interop-types';
22
+ import { MessagingInternalComponentName } from '@firebase/messaging-interop-types';
23
+ import { AppCheckInternalComponentName } from '@firebase/app-check-interop-types';
24
+ export declare const DEFAULT_REGION = "us-central1";
25
+ /**
26
+ * Describes the shape of the HttpResponse body.
27
+ * It makes functions that would otherwise take {} able to access the
28
+ * possible elements in the body more easily
29
+ */
30
+ export interface HttpResponseBody {
31
+ data?: unknown;
32
+ result?: unknown;
33
+ error?: {
34
+ message?: unknown;
35
+ status?: unknown;
36
+ details?: unknown;
37
+ };
38
+ }
39
+ /**
40
+ * The main class for the Firebase Functions SDK.
41
+ * @internal
42
+ */
43
+ export declare class FunctionsService implements _FirebaseService {
44
+ readonly app: FirebaseApp;
45
+ readonly contextProvider: ContextProvider;
46
+ emulatorOrigin: string | null;
47
+ cancelAllRequests: Promise<void>;
48
+ deleteService: () => Promise<void>;
49
+ region: string;
50
+ customDomain: string | null;
51
+ /**
52
+ * Creates a new Functions service for the given app.
53
+ * @param app - The FirebaseApp to use.
54
+ */
55
+ constructor(app: FirebaseApp, authProvider: Provider<FirebaseAuthInternalName>, messagingProvider: Provider<MessagingInternalComponentName>, appCheckProvider: Provider<AppCheckInternalComponentName>, regionOrCustomDomain?: string);
56
+ _delete(): Promise<void>;
57
+ /**
58
+ * Returns the URL for a callable with the given name.
59
+ * @param name - The name of the callable.
60
+ * @internal
61
+ */
62
+ _url(name: string): string;
63
+ }
64
+ /**
65
+ * Modify this instance to communicate with the Cloud Functions emulator.
66
+ *
67
+ * Note: this must be called before this instance has been used to do any operations.
68
+ *
69
+ * @param host The emulator host (ex: localhost)
70
+ * @param port The emulator port (ex: 5001)
71
+ * @public
72
+ */
73
+ export declare function connectFunctionsEmulator(functionsInstance: FunctionsService, host: string, port: number): void;
74
+ /**
75
+ * Returns a reference to the callable https trigger with the given name.
76
+ * @param name - The name of the trigger.
77
+ * @public
78
+ */
79
+ export declare function httpsCallable<RequestData, ResponseData>(functionsInstance: FunctionsService, name: string, options?: HttpsCallableOptions): HttpsCallable<RequestData, ResponseData>;
80
+ /**
81
+ * Returns a reference to the callable https trigger with the given url.
82
+ * @param url - The url of the trigger.
83
+ * @public
84
+ */
85
+ export declare function httpsCallableFromURL<RequestData, ResponseData>(functionsInstance: FunctionsService, url: string, options?: HttpsCallableOptions): HttpsCallable<RequestData, ResponseData>;
@@ -1 +1 @@
1
- export {};
1
+ export {};
@@ -1,21 +1,21 @@
1
- /**
2
- * @license
3
- * Copyright 2019 Google LLC
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
16
- */
17
- import { FirebaseOptions, FirebaseApp } from '@firebase/app';
18
- import { Provider } from '@firebase/component';
19
- import { FunctionsService } from '../src/service';
20
- export declare function makeFakeApp(options?: FirebaseOptions): FirebaseApp;
21
- export declare function createTestService(app: FirebaseApp, region?: string, authProvider?: Provider<"auth-internal">, messagingProvider?: Provider<"messaging-internal">, appCheckProvider?: Provider<"app-check-internal">): FunctionsService;
1
+ /**
2
+ * @license
3
+ * Copyright 2019 Google LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ import { FirebaseOptions, FirebaseApp } from '@firebase/app';
18
+ import { Provider } from '@firebase/component';
19
+ import { FunctionsService } from '../src/service';
20
+ export declare function makeFakeApp(options?: FirebaseOptions): FirebaseApp;
21
+ export declare function createTestService(app: FirebaseApp, region?: string, authProvider?: Provider<"auth-internal">, messagingProvider?: Provider<"messaging-internal">, appCheckProvider?: Provider<"app-check-internal">): FunctionsService;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@firebase/functions",
3
- "version": "0.11.9",
3
+ "version": "0.11.10",
4
4
  "description": "",
5
5
  "author": "Firebase <firebase-support@google.com> (https://firebase.google.com/)",
6
6
  "main": "dist/index.cjs.js",
@@ -49,11 +49,11 @@
49
49
  "@firebase/app": "0.x"
50
50
  },
51
51
  "devDependencies": {
52
- "@firebase/app": "0.10.14",
52
+ "@firebase/app": "0.10.16",
53
53
  "rollup": "2.79.1",
54
54
  "@rollup/plugin-json": "4.1.0",
55
55
  "rollup-plugin-typescript2": "0.31.2",
56
- "typescript": "4.7.4"
56
+ "typescript": "5.5.4"
57
57
  },
58
58
  "repository": {
59
59
  "directory": "packages/functions",
@@ -65,11 +65,11 @@
65
65
  },
66
66
  "typings": "./dist/functions-public.d.ts",
67
67
  "dependencies": {
68
- "@firebase/component": "0.6.10",
69
- "@firebase/messaging-interop-types": "0.2.2",
70
- "@firebase/auth-interop-types": "0.2.3",
71
- "@firebase/app-check-interop-types": "0.3.2",
72
- "@firebase/util": "1.10.1",
68
+ "@firebase/component": "0.6.11",
69
+ "@firebase/messaging-interop-types": "0.2.3",
70
+ "@firebase/auth-interop-types": "0.2.4",
71
+ "@firebase/app-check-interop-types": "0.3.3",
72
+ "@firebase/util": "1.10.2",
73
73
  "tslib": "^2.1.0"
74
74
  },
75
75
  "nyc": {