ga4-export-fixer 0.1.3-dev.0 → 0.1.3-dev.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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/utils.js +4 -5
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ga4-export-fixer",
3
- "version": "0.1.3-dev.0",
3
+ "version": "0.1.3-dev.2",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "files": [
package/utils.js CHANGED
@@ -184,7 +184,7 @@ const mergeSQLConfigurations = (defaultConfig, inputConfig = {}) => {
184
184
  return `\`${project}.${dataset}.events_*\``;
185
185
  }
186
186
  }
187
- throw new Error(`sourceTable must be a Dataform table reference or a string in the format '\`project.dataset.table\`'. Received: ${JSON.stringify(sourceTable)}`);
187
+ throw new Error(`sourceTable must be a Dataform table reference or a string. Supported string formats include: '\`project.dataset.events_*\`', 'project.dataset', 'project.dataset.events_*', for example. Received: ${JSON.stringify(sourceTable)}`);
188
188
  };
189
189
 
190
190
  // process the sourceTable to support different formats
@@ -198,7 +198,7 @@ const mergeSQLConfigurations = (defaultConfig, inputConfig = {}) => {
198
198
  /**
199
199
  * Checks if a given object is a Dataform table reference object.
200
200
  *
201
- * A Dataform table reference object is expected to have the properties: 'name', 'project', and 'dataset'.
201
+ * A Dataform table reference object is expected to have the properties: 'name', and 'schema'.
202
202
  *
203
203
  * @param {Object} obj - The object to check.
204
204
  * @returns {boolean} True if the object is a Dataform table reference, false otherwise.
@@ -207,8 +207,7 @@ const isDataformTableReferenceObject = (obj) => {
207
207
  return obj &&
208
208
  typeof obj === 'object' &&
209
209
  Object.hasOwn(obj, 'name') &&
210
- Object.hasOwn(obj, 'project') &&
211
- Object.hasOwn(obj, 'dataset');
210
+ Object.hasOwn(obj, 'schema');
212
211
  };
213
212
 
214
213
 
@@ -216,7 +215,7 @@ const isDataformTableReferenceObject = (obj) => {
216
215
  * Sets the Dataform context for a configuration object.
217
216
  *
218
217
  * This function updates the provided config object by resolving the `sourceTable` property. If the `sourceTable`
219
- * is a Dataform table reference object (with 'name', 'project', and 'dataset' properties), it uses `ctx.ref()` to
218
+ * is a Dataform table reference object (with 'name', and 'schema' properties), it uses `ctx.ref()` to
220
219
  * obtain the correct reference. Otherwise, it checks if `sourceTable` is a string in the format '`project.dataset.table`'.
221
220
  * If not, it throws an error. Finally, it sets the `self` and `incremental` properties on the config using
222
221
  * `ctx.self()` and `ctx.incremental()`, respectively.