From 4d23a075857f45be3f98817b2ac0ce0497addbf6 Mon Sep 17 00:00:00 2001 From: ci core model Date: Wed, 19 Aug 2026 07:34:59 +0000 Subject: [PATCH] Latest generation --- package.json | 2 +- restrictions.client.ts | 13 +++ restrictions.ts | 224 ++++++++++++++++++++++++++++++++++++++++- 3 files changed, 234 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index b86e1ca..4d7b5cb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@reflex-platform/npm-core-sdk", - "version": "1.15.0-SNAPSHOT-260818140611", + "version": "1.15.0-SNAPSHOT-260819073423", "description": "npm libs from core model proto files", "homepage": "", "main": "index.ts", diff --git a/restrictions.client.ts b/restrictions.client.ts index 3c6b44b..004f57e 100644 --- a/restrictions.client.ts +++ b/restrictions.client.ts @@ -4,6 +4,8 @@ import type { RpcTransport } from "@protobuf-ts/runtime-rpc"; import type { ServiceInfo } from "@protobuf-ts/runtime-rpc"; import { RestrictionService } from "./restrictions"; +import type { ComputeForValidationResponse } from "./restrictions"; +import type { ComputeForValidationRequest } from "./restrictions"; import type { ComputeRuleResponse } from "./restrictions"; import type { ComputeRuleRequest } from "./restrictions"; import type { GetRuleJSONTreeResponse } from "./restrictions"; @@ -83,6 +85,10 @@ export interface IRestrictionServiceClient { * @generated from protobuf rpc: Compute */ compute(input: ComputeRuleRequest, options?: RpcOptions): UnaryCall; + /** + * @generated from protobuf rpc: ComputeForValidation + */ + computeForValidation(input: ComputeForValidationRequest, options?: RpcOptions): UnaryCall; } /** * @generated from protobuf service api.RestrictionService @@ -177,4 +183,11 @@ export class RestrictionServiceClient implements IRestrictionServiceClient, Serv const method = this.methods[11], opt = this._transport.mergeOptions(options); return stackIntercept("unary", this._transport, method, opt, input); } + /** + * @generated from protobuf rpc: ComputeForValidation + */ + computeForValidation(input: ComputeForValidationRequest, options?: RpcOptions): UnaryCall { + const method = this.methods[12], opt = this._transport.mergeOptions(options); + return stackIntercept("unary", this._transport, method, opt, input); + } } diff --git a/restrictions.ts b/restrictions.ts index c5255a3..89e9745 100644 --- a/restrictions.ts +++ b/restrictions.ts @@ -162,6 +162,27 @@ export interface RestrictionRule { */ Attributes: string[]; // Optional contextual key:value pairs provided by the rule's consumer to scope evaluation. Usually empty. "ActorID:\" may be provided to compute the rule against a specific actor's data access context. } +/** + * @generated from protobuf message api.ValidationComputeResult + */ +export interface ValidationComputeResult { + /** + * @generated from protobuf field: string FieldName = 1 + */ + FieldName: string; + /** + * Name of the field being validated. + * + * @generated from protobuf field: string Regex = 2 + */ + Regex: string; + /** + * Regular expression the field must match. + * + * @generated from protobuf field: repeated string Values = 3 + */ + Values: string[]; // List of values the field can take. +} // ========== REQUESTS & RESPONSE MESSAGES ========== /** @@ -460,6 +481,30 @@ export interface ComputeRuleResponse { */ Results: RestrictionComputeResult[]; } +/** + * ComputeForValidation + * + * @generated from protobuf message api.ComputeForValidationRequest + */ +export interface ComputeForValidationRequest { + /** + * @generated from protobuf field: api.RequestProjectHeader Header = 1 + */ + Header?: RequestProjectHeader; + /** + * @generated from protobuf field: api.EntityType Entity = 2 + */ + Entity: EntityType; +} +/** + * @generated from protobuf message api.ComputeForValidationResponse + */ +export interface ComputeForValidationResponse { + /** + * @generated from protobuf field: repeated api.ValidationComputeResult Results = 1 + */ + Results: ValidationComputeResult[]; +} /** * @generated from protobuf message api.ValidateRestrictionRuleRequest */ @@ -528,11 +573,17 @@ export enum RuleComputeFormat { /** * OpenSearch query expression. * - * jq filter expression. - * * @generated from protobuf enum value: RULE_COMPUTE_FORMAT_JQ = 3; */ - RULE_COMPUTE_FORMAT_JQ = 3 + RULE_COMPUTE_FORMAT_JQ = 3, + /** + * jq filter expression. + * + * Regular expression. + * + * @generated from protobuf enum value: RULE_COMPUTE_FORMAT_REGEX = 4; + */ + RULE_COMPUTE_FORMAT_REGEX = 4 } // @generated message type with reflection information, may provide speed optimized methods class Restriction$Type extends MessageType { @@ -859,6 +910,69 @@ class RestrictionRule$Type extends MessageType { */ export const RestrictionRule = new RestrictionRule$Type(); // @generated message type with reflection information, may provide speed optimized methods +class ValidationComputeResult$Type extends MessageType { + constructor() { + super("api.ValidationComputeResult", [ + { no: 1, name: "FieldName", kind: "scalar", localName: "FieldName", jsonName: "FieldName", T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: "Regex", kind: "scalar", localName: "Regex", jsonName: "Regex", T: 9 /*ScalarType.STRING*/ }, + { no: 3, name: "Values", kind: "scalar", localName: "Values", jsonName: "Values", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/ } + ]); + } + create(value?: PartialMessage): ValidationComputeResult { + const message = globalThis.Object.create((this.messagePrototype!)); + message.FieldName = ""; + message.Regex = ""; + message.Values = []; + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ValidationComputeResult): ValidationComputeResult { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string FieldName */ 1: + message.FieldName = reader.string(); + break; + case /* string Regex */ 2: + message.Regex = reader.string(); + break; + case /* repeated string Values */ 3: + message.Values.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: ValidationComputeResult, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string FieldName = 1; */ + if (message.FieldName !== "") + writer.tag(1, WireType.LengthDelimited).string(message.FieldName); + /* string Regex = 2; */ + if (message.Regex !== "") + writer.tag(2, WireType.LengthDelimited).string(message.Regex); + /* repeated string Values = 3; */ + for (let i = 0; i < message.Values.length; i++) + writer.tag(3, WireType.LengthDelimited).string(message.Values[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.ValidationComputeResult + */ +export const ValidationComputeResult = new ValidationComputeResult$Type(); +// @generated message type with reflection information, may provide speed optimized methods class CreateRestrictionRequest$Type extends MessageType { constructor() { super("api.CreateRestrictionRequest", [ @@ -2035,6 +2149,107 @@ class ComputeRuleResponse$Type extends MessageType { */ export const ComputeRuleResponse = new ComputeRuleResponse$Type(); // @generated message type with reflection information, may provide speed optimized methods +class ComputeForValidationRequest$Type extends MessageType { + constructor() { + super("api.ComputeForValidationRequest", [ + { no: 1, name: "Header", kind: "message", localName: "Header", jsonName: "Header", T: () => RequestProjectHeader, options: { "n1validate.rules": { message: { required: true } } } }, + { no: 2, name: "Entity", kind: "enum", localName: "Entity", jsonName: "Entity", T: () => ["api.EntityType", EntityType], options: { "n1validate.rules": { enum: { definedOnly: true } } } } + ], { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema": { jsonSchema: { required: ["Header", "Entity"] } } }); + } + create(value?: PartialMessage): ComputeForValidationRequest { + const message = globalThis.Object.create((this.messagePrototype!)); + message.Entity = 0; + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ComputeForValidationRequest): ComputeForValidationRequest { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* api.RequestProjectHeader Header */ 1: + message.Header = RequestProjectHeader.internalBinaryRead(reader, reader.uint32(), options, message.Header); + break; + case /* api.EntityType Entity */ 2: + message.Entity = 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: ComputeForValidationRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* api.RequestProjectHeader Header = 1; */ + if (message.Header) + RequestProjectHeader.internalBinaryWrite(message.Header, writer.tag(1, WireType.LengthDelimited).fork(), options).join(); + /* api.EntityType Entity = 2; */ + if (message.Entity !== 0) + writer.tag(2, WireType.Varint).int32(message.Entity); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message api.ComputeForValidationRequest + */ +export const ComputeForValidationRequest = new ComputeForValidationRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class ComputeForValidationResponse$Type extends MessageType { + constructor() { + super("api.ComputeForValidationResponse", [ + { no: 1, name: "Results", kind: "message", localName: "Results", jsonName: "Results", repeat: 2 /*RepeatType.UNPACKED*/, T: () => ValidationComputeResult } + ]); + } + create(value?: PartialMessage): ComputeForValidationResponse { + const message = globalThis.Object.create((this.messagePrototype!)); + message.Results = []; + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ComputeForValidationResponse): ComputeForValidationResponse { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* repeated api.ValidationComputeResult Results */ 1: + message.Results.push(ValidationComputeResult.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: ComputeForValidationResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* repeated api.ValidationComputeResult Results = 1; */ + for (let i = 0; i < message.Results.length; i++) + ValidationComputeResult.internalBinaryWrite(message.Results[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.ComputeForValidationResponse + */ +export const ComputeForValidationResponse = new ComputeForValidationResponse$Type(); +// @generated message type with reflection information, may provide speed optimized methods class ValidateRestrictionRuleRequest$Type extends MessageType { constructor() { super("api.ValidateRestrictionRuleRequest", [ @@ -2140,5 +2355,6 @@ export const RestrictionService = new ServiceType("api.RestrictionService", [ { name: "GetRulesJSONTree", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["Restriction"], description: "Get the JSON tree of restriction rules when compiled" }, "google.api.method_visibility": { restriction: "SDK" }, "api.rscType": "Project", "api.roles": "" }, I: GetRulesJSONTreeRequest, O: GetRulesJSONTreeResponse }, { name: "ValidateRule", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["Restriction"], description: "Validate a restriction rule, will return a 400 error if the rule is not a valid restriction rule" }, "google.api.method_visibility": { restriction: "SDK" }, "api.rscType": "Project", "api.roles": "" }, I: ValidateRestrictionRuleRequest, O: ValidateRestrictionRuleResponse }, { name: "GetRuleJSONTree", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["Restriction"], description: "Get the JSON tree of a restriction rule when compiled" }, "google.api.method_visibility": { restriction: "SDK" }, "api.rscType": "Project", "api.roles": "" }, I: GetRuleJSONTreeRequest, O: GetRuleJSONTreeResponse }, - { name: "Compute", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["Restriction"], description: "Compute all the restrictions for a user on a given entity in a project" }, "google.api.method_visibility": { restriction: "INTERNAL" }, "api.rscType": "Project", "api.roles": "Platform.Project-Rule" }, I: ComputeRuleRequest, O: ComputeRuleResponse } + { name: "Compute", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["Restriction"], description: "Compute all the restrictions for a user on a given entity in a project" }, "google.api.method_visibility": { restriction: "INTERNAL" }, "api.rscType": "Project", "api.roles": "Platform.Project-Rule" }, I: ComputeRuleRequest, O: ComputeRuleResponse }, + { name: "ComputeForValidation", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["Restriction"], description: "Return all the REGEX validation for all fields for a given entity in a project the user has to respect" }, "google.api.method_visibility": { restriction: "INTERNAL" }, "api.rscType": "Project", "api.roles": "Platform.Project-Rule" }, I: ComputeForValidationRequest, O: ComputeForValidationResponse } ], { "api.k8sService": "rule-server" });