UNPKG

@authzed/authzed-node

Version:
1,178 lines (1,177 loc) 160 kB
// @generated by protobuf-ts 2.9.1 with parameter generate_dependencies,long_type_string,client_grpc1 // @generated from protobuf file "authzed/api/v1/experimental_service.proto" (package "authzed.api.v1", syntax proto3) // tslint:disable import { ServiceType } from "@protobuf-ts/runtime-rpc"; import type { BinaryWriteOptions } from "@protobuf-ts/runtime"; import type { IBinaryWriter } from "@protobuf-ts/runtime"; import { WireType } from "@protobuf-ts/runtime"; import type { BinaryReadOptions } from "@protobuf-ts/runtime"; import type { IBinaryReader } from "@protobuf-ts/runtime"; import { UnknownFieldHandler } from "@protobuf-ts/runtime"; import type { PartialMessage } from "@protobuf-ts/runtime"; import { reflectionMergePartial } from "@protobuf-ts/runtime"; import { MESSAGE_TYPE } from "@protobuf-ts/runtime"; import { MessageType } from "@protobuf-ts/runtime"; import { Cursor } from "./core.js"; import { Relationship } from "./core.js"; import { PartialCaveatInfo } from "./core.js"; import { CheckPermissionResponse_Permissionship } from "./permission_service.js"; import { Status } from "../../../google/rpc/status.js"; import { Struct } from "../../../google/protobuf/struct.js"; import { SubjectReference } from "./core.js"; import { ObjectReference } from "./core.js"; import { Consistency } from "./permission_service.js"; import { ZedToken } from "./core.js"; import { RelationshipFilter } from "./permission_service.js"; /** * @generated from protobuf message authzed.api.v1.ExperimentalRegisterRelationshipCounterRequest */ export interface ExperimentalRegisterRelationshipCounterRequest { /** * name is the name of the counter being registered. * * @generated from protobuf field: string name = 1; */ name: string; /** * relationship_filter defines the filter to be applied to the relationships * to be counted. * * @generated from protobuf field: authzed.api.v1.RelationshipFilter relationship_filter = 2; */ relationshipFilter?: RelationshipFilter; } /** * @generated from protobuf message authzed.api.v1.ExperimentalRegisterRelationshipCounterResponse */ export interface ExperimentalRegisterRelationshipCounterResponse { } /** * @generated from protobuf message authzed.api.v1.ExperimentalCountRelationshipsRequest */ export interface ExperimentalCountRelationshipsRequest { /** * name is the name of the counter whose count is being requested. * * @generated from protobuf field: string name = 1; */ name: string; } /** * @generated from protobuf message authzed.api.v1.ExperimentalCountRelationshipsResponse */ export interface ExperimentalCountRelationshipsResponse { /** * @generated from protobuf oneof: counter_result */ counterResult: { oneofKind: "counterStillCalculating"; /** * counter_still_calculating is true if the counter is still calculating the count. * * @generated from protobuf field: bool counter_still_calculating = 1; */ counterStillCalculating: boolean; } | { oneofKind: "readCounterValue"; /** * read_counter_value is the value of the counter at the time of the read. * * @generated from protobuf field: authzed.api.v1.ReadCounterValue read_counter_value = 2; */ readCounterValue: ReadCounterValue; } | { oneofKind: undefined; }; } /** * @generated from protobuf message authzed.api.v1.ReadCounterValue */ export interface ReadCounterValue { /** * relationship_count is the count of relationships that match the filter. * * @generated from protobuf field: uint64 relationship_count = 1; */ relationshipCount: string; /** * read_at is the ZedToken at which the relationship count applies. * * @generated from protobuf field: authzed.api.v1.ZedToken read_at = 2; */ readAt?: ZedToken; } /** * @generated from protobuf message authzed.api.v1.ExperimentalUnregisterRelationshipCounterRequest */ export interface ExperimentalUnregisterRelationshipCounterRequest { /** * name is the name of the counter being unregistered. * * @generated from protobuf field: string name = 1; */ name: string; } /** * @generated from protobuf message authzed.api.v1.ExperimentalUnregisterRelationshipCounterResponse */ export interface ExperimentalUnregisterRelationshipCounterResponse { } /** * NOTE: Deprecated now that BulkCheckPermission has been promoted to the stable API as "CheckBulkPermission". * * @generated from protobuf message authzed.api.v1.BulkCheckPermissionRequest */ export interface BulkCheckPermissionRequest { /** * @generated from protobuf field: authzed.api.v1.Consistency consistency = 1; */ consistency?: Consistency; /** * @deprecated * @generated from protobuf field: repeated authzed.api.v1.BulkCheckPermissionRequestItem items = 2 [deprecated = true]; */ items: BulkCheckPermissionRequestItem[]; } /** * @generated from protobuf message authzed.api.v1.BulkCheckPermissionRequestItem */ export interface BulkCheckPermissionRequestItem { /** * @generated from protobuf field: authzed.api.v1.ObjectReference resource = 1; */ resource?: ObjectReference; /** * @generated from protobuf field: string permission = 2; */ permission: string; /** * @generated from protobuf field: authzed.api.v1.SubjectReference subject = 3; */ subject?: SubjectReference; /** * @generated from protobuf field: google.protobuf.Struct context = 4; */ context?: Struct; } /** * @generated from protobuf message authzed.api.v1.BulkCheckPermissionResponse */ export interface BulkCheckPermissionResponse { /** * @generated from protobuf field: authzed.api.v1.ZedToken checked_at = 1; */ checkedAt?: ZedToken; /** * @generated from protobuf field: repeated authzed.api.v1.BulkCheckPermissionPair pairs = 2; */ pairs: BulkCheckPermissionPair[]; } /** * @generated from protobuf message authzed.api.v1.BulkCheckPermissionPair */ export interface BulkCheckPermissionPair { /** * @generated from protobuf field: authzed.api.v1.BulkCheckPermissionRequestItem request = 1; */ request?: BulkCheckPermissionRequestItem; /** * @generated from protobuf oneof: response */ response: { oneofKind: "item"; /** * @generated from protobuf field: authzed.api.v1.BulkCheckPermissionResponseItem item = 2; */ item: BulkCheckPermissionResponseItem; } | { oneofKind: "error"; /** * @generated from protobuf field: google.rpc.Status error = 3; */ error: Status; } | { oneofKind: undefined; }; } /** * @generated from protobuf message authzed.api.v1.BulkCheckPermissionResponseItem */ export interface BulkCheckPermissionResponseItem { /** * @generated from protobuf field: authzed.api.v1.CheckPermissionResponse.Permissionship permissionship = 1; */ permissionship: CheckPermissionResponse_Permissionship; /** * @generated from protobuf field: authzed.api.v1.PartialCaveatInfo partial_caveat_info = 2; */ partialCaveatInfo?: PartialCaveatInfo; } /** * BulkImportRelationshipsRequest represents one batch of the streaming * BulkImportRelationships API. The maximum size is only limited by the backing * datastore, and optimal size should be determined by the calling client * experimentally. When BulkImport is invoked and receives its first request message, * a transaction is opened to import the relationships. All requests sent to the same * invocation are executed under this single transaction. If a relationship already * exists within the datastore, the entire transaction will fail with an error. * * @generated from protobuf message authzed.api.v1.BulkImportRelationshipsRequest */ export interface BulkImportRelationshipsRequest { /** * @generated from protobuf field: repeated authzed.api.v1.Relationship relationships = 1; */ relationships: Relationship[]; } /** * BulkImportRelationshipsResponse is returned on successful completion of the * bulk load stream, and contains the total number of relationships loaded. * * @generated from protobuf message authzed.api.v1.BulkImportRelationshipsResponse */ export interface BulkImportRelationshipsResponse { /** * @generated from protobuf field: uint64 num_loaded = 1; */ numLoaded: string; } /** * BulkExportRelationshipsRequest represents a resumable request for * all relationships from the server. * * @generated from protobuf message authzed.api.v1.BulkExportRelationshipsRequest */ export interface BulkExportRelationshipsRequest { /** * @generated from protobuf field: authzed.api.v1.Consistency consistency = 1; */ consistency?: Consistency; /** * optional_limit, if non-zero, specifies the limit on the number of * relationships the server can return in one page. By default, the server * will pick a page size, and the server is free to choose a smaller size * at will. * * @generated from protobuf field: uint32 optional_limit = 2; */ optionalLimit: number; /** * optional_cursor, if specified, indicates the cursor after which results * should resume being returned. The cursor can be found on the * BulkExportRelationshipsResponse object. * * @generated from protobuf field: authzed.api.v1.Cursor optional_cursor = 3; */ optionalCursor?: Cursor; /** * optional_relationship_filter, if specified, indicates the * filter to apply to each relationship to be exported. * * @generated from protobuf field: authzed.api.v1.RelationshipFilter optional_relationship_filter = 4; */ optionalRelationshipFilter?: RelationshipFilter; } /** * BulkExportRelationshipsResponse is one page in a stream of relationship * groups that meet the criteria specified by the originating request. The * server will continue to stream back relationship groups as quickly as it can * until all relationships have been transmitted back. * * @generated from protobuf message authzed.api.v1.BulkExportRelationshipsResponse */ export interface BulkExportRelationshipsResponse { /** * @generated from protobuf field: authzed.api.v1.Cursor after_result_cursor = 1; */ afterResultCursor?: Cursor; /** * @generated from protobuf field: repeated authzed.api.v1.Relationship relationships = 2; */ relationships: Relationship[]; } // Reflection types //////////////////////////////////////////// /** * @generated from protobuf message authzed.api.v1.ExperimentalReflectSchemaRequest */ export interface ExperimentalReflectSchemaRequest { /** * @generated from protobuf field: authzed.api.v1.Consistency consistency = 1; */ consistency?: Consistency; /** * optional_filters defines optional filters that are applied in * an OR fashion to the schema, before being returned * * @generated from protobuf field: repeated authzed.api.v1.ExpSchemaFilter optional_filters = 2; */ optionalFilters: ExpSchemaFilter[]; } /** * @generated from protobuf message authzed.api.v1.ExperimentalReflectSchemaResponse */ export interface ExperimentalReflectSchemaResponse { /** * definitions are the definitions defined in the schema. * * @generated from protobuf field: repeated authzed.api.v1.ExpDefinition definitions = 1; */ definitions: ExpDefinition[]; /** * caveats are the caveats defined in the schema. * * @generated from protobuf field: repeated authzed.api.v1.ExpCaveat caveats = 2; */ caveats: ExpCaveat[]; /** * read_at is the ZedToken at which the schema was read. * * @generated from protobuf field: authzed.api.v1.ZedToken read_at = 3; */ readAt?: ZedToken; } /** * ExpSchemaFilter is a filter that can be applied to the schema on reflection. * * @generated from protobuf message authzed.api.v1.ExpSchemaFilter */ export interface ExpSchemaFilter { /** * optional_definition_name_filter is a prefix that is matched against the definition name. * * @generated from protobuf field: string optional_definition_name_filter = 1; */ optionalDefinitionNameFilter: string; /** * optional_caveat_name_filter is a prefix that is matched against the caveat name. * * @generated from protobuf field: string optional_caveat_name_filter = 2; */ optionalCaveatNameFilter: string; /** * optional_relation_name_filter is a prefix that is matched against the relation name. * * @generated from protobuf field: string optional_relation_name_filter = 3; */ optionalRelationNameFilter: string; /** * optional_permission_name_filter is a prefix that is matched against the permission name. * * @generated from protobuf field: string optional_permission_name_filter = 4; */ optionalPermissionNameFilter: string; } /** * ExpDefinition is the representation of a definition in the schema. * * @generated from protobuf message authzed.api.v1.ExpDefinition */ export interface ExpDefinition { /** * @generated from protobuf field: string name = 1; */ name: string; /** * comment is a human-readable comments on the definition. Will include * delimiter characters. * * @generated from protobuf field: string comment = 2; */ comment: string; /** * @generated from protobuf field: repeated authzed.api.v1.ExpRelation relations = 3; */ relations: ExpRelation[]; /** * @generated from protobuf field: repeated authzed.api.v1.ExpPermission permissions = 4; */ permissions: ExpPermission[]; } /** * ExpCaveat is the representation of a caveat in the schema. * * @generated from protobuf message authzed.api.v1.ExpCaveat */ export interface ExpCaveat { /** * @generated from protobuf field: string name = 1; */ name: string; /** * comment is a human-readable comments on the caveat. Will include * delimiter characters. * * @generated from protobuf field: string comment = 2; */ comment: string; /** * @generated from protobuf field: repeated authzed.api.v1.ExpCaveatParameter parameters = 3; */ parameters: ExpCaveatParameter[]; /** * @generated from protobuf field: string expression = 4; */ expression: string; } /** * ExpCaveatParameter is the representation of a parameter in a caveat. * * @generated from protobuf message authzed.api.v1.ExpCaveatParameter */ export interface ExpCaveatParameter { /** * @generated from protobuf field: string name = 1; */ name: string; /** * type is the type of the parameter. Will be a string representing the * type, e.g. `int` or `list<string>` * * @generated from protobuf field: string type = 2; */ type: string; /** * @generated from protobuf field: string parent_caveat_name = 3; */ parentCaveatName: string; } /** * ExpRelation is the representation of a relation in the schema. * * @generated from protobuf message authzed.api.v1.ExpRelation */ export interface ExpRelation { /** * @generated from protobuf field: string name = 1; */ name: string; /** * @generated from protobuf field: string comment = 2; */ comment: string; /** * @generated from protobuf field: string parent_definition_name = 3; */ parentDefinitionName: string; /** * @generated from protobuf field: repeated authzed.api.v1.ExpTypeReference subject_types = 4; */ subjectTypes: ExpTypeReference[]; } /** * ExpTypeReference is the representation of a type reference in the schema. * * @generated from protobuf message authzed.api.v1.ExpTypeReference */ export interface ExpTypeReference { /** * subject_definition_name is the name of the subject's definition. * * @generated from protobuf field: string subject_definition_name = 1; */ subjectDefinitionName: string; /** * optional_caveat_name is the name of the caveat that is applied to the subject, if any. * * @generated from protobuf field: string optional_caveat_name = 2; */ optionalCaveatName: string; /** * @generated from protobuf oneof: typeref */ typeref: { oneofKind: "isTerminalSubject"; /** * is_terminal_subject is true if the subject is terminal, meaning it is referenced directly vs a sub-relation. * * @generated from protobuf field: bool is_terminal_subject = 3; */ isTerminalSubject: boolean; } | { oneofKind: "optionalRelationName"; /** * optional_relation_name is the name of the relation that is applied to the subject, if any. * * @generated from protobuf field: string optional_relation_name = 4; */ optionalRelationName: string; } | { oneofKind: "isPublicWildcard"; /** * is_public_wildcard is true if the subject is a public wildcard. * * @generated from protobuf field: bool is_public_wildcard = 5; */ isPublicWildcard: boolean; } | { oneofKind: undefined; }; } /** * ExpPermission is the representation of a permission in the schema. * * @generated from protobuf message authzed.api.v1.ExpPermission */ export interface ExpPermission { /** * @generated from protobuf field: string name = 1; */ name: string; /** * comment is a human-readable comments on the permission. Will include * delimiter characters. * * @generated from protobuf field: string comment = 2; */ comment: string; /** * @generated from protobuf field: string parent_definition_name = 3; */ parentDefinitionName: string; } /** * @generated from protobuf message authzed.api.v1.ExperimentalComputablePermissionsRequest */ export interface ExperimentalComputablePermissionsRequest { /** * @generated from protobuf field: authzed.api.v1.Consistency consistency = 1; */ consistency?: Consistency; /** * @generated from protobuf field: string definition_name = 2; */ definitionName: string; /** * @generated from protobuf field: string relation_name = 3; */ relationName: string; /** * optional_definition_name_match is a prefix that is matched against the definition name(s) * for the permissions returned. * If not specified, will be ignored. * * @generated from protobuf field: string optional_definition_name_filter = 4; */ optionalDefinitionNameFilter: string; } /** * ExpRelationReference is a reference to a relation or permission in the schema. * * @generated from protobuf message authzed.api.v1.ExpRelationReference */ export interface ExpRelationReference { /** * @generated from protobuf field: string definition_name = 1; */ definitionName: string; /** * @generated from protobuf field: string relation_name = 2; */ relationName: string; /** * @generated from protobuf field: bool is_permission = 3; */ isPermission: boolean; } /** * @generated from protobuf message authzed.api.v1.ExperimentalComputablePermissionsResponse */ export interface ExperimentalComputablePermissionsResponse { /** * @generated from protobuf field: repeated authzed.api.v1.ExpRelationReference permissions = 1; */ permissions: ExpRelationReference[]; /** * read_at is the ZedToken at which the schema was read. * * @generated from protobuf field: authzed.api.v1.ZedToken read_at = 2; */ readAt?: ZedToken; } /** * @generated from protobuf message authzed.api.v1.ExperimentalDependentRelationsRequest */ export interface ExperimentalDependentRelationsRequest { /** * @generated from protobuf field: authzed.api.v1.Consistency consistency = 1; */ consistency?: Consistency; /** * @generated from protobuf field: string definition_name = 2; */ definitionName: string; /** * @generated from protobuf field: string permission_name = 3; */ permissionName: string; } /** * @generated from protobuf message authzed.api.v1.ExperimentalDependentRelationsResponse */ export interface ExperimentalDependentRelationsResponse { /** * @generated from protobuf field: repeated authzed.api.v1.ExpRelationReference relations = 1; */ relations: ExpRelationReference[]; /** * read_at is the ZedToken at which the schema was read. * * @generated from protobuf field: authzed.api.v1.ZedToken read_at = 2; */ readAt?: ZedToken; } /** * @generated from protobuf message authzed.api.v1.ExperimentalDiffSchemaRequest */ export interface ExperimentalDiffSchemaRequest { /** * @generated from protobuf field: authzed.api.v1.Consistency consistency = 1; */ consistency?: Consistency; /** * @generated from protobuf field: string comparison_schema = 2; */ comparisonSchema: string; } /** * @generated from protobuf message authzed.api.v1.ExperimentalDiffSchemaResponse */ export interface ExperimentalDiffSchemaResponse { /** * @generated from protobuf field: repeated authzed.api.v1.ExpSchemaDiff diffs = 1; */ diffs: ExpSchemaDiff[]; /** * read_at is the ZedToken at which the schema was read. * * @generated from protobuf field: authzed.api.v1.ZedToken read_at = 2; */ readAt?: ZedToken; } /** * @generated from protobuf message authzed.api.v1.ExpRelationSubjectTypeChange */ export interface ExpRelationSubjectTypeChange { /** * @generated from protobuf field: authzed.api.v1.ExpRelation relation = 1; */ relation?: ExpRelation; /** * @generated from protobuf field: authzed.api.v1.ExpTypeReference changed_subject_type = 2; */ changedSubjectType?: ExpTypeReference; } /** * @generated from protobuf message authzed.api.v1.ExpCaveatParameterTypeChange */ export interface ExpCaveatParameterTypeChange { /** * @generated from protobuf field: authzed.api.v1.ExpCaveatParameter parameter = 1; */ parameter?: ExpCaveatParameter; /** * @generated from protobuf field: string previous_type = 2; */ previousType: string; } /** * ExpSchemaDiff is the representation of a diff between two schemas. * * @generated from protobuf message authzed.api.v1.ExpSchemaDiff */ export interface ExpSchemaDiff { /** * @generated from protobuf oneof: diff */ diff: { oneofKind: "definitionAdded"; /** * @generated from protobuf field: authzed.api.v1.ExpDefinition definition_added = 1; */ definitionAdded: ExpDefinition; } | { oneofKind: "definitionRemoved"; /** * @generated from protobuf field: authzed.api.v1.ExpDefinition definition_removed = 2; */ definitionRemoved: ExpDefinition; } | { oneofKind: "definitionDocCommentChanged"; /** * @generated from protobuf field: authzed.api.v1.ExpDefinition definition_doc_comment_changed = 3; */ definitionDocCommentChanged: ExpDefinition; } | { oneofKind: "relationAdded"; /** * @generated from protobuf field: authzed.api.v1.ExpRelation relation_added = 4; */ relationAdded: ExpRelation; } | { oneofKind: "relationRemoved"; /** * @generated from protobuf field: authzed.api.v1.ExpRelation relation_removed = 5; */ relationRemoved: ExpRelation; } | { oneofKind: "relationDocCommentChanged"; /** * @generated from protobuf field: authzed.api.v1.ExpRelation relation_doc_comment_changed = 6; */ relationDocCommentChanged: ExpRelation; } | { oneofKind: "relationSubjectTypeAdded"; /** * @generated from protobuf field: authzed.api.v1.ExpRelationSubjectTypeChange relation_subject_type_added = 7; */ relationSubjectTypeAdded: ExpRelationSubjectTypeChange; } | { oneofKind: "relationSubjectTypeRemoved"; /** * @generated from protobuf field: authzed.api.v1.ExpRelationSubjectTypeChange relation_subject_type_removed = 8; */ relationSubjectTypeRemoved: ExpRelationSubjectTypeChange; } | { oneofKind: "permissionAdded"; /** * @generated from protobuf field: authzed.api.v1.ExpPermission permission_added = 9; */ permissionAdded: ExpPermission; } | { oneofKind: "permissionRemoved"; /** * @generated from protobuf field: authzed.api.v1.ExpPermission permission_removed = 10; */ permissionRemoved: ExpPermission; } | { oneofKind: "permissionDocCommentChanged"; /** * @generated from protobuf field: authzed.api.v1.ExpPermission permission_doc_comment_changed = 11; */ permissionDocCommentChanged: ExpPermission; } | { oneofKind: "permissionExprChanged"; /** * @generated from protobuf field: authzed.api.v1.ExpPermission permission_expr_changed = 12; */ permissionExprChanged: ExpPermission; } | { oneofKind: "caveatAdded"; /** * @generated from protobuf field: authzed.api.v1.ExpCaveat caveat_added = 13; */ caveatAdded: ExpCaveat; } | { oneofKind: "caveatRemoved"; /** * @generated from protobuf field: authzed.api.v1.ExpCaveat caveat_removed = 14; */ caveatRemoved: ExpCaveat; } | { oneofKind: "caveatDocCommentChanged"; /** * @generated from protobuf field: authzed.api.v1.ExpCaveat caveat_doc_comment_changed = 15; */ caveatDocCommentChanged: ExpCaveat; } | { oneofKind: "caveatExprChanged"; /** * @generated from protobuf field: authzed.api.v1.ExpCaveat caveat_expr_changed = 16; */ caveatExprChanged: ExpCaveat; } | { oneofKind: "caveatParameterAdded"; /** * @generated from protobuf field: authzed.api.v1.ExpCaveatParameter caveat_parameter_added = 17; */ caveatParameterAdded: ExpCaveatParameter; } | { oneofKind: "caveatParameterRemoved"; /** * @generated from protobuf field: authzed.api.v1.ExpCaveatParameter caveat_parameter_removed = 18; */ caveatParameterRemoved: ExpCaveatParameter; } | { oneofKind: "caveatParameterTypeChanged"; /** * @generated from protobuf field: authzed.api.v1.ExpCaveatParameterTypeChange caveat_parameter_type_changed = 19; */ caveatParameterTypeChanged: ExpCaveatParameterTypeChange; } | { oneofKind: undefined; }; } // @generated message type with reflection information, may provide speed optimized methods class ExperimentalRegisterRelationshipCounterRequest$Type extends MessageType<ExperimentalRegisterRelationshipCounterRequest> { constructor() { super("authzed.api.v1.ExperimentalRegisterRelationshipCounterRequest", [ { no: 1, name: "name", kind: "scalar", T: 9 /*ScalarType.STRING*/, options: { "buf.validate.field": { string: { maxBytes: "64", pattern: "^([a-z][a-z0-9_]{1,62}[a-z0-9])?$" } }, "validate.rules": { string: { maxBytes: "64", pattern: "^([a-z][a-z0-9_]{1,62}[a-z0-9])?$" } } } }, { no: 2, name: "relationship_filter", kind: "message", T: () => RelationshipFilter, options: { "buf.validate.field": { required: true }, "validate.rules": { message: { required: true } } } } ]); } create(value?: PartialMessage<ExperimentalRegisterRelationshipCounterRequest>): ExperimentalRegisterRelationshipCounterRequest { const message = { name: "" }; globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); if (value !== undefined) reflectionMergePartial<ExperimentalRegisterRelationshipCounterRequest>(this, message, value); return message; } internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ExperimentalRegisterRelationshipCounterRequest): ExperimentalRegisterRelationshipCounterRequest { let message = target ?? this.create(), end = reader.pos + length; while (reader.pos < end) { let [fieldNo, wireType] = reader.tag(); switch (fieldNo) { case /* string name */ 1: message.name = reader.string(); break; case /* authzed.api.v1.RelationshipFilter relationship_filter */ 2: message.relationshipFilter = RelationshipFilter.internalBinaryRead(reader, reader.uint32(), options, message.relationshipFilter); 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: ExperimentalRegisterRelationshipCounterRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { /* string name = 1; */ if (message.name !== "") writer.tag(1, WireType.LengthDelimited).string(message.name); /* authzed.api.v1.RelationshipFilter relationship_filter = 2; */ if (message.relationshipFilter) RelationshipFilter.internalBinaryWrite(message.relationshipFilter, writer.tag(2, 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 authzed.api.v1.ExperimentalRegisterRelationshipCounterRequest */ export const ExperimentalRegisterRelationshipCounterRequest = new ExperimentalRegisterRelationshipCounterRequest$Type(); // @generated message type with reflection information, may provide speed optimized methods class ExperimentalRegisterRelationshipCounterResponse$Type extends MessageType<ExperimentalRegisterRelationshipCounterResponse> { constructor() { super("authzed.api.v1.ExperimentalRegisterRelationshipCounterResponse", []); } create(value?: PartialMessage<ExperimentalRegisterRelationshipCounterResponse>): ExperimentalRegisterRelationshipCounterResponse { const message = {}; globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); if (value !== undefined) reflectionMergePartial<ExperimentalRegisterRelationshipCounterResponse>(this, message, value); return message; } internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ExperimentalRegisterRelationshipCounterResponse): ExperimentalRegisterRelationshipCounterResponse { return target ?? this.create(); } internalBinaryWrite(message: ExperimentalRegisterRelationshipCounterResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { let u = options.writeUnknownFields; if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); return writer; } } /** * @generated MessageType for protobuf message authzed.api.v1.ExperimentalRegisterRelationshipCounterResponse */ export const ExperimentalRegisterRelationshipCounterResponse = new ExperimentalRegisterRelationshipCounterResponse$Type(); // @generated message type with reflection information, may provide speed optimized methods class ExperimentalCountRelationshipsRequest$Type extends MessageType<ExperimentalCountRelationshipsRequest> { constructor() { super("authzed.api.v1.ExperimentalCountRelationshipsRequest", [ { no: 1, name: "name", kind: "scalar", T: 9 /*ScalarType.STRING*/, options: { "buf.validate.field": { string: { maxBytes: "64", pattern: "^([a-z][a-z0-9_]{1,62}[a-z0-9])?$" } }, "validate.rules": { string: { maxBytes: "64", pattern: "^([a-z][a-z0-9_]{1,62}[a-z0-9])?$" } } } } ]); } create(value?: PartialMessage<ExperimentalCountRelationshipsRequest>): ExperimentalCountRelationshipsRequest { const message = { name: "" }; globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); if (value !== undefined) reflectionMergePartial<ExperimentalCountRelationshipsRequest>(this, message, value); return message; } internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ExperimentalCountRelationshipsRequest): ExperimentalCountRelationshipsRequest { let message = target ?? this.create(), end = reader.pos + length; while (reader.pos < end) { let [fieldNo, wireType] = reader.tag(); switch (fieldNo) { case /* string name */ 1: message.name = 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: ExperimentalCountRelationshipsRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { /* string name = 1; */ if (message.name !== "") writer.tag(1, WireType.LengthDelimited).string(message.name); let u = options.writeUnknownFields; if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); return writer; } } /** * @generated MessageType for protobuf message authzed.api.v1.ExperimentalCountRelationshipsRequest */ export const ExperimentalCountRelationshipsRequest = new ExperimentalCountRelationshipsRequest$Type(); // @generated message type with reflection information, may provide speed optimized methods class ExperimentalCountRelationshipsResponse$Type extends MessageType<ExperimentalCountRelationshipsResponse> { constructor() { super("authzed.api.v1.ExperimentalCountRelationshipsResponse", [ { no: 1, name: "counter_still_calculating", kind: "scalar", oneof: "counterResult", T: 8 /*ScalarType.BOOL*/ }, { no: 2, name: "read_counter_value", kind: "message", oneof: "counterResult", T: () => ReadCounterValue } ]); } create(value?: PartialMessage<ExperimentalCountRelationshipsResponse>): ExperimentalCountRelationshipsResponse { const message = { counterResult: { oneofKind: undefined } }; globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); if (value !== undefined) reflectionMergePartial<ExperimentalCountRelationshipsResponse>(this, message, value); return message; } internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ExperimentalCountRelationshipsResponse): ExperimentalCountRelationshipsResponse { let message = target ?? this.create(), end = reader.pos + length; while (reader.pos < end) { let [fieldNo, wireType] = reader.tag(); switch (fieldNo) { case /* bool counter_still_calculating */ 1: message.counterResult = { oneofKind: "counterStillCalculating", counterStillCalculating: reader.bool() }; break; case /* authzed.api.v1.ReadCounterValue read_counter_value */ 2: message.counterResult = { oneofKind: "readCounterValue", readCounterValue: ReadCounterValue.internalBinaryRead(reader, reader.uint32(), options, (message.counterResult as any).readCounterValue) }; 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: ExperimentalCountRelationshipsResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { /* bool counter_still_calculating = 1; */ if (message.counterResult.oneofKind === "counterStillCalculating") writer.tag(1, WireType.Varint).bool(message.counterResult.counterStillCalculating); /* authzed.api.v1.ReadCounterValue read_counter_value = 2; */ if (message.counterResult.oneofKind === "readCounterValue") ReadCounterValue.internalBinaryWrite(message.counterResult.readCounterValue, writer.tag(2, 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 authzed.api.v1.ExperimentalCountRelationshipsResponse */ export const ExperimentalCountRelationshipsResponse = new ExperimentalCountRelationshipsResponse$Type(); // @generated message type with reflection information, may provide speed optimized methods class ReadCounterValue$Type extends MessageType<ReadCounterValue> { constructor() { super("authzed.api.v1.ReadCounterValue", [ { no: 1, name: "relationship_count", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, { no: 2, name: "read_at", kind: "message", T: () => ZedToken, options: { "buf.validate.field": { required: true }, "validate.rules": { message: { required: true } } } } ]); } create(value?: PartialMessage<ReadCounterValue>): ReadCounterValue { const message = { relationshipCount: "0" }; globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); if (value !== undefined) reflectionMergePartial<ReadCounterValue>(this, message, value); return message; } internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ReadCounterValue): ReadCounterValue { let message = target ?? this.create(), end = reader.pos + length; while (reader.pos < end) { let [fieldNo, wireType] = reader.tag(); switch (fieldNo) { case /* uint64 relationship_count */ 1: message.relationshipCount = reader.uint64().toString(); break; case /* authzed.api.v1.ZedToken read_at */ 2: message.readAt = ZedToken.internalBinaryRead(reader, reader.uint32(), options, message.readAt); 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: ReadCounterValue, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { /* uint64 relationship_count = 1; */ if (message.relationshipCount !== "0") writer.tag(1, WireType.Varint).uint64(message.relationshipCount); /* authzed.api.v1.ZedToken read_at = 2; */ if (message.readAt) ZedToken.internalBinaryWrite(message.readAt, writer.tag(2, 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 authzed.api.v1.ReadCounterValue */ export const ReadCounterValue = new ReadCounterValue$Type(); // @generated message type with reflection information, may provide speed optimized methods class ExperimentalUnregisterRelationshipCounterRequest$Type extends MessageType<ExperimentalUnregisterRelationshipCounterRequest> { constructor() { super("authzed.api.v1.ExperimentalUnregisterRelationshipCounterRequest", [ { no: 1, name: "name", kind: "scalar", T: 9 /*ScalarType.STRING*/, options: { "buf.validate.field": { string: { maxBytes: "64", pattern: "^([a-z][a-z0-9_]{1,62}[a-z0-9])?$" } }, "validate.rules": { string: { maxBytes: "64", pattern: "^([a-z][a-z0-9_]{1,62}[a-z0-9])?$" } } } } ]); } create(value?: PartialMessage<ExperimentalUnregisterRelationshipCounterRequest>): ExperimentalUnregisterRelationshipCounterRequest { const message = { name: "" }; globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); if (value !== undefined) reflectionMergePartial<ExperimentalUnregisterRelationshipCounterRequest>(this, message, value); return message; } internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ExperimentalUnregisterRelationshipCounterRequest): ExperimentalUnregisterRelationshipCounterRequest { let message = target ?? this.create(), end = reader.pos + length; while (reader.pos < end) { let [fieldNo, wireType] = reader.tag(); switch (fieldNo) { case /* string name */ 1: message.name = 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: ExperimentalUnregisterRelationshipCounterRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { /* string name = 1; */ if (message.name !== "") writer.tag(1, WireType.LengthDelimited).string(message.name); let u = options.writeUnknownFields; if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); return writer; } } /** * @generated MessageType for protobuf message authzed.api.v1.ExperimentalUnregisterRelationshipCounterRequest */ export const ExperimentalUnregisterRelationshipCounterRequest = new ExperimentalUnregisterRelationshipCounterRequest$Type(); // @generated message type with reflection information, may provide speed optimized methods class ExperimentalUnregisterRelationshipCounterResponse$Type extends MessageType<ExperimentalUnregisterRelationshipCounterResponse> { constructor() { super("authzed.api.v1.ExperimentalUnregisterRelationshipCounterResponse", []); } create(value?: PartialMessage<ExperimentalUnregisterRelationshipCounterResponse>): ExperimentalUnregisterRelationshipCounterResponse { const message = {}; globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); if (value !== undefined) reflectionMergePartial<ExperimentalUnregisterRelationshipCounterResponse>(this, message, value); return message; } internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ExperimentalUnregisterRelationshipCounterResponse): ExperimentalUnregisterRelationshipCounterResponse { return target ?? this.create(); } internalBinaryWrite(message: ExperimentalUnregisterRelationshipCounterResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { let u = options.writeUnknownFields; if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); return writer; } } /** * @generated MessageType for protobuf message authzed.api.v1.ExperimentalUnregisterRelationshipCounterResponse */ export const ExperimentalUnregisterRelationshipCounterResponse = new ExperimentalUnregisterRelationshipCounterResponse$Type(); // @generated message type with reflection information, may provide speed optimized methods class BulkCheckPermissionRequest$Type extends MessageType<BulkCheckPermissionRequest> { constructor() { super("authzed.api.v1.BulkCheckPermissionRequest", [ { no: 1, name: "consistency", kind: "message", T: () => Consistency }, { no: 2, name: "items", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => BulkCheckPermissionRequestItem, options: { "buf.validate.field": { repeated: { items: { required: true } } }, "validate.rules": { repeated: { items: { message: { required: true } } } } } } ]); } create(value?: PartialMessage<BulkCheckPermissionRequest>): BulkCheckPermissionRequest { const message = { items: [] }; globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); if (value !== undefined) reflectionMergePartial<BulkCheckPermissionRequest>(this, message, value); return message; } internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: BulkCheckPermissionRequest): BulkCheckPermissionRequest { let message = target ?? this.create(), end = reader.pos + length; while (reader.pos < end) { let [fieldNo, wireType] = reader.tag(); switch (fieldNo) { case /* authzed.api.v1.Consistency consistency */ 1: message.consistency = Consistency.internalBinaryRead(reader, reader.uint32(), options, message.consistency); break; case /* repeated authzed.api.v1.BulkCheckPermissionRequestItem items = 2 [deprecated = true];*/ 2: message.items.push(BulkCheckPermissionRequestItem.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: BulkCheckPermissionRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { /* authzed.api.v1.Consistency consistency = 1; */ if (message.consistency) Consistency.internalBinaryWrite(message.consistency, writer.tag(1, WireType.LengthDelimited).fork(), options).join(); /* repeated authzed.api.v1.BulkCheckPermissionRequestItem items = 2 [deprecated = true]; */ for (let i = 0; i < message.items.length; i++) BulkCheckPermissionRequestItem.internalBinaryWrite(message.items[i], writer.tag(2, 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 authzed.api.v1.BulkCheckPermissionRequest */ export const BulkCheckPermissionRequest = new BulkCheckPermissionRequest$Type(); // @generated message type with reflection information, may provide speed optimized methods class BulkCheckPermissionRequestItem$Type extends MessageType<BulkCheckPermissionRequestItem> { constructor() { super("authzed.api.v1.BulkCheckPermissionRequestItem", [ { no: 1, name: "resource", kind: "message", T: () => ObjectReference, options: { "buf.validate.field": { required: true }, "validate.rules": { message: { required: true } } } }, { no: 2, name: "permission", kind: "scalar", T: 9 /*ScalarType.STRING*/, options: { "buf.validate.field": { string: { maxBytes