@firebase/data-connect 0.4.0 → 0.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.
@@ -21,5 +21,5 @@ export * from './Reference';
21
21
  export * from './Mutation';
22
22
  export * from './query';
23
23
  export { setLogLevel } from '../logger';
24
- export { validateArgs } from '../util/validateArgs';
24
+ export { validateArgs, validateArgsWithOptions } from '../util/validateArgs';
25
25
  export { DataConnectErrorCode, Code, DataConnectError, DataConnectOperationError, DataConnectOperationFailureResponse, DataConnectOperationFailureResponseErrorInfo } from '../core/error';
@@ -20,6 +20,9 @@ export declare const QueryFetchPolicy: {
20
20
  readonly SERVER_ONLY: "SERVER_ONLY";
21
21
  };
22
22
  export type QueryFetchPolicy = (typeof QueryFetchPolicy)[keyof typeof QueryFetchPolicy];
23
+ /**
24
+ * Options for executing a query.
25
+ */
23
26
  export interface ExecuteQueryOptions {
24
27
  fetchPolicy: QueryFetchPolicy;
25
28
  }
@@ -14,20 +14,44 @@
14
14
  * See the License for the specific language governing permissions and
15
15
  * limitations under the License.
16
16
  */
17
+ import { ExecuteQueryOptions } from '../api';
17
18
  import { ConnectorConfig, DataConnect } from '../api/DataConnect';
18
19
  interface ParsedArgs<Variables> {
19
20
  dc: DataConnect;
20
21
  vars: Variables;
22
+ options?: ExecuteQueryOptions;
21
23
  }
22
24
  /**
23
- * The generated SDK will allow the user to pass in either the variable or the data connect instance with the variable,
24
- * and this function validates the variables and returns back the DataConnect instance and variables based on the arguments passed in.
25
+ * The generated SDK will allow the user to pass in either the variables or the data connect instance
26
+ * with the variables. This function validates the variables and returns back the DataConnect instance
27
+ * and variables based on the arguments passed in.
28
+ *
29
+ * Generated SDKs generated from versions 3.2.0 and lower of the Data Connect emulator binary are
30
+ * NOT concerned with options, and will use this function to validate arguments.
31
+ *
25
32
  * @param connectorConfig
26
33
  * @param dcOrVars
27
34
  * @param vars
28
- * @param validateVars
35
+ * @param variablesRequired
29
36
  * @returns {DataConnect} and {Variables} instance
30
37
  * @internal
31
38
  */
32
- export declare function validateArgs<Variables extends object>(connectorConfig: ConnectorConfig, dcOrVars?: DataConnect | Variables, vars?: Variables, validateVars?: boolean): ParsedArgs<Variables>;
39
+ export declare function validateArgs<Variables extends object>(connectorConfig: ConnectorConfig, dcOrVars?: DataConnect | Variables, vars?: Variables, variablesRequired?: boolean): ParsedArgs<Variables>;
40
+ /**
41
+ * The generated SDK will allow the user to pass in either the variables or the data connect instance
42
+ * with the variables, and/or options. This function validates the variables and returns back the
43
+ * DataConnect instance and variables, and potentially options, based on the arguments passed in.
44
+ *
45
+ * Generated SDKs generated from versions 3.2.0 and higher of the Data Connect emulator binary are
46
+ * in fact concerned with options, and will use this function to validate arguments.
47
+ *
48
+ * @param connectorConfig
49
+ * @param dcOrVarsOrOptions
50
+ * @param varsOrOptions
51
+ * @param variablesRequired
52
+ * @param options
53
+ * @returns {DataConnect} and {Variables} instance, and optionally {ExecuteQueryOptions}
54
+ * @internal
55
+ */
56
+ export declare function validateArgsWithOptions<Variables extends object>(connectorConfig: ConnectorConfig, dcOrVarsOrOptions?: DataConnect | Variables | ExecuteQueryOptions, varsOrOptions?: Variables | ExecuteQueryOptions, options?: ExecuteQueryOptions, hasVars?: boolean, variablesRequired?: boolean): ParsedArgs<Variables>;
33
57
  export {};
