import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; import Long from "long"; import { CheckedExpr } from "../../google/api/expr/v1alpha1/checked"; import { Any } from "../../google/protobuf/any"; export declare const protobufPackage = "base.v1"; /** Enumerates results of a check operation. */ export declare enum CheckResult { /** CHECK_RESULT_UNSPECIFIED - Not specified check result. This is the default value. */ CHECK_RESULT_UNSPECIFIED = 0, /** CHECK_RESULT_ALLOWED - Represents a successful check (the check allowed the operation). */ CHECK_RESULT_ALLOWED = 1, /** CHECK_RESULT_DENIED - Represents a failed check (the check denied the operation). */ CHECK_RESULT_DENIED = 2, UNRECOGNIZED = -1 } export declare function checkResultFromJSON(object: any): CheckResult; export declare function checkResultToJSON(object: CheckResult): string; /** Enumerates the types of attribute. */ export declare enum AttributeType { /** ATTRIBUTE_TYPE_UNSPECIFIED - Not specified attribute type. This is the default value. */ ATTRIBUTE_TYPE_UNSPECIFIED = 0, /** ATTRIBUTE_TYPE_BOOLEAN - A boolean attribute type. */ ATTRIBUTE_TYPE_BOOLEAN = 1, /** ATTRIBUTE_TYPE_BOOLEAN_ARRAY - A boolean array attribute type. */ ATTRIBUTE_TYPE_BOOLEAN_ARRAY = 2, /** ATTRIBUTE_TYPE_STRING - A string attribute type. */ ATTRIBUTE_TYPE_STRING = 3, /** ATTRIBUTE_TYPE_STRING_ARRAY - A string array attribute type. */ ATTRIBUTE_TYPE_STRING_ARRAY = 4, /** ATTRIBUTE_TYPE_INTEGER - An integer attribute type. */ ATTRIBUTE_TYPE_INTEGER = 5, /** ATTRIBUTE_TYPE_INTEGER_ARRAY - An integer array attribute type. */ ATTRIBUTE_TYPE_INTEGER_ARRAY = 6, /** ATTRIBUTE_TYPE_DOUBLE - A double attribute type. */ ATTRIBUTE_TYPE_DOUBLE = 7, /** ATTRIBUTE_TYPE_DOUBLE_ARRAY - A double array attribute type. */ ATTRIBUTE_TYPE_DOUBLE_ARRAY = 8, UNRECOGNIZED = -1 } export declare function attributeTypeFromJSON(object: any): AttributeType; export declare function attributeTypeToJSON(object: AttributeType): string; /** * Context encapsulates the information related to a single operation, * including the tuples involved and the associated attributes. */ export interface Context { /** A repeated field of tuples involved in the operation. */ tuples: Tuple[]; /** A repeated field of attributes associated with the operation. */ attributes: Attribute[]; /** Additional data associated with the context. */ data: { [key: string]: any; } | undefined; } /** Child represents a node in the permission tree. */ export interface Child { /** Child node can be either a leaf or a rewrite operation. */ type?: // /** Leaf node in the permission tree. */ { $case: "leaf"; leaf: Leaf; } | // /** Rewrite operation in the permission tree. */ { $case: "rewrite"; rewrite: Rewrite; } | undefined; } /** Leaf represents a leaf node in the permission tree. */ export interface Leaf { /** Leaf node can be one of several types. */ type?: // /** A computed set of users. */ { $case: "computedUserSet"; computedUserSet: ComputedUserSet; } | // /** A tuple to user set conversion. */ { $case: "tupleToUserSet"; tupleToUserSet: TupleToUserSet; } | // /** A computed attribute. */ { $case: "computedAttribute"; computedAttribute: ComputedAttribute; } | // /** A call to a function or method. */ { $case: "call"; call: Call; } | undefined; } /** * The Rewrite message represents a specific rewrite operation. * This operation could be one of the following: union, intersection, or exclusion. */ export interface Rewrite { /** The type of rewrite operation to be performed. */ rewriteOperation: Rewrite_Operation; /** A list of children that are operated upon by the rewrite operation. */ children: Child[]; } /** * Operation enum includes potential rewrite operations. * OPERATION_UNION: Represents a union operation. * OPERATION_INTERSECTION: Represents an intersection operation. * OPERATION_EXCLUSION: Represents an exclusion operation. */ export declare enum Rewrite_Operation { /** OPERATION_UNSPECIFIED - Default, unspecified operation. */ OPERATION_UNSPECIFIED = 0, /** OPERATION_UNION - Represents a union operation. */ OPERATION_UNION = 1, /** OPERATION_INTERSECTION - Represents an intersection operation. */ OPERATION_INTERSECTION = 2, /** OPERATION_EXCLUSION - Represents an exclusion operation. */ OPERATION_EXCLUSION = 3, UNRECOGNIZED = -1 } export declare function rewrite_OperationFromJSON(object: any): Rewrite_Operation; export declare function rewrite_OperationToJSON(object: Rewrite_Operation): string; /** * The SchemaDefinition message provides definitions for entities and rules, * and includes references to clarify whether a name refers to an entity or a rule. */ export interface SchemaDefinition { /** Map of entity definitions. The key is the entity name, and the value is the corresponding EntityDefinition. */ entityDefinitions: { [key: string]: EntityDefinition; }; /** Map of rule definitions. The key is the rule name, and the value is the corresponding RuleDefinition. */ ruleDefinitions: { [key: string]: RuleDefinition; }; /** Map of references to signify whether a string refers to an entity or a rule. */ references: { [key: string]: SchemaDefinition_Reference; }; } /** The Reference enum helps distinguish whether a name corresponds to an entity or a rule. */ export declare enum SchemaDefinition_Reference { /** REFERENCE_UNSPECIFIED - Default, unspecified reference. */ REFERENCE_UNSPECIFIED = 0, /** REFERENCE_ENTITY - Indicates that the name refers to an entity. */ REFERENCE_ENTITY = 1, /** REFERENCE_RULE - Indicates that the name refers to a rule. */ REFERENCE_RULE = 2, UNRECOGNIZED = -1 } export declare function schemaDefinition_ReferenceFromJSON(object: any): SchemaDefinition_Reference; export declare function schemaDefinition_ReferenceToJSON(object: SchemaDefinition_Reference): string; export interface SchemaDefinition_EntityDefinitionsEntry { key: string; value: EntityDefinition | undefined; } export interface SchemaDefinition_RuleDefinitionsEntry { key: string; value: RuleDefinition | undefined; } export interface SchemaDefinition_ReferencesEntry { key: string; value: SchemaDefinition_Reference; } /** The EntityDefinition message provides detailed information about a specific entity. */ export interface EntityDefinition { /** The name of the entity, which follows a specific string pattern and has a maximum byte size. */ name: string; /** Map of relation definitions within this entity. The key is the relation name, and the value is the RelationDefinition. */ relations: { [key: string]: RelationDefinition; }; /** Map of permission definitions within this entity. The key is the permission name, and the value is the PermissionDefinition. */ permissions: { [key: string]: PermissionDefinition; }; /** Map of attribute definitions within this entity. The key is the attribute name, and the value is the AttributeDefinition. */ attributes: { [key: string]: AttributeDefinition; }; /** Map of references indicating whether a string pertains to a relation, permission, or attribute. */ references: { [key: string]: EntityDefinition_Reference; }; } /** The Reference enum specifies whether a name pertains to a relation, permission, or attribute. */ export declare enum EntityDefinition_Reference { /** REFERENCE_UNSPECIFIED - Default, unspecified reference. */ REFERENCE_UNSPECIFIED = 0, /** REFERENCE_RELATION - Indicates that the name refers to a relation. */ REFERENCE_RELATION = 1, /** REFERENCE_PERMISSION - Indicates that the name refers to a permission. */ REFERENCE_PERMISSION = 2, /** REFERENCE_ATTRIBUTE - Indicates that the name refers to an attribute. */ REFERENCE_ATTRIBUTE = 3, UNRECOGNIZED = -1 } export declare function entityDefinition_ReferenceFromJSON(object: any): EntityDefinition_Reference; export declare function entityDefinition_ReferenceToJSON(object: EntityDefinition_Reference): string; export interface EntityDefinition_RelationsEntry { key: string; value: RelationDefinition | undefined; } export interface EntityDefinition_PermissionsEntry { key: string; value: PermissionDefinition | undefined; } export interface EntityDefinition_AttributesEntry { key: string; value: AttributeDefinition | undefined; } export interface EntityDefinition_ReferencesEntry { key: string; value: EntityDefinition_Reference; } /** The RuleDefinition message provides detailed information about a specific rule. */ export interface RuleDefinition { /** The name of the rule, which follows a specific string pattern and has a maximum byte size. */ name: string; /** Map of arguments for this rule. The key is the attribute name, and the value is the AttributeType. */ arguments: { [key: string]: AttributeType; }; /** The expression for this rule in the form of a google.api.expr.v1alpha1.CheckedExpr. */ expression: CheckedExpr | undefined; } export interface RuleDefinition_ArgumentsEntry { key: string; value: AttributeType; } /** The AttributeDefinition message provides detailed information about a specific attribute. */ export interface AttributeDefinition { /** The name of the attribute, which follows a specific string pattern and has a maximum byte size. */ name: string; /** The type of the attribute. */ type: AttributeType; } /** The RelationDefinition message provides detailed information about a specific relation. */ export interface RelationDefinition { /** The name of the relation, which follows a specific string pattern and has a maximum byte size. */ name: string; /** A list of references to other relations. */ relationReferences: RelationReference[]; } /** The PermissionDefinition message provides detailed information about a specific permission. */ export interface PermissionDefinition { /** The name of the permission, which follows a specific string pattern and has a maximum byte size. */ name: string; /** The child related to this permission. */ child: Child | undefined; } /** The RelationReference message provides a reference to a specific relation. */ export interface RelationReference { /** The type of the referenced entity, which follows a specific string pattern and has a maximum byte size. */ type: string; /** The name of the referenced relation, which follows a specific string pattern and has a maximum byte size. */ relation: string; } export interface Entrance { /** The type of the entrance entity, which follows a specific string pattern and has a maximum byte size. */ type: string; /** The value associated with the entrance, which follows a specific string pattern and has a maximum byte size. */ value: string; } /** Argument defines the type of argument in a Call. It can be either a ComputedAttribute or a ContextAttribute. */ export interface Argument { type?: { $case: "computedAttribute"; computedAttribute: ComputedAttribute; } | undefined; } /** Call represents a call to a rule. It includes the name of the rule and the arguments passed to it. */ export interface Call { /** Name of the rule */ ruleName: string; /** Arguments passed to the rule */ arguments: Argument[]; } /** ComputedAttribute defines a computed attribute which includes its name. */ export interface ComputedAttribute { /** Name of the computed attribute */ name: string; } /** ComputedUserSet defines a set of computed users which includes the relation name. */ export interface ComputedUserSet { /** Relation name */ relation: string; } /** TupleToUserSet defines a mapping from tuple sets to computed user sets. */ export interface TupleToUserSet { /** The tuple set */ tupleSet: TupleSet | undefined; /** The computed user set */ computed: ComputedUserSet | undefined; } /** TupleSet represents a set of tuples associated with a specific relation. */ export interface TupleSet { relation: string; } /** Tuple is a structure that includes an entity, a relation, and a subject. */ export interface Tuple { entity: Entity | undefined; relation: string; subject: Subject | undefined; } /** Attribute represents an attribute of an entity with a specific type and value. */ export interface Attribute { entity: Entity | undefined; /** Name of the attribute */ attribute: string; value: Any | undefined; } /** Tuples is a collection of tuples. */ export interface Tuples { tuples: Tuple[]; } /** Attributes is a collection of attributes. */ export interface Attributes { attributes: Attribute[]; } /** Entity represents an entity with a type and an identifier. */ export interface Entity { type: string; id: string; } /** EntityAndRelation represents an entity along with a relation. */ export interface EntityAndRelation { entity: Entity | undefined; relation: string; } /** Subject represents an entity subject with a type, an identifier, and a relation. */ export interface Subject { type: string; id: string; relation: string; } /** AttributeFilter is used to filter attributes based on the entity and attribute names. */ export interface AttributeFilter { entity: EntityFilter | undefined; /** Names of the attributes to be filtered */ attributes: string[]; } /** TupleFilter is used to filter tuples based on the entity, relation and the subject. */ export interface TupleFilter { entity: EntityFilter | undefined; relation: string; /** The subject filter */ subject: SubjectFilter | undefined; } /** EntityFilter is used to filter entities based on the type and ids. */ export interface EntityFilter { /** Type of the entity */ type: string; /** List of entity IDs */ ids: string[]; } /** SubjectFilter is used to filter subjects based on the type, ids and relation. */ export interface SubjectFilter { /** Type of the subject */ type: string; /** List of subject IDs */ ids: string[]; relation: string; } /** ExpandTreeNode represents a node in an expansion tree with a specific operation and its children. */ export interface ExpandTreeNode { /** Operation to be applied on this tree node */ operation: ExpandTreeNode_Operation; /** The children of this tree node */ children: Expand[]; } /** Operation is an enum representing the type of operation to be applied on the tree node. */ export declare enum ExpandTreeNode_Operation { OPERATION_UNSPECIFIED = 0, OPERATION_UNION = 1, OPERATION_INTERSECTION = 2, OPERATION_EXCLUSION = 3, UNRECOGNIZED = -1 } export declare function expandTreeNode_OperationFromJSON(object: any): ExpandTreeNode_Operation; export declare function expandTreeNode_OperationToJSON(object: ExpandTreeNode_Operation): string; /** * Expand is used to define a hierarchical structure for permissions. * It has an entity, permission, and arguments. The node can be either another hierarchical structure or a set of subjects. */ export interface Expand { /** entity is the entity for which the hierarchical structure is defined. */ entity: Entity | undefined; /** permission is the permission applied to the entity. */ permission: string; /** arguments are the additional information or context used to evaluate permissions. */ arguments: Argument[]; /** The node can either be an ExpandTreeNode or a set of Subjects. */ node?: // /** expand contains another hierarchical structure. */ { $case: "expand"; expand: ExpandTreeNode; } | // /** leaf contains a set of subjects. */ { $case: "leaf"; leaf: ExpandLeaf; } | undefined; } /** ExpandLeaf is the leaf node of an Expand tree and can be either a set of Subjects or a set of Values. */ export interface ExpandLeaf { /** type can be either Subjects or Values. */ type?: // /** subjects are used when the leaf is a set of subjects. */ { $case: "subjects"; subjects: Subjects; } | // /** values are used when the leaf node is a set of values. */ { $case: "values"; values: Values; } | // /** value is used when the leaf node is a single value. */ { $case: "value"; value: Any; } | undefined; } export interface Values { values: { [key: string]: Any; }; } export interface Values_ValuesEntry { key: string; value: Any | undefined; } /** Subjects holds a repeated field of Subject type. */ export interface Subjects { /** A list of subjects. */ subjects: Subject[]; } /** Tenant represents a tenant with an id, a name, and a timestamp indicating when it was created. */ export interface Tenant { /** The ID of the tenant. */ id: string; /** The name of the tenant. */ name: string; /** The time at which the tenant was created. */ createdAt: Date | undefined; } /** DataChanges represent changes in data with a snap token and a list of data change objects. */ export interface DataChanges { /** The snapshot token. */ snapToken: string; /** The list of data changes. */ dataChanges: DataChange[]; } /** DataChange represents a single change in data, with an operation type and the actual change which could be a tuple or an attribute. */ export interface DataChange { /** The operation type. */ operation: DataChange_Operation; /** The type of the change which can be either a tuple or an attribute. */ type?: // /** If the change is a tuple. */ { $case: "tuple"; tuple: Tuple; } | // /** If the change is an attribute. */ { $case: "attribute"; attribute: Attribute; } | undefined; } export declare enum DataChange_Operation { /** OPERATION_UNSPECIFIED - Default operation, not specified. */ OPERATION_UNSPECIFIED = 0, /** OPERATION_CREATE - Creation operation. */ OPERATION_CREATE = 1, /** OPERATION_DELETE - Deletion operation. */ OPERATION_DELETE = 2, UNRECOGNIZED = -1 } export declare function dataChange_OperationFromJSON(object: any): DataChange_Operation; export declare function dataChange_OperationToJSON(object: DataChange_Operation): string; /** Wrapper for a single string value. */ export interface StringValue { /** The string value. */ data: string; } /** Wrapper for a single integer value. */ export interface IntegerValue { /** The integer value. */ data: number; } /** Wrapper for a single double precision floating point value. */ export interface DoubleValue { /** The double value. */ data: number; } /** Wrapper for a single boolean value. */ export interface BooleanValue { /** The boolean value. */ data: boolean; } /** Wrapper for an array of strings. */ export interface StringArrayValue { /** The array of strings. */ data: string[]; } /** Wrapper for an array of integers. */ export interface IntegerArrayValue { /** The array of integers. */ data: number[]; } /** Wrapper for an array of double precision floating point values. */ export interface DoubleArrayValue { /** The array of doubles. */ data: number[]; } /** Wrapper for an array of booleans. */ export interface BooleanArrayValue { /** The array of booleans. */ data: boolean[]; } /** * DataBundle is a message representing a bundle of data, which includes a name, * a list of arguments, and a series of operations. */ export interface DataBundle { /** 'name' is a simple string field representing the name of the DataBundle. */ name: string; /** * 'arguments' is a repeated field, which means it can contain multiple strings. * These are used to store a list of arguments related to the DataBundle. */ arguments: string[]; /** * 'operations' is a repeated field containing multiple Operation messages. * Each Operation represents a specific action or set of actions to be performed. */ operations: Operation[]; } /** * Operation is a message representing a series of operations that can be performed. * It includes fields for writing and deleting relationships and attributes. */ export interface Operation { /** * 'relationships_write' is a repeated string field for storing relationship keys * that are to be written or created. */ relationshipsWrite: string[]; /** * 'relationships_delete' is a repeated string field for storing relationship keys * that are to be deleted or removed. */ relationshipsDelete: string[]; /** * 'attributes_write' is a repeated string field for storing attribute keys * that are to be written or created. */ attributesWrite: string[]; /** * 'attributes_delete' is a repeated string field for storing attribute keys * that are to be deleted or removed. */ attributesDelete: string[]; } /** Partials contains the write, update and delete definitions */ export interface Partials { write: string[]; delete: string[]; update: string[]; } export declare const Context: MessageFns; export declare const Child: MessageFns; export declare const Leaf: MessageFns; export declare const Rewrite: MessageFns; export declare const SchemaDefinition: MessageFns; export declare const SchemaDefinition_EntityDefinitionsEntry: MessageFns; export declare const SchemaDefinition_RuleDefinitionsEntry: MessageFns; export declare const SchemaDefinition_ReferencesEntry: MessageFns; export declare const EntityDefinition: MessageFns; export declare const EntityDefinition_RelationsEntry: MessageFns; export declare const EntityDefinition_PermissionsEntry: MessageFns; export declare const EntityDefinition_AttributesEntry: MessageFns; export declare const EntityDefinition_ReferencesEntry: MessageFns; export declare const RuleDefinition: MessageFns; export declare const RuleDefinition_ArgumentsEntry: MessageFns; export declare const AttributeDefinition: MessageFns; export declare const RelationDefinition: MessageFns; export declare const PermissionDefinition: MessageFns; export declare const RelationReference: MessageFns; export declare const Entrance: MessageFns; export declare const Argument: MessageFns; export declare const Call: MessageFns; export declare const ComputedAttribute: MessageFns; export declare const ComputedUserSet: MessageFns; export declare const TupleToUserSet: MessageFns; export declare const TupleSet: MessageFns; export declare const Tuple: MessageFns; export declare const Attribute: MessageFns; export declare const Tuples: MessageFns; export declare const Attributes: MessageFns; export declare const Entity: MessageFns; export declare const EntityAndRelation: MessageFns; export declare const Subject: MessageFns; export declare const AttributeFilter: MessageFns; export declare const TupleFilter: MessageFns; export declare const EntityFilter: MessageFns; export declare const SubjectFilter: MessageFns; export declare const ExpandTreeNode: MessageFns; export declare const Expand: MessageFns; export declare const ExpandLeaf: MessageFns; export declare const Values: MessageFns; export declare const Values_ValuesEntry: MessageFns; export declare const Subjects: MessageFns; export declare const Tenant: MessageFns; export declare const DataChanges: MessageFns; export declare const DataChange: MessageFns; export declare const StringValue: MessageFns; export declare const IntegerValue: MessageFns; export declare const DoubleValue: MessageFns; export declare const BooleanValue: MessageFns; export declare const StringArrayValue: MessageFns; export declare const IntegerArrayValue: MessageFns; export declare const DoubleArrayValue: MessageFns; export declare const BooleanArrayValue: MessageFns; export declare const DataBundle: MessageFns; export declare const Operation: MessageFns; export declare const Partials: MessageFns; type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; export type DeepPartial = T extends Builtin ? T : T extends Long ? string | number | Long : T extends globalThis.Array ? globalThis.Array> : T extends ReadonlyArray ? ReadonlyArray> : T extends { $case: string; } ? { [K in keyof Omit]?: DeepPartial; } & { $case: T["$case"]; } : T extends {} ? { [K in keyof T]?: DeepPartial; } : Partial; export interface MessageFns { encode(message: T, writer?: BinaryWriter): BinaryWriter; decode(input: BinaryReader | Uint8Array, length?: number): T; fromJSON(object: any): T; toJSON(message: T): unknown; create(base?: DeepPartial): T; fromPartial(object: DeepPartial): T; } export {};