firebase-admin 12.3.1 → 12.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/lib/app/core.d.ts +1 -1
- package/lib/app/core.js +1 -1
- package/lib/app/credential-factory.d.ts +1 -1
- package/lib/app/credential-factory.js +1 -1
- package/lib/app/credential-internal.d.ts +1 -1
- package/lib/app/credential-internal.js +1 -1
- package/lib/app/credential.d.ts +1 -1
- package/lib/app/credential.js +1 -1
- package/lib/app/firebase-app.d.ts +1 -1
- package/lib/app/firebase-app.js +1 -1
- package/lib/app/firebase-namespace.d.ts +1 -1
- package/lib/app/firebase-namespace.js +1 -1
- package/lib/app/index.d.ts +1 -1
- package/lib/app/index.js +1 -1
- package/lib/app/lifecycle.d.ts +1 -1
- package/lib/app/lifecycle.js +1 -1
- package/lib/app-check/app-check-api-client-internal.d.ts +1 -1
- package/lib/app-check/app-check-api-client-internal.js +1 -1
- package/lib/app-check/app-check-api.d.ts +1 -1
- package/lib/app-check/app-check-api.js +1 -1
- package/lib/app-check/app-check-namespace.d.ts +1 -1
- package/lib/app-check/app-check-namespace.js +1 -1
- package/lib/app-check/app-check.d.ts +1 -1
- package/lib/app-check/app-check.js +1 -1
- package/lib/app-check/index.d.ts +1 -1
- package/lib/app-check/index.js +1 -1
- package/lib/app-check/token-generator.d.ts +1 -1
- package/lib/app-check/token-generator.js +1 -1
- package/lib/app-check/token-verifier.d.ts +1 -1
- package/lib/app-check/token-verifier.js +2 -2
- package/lib/auth/action-code-settings-builder.d.ts +1 -1
- package/lib/auth/action-code-settings-builder.js +1 -1
- package/lib/auth/auth-api-request.d.ts +1 -1
- package/lib/auth/auth-api-request.js +1 -1
- package/lib/auth/auth-config.d.ts +1 -1
- package/lib/auth/auth-config.js +1 -1
- package/lib/auth/auth-namespace.d.ts +1 -1
- package/lib/auth/auth-namespace.js +1 -1
- package/lib/auth/auth.d.ts +1 -1
- package/lib/auth/auth.js +1 -1
- package/lib/auth/base-auth.d.ts +1 -1
- package/lib/auth/base-auth.js +1 -1
- package/lib/auth/identifier.d.ts +1 -1
- package/lib/auth/identifier.js +1 -1
- package/lib/auth/index.d.ts +1 -1
- package/lib/auth/index.js +1 -1
- package/lib/auth/project-config-manager.d.ts +1 -1
- package/lib/auth/project-config-manager.js +1 -1
- package/lib/auth/project-config.d.ts +1 -1
- package/lib/auth/project-config.js +1 -1
- package/lib/auth/tenant-manager.d.ts +1 -1
- package/lib/auth/tenant-manager.js +1 -1
- package/lib/auth/tenant.d.ts +1 -1
- package/lib/auth/tenant.js +1 -1
- package/lib/auth/token-generator.d.ts +1 -1
- package/lib/auth/token-generator.js +1 -1
- package/lib/auth/token-verifier.d.ts +1 -1
- package/lib/auth/token-verifier.js +1 -1
- package/lib/auth/user-import-builder.d.ts +1 -1
- package/lib/auth/user-import-builder.js +1 -1
- package/lib/auth/user-record.d.ts +1 -1
- package/lib/auth/user-record.js +1 -1
- package/lib/credential/index.d.ts +1 -1
- package/lib/credential/index.js +1 -1
- package/lib/database/database-namespace.d.ts +1 -1
- package/lib/database/database-namespace.js +1 -1
- package/lib/database/database.d.ts +1 -1
- package/lib/database/database.js +1 -1
- package/lib/database/index.d.ts +1 -1
- package/lib/database/index.js +1 -1
- package/lib/default-namespace.d.ts +1 -1
- package/lib/default-namespace.js +1 -1
- package/lib/esm/remote-config/index.js +1 -0
- package/lib/eventarc/cloudevent.d.ts +1 -1
- package/lib/eventarc/cloudevent.js +1 -1
- package/lib/eventarc/eventarc-client-internal.d.ts +1 -1
- package/lib/eventarc/eventarc-client-internal.js +1 -1
- package/lib/eventarc/eventarc-utils.d.ts +1 -1
- package/lib/eventarc/eventarc-utils.js +1 -1
- package/lib/eventarc/eventarc.d.ts +1 -1
- package/lib/eventarc/eventarc.js +1 -1
- package/lib/eventarc/index.d.ts +1 -1
- package/lib/eventarc/index.js +1 -1
- package/lib/extensions/extensions-api-client-internal.d.ts +1 -1
- package/lib/extensions/extensions-api-client-internal.js +1 -1
- package/lib/extensions/extensions-api.d.ts +1 -1
- package/lib/extensions/extensions-api.js +1 -1
- package/lib/extensions/extensions.d.ts +1 -1
- package/lib/extensions/extensions.js +1 -1
- package/lib/extensions/index.d.ts +1 -1
- package/lib/extensions/index.js +1 -1
- package/lib/firebase-namespace-api.d.ts +1 -1
- package/lib/firebase-namespace-api.js +1 -1
- package/lib/firestore/firestore-internal.d.ts +1 -1
- package/lib/firestore/firestore-internal.js +1 -1
- package/lib/firestore/firestore-namespace.d.ts +1 -1
- package/lib/firestore/firestore-namespace.js +1 -1
- package/lib/firestore/index.d.ts +1 -1
- package/lib/firestore/index.js +1 -1
- package/lib/functions/functions-api-client-internal.d.ts +2 -1
- package/lib/functions/functions-api-client-internal.js +29 -7
- package/lib/functions/functions-api.d.ts +1 -1
- package/lib/functions/functions-api.js +1 -1
- package/lib/functions/functions.d.ts +1 -1
- package/lib/functions/functions.js +1 -1
- package/lib/functions/index.d.ts +1 -1
- package/lib/functions/index.js +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/installations/index.d.ts +1 -1
- package/lib/installations/index.js +1 -1
- package/lib/installations/installations-namespace.d.ts +1 -1
- package/lib/installations/installations-namespace.js +1 -1
- package/lib/installations/installations-request-handler.d.ts +1 -1
- package/lib/installations/installations-request-handler.js +1 -1
- package/lib/installations/installations.d.ts +1 -1
- package/lib/installations/installations.js +1 -1
- package/lib/instance-id/index.d.ts +1 -1
- package/lib/instance-id/index.js +1 -1
- package/lib/instance-id/instance-id-namespace.d.ts +1 -1
- package/lib/instance-id/instance-id-namespace.js +1 -1
- package/lib/instance-id/instance-id.d.ts +1 -1
- package/lib/instance-id/instance-id.js +1 -1
- package/lib/machine-learning/index.d.ts +1 -1
- package/lib/machine-learning/index.js +1 -1
- package/lib/machine-learning/machine-learning-api-client.d.ts +1 -1
- package/lib/machine-learning/machine-learning-api-client.js +1 -1
- package/lib/machine-learning/machine-learning-namespace.d.ts +1 -1
- 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 +1 -1
- package/lib/machine-learning/machine-learning.js +1 -1
- package/lib/messaging/batch-request-internal.d.ts +1 -1
- package/lib/messaging/batch-request-internal.js +1 -1
- package/lib/messaging/index.d.ts +1 -1
- package/lib/messaging/index.js +1 -1
- package/lib/messaging/messaging-api-request-internal.d.ts +1 -1
- package/lib/messaging/messaging-api-request-internal.js +1 -1
- package/lib/messaging/messaging-api.d.ts +5 -5
- package/lib/messaging/messaging-api.js +1 -1
- package/lib/messaging/messaging-errors-internal.d.ts +1 -1
- package/lib/messaging/messaging-errors-internal.js +1 -1
- package/lib/messaging/messaging-internal.d.ts +1 -1
- package/lib/messaging/messaging-internal.js +1 -1
- package/lib/messaging/messaging-namespace.d.ts +1 -1
- package/lib/messaging/messaging-namespace.js +1 -1
- package/lib/messaging/messaging.d.ts +5 -1
- package/lib/messaging/messaging.js +5 -1
- package/lib/project-management/android-app.d.ts +1 -1
- package/lib/project-management/android-app.js +1 -1
- 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 +1 -1
- package/lib/project-management/index.js +1 -1
- package/lib/project-management/ios-app.d.ts +1 -1
- package/lib/project-management/ios-app.js +1 -1
- package/lib/project-management/project-management-api-request-internal.d.ts +1 -1
- package/lib/project-management/project-management-api-request-internal.js +1 -1
- package/lib/project-management/project-management-namespace.d.ts +1 -1
- package/lib/project-management/project-management-namespace.js +1 -1
- package/lib/project-management/project-management.d.ts +1 -1
- package/lib/project-management/project-management.js +1 -1
- package/lib/remote-config/condition-evaluator-internal.d.ts +1 -1
- package/lib/remote-config/condition-evaluator-internal.js +103 -2
- package/lib/remote-config/index.d.ts +2 -2
- package/lib/remote-config/index.js +3 -2
- package/lib/remote-config/internal/value-impl.d.ts +1 -1
- package/lib/remote-config/internal/value-impl.js +1 -1
- package/lib/remote-config/remote-config-api-client-internal.d.ts +1 -1
- package/lib/remote-config/remote-config-api-client-internal.js +1 -1
- package/lib/remote-config/remote-config-api.d.ts +111 -3
- package/lib/remote-config/remote-config-api.js +78 -2
- package/lib/remote-config/remote-config-namespace.d.ts +1 -1
- package/lib/remote-config/remote-config-namespace.js +1 -1
- package/lib/remote-config/remote-config.d.ts +1 -1
- package/lib/remote-config/remote-config.js +1 -1
- package/lib/security-rules/index.d.ts +1 -1
- package/lib/security-rules/index.js +1 -1
- 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 +1 -1
- package/lib/security-rules/security-rules-namespace.js +1 -1
- package/lib/security-rules/security-rules.d.ts +1 -1
- package/lib/security-rules/security-rules.js +1 -1
- package/lib/storage/index.d.ts +1 -1
- package/lib/storage/index.js +1 -1
- package/lib/storage/storage-namespace.d.ts +1 -1
- package/lib/storage/storage-namespace.js +1 -1
- package/lib/storage/storage.d.ts +1 -1
- package/lib/storage/storage.js +1 -1
- package/lib/storage/utils.d.ts +1 -1
- package/lib/storage/utils.js +1 -1
- package/lib/utils/api-request.d.ts +1 -1
- package/lib/utils/api-request.js +1 -1
- package/lib/utils/crypto-signer.d.ts +1 -1
- package/lib/utils/crypto-signer.js +1 -1
- package/lib/utils/deep-copy.d.ts +1 -1
- package/lib/utils/deep-copy.js +1 -1
- package/lib/utils/error.d.ts +1 -1
- package/lib/utils/error.js +1 -1
- package/lib/utils/index.d.ts +1 -1
- package/lib/utils/index.js +1 -1
- package/lib/utils/jwt.d.ts +3 -3
- package/lib/utils/jwt.js +6 -5
- package/lib/utils/validator.d.ts +1 -1
- package/lib/utils/validator.js +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! firebase-admin v12.
|
|
1
|
+
/*! firebase-admin v12.5.0 */
|
|
2
2
|
/*!
|
|
3
3
|
* Copyright 2024 Google Inc.
|
|
4
4
|
*
|
|
@@ -56,6 +56,9 @@ class ConditionEvaluator {
|
|
|
56
56
|
if (condition.percent) {
|
|
57
57
|
return this.evaluatePercentCondition(condition.percent, context);
|
|
58
58
|
}
|
|
59
|
+
if (condition.customSignal) {
|
|
60
|
+
return this.evaluateCustomSignalCondition(condition.customSignal, context);
|
|
61
|
+
}
|
|
59
62
|
// TODO: add logging once we have a wrapped logger.
|
|
60
63
|
return false;
|
|
61
64
|
}
|
|
@@ -118,7 +121,6 @@ class ConditionEvaluator {
|
|
|
118
121
|
// TODO: add logging once we have a wrapped logger.
|
|
119
122
|
return false;
|
|
120
123
|
}
|
|
121
|
-
// Visible for testing
|
|
122
124
|
static hashSeededRandomizationId(seededRandomizationId) {
|
|
123
125
|
// For consistency with the Remote Config fetch endpoint's percent condition behavior
|
|
124
126
|
// we use Farmhash's fingerprint64 algorithm and interpret the resulting unsigned value
|
|
@@ -131,6 +133,105 @@ class ConditionEvaluator {
|
|
|
131
133
|
}
|
|
132
134
|
return hash64;
|
|
133
135
|
}
|
|
136
|
+
evaluateCustomSignalCondition(customSignalCondition, context) {
|
|
137
|
+
const { customSignalOperator, customSignalKey, targetCustomSignalValues, } = customSignalCondition;
|
|
138
|
+
if (!customSignalOperator || !customSignalKey || !targetCustomSignalValues) {
|
|
139
|
+
// TODO: add logging once we have a wrapped logger.
|
|
140
|
+
return false;
|
|
141
|
+
}
|
|
142
|
+
if (!targetCustomSignalValues.length) {
|
|
143
|
+
return false;
|
|
144
|
+
}
|
|
145
|
+
// Extract the value of the signal from the evaluation context.
|
|
146
|
+
const actualCustomSignalValue = context[customSignalKey];
|
|
147
|
+
if (actualCustomSignalValue == undefined) {
|
|
148
|
+
return false;
|
|
149
|
+
}
|
|
150
|
+
switch (customSignalOperator) {
|
|
151
|
+
case remote_config_api_1.CustomSignalOperator.STRING_CONTAINS:
|
|
152
|
+
return compareStrings(targetCustomSignalValues, actualCustomSignalValue, (target, actual) => actual.includes(target));
|
|
153
|
+
case remote_config_api_1.CustomSignalOperator.STRING_DOES_NOT_CONTAIN:
|
|
154
|
+
return !compareStrings(targetCustomSignalValues, actualCustomSignalValue, (target, actual) => actual.includes(target));
|
|
155
|
+
case remote_config_api_1.CustomSignalOperator.STRING_EXACTLY_MATCHES:
|
|
156
|
+
return compareStrings(targetCustomSignalValues, actualCustomSignalValue, (target, actual) => actual.trim() === target.trim());
|
|
157
|
+
case remote_config_api_1.CustomSignalOperator.STRING_CONTAINS_REGEX:
|
|
158
|
+
return compareStrings(targetCustomSignalValues, actualCustomSignalValue, (target, actual) => new RegExp(target).test(actual));
|
|
159
|
+
// For numeric operators only one target value is allowed.
|
|
160
|
+
case remote_config_api_1.CustomSignalOperator.NUMERIC_LESS_THAN:
|
|
161
|
+
return compareNumbers(actualCustomSignalValue, targetCustomSignalValues[0], (r) => r < 0);
|
|
162
|
+
case remote_config_api_1.CustomSignalOperator.NUMERIC_LESS_EQUAL:
|
|
163
|
+
return compareNumbers(actualCustomSignalValue, targetCustomSignalValues[0], (r) => r <= 0);
|
|
164
|
+
case remote_config_api_1.CustomSignalOperator.NUMERIC_EQUAL:
|
|
165
|
+
return compareNumbers(actualCustomSignalValue, targetCustomSignalValues[0], (r) => r === 0);
|
|
166
|
+
case remote_config_api_1.CustomSignalOperator.NUMERIC_NOT_EQUAL:
|
|
167
|
+
return compareNumbers(actualCustomSignalValue, targetCustomSignalValues[0], (r) => r !== 0);
|
|
168
|
+
case remote_config_api_1.CustomSignalOperator.NUMERIC_GREATER_THAN:
|
|
169
|
+
return compareNumbers(actualCustomSignalValue, targetCustomSignalValues[0], (r) => r > 0);
|
|
170
|
+
case remote_config_api_1.CustomSignalOperator.NUMERIC_GREATER_EQUAL:
|
|
171
|
+
return compareNumbers(actualCustomSignalValue, targetCustomSignalValues[0], (r) => r >= 0);
|
|
172
|
+
// For semantic operators only one target value is allowed.
|
|
173
|
+
case remote_config_api_1.CustomSignalOperator.SEMANTIC_VERSION_LESS_THAN:
|
|
174
|
+
return compareSemanticVersions(actualCustomSignalValue, targetCustomSignalValues[0], (r) => r < 0);
|
|
175
|
+
case remote_config_api_1.CustomSignalOperator.SEMANTIC_VERSION_LESS_EQUAL:
|
|
176
|
+
return compareSemanticVersions(actualCustomSignalValue, targetCustomSignalValues[0], (r) => r <= 0);
|
|
177
|
+
case remote_config_api_1.CustomSignalOperator.SEMANTIC_VERSION_EQUAL:
|
|
178
|
+
return compareSemanticVersions(actualCustomSignalValue, targetCustomSignalValues[0], (r) => r === 0);
|
|
179
|
+
case remote_config_api_1.CustomSignalOperator.SEMANTIC_VERSION_NOT_EQUAL:
|
|
180
|
+
return compareSemanticVersions(actualCustomSignalValue, targetCustomSignalValues[0], (r) => r !== 0);
|
|
181
|
+
case remote_config_api_1.CustomSignalOperator.SEMANTIC_VERSION_GREATER_THAN:
|
|
182
|
+
return compareSemanticVersions(actualCustomSignalValue, targetCustomSignalValues[0], (r) => r > 0);
|
|
183
|
+
case remote_config_api_1.CustomSignalOperator.SEMANTIC_VERSION_GREATER_EQUAL:
|
|
184
|
+
return compareSemanticVersions(actualCustomSignalValue, targetCustomSignalValues[0], (r) => r >= 0);
|
|
185
|
+
}
|
|
186
|
+
// TODO: add logging once we have a wrapped logger.
|
|
187
|
+
return false;
|
|
188
|
+
}
|
|
134
189
|
}
|
|
135
190
|
exports.ConditionEvaluator = ConditionEvaluator;
|
|
136
191
|
ConditionEvaluator.MAX_CONDITION_RECURSION_DEPTH = 10;
|
|
192
|
+
// Compares the actual string value of a signal against a list of target
|
|
193
|
+
// values. If any of the target values are a match, returns true.
|
|
194
|
+
function compareStrings(targetValues, actualValue, predicateFn) {
|
|
195
|
+
const actual = String(actualValue);
|
|
196
|
+
return targetValues.some((target) => predicateFn(target, actual));
|
|
197
|
+
}
|
|
198
|
+
// Compares two numbers against each other.
|
|
199
|
+
// Calls the predicate function with -1, 0, 1 if actual is less than, equal to, or greater than target.
|
|
200
|
+
function compareNumbers(actualValue, targetValue, predicateFn) {
|
|
201
|
+
const target = Number(targetValue);
|
|
202
|
+
const actual = Number(actualValue);
|
|
203
|
+
if (isNaN(target) || isNaN(actual)) {
|
|
204
|
+
return false;
|
|
205
|
+
}
|
|
206
|
+
return predicateFn(actual < target ? -1 : actual > target ? 1 : 0);
|
|
207
|
+
}
|
|
208
|
+
// Max number of segments a numeric version can have. This is enforced by the server as well.
|
|
209
|
+
const MAX_LENGTH = 5;
|
|
210
|
+
// Compares semantic version strings against each other.
|
|
211
|
+
// Calls the predicate function with -1, 0, 1 if actual is less than, equal to, or greater than target.
|
|
212
|
+
function compareSemanticVersions(actualValue, targetValue, predicateFn) {
|
|
213
|
+
const version1 = String(actualValue).split('.').map(Number);
|
|
214
|
+
const version2 = targetValue.split('.').map(Number);
|
|
215
|
+
for (let i = 0; i < MAX_LENGTH; i++) {
|
|
216
|
+
// Check to see if segments are present. Note that these may be present and be NaN.
|
|
217
|
+
const version1HasSegment = version1[i] !== undefined;
|
|
218
|
+
const version2HasSegment = version2[i] !== undefined;
|
|
219
|
+
// If both are undefined, we've consumed everything and they're equal.
|
|
220
|
+
if (!version1HasSegment && !version2HasSegment)
|
|
221
|
+
return predicateFn(0);
|
|
222
|
+
// Insert zeros if undefined for easier comparison.
|
|
223
|
+
if (!version1HasSegment)
|
|
224
|
+
version1[i] = 0;
|
|
225
|
+
if (!version2HasSegment)
|
|
226
|
+
version2[i] = 0;
|
|
227
|
+
// At this point, if either segment is NaN, we return false directly.
|
|
228
|
+
if (isNaN(version1[i]) || isNaN(version2[i]))
|
|
229
|
+
return false;
|
|
230
|
+
// Check if we have a difference in segments. Otherwise continue to next segment.
|
|
231
|
+
if (version1[i] < version2[i])
|
|
232
|
+
return predicateFn(-1);
|
|
233
|
+
if (version1[i] > version2[i])
|
|
234
|
+
return predicateFn(1);
|
|
235
|
+
}
|
|
236
|
+
return false;
|
|
237
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! firebase-admin v12.
|
|
1
|
+
/*! firebase-admin v12.5.0 */
|
|
2
2
|
/*!
|
|
3
3
|
* Copyright 2020 Google Inc.
|
|
4
4
|
*
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
*/
|
|
22
22
|
import { App } from '../app';
|
|
23
23
|
import { RemoteConfig } from './remote-config';
|
|
24
|
-
export { AndCondition, DefaultConfig, EvaluationContext, ExplicitParameterValue, GetServerTemplateOptions, InAppDefaultValue, InitServerTemplateOptions, ListVersionsOptions, ListVersionsResult, MicroPercentRange, NamedCondition, OneOfCondition, OrCondition, ParameterValueType, PercentConditionOperator, PercentCondition, RemoteConfigCondition, RemoteConfigParameter, RemoteConfigParameterGroup, RemoteConfigParameterValue, RemoteConfigTemplate, RemoteConfigUser, ServerConfig, ServerTemplate, ServerTemplateData, ServerTemplateDataType, TagColor, Value, ValueSource, Version, } from './remote-config-api';
|
|
24
|
+
export { AndCondition, CustomSignalCondition, CustomSignalOperator, DefaultConfig, EvaluationContext, ExplicitParameterValue, GetServerTemplateOptions, InAppDefaultValue, InitServerTemplateOptions, ListVersionsOptions, ListVersionsResult, MicroPercentRange, NamedCondition, OneOfCondition, OrCondition, ParameterValueType, PercentConditionOperator, PercentCondition, PredefinedSignals, RemoteConfigCondition, RemoteConfigParameter, RemoteConfigParameterGroup, RemoteConfigParameterValue, RemoteConfigTemplate, RemoteConfigUser, ServerConfig, ServerTemplate, ServerTemplateData, ServerTemplateDataType, TagColor, UserProvidedSignals, Value, ValueSource, Version, } from './remote-config-api';
|
|
25
25
|
export { RemoteConfig } from './remote-config';
|
|
26
26
|
/**
|
|
27
27
|
* Gets the {@link RemoteConfig} service for the default app or a given app.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! firebase-admin v12.
|
|
1
|
+
/*! firebase-admin v12.5.0 */
|
|
2
2
|
"use strict";
|
|
3
3
|
/*!
|
|
4
4
|
* Copyright 2020 Google Inc.
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
* limitations under the License.
|
|
17
17
|
*/
|
|
18
18
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
-
exports.getRemoteConfig = exports.RemoteConfig = exports.PercentConditionOperator = void 0;
|
|
19
|
+
exports.getRemoteConfig = exports.RemoteConfig = exports.PercentConditionOperator = exports.CustomSignalOperator = void 0;
|
|
20
20
|
/**
|
|
21
21
|
* Firebase Remote Config.
|
|
22
22
|
*
|
|
@@ -25,6 +25,7 @@ exports.getRemoteConfig = exports.RemoteConfig = exports.PercentConditionOperato
|
|
|
25
25
|
const app_1 = require("../app");
|
|
26
26
|
const remote_config_1 = require("./remote-config");
|
|
27
27
|
var remote_config_api_1 = require("./remote-config-api");
|
|
28
|
+
Object.defineProperty(exports, "CustomSignalOperator", { enumerable: true, get: function () { return remote_config_api_1.CustomSignalOperator; } });
|
|
28
29
|
Object.defineProperty(exports, "PercentConditionOperator", { enumerable: true, get: function () { return remote_config_api_1.PercentConditionOperator; } });
|
|
29
30
|
var remote_config_2 = require("./remote-config");
|
|
30
31
|
Object.defineProperty(exports, "RemoteConfig", { enumerable: true, get: function () { return remote_config_2.RemoteConfig; } });
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! firebase-admin v12.
|
|
1
|
+
/*! firebase-admin v12.5.0 */
|
|
2
2
|
/*!
|
|
3
3
|
* Copyright 2021 Google Inc.
|
|
4
4
|
*
|
|
@@ -90,6 +90,10 @@ export interface OneOfCondition {
|
|
|
90
90
|
* Makes this condition a percent condition.
|
|
91
91
|
*/
|
|
92
92
|
percent?: PercentCondition;
|
|
93
|
+
/**
|
|
94
|
+
* Makes this condition a custom signal condition.
|
|
95
|
+
*/
|
|
96
|
+
customSignal?: CustomSignalCondition;
|
|
93
97
|
}
|
|
94
98
|
/**
|
|
95
99
|
* Represents a collection of conditions that evaluate to true if all are true.
|
|
@@ -180,6 +184,100 @@ export interface PercentCondition {
|
|
|
180
184
|
*/
|
|
181
185
|
microPercentRange?: MicroPercentRange;
|
|
182
186
|
}
|
|
187
|
+
/**
|
|
188
|
+
* Defines supported operators for custom signal conditions.
|
|
189
|
+
*/
|
|
190
|
+
export declare enum CustomSignalOperator {
|
|
191
|
+
/**
|
|
192
|
+
* A catchall error case.
|
|
193
|
+
*/
|
|
194
|
+
UNKNOWN = "UNKNOWN",
|
|
195
|
+
/**
|
|
196
|
+
* Matches a numeric value less than the target value.
|
|
197
|
+
*/
|
|
198
|
+
NUMERIC_LESS_THAN = "NUMERIC_LESS_THAN",
|
|
199
|
+
/**
|
|
200
|
+
* Matches a numeric value less than or equal to the target value.
|
|
201
|
+
*/
|
|
202
|
+
NUMERIC_LESS_EQUAL = "NUMERIC_LESS_EQUAL",
|
|
203
|
+
/**
|
|
204
|
+
* Matches a numeric value equal to the target value.
|
|
205
|
+
*/
|
|
206
|
+
NUMERIC_EQUAL = "NUMERIC_EQUAL",
|
|
207
|
+
/**
|
|
208
|
+
* Matches a numeric value not equal to the target value.
|
|
209
|
+
*/
|
|
210
|
+
NUMERIC_NOT_EQUAL = "NUMERIC_NOT_EQUAL",
|
|
211
|
+
/**
|
|
212
|
+
* Matches a numeric value greater than the target value.
|
|
213
|
+
*/
|
|
214
|
+
NUMERIC_GREATER_THAN = "NUMERIC_GREATER_THAN",
|
|
215
|
+
/**
|
|
216
|
+
* Matches a numeric value greater than or equal to the target value.
|
|
217
|
+
*/
|
|
218
|
+
NUMERIC_GREATER_EQUAL = "NUMERIC_GREATER_EQUAL",
|
|
219
|
+
/**
|
|
220
|
+
* Matches if at least one of the target values is a substring of the actual custom
|
|
221
|
+
* signal value (e.g. "abc" contains the string "a", "bc").
|
|
222
|
+
*/
|
|
223
|
+
STRING_CONTAINS = "STRING_CONTAINS",
|
|
224
|
+
/**
|
|
225
|
+
* Matches if none of the target values is a substring of the actual custom signal value.
|
|
226
|
+
*/
|
|
227
|
+
STRING_DOES_NOT_CONTAIN = "STRING_DOES_NOT_CONTAIN",
|
|
228
|
+
/**
|
|
229
|
+
* Matches if the actual value exactly matches at least one of the target values.
|
|
230
|
+
*/
|
|
231
|
+
STRING_EXACTLY_MATCHES = "STRING_EXACTLY_MATCHES",
|
|
232
|
+
/**
|
|
233
|
+
* The target regular expression matches at least one of the actual values.
|
|
234
|
+
* The regex conforms to RE2 format. See https://github.com/google/re2/wiki/Syntax
|
|
235
|
+
*/
|
|
236
|
+
STRING_CONTAINS_REGEX = "STRING_CONTAINS_REGEX",
|
|
237
|
+
/**
|
|
238
|
+
* Matches if the actual version value is less than the target value.
|
|
239
|
+
*/
|
|
240
|
+
SEMANTIC_VERSION_LESS_THAN = "SEMANTIC_VERSION_LESS_THAN",
|
|
241
|
+
/**
|
|
242
|
+
* Matches if the actual version value is less than or equal to the target value.
|
|
243
|
+
*/
|
|
244
|
+
SEMANTIC_VERSION_LESS_EQUAL = "SEMANTIC_VERSION_LESS_EQUAL",
|
|
245
|
+
/**
|
|
246
|
+
* Matches if the actual version value is equal to the target value.
|
|
247
|
+
*/
|
|
248
|
+
SEMANTIC_VERSION_EQUAL = "SEMANTIC_VERSION_EQUAL",
|
|
249
|
+
/**
|
|
250
|
+
* Matches if the actual version value is not equal to the target value.
|
|
251
|
+
*/
|
|
252
|
+
SEMANTIC_VERSION_NOT_EQUAL = "SEMANTIC_VERSION_NOT_EQUAL",
|
|
253
|
+
/**
|
|
254
|
+
* Matches if the actual version value is greater than the target value.
|
|
255
|
+
*/
|
|
256
|
+
SEMANTIC_VERSION_GREATER_THAN = "SEMANTIC_VERSION_GREATER_THAN",
|
|
257
|
+
/**
|
|
258
|
+
* Matches if the actual version value is greater than or equal to the target value.
|
|
259
|
+
*/
|
|
260
|
+
SEMANTIC_VERSION_GREATER_EQUAL = "SEMANTIC_VERSION_GREATER_EQUAL"
|
|
261
|
+
}
|
|
262
|
+
/**
|
|
263
|
+
* Represents a condition that compares provided signals against a target value.
|
|
264
|
+
*/
|
|
265
|
+
export interface CustomSignalCondition {
|
|
266
|
+
/**
|
|
267
|
+
* The choice of custom signal operator to determine how to compare targets
|
|
268
|
+
* to value(s).
|
|
269
|
+
*/
|
|
270
|
+
customSignalOperator?: CustomSignalOperator;
|
|
271
|
+
/**
|
|
272
|
+
* The key of the signal set in the EvaluationContext
|
|
273
|
+
*/
|
|
274
|
+
customSignalKey?: string;
|
|
275
|
+
/**
|
|
276
|
+
* A list of at most 100 target custom signal values. For numeric operators,
|
|
277
|
+
* this will have exactly ONE target value.
|
|
278
|
+
*/
|
|
279
|
+
targetCustomSignalValues?: string[];
|
|
280
|
+
}
|
|
183
281
|
/**
|
|
184
282
|
* Interface representing an explicit parameter value.
|
|
185
283
|
*/
|
|
@@ -363,15 +461,25 @@ export interface ServerTemplate {
|
|
|
363
461
|
toJSON(): ServerTemplateData;
|
|
364
462
|
}
|
|
365
463
|
/**
|
|
366
|
-
*
|
|
464
|
+
* Generic map of developer-defined signals used as evaluation input signals.
|
|
465
|
+
*/
|
|
466
|
+
export type UserProvidedSignals = {
|
|
467
|
+
[key: string]: string | number;
|
|
468
|
+
};
|
|
469
|
+
/**
|
|
470
|
+
* Predefined template evaluation input signals.
|
|
367
471
|
*/
|
|
368
|
-
export type
|
|
472
|
+
export type PredefinedSignals = {
|
|
369
473
|
/**
|
|
370
474
|
* Defines the identifier to use when splitting a group. For example,
|
|
371
475
|
* this is used by the percent condition.
|
|
372
476
|
*/
|
|
373
477
|
randomizationId?: string;
|
|
374
478
|
};
|
|
479
|
+
/**
|
|
480
|
+
* Represents template evaluation input signals.
|
|
481
|
+
*/
|
|
482
|
+
export type EvaluationContext = UserProvidedSignals & PredefinedSignals;
|
|
375
483
|
/**
|
|
376
484
|
* Interface representing a Remote Config user.
|
|
377
485
|
*/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! firebase-admin v12.
|
|
1
|
+
/*! firebase-admin v12.5.0 */
|
|
2
2
|
"use strict";
|
|
3
3
|
/*!
|
|
4
4
|
* Copyright 2021 Google Inc.
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
* limitations under the License.
|
|
17
17
|
*/
|
|
18
18
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
-
exports.PercentConditionOperator = void 0;
|
|
19
|
+
exports.CustomSignalOperator = exports.PercentConditionOperator = void 0;
|
|
20
20
|
/**
|
|
21
21
|
* Defines supported operators for percent conditions.
|
|
22
22
|
*/
|
|
@@ -44,3 +44,79 @@ var PercentConditionOperator;
|
|
|
44
44
|
*/
|
|
45
45
|
PercentConditionOperator["BETWEEN"] = "BETWEEN";
|
|
46
46
|
})(PercentConditionOperator || (exports.PercentConditionOperator = PercentConditionOperator = {}));
|
|
47
|
+
/**
|
|
48
|
+
* Defines supported operators for custom signal conditions.
|
|
49
|
+
*/
|
|
50
|
+
var CustomSignalOperator;
|
|
51
|
+
(function (CustomSignalOperator) {
|
|
52
|
+
/**
|
|
53
|
+
* A catchall error case.
|
|
54
|
+
*/
|
|
55
|
+
CustomSignalOperator["UNKNOWN"] = "UNKNOWN";
|
|
56
|
+
/**
|
|
57
|
+
* Matches a numeric value less than the target value.
|
|
58
|
+
*/
|
|
59
|
+
CustomSignalOperator["NUMERIC_LESS_THAN"] = "NUMERIC_LESS_THAN";
|
|
60
|
+
/**
|
|
61
|
+
* Matches a numeric value less than or equal to the target value.
|
|
62
|
+
*/
|
|
63
|
+
CustomSignalOperator["NUMERIC_LESS_EQUAL"] = "NUMERIC_LESS_EQUAL";
|
|
64
|
+
/**
|
|
65
|
+
* Matches a numeric value equal to the target value.
|
|
66
|
+
*/
|
|
67
|
+
CustomSignalOperator["NUMERIC_EQUAL"] = "NUMERIC_EQUAL";
|
|
68
|
+
/**
|
|
69
|
+
* Matches a numeric value not equal to the target value.
|
|
70
|
+
*/
|
|
71
|
+
CustomSignalOperator["NUMERIC_NOT_EQUAL"] = "NUMERIC_NOT_EQUAL";
|
|
72
|
+
/**
|
|
73
|
+
* Matches a numeric value greater than the target value.
|
|
74
|
+
*/
|
|
75
|
+
CustomSignalOperator["NUMERIC_GREATER_THAN"] = "NUMERIC_GREATER_THAN";
|
|
76
|
+
/**
|
|
77
|
+
* Matches a numeric value greater than or equal to the target value.
|
|
78
|
+
*/
|
|
79
|
+
CustomSignalOperator["NUMERIC_GREATER_EQUAL"] = "NUMERIC_GREATER_EQUAL";
|
|
80
|
+
/**
|
|
81
|
+
* Matches if at least one of the target values is a substring of the actual custom
|
|
82
|
+
* signal value (e.g. "abc" contains the string "a", "bc").
|
|
83
|
+
*/
|
|
84
|
+
CustomSignalOperator["STRING_CONTAINS"] = "STRING_CONTAINS";
|
|
85
|
+
/**
|
|
86
|
+
* Matches if none of the target values is a substring of the actual custom signal value.
|
|
87
|
+
*/
|
|
88
|
+
CustomSignalOperator["STRING_DOES_NOT_CONTAIN"] = "STRING_DOES_NOT_CONTAIN";
|
|
89
|
+
/**
|
|
90
|
+
* Matches if the actual value exactly matches at least one of the target values.
|
|
91
|
+
*/
|
|
92
|
+
CustomSignalOperator["STRING_EXACTLY_MATCHES"] = "STRING_EXACTLY_MATCHES";
|
|
93
|
+
/**
|
|
94
|
+
* The target regular expression matches at least one of the actual values.
|
|
95
|
+
* The regex conforms to RE2 format. See https://github.com/google/re2/wiki/Syntax
|
|
96
|
+
*/
|
|
97
|
+
CustomSignalOperator["STRING_CONTAINS_REGEX"] = "STRING_CONTAINS_REGEX";
|
|
98
|
+
/**
|
|
99
|
+
* Matches if the actual version value is less than the target value.
|
|
100
|
+
*/
|
|
101
|
+
CustomSignalOperator["SEMANTIC_VERSION_LESS_THAN"] = "SEMANTIC_VERSION_LESS_THAN";
|
|
102
|
+
/**
|
|
103
|
+
* Matches if the actual version value is less than or equal to the target value.
|
|
104
|
+
*/
|
|
105
|
+
CustomSignalOperator["SEMANTIC_VERSION_LESS_EQUAL"] = "SEMANTIC_VERSION_LESS_EQUAL";
|
|
106
|
+
/**
|
|
107
|
+
* Matches if the actual version value is equal to the target value.
|
|
108
|
+
*/
|
|
109
|
+
CustomSignalOperator["SEMANTIC_VERSION_EQUAL"] = "SEMANTIC_VERSION_EQUAL";
|
|
110
|
+
/**
|
|
111
|
+
* Matches if the actual version value is not equal to the target value.
|
|
112
|
+
*/
|
|
113
|
+
CustomSignalOperator["SEMANTIC_VERSION_NOT_EQUAL"] = "SEMANTIC_VERSION_NOT_EQUAL";
|
|
114
|
+
/**
|
|
115
|
+
* Matches if the actual version value is greater than the target value.
|
|
116
|
+
*/
|
|
117
|
+
CustomSignalOperator["SEMANTIC_VERSION_GREATER_THAN"] = "SEMANTIC_VERSION_GREATER_THAN";
|
|
118
|
+
/**
|
|
119
|
+
* Matches if the actual version value is greater than or equal to the target value.
|
|
120
|
+
*/
|
|
121
|
+
CustomSignalOperator["SEMANTIC_VERSION_GREATER_EQUAL"] = "SEMANTIC_VERSION_GREATER_EQUAL";
|
|
122
|
+
})(CustomSignalOperator || (exports.CustomSignalOperator = CustomSignalOperator = {}));
|
package/lib/storage/index.d.ts
CHANGED
package/lib/storage/index.js
CHANGED