Latest generation

This commit is contained in:
ci core model
2026-02-17 15:20:24 +00:00
parent 5418229663
commit 8a8f58f400
5 changed files with 316 additions and 85 deletions

217
api.ts
View File

@@ -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<GetPermissionsRequest> {
constructor() {
@@ -930,6 +974,178 @@ class CleanScopeResult$Type extends MessageType<CleanScopeResult> {
* @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<UserRPT> {
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>): UserRPT {
const message = globalThis.Object.create((this.messagePrototype!));
message.UserID = "";
message.Scopes = [];
if (value !== undefined)
reflectionMergePartial<UserRPT>(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<ListUserRPTsRequest> {
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>): ListUserRPTsRequest {
const message = globalThis.Object.create((this.messagePrototype!));
message.UserID = "";
message.ResourceType = 0;
message.ResourceID = "";
if (value !== undefined)
reflectionMergePartial<ListUserRPTsRequest>(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<ListUserRPTsResponse> {
constructor() {
super("api.ListUserRPTsResponse", [
{ no: 1, name: "RPTs", kind: "message", localName: "RPTs", jsonName: "RPTs", repeat: 2 /*RepeatType.UNPACKED*/, T: () => UserRPT }
]);
}
create(value?: PartialMessage<ListUserRPTsResponse>): ListUserRPTsResponse {
const message = globalThis.Object.create((this.messagePrototype!));
message.RPTs = [];
if (value !== undefined)
reflectionMergePartial<ListUserRPTsResponse>(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 },