@cerbos/http
Advanced tools
Comparing version 0.11.0 to 0.12.0
@@ -200,4 +200,4 @@ "use strict"; | ||
function fromTimestamp(t) { | ||
let millis = Number(t.seconds) * 1000; | ||
millis += t.nanos / 1000000; | ||
let millis = (Number(t.seconds) || 0) * 1000; | ||
millis += (t.nanos || 0) / 1000000; | ||
return new Date(millis); | ||
@@ -204,0 +204,0 @@ } |
@@ -12,3 +12,3 @@ "use strict"; | ||
Effect[Effect["EFFECT_NO_MATCH"] = 3] = "EFFECT_NO_MATCH"; | ||
})(Effect = exports.Effect || (exports.Effect = {})); | ||
})(Effect || (exports.Effect = Effect = {})); | ||
function effectFromJSON(object) { | ||
@@ -15,0 +15,0 @@ switch (object) { |
@@ -77,2 +77,3 @@ import { Effect } from "../../effect/v1/effect"; | ||
validationErrors: ValidationError[]; | ||
outputs: OutputEntry[]; | ||
} | ||
@@ -88,2 +89,6 @@ export interface CheckOutput_ActionEffect { | ||
} | ||
export interface OutputEntry { | ||
src: string; | ||
val: any | undefined; | ||
} | ||
export interface Resource { | ||
@@ -168,2 +173,6 @@ kind: string; | ||
}; | ||
export declare const OutputEntry: { | ||
fromJSON(object: any): OutputEntry; | ||
toJSON(message: OutputEntry): unknown; | ||
}; | ||
export declare const Resource: { | ||
@@ -170,0 +179,0 @@ fromJSON(object: any): Resource; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.AuxData_JwtEntry = exports.AuxData = exports.Principal_AttrEntry = exports.Principal = exports.Resource_AttrEntry = exports.Resource = exports.CheckOutput_ActionsEntry = exports.CheckOutput_ActionEffect = exports.CheckOutput = exports.CheckInput = exports.PlanResourcesOutput = exports.PlanResourcesFilter_Expression_Operand = exports.PlanResourcesFilter_Expression = exports.PlanResourcesFilter = exports.PlanResourcesInput_Resource_AttrEntry = exports.PlanResourcesInput_Resource = exports.PlanResourcesInput = exports.planResourcesFilter_KindToJSON = exports.planResourcesFilter_KindFromJSON = exports.PlanResourcesFilter_Kind = exports.protobufPackage = void 0; | ||
exports.AuxData_JwtEntry = exports.AuxData = exports.Principal_AttrEntry = exports.Principal = exports.Resource_AttrEntry = exports.Resource = exports.OutputEntry = exports.CheckOutput_ActionsEntry = exports.CheckOutput_ActionEffect = exports.CheckOutput = exports.CheckInput = exports.PlanResourcesOutput = exports.PlanResourcesFilter_Expression_Operand = exports.PlanResourcesFilter_Expression = exports.PlanResourcesFilter = exports.PlanResourcesInput_Resource_AttrEntry = exports.PlanResourcesInput_Resource = exports.PlanResourcesInput = exports.planResourcesFilter_KindToJSON = exports.planResourcesFilter_KindFromJSON = exports.PlanResourcesFilter_Kind = exports.protobufPackage = void 0; | ||
/* eslint-disable */ | ||
@@ -14,3 +14,3 @@ const effect_1 = require("../../effect/v1/effect"); | ||
PlanResourcesFilter_Kind[PlanResourcesFilter_Kind["KIND_CONDITIONAL"] = 3] = "KIND_CONDITIONAL"; | ||
})(PlanResourcesFilter_Kind = exports.PlanResourcesFilter_Kind || (exports.PlanResourcesFilter_Kind = {})); | ||
})(PlanResourcesFilter_Kind || (exports.PlanResourcesFilter_Kind = PlanResourcesFilter_Kind = {})); | ||
function planResourcesFilter_KindFromJSON(object) { | ||
@@ -252,2 +252,3 @@ switch (object) { | ||
: [], | ||
outputs: Array.isArray(object?.outputs) ? object.outputs.map((e) => exports.OutputEntry.fromJSON(e)) : [], | ||
}; | ||
@@ -277,2 +278,8 @@ }, | ||
} | ||
if (message.outputs) { | ||
obj.outputs = message.outputs.map((e) => e ? exports.OutputEntry.toJSON(e) : undefined); | ||
} | ||
else { | ||
obj.outputs = []; | ||
} | ||
return obj; | ||
@@ -312,2 +319,13 @@ }, | ||
}; | ||
exports.OutputEntry = { | ||
fromJSON(object) { | ||
return { src: isSet(object.src) ? String(object.src) : "", val: isSet(object?.val) ? object.val : undefined }; | ||
}, | ||
toJSON(message) { | ||
const obj = {}; | ||
message.src !== undefined && (obj.src = message.src); | ||
message.val !== undefined && (obj.val = message.val); | ||
return obj; | ||
}, | ||
}; | ||
exports.Resource = { | ||
@@ -314,0 +332,0 @@ fromJSON(object) { |
@@ -55,2 +55,3 @@ import { Effect } from "../../effect/v1/effect"; | ||
name: string; | ||
output: Output | undefined; | ||
} | ||
@@ -72,2 +73,3 @@ export interface PrincipalPolicy { | ||
name: string; | ||
output: Output | undefined; | ||
} | ||
@@ -110,2 +112,5 @@ export interface DerivedRoles { | ||
} | ||
export interface Output { | ||
expr: string; | ||
} | ||
export interface Schemas { | ||
@@ -178,2 +183,6 @@ principalSchema: Schemas_Schema | undefined; | ||
}; | ||
export declare const Output: { | ||
fromJSON(object: any): Output; | ||
toJSON(message: Output): unknown; | ||
}; | ||
export declare const Schemas: { | ||
@@ -180,0 +189,0 @@ fromJSON(object: any): Schemas; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.Schemas_Schema = exports.Schemas_IgnoreWhen = exports.Schemas = exports.Match_ExprList = exports.Match = exports.Condition = exports.RoleDef = exports.DerivedRoles = exports.PrincipalRule_Action = exports.PrincipalRule = exports.PrincipalPolicy = exports.ResourceRule = exports.ResourcePolicy = exports.Metadata_AnnotationsEntry = exports.Metadata = exports.Policy_VariablesEntry = exports.Policy = exports.protobufPackage = void 0; | ||
exports.Schemas_Schema = exports.Schemas_IgnoreWhen = exports.Schemas = exports.Output = exports.Match_ExprList = exports.Match = exports.Condition = exports.RoleDef = exports.DerivedRoles = exports.PrincipalRule_Action = exports.PrincipalRule = exports.PrincipalPolicy = exports.ResourceRule = exports.ResourcePolicy = exports.Metadata_AnnotationsEntry = exports.Metadata = exports.Policy_VariablesEntry = exports.Policy = exports.protobufPackage = void 0; | ||
/* eslint-disable */ | ||
@@ -150,2 +150,3 @@ const effect_1 = require("../../effect/v1/effect"); | ||
name: isSet(object.name) ? String(object.name) : "", | ||
output: isSet(object.output) ? exports.Output.fromJSON(object.output) : undefined, | ||
}; | ||
@@ -177,2 +178,3 @@ }, | ||
message.name !== undefined && (obj.name = message.name); | ||
message.output !== undefined && (obj.output = message.output ? exports.Output.toJSON(message.output) : undefined); | ||
return obj; | ||
@@ -230,2 +232,3 @@ }, | ||
name: isSet(object.name) ? String(object.name) : "", | ||
output: isSet(object.output) ? exports.Output.fromJSON(object.output) : undefined, | ||
}; | ||
@@ -240,2 +243,3 @@ }, | ||
message.name !== undefined && (obj.name = message.name); | ||
message.output !== undefined && (obj.output = message.output ? exports.Output.toJSON(message.output) : undefined); | ||
return obj; | ||
@@ -341,2 +345,12 @@ }, | ||
}; | ||
exports.Output = { | ||
fromJSON(object) { | ||
return { expr: isSet(object.expr) ? String(object.expr) : "" }; | ||
}, | ||
toJSON(message) { | ||
const obj = {}; | ||
message.expr !== undefined && (obj.expr = message.expr); | ||
return obj; | ||
}, | ||
}; | ||
exports.Schemas = { | ||
@@ -343,0 +357,0 @@ fromJSON(object) { |
@@ -16,3 +16,3 @@ "use strict"; | ||
ListAuditLogEntriesRequest_Kind[ListAuditLogEntriesRequest_Kind["KIND_DECISION"] = 2] = "KIND_DECISION"; | ||
})(ListAuditLogEntriesRequest_Kind = exports.ListAuditLogEntriesRequest_Kind || (exports.ListAuditLogEntriesRequest_Kind = {})); | ||
})(ListAuditLogEntriesRequest_Kind || (exports.ListAuditLogEntriesRequest_Kind = ListAuditLogEntriesRequest_Kind = {})); | ||
function listAuditLogEntriesRequest_KindFromJSON(object) { | ||
@@ -492,4 +492,4 @@ switch (object) { | ||
function fromTimestamp(t) { | ||
let millis = Number(t.seconds) * 1000; | ||
millis += t.nanos / 1000000; | ||
let millis = (Number(t.seconds) || 0) * 1000; | ||
millis += (t.nanos || 0) / 1000000; | ||
return new Date(millis); | ||
@@ -496,0 +496,0 @@ } |
import { Empty } from "../../../google/protobuf/empty"; | ||
import { AccessLogEntry, DecisionLogEntry } from "../../audit/v1/audit"; | ||
import { Effect } from "../../effect/v1/effect"; | ||
import { PlanResourcesFilter } from "../../engine/v1/engine"; | ||
import { OutputEntry, PlanResourcesFilter } from "../../engine/v1/engine"; | ||
import { Policy } from "../../policy/v1/policy"; | ||
@@ -91,2 +91,3 @@ import { Schema, ValidationError } from "../../schema/v1/schema"; | ||
meta: CheckResourcesResponse_ResultEntry_Meta | undefined; | ||
outputs: OutputEntry[]; | ||
} | ||
@@ -93,0 +94,0 @@ export interface CheckResourcesResponse_ResultEntry_Resource { |
@@ -348,2 +348,5 @@ "use strict"; | ||
meta: isSet(object.meta) ? exports.CheckResourcesResponse_ResultEntry_Meta.fromJSON(object.meta) : undefined, | ||
outputs: Array.isArray(object?.outputs) | ||
? object.outputs.map((e) => engine_1.OutputEntry.fromJSON(e)) | ||
: [], | ||
}; | ||
@@ -370,2 +373,8 @@ }, | ||
(obj.meta = message.meta ? exports.CheckResourcesResponse_ResultEntry_Meta.toJSON(message.meta) : undefined); | ||
if (message.outputs) { | ||
obj.outputs = message.outputs.map((e) => e ? engine_1.OutputEntry.toJSON(e) : undefined); | ||
} | ||
else { | ||
obj.outputs = []; | ||
} | ||
return obj; | ||
@@ -372,0 +381,0 @@ }, |
@@ -11,3 +11,3 @@ "use strict"; | ||
ValidationError_Source[ValidationError_Source["SOURCE_RESOURCE"] = 2] = "SOURCE_RESOURCE"; | ||
})(ValidationError_Source = exports.ValidationError_Source || (exports.ValidationError_Source = {})); | ||
})(ValidationError_Source || (exports.ValidationError_Source = ValidationError_Source = {})); | ||
function validationError_SourceFromJSON(object) { | ||
@@ -14,0 +14,0 @@ switch (object) { |
@@ -16,3 +16,3 @@ "use strict"; | ||
FieldBehavior[FieldBehavior["NON_EMPTY_DEFAULT"] = 7] = "NON_EMPTY_DEFAULT"; | ||
})(FieldBehavior = exports.FieldBehavior || (exports.FieldBehavior = {})); | ||
})(FieldBehavior || (exports.FieldBehavior = FieldBehavior = {})); | ||
function fieldBehaviorFromJSON(object) { | ||
@@ -19,0 +19,0 @@ switch (object) { |
@@ -11,3 +11,3 @@ "use strict"; | ||
FileOptions_OptimizeMode[FileOptions_OptimizeMode["LITE_RUNTIME"] = 3] = "LITE_RUNTIME"; | ||
})(FileOptions_OptimizeMode = exports.FileOptions_OptimizeMode || (exports.FileOptions_OptimizeMode = {})); | ||
})(FileOptions_OptimizeMode || (exports.FileOptions_OptimizeMode = FileOptions_OptimizeMode = {})); | ||
function fileOptions_OptimizeModeFromJSON(object) { | ||
@@ -47,3 +47,3 @@ switch (object) { | ||
FieldOptions_CType[FieldOptions_CType["STRING_PIECE"] = 2] = "STRING_PIECE"; | ||
})(FieldOptions_CType = exports.FieldOptions_CType || (exports.FieldOptions_CType = {})); | ||
})(FieldOptions_CType || (exports.FieldOptions_CType = FieldOptions_CType = {})); | ||
function fieldOptions_CTypeFromJSON(object) { | ||
@@ -83,3 +83,3 @@ switch (object) { | ||
FieldOptions_JSType[FieldOptions_JSType["JS_NUMBER"] = 2] = "JS_NUMBER"; | ||
})(FieldOptions_JSType = exports.FieldOptions_JSType || (exports.FieldOptions_JSType = {})); | ||
})(FieldOptions_JSType || (exports.FieldOptions_JSType = FieldOptions_JSType = {})); | ||
function fieldOptions_JSTypeFromJSON(object) { | ||
@@ -119,3 +119,3 @@ switch (object) { | ||
FieldOptions_OptionRetention[FieldOptions_OptionRetention["RETENTION_SOURCE"] = 2] = "RETENTION_SOURCE"; | ||
})(FieldOptions_OptionRetention = exports.FieldOptions_OptionRetention || (exports.FieldOptions_OptionRetention = {})); | ||
})(FieldOptions_OptionRetention || (exports.FieldOptions_OptionRetention = FieldOptions_OptionRetention = {})); | ||
function fieldOptions_OptionRetentionFromJSON(object) { | ||
@@ -162,3 +162,3 @@ switch (object) { | ||
FieldOptions_OptionTargetType[FieldOptions_OptionTargetType["TARGET_TYPE_METHOD"] = 9] = "TARGET_TYPE_METHOD"; | ||
})(FieldOptions_OptionTargetType = exports.FieldOptions_OptionTargetType || (exports.FieldOptions_OptionTargetType = {})); | ||
})(FieldOptions_OptionTargetType || (exports.FieldOptions_OptionTargetType = FieldOptions_OptionTargetType = {})); | ||
function fieldOptions_OptionTargetTypeFromJSON(object) { | ||
@@ -233,3 +233,3 @@ switch (object) { | ||
MethodOptions_IdempotencyLevel[MethodOptions_IdempotencyLevel["IDEMPOTENT"] = 2] = "IDEMPOTENT"; | ||
})(MethodOptions_IdempotencyLevel = exports.MethodOptions_IdempotencyLevel || (exports.MethodOptions_IdempotencyLevel = {})); | ||
})(MethodOptions_IdempotencyLevel || (exports.MethodOptions_IdempotencyLevel = MethodOptions_IdempotencyLevel = {})); | ||
function methodOptions_IdempotencyLevelFromJSON(object) { | ||
@@ -236,0 +236,0 @@ switch (object) { |
@@ -9,3 +9,3 @@ "use strict"; | ||
NullValue[NullValue["NULL_VALUE"] = 0] = "NULL_VALUE"; | ||
})(NullValue = exports.NullValue || (exports.NullValue = {})); | ||
})(NullValue || (exports.NullValue = NullValue = {})); | ||
function nullValueFromJSON(object) { | ||
@@ -12,0 +12,0 @@ switch (object) { |
@@ -24,2 +24,3 @@ export declare const protobufPackage = "grpc.gateway.protoc_gen_openapiv2.options"; | ||
security: SecurityRequirement[]; | ||
tags: Tag[]; | ||
externalDocs: ExternalDocumentation | undefined; | ||
@@ -55,2 +56,3 @@ extensions: { | ||
}; | ||
parameters: Parameters | undefined; | ||
} | ||
@@ -65,2 +67,21 @@ export interface Operation_ResponsesEntry { | ||
} | ||
export interface Parameters { | ||
headers: HeaderParameter[]; | ||
} | ||
export interface HeaderParameter { | ||
name: string; | ||
description: string; | ||
type: HeaderParameter_Type; | ||
format: string; | ||
required: boolean; | ||
} | ||
export declare enum HeaderParameter_Type { | ||
UNKNOWN = 0, | ||
STRING = 1, | ||
NUMBER = 2, | ||
INTEGER = 3, | ||
BOOLEAN = 4 | ||
} | ||
export declare function headerParameter_TypeFromJSON(object: any): HeaderParameter_Type; | ||
export declare function headerParameter_TypeToJSON(object: HeaderParameter_Type): string; | ||
export interface Header { | ||
@@ -183,5 +204,13 @@ description: string; | ||
export interface Tag { | ||
name: string; | ||
description: string; | ||
externalDocs: ExternalDocumentation | undefined; | ||
extensions: { | ||
[key: string]: any | undefined; | ||
}; | ||
} | ||
export interface Tag_ExtensionsEntry { | ||
key: string; | ||
value: any | undefined; | ||
} | ||
export interface SecurityDefinitions { | ||
@@ -282,2 +311,10 @@ security: { | ||
}; | ||
export declare const Parameters: { | ||
fromJSON(object: any): Parameters; | ||
toJSON(message: Parameters): unknown; | ||
}; | ||
export declare const HeaderParameter: { | ||
fromJSON(object: any): HeaderParameter; | ||
toJSON(message: HeaderParameter): unknown; | ||
}; | ||
export declare const Header: { | ||
@@ -343,2 +380,6 @@ fromJSON(object: any): Header; | ||
}; | ||
export declare const Tag_ExtensionsEntry: { | ||
fromJSON(object: any): Tag_ExtensionsEntry; | ||
toJSON(message: Tag_ExtensionsEntry): unknown; | ||
}; | ||
export declare const SecurityDefinitions: { | ||
@@ -345,0 +386,0 @@ fromJSON(object: any): SecurityDefinitions; |
"use strict"; | ||
/* eslint-disable */ | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.Scopes_ScopeEntry = exports.Scopes = exports.SecurityRequirement_SecurityRequirementEntry = exports.SecurityRequirement_SecurityRequirementValue = exports.SecurityRequirement = exports.SecurityScheme_ExtensionsEntry = exports.SecurityScheme = exports.SecurityDefinitions_SecurityEntry = exports.SecurityDefinitions = exports.Tag = exports.JSONSchema_ExtensionsEntry = exports.JSONSchema_FieldConfiguration = exports.JSONSchema = exports.Schema = exports.ExternalDocumentation = exports.License = exports.Contact = exports.Info_ExtensionsEntry = exports.Info = exports.Response_ExtensionsEntry = exports.Response_ExamplesEntry = exports.Response_HeadersEntry = exports.Response = exports.Header = exports.Operation_ExtensionsEntry = exports.Operation_ResponsesEntry = exports.Operation = exports.Swagger_ExtensionsEntry = exports.Swagger_ResponsesEntry = exports.Swagger = exports.securityScheme_FlowToJSON = exports.securityScheme_FlowFromJSON = exports.SecurityScheme_Flow = exports.securityScheme_InToJSON = exports.securityScheme_InFromJSON = exports.SecurityScheme_In = exports.securityScheme_TypeToJSON = exports.securityScheme_TypeFromJSON = exports.SecurityScheme_Type = exports.jSONSchema_JSONSchemaSimpleTypesToJSON = exports.jSONSchema_JSONSchemaSimpleTypesFromJSON = exports.JSONSchema_JSONSchemaSimpleTypes = exports.schemeToJSON = exports.schemeFromJSON = exports.Scheme = exports.protobufPackage = void 0; | ||
exports.SecurityRequirement_SecurityRequirementEntry = exports.SecurityRequirement_SecurityRequirementValue = exports.SecurityRequirement = exports.SecurityScheme_ExtensionsEntry = exports.SecurityScheme = exports.SecurityDefinitions_SecurityEntry = exports.SecurityDefinitions = exports.Tag_ExtensionsEntry = exports.Tag = exports.JSONSchema_ExtensionsEntry = exports.JSONSchema_FieldConfiguration = exports.JSONSchema = exports.Schema = exports.ExternalDocumentation = exports.License = exports.Contact = exports.Info_ExtensionsEntry = exports.Info = exports.Response_ExtensionsEntry = exports.Response_ExamplesEntry = exports.Response_HeadersEntry = exports.Response = exports.Header = exports.HeaderParameter = exports.Parameters = exports.Operation_ExtensionsEntry = exports.Operation_ResponsesEntry = exports.Operation = exports.Swagger_ExtensionsEntry = exports.Swagger_ResponsesEntry = exports.Swagger = exports.securityScheme_FlowToJSON = exports.securityScheme_FlowFromJSON = exports.SecurityScheme_Flow = exports.securityScheme_InToJSON = exports.securityScheme_InFromJSON = exports.SecurityScheme_In = exports.securityScheme_TypeToJSON = exports.securityScheme_TypeFromJSON = exports.SecurityScheme_Type = exports.jSONSchema_JSONSchemaSimpleTypesToJSON = exports.jSONSchema_JSONSchemaSimpleTypesFromJSON = exports.JSONSchema_JSONSchemaSimpleTypes = exports.headerParameter_TypeToJSON = exports.headerParameter_TypeFromJSON = exports.HeaderParameter_Type = exports.schemeToJSON = exports.schemeFromJSON = exports.Scheme = exports.protobufPackage = void 0; | ||
exports.Scopes_ScopeEntry = exports.Scopes = void 0; | ||
exports.protobufPackage = "grpc.gateway.protoc_gen_openapiv2.options"; | ||
@@ -13,3 +14,3 @@ var Scheme; | ||
Scheme[Scheme["WSS"] = 4] = "WSS"; | ||
})(Scheme = exports.Scheme || (exports.Scheme = {})); | ||
})(Scheme || (exports.Scheme = Scheme = {})); | ||
function schemeFromJSON(object) { | ||
@@ -54,2 +55,49 @@ switch (object) { | ||
exports.schemeToJSON = schemeToJSON; | ||
var HeaderParameter_Type; | ||
(function (HeaderParameter_Type) { | ||
HeaderParameter_Type[HeaderParameter_Type["UNKNOWN"] = 0] = "UNKNOWN"; | ||
HeaderParameter_Type[HeaderParameter_Type["STRING"] = 1] = "STRING"; | ||
HeaderParameter_Type[HeaderParameter_Type["NUMBER"] = 2] = "NUMBER"; | ||
HeaderParameter_Type[HeaderParameter_Type["INTEGER"] = 3] = "INTEGER"; | ||
HeaderParameter_Type[HeaderParameter_Type["BOOLEAN"] = 4] = "BOOLEAN"; | ||
})(HeaderParameter_Type || (exports.HeaderParameter_Type = HeaderParameter_Type = {})); | ||
function headerParameter_TypeFromJSON(object) { | ||
switch (object) { | ||
case 0: | ||
case "UNKNOWN": | ||
return HeaderParameter_Type.UNKNOWN; | ||
case 1: | ||
case "STRING": | ||
return HeaderParameter_Type.STRING; | ||
case 2: | ||
case "NUMBER": | ||
return HeaderParameter_Type.NUMBER; | ||
case 3: | ||
case "INTEGER": | ||
return HeaderParameter_Type.INTEGER; | ||
case 4: | ||
case "BOOLEAN": | ||
return HeaderParameter_Type.BOOLEAN; | ||
default: | ||
throw new tsProtoGlobalThis.Error("Unrecognized enum value " + object + " for enum HeaderParameter_Type"); | ||
} | ||
} | ||
exports.headerParameter_TypeFromJSON = headerParameter_TypeFromJSON; | ||
function headerParameter_TypeToJSON(object) { | ||
switch (object) { | ||
case HeaderParameter_Type.UNKNOWN: | ||
return "UNKNOWN"; | ||
case HeaderParameter_Type.STRING: | ||
return "STRING"; | ||
case HeaderParameter_Type.NUMBER: | ||
return "NUMBER"; | ||
case HeaderParameter_Type.INTEGER: | ||
return "INTEGER"; | ||
case HeaderParameter_Type.BOOLEAN: | ||
return "BOOLEAN"; | ||
default: | ||
throw new tsProtoGlobalThis.Error("Unrecognized enum value " + object + " for enum HeaderParameter_Type"); | ||
} | ||
} | ||
exports.headerParameter_TypeToJSON = headerParameter_TypeToJSON; | ||
var JSONSchema_JSONSchemaSimpleTypes; | ||
@@ -65,3 +113,3 @@ (function (JSONSchema_JSONSchemaSimpleTypes) { | ||
JSONSchema_JSONSchemaSimpleTypes[JSONSchema_JSONSchemaSimpleTypes["STRING"] = 7] = "STRING"; | ||
})(JSONSchema_JSONSchemaSimpleTypes = exports.JSONSchema_JSONSchemaSimpleTypes || (exports.JSONSchema_JSONSchemaSimpleTypes = {})); | ||
})(JSONSchema_JSONSchemaSimpleTypes || (exports.JSONSchema_JSONSchemaSimpleTypes = JSONSchema_JSONSchemaSimpleTypes = {})); | ||
function jSONSchema_JSONSchemaSimpleTypesFromJSON(object) { | ||
@@ -127,3 +175,3 @@ switch (object) { | ||
SecurityScheme_Type[SecurityScheme_Type["TYPE_OAUTH2"] = 3] = "TYPE_OAUTH2"; | ||
})(SecurityScheme_Type = exports.SecurityScheme_Type || (exports.SecurityScheme_Type = {})); | ||
})(SecurityScheme_Type || (exports.SecurityScheme_Type = SecurityScheme_Type = {})); | ||
function securityScheme_TypeFromJSON(object) { | ||
@@ -168,3 +216,3 @@ switch (object) { | ||
SecurityScheme_In[SecurityScheme_In["IN_HEADER"] = 2] = "IN_HEADER"; | ||
})(SecurityScheme_In = exports.SecurityScheme_In || (exports.SecurityScheme_In = {})); | ||
})(SecurityScheme_In || (exports.SecurityScheme_In = SecurityScheme_In = {})); | ||
function securityScheme_InFromJSON(object) { | ||
@@ -206,3 +254,3 @@ switch (object) { | ||
SecurityScheme_Flow[SecurityScheme_Flow["FLOW_ACCESS_CODE"] = 4] = "FLOW_ACCESS_CODE"; | ||
})(SecurityScheme_Flow = exports.SecurityScheme_Flow || (exports.SecurityScheme_Flow = {})); | ||
})(SecurityScheme_Flow || (exports.SecurityScheme_Flow = SecurityScheme_Flow = {})); | ||
function securityScheme_FlowFromJSON(object) { | ||
@@ -269,2 +317,5 @@ switch (object) { | ||
: [], | ||
tags: Array.isArray(object?.tags) | ||
? object.tags.map((e) => exports.Tag.fromJSON(e)) | ||
: [], | ||
externalDocs: isSet(object.externalDocs) ? exports.ExternalDocumentation.fromJSON(object.externalDocs) : undefined, | ||
@@ -318,2 +369,8 @@ extensions: isObject(object.extensions) | ||
} | ||
if (message.tags) { | ||
obj.tags = message.tags.map((e) => e ? exports.Tag.toJSON(e) : undefined); | ||
} | ||
else { | ||
obj.tags = []; | ||
} | ||
message.externalDocs !== undefined && | ||
@@ -382,2 +439,3 @@ (obj.externalDocs = message.externalDocs ? exports.ExternalDocumentation.toJSON(message.externalDocs) : undefined); | ||
: {}, | ||
parameters: isSet(object.parameters) ? exports.Parameters.fromJSON(object.parameters) : undefined, | ||
}; | ||
@@ -435,2 +493,4 @@ }, | ||
} | ||
message.parameters !== undefined && | ||
(obj.parameters = message.parameters ? exports.Parameters.toJSON(message.parameters) : undefined); | ||
return obj; | ||
@@ -464,2 +524,39 @@ }, | ||
}; | ||
exports.Parameters = { | ||
fromJSON(object) { | ||
return { | ||
headers: Array.isArray(object?.headers) ? object.headers.map((e) => exports.HeaderParameter.fromJSON(e)) : [], | ||
}; | ||
}, | ||
toJSON(message) { | ||
const obj = {}; | ||
if (message.headers) { | ||
obj.headers = message.headers.map((e) => e ? exports.HeaderParameter.toJSON(e) : undefined); | ||
} | ||
else { | ||
obj.headers = []; | ||
} | ||
return obj; | ||
}, | ||
}; | ||
exports.HeaderParameter = { | ||
fromJSON(object) { | ||
return { | ||
name: isSet(object.name) ? String(object.name) : "", | ||
description: isSet(object.description) ? String(object.description) : "", | ||
type: isSet(object.type) ? headerParameter_TypeFromJSON(object.type) : 0, | ||
format: isSet(object.format) ? String(object.format) : "", | ||
required: isSet(object.required) ? Boolean(object.required) : false, | ||
}; | ||
}, | ||
toJSON(message) { | ||
const obj = {}; | ||
message.name !== undefined && (obj.name = message.name); | ||
message.description !== undefined && (obj.description = message.description); | ||
message.type !== undefined && (obj.type = headerParameter_TypeToJSON(message.type)); | ||
message.format !== undefined && (obj.format = message.format); | ||
message.required !== undefined && (obj.required = message.required); | ||
return obj; | ||
}, | ||
}; | ||
exports.Header = { | ||
@@ -801,4 +898,11 @@ fromJSON(object) { | ||
return { | ||
name: isSet(object.name) ? String(object.name) : "", | ||
description: isSet(object.description) ? String(object.description) : "", | ||
externalDocs: isSet(object.externalDocs) ? exports.ExternalDocumentation.fromJSON(object.externalDocs) : undefined, | ||
extensions: isObject(object.extensions) | ||
? Object.entries(object.extensions).reduce((acc, [key, value]) => { | ||
acc[key] = value; | ||
return acc; | ||
}, {}) | ||
: {}, | ||
}; | ||
@@ -808,8 +912,26 @@ }, | ||
const obj = {}; | ||
message.name !== undefined && (obj.name = message.name); | ||
message.description !== undefined && (obj.description = message.description); | ||
message.externalDocs !== undefined && | ||
(obj.externalDocs = message.externalDocs ? exports.ExternalDocumentation.toJSON(message.externalDocs) : undefined); | ||
obj.extensions = {}; | ||
if (message.extensions) { | ||
Object.entries(message.extensions).forEach(([k, v]) => { | ||
obj.extensions[k] = v; | ||
}); | ||
} | ||
return obj; | ||
}, | ||
}; | ||
exports.Tag_ExtensionsEntry = { | ||
fromJSON(object) { | ||
return { key: isSet(object.key) ? String(object.key) : "", value: isSet(object?.value) ? object.value : undefined }; | ||
}, | ||
toJSON(message) { | ||
const obj = {}; | ||
message.key !== undefined && (obj.key = message.key); | ||
message.value !== undefined && (obj.value = message.value); | ||
return obj; | ||
}, | ||
}; | ||
exports.SecurityDefinitions = { | ||
@@ -816,0 +938,0 @@ fromJSON(object) { |
@@ -13,3 +13,3 @@ "use strict"; | ||
KnownRegex[KnownRegex["HTTP_HEADER_VALUE"] = 2] = "HTTP_HEADER_VALUE"; | ||
})(KnownRegex = exports.KnownRegex || (exports.KnownRegex = {})); | ||
})(KnownRegex || (exports.KnownRegex = KnownRegex = {})); | ||
function knownRegexFromJSON(object) { | ||
@@ -990,4 +990,4 @@ switch (object) { | ||
function fromTimestamp(t) { | ||
let millis = Number(t.seconds) * 1000; | ||
millis += t.nanos / 1000000; | ||
let millis = (Number(t.seconds) || 0) * 1000; | ||
millis += (t.nanos || 0) / 1000000; | ||
return new Date(millis); | ||
@@ -994,0 +994,0 @@ } |
{ | ||
"name": "@cerbos/http", | ||
"version": "0.11.0", | ||
"version": "0.12.0", | ||
"description": "Client library for interacting with the Cerbos policy decision point over HTTP from browser-based applications", | ||
@@ -17,3 +17,3 @@ "repository": { | ||
"engines": { | ||
"node": ">= 14" | ||
"node": ">= 16" | ||
}, | ||
@@ -30,5 +30,5 @@ "main": "./lib/index.js", | ||
"dependencies": { | ||
"@cerbos/core": "^0.10.0", | ||
"@cerbos/core": "^0.11.0", | ||
"abab": "^2.0.6", | ||
"qs": "^6.11.1" | ||
"qs": "^6.11.2" | ||
}, | ||
@@ -35,0 +35,0 @@ "devDependencies": { |
@@ -19,3 +19,3 @@ # @cerbos/http | ||
- Cerbos 0.16+ | ||
- Node.js 14+ | ||
- Node.js 16+ | ||
- `fetch` | ||
@@ -22,0 +22,0 @@ |
@@ -266,4 +266,4 @@ /* eslint-disable */ | ||
function fromTimestamp(t: Timestamp): Date { | ||
let millis = Number(t.seconds) * 1_000; | ||
millis += t.nanos / 1_000_000; | ||
let millis = (Number(t.seconds) || 0) * 1_000; | ||
millis += (t.nanos || 0) / 1_000_000; | ||
return new Date(millis); | ||
@@ -270,0 +270,0 @@ } |
@@ -111,2 +111,3 @@ /* eslint-disable */ | ||
validationErrors: ValidationError[]; | ||
outputs: OutputEntry[]; | ||
} | ||
@@ -125,2 +126,7 @@ | ||
export interface OutputEntry { | ||
src: string; | ||
val: any | undefined; | ||
} | ||
export interface Resource { | ||
@@ -376,2 +382,3 @@ kind: string; | ||
: [], | ||
outputs: Array.isArray(object?.outputs) ? object.outputs.map((e: any) => OutputEntry.fromJSON(e)) : [], | ||
}; | ||
@@ -400,2 +407,7 @@ }, | ||
} | ||
if (message.outputs) { | ||
obj.outputs = message.outputs.map((e) => e ? OutputEntry.toJSON(e) : undefined); | ||
} else { | ||
obj.outputs = []; | ||
} | ||
return obj; | ||
@@ -440,2 +452,15 @@ }, | ||
export const OutputEntry = { | ||
fromJSON(object: any): OutputEntry { | ||
return { src: isSet(object.src) ? String(object.src) : "", val: isSet(object?.val) ? object.val : undefined }; | ||
}, | ||
toJSON(message: OutputEntry): unknown { | ||
const obj: any = {}; | ||
message.src !== undefined && (obj.src = message.src); | ||
message.val !== undefined && (obj.val = message.val); | ||
return obj; | ||
}, | ||
}; | ||
export const Resource = { | ||
@@ -442,0 +467,0 @@ fromJSON(object: any): Resource { |
@@ -55,2 +55,3 @@ /* eslint-disable */ | ||
name: string; | ||
output: Output | undefined; | ||
} | ||
@@ -75,2 +76,3 @@ | ||
name: string; | ||
output: Output | undefined; | ||
} | ||
@@ -104,2 +106,6 @@ | ||
export interface Output { | ||
expr: string; | ||
} | ||
export interface Schemas { | ||
@@ -270,2 +276,3 @@ principalSchema: Schemas_Schema | undefined; | ||
name: isSet(object.name) ? String(object.name) : "", | ||
output: isSet(object.output) ? Output.fromJSON(object.output) : undefined, | ||
}; | ||
@@ -295,2 +302,3 @@ }, | ||
message.name !== undefined && (obj.name = message.name); | ||
message.output !== undefined && (obj.output = message.output ? Output.toJSON(message.output) : undefined); | ||
return obj; | ||
@@ -351,2 +359,3 @@ }, | ||
name: isSet(object.name) ? String(object.name) : "", | ||
output: isSet(object.output) ? Output.fromJSON(object.output) : undefined, | ||
}; | ||
@@ -362,2 +371,3 @@ }, | ||
message.name !== undefined && (obj.name = message.name); | ||
message.output !== undefined && (obj.output = message.output ? Output.toJSON(message.output) : undefined); | ||
return obj; | ||
@@ -471,2 +481,14 @@ }, | ||
export const Output = { | ||
fromJSON(object: any): Output { | ||
return { expr: isSet(object.expr) ? String(object.expr) : "" }; | ||
}, | ||
toJSON(message: Output): unknown { | ||
const obj: any = {}; | ||
message.expr !== undefined && (obj.expr = message.expr); | ||
return obj; | ||
}, | ||
}; | ||
export const Schemas = { | ||
@@ -473,0 +495,0 @@ fromJSON(object: any): Schemas { |
@@ -664,4 +664,4 @@ /* eslint-disable */ | ||
function fromTimestamp(t: Timestamp): Date { | ||
let millis = Number(t.seconds) * 1_000; | ||
millis += t.nanos / 1_000_000; | ||
let millis = (Number(t.seconds) || 0) * 1_000; | ||
millis += (t.nanos || 0) / 1_000_000; | ||
return new Date(millis); | ||
@@ -668,0 +668,0 @@ } |
@@ -5,3 +5,3 @@ /* eslint-disable */ | ||
import { Effect, effectFromJSON, effectToJSON } from "../../effect/v1/effect"; | ||
import { PlanResourcesFilter } from "../../engine/v1/engine"; | ||
import { OutputEntry, PlanResourcesFilter } from "../../engine/v1/engine"; | ||
import { Policy } from "../../policy/v1/policy"; | ||
@@ -98,2 +98,3 @@ import { Schema, ValidationError } from "../../schema/v1/schema"; | ||
meta: CheckResourcesResponse_ResultEntry_Meta | undefined; | ||
outputs: OutputEntry[]; | ||
} | ||
@@ -548,2 +549,5 @@ | ||
meta: isSet(object.meta) ? CheckResourcesResponse_ResultEntry_Meta.fromJSON(object.meta) : undefined, | ||
outputs: Array.isArray(object?.outputs) | ||
? object.outputs.map((e: any) => OutputEntry.fromJSON(e)) | ||
: [], | ||
}; | ||
@@ -570,2 +574,7 @@ }, | ||
(obj.meta = message.meta ? CheckResourcesResponse_ResultEntry_Meta.toJSON(message.meta) : undefined); | ||
if (message.outputs) { | ||
obj.outputs = message.outputs.map((e) => e ? OutputEntry.toJSON(e) : undefined); | ||
} else { | ||
obj.outputs = []; | ||
} | ||
return obj; | ||
@@ -572,0 +581,0 @@ }, |
@@ -63,2 +63,3 @@ /* eslint-disable */ | ||
security: SecurityRequirement[]; | ||
tags: Tag[]; | ||
externalDocs: ExternalDocumentation | undefined; | ||
@@ -91,2 +92,3 @@ extensions: { [key: string]: any | undefined }; | ||
extensions: { [key: string]: any | undefined }; | ||
parameters: Parameters | undefined; | ||
} | ||
@@ -104,2 +106,61 @@ | ||
export interface Parameters { | ||
headers: HeaderParameter[]; | ||
} | ||
export interface HeaderParameter { | ||
name: string; | ||
description: string; | ||
type: HeaderParameter_Type; | ||
format: string; | ||
required: boolean; | ||
} | ||
export enum HeaderParameter_Type { | ||
UNKNOWN = 0, | ||
STRING = 1, | ||
NUMBER = 2, | ||
INTEGER = 3, | ||
BOOLEAN = 4, | ||
} | ||
export function headerParameter_TypeFromJSON(object: any): HeaderParameter_Type { | ||
switch (object) { | ||
case 0: | ||
case "UNKNOWN": | ||
return HeaderParameter_Type.UNKNOWN; | ||
case 1: | ||
case "STRING": | ||
return HeaderParameter_Type.STRING; | ||
case 2: | ||
case "NUMBER": | ||
return HeaderParameter_Type.NUMBER; | ||
case 3: | ||
case "INTEGER": | ||
return HeaderParameter_Type.INTEGER; | ||
case 4: | ||
case "BOOLEAN": | ||
return HeaderParameter_Type.BOOLEAN; | ||
default: | ||
throw new tsProtoGlobalThis.Error("Unrecognized enum value " + object + " for enum HeaderParameter_Type"); | ||
} | ||
} | ||
export function headerParameter_TypeToJSON(object: HeaderParameter_Type): string { | ||
switch (object) { | ||
case HeaderParameter_Type.UNKNOWN: | ||
return "UNKNOWN"; | ||
case HeaderParameter_Type.STRING: | ||
return "STRING"; | ||
case HeaderParameter_Type.NUMBER: | ||
return "NUMBER"; | ||
case HeaderParameter_Type.INTEGER: | ||
return "INTEGER"; | ||
case HeaderParameter_Type.BOOLEAN: | ||
return "BOOLEAN"; | ||
default: | ||
throw new tsProtoGlobalThis.Error("Unrecognized enum value " + object + " for enum HeaderParameter_Type"); | ||
} | ||
} | ||
export interface Header { | ||
@@ -283,6 +344,13 @@ description: string; | ||
export interface Tag { | ||
name: string; | ||
description: string; | ||
externalDocs: ExternalDocumentation | undefined; | ||
extensions: { [key: string]: any | undefined }; | ||
} | ||
export interface Tag_ExtensionsEntry { | ||
key: string; | ||
value: any | undefined; | ||
} | ||
export interface SecurityDefinitions { | ||
@@ -481,2 +549,5 @@ security: { [key: string]: SecurityScheme }; | ||
: [], | ||
tags: Array.isArray(object?.tags) | ||
? object.tags.map((e: any) => Tag.fromJSON(e)) | ||
: [], | ||
externalDocs: isSet(object.externalDocs) ? ExternalDocumentation.fromJSON(object.externalDocs) : undefined, | ||
@@ -527,2 +598,7 @@ extensions: isObject(object.extensions) | ||
} | ||
if (message.tags) { | ||
obj.tags = message.tags.map((e) => e ? Tag.toJSON(e) : undefined); | ||
} else { | ||
obj.tags = []; | ||
} | ||
message.externalDocs !== undefined && | ||
@@ -596,2 +672,3 @@ (obj.externalDocs = message.externalDocs ? ExternalDocumentation.toJSON(message.externalDocs) : undefined); | ||
: {}, | ||
parameters: isSet(object.parameters) ? Parameters.fromJSON(object.parameters) : undefined, | ||
}; | ||
@@ -645,2 +722,4 @@ }, | ||
} | ||
message.parameters !== undefined && | ||
(obj.parameters = message.parameters ? Parameters.toJSON(message.parameters) : undefined); | ||
return obj; | ||
@@ -679,2 +758,42 @@ }, | ||
export const Parameters = { | ||
fromJSON(object: any): Parameters { | ||
return { | ||
headers: Array.isArray(object?.headers) ? object.headers.map((e: any) => HeaderParameter.fromJSON(e)) : [], | ||
}; | ||
}, | ||
toJSON(message: Parameters): unknown { | ||
const obj: any = {}; | ||
if (message.headers) { | ||
obj.headers = message.headers.map((e) => e ? HeaderParameter.toJSON(e) : undefined); | ||
} else { | ||
obj.headers = []; | ||
} | ||
return obj; | ||
}, | ||
}; | ||
export const HeaderParameter = { | ||
fromJSON(object: any): HeaderParameter { | ||
return { | ||
name: isSet(object.name) ? String(object.name) : "", | ||
description: isSet(object.description) ? String(object.description) : "", | ||
type: isSet(object.type) ? headerParameter_TypeFromJSON(object.type) : 0, | ||
format: isSet(object.format) ? String(object.format) : "", | ||
required: isSet(object.required) ? Boolean(object.required) : false, | ||
}; | ||
}, | ||
toJSON(message: HeaderParameter): unknown { | ||
const obj: any = {}; | ||
message.name !== undefined && (obj.name = message.name); | ||
message.description !== undefined && (obj.description = message.description); | ||
message.type !== undefined && (obj.type = headerParameter_TypeToJSON(message.type)); | ||
message.format !== undefined && (obj.format = message.format); | ||
message.required !== undefined && (obj.required = message.required); | ||
return obj; | ||
}, | ||
}; | ||
export const Header = { | ||
@@ -1040,4 +1159,11 @@ fromJSON(object: any): Header { | ||
return { | ||
name: isSet(object.name) ? String(object.name) : "", | ||
description: isSet(object.description) ? String(object.description) : "", | ||
externalDocs: isSet(object.externalDocs) ? ExternalDocumentation.fromJSON(object.externalDocs) : undefined, | ||
extensions: isObject(object.extensions) | ||
? Object.entries(object.extensions).reduce<{ [key: string]: any | undefined }>((acc, [key, value]) => { | ||
acc[key] = value as any | undefined; | ||
return acc; | ||
}, {}) | ||
: {}, | ||
}; | ||
@@ -1048,5 +1174,12 @@ }, | ||
const obj: any = {}; | ||
message.name !== undefined && (obj.name = message.name); | ||
message.description !== undefined && (obj.description = message.description); | ||
message.externalDocs !== undefined && | ||
(obj.externalDocs = message.externalDocs ? ExternalDocumentation.toJSON(message.externalDocs) : undefined); | ||
obj.extensions = {}; | ||
if (message.extensions) { | ||
Object.entries(message.extensions).forEach(([k, v]) => { | ||
obj.extensions[k] = v; | ||
}); | ||
} | ||
return obj; | ||
@@ -1056,2 +1189,15 @@ }, | ||
export const Tag_ExtensionsEntry = { | ||
fromJSON(object: any): Tag_ExtensionsEntry { | ||
return { key: isSet(object.key) ? String(object.key) : "", value: isSet(object?.value) ? object.value : undefined }; | ||
}, | ||
toJSON(message: Tag_ExtensionsEntry): unknown { | ||
const obj: any = {}; | ||
message.key !== undefined && (obj.key = message.key); | ||
message.value !== undefined && (obj.value = message.value); | ||
return obj; | ||
}, | ||
}; | ||
export const SecurityDefinitions = { | ||
@@ -1058,0 +1204,0 @@ fromJSON(object: any): SecurityDefinitions { |
@@ -1269,4 +1269,4 @@ /* eslint-disable */ | ||
function fromTimestamp(t: Timestamp): Date { | ||
let millis = Number(t.seconds) * 1_000; | ||
millis += t.nanos / 1_000_000; | ||
let millis = (Number(t.seconds) || 0) * 1_000; | ||
millis += (t.nanos || 0) / 1_000_000; | ||
return new Date(millis); | ||
@@ -1273,0 +1273,0 @@ } |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
868024
14627
+ Added@cerbos/core@0.11.0(transitive)
- Removed@cerbos/core@0.10.0(transitive)
Updated@cerbos/core@^0.11.0
Updatedqs@^6.11.2