@firebase/data-connect 0.4.0-canary.843a8d789 → 0.4.0-canary.891a0c9d4
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/index.cjs.js +7 -62
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +8 -62
- package/dist/index.esm.js.map +1 -1
- package/dist/index.node.cjs.js +7 -62
- package/dist/index.node.cjs.js.map +1 -1
- package/dist/internal.d.ts +4 -31
- package/dist/node-esm/index.node.esm.js +8 -62
- package/dist/node-esm/index.node.esm.js.map +1 -1
- package/dist/node-esm/src/api/index.d.ts +1 -1
- package/dist/node-esm/src/core/query/queryOptions.d.ts +0 -3
- package/dist/node-esm/src/util/validateArgs.d.ts +4 -28
- package/dist/private.d.ts +0 -6
- package/dist/public.d.ts +0 -4
- package/dist/src/api/index.d.ts +1 -1
- package/dist/src/core/query/queryOptions.d.ts +0 -3
- package/dist/src/util/validateArgs.d.ts +4 -28
- package/package.json +7 -7
package/dist/index.cjs.js
CHANGED
|
@@ -8,7 +8,7 @@ var util = require('@firebase/util');
|
|
|
8
8
|
var logger$1 = require('@firebase/logger');
|
|
9
9
|
|
|
10
10
|
const name = "@firebase/data-connect";
|
|
11
|
-
const version = "0.4.0-canary.
|
|
11
|
+
const version = "0.4.0-canary.891a0c9d4";
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* @license
|
|
@@ -1948,25 +1948,19 @@ function toQueryRef(serializedRef) {
|
|
|
1948
1948
|
* limitations under the License.
|
|
1949
1949
|
*/
|
|
1950
1950
|
/**
|
|
1951
|
-
* The generated SDK will allow the user to pass in either the
|
|
1952
|
-
*
|
|
1953
|
-
* and variables based on the arguments passed in.
|
|
1954
|
-
*
|
|
1955
|
-
* Generated SDKs generated from versions 3.2.0 and lower of the Data Connect emulator binary are
|
|
1956
|
-
* NOT concerned with options, and will use this function to validate arguments.
|
|
1957
|
-
*
|
|
1951
|
+
* The generated SDK will allow the user to pass in either the variable or the data connect instance with the variable,
|
|
1952
|
+
* and this function validates the variables and returns back the DataConnect instance and variables based on the arguments passed in.
|
|
1958
1953
|
* @param connectorConfig
|
|
1959
1954
|
* @param dcOrVars
|
|
1960
1955
|
* @param vars
|
|
1961
|
-
* @param
|
|
1956
|
+
* @param validateVars
|
|
1962
1957
|
* @returns {DataConnect} and {Variables} instance
|
|
1963
1958
|
* @internal
|
|
1964
1959
|
*/
|
|
1965
|
-
function validateArgs(connectorConfig, dcOrVars, vars,
|
|
1960
|
+
function validateArgs(connectorConfig, dcOrVars, vars, validateVars) {
|
|
1966
1961
|
let dcInstance;
|
|
1967
1962
|
let realVars;
|
|
1968
|
-
|
|
1969
|
-
if (dcFirstArg) {
|
|
1963
|
+
if (dcOrVars && 'enableEmulator' in dcOrVars) {
|
|
1970
1964
|
dcInstance = dcOrVars;
|
|
1971
1965
|
realVars = vars;
|
|
1972
1966
|
}
|
|
@@ -1974,59 +1968,11 @@ function validateArgs(connectorConfig, dcOrVars, vars, variablesRequired) {
|
|
|
1974
1968
|
dcInstance = getDataConnect(connectorConfig);
|
|
1975
1969
|
realVars = dcOrVars;
|
|
1976
1970
|
}
|
|
1977
|
-
if (!dcInstance || (!realVars &&
|
|
1971
|
+
if (!dcInstance || (!realVars && validateVars)) {
|
|
1978
1972
|
throw new DataConnectError(Code.INVALID_ARGUMENT, 'Variables required.');
|
|
1979
1973
|
}
|
|
1980
1974
|
return { dc: dcInstance, vars: realVars };
|
|
1981
1975
|
}
|
|
1982
|
-
/**
|
|
1983
|
-
* The generated SDK will allow the user to pass in either the variables or the data connect instance
|
|
1984
|
-
* with the variables, and/or options. This function validates the variables and returns back the
|
|
1985
|
-
* DataConnect instance and variables, and potentially options, based on the arguments passed in.
|
|
1986
|
-
*
|
|
1987
|
-
* Generated SDKs generated from versions 3.2.0 and higher of the Data Connect emulator binary are
|
|
1988
|
-
* in fact concerned with options, and will use this function to validate arguments.
|
|
1989
|
-
*
|
|
1990
|
-
* @param connectorConfig
|
|
1991
|
-
* @param dcOrVarsOrOptions
|
|
1992
|
-
* @param varsOrOptions
|
|
1993
|
-
* @param variablesRequired
|
|
1994
|
-
* @param options
|
|
1995
|
-
* @returns {DataConnect} and {Variables} instance, and optionally {ExecuteQueryOptions}
|
|
1996
|
-
* @internal
|
|
1997
|
-
*/
|
|
1998
|
-
function validateArgsWithOptions(connectorConfig, dcOrVarsOrOptions, varsOrOptions, options, hasVars, variablesRequired) {
|
|
1999
|
-
let dcInstance;
|
|
2000
|
-
let realVars;
|
|
2001
|
-
let realOptions;
|
|
2002
|
-
const dcFirstArg = dcOrVarsOrOptions && 'enableEmulator' in dcOrVarsOrOptions;
|
|
2003
|
-
if (dcFirstArg) {
|
|
2004
|
-
dcInstance = dcOrVarsOrOptions;
|
|
2005
|
-
if (hasVars) {
|
|
2006
|
-
realVars = varsOrOptions;
|
|
2007
|
-
realOptions = options;
|
|
2008
|
-
}
|
|
2009
|
-
else {
|
|
2010
|
-
realVars = undefined;
|
|
2011
|
-
realOptions = varsOrOptions;
|
|
2012
|
-
}
|
|
2013
|
-
}
|
|
2014
|
-
else {
|
|
2015
|
-
dcInstance = getDataConnect(connectorConfig);
|
|
2016
|
-
if (hasVars) {
|
|
2017
|
-
realVars = dcOrVarsOrOptions;
|
|
2018
|
-
realOptions = varsOrOptions;
|
|
2019
|
-
}
|
|
2020
|
-
else {
|
|
2021
|
-
realVars = undefined;
|
|
2022
|
-
realOptions = dcOrVarsOrOptions;
|
|
2023
|
-
}
|
|
2024
|
-
}
|
|
2025
|
-
if (!dcInstance || (!realVars && variablesRequired)) {
|
|
2026
|
-
throw new DataConnectError(Code.INVALID_ARGUMENT, 'Variables required.');
|
|
2027
|
-
}
|
|
2028
|
-
return { dc: dcInstance, vars: realVars, options: realOptions };
|
|
2029
|
-
}
|
|
2030
1976
|
|
|
2031
1977
|
/**
|
|
2032
1978
|
* @license
|
|
@@ -2118,6 +2064,5 @@ exports.subscribe = subscribe;
|
|
|
2118
2064
|
exports.terminate = terminate;
|
|
2119
2065
|
exports.toQueryRef = toQueryRef;
|
|
2120
2066
|
exports.validateArgs = validateArgs;
|
|
2121
|
-
exports.validateArgsWithOptions = validateArgsWithOptions;
|
|
2122
2067
|
exports.validateDCOptions = validateDCOptions;
|
|
2123
2068
|
//# sourceMappingURL=index.cjs.js.map
|