diff --git a/alias.ts b/alias.ts index c5e98d3..319f07a 100644 --- a/alias.ts +++ b/alias.ts @@ -41,12 +41,6 @@ export interface AliasPropertiesAppointmentScheduling { * @generated from protobuf field: string ActorName = 4 */ ActorName: string; - /** - * Restriction rule IDs which will be applied when this alias is used. - * - * @generated from protobuf field: repeated string RestrictionRuleIDs = 5 - */ - RestrictionRuleIDs: string[]; } /** * Alias represents a named link from one resource to another. @@ -237,8 +231,7 @@ class AliasPropertiesAppointmentScheduling$Type extends MessageType ["api.AppointmentType", AppointmentType], options: { "validate.rules": { enum: { definedOnly: true } } } }, { no: 2, name: "LoadingCommandIdentifierEntry", kind: "enum", localName: "LoadingCommandIdentifierEntry", jsonName: "LoadingCommandIdentifierEntry", T: () => ["api.CommandIdentifierEntry", CommandIdentifierEntry], options: { "validate.rules": { enum: { definedOnly: true } } } }, { no: 3, name: "UnLoadingCommandIdentifierEntry", kind: "enum", localName: "UnLoadingCommandIdentifierEntry", jsonName: "UnLoadingCommandIdentifierEntry", T: () => ["api.CommandIdentifierEntry", CommandIdentifierEntry], options: { "validate.rules": { enum: { definedOnly: true } } } }, - { no: 4, name: "ActorName", kind: "scalar", localName: "ActorName", jsonName: "ActorName", T: 9 /*ScalarType.STRING*/ }, - { no: 5, name: "RestrictionRuleIDs", kind: "scalar", localName: "RestrictionRuleIDs", jsonName: "RestrictionRuleIDs", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/ } + { no: 4, name: "ActorName", kind: "scalar", localName: "ActorName", jsonName: "ActorName", T: 9 /*ScalarType.STRING*/ } ]); } create(value?: PartialMessage): AliasPropertiesAppointmentScheduling { @@ -247,7 +240,6 @@ class AliasPropertiesAppointmentScheduling$Type extends MessageType(this, message, value); return message; @@ -269,9 +261,6 @@ class AliasPropertiesAppointmentScheduling$Type extends MessageType" for a restriction rule). } /** + * RestrictionRule is the input structure used to define a rule within a restriction, before it is persisted as a full Rule. + * * @generated from protobuf message api.RestrictionRule */ export interface RestrictionRule { @@ -106,11 +118,15 @@ export interface RestrictionRule { /** * @generated from protobuf field: string Description = 3 */ - Description: string; + Description: string; // Optional description providing context for the rule. /** * @generated from protobuf field: string Definition = 4 */ Definition: string; + /** + * @generated from protobuf field: repeated string Attributes = 5 + */ + 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. } // ========== REQUESTS & RESPONSE MESSAGES ========== @@ -399,7 +415,7 @@ export interface ComputeRuleRequest { /** * @generated from protobuf field: string RewriteFor = 5 */ - RewriteFor: string; // Example: "ShipFrom.Actor", "ShipTo.Actor" + RewriteFor: string; // Actor path prefix used to rewrite actor references in the computed output (e.g. "ShipFrom.Actor", "ShipTo.Actor"). } /** * @generated from protobuf message api.ComputeRuleResponse @@ -429,39 +445,57 @@ export interface ValidateRestrictionRuleRequest { export interface ValidateRestrictionRuleResponse { } /** + * RestrictionType determines the scope of a restriction's application. + * * @generated from protobuf enum api.RestrictionType */ export enum RestrictionType { /** + * Default unset value. Should not be used explicitly. + * * @generated from protobuf enum value: RESTRICTION_TYPE_UNKNOWN = 0; */ RESTRICTION_TYPE_UNKNOWN = 0, /** + * Restriction applies to individual users directly. + * * @generated from protobuf enum value: RESTRICTION_TYPE_USER = 1; */ RESTRICTION_TYPE_USER = 1, /** + * Restriction applies via partner: users whose partner has this restriction will also have it applied to them. + * * @generated from protobuf enum value: RESTRICTION_TYPE_PARTNER = 2; */ RESTRICTION_TYPE_PARTNER = 2 } /** + * RuleComputeFormat specifies the query language into which a restriction rule is compiled. + * * @generated from protobuf enum api.RuleComputeFormat */ export enum RuleComputeFormat { /** + * Default unset value. Should not be used explicitly. + * * @generated from protobuf enum value: RULE_COMPUTE_FORMAT_UNKNOWN = 0; */ RULE_COMPUTE_FORMAT_UNKNOWN = 0, /** + * ClickHouse SQL expression. + * * @generated from protobuf enum value: RULE_COMPUTE_FORMAT_CH = 1; */ RULE_COMPUTE_FORMAT_CH = 1, /** + * OpenSearch query expression. + * * @generated from protobuf enum value: RULE_COMPUTE_FORMAT_OS = 2; */ RULE_COMPUTE_FORMAT_OS = 2, /** + * jq filter expression. + * * @generated from protobuf enum value: RULE_COMPUTE_FORMAT_JQ = 3; */ RULE_COMPUTE_FORMAT_JQ = 3 @@ -646,7 +680,8 @@ class RuleComputeResult$Type extends MessageType { super("api.RuleComputeResult", [ { no: 1, name: "Format", kind: "enum", localName: "Format", jsonName: "Format", T: () => ["api.RuleComputeFormat", RuleComputeFormat] }, { no: 2, name: "Value", kind: "scalar", localName: "Value", jsonName: "Value", T: 9 /*ScalarType.STRING*/ }, - { no: 3, name: "RuleID", kind: "scalar", localName: "RuleID", jsonName: "RuleID", T: 9 /*ScalarType.STRING*/ } + { no: 3, name: "RuleID", kind: "scalar", localName: "RuleID", jsonName: "RuleID", T: 9 /*ScalarType.STRING*/ }, + { no: 4, name: "Attributes", kind: "scalar", localName: "Attributes", jsonName: "Attributes", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/ } ]); } create(value?: PartialMessage): RuleComputeResult { @@ -654,6 +689,7 @@ class RuleComputeResult$Type extends MessageType { message.Format = 0; message.Value = ""; message.RuleID = ""; + message.Attributes = []; if (value !== undefined) reflectionMergePartial(this, message, value); return message; @@ -672,6 +708,9 @@ class RuleComputeResult$Type extends MessageType { case /* string RuleID */ 3: message.RuleID = reader.string(); break; + case /* repeated string Attributes */ 4: + message.Attributes.push(reader.string()); + break; default: let u = options.readUnknownField; if (u === "throw") @@ -693,6 +732,9 @@ class RuleComputeResult$Type extends MessageType { /* string RuleID = 3; */ if (message.RuleID !== "") writer.tag(3, WireType.LengthDelimited).string(message.RuleID); + /* repeated string Attributes = 4; */ + for (let i = 0; i < message.Attributes.length; i++) + writer.tag(4, WireType.LengthDelimited).string(message.Attributes[i]); let u = options.writeUnknownFields; if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); @@ -710,7 +752,8 @@ class RestrictionRule$Type extends MessageType { { no: 1, name: "Name", kind: "scalar", localName: "Name", jsonName: "Name", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { minLen: "1" } } } }, { no: 2, name: "Entity", kind: "enum", localName: "Entity", jsonName: "Entity", T: () => ["api.EntityType", EntityType], options: { "validate.rules": { enum: { definedOnly: true } } } }, { no: 3, name: "Description", kind: "scalar", localName: "Description", jsonName: "Description", T: 9 /*ScalarType.STRING*/ }, - { no: 4, name: "Definition", kind: "scalar", localName: "Definition", jsonName: "Definition", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { minLen: "1" } } } } + { no: 4, name: "Definition", kind: "scalar", localName: "Definition", jsonName: "Definition", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { minLen: "1" } } } }, + { no: 5, name: "Attributes", kind: "scalar", localName: "Attributes", jsonName: "Attributes", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/ } ], { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema": { jsonSchema: { required: ["Name", "Entity", "Definition"] } } }); } create(value?: PartialMessage): RestrictionRule { @@ -719,6 +762,7 @@ class RestrictionRule$Type extends MessageType { message.Entity = 0; message.Description = ""; message.Definition = ""; + message.Attributes = []; if (value !== undefined) reflectionMergePartial(this, message, value); return message; @@ -740,6 +784,9 @@ class RestrictionRule$Type extends MessageType { case /* string Definition */ 4: message.Definition = reader.string(); break; + case /* repeated string Attributes */ 5: + message.Attributes.push(reader.string()); + break; default: let u = options.readUnknownField; if (u === "throw") @@ -764,6 +811,9 @@ class RestrictionRule$Type extends MessageType { /* string Definition = 4; */ if (message.Definition !== "") writer.tag(4, WireType.LengthDelimited).string(message.Definition); + /* repeated string Attributes = 5; */ + for (let i = 0; i < message.Attributes.length; i++) + writer.tag(5, WireType.LengthDelimited).string(message.Attributes[i]); let u = options.writeUnknownFields; if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); diff --git a/rules.ts b/rules.ts index 7739df3..00cd208 100644 --- a/rules.ts +++ b/rules.ts @@ -15,45 +15,51 @@ import { EntityType } from "./shared"; // ========== MODEL MESSAGES ========== /** + * Rule represents a named business rule applied to a specific entity type within an organisation. + * * @generated from protobuf message api.Rule */ export interface Rule { /** * @generated from protobuf field: string ID = 1 */ - ID: string; + ID: string; // Unique identifier of the rule. /** * @generated from protobuf field: string OrganisationID = 2 */ - OrganisationID: string; + OrganisationID: string; // Identifier of the organisation the rule belongs to. /** * @generated from protobuf field: api.EntityType Entity = 3 */ - Entity: EntityType; + Entity: EntityType; // Entity type the rule applies to (e.g. ORDER, ACTOR). /** * @generated from protobuf field: string Name = 4 */ - Name: string; + Name: string; // Human-readable name of the rule. /** * @generated from protobuf field: string Description = 5 */ - Description: string; + Description: string; // Optional description providing context for the rule. /** * @generated from protobuf field: string Definition = 6 */ - Definition: string; + Definition: string; // RPL (Reflex Platform Language) expression defining the rule logic. /** * @generated from protobuf field: api.RuleType RuleType = 7 */ - RuleType: RuleType; + RuleType: RuleType; // Category of the rule, determining how it is enforced. /** * @generated from protobuf field: string RuleTypeID = 8 */ - RuleTypeID: string; + RuleTypeID: string; // ID of the resource this rule is attached to. Its type depends on RuleType (e.g. a RestrictionID for RESTRICTION, a ProjectLifecycle task ID for PRUNE or ANONYMIZE). /** * @generated from protobuf field: bool Status = 9 */ - Status: boolean; + Status: boolean; // Whether the rule is currently active (true = enabled, false = disabled). + /** + * @generated from protobuf field: repeated string Attributes = 10 + */ + Attributes: string[]; // Contextual key:value pairs provided by the rule's consumer to scope evaluation (e.g. "ActorID:" used to compute a restriction rule for a given actor context). } // ========== REQUESTS & RESPONSE MESSAGES ========== @@ -95,6 +101,10 @@ export interface CreateRuleRequest { * @generated from protobuf field: string Issuer = 8 */ Issuer: string; // Who created the rule, will be used as the commit's author when pushed to git + /** + * @generated from protobuf field: repeated string Attributes = 9 + */ + Attributes: string[]; } /** * @generated from protobuf message api.CreateRuleResponse @@ -135,6 +145,10 @@ export interface UpdateRuleRequest { * @generated from protobuf field: string Issuer = 6 */ Issuer: string; // Who updated the rule, will be used as the commit's author when pushed to git + /** + * @generated from protobuf field: repeated string Attributes = 7 + */ + Attributes: string[]; } /** * @generated from protobuf message api.UpdateRuleResponse @@ -280,22 +294,32 @@ export interface GetJSONTreeResponse { JSONTree: string; } /** + * RuleType categorises rules by their enforcement behaviour within a project. + * * @generated from protobuf enum api.RuleType */ export enum RuleType { /** + * Default unset value. Should not be used explicitly. + * * @generated from protobuf enum value: RULE_TYPE_PROJECT_UNKNOWN = 0; */ RULE_TYPE_PROJECT_UNKNOWN = 0, /** + * Data-access restriction: filters which data a user or role can see. + * * @generated from protobuf enum value: RULE_TYPE_PROJECT_RESTRICTION = 1; */ RULE_TYPE_PROJECT_RESTRICTION = 1, /** + * Prune: removes or archives entities based on defined conditions. + * * @generated from protobuf enum value: RULE_TYPE_PROJECT_PRUNE = 2; */ RULE_TYPE_PROJECT_PRUNE = 2, /** + * Anonymize: masks or anonymizes entity data based on defined conditions. + * * @generated from protobuf enum value: RULE_TYPE_PROJECT_ANONYMIZE = 3; */ RULE_TYPE_PROJECT_ANONYMIZE = 3 @@ -312,7 +336,8 @@ class Rule$Type extends MessageType { { no: 6, name: "Definition", kind: "scalar", localName: "Definition", jsonName: "Definition", T: 9 /*ScalarType.STRING*/ }, { no: 7, name: "RuleType", kind: "enum", localName: "RuleType", jsonName: "RuleType", T: () => ["api.RuleType", RuleType] }, { no: 8, name: "RuleTypeID", kind: "scalar", localName: "RuleTypeID", jsonName: "RuleTypeID", T: 9 /*ScalarType.STRING*/ }, - { no: 9, name: "Status", kind: "scalar", localName: "Status", jsonName: "Status", T: 8 /*ScalarType.BOOL*/ } + { no: 9, name: "Status", kind: "scalar", localName: "Status", jsonName: "Status", T: 8 /*ScalarType.BOOL*/ }, + { no: 10, name: "Attributes", kind: "scalar", localName: "Attributes", jsonName: "Attributes", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/ } ]); } create(value?: PartialMessage): Rule { @@ -326,6 +351,7 @@ class Rule$Type extends MessageType { message.RuleType = 0; message.RuleTypeID = ""; message.Status = false; + message.Attributes = []; if (value !== undefined) reflectionMergePartial(this, message, value); return message; @@ -362,6 +388,9 @@ class Rule$Type extends MessageType { case /* bool Status */ 9: message.Status = reader.bool(); break; + case /* repeated string Attributes */ 10: + message.Attributes.push(reader.string()); + break; default: let u = options.readUnknownField; if (u === "throw") @@ -401,6 +430,9 @@ class Rule$Type extends MessageType { /* bool Status = 9; */ if (message.Status !== false) writer.tag(9, WireType.Varint).bool(message.Status); + /* repeated string Attributes = 10; */ + for (let i = 0; i < message.Attributes.length; i++) + writer.tag(10, WireType.LengthDelimited).string(message.Attributes[i]); let u = options.writeUnknownFields; if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); @@ -422,7 +454,8 @@ class CreateRuleRequest$Type extends MessageType { { no: 5, name: "RuleTypeID", kind: "scalar", localName: "RuleTypeID", jsonName: "RuleTypeID", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { minLen: "1" } } } }, { no: 6, name: "Description", kind: "scalar", localName: "Description", jsonName: "Description", T: 9 /*ScalarType.STRING*/ }, { no: 7, name: "Definition", kind: "scalar", localName: "Definition", jsonName: "Definition", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { minLen: "1" } } } }, - { no: 8, name: "Issuer", kind: "scalar", localName: "Issuer", jsonName: "Issuer", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { minLen: "1" } } } } + { no: 8, name: "Issuer", kind: "scalar", localName: "Issuer", jsonName: "Issuer", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { minLen: "1" } } } }, + { no: 9, name: "Attributes", kind: "scalar", localName: "Attributes", jsonName: "Attributes", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/ } ], { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema": { jsonSchema: { required: ["OrganisationID", "Entity", "Name", "RuleType", "RuleTypeID", "Definition", "Issuer"] } } }); } create(value?: PartialMessage): CreateRuleRequest { @@ -435,6 +468,7 @@ class CreateRuleRequest$Type extends MessageType { message.Description = ""; message.Definition = ""; message.Issuer = ""; + message.Attributes = []; if (value !== undefined) reflectionMergePartial(this, message, value); return message; @@ -468,6 +502,9 @@ class CreateRuleRequest$Type extends MessageType { case /* string Issuer */ 8: message.Issuer = reader.string(); break; + case /* repeated string Attributes */ 9: + message.Attributes.push(reader.string()); + break; default: let u = options.readUnknownField; if (u === "throw") @@ -504,6 +541,9 @@ class CreateRuleRequest$Type extends MessageType { /* string Issuer = 8; */ if (message.Issuer !== "") writer.tag(8, WireType.LengthDelimited).string(message.Issuer); + /* repeated string Attributes = 9; */ + for (let i = 0; i < message.Attributes.length; i++) + writer.tag(9, WireType.LengthDelimited).string(message.Attributes[i]); let u = options.writeUnknownFields; if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); @@ -569,7 +609,8 @@ class UpdateRuleRequest$Type extends MessageType { { no: 3, name: "Description", kind: "scalar", localName: "Description", jsonName: "Description", T: 9 /*ScalarType.STRING*/ }, { no: 4, name: "Definition", kind: "scalar", localName: "Definition", jsonName: "Definition", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { minLen: "1" } } } }, { no: 5, name: "Entity", kind: "enum", localName: "Entity", jsonName: "Entity", T: () => ["api.EntityType", EntityType], options: { "validate.rules": { enum: { definedOnly: true } } } }, - { no: 6, name: "Issuer", kind: "scalar", localName: "Issuer", jsonName: "Issuer", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { minLen: "1" } } } } + { no: 6, name: "Issuer", kind: "scalar", localName: "Issuer", jsonName: "Issuer", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { minLen: "1" } } } }, + { no: 7, name: "Attributes", kind: "scalar", localName: "Attributes", jsonName: "Attributes", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/ } ], { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema": { jsonSchema: { required: ["RuleID", "Name", "Definition", "Issuer", "Entity"] } } }); } create(value?: PartialMessage): UpdateRuleRequest { @@ -580,6 +621,7 @@ class UpdateRuleRequest$Type extends MessageType { message.Definition = ""; message.Entity = 0; message.Issuer = ""; + message.Attributes = []; if (value !== undefined) reflectionMergePartial(this, message, value); return message; @@ -607,6 +649,9 @@ class UpdateRuleRequest$Type extends MessageType { case /* string Issuer */ 6: message.Issuer = reader.string(); break; + case /* repeated string Attributes */ 7: + message.Attributes.push(reader.string()); + break; default: let u = options.readUnknownField; if (u === "throw") @@ -637,6 +682,9 @@ class UpdateRuleRequest$Type extends MessageType { /* string Issuer = 6; */ if (message.Issuer !== "") writer.tag(6, WireType.LengthDelimited).string(message.Issuer); + /* repeated string Attributes = 7; */ + for (let i = 0; i < message.Attributes.length; i++) + writer.tag(7, WireType.LengthDelimited).string(message.Attributes[i]); let u = options.writeUnknownFields; if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);