UNPKG

@dataform/cli

Version:

Dataform command line interface.

1,070 lines (1,000 loc) 1.13 MB
#!/usr/bin/env node // Copyright 2023 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. 'use strict'; var fs = require('fs'); var glob = require('glob'); var path = require('path'); var semver = require('semver'); var vm2 = require('vm2'); var protobufjs = require('protobufjs'); var $protobuf = require('protobufjs/minimal'); function _interopNamespace(e) { if (e && e.__esModule) return e; var n = Object.create(null); if (e) { Object.keys(e).forEach(function (k) { if (k !== 'default') { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); } n["default"] = e; return Object.freeze(n); } var fs__namespace = /*#__PURE__*/_interopNamespace(fs); var glob__namespace = /*#__PURE__*/_interopNamespace(glob); var path__namespace = /*#__PURE__*/_interopNamespace(path); var semver__namespace = /*#__PURE__*/_interopNamespace(semver); var $protobuf__namespace = /*#__PURE__*/_interopNamespace($protobuf); var VerifyProtoErrorBehaviour; (function (VerifyProtoErrorBehaviour) { VerifyProtoErrorBehaviour[VerifyProtoErrorBehaviour["DEFAULT"] = 0] = "DEFAULT"; VerifyProtoErrorBehaviour[VerifyProtoErrorBehaviour["SUGGEST_REPORTING_TO_DATAFORM_TEAM"] = 1] = "SUGGEST_REPORTING_TO_DATAFORM_TEAM"; VerifyProtoErrorBehaviour[VerifyProtoErrorBehaviour["SHOW_DOCS_LINK"] = 2] = "SHOW_DOCS_LINK"; })(VerifyProtoErrorBehaviour || (VerifyProtoErrorBehaviour = {})); function encode64(protoType, value = {}) { return toBase64(protoType.encode(protoType.create(value)).finish()); } function toBase64(value) { return protobufjs.util.base64.encode(value, 0, value.length); } /*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/ // Common aliases const $Reader = $protobuf__namespace.Reader, $Writer = $protobuf__namespace.Writer, $util = $protobuf__namespace.util; // Exported root namespace const $root = $protobuf__namespace.roots["default"] || ($protobuf__namespace.roots["default"] = {}); const dataform = $root.dataform = (() => { /** * Namespace dataform. * @exports dataform * @namespace */ const dataform = {}; dataform.WorkflowSettings = (function() { /** * Properties of a WorkflowSettings. * @memberof dataform * @interface IWorkflowSettings * @property {string|null} [dataformCoreVersion] WorkflowSettings dataformCoreVersion * @property {string|null} [defaultProject] WorkflowSettings defaultProject * @property {string|null} [defaultDataset] WorkflowSettings defaultDataset * @property {string|null} [defaultLocation] WorkflowSettings defaultLocation * @property {string|null} [defaultAssertionDataset] WorkflowSettings defaultAssertionDataset * @property {Object.<string,string>|null} [vars] WorkflowSettings vars * @property {string|null} [projectSuffix] WorkflowSettings projectSuffix * @property {string|null} [datasetSuffix] WorkflowSettings datasetSuffix * @property {string|null} [namePrefix] WorkflowSettings namePrefix * @property {dataform.INotebookRuntimeOptionsConfig|null} [defaultNotebookRuntimeOptions] WorkflowSettings defaultNotebookRuntimeOptions * @property {string|null} [builtinAssertionNamePrefix] WorkflowSettings builtinAssertionNamePrefix * @property {dataform.IDefaultIcebergConfig|null} [defaultIcebergConfig] WorkflowSettings defaultIcebergConfig */ /** * Constructs a new WorkflowSettings. * @memberof dataform * @classdesc Represents a WorkflowSettings. * @implements IWorkflowSettings * @constructor * @param {dataform.IWorkflowSettings=} [properties] Properties to set */ function WorkflowSettings(properties) { this.vars = {}; if (properties) for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * WorkflowSettings dataformCoreVersion. * @member {string} dataformCoreVersion * @memberof dataform.WorkflowSettings * @instance */ WorkflowSettings.prototype.dataformCoreVersion = ""; /** * WorkflowSettings defaultProject. * @member {string} defaultProject * @memberof dataform.WorkflowSettings * @instance */ WorkflowSettings.prototype.defaultProject = ""; /** * WorkflowSettings defaultDataset. * @member {string} defaultDataset * @memberof dataform.WorkflowSettings * @instance */ WorkflowSettings.prototype.defaultDataset = ""; /** * WorkflowSettings defaultLocation. * @member {string} defaultLocation * @memberof dataform.WorkflowSettings * @instance */ WorkflowSettings.prototype.defaultLocation = ""; /** * WorkflowSettings defaultAssertionDataset. * @member {string} defaultAssertionDataset * @memberof dataform.WorkflowSettings * @instance */ WorkflowSettings.prototype.defaultAssertionDataset = ""; /** * WorkflowSettings vars. * @member {Object.<string,string>} vars * @memberof dataform.WorkflowSettings * @instance */ WorkflowSettings.prototype.vars = $util.emptyObject; /** * WorkflowSettings projectSuffix. * @member {string} projectSuffix * @memberof dataform.WorkflowSettings * @instance */ WorkflowSettings.prototype.projectSuffix = ""; /** * WorkflowSettings datasetSuffix. * @member {string} datasetSuffix * @memberof dataform.WorkflowSettings * @instance */ WorkflowSettings.prototype.datasetSuffix = ""; /** * WorkflowSettings namePrefix. * @member {string} namePrefix * @memberof dataform.WorkflowSettings * @instance */ WorkflowSettings.prototype.namePrefix = ""; /** * WorkflowSettings defaultNotebookRuntimeOptions. * @member {dataform.INotebookRuntimeOptionsConfig|null|undefined} defaultNotebookRuntimeOptions * @memberof dataform.WorkflowSettings * @instance */ WorkflowSettings.prototype.defaultNotebookRuntimeOptions = null; /** * WorkflowSettings builtinAssertionNamePrefix. * @member {string} builtinAssertionNamePrefix * @memberof dataform.WorkflowSettings * @instance */ WorkflowSettings.prototype.builtinAssertionNamePrefix = ""; /** * WorkflowSettings defaultIcebergConfig. * @member {dataform.IDefaultIcebergConfig|null|undefined} defaultIcebergConfig * @memberof dataform.WorkflowSettings * @instance */ WorkflowSettings.prototype.defaultIcebergConfig = null; /** * Creates a new WorkflowSettings instance using the specified properties. * @function create * @memberof dataform.WorkflowSettings * @static * @param {dataform.IWorkflowSettings=} [properties] Properties to set * @returns {dataform.WorkflowSettings} WorkflowSettings instance */ WorkflowSettings.create = function create(properties) { return new WorkflowSettings(properties); }; /** * Encodes the specified WorkflowSettings message. Does not implicitly {@link dataform.WorkflowSettings.verify|verify} messages. * @function encode * @memberof dataform.WorkflowSettings * @static * @param {dataform.IWorkflowSettings} message WorkflowSettings message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ WorkflowSettings.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.dataformCoreVersion != null && Object.hasOwnProperty.call(message, "dataformCoreVersion")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.dataformCoreVersion); if (message.defaultProject != null && Object.hasOwnProperty.call(message, "defaultProject")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.defaultProject); if (message.defaultDataset != null && Object.hasOwnProperty.call(message, "defaultDataset")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.defaultDataset); if (message.defaultLocation != null && Object.hasOwnProperty.call(message, "defaultLocation")) writer.uint32(/* id 4, wireType 2 =*/34).string(message.defaultLocation); if (message.defaultAssertionDataset != null && Object.hasOwnProperty.call(message, "defaultAssertionDataset")) writer.uint32(/* id 5, wireType 2 =*/42).string(message.defaultAssertionDataset); if (message.vars != null && Object.hasOwnProperty.call(message, "vars")) for (let keys = Object.keys(message.vars), i = 0; i < keys.length; ++i) writer.uint32(/* id 6, wireType 2 =*/50).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.vars[keys[i]]).ldelim(); if (message.projectSuffix != null && Object.hasOwnProperty.call(message, "projectSuffix")) writer.uint32(/* id 7, wireType 2 =*/58).string(message.projectSuffix); if (message.datasetSuffix != null && Object.hasOwnProperty.call(message, "datasetSuffix")) writer.uint32(/* id 8, wireType 2 =*/66).string(message.datasetSuffix); if (message.namePrefix != null && Object.hasOwnProperty.call(message, "namePrefix")) writer.uint32(/* id 9, wireType 2 =*/74).string(message.namePrefix); if (message.defaultNotebookRuntimeOptions != null && Object.hasOwnProperty.call(message, "defaultNotebookRuntimeOptions")) $root.dataform.NotebookRuntimeOptionsConfig.encode(message.defaultNotebookRuntimeOptions, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); if (message.builtinAssertionNamePrefix != null && Object.hasOwnProperty.call(message, "builtinAssertionNamePrefix")) writer.uint32(/* id 11, wireType 2 =*/90).string(message.builtinAssertionNamePrefix); if (message.defaultIcebergConfig != null && Object.hasOwnProperty.call(message, "defaultIcebergConfig")) $root.dataform.DefaultIcebergConfig.encode(message.defaultIcebergConfig, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); return writer; }; /** * Encodes the specified WorkflowSettings message, length delimited. Does not implicitly {@link dataform.WorkflowSettings.verify|verify} messages. * @function encodeDelimited * @memberof dataform.WorkflowSettings * @static * @param {dataform.IWorkflowSettings} message WorkflowSettings message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ WorkflowSettings.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a WorkflowSettings message from the specified reader or buffer. * @function decode * @memberof dataform.WorkflowSettings * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {dataform.WorkflowSettings} WorkflowSettings * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ WorkflowSettings.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); let end = length === undefined ? reader.len : reader.pos + length, message = new $root.dataform.WorkflowSettings(), key, value; while (reader.pos < end) { let tag = reader.uint32(); switch (tag >>> 3) { case 1: { message.dataformCoreVersion = reader.string(); break; } case 2: { message.defaultProject = reader.string(); break; } case 3: { message.defaultDataset = reader.string(); break; } case 4: { message.defaultLocation = reader.string(); break; } case 5: { message.defaultAssertionDataset = reader.string(); break; } case 6: { if (message.vars === $util.emptyObject) message.vars = {}; let end2 = reader.uint32() + reader.pos; key = ""; value = ""; while (reader.pos < end2) { let tag2 = reader.uint32(); switch (tag2 >>> 3) { case 1: key = reader.string(); break; case 2: value = reader.string(); break; default: reader.skipType(tag2 & 7); break; } } message.vars[key] = value; break; } case 7: { message.projectSuffix = reader.string(); break; } case 8: { message.datasetSuffix = reader.string(); break; } case 9: { message.namePrefix = reader.string(); break; } case 10: { message.defaultNotebookRuntimeOptions = $root.dataform.NotebookRuntimeOptionsConfig.decode(reader, reader.uint32()); break; } case 11: { message.builtinAssertionNamePrefix = reader.string(); break; } case 12: { message.defaultIcebergConfig = $root.dataform.DefaultIcebergConfig.decode(reader, reader.uint32()); break; } default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a WorkflowSettings message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof dataform.WorkflowSettings * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {dataform.WorkflowSettings} WorkflowSettings * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ WorkflowSettings.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a WorkflowSettings message. * @function verify * @memberof dataform.WorkflowSettings * @static * @param {Object.<string,*>} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ WorkflowSettings.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.dataformCoreVersion != null && message.hasOwnProperty("dataformCoreVersion")) if (!$util.isString(message.dataformCoreVersion)) return "dataformCoreVersion: string expected"; if (message.defaultProject != null && message.hasOwnProperty("defaultProject")) if (!$util.isString(message.defaultProject)) return "defaultProject: string expected"; if (message.defaultDataset != null && message.hasOwnProperty("defaultDataset")) if (!$util.isString(message.defaultDataset)) return "defaultDataset: string expected"; if (message.defaultLocation != null && message.hasOwnProperty("defaultLocation")) if (!$util.isString(message.defaultLocation)) return "defaultLocation: string expected"; if (message.defaultAssertionDataset != null && message.hasOwnProperty("defaultAssertionDataset")) if (!$util.isString(message.defaultAssertionDataset)) return "defaultAssertionDataset: string expected"; if (message.vars != null && message.hasOwnProperty("vars")) { if (!$util.isObject(message.vars)) return "vars: object expected"; let key = Object.keys(message.vars); for (let i = 0; i < key.length; ++i) if (!$util.isString(message.vars[key[i]])) return "vars: string{k:string} expected"; } if (message.projectSuffix != null && message.hasOwnProperty("projectSuffix")) if (!$util.isString(message.projectSuffix)) return "projectSuffix: string expected"; if (message.datasetSuffix != null && message.hasOwnProperty("datasetSuffix")) if (!$util.isString(message.datasetSuffix)) return "datasetSuffix: string expected"; if (message.namePrefix != null && message.hasOwnProperty("namePrefix")) if (!$util.isString(message.namePrefix)) return "namePrefix: string expected"; if (message.defaultNotebookRuntimeOptions != null && message.hasOwnProperty("defaultNotebookRuntimeOptions")) { let error = $root.dataform.NotebookRuntimeOptionsConfig.verify(message.defaultNotebookRuntimeOptions); if (error) return "defaultNotebookRuntimeOptions." + error; } if (message.builtinAssertionNamePrefix != null && message.hasOwnProperty("builtinAssertionNamePrefix")) if (!$util.isString(message.builtinAssertionNamePrefix)) return "builtinAssertionNamePrefix: string expected"; if (message.defaultIcebergConfig != null && message.hasOwnProperty("defaultIcebergConfig")) { let error = $root.dataform.DefaultIcebergConfig.verify(message.defaultIcebergConfig); if (error) return "defaultIcebergConfig." + error; } return null; }; /** * Creates a WorkflowSettings message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof dataform.WorkflowSettings * @static * @param {Object.<string,*>} object Plain object * @returns {dataform.WorkflowSettings} WorkflowSettings */ WorkflowSettings.fromObject = function fromObject(object) { if (object instanceof $root.dataform.WorkflowSettings) return object; let message = new $root.dataform.WorkflowSettings(); if (object.dataformCoreVersion != null) message.dataformCoreVersion = String(object.dataformCoreVersion); if (object.defaultProject != null) message.defaultProject = String(object.defaultProject); if (object.defaultDataset != null) message.defaultDataset = String(object.defaultDataset); if (object.defaultLocation != null) message.defaultLocation = String(object.defaultLocation); if (object.defaultAssertionDataset != null) message.defaultAssertionDataset = String(object.defaultAssertionDataset); if (object.vars) { if (typeof object.vars !== "object") throw TypeError(".dataform.WorkflowSettings.vars: object expected"); message.vars = {}; for (let keys = Object.keys(object.vars), i = 0; i < keys.length; ++i) message.vars[keys[i]] = String(object.vars[keys[i]]); } if (object.projectSuffix != null) message.projectSuffix = String(object.projectSuffix); if (object.datasetSuffix != null) message.datasetSuffix = String(object.datasetSuffix); if (object.namePrefix != null) message.namePrefix = String(object.namePrefix); if (object.defaultNotebookRuntimeOptions != null) { if (typeof object.defaultNotebookRuntimeOptions !== "object") throw TypeError(".dataform.WorkflowSettings.defaultNotebookRuntimeOptions: object expected"); message.defaultNotebookRuntimeOptions = $root.dataform.NotebookRuntimeOptionsConfig.fromObject(object.defaultNotebookRuntimeOptions); } if (object.builtinAssertionNamePrefix != null) message.builtinAssertionNamePrefix = String(object.builtinAssertionNamePrefix); if (object.defaultIcebergConfig != null) { if (typeof object.defaultIcebergConfig !== "object") throw TypeError(".dataform.WorkflowSettings.defaultIcebergConfig: object expected"); message.defaultIcebergConfig = $root.dataform.DefaultIcebergConfig.fromObject(object.defaultIcebergConfig); } return message; }; /** * Creates a plain object from a WorkflowSettings message. Also converts values to other types if specified. * @function toObject * @memberof dataform.WorkflowSettings * @static * @param {dataform.WorkflowSettings} message WorkflowSettings * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.<string,*>} Plain object */ WorkflowSettings.toObject = function toObject(message, options) { if (!options) options = {}; let object = {}; if (options.objects || options.defaults) object.vars = {}; if (options.defaults) { object.dataformCoreVersion = ""; object.defaultProject = ""; object.defaultDataset = ""; object.defaultLocation = ""; object.defaultAssertionDataset = ""; object.projectSuffix = ""; object.datasetSuffix = ""; object.namePrefix = ""; object.defaultNotebookRuntimeOptions = null; object.builtinAssertionNamePrefix = ""; object.defaultIcebergConfig = null; } if (message.dataformCoreVersion != null && message.hasOwnProperty("dataformCoreVersion")) object.dataformCoreVersion = message.dataformCoreVersion; if (message.defaultProject != null && message.hasOwnProperty("defaultProject")) object.defaultProject = message.defaultProject; if (message.defaultDataset != null && message.hasOwnProperty("defaultDataset")) object.defaultDataset = message.defaultDataset; if (message.defaultLocation != null && message.hasOwnProperty("defaultLocation")) object.defaultLocation = message.defaultLocation; if (message.defaultAssertionDataset != null && message.hasOwnProperty("defaultAssertionDataset")) object.defaultAssertionDataset = message.defaultAssertionDataset; let keys2; if (message.vars && (keys2 = Object.keys(message.vars)).length) { object.vars = {}; for (let j = 0; j < keys2.length; ++j) object.vars[keys2[j]] = message.vars[keys2[j]]; } if (message.projectSuffix != null && message.hasOwnProperty("projectSuffix")) object.projectSuffix = message.projectSuffix; if (message.datasetSuffix != null && message.hasOwnProperty("datasetSuffix")) object.datasetSuffix = message.datasetSuffix; if (message.namePrefix != null && message.hasOwnProperty("namePrefix")) object.namePrefix = message.namePrefix; if (message.defaultNotebookRuntimeOptions != null && message.hasOwnProperty("defaultNotebookRuntimeOptions")) object.defaultNotebookRuntimeOptions = $root.dataform.NotebookRuntimeOptionsConfig.toObject(message.defaultNotebookRuntimeOptions, options); if (message.builtinAssertionNamePrefix != null && message.hasOwnProperty("builtinAssertionNamePrefix")) object.builtinAssertionNamePrefix = message.builtinAssertionNamePrefix; if (message.defaultIcebergConfig != null && message.hasOwnProperty("defaultIcebergConfig")) object.defaultIcebergConfig = $root.dataform.DefaultIcebergConfig.toObject(message.defaultIcebergConfig, options); return object; }; /** * Converts this WorkflowSettings to JSON. * @function toJSON * @memberof dataform.WorkflowSettings * @instance * @returns {Object.<string,*>} JSON object */ WorkflowSettings.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf__namespace.util.toJSONOptions); }; /** * Gets the default type url for WorkflowSettings * @function getTypeUrl * @memberof dataform.WorkflowSettings * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ WorkflowSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } return typeUrlPrefix + "/dataform.WorkflowSettings"; }; return WorkflowSettings; })(); dataform.DefaultIcebergConfig = (function() { /** * Properties of a DefaultIcebergConfig. * @memberof dataform * @interface IDefaultIcebergConfig * @property {string|null} [bucketName] DefaultIcebergConfig bucketName * @property {string|null} [tableFolderRoot] DefaultIcebergConfig tableFolderRoot * @property {string|null} [tableFolderSubpath] DefaultIcebergConfig tableFolderSubpath */ /** * Constructs a new DefaultIcebergConfig. * @memberof dataform * @classdesc Represents a DefaultIcebergConfig. * @implements IDefaultIcebergConfig * @constructor * @param {dataform.IDefaultIcebergConfig=} [properties] Properties to set */ function DefaultIcebergConfig(properties) { if (properties) for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * DefaultIcebergConfig bucketName. * @member {string} bucketName * @memberof dataform.DefaultIcebergConfig * @instance */ DefaultIcebergConfig.prototype.bucketName = ""; /** * DefaultIcebergConfig tableFolderRoot. * @member {string} tableFolderRoot * @memberof dataform.DefaultIcebergConfig * @instance */ DefaultIcebergConfig.prototype.tableFolderRoot = ""; /** * DefaultIcebergConfig tableFolderSubpath. * @member {string} tableFolderSubpath * @memberof dataform.DefaultIcebergConfig * @instance */ DefaultIcebergConfig.prototype.tableFolderSubpath = ""; /** * Creates a new DefaultIcebergConfig instance using the specified properties. * @function create * @memberof dataform.DefaultIcebergConfig * @static * @param {dataform.IDefaultIcebergConfig=} [properties] Properties to set * @returns {dataform.DefaultIcebergConfig} DefaultIcebergConfig instance */ DefaultIcebergConfig.create = function create(properties) { return new DefaultIcebergConfig(properties); }; /** * Encodes the specified DefaultIcebergConfig message. Does not implicitly {@link dataform.DefaultIcebergConfig.verify|verify} messages. * @function encode * @memberof dataform.DefaultIcebergConfig * @static * @param {dataform.IDefaultIcebergConfig} message DefaultIcebergConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ DefaultIcebergConfig.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.bucketName != null && Object.hasOwnProperty.call(message, "bucketName")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.bucketName); if (message.tableFolderRoot != null && Object.hasOwnProperty.call(message, "tableFolderRoot")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.tableFolderRoot); if (message.tableFolderSubpath != null && Object.hasOwnProperty.call(message, "tableFolderSubpath")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.tableFolderSubpath); return writer; }; /** * Encodes the specified DefaultIcebergConfig message, length delimited. Does not implicitly {@link dataform.DefaultIcebergConfig.verify|verify} messages. * @function encodeDelimited * @memberof dataform.DefaultIcebergConfig * @static * @param {dataform.IDefaultIcebergConfig} message DefaultIcebergConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ DefaultIcebergConfig.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a DefaultIcebergConfig message from the specified reader or buffer. * @function decode * @memberof dataform.DefaultIcebergConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {dataform.DefaultIcebergConfig} DefaultIcebergConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ DefaultIcebergConfig.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); let end = length === undefined ? reader.len : reader.pos + length, message = new $root.dataform.DefaultIcebergConfig(); while (reader.pos < end) { let tag = reader.uint32(); switch (tag >>> 3) { case 1: { message.bucketName = reader.string(); break; } case 2: { message.tableFolderRoot = reader.string(); break; } case 3: { message.tableFolderSubpath = reader.string(); break; } default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a DefaultIcebergConfig message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof dataform.DefaultIcebergConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {dataform.DefaultIcebergConfig} DefaultIcebergConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ DefaultIcebergConfig.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a DefaultIcebergConfig message. * @function verify * @memberof dataform.DefaultIcebergConfig * @static * @param {Object.<string,*>} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ DefaultIcebergConfig.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.bucketName != null && message.hasOwnProperty("bucketName")) if (!$util.isString(message.bucketName)) return "bucketName: string expected"; if (message.tableFolderRoot != null && message.hasOwnProperty("tableFolderRoot")) if (!$util.isString(message.tableFolderRoot)) return "tableFolderRoot: string expected"; if (message.tableFolderSubpath != null && message.hasOwnProperty("tableFolderSubpath")) if (!$util.isString(message.tableFolderSubpath)) return "tableFolderSubpath: string expected"; return null; }; /** * Creates a DefaultIcebergConfig message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof dataform.DefaultIcebergConfig * @static * @param {Object.<string,*>} object Plain object * @returns {dataform.DefaultIcebergConfig} DefaultIcebergConfig */ DefaultIcebergConfig.fromObject = function fromObject(object) { if (object instanceof $root.dataform.DefaultIcebergConfig) return object; let message = new $root.dataform.DefaultIcebergConfig(); if (object.bucketName != null) message.bucketName = String(object.bucketName); if (object.tableFolderRoot != null) message.tableFolderRoot = String(object.tableFolderRoot); if (object.tableFolderSubpath != null) message.tableFolderSubpath = String(object.tableFolderSubpath); return message; }; /** * Creates a plain object from a DefaultIcebergConfig message. Also converts values to other types if specified. * @function toObject * @memberof dataform.DefaultIcebergConfig * @static * @param {dataform.DefaultIcebergConfig} message DefaultIcebergConfig * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.<string,*>} Plain object */ DefaultIcebergConfig.toObject = function toObject(message, options) { if (!options) options = {}; let object = {}; if (options.defaults) { object.bucketName = ""; object.tableFolderRoot = ""; object.tableFolderSubpath = ""; } if (message.bucketName != null && message.hasOwnProperty("bucketName")) object.bucketName = message.bucketName; if (message.tableFolderRoot != null && message.hasOwnProperty("tableFolderRoot")) object.tableFolderRoot = message.tableFolderRoot; if (message.tableFolderSubpath != null && message.hasOwnProperty("tableFolderSubpath")) object.tableFolderSubpath = message.tableFolderSubpath; return object; }; /** * Converts this DefaultIcebergConfig to JSON. * @function toJSON * @memberof dataform.DefaultIcebergConfig * @instance * @returns {Object.<string,*>} JSON object */ DefaultIcebergConfig.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf__namespace.util.toJSONOptions); }; /** * Gets the default type url for DefaultIcebergConfig * @function getTypeUrl * @memberof dataform.DefaultIcebergConfig * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ DefaultIcebergConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } return typeUrlPrefix + "/dataform.DefaultIcebergConfig"; }; return DefaultIcebergConfig; })(); dataform.ActionConfigs = (function() { /** * Properties of an ActionConfigs. * @memberof dataform * @interface IActionConfigs * @property {Array.<dataform.IActionConfig>|null} [actions] ActionConfigs actions */ /** * Constructs a new ActionConfigs. * @memberof dataform * @classdesc Represents an ActionConfigs. * @implements IActionConfigs * @constructor * @param {dataform.IActionConfigs=} [properties] Properties to set */ function ActionConfigs(properties) { this.actions = []; if (properties) for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * ActionConfigs actions. * @member {Array.<dataform.IActionConfig>} actions * @memberof dataform.ActionConfigs * @instance */ ActionConfigs.prototype.actions = $util.emptyArray; /** * Creates a new ActionConfigs instance using the specified properties. * @function create * @memberof dataform.ActionConfigs * @static * @param {dataform.IActionConfigs=} [properties] Properties to set * @returns {dataform.ActionConfigs} ActionConfigs instance */ ActionConfigs.create = function create(properties) { return new ActionConfigs(properties); }; /** * Encodes the specified ActionConfigs message. Does not implicitly {@link dataform.ActionConfigs.verify|verify} messages. * @function encode * @memberof dataform.ActionConfigs * @static * @param {dataform.IActionConfigs} message ActionConfigs message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ ActionConfigs.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.actions != null && message.actions.length) for (let i = 0; i < message.actions.length; ++i) $root.dataform.ActionConfig.encode(message.actions[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** * Encodes the specified ActionConfigs message, length delimited. Does not implicitly {@link dataform.ActionConfigs.verify|verify} messages. * @function encodeDelimited * @memberof dataform.ActionConfigs * @static * @param {dataform.IActionConfigs} message ActionConfigs message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ ActionConfigs.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes an ActionConfigs message from the specified reader or buffer. * @function decode * @memberof dataform.ActionConfigs * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {dataform.ActionConfigs} ActionConfigs * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ ActionConfigs.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); let end = length === undefined ? reader.len : reader.pos + length, message = new $root.dataform.ActionConfigs(); while (reader.pos < end) { let tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (!(message.actions && message.actions.length)) message.actions = []; message.actions.push($root.dataform.ActionConfig.decode(reader, reader.uint32())); break; } default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes an ActionConfigs message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof dataform.ActionConfigs * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {dataform.ActionConfigs} ActionConfigs * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ ActionConfigs.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies an ActionConfigs message. * @function verify * @memberof dataform.ActionConfigs * @static * @param {Object.<string,*>} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ ActionConfigs.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.actions != null && message.hasOwnProperty("actions")) { if (!Array.isArray(message.actions)) return "actions: array expected"; for (let i = 0; i < message.actions.length; ++i) { let error = $root.dataform.ActionConfig.verify(message.actions[i]); if (error) return "actions." + error; } } return null; }; /** * Creates an ActionConfigs message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof dataform.ActionConfigs * @static * @param {Object.<string,*>} object Plain object * @returns {dataform.ActionConfigs} ActionConfigs */ ActionConfigs.fromObject = function fromObject(object) { if (object instanceof $root.dataform.ActionConfigs) return object; let message = new $root.dataform.ActionConfigs(); if (object.actions) { if (!Array.isArray(object.actions)) throw TypeError(".dataform.ActionConfigs.actions: array expected"); message.actions = []; for (let i = 0; i < object.actions.length; ++i) { if (typeof object.actions[i] !== "object") throw TypeError(".dataform.ActionConfigs.actions: object expected"); message.actions[i] = $root.dataform.ActionConfig.fromObject(object.actions[i]); } } return message; }; /** * Creates a plain object from an ActionConfigs message. Also converts values to other types if specified. * @function toObject * @memberof dataform.ActionConfigs * @static * @param {dataform.ActionConfigs} message ActionConfigs * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.<string,*>} Plain object */ ActionConfigs.toObject = function toObject(message, options) { if (!options) options = {}; let object = {}; if (options.arrays || options.defaults) object.actions = []; if (message.actions && message.actions.length) { object.actions = []; for (let j = 0; j < message.actions.length; ++j) object.actions[j] = $root.dataform.ActionConfig.toObject(message.actions[j], options); } return object; }; /** * Converts this ActionConfigs to JSON. * @function toJSON * @memberof dataform.ActionConfigs * @instance * @returns {Object.<string,*>} JSON object */ ActionConfigs.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf__namespace.util.toJSONOptions); }; /** * Gets the default type url for ActionConfigs * @function getTypeUrl * @memberof dataform.ActionConfigs * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ ActionConfigs.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } return typeUrlPrefix + "/dataform.ActionConfigs"; }; return ActionConfigs; })(); dataform.ActionConfig = (function() { /** * Properties of an ActionConfig. * @memberof dataform * @interface IActionConfig * @property {dataform.ActionConfig.ITableConfig|null} [table] ActionConfig table * @property {dataform.ActionConfig.IViewConfig|null} [view] ActionConfig view * @property {dataform.ActionConfig.IIncrementalTableConfig|null} [incrementalTable] ActionConfig incrementalTable * @property {dataform.ActionConfig.IAssertionConfig|null} [assertion] ActionConfig assertion * @property {dataform.ActionConfig.IOperationConfig|null} [operation] ActionConfig operation * @property {dataform.ActionConfig.IDeclarationConfig|null} [declaration] ActionConfig declaration * @property {dataform.ActionConfig.INotebookConfig|null} [notebook] ActionConfig notebook * @property {dataform.ActionConfig