diff --git a/package-lock.json b/package-lock.json index ed1a16dd..3e597c73 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14,8 +14,8 @@ "@microsoft/api-extractor": "7.38.3", "@tsconfig/node18": "18.2.2", "@types/node": "18.18.9", - "@typescript-eslint/eslint-plugin": "6.10.0", - "@typescript-eslint/parser": "6.10.0", + "@typescript-eslint/eslint-plugin": "6.11.0", + "@typescript-eslint/parser": "6.11.0", "concurrently": "8.2.2", "eslint": "8.53.0", "eslint-import-resolver-typescript": "3.6.1", @@ -23,7 +23,7 @@ "eslint-plugin-jest": "27.6.0", "eslint-plugin-tsdoc": "0.2.17", "patch-package": "8.0.0", - "prettier": "3.0.3", + "prettier": "3.1.0", "prettier-plugin-pkg": "0.18.0", "ts-jest": "29.1.1", "ts-node": "10.9.1", @@ -1902,16 +1902,16 @@ "dev": true }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "6.10.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.10.0.tgz", - "integrity": "sha512-uoLj4g2OTL8rfUQVx2AFO1hp/zja1wABJq77P6IclQs6I/m9GLrm7jCdgzZkvWdDCQf1uEvoa8s8CupsgWQgVg==", + "version": "6.11.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.11.0.tgz", + "integrity": "sha512-uXnpZDc4VRjY4iuypDBKzW1rz9T5YBBK0snMn8MaTSNd2kMlj50LnLBABELjJiOL5YHk7ZD8hbSpI9ubzqYI0w==", "dev": true, "dependencies": { "@eslint-community/regexpp": "^4.5.1", - "@typescript-eslint/scope-manager": "6.10.0", - "@typescript-eslint/type-utils": "6.10.0", - "@typescript-eslint/utils": "6.10.0", - "@typescript-eslint/visitor-keys": "6.10.0", + "@typescript-eslint/scope-manager": "6.11.0", + "@typescript-eslint/type-utils": "6.11.0", + "@typescript-eslint/utils": "6.11.0", + "@typescript-eslint/visitor-keys": "6.11.0", "debug": "^4.3.4", "graphemer": "^1.4.0", "ignore": "^5.2.4", @@ -1937,15 +1937,15 @@ } }, "node_modules/@typescript-eslint/parser": { - "version": "6.10.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.10.0.tgz", - "integrity": "sha512-+sZwIj+s+io9ozSxIWbNB5873OSdfeBEH/FR0re14WLI6BaKuSOnnwCJ2foUiu8uXf4dRp1UqHP0vrZ1zXGrog==", + "version": "6.11.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.11.0.tgz", + "integrity": "sha512-+whEdjk+d5do5nxfxx73oanLL9ghKO3EwM9kBCkUtWMRwWuPaFv9ScuqlYfQ6pAD6ZiJhky7TZ2ZYhrMsfMxVQ==", "dev": true, "dependencies": { - "@typescript-eslint/scope-manager": "6.10.0", - "@typescript-eslint/types": "6.10.0", - "@typescript-eslint/typescript-estree": "6.10.0", - "@typescript-eslint/visitor-keys": "6.10.0", + "@typescript-eslint/scope-manager": "6.11.0", + "@typescript-eslint/types": "6.11.0", + "@typescript-eslint/typescript-estree": "6.11.0", + "@typescript-eslint/visitor-keys": "6.11.0", "debug": "^4.3.4" }, "engines": { @@ -1965,13 +1965,13 @@ } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "6.10.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.10.0.tgz", - "integrity": "sha512-TN/plV7dzqqC2iPNf1KrxozDgZs53Gfgg5ZHyw8erd6jd5Ta/JIEcdCheXFt9b1NYb93a1wmIIVW/2gLkombDg==", + "version": "6.11.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.11.0.tgz", + "integrity": "sha512-0A8KoVvIURG4uhxAdjSaxy8RdRE//HztaZdG8KiHLP8WOXSk0vlF7Pvogv+vlJA5Rnjj/wDcFENvDaHb+gKd1A==", "dev": true, "dependencies": { - "@typescript-eslint/types": "6.10.0", - "@typescript-eslint/visitor-keys": "6.10.0" + "@typescript-eslint/types": "6.11.0", + "@typescript-eslint/visitor-keys": "6.11.0" }, "engines": { "node": "^16.0.0 || >=18.0.0" @@ -1982,13 +1982,13 @@ } }, "node_modules/@typescript-eslint/type-utils": { - "version": "6.10.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-6.10.0.tgz", - "integrity": "sha512-wYpPs3hgTFblMYwbYWPT3eZtaDOjbLyIYuqpwuLBBqhLiuvJ+9sEp2gNRJEtR5N/c9G1uTtQQL5AhV0fEPJYcg==", + "version": "6.11.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-6.11.0.tgz", + "integrity": "sha512-nA4IOXwZtqBjIoYrJcYxLRO+F9ri+leVGoJcMW1uqr4r1Hq7vW5cyWrA43lFbpRvQ9XgNrnfLpIkO3i1emDBIA==", "dev": true, "dependencies": { - "@typescript-eslint/typescript-estree": "6.10.0", - "@typescript-eslint/utils": "6.10.0", + "@typescript-eslint/typescript-estree": "6.11.0", + "@typescript-eslint/utils": "6.11.0", "debug": "^4.3.4", "ts-api-utils": "^1.0.1" }, @@ -2009,9 +2009,9 @@ } }, "node_modules/@typescript-eslint/types": { - "version": "6.10.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.10.0.tgz", - "integrity": "sha512-36Fq1PWh9dusgo3vH7qmQAj5/AZqARky1Wi6WpINxB6SkQdY5vQoT2/7rW7uBIsPDcvvGCLi4r10p0OJ7ITAeg==", + "version": "6.11.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.11.0.tgz", + "integrity": "sha512-ZbEzuD4DwEJxwPqhv3QULlRj8KYTAnNsXxmfuUXFCxZmO6CF2gM/y+ugBSAQhrqaJL3M+oe4owdWunaHM6beqA==", "dev": true, "engines": { "node": "^16.0.0 || >=18.0.0" @@ -2022,13 +2022,13 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "6.10.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.10.0.tgz", - "integrity": "sha512-ek0Eyuy6P15LJVeghbWhSrBCj/vJpPXXR+EpaRZqou7achUWL8IdYnMSC5WHAeTWswYQuP2hAZgij/bC9fanBg==", + "version": "6.11.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.11.0.tgz", + "integrity": "sha512-Aezzv1o2tWJwvZhedzvD5Yv7+Lpu1by/U1LZ5gLc4tCx8jUmuSCMioPFRjliN/6SJIvY6HpTtJIWubKuYYYesQ==", "dev": true, "dependencies": { - "@typescript-eslint/types": "6.10.0", - "@typescript-eslint/visitor-keys": "6.10.0", + "@typescript-eslint/types": "6.11.0", + "@typescript-eslint/visitor-keys": "6.11.0", "debug": "^4.3.4", "globby": "^11.1.0", "is-glob": "^4.0.3", @@ -2049,17 +2049,17 @@ } }, "node_modules/@typescript-eslint/utils": { - "version": "6.10.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.10.0.tgz", - "integrity": "sha512-v+pJ1/RcVyRc0o4wAGux9x42RHmAjIGzPRo538Z8M1tVx6HOnoQBCX/NoadHQlZeC+QO2yr4nNSFWOoraZCAyg==", + "version": "6.11.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.11.0.tgz", + "integrity": "sha512-p23ibf68fxoZy605dc0dQAEoUsoiNoP3MD9WQGiHLDuTSOuqoTsa4oAy+h3KDkTcxbbfOtUjb9h3Ta0gT4ug2g==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.4.0", "@types/json-schema": "^7.0.12", "@types/semver": "^7.5.0", - "@typescript-eslint/scope-manager": "6.10.0", - "@typescript-eslint/types": "6.10.0", - "@typescript-eslint/typescript-estree": "6.10.0", + "@typescript-eslint/scope-manager": "6.11.0", + "@typescript-eslint/types": "6.11.0", + "@typescript-eslint/typescript-estree": "6.11.0", "semver": "^7.5.4" }, "engines": { @@ -2074,12 +2074,12 @@ } }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "6.10.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.10.0.tgz", - "integrity": "sha512-xMGluxQIEtOM7bqFCo+rCMh5fqI+ZxV5RUUOa29iVPz1OgCZrtc7rFnz5cLUazlkPKYqX+75iuDq7m0HQ48nCg==", + "version": "6.11.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.11.0.tgz", + "integrity": "sha512-+SUN/W7WjBr05uRxPggJPSzyB8zUpaYo2hByKasWbqr3PM8AXfZt8UHdNpBS1v9SA62qnSSMF3380SwDqqprgQ==", "dev": true, "dependencies": { - "@typescript-eslint/types": "6.10.0", + "@typescript-eslint/types": "6.11.0", "eslint-visitor-keys": "^3.4.1" }, "engines": { @@ -6008,9 +6008,9 @@ } }, "node_modules/prettier": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.0.3.tgz", - "integrity": "sha512-L/4pUDMxcNa8R/EthV08Zt42WBO4h1rarVtK0K+QJG0X187OLo7l699jWw0GKuwzkPQ//jMFA/8Xm6Fh3J/DAg==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.1.0.tgz", + "integrity": "sha512-TQLvXjq5IAibjh8EpBIkNKxO749UEWABoiIZehEPiY4GNpVdhaFKqSTu+QrlU6D2dPAfubRmtJTi4K4YkQ5eXw==", "dev": true, "bin": { "prettier": "bin/prettier.cjs" diff --git a/package.json b/package.json index c529ba20..02402f17 100644 --- a/package.json +++ b/package.json @@ -57,8 +57,8 @@ "@microsoft/api-extractor": "7.38.3", "@tsconfig/node18": "18.2.2", "@types/node": "18.18.9", - "@typescript-eslint/eslint-plugin": "6.10.0", - "@typescript-eslint/parser": "6.10.0", + "@typescript-eslint/eslint-plugin": "6.11.0", + "@typescript-eslint/parser": "6.11.0", "concurrently": "8.2.2", "eslint": "8.53.0", "eslint-import-resolver-typescript": "3.6.1", @@ -66,7 +66,7 @@ "eslint-plugin-jest": "27.6.0", "eslint-plugin-tsdoc": "0.2.17", "patch-package": "8.0.0", - "prettier": "3.0.3", + "prettier": "3.1.0", "prettier-plugin-pkg": "0.18.0", "ts-jest": "29.1.1", "ts-node": "10.9.1", diff --git a/packages/files/src/protobuf/cerbos/policy/v1/policy.ts b/packages/files/src/protobuf/cerbos/policy/v1/policy.ts index 283181ae..b8d13cf5 100644 --- a/packages/files/src/protobuf/cerbos/policy/v1/policy.ts +++ b/packages/files/src/protobuf/cerbos/policy/v1/policy.ts @@ -168,21 +168,23 @@ export const Policy = { resourcePolicy: ResourcePolicy.fromJSON(object.resourcePolicy), } : isSet(object.principalPolicy) - ? { - $case: "principalPolicy", - principalPolicy: PrincipalPolicy.fromJSON(object.principalPolicy), - } - : isSet(object.derivedRoles) - ? { - $case: "derivedRoles", - derivedRoles: DerivedRoles.fromJSON(object.derivedRoles), - } - : isSet(object.exportVariables) - ? { - $case: "exportVariables", - exportVariables: ExportVariables.fromJSON(object.exportVariables), - } - : undefined, + ? { + $case: "principalPolicy", + principalPolicy: PrincipalPolicy.fromJSON(object.principalPolicy), + } + : isSet(object.derivedRoles) + ? { + $case: "derivedRoles", + derivedRoles: DerivedRoles.fromJSON(object.derivedRoles), + } + : isSet(object.exportVariables) + ? { + $case: "exportVariables", + exportVariables: ExportVariables.fromJSON( + object.exportVariables, + ), + } + : undefined, variables: isObject(object.variables) ? Object.entries(object.variables).reduce<{ [key: string]: string }>( (acc, [key, value]) => { @@ -422,8 +424,8 @@ export const Condition = { condition: isSet(object.match) ? { $case: "match", match: Match.fromJSON(object.match) } : isSet(object.script) - ? { $case: "script", script: globalThis.String(object.script) } - : undefined, + ? { $case: "script", script: globalThis.String(object.script) } + : undefined, }; }, }; @@ -434,12 +436,12 @@ export const Match = { op: isSet(object.all) ? { $case: "all", all: Match_ExprList.fromJSON(object.all) } : isSet(object.any) - ? { $case: "any", any: Match_ExprList.fromJSON(object.any) } - : isSet(object.none) - ? { $case: "none", none: Match_ExprList.fromJSON(object.none) } - : isSet(object.expr) - ? { $case: "expr", expr: globalThis.String(object.expr) } - : undefined, + ? { $case: "any", any: Match_ExprList.fromJSON(object.any) } + : isSet(object.none) + ? { $case: "none", none: Match_ExprList.fromJSON(object.none) } + : isSet(object.expr) + ? { $case: "expr", expr: globalThis.String(object.expr) } + : undefined, }; }, }; diff --git a/packages/files/src/protobuf/validate/validate.ts b/packages/files/src/protobuf/validate/validate.ts index f9021de7..07a0e21d 100644 --- a/packages/files/src/protobuf/validate/validate.ts +++ b/packages/files/src/protobuf/validate/validate.ts @@ -308,61 +308,117 @@ export const FieldRules = { type: isSet(object.float) ? { $case: "float", float: FloatRules.fromJSON(object.float) } : isSet(object.double) - ? { $case: "double", double: DoubleRules.fromJSON(object.double) } - : isSet(object.int32) - ? { $case: "int32", int32: Int32Rules.fromJSON(object.int32) } - : isSet(object.int64) - ? { $case: "int64", int64: Int64Rules.fromJSON(object.int64) } - : isSet(object.uint32) - ? { $case: "uint32", uint32: UInt32Rules.fromJSON(object.uint32) } - : isSet(object.uint64) - ? { $case: "uint64", uint64: UInt64Rules.fromJSON(object.uint64) } - : isSet(object.sint32) - ? { $case: "sint32", sint32: SInt32Rules.fromJSON(object.sint32) } - : isSet(object.sint64) - ? { $case: "sint64", sint64: SInt64Rules.fromJSON(object.sint64) } - : isSet(object.fixed32) - ? { $case: "fixed32", fixed32: Fixed32Rules.fromJSON(object.fixed32) } - : isSet(object.fixed64) - ? { $case: "fixed64", fixed64: Fixed64Rules.fromJSON(object.fixed64) } - : isSet(object.sfixed32) - ? { - $case: "sfixed32", - sfixed32: SFixed32Rules.fromJSON(object.sfixed32), - } - : isSet(object.sfixed64) - ? { - $case: "sfixed64", - sfixed64: SFixed64Rules.fromJSON(object.sfixed64), - } - : isSet(object.bool) - ? { $case: "bool", bool: BoolRules.fromJSON(object.bool) } - : isSet(object.string) - ? { $case: "string", string: StringRules.fromJSON(object.string) } - : isSet(object.bytes) - ? { $case: "bytes", bytes: BytesRules.fromJSON(object.bytes) } - : isSet(object.enum) - ? { $case: "enum", enum: EnumRules.fromJSON(object.enum) } - : isSet(object.repeated) - ? { - $case: "repeated", - repeated: RepeatedRules.fromJSON(object.repeated), - } - : isSet(object.map) - ? { $case: "map", map: MapRules.fromJSON(object.map) } - : isSet(object.any) - ? { $case: "any", any: AnyRules.fromJSON(object.any) } - : isSet(object.duration) - ? { - $case: "duration", - duration: DurationRules.fromJSON(object.duration), - } - : isSet(object.timestamp) - ? { - $case: "timestamp", - timestamp: TimestampRules.fromJSON(object.timestamp), - } - : undefined, + ? { $case: "double", double: DoubleRules.fromJSON(object.double) } + : isSet(object.int32) + ? { $case: "int32", int32: Int32Rules.fromJSON(object.int32) } + : isSet(object.int64) + ? { $case: "int64", int64: Int64Rules.fromJSON(object.int64) } + : isSet(object.uint32) + ? { + $case: "uint32", + uint32: UInt32Rules.fromJSON(object.uint32), + } + : isSet(object.uint64) + ? { + $case: "uint64", + uint64: UInt64Rules.fromJSON(object.uint64), + } + : isSet(object.sint32) + ? { + $case: "sint32", + sint32: SInt32Rules.fromJSON(object.sint32), + } + : isSet(object.sint64) + ? { + $case: "sint64", + sint64: SInt64Rules.fromJSON(object.sint64), + } + : isSet(object.fixed32) + ? { + $case: "fixed32", + fixed32: Fixed32Rules.fromJSON(object.fixed32), + } + : isSet(object.fixed64) + ? { + $case: "fixed64", + fixed64: Fixed64Rules.fromJSON(object.fixed64), + } + : isSet(object.sfixed32) + ? { + $case: "sfixed32", + sfixed32: SFixed32Rules.fromJSON( + object.sfixed32, + ), + } + : isSet(object.sfixed64) + ? { + $case: "sfixed64", + sfixed64: SFixed64Rules.fromJSON( + object.sfixed64, + ), + } + : isSet(object.bool) + ? { + $case: "bool", + bool: BoolRules.fromJSON(object.bool), + } + : isSet(object.string) + ? { + $case: "string", + string: StringRules.fromJSON( + object.string, + ), + } + : isSet(object.bytes) + ? { + $case: "bytes", + bytes: BytesRules.fromJSON( + object.bytes, + ), + } + : isSet(object.enum) + ? { + $case: "enum", + enum: EnumRules.fromJSON(object.enum), + } + : isSet(object.repeated) + ? { + $case: "repeated", + repeated: RepeatedRules.fromJSON( + object.repeated, + ), + } + : isSet(object.map) + ? { + $case: "map", + map: MapRules.fromJSON( + object.map, + ), + } + : isSet(object.any) + ? { + $case: "any", + any: AnyRules.fromJSON( + object.any, + ), + } + : isSet(object.duration) + ? { + $case: "duration", + duration: + DurationRules.fromJSON( + object.duration, + ), + } + : isSet(object.timestamp) + ? { + $case: "timestamp", + timestamp: + TimestampRules.fromJSON( + object.timestamp, + ), + } + : undefined, }; }, }; @@ -661,27 +717,38 @@ export const StringRules = { wellKnown: isSet(object.email) ? { $case: "email", email: globalThis.Boolean(object.email) } : isSet(object.hostname) - ? { $case: "hostname", hostname: globalThis.Boolean(object.hostname) } - : isSet(object.ip) - ? { $case: "ip", ip: globalThis.Boolean(object.ip) } - : isSet(object.ipv4) - ? { $case: "ipv4", ipv4: globalThis.Boolean(object.ipv4) } - : isSet(object.ipv6) - ? { $case: "ipv6", ipv6: globalThis.Boolean(object.ipv6) } - : isSet(object.uri) - ? { $case: "uri", uri: globalThis.Boolean(object.uri) } - : isSet(object.uriRef) - ? { $case: "uriRef", uriRef: globalThis.Boolean(object.uriRef) } - : isSet(object.address) - ? { $case: "address", address: globalThis.Boolean(object.address) } - : isSet(object.uuid) - ? { $case: "uuid", uuid: globalThis.Boolean(object.uuid) } - : isSet(object.wellKnownRegex) - ? { - $case: "wellKnownRegex", - wellKnownRegex: knownRegexFromJSON(object.wellKnownRegex), - } - : undefined, + ? { $case: "hostname", hostname: globalThis.Boolean(object.hostname) } + : isSet(object.ip) + ? { $case: "ip", ip: globalThis.Boolean(object.ip) } + : isSet(object.ipv4) + ? { $case: "ipv4", ipv4: globalThis.Boolean(object.ipv4) } + : isSet(object.ipv6) + ? { $case: "ipv6", ipv6: globalThis.Boolean(object.ipv6) } + : isSet(object.uri) + ? { $case: "uri", uri: globalThis.Boolean(object.uri) } + : isSet(object.uriRef) + ? { + $case: "uriRef", + uriRef: globalThis.Boolean(object.uriRef), + } + : isSet(object.address) + ? { + $case: "address", + address: globalThis.Boolean(object.address), + } + : isSet(object.uuid) + ? { + $case: "uuid", + uuid: globalThis.Boolean(object.uuid), + } + : isSet(object.wellKnownRegex) + ? { + $case: "wellKnownRegex", + wellKnownRegex: knownRegexFromJSON( + object.wellKnownRegex, + ), + } + : undefined, strict: isSet(object.strict) ? globalThis.Boolean(object.strict) : false, ignoreEmpty: isSet(object.ignoreEmpty) ? globalThis.Boolean(object.ignoreEmpty) @@ -718,10 +785,10 @@ export const BytesRules = { wellKnown: isSet(object.ip) ? { $case: "ip", ip: globalThis.Boolean(object.ip) } : isSet(object.ipv4) - ? { $case: "ipv4", ipv4: globalThis.Boolean(object.ipv4) } - : isSet(object.ipv6) - ? { $case: "ipv6", ipv6: globalThis.Boolean(object.ipv6) } - : undefined, + ? { $case: "ipv4", ipv4: globalThis.Boolean(object.ipv4) } + : isSet(object.ipv6) + ? { $case: "ipv6", ipv6: globalThis.Boolean(object.ipv6) } + : undefined, ignoreEmpty: isSet(object.ignoreEmpty) ? globalThis.Boolean(object.ignoreEmpty) : false, diff --git a/packages/http/src/protobuf/cerbos/audit/v1/audit.ts b/packages/http/src/protobuf/cerbos/audit/v1/audit.ts index eca9ac50..53455446 100644 --- a/packages/http/src/protobuf/cerbos/audit/v1/audit.ts +++ b/packages/http/src/protobuf/cerbos/audit/v1/audit.ts @@ -170,13 +170,13 @@ export const DecisionLogEntry = { ), } : isSet(object.planResources) - ? { - $case: "planResources", - planResources: DecisionLogEntry_PlanResources.fromJSON( - object.planResources, - ), - } - : undefined, + ? { + $case: "planResources", + planResources: DecisionLogEntry_PlanResources.fromJSON( + object.planResources, + ), + } + : undefined, metadata: isObject(object.metadata) ? Object.entries(object.metadata).reduce<{ [key: string]: MetaValues }>( (acc, [key, value]) => { diff --git a/packages/http/src/protobuf/cerbos/engine/v1/engine.ts b/packages/http/src/protobuf/cerbos/engine/v1/engine.ts index f7438bff..dd7919fd 100644 --- a/packages/http/src/protobuf/cerbos/engine/v1/engine.ts +++ b/packages/http/src/protobuf/cerbos/engine/v1/engine.ts @@ -344,15 +344,18 @@ export const PlanResourcesFilter_Expression_Operand = { node: isSet(object.value) ? { $case: "value", value: object.value } : isSet(object.expression) - ? { - $case: "expression", - expression: PlanResourcesFilter_Expression.fromJSON( - object.expression, - ), - } - : isSet(object.variable) - ? { $case: "variable", variable: globalThis.String(object.variable) } - : undefined, + ? { + $case: "expression", + expression: PlanResourcesFilter_Expression.fromJSON( + object.expression, + ), + } + : isSet(object.variable) + ? { + $case: "variable", + variable: globalThis.String(object.variable), + } + : undefined, }; }, diff --git a/packages/http/src/protobuf/cerbos/policy/v1/policy.ts b/packages/http/src/protobuf/cerbos/policy/v1/policy.ts index 612873e4..09499f1a 100644 --- a/packages/http/src/protobuf/cerbos/policy/v1/policy.ts +++ b/packages/http/src/protobuf/cerbos/policy/v1/policy.ts @@ -168,21 +168,23 @@ export const Policy = { resourcePolicy: ResourcePolicy.fromJSON(object.resourcePolicy), } : isSet(object.principalPolicy) - ? { - $case: "principalPolicy", - principalPolicy: PrincipalPolicy.fromJSON(object.principalPolicy), - } - : isSet(object.derivedRoles) - ? { - $case: "derivedRoles", - derivedRoles: DerivedRoles.fromJSON(object.derivedRoles), - } - : isSet(object.exportVariables) - ? { - $case: "exportVariables", - exportVariables: ExportVariables.fromJSON(object.exportVariables), - } - : undefined, + ? { + $case: "principalPolicy", + principalPolicy: PrincipalPolicy.fromJSON(object.principalPolicy), + } + : isSet(object.derivedRoles) + ? { + $case: "derivedRoles", + derivedRoles: DerivedRoles.fromJSON(object.derivedRoles), + } + : isSet(object.exportVariables) + ? { + $case: "exportVariables", + exportVariables: ExportVariables.fromJSON( + object.exportVariables, + ), + } + : undefined, variables: isObject(object.variables) ? Object.entries(object.variables).reduce<{ [key: string]: string }>( (acc, [key, value]) => { @@ -704,8 +706,8 @@ export const Condition = { condition: isSet(object.match) ? { $case: "match", match: Match.fromJSON(object.match) } : isSet(object.script) - ? { $case: "script", script: globalThis.String(object.script) } - : undefined, + ? { $case: "script", script: globalThis.String(object.script) } + : undefined, }; }, @@ -727,12 +729,12 @@ export const Match = { op: isSet(object.all) ? { $case: "all", all: Match_ExprList.fromJSON(object.all) } : isSet(object.any) - ? { $case: "any", any: Match_ExprList.fromJSON(object.any) } - : isSet(object.none) - ? { $case: "none", none: Match_ExprList.fromJSON(object.none) } - : isSet(object.expr) - ? { $case: "expr", expr: globalThis.String(object.expr) } - : undefined, + ? { $case: "any", any: Match_ExprList.fromJSON(object.any) } + : isSet(object.none) + ? { $case: "none", none: Match_ExprList.fromJSON(object.none) } + : isSet(object.expr) + ? { $case: "expr", expr: globalThis.String(object.expr) } + : undefined, }; }, diff --git a/packages/http/src/protobuf/cerbos/request/v1/request.ts b/packages/http/src/protobuf/cerbos/request/v1/request.ts index 89a92479..082c5b37 100644 --- a/packages/http/src/protobuf/cerbos/request/v1/request.ts +++ b/packages/http/src/protobuf/cerbos/request/v1/request.ts @@ -596,17 +596,17 @@ export const ListAuditLogEntriesRequest = { filter: isSet(object.tail) ? { $case: "tail", tail: globalThis.Number(object.tail) } : isSet(object.between) - ? { - $case: "between", - between: ListAuditLogEntriesRequest_TimeRange.fromJSON( - object.between, - ), - } - : isSet(object.since) - ? { $case: "since", since: Duration.fromJSON(object.since) } - : isSet(object.lookup) - ? { $case: "lookup", lookup: globalThis.String(object.lookup) } - : undefined, + ? { + $case: "between", + between: ListAuditLogEntriesRequest_TimeRange.fromJSON( + object.between, + ), + } + : isSet(object.since) + ? { $case: "since", since: Duration.fromJSON(object.since) } + : isSet(object.lookup) + ? { $case: "lookup", lookup: globalThis.String(object.lookup) } + : undefined, }; }, diff --git a/packages/http/src/protobuf/cerbos/response/v1/response.ts b/packages/http/src/protobuf/cerbos/response/v1/response.ts index efdc59d4..6f820e2f 100644 --- a/packages/http/src/protobuf/cerbos/response/v1/response.ts +++ b/packages/http/src/protobuf/cerbos/response/v1/response.ts @@ -881,13 +881,13 @@ export const ListAuditLogEntriesResponse = { accessLogEntry: AccessLogEntry.fromJSON(object.accessLogEntry), } : isSet(object.decisionLogEntry) - ? { - $case: "decisionLogEntry", - decisionLogEntry: DecisionLogEntry.fromJSON( - object.decisionLogEntry, - ), - } - : undefined, + ? { + $case: "decisionLogEntry", + decisionLogEntry: DecisionLogEntry.fromJSON( + object.decisionLogEntry, + ), + } + : undefined, }; }, diff --git a/packages/http/src/protobuf/google/api/http.ts b/packages/http/src/protobuf/google/api/http.ts index 806d54f0..6cdca781 100644 --- a/packages/http/src/protobuf/google/api/http.ts +++ b/packages/http/src/protobuf/google/api/http.ts @@ -31,16 +31,19 @@ export const HttpRule = { pattern: isSet(object.get) ? { $case: "get", get: globalThis.String(object.get) } : isSet(object.put) - ? { $case: "put", put: globalThis.String(object.put) } - : isSet(object.post) - ? { $case: "post", post: globalThis.String(object.post) } - : isSet(object.delete) - ? { $case: "delete", delete: globalThis.String(object.delete) } - : isSet(object.patch) - ? { $case: "patch", patch: globalThis.String(object.patch) } - : isSet(object.custom) - ? { $case: "custom", custom: CustomHttpPattern.fromJSON(object.custom) } - : undefined, + ? { $case: "put", put: globalThis.String(object.put) } + : isSet(object.post) + ? { $case: "post", post: globalThis.String(object.post) } + : isSet(object.delete) + ? { $case: "delete", delete: globalThis.String(object.delete) } + : isSet(object.patch) + ? { $case: "patch", patch: globalThis.String(object.patch) } + : isSet(object.custom) + ? { + $case: "custom", + custom: CustomHttpPattern.fromJSON(object.custom), + } + : undefined, body: isSet(object.body) ? globalThis.String(object.body) : "", responseBody: isSet(object.responseBody) ? globalThis.String(object.responseBody) diff --git a/packages/http/src/protobuf/google/protobuf/struct.ts b/packages/http/src/protobuf/google/protobuf/struct.ts index a3e20744..ab8c1646 100644 --- a/packages/http/src/protobuf/google/protobuf/struct.ts +++ b/packages/http/src/protobuf/google/protobuf/struct.ts @@ -136,25 +136,25 @@ export const Value = { kind: isSet(object.nullValue) ? { $case: "nullValue", nullValue: nullValueFromJSON(object.nullValue) } : isSet(object.numberValue) - ? { - $case: "numberValue", - numberValue: globalThis.Number(object.numberValue), - } - : isSet(object.stringValue) - ? { - $case: "stringValue", - stringValue: globalThis.String(object.stringValue), - } - : isSet(object.boolValue) - ? { - $case: "boolValue", - boolValue: globalThis.Boolean(object.boolValue), - } - : isSet(object.structValue) - ? { $case: "structValue", structValue: object.structValue } - : isSet(object.listValue) - ? { $case: "listValue", listValue: [...object.listValue] } - : undefined, + ? { + $case: "numberValue", + numberValue: globalThis.Number(object.numberValue), + } + : isSet(object.stringValue) + ? { + $case: "stringValue", + stringValue: globalThis.String(object.stringValue), + } + : isSet(object.boolValue) + ? { + $case: "boolValue", + boolValue: globalThis.Boolean(object.boolValue), + } + : isSet(object.structValue) + ? { $case: "structValue", structValue: object.structValue } + : isSet(object.listValue) + ? { $case: "listValue", listValue: [...object.listValue] } + : undefined, }; }, diff --git a/packages/http/src/protobuf/validate/validate.ts b/packages/http/src/protobuf/validate/validate.ts index c32a3969..a26e4d69 100644 --- a/packages/http/src/protobuf/validate/validate.ts +++ b/packages/http/src/protobuf/validate/validate.ts @@ -323,61 +323,117 @@ export const FieldRules = { type: isSet(object.float) ? { $case: "float", float: FloatRules.fromJSON(object.float) } : isSet(object.double) - ? { $case: "double", double: DoubleRules.fromJSON(object.double) } - : isSet(object.int32) - ? { $case: "int32", int32: Int32Rules.fromJSON(object.int32) } - : isSet(object.int64) - ? { $case: "int64", int64: Int64Rules.fromJSON(object.int64) } - : isSet(object.uint32) - ? { $case: "uint32", uint32: UInt32Rules.fromJSON(object.uint32) } - : isSet(object.uint64) - ? { $case: "uint64", uint64: UInt64Rules.fromJSON(object.uint64) } - : isSet(object.sint32) - ? { $case: "sint32", sint32: SInt32Rules.fromJSON(object.sint32) } - : isSet(object.sint64) - ? { $case: "sint64", sint64: SInt64Rules.fromJSON(object.sint64) } - : isSet(object.fixed32) - ? { $case: "fixed32", fixed32: Fixed32Rules.fromJSON(object.fixed32) } - : isSet(object.fixed64) - ? { $case: "fixed64", fixed64: Fixed64Rules.fromJSON(object.fixed64) } - : isSet(object.sfixed32) - ? { - $case: "sfixed32", - sfixed32: SFixed32Rules.fromJSON(object.sfixed32), - } - : isSet(object.sfixed64) - ? { - $case: "sfixed64", - sfixed64: SFixed64Rules.fromJSON(object.sfixed64), - } - : isSet(object.bool) - ? { $case: "bool", bool: BoolRules.fromJSON(object.bool) } - : isSet(object.string) - ? { $case: "string", string: StringRules.fromJSON(object.string) } - : isSet(object.bytes) - ? { $case: "bytes", bytes: BytesRules.fromJSON(object.bytes) } - : isSet(object.enum) - ? { $case: "enum", enum: EnumRules.fromJSON(object.enum) } - : isSet(object.repeated) - ? { - $case: "repeated", - repeated: RepeatedRules.fromJSON(object.repeated), - } - : isSet(object.map) - ? { $case: "map", map: MapRules.fromJSON(object.map) } - : isSet(object.any) - ? { $case: "any", any: AnyRules.fromJSON(object.any) } - : isSet(object.duration) - ? { - $case: "duration", - duration: DurationRules.fromJSON(object.duration), - } - : isSet(object.timestamp) - ? { - $case: "timestamp", - timestamp: TimestampRules.fromJSON(object.timestamp), - } - : undefined, + ? { $case: "double", double: DoubleRules.fromJSON(object.double) } + : isSet(object.int32) + ? { $case: "int32", int32: Int32Rules.fromJSON(object.int32) } + : isSet(object.int64) + ? { $case: "int64", int64: Int64Rules.fromJSON(object.int64) } + : isSet(object.uint32) + ? { + $case: "uint32", + uint32: UInt32Rules.fromJSON(object.uint32), + } + : isSet(object.uint64) + ? { + $case: "uint64", + uint64: UInt64Rules.fromJSON(object.uint64), + } + : isSet(object.sint32) + ? { + $case: "sint32", + sint32: SInt32Rules.fromJSON(object.sint32), + } + : isSet(object.sint64) + ? { + $case: "sint64", + sint64: SInt64Rules.fromJSON(object.sint64), + } + : isSet(object.fixed32) + ? { + $case: "fixed32", + fixed32: Fixed32Rules.fromJSON(object.fixed32), + } + : isSet(object.fixed64) + ? { + $case: "fixed64", + fixed64: Fixed64Rules.fromJSON(object.fixed64), + } + : isSet(object.sfixed32) + ? { + $case: "sfixed32", + sfixed32: SFixed32Rules.fromJSON( + object.sfixed32, + ), + } + : isSet(object.sfixed64) + ? { + $case: "sfixed64", + sfixed64: SFixed64Rules.fromJSON( + object.sfixed64, + ), + } + : isSet(object.bool) + ? { + $case: "bool", + bool: BoolRules.fromJSON(object.bool), + } + : isSet(object.string) + ? { + $case: "string", + string: StringRules.fromJSON( + object.string, + ), + } + : isSet(object.bytes) + ? { + $case: "bytes", + bytes: BytesRules.fromJSON( + object.bytes, + ), + } + : isSet(object.enum) + ? { + $case: "enum", + enum: EnumRules.fromJSON(object.enum), + } + : isSet(object.repeated) + ? { + $case: "repeated", + repeated: RepeatedRules.fromJSON( + object.repeated, + ), + } + : isSet(object.map) + ? { + $case: "map", + map: MapRules.fromJSON( + object.map, + ), + } + : isSet(object.any) + ? { + $case: "any", + any: AnyRules.fromJSON( + object.any, + ), + } + : isSet(object.duration) + ? { + $case: "duration", + duration: + DurationRules.fromJSON( + object.duration, + ), + } + : isSet(object.timestamp) + ? { + $case: "timestamp", + timestamp: + TimestampRules.fromJSON( + object.timestamp, + ), + } + : undefined, }; }, @@ -1103,27 +1159,38 @@ export const StringRules = { wellKnown: isSet(object.email) ? { $case: "email", email: globalThis.Boolean(object.email) } : isSet(object.hostname) - ? { $case: "hostname", hostname: globalThis.Boolean(object.hostname) } - : isSet(object.ip) - ? { $case: "ip", ip: globalThis.Boolean(object.ip) } - : isSet(object.ipv4) - ? { $case: "ipv4", ipv4: globalThis.Boolean(object.ipv4) } - : isSet(object.ipv6) - ? { $case: "ipv6", ipv6: globalThis.Boolean(object.ipv6) } - : isSet(object.uri) - ? { $case: "uri", uri: globalThis.Boolean(object.uri) } - : isSet(object.uriRef) - ? { $case: "uriRef", uriRef: globalThis.Boolean(object.uriRef) } - : isSet(object.address) - ? { $case: "address", address: globalThis.Boolean(object.address) } - : isSet(object.uuid) - ? { $case: "uuid", uuid: globalThis.Boolean(object.uuid) } - : isSet(object.wellKnownRegex) - ? { - $case: "wellKnownRegex", - wellKnownRegex: knownRegexFromJSON(object.wellKnownRegex), - } - : undefined, + ? { $case: "hostname", hostname: globalThis.Boolean(object.hostname) } + : isSet(object.ip) + ? { $case: "ip", ip: globalThis.Boolean(object.ip) } + : isSet(object.ipv4) + ? { $case: "ipv4", ipv4: globalThis.Boolean(object.ipv4) } + : isSet(object.ipv6) + ? { $case: "ipv6", ipv6: globalThis.Boolean(object.ipv6) } + : isSet(object.uri) + ? { $case: "uri", uri: globalThis.Boolean(object.uri) } + : isSet(object.uriRef) + ? { + $case: "uriRef", + uriRef: globalThis.Boolean(object.uriRef), + } + : isSet(object.address) + ? { + $case: "address", + address: globalThis.Boolean(object.address), + } + : isSet(object.uuid) + ? { + $case: "uuid", + uuid: globalThis.Boolean(object.uuid), + } + : isSet(object.wellKnownRegex) + ? { + $case: "wellKnownRegex", + wellKnownRegex: knownRegexFromJSON( + object.wellKnownRegex, + ), + } + : undefined, strict: isSet(object.strict) ? globalThis.Boolean(object.strict) : false, ignoreEmpty: isSet(object.ignoreEmpty) ? globalThis.Boolean(object.ignoreEmpty) @@ -1243,10 +1310,10 @@ export const BytesRules = { wellKnown: isSet(object.ip) ? { $case: "ip", ip: globalThis.Boolean(object.ip) } : isSet(object.ipv4) - ? { $case: "ipv4", ipv4: globalThis.Boolean(object.ipv4) } - : isSet(object.ipv6) - ? { $case: "ipv6", ipv6: globalThis.Boolean(object.ipv6) } - : undefined, + ? { $case: "ipv4", ipv4: globalThis.Boolean(object.ipv4) } + : isSet(object.ipv6) + ? { $case: "ipv6", ipv6: globalThis.Boolean(object.ipv6) } + : undefined, ignoreEmpty: isSet(object.ignoreEmpty) ? globalThis.Boolean(object.ignoreEmpty) : false, diff --git a/packages/lite/src/protobuf/cerbos/engine/v1/engine.ts b/packages/lite/src/protobuf/cerbos/engine/v1/engine.ts index 660bdaff..3b2a9297 100644 --- a/packages/lite/src/protobuf/cerbos/engine/v1/engine.ts +++ b/packages/lite/src/protobuf/cerbos/engine/v1/engine.ts @@ -252,15 +252,18 @@ export const PlanResourcesFilter_Expression_Operand = { node: isSet(object.value) ? { $case: "value", value: object.value } : isSet(object.expression) - ? { - $case: "expression", - expression: PlanResourcesFilter_Expression.fromJSON( - object.expression, - ), - } - : isSet(object.variable) - ? { $case: "variable", variable: globalThis.String(object.variable) } - : undefined, + ? { + $case: "expression", + expression: PlanResourcesFilter_Expression.fromJSON( + object.expression, + ), + } + : isSet(object.variable) + ? { + $case: "variable", + variable: globalThis.String(object.variable), + } + : undefined, }; }, diff --git a/packages/lite/src/protobuf/google/api/http.ts b/packages/lite/src/protobuf/google/api/http.ts index 806d54f0..6cdca781 100644 --- a/packages/lite/src/protobuf/google/api/http.ts +++ b/packages/lite/src/protobuf/google/api/http.ts @@ -31,16 +31,19 @@ export const HttpRule = { pattern: isSet(object.get) ? { $case: "get", get: globalThis.String(object.get) } : isSet(object.put) - ? { $case: "put", put: globalThis.String(object.put) } - : isSet(object.post) - ? { $case: "post", post: globalThis.String(object.post) } - : isSet(object.delete) - ? { $case: "delete", delete: globalThis.String(object.delete) } - : isSet(object.patch) - ? { $case: "patch", patch: globalThis.String(object.patch) } - : isSet(object.custom) - ? { $case: "custom", custom: CustomHttpPattern.fromJSON(object.custom) } - : undefined, + ? { $case: "put", put: globalThis.String(object.put) } + : isSet(object.post) + ? { $case: "post", post: globalThis.String(object.post) } + : isSet(object.delete) + ? { $case: "delete", delete: globalThis.String(object.delete) } + : isSet(object.patch) + ? { $case: "patch", patch: globalThis.String(object.patch) } + : isSet(object.custom) + ? { + $case: "custom", + custom: CustomHttpPattern.fromJSON(object.custom), + } + : undefined, body: isSet(object.body) ? globalThis.String(object.body) : "", responseBody: isSet(object.responseBody) ? globalThis.String(object.responseBody) diff --git a/packages/lite/src/protobuf/google/protobuf/struct.ts b/packages/lite/src/protobuf/google/protobuf/struct.ts index a3e20744..ab8c1646 100644 --- a/packages/lite/src/protobuf/google/protobuf/struct.ts +++ b/packages/lite/src/protobuf/google/protobuf/struct.ts @@ -136,25 +136,25 @@ export const Value = { kind: isSet(object.nullValue) ? { $case: "nullValue", nullValue: nullValueFromJSON(object.nullValue) } : isSet(object.numberValue) - ? { - $case: "numberValue", - numberValue: globalThis.Number(object.numberValue), - } - : isSet(object.stringValue) - ? { - $case: "stringValue", - stringValue: globalThis.String(object.stringValue), - } - : isSet(object.boolValue) - ? { - $case: "boolValue", - boolValue: globalThis.Boolean(object.boolValue), - } - : isSet(object.structValue) - ? { $case: "structValue", structValue: object.structValue } - : isSet(object.listValue) - ? { $case: "listValue", listValue: [...object.listValue] } - : undefined, + ? { + $case: "numberValue", + numberValue: globalThis.Number(object.numberValue), + } + : isSet(object.stringValue) + ? { + $case: "stringValue", + stringValue: globalThis.String(object.stringValue), + } + : isSet(object.boolValue) + ? { + $case: "boolValue", + boolValue: globalThis.Boolean(object.boolValue), + } + : isSet(object.structValue) + ? { $case: "structValue", structValue: object.structValue } + : isSet(object.listValue) + ? { $case: "listValue", listValue: [...object.listValue] } + : undefined, }; }, diff --git a/packages/lite/src/protobuf/validate/validate.ts b/packages/lite/src/protobuf/validate/validate.ts index dfc43f8c..a9fd112f 100644 --- a/packages/lite/src/protobuf/validate/validate.ts +++ b/packages/lite/src/protobuf/validate/validate.ts @@ -323,61 +323,117 @@ export const FieldRules = { type: isSet(object.float) ? { $case: "float", float: FloatRules.fromJSON(object.float) } : isSet(object.double) - ? { $case: "double", double: DoubleRules.fromJSON(object.double) } - : isSet(object.int32) - ? { $case: "int32", int32: Int32Rules.fromJSON(object.int32) } - : isSet(object.int64) - ? { $case: "int64", int64: Int64Rules.fromJSON(object.int64) } - : isSet(object.uint32) - ? { $case: "uint32", uint32: UInt32Rules.fromJSON(object.uint32) } - : isSet(object.uint64) - ? { $case: "uint64", uint64: UInt64Rules.fromJSON(object.uint64) } - : isSet(object.sint32) - ? { $case: "sint32", sint32: SInt32Rules.fromJSON(object.sint32) } - : isSet(object.sint64) - ? { $case: "sint64", sint64: SInt64Rules.fromJSON(object.sint64) } - : isSet(object.fixed32) - ? { $case: "fixed32", fixed32: Fixed32Rules.fromJSON(object.fixed32) } - : isSet(object.fixed64) - ? { $case: "fixed64", fixed64: Fixed64Rules.fromJSON(object.fixed64) } - : isSet(object.sfixed32) - ? { - $case: "sfixed32", - sfixed32: SFixed32Rules.fromJSON(object.sfixed32), - } - : isSet(object.sfixed64) - ? { - $case: "sfixed64", - sfixed64: SFixed64Rules.fromJSON(object.sfixed64), - } - : isSet(object.bool) - ? { $case: "bool", bool: BoolRules.fromJSON(object.bool) } - : isSet(object.string) - ? { $case: "string", string: StringRules.fromJSON(object.string) } - : isSet(object.bytes) - ? { $case: "bytes", bytes: BytesRules.fromJSON(object.bytes) } - : isSet(object.enum) - ? { $case: "enum", enum: EnumRules.fromJSON(object.enum) } - : isSet(object.repeated) - ? { - $case: "repeated", - repeated: RepeatedRules.fromJSON(object.repeated), - } - : isSet(object.map) - ? { $case: "map", map: MapRules.fromJSON(object.map) } - : isSet(object.any) - ? { $case: "any", any: AnyRules.fromJSON(object.any) } - : isSet(object.duration) - ? { - $case: "duration", - duration: DurationRules.fromJSON(object.duration), - } - : isSet(object.timestamp) - ? { - $case: "timestamp", - timestamp: TimestampRules.fromJSON(object.timestamp), - } - : undefined, + ? { $case: "double", double: DoubleRules.fromJSON(object.double) } + : isSet(object.int32) + ? { $case: "int32", int32: Int32Rules.fromJSON(object.int32) } + : isSet(object.int64) + ? { $case: "int64", int64: Int64Rules.fromJSON(object.int64) } + : isSet(object.uint32) + ? { + $case: "uint32", + uint32: UInt32Rules.fromJSON(object.uint32), + } + : isSet(object.uint64) + ? { + $case: "uint64", + uint64: UInt64Rules.fromJSON(object.uint64), + } + : isSet(object.sint32) + ? { + $case: "sint32", + sint32: SInt32Rules.fromJSON(object.sint32), + } + : isSet(object.sint64) + ? { + $case: "sint64", + sint64: SInt64Rules.fromJSON(object.sint64), + } + : isSet(object.fixed32) + ? { + $case: "fixed32", + fixed32: Fixed32Rules.fromJSON(object.fixed32), + } + : isSet(object.fixed64) + ? { + $case: "fixed64", + fixed64: Fixed64Rules.fromJSON(object.fixed64), + } + : isSet(object.sfixed32) + ? { + $case: "sfixed32", + sfixed32: SFixed32Rules.fromJSON( + object.sfixed32, + ), + } + : isSet(object.sfixed64) + ? { + $case: "sfixed64", + sfixed64: SFixed64Rules.fromJSON( + object.sfixed64, + ), + } + : isSet(object.bool) + ? { + $case: "bool", + bool: BoolRules.fromJSON(object.bool), + } + : isSet(object.string) + ? { + $case: "string", + string: StringRules.fromJSON( + object.string, + ), + } + : isSet(object.bytes) + ? { + $case: "bytes", + bytes: BytesRules.fromJSON( + object.bytes, + ), + } + : isSet(object.enum) + ? { + $case: "enum", + enum: EnumRules.fromJSON(object.enum), + } + : isSet(object.repeated) + ? { + $case: "repeated", + repeated: RepeatedRules.fromJSON( + object.repeated, + ), + } + : isSet(object.map) + ? { + $case: "map", + map: MapRules.fromJSON( + object.map, + ), + } + : isSet(object.any) + ? { + $case: "any", + any: AnyRules.fromJSON( + object.any, + ), + } + : isSet(object.duration) + ? { + $case: "duration", + duration: + DurationRules.fromJSON( + object.duration, + ), + } + : isSet(object.timestamp) + ? { + $case: "timestamp", + timestamp: + TimestampRules.fromJSON( + object.timestamp, + ), + } + : undefined, }; }, @@ -1097,27 +1153,38 @@ export const StringRules = { wellKnown: isSet(object.email) ? { $case: "email", email: globalThis.Boolean(object.email) } : isSet(object.hostname) - ? { $case: "hostname", hostname: globalThis.Boolean(object.hostname) } - : isSet(object.ip) - ? { $case: "ip", ip: globalThis.Boolean(object.ip) } - : isSet(object.ipv4) - ? { $case: "ipv4", ipv4: globalThis.Boolean(object.ipv4) } - : isSet(object.ipv6) - ? { $case: "ipv6", ipv6: globalThis.Boolean(object.ipv6) } - : isSet(object.uri) - ? { $case: "uri", uri: globalThis.Boolean(object.uri) } - : isSet(object.uriRef) - ? { $case: "uriRef", uriRef: globalThis.Boolean(object.uriRef) } - : isSet(object.address) - ? { $case: "address", address: globalThis.Boolean(object.address) } - : isSet(object.uuid) - ? { $case: "uuid", uuid: globalThis.Boolean(object.uuid) } - : isSet(object.wellKnownRegex) - ? { - $case: "wellKnownRegex", - wellKnownRegex: knownRegexFromJSON(object.wellKnownRegex), - } - : undefined, + ? { $case: "hostname", hostname: globalThis.Boolean(object.hostname) } + : isSet(object.ip) + ? { $case: "ip", ip: globalThis.Boolean(object.ip) } + : isSet(object.ipv4) + ? { $case: "ipv4", ipv4: globalThis.Boolean(object.ipv4) } + : isSet(object.ipv6) + ? { $case: "ipv6", ipv6: globalThis.Boolean(object.ipv6) } + : isSet(object.uri) + ? { $case: "uri", uri: globalThis.Boolean(object.uri) } + : isSet(object.uriRef) + ? { + $case: "uriRef", + uriRef: globalThis.Boolean(object.uriRef), + } + : isSet(object.address) + ? { + $case: "address", + address: globalThis.Boolean(object.address), + } + : isSet(object.uuid) + ? { + $case: "uuid", + uuid: globalThis.Boolean(object.uuid), + } + : isSet(object.wellKnownRegex) + ? { + $case: "wellKnownRegex", + wellKnownRegex: knownRegexFromJSON( + object.wellKnownRegex, + ), + } + : undefined, strict: isSet(object.strict) ? globalThis.Boolean(object.strict) : false, ignoreEmpty: isSet(object.ignoreEmpty) ? globalThis.Boolean(object.ignoreEmpty) @@ -1237,10 +1304,10 @@ export const BytesRules = { wellKnown: isSet(object.ip) ? { $case: "ip", ip: globalThis.Boolean(object.ip) } : isSet(object.ipv4) - ? { $case: "ipv4", ipv4: globalThis.Boolean(object.ipv4) } - : isSet(object.ipv6) - ? { $case: "ipv6", ipv6: globalThis.Boolean(object.ipv6) } - : undefined, + ? { $case: "ipv4", ipv4: globalThis.Boolean(object.ipv4) } + : isSet(object.ipv6) + ? { $case: "ipv6", ipv6: globalThis.Boolean(object.ipv6) } + : undefined, ignoreEmpty: isSet(object.ignoreEmpty) ? globalThis.Boolean(object.ignoreEmpty) : false,