package/dist/private.d.ts CHANGED
@@ -290,6 +290,9 @@ export declare function executeMutation<Data, Variables>(mutationRef: MutationRe
290
290
  */
291
291
  export declare function executeQuery<Data, Variables>(queryRef: QueryRef<Data, Variables>, options?: ExecuteQueryOptions): QueryPromise<Data, Variables>;
292
292
 
293
+ /**
294
+ * Options for executing a query.
295
+ */
293
296
  export declare interface ExecuteQueryOptions {
294
297
  fetchPolicy: QueryFetchPolicy;
295
298
  }
@@ -444,6 +447,7 @@ export declare interface OpResult<Data> {
444
447
  declare interface ParsedArgs<Variables> {
445
448
  dc: DataConnect;
446
449
  vars: Variables;
450
+ options?: ExecuteQueryOptions;
447
451
  }
448
452
 
449
453
  /* Excluded from this release type: parseOptions */
@@ -650,6 +654,8 @@ export declare interface TransportOptions {
650
654
 
651
655
  /* Excluded from this release type: validateArgs */
652
656
 
657
+ /* Excluded from this release type: validateArgsWithOptions */
658
+
653
659
  /* Excluded from this release type: validateDCOptions */
654
660
 
655
661
  export { }
package/dist/public.d.ts CHANGED
@@ -138,6 +138,9 @@ export declare function executeMutation<Data, Variables>(mutationRef: MutationRe
138
138
  * @returns `QueryPromise`
139
139
  */
140
140
  export declare function executeQuery<Data, Variables>(queryRef: QueryRef<Data, Variables>, options?: ExecuteQueryOptions): QueryPromise<Data, Variables>;
141
+ /**
142
+ * Options for executing a query.
143
+ */
141
144
  export declare interface ExecuteQueryOptions {
142
145
  fetchPolicy: QueryFetchPolicy;
143
146
  }
@@ -346,5 +349,6 @@ export declare interface TransportOptions {
346
349
  port?: number;
347
350
  }
348
351
  /* Excluded from this release type: validateArgs */
352
+ /* Excluded from this release type: validateArgsWithOptions */
349
353
  /* Excluded from this release type: validateDCOptions */
350
354
  export {};
@@ -21,5 +21,5 @@ export * from './Reference';
21
21
  export * from './Mutation';
22
22
  export * from './query';
23
23
  export { setLogLevel } from '../logger';
24
- export { validateArgs } from '../util/validateArgs';
24
+ export { validateArgs, validateArgsWithOptions } from '../util/validateArgs';
25
25
  export { DataConnectErrorCode, Code, DataConnectError, DataConnectOperationError, DataConnectOperationFailureResponse, DataConnectOperationFailureResponseErrorInfo } from '../core/error';
@@ -20,6 +20,9 @@ export declare const QueryFetchPolicy: {
20
20
  readonly SERVER_ONLY: "SERVER_ONLY";
21
21
  };
22
22
  export type QueryFetchPolicy = (typeof QueryFetchPolicy)[keyof typeof QueryFetchPolicy];
23
+ /**
24
+ * Options for executing a query.
25
+ */
23
26
  export interface ExecuteQueryOptions {
24
27
  fetchPolicy: QueryFetchPolicy;
25
28
  }
@@ -14,20 +14,44 @@
14
14
  * See the License for the specific language governing permissions and
15
15
  * limitations under the License.
16
16
  */
17
+ import { ExecuteQueryOptions } from '../api';
17
18
  import { ConnectorConfig, DataConnect } from '../api/DataConnect';
18
19
  interface ParsedArgs<Variables> {
19
20
  dc: DataConnect;
20
21
  vars: Variables;
22
+ options?: ExecuteQueryOptions;
21
23
  }
22
24
  /**
23
- * The generated SDK will allow the user to pass in either the variable or the data connect instance with the variable,
24
- * and this function validates the variables and returns back the DataConnect instance and variables based on the arguments passed in.
25
+ * The generated SDK will allow the user to pass in either the variables or the data connect instance
26
+ * with the variables. This function validates the variables and returns back the DataConnect instance
27
+ * and variables based on the arguments passed in.
28
+ *
29
+ * Generated SDKs generated from versions 3.2.0 and lower of the Data Connect emulator binary are
30
+ * NOT concerned with options, and will use this function to validate arguments.
31
+ *
25
32
  * @param connectorConfig
26
33
  * @param dcOrVars
27
34
  * @param vars
28
- * @param validateVars
35
+ * @param variablesRequired
29
36
  * @returns {DataConnect} and {Variables} instance
30
37
  * @internal
31
38
  */
32
- export declare function validateArgs<Variables extends object>(connectorConfig: ConnectorConfig, dcOrVars?: DataConnect | Variables, vars?: Variables, validateVars?: boolean): ParsedArgs<Variables>;
39
+ export declare function validateArgs<Variables extends object>(connectorConfig: ConnectorConfig, dcOrVars?: DataConnect | Variables, vars?: Variables, variablesRequired?: boolean): ParsedArgs<Variables>;
40
+ /**
41
+ * The generated SDK will allow the user to pass in either the variables or the data connect instance
42
+ * with the variables, and/or options. This function validates the variables and returns back the
43
+ * DataConnect instance and variables, and potentially options, based on the arguments passed in.
44
+ *
45
+ * Generated SDKs generated from versions 3.2.0 and higher of the Data Connect emulator binary are
46
+ * in fact concerned with options, and will use this function to validate arguments.
47
+ *
48
+ * @param connectorConfig
49
+ * @param dcOrVarsOrOptions
50
+ * @param varsOrOptions
51
+ * @param variablesRequired
52
+ * @param options
53
+ * @returns {DataConnect} and {Variables} instance, and optionally {ExecuteQueryOptions}
54
+ * @internal
55
+ */
56
+ export declare function validateArgsWithOptions<Variables extends object>(connectorConfig: ConnectorConfig, dcOrVarsOrOptions?: DataConnect | Variables | ExecuteQueryOptions, varsOrOptions?: Variables | ExecuteQueryOptions, options?: ExecuteQueryOptions, hasVars?: boolean, variablesRequired?: boolean): ParsedArgs<Variables>;
33
57
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@firebase/data-connect",
3
- "version": "0.4.0",
3
+ "version": "0.5.0",
4
4
  "description": "",
5
5
  "author": "Firebase <firebase-support@google.com> (https://firebase.google.com/)",
6
6
  "main": "dist/index.node.cjs.js",
@@ -49,13 +49,13 @@
49
49
  },
50
50
  "dependencies": {
51
51
  "@firebase/auth-interop-types": "0.2.4",
52
- "@firebase/component": "0.7.1",
52
+ "@firebase/component": "0.7.2",
53
53
  "@firebase/logger": "0.5.0",
54
- "@firebase/util": "1.14.0",
54
+ "@firebase/util": "1.15.0",
55
55
  "tslib": "^2.1.0"
56
56
  },
57
57
  "devDependencies": {
58
- "@firebase/app": "0.14.9",
58
+ "@firebase/app": "0.14.10",
59
59
  "rollup": "2.79.2",
60
60
  "rollup-plugin-typescript2": "0.36.0",
61
61
  "typescript": "5.5.4"