Skip to content

Commit fdd2aea

Browse files
committed
Add functions-types docs
1 parent 433d28f commit fdd2aea

20 files changed

+303
-6
lines changed
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
## API Report File for "@firebase/functions-types-exp"
2+
3+
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
4+
5+
```ts
6+
7+
import { FirebaseApp } from '@firebase/app-types-exp';
8+
import { FirebaseError } from '@firebase/util';
9+
10+
// @public
11+
export interface Functions {
12+
app: FirebaseApp;
13+
14+
region: string;
15+
}
16+
17+
// @public (undocumented)
18+
export interface FunctionsError extends FirebaseError {
19+
readonly code: FunctionsErrorCode;
20+
21+
readonly details?: any;
22+
}
23+
24+
// @public
25+
export type FunctionsErrorCode =
26+
| 'ok'
27+
| 'cancelled'
28+
| 'unknown'
29+
| 'invalid-argument'
30+
| 'deadline-exceeded'
31+
| 'not-found'
32+
| 'already-exists'
33+
| 'permission-denied'
34+
| 'resource-exhausted'
35+
| 'failed-precondition'
36+
| 'aborted'
37+
| 'out-of-range'
38+
| 'unimplemented'
39+
| 'internal'
40+
| 'unavailable'
41+
| 'data-loss'
42+
| 'unauthenticated';
43+
44+
// @public
45+
export interface HttpsCallable {
46+
// (undocumented)
47+
(data?: {} | null): Promise<HttpsCallableResult>;
48+
}
49+
50+
// @public
51+
export interface HttpsCallableOptions {
52+
// (undocumented)
53+
timeout?: number; // in millis
54+
}
55+
56+
// @public
57+
export interface HttpsCallableResult {
58+
// (undocumented)
59+
readonly data: any;
60+
}
61+
62+
63+
// (No @packageDocumentation comment for this package)
64+
65+
```
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
2+
3+
[Home](./index.md) &gt; [@firebase/functions-types](./functions-types.md) &gt; [Functions](./functions-types.functions.md) &gt; [app](./functions-types.functions.app.md)
4+
5+
## Functions.app property
6+
7+
The FirebaseApp this Functions instance is associated with.
8+
9+
<b>Signature:</b>
10+
11+
```typescript
12+
app: FirebaseApp;
13+
```

