@firebase/rules-unit-testing 4.0.1-canary.4e6a5c670 → 4.0.1-canary.59ae45e48
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/dist/esm/test/dummy.test.d.ts +17 -0
- package/dist/{firebase/compat/storage/index.d.ts → esm/test/impl/discovery.test.d.ts} +1 -1
- package/dist/esm/{firebase/compat/storage/index.d.ts → test/impl/rules.test.d.ts} +1 -1
- package/dist/esm/{firebase/compat/database/index.d.ts → test/util.test.d.ts} +1 -1
- package/dist/test/dummy.test.d.ts +17 -0
- package/dist/{firebase/compat/database/index.d.ts → test/impl/discovery.test.d.ts} +1 -1
- package/dist/test/impl/rules.test.d.ts +17 -0
- package/dist/test/util.test.d.ts +17 -0
- package/package.json +6 -6
- package/dist/esm/firebase/compat/firestore/index.d.ts +0 -17
- package/dist/esm/util/index.d.ts +0 -38
- package/dist/esm/util/src/assert.d.ts +0 -24
- package/dist/esm/util/src/compat.d.ts +0 -20
- package/dist/esm/util/src/constants.d.ts +0 -33
- package/dist/esm/util/src/crypt.d.ts +0 -66
- package/dist/esm/util/src/deepCopy.d.ts +0 -35
- package/dist/esm/util/src/defaults.d.ts +0 -79
- package/dist/esm/util/src/deferred.d.ts +0 -28
- package/dist/esm/util/src/emulator.d.ts +0 -47
- package/dist/esm/util/src/environment.d.ts +0 -90
- package/dist/esm/util/src/errors.d.ts +0 -87
- package/dist/esm/util/src/exponential_backoff.d.ts +0 -37
- package/dist/esm/util/src/formatters.d.ts +0 -20
- package/dist/esm/util/src/global.d.ts +0 -22
- package/dist/esm/util/src/json.d.ts +0 -29
- package/dist/esm/util/src/jwt.d.ts +0 -73
- package/dist/esm/util/src/obj.d.ts +0 -30
- package/dist/esm/util/src/promise.d.ts +0 -21
- package/dist/esm/util/src/query.d.ts +0 -33
- package/dist/esm/util/src/sha1.d.ts +0 -84
- package/dist/esm/util/src/subscribe.d.ts +0 -49
- package/dist/esm/util/src/utf8.d.ts +0 -27
- package/dist/esm/util/src/validation.d.ts +0 -43
- package/dist/firebase/compat/firestore/index.d.ts +0 -17
- package/dist/util/index.d.ts +0 -38
- package/dist/util/src/assert.d.ts +0 -24
- package/dist/util/src/compat.d.ts +0 -20
- package/dist/util/src/constants.d.ts +0 -33
- package/dist/util/src/crypt.d.ts +0 -66
- package/dist/util/src/deepCopy.d.ts +0 -35
- package/dist/util/src/defaults.d.ts +0 -79
- package/dist/util/src/deferred.d.ts +0 -28
- package/dist/util/src/emulator.d.ts +0 -47
- package/dist/util/src/environment.d.ts +0 -90
- package/dist/util/src/errors.d.ts +0 -87
- package/dist/util/src/exponential_backoff.d.ts +0 -37
- package/dist/util/src/formatters.d.ts +0 -20
- package/dist/util/src/global.d.ts +0 -22
- package/dist/util/src/json.d.ts +0 -29
- package/dist/util/src/jwt.d.ts +0 -73
- package/dist/util/src/obj.d.ts +0 -30
- package/dist/util/src/promise.d.ts +0 -21
- package/dist/util/src/query.d.ts +0 -33
- package/dist/util/src/sha1.d.ts +0 -84
- package/dist/util/src/subscribe.d.ts +0 -49
- package/dist/util/src/utf8.d.ts +0 -27
- package/dist/util/src/validation.d.ts +0 -43
- /package/dist/esm/{rules-unit-testing/index.d.ts → index.d.ts} +0 -0
- /package/dist/esm/{rules-unit-testing/src → src}/impl/discovery.d.ts +0 -0
- /package/dist/esm/{rules-unit-testing/src → src}/impl/rules.d.ts +0 -0
- /package/dist/esm/{rules-unit-testing/src → src}/impl/test_environment.d.ts +0 -0
- /package/dist/esm/{rules-unit-testing/src → src}/impl/url.d.ts +0 -0
- /package/dist/esm/{rules-unit-testing/src → src}/initialize.d.ts +0 -0
- /package/dist/esm/{rules-unit-testing/src → src}/public_types/index.d.ts +0 -0
- /package/dist/esm/{rules-unit-testing/src → src}/util.d.ts +0 -0
- /package/dist/esm/{rules-unit-testing/test → test}/setup.d.ts +0 -0
- /package/dist/esm/{rules-unit-testing/test → test}/test_utils.d.ts +0 -0
- /package/dist/{rules-unit-testing/index.d.ts → index.d.ts} +0 -0
- /package/dist/{rules-unit-testing/src → src}/impl/discovery.d.ts +0 -0
- /package/dist/{rules-unit-testing/src → src}/impl/rules.d.ts +0 -0
- /package/dist/{rules-unit-testing/src → src}/impl/test_environment.d.ts +0 -0
- /package/dist/{rules-unit-testing/src → src}/impl/url.d.ts +0 -0
- /package/dist/{rules-unit-testing/src → src}/initialize.d.ts +0 -0
- /package/dist/{rules-unit-testing/src → src}/public_types/index.d.ts +0 -0
- /package/dist/{rules-unit-testing/src → src}/util.d.ts +0 -0
- /package/dist/{rules-unit-testing/test → test}/setup.d.ts +0 -0
- /package/dist/{rules-unit-testing/test → test}/test_utils.d.ts +0 -0
- /package/dist/{rules-unit-testing/tsdoc-metadata.json → tsdoc-metadata.json} +0 -0
|
@@ -1,87 +0,0 @@
|
|
|
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
|
-
/**
|
|
18
|
-
* @fileoverview Standardized Firebase Error.
|
|
19
|
-
*
|
|
20
|
-
* Usage:
|
|
21
|
-
*
|
|
22
|
-
* // TypeScript string literals for type-safe codes
|
|
23
|
-
* type Err =
|
|
24
|
-
* 'unknown' |
|
|
25
|
-
* 'object-not-found'
|
|
26
|
-
* ;
|
|
27
|
-
*
|
|
28
|
-
* // Closure enum for type-safe error codes
|
|
29
|
-
* // at-enum {string}
|
|
30
|
-
* var Err = {
|
|
31
|
-
* UNKNOWN: 'unknown',
|
|
32
|
-
* OBJECT_NOT_FOUND: 'object-not-found',
|
|
33
|
-
* }
|
|
34
|
-
*
|
|
35
|
-
* let errors: Map<Err, string> = {
|
|
36
|
-
* 'generic-error': "Unknown error",
|
|
37
|
-
* 'file-not-found': "Could not find file: {$file}",
|
|
38
|
-
* };
|
|
39
|
-
*
|
|
40
|
-
* // Type-safe function - must pass a valid error code as param.
|
|
41
|
-
* let error = new ErrorFactory<Err>('service', 'Service', errors);
|
|
42
|
-
*
|
|
43
|
-
* ...
|
|
44
|
-
* throw error.create(Err.GENERIC);
|
|
45
|
-
* ...
|
|
46
|
-
* throw error.create(Err.FILE_NOT_FOUND, {'file': fileName});
|
|
47
|
-
* ...
|
|
48
|
-
* // Service: Could not file file: foo.txt (service/file-not-found).
|
|
49
|
-
*
|
|
50
|
-
* catch (e) {
|
|
51
|
-
* assert(e.message === "Could not find file: foo.txt.");
|
|
52
|
-
* if ((e as FirebaseError)?.code === 'service/file-not-found') {
|
|
53
|
-
* console.log("Could not read file: " + e['file']);
|
|
54
|
-
* }
|
|
55
|
-
* }
|
|
56
|
-
*/
|
|
57
|
-
export type ErrorMap<ErrorCode extends string> = {
|
|
58
|
-
readonly [K in ErrorCode]: string;
|
|
59
|
-
};
|
|
60
|
-
export interface StringLike {
|
|
61
|
-
toString(): string;
|
|
62
|
-
}
|
|
63
|
-
export interface ErrorData {
|
|
64
|
-
[key: string]: unknown;
|
|
65
|
-
}
|
|
66
|
-
export declare class FirebaseError extends Error {
|
|
67
|
-
/** The error code for this error. */
|
|
68
|
-
readonly code: string;
|
|
69
|
-
/** Custom data for this error. */
|
|
70
|
-
customData?: Record<string, unknown> | undefined;
|
|
71
|
-
/** The custom name for all FirebaseErrors. */
|
|
72
|
-
readonly name: string;
|
|
73
|
-
constructor(
|
|
74
|
-
/** The error code for this error. */
|
|
75
|
-
code: string, message: string,
|
|
76
|
-
/** Custom data for this error. */
|
|
77
|
-
customData?: Record<string, unknown> | undefined);
|
|
78
|
-
}
|
|
79
|
-
export declare class ErrorFactory<ErrorCode extends string, ErrorParams extends {
|
|
80
|
-
readonly [K in ErrorCode]?: ErrorData;
|
|
81
|
-
} = {}> {
|
|
82
|
-
private readonly service;
|
|
83
|
-
private readonly serviceName;
|
|
84
|
-
private readonly errors;
|
|
85
|
-
constructor(service: string, serviceName: string, errors: ErrorMap<ErrorCode>);
|
|
86
|
-
create<K extends ErrorCode>(code: K, ...data: K extends keyof ErrorParams ? [ErrorParams[K]] : []): FirebaseError;
|
|
87
|
-
}
|
|
@@ -1,37 +0,0 @@
|
|
|
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
|
-
/**
|
|
18
|
-
* The maximum milliseconds to increase to.
|
|
19
|
-
*
|
|
20
|
-
* <p>Visible for testing
|
|
21
|
-
*/
|
|
22
|
-
export declare const MAX_VALUE_MILLIS: number;
|
|
23
|
-
/**
|
|
24
|
-
* The percentage of backoff time to randomize by.
|
|
25
|
-
* See
|
|
26
|
-
* http://go/safe-client-behavior#step-1-determine-the-appropriate-retry-interval-to-handle-spike-traffic
|
|
27
|
-
* for context.
|
|
28
|
-
*
|
|
29
|
-
* <p>Visible for testing
|
|
30
|
-
*/
|
|
31
|
-
export declare const RANDOM_FACTOR = 0.5;
|
|
32
|
-
/**
|
|
33
|
-
* Based on the backoff method from
|
|
34
|
-
* https://github.com/google/closure-library/blob/master/closure/goog/math/exponentialbackoff.js.
|
|
35
|
-
* Extracted here so we don't need to pass metadata and a stateful ExponentialBackoff object around.
|
|
36
|
-
*/
|
|
37
|
-
export declare function calculateBackoffMillis(backoffCount: number, intervalMillis?: number, backoffFactor?: number): number;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright 2020 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
|
-
/**
|
|
18
|
-
* Provide English ordinal letters after a number
|
|
19
|
-
*/
|
|
20
|
-
export declare function ordinal(i: number): string;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright 2022 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
|
-
/**
|
|
18
|
-
* Polyfill for `globalThis` object.
|
|
19
|
-
* @returns the `globalThis` object for the given environment.
|
|
20
|
-
* @public
|
|
21
|
-
*/
|
|
22
|
-
export declare function getGlobal(): typeof globalThis;
|
|
@@ -1,29 +0,0 @@
|
|
|
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
|
-
/**
|
|
18
|
-
* Evaluates a JSON string into a javascript object.
|
|
19
|
-
*
|
|
20
|
-
* @param {string} str A string containing JSON.
|
|
21
|
-
* @return {*} The javascript object representing the specified JSON.
|
|
22
|
-
*/
|
|
23
|
-
export declare function jsonEval(str: string): unknown;
|
|
24
|
-
/**
|
|
25
|
-
* Returns JSON representing a javascript object.
|
|
26
|
-
* @param {*} data JavaScript object to be stringified.
|
|
27
|
-
* @return {string} The JSON contents of the object.
|
|
28
|
-
*/
|
|
29
|
-
export declare function stringify(data: unknown): string;
|
|
@@ -1,73 +0,0 @@
|
|
|
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
|
-
interface Claims {
|
|
18
|
-
[key: string]: {};
|
|
19
|
-
}
|
|
20
|
-
interface DecodedToken {
|
|
21
|
-
header: object;
|
|
22
|
-
claims: Claims;
|
|
23
|
-
data: object;
|
|
24
|
-
signature: string;
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* Decodes a Firebase auth. token into constituent parts.
|
|
28
|
-
*
|
|
29
|
-
* Notes:
|
|
30
|
-
* - May return with invalid / incomplete claims if there's no native base64 decoding support.
|
|
31
|
-
* - Doesn't check if the token is actually valid.
|
|
32
|
-
*/
|
|
33
|
-
export declare const decode: (token: string) => DecodedToken;
|
|
34
|
-
interface DecodedToken {
|
|
35
|
-
header: object;
|
|
36
|
-
claims: Claims;
|
|
37
|
-
data: object;
|
|
38
|
-
signature: string;
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* Decodes a Firebase auth. token and checks the validity of its time-based claims. Will return true if the
|
|
42
|
-
* token is within the time window authorized by the 'nbf' (not-before) and 'iat' (issued-at) claims.
|
|
43
|
-
*
|
|
44
|
-
* Notes:
|
|
45
|
-
* - May return a false negative if there's no native base64 decoding support.
|
|
46
|
-
* - Doesn't check if the token is actually valid.
|
|
47
|
-
*/
|
|
48
|
-
export declare const isValidTimestamp: (token: string) => boolean;
|
|
49
|
-
/**
|
|
50
|
-
* Decodes a Firebase auth. token and returns its issued at time if valid, null otherwise.
|
|
51
|
-
*
|
|
52
|
-
* Notes:
|
|
53
|
-
* - May return null if there's no native base64 decoding support.
|
|
54
|
-
* - Doesn't check if the token is actually valid.
|
|
55
|
-
*/
|
|
56
|
-
export declare const issuedAtTime: (token: string) => number | null;
|
|
57
|
-
/**
|
|
58
|
-
* Decodes a Firebase auth. token and checks the validity of its format. Expects a valid issued-at time.
|
|
59
|
-
*
|
|
60
|
-
* Notes:
|
|
61
|
-
* - May return a false negative if there's no native base64 decoding support.
|
|
62
|
-
* - Doesn't check if the token is actually valid.
|
|
63
|
-
*/
|
|
64
|
-
export declare const isValidFormat: (token: string) => boolean;
|
|
65
|
-
/**
|
|
66
|
-
* Attempts to peer into an auth token and determine if it's an admin auth token by looking at the claims portion.
|
|
67
|
-
*
|
|
68
|
-
* Notes:
|
|
69
|
-
* - May return a false negative if there's no native base64 decoding support.
|
|
70
|
-
* - Doesn't check if the token is actually valid.
|
|
71
|
-
*/
|
|
72
|
-
export declare const isAdmin: (token: string) => boolean;
|
|
73
|
-
export {};
|
|
@@ -1,30 +0,0 @@
|
|
|
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
|
-
export declare function contains<T extends object>(obj: T, key: string): boolean;
|
|
18
|
-
export declare function safeGet<T extends object, K extends keyof T>(obj: T, key: K): T[K] | undefined;
|
|
19
|
-
export declare function isEmpty(obj: object): obj is {};
|
|
20
|
-
export declare function map<K extends string, V, U>(obj: {
|
|
21
|
-
[key in K]: V;
|
|
22
|
-
}, fn: (value: V, key: K, obj: {
|
|
23
|
-
[key in K]: V;
|
|
24
|
-
}) => U, contextObj?: unknown): {
|
|
25
|
-
[key in K]: U;
|
|
26
|
-
};
|
|
27
|
-
/**
|
|
28
|
-
* Deep equal two objects. Support Arrays and Objects.
|
|
29
|
-
*/
|
|
30
|
-
export declare function deepEqual(a: object, b: object): boolean;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright 2022 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
|
-
/**
|
|
18
|
-
* Rejects if the given promise doesn't resolve in timeInMS milliseconds.
|
|
19
|
-
* @internal
|
|
20
|
-
*/
|
|
21
|
-
export declare function promiseWithTimeout<T>(promise: Promise<T>, timeInMS?: number): Promise<T>;
|
|
@@ -1,33 +0,0 @@
|
|
|
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
|
-
/**
|
|
18
|
-
* Returns a querystring-formatted string (e.g. &arg=val&arg2=val2) from a
|
|
19
|
-
* params object (e.g. {arg: 'val', arg2: 'val2'})
|
|
20
|
-
* Note: You must prepend it with ? when adding it to a URL.
|
|
21
|
-
*/
|
|
22
|
-
export declare function querystring(querystringParams: {
|
|
23
|
-
[key: string]: string | number;
|
|
24
|
-
}): string;
|
|
25
|
-
/**
|
|
26
|
-
* Decodes a querystring (e.g. ?arg=val&arg2=val2) into a params object
|
|
27
|
-
* (e.g. {arg: 'val', arg2: 'val2'})
|
|
28
|
-
*/
|
|
29
|
-
export declare function querystringDecode(querystring: string): Record<string, string>;
|
|
30
|
-
/**
|
|
31
|
-
* Extract the query string part of a URL, including the leading question mark (if present).
|
|
32
|
-
*/
|
|
33
|
-
export declare function extractQuerystring(url: string): string;
|
|
@@ -1,84 +0,0 @@
|
|
|
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
|
-
/**
|
|
18
|
-
* @fileoverview SHA-1 cryptographic hash.
|
|
19
|
-
* Variable names follow the notation in FIPS PUB 180-3:
|
|
20
|
-
* http://csrc.nist.gov/publications/fips/fips180-3/fips180-3_final.pdf.
|
|
21
|
-
*
|
|
22
|
-
* Usage:
|
|
23
|
-
* var sha1 = new sha1();
|
|
24
|
-
* sha1.update(bytes);
|
|
25
|
-
* var hash = sha1.digest();
|
|
26
|
-
*
|
|
27
|
-
* Performance:
|
|
28
|
-
* Chrome 23: ~400 Mbit/s
|
|
29
|
-
* Firefox 16: ~250 Mbit/s
|
|
30
|
-
*
|
|
31
|
-
*/
|
|
32
|
-
/**
|
|
33
|
-
* SHA-1 cryptographic hash constructor.
|
|
34
|
-
*
|
|
35
|
-
* The properties declared here are discussed in the above algorithm document.
|
|
36
|
-
* @constructor
|
|
37
|
-
* @final
|
|
38
|
-
* @struct
|
|
39
|
-
*/
|
|
40
|
-
export declare class Sha1 {
|
|
41
|
-
/**
|
|
42
|
-
* Holds the previous values of accumulated variables a-e in the compress_
|
|
43
|
-
* function.
|
|
44
|
-
* @private
|
|
45
|
-
*/
|
|
46
|
-
private chain_;
|
|
47
|
-
/**
|
|
48
|
-
* A buffer holding the partially computed hash result.
|
|
49
|
-
* @private
|
|
50
|
-
*/
|
|
51
|
-
private buf_;
|
|
52
|
-
/**
|
|
53
|
-
* An array of 80 bytes, each a part of the message to be hashed. Referred to
|
|
54
|
-
* as the message schedule in the docs.
|
|
55
|
-
* @private
|
|
56
|
-
*/
|
|
57
|
-
private W_;
|
|
58
|
-
/**
|
|
59
|
-
* Contains data needed to pad messages less than 64 bytes.
|
|
60
|
-
* @private
|
|
61
|
-
*/
|
|
62
|
-
private pad_;
|
|
63
|
-
/**
|
|
64
|
-
* @private {number}
|
|
65
|
-
*/
|
|
66
|
-
private inbuf_;
|
|
67
|
-
/**
|
|
68
|
-
* @private {number}
|
|
69
|
-
*/
|
|
70
|
-
private total_;
|
|
71
|
-
blockSize: number;
|
|
72
|
-
constructor();
|
|
73
|
-
reset(): void;
|
|
74
|
-
/**
|
|
75
|
-
* Internal compress helper function.
|
|
76
|
-
* @param buf Block to compress.
|
|
77
|
-
* @param offset Offset of the block in the buffer.
|
|
78
|
-
* @private
|
|
79
|
-
*/
|
|
80
|
-
compress_(buf: number[] | Uint8Array | string, offset?: number): void;
|
|
81
|
-
update(bytes?: number[] | Uint8Array | string, length?: number): void;
|
|
82
|
-
/** @override */
|
|
83
|
-
digest(): number[];
|
|
84
|
-
}
|
|
@@ -1,49 +0,0 @@
|
|
|
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
|
-
export type NextFn<T> = (value: T) => void;
|
|
18
|
-
export type ErrorFn = (error: Error) => void;
|
|
19
|
-
export type CompleteFn = () => void;
|
|
20
|
-
export interface Observer<T> {
|
|
21
|
-
next: NextFn<T>;
|
|
22
|
-
error: ErrorFn;
|
|
23
|
-
complete: CompleteFn;
|
|
24
|
-
}
|
|
25
|
-
export type PartialObserver<T> = Partial<Observer<T>>;
|
|
26
|
-
export type Unsubscribe = () => void;
|
|
27
|
-
/**
|
|
28
|
-
* The Subscribe interface has two forms - passing the inline function
|
|
29
|
-
* callbacks, or a object interface with callback properties.
|
|
30
|
-
*/
|
|
31
|
-
export interface Subscribe<T> {
|
|
32
|
-
(next?: NextFn<T>, error?: ErrorFn, complete?: CompleteFn): Unsubscribe;
|
|
33
|
-
(observer: PartialObserver<T>): Unsubscribe;
|
|
34
|
-
}
|
|
35
|
-
export interface Observable<T> {
|
|
36
|
-
subscribe: Subscribe<T>;
|
|
37
|
-
}
|
|
38
|
-
export type Executor<T> = (observer: Observer<T>) => void;
|
|
39
|
-
/**
|
|
40
|
-
* Helper to make a Subscribe function (just like Promise helps make a
|
|
41
|
-
* Thenable).
|
|
42
|
-
*
|
|
43
|
-
* @param executor Function which can make calls to a single Observer
|
|
44
|
-
* as a proxy.
|
|
45
|
-
* @param onNoObservers Callback when count of Observers goes to zero.
|
|
46
|
-
*/
|
|
47
|
-
export declare function createSubscribe<T>(executor: Executor<T>, onNoObservers?: Executor<T>): Subscribe<T>;
|
|
48
|
-
/** Turn synchronous function into one called asynchronously. */
|
|
49
|
-
export declare function async(fn: Function, onError?: ErrorFn): Function;
|
|
@@ -1,27 +0,0 @@
|
|
|
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
|
-
/**
|
|
18
|
-
* @param {string} str
|
|
19
|
-
* @return {Array}
|
|
20
|
-
*/
|
|
21
|
-
export declare const stringToByteArray: (str: string) => number[];
|
|
22
|
-
/**
|
|
23
|
-
* Calculate length without actually converting; useful for doing cheaper validation.
|
|
24
|
-
* @param {string} str
|
|
25
|
-
* @return {number}
|
|
26
|
-
*/
|
|
27
|
-
export declare const stringLength: (str: string) => number;
|
|
@@ -1,43 +0,0 @@
|
|
|
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
|
-
/**
|
|
18
|
-
* Check to make sure the appropriate number of arguments are provided for a public function.
|
|
19
|
-
* Throws an error if it fails.
|
|
20
|
-
*
|
|
21
|
-
* @param fnName The function name
|
|
22
|
-
* @param minCount The minimum number of arguments to allow for the function call
|
|
23
|
-
* @param maxCount The maximum number of argument to allow for the function call
|
|
24
|
-
* @param argCount The actual number of arguments provided.
|
|
25
|
-
*/
|
|
26
|
-
export declare const validateArgCount: (fnName: string, minCount: number, maxCount: number, argCount: number) => void;
|
|
27
|
-
/**
|
|
28
|
-
* Generates a string to prefix an error message about failed argument validation
|
|
29
|
-
*
|
|
30
|
-
* @param fnName The function name
|
|
31
|
-
* @param argName The name of the argument
|
|
32
|
-
* @return The prefix to add to the error thrown for validation.
|
|
33
|
-
*/
|
|
34
|
-
export declare function errorPrefix(fnName: string, argName: string): string;
|
|
35
|
-
/**
|
|
36
|
-
* @param fnName
|
|
37
|
-
* @param argumentNumber
|
|
38
|
-
* @param namespace
|
|
39
|
-
* @param optional
|
|
40
|
-
*/
|
|
41
|
-
export declare function validateNamespace(fnName: string, namespace: string, optional: boolean): void;
|
|
42
|
-
export declare function validateCallback(fnName: string, argumentName: string, callback: Function, optional: boolean): void;
|
|
43
|
-
export declare function validateContextObject(fnName: string, argumentName: string, context: unknown, optional: boolean): void;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright 2021 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 '@firebase/firestore-compat';
|
package/dist/util/index.d.ts
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
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
|
-
export * from './src/assert';
|
|
18
|
-
export * from './src/crypt';
|
|
19
|
-
export * from './src/constants';
|
|
20
|
-
export * from './src/deepCopy';
|
|
21
|
-
export * from './src/defaults';
|
|
22
|
-
export * from './src/deferred';
|
|
23
|
-
export * from './src/emulator';
|
|
24
|
-
export * from './src/environment';
|
|
25
|
-
export * from './src/errors';
|
|
26
|
-
export * from './src/json';
|
|
27
|
-
export * from './src/jwt';
|
|
28
|
-
export * from './src/obj';
|
|
29
|
-
export * from './src/promise';
|
|
30
|
-
export * from './src/query';
|
|
31
|
-
export * from './src/sha1';
|
|
32
|
-
export * from './src/subscribe';
|
|
33
|
-
export * from './src/validation';
|
|
34
|
-
export * from './src/utf8';
|
|
35
|
-
export * from './src/exponential_backoff';
|
|
36
|
-
export * from './src/formatters';
|
|
37
|
-
export * from './src/compat';
|
|
38
|
-
export * from './src/global';
|
|
@@ -1,24 +0,0 @@
|
|
|
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
|
-
/**
|
|
18
|
-
* Throws an error if the provided assertion is falsy
|
|
19
|
-
*/
|
|
20
|
-
export declare const assert: (assertion: unknown, message: string) => void;
|
|
21
|
-
/**
|
|
22
|
-
* Returns an Error object suitable for throwing.
|
|
23
|
-
*/
|
|
24
|
-
export declare const assertionError: (message: string) => Error;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright 2021 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
|
-
export interface Compat<T> {
|
|
18
|
-
_delegate: T;
|
|
19
|
-
}
|
|
20
|
-
export declare function getModularInstance<ExpService>(service: Compat<ExpService> | ExpService): ExpService;
|