diff --git a/package.json b/package.json index d1a4afa..fc21c7a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@reflex-platform/npm-viz-sdk", - "version": "1.15.0-SNAPSHOT-260630073007", + "version": "1.15.0-SNAPSHOT-260715140413", "description": "npm libs from visibility model proto files", "homepage": "", "main": "index.ts", diff --git a/viz-view.client.ts b/viz-view.client.ts index 9348fbe..672979b 100644 --- a/viz-view.client.ts +++ b/viz-view.client.ts @@ -5,7 +5,7 @@ import type { RpcTransport } from "@protobuf-ts/runtime-rpc"; import type { ServiceInfo } from "@protobuf-ts/runtime-rpc"; import { ViewService } from "./viz-view"; import type { CrossExtractRequest } from "./viz-view"; -import type { ExtractResult } from "./viz-view"; +import type { ExtractResultBasic } from "./viz-view"; import type { ExtractRequest } from "./viz-view"; import type { SetOwnerViewResult } from "./viz-view"; import type { SetOwnerViewRequest } from "./viz-view"; @@ -59,11 +59,11 @@ export interface IViewServiceClient { /** * @generated from protobuf rpc: Extract */ - extract(input: ExtractRequest, options?: RpcOptions): UnaryCall; + extract(input: ExtractRequest, options?: RpcOptions): UnaryCall; /** * @generated from protobuf rpc: CrossExtract */ - crossExtract(input: CrossExtractRequest, options?: RpcOptions): UnaryCall; + crossExtract(input: CrossExtractRequest, options?: RpcOptions): UnaryCall; } /** * @generated from protobuf service vizapi.ViewService @@ -126,15 +126,15 @@ export class ViewServiceClient implements IViewServiceClient, ServiceInfo { /** * @generated from protobuf rpc: Extract */ - extract(input: ExtractRequest, options?: RpcOptions): UnaryCall { + extract(input: ExtractRequest, options?: RpcOptions): UnaryCall { const method = this.methods[7], opt = this._transport.mergeOptions(options); - return stackIntercept("unary", this._transport, method, opt, input); + return stackIntercept("unary", this._transport, method, opt, input); } /** * @generated from protobuf rpc: CrossExtract */ - crossExtract(input: CrossExtractRequest, options?: RpcOptions): UnaryCall { + crossExtract(input: CrossExtractRequest, options?: RpcOptions): UnaryCall { const method = this.methods[8], opt = this._transport.mergeOptions(options); - return stackIntercept("unary", this._transport, method, opt, input); + return stackIntercept("unary", this._transport, method, opt, input); } } diff --git a/viz-view.ts b/viz-view.ts index 5021faa..227a488 100644 --- a/viz-view.ts +++ b/viz-view.ts @@ -11,6 +11,8 @@ import { UnknownFieldHandler } from "@protobuf-ts/runtime"; import type { PartialMessage } from "@protobuf-ts/runtime"; import { reflectionMergePartial } from "@protobuf-ts/runtime"; import { MessageType } from "@protobuf-ts/runtime"; +import { ExtractColumnFormat } from "./core/shared"; +import { TranslationMap } from "./core/shared"; import { BlockFilter } from "./core/shared"; import { RequestProjectHeader } from "./core/shared"; /** @@ -321,55 +323,6 @@ export interface DeleteViewsForProjectRequest { */ export interface DeleteViewsForProjectResult { } -/** - * @generated from protobuf message vizapi.TranslationMap - */ -export interface TranslationMap { - /** - * @generated from protobuf field: map data = 1 - */ - data: { - [key: string]: string; - }; -} -/** - * @generated from protobuf message vizapi.ExtractColumnFormat - */ -export interface ExtractColumnFormat { - /** - * @generated from protobuf field: vizapi.ExtractColumnFormat.type Type = 1 - */ - Type: ExtractColumnFormat_type; - /** - * @generated from protobuf field: string Format = 2 - */ - Format: string; - /** - * @generated from protobuf field: vizapi.DisplayDate DisplayDate = 3 - */ - DisplayDate: DisplayDate; -} -/** - * @generated from protobuf enum vizapi.ExtractColumnFormat.type - */ -export enum ExtractColumnFormat_type { - /** - * @generated from protobuf enum value: UNKNOWN = 0; - */ - UNKNOWN = 0, - /** - * @generated from protobuf enum value: DATE = 1; - */ - DATE = 1, - /** - * @generated from protobuf enum value: SUFFIX = 2; - */ - SUFFIX = 2, - /** - * @generated from protobuf enum value: NUMBER = 3; - */ - NUMBER = 3 -} /** * @generated from protobuf message vizapi.ExtractRequest */ @@ -399,13 +352,13 @@ export interface ExtractRequest { */ DecimalSeparator: string; /** - * @generated from protobuf field: map ColumnTranslationMaps = 8 + * @generated from protobuf field: map ColumnTranslationMaps = 8 */ ColumnTranslationMaps: { [key: string]: TranslationMap; }; /** - * @generated from protobuf field: map ColumnFormats = 9 + * @generated from protobuf field: map ColumnFormats = 9 */ ColumnFormats: { [key: number]: ExtractColumnFormat; @@ -452,13 +405,13 @@ export interface CrossExtractRequest { */ DecimalSeparator: string; /** - * @generated from protobuf field: map ColumnTranslationMaps = 5 + * @generated from protobuf field: map ColumnTranslationMaps = 5 */ ColumnTranslationMaps: { [key: string]: TranslationMap; }; /** - * @generated from protobuf field: map ColumnFormats = 6 + * @generated from protobuf field: map ColumnFormats = 6 */ ColumnFormats: { [key: number]: ExtractColumnFormat; @@ -489,9 +442,9 @@ export interface CrossExtractRequest { SearchTagUsers: string[]; } /** - * @generated from protobuf message vizapi.ExtractResult + * @generated from protobuf message vizapi.ExtractResultBasic */ -export interface ExtractResult { +export interface ExtractResultBasic { /** * @generated from protobuf field: string WorkflowID = 1 */ @@ -1418,132 +1371,6 @@ class DeleteViewsForProjectResult$Type extends MessageType { - constructor() { - super("vizapi.TranslationMap", [ - { no: 1, name: "data", kind: "map", K: 9 /*ScalarType.STRING*/, V: { kind: "scalar", T: 9 /*ScalarType.STRING*/ } } - ]); - } - create(value?: PartialMessage): TranslationMap { - const message = globalThis.Object.create((this.messagePrototype!)); - message.data = {}; - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: TranslationMap): TranslationMap { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* map data */ 1: - this.binaryReadMap1(message.data, reader, options); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - private binaryReadMap1(map: TranslationMap["data"], reader: IBinaryReader, options: BinaryReadOptions): void { - let len = reader.uint32(), end = reader.pos + len, key: keyof TranslationMap["data"] | undefined, val: TranslationMap["data"][any] | undefined; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case 1: - key = reader.string(); - break; - case 2: - val = reader.string(); - break; - default: throw new globalThis.Error("unknown map entry field for vizapi.TranslationMap.data"); - } - } - map[key ?? ""] = val ?? ""; - } - internalBinaryWrite(message: TranslationMap, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* map data = 1; */ - for (let k of globalThis.Object.keys(message.data)) - writer.tag(1, WireType.LengthDelimited).fork().tag(1, WireType.LengthDelimited).string(k).tag(2, WireType.LengthDelimited).string(message.data[k]).join(); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message vizapi.TranslationMap - */ -export const TranslationMap = new TranslationMap$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class ExtractColumnFormat$Type extends MessageType { - constructor() { - super("vizapi.ExtractColumnFormat", [ - { no: 1, name: "Type", kind: "enum", localName: "Type", jsonName: "Type", T: () => ["vizapi.ExtractColumnFormat.type", ExtractColumnFormat_type] }, - { no: 2, name: "Format", kind: "scalar", localName: "Format", jsonName: "Format", T: 9 /*ScalarType.STRING*/ }, - { no: 3, name: "DisplayDate", kind: "enum", localName: "DisplayDate", jsonName: "DisplayDate", T: () => ["vizapi.DisplayDate", DisplayDate] } - ]); - } - create(value?: PartialMessage): ExtractColumnFormat { - const message = globalThis.Object.create((this.messagePrototype!)); - message.Type = 0; - message.Format = ""; - message.DisplayDate = 0; - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ExtractColumnFormat): ExtractColumnFormat { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* vizapi.ExtractColumnFormat.type Type */ 1: - message.Type = reader.int32(); - break; - case /* string Format */ 2: - message.Format = reader.string(); - break; - case /* vizapi.DisplayDate DisplayDate */ 3: - message.DisplayDate = reader.int32(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: ExtractColumnFormat, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* vizapi.ExtractColumnFormat.type Type = 1; */ - if (message.Type !== 0) - writer.tag(1, WireType.Varint).int32(message.Type); - /* string Format = 2; */ - if (message.Format !== "") - writer.tag(2, WireType.LengthDelimited).string(message.Format); - /* vizapi.DisplayDate DisplayDate = 3; */ - if (message.DisplayDate !== 0) - writer.tag(3, WireType.Varint).int32(message.DisplayDate); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message vizapi.ExtractColumnFormat - */ -export const ExtractColumnFormat = new ExtractColumnFormat$Type(); -// @generated message type with reflection information, may provide speed optimized methods class ExtractRequest$Type extends MessageType { constructor() { super("vizapi.ExtractRequest", [ @@ -1596,10 +1423,10 @@ class ExtractRequest$Type extends MessageType { case /* string DecimalSeparator */ 5: message.DecimalSeparator = reader.string(); break; - case /* map ColumnTranslationMaps */ 8: + case /* map ColumnTranslationMaps */ 8: this.binaryReadMap8(message.ColumnTranslationMaps, reader, options); break; - case /* map ColumnFormats */ 9: + case /* map ColumnFormats */ 9: this.binaryReadMap9(message.ColumnFormats, reader, options); break; case /* string TargetTimeZone */ 10: @@ -1673,14 +1500,14 @@ class ExtractRequest$Type extends MessageType { /* string DecimalSeparator = 5; */ if (message.DecimalSeparator !== "") writer.tag(5, WireType.LengthDelimited).string(message.DecimalSeparator); - /* map ColumnTranslationMaps = 8; */ + /* map ColumnTranslationMaps = 8; */ for (let k of globalThis.Object.keys(message.ColumnTranslationMaps)) { writer.tag(8, WireType.LengthDelimited).fork().tag(1, WireType.LengthDelimited).string(k); writer.tag(2, WireType.LengthDelimited).fork(); TranslationMap.internalBinaryWrite(message.ColumnTranslationMaps[k], writer, options); writer.join().join(); } - /* map ColumnFormats = 9; */ + /* map ColumnFormats = 9; */ for (let k of globalThis.Object.keys(message.ColumnFormats)) { writer.tag(9, WireType.LengthDelimited).fork().tag(1, WireType.Varint).int32(parseInt(k)); writer.tag(2, WireType.LengthDelimited).fork(); @@ -1762,10 +1589,10 @@ class CrossExtractRequest$Type extends MessageType { case /* string DecimalSeparator */ 4: message.DecimalSeparator = reader.string(); break; - case /* map ColumnTranslationMaps */ 5: + case /* map ColumnTranslationMaps */ 5: this.binaryReadMap5(message.ColumnTranslationMaps, reader, options); break; - case /* map ColumnFormats */ 6: + case /* map ColumnFormats */ 6: this.binaryReadMap6(message.ColumnFormats, reader, options); break; case /* string TargetTimeZone */ 7: @@ -1842,14 +1669,14 @@ class CrossExtractRequest$Type extends MessageType { /* string DecimalSeparator = 4; */ if (message.DecimalSeparator !== "") writer.tag(4, WireType.LengthDelimited).string(message.DecimalSeparator); - /* map ColumnTranslationMaps = 5; */ + /* map ColumnTranslationMaps = 5; */ for (let k of globalThis.Object.keys(message.ColumnTranslationMaps)) { writer.tag(5, WireType.LengthDelimited).fork().tag(1, WireType.LengthDelimited).string(k); writer.tag(2, WireType.LengthDelimited).fork(); TranslationMap.internalBinaryWrite(message.ColumnTranslationMaps[k], writer, options); writer.join().join(); } - /* map ColumnFormats = 6; */ + /* map ColumnFormats = 6; */ for (let k of globalThis.Object.keys(message.ColumnFormats)) { writer.tag(6, WireType.LengthDelimited).fork().tag(1, WireType.Varint).int32(parseInt(k)); writer.tag(2, WireType.LengthDelimited).fork(); @@ -1885,22 +1712,22 @@ class CrossExtractRequest$Type extends MessageType { */ export const CrossExtractRequest = new CrossExtractRequest$Type(); // @generated message type with reflection information, may provide speed optimized methods -class ExtractResult$Type extends MessageType { +class ExtractResultBasic$Type extends MessageType { constructor() { - super("vizapi.ExtractResult", [ + super("vizapi.ExtractResultBasic", [ { no: 1, name: "WorkflowID", kind: "scalar", localName: "WorkflowID", jsonName: "WorkflowID", T: 9 /*ScalarType.STRING*/ }, { no: 2, name: "RunID", kind: "scalar", localName: "RunID", jsonName: "RunID", T: 9 /*ScalarType.STRING*/ } ]); } - create(value?: PartialMessage): ExtractResult { + create(value?: PartialMessage): ExtractResultBasic { const message = globalThis.Object.create((this.messagePrototype!)); message.WorkflowID = ""; message.RunID = ""; if (value !== undefined) - reflectionMergePartial(this, message, value); + reflectionMergePartial(this, message, value); return message; } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ExtractResult): ExtractResult { + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ExtractResultBasic): ExtractResultBasic { let message = target ?? this.create(), end = reader.pos + length; while (reader.pos < end) { let [fieldNo, wireType] = reader.tag(); @@ -1922,7 +1749,7 @@ class ExtractResult$Type extends MessageType { } return message; } - internalBinaryWrite(message: ExtractResult, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + internalBinaryWrite(message: ExtractResultBasic, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { /* string WorkflowID = 1; */ if (message.WorkflowID !== "") writer.tag(1, WireType.LengthDelimited).string(message.WorkflowID); @@ -1936,9 +1763,9 @@ class ExtractResult$Type extends MessageType { } } /** - * @generated MessageType for protobuf message vizapi.ExtractResult + * @generated MessageType for protobuf message vizapi.ExtractResultBasic */ -export const ExtractResult = new ExtractResult$Type(); +export const ExtractResultBasic = new ExtractResultBasic$Type(); // @generated message type with reflection information, may provide speed optimized methods class SetOwnerViewRequest$Type extends MessageType { constructor() { @@ -2059,6 +1886,6 @@ export const ViewService = new ServiceType("vizapi.ViewService", [ { name: "List", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["View"], summary: "List views", description: "List all Views present under the same Project and with the same Screen ID" }, "api.rscType": "Project", "api.roles": "Platform.Project-Views", "google.api.method_visibility": { restriction: "PUBLIC" } }, I: ListViewRequest, O: ListViewResult }, { name: "DeleteViewsForProject", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["View"], summary: "Delete all views for a project" }, "api.rscType": "Platform", "api.roles": "Platform.Project-Views", "google.api.method_visibility": { restriction: "PUBLIC" } }, I: DeleteViewsForProjectRequest, O: DeleteViewsForProjectResult }, { name: "SetOwner", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["View"], summary: "Set the owner of a view", description: "Set the owner of a View with its ID and the user ID of the new owner" }, "api.rscType": "Project", "api.roles": "", "google.api.method_visibility": { restriction: "PUBLIC" } }, I: SetOwnerViewRequest, O: SetOwnerViewResult }, - { name: "Extract", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["View"], summary: "Extract view", description: "Start view extraction in csv format" }, "api.rscType": "Project", "api.roles": "", "google.api.method_visibility": { restriction: "PUBLIC" } }, I: ExtractRequest, O: ExtractResult }, - { name: "CrossExtract", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["View"], summary: "Cross Extract view", description: "Start view extraction in csv format" }, "api.rscType": "Platform", "api.roles": "", "google.api.method_visibility": { restriction: "PUBLIC" } }, I: CrossExtractRequest, O: ExtractResult } + { name: "Extract", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["View"], summary: "Extract view", description: "Start view extraction in csv format" }, "api.rscType": "Project", "api.roles": "", "google.api.method_visibility": { restriction: "PUBLIC" } }, I: ExtractRequest, O: ExtractResultBasic }, + { name: "CrossExtract", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["View"], summary: "Cross Extract view", description: "Start view extraction in csv format" }, "api.rscType": "Platform", "api.roles": "", "google.api.method_visibility": { restriction: "PUBLIC" } }, I: CrossExtractRequest, O: ExtractResultBasic } ], { "api.k8sService": "views-server" });