docs-exp/functions-types.functions.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
2+
3+
[Home](./index.md) &gt; [@firebase/functions-types](./functions-types.md) &gt; [Functions](./functions-types.functions.md)
4+
5+
## Functions interface
6+
7+
`Functions` represents a Functions instance, and is a required argument for all Functions operations.
8+
9+
<b>Signature:</b>
10+
11+
```typescript
12+
export interface Functions
13+
```
14+
15+
## Properties
16+
17+
| Property | Type | Description |
18+
| --- | --- | --- |
19+
| [app](./functions-types.functions.app.md) | [FirebaseApp](./app-types.firebaseapp.md) | The FirebaseApp this Functions instance is associated with. |
20+
| [region](./functions-types.functions.region.md) | string | The region the callable Cloud Functions are located in. Default is <code>us-central-1</code>. |
21+
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
2+
3+
[Home](./index.md) &gt; [@firebase/functions-types](./functions-types.md) &gt; [Functions](./functions-types.functions.md) &gt; [region](./functions-types.functions.region.md)
4+
5+
## Functions.region property
6+
7+
The region the callable Cloud Functions are located in. Default is `us-central-1`<!-- -->.
8+
9+
<b>Signature:</b>
10+
11+
```typescript
12+
region: string;
13+
```
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
2+
3+
[Home](./index.md) &gt; [@firebase/functions-types](./functions-types.md) &gt; [FunctionsError](./functions-types.functionserror.md) &gt; [code](./functions-types.functionserror.code.md)
4+
5+
## FunctionsError.code property
6+
7+
A standard error code that will be returned to the client. This also determines the HTTP status code of the response, as defined in code.proto.
8+
9+
<b>Signature:</b>
10+
11+
```typescript
12+
readonly code: FunctionsErrorCode;
13+
```
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
2+
3+
[Home](./index.md) &gt; [@firebase/functions-types](./functions-types.md) &gt; [FunctionsError](./functions-types.functionserror.md) &gt; [details](./functions-types.functionserror.details.md)
4+
5+
## FunctionsError.details property
6+
7+
Extra data to be converted to JSON and included in the error response.
8+
9+
<b>Signature:</b>
10+
11+
```typescript
12+
readonly details?: any;
13+
```
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
2+
3+
[Home](./index.md) &gt; [@firebase/functions-types](./functions-types.md) &gt; [FunctionsError](./functions-types.functionserror.md)
4+
5+
## FunctionsError interface
6+
7+
<b>Signature:</b>
8+
9+
```typescript
10+
export interface FunctionsError extends FirebaseError
11+
```
12+
<b>Extends:</b> FirebaseError
13+
14+
## Properties
15+
16+
| Property | Type | Description |
17+
| --- | --- | --- |
18+
| [code](./functions-types.functionserror.code.md) | [FunctionsErrorCode](./functions-types.functionserrorcode.md) | A standard error code that will be returned to the client. This also determines the HTTP status code of the response, as defined in code.proto. |
19+
| [details](./functions-types.functionserror.details.md) | any | Extra data to be converted to JSON and included in the error response. |
20+
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
2+
3+
[Home](./index.md) &gt; [@firebase/functions-types](./functions-types.md) &gt; [FunctionsErrorCode](./functions-types.functionserrorcode.md)
4+
5+
## FunctionsErrorCode type
6+
7+
The set of Firebase Functions status codes. The codes are the same at the ones exposed by gRPC here: https://github.com/grpc/grpc/blob/master/doc/statuscodes.md
8+
9+
Possible values: - 'cancelled': The operation was cancelled (typically by the caller). - 'unknown': Unknown error or an error from a different error domain. - 'invalid-argument': Client specified an invalid argument. Note that this differs from 'failed-precondition'. 'invalid-argument' indicates arguments that are problematic regardless of the state of the system (e.g. an invalid field name). - 'deadline-exceeded': Deadline expired before operation could complete. For operations that change the state of the system, this error may be returned even if the operation has completed successfully. For example, a successful response from a server could have been delayed long enough for the deadline to expire. - 'not-found': Some requested document was not found. - 'already-exists': Some document that we attempted to create already exists. - 'permission-denied': The caller does not have permission to execute the specified operation. - 'resource-exhausted': Some resource has been exhausted, perhaps a per-user quota, or perhaps the entire file system is out of space. - 'failed-precondition': Operation was rejected because the system is not in a state required for the operation's execution. - 'aborted': The operation was aborted, typically due to a concurrency issue like transaction aborts, etc. - 'out-of-range': Operation was attempted past the valid range. - 'unimplemented': Operation is not implemented or not supported/enabled. - 'internal': Internal errors. Means some invariants expected by underlying system has been broken. If you see one of these errors, something is very broken. - 'unavailable': The service is currently unavailable. This is most likely a transient condition and may be corrected by retrying with a backoff. - 'data-loss': Unrecoverable data loss or corruption. - 'unauthenticated': The request does not have valid authentication credentials for the operation.
10+
11+
<b>Signature:</b>
12+
13+
```typescript
14+
export type FunctionsErrorCode =
15+
| 'ok'
16+
| 'cancelled'
17+
| 'unknown'
18+
| 'invalid-argument'
19+
| 'deadline-exceeded'
20+
| 'not-found'
21+
| 'already-exists'
22+
| 'permission-denied'
23+
| 'resource-exhausted'
24+
| 'failed-precondition'
25+
| 'aborted'
26+
| 'out-of-range'
27+
| 'unimplemented'
28+
| 'internal'
29+
| 'unavailable'
30+
| 'data-loss'
31+
| 'unauthenticated';
32+
```
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
2+
3+
[Home](./index.md) &gt; [@firebase/functions-types](./functions-types.md) &gt; [HttpsCallable](./functions-types.httpscallable.md)
4+
5+
## HttpsCallable interface
6+
7+
An HttpsCallable is a reference to a "callable" http trigger in Google Cloud Functions.
8+
9+
<b>Signature:</b>
10+
11+
```typescript
12+
export interface HttpsCallable
13+
```
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
2+
3+
[Home](./index.md) &gt; [@firebase/functions-types](./functions-types.md) &gt; [HttpsCallableOptions](./functions-types.httpscallableoptions.md)
4+
5+
## HttpsCallableOptions interface
6+
7+
HttpsCallableOptions specify metadata about how calls should be executed.
8+
9+
<b>Signature:</b>
10+
11+
```typescript
12+
export interface HttpsCallableOptions
13+
```
14+
15+
## Properties
16+
17+
| Property | Type | Description |
18+
| --- | --- | --- |
19+
| [timeout](./functions-types.httpscallableoptions.timeout.md) | number | |
20+
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
2+
3+
[Home](./index.md) &gt; [@firebase/functions-types](./functions-types.md) &gt; [HttpsCallableOptions](./functions-types.httpscallableoptions.md) &gt; [timeout](./functions-types.httpscallableoptions.timeout.md)
4+
5+
## HttpsCallableOptions.timeout property
6+
7+
<b>Signature:</b>
8+
9+
```typescript
10+
timeout?: number;
11+
```
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
2+
3+
[Home](./index.md) &gt; [@firebase/functions-types](./functions-types.md) &gt; [HttpsCallableResult](./functions-types.httpscallableresult.md) &gt; [data](./functions-types.httpscallableresult.data.md)
4+
5+
## HttpsCallableResult.data property
6+
7+
<b>Signature:</b>
8+
9+
```typescript
10+
readonly data: any;
11+
```
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
2+
3+
[Home](./index.md) &gt; [@firebase/functions-types](./functions-types.md) &gt; [HttpsCallableResult](./functions-types.httpscallableresult.md)
4+
5+
## HttpsCallableResult interface
6+
7+
An HttpsCallableResult wraps a single result from a function call.
8+
9+
<b>Signature:</b>
10+
11+
```typescript
12+
export interface HttpsCallableResult
13+
```
14+
15+
## Properties
16+
17+
| Property | Type | Description |
18+
| --- | --- | --- |
19+
| [data](./functions-types.httpscallableresult.data.md) | any | |
20+

