@cerbos/grpc
Advanced tools
Comparing version 0.16.0 to 0.17.0
@@ -9,4 +9,4 @@ "use strict"; | ||
exports.GRPC = void 0; | ||
const grpc_js_1 = require("@grpc/grpc-js"); | ||
const core_1 = require("@cerbos/core"); | ||
const grpc_js_1 = require("@grpc/grpc-js"); | ||
const svc_1 = require("./protobuf/cerbos/svc/v1/svc"); | ||
@@ -60,3 +60,3 @@ // eslint-disable-next-line @typescript-eslint/no-var-requires -- Can't import package.json because it is outside of the project's rootDir | ||
}); | ||
super(async (service, rpc, request, headers) => { | ||
super(async (service, rpc, request, headers, abortHandler) => { | ||
const { path, requestSerialize, responseDeserialize } = services[service][rpc]; // https://github.com/microsoft/TypeScript/issues/30581 | ||
@@ -69,3 +69,4 @@ const callOptions = {}; | ||
return await new Promise((resolve, reject) => { | ||
client.makeUnaryRequest(path, requestSerialize, responseDeserialize, request, metadata, callOptions, (error, response) => { | ||
abortHandler.throwIfAborted(); | ||
const call = client.makeUnaryRequest(path, requestSerialize, responseDeserialize, request, metadata, callOptions, (error, response) => { | ||
if (error) { | ||
@@ -81,2 +82,6 @@ reject(new core_1.NotOK((error.code || core_1.Status.UNKNOWN), error.details)); | ||
}); | ||
abortHandler.onAbort((error) => { | ||
reject(error); | ||
call.cancel(); | ||
}); | ||
}); | ||
@@ -83,0 +88,0 @@ }, options); |
@@ -584,11 +584,11 @@ "use strict"; | ||
function toTimestamp(date) { | ||
const seconds = Math.trunc(date.getTime() / 1000).toString(); | ||
const nanos = (date.getTime() % 1000) * 1000000; | ||
const seconds = Math.trunc(date.getTime() / 1_000).toString(); | ||
const nanos = (date.getTime() % 1_000) * 1_000_000; | ||
return { seconds, nanos }; | ||
} | ||
function fromTimestamp(t) { | ||
let millis = (globalThis.Number(t.seconds) || 0) * 1000; | ||
millis += (t.nanos || 0) / 1000000; | ||
let millis = (globalThis.Number(t.seconds) || 0) * 1_000; | ||
millis += (t.nanos || 0) / 1_000_000; | ||
return new globalThis.Date(millis); | ||
} | ||
//# sourceMappingURL=audit.js.map |
@@ -46,3 +46,3 @@ "use strict"; | ||
} | ||
if (message.includeMeta === true) { | ||
if (message.includeMeta !== false) { | ||
writer.uint32(48).bool(message.includeMeta); | ||
@@ -49,0 +49,0 @@ } |
@@ -28,3 +28,3 @@ "use strict"; | ||
} | ||
if (message.disabled === true) { | ||
if (message.disabled !== false) { | ||
writer.uint32(16).bool(message.disabled); | ||
@@ -31,0 +31,0 @@ } |
@@ -49,3 +49,3 @@ "use strict"; | ||
} | ||
if (message.includeMeta === true) { | ||
if (message.includeMeta !== false) { | ||
writer.uint32(48).bool(message.includeMeta); | ||
@@ -131,3 +131,3 @@ } | ||
} | ||
if (message.includeMeta === true) { | ||
if (message.includeMeta !== false) { | ||
writer.uint32(40).bool(message.includeMeta); | ||
@@ -492,3 +492,3 @@ } | ||
} | ||
if (message.includeMeta === true) { | ||
if (message.includeMeta !== false) { | ||
writer.uint32(16).bool(message.includeMeta); | ||
@@ -849,3 +849,3 @@ } | ||
encode(message, writer = minimal_1.default.Writer.create()) { | ||
if (message.includeDisabled === true) { | ||
if (message.includeDisabled !== false) { | ||
writer.uint32(8).bool(message.includeDisabled); | ||
@@ -1124,3 +1124,3 @@ } | ||
encode(message, writer = minimal_1.default.Writer.create()) { | ||
if (message.wait === true) { | ||
if (message.wait !== false) { | ||
writer.uint32(8).bool(message.wait); | ||
@@ -1153,11 +1153,11 @@ } | ||
function toTimestamp(date) { | ||
const seconds = Math.trunc(date.getTime() / 1000).toString(); | ||
const nanos = (date.getTime() % 1000) * 1000000; | ||
const seconds = Math.trunc(date.getTime() / 1_000).toString(); | ||
const nanos = (date.getTime() % 1_000) * 1_000_000; | ||
return { seconds, nanos }; | ||
} | ||
function fromTimestamp(t) { | ||
let millis = (globalThis.Number(t.seconds) || 0) * 1000; | ||
millis += (t.nanos || 0) / 1000000; | ||
let millis = (globalThis.Number(t.seconds) || 0) * 1_000; | ||
millis += (t.nanos || 0) / 1_000_000; | ||
return new globalThis.Date(millis); | ||
} | ||
//# sourceMappingURL=request.js.map |
@@ -15,23 +15,23 @@ import _m0 from "protobufjs/minimal"; | ||
export interface FileOptions { | ||
javaPackage: string; | ||
javaOuterClassname: string; | ||
javaMultipleFiles: boolean; | ||
javaGenerateEqualsAndHash: boolean; | ||
javaStringCheckUtf8: boolean; | ||
optimizeFor: FileOptions_OptimizeMode; | ||
goPackage: string; | ||
ccGenericServices: boolean; | ||
javaGenericServices: boolean; | ||
pyGenericServices: boolean; | ||
phpGenericServices: boolean; | ||
deprecated: boolean; | ||
ccEnableArenas: boolean; | ||
objcClassPrefix: string; | ||
csharpNamespace: string; | ||
swiftPrefix: string; | ||
phpClassPrefix: string; | ||
phpNamespace: string; | ||
phpMetadataNamespace: string; | ||
rubyPackage: string; | ||
features: FeatureSet | undefined; | ||
javaPackage?: string | undefined; | ||
javaOuterClassname?: string | undefined; | ||
javaMultipleFiles?: boolean | undefined; | ||
javaGenerateEqualsAndHash?: boolean | undefined; | ||
javaStringCheckUtf8?: boolean | undefined; | ||
optimizeFor?: FileOptions_OptimizeMode | undefined; | ||
goPackage?: string | undefined; | ||
ccGenericServices?: boolean | undefined; | ||
javaGenericServices?: boolean | undefined; | ||
pyGenericServices?: boolean | undefined; | ||
phpGenericServices?: boolean | undefined; | ||
deprecated?: boolean | undefined; | ||
ccEnableArenas?: boolean | undefined; | ||
objcClassPrefix?: string | undefined; | ||
csharpNamespace?: string | undefined; | ||
swiftPrefix?: string | undefined; | ||
phpClassPrefix?: string | undefined; | ||
phpNamespace?: string | undefined; | ||
phpMetadataNamespace?: string | undefined; | ||
rubyPackage?: string | undefined; | ||
features?: FeatureSet | undefined; | ||
uninterpretedOption: UninterpretedOption[]; | ||
@@ -45,23 +45,23 @@ } | ||
export interface MessageOptions { | ||
messageSetWireFormat: boolean; | ||
noStandardDescriptorAccessor: boolean; | ||
deprecated: boolean; | ||
mapEntry: boolean; | ||
deprecatedLegacyJsonFieldConflicts: boolean; | ||
features: FeatureSet | undefined; | ||
messageSetWireFormat?: boolean | undefined; | ||
noStandardDescriptorAccessor?: boolean | undefined; | ||
deprecated?: boolean | undefined; | ||
mapEntry?: boolean | undefined; | ||
deprecatedLegacyJsonFieldConflicts?: boolean | undefined; | ||
features?: FeatureSet | undefined; | ||
uninterpretedOption: UninterpretedOption[]; | ||
} | ||
export interface FieldOptions { | ||
ctype: FieldOptions_CType; | ||
packed: boolean; | ||
jstype: FieldOptions_JSType; | ||
lazy: boolean; | ||
unverifiedLazy: boolean; | ||
deprecated: boolean; | ||
weak: boolean; | ||
debugRedact: boolean; | ||
retention: FieldOptions_OptionRetention; | ||
ctype?: FieldOptions_CType | undefined; | ||
packed?: boolean | undefined; | ||
jstype?: FieldOptions_JSType | undefined; | ||
lazy?: boolean | undefined; | ||
unverifiedLazy?: boolean | undefined; | ||
deprecated?: boolean | undefined; | ||
weak?: boolean | undefined; | ||
debugRedact?: boolean | undefined; | ||
retention?: FieldOptions_OptionRetention | undefined; | ||
targets: FieldOptions_OptionTargetType[]; | ||
editionDefaults: FieldOptions_EditionDefault[]; | ||
features: FeatureSet | undefined; | ||
features?: FeatureSet | undefined; | ||
uninterpretedOption: UninterpretedOption[]; | ||
@@ -97,18 +97,18 @@ } | ||
export interface FieldOptions_EditionDefault { | ||
edition: Edition; | ||
value: string; | ||
edition?: Edition | undefined; | ||
value?: string | undefined; | ||
} | ||
export interface OneofOptions { | ||
features: FeatureSet | undefined; | ||
features?: FeatureSet | undefined; | ||
uninterpretedOption: UninterpretedOption[]; | ||
} | ||
export interface ServiceOptions { | ||
features: FeatureSet | undefined; | ||
deprecated: boolean; | ||
features?: FeatureSet | undefined; | ||
deprecated?: boolean | undefined; | ||
uninterpretedOption: UninterpretedOption[]; | ||
} | ||
export interface MethodOptions { | ||
deprecated: boolean; | ||
idempotencyLevel: MethodOptions_IdempotencyLevel; | ||
features: FeatureSet | undefined; | ||
deprecated?: boolean | undefined; | ||
idempotencyLevel?: MethodOptions_IdempotencyLevel | undefined; | ||
features?: FeatureSet | undefined; | ||
uninterpretedOption: UninterpretedOption[]; | ||
@@ -123,8 +123,8 @@ } | ||
name: UninterpretedOption_NamePart[]; | ||
identifierValue: string; | ||
positiveIntValue: string; | ||
negativeIntValue: string; | ||
doubleValue: number; | ||
stringValue: Uint8Array; | ||
aggregateValue: string; | ||
identifierValue?: string | undefined; | ||
positiveIntValue?: string | undefined; | ||
negativeIntValue?: string | undefined; | ||
doubleValue?: number | undefined; | ||
stringValue?: Uint8Array | undefined; | ||
aggregateValue?: string | undefined; | ||
} | ||
@@ -136,8 +136,8 @@ export interface UninterpretedOption_NamePart { | ||
export interface FeatureSet { | ||
fieldPresence: FeatureSet_FieldPresence; | ||
enumType: FeatureSet_EnumType; | ||
repeatedFieldEncoding: FeatureSet_RepeatedFieldEncoding; | ||
utf8Validation: FeatureSet_Utf8Validation; | ||
messageEncoding: FeatureSet_MessageEncoding; | ||
jsonFormat: FeatureSet_JsonFormat; | ||
fieldPresence?: FeatureSet_FieldPresence | undefined; | ||
enumType?: FeatureSet_EnumType | undefined; | ||
repeatedFieldEncoding?: FeatureSet_RepeatedFieldEncoding | undefined; | ||
utf8Validation?: FeatureSet_Utf8Validation | undefined; | ||
messageEncoding?: FeatureSet_MessageEncoding | undefined; | ||
jsonFormat?: FeatureSet_JsonFormat | undefined; | ||
} | ||
@@ -144,0 +144,0 @@ export declare enum FeatureSet_FieldPresence { |
@@ -117,3 +117,3 @@ "use strict"; | ||
deprecated: false, | ||
ccEnableArenas: false, | ||
ccEnableArenas: true, | ||
objcClassPrefix: "", | ||
@@ -132,60 +132,72 @@ csharpNamespace: "", | ||
encode(message, writer = minimal_1.default.Writer.create()) { | ||
if (message.javaPackage !== "") { | ||
if (message.javaPackage !== undefined && message.javaPackage !== "") { | ||
writer.uint32(10).string(message.javaPackage); | ||
} | ||
if (message.javaOuterClassname !== "") { | ||
if (message.javaOuterClassname !== undefined && | ||
message.javaOuterClassname !== "") { | ||
writer.uint32(66).string(message.javaOuterClassname); | ||
} | ||
if (message.javaMultipleFiles === true) { | ||
if (message.javaMultipleFiles !== undefined && | ||
message.javaMultipleFiles !== false) { | ||
writer.uint32(80).bool(message.javaMultipleFiles); | ||
} | ||
if (message.javaGenerateEqualsAndHash === true) { | ||
if (message.javaGenerateEqualsAndHash !== undefined && | ||
message.javaGenerateEqualsAndHash !== false) { | ||
writer.uint32(160).bool(message.javaGenerateEqualsAndHash); | ||
} | ||
if (message.javaStringCheckUtf8 === true) { | ||
if (message.javaStringCheckUtf8 !== undefined && | ||
message.javaStringCheckUtf8 !== false) { | ||
writer.uint32(216).bool(message.javaStringCheckUtf8); | ||
} | ||
if (message.optimizeFor !== 1) { | ||
if (message.optimizeFor !== undefined && message.optimizeFor !== 1) { | ||
writer.uint32(72).int32(message.optimizeFor); | ||
} | ||
if (message.goPackage !== "") { | ||
if (message.goPackage !== undefined && message.goPackage !== "") { | ||
writer.uint32(90).string(message.goPackage); | ||
} | ||
if (message.ccGenericServices === true) { | ||
if (message.ccGenericServices !== undefined && | ||
message.ccGenericServices !== false) { | ||
writer.uint32(128).bool(message.ccGenericServices); | ||
} | ||
if (message.javaGenericServices === true) { | ||
if (message.javaGenericServices !== undefined && | ||
message.javaGenericServices !== false) { | ||
writer.uint32(136).bool(message.javaGenericServices); | ||
} | ||
if (message.pyGenericServices === true) { | ||
if (message.pyGenericServices !== undefined && | ||
message.pyGenericServices !== false) { | ||
writer.uint32(144).bool(message.pyGenericServices); | ||
} | ||
if (message.phpGenericServices === true) { | ||
if (message.phpGenericServices !== undefined && | ||
message.phpGenericServices !== false) { | ||
writer.uint32(336).bool(message.phpGenericServices); | ||
} | ||
if (message.deprecated === true) { | ||
if (message.deprecated !== undefined && message.deprecated !== false) { | ||
writer.uint32(184).bool(message.deprecated); | ||
} | ||
if (message.ccEnableArenas === true) { | ||
if (message.ccEnableArenas !== undefined && | ||
message.ccEnableArenas !== true) { | ||
writer.uint32(248).bool(message.ccEnableArenas); | ||
} | ||
if (message.objcClassPrefix !== "") { | ||
if (message.objcClassPrefix !== undefined && | ||
message.objcClassPrefix !== "") { | ||
writer.uint32(290).string(message.objcClassPrefix); | ||
} | ||
if (message.csharpNamespace !== "") { | ||
if (message.csharpNamespace !== undefined && | ||
message.csharpNamespace !== "") { | ||
writer.uint32(298).string(message.csharpNamespace); | ||
} | ||
if (message.swiftPrefix !== "") { | ||
if (message.swiftPrefix !== undefined && message.swiftPrefix !== "") { | ||
writer.uint32(314).string(message.swiftPrefix); | ||
} | ||
if (message.phpClassPrefix !== "") { | ||
if (message.phpClassPrefix !== undefined && message.phpClassPrefix !== "") { | ||
writer.uint32(322).string(message.phpClassPrefix); | ||
} | ||
if (message.phpNamespace !== "") { | ||
if (message.phpNamespace !== undefined && message.phpNamespace !== "") { | ||
writer.uint32(330).string(message.phpNamespace); | ||
} | ||
if (message.phpMetadataNamespace !== "") { | ||
if (message.phpMetadataNamespace !== undefined && | ||
message.phpMetadataNamespace !== "") { | ||
writer.uint32(354).string(message.phpMetadataNamespace); | ||
} | ||
if (message.rubyPackage !== "") { | ||
if (message.rubyPackage !== undefined && message.rubyPackage !== "") { | ||
writer.uint32(362).string(message.rubyPackage); | ||
@@ -362,15 +374,18 @@ } | ||
encode(message, writer = minimal_1.default.Writer.create()) { | ||
if (message.messageSetWireFormat === true) { | ||
if (message.messageSetWireFormat !== undefined && | ||
message.messageSetWireFormat !== false) { | ||
writer.uint32(8).bool(message.messageSetWireFormat); | ||
} | ||
if (message.noStandardDescriptorAccessor === true) { | ||
if (message.noStandardDescriptorAccessor !== undefined && | ||
message.noStandardDescriptorAccessor !== false) { | ||
writer.uint32(16).bool(message.noStandardDescriptorAccessor); | ||
} | ||
if (message.deprecated === true) { | ||
if (message.deprecated !== undefined && message.deprecated !== false) { | ||
writer.uint32(24).bool(message.deprecated); | ||
} | ||
if (message.mapEntry === true) { | ||
if (message.mapEntry !== undefined && message.mapEntry !== false) { | ||
writer.uint32(56).bool(message.mapEntry); | ||
} | ||
if (message.deprecatedLegacyJsonFieldConflicts === true) { | ||
if (message.deprecatedLegacyJsonFieldConflicts !== undefined && | ||
message.deprecatedLegacyJsonFieldConflicts !== false) { | ||
writer.uint32(88).bool(message.deprecatedLegacyJsonFieldConflicts); | ||
@@ -463,27 +478,28 @@ } | ||
encode(message, writer = minimal_1.default.Writer.create()) { | ||
if (message.ctype !== 0) { | ||
if (message.ctype !== undefined && message.ctype !== 0) { | ||
writer.uint32(8).int32(message.ctype); | ||
} | ||
if (message.packed === true) { | ||
if (message.packed !== undefined && message.packed !== false) { | ||
writer.uint32(16).bool(message.packed); | ||
} | ||
if (message.jstype !== 0) { | ||
if (message.jstype !== undefined && message.jstype !== 0) { | ||
writer.uint32(48).int32(message.jstype); | ||
} | ||
if (message.lazy === true) { | ||
if (message.lazy !== undefined && message.lazy !== false) { | ||
writer.uint32(40).bool(message.lazy); | ||
} | ||
if (message.unverifiedLazy === true) { | ||
if (message.unverifiedLazy !== undefined && | ||
message.unverifiedLazy !== false) { | ||
writer.uint32(120).bool(message.unverifiedLazy); | ||
} | ||
if (message.deprecated === true) { | ||
if (message.deprecated !== undefined && message.deprecated !== false) { | ||
writer.uint32(24).bool(message.deprecated); | ||
} | ||
if (message.weak === true) { | ||
if (message.weak !== undefined && message.weak !== false) { | ||
writer.uint32(80).bool(message.weak); | ||
} | ||
if (message.debugRedact === true) { | ||
if (message.debugRedact !== undefined && message.debugRedact !== false) { | ||
writer.uint32(128).bool(message.debugRedact); | ||
} | ||
if (message.retention !== 0) { | ||
if (message.retention !== undefined && message.retention !== 0) { | ||
writer.uint32(136).int32(message.retention); | ||
@@ -613,6 +629,6 @@ } | ||
encode(message, writer = minimal_1.default.Writer.create()) { | ||
if (message.edition !== 0) { | ||
if (message.edition !== undefined && message.edition !== 0) { | ||
writer.uint32(24).int32(message.edition); | ||
} | ||
if (message.value !== "") { | ||
if (message.value !== undefined && message.value !== "") { | ||
writer.uint32(18).string(message.value); | ||
@@ -699,3 +715,3 @@ } | ||
} | ||
if (message.deprecated === true) { | ||
if (message.deprecated !== undefined && message.deprecated !== false) { | ||
writer.uint32(264).bool(message.deprecated); | ||
@@ -752,6 +768,7 @@ } | ||
encode(message, writer = minimal_1.default.Writer.create()) { | ||
if (message.deprecated === true) { | ||
if (message.deprecated !== undefined && message.deprecated !== false) { | ||
writer.uint32(264).bool(message.deprecated); | ||
} | ||
if (message.idempotencyLevel !== 0) { | ||
if (message.idempotencyLevel !== undefined && | ||
message.idempotencyLevel !== 0) { | ||
writer.uint32(272).int32(message.idempotencyLevel); | ||
@@ -823,18 +840,21 @@ } | ||
} | ||
if (message.identifierValue !== "") { | ||
if (message.identifierValue !== undefined && | ||
message.identifierValue !== "") { | ||
writer.uint32(26).string(message.identifierValue); | ||
} | ||
if (message.positiveIntValue !== "0") { | ||
if (message.positiveIntValue !== undefined && | ||
message.positiveIntValue !== "0") { | ||
writer.uint32(32).uint64(message.positiveIntValue); | ||
} | ||
if (message.negativeIntValue !== "0") { | ||
if (message.negativeIntValue !== undefined && | ||
message.negativeIntValue !== "0") { | ||
writer.uint32(40).int64(message.negativeIntValue); | ||
} | ||
if (message.doubleValue !== 0) { | ||
if (message.doubleValue !== undefined && message.doubleValue !== 0) { | ||
writer.uint32(49).double(message.doubleValue); | ||
} | ||
if (message.stringValue.length !== 0) { | ||
if (message.stringValue !== undefined && message.stringValue.length !== 0) { | ||
writer.uint32(58).bytes(message.stringValue); | ||
} | ||
if (message.aggregateValue !== "") { | ||
if (message.aggregateValue !== undefined && message.aggregateValue !== "") { | ||
writer.uint32(66).string(message.aggregateValue); | ||
@@ -910,3 +930,3 @@ } | ||
} | ||
if (message.isExtension === true) { | ||
if (message.isExtension !== false) { | ||
writer.uint32(16).bool(message.isExtension); | ||
@@ -956,18 +976,20 @@ } | ||
encode(message, writer = minimal_1.default.Writer.create()) { | ||
if (message.fieldPresence !== 0) { | ||
if (message.fieldPresence !== undefined && message.fieldPresence !== 0) { | ||
writer.uint32(8).int32(message.fieldPresence); | ||
} | ||
if (message.enumType !== 0) { | ||
if (message.enumType !== undefined && message.enumType !== 0) { | ||
writer.uint32(16).int32(message.enumType); | ||
} | ||
if (message.repeatedFieldEncoding !== 0) { | ||
if (message.repeatedFieldEncoding !== undefined && | ||
message.repeatedFieldEncoding !== 0) { | ||
writer.uint32(24).int32(message.repeatedFieldEncoding); | ||
} | ||
if (message.utf8Validation !== 0) { | ||
if (message.utf8Validation !== undefined && message.utf8Validation !== 0) { | ||
writer.uint32(32).int32(message.utf8Validation); | ||
} | ||
if (message.messageEncoding !== 0) { | ||
if (message.messageEncoding !== undefined && | ||
message.messageEncoding !== 0) { | ||
writer.uint32(40).int32(message.messageEncoding); | ||
} | ||
if (message.jsonFormat !== 0) { | ||
if (message.jsonFormat !== undefined && message.jsonFormat !== 0) { | ||
writer.uint32(48).int32(message.jsonFormat); | ||
@@ -974,0 +996,0 @@ } |
{ | ||
"name": "@cerbos/grpc", | ||
"version": "0.16.0", | ||
"version": "0.17.0", | ||
"description": "Client library for interacting with the Cerbos policy decision point service over gRPC from server-side Node.js applications", | ||
@@ -19,4 +19,8 @@ "repository": { | ||
}, | ||
"main": "./lib/index.js", | ||
"types": "./lib/index.d.ts", | ||
"exports": { | ||
".": { | ||
"default": "./lib/index.js", | ||
"types": "./lib/index.d.ts" | ||
} | ||
}, | ||
"files": [ | ||
@@ -29,8 +33,29 @@ "lib/**/*.d.ts", | ||
], | ||
"keywords": [ | ||
"Cerbos", | ||
"authorization", | ||
"access control", | ||
"roles", | ||
"permissions", | ||
"policy", | ||
"security", | ||
"role-based access control", | ||
"RBAC", | ||
"attribute-based access control", | ||
"ABAC", | ||
"policy decision point", | ||
"PDP", | ||
"gRPC", | ||
"server-side" | ||
], | ||
"dependencies": { | ||
"@cerbos/core": "^0.16.0", | ||
"@grpc/grpc-js": "^1.10.1", | ||
"@cerbos/core": "^0.17.0", | ||
"@grpc/grpc-js": "^1.10.6", | ||
"long": "^5.2.3", | ||
"protobufjs": "^7.2.6" | ||
}, | ||
"publishConfig": { | ||
"access": "public", | ||
"provenance": true | ||
} | ||
} |
@@ -9,2 +9,9 @@ /** | ||
import type { CallOptions, MethodDefinition } from "@grpc/grpc-js"; | ||
import { | ||
ChannelCredentials, | ||
Client as GenericClient, | ||
Metadata, | ||
} from "@grpc/grpc-js"; | ||
import type { | ||
@@ -18,8 +25,2 @@ Options as CoreOptions, | ||
import { Client, NotOK, Status } from "@cerbos/core"; | ||
import type { CallOptions, MethodDefinition } from "@grpc/grpc-js"; | ||
import { | ||
ChannelCredentials, | ||
Client as GenericClient, | ||
Metadata, | ||
} from "@grpc/grpc-js"; | ||
@@ -106,3 +107,3 @@ import { | ||
super(async (service, rpc, request, headers) => { | ||
super(async (service, rpc, request, headers, abortHandler) => { | ||
const { path, requestSerialize, responseDeserialize } = services[service][ | ||
@@ -120,3 +121,5 @@ rpc | ||
return await new Promise((resolve, reject) => { | ||
client.makeUnaryRequest( | ||
abortHandler.throwIfAborted(); | ||
const call = client.makeUnaryRequest( | ||
path, | ||
@@ -143,2 +146,7 @@ requestSerialize, | ||
); | ||
abortHandler.onAbort((error) => { | ||
reject(error); | ||
call.cancel(); | ||
}); | ||
}); | ||
@@ -145,0 +153,0 @@ }, options); |
@@ -168,3 +168,3 @@ /* eslint-disable */ | ||
} | ||
if (message.includeMeta === true) { | ||
if (message.includeMeta !== false) { | ||
writer.uint32(48).bool(message.includeMeta); | ||
@@ -171,0 +171,0 @@ } |
@@ -189,3 +189,3 @@ /* eslint-disable */ | ||
} | ||
if (message.disabled === true) { | ||
if (message.disabled !== false) { | ||
writer.uint32(16).bool(message.disabled); | ||
@@ -192,0 +192,0 @@ } |
@@ -187,3 +187,3 @@ /* eslint-disable */ | ||
} | ||
if (message.includeMeta === true) { | ||
if (message.includeMeta !== false) { | ||
writer.uint32(48).bool(message.includeMeta); | ||
@@ -288,3 +288,3 @@ } | ||
} | ||
if (message.includeMeta === true) { | ||
if (message.includeMeta !== false) { | ||
writer.uint32(40).bool(message.includeMeta); | ||
@@ -757,3 +757,3 @@ } | ||
} | ||
if (message.includeMeta === true) { | ||
if (message.includeMeta !== false) { | ||
writer.uint32(16).bool(message.includeMeta); | ||
@@ -1227,3 +1227,3 @@ } | ||
): _m0.Writer { | ||
if (message.includeDisabled === true) { | ||
if (message.includeDisabled !== false) { | ||
writer.uint32(8).bool(message.includeDisabled); | ||
@@ -1574,3 +1574,3 @@ } | ||
): _m0.Writer { | ||
if (message.wait === true) { | ||
if (message.wait !== false) { | ||
writer.uint32(8).bool(message.wait); | ||
@@ -1577,0 +1577,0 @@ } |
@@ -20,23 +20,23 @@ /* eslint-disable */ | ||
export interface FileOptions { | ||
javaPackage: string; | ||
javaOuterClassname: string; | ||
javaMultipleFiles: boolean; | ||
javaGenerateEqualsAndHash: boolean; | ||
javaStringCheckUtf8: boolean; | ||
optimizeFor: FileOptions_OptimizeMode; | ||
goPackage: string; | ||
ccGenericServices: boolean; | ||
javaGenericServices: boolean; | ||
pyGenericServices: boolean; | ||
phpGenericServices: boolean; | ||
deprecated: boolean; | ||
ccEnableArenas: boolean; | ||
objcClassPrefix: string; | ||
csharpNamespace: string; | ||
swiftPrefix: string; | ||
phpClassPrefix: string; | ||
phpNamespace: string; | ||
phpMetadataNamespace: string; | ||
rubyPackage: string; | ||
features: FeatureSet | undefined; | ||
javaPackage?: string | undefined; | ||
javaOuterClassname?: string | undefined; | ||
javaMultipleFiles?: boolean | undefined; | ||
javaGenerateEqualsAndHash?: boolean | undefined; | ||
javaStringCheckUtf8?: boolean | undefined; | ||
optimizeFor?: FileOptions_OptimizeMode | undefined; | ||
goPackage?: string | undefined; | ||
ccGenericServices?: boolean | undefined; | ||
javaGenericServices?: boolean | undefined; | ||
pyGenericServices?: boolean | undefined; | ||
phpGenericServices?: boolean | undefined; | ||
deprecated?: boolean | undefined; | ||
ccEnableArenas?: boolean | undefined; | ||
objcClassPrefix?: string | undefined; | ||
csharpNamespace?: string | undefined; | ||
swiftPrefix?: string | undefined; | ||
phpClassPrefix?: string | undefined; | ||
phpNamespace?: string | undefined; | ||
phpMetadataNamespace?: string | undefined; | ||
rubyPackage?: string | undefined; | ||
features?: FeatureSet | undefined; | ||
uninterpretedOption: UninterpretedOption[]; | ||
@@ -52,8 +52,8 @@ } | ||
export interface MessageOptions { | ||
messageSetWireFormat: boolean; | ||
noStandardDescriptorAccessor: boolean; | ||
deprecated: boolean; | ||
mapEntry: boolean; | ||
deprecatedLegacyJsonFieldConflicts: boolean; | ||
features: FeatureSet | undefined; | ||
messageSetWireFormat?: boolean | undefined; | ||
noStandardDescriptorAccessor?: boolean | undefined; | ||
deprecated?: boolean | undefined; | ||
mapEntry?: boolean | undefined; | ||
deprecatedLegacyJsonFieldConflicts?: boolean | undefined; | ||
features?: FeatureSet | undefined; | ||
uninterpretedOption: UninterpretedOption[]; | ||
@@ -63,14 +63,14 @@ } | ||
export interface FieldOptions { | ||
ctype: FieldOptions_CType; | ||
packed: boolean; | ||
jstype: FieldOptions_JSType; | ||
lazy: boolean; | ||
unverifiedLazy: boolean; | ||
deprecated: boolean; | ||
weak: boolean; | ||
debugRedact: boolean; | ||
retention: FieldOptions_OptionRetention; | ||
ctype?: FieldOptions_CType | undefined; | ||
packed?: boolean | undefined; | ||
jstype?: FieldOptions_JSType | undefined; | ||
lazy?: boolean | undefined; | ||
unverifiedLazy?: boolean | undefined; | ||
deprecated?: boolean | undefined; | ||
weak?: boolean | undefined; | ||
debugRedact?: boolean | undefined; | ||
retention?: FieldOptions_OptionRetention | undefined; | ||
targets: FieldOptions_OptionTargetType[]; | ||
editionDefaults: FieldOptions_EditionDefault[]; | ||
features: FeatureSet | undefined; | ||
features?: FeatureSet | undefined; | ||
uninterpretedOption: UninterpretedOption[]; | ||
@@ -111,8 +111,8 @@ } | ||
export interface FieldOptions_EditionDefault { | ||
edition: Edition; | ||
value: string; | ||
edition?: Edition | undefined; | ||
value?: string | undefined; | ||
} | ||
export interface OneofOptions { | ||
features: FeatureSet | undefined; | ||
features?: FeatureSet | undefined; | ||
uninterpretedOption: UninterpretedOption[]; | ||
@@ -122,4 +122,4 @@ } | ||
export interface ServiceOptions { | ||
features: FeatureSet | undefined; | ||
deprecated: boolean; | ||
features?: FeatureSet | undefined; | ||
deprecated?: boolean | undefined; | ||
uninterpretedOption: UninterpretedOption[]; | ||
@@ -129,5 +129,5 @@ } | ||
export interface MethodOptions { | ||
deprecated: boolean; | ||
idempotencyLevel: MethodOptions_IdempotencyLevel; | ||
features: FeatureSet | undefined; | ||
deprecated?: boolean | undefined; | ||
idempotencyLevel?: MethodOptions_IdempotencyLevel | undefined; | ||
features?: FeatureSet | undefined; | ||
uninterpretedOption: UninterpretedOption[]; | ||
@@ -144,8 +144,8 @@ } | ||
name: UninterpretedOption_NamePart[]; | ||
identifierValue: string; | ||
positiveIntValue: string; | ||
negativeIntValue: string; | ||
doubleValue: number; | ||
stringValue: Uint8Array; | ||
aggregateValue: string; | ||
identifierValue?: string | undefined; | ||
positiveIntValue?: string | undefined; | ||
negativeIntValue?: string | undefined; | ||
doubleValue?: number | undefined; | ||
stringValue?: Uint8Array | undefined; | ||
aggregateValue?: string | undefined; | ||
} | ||
@@ -159,8 +159,8 @@ | ||
export interface FeatureSet { | ||
fieldPresence: FeatureSet_FieldPresence; | ||
enumType: FeatureSet_EnumType; | ||
repeatedFieldEncoding: FeatureSet_RepeatedFieldEncoding; | ||
utf8Validation: FeatureSet_Utf8Validation; | ||
messageEncoding: FeatureSet_MessageEncoding; | ||
jsonFormat: FeatureSet_JsonFormat; | ||
fieldPresence?: FeatureSet_FieldPresence | undefined; | ||
enumType?: FeatureSet_EnumType | undefined; | ||
repeatedFieldEncoding?: FeatureSet_RepeatedFieldEncoding | undefined; | ||
utf8Validation?: FeatureSet_Utf8Validation | undefined; | ||
messageEncoding?: FeatureSet_MessageEncoding | undefined; | ||
jsonFormat?: FeatureSet_JsonFormat | undefined; | ||
} | ||
@@ -219,3 +219,3 @@ | ||
deprecated: false, | ||
ccEnableArenas: false, | ||
ccEnableArenas: true, | ||
objcClassPrefix: "", | ||
@@ -238,60 +238,96 @@ csharpNamespace: "", | ||
): _m0.Writer { | ||
if (message.javaPackage !== "") { | ||
if (message.javaPackage !== undefined && message.javaPackage !== "") { | ||
writer.uint32(10).string(message.javaPackage); | ||
} | ||
if (message.javaOuterClassname !== "") { | ||
if ( | ||
message.javaOuterClassname !== undefined && | ||
message.javaOuterClassname !== "" | ||
) { | ||
writer.uint32(66).string(message.javaOuterClassname); | ||
} | ||
if (message.javaMultipleFiles === true) { | ||
if ( | ||
message.javaMultipleFiles !== undefined && | ||
message.javaMultipleFiles !== false | ||
) { | ||
writer.uint32(80).bool(message.javaMultipleFiles); | ||
} | ||
if (message.javaGenerateEqualsAndHash === true) { | ||
if ( | ||
message.javaGenerateEqualsAndHash !== undefined && | ||
message.javaGenerateEqualsAndHash !== false | ||
) { | ||
writer.uint32(160).bool(message.javaGenerateEqualsAndHash); | ||
} | ||
if (message.javaStringCheckUtf8 === true) { | ||
if ( | ||
message.javaStringCheckUtf8 !== undefined && | ||
message.javaStringCheckUtf8 !== false | ||
) { | ||
writer.uint32(216).bool(message.javaStringCheckUtf8); | ||
} | ||
if (message.optimizeFor !== 1) { | ||
if (message.optimizeFor !== undefined && message.optimizeFor !== 1) { | ||
writer.uint32(72).int32(message.optimizeFor); | ||
} | ||
if (message.goPackage !== "") { | ||
if (message.goPackage !== undefined && message.goPackage !== "") { | ||
writer.uint32(90).string(message.goPackage); | ||
} | ||
if (message.ccGenericServices === true) { | ||
if ( | ||
message.ccGenericServices !== undefined && | ||
message.ccGenericServices !== false | ||
) { | ||
writer.uint32(128).bool(message.ccGenericServices); | ||
} | ||
if (message.javaGenericServices === true) { | ||
if ( | ||
message.javaGenericServices !== undefined && | ||
message.javaGenericServices !== false | ||
) { | ||
writer.uint32(136).bool(message.javaGenericServices); | ||
} | ||
if (message.pyGenericServices === true) { | ||
if ( | ||
message.pyGenericServices !== undefined && | ||
message.pyGenericServices !== false | ||
) { | ||
writer.uint32(144).bool(message.pyGenericServices); | ||
} | ||
if (message.phpGenericServices === true) { | ||
if ( | ||
message.phpGenericServices !== undefined && | ||
message.phpGenericServices !== false | ||
) { | ||
writer.uint32(336).bool(message.phpGenericServices); | ||
} | ||
if (message.deprecated === true) { | ||
if (message.deprecated !== undefined && message.deprecated !== false) { | ||
writer.uint32(184).bool(message.deprecated); | ||
} | ||
if (message.ccEnableArenas === true) { | ||
if ( | ||
message.ccEnableArenas !== undefined && | ||
message.ccEnableArenas !== true | ||
) { | ||
writer.uint32(248).bool(message.ccEnableArenas); | ||
} | ||
if (message.objcClassPrefix !== "") { | ||
if ( | ||
message.objcClassPrefix !== undefined && | ||
message.objcClassPrefix !== "" | ||
) { | ||
writer.uint32(290).string(message.objcClassPrefix); | ||
} | ||
if (message.csharpNamespace !== "") { | ||
if ( | ||
message.csharpNamespace !== undefined && | ||
message.csharpNamespace !== "" | ||
) { | ||
writer.uint32(298).string(message.csharpNamespace); | ||
} | ||
if (message.swiftPrefix !== "") { | ||
if (message.swiftPrefix !== undefined && message.swiftPrefix !== "") { | ||
writer.uint32(314).string(message.swiftPrefix); | ||
} | ||
if (message.phpClassPrefix !== "") { | ||
if (message.phpClassPrefix !== undefined && message.phpClassPrefix !== "") { | ||
writer.uint32(322).string(message.phpClassPrefix); | ||
} | ||
if (message.phpNamespace !== "") { | ||
if (message.phpNamespace !== undefined && message.phpNamespace !== "") { | ||
writer.uint32(330).string(message.phpNamespace); | ||
} | ||
if (message.phpMetadataNamespace !== "") { | ||
if ( | ||
message.phpMetadataNamespace !== undefined && | ||
message.phpMetadataNamespace !== "" | ||
) { | ||
writer.uint32(354).string(message.phpMetadataNamespace); | ||
} | ||
if (message.rubyPackage !== "") { | ||
if (message.rubyPackage !== undefined && message.rubyPackage !== "") { | ||
writer.uint32(362).string(message.rubyPackage); | ||
@@ -499,15 +535,24 @@ } | ||
): _m0.Writer { | ||
if (message.messageSetWireFormat === true) { | ||
if ( | ||
message.messageSetWireFormat !== undefined && | ||
message.messageSetWireFormat !== false | ||
) { | ||
writer.uint32(8).bool(message.messageSetWireFormat); | ||
} | ||
if (message.noStandardDescriptorAccessor === true) { | ||
if ( | ||
message.noStandardDescriptorAccessor !== undefined && | ||
message.noStandardDescriptorAccessor !== false | ||
) { | ||
writer.uint32(16).bool(message.noStandardDescriptorAccessor); | ||
} | ||
if (message.deprecated === true) { | ||
if (message.deprecated !== undefined && message.deprecated !== false) { | ||
writer.uint32(24).bool(message.deprecated); | ||
} | ||
if (message.mapEntry === true) { | ||
if (message.mapEntry !== undefined && message.mapEntry !== false) { | ||
writer.uint32(56).bool(message.mapEntry); | ||
} | ||
if (message.deprecatedLegacyJsonFieldConflicts === true) { | ||
if ( | ||
message.deprecatedLegacyJsonFieldConflicts !== undefined && | ||
message.deprecatedLegacyJsonFieldConflicts !== false | ||
) { | ||
writer.uint32(88).bool(message.deprecatedLegacyJsonFieldConflicts); | ||
@@ -616,27 +661,30 @@ } | ||
): _m0.Writer { | ||
if (message.ctype !== 0) { | ||
if (message.ctype !== undefined && message.ctype !== 0) { | ||
writer.uint32(8).int32(message.ctype); | ||
} | ||
if (message.packed === true) { | ||
if (message.packed !== undefined && message.packed !== false) { | ||
writer.uint32(16).bool(message.packed); | ||
} | ||
if (message.jstype !== 0) { | ||
if (message.jstype !== undefined && message.jstype !== 0) { | ||
writer.uint32(48).int32(message.jstype); | ||
} | ||
if (message.lazy === true) { | ||
if (message.lazy !== undefined && message.lazy !== false) { | ||
writer.uint32(40).bool(message.lazy); | ||
} | ||
if (message.unverifiedLazy === true) { | ||
if ( | ||
message.unverifiedLazy !== undefined && | ||
message.unverifiedLazy !== false | ||
) { | ||
writer.uint32(120).bool(message.unverifiedLazy); | ||
} | ||
if (message.deprecated === true) { | ||
if (message.deprecated !== undefined && message.deprecated !== false) { | ||
writer.uint32(24).bool(message.deprecated); | ||
} | ||
if (message.weak === true) { | ||
if (message.weak !== undefined && message.weak !== false) { | ||
writer.uint32(80).bool(message.weak); | ||
} | ||
if (message.debugRedact === true) { | ||
if (message.debugRedact !== undefined && message.debugRedact !== false) { | ||
writer.uint32(128).bool(message.debugRedact); | ||
} | ||
if (message.retention !== 0) { | ||
if (message.retention !== undefined && message.retention !== 0) { | ||
writer.uint32(136).int32(message.retention); | ||
@@ -796,6 +844,6 @@ } | ||
): _m0.Writer { | ||
if (message.edition !== 0) { | ||
if (message.edition !== undefined && message.edition !== 0) { | ||
writer.uint32(24).int32(message.edition); | ||
} | ||
if (message.value !== "") { | ||
if (message.value !== undefined && message.value !== "") { | ||
writer.uint32(18).string(message.value); | ||
@@ -905,3 +953,3 @@ } | ||
} | ||
if (message.deprecated === true) { | ||
if (message.deprecated !== undefined && message.deprecated !== false) { | ||
writer.uint32(264).bool(message.deprecated); | ||
@@ -970,6 +1018,9 @@ } | ||
): _m0.Writer { | ||
if (message.deprecated === true) { | ||
if (message.deprecated !== undefined && message.deprecated !== false) { | ||
writer.uint32(264).bool(message.deprecated); | ||
} | ||
if (message.idempotencyLevel !== 0) { | ||
if ( | ||
message.idempotencyLevel !== undefined && | ||
message.idempotencyLevel !== 0 | ||
) { | ||
writer.uint32(272).int32(message.idempotencyLevel); | ||
@@ -1057,18 +1108,27 @@ } | ||
} | ||
if (message.identifierValue !== "") { | ||
if ( | ||
message.identifierValue !== undefined && | ||
message.identifierValue !== "" | ||
) { | ||
writer.uint32(26).string(message.identifierValue); | ||
} | ||
if (message.positiveIntValue !== "0") { | ||
if ( | ||
message.positiveIntValue !== undefined && | ||
message.positiveIntValue !== "0" | ||
) { | ||
writer.uint32(32).uint64(message.positiveIntValue); | ||
} | ||
if (message.negativeIntValue !== "0") { | ||
if ( | ||
message.negativeIntValue !== undefined && | ||
message.negativeIntValue !== "0" | ||
) { | ||
writer.uint32(40).int64(message.negativeIntValue); | ||
} | ||
if (message.doubleValue !== 0) { | ||
if (message.doubleValue !== undefined && message.doubleValue !== 0) { | ||
writer.uint32(49).double(message.doubleValue); | ||
} | ||
if (message.stringValue.length !== 0) { | ||
if (message.stringValue !== undefined && message.stringValue.length !== 0) { | ||
writer.uint32(58).bytes(message.stringValue); | ||
} | ||
if (message.aggregateValue !== "") { | ||
if (message.aggregateValue !== undefined && message.aggregateValue !== "") { | ||
writer.uint32(66).string(message.aggregateValue); | ||
@@ -1160,3 +1220,3 @@ } | ||
} | ||
if (message.isExtension === true) { | ||
if (message.isExtension !== false) { | ||
writer.uint32(16).bool(message.isExtension); | ||
@@ -1218,18 +1278,24 @@ } | ||
): _m0.Writer { | ||
if (message.fieldPresence !== 0) { | ||
if (message.fieldPresence !== undefined && message.fieldPresence !== 0) { | ||
writer.uint32(8).int32(message.fieldPresence); | ||
} | ||
if (message.enumType !== 0) { | ||
if (message.enumType !== undefined && message.enumType !== 0) { | ||
writer.uint32(16).int32(message.enumType); | ||
} | ||
if (message.repeatedFieldEncoding !== 0) { | ||
if ( | ||
message.repeatedFieldEncoding !== undefined && | ||
message.repeatedFieldEncoding !== 0 | ||
) { | ||
writer.uint32(24).int32(message.repeatedFieldEncoding); | ||
} | ||
if (message.utf8Validation !== 0) { | ||
if (message.utf8Validation !== undefined && message.utf8Validation !== 0) { | ||
writer.uint32(32).int32(message.utf8Validation); | ||
} | ||
if (message.messageEncoding !== 0) { | ||
if ( | ||
message.messageEncoding !== undefined && | ||
message.messageEncoding !== 0 | ||
) { | ||
writer.uint32(40).int32(message.messageEncoding); | ||
} | ||
if (message.jsonFormat !== 0) { | ||
if (message.jsonFormat !== undefined && message.jsonFormat !== 0) { | ||
writer.uint32(48).int32(message.jsonFormat); | ||
@@ -1236,0 +1302,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 too big to display
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 too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
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
1566031
31939
1
+ Added@cerbos/core@0.17.1(transitive)
- Removed@cerbos/core@0.16.0(transitive)
Updated@cerbos/core@^0.17.0
Updated@grpc/grpc-js@^1.10.6