From 8a8f58f400e6c9877ea489b36c4700f160937708 Mon Sep 17 00:00:00 2001 From: ci core model Date: Tue, 17 Feb 2026 15:20:24 +0000 Subject: [PATCH] Latest generation --- api.client.ts | 21 ++++- api.ts | 217 ++++++++++++++++++++++++++++++++++++++++++++++++++ package.json | 2 +- resource.ts | 81 +------------------ shared.ts | 80 +++++++++++++++++++ 5 files changed, 316 insertions(+), 85 deletions(-) diff --git a/api.client.ts b/api.client.ts index e95e69a..b1409ee 100644 --- a/api.client.ts +++ b/api.client.ts @@ -12,6 +12,8 @@ import type { CreateScopeResult } from "./api"; import type { CreateScopeRequest } from "./api"; import type { RegisterPackageResult } from "./api"; import type { RegisterPackageRequest } from "./api"; +import type { ListUserRPTsResponse } from "./api"; +import type { ListUserRPTsRequest } from "./api"; import type { ListUserUIPermissionsResult } from "./api"; import type { ListUserUIPermissionsRequest } from "./api"; import type { GetUIPermissionsResult } from "./api"; @@ -37,6 +39,10 @@ export interface IAPIServiceClient { * @generated from protobuf rpc: ListUserUIPermissions */ listUserUIPermissions(input: ListUserUIPermissionsRequest, options?: RpcOptions): UnaryCall; + /** + * @generated from protobuf rpc: ListUserRPTs + */ + listUserRPTs(input: ListUserRPTsRequest, options?: RpcOptions): UnaryCall; /** * @generated from protobuf rpc: RegisterPackage */ @@ -84,32 +90,39 @@ export class APIServiceClient implements IAPIServiceClient, ServiceInfo { const method = this.methods[2], opt = this._transport.mergeOptions(options); return stackIntercept("unary", this._transport, method, opt, input); } + /** + * @generated from protobuf rpc: ListUserRPTs + */ + listUserRPTs(input: ListUserRPTsRequest, options?: RpcOptions): UnaryCall { + const method = this.methods[3], opt = this._transport.mergeOptions(options); + return stackIntercept("unary", this._transport, method, opt, input); + } /** * @generated from protobuf rpc: RegisterPackage */ registerPackage(input: RegisterPackageRequest, options?: RpcOptions): UnaryCall { - const method = this.methods[3], opt = this._transport.mergeOptions(options); + const method = this.methods[4], opt = this._transport.mergeOptions(options); return stackIntercept("unary", this._transport, method, opt, input); } /** * @generated from protobuf rpc: CreateScope */ createScope(input: CreateScopeRequest, options?: RpcOptions): UnaryCall { - const method = this.methods[4], opt = this._transport.mergeOptions(options); + const method = this.methods[5], opt = this._transport.mergeOptions(options); return stackIntercept("unary", this._transport, method, opt, input); } /** * @generated from protobuf rpc: DeleteScope */ deleteScope(input: DeleteScopeRequest, options?: RpcOptions): UnaryCall { - const method = this.methods[5], opt = this._transport.mergeOptions(options); + const method = this.methods[6], opt = this._transport.mergeOptions(options); return stackIntercept("unary", this._transport, method, opt, input); } /** * @generated from protobuf rpc: CleanScope */ cleanScope(input: CleanScopeRequest, options?: RpcOptions): UnaryCall { - const method = this.methods[6], opt = this._transport.mergeOptions(options); + const method = this.methods[7], opt = this._transport.mergeOptions(options); return stackIntercept("unary", this._transport, method, opt, input); } } diff --git a/api.ts b/api.ts index 7a5db9b..3e4dbcd 100644 --- a/api.ts +++ b/api.ts @@ -11,6 +11,7 @@ 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 { Resource } from "./shared"; import { Scope } from "./shared"; import { Module } from "./module"; import { ModuleRegistration } from "./shared"; @@ -191,6 +192,49 @@ export interface CleanScopeRequest { */ export interface CleanScopeResult { } +/** + * @generated from protobuf message api.UserRPT + */ +export interface UserRPT { + /** + * @generated from protobuf field: string UserID = 1 + */ + UserID: string; + /** + * @generated from protobuf field: api.Resource Resource = 2 + */ + Resource?: Resource; + /** + * @generated from protobuf field: repeated string Scopes = 3 + */ + Scopes: string[]; +} +/** + * @generated from protobuf message api.ListUserRPTsRequest + */ +export interface ListUserRPTsRequest { + /** + * @generated from protobuf field: string UserID = 1 + */ + UserID: string; + /** + * @generated from protobuf field: api.ResourceType ResourceType = 2 + */ + ResourceType: ResourceType; // Will filter the user's permissions for resources of this type. + /** + * @generated from protobuf field: string ResourceID = 3 + */ + ResourceID: string; // Will filter the user's permissions for this resource id. +} +/** + * @generated from protobuf message api.ListUserRPTsResponse + */ +export interface ListUserRPTsResponse { + /** + * @generated from protobuf field: repeated api.UserRPT RPTs = 1 + */ + RPTs: UserRPT[]; +} // @generated message type with reflection information, may provide speed optimized methods class GetPermissionsRequest$Type extends MessageType { constructor() { @@ -930,6 +974,178 @@ class CleanScopeResult$Type extends MessageType { * @generated MessageType for protobuf message api.CleanScopeResult */ export const CleanScopeResult = new CleanScopeResult$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class UserRPT$Type extends MessageType { + constructor() { + super("api.UserRPT", [ + { no: 1, name: "UserID", kind: "scalar", localName: "UserID", jsonName: "UserID", T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: "Resource", kind: "message", localName: "Resource", jsonName: "Resource", T: () => Resource }, + { no: 3, name: "Scopes", kind: "scalar", localName: "Scopes", jsonName: "Scopes", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/ } + ]); + } + create(value?: PartialMessage): UserRPT { + const message = globalThis.Object.create((this.messagePrototype!)); + message.UserID = ""; + message.Scopes = []; + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: UserRPT): UserRPT { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string UserID */ 1: + message.UserID = reader.string(); + break; + case /* api.Resource Resource */ 2: + message.Resource = Resource.internalBinaryRead(reader, reader.uint32(), options, message.Resource); + break; + case /* repeated string Scopes */ 3: + message.Scopes.push(reader.string()); + 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: UserRPT, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string UserID = 1; */ + if (message.UserID !== "") + writer.tag(1, WireType.LengthDelimited).string(message.UserID); + /* api.Resource Resource = 2; */ + if (message.Resource) + Resource.internalBinaryWrite(message.Resource, writer.tag(2, WireType.LengthDelimited).fork(), options).join(); + /* repeated string Scopes = 3; */ + for (let i = 0; i < message.Scopes.length; i++) + writer.tag(3, WireType.LengthDelimited).string(message.Scopes[i]); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message api.UserRPT + */ +export const UserRPT = new UserRPT$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class ListUserRPTsRequest$Type extends MessageType { + constructor() { + super("api.ListUserRPTsRequest", [ + { no: 1, name: "UserID", kind: "scalar", localName: "UserID", jsonName: "UserID", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { minLen: "1" } } } }, + { no: 2, name: "ResourceType", kind: "enum", localName: "ResourceType", jsonName: "ResourceType", T: () => ["api.ResourceType", ResourceType] }, + { no: 3, name: "ResourceID", kind: "scalar", localName: "ResourceID", jsonName: "ResourceID", T: 9 /*ScalarType.STRING*/ } + ], { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema": { jsonSchema: { required: ["UserID"] } } }); + } + create(value?: PartialMessage): ListUserRPTsRequest { + const message = globalThis.Object.create((this.messagePrototype!)); + message.UserID = ""; + message.ResourceType = 0; + message.ResourceID = ""; + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ListUserRPTsRequest): ListUserRPTsRequest { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string UserID */ 1: + message.UserID = reader.string(); + break; + case /* api.ResourceType ResourceType */ 2: + message.ResourceType = reader.int32(); + break; + case /* string ResourceID */ 3: + message.ResourceID = reader.string(); + 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: ListUserRPTsRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string UserID = 1; */ + if (message.UserID !== "") + writer.tag(1, WireType.LengthDelimited).string(message.UserID); + /* api.ResourceType ResourceType = 2; */ + if (message.ResourceType !== 0) + writer.tag(2, WireType.Varint).int32(message.ResourceType); + /* string ResourceID = 3; */ + if (message.ResourceID !== "") + writer.tag(3, WireType.LengthDelimited).string(message.ResourceID); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message api.ListUserRPTsRequest + */ +export const ListUserRPTsRequest = new ListUserRPTsRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class ListUserRPTsResponse$Type extends MessageType { + constructor() { + super("api.ListUserRPTsResponse", [ + { no: 1, name: "RPTs", kind: "message", localName: "RPTs", jsonName: "RPTs", repeat: 2 /*RepeatType.UNPACKED*/, T: () => UserRPT } + ]); + } + create(value?: PartialMessage): ListUserRPTsResponse { + const message = globalThis.Object.create((this.messagePrototype!)); + message.RPTs = []; + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ListUserRPTsResponse): ListUserRPTsResponse { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* repeated api.UserRPT RPTs */ 1: + message.RPTs.push(UserRPT.internalBinaryRead(reader, reader.uint32(), 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; + } + internalBinaryWrite(message: ListUserRPTsResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* repeated api.UserRPT RPTs = 1; */ + for (let i = 0; i < message.RPTs.length; i++) + UserRPT.internalBinaryWrite(message.RPTs[i], writer.tag(1, WireType.LengthDelimited).fork(), options).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message api.ListUserRPTsResponse + */ +export const ListUserRPTsResponse = new ListUserRPTsResponse$Type(); /** * @generated ServiceType for protobuf service api.APIService */ @@ -937,6 +1153,7 @@ export const APIService = new ServiceType("api.APIService", [ { name: "GetPermissions", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["APIs"], description: "Returns the available permissions" }, "api.rscType": "Platform", "api.roles": "Platform.Permission", "google.api.method_visibility": { restriction: "INTERNAL" } }, I: GetPermissionsRequest, O: GetPermissionsResult }, { name: "GetUIPermissions", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["APIs"], description: "Returns the available UI permissions" }, "api.rscType": "Platform", "api.roles": "Platform.Permission", "google.api.method_visibility": { restriction: "INTERNAL" } }, I: GetUIPermissionsRequest, O: GetUIPermissionsResult }, { name: "ListUserUIPermissions", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["Permissions"], description: "List the user's active UI permissions" }, "api.rscType": "Platform", "api.roles": "", "google.api.method_visibility": { restriction: "SDK" } }, I: ListUserUIPermissionsRequest, O: ListUserUIPermissionsResult }, + { name: "ListUserRPTs", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["Permissions"], description: "List the user's stored RPTs" }, "api.rscType": "Platform", "api.roles": "Platform.Permission", "google.api.method_visibility": { restriction: "INTERNAL" } }, I: ListUserRPTsRequest, O: ListUserRPTsResponse }, { name: "RegisterPackage", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["APIs"], description: "Register a package with its set of Clients and their APIs" }, "api.rscType": "Platform", "api.roles": "Platform.PackageInit", "google.api.method_visibility": { restriction: "INTERNAL" } }, I: RegisterPackageRequest, O: RegisterPackageResult }, { name: "CreateScope", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["APIs"], description: "Create a new scope. This API is used by the platform to create scopes for specific resources (e.g. projects). Static scopes are created by the platform through the RegisterModule API and are based on a static list." }, "api.rscType": "Platform", "api.roles": "Platform.Scope", "google.api.method_visibility": { restriction: "INTERNAL" } }, I: CreateScopeRequest, O: CreateScopeResult }, { name: "DeleteScope", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["APIs"], description: "Delete a scope" }, "api.rscType": "Platform", "api.roles": "Platform.Scope", "google.api.method_visibility": { restriction: "INTERNAL" } }, I: DeleteScopeRequest, O: DeleteScopeResult }, diff --git a/package.json b/package.json index fc0e6e8..304085d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@reflex-platform/npm-core-sdk", - "version": "1.13.0-SNAPSHOT-260217104007", + "version": "1.13.0-SNAPSHOT-260217151939", "description": "npm libs from core model proto files", "homepage": "", "main": "index.ts", diff --git a/resource.ts b/resource.ts index e77dd16..f4b1e5e 100644 --- a/resource.ts +++ b/resource.ts @@ -12,23 +12,7 @@ import type { PartialMessage } from "@protobuf-ts/runtime"; import { reflectionMergePartial } from "@protobuf-ts/runtime"; import { MessageType } from "@protobuf-ts/runtime"; import { ResourceType } from "./shared"; -/** - * @generated from protobuf message api.Resource - */ -export interface Resource { - /** - * @generated from protobuf field: string ID = 1 - */ - ID: string; - /** - * @generated from protobuf field: api.ResourceType Type = 2 - */ - Type: ResourceType; - /** - * @generated from protobuf field: string ParentID = 3 - */ - ParentID: string; -} +import { Resource } from "./shared"; /** * @generated from protobuf message api.CreateResourceRequest */ @@ -102,69 +86,6 @@ export interface CleanResourceRequest { export interface CleanResourceResult { } // @generated message type with reflection information, may provide speed optimized methods -class Resource$Type extends MessageType { - constructor() { - super("api.Resource", [ - { no: 1, name: "ID", kind: "scalar", localName: "ID", jsonName: "ID", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { minLen: "1" } } } }, - { no: 2, name: "Type", kind: "enum", localName: "Type", jsonName: "Type", T: () => ["api.ResourceType", ResourceType], options: { "validate.rules": { enum: { definedOnly: true } } } }, - { no: 3, name: "ParentID", kind: "scalar", localName: "ParentID", jsonName: "ParentID", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { minLen: "1" } } } } - ], { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema": { jsonSchema: { required: ["ID", "Type", "ParentId"] } } }); - } - create(value?: PartialMessage): Resource { - const message = globalThis.Object.create((this.messagePrototype!)); - message.ID = ""; - message.Type = 0; - message.ParentID = ""; - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Resource): Resource { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* string ID */ 1: - message.ID = reader.string(); - break; - case /* api.ResourceType Type */ 2: - message.Type = reader.int32(); - break; - case /* string ParentID */ 3: - message.ParentID = reader.string(); - 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: Resource, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* string ID = 1; */ - if (message.ID !== "") - writer.tag(1, WireType.LengthDelimited).string(message.ID); - /* api.ResourceType Type = 2; */ - if (message.Type !== 0) - writer.tag(2, WireType.Varint).int32(message.Type); - /* string ParentID = 3; */ - if (message.ParentID !== "") - writer.tag(3, WireType.LengthDelimited).string(message.ParentID); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message api.Resource - */ -export const Resource = new Resource$Type(); -// @generated message type with reflection information, may provide speed optimized methods class CreateResourceRequest$Type extends MessageType { constructor() { super("api.CreateResourceRequest", [ diff --git a/shared.ts b/shared.ts index 2bfd1bc..bdb54d0 100644 --- a/shared.ts +++ b/shared.ts @@ -1821,6 +1821,23 @@ export interface UserUIPermissions { */ Scopes: Scope[]; } +/** + * @generated from protobuf message api.Resource + */ +export interface Resource { + /** + * @generated from protobuf field: string ID = 1 + */ + ID: string; + /** + * @generated from protobuf field: api.ResourceType Type = 2 + */ + Type: ResourceType; + /** + * @generated from protobuf field: string ParentID = 3 + */ + ParentID: string; +} /** * @generated from protobuf message api.ElementByMatchQuery */ @@ -7765,6 +7782,69 @@ class UserUIPermissions$Type extends MessageType { */ export const UserUIPermissions = new UserUIPermissions$Type(); // @generated message type with reflection information, may provide speed optimized methods +class Resource$Type extends MessageType { + constructor() { + super("api.Resource", [ + { no: 1, name: "ID", kind: "scalar", localName: "ID", jsonName: "ID", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { minLen: "1" } } } }, + { no: 2, name: "Type", kind: "enum", localName: "Type", jsonName: "Type", T: () => ["api.ResourceType", ResourceType], options: { "validate.rules": { enum: { definedOnly: true } } } }, + { no: 3, name: "ParentID", kind: "scalar", localName: "ParentID", jsonName: "ParentID", T: 9 /*ScalarType.STRING*/ } + ], { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema": { jsonSchema: { required: ["ID", "Type"] } } }); + } + create(value?: PartialMessage): Resource { + const message = globalThis.Object.create((this.messagePrototype!)); + message.ID = ""; + message.Type = 0; + message.ParentID = ""; + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Resource): Resource { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string ID */ 1: + message.ID = reader.string(); + break; + case /* api.ResourceType Type */ 2: + message.Type = reader.int32(); + break; + case /* string ParentID */ 3: + message.ParentID = reader.string(); + 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: Resource, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string ID = 1; */ + if (message.ID !== "") + writer.tag(1, WireType.LengthDelimited).string(message.ID); + /* api.ResourceType Type = 2; */ + if (message.Type !== 0) + writer.tag(2, WireType.Varint).int32(message.Type); + /* string ParentID = 3; */ + if (message.ParentID !== "") + writer.tag(3, WireType.LengthDelimited).string(message.ParentID); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message api.Resource + */ +export const Resource = new Resource$Type(); +// @generated message type with reflection information, may provide speed optimized methods class ElementByMatchQuery$Type extends MessageType { constructor() { super("api.ElementByMatchQuery", [