docs-exp/functions-types.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
2+
3+
[Home](./index.md) &gt; [@firebase/functions-types](./functions-types.md)
4+
5+
## functions-types package
6+
7+
## Interfaces
8+
9+
| Interface | Description |
10+
| --- | --- |
11+
| [Functions](./functions-types.functions.md) | <code>Functions</code> represents a Functions instance, and is a required argument for all Functions operations. |
12+
| [FunctionsError](./functions-types.functionserror.md) | |
13+
| [HttpsCallable](./functions-types.httpscallable.md) | An HttpsCallable is a reference to a "callable" http trigger in Google Cloud Functions. |
14+
| [HttpsCallableOptions](./functions-types.httpscallableoptions.md) | HttpsCallableOptions specify metadata about how calls should be executed. |
15+
| [HttpsCallableResult](./functions-types.httpscallableresult.md) | An HttpsCallableResult wraps a single result from a function call. |
16+
17+
## Type Aliases
18+
19+
| Type Alias | Description |
20+
| --- | --- |
21+
| [FunctionsErrorCode](./functions-types.functionserrorcode.md) | The set of Firebase Functions status codes. The codes are the same at the ones exposed by gRPC here: https://github.com/grpc/grpc/blob/master/doc/statuscodes.md<!-- -->Possible values: - 'cancelled': The operation was cancelled (typically by the caller). - 'unknown': Unknown error or an error from a different error domain. - 'invalid-argument': Client specified an invalid argument. Note that this differs from 'failed-precondition'. 'invalid-argument' indicates arguments that are problematic regardless of the state of the system (e.g. an invalid field name). - 'deadline-exceeded': Deadline expired before operation could complete. For operations that change the state of the system, this error may be returned even if the operation has completed successfully. For example, a successful response from a server could have been delayed long enough for the deadline to expire. - 'not-found': Some requested document was not found. - 'already-exists': Some document that we attempted to create already exists. - 'permission-denied': The caller does not have permission to execute the specified operation. - 'resource-exhausted': Some resource has been exhausted, perhaps a per-user quota, or perhaps the entire file system is out of space. - 'failed-precondition': Operation was rejected because the system is not in a state required for the operation's execution. - 'aborted': The operation was aborted, typically due to a concurrency issue like transaction aborts, etc. - 'out-of-range': Operation was attempted past the valid range. - 'unimplemented': Operation is not implemented or not supported/enabled. - 'internal': Internal errors. Means some invariants expected by underlying system has been broken. If you see one of these errors, something is very broken. - 'unavailable': The service is currently unavailable. This is most likely a transient condition and may be corrected by retrying with a backoff. - 'data-loss': Unrecoverable data loss or corruption. - 'unauthenticated': The request does not have valid authentication credentials for the operation. |
22+

docs-exp/functions.getfunctions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,5 @@ export declare function getFunctions(app: FirebaseApp, region?: string): Functio
2121

2222
<b>Returns:</b>
2323

24-
Functions
24+
[Functions](./functions-types.functions.md)
2525

docs-exp/functions.httpscallable.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ export declare function httpsCallable(functionsInstance: Functions, name: string
1616

1717
| Parameter | Type | Description |
1818
| --- | --- | --- |
19-
| functionsInstance | Functions | |
19+
| functionsInstance | [Functions](./functions-types.functions.md) | |
2020
| name | string | The name of the trigger. |
21-
| options | HttpsCallableOptions | |
21+
| options | [HttpsCallableOptions](./functions-types.httpscallableoptions.md) | |
2222

2323
<b>Returns:</b>
2424

25-
HttpsCallable
25+
[HttpsCallable](./functions-types.httpscallable.md)
2626

docs-exp/functions.usefunctionsemulator.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export declare function useFunctionsEmulator(functionsInstance: Functions, origi
1616

1717
| Parameter | Type | Description |
1818
| --- | --- | --- |
19-
| functionsInstance | Functions | |
19+
| functionsInstance | [Functions](./functions-types.functions.md) | |
2020
| origin | string | The origin of the local emulator, such as "http://localhost:5005". |
2121

2222
<b>Returns:</b>

docs-exp/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,5 @@
1111
| [@firebase/app](./app.md) | Firebase App |
1212
| [@firebase/app-types](./app-types.md) | |
1313
| [@firebase/functions](./functions.md) | |
14+
| [@firebase/functions-types](./functions-types.md) | |
1415

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"extends": "../../config/api-extractor.json",
3+
// Point it to your entry point d.ts file.
4+
"mainEntryPointFilePath": "<projectFolder>/index.d.ts"
5+
}

packages-exp/functions-types-exp/package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@
88
"scripts": {
99
"test": "tsc",
1010
"test:ci": "node ../../scripts/run_tests_in_ci.js",
11-
"prepare": "node ../../scripts/exp/remove-exp.js ./index.d.ts"
11+
"prepare": "node ../../scripts/exp/remove-exp.js ./index.d.ts",
12+
"api-report": "api-extractor run --local --verbose",
13+
"predoc": "node ../../scripts/exp/remove-exp.js temp",
14+
"doc": "api-documenter markdown --input temp --output docs",
15+
"build:doc": "yarn api-report && yarn doc"
1216
},
1317
"files": [
1418
"index.d.ts"

0 commit comments

Comments
 (0)