firebase-admin 9.100.0-alpha.0 → 10.0.2
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/README.md +7 -3
- package/lib/app/core.d.ts +15 -22
- package/lib/app/core.js +1 -1
- package/lib/app/credential-factory.d.ts +17 -33
- package/lib/app/credential-factory.js +17 -33
- package/lib/app/credential-internal.d.ts +10 -9
- package/lib/app/credential-internal.js +15 -13
- package/lib/app/credential.d.ts +3 -9
- package/lib/app/credential.js +1 -1
- package/lib/app/firebase-app.d.ts +6 -30
- package/lib/app/firebase-app.js +72 -216
- package/lib/app/firebase-namespace.d.ts +28 -34
- package/lib/app/firebase-namespace.js +119 -99
- package/lib/app/index.d.ts +6 -1
- package/lib/app/index.js +1 -1
- package/lib/app/lifecycle.d.ts +24 -3
- package/lib/app/lifecycle.js +119 -25
- package/lib/app-check/app-check-api-client-internal.d.ts +32 -0
- package/lib/app-check/app-check-api-client-internal.js +197 -0
- package/lib/app-check/app-check-api.d.ts +95 -0
- package/lib/app-check/app-check-api.js +19 -0
- package/lib/app-check/app-check-namespace.d.ts +65 -0
- package/lib/app-check/app-check-namespace.js +18 -0
- package/lib/app-check/app-check.d.ts +49 -0
- package/lib/app-check/app-check.js +82 -0
- package/lib/app-check/index.d.ts +53 -0
- package/lib/app-check/index.js +63 -0
- package/lib/app-check/token-generator.d.ts +25 -0
- package/lib/app-check/token-generator.js +159 -0
- package/lib/app-check/token-verifier.d.ts +17 -0
- package/lib/app-check/token-verifier.js +151 -0
- package/lib/auth/action-code-settings-builder.d.ts +1 -1
- package/lib/auth/action-code-settings-builder.js +2 -2
- package/lib/auth/auth-api-request.d.ts +28 -32
- package/lib/auth/auth-api-request.js +167 -125
- package/lib/auth/auth-config.d.ts +123 -21
- package/lib/auth/auth-config.js +85 -34
- package/lib/auth/auth-namespace.d.ts +157 -4
- package/lib/auth/auth-namespace.js +1 -1
- package/lib/auth/auth.d.ts +5 -3
- package/lib/auth/auth.js +6 -4
- package/lib/auth/base-auth.d.ts +134 -116
- package/lib/auth/base-auth.js +213 -143
- package/lib/auth/identifier.d.ts +5 -5
- package/lib/auth/identifier.js +1 -1
- package/lib/auth/index.d.ts +10 -5
- package/lib/auth/index.js +9 -4
- package/lib/auth/tenant-manager.d.ts +19 -19
- package/lib/auth/tenant-manager.js +21 -25
- package/lib/auth/tenant.d.ts +14 -5
- package/lib/auth/tenant.js +19 -11
- package/lib/auth/token-generator.d.ts +7 -108
- package/lib/auth/token-generator.js +52 -145
- package/lib/auth/token-verifier.d.ts +3 -4
- package/lib/auth/token-verifier.js +96 -145
- package/lib/auth/user-import-builder.d.ts +11 -11
- package/lib/auth/user-import-builder.js +9 -9
- package/lib/auth/user-record.d.ts +23 -15
- package/lib/auth/user-record.js +30 -20
- package/lib/credential/index.d.ts +18 -35
- package/lib/credential/index.js +17 -33
- package/lib/database/database-namespace.d.ts +39 -10
- package/lib/database/database-namespace.js +1 -1
- package/lib/database/database.d.ts +16 -6
- package/lib/database/database.js +61 -6
- package/lib/database/index.d.ts +19 -18
- package/lib/database/index.js +21 -23
- package/lib/default-namespace.d.ts +7 -1
- package/lib/default-namespace.js +4 -4
- package/lib/esm/app/index.js +10 -0
- package/lib/esm/app-check/index.js +4 -0
- package/lib/esm/auth/index.js +14 -0
- package/lib/esm/database/index.js +6 -0
- package/lib/esm/firestore/index.js +24 -0
- package/lib/esm/installations/index.js +4 -0
- package/lib/esm/instance-id/index.js +4 -0
- package/lib/esm/machine-learning/index.js +5 -0
- package/lib/esm/messaging/index.js +4 -0
- package/lib/esm/package.json +1 -0
- package/lib/esm/project-management/index.js +8 -0
- package/lib/esm/remote-config/index.js +4 -0
- package/lib/esm/security-rules/index.js +6 -0
- package/lib/esm/storage/index.js +4 -0
- package/lib/firebase-namespace-api.d.ts +12 -6
- package/lib/firebase-namespace-api.js +5 -1
- package/lib/firestore/firestore-internal.d.ts +2 -2
- package/lib/firestore/firestore-internal.js +2 -2
- package/lib/firestore/firestore-namespace.d.ts +6 -1
- package/lib/firestore/firestore-namespace.js +2 -1
- package/lib/firestore/index.d.ts +36 -4
- package/lib/firestore/index.js +29 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/installations/index.d.ts +52 -0
- package/lib/installations/index.js +62 -0
- package/lib/installations/installations-namespace.d.ts +55 -0
- package/lib/installations/installations-namespace.js +18 -0
- package/lib/{instance-id/instance-id-request-internal.d.ts → installations/installations-request-handler.d.ts} +8 -8
- package/lib/{instance-id/instance-id-request-internal.js → installations/installations-request-handler.js} +23 -23
- package/lib/installations/installations.d.ts +38 -0
- package/lib/installations/installations.js +63 -0
- package/lib/instance-id/index.d.ts +20 -9
- package/lib/instance-id/index.js +20 -9
- package/lib/instance-id/instance-id-namespace.d.ts +9 -8
- package/lib/instance-id/instance-id-namespace.js +1 -1
- package/lib/instance-id/instance-id.d.ts +8 -6
- package/lib/instance-id/instance-id.js +20 -11
- package/lib/machine-learning/index.d.ts +29 -27
- package/lib/machine-learning/index.js +29 -27
- package/lib/machine-learning/machine-learning-api-client.d.ts +1 -1
- package/lib/machine-learning/machine-learning-api-client.js +4 -4
- package/lib/machine-learning/machine-learning-namespace.d.ts +33 -8
- package/lib/machine-learning/machine-learning-namespace.js +1 -1
- package/lib/machine-learning/machine-learning-utils.d.ts +1 -1
- package/lib/machine-learning/machine-learning-utils.js +1 -1
- package/lib/machine-learning/machine-learning.d.ts +19 -19
- package/lib/machine-learning/machine-learning.js +20 -20
- package/lib/messaging/batch-request-internal.d.ts +3 -3
- package/lib/messaging/batch-request-internal.js +9 -9
- package/lib/messaging/index.d.ts +11 -9
- package/lib/messaging/index.js +11 -9
- package/lib/messaging/messaging-api-request-internal.d.ts +8 -8
- package/lib/messaging/messaging-api-request-internal.js +8 -8
- package/lib/messaging/messaging-api.d.ts +79 -75
- package/lib/messaging/messaging-api.js +1 -1
- package/lib/messaging/messaging-errors-internal.d.ts +5 -5
- package/lib/messaging/messaging-errors-internal.js +7 -7
- package/lib/messaging/messaging-internal.d.ts +1 -1
- package/lib/messaging/messaging-internal.js +6 -31
- package/lib/messaging/messaging-namespace.d.ts +105 -8
- package/lib/messaging/messaging-namespace.js +1 -1
- package/lib/messaging/messaging.d.ts +70 -86
- package/lib/messaging/messaging.js +76 -89
- package/lib/project-management/android-app.d.ts +11 -12
- package/lib/project-management/android-app.js +13 -14
- package/lib/project-management/app-metadata.d.ts +1 -1
- package/lib/project-management/app-metadata.js +1 -1
- package/lib/project-management/index.d.ts +11 -9
- package/lib/project-management/index.js +11 -9
- package/lib/project-management/ios-app.d.ts +6 -7
- package/lib/project-management/ios-app.js +6 -7
- package/lib/project-management/project-management-api-request-internal.d.ts +1 -80
- package/lib/project-management/project-management-api-request-internal.js +14 -14
- package/lib/project-management/project-management-namespace.d.ts +31 -9
- package/lib/project-management/project-management-namespace.js +1 -1
- package/lib/project-management/project-management.d.ts +18 -21
- package/lib/project-management/project-management.js +19 -22
- package/lib/remote-config/index.d.ts +12 -10
- package/lib/remote-config/index.js +11 -9
- package/lib/remote-config/remote-config-api-client-internal.d.ts +1 -1
- package/lib/remote-config/remote-config-api-client-internal.js +2 -2
- package/lib/remote-config/remote-config-api.d.ts +12 -2
- package/lib/remote-config/remote-config-api.js +1 -1
- package/lib/remote-config/remote-config-namespace.d.ts +50 -9
- package/lib/remote-config/remote-config-namespace.js +1 -1
- package/lib/remote-config/remote-config.d.ts +19 -21
- package/lib/remote-config/remote-config.js +25 -25
- package/lib/security-rules/index.d.ts +12 -10
- package/lib/security-rules/index.js +12 -10
- package/lib/security-rules/security-rules-api-client-internal.d.ts +1 -1
- package/lib/security-rules/security-rules-api-client-internal.js +1 -1
- package/lib/security-rules/security-rules-internal.d.ts +1 -1
- package/lib/security-rules/security-rules-internal.js +1 -1
- package/lib/security-rules/security-rules-namespace.d.ts +43 -28
- package/lib/security-rules/security-rules-namespace.js +1 -1
- package/lib/security-rules/security-rules.d.ts +39 -42
- package/lib/security-rules/security-rules.js +38 -39
- package/lib/storage/index.d.ts +9 -7
- package/lib/storage/index.js +9 -7
- package/lib/storage/storage-namespace.d.ts +7 -6
- package/lib/storage/storage-namespace.js +1 -1
- package/lib/storage/storage.d.ts +3 -3
- package/lib/storage/storage.js +14 -4
- package/lib/utils/api-request.d.ts +24 -24
- package/lib/utils/api-request.js +25 -25
- package/lib/utils/crypto-signer.d.ts +128 -0
- package/lib/utils/crypto-signer.js +237 -0
- package/lib/utils/deep-copy.d.ts +6 -6
- package/lib/utils/deep-copy.js +6 -6
- package/lib/utils/error.d.ts +69 -36
- package/lib/utils/error.js +98 -43
- package/lib/utils/index.d.ts +30 -19
- package/lib/utils/index.js +47 -20
- package/lib/utils/jwt.d.ts +131 -0
- package/lib/utils/jwt.js +355 -0
- package/lib/utils/validator.d.ts +37 -37
- package/lib/utils/validator.js +37 -37
- package/package.json +126 -53
package/lib/utils/validator.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! firebase-admin
|
|
1
|
+
/*! firebase-admin v10.0.2 */
|
|
2
2
|
/*!
|
|
3
3
|
* @license
|
|
4
4
|
* Copyright 2017 Google Inc.
|
|
@@ -19,126 +19,126 @@
|
|
|
19
19
|
/**
|
|
20
20
|
* Validates that a value is a byte buffer.
|
|
21
21
|
*
|
|
22
|
-
* @param
|
|
23
|
-
* @
|
|
22
|
+
* @param value - The value to validate.
|
|
23
|
+
* @returns Whether the value is byte buffer or not.
|
|
24
24
|
*/
|
|
25
25
|
export declare function isBuffer(value: any): value is Buffer;
|
|
26
26
|
/**
|
|
27
27
|
* Validates that a value is an array.
|
|
28
28
|
*
|
|
29
|
-
* @param
|
|
30
|
-
* @
|
|
29
|
+
* @param value - The value to validate.
|
|
30
|
+
* @returns Whether the value is an array or not.
|
|
31
31
|
*/
|
|
32
32
|
export declare function isArray<T>(value: any): value is T[];
|
|
33
33
|
/**
|
|
34
34
|
* Validates that a value is a non-empty array.
|
|
35
35
|
*
|
|
36
|
-
* @param
|
|
37
|
-
* @
|
|
36
|
+
* @param value - The value to validate.
|
|
37
|
+
* @returns Whether the value is a non-empty array or not.
|
|
38
38
|
*/
|
|
39
39
|
export declare function isNonEmptyArray<T>(value: any): value is T[];
|
|
40
40
|
/**
|
|
41
41
|
* Validates that a value is a boolean.
|
|
42
42
|
*
|
|
43
|
-
* @param
|
|
44
|
-
* @
|
|
43
|
+
* @param value - The value to validate.
|
|
44
|
+
* @returns Whether the value is a boolean or not.
|
|
45
45
|
*/
|
|
46
46
|
export declare function isBoolean(value: any): boolean;
|
|
47
47
|
/**
|
|
48
48
|
* Validates that a value is a number.
|
|
49
49
|
*
|
|
50
|
-
* @param
|
|
51
|
-
* @
|
|
50
|
+
* @param value - The value to validate.
|
|
51
|
+
* @returns Whether the value is a number or not.
|
|
52
52
|
*/
|
|
53
53
|
export declare function isNumber(value: any): boolean;
|
|
54
54
|
/**
|
|
55
55
|
* Validates that a value is a string.
|
|
56
56
|
*
|
|
57
|
-
* @param
|
|
58
|
-
* @
|
|
57
|
+
* @param value - The value to validate.
|
|
58
|
+
* @returns Whether the value is a string or not.
|
|
59
59
|
*/
|
|
60
60
|
export declare function isString(value: any): value is string;
|
|
61
61
|
/**
|
|
62
62
|
* Validates that a value is a base64 string.
|
|
63
63
|
*
|
|
64
|
-
* @param
|
|
65
|
-
* @
|
|
64
|
+
* @param value - The value to validate.
|
|
65
|
+
* @returns Whether the value is a base64 string or not.
|
|
66
66
|
*/
|
|
67
67
|
export declare function isBase64String(value: any): boolean;
|
|
68
68
|
/**
|
|
69
69
|
* Validates that a value is a non-empty string.
|
|
70
70
|
*
|
|
71
|
-
* @param
|
|
72
|
-
* @
|
|
71
|
+
* @param value - The value to validate.
|
|
72
|
+
* @returns Whether the value is a non-empty string or not.
|
|
73
73
|
*/
|
|
74
74
|
export declare function isNonEmptyString(value: any): value is string;
|
|
75
75
|
/**
|
|
76
76
|
* Validates that a value is a nullable object.
|
|
77
77
|
*
|
|
78
|
-
* @param
|
|
79
|
-
* @
|
|
78
|
+
* @param value - The value to validate.
|
|
79
|
+
* @returns Whether the value is an object or not.
|
|
80
80
|
*/
|
|
81
81
|
export declare function isObject(value: any): boolean;
|
|
82
82
|
/**
|
|
83
83
|
* Validates that a value is a non-null object.
|
|
84
84
|
*
|
|
85
|
-
* @param
|
|
86
|
-
* @
|
|
85
|
+
* @param value - The value to validate.
|
|
86
|
+
* @returns Whether the value is a non-null object or not.
|
|
87
87
|
*/
|
|
88
88
|
export declare function isNonNullObject<T>(value: T | null | undefined): value is T;
|
|
89
89
|
/**
|
|
90
90
|
* Validates that a string is a valid Firebase Auth uid.
|
|
91
91
|
*
|
|
92
|
-
* @param
|
|
93
|
-
* @
|
|
92
|
+
* @param uid - The string to validate.
|
|
93
|
+
* @returns Whether the string is a valid Firebase Auth uid.
|
|
94
94
|
*/
|
|
95
95
|
export declare function isUid(uid: any): boolean;
|
|
96
96
|
/**
|
|
97
97
|
* Validates that a string is a valid Firebase Auth password.
|
|
98
98
|
*
|
|
99
|
-
* @param
|
|
100
|
-
* @
|
|
99
|
+
* @param password - The password string to validate.
|
|
100
|
+
* @returns Whether the string is a valid Firebase Auth password.
|
|
101
101
|
*/
|
|
102
102
|
export declare function isPassword(password: any): boolean;
|
|
103
103
|
/**
|
|
104
104
|
* Validates that a string is a valid email.
|
|
105
105
|
*
|
|
106
|
-
* @param
|
|
107
|
-
* @
|
|
106
|
+
* @param email - The string to validate.
|
|
107
|
+
* @returns Whether the string is valid email or not.
|
|
108
108
|
*/
|
|
109
109
|
export declare function isEmail(email: any): boolean;
|
|
110
110
|
/**
|
|
111
111
|
* Validates that a string is a valid phone number.
|
|
112
112
|
*
|
|
113
|
-
* @param
|
|
114
|
-
* @
|
|
113
|
+
* @param phoneNumber - The string to validate.
|
|
114
|
+
* @returns Whether the string is a valid phone number or not.
|
|
115
115
|
*/
|
|
116
116
|
export declare function isPhoneNumber(phoneNumber: any): boolean;
|
|
117
117
|
/**
|
|
118
118
|
* Validates that a string is a valid ISO date string.
|
|
119
119
|
*
|
|
120
|
-
* @param dateString The string to validate.
|
|
121
|
-
* @
|
|
120
|
+
* @param dateString - The string to validate.
|
|
121
|
+
* @returns Whether the string is a valid ISO date string.
|
|
122
122
|
*/
|
|
123
123
|
export declare function isISODateString(dateString: any): boolean;
|
|
124
124
|
/**
|
|
125
125
|
* Validates that a string is a valid UTC date string.
|
|
126
126
|
*
|
|
127
|
-
* @param dateString The string to validate.
|
|
128
|
-
* @
|
|
127
|
+
* @param dateString - The string to validate.
|
|
128
|
+
* @returns Whether the string is a valid UTC date string.
|
|
129
129
|
*/
|
|
130
130
|
export declare function isUTCDateString(dateString: any): boolean;
|
|
131
131
|
/**
|
|
132
132
|
* Validates that a string is a valid web URL.
|
|
133
133
|
*
|
|
134
|
-
* @param
|
|
135
|
-
* @
|
|
134
|
+
* @param urlStr - The string to validate.
|
|
135
|
+
* @returns Whether the string is valid web URL or not.
|
|
136
136
|
*/
|
|
137
137
|
export declare function isURL(urlStr: any): boolean;
|
|
138
138
|
/**
|
|
139
139
|
* Validates that the provided topic is a valid FCM topic name.
|
|
140
140
|
*
|
|
141
|
-
* @param
|
|
142
|
-
* @
|
|
141
|
+
* @param topic - The topic to validate.
|
|
142
|
+
* @returns Whether the provided topic is a valid FCM topic name.
|
|
143
143
|
*/
|
|
144
144
|
export declare function isTopic(topic: any): boolean;
|
package/lib/utils/validator.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! firebase-admin
|
|
1
|
+
/*! firebase-admin v10.0.2 */
|
|
2
2
|
"use strict";
|
|
3
3
|
/*!
|
|
4
4
|
* @license
|
|
@@ -22,8 +22,8 @@ var url = require("url");
|
|
|
22
22
|
/**
|
|
23
23
|
* Validates that a value is a byte buffer.
|
|
24
24
|
*
|
|
25
|
-
* @param
|
|
26
|
-
* @
|
|
25
|
+
* @param value - The value to validate.
|
|
26
|
+
* @returns Whether the value is byte buffer or not.
|
|
27
27
|
*/
|
|
28
28
|
function isBuffer(value) {
|
|
29
29
|
return value instanceof Buffer;
|
|
@@ -32,8 +32,8 @@ exports.isBuffer = isBuffer;
|
|
|
32
32
|
/**
|
|
33
33
|
* Validates that a value is an array.
|
|
34
34
|
*
|
|
35
|
-
* @param
|
|
36
|
-
* @
|
|
35
|
+
* @param value - The value to validate.
|
|
36
|
+
* @returns Whether the value is an array or not.
|
|
37
37
|
*/
|
|
38
38
|
function isArray(value) {
|
|
39
39
|
return Array.isArray(value);
|
|
@@ -42,8 +42,8 @@ exports.isArray = isArray;
|
|
|
42
42
|
/**
|
|
43
43
|
* Validates that a value is a non-empty array.
|
|
44
44
|
*
|
|
45
|
-
* @param
|
|
46
|
-
* @
|
|
45
|
+
* @param value - The value to validate.
|
|
46
|
+
* @returns Whether the value is a non-empty array or not.
|
|
47
47
|
*/
|
|
48
48
|
function isNonEmptyArray(value) {
|
|
49
49
|
return isArray(value) && value.length !== 0;
|
|
@@ -52,8 +52,8 @@ exports.isNonEmptyArray = isNonEmptyArray;
|
|
|
52
52
|
/**
|
|
53
53
|
* Validates that a value is a boolean.
|
|
54
54
|
*
|
|
55
|
-
* @param
|
|
56
|
-
* @
|
|
55
|
+
* @param value - The value to validate.
|
|
56
|
+
* @returns Whether the value is a boolean or not.
|
|
57
57
|
*/
|
|
58
58
|
function isBoolean(value) {
|
|
59
59
|
return typeof value === 'boolean';
|
|
@@ -62,8 +62,8 @@ exports.isBoolean = isBoolean;
|
|
|
62
62
|
/**
|
|
63
63
|
* Validates that a value is a number.
|
|
64
64
|
*
|
|
65
|
-
* @param
|
|
66
|
-
* @
|
|
65
|
+
* @param value - The value to validate.
|
|
66
|
+
* @returns Whether the value is a number or not.
|
|
67
67
|
*/
|
|
68
68
|
function isNumber(value) {
|
|
69
69
|
return typeof value === 'number' && !isNaN(value);
|
|
@@ -72,8 +72,8 @@ exports.isNumber = isNumber;
|
|
|
72
72
|
/**
|
|
73
73
|
* Validates that a value is a string.
|
|
74
74
|
*
|
|
75
|
-
* @param
|
|
76
|
-
* @
|
|
75
|
+
* @param value - The value to validate.
|
|
76
|
+
* @returns Whether the value is a string or not.
|
|
77
77
|
*/
|
|
78
78
|
function isString(value) {
|
|
79
79
|
return typeof value === 'string';
|
|
@@ -82,8 +82,8 @@ exports.isString = isString;
|
|
|
82
82
|
/**
|
|
83
83
|
* Validates that a value is a base64 string.
|
|
84
84
|
*
|
|
85
|
-
* @param
|
|
86
|
-
* @
|
|
85
|
+
* @param value - The value to validate.
|
|
86
|
+
* @returns Whether the value is a base64 string or not.
|
|
87
87
|
*/
|
|
88
88
|
function isBase64String(value) {
|
|
89
89
|
if (!isString(value)) {
|
|
@@ -95,8 +95,8 @@ exports.isBase64String = isBase64String;
|
|
|
95
95
|
/**
|
|
96
96
|
* Validates that a value is a non-empty string.
|
|
97
97
|
*
|
|
98
|
-
* @param
|
|
99
|
-
* @
|
|
98
|
+
* @param value - The value to validate.
|
|
99
|
+
* @returns Whether the value is a non-empty string or not.
|
|
100
100
|
*/
|
|
101
101
|
function isNonEmptyString(value) {
|
|
102
102
|
return isString(value) && value !== '';
|
|
@@ -105,8 +105,8 @@ exports.isNonEmptyString = isNonEmptyString;
|
|
|
105
105
|
/**
|
|
106
106
|
* Validates that a value is a nullable object.
|
|
107
107
|
*
|
|
108
|
-
* @param
|
|
109
|
-
* @
|
|
108
|
+
* @param value - The value to validate.
|
|
109
|
+
* @returns Whether the value is an object or not.
|
|
110
110
|
*/
|
|
111
111
|
function isObject(value) {
|
|
112
112
|
return typeof value === 'object' && !isArray(value);
|
|
@@ -115,8 +115,8 @@ exports.isObject = isObject;
|
|
|
115
115
|
/**
|
|
116
116
|
* Validates that a value is a non-null object.
|
|
117
117
|
*
|
|
118
|
-
* @param
|
|
119
|
-
* @
|
|
118
|
+
* @param value - The value to validate.
|
|
119
|
+
* @returns Whether the value is a non-null object or not.
|
|
120
120
|
*/
|
|
121
121
|
function isNonNullObject(value) {
|
|
122
122
|
return isObject(value) && value !== null;
|
|
@@ -125,8 +125,8 @@ exports.isNonNullObject = isNonNullObject;
|
|
|
125
125
|
/**
|
|
126
126
|
* Validates that a string is a valid Firebase Auth uid.
|
|
127
127
|
*
|
|
128
|
-
* @param
|
|
129
|
-
* @
|
|
128
|
+
* @param uid - The string to validate.
|
|
129
|
+
* @returns Whether the string is a valid Firebase Auth uid.
|
|
130
130
|
*/
|
|
131
131
|
function isUid(uid) {
|
|
132
132
|
return typeof uid === 'string' && uid.length > 0 && uid.length <= 128;
|
|
@@ -135,8 +135,8 @@ exports.isUid = isUid;
|
|
|
135
135
|
/**
|
|
136
136
|
* Validates that a string is a valid Firebase Auth password.
|
|
137
137
|
*
|
|
138
|
-
* @param
|
|
139
|
-
* @
|
|
138
|
+
* @param password - The password string to validate.
|
|
139
|
+
* @returns Whether the string is a valid Firebase Auth password.
|
|
140
140
|
*/
|
|
141
141
|
function isPassword(password) {
|
|
142
142
|
// A password must be a string of at least 6 characters.
|
|
@@ -146,8 +146,8 @@ exports.isPassword = isPassword;
|
|
|
146
146
|
/**
|
|
147
147
|
* Validates that a string is a valid email.
|
|
148
148
|
*
|
|
149
|
-
* @param
|
|
150
|
-
* @
|
|
149
|
+
* @param email - The string to validate.
|
|
150
|
+
* @returns Whether the string is valid email or not.
|
|
151
151
|
*/
|
|
152
152
|
function isEmail(email) {
|
|
153
153
|
if (typeof email !== 'string') {
|
|
@@ -161,8 +161,8 @@ exports.isEmail = isEmail;
|
|
|
161
161
|
/**
|
|
162
162
|
* Validates that a string is a valid phone number.
|
|
163
163
|
*
|
|
164
|
-
* @param
|
|
165
|
-
* @
|
|
164
|
+
* @param phoneNumber - The string to validate.
|
|
165
|
+
* @returns Whether the string is a valid phone number or not.
|
|
166
166
|
*/
|
|
167
167
|
function isPhoneNumber(phoneNumber) {
|
|
168
168
|
if (typeof phoneNumber !== 'string') {
|
|
@@ -180,8 +180,8 @@ exports.isPhoneNumber = isPhoneNumber;
|
|
|
180
180
|
/**
|
|
181
181
|
* Validates that a string is a valid ISO date string.
|
|
182
182
|
*
|
|
183
|
-
* @param dateString The string to validate.
|
|
184
|
-
* @
|
|
183
|
+
* @param dateString - The string to validate.
|
|
184
|
+
* @returns Whether the string is a valid ISO date string.
|
|
185
185
|
*/
|
|
186
186
|
function isISODateString(dateString) {
|
|
187
187
|
try {
|
|
@@ -196,8 +196,8 @@ exports.isISODateString = isISODateString;
|
|
|
196
196
|
/**
|
|
197
197
|
* Validates that a string is a valid UTC date string.
|
|
198
198
|
*
|
|
199
|
-
* @param dateString The string to validate.
|
|
200
|
-
* @
|
|
199
|
+
* @param dateString - The string to validate.
|
|
200
|
+
* @returns Whether the string is a valid UTC date string.
|
|
201
201
|
*/
|
|
202
202
|
function isUTCDateString(dateString) {
|
|
203
203
|
try {
|
|
@@ -212,8 +212,8 @@ exports.isUTCDateString = isUTCDateString;
|
|
|
212
212
|
/**
|
|
213
213
|
* Validates that a string is a valid web URL.
|
|
214
214
|
*
|
|
215
|
-
* @param
|
|
216
|
-
* @
|
|
215
|
+
* @param urlStr - The string to validate.
|
|
216
|
+
* @returns Whether the string is valid web URL or not.
|
|
217
217
|
*/
|
|
218
218
|
function isURL(urlStr) {
|
|
219
219
|
if (typeof urlStr !== 'string') {
|
|
@@ -258,8 +258,8 @@ exports.isURL = isURL;
|
|
|
258
258
|
/**
|
|
259
259
|
* Validates that the provided topic is a valid FCM topic name.
|
|
260
260
|
*
|
|
261
|
-
* @param
|
|
262
|
-
* @
|
|
261
|
+
* @param topic - The topic to validate.
|
|
262
|
+
* @returns Whether the provided topic is a valid FCM topic name.
|
|
263
263
|
*/
|
|
264
264
|
function isTopic(topic) {
|
|
265
265
|
if (typeof topic !== 'string') {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "firebase-admin",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "10.0.2",
|
|
4
4
|
"description": "Firebase admin SDK for Node.js",
|
|
5
5
|
"author": "Firebase <firebase-support@google.com> (https://firebase.google.com/)",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"scripts": {
|
|
12
12
|
"build": "gulp build",
|
|
13
13
|
"build:tests": "gulp compile_test",
|
|
14
|
-
"prepare": "npm run build",
|
|
14
|
+
"prepare": "npm run build && npm run esm-wrap",
|
|
15
15
|
"lint": "run-p lint:src lint:test",
|
|
16
16
|
"test": "run-s lint test:unit",
|
|
17
17
|
"integration": "run-s build test:integration",
|
|
@@ -20,9 +20,14 @@
|
|
|
20
20
|
"test:coverage": "nyc npm run test:unit",
|
|
21
21
|
"lint:src": "eslint src/ --ext .ts",
|
|
22
22
|
"lint:test": "eslint test/ --ext .ts",
|
|
23
|
-
"apidocs": "
|
|
23
|
+
"apidocs": "run-s api-extractor:local api-documenter",
|
|
24
24
|
"api-extractor": "node generate-reports.js",
|
|
25
|
-
"api-extractor:local": "npm run build && node generate-reports.js --local"
|
|
25
|
+
"api-extractor:local": "npm run build && node generate-reports.js --local",
|
|
26
|
+
"esm-wrap": "node generate-esm-wrapper.js",
|
|
27
|
+
"api-documenter": "run-s api-documenter:markdown api-documenter:toc api-documenter:post",
|
|
28
|
+
"api-documenter:markdown": "api-documenter-fire markdown --input temp --output docgen/markdown -s",
|
|
29
|
+
"api-documenter:toc": "api-documenter-fire toc --input temp --output docgen/markdown -p /docs/reference/admin/node -s",
|
|
30
|
+
"api-documenter:post": "node docgen/post-process.js"
|
|
26
31
|
},
|
|
27
32
|
"nyc": {
|
|
28
33
|
"extension": [
|
|
@@ -57,95 +62,163 @@
|
|
|
57
62
|
"types": "./lib/index.d.ts",
|
|
58
63
|
"typesVersions": {
|
|
59
64
|
"*": {
|
|
60
|
-
"app": [
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
"
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
"
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
"
|
|
70
|
-
|
|
65
|
+
"app": [
|
|
66
|
+
"lib/app"
|
|
67
|
+
],
|
|
68
|
+
"app-check": [
|
|
69
|
+
"lib/app-check"
|
|
70
|
+
],
|
|
71
|
+
"auth": [
|
|
72
|
+
"lib/auth"
|
|
73
|
+
],
|
|
74
|
+
"database": [
|
|
75
|
+
"lib/database"
|
|
76
|
+
],
|
|
77
|
+
"firestore": [
|
|
78
|
+
"lib/firestore"
|
|
79
|
+
],
|
|
80
|
+
"installations": [
|
|
81
|
+
"lib/installations"
|
|
82
|
+
],
|
|
83
|
+
"instance-id": [
|
|
84
|
+
"lib/instance-id"
|
|
85
|
+
],
|
|
86
|
+
"machine-learning": [
|
|
87
|
+
"lib/machine-learning"
|
|
88
|
+
],
|
|
89
|
+
"messaging": [
|
|
90
|
+
"lib/messaging"
|
|
91
|
+
],
|
|
92
|
+
"project-management": [
|
|
93
|
+
"lib/project-management"
|
|
94
|
+
],
|
|
95
|
+
"remote-config": [
|
|
96
|
+
"lib/remote-config"
|
|
97
|
+
],
|
|
98
|
+
"security-rules": [
|
|
99
|
+
"lib/security-rules"
|
|
100
|
+
],
|
|
101
|
+
"storage": [
|
|
102
|
+
"lib/storage"
|
|
103
|
+
]
|
|
71
104
|
}
|
|
72
105
|
},
|
|
73
106
|
"exports": {
|
|
74
107
|
".": "./lib/index.js",
|
|
75
|
-
"./app":
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
"./
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
"./
|
|
84
|
-
|
|
85
|
-
|
|
108
|
+
"./app": {
|
|
109
|
+
"require": "./lib/app/index.js",
|
|
110
|
+
"import": "./lib/esm/app/index.js"
|
|
111
|
+
},
|
|
112
|
+
"./app-check": {
|
|
113
|
+
"require": "./lib/app-check/index.js",
|
|
114
|
+
"import": "./lib/esm/app-check/index.js"
|
|
115
|
+
},
|
|
116
|
+
"./auth": {
|
|
117
|
+
"require": "./lib/auth/index.js",
|
|
118
|
+
"import": "./lib/esm/auth/index.js"
|
|
119
|
+
},
|
|
120
|
+
"./database": {
|
|
121
|
+
"require": "./lib/database/index.js",
|
|
122
|
+
"import": "./lib/esm/database/index.js"
|
|
123
|
+
},
|
|
124
|
+
"./firestore": {
|
|
125
|
+
"require": "./lib/firestore/index.js",
|
|
126
|
+
"import": "./lib/esm/firestore/index.js"
|
|
127
|
+
},
|
|
128
|
+
"./installations": {
|
|
129
|
+
"require": "./lib/installations/index.js",
|
|
130
|
+
"import": "./lib/esm/installations/index.js"
|
|
131
|
+
},
|
|
132
|
+
"./instance-id": {
|
|
133
|
+
"require": "./lib/instance-id/index.js",
|
|
134
|
+
"import": "./lib/esm/instance-id/index.js"
|
|
135
|
+
},
|
|
136
|
+
"./machine-learning": {
|
|
137
|
+
"require": "./lib/machine-learning/index.js",
|
|
138
|
+
"import": "./lib/esm/machine-learning/index.js"
|
|
139
|
+
},
|
|
140
|
+
"./messaging": {
|
|
141
|
+
"require": "./lib/messaging/index.js",
|
|
142
|
+
"import": "./lib/esm/messaging/index.js"
|
|
143
|
+
},
|
|
144
|
+
"./project-management": {
|
|
145
|
+
"require": "./lib/project-management/index.js",
|
|
146
|
+
"import": "./lib/esm/project-management/index.js"
|
|
147
|
+
},
|
|
148
|
+
"./remote-config": {
|
|
149
|
+
"require": "./lib/remote-config/index.js",
|
|
150
|
+
"import": "./lib/esm/remote-config/index.js"
|
|
151
|
+
},
|
|
152
|
+
"./security-rules": {
|
|
153
|
+
"require": "./lib/security-rules/index.js",
|
|
154
|
+
"import": "./lib/esm/security-rules/index.js"
|
|
155
|
+
},
|
|
156
|
+
"./storage": {
|
|
157
|
+
"require": "./lib/storage/index.js",
|
|
158
|
+
"import": "./lib/esm/storage/index.js"
|
|
159
|
+
}
|
|
86
160
|
},
|
|
87
161
|
"dependencies": {
|
|
88
|
-
"@firebase/database": "^0.
|
|
89
|
-
"@firebase/database-types": "^0.
|
|
90
|
-
"@types/node": "
|
|
162
|
+
"@firebase/database-compat": "^0.1.1",
|
|
163
|
+
"@firebase/database-types": "^0.9.3",
|
|
164
|
+
"@types/node": ">=12.12.47",
|
|
91
165
|
"dicer": "^0.3.0",
|
|
92
166
|
"jsonwebtoken": "^8.5.1",
|
|
93
|
-
"
|
|
167
|
+
"jwks-rsa": "^2.0.2",
|
|
168
|
+
"node-forge": "^1.0.0"
|
|
94
169
|
},
|
|
95
170
|
"optionalDependencies": {
|
|
96
171
|
"@google-cloud/firestore": "^4.5.0",
|
|
97
172
|
"@google-cloud/storage": "^5.3.0"
|
|
98
173
|
},
|
|
99
174
|
"devDependencies": {
|
|
100
|
-
"@firebase/
|
|
101
|
-
"@firebase/
|
|
102
|
-
"@firebase/auth-
|
|
175
|
+
"@firebase/api-documenter": "^0.1.2",
|
|
176
|
+
"@firebase/app-compat": "^0.1.2",
|
|
177
|
+
"@firebase/auth-compat": "^0.2.5",
|
|
178
|
+
"@firebase/auth-types": "^0.11.0",
|
|
103
179
|
"@microsoft/api-extractor": "^7.11.2",
|
|
104
|
-
"@types/bcrypt": "^
|
|
180
|
+
"@types/bcrypt": "^5.0.0",
|
|
105
181
|
"@types/chai": "^4.0.0",
|
|
106
182
|
"@types/chai-as-promised": "^7.1.0",
|
|
107
183
|
"@types/firebase-token-generator": "^2.0.28",
|
|
108
|
-
"@types/jsonwebtoken": "
|
|
184
|
+
"@types/jsonwebtoken": "8.5.1",
|
|
109
185
|
"@types/lodash": "^4.14.104",
|
|
110
186
|
"@types/minimist": "^1.2.0",
|
|
111
|
-
"@types/mocha": "^
|
|
112
|
-
"@types/nock": "^
|
|
187
|
+
"@types/mocha": "^9.0.0",
|
|
188
|
+
"@types/nock": "^11.1.0",
|
|
113
189
|
"@types/request": "^2.47.0",
|
|
114
190
|
"@types/request-promise": "^4.1.41",
|
|
115
|
-
"@types/sinon": "^
|
|
191
|
+
"@types/sinon": "^10.0.2",
|
|
116
192
|
"@types/sinon-chai": "^3.0.0",
|
|
117
|
-
"@typescript-eslint/eslint-plugin": "^
|
|
118
|
-
"@typescript-eslint/parser": "^
|
|
193
|
+
"@typescript-eslint/eslint-plugin": "^5.0.0",
|
|
194
|
+
"@typescript-eslint/parser": "^5.0.0",
|
|
119
195
|
"bcrypt": "^5.0.0",
|
|
120
196
|
"chai": "^4.2.0",
|
|
121
197
|
"chai-as-promised": "^7.0.0",
|
|
122
|
-
"chalk": "^1.1
|
|
198
|
+
"chalk": "^4.1.1",
|
|
123
199
|
"child-process-promise": "^2.2.1",
|
|
124
|
-
"del": "^
|
|
125
|
-
"eslint": "^
|
|
200
|
+
"del": "^6.0.0",
|
|
201
|
+
"eslint": "^7.1.0",
|
|
126
202
|
"firebase-token-generator": "^2.0.0",
|
|
127
203
|
"gulp": "^4.0.2",
|
|
128
|
-
"gulp-filter": "^
|
|
129
|
-
"gulp-header": "^
|
|
130
|
-
"gulp-replace": "^0.5.4",
|
|
204
|
+
"gulp-filter": "^7.0.0",
|
|
205
|
+
"gulp-header": "^2.0.9",
|
|
131
206
|
"gulp-typescript": "^5.0.1",
|
|
132
207
|
"http-message-parser": "^0.0.34",
|
|
133
|
-
"jsdom": "^15.0.0",
|
|
134
208
|
"lodash": "^4.17.15",
|
|
135
209
|
"minimist": "^1.2.0",
|
|
136
|
-
"mocha": "^
|
|
210
|
+
"mocha": "^9.1.2",
|
|
137
211
|
"mz": "^2.7.0",
|
|
138
212
|
"nock": "^13.0.0",
|
|
139
213
|
"npm-run-all": "^4.1.5",
|
|
140
|
-
"nyc": "^
|
|
214
|
+
"nyc": "^15.1.0",
|
|
141
215
|
"request": "^2.75.0",
|
|
142
216
|
"request-promise": "^4.1.1",
|
|
143
|
-
"run-sequence": "^
|
|
217
|
+
"run-sequence": "^2.2.1",
|
|
144
218
|
"sinon": "^9.0.0",
|
|
145
219
|
"sinon-chai": "^3.0.0",
|
|
146
|
-
"ts-node": "^
|
|
147
|
-
"typedoc": "^0.19.2",
|
|
220
|
+
"ts-node": "^10.2.0",
|
|
148
221
|
"typescript": "^3.7.3",
|
|
149
|
-
"yargs": "^
|
|
222
|
+
"yargs": "^17.0.1"
|
|
150
223
|
}
|
|
151
224
|
}
|