From 888bfeca441978be2c581ce1ebc88438a0e4626f Mon Sep 17 00:00:00 2001 From: Tyler Carson Date: Mon, 10 Nov 2025 17:10:33 -0800 Subject: [PATCH] HPKE wrapped transmission key Adds quantum-resistant HPKE wrapped transmission key implementation, which is opt-in via the `useHpkeForTransmissionKey` config option. Not all environments support this yet, but should be suitable for testing. Remaining public keys will be added ASAP. Updates protobufs to get needed ecKeyId field on QrcMessageKey. --- keeperapi/jest.config.js | 3 + keeperapi/package-lock.json | 70 +- keeperapi/package.json | 3 +- keeperapi/rollup.config.js | 6 +- keeperapi/src/__tests__/qrc.test.ts | 270 ++ keeperapi/src/browser/platform.ts | 76 +- keeperapi/src/configuration.ts | 23 +- keeperapi/src/endpoint.ts | 133 +- keeperapi/src/node/platform.ts | 31 +- keeperapi/src/platform.ts | 22 + keeperapi/src/proto.d.ts | 1676 ++++++++++- keeperapi/src/proto.js | 4279 ++++++++++++++++++++++++++- keeperapi/src/qrc/constants.ts | 87 + keeperapi/src/qrc/context.ts | 82 + keeperapi/src/qrc/hpke.ts | 178 ++ keeperapi/src/qrc/index.ts | 50 + keeperapi/src/qrc/mlkem.ts | 89 + keeperapi/src/qrc/types.ts | 37 + keeperapi/src/qrc/utils.ts | 113 + keeperapi/src/transmissionKeys.ts | 61 +- keeperapi/src/utils.ts | 72 +- keeperapi/tsconfig.json | 3 +- 22 files changed, 7272 insertions(+), 92 deletions(-) create mode 100644 keeperapi/src/__tests__/qrc.test.ts create mode 100644 keeperapi/src/qrc/constants.ts create mode 100644 keeperapi/src/qrc/context.ts create mode 100644 keeperapi/src/qrc/hpke.ts create mode 100644 keeperapi/src/qrc/index.ts create mode 100644 keeperapi/src/qrc/mlkem.ts create mode 100644 keeperapi/src/qrc/types.ts create mode 100644 keeperapi/src/qrc/utils.ts diff --git a/keeperapi/jest.config.js b/keeperapi/jest.config.js index b8c19c3..85d6ad7 100644 --- a/keeperapi/jest.config.js +++ b/keeperapi/jest.config.js @@ -8,6 +8,9 @@ module.exports = { // Ignore dist folder and node_modules testPathIgnorePatterns: ["/node_modules/", "/dist/"], + // Transform ESM packages from node_modules + transformIgnorePatterns: ["node_modules/(?!@noble/)"], + // Module file extensions moduleFileExtensions: ["ts", "tsx", "js", "jsx", "json", "node"], }; diff --git a/keeperapi/package-lock.json b/keeperapi/package-lock.json index fb882ea..4f1bc94 100644 --- a/keeperapi/package-lock.json +++ b/keeperapi/package-lock.json @@ -1,14 +1,15 @@ { "name": "@keeper-security/keeperapi", - "version": "16.0.90", + "version": "16.0.91", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@keeper-security/keeperapi", - "version": "16.0.90", + "version": "16.0.91", "license": "ISC", "dependencies": { + "@noble/post-quantum": "^0.5.2", "asmcrypto.js": "^2.3.2", "faye-websocket": "^0.11.3", "form-data": "^4.0.4", @@ -2669,6 +2670,49 @@ "node": ">=v12.0.0" } }, + "node_modules/@noble/curves": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-2.0.1.tgz", + "integrity": "sha512-vs1Az2OOTBiP4q0pwjW5aF0xp9n4MxVrmkFBxc6EKZc6ddYx5gaZiAsZoq0uRRXWbi3AT/sBqn05eRPtn1JCPw==", + "license": "MIT", + "dependencies": { + "@noble/hashes": "2.0.1" + }, + "engines": { + "node": ">= 20.19.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/@noble/hashes": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-2.0.1.tgz", + "integrity": "sha512-XlOlEbQcE9fmuXxrVTXCTlG2nlRXa9Rj3rr5Ue/+tX+nmkgbX720YHh0VR3hBF9xDvwnb8D2shVGOwNx+ulArw==", + "license": "MIT", + "engines": { + "node": ">= 20.19.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/@noble/post-quantum": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/@noble/post-quantum/-/post-quantum-0.5.2.tgz", + "integrity": "sha512-etMDBkCuB95Xj/gfsWYBD2x+84IjL4uMLd/FhGoUUG/g+eh0K2eP7pJz1EmvpN8Df3vKdoWVAc7RxIBCHQfFHQ==", + "license": "MIT", + "dependencies": { + "@noble/curves": "~2.0.0", + "@noble/hashes": "~2.0.0" + }, + "engines": { + "node": ">= 20.19.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, "node_modules/@protobufjs/aspromise": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz", @@ -10629,6 +10673,28 @@ "lodash": "^4.17.21" } }, + "@noble/curves": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-2.0.1.tgz", + "integrity": "sha512-vs1Az2OOTBiP4q0pwjW5aF0xp9n4MxVrmkFBxc6EKZc6ddYx5gaZiAsZoq0uRRXWbi3AT/sBqn05eRPtn1JCPw==", + "requires": { + "@noble/hashes": "2.0.1" + } + }, + "@noble/hashes": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-2.0.1.tgz", + "integrity": "sha512-XlOlEbQcE9fmuXxrVTXCTlG2nlRXa9Rj3rr5Ue/+tX+nmkgbX720YHh0VR3hBF9xDvwnb8D2shVGOwNx+ulArw==" + }, + "@noble/post-quantum": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/@noble/post-quantum/-/post-quantum-0.5.2.tgz", + "integrity": "sha512-etMDBkCuB95Xj/gfsWYBD2x+84IjL4uMLd/FhGoUUG/g+eh0K2eP7pJz1EmvpN8Df3vKdoWVAc7RxIBCHQfFHQ==", + "requires": { + "@noble/curves": "~2.0.0", + "@noble/hashes": "~2.0.0" + } + }, "@protobufjs/aspromise": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz", diff --git a/keeperapi/package.json b/keeperapi/package.json index dd7a34f..97b6b2c 100644 --- a/keeperapi/package.json +++ b/keeperapi/package.json @@ -1,7 +1,7 @@ { "name": "@keeper-security/keeperapi", "description": "Keeper API Javascript SDK", - "version": "16.0.90", + "version": "16.0.91", "browser": "dist/index.es.js", "main": "dist/index.cjs.js", "types": "dist/node/index.d.ts", @@ -19,6 +19,7 @@ "publish-to-npm": "npm publish" }, "dependencies": { + "@noble/post-quantum": "^0.5.2", "asmcrypto.js": "^2.3.2", "faye-websocket": "^0.11.3", "form-data": "^4.0.4", diff --git a/keeperapi/rollup.config.js b/keeperapi/rollup.config.js index 414bd9d..87daee8 100644 --- a/keeperapi/rollup.config.js +++ b/keeperapi/rollup.config.js @@ -20,7 +20,8 @@ export default [ ], external: [ ...Object.keys(pkg.dependencies || {}), - "protobufjs/minimal" + "protobufjs/minimal", + "@noble/post-quantum/ml-kem.js" ], plugins: [ typescript({ @@ -56,7 +57,8 @@ export default [ ], external: [ ...Object.keys(pkg.dependencies || {}), - "crypto", "constants", "https", "protobufjs/minimal" + "crypto", "constants", "https", "protobufjs/minimal", + "@noble/post-quantum/ml-kem.js" ], plugins: [ typescript({ diff --git a/keeperapi/src/__tests__/qrc.test.ts b/keeperapi/src/__tests__/qrc.test.ts new file mode 100644 index 0000000..1c96ba8 --- /dev/null +++ b/keeperapi/src/__tests__/qrc.test.ts @@ -0,0 +1,270 @@ +/** + * @jest-environment jsdom + */ + +// @ts-ignore +import crypto from 'crypto'; +import { browserPlatform } from '../browser/platform'; +import { TextEncoder, TextDecoder } from 'util'; +import { connectPlatform, platform } from '../platform'; +import { + HPKE_ECDH_KYBER, + Ciphersuite, + MlKemVariant, + concatUint8Arrays, + mlKemKeygen, + mlKemEncapsulate, + mlKemDecapsulate, + ML_KEM_768_CIPHERTEXT_LENGTH, +} from '../qrc'; +import { EC_PUBLIC_KEY_LENGTH, EC_SHARED_SECRET_LENGTH, ML_KEM_1024_CIPHERTEXT_LENGTH } from '../qrc/constants'; +import { getKeeperMlKemKeys, getKeeperMlKemKeyVariant, isAllowedMlKemKeyId } from '../transmissionKeys'; + +Object.assign(global, { TextDecoder, TextEncoder }); + +// Set up crypto for both global.self (browser APIs) and globalThis (noble libraries) +const cryptoObj = { + subtle: crypto.webcrypto.subtle, + getRandomValues: (array: Uint8Array) => { + const randomData = crypto.randomBytes(array.length); + array.set(randomData); + return array; + }, +}; + +Object.defineProperty(global.self, 'crypto', { value: cryptoObj }); +Object.defineProperty(globalThis, 'crypto', { value: cryptoObj }); + +describe('ML-KEM Operations', () => { + describe('mlKemEncapsulate and mlKemDecapsulate', () => { + it('encapsulates and decapsulates with ML-KEM-768', () => { + const keyPair = mlKemKeygen(MlKemVariant.ML_KEM_768); + const { ciphertext, sharedSecret } = mlKemEncapsulate(keyPair.publicKey, MlKemVariant.ML_KEM_768); + + expect(ciphertext.length).toBe(ML_KEM_768_CIPHERTEXT_LENGTH); + expect(sharedSecret.length).toBe(EC_SHARED_SECRET_LENGTH); + + const decapsulatedSecret = mlKemDecapsulate(ciphertext, keyPair.privateKey, MlKemVariant.ML_KEM_768); + expect(decapsulatedSecret).toEqual(sharedSecret); + }); + + it('encapsulates and decapsulates with ML-KEM-1024', () => { + const keyPair = mlKemKeygen(MlKemVariant.ML_KEM_1024); + const { ciphertext, sharedSecret } = mlKemEncapsulate(keyPair.publicKey, MlKemVariant.ML_KEM_1024); + + expect(ciphertext.length).toBe(ML_KEM_1024_CIPHERTEXT_LENGTH); + expect(sharedSecret.length).toBe(EC_SHARED_SECRET_LENGTH); + + const decapsulatedSecret = mlKemDecapsulate(ciphertext, keyPair.privateKey, MlKemVariant.ML_KEM_1024); + expect(decapsulatedSecret).toEqual(sharedSecret); + }); + + it('generates different ciphertexts for same public key', () => { + const keyPair = mlKemKeygen(MlKemVariant.ML_KEM_768); + const result1 = mlKemEncapsulate(keyPair.publicKey, MlKemVariant.ML_KEM_768); + const result2 = mlKemEncapsulate(keyPair.publicKey, MlKemVariant.ML_KEM_768); + + expect(result1.ciphertext).not.toEqual(result2.ciphertext); + expect(result1.sharedSecret).not.toEqual(result2.sharedSecret); + }); + }); + + describe('PEM-encoded ML-KEM keys', () => { + // ML-KEM OIDs from NIST + // ML-KEM-768: 2.16.840.1.101.3.4.4.2 -> 06 0B 60 86 48 01 65 03 04 04 02 + // ML-KEM-1024: 2.16.840.1.101.3.4.4.3 -> 06 0B 60 86 48 01 65 03 04 04 03 + const ML_KEM_768_OID = new Uint8Array([0x06, 0x0B, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x04, 0x02]); + const ML_KEM_1024_OID = new Uint8Array([0x06, 0x0B, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x04, 0x03]); + + /** + * Encodes a length in DER format + */ + function encodeLength(length: number): Uint8Array { + if (length < 128) { + return new Uint8Array([length]); + } else if (length < 256) { + return new Uint8Array([0x81, length]); + } else if (length < 65536) { + return new Uint8Array([0x82, (length >> 8) & 0xFF, length & 0xFF]); + } else { + throw new Error('Length too large for DER encoding'); + } + } + + /** + * Wraps data in a DER SEQUENCE + */ + function derSequence(...items: Uint8Array[]): Uint8Array { + const content = concatUint8Arrays(...items); + const lengthBytes = encodeLength(content.length); + return concatUint8Arrays(new Uint8Array([0x30]), lengthBytes, content); + } + + /** + * Wraps data in a DER BIT STRING (with 0 unused bits) + */ + function derBitString(data: Uint8Array): Uint8Array { + const lengthBytes = encodeLength(data.length + 1); // +1 for unused bits byte + return concatUint8Arrays(new Uint8Array([0x03]), lengthBytes, new Uint8Array([0x00]), data); + } + + /** + * Encodes a raw ML-KEM public key to PEM format (SubjectPublicKeyInfo) + */ + function encodeMlKemPublicKeyToPem(rawPublicKey: Uint8Array, variant: MlKemVariant): Uint8Array { + const oid = variant === MlKemVariant.ML_KEM_768 ? ML_KEM_768_OID : ML_KEM_1024_OID; + + // AlgorithmIdentifier: SEQUENCE { OID } + const algorithmIdentifier = derSequence(oid); + + // SubjectPublicKeyInfo: SEQUENCE { AlgorithmIdentifier, BIT STRING } + const spki = derSequence(algorithmIdentifier, derBitString(rawPublicKey)); + + // Encode to base64 and wrap in PEM + const base64 = platform.bytesToBase64(spki); + + // Format with line breaks every 64 characters + const lines: string[] = []; + for (let i = 0; i < base64.length; i += 64) { + lines.push(base64.slice(i, i + 64)); + } + + const pemString = `-----BEGIN PUBLIC KEY-----\n${lines.join('\n')}\n-----END PUBLIC KEY-----`; + return new TextEncoder().encode(pemString); + } + + beforeAll(() => { + connectPlatform(browserPlatform); + }); + + it('encapsulates with PEM-encoded ML-KEM-768 public key', () => { + const keyPair = mlKemKeygen(MlKemVariant.ML_KEM_768); + const pemPublicKey = encodeMlKemPublicKeyToPem(keyPair.publicKey, MlKemVariant.ML_KEM_768); + + // Encapsulate using PEM-encoded key + const { ciphertext, sharedSecret } = mlKemEncapsulate(pemPublicKey, MlKemVariant.ML_KEM_768); + + expect(ciphertext.length).toBe(ML_KEM_768_CIPHERTEXT_LENGTH); + expect(sharedSecret.length).toBe(EC_SHARED_SECRET_LENGTH); + + // Decapsulate should produce same shared secret + const decapsulatedSecret = mlKemDecapsulate(ciphertext, keyPair.privateKey, MlKemVariant.ML_KEM_768); + expect(decapsulatedSecret).toEqual(sharedSecret); + }); + + it('encapsulates with PEM-encoded ML-KEM-1024 public key', () => { + const keyPair = mlKemKeygen(MlKemVariant.ML_KEM_1024); + const pemPublicKey = encodeMlKemPublicKeyToPem(keyPair.publicKey, MlKemVariant.ML_KEM_1024); + + // Encapsulate using PEM-encoded key + const { ciphertext, sharedSecret } = mlKemEncapsulate(pemPublicKey, MlKemVariant.ML_KEM_1024); + + expect(ciphertext.length).toBe(ML_KEM_1024_CIPHERTEXT_LENGTH); + expect(sharedSecret.length).toBe(EC_SHARED_SECRET_LENGTH); + + // Decapsulate should produce same shared secret + const decapsulatedSecret = mlKemDecapsulate(ciphertext, keyPair.privateKey, MlKemVariant.ML_KEM_1024); + expect(decapsulatedSecret).toEqual(sharedSecret); + }); + + it('HPKE encrypts/decrypts with PEM-encoded ML-KEM-768 server key', async () => { + const hpke = new HPKE_ECDH_KYBER(Ciphersuite.HPKE_MLKEM768_ECDHP256_HKDFSHA256_AESGCM256); + + // Generate server keys + const serverEcKeyPair = await platform.generateECKeyPair(); + const serverMlKemKeys = hpke.generateMlKemKeys(); + + // Convert ML-KEM public key to PEM format (simulating server-provided key) + const pemMlKemPublicKey = encodeMlKemPublicKeyToPem(serverMlKemKeys.publicKey, MlKemVariant.ML_KEM_768); + + const message = platform.getRandomBytes(32); + + // Encrypt using PEM-encoded ML-KEM public key + const result = await hpke.encrypt( + message, + serverEcKeyPair.publicKey, + pemMlKemPublicKey + ); + + expect(result.clientEcPublicKey.length).toBe(EC_PUBLIC_KEY_LENGTH); + expect(result.mlKemEncapsulatedKey.length).toBe(ML_KEM_768_CIPHERTEXT_LENGTH); + + // Decrypt (server uses raw private key) + const decrypted = await hpke.decrypt( + result.clientEcPublicKey, + result.mlKemEncapsulatedKey, + result.encryptedData, + result.msgVersion, + serverEcKeyPair.privateKey, + serverEcKeyPair.publicKey, + serverMlKemKeys.privateKey + ); + + expect(decrypted).toEqual(message); + }); + + it('HPKE encrypts/decrypts with PEM-encoded ML-KEM-1024 server key', async () => { + const hpke = new HPKE_ECDH_KYBER(Ciphersuite.HPKE_MLKEM1024_ECDHP256_HKDFSHA256_AESGCM256); + + // Generate server keys + const serverEcKeyPair = await platform.generateECKeyPair(); + const serverMlKemKeys = hpke.generateMlKemKeys(); + + // Convert ML-KEM public key to PEM format (simulating server-provided key) + const pemMlKemPublicKey = encodeMlKemPublicKeyToPem(serverMlKemKeys.publicKey, MlKemVariant.ML_KEM_1024); + + const message = platform.getRandomBytes(32); + + // Encrypt using PEM-encoded ML-KEM public key + const result = await hpke.encrypt( + message, + serverEcKeyPair.publicKey, + pemMlKemPublicKey + ); + + expect(result.clientEcPublicKey.length).toBe(EC_PUBLIC_KEY_LENGTH); + expect(result.mlKemEncapsulatedKey.length).toBe(ML_KEM_1024_CIPHERTEXT_LENGTH); + + // Decrypt (server uses raw private key) + const decrypted = await hpke.decrypt( + result.clientEcPublicKey, + result.mlKemEncapsulatedKey, + result.encryptedData, + result.msgVersion, + serverEcKeyPair.privateKey, + serverEcKeyPair.publicKey, + serverMlKemKeys.privateKey + ); + + expect(decrypted).toEqual(message); + }); + }); +}); + +describe('ML-KEM Transmission Keys', () => { + beforeAll(() => { + connectPlatform(browserPlatform); + }); + + it('decodes and encapsulates with all configured ML-KEM transmission keys', () => { + const mlKemKeys = getKeeperMlKemKeys((source: string) => platform.base64ToBytes(source)); + + // Test every key in the array + mlKemKeys.forEach((keyData, keyId) => { + if (!keyData || !isAllowedMlKemKeyId(keyId)) { + return; + } + + const variant = getKeeperMlKemKeyVariant(keyId); + const expectedCiphertextLength = variant === MlKemVariant.ML_KEM_768 + ? ML_KEM_768_CIPHERTEXT_LENGTH + : ML_KEM_1024_CIPHERTEXT_LENGTH; + + // Encapsulate to verify the key can be decoded and used + const { ciphertext, sharedSecret } = mlKemEncapsulate(keyData, variant); + + expect(ciphertext.length).toBe(expectedCiphertextLength); + expect(sharedSecret.length).toBe(EC_SHARED_SECRET_LENGTH); + }); + }); +}); diff --git a/keeperapi/src/browser/platform.ts b/keeperapi/src/browser/platform.ts index a5cf27e..2b33aac 100644 --- a/keeperapi/src/browser/platform.ts +++ b/keeperapi/src/browser/platform.ts @@ -10,7 +10,7 @@ import { } from '../platform' import {_asnhex_getHexOfV_AtObj, _asnhex_getPosArrayOfChildren_AtObj} from "./asn1hex"; import {RSAKey} from "./rsa"; -import {getKeeperKeys} from "../transmissionKeys"; +import {getKeeperKeys, getKeeperMlKemKeys} from "../transmissionKeys"; import {normal64, normal64Bytes, webSafe64FromBytes} from "../utils"; import {SocketProxy, socketSendMessage} from '../socket' import * as asmCrypto from 'asmcrypto.js' @@ -45,6 +45,7 @@ export const browserPlatform: Platform = class { } static keys = getKeeperKeys(this.normal64Bytes); + static mlKemKeys = getKeeperMlKemKeys(this.base64ToBytes); static getRandomBytes(length: number): Uint8Array { let data = new Uint8Array(length); @@ -540,6 +541,27 @@ export const browserPlatform: Platform = class { return await crypto.subtle.importKey('jwk', jwk, { name: 'ECDH', namedCurve: 'P-256' }, true, ['deriveBits']) } + static async ecdhComputeSharedSecret( + senderPrivateKey: Uint8Array, + recipientPublicKey: Uint8Array, + senderPublicKey: Uint8Array + ): Promise { + const senderPrivateCryptoKey = await this.importPrivateKeyEC(senderPrivateKey, senderPublicKey) + const recipientPublicCryptoKey = await crypto.subtle.importKey( + 'raw', + recipientPublicKey, + { name: 'ECDH', namedCurve: 'P-256' }, + false, + [] + ) + const sharedSecretBuffer = await crypto.subtle.deriveBits( + { name: 'ECDH', public: recipientPublicCryptoKey }, + senderPrivateCryptoKey, + 256 + ) + return new Uint8Array(sharedSecretBuffer) + } + static async deriveSharedSecretKey(ephemeralPublicKey: Uint8Array, privateKey: CryptoKey, id?: Uint8Array, useHKDF?: boolean): Promise { const pubCryptoKey = await crypto.subtle.importKey('raw', ephemeralPublicKey, { name: 'ECDH', namedCurve: 'P-256' }, true, []) const sharedSecret = await crypto.subtle.deriveBits({ name: 'ECDH', public: pubCryptoKey }, privateKey, 256) @@ -552,28 +574,36 @@ export const browserPlatform: Platform = class { const symmetricKeyBuffer = await crypto.subtle.digest('SHA-256', sharedSecretCombined) return this.aesGcmImportKey(new Uint8Array(symmetricKeyBuffer), false) } else { - const hkdfKey = await crypto.subtle.importKey( - 'raw', - sharedSecret, - 'HKDF', - false, - ['deriveBits'] - ) - - const symmetricKeyBuffer = await crypto.subtle.deriveBits( - { - name: 'HKDF', - hash: 'SHA-256', - salt: new Uint8Array(), - info: id ?? new Uint8Array() - }, - hkdfKey, - 256 - ) - return this.aesGcmImportKey(new Uint8Array(symmetricKeyBuffer), false) + const symmetricKey = await this.hkdf(new Uint8Array(), new Uint8Array(sharedSecret), id ?? new Uint8Array(), 32) + return this.aesGcmImportKey(symmetricKey, false) } } + static async hkdf(salt: Uint8Array, ikm: Uint8Array, info: Uint8Array, length: number): Promise { + // Import IKM as HKDF key + const hkdfKey = await crypto.subtle.importKey( + 'raw', + ikm, + 'HKDF', + false, + ['deriveBits'] + ); + + // Derive bits using HKDF + const derivedBits = await crypto.subtle.deriveBits( + { + name: 'HKDF', + hash: 'SHA-256', + salt: salt, + info: info + }, + hkdfKey, + length * 8 // bits + ); + + return new Uint8Array(derivedBits); + } + static async privateDecryptECWebCrypto(data: Uint8Array, privateKey: CryptoKey, id?: Uint8Array, useHKDF?: boolean): Promise { const message = data.slice(ECC_PUB_KEY_LENGTH) const ephemeralPublicKey = data.slice(0, ECC_PUB_KEY_LENGTH) @@ -808,7 +838,11 @@ export const browserPlatform: Platform = class { } static async calcAuthVerifier(key: Uint8Array): Promise { - let digest = await crypto.subtle.digest("SHA-256", key); + return this.sha256(key); + } + + static async sha256(data: Uint8Array): Promise { + const digest = await crypto.subtle.digest("SHA-256", data); return new Uint8Array(digest); } diff --git a/keeperapi/src/configuration.ts b/keeperapi/src/configuration.ts index 51b218c..7ee24a0 100644 --- a/keeperapi/src/configuration.ts +++ b/keeperapi/src/configuration.ts @@ -26,6 +26,7 @@ export interface ClientConfiguration { useSessionResumption?: boolean iterations?: number salt?: Uint8Array + useHpkeForTransmissionKey?: boolean } export interface ClientConfigurationInternal extends ClientConfiguration { deviceConfig: DeviceConfig // v15+ device config @@ -39,6 +40,7 @@ export type KeeperError = { path?: string result_code?: string key_id?: number + qrc_ec_key_id?: number region_host?: string } @@ -48,6 +50,7 @@ export interface DeviceConfig { privateKey?: Uint8Array publicKey?: Uint8Array transmissionKeyId?: number + mlKemPublicKeyId?: number } export interface SessionStorage { @@ -74,8 +77,24 @@ export interface VendorConfiguration { export interface TransmissionKey { key: Uint8Array - publicKeyId: number - encryptedKey: Uint8Array + ecKeyId: number + ecEncryptedKey: Uint8Array + mlKemKeyId: number +} + +export interface QrcMessageKey { + clientEcPublicKey: Uint8Array + mlKemEncapsulatedKey: Uint8Array + data: Uint8Array + msgVersion: number + ecKeyId: number +} + +export interface TransmissionKeyHpke { + key: Uint8Array + mlKemKeyId: number + qrcMessageKey: QrcMessageKey + optionalData?: Uint8Array } export interface AuthUI { diff --git a/keeperapi/src/endpoint.ts b/keeperapi/src/endpoint.ts index 0ff7e5f..a4970c5 100644 --- a/keeperapi/src/endpoint.ts +++ b/keeperapi/src/endpoint.ts @@ -4,6 +4,7 @@ import {platform} from './platform' import { formatTimeDiff, generateTransmissionKey, + generateHpkeTransmissionKey, getKeeperUrl, isTwoFactorResultCode, log, normal64Bytes, @@ -26,7 +27,7 @@ import WssClientResponse = Push.WssClientResponse; import WssConnectionRequest = Push.WssConnectionRequest; import SsoCloudResponse = SsoCloud.SsoCloudResponse; import {KeeperHttpResponse, RestCommand} from './commands' -import { AllowedNumbers, isAllowedNumber } from './transmissionKeys' +import {AllowedEcKeyIds, AllowedMlKemKeyIds, isAllowedEcKeyId, isAllowedMlKemKeyId} from './transmissionKeys' export class KeeperEndpoint { private _transmissionKey?: TransmissionKey @@ -37,21 +38,29 @@ export class KeeperEndpoint { private onsitePrivateKey: Uint8Array | null = null private onsitePublicKey: Uint8Array | null = null - constructor(private options: ClientConfigurationInternal) { + private useHpkeForTransmissionKey: boolean = false + + constructor(private options: ClientConfigurationInternal) { if (options.deviceToken) { this.deviceToken = options.deviceToken - } + } if (options.locale) { this.locale = options.locale } + if (options.useHpkeForTransmissionKey) { + this.useHpkeForTransmissionKey = true + } } async getTransmissionKey():Promise { - const deviceConfigTransmissionKeyId = this.options.deviceConfig.transmissionKeyId || 7 - if(!this._transmissionKey && isAllowedNumber(deviceConfigTransmissionKeyId)){ - this._transmissionKey = await generateTransmissionKey(deviceConfigTransmissionKeyId) + const DEFAULT_PROD_EC_KEY_ID = 10 + const DEFAULT_PROD_ML_KEM_KEY_ID = 136 + const deviceConfigTransmissionKeyId = this.options.deviceConfig.transmissionKeyId || DEFAULT_PROD_EC_KEY_ID + const deviceConfigMlKemKeyId = this.options.deviceConfig.mlKemPublicKeyId || DEFAULT_PROD_ML_KEM_KEY_ID + if(!this._transmissionKey && isAllowedEcKeyId(deviceConfigTransmissionKeyId) && isAllowedMlKemKeyId(deviceConfigMlKemKeyId)){ + this._transmissionKey = await generateTransmissionKey(deviceConfigTransmissionKeyId, deviceConfigMlKemKeyId) } else if(!this._transmissionKey){ - this._transmissionKey = await generateTransmissionKey(7) + this._transmissionKey = await generateTransmissionKey(DEFAULT_PROD_EC_KEY_ID, DEFAULT_PROD_ML_KEM_KEY_ID) } return this._transmissionKey @@ -159,7 +168,15 @@ export class KeeperEndpoint { while (true) { const payload = 'toBytes' in message ? message.toBytes() : new Uint8Array() const apiVersion = message.apiVersion || 0 - const request = await this.prepareRequest(payload, sessionToken, apiVersion) + + const request = await prepareApiRequest({ + payload, + transmissionKey: this._transmissionKey, + sessionToken, + locale: this.locale, + apiVersion, + useHpkeForTransmissionKey: this.useHpkeForTransmissionKey + }) log(`Calling REST URL: ${this.getUrl(message.path)}`, 'noCR'); const startTime = Date.now() const response = await platform.post(this.getUrl(message.path), request) @@ -183,9 +200,18 @@ export class KeeperEndpoint { const errorObj: KeeperError = JSON.parse(errorMessage) switch (errorObj.error) { case 'key': - if(isAllowedNumber(errorObj.key_id!)){ - await this.updateTransmissionKey(errorObj.key_id!) - } else { + if (errorObj.qrc_ec_key_id && errorObj.key_id){ + if (isAllowedEcKeyId(errorObj.qrc_ec_key_id) && isAllowedMlKemKeyId(errorObj.key_id)) { + // Rotate EC key and ML-KEM key + await this.updateTransmissionKey(errorObj.qrc_ec_key_id, errorObj.key_id) + } else { + throw new Error('Incorrect Transmission Key IDs being used.') + } + } else if (errorObj.key_id && isAllowedEcKeyId(errorObj.key_id) && this._transmissionKey) { + // Rotate EC key + await this.updateTransmissionKey(errorObj.key_id, this._transmissionKey.mlKemKeyId as AllowedMlKemKeyIds) + } + else { throw new Error('Incorrect Transmission Key ID being used.') } continue @@ -245,10 +271,11 @@ export class KeeperEndpoint { return platform.get(this.getUrl(path), {}) } - public async updateTransmissionKey(keyNumber: AllowedNumbers) { - this._transmissionKey = await generateTransmissionKey(keyNumber) + public async updateTransmissionKey(ecKeyId: AllowedEcKeyIds, mlKemKeyId: AllowedMlKemKeyIds) { + this._transmissionKey = await generateTransmissionKey(ecKeyId, mlKemKeyId) - this.options.deviceConfig.transmissionKeyId = keyNumber + this.options.deviceConfig.transmissionKeyId = ecKeyId + this.options.deviceConfig.mlKemPublicKeyId = mlKemKeyId if (this.options.onDeviceConfig) { await this.options.onDeviceConfig(this.options.deviceConfig, this.options.host); } @@ -256,7 +283,14 @@ export class KeeperEndpoint { public async prepareRequest(payload: Uint8Array | unknown, sessionToken?: string, apiVersion?: number): Promise { this._transmissionKey = await this.getTransmissionKey() - return prepareApiRequest(payload, this._transmissionKey, sessionToken, this.locale, apiVersion) + return prepareApiRequest({ + payload, + transmissionKey: this._transmissionKey, + sessionToken, + locale: this.locale, + apiVersion, + useHpkeForTransmissionKey: this.useHpkeForTransmissionKey + }) } async decryptPushMessage(pushMessageData: Uint8Array): Promise { @@ -281,7 +315,12 @@ export class KeeperEndpoint { "idpSessionId": idpSessionId, "username": username } - const request = await prepareApiRequest(SsoCloud.SsoCloudRequest.encode(payload).finish(), this._transmissionKey, undefined, this.locale) + const request = await prepareApiRequest({ + payload: SsoCloud.SsoCloudRequest.encode(payload).finish(), + transmissionKey: this._transmissionKey, + locale: this.locale, + useHpkeForTransmissionKey: this.useHpkeForTransmissionKey + }) return webSafe64FromBytes(request) } @@ -294,12 +333,12 @@ export class KeeperEndpoint { if (!this.onsitePublicKey || !this.onsitePrivateKey) { if(ecOnly){ const {privateKey, publicKey} = await platform.generateECKeyPair() - + this.onsitePrivateKey = privateKey this.onsitePublicKey = publicKey } else { const {privateKey, publicKey} = await platform.generateRSAKeyPair() - + this.onsitePrivateKey = privateKey this.onsitePublicKey = publicKey } @@ -325,11 +364,32 @@ export async function getPushConnectionRequest(messageSessionUid: Uint8Array, tr deviceTimeStamp: new Date().getTime() }) const connectionRequestBytes = WssConnectionRequest.encode(connectionRequest).finish() - const apiRequest = await prepareApiRequest(connectionRequestBytes, transmissionKey, undefined, locale) + const apiRequest = await prepareApiRequest({ + payload: connectionRequestBytes, + transmissionKey, + locale, + useHpkeForTransmissionKey: false // HPKE not currently supported for push + }) return webSafe64FromBytes(apiRequest) } -export async function prepareApiRequest(payload: Uint8Array | unknown, transmissionKey: TransmissionKey, sessionToken?: string, locale?: string, apiVersion?: number): Promise { +type PrepareApiRequestParams = { + payload: Uint8Array | unknown, + transmissionKey: TransmissionKey, + sessionToken?: string, + locale?: string, + apiVersion?: number + useHpkeForTransmissionKey?: boolean +} + +export async function prepareApiRequest({ + payload, + transmissionKey, + sessionToken, + locale, + apiVersion, + useHpkeForTransmissionKey +}: PrepareApiRequestParams): Promise { const requestPayload = ApiRequestPayload.create() if (payload) { requestPayload.payload = payload instanceof Uint8Array @@ -340,14 +400,31 @@ export async function prepareApiRequest(payload: Uint8Array | unknown, transmiss requestPayload.encryptedSessionToken = normal64Bytes(sessionToken); } requestPayload.apiVersion = apiVersion || 0 - let requestPayloadBytes = ApiRequestPayload.encode(requestPayload).finish() - let encryptedRequestPayload = await platform.aesGcmEncrypt(requestPayloadBytes, transmissionKey.key) - let apiRequest = ApiRequest.create({ - encryptedTransmissionKey: transmissionKey.encryptedKey, - encryptedPayload: encryptedRequestPayload, - publicKeyId: transmissionKey.publicKeyId, - locale: locale || 'en_US' - }) + const requestPayloadBytes = ApiRequestPayload.encode(requestPayload).finish() + const encryptedRequestPayload = await platform.aesGcmEncrypt(requestPayloadBytes, transmissionKey.key) + let apiRequest: Authentication.IApiRequest + + if (useHpkeForTransmissionKey) { + const hpkeTransmissionKey = await generateHpkeTransmissionKey( + transmissionKey, + true // use optional data + ) + apiRequest = ApiRequest.create({ + qrcMessageKey: hpkeTransmissionKey.qrcMessageKey, + encryptedPayload: encryptedRequestPayload, + publicKeyId: hpkeTransmissionKey.mlKemKeyId, + encryptedTransmissionKey: hpkeTransmissionKey.optionalData || null, + locale: locale || 'en_US' + }); + } else { + apiRequest = ApiRequest.create({ + encryptedTransmissionKey: transmissionKey.ecEncryptedKey, + encryptedPayload: encryptedRequestPayload, + publicKeyId: transmissionKey.ecKeyId, + locale: locale || 'en_US' + }) + } + return ApiRequest.encode(apiRequest).finish() } diff --git a/keeperapi/src/node/platform.ts b/keeperapi/src/node/platform.ts index db334f2..b48fd1e 100644 --- a/keeperapi/src/node/platform.ts +++ b/keeperapi/src/node/platform.ts @@ -15,7 +15,7 @@ import { UnwrappedKeyType } from "../platform"; import {RSA_PKCS1_PADDING} from "constants"; -import {getKeeperKeys} from "../transmissionKeys"; +import {getKeeperKeys, getKeeperMlKemKeys} from "../transmissionKeys"; import {SocketProxy, socketSendMessage} from '../socket' import {normal64} from "../utils"; import type {KeeperHttpResponse} from "../commands"; @@ -25,7 +25,7 @@ const base64ToBytes = (data: string): Uint8Array => { } export const nodePlatform: Platform = class { - // Unimplemented in NodeJS, worker threads did not appear to improve performance + // Unimplemented in NodeJS, worker threads did not appear to improve performance static supportsConcurrency: boolean = false static base64ToBytes = base64ToBytes @@ -33,16 +33,17 @@ export const nodePlatform: Platform = class { static normal64Bytes(source: string): Uint8Array { return base64ToBytes(normal64(source)); } - + static keys = getKeeperKeys(this.normal64Bytes); - + static mlKemKeys = getKeeperMlKemKeys(this.base64ToBytes); + static getRandomBytes(length: number): Uint8Array { return crypto.randomBytes(length); } static bytesToBase64(data: Uint8Array): string { return Buffer.from(data).toString("base64"); - } + } static bytesToString(data: Uint8Array): string { return Buffer.from(data).toString(); @@ -231,6 +232,20 @@ export const nodePlatform: Platform = class { return await this.mainPublicEncryptEC(data, key, id) } + static async ecdhComputeSharedSecret( + senderPrivateKey: Uint8Array, + recipientPublicKey: Uint8Array, + senderPublicKey: Uint8Array + ): Promise { + const ecdh = createECDH('prime256v1') + ecdh.setPrivateKey(senderPrivateKey) + return ecdh.computeSecret(recipientPublicKey) + } + + static async hkdf(salt: Uint8Array, ikm: Uint8Array, info: Uint8Array, length: number): Promise { + return Promise.resolve(Buffer.from(hkdfSync('sha256', ikm, salt, info, length))) + } + static privateDecrypt(data: Uint8Array, key: Uint8Array): Uint8Array { const rsaPrivateKey = new NodeRSA(Buffer.from(key), 'pkcs1-private-der', { encryptionScheme: 'pkcs1' @@ -305,7 +320,11 @@ export const nodePlatform: Platform = class { } static calcAuthVerifier(key: Uint8Array): Promise { - return Promise.resolve(crypto.createHash("SHA256").update(key).digest()); + return this.sha256(key); + } + + static sha256(data: Uint8Array): Promise { + return Promise.resolve(crypto.createHash("SHA256").update(data).digest()); } static get( diff --git a/keeperapi/src/platform.ts b/keeperapi/src/platform.ts index 1b620f3..a3facaa 100644 --- a/keeperapi/src/platform.ts +++ b/keeperapi/src/platform.ts @@ -4,6 +4,7 @@ import type {CryptoWorkerPool, CryptoWorkerPoolConfig} from './cryptoWorker'; export interface Platform { keys: Uint8Array[]; + mlKemKeys: Uint8Array[]; supportsConcurrency: boolean @@ -57,6 +58,25 @@ export interface Platform { privateSign(data: Uint8Array, key: string): Promise; + /** + * Computes ECDH shared secret + * @param senderPrivateKey - Private key (32 bytes) + * @param recipientPublicKey - Public key (65 bytes, uncompressed) + * @param senderPublicKey - Sender's public key (65 bytes, uncompressed) + * @returns Shared secret (32 bytes) + */ + ecdhComputeSharedSecret(senderPrivateKey: Uint8Array, recipientPublicKey: Uint8Array, senderPublicKey: Uint8Array): Promise; + + /** + * Derives a key using HKDF-SHA256 + * @param salt - Salt (can be empty) + * @param ikm - Input keying material + * @param info - Context information + * @param length - Output length in bytes + * @returns Derived key + */ + hkdf(salt: Uint8Array, ikm: Uint8Array, info: Uint8Array, length: number): Promise; + wrapKey(keyId: string, wrappingKeyId: string, encryptionType: EncryptionType, storage?: KeyStorage): Promise encrypt(data: Uint8Array, keyId: string, encryptionType: EncryptionType, storage?: KeyStorage): Promise @@ -75,6 +95,8 @@ export interface Platform { calcAuthVerifier(key: Uint8Array): Promise; + sha256(data: Uint8Array): Promise; + get(url: string, headers: any): Promise; post(url: string, request: Uint8Array, headers?: any): Promise; diff --git a/keeperapi/src/proto.d.ts b/keeperapi/src/proto.d.ts index 0381a45..adb85ae 100644 --- a/keeperapi/src/proto.d.ts +++ b/keeperapi/src/proto.d.ts @@ -107,6 +107,9 @@ export namespace Authentication { /** QrcMessageKey msgVersion */ msgVersion?: (number|null); + + /** QrcMessageKey ecKeyId */ + ecKeyId?: (number|null); } /** Represents a QrcMessageKey. */ @@ -130,6 +133,9 @@ export namespace Authentication { /** QrcMessageKey msgVersion. */ public msgVersion: number; + /** QrcMessageKey ecKeyId. */ + public ecKeyId: number; + /** * Creates a new QrcMessageKey instance using the specified properties. * @param [properties] Properties to set @@ -37646,6 +37652,109 @@ export namespace Enterprise { */ public static getTypeUrl(typeUrlPrefix?: string): string; } + + /** Properties of a RolesByTeam. */ + interface IRolesByTeam { + + /** RolesByTeam teamUid */ + teamUid?: (Uint8Array|null); + + /** RolesByTeam roleId */ + roleId?: ((number|Long)[]|null); + } + + /** Represents a RolesByTeam. */ + class RolesByTeam implements IRolesByTeam { + + /** + * Constructs a new RolesByTeam. + * @param [properties] Properties to set + */ + constructor(properties?: Enterprise.IRolesByTeam); + + /** RolesByTeam teamUid. */ + public teamUid: Uint8Array; + + /** RolesByTeam roleId. */ + public roleId: (number|Long)[]; + + /** + * Creates a new RolesByTeam instance using the specified properties. + * @param [properties] Properties to set + * @returns RolesByTeam instance + */ + public static create(properties?: Enterprise.IRolesByTeam): Enterprise.RolesByTeam; + + /** + * Encodes the specified RolesByTeam message. Does not implicitly {@link Enterprise.RolesByTeam.verify|verify} messages. + * @param message RolesByTeam message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: Enterprise.IRolesByTeam, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RolesByTeam message, length delimited. Does not implicitly {@link Enterprise.RolesByTeam.verify|verify} messages. + * @param message RolesByTeam message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: Enterprise.IRolesByTeam, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RolesByTeam message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RolesByTeam + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): Enterprise.RolesByTeam; + + /** + * Decodes a RolesByTeam message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RolesByTeam + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): Enterprise.RolesByTeam; + + /** + * Verifies a RolesByTeam message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RolesByTeam message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RolesByTeam + */ + public static fromObject(object: { [k: string]: any }): Enterprise.RolesByTeam; + + /** + * Creates a plain object from a RolesByTeam message. Also converts values to other types if specified. + * @param message RolesByTeam + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: Enterprise.RolesByTeam, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RolesByTeam to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RolesByTeam + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } } /** Namespace AccountSummary. */ @@ -78022,7 +78131,14 @@ export namespace NotificationCenter { NT_APPROVED_RESPONSE = 10, NT_DENIED_RESPONSE = 11, NT_2FA_CONFIGURED = 12, - NT_SHARE_APPROVAL_DENIED = 13 + NT_SHARE_APPROVAL_DENIED = 13, + NT_DEVICE_APPROVAL_APPROVED = 14, + NT_DEVICE_APPROVAL_DENIED = 15, + NT_ACCOUNT_CREATED = 16, + NT_2FA_ENABLED = 17, + NT_2FA_DISABLED = 18, + NT_SECURITY_KEYS_ENABLED = 19, + NT_SECURITY_KEYS_DISABLED = 20 } /** NotificationReadStatus enum. */ @@ -79352,6 +79468,103 @@ export namespace NotificationCenter { */ public static getTypeUrl(typeUrlPrefix?: string): string; } + + /** Properties of a NotificationsApprovalStatusUpdateRequest. */ + interface INotificationsApprovalStatusUpdateRequest { + + /** NotificationsApprovalStatusUpdateRequest updates */ + updates?: (NotificationCenter.IApprovalStatusUpdate[]|null); + } + + /** Represents a NotificationsApprovalStatusUpdateRequest. */ + class NotificationsApprovalStatusUpdateRequest implements INotificationsApprovalStatusUpdateRequest { + + /** + * Constructs a new NotificationsApprovalStatusUpdateRequest. + * @param [properties] Properties to set + */ + constructor(properties?: NotificationCenter.INotificationsApprovalStatusUpdateRequest); + + /** NotificationsApprovalStatusUpdateRequest updates. */ + public updates: NotificationCenter.IApprovalStatusUpdate[]; + + /** + * Creates a new NotificationsApprovalStatusUpdateRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns NotificationsApprovalStatusUpdateRequest instance + */ + public static create(properties?: NotificationCenter.INotificationsApprovalStatusUpdateRequest): NotificationCenter.NotificationsApprovalStatusUpdateRequest; + + /** + * Encodes the specified NotificationsApprovalStatusUpdateRequest message. Does not implicitly {@link NotificationCenter.NotificationsApprovalStatusUpdateRequest.verify|verify} messages. + * @param message NotificationsApprovalStatusUpdateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: NotificationCenter.INotificationsApprovalStatusUpdateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NotificationsApprovalStatusUpdateRequest message, length delimited. Does not implicitly {@link NotificationCenter.NotificationsApprovalStatusUpdateRequest.verify|verify} messages. + * @param message NotificationsApprovalStatusUpdateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: NotificationCenter.INotificationsApprovalStatusUpdateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NotificationsApprovalStatusUpdateRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NotificationsApprovalStatusUpdateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): NotificationCenter.NotificationsApprovalStatusUpdateRequest; + + /** + * Decodes a NotificationsApprovalStatusUpdateRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NotificationsApprovalStatusUpdateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): NotificationCenter.NotificationsApprovalStatusUpdateRequest; + + /** + * Verifies a NotificationsApprovalStatusUpdateRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NotificationsApprovalStatusUpdateRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NotificationsApprovalStatusUpdateRequest + */ + public static fromObject(object: { [k: string]: any }): NotificationCenter.NotificationsApprovalStatusUpdateRequest; + + /** + * Creates a plain object from a NotificationsApprovalStatusUpdateRequest message. Also converts values to other types if specified. + * @param message NotificationsApprovalStatusUpdateRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: NotificationCenter.NotificationsApprovalStatusUpdateRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NotificationsApprovalStatusUpdateRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NotificationsApprovalStatusUpdateRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } } /** Namespace GraphSync. */ @@ -86978,6 +87191,206 @@ export namespace BI { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of an EventResponse. */ + interface IEventResponse { + + /** EventResponse index */ + index?: (number|null); + + /** EventResponse status */ + status?: (boolean|null); + } + + /** Represents an EventResponse. */ + class EventResponse implements IEventResponse { + + /** + * Constructs a new EventResponse. + * @param [properties] Properties to set + */ + constructor(properties?: BI.IEventResponse); + + /** EventResponse index. */ + public index: number; + + /** EventResponse status. */ + public status: boolean; + + /** + * Creates a new EventResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns EventResponse instance + */ + public static create(properties?: BI.IEventResponse): BI.EventResponse; + + /** + * Encodes the specified EventResponse message. Does not implicitly {@link BI.EventResponse.verify|verify} messages. + * @param message EventResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: BI.IEventResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EventResponse message, length delimited. Does not implicitly {@link BI.EventResponse.verify|verify} messages. + * @param message EventResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: BI.IEventResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EventResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EventResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): BI.EventResponse; + + /** + * Decodes an EventResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EventResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): BI.EventResponse; + + /** + * Verifies an EventResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EventResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EventResponse + */ + public static fromObject(object: { [k: string]: any }): BI.EventResponse; + + /** + * Creates a plain object from an EventResponse message. Also converts values to other types if specified. + * @param message EventResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: BI.EventResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EventResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EventResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EventsResponse. */ + interface IEventsResponse { + + /** EventsResponse response */ + response?: (BI.IEventResponse[]|null); + } + + /** Represents an EventsResponse. */ + class EventsResponse implements IEventsResponse { + + /** + * Constructs a new EventsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: BI.IEventsResponse); + + /** EventsResponse response. */ + public response: BI.IEventResponse[]; + + /** + * Creates a new EventsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns EventsResponse instance + */ + public static create(properties?: BI.IEventsResponse): BI.EventsResponse; + + /** + * Encodes the specified EventsResponse message. Does not implicitly {@link BI.EventsResponse.verify|verify} messages. + * @param message EventsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: BI.IEventsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EventsResponse message, length delimited. Does not implicitly {@link BI.EventsResponse.verify|verify} messages. + * @param message EventsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: BI.IEventsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EventsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EventsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): BI.EventsResponse; + + /** + * Decodes an EventsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EventsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): BI.EventsResponse; + + /** + * Verifies an EventsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EventsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EventsResponse + */ + public static fromObject(object: { [k: string]: any }): BI.EventsResponse; + + /** + * Creates a plain object from an EventsResponse message. Also converts values to other types if specified. + * @param message EventsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: BI.EventsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EventsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EventsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Properties of a CustomerCaptureRequest. */ interface ICustomerCaptureRequest { @@ -87225,7 +87638,8 @@ export namespace BI { addChat = 6, addPAM = 7, addSilverSupport = 8, - addPlatinumSupport = 9 + addPlatinumSupport = 9, + addKEPM = 10 } /** Properties of an Error. */ @@ -87354,6 +87768,9 @@ export namespace BI { /** QuotePurchase taxLabel */ taxLabel?: (string|null); + + /** QuotePurchase purchaseIdentifier */ + purchaseIdentifier?: (string|null); } /** Represents a QuotePurchase. */ @@ -87380,6 +87797,9 @@ export namespace BI { /** QuotePurchase taxLabel. */ public taxLabel: string; + /** QuotePurchase purchaseIdentifier. */ + public purchaseIdentifier: string; + /** * Creates a new QuotePurchase instance using the specified properties. * @param [properties] Properties to set @@ -87458,6 +87878,423 @@ export namespace BI { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of a PurchaseOptions. */ + interface IPurchaseOptions { + + /** PurchaseOptions inConsole */ + inConsole?: (boolean|null); + + /** PurchaseOptions externalCheckout */ + externalCheckout?: (boolean|null); + } + + /** Represents a PurchaseOptions. */ + class PurchaseOptions implements IPurchaseOptions { + + /** + * Constructs a new PurchaseOptions. + * @param [properties] Properties to set + */ + constructor(properties?: BI.IPurchaseOptions); + + /** PurchaseOptions inConsole. */ + public inConsole?: (boolean|null); + + /** PurchaseOptions externalCheckout. */ + public externalCheckout?: (boolean|null); + + /** PurchaseOptions _inConsole. */ + public _inConsole?: "inConsole"; + + /** PurchaseOptions _externalCheckout. */ + public _externalCheckout?: "externalCheckout"; + + /** + * Creates a new PurchaseOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns PurchaseOptions instance + */ + public static create(properties?: BI.IPurchaseOptions): BI.PurchaseOptions; + + /** + * Encodes the specified PurchaseOptions message. Does not implicitly {@link BI.PurchaseOptions.verify|verify} messages. + * @param message PurchaseOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: BI.IPurchaseOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PurchaseOptions message, length delimited. Does not implicitly {@link BI.PurchaseOptions.verify|verify} messages. + * @param message PurchaseOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: BI.IPurchaseOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PurchaseOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PurchaseOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): BI.PurchaseOptions; + + /** + * Decodes a PurchaseOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PurchaseOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): BI.PurchaseOptions; + + /** + * Verifies a PurchaseOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PurchaseOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PurchaseOptions + */ + public static fromObject(object: { [k: string]: any }): BI.PurchaseOptions; + + /** + * Creates a plain object from a PurchaseOptions message. Also converts values to other types if specified. + * @param message PurchaseOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: BI.PurchaseOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PurchaseOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PurchaseOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AddonPurchaseOptions. */ + interface IAddonPurchaseOptions { + + /** AddonPurchaseOptions storage */ + storage?: (BI.IPurchaseOptions|null); + + /** AddonPurchaseOptions audit */ + audit?: (BI.IPurchaseOptions|null); + + /** AddonPurchaseOptions breachwatch */ + breachwatch?: (BI.IPurchaseOptions|null); + + /** AddonPurchaseOptions chat */ + chat?: (BI.IPurchaseOptions|null); + + /** AddonPurchaseOptions compliance */ + compliance?: (BI.IPurchaseOptions|null); + + /** AddonPurchaseOptions professionalServicesSilver */ + professionalServicesSilver?: (BI.IPurchaseOptions|null); + + /** AddonPurchaseOptions professionalServicesPlatinum */ + professionalServicesPlatinum?: (BI.IPurchaseOptions|null); + + /** AddonPurchaseOptions pam */ + pam?: (BI.IPurchaseOptions|null); + + /** AddonPurchaseOptions epm */ + epm?: (BI.IPurchaseOptions|null); + + /** AddonPurchaseOptions secretsManager */ + secretsManager?: (BI.IPurchaseOptions|null); + + /** AddonPurchaseOptions connectionManager */ + connectionManager?: (BI.IPurchaseOptions|null); + + /** AddonPurchaseOptions remoteBrowserIsolation */ + remoteBrowserIsolation?: (BI.IPurchaseOptions|null); + } + + /** Represents an AddonPurchaseOptions. */ + class AddonPurchaseOptions implements IAddonPurchaseOptions { + + /** + * Constructs a new AddonPurchaseOptions. + * @param [properties] Properties to set + */ + constructor(properties?: BI.IAddonPurchaseOptions); + + /** AddonPurchaseOptions storage. */ + public storage?: (BI.IPurchaseOptions|null); + + /** AddonPurchaseOptions audit. */ + public audit?: (BI.IPurchaseOptions|null); + + /** AddonPurchaseOptions breachwatch. */ + public breachwatch?: (BI.IPurchaseOptions|null); + + /** AddonPurchaseOptions chat. */ + public chat?: (BI.IPurchaseOptions|null); + + /** AddonPurchaseOptions compliance. */ + public compliance?: (BI.IPurchaseOptions|null); + + /** AddonPurchaseOptions professionalServicesSilver. */ + public professionalServicesSilver?: (BI.IPurchaseOptions|null); + + /** AddonPurchaseOptions professionalServicesPlatinum. */ + public professionalServicesPlatinum?: (BI.IPurchaseOptions|null); + + /** AddonPurchaseOptions pam. */ + public pam?: (BI.IPurchaseOptions|null); + + /** AddonPurchaseOptions epm. */ + public epm?: (BI.IPurchaseOptions|null); + + /** AddonPurchaseOptions secretsManager. */ + public secretsManager?: (BI.IPurchaseOptions|null); + + /** AddonPurchaseOptions connectionManager. */ + public connectionManager?: (BI.IPurchaseOptions|null); + + /** AddonPurchaseOptions remoteBrowserIsolation. */ + public remoteBrowserIsolation?: (BI.IPurchaseOptions|null); + + /** AddonPurchaseOptions _storage. */ + public _storage?: "storage"; + + /** AddonPurchaseOptions _audit. */ + public _audit?: "audit"; + + /** AddonPurchaseOptions _breachwatch. */ + public _breachwatch?: "breachwatch"; + + /** AddonPurchaseOptions _chat. */ + public _chat?: "chat"; + + /** AddonPurchaseOptions _compliance. */ + public _compliance?: "compliance"; + + /** AddonPurchaseOptions _professionalServicesSilver. */ + public _professionalServicesSilver?: "professionalServicesSilver"; + + /** AddonPurchaseOptions _professionalServicesPlatinum. */ + public _professionalServicesPlatinum?: "professionalServicesPlatinum"; + + /** AddonPurchaseOptions _pam. */ + public _pam?: "pam"; + + /** AddonPurchaseOptions _epm. */ + public _epm?: "epm"; + + /** AddonPurchaseOptions _secretsManager. */ + public _secretsManager?: "secretsManager"; + + /** AddonPurchaseOptions _connectionManager. */ + public _connectionManager?: "connectionManager"; + + /** AddonPurchaseOptions _remoteBrowserIsolation. */ + public _remoteBrowserIsolation?: "remoteBrowserIsolation"; + + /** + * Creates a new AddonPurchaseOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns AddonPurchaseOptions instance + */ + public static create(properties?: BI.IAddonPurchaseOptions): BI.AddonPurchaseOptions; + + /** + * Encodes the specified AddonPurchaseOptions message. Does not implicitly {@link BI.AddonPurchaseOptions.verify|verify} messages. + * @param message AddonPurchaseOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: BI.IAddonPurchaseOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AddonPurchaseOptions message, length delimited. Does not implicitly {@link BI.AddonPurchaseOptions.verify|verify} messages. + * @param message AddonPurchaseOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: BI.IAddonPurchaseOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AddonPurchaseOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AddonPurchaseOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): BI.AddonPurchaseOptions; + + /** + * Decodes an AddonPurchaseOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AddonPurchaseOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): BI.AddonPurchaseOptions; + + /** + * Verifies an AddonPurchaseOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AddonPurchaseOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AddonPurchaseOptions + */ + public static fromObject(object: { [k: string]: any }): BI.AddonPurchaseOptions; + + /** + * Creates a plain object from an AddonPurchaseOptions message. Also converts values to other types if specified. + * @param message AddonPurchaseOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: BI.AddonPurchaseOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AddonPurchaseOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AddonPurchaseOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AvailablePurchaseOptions. */ + interface IAvailablePurchaseOptions { + + /** AvailablePurchaseOptions basePlan */ + basePlan?: (BI.IPurchaseOptions|null); + + /** AvailablePurchaseOptions users */ + users?: (BI.IPurchaseOptions|null); + + /** AvailablePurchaseOptions addons */ + addons?: (BI.IAddonPurchaseOptions|null); + } + + /** Represents an AvailablePurchaseOptions. */ + class AvailablePurchaseOptions implements IAvailablePurchaseOptions { + + /** + * Constructs a new AvailablePurchaseOptions. + * @param [properties] Properties to set + */ + constructor(properties?: BI.IAvailablePurchaseOptions); + + /** AvailablePurchaseOptions basePlan. */ + public basePlan?: (BI.IPurchaseOptions|null); + + /** AvailablePurchaseOptions users. */ + public users?: (BI.IPurchaseOptions|null); + + /** AvailablePurchaseOptions addons. */ + public addons?: (BI.IAddonPurchaseOptions|null); + + /** + * Creates a new AvailablePurchaseOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns AvailablePurchaseOptions instance + */ + public static create(properties?: BI.IAvailablePurchaseOptions): BI.AvailablePurchaseOptions; + + /** + * Encodes the specified AvailablePurchaseOptions message. Does not implicitly {@link BI.AvailablePurchaseOptions.verify|verify} messages. + * @param message AvailablePurchaseOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: BI.IAvailablePurchaseOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AvailablePurchaseOptions message, length delimited. Does not implicitly {@link BI.AvailablePurchaseOptions.verify|verify} messages. + * @param message AvailablePurchaseOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: BI.IAvailablePurchaseOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AvailablePurchaseOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AvailablePurchaseOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): BI.AvailablePurchaseOptions; + + /** + * Decodes an AvailablePurchaseOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AvailablePurchaseOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): BI.AvailablePurchaseOptions; + + /** + * Verifies an AvailablePurchaseOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AvailablePurchaseOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AvailablePurchaseOptions + */ + public static fromObject(object: { [k: string]: any }): BI.AvailablePurchaseOptions; + + /** + * Creates a plain object from an AvailablePurchaseOptions message. Also converts values to other types if specified. + * @param message AvailablePurchaseOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: BI.AvailablePurchaseOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AvailablePurchaseOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AvailablePurchaseOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Properties of an UpgradeLicenseStatusRequest. */ interface IUpgradeLicenseStatusRequest { } @@ -87555,8 +88392,8 @@ export namespace BI { /** UpgradeLicenseStatusResponse allowPurchaseFromConsole */ allowPurchaseFromConsole?: (boolean|null); - /** UpgradeLicenseStatusResponse checkoutLink */ - checkoutLink?: (string|null); + /** UpgradeLicenseStatusResponse purchaseOptions */ + purchaseOptions?: (BI.IAvailablePurchaseOptions|null); /** UpgradeLicenseStatusResponse error */ error?: (BI.IError|null); @@ -87574,8 +88411,8 @@ export namespace BI { /** UpgradeLicenseStatusResponse allowPurchaseFromConsole. */ public allowPurchaseFromConsole: boolean; - /** UpgradeLicenseStatusResponse checkoutLink. */ - public checkoutLink: string; + /** UpgradeLicenseStatusResponse purchaseOptions. */ + public purchaseOptions?: (BI.IAvailablePurchaseOptions|null); /** UpgradeLicenseStatusResponse error. */ public error?: (BI.IError|null); @@ -87666,6 +88503,9 @@ export namespace BI { /** UpgradeLicenseQuotePurchaseRequest quantity */ quantity?: (number|null); + + /** UpgradeLicenseQuotePurchaseRequest tier */ + tier?: (number|null); } /** Represents an UpgradeLicenseQuotePurchaseRequest. */ @@ -87683,6 +88523,9 @@ export namespace BI { /** UpgradeLicenseQuotePurchaseRequest quantity. */ public quantity: number; + /** UpgradeLicenseQuotePurchaseRequest tier. */ + public tier: number; + /** * Creates a new UpgradeLicenseQuotePurchaseRequest instance using the specified properties. * @param [properties] Properties to set @@ -87887,6 +88730,9 @@ export namespace BI { /** UpgradeLicenseCompletePurchaseRequest quotePurchase */ quotePurchase?: (BI.IQuotePurchase|null); + + /** UpgradeLicenseCompletePurchaseRequest tier */ + tier?: (number|null); } /** Represents an UpgradeLicenseCompletePurchaseRequest. */ @@ -87907,6 +88753,9 @@ export namespace BI { /** UpgradeLicenseCompletePurchaseRequest quotePurchase. */ public quotePurchase?: (BI.IQuotePurchase|null); + /** UpgradeLicenseCompletePurchaseRequest tier. */ + public tier: number; + /** * Creates a new UpgradeLicenseCompletePurchaseRequest instance using the specified properties. * @param [properties] Properties to set @@ -88952,6 +89801,821 @@ export namespace BI { */ public static getTypeUrl(typeUrlPrefix?: string): string; } + + /** Properties of a GetDailyCountRequest. */ + interface IGetDailyCountRequest { + + /** GetDailyCountRequest enterpriseId */ + enterpriseId?: (number[]|null); + + /** GetDailyCountRequest monthYear */ + monthYear?: (BI.IMonthYear|null); + + /** GetDailyCountRequest dateRange */ + dateRange?: (BI.IDateRange|null); + } + + /** Represents a GetDailyCountRequest. */ + class GetDailyCountRequest implements IGetDailyCountRequest { + + /** + * Constructs a new GetDailyCountRequest. + * @param [properties] Properties to set + */ + constructor(properties?: BI.IGetDailyCountRequest); + + /** GetDailyCountRequest enterpriseId. */ + public enterpriseId: number[]; + + /** GetDailyCountRequest monthYear. */ + public monthYear?: (BI.IMonthYear|null); + + /** GetDailyCountRequest dateRange. */ + public dateRange?: (BI.IDateRange|null); + + /** GetDailyCountRequest period. */ + public period?: ("monthYear"|"dateRange"); + + /** + * Creates a new GetDailyCountRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetDailyCountRequest instance + */ + public static create(properties?: BI.IGetDailyCountRequest): BI.GetDailyCountRequest; + + /** + * Encodes the specified GetDailyCountRequest message. Does not implicitly {@link BI.GetDailyCountRequest.verify|verify} messages. + * @param message GetDailyCountRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: BI.IGetDailyCountRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetDailyCountRequest message, length delimited. Does not implicitly {@link BI.GetDailyCountRequest.verify|verify} messages. + * @param message GetDailyCountRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: BI.IGetDailyCountRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetDailyCountRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetDailyCountRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): BI.GetDailyCountRequest; + + /** + * Decodes a GetDailyCountRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetDailyCountRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): BI.GetDailyCountRequest; + + /** + * Verifies a GetDailyCountRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetDailyCountRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetDailyCountRequest + */ + public static fromObject(object: { [k: string]: any }): BI.GetDailyCountRequest; + + /** + * Creates a plain object from a GetDailyCountRequest message. Also converts values to other types if specified. + * @param message GetDailyCountRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: BI.GetDailyCountRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetDailyCountRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetDailyCountRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MonthYear. */ + interface IMonthYear { + + /** MonthYear month */ + month?: (number|null); + + /** MonthYear year */ + year?: (number|null); + } + + /** Represents a MonthYear. */ + class MonthYear implements IMonthYear { + + /** + * Constructs a new MonthYear. + * @param [properties] Properties to set + */ + constructor(properties?: BI.IMonthYear); + + /** MonthYear month. */ + public month: number; + + /** MonthYear year. */ + public year: number; + + /** + * Creates a new MonthYear instance using the specified properties. + * @param [properties] Properties to set + * @returns MonthYear instance + */ + public static create(properties?: BI.IMonthYear): BI.MonthYear; + + /** + * Encodes the specified MonthYear message. Does not implicitly {@link BI.MonthYear.verify|verify} messages. + * @param message MonthYear message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: BI.IMonthYear, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MonthYear message, length delimited. Does not implicitly {@link BI.MonthYear.verify|verify} messages. + * @param message MonthYear message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: BI.IMonthYear, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MonthYear message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MonthYear + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): BI.MonthYear; + + /** + * Decodes a MonthYear message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MonthYear + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): BI.MonthYear; + + /** + * Verifies a MonthYear message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MonthYear message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MonthYear + */ + public static fromObject(object: { [k: string]: any }): BI.MonthYear; + + /** + * Creates a plain object from a MonthYear message. Also converts values to other types if specified. + * @param message MonthYear + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: BI.MonthYear, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MonthYear to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MonthYear + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DateRange. */ + interface IDateRange { + + /** DateRange start */ + start?: (number|Long|null); + + /** DateRange end */ + end?: (number|Long|null); + } + + /** Represents a DateRange. */ + class DateRange implements IDateRange { + + /** + * Constructs a new DateRange. + * @param [properties] Properties to set + */ + constructor(properties?: BI.IDateRange); + + /** DateRange start. */ + public start: (number|Long); + + /** DateRange end. */ + public end: (number|Long); + + /** + * Creates a new DateRange instance using the specified properties. + * @param [properties] Properties to set + * @returns DateRange instance + */ + public static create(properties?: BI.IDateRange): BI.DateRange; + + /** + * Encodes the specified DateRange message. Does not implicitly {@link BI.DateRange.verify|verify} messages. + * @param message DateRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: BI.IDateRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DateRange message, length delimited. Does not implicitly {@link BI.DateRange.verify|verify} messages. + * @param message DateRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: BI.IDateRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DateRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DateRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): BI.DateRange; + + /** + * Decodes a DateRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DateRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): BI.DateRange; + + /** + * Verifies a DateRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DateRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DateRange + */ + public static fromObject(object: { [k: string]: any }): BI.DateRange; + + /** + * Creates a plain object from a DateRange message. Also converts values to other types if specified. + * @param message DateRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: BI.DateRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DateRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DateRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DailyCount. */ + interface IDailyCount { + + /** DailyCount date */ + date?: (number|Long|null); + + /** DailyCount pamCount */ + pamCount?: (number|null); + } + + /** Represents a DailyCount. */ + class DailyCount implements IDailyCount { + + /** + * Constructs a new DailyCount. + * @param [properties] Properties to set + */ + constructor(properties?: BI.IDailyCount); + + /** DailyCount date. */ + public date: (number|Long); + + /** DailyCount pamCount. */ + public pamCount: number; + + /** + * Creates a new DailyCount instance using the specified properties. + * @param [properties] Properties to set + * @returns DailyCount instance + */ + public static create(properties?: BI.IDailyCount): BI.DailyCount; + + /** + * Encodes the specified DailyCount message. Does not implicitly {@link BI.DailyCount.verify|verify} messages. + * @param message DailyCount message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: BI.IDailyCount, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DailyCount message, length delimited. Does not implicitly {@link BI.DailyCount.verify|verify} messages. + * @param message DailyCount message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: BI.IDailyCount, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DailyCount message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DailyCount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): BI.DailyCount; + + /** + * Decodes a DailyCount message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DailyCount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): BI.DailyCount; + + /** + * Verifies a DailyCount message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DailyCount message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DailyCount + */ + public static fromObject(object: { [k: string]: any }): BI.DailyCount; + + /** + * Creates a plain object from a DailyCount message. Also converts values to other types if specified. + * @param message DailyCount + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: BI.DailyCount, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DailyCount to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DailyCount + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CountForEnterprise. */ + interface ICountForEnterprise { + + /** CountForEnterprise enterpriseId */ + enterpriseId?: (number|null); + + /** CountForEnterprise counts */ + counts?: (BI.IDailyCount[]|null); + } + + /** Represents a CountForEnterprise. */ + class CountForEnterprise implements ICountForEnterprise { + + /** + * Constructs a new CountForEnterprise. + * @param [properties] Properties to set + */ + constructor(properties?: BI.ICountForEnterprise); + + /** CountForEnterprise enterpriseId. */ + public enterpriseId: number; + + /** CountForEnterprise counts. */ + public counts: BI.IDailyCount[]; + + /** + * Creates a new CountForEnterprise instance using the specified properties. + * @param [properties] Properties to set + * @returns CountForEnterprise instance + */ + public static create(properties?: BI.ICountForEnterprise): BI.CountForEnterprise; + + /** + * Encodes the specified CountForEnterprise message. Does not implicitly {@link BI.CountForEnterprise.verify|verify} messages. + * @param message CountForEnterprise message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: BI.ICountForEnterprise, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CountForEnterprise message, length delimited. Does not implicitly {@link BI.CountForEnterprise.verify|verify} messages. + * @param message CountForEnterprise message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: BI.ICountForEnterprise, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CountForEnterprise message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CountForEnterprise + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): BI.CountForEnterprise; + + /** + * Decodes a CountForEnterprise message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CountForEnterprise + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): BI.CountForEnterprise; + + /** + * Verifies a CountForEnterprise message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CountForEnterprise message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CountForEnterprise + */ + public static fromObject(object: { [k: string]: any }): BI.CountForEnterprise; + + /** + * Creates a plain object from a CountForEnterprise message. Also converts values to other types if specified. + * @param message CountForEnterprise + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: BI.CountForEnterprise, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CountForEnterprise to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CountForEnterprise + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetDailyCountResponse. */ + interface IGetDailyCountResponse { + + /** GetDailyCountResponse enterpriseCounts */ + enterpriseCounts?: (BI.ICountForEnterprise[]|null); + } + + /** Represents a GetDailyCountResponse. */ + class GetDailyCountResponse implements IGetDailyCountResponse { + + /** + * Constructs a new GetDailyCountResponse. + * @param [properties] Properties to set + */ + constructor(properties?: BI.IGetDailyCountResponse); + + /** GetDailyCountResponse enterpriseCounts. */ + public enterpriseCounts: BI.ICountForEnterprise[]; + + /** + * Creates a new GetDailyCountResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns GetDailyCountResponse instance + */ + public static create(properties?: BI.IGetDailyCountResponse): BI.GetDailyCountResponse; + + /** + * Encodes the specified GetDailyCountResponse message. Does not implicitly {@link BI.GetDailyCountResponse.verify|verify} messages. + * @param message GetDailyCountResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: BI.IGetDailyCountResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetDailyCountResponse message, length delimited. Does not implicitly {@link BI.GetDailyCountResponse.verify|verify} messages. + * @param message GetDailyCountResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: BI.IGetDailyCountResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetDailyCountResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetDailyCountResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): BI.GetDailyCountResponse; + + /** + * Decodes a GetDailyCountResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetDailyCountResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): BI.GetDailyCountResponse; + + /** + * Verifies a GetDailyCountResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetDailyCountResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetDailyCountResponse + */ + public static fromObject(object: { [k: string]: any }): BI.GetDailyCountResponse; + + /** + * Creates a plain object from a GetDailyCountResponse message. Also converts values to other types if specified. + * @param message GetDailyCountResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: BI.GetDailyCountResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetDailyCountResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetDailyCountResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ActivePamCountRequest. */ + interface IActivePamCountRequest { + + /** ActivePamCountRequest enterpriseId */ + enterpriseId?: (number|null); + } + + /** Represents an ActivePamCountRequest. */ + class ActivePamCountRequest implements IActivePamCountRequest { + + /** + * Constructs a new ActivePamCountRequest. + * @param [properties] Properties to set + */ + constructor(properties?: BI.IActivePamCountRequest); + + /** ActivePamCountRequest enterpriseId. */ + public enterpriseId: number; + + /** + * Creates a new ActivePamCountRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ActivePamCountRequest instance + */ + public static create(properties?: BI.IActivePamCountRequest): BI.ActivePamCountRequest; + + /** + * Encodes the specified ActivePamCountRequest message. Does not implicitly {@link BI.ActivePamCountRequest.verify|verify} messages. + * @param message ActivePamCountRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: BI.IActivePamCountRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ActivePamCountRequest message, length delimited. Does not implicitly {@link BI.ActivePamCountRequest.verify|verify} messages. + * @param message ActivePamCountRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: BI.IActivePamCountRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ActivePamCountRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ActivePamCountRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): BI.ActivePamCountRequest; + + /** + * Decodes an ActivePamCountRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ActivePamCountRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): BI.ActivePamCountRequest; + + /** + * Verifies an ActivePamCountRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ActivePamCountRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ActivePamCountRequest + */ + public static fromObject(object: { [k: string]: any }): BI.ActivePamCountRequest; + + /** + * Creates a plain object from an ActivePamCountRequest message. Also converts values to other types if specified. + * @param message ActivePamCountRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: BI.ActivePamCountRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ActivePamCountRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ActivePamCountRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ActivePamCountResponse. */ + interface IActivePamCountResponse { + + /** ActivePamCountResponse pamCount */ + pamCount?: (number|null); + } + + /** Represents an ActivePamCountResponse. */ + class ActivePamCountResponse implements IActivePamCountResponse { + + /** + * Constructs a new ActivePamCountResponse. + * @param [properties] Properties to set + */ + constructor(properties?: BI.IActivePamCountResponse); + + /** ActivePamCountResponse pamCount. */ + public pamCount: number; + + /** + * Creates a new ActivePamCountResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ActivePamCountResponse instance + */ + public static create(properties?: BI.IActivePamCountResponse): BI.ActivePamCountResponse; + + /** + * Encodes the specified ActivePamCountResponse message. Does not implicitly {@link BI.ActivePamCountResponse.verify|verify} messages. + * @param message ActivePamCountResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: BI.IActivePamCountResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ActivePamCountResponse message, length delimited. Does not implicitly {@link BI.ActivePamCountResponse.verify|verify} messages. + * @param message ActivePamCountResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: BI.IActivePamCountResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ActivePamCountResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ActivePamCountResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): BI.ActivePamCountResponse; + + /** + * Decodes an ActivePamCountResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ActivePamCountResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): BI.ActivePamCountResponse; + + /** + * Verifies an ActivePamCountResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ActivePamCountResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ActivePamCountResponse + */ + public static fromObject(object: { [k: string]: any }): BI.ActivePamCountResponse; + + /** + * Creates a plain object from an ActivePamCountResponse message. Also converts values to other types if specified. + * @param message ActivePamCountResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: BI.ActivePamCountResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ActivePamCountResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ActivePamCountResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } } /** Namespace google. */ diff --git a/keeperapi/src/proto.js b/keeperapi/src/proto.js index 9c439c0..ef2c70a 100644 --- a/keeperapi/src/proto.js +++ b/keeperapi/src/proto.js @@ -222,6 +222,7 @@ export const Authentication = $root.Authentication = (() => { * @property {Uint8Array|null} [mlKemEncapsulatedKey] QrcMessageKey mlKemEncapsulatedKey * @property {Uint8Array|null} [data] QrcMessageKey data * @property {number|null} [msgVersion] QrcMessageKey msgVersion + * @property {number|null} [ecKeyId] QrcMessageKey ecKeyId */ /** @@ -271,6 +272,14 @@ export const Authentication = $root.Authentication = (() => { */ QrcMessageKey.prototype.msgVersion = 0; + /** + * QrcMessageKey ecKeyId. + * @member {number} ecKeyId + * @memberof Authentication.QrcMessageKey + * @instance + */ + QrcMessageKey.prototype.ecKeyId = 0; + /** * Creates a new QrcMessageKey instance using the specified properties. * @function create @@ -303,6 +312,8 @@ export const Authentication = $root.Authentication = (() => { writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.data); if (message.msgVersion != null && Object.hasOwnProperty.call(message, "msgVersion")) writer.uint32(/* id 4, wireType 0 =*/32).int32(message.msgVersion); + if (message.ecKeyId != null && Object.hasOwnProperty.call(message, "ecKeyId")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.ecKeyId); return writer; }; @@ -353,6 +364,10 @@ export const Authentication = $root.Authentication = (() => { message.msgVersion = reader.int32(); break; } + case 5: { + message.ecKeyId = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -400,6 +415,9 @@ export const Authentication = $root.Authentication = (() => { if (message.msgVersion != null && message.hasOwnProperty("msgVersion")) if (!$util.isInteger(message.msgVersion)) return "msgVersion: integer expected"; + if (message.ecKeyId != null && message.hasOwnProperty("ecKeyId")) + if (!$util.isInteger(message.ecKeyId)) + return "ecKeyId: integer expected"; return null; }; @@ -432,6 +450,8 @@ export const Authentication = $root.Authentication = (() => { message.data = object.data; if (object.msgVersion != null) message.msgVersion = object.msgVersion | 0; + if (object.ecKeyId != null) + message.ecKeyId = object.ecKeyId | 0; return message; }; @@ -471,6 +491,7 @@ export const Authentication = $root.Authentication = (() => { object.data = $util.newBuffer(object.data); } object.msgVersion = 0; + object.ecKeyId = 0; } if (message.clientEcPublicKey != null && message.hasOwnProperty("clientEcPublicKey")) object.clientEcPublicKey = options.bytes === String ? $util.base64.encode(message.clientEcPublicKey, 0, message.clientEcPublicKey.length) : options.bytes === Array ? Array.prototype.slice.call(message.clientEcPublicKey) : message.clientEcPublicKey; @@ -480,6 +501,8 @@ export const Authentication = $root.Authentication = (() => { object.data = options.bytes === String ? $util.base64.encode(message.data, 0, message.data.length) : options.bytes === Array ? Array.prototype.slice.call(message.data) : message.data; if (message.msgVersion != null && message.hasOwnProperty("msgVersion")) object.msgVersion = message.msgVersion; + if (message.ecKeyId != null && message.hasOwnProperty("ecKeyId")) + object.ecKeyId = message.ecKeyId; return object; }; @@ -100048,6 +100071,276 @@ export const Enterprise = $root.Enterprise = (() => { return ClearSecurityDataRequest; })(); + Enterprise.RolesByTeam = (function() { + + /** + * Properties of a RolesByTeam. + * @memberof Enterprise + * @interface IRolesByTeam + * @property {Uint8Array|null} [teamUid] RolesByTeam teamUid + * @property {Array.|null} [roleId] RolesByTeam roleId + */ + + /** + * Constructs a new RolesByTeam. + * @memberof Enterprise + * @classdesc Represents a RolesByTeam. + * @implements IRolesByTeam + * @constructor + * @param {Enterprise.IRolesByTeam=} [properties] Properties to set + */ + function RolesByTeam(properties) { + this.roleId = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RolesByTeam teamUid. + * @member {Uint8Array} teamUid + * @memberof Enterprise.RolesByTeam + * @instance + */ + RolesByTeam.prototype.teamUid = $util.newBuffer([]); + + /** + * RolesByTeam roleId. + * @member {Array.} roleId + * @memberof Enterprise.RolesByTeam + * @instance + */ + RolesByTeam.prototype.roleId = $util.emptyArray; + + /** + * Creates a new RolesByTeam instance using the specified properties. + * @function create + * @memberof Enterprise.RolesByTeam + * @static + * @param {Enterprise.IRolesByTeam=} [properties] Properties to set + * @returns {Enterprise.RolesByTeam} RolesByTeam instance + */ + RolesByTeam.create = function create(properties) { + return new RolesByTeam(properties); + }; + + /** + * Encodes the specified RolesByTeam message. Does not implicitly {@link Enterprise.RolesByTeam.verify|verify} messages. + * @function encode + * @memberof Enterprise.RolesByTeam + * @static + * @param {Enterprise.IRolesByTeam} message RolesByTeam message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RolesByTeam.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.teamUid != null && Object.hasOwnProperty.call(message, "teamUid")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.teamUid); + if (message.roleId != null && message.roleId.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (let i = 0; i < message.roleId.length; ++i) + writer.int64(message.roleId[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified RolesByTeam message, length delimited. Does not implicitly {@link Enterprise.RolesByTeam.verify|verify} messages. + * @function encodeDelimited + * @memberof Enterprise.RolesByTeam + * @static + * @param {Enterprise.IRolesByTeam} message RolesByTeam message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RolesByTeam.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RolesByTeam message from the specified reader or buffer. + * @function decode + * @memberof Enterprise.RolesByTeam + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {Enterprise.RolesByTeam} RolesByTeam + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RolesByTeam.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.Enterprise.RolesByTeam(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.teamUid = reader.bytes(); + break; + } + case 2: { + if (!(message.roleId && message.roleId.length)) + message.roleId = []; + if ((tag & 7) === 2) { + let end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.roleId.push(reader.int64()); + } else + message.roleId.push(reader.int64()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RolesByTeam message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof Enterprise.RolesByTeam + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {Enterprise.RolesByTeam} RolesByTeam + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RolesByTeam.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RolesByTeam message. + * @function verify + * @memberof Enterprise.RolesByTeam + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RolesByTeam.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.teamUid != null && message.hasOwnProperty("teamUid")) + if (!(message.teamUid && typeof message.teamUid.length === "number" || $util.isString(message.teamUid))) + return "teamUid: buffer expected"; + if (message.roleId != null && message.hasOwnProperty("roleId")) { + if (!Array.isArray(message.roleId)) + return "roleId: array expected"; + for (let i = 0; i < message.roleId.length; ++i) + if (!$util.isInteger(message.roleId[i]) && !(message.roleId[i] && $util.isInteger(message.roleId[i].low) && $util.isInteger(message.roleId[i].high))) + return "roleId: integer|Long[] expected"; + } + return null; + }; + + /** + * Creates a RolesByTeam message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof Enterprise.RolesByTeam + * @static + * @param {Object.} object Plain object + * @returns {Enterprise.RolesByTeam} RolesByTeam + */ + RolesByTeam.fromObject = function fromObject(object) { + if (object instanceof $root.Enterprise.RolesByTeam) + return object; + let message = new $root.Enterprise.RolesByTeam(); + if (object.teamUid != null) + if (typeof object.teamUid === "string") + $util.base64.decode(object.teamUid, message.teamUid = $util.newBuffer($util.base64.length(object.teamUid)), 0); + else if (object.teamUid.length >= 0) + message.teamUid = object.teamUid; + if (object.roleId) { + if (!Array.isArray(object.roleId)) + throw TypeError(".Enterprise.RolesByTeam.roleId: array expected"); + message.roleId = []; + for (let i = 0; i < object.roleId.length; ++i) + if ($util.Long) + (message.roleId[i] = $util.Long.fromValue(object.roleId[i])).unsigned = false; + else if (typeof object.roleId[i] === "string") + message.roleId[i] = parseInt(object.roleId[i], 10); + else if (typeof object.roleId[i] === "number") + message.roleId[i] = object.roleId[i]; + else if (typeof object.roleId[i] === "object") + message.roleId[i] = new $util.LongBits(object.roleId[i].low >>> 0, object.roleId[i].high >>> 0).toNumber(); + } + return message; + }; + + /** + * Creates a plain object from a RolesByTeam message. Also converts values to other types if specified. + * @function toObject + * @memberof Enterprise.RolesByTeam + * @static + * @param {Enterprise.RolesByTeam} message RolesByTeam + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RolesByTeam.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.roleId = []; + if (options.defaults) + if (options.bytes === String) + object.teamUid = ""; + else { + object.teamUid = []; + if (options.bytes !== Array) + object.teamUid = $util.newBuffer(object.teamUid); + } + if (message.teamUid != null && message.hasOwnProperty("teamUid")) + object.teamUid = options.bytes === String ? $util.base64.encode(message.teamUid, 0, message.teamUid.length) : options.bytes === Array ? Array.prototype.slice.call(message.teamUid) : message.teamUid; + if (message.roleId && message.roleId.length) { + object.roleId = []; + for (let j = 0; j < message.roleId.length; ++j) + if (typeof message.roleId[j] === "number") + object.roleId[j] = options.longs === String ? String(message.roleId[j]) : message.roleId[j]; + else + object.roleId[j] = options.longs === String ? $util.Long.prototype.toString.call(message.roleId[j]) : options.longs === Number ? new $util.LongBits(message.roleId[j].low >>> 0, message.roleId[j].high >>> 0).toNumber() : message.roleId[j]; + } + return object; + }; + + /** + * Converts this RolesByTeam to JSON. + * @function toJSON + * @memberof Enterprise.RolesByTeam + * @instance + * @returns {Object.} JSON object + */ + RolesByTeam.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RolesByTeam + * @function getTypeUrl + * @memberof Enterprise.RolesByTeam + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RolesByTeam.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/Enterprise.RolesByTeam"; + }; + + return RolesByTeam; + })(); + return Enterprise; })(); @@ -213443,6 +213736,13 @@ export const NotificationCenter = $root.NotificationCenter = (() => { * @property {number} NT_DENIED_RESPONSE=11 NT_DENIED_RESPONSE value * @property {number} NT_2FA_CONFIGURED=12 NT_2FA_CONFIGURED value * @property {number} NT_SHARE_APPROVAL_DENIED=13 NT_SHARE_APPROVAL_DENIED value + * @property {number} NT_DEVICE_APPROVAL_APPROVED=14 NT_DEVICE_APPROVAL_APPROVED value + * @property {number} NT_DEVICE_APPROVAL_DENIED=15 NT_DEVICE_APPROVAL_DENIED value + * @property {number} NT_ACCOUNT_CREATED=16 NT_ACCOUNT_CREATED value + * @property {number} NT_2FA_ENABLED=17 NT_2FA_ENABLED value + * @property {number} NT_2FA_DISABLED=18 NT_2FA_DISABLED value + * @property {number} NT_SECURITY_KEYS_ENABLED=19 NT_SECURITY_KEYS_ENABLED value + * @property {number} NT_SECURITY_KEYS_DISABLED=20 NT_SECURITY_KEYS_DISABLED value */ NotificationCenter.NotificationType = (function() { const valuesById = {}, values = Object.create(valuesById); @@ -213460,6 +213760,13 @@ export const NotificationCenter = $root.NotificationCenter = (() => { values[valuesById[11] = "NT_DENIED_RESPONSE"] = 11; values[valuesById[12] = "NT_2FA_CONFIGURED"] = 12; values[valuesById[13] = "NT_SHARE_APPROVAL_DENIED"] = 13; + values[valuesById[14] = "NT_DEVICE_APPROVAL_APPROVED"] = 14; + values[valuesById[15] = "NT_DEVICE_APPROVAL_DENIED"] = 15; + values[valuesById[16] = "NT_ACCOUNT_CREATED"] = 16; + values[valuesById[17] = "NT_2FA_ENABLED"] = 17; + values[valuesById[18] = "NT_2FA_DISABLED"] = 18; + values[valuesById[19] = "NT_SECURITY_KEYS_ENABLED"] = 19; + values[valuesById[20] = "NT_SECURITY_KEYS_DISABLED"] = 20; return values; })(); @@ -213992,6 +214299,13 @@ export const NotificationCenter = $root.NotificationCenter = (() => { case 11: case 12: case 13: + case 14: + case 15: + case 16: + case 17: + case 18: + case 19: + case 20: break; } if (message.category != null && message.hasOwnProperty("category")) @@ -214126,6 +214440,34 @@ export const NotificationCenter = $root.NotificationCenter = (() => { case 13: message.type = 13; break; + case "NT_DEVICE_APPROVAL_APPROVED": + case 14: + message.type = 14; + break; + case "NT_DEVICE_APPROVAL_DENIED": + case 15: + message.type = 15; + break; + case "NT_ACCOUNT_CREATED": + case 16: + message.type = 16; + break; + case "NT_2FA_ENABLED": + case 17: + message.type = 17; + break; + case "NT_2FA_DISABLED": + case 18: + message.type = 18; + break; + case "NT_SECURITY_KEYS_ENABLED": + case 19: + message.type = 19; + break; + case "NT_SECURITY_KEYS_DISABLED": + case 20: + message.type = 20; + break; } switch (object.category) { default: @@ -217257,6 +217599,230 @@ export const NotificationCenter = $root.NotificationCenter = (() => { return NotificationSyncRequest; })(); + NotificationCenter.NotificationsApprovalStatusUpdateRequest = (function() { + + /** + * Properties of a NotificationsApprovalStatusUpdateRequest. + * @memberof NotificationCenter + * @interface INotificationsApprovalStatusUpdateRequest + * @property {Array.|null} [updates] NotificationsApprovalStatusUpdateRequest updates + */ + + /** + * Constructs a new NotificationsApprovalStatusUpdateRequest. + * @memberof NotificationCenter + * @classdesc Represents a NotificationsApprovalStatusUpdateRequest. + * @implements INotificationsApprovalStatusUpdateRequest + * @constructor + * @param {NotificationCenter.INotificationsApprovalStatusUpdateRequest=} [properties] Properties to set + */ + function NotificationsApprovalStatusUpdateRequest(properties) { + this.updates = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NotificationsApprovalStatusUpdateRequest updates. + * @member {Array.} updates + * @memberof NotificationCenter.NotificationsApprovalStatusUpdateRequest + * @instance + */ + NotificationsApprovalStatusUpdateRequest.prototype.updates = $util.emptyArray; + + /** + * Creates a new NotificationsApprovalStatusUpdateRequest instance using the specified properties. + * @function create + * @memberof NotificationCenter.NotificationsApprovalStatusUpdateRequest + * @static + * @param {NotificationCenter.INotificationsApprovalStatusUpdateRequest=} [properties] Properties to set + * @returns {NotificationCenter.NotificationsApprovalStatusUpdateRequest} NotificationsApprovalStatusUpdateRequest instance + */ + NotificationsApprovalStatusUpdateRequest.create = function create(properties) { + return new NotificationsApprovalStatusUpdateRequest(properties); + }; + + /** + * Encodes the specified NotificationsApprovalStatusUpdateRequest message. Does not implicitly {@link NotificationCenter.NotificationsApprovalStatusUpdateRequest.verify|verify} messages. + * @function encode + * @memberof NotificationCenter.NotificationsApprovalStatusUpdateRequest + * @static + * @param {NotificationCenter.INotificationsApprovalStatusUpdateRequest} message NotificationsApprovalStatusUpdateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NotificationsApprovalStatusUpdateRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.updates != null && message.updates.length) + for (let i = 0; i < message.updates.length; ++i) + $root.NotificationCenter.ApprovalStatusUpdate.encode(message.updates[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified NotificationsApprovalStatusUpdateRequest message, length delimited. Does not implicitly {@link NotificationCenter.NotificationsApprovalStatusUpdateRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof NotificationCenter.NotificationsApprovalStatusUpdateRequest + * @static + * @param {NotificationCenter.INotificationsApprovalStatusUpdateRequest} message NotificationsApprovalStatusUpdateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NotificationsApprovalStatusUpdateRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NotificationsApprovalStatusUpdateRequest message from the specified reader or buffer. + * @function decode + * @memberof NotificationCenter.NotificationsApprovalStatusUpdateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {NotificationCenter.NotificationsApprovalStatusUpdateRequest} NotificationsApprovalStatusUpdateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NotificationsApprovalStatusUpdateRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.NotificationCenter.NotificationsApprovalStatusUpdateRequest(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.updates && message.updates.length)) + message.updates = []; + message.updates.push($root.NotificationCenter.ApprovalStatusUpdate.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NotificationsApprovalStatusUpdateRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof NotificationCenter.NotificationsApprovalStatusUpdateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {NotificationCenter.NotificationsApprovalStatusUpdateRequest} NotificationsApprovalStatusUpdateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NotificationsApprovalStatusUpdateRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NotificationsApprovalStatusUpdateRequest message. + * @function verify + * @memberof NotificationCenter.NotificationsApprovalStatusUpdateRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NotificationsApprovalStatusUpdateRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.updates != null && message.hasOwnProperty("updates")) { + if (!Array.isArray(message.updates)) + return "updates: array expected"; + for (let i = 0; i < message.updates.length; ++i) { + let error = $root.NotificationCenter.ApprovalStatusUpdate.verify(message.updates[i]); + if (error) + return "updates." + error; + } + } + return null; + }; + + /** + * Creates a NotificationsApprovalStatusUpdateRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof NotificationCenter.NotificationsApprovalStatusUpdateRequest + * @static + * @param {Object.} object Plain object + * @returns {NotificationCenter.NotificationsApprovalStatusUpdateRequest} NotificationsApprovalStatusUpdateRequest + */ + NotificationsApprovalStatusUpdateRequest.fromObject = function fromObject(object) { + if (object instanceof $root.NotificationCenter.NotificationsApprovalStatusUpdateRequest) + return object; + let message = new $root.NotificationCenter.NotificationsApprovalStatusUpdateRequest(); + if (object.updates) { + if (!Array.isArray(object.updates)) + throw TypeError(".NotificationCenter.NotificationsApprovalStatusUpdateRequest.updates: array expected"); + message.updates = []; + for (let i = 0; i < object.updates.length; ++i) { + if (typeof object.updates[i] !== "object") + throw TypeError(".NotificationCenter.NotificationsApprovalStatusUpdateRequest.updates: object expected"); + message.updates[i] = $root.NotificationCenter.ApprovalStatusUpdate.fromObject(object.updates[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a NotificationsApprovalStatusUpdateRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof NotificationCenter.NotificationsApprovalStatusUpdateRequest + * @static + * @param {NotificationCenter.NotificationsApprovalStatusUpdateRequest} message NotificationsApprovalStatusUpdateRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NotificationsApprovalStatusUpdateRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.updates = []; + if (message.updates && message.updates.length) { + object.updates = []; + for (let j = 0; j < message.updates.length; ++j) + object.updates[j] = $root.NotificationCenter.ApprovalStatusUpdate.toObject(message.updates[j], options); + } + return object; + }; + + /** + * Converts this NotificationsApprovalStatusUpdateRequest to JSON. + * @function toJSON + * @memberof NotificationCenter.NotificationsApprovalStatusUpdateRequest + * @instance + * @returns {Object.} JSON object + */ + NotificationsApprovalStatusUpdateRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NotificationsApprovalStatusUpdateRequest + * @function getTypeUrl + * @memberof NotificationCenter.NotificationsApprovalStatusUpdateRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NotificationsApprovalStatusUpdateRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/NotificationCenter.NotificationsApprovalStatusUpdateRequest"; + }; + + return NotificationsApprovalStatusUpdateRequest; + })(); + return NotificationCenter; })(); @@ -235708,6 +236274,457 @@ export const BI = $root.BI = (() => { return EventsRequest; })(); + BI.EventResponse = (function() { + + /** + * Properties of an EventResponse. + * @memberof BI + * @interface IEventResponse + * @property {number|null} [index] EventResponse index + * @property {boolean|null} [status] EventResponse status + */ + + /** + * Constructs a new EventResponse. + * @memberof BI + * @classdesc Represents an EventResponse. + * @implements IEventResponse + * @constructor + * @param {BI.IEventResponse=} [properties] Properties to set + */ + function EventResponse(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EventResponse index. + * @member {number} index + * @memberof BI.EventResponse + * @instance + */ + EventResponse.prototype.index = 0; + + /** + * EventResponse status. + * @member {boolean} status + * @memberof BI.EventResponse + * @instance + */ + EventResponse.prototype.status = false; + + /** + * Creates a new EventResponse instance using the specified properties. + * @function create + * @memberof BI.EventResponse + * @static + * @param {BI.IEventResponse=} [properties] Properties to set + * @returns {BI.EventResponse} EventResponse instance + */ + EventResponse.create = function create(properties) { + return new EventResponse(properties); + }; + + /** + * Encodes the specified EventResponse message. Does not implicitly {@link BI.EventResponse.verify|verify} messages. + * @function encode + * @memberof BI.EventResponse + * @static + * @param {BI.IEventResponse} message EventResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EventResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.index != null && Object.hasOwnProperty.call(message, "index")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.index); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.status); + return writer; + }; + + /** + * Encodes the specified EventResponse message, length delimited. Does not implicitly {@link BI.EventResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof BI.EventResponse + * @static + * @param {BI.IEventResponse} message EventResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EventResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EventResponse message from the specified reader or buffer. + * @function decode + * @memberof BI.EventResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {BI.EventResponse} EventResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EventResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.BI.EventResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.index = reader.int32(); + break; + } + case 2: { + message.status = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EventResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof BI.EventResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {BI.EventResponse} EventResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EventResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EventResponse message. + * @function verify + * @memberof BI.EventResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EventResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.index != null && message.hasOwnProperty("index")) + if (!$util.isInteger(message.index)) + return "index: integer expected"; + if (message.status != null && message.hasOwnProperty("status")) + if (typeof message.status !== "boolean") + return "status: boolean expected"; + return null; + }; + + /** + * Creates an EventResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof BI.EventResponse + * @static + * @param {Object.} object Plain object + * @returns {BI.EventResponse} EventResponse + */ + EventResponse.fromObject = function fromObject(object) { + if (object instanceof $root.BI.EventResponse) + return object; + let message = new $root.BI.EventResponse(); + if (object.index != null) + message.index = object.index | 0; + if (object.status != null) + message.status = Boolean(object.status); + return message; + }; + + /** + * Creates a plain object from an EventResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof BI.EventResponse + * @static + * @param {BI.EventResponse} message EventResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EventResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.index = 0; + object.status = false; + } + if (message.index != null && message.hasOwnProperty("index")) + object.index = message.index; + if (message.status != null && message.hasOwnProperty("status")) + object.status = message.status; + return object; + }; + + /** + * Converts this EventResponse to JSON. + * @function toJSON + * @memberof BI.EventResponse + * @instance + * @returns {Object.} JSON object + */ + EventResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EventResponse + * @function getTypeUrl + * @memberof BI.EventResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EventResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/BI.EventResponse"; + }; + + return EventResponse; + })(); + + BI.EventsResponse = (function() { + + /** + * Properties of an EventsResponse. + * @memberof BI + * @interface IEventsResponse + * @property {Array.|null} [response] EventsResponse response + */ + + /** + * Constructs a new EventsResponse. + * @memberof BI + * @classdesc Represents an EventsResponse. + * @implements IEventsResponse + * @constructor + * @param {BI.IEventsResponse=} [properties] Properties to set + */ + function EventsResponse(properties) { + this.response = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EventsResponse response. + * @member {Array.} response + * @memberof BI.EventsResponse + * @instance + */ + EventsResponse.prototype.response = $util.emptyArray; + + /** + * Creates a new EventsResponse instance using the specified properties. + * @function create + * @memberof BI.EventsResponse + * @static + * @param {BI.IEventsResponse=} [properties] Properties to set + * @returns {BI.EventsResponse} EventsResponse instance + */ + EventsResponse.create = function create(properties) { + return new EventsResponse(properties); + }; + + /** + * Encodes the specified EventsResponse message. Does not implicitly {@link BI.EventsResponse.verify|verify} messages. + * @function encode + * @memberof BI.EventsResponse + * @static + * @param {BI.IEventsResponse} message EventsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EventsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.response != null && message.response.length) + for (let i = 0; i < message.response.length; ++i) + $root.BI.EventResponse.encode(message.response[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EventsResponse message, length delimited. Does not implicitly {@link BI.EventsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof BI.EventsResponse + * @static + * @param {BI.IEventsResponse} message EventsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EventsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EventsResponse message from the specified reader or buffer. + * @function decode + * @memberof BI.EventsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {BI.EventsResponse} EventsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EventsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.BI.EventsResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.response && message.response.length)) + message.response = []; + message.response.push($root.BI.EventResponse.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EventsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof BI.EventsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {BI.EventsResponse} EventsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EventsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EventsResponse message. + * @function verify + * @memberof BI.EventsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EventsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.response != null && message.hasOwnProperty("response")) { + if (!Array.isArray(message.response)) + return "response: array expected"; + for (let i = 0; i < message.response.length; ++i) { + let error = $root.BI.EventResponse.verify(message.response[i]); + if (error) + return "response." + error; + } + } + return null; + }; + + /** + * Creates an EventsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof BI.EventsResponse + * @static + * @param {Object.} object Plain object + * @returns {BI.EventsResponse} EventsResponse + */ + EventsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.BI.EventsResponse) + return object; + let message = new $root.BI.EventsResponse(); + if (object.response) { + if (!Array.isArray(object.response)) + throw TypeError(".BI.EventsResponse.response: array expected"); + message.response = []; + for (let i = 0; i < object.response.length; ++i) { + if (typeof object.response[i] !== "object") + throw TypeError(".BI.EventsResponse.response: object expected"); + message.response[i] = $root.BI.EventResponse.fromObject(object.response[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an EventsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof BI.EventsResponse + * @static + * @param {BI.EventsResponse} message EventsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EventsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.response = []; + if (message.response && message.response.length) { + object.response = []; + for (let j = 0; j < message.response.length; ++j) + object.response[j] = $root.BI.EventResponse.toObject(message.response[j], options); + } + return object; + }; + + /** + * Converts this EventsResponse to JSON. + * @function toJSON + * @memberof BI.EventsResponse + * @instance + * @returns {Object.} JSON object + */ + EventsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EventsResponse + * @function getTypeUrl + * @memberof BI.EventsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EventsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/BI.EventsResponse"; + }; + + return EventsResponse; + })(); + BI.CustomerCaptureRequest = (function() { /** @@ -236285,6 +237302,7 @@ export const BI = $root.BI = (() => { * @property {number} addPAM=7 addPAM value * @property {number} addSilverSupport=8 addSilverSupport value * @property {number} addPlatinumSupport=9 addPlatinumSupport value + * @property {number} addKEPM=10 addKEPM value */ BI.PurchaseProductType = (function() { const valuesById = {}, values = Object.create(valuesById); @@ -236298,6 +237316,7 @@ export const BI = $root.BI = (() => { values[valuesById[7] = "addPAM"] = 7; values[valuesById[8] = "addSilverSupport"] = 8; values[valuesById[9] = "addPlatinumSupport"] = 9; + values[valuesById[10] = "addKEPM"] = 10; return values; })(); @@ -236598,6 +237617,7 @@ export const BI = $root.BI = (() => { * @property {boolean|null} [includedOtherAddons] QuotePurchase includedOtherAddons * @property {number|null} [taxAmount] QuotePurchase taxAmount * @property {string|null} [taxLabel] QuotePurchase taxLabel + * @property {string|null} [purchaseIdentifier] QuotePurchase purchaseIdentifier */ /** @@ -236655,6 +237675,14 @@ export const BI = $root.BI = (() => { */ QuotePurchase.prototype.taxLabel = ""; + /** + * QuotePurchase purchaseIdentifier. + * @member {string} purchaseIdentifier + * @memberof BI.QuotePurchase + * @instance + */ + QuotePurchase.prototype.purchaseIdentifier = ""; + /** * Creates a new QuotePurchase instance using the specified properties. * @function create @@ -236689,6 +237717,8 @@ export const BI = $root.BI = (() => { writer.uint32(/* id 4, wireType 1 =*/33).double(message.taxAmount); if (message.taxLabel != null && Object.hasOwnProperty.call(message, "taxLabel")) writer.uint32(/* id 5, wireType 2 =*/42).string(message.taxLabel); + if (message.purchaseIdentifier != null && Object.hasOwnProperty.call(message, "purchaseIdentifier")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.purchaseIdentifier); return writer; }; @@ -236743,6 +237773,10 @@ export const BI = $root.BI = (() => { message.taxLabel = reader.string(); break; } + case 6: { + message.purchaseIdentifier = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -236793,6 +237827,9 @@ export const BI = $root.BI = (() => { if (message.taxLabel != null && message.hasOwnProperty("taxLabel")) if (!$util.isString(message.taxLabel)) return "taxLabel: string expected"; + if (message.purchaseIdentifier != null && message.hasOwnProperty("purchaseIdentifier")) + if (!$util.isString(message.purchaseIdentifier)) + return "purchaseIdentifier: string expected"; return null; }; @@ -236818,6 +237855,8 @@ export const BI = $root.BI = (() => { message.taxAmount = Number(object.taxAmount); if (object.taxLabel != null) message.taxLabel = String(object.taxLabel); + if (object.purchaseIdentifier != null) + message.purchaseIdentifier = String(object.purchaseIdentifier); return message; }; @@ -236840,6 +237879,7 @@ export const BI = $root.BI = (() => { object.includedOtherAddons = false; object.taxAmount = 0; object.taxLabel = ""; + object.purchaseIdentifier = ""; } if (message.quoteTotal != null && message.hasOwnProperty("quoteTotal")) object.quoteTotal = options.json && !isFinite(message.quoteTotal) ? String(message.quoteTotal) : message.quoteTotal; @@ -236851,6 +237891,8 @@ export const BI = $root.BI = (() => { object.taxAmount = options.json && !isFinite(message.taxAmount) ? String(message.taxAmount) : message.taxAmount; if (message.taxLabel != null && message.hasOwnProperty("taxLabel")) object.taxLabel = message.taxLabel; + if (message.purchaseIdentifier != null && message.hasOwnProperty("purchaseIdentifier")) + object.purchaseIdentifier = message.purchaseIdentifier; return object; }; @@ -236883,6 +237925,1241 @@ export const BI = $root.BI = (() => { return QuotePurchase; })(); + BI.PurchaseOptions = (function() { + + /** + * Properties of a PurchaseOptions. + * @memberof BI + * @interface IPurchaseOptions + * @property {boolean|null} [inConsole] PurchaseOptions inConsole + * @property {boolean|null} [externalCheckout] PurchaseOptions externalCheckout + */ + + /** + * Constructs a new PurchaseOptions. + * @memberof BI + * @classdesc Represents a PurchaseOptions. + * @implements IPurchaseOptions + * @constructor + * @param {BI.IPurchaseOptions=} [properties] Properties to set + */ + function PurchaseOptions(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PurchaseOptions inConsole. + * @member {boolean|null|undefined} inConsole + * @memberof BI.PurchaseOptions + * @instance + */ + PurchaseOptions.prototype.inConsole = null; + + /** + * PurchaseOptions externalCheckout. + * @member {boolean|null|undefined} externalCheckout + * @memberof BI.PurchaseOptions + * @instance + */ + PurchaseOptions.prototype.externalCheckout = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * PurchaseOptions _inConsole. + * @member {"inConsole"|undefined} _inConsole + * @memberof BI.PurchaseOptions + * @instance + */ + Object.defineProperty(PurchaseOptions.prototype, "_inConsole", { + get: $util.oneOfGetter($oneOfFields = ["inConsole"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * PurchaseOptions _externalCheckout. + * @member {"externalCheckout"|undefined} _externalCheckout + * @memberof BI.PurchaseOptions + * @instance + */ + Object.defineProperty(PurchaseOptions.prototype, "_externalCheckout", { + get: $util.oneOfGetter($oneOfFields = ["externalCheckout"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PurchaseOptions instance using the specified properties. + * @function create + * @memberof BI.PurchaseOptions + * @static + * @param {BI.IPurchaseOptions=} [properties] Properties to set + * @returns {BI.PurchaseOptions} PurchaseOptions instance + */ + PurchaseOptions.create = function create(properties) { + return new PurchaseOptions(properties); + }; + + /** + * Encodes the specified PurchaseOptions message. Does not implicitly {@link BI.PurchaseOptions.verify|verify} messages. + * @function encode + * @memberof BI.PurchaseOptions + * @static + * @param {BI.IPurchaseOptions} message PurchaseOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PurchaseOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.inConsole != null && Object.hasOwnProperty.call(message, "inConsole")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.inConsole); + if (message.externalCheckout != null && Object.hasOwnProperty.call(message, "externalCheckout")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.externalCheckout); + return writer; + }; + + /** + * Encodes the specified PurchaseOptions message, length delimited. Does not implicitly {@link BI.PurchaseOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof BI.PurchaseOptions + * @static + * @param {BI.IPurchaseOptions} message PurchaseOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PurchaseOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PurchaseOptions message from the specified reader or buffer. + * @function decode + * @memberof BI.PurchaseOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {BI.PurchaseOptions} PurchaseOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PurchaseOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.BI.PurchaseOptions(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.inConsole = reader.bool(); + break; + } + case 2: { + message.externalCheckout = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PurchaseOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof BI.PurchaseOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {BI.PurchaseOptions} PurchaseOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PurchaseOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PurchaseOptions message. + * @function verify + * @memberof BI.PurchaseOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PurchaseOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + let properties = {}; + if (message.inConsole != null && message.hasOwnProperty("inConsole")) { + properties._inConsole = 1; + if (typeof message.inConsole !== "boolean") + return "inConsole: boolean expected"; + } + if (message.externalCheckout != null && message.hasOwnProperty("externalCheckout")) { + properties._externalCheckout = 1; + if (typeof message.externalCheckout !== "boolean") + return "externalCheckout: boolean expected"; + } + return null; + }; + + /** + * Creates a PurchaseOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof BI.PurchaseOptions + * @static + * @param {Object.} object Plain object + * @returns {BI.PurchaseOptions} PurchaseOptions + */ + PurchaseOptions.fromObject = function fromObject(object) { + if (object instanceof $root.BI.PurchaseOptions) + return object; + let message = new $root.BI.PurchaseOptions(); + if (object.inConsole != null) + message.inConsole = Boolean(object.inConsole); + if (object.externalCheckout != null) + message.externalCheckout = Boolean(object.externalCheckout); + return message; + }; + + /** + * Creates a plain object from a PurchaseOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof BI.PurchaseOptions + * @static + * @param {BI.PurchaseOptions} message PurchaseOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PurchaseOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (message.inConsole != null && message.hasOwnProperty("inConsole")) { + object.inConsole = message.inConsole; + if (options.oneofs) + object._inConsole = "inConsole"; + } + if (message.externalCheckout != null && message.hasOwnProperty("externalCheckout")) { + object.externalCheckout = message.externalCheckout; + if (options.oneofs) + object._externalCheckout = "externalCheckout"; + } + return object; + }; + + /** + * Converts this PurchaseOptions to JSON. + * @function toJSON + * @memberof BI.PurchaseOptions + * @instance + * @returns {Object.} JSON object + */ + PurchaseOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PurchaseOptions + * @function getTypeUrl + * @memberof BI.PurchaseOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PurchaseOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/BI.PurchaseOptions"; + }; + + return PurchaseOptions; + })(); + + BI.AddonPurchaseOptions = (function() { + + /** + * Properties of an AddonPurchaseOptions. + * @memberof BI + * @interface IAddonPurchaseOptions + * @property {BI.IPurchaseOptions|null} [storage] AddonPurchaseOptions storage + * @property {BI.IPurchaseOptions|null} [audit] AddonPurchaseOptions audit + * @property {BI.IPurchaseOptions|null} [breachwatch] AddonPurchaseOptions breachwatch + * @property {BI.IPurchaseOptions|null} [chat] AddonPurchaseOptions chat + * @property {BI.IPurchaseOptions|null} [compliance] AddonPurchaseOptions compliance + * @property {BI.IPurchaseOptions|null} [professionalServicesSilver] AddonPurchaseOptions professionalServicesSilver + * @property {BI.IPurchaseOptions|null} [professionalServicesPlatinum] AddonPurchaseOptions professionalServicesPlatinum + * @property {BI.IPurchaseOptions|null} [pam] AddonPurchaseOptions pam + * @property {BI.IPurchaseOptions|null} [epm] AddonPurchaseOptions epm + * @property {BI.IPurchaseOptions|null} [secretsManager] AddonPurchaseOptions secretsManager + * @property {BI.IPurchaseOptions|null} [connectionManager] AddonPurchaseOptions connectionManager + * @property {BI.IPurchaseOptions|null} [remoteBrowserIsolation] AddonPurchaseOptions remoteBrowserIsolation + */ + + /** + * Constructs a new AddonPurchaseOptions. + * @memberof BI + * @classdesc Represents an AddonPurchaseOptions. + * @implements IAddonPurchaseOptions + * @constructor + * @param {BI.IAddonPurchaseOptions=} [properties] Properties to set + */ + function AddonPurchaseOptions(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AddonPurchaseOptions storage. + * @member {BI.IPurchaseOptions|null|undefined} storage + * @memberof BI.AddonPurchaseOptions + * @instance + */ + AddonPurchaseOptions.prototype.storage = null; + + /** + * AddonPurchaseOptions audit. + * @member {BI.IPurchaseOptions|null|undefined} audit + * @memberof BI.AddonPurchaseOptions + * @instance + */ + AddonPurchaseOptions.prototype.audit = null; + + /** + * AddonPurchaseOptions breachwatch. + * @member {BI.IPurchaseOptions|null|undefined} breachwatch + * @memberof BI.AddonPurchaseOptions + * @instance + */ + AddonPurchaseOptions.prototype.breachwatch = null; + + /** + * AddonPurchaseOptions chat. + * @member {BI.IPurchaseOptions|null|undefined} chat + * @memberof BI.AddonPurchaseOptions + * @instance + */ + AddonPurchaseOptions.prototype.chat = null; + + /** + * AddonPurchaseOptions compliance. + * @member {BI.IPurchaseOptions|null|undefined} compliance + * @memberof BI.AddonPurchaseOptions + * @instance + */ + AddonPurchaseOptions.prototype.compliance = null; + + /** + * AddonPurchaseOptions professionalServicesSilver. + * @member {BI.IPurchaseOptions|null|undefined} professionalServicesSilver + * @memberof BI.AddonPurchaseOptions + * @instance + */ + AddonPurchaseOptions.prototype.professionalServicesSilver = null; + + /** + * AddonPurchaseOptions professionalServicesPlatinum. + * @member {BI.IPurchaseOptions|null|undefined} professionalServicesPlatinum + * @memberof BI.AddonPurchaseOptions + * @instance + */ + AddonPurchaseOptions.prototype.professionalServicesPlatinum = null; + + /** + * AddonPurchaseOptions pam. + * @member {BI.IPurchaseOptions|null|undefined} pam + * @memberof BI.AddonPurchaseOptions + * @instance + */ + AddonPurchaseOptions.prototype.pam = null; + + /** + * AddonPurchaseOptions epm. + * @member {BI.IPurchaseOptions|null|undefined} epm + * @memberof BI.AddonPurchaseOptions + * @instance + */ + AddonPurchaseOptions.prototype.epm = null; + + /** + * AddonPurchaseOptions secretsManager. + * @member {BI.IPurchaseOptions|null|undefined} secretsManager + * @memberof BI.AddonPurchaseOptions + * @instance + */ + AddonPurchaseOptions.prototype.secretsManager = null; + + /** + * AddonPurchaseOptions connectionManager. + * @member {BI.IPurchaseOptions|null|undefined} connectionManager + * @memberof BI.AddonPurchaseOptions + * @instance + */ + AddonPurchaseOptions.prototype.connectionManager = null; + + /** + * AddonPurchaseOptions remoteBrowserIsolation. + * @member {BI.IPurchaseOptions|null|undefined} remoteBrowserIsolation + * @memberof BI.AddonPurchaseOptions + * @instance + */ + AddonPurchaseOptions.prototype.remoteBrowserIsolation = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * AddonPurchaseOptions _storage. + * @member {"storage"|undefined} _storage + * @memberof BI.AddonPurchaseOptions + * @instance + */ + Object.defineProperty(AddonPurchaseOptions.prototype, "_storage", { + get: $util.oneOfGetter($oneOfFields = ["storage"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AddonPurchaseOptions _audit. + * @member {"audit"|undefined} _audit + * @memberof BI.AddonPurchaseOptions + * @instance + */ + Object.defineProperty(AddonPurchaseOptions.prototype, "_audit", { + get: $util.oneOfGetter($oneOfFields = ["audit"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AddonPurchaseOptions _breachwatch. + * @member {"breachwatch"|undefined} _breachwatch + * @memberof BI.AddonPurchaseOptions + * @instance + */ + Object.defineProperty(AddonPurchaseOptions.prototype, "_breachwatch", { + get: $util.oneOfGetter($oneOfFields = ["breachwatch"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AddonPurchaseOptions _chat. + * @member {"chat"|undefined} _chat + * @memberof BI.AddonPurchaseOptions + * @instance + */ + Object.defineProperty(AddonPurchaseOptions.prototype, "_chat", { + get: $util.oneOfGetter($oneOfFields = ["chat"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AddonPurchaseOptions _compliance. + * @member {"compliance"|undefined} _compliance + * @memberof BI.AddonPurchaseOptions + * @instance + */ + Object.defineProperty(AddonPurchaseOptions.prototype, "_compliance", { + get: $util.oneOfGetter($oneOfFields = ["compliance"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AddonPurchaseOptions _professionalServicesSilver. + * @member {"professionalServicesSilver"|undefined} _professionalServicesSilver + * @memberof BI.AddonPurchaseOptions + * @instance + */ + Object.defineProperty(AddonPurchaseOptions.prototype, "_professionalServicesSilver", { + get: $util.oneOfGetter($oneOfFields = ["professionalServicesSilver"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AddonPurchaseOptions _professionalServicesPlatinum. + * @member {"professionalServicesPlatinum"|undefined} _professionalServicesPlatinum + * @memberof BI.AddonPurchaseOptions + * @instance + */ + Object.defineProperty(AddonPurchaseOptions.prototype, "_professionalServicesPlatinum", { + get: $util.oneOfGetter($oneOfFields = ["professionalServicesPlatinum"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AddonPurchaseOptions _pam. + * @member {"pam"|undefined} _pam + * @memberof BI.AddonPurchaseOptions + * @instance + */ + Object.defineProperty(AddonPurchaseOptions.prototype, "_pam", { + get: $util.oneOfGetter($oneOfFields = ["pam"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AddonPurchaseOptions _epm. + * @member {"epm"|undefined} _epm + * @memberof BI.AddonPurchaseOptions + * @instance + */ + Object.defineProperty(AddonPurchaseOptions.prototype, "_epm", { + get: $util.oneOfGetter($oneOfFields = ["epm"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AddonPurchaseOptions _secretsManager. + * @member {"secretsManager"|undefined} _secretsManager + * @memberof BI.AddonPurchaseOptions + * @instance + */ + Object.defineProperty(AddonPurchaseOptions.prototype, "_secretsManager", { + get: $util.oneOfGetter($oneOfFields = ["secretsManager"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AddonPurchaseOptions _connectionManager. + * @member {"connectionManager"|undefined} _connectionManager + * @memberof BI.AddonPurchaseOptions + * @instance + */ + Object.defineProperty(AddonPurchaseOptions.prototype, "_connectionManager", { + get: $util.oneOfGetter($oneOfFields = ["connectionManager"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AddonPurchaseOptions _remoteBrowserIsolation. + * @member {"remoteBrowserIsolation"|undefined} _remoteBrowserIsolation + * @memberof BI.AddonPurchaseOptions + * @instance + */ + Object.defineProperty(AddonPurchaseOptions.prototype, "_remoteBrowserIsolation", { + get: $util.oneOfGetter($oneOfFields = ["remoteBrowserIsolation"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AddonPurchaseOptions instance using the specified properties. + * @function create + * @memberof BI.AddonPurchaseOptions + * @static + * @param {BI.IAddonPurchaseOptions=} [properties] Properties to set + * @returns {BI.AddonPurchaseOptions} AddonPurchaseOptions instance + */ + AddonPurchaseOptions.create = function create(properties) { + return new AddonPurchaseOptions(properties); + }; + + /** + * Encodes the specified AddonPurchaseOptions message. Does not implicitly {@link BI.AddonPurchaseOptions.verify|verify} messages. + * @function encode + * @memberof BI.AddonPurchaseOptions + * @static + * @param {BI.IAddonPurchaseOptions} message AddonPurchaseOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AddonPurchaseOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.storage != null && Object.hasOwnProperty.call(message, "storage")) + $root.BI.PurchaseOptions.encode(message.storage, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.audit != null && Object.hasOwnProperty.call(message, "audit")) + $root.BI.PurchaseOptions.encode(message.audit, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.breachwatch != null && Object.hasOwnProperty.call(message, "breachwatch")) + $root.BI.PurchaseOptions.encode(message.breachwatch, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.chat != null && Object.hasOwnProperty.call(message, "chat")) + $root.BI.PurchaseOptions.encode(message.chat, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.compliance != null && Object.hasOwnProperty.call(message, "compliance")) + $root.BI.PurchaseOptions.encode(message.compliance, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.professionalServicesSilver != null && Object.hasOwnProperty.call(message, "professionalServicesSilver")) + $root.BI.PurchaseOptions.encode(message.professionalServicesSilver, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.professionalServicesPlatinum != null && Object.hasOwnProperty.call(message, "professionalServicesPlatinum")) + $root.BI.PurchaseOptions.encode(message.professionalServicesPlatinum, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.pam != null && Object.hasOwnProperty.call(message, "pam")) + $root.BI.PurchaseOptions.encode(message.pam, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.epm != null && Object.hasOwnProperty.call(message, "epm")) + $root.BI.PurchaseOptions.encode(message.epm, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.secretsManager != null && Object.hasOwnProperty.call(message, "secretsManager")) + $root.BI.PurchaseOptions.encode(message.secretsManager, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.connectionManager != null && Object.hasOwnProperty.call(message, "connectionManager")) + $root.BI.PurchaseOptions.encode(message.connectionManager, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.remoteBrowserIsolation != null && Object.hasOwnProperty.call(message, "remoteBrowserIsolation")) + $root.BI.PurchaseOptions.encode(message.remoteBrowserIsolation, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AddonPurchaseOptions message, length delimited. Does not implicitly {@link BI.AddonPurchaseOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof BI.AddonPurchaseOptions + * @static + * @param {BI.IAddonPurchaseOptions} message AddonPurchaseOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AddonPurchaseOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AddonPurchaseOptions message from the specified reader or buffer. + * @function decode + * @memberof BI.AddonPurchaseOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {BI.AddonPurchaseOptions} AddonPurchaseOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AddonPurchaseOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.BI.AddonPurchaseOptions(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.storage = $root.BI.PurchaseOptions.decode(reader, reader.uint32()); + break; + } + case 2: { + message.audit = $root.BI.PurchaseOptions.decode(reader, reader.uint32()); + break; + } + case 3: { + message.breachwatch = $root.BI.PurchaseOptions.decode(reader, reader.uint32()); + break; + } + case 4: { + message.chat = $root.BI.PurchaseOptions.decode(reader, reader.uint32()); + break; + } + case 5: { + message.compliance = $root.BI.PurchaseOptions.decode(reader, reader.uint32()); + break; + } + case 6: { + message.professionalServicesSilver = $root.BI.PurchaseOptions.decode(reader, reader.uint32()); + break; + } + case 7: { + message.professionalServicesPlatinum = $root.BI.PurchaseOptions.decode(reader, reader.uint32()); + break; + } + case 8: { + message.pam = $root.BI.PurchaseOptions.decode(reader, reader.uint32()); + break; + } + case 9: { + message.epm = $root.BI.PurchaseOptions.decode(reader, reader.uint32()); + break; + } + case 10: { + message.secretsManager = $root.BI.PurchaseOptions.decode(reader, reader.uint32()); + break; + } + case 11: { + message.connectionManager = $root.BI.PurchaseOptions.decode(reader, reader.uint32()); + break; + } + case 12: { + message.remoteBrowserIsolation = $root.BI.PurchaseOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AddonPurchaseOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof BI.AddonPurchaseOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {BI.AddonPurchaseOptions} AddonPurchaseOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AddonPurchaseOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AddonPurchaseOptions message. + * @function verify + * @memberof BI.AddonPurchaseOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AddonPurchaseOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + let properties = {}; + if (message.storage != null && message.hasOwnProperty("storage")) { + properties._storage = 1; + { + let error = $root.BI.PurchaseOptions.verify(message.storage); + if (error) + return "storage." + error; + } + } + if (message.audit != null && message.hasOwnProperty("audit")) { + properties._audit = 1; + { + let error = $root.BI.PurchaseOptions.verify(message.audit); + if (error) + return "audit." + error; + } + } + if (message.breachwatch != null && message.hasOwnProperty("breachwatch")) { + properties._breachwatch = 1; + { + let error = $root.BI.PurchaseOptions.verify(message.breachwatch); + if (error) + return "breachwatch." + error; + } + } + if (message.chat != null && message.hasOwnProperty("chat")) { + properties._chat = 1; + { + let error = $root.BI.PurchaseOptions.verify(message.chat); + if (error) + return "chat." + error; + } + } + if (message.compliance != null && message.hasOwnProperty("compliance")) { + properties._compliance = 1; + { + let error = $root.BI.PurchaseOptions.verify(message.compliance); + if (error) + return "compliance." + error; + } + } + if (message.professionalServicesSilver != null && message.hasOwnProperty("professionalServicesSilver")) { + properties._professionalServicesSilver = 1; + { + let error = $root.BI.PurchaseOptions.verify(message.professionalServicesSilver); + if (error) + return "professionalServicesSilver." + error; + } + } + if (message.professionalServicesPlatinum != null && message.hasOwnProperty("professionalServicesPlatinum")) { + properties._professionalServicesPlatinum = 1; + { + let error = $root.BI.PurchaseOptions.verify(message.professionalServicesPlatinum); + if (error) + return "professionalServicesPlatinum." + error; + } + } + if (message.pam != null && message.hasOwnProperty("pam")) { + properties._pam = 1; + { + let error = $root.BI.PurchaseOptions.verify(message.pam); + if (error) + return "pam." + error; + } + } + if (message.epm != null && message.hasOwnProperty("epm")) { + properties._epm = 1; + { + let error = $root.BI.PurchaseOptions.verify(message.epm); + if (error) + return "epm." + error; + } + } + if (message.secretsManager != null && message.hasOwnProperty("secretsManager")) { + properties._secretsManager = 1; + { + let error = $root.BI.PurchaseOptions.verify(message.secretsManager); + if (error) + return "secretsManager." + error; + } + } + if (message.connectionManager != null && message.hasOwnProperty("connectionManager")) { + properties._connectionManager = 1; + { + let error = $root.BI.PurchaseOptions.verify(message.connectionManager); + if (error) + return "connectionManager." + error; + } + } + if (message.remoteBrowserIsolation != null && message.hasOwnProperty("remoteBrowserIsolation")) { + properties._remoteBrowserIsolation = 1; + { + let error = $root.BI.PurchaseOptions.verify(message.remoteBrowserIsolation); + if (error) + return "remoteBrowserIsolation." + error; + } + } + return null; + }; + + /** + * Creates an AddonPurchaseOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof BI.AddonPurchaseOptions + * @static + * @param {Object.} object Plain object + * @returns {BI.AddonPurchaseOptions} AddonPurchaseOptions + */ + AddonPurchaseOptions.fromObject = function fromObject(object) { + if (object instanceof $root.BI.AddonPurchaseOptions) + return object; + let message = new $root.BI.AddonPurchaseOptions(); + if (object.storage != null) { + if (typeof object.storage !== "object") + throw TypeError(".BI.AddonPurchaseOptions.storage: object expected"); + message.storage = $root.BI.PurchaseOptions.fromObject(object.storage); + } + if (object.audit != null) { + if (typeof object.audit !== "object") + throw TypeError(".BI.AddonPurchaseOptions.audit: object expected"); + message.audit = $root.BI.PurchaseOptions.fromObject(object.audit); + } + if (object.breachwatch != null) { + if (typeof object.breachwatch !== "object") + throw TypeError(".BI.AddonPurchaseOptions.breachwatch: object expected"); + message.breachwatch = $root.BI.PurchaseOptions.fromObject(object.breachwatch); + } + if (object.chat != null) { + if (typeof object.chat !== "object") + throw TypeError(".BI.AddonPurchaseOptions.chat: object expected"); + message.chat = $root.BI.PurchaseOptions.fromObject(object.chat); + } + if (object.compliance != null) { + if (typeof object.compliance !== "object") + throw TypeError(".BI.AddonPurchaseOptions.compliance: object expected"); + message.compliance = $root.BI.PurchaseOptions.fromObject(object.compliance); + } + if (object.professionalServicesSilver != null) { + if (typeof object.professionalServicesSilver !== "object") + throw TypeError(".BI.AddonPurchaseOptions.professionalServicesSilver: object expected"); + message.professionalServicesSilver = $root.BI.PurchaseOptions.fromObject(object.professionalServicesSilver); + } + if (object.professionalServicesPlatinum != null) { + if (typeof object.professionalServicesPlatinum !== "object") + throw TypeError(".BI.AddonPurchaseOptions.professionalServicesPlatinum: object expected"); + message.professionalServicesPlatinum = $root.BI.PurchaseOptions.fromObject(object.professionalServicesPlatinum); + } + if (object.pam != null) { + if (typeof object.pam !== "object") + throw TypeError(".BI.AddonPurchaseOptions.pam: object expected"); + message.pam = $root.BI.PurchaseOptions.fromObject(object.pam); + } + if (object.epm != null) { + if (typeof object.epm !== "object") + throw TypeError(".BI.AddonPurchaseOptions.epm: object expected"); + message.epm = $root.BI.PurchaseOptions.fromObject(object.epm); + } + if (object.secretsManager != null) { + if (typeof object.secretsManager !== "object") + throw TypeError(".BI.AddonPurchaseOptions.secretsManager: object expected"); + message.secretsManager = $root.BI.PurchaseOptions.fromObject(object.secretsManager); + } + if (object.connectionManager != null) { + if (typeof object.connectionManager !== "object") + throw TypeError(".BI.AddonPurchaseOptions.connectionManager: object expected"); + message.connectionManager = $root.BI.PurchaseOptions.fromObject(object.connectionManager); + } + if (object.remoteBrowserIsolation != null) { + if (typeof object.remoteBrowserIsolation !== "object") + throw TypeError(".BI.AddonPurchaseOptions.remoteBrowserIsolation: object expected"); + message.remoteBrowserIsolation = $root.BI.PurchaseOptions.fromObject(object.remoteBrowserIsolation); + } + return message; + }; + + /** + * Creates a plain object from an AddonPurchaseOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof BI.AddonPurchaseOptions + * @static + * @param {BI.AddonPurchaseOptions} message AddonPurchaseOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AddonPurchaseOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (message.storage != null && message.hasOwnProperty("storage")) { + object.storage = $root.BI.PurchaseOptions.toObject(message.storage, options); + if (options.oneofs) + object._storage = "storage"; + } + if (message.audit != null && message.hasOwnProperty("audit")) { + object.audit = $root.BI.PurchaseOptions.toObject(message.audit, options); + if (options.oneofs) + object._audit = "audit"; + } + if (message.breachwatch != null && message.hasOwnProperty("breachwatch")) { + object.breachwatch = $root.BI.PurchaseOptions.toObject(message.breachwatch, options); + if (options.oneofs) + object._breachwatch = "breachwatch"; + } + if (message.chat != null && message.hasOwnProperty("chat")) { + object.chat = $root.BI.PurchaseOptions.toObject(message.chat, options); + if (options.oneofs) + object._chat = "chat"; + } + if (message.compliance != null && message.hasOwnProperty("compliance")) { + object.compliance = $root.BI.PurchaseOptions.toObject(message.compliance, options); + if (options.oneofs) + object._compliance = "compliance"; + } + if (message.professionalServicesSilver != null && message.hasOwnProperty("professionalServicesSilver")) { + object.professionalServicesSilver = $root.BI.PurchaseOptions.toObject(message.professionalServicesSilver, options); + if (options.oneofs) + object._professionalServicesSilver = "professionalServicesSilver"; + } + if (message.professionalServicesPlatinum != null && message.hasOwnProperty("professionalServicesPlatinum")) { + object.professionalServicesPlatinum = $root.BI.PurchaseOptions.toObject(message.professionalServicesPlatinum, options); + if (options.oneofs) + object._professionalServicesPlatinum = "professionalServicesPlatinum"; + } + if (message.pam != null && message.hasOwnProperty("pam")) { + object.pam = $root.BI.PurchaseOptions.toObject(message.pam, options); + if (options.oneofs) + object._pam = "pam"; + } + if (message.epm != null && message.hasOwnProperty("epm")) { + object.epm = $root.BI.PurchaseOptions.toObject(message.epm, options); + if (options.oneofs) + object._epm = "epm"; + } + if (message.secretsManager != null && message.hasOwnProperty("secretsManager")) { + object.secretsManager = $root.BI.PurchaseOptions.toObject(message.secretsManager, options); + if (options.oneofs) + object._secretsManager = "secretsManager"; + } + if (message.connectionManager != null && message.hasOwnProperty("connectionManager")) { + object.connectionManager = $root.BI.PurchaseOptions.toObject(message.connectionManager, options); + if (options.oneofs) + object._connectionManager = "connectionManager"; + } + if (message.remoteBrowserIsolation != null && message.hasOwnProperty("remoteBrowserIsolation")) { + object.remoteBrowserIsolation = $root.BI.PurchaseOptions.toObject(message.remoteBrowserIsolation, options); + if (options.oneofs) + object._remoteBrowserIsolation = "remoteBrowserIsolation"; + } + return object; + }; + + /** + * Converts this AddonPurchaseOptions to JSON. + * @function toJSON + * @memberof BI.AddonPurchaseOptions + * @instance + * @returns {Object.} JSON object + */ + AddonPurchaseOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AddonPurchaseOptions + * @function getTypeUrl + * @memberof BI.AddonPurchaseOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AddonPurchaseOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/BI.AddonPurchaseOptions"; + }; + + return AddonPurchaseOptions; + })(); + + BI.AvailablePurchaseOptions = (function() { + + /** + * Properties of an AvailablePurchaseOptions. + * @memberof BI + * @interface IAvailablePurchaseOptions + * @property {BI.IPurchaseOptions|null} [basePlan] AvailablePurchaseOptions basePlan + * @property {BI.IPurchaseOptions|null} [users] AvailablePurchaseOptions users + * @property {BI.IAddonPurchaseOptions|null} [addons] AvailablePurchaseOptions addons + */ + + /** + * Constructs a new AvailablePurchaseOptions. + * @memberof BI + * @classdesc Represents an AvailablePurchaseOptions. + * @implements IAvailablePurchaseOptions + * @constructor + * @param {BI.IAvailablePurchaseOptions=} [properties] Properties to set + */ + function AvailablePurchaseOptions(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AvailablePurchaseOptions basePlan. + * @member {BI.IPurchaseOptions|null|undefined} basePlan + * @memberof BI.AvailablePurchaseOptions + * @instance + */ + AvailablePurchaseOptions.prototype.basePlan = null; + + /** + * AvailablePurchaseOptions users. + * @member {BI.IPurchaseOptions|null|undefined} users + * @memberof BI.AvailablePurchaseOptions + * @instance + */ + AvailablePurchaseOptions.prototype.users = null; + + /** + * AvailablePurchaseOptions addons. + * @member {BI.IAddonPurchaseOptions|null|undefined} addons + * @memberof BI.AvailablePurchaseOptions + * @instance + */ + AvailablePurchaseOptions.prototype.addons = null; + + /** + * Creates a new AvailablePurchaseOptions instance using the specified properties. + * @function create + * @memberof BI.AvailablePurchaseOptions + * @static + * @param {BI.IAvailablePurchaseOptions=} [properties] Properties to set + * @returns {BI.AvailablePurchaseOptions} AvailablePurchaseOptions instance + */ + AvailablePurchaseOptions.create = function create(properties) { + return new AvailablePurchaseOptions(properties); + }; + + /** + * Encodes the specified AvailablePurchaseOptions message. Does not implicitly {@link BI.AvailablePurchaseOptions.verify|verify} messages. + * @function encode + * @memberof BI.AvailablePurchaseOptions + * @static + * @param {BI.IAvailablePurchaseOptions} message AvailablePurchaseOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AvailablePurchaseOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.basePlan != null && Object.hasOwnProperty.call(message, "basePlan")) + $root.BI.PurchaseOptions.encode(message.basePlan, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.users != null && Object.hasOwnProperty.call(message, "users")) + $root.BI.PurchaseOptions.encode(message.users, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.addons != null && Object.hasOwnProperty.call(message, "addons")) + $root.BI.AddonPurchaseOptions.encode(message.addons, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AvailablePurchaseOptions message, length delimited. Does not implicitly {@link BI.AvailablePurchaseOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof BI.AvailablePurchaseOptions + * @static + * @param {BI.IAvailablePurchaseOptions} message AvailablePurchaseOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AvailablePurchaseOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AvailablePurchaseOptions message from the specified reader or buffer. + * @function decode + * @memberof BI.AvailablePurchaseOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {BI.AvailablePurchaseOptions} AvailablePurchaseOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AvailablePurchaseOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.BI.AvailablePurchaseOptions(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.basePlan = $root.BI.PurchaseOptions.decode(reader, reader.uint32()); + break; + } + case 2: { + message.users = $root.BI.PurchaseOptions.decode(reader, reader.uint32()); + break; + } + case 3: { + message.addons = $root.BI.AddonPurchaseOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AvailablePurchaseOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof BI.AvailablePurchaseOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {BI.AvailablePurchaseOptions} AvailablePurchaseOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AvailablePurchaseOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AvailablePurchaseOptions message. + * @function verify + * @memberof BI.AvailablePurchaseOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AvailablePurchaseOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.basePlan != null && message.hasOwnProperty("basePlan")) { + let error = $root.BI.PurchaseOptions.verify(message.basePlan); + if (error) + return "basePlan." + error; + } + if (message.users != null && message.hasOwnProperty("users")) { + let error = $root.BI.PurchaseOptions.verify(message.users); + if (error) + return "users." + error; + } + if (message.addons != null && message.hasOwnProperty("addons")) { + let error = $root.BI.AddonPurchaseOptions.verify(message.addons); + if (error) + return "addons." + error; + } + return null; + }; + + /** + * Creates an AvailablePurchaseOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof BI.AvailablePurchaseOptions + * @static + * @param {Object.} object Plain object + * @returns {BI.AvailablePurchaseOptions} AvailablePurchaseOptions + */ + AvailablePurchaseOptions.fromObject = function fromObject(object) { + if (object instanceof $root.BI.AvailablePurchaseOptions) + return object; + let message = new $root.BI.AvailablePurchaseOptions(); + if (object.basePlan != null) { + if (typeof object.basePlan !== "object") + throw TypeError(".BI.AvailablePurchaseOptions.basePlan: object expected"); + message.basePlan = $root.BI.PurchaseOptions.fromObject(object.basePlan); + } + if (object.users != null) { + if (typeof object.users !== "object") + throw TypeError(".BI.AvailablePurchaseOptions.users: object expected"); + message.users = $root.BI.PurchaseOptions.fromObject(object.users); + } + if (object.addons != null) { + if (typeof object.addons !== "object") + throw TypeError(".BI.AvailablePurchaseOptions.addons: object expected"); + message.addons = $root.BI.AddonPurchaseOptions.fromObject(object.addons); + } + return message; + }; + + /** + * Creates a plain object from an AvailablePurchaseOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof BI.AvailablePurchaseOptions + * @static + * @param {BI.AvailablePurchaseOptions} message AvailablePurchaseOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AvailablePurchaseOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.basePlan = null; + object.users = null; + object.addons = null; + } + if (message.basePlan != null && message.hasOwnProperty("basePlan")) + object.basePlan = $root.BI.PurchaseOptions.toObject(message.basePlan, options); + if (message.users != null && message.hasOwnProperty("users")) + object.users = $root.BI.PurchaseOptions.toObject(message.users, options); + if (message.addons != null && message.hasOwnProperty("addons")) + object.addons = $root.BI.AddonPurchaseOptions.toObject(message.addons, options); + return object; + }; + + /** + * Converts this AvailablePurchaseOptions to JSON. + * @function toJSON + * @memberof BI.AvailablePurchaseOptions + * @instance + * @returns {Object.} JSON object + */ + AvailablePurchaseOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AvailablePurchaseOptions + * @function getTypeUrl + * @memberof BI.AvailablePurchaseOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AvailablePurchaseOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/BI.AvailablePurchaseOptions"; + }; + + return AvailablePurchaseOptions; + })(); + BI.UpgradeLicenseStatusRequest = (function() { /** @@ -237065,7 +239342,7 @@ export const BI = $root.BI = (() => { * @memberof BI * @interface IUpgradeLicenseStatusResponse * @property {boolean|null} [allowPurchaseFromConsole] UpgradeLicenseStatusResponse allowPurchaseFromConsole - * @property {string|null} [checkoutLink] UpgradeLicenseStatusResponse checkoutLink + * @property {BI.IAvailablePurchaseOptions|null} [purchaseOptions] UpgradeLicenseStatusResponse purchaseOptions * @property {BI.IError|null} [error] UpgradeLicenseStatusResponse error */ @@ -237093,12 +239370,12 @@ export const BI = $root.BI = (() => { UpgradeLicenseStatusResponse.prototype.allowPurchaseFromConsole = false; /** - * UpgradeLicenseStatusResponse checkoutLink. - * @member {string} checkoutLink + * UpgradeLicenseStatusResponse purchaseOptions. + * @member {BI.IAvailablePurchaseOptions|null|undefined} purchaseOptions * @memberof BI.UpgradeLicenseStatusResponse * @instance */ - UpgradeLicenseStatusResponse.prototype.checkoutLink = ""; + UpgradeLicenseStatusResponse.prototype.purchaseOptions = null; /** * UpgradeLicenseStatusResponse error. @@ -237134,8 +239411,8 @@ export const BI = $root.BI = (() => { writer = $Writer.create(); if (message.allowPurchaseFromConsole != null && Object.hasOwnProperty.call(message, "allowPurchaseFromConsole")) writer.uint32(/* id 1, wireType 0 =*/8).bool(message.allowPurchaseFromConsole); - if (message.checkoutLink != null && Object.hasOwnProperty.call(message, "checkoutLink")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.checkoutLink); + if (message.purchaseOptions != null && Object.hasOwnProperty.call(message, "purchaseOptions")) + $root.BI.AvailablePurchaseOptions.encode(message.purchaseOptions, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); if (message.error != null && Object.hasOwnProperty.call(message, "error")) $root.BI.Error.encode(message.error, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; @@ -237177,7 +239454,7 @@ export const BI = $root.BI = (() => { break; } case 2: { - message.checkoutLink = reader.string(); + message.purchaseOptions = $root.BI.AvailablePurchaseOptions.decode(reader, reader.uint32()); break; } case 3: { @@ -237222,9 +239499,11 @@ export const BI = $root.BI = (() => { if (message.allowPurchaseFromConsole != null && message.hasOwnProperty("allowPurchaseFromConsole")) if (typeof message.allowPurchaseFromConsole !== "boolean") return "allowPurchaseFromConsole: boolean expected"; - if (message.checkoutLink != null && message.hasOwnProperty("checkoutLink")) - if (!$util.isString(message.checkoutLink)) - return "checkoutLink: string expected"; + if (message.purchaseOptions != null && message.hasOwnProperty("purchaseOptions")) { + let error = $root.BI.AvailablePurchaseOptions.verify(message.purchaseOptions); + if (error) + return "purchaseOptions." + error; + } if (message.error != null && message.hasOwnProperty("error")) { let error = $root.BI.Error.verify(message.error); if (error) @@ -237247,8 +239526,11 @@ export const BI = $root.BI = (() => { let message = new $root.BI.UpgradeLicenseStatusResponse(); if (object.allowPurchaseFromConsole != null) message.allowPurchaseFromConsole = Boolean(object.allowPurchaseFromConsole); - if (object.checkoutLink != null) - message.checkoutLink = String(object.checkoutLink); + if (object.purchaseOptions != null) { + if (typeof object.purchaseOptions !== "object") + throw TypeError(".BI.UpgradeLicenseStatusResponse.purchaseOptions: object expected"); + message.purchaseOptions = $root.BI.AvailablePurchaseOptions.fromObject(object.purchaseOptions); + } if (object.error != null) { if (typeof object.error !== "object") throw TypeError(".BI.UpgradeLicenseStatusResponse.error: object expected"); @@ -237272,13 +239554,13 @@ export const BI = $root.BI = (() => { let object = {}; if (options.defaults) { object.allowPurchaseFromConsole = false; - object.checkoutLink = ""; + object.purchaseOptions = null; object.error = null; } if (message.allowPurchaseFromConsole != null && message.hasOwnProperty("allowPurchaseFromConsole")) object.allowPurchaseFromConsole = message.allowPurchaseFromConsole; - if (message.checkoutLink != null && message.hasOwnProperty("checkoutLink")) - object.checkoutLink = message.checkoutLink; + if (message.purchaseOptions != null && message.hasOwnProperty("purchaseOptions")) + object.purchaseOptions = $root.BI.AvailablePurchaseOptions.toObject(message.purchaseOptions, options); if (message.error != null && message.hasOwnProperty("error")) object.error = $root.BI.Error.toObject(message.error, options); return object; @@ -237321,6 +239603,7 @@ export const BI = $root.BI = (() => { * @interface IUpgradeLicenseQuotePurchaseRequest * @property {BI.PurchaseProductType|null} [productType] UpgradeLicenseQuotePurchaseRequest productType * @property {number|null} [quantity] UpgradeLicenseQuotePurchaseRequest quantity + * @property {number|null} [tier] UpgradeLicenseQuotePurchaseRequest tier */ /** @@ -237354,6 +239637,14 @@ export const BI = $root.BI = (() => { */ UpgradeLicenseQuotePurchaseRequest.prototype.quantity = 0; + /** + * UpgradeLicenseQuotePurchaseRequest tier. + * @member {number} tier + * @memberof BI.UpgradeLicenseQuotePurchaseRequest + * @instance + */ + UpgradeLicenseQuotePurchaseRequest.prototype.tier = 0; + /** * Creates a new UpgradeLicenseQuotePurchaseRequest instance using the specified properties. * @function create @@ -237382,6 +239673,8 @@ export const BI = $root.BI = (() => { writer.uint32(/* id 1, wireType 0 =*/8).int32(message.productType); if (message.quantity != null && Object.hasOwnProperty.call(message, "quantity")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.quantity); + if (message.tier != null && Object.hasOwnProperty.call(message, "tier")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.tier); return writer; }; @@ -237424,6 +239717,10 @@ export const BI = $root.BI = (() => { message.quantity = reader.int32(); break; } + case 3: { + message.tier = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -237473,11 +239770,15 @@ export const BI = $root.BI = (() => { case 7: case 8: case 9: + case 10: break; } if (message.quantity != null && message.hasOwnProperty("quantity")) if (!$util.isInteger(message.quantity)) return "quantity: integer expected"; + if (message.tier != null && message.hasOwnProperty("tier")) + if (!$util.isInteger(message.tier)) + return "tier: integer expected"; return null; }; @@ -237540,9 +239841,15 @@ export const BI = $root.BI = (() => { case 9: message.productType = 9; break; + case "addKEPM": + case 10: + message.productType = 10; + break; } if (object.quantity != null) message.quantity = object.quantity | 0; + if (object.tier != null) + message.tier = object.tier | 0; return message; }; @@ -237562,11 +239869,14 @@ export const BI = $root.BI = (() => { if (options.defaults) { object.productType = options.enums === String ? "upgradeToEnterprise" : 0; object.quantity = 0; + object.tier = 0; } if (message.productType != null && message.hasOwnProperty("productType")) object.productType = options.enums === String ? $root.BI.PurchaseProductType[message.productType] === undefined ? message.productType : $root.BI.PurchaseProductType[message.productType] : message.productType; if (message.quantity != null && message.hasOwnProperty("quantity")) object.quantity = message.quantity; + if (message.tier != null && message.hasOwnProperty("tier")) + object.tier = message.tier; return object; }; @@ -237891,6 +240201,7 @@ export const BI = $root.BI = (() => { * @property {BI.PurchaseProductType|null} [productType] UpgradeLicenseCompletePurchaseRequest productType * @property {number|null} [quantity] UpgradeLicenseCompletePurchaseRequest quantity * @property {BI.IQuotePurchase|null} [quotePurchase] UpgradeLicenseCompletePurchaseRequest quotePurchase + * @property {number|null} [tier] UpgradeLicenseCompletePurchaseRequest tier */ /** @@ -237932,6 +240243,14 @@ export const BI = $root.BI = (() => { */ UpgradeLicenseCompletePurchaseRequest.prototype.quotePurchase = null; + /** + * UpgradeLicenseCompletePurchaseRequest tier. + * @member {number} tier + * @memberof BI.UpgradeLicenseCompletePurchaseRequest + * @instance + */ + UpgradeLicenseCompletePurchaseRequest.prototype.tier = 0; + /** * Creates a new UpgradeLicenseCompletePurchaseRequest instance using the specified properties. * @function create @@ -237962,6 +240281,8 @@ export const BI = $root.BI = (() => { writer.uint32(/* id 2, wireType 0 =*/16).int32(message.quantity); if (message.quotePurchase != null && Object.hasOwnProperty.call(message, "quotePurchase")) $root.BI.QuotePurchase.encode(message.quotePurchase, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.tier != null && Object.hasOwnProperty.call(message, "tier")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.tier); return writer; }; @@ -238008,6 +240329,10 @@ export const BI = $root.BI = (() => { message.quotePurchase = $root.BI.QuotePurchase.decode(reader, reader.uint32()); break; } + case 4: { + message.tier = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -238057,6 +240382,7 @@ export const BI = $root.BI = (() => { case 7: case 8: case 9: + case 10: break; } if (message.quantity != null && message.hasOwnProperty("quantity")) @@ -238067,6 +240393,9 @@ export const BI = $root.BI = (() => { if (error) return "quotePurchase." + error; } + if (message.tier != null && message.hasOwnProperty("tier")) + if (!$util.isInteger(message.tier)) + return "tier: integer expected"; return null; }; @@ -238129,6 +240458,10 @@ export const BI = $root.BI = (() => { case 9: message.productType = 9; break; + case "addKEPM": + case 10: + message.productType = 10; + break; } if (object.quantity != null) message.quantity = object.quantity | 0; @@ -238137,6 +240470,8 @@ export const BI = $root.BI = (() => { throw TypeError(".BI.UpgradeLicenseCompletePurchaseRequest.quotePurchase: object expected"); message.quotePurchase = $root.BI.QuotePurchase.fromObject(object.quotePurchase); } + if (object.tier != null) + message.tier = object.tier | 0; return message; }; @@ -238157,6 +240492,7 @@ export const BI = $root.BI = (() => { object.productType = options.enums === String ? "upgradeToEnterprise" : 0; object.quantity = 0; object.quotePurchase = null; + object.tier = 0; } if (message.productType != null && message.hasOwnProperty("productType")) object.productType = options.enums === String ? $root.BI.PurchaseProductType[message.productType] === undefined ? message.productType : $root.BI.PurchaseProductType[message.productType] : message.productType; @@ -238164,6 +240500,8 @@ export const BI = $root.BI = (() => { object.quantity = message.quantity; if (message.quotePurchase != null && message.hasOwnProperty("quotePurchase")) object.quotePurchase = $root.BI.QuotePurchase.toObject(message.quotePurchase, options); + if (message.tier != null && message.hasOwnProperty("tier")) + object.tier = message.tier; return object; }; @@ -240755,6 +243093,1917 @@ export const BI = $root.BI = (() => { return SingularEventRequest; })(); + BI.GetDailyCountRequest = (function() { + + /** + * Properties of a GetDailyCountRequest. + * @memberof BI + * @interface IGetDailyCountRequest + * @property {Array.|null} [enterpriseId] GetDailyCountRequest enterpriseId + * @property {BI.IMonthYear|null} [monthYear] GetDailyCountRequest monthYear + * @property {BI.IDateRange|null} [dateRange] GetDailyCountRequest dateRange + */ + + /** + * Constructs a new GetDailyCountRequest. + * @memberof BI + * @classdesc Represents a GetDailyCountRequest. + * @implements IGetDailyCountRequest + * @constructor + * @param {BI.IGetDailyCountRequest=} [properties] Properties to set + */ + function GetDailyCountRequest(properties) { + this.enterpriseId = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetDailyCountRequest enterpriseId. + * @member {Array.} enterpriseId + * @memberof BI.GetDailyCountRequest + * @instance + */ + GetDailyCountRequest.prototype.enterpriseId = $util.emptyArray; + + /** + * GetDailyCountRequest monthYear. + * @member {BI.IMonthYear|null|undefined} monthYear + * @memberof BI.GetDailyCountRequest + * @instance + */ + GetDailyCountRequest.prototype.monthYear = null; + + /** + * GetDailyCountRequest dateRange. + * @member {BI.IDateRange|null|undefined} dateRange + * @memberof BI.GetDailyCountRequest + * @instance + */ + GetDailyCountRequest.prototype.dateRange = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * GetDailyCountRequest period. + * @member {"monthYear"|"dateRange"|undefined} period + * @memberof BI.GetDailyCountRequest + * @instance + */ + Object.defineProperty(GetDailyCountRequest.prototype, "period", { + get: $util.oneOfGetter($oneOfFields = ["monthYear", "dateRange"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetDailyCountRequest instance using the specified properties. + * @function create + * @memberof BI.GetDailyCountRequest + * @static + * @param {BI.IGetDailyCountRequest=} [properties] Properties to set + * @returns {BI.GetDailyCountRequest} GetDailyCountRequest instance + */ + GetDailyCountRequest.create = function create(properties) { + return new GetDailyCountRequest(properties); + }; + + /** + * Encodes the specified GetDailyCountRequest message. Does not implicitly {@link BI.GetDailyCountRequest.verify|verify} messages. + * @function encode + * @memberof BI.GetDailyCountRequest + * @static + * @param {BI.IGetDailyCountRequest} message GetDailyCountRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDailyCountRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.enterpriseId != null && message.enterpriseId.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (let i = 0; i < message.enterpriseId.length; ++i) + writer.int32(message.enterpriseId[i]); + writer.ldelim(); + } + if (message.monthYear != null && Object.hasOwnProperty.call(message, "monthYear")) + $root.BI.MonthYear.encode(message.monthYear, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.dateRange != null && Object.hasOwnProperty.call(message, "dateRange")) + $root.BI.DateRange.encode(message.dateRange, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetDailyCountRequest message, length delimited. Does not implicitly {@link BI.GetDailyCountRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof BI.GetDailyCountRequest + * @static + * @param {BI.IGetDailyCountRequest} message GetDailyCountRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDailyCountRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetDailyCountRequest message from the specified reader or buffer. + * @function decode + * @memberof BI.GetDailyCountRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {BI.GetDailyCountRequest} GetDailyCountRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDailyCountRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.BI.GetDailyCountRequest(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.enterpriseId && message.enterpriseId.length)) + message.enterpriseId = []; + if ((tag & 7) === 2) { + let end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.enterpriseId.push(reader.int32()); + } else + message.enterpriseId.push(reader.int32()); + break; + } + case 2: { + message.monthYear = $root.BI.MonthYear.decode(reader, reader.uint32()); + break; + } + case 3: { + message.dateRange = $root.BI.DateRange.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetDailyCountRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof BI.GetDailyCountRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {BI.GetDailyCountRequest} GetDailyCountRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDailyCountRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetDailyCountRequest message. + * @function verify + * @memberof BI.GetDailyCountRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetDailyCountRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + let properties = {}; + if (message.enterpriseId != null && message.hasOwnProperty("enterpriseId")) { + if (!Array.isArray(message.enterpriseId)) + return "enterpriseId: array expected"; + for (let i = 0; i < message.enterpriseId.length; ++i) + if (!$util.isInteger(message.enterpriseId[i])) + return "enterpriseId: integer[] expected"; + } + if (message.monthYear != null && message.hasOwnProperty("monthYear")) { + properties.period = 1; + { + let error = $root.BI.MonthYear.verify(message.monthYear); + if (error) + return "monthYear." + error; + } + } + if (message.dateRange != null && message.hasOwnProperty("dateRange")) { + if (properties.period === 1) + return "period: multiple values"; + properties.period = 1; + { + let error = $root.BI.DateRange.verify(message.dateRange); + if (error) + return "dateRange." + error; + } + } + return null; + }; + + /** + * Creates a GetDailyCountRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof BI.GetDailyCountRequest + * @static + * @param {Object.} object Plain object + * @returns {BI.GetDailyCountRequest} GetDailyCountRequest + */ + GetDailyCountRequest.fromObject = function fromObject(object) { + if (object instanceof $root.BI.GetDailyCountRequest) + return object; + let message = new $root.BI.GetDailyCountRequest(); + if (object.enterpriseId) { + if (!Array.isArray(object.enterpriseId)) + throw TypeError(".BI.GetDailyCountRequest.enterpriseId: array expected"); + message.enterpriseId = []; + for (let i = 0; i < object.enterpriseId.length; ++i) + message.enterpriseId[i] = object.enterpriseId[i] | 0; + } + if (object.monthYear != null) { + if (typeof object.monthYear !== "object") + throw TypeError(".BI.GetDailyCountRequest.monthYear: object expected"); + message.monthYear = $root.BI.MonthYear.fromObject(object.monthYear); + } + if (object.dateRange != null) { + if (typeof object.dateRange !== "object") + throw TypeError(".BI.GetDailyCountRequest.dateRange: object expected"); + message.dateRange = $root.BI.DateRange.fromObject(object.dateRange); + } + return message; + }; + + /** + * Creates a plain object from a GetDailyCountRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof BI.GetDailyCountRequest + * @static + * @param {BI.GetDailyCountRequest} message GetDailyCountRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetDailyCountRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.enterpriseId = []; + if (message.enterpriseId && message.enterpriseId.length) { + object.enterpriseId = []; + for (let j = 0; j < message.enterpriseId.length; ++j) + object.enterpriseId[j] = message.enterpriseId[j]; + } + if (message.monthYear != null && message.hasOwnProperty("monthYear")) { + object.monthYear = $root.BI.MonthYear.toObject(message.monthYear, options); + if (options.oneofs) + object.period = "monthYear"; + } + if (message.dateRange != null && message.hasOwnProperty("dateRange")) { + object.dateRange = $root.BI.DateRange.toObject(message.dateRange, options); + if (options.oneofs) + object.period = "dateRange"; + } + return object; + }; + + /** + * Converts this GetDailyCountRequest to JSON. + * @function toJSON + * @memberof BI.GetDailyCountRequest + * @instance + * @returns {Object.} JSON object + */ + GetDailyCountRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetDailyCountRequest + * @function getTypeUrl + * @memberof BI.GetDailyCountRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetDailyCountRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/BI.GetDailyCountRequest"; + }; + + return GetDailyCountRequest; + })(); + + BI.MonthYear = (function() { + + /** + * Properties of a MonthYear. + * @memberof BI + * @interface IMonthYear + * @property {number|null} [month] MonthYear month + * @property {number|null} [year] MonthYear year + */ + + /** + * Constructs a new MonthYear. + * @memberof BI + * @classdesc Represents a MonthYear. + * @implements IMonthYear + * @constructor + * @param {BI.IMonthYear=} [properties] Properties to set + */ + function MonthYear(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MonthYear month. + * @member {number} month + * @memberof BI.MonthYear + * @instance + */ + MonthYear.prototype.month = 0; + + /** + * MonthYear year. + * @member {number} year + * @memberof BI.MonthYear + * @instance + */ + MonthYear.prototype.year = 0; + + /** + * Creates a new MonthYear instance using the specified properties. + * @function create + * @memberof BI.MonthYear + * @static + * @param {BI.IMonthYear=} [properties] Properties to set + * @returns {BI.MonthYear} MonthYear instance + */ + MonthYear.create = function create(properties) { + return new MonthYear(properties); + }; + + /** + * Encodes the specified MonthYear message. Does not implicitly {@link BI.MonthYear.verify|verify} messages. + * @function encode + * @memberof BI.MonthYear + * @static + * @param {BI.IMonthYear} message MonthYear message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MonthYear.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.month != null && Object.hasOwnProperty.call(message, "month")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.month); + if (message.year != null && Object.hasOwnProperty.call(message, "year")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.year); + return writer; + }; + + /** + * Encodes the specified MonthYear message, length delimited. Does not implicitly {@link BI.MonthYear.verify|verify} messages. + * @function encodeDelimited + * @memberof BI.MonthYear + * @static + * @param {BI.IMonthYear} message MonthYear message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MonthYear.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MonthYear message from the specified reader or buffer. + * @function decode + * @memberof BI.MonthYear + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {BI.MonthYear} MonthYear + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MonthYear.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.BI.MonthYear(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.month = reader.int32(); + break; + } + case 2: { + message.year = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MonthYear message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof BI.MonthYear + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {BI.MonthYear} MonthYear + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MonthYear.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MonthYear message. + * @function verify + * @memberof BI.MonthYear + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MonthYear.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.month != null && message.hasOwnProperty("month")) + if (!$util.isInteger(message.month)) + return "month: integer expected"; + if (message.year != null && message.hasOwnProperty("year")) + if (!$util.isInteger(message.year)) + return "year: integer expected"; + return null; + }; + + /** + * Creates a MonthYear message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof BI.MonthYear + * @static + * @param {Object.} object Plain object + * @returns {BI.MonthYear} MonthYear + */ + MonthYear.fromObject = function fromObject(object) { + if (object instanceof $root.BI.MonthYear) + return object; + let message = new $root.BI.MonthYear(); + if (object.month != null) + message.month = object.month | 0; + if (object.year != null) + message.year = object.year | 0; + return message; + }; + + /** + * Creates a plain object from a MonthYear message. Also converts values to other types if specified. + * @function toObject + * @memberof BI.MonthYear + * @static + * @param {BI.MonthYear} message MonthYear + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MonthYear.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.month = 0; + object.year = 0; + } + if (message.month != null && message.hasOwnProperty("month")) + object.month = message.month; + if (message.year != null && message.hasOwnProperty("year")) + object.year = message.year; + return object; + }; + + /** + * Converts this MonthYear to JSON. + * @function toJSON + * @memberof BI.MonthYear + * @instance + * @returns {Object.} JSON object + */ + MonthYear.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MonthYear + * @function getTypeUrl + * @memberof BI.MonthYear + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MonthYear.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/BI.MonthYear"; + }; + + return MonthYear; + })(); + + BI.DateRange = (function() { + + /** + * Properties of a DateRange. + * @memberof BI + * @interface IDateRange + * @property {number|Long|null} [start] DateRange start + * @property {number|Long|null} [end] DateRange end + */ + + /** + * Constructs a new DateRange. + * @memberof BI + * @classdesc Represents a DateRange. + * @implements IDateRange + * @constructor + * @param {BI.IDateRange=} [properties] Properties to set + */ + function DateRange(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DateRange start. + * @member {number|Long} start + * @memberof BI.DateRange + * @instance + */ + DateRange.prototype.start = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * DateRange end. + * @member {number|Long} end + * @memberof BI.DateRange + * @instance + */ + DateRange.prototype.end = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new DateRange instance using the specified properties. + * @function create + * @memberof BI.DateRange + * @static + * @param {BI.IDateRange=} [properties] Properties to set + * @returns {BI.DateRange} DateRange instance + */ + DateRange.create = function create(properties) { + return new DateRange(properties); + }; + + /** + * Encodes the specified DateRange message. Does not implicitly {@link BI.DateRange.verify|verify} messages. + * @function encode + * @memberof BI.DateRange + * @static + * @param {BI.IDateRange} message DateRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DateRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.end); + return writer; + }; + + /** + * Encodes the specified DateRange message, length delimited. Does not implicitly {@link BI.DateRange.verify|verify} messages. + * @function encodeDelimited + * @memberof BI.DateRange + * @static + * @param {BI.IDateRange} message DateRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DateRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DateRange message from the specified reader or buffer. + * @function decode + * @memberof BI.DateRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {BI.DateRange} DateRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DateRange.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.BI.DateRange(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.start = reader.int64(); + break; + } + case 2: { + message.end = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DateRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof BI.DateRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {BI.DateRange} DateRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DateRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DateRange message. + * @function verify + * @memberof BI.DateRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DateRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start) && !(message.start && $util.isInteger(message.start.low) && $util.isInteger(message.start.high))) + return "start: integer|Long expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end) && !(message.end && $util.isInteger(message.end.low) && $util.isInteger(message.end.high))) + return "end: integer|Long expected"; + return null; + }; + + /** + * Creates a DateRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof BI.DateRange + * @static + * @param {Object.} object Plain object + * @returns {BI.DateRange} DateRange + */ + DateRange.fromObject = function fromObject(object) { + if (object instanceof $root.BI.DateRange) + return object; + let message = new $root.BI.DateRange(); + if (object.start != null) + if ($util.Long) + (message.start = $util.Long.fromValue(object.start)).unsigned = false; + else if (typeof object.start === "string") + message.start = parseInt(object.start, 10); + else if (typeof object.start === "number") + message.start = object.start; + else if (typeof object.start === "object") + message.start = new $util.LongBits(object.start.low >>> 0, object.start.high >>> 0).toNumber(); + if (object.end != null) + if ($util.Long) + (message.end = $util.Long.fromValue(object.end)).unsigned = false; + else if (typeof object.end === "string") + message.end = parseInt(object.end, 10); + else if (typeof object.end === "number") + message.end = object.end; + else if (typeof object.end === "object") + message.end = new $util.LongBits(object.end.low >>> 0, object.end.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a DateRange message. Also converts values to other types if specified. + * @function toObject + * @memberof BI.DateRange + * @static + * @param {BI.DateRange} message DateRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DateRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + if ($util.Long) { + let long = new $util.Long(0, 0, false); + object.start = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.start = options.longs === String ? "0" : 0; + if ($util.Long) { + let long = new $util.Long(0, 0, false); + object.end = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.end = options.longs === String ? "0" : 0; + } + if (message.start != null && message.hasOwnProperty("start")) + if (typeof message.start === "number") + object.start = options.longs === String ? String(message.start) : message.start; + else + object.start = options.longs === String ? $util.Long.prototype.toString.call(message.start) : options.longs === Number ? new $util.LongBits(message.start.low >>> 0, message.start.high >>> 0).toNumber() : message.start; + if (message.end != null && message.hasOwnProperty("end")) + if (typeof message.end === "number") + object.end = options.longs === String ? String(message.end) : message.end; + else + object.end = options.longs === String ? $util.Long.prototype.toString.call(message.end) : options.longs === Number ? new $util.LongBits(message.end.low >>> 0, message.end.high >>> 0).toNumber() : message.end; + return object; + }; + + /** + * Converts this DateRange to JSON. + * @function toJSON + * @memberof BI.DateRange + * @instance + * @returns {Object.} JSON object + */ + DateRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DateRange + * @function getTypeUrl + * @memberof BI.DateRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DateRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/BI.DateRange"; + }; + + return DateRange; + })(); + + BI.DailyCount = (function() { + + /** + * Properties of a DailyCount. + * @memberof BI + * @interface IDailyCount + * @property {number|Long|null} [date] DailyCount date + * @property {number|null} [pamCount] DailyCount pamCount + */ + + /** + * Constructs a new DailyCount. + * @memberof BI + * @classdesc Represents a DailyCount. + * @implements IDailyCount + * @constructor + * @param {BI.IDailyCount=} [properties] Properties to set + */ + function DailyCount(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DailyCount date. + * @member {number|Long} date + * @memberof BI.DailyCount + * @instance + */ + DailyCount.prototype.date = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * DailyCount pamCount. + * @member {number} pamCount + * @memberof BI.DailyCount + * @instance + */ + DailyCount.prototype.pamCount = 0; + + /** + * Creates a new DailyCount instance using the specified properties. + * @function create + * @memberof BI.DailyCount + * @static + * @param {BI.IDailyCount=} [properties] Properties to set + * @returns {BI.DailyCount} DailyCount instance + */ + DailyCount.create = function create(properties) { + return new DailyCount(properties); + }; + + /** + * Encodes the specified DailyCount message. Does not implicitly {@link BI.DailyCount.verify|verify} messages. + * @function encode + * @memberof BI.DailyCount + * @static + * @param {BI.IDailyCount} message DailyCount message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DailyCount.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.date != null && Object.hasOwnProperty.call(message, "date")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.date); + if (message.pamCount != null && Object.hasOwnProperty.call(message, "pamCount")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pamCount); + return writer; + }; + + /** + * Encodes the specified DailyCount message, length delimited. Does not implicitly {@link BI.DailyCount.verify|verify} messages. + * @function encodeDelimited + * @memberof BI.DailyCount + * @static + * @param {BI.IDailyCount} message DailyCount message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DailyCount.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DailyCount message from the specified reader or buffer. + * @function decode + * @memberof BI.DailyCount + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {BI.DailyCount} DailyCount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DailyCount.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.BI.DailyCount(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.date = reader.int64(); + break; + } + case 2: { + message.pamCount = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DailyCount message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof BI.DailyCount + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {BI.DailyCount} DailyCount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DailyCount.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DailyCount message. + * @function verify + * @memberof BI.DailyCount + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DailyCount.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.date != null && message.hasOwnProperty("date")) + if (!$util.isInteger(message.date) && !(message.date && $util.isInteger(message.date.low) && $util.isInteger(message.date.high))) + return "date: integer|Long expected"; + if (message.pamCount != null && message.hasOwnProperty("pamCount")) + if (!$util.isInteger(message.pamCount)) + return "pamCount: integer expected"; + return null; + }; + + /** + * Creates a DailyCount message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof BI.DailyCount + * @static + * @param {Object.} object Plain object + * @returns {BI.DailyCount} DailyCount + */ + DailyCount.fromObject = function fromObject(object) { + if (object instanceof $root.BI.DailyCount) + return object; + let message = new $root.BI.DailyCount(); + if (object.date != null) + if ($util.Long) + (message.date = $util.Long.fromValue(object.date)).unsigned = false; + else if (typeof object.date === "string") + message.date = parseInt(object.date, 10); + else if (typeof object.date === "number") + message.date = object.date; + else if (typeof object.date === "object") + message.date = new $util.LongBits(object.date.low >>> 0, object.date.high >>> 0).toNumber(); + if (object.pamCount != null) + message.pamCount = object.pamCount | 0; + return message; + }; + + /** + * Creates a plain object from a DailyCount message. Also converts values to other types if specified. + * @function toObject + * @memberof BI.DailyCount + * @static + * @param {BI.DailyCount} message DailyCount + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DailyCount.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + if ($util.Long) { + let long = new $util.Long(0, 0, false); + object.date = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.date = options.longs === String ? "0" : 0; + object.pamCount = 0; + } + if (message.date != null && message.hasOwnProperty("date")) + if (typeof message.date === "number") + object.date = options.longs === String ? String(message.date) : message.date; + else + object.date = options.longs === String ? $util.Long.prototype.toString.call(message.date) : options.longs === Number ? new $util.LongBits(message.date.low >>> 0, message.date.high >>> 0).toNumber() : message.date; + if (message.pamCount != null && message.hasOwnProperty("pamCount")) + object.pamCount = message.pamCount; + return object; + }; + + /** + * Converts this DailyCount to JSON. + * @function toJSON + * @memberof BI.DailyCount + * @instance + * @returns {Object.} JSON object + */ + DailyCount.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DailyCount + * @function getTypeUrl + * @memberof BI.DailyCount + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DailyCount.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/BI.DailyCount"; + }; + + return DailyCount; + })(); + + BI.CountForEnterprise = (function() { + + /** + * Properties of a CountForEnterprise. + * @memberof BI + * @interface ICountForEnterprise + * @property {number|null} [enterpriseId] CountForEnterprise enterpriseId + * @property {Array.|null} [counts] CountForEnterprise counts + */ + + /** + * Constructs a new CountForEnterprise. + * @memberof BI + * @classdesc Represents a CountForEnterprise. + * @implements ICountForEnterprise + * @constructor + * @param {BI.ICountForEnterprise=} [properties] Properties to set + */ + function CountForEnterprise(properties) { + this.counts = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CountForEnterprise enterpriseId. + * @member {number} enterpriseId + * @memberof BI.CountForEnterprise + * @instance + */ + CountForEnterprise.prototype.enterpriseId = 0; + + /** + * CountForEnterprise counts. + * @member {Array.} counts + * @memberof BI.CountForEnterprise + * @instance + */ + CountForEnterprise.prototype.counts = $util.emptyArray; + + /** + * Creates a new CountForEnterprise instance using the specified properties. + * @function create + * @memberof BI.CountForEnterprise + * @static + * @param {BI.ICountForEnterprise=} [properties] Properties to set + * @returns {BI.CountForEnterprise} CountForEnterprise instance + */ + CountForEnterprise.create = function create(properties) { + return new CountForEnterprise(properties); + }; + + /** + * Encodes the specified CountForEnterprise message. Does not implicitly {@link BI.CountForEnterprise.verify|verify} messages. + * @function encode + * @memberof BI.CountForEnterprise + * @static + * @param {BI.ICountForEnterprise} message CountForEnterprise message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CountForEnterprise.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.enterpriseId != null && Object.hasOwnProperty.call(message, "enterpriseId")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.enterpriseId); + if (message.counts != null && message.counts.length) + for (let i = 0; i < message.counts.length; ++i) + $root.BI.DailyCount.encode(message.counts[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CountForEnterprise message, length delimited. Does not implicitly {@link BI.CountForEnterprise.verify|verify} messages. + * @function encodeDelimited + * @memberof BI.CountForEnterprise + * @static + * @param {BI.ICountForEnterprise} message CountForEnterprise message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CountForEnterprise.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CountForEnterprise message from the specified reader or buffer. + * @function decode + * @memberof BI.CountForEnterprise + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {BI.CountForEnterprise} CountForEnterprise + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CountForEnterprise.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.BI.CountForEnterprise(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.enterpriseId = reader.int32(); + break; + } + case 2: { + if (!(message.counts && message.counts.length)) + message.counts = []; + message.counts.push($root.BI.DailyCount.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CountForEnterprise message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof BI.CountForEnterprise + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {BI.CountForEnterprise} CountForEnterprise + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CountForEnterprise.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CountForEnterprise message. + * @function verify + * @memberof BI.CountForEnterprise + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CountForEnterprise.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.enterpriseId != null && message.hasOwnProperty("enterpriseId")) + if (!$util.isInteger(message.enterpriseId)) + return "enterpriseId: integer expected"; + if (message.counts != null && message.hasOwnProperty("counts")) { + if (!Array.isArray(message.counts)) + return "counts: array expected"; + for (let i = 0; i < message.counts.length; ++i) { + let error = $root.BI.DailyCount.verify(message.counts[i]); + if (error) + return "counts." + error; + } + } + return null; + }; + + /** + * Creates a CountForEnterprise message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof BI.CountForEnterprise + * @static + * @param {Object.} object Plain object + * @returns {BI.CountForEnterprise} CountForEnterprise + */ + CountForEnterprise.fromObject = function fromObject(object) { + if (object instanceof $root.BI.CountForEnterprise) + return object; + let message = new $root.BI.CountForEnterprise(); + if (object.enterpriseId != null) + message.enterpriseId = object.enterpriseId | 0; + if (object.counts) { + if (!Array.isArray(object.counts)) + throw TypeError(".BI.CountForEnterprise.counts: array expected"); + message.counts = []; + for (let i = 0; i < object.counts.length; ++i) { + if (typeof object.counts[i] !== "object") + throw TypeError(".BI.CountForEnterprise.counts: object expected"); + message.counts[i] = $root.BI.DailyCount.fromObject(object.counts[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a CountForEnterprise message. Also converts values to other types if specified. + * @function toObject + * @memberof BI.CountForEnterprise + * @static + * @param {BI.CountForEnterprise} message CountForEnterprise + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CountForEnterprise.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.counts = []; + if (options.defaults) + object.enterpriseId = 0; + if (message.enterpriseId != null && message.hasOwnProperty("enterpriseId")) + object.enterpriseId = message.enterpriseId; + if (message.counts && message.counts.length) { + object.counts = []; + for (let j = 0; j < message.counts.length; ++j) + object.counts[j] = $root.BI.DailyCount.toObject(message.counts[j], options); + } + return object; + }; + + /** + * Converts this CountForEnterprise to JSON. + * @function toJSON + * @memberof BI.CountForEnterprise + * @instance + * @returns {Object.} JSON object + */ + CountForEnterprise.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CountForEnterprise + * @function getTypeUrl + * @memberof BI.CountForEnterprise + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CountForEnterprise.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/BI.CountForEnterprise"; + }; + + return CountForEnterprise; + })(); + + BI.GetDailyCountResponse = (function() { + + /** + * Properties of a GetDailyCountResponse. + * @memberof BI + * @interface IGetDailyCountResponse + * @property {Array.|null} [enterpriseCounts] GetDailyCountResponse enterpriseCounts + */ + + /** + * Constructs a new GetDailyCountResponse. + * @memberof BI + * @classdesc Represents a GetDailyCountResponse. + * @implements IGetDailyCountResponse + * @constructor + * @param {BI.IGetDailyCountResponse=} [properties] Properties to set + */ + function GetDailyCountResponse(properties) { + this.enterpriseCounts = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetDailyCountResponse enterpriseCounts. + * @member {Array.} enterpriseCounts + * @memberof BI.GetDailyCountResponse + * @instance + */ + GetDailyCountResponse.prototype.enterpriseCounts = $util.emptyArray; + + /** + * Creates a new GetDailyCountResponse instance using the specified properties. + * @function create + * @memberof BI.GetDailyCountResponse + * @static + * @param {BI.IGetDailyCountResponse=} [properties] Properties to set + * @returns {BI.GetDailyCountResponse} GetDailyCountResponse instance + */ + GetDailyCountResponse.create = function create(properties) { + return new GetDailyCountResponse(properties); + }; + + /** + * Encodes the specified GetDailyCountResponse message. Does not implicitly {@link BI.GetDailyCountResponse.verify|verify} messages. + * @function encode + * @memberof BI.GetDailyCountResponse + * @static + * @param {BI.IGetDailyCountResponse} message GetDailyCountResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDailyCountResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.enterpriseCounts != null && message.enterpriseCounts.length) + for (let i = 0; i < message.enterpriseCounts.length; ++i) + $root.BI.CountForEnterprise.encode(message.enterpriseCounts[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetDailyCountResponse message, length delimited. Does not implicitly {@link BI.GetDailyCountResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof BI.GetDailyCountResponse + * @static + * @param {BI.IGetDailyCountResponse} message GetDailyCountResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDailyCountResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetDailyCountResponse message from the specified reader or buffer. + * @function decode + * @memberof BI.GetDailyCountResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {BI.GetDailyCountResponse} GetDailyCountResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDailyCountResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.BI.GetDailyCountResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.enterpriseCounts && message.enterpriseCounts.length)) + message.enterpriseCounts = []; + message.enterpriseCounts.push($root.BI.CountForEnterprise.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetDailyCountResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof BI.GetDailyCountResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {BI.GetDailyCountResponse} GetDailyCountResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDailyCountResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetDailyCountResponse message. + * @function verify + * @memberof BI.GetDailyCountResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetDailyCountResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.enterpriseCounts != null && message.hasOwnProperty("enterpriseCounts")) { + if (!Array.isArray(message.enterpriseCounts)) + return "enterpriseCounts: array expected"; + for (let i = 0; i < message.enterpriseCounts.length; ++i) { + let error = $root.BI.CountForEnterprise.verify(message.enterpriseCounts[i]); + if (error) + return "enterpriseCounts." + error; + } + } + return null; + }; + + /** + * Creates a GetDailyCountResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof BI.GetDailyCountResponse + * @static + * @param {Object.} object Plain object + * @returns {BI.GetDailyCountResponse} GetDailyCountResponse + */ + GetDailyCountResponse.fromObject = function fromObject(object) { + if (object instanceof $root.BI.GetDailyCountResponse) + return object; + let message = new $root.BI.GetDailyCountResponse(); + if (object.enterpriseCounts) { + if (!Array.isArray(object.enterpriseCounts)) + throw TypeError(".BI.GetDailyCountResponse.enterpriseCounts: array expected"); + message.enterpriseCounts = []; + for (let i = 0; i < object.enterpriseCounts.length; ++i) { + if (typeof object.enterpriseCounts[i] !== "object") + throw TypeError(".BI.GetDailyCountResponse.enterpriseCounts: object expected"); + message.enterpriseCounts[i] = $root.BI.CountForEnterprise.fromObject(object.enterpriseCounts[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a GetDailyCountResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof BI.GetDailyCountResponse + * @static + * @param {BI.GetDailyCountResponse} message GetDailyCountResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetDailyCountResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.enterpriseCounts = []; + if (message.enterpriseCounts && message.enterpriseCounts.length) { + object.enterpriseCounts = []; + for (let j = 0; j < message.enterpriseCounts.length; ++j) + object.enterpriseCounts[j] = $root.BI.CountForEnterprise.toObject(message.enterpriseCounts[j], options); + } + return object; + }; + + /** + * Converts this GetDailyCountResponse to JSON. + * @function toJSON + * @memberof BI.GetDailyCountResponse + * @instance + * @returns {Object.} JSON object + */ + GetDailyCountResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetDailyCountResponse + * @function getTypeUrl + * @memberof BI.GetDailyCountResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetDailyCountResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/BI.GetDailyCountResponse"; + }; + + return GetDailyCountResponse; + })(); + + BI.ActivePamCountRequest = (function() { + + /** + * Properties of an ActivePamCountRequest. + * @memberof BI + * @interface IActivePamCountRequest + * @property {number|null} [enterpriseId] ActivePamCountRequest enterpriseId + */ + + /** + * Constructs a new ActivePamCountRequest. + * @memberof BI + * @classdesc Represents an ActivePamCountRequest. + * @implements IActivePamCountRequest + * @constructor + * @param {BI.IActivePamCountRequest=} [properties] Properties to set + */ + function ActivePamCountRequest(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ActivePamCountRequest enterpriseId. + * @member {number} enterpriseId + * @memberof BI.ActivePamCountRequest + * @instance + */ + ActivePamCountRequest.prototype.enterpriseId = 0; + + /** + * Creates a new ActivePamCountRequest instance using the specified properties. + * @function create + * @memberof BI.ActivePamCountRequest + * @static + * @param {BI.IActivePamCountRequest=} [properties] Properties to set + * @returns {BI.ActivePamCountRequest} ActivePamCountRequest instance + */ + ActivePamCountRequest.create = function create(properties) { + return new ActivePamCountRequest(properties); + }; + + /** + * Encodes the specified ActivePamCountRequest message. Does not implicitly {@link BI.ActivePamCountRequest.verify|verify} messages. + * @function encode + * @memberof BI.ActivePamCountRequest + * @static + * @param {BI.IActivePamCountRequest} message ActivePamCountRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ActivePamCountRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.enterpriseId != null && Object.hasOwnProperty.call(message, "enterpriseId")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.enterpriseId); + return writer; + }; + + /** + * Encodes the specified ActivePamCountRequest message, length delimited. Does not implicitly {@link BI.ActivePamCountRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof BI.ActivePamCountRequest + * @static + * @param {BI.IActivePamCountRequest} message ActivePamCountRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ActivePamCountRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ActivePamCountRequest message from the specified reader or buffer. + * @function decode + * @memberof BI.ActivePamCountRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {BI.ActivePamCountRequest} ActivePamCountRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ActivePamCountRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.BI.ActivePamCountRequest(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.enterpriseId = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ActivePamCountRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof BI.ActivePamCountRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {BI.ActivePamCountRequest} ActivePamCountRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ActivePamCountRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ActivePamCountRequest message. + * @function verify + * @memberof BI.ActivePamCountRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ActivePamCountRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.enterpriseId != null && message.hasOwnProperty("enterpriseId")) + if (!$util.isInteger(message.enterpriseId)) + return "enterpriseId: integer expected"; + return null; + }; + + /** + * Creates an ActivePamCountRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof BI.ActivePamCountRequest + * @static + * @param {Object.} object Plain object + * @returns {BI.ActivePamCountRequest} ActivePamCountRequest + */ + ActivePamCountRequest.fromObject = function fromObject(object) { + if (object instanceof $root.BI.ActivePamCountRequest) + return object; + let message = new $root.BI.ActivePamCountRequest(); + if (object.enterpriseId != null) + message.enterpriseId = object.enterpriseId | 0; + return message; + }; + + /** + * Creates a plain object from an ActivePamCountRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof BI.ActivePamCountRequest + * @static + * @param {BI.ActivePamCountRequest} message ActivePamCountRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ActivePamCountRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) + object.enterpriseId = 0; + if (message.enterpriseId != null && message.hasOwnProperty("enterpriseId")) + object.enterpriseId = message.enterpriseId; + return object; + }; + + /** + * Converts this ActivePamCountRequest to JSON. + * @function toJSON + * @memberof BI.ActivePamCountRequest + * @instance + * @returns {Object.} JSON object + */ + ActivePamCountRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ActivePamCountRequest + * @function getTypeUrl + * @memberof BI.ActivePamCountRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ActivePamCountRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/BI.ActivePamCountRequest"; + }; + + return ActivePamCountRequest; + })(); + + BI.ActivePamCountResponse = (function() { + + /** + * Properties of an ActivePamCountResponse. + * @memberof BI + * @interface IActivePamCountResponse + * @property {number|null} [pamCount] ActivePamCountResponse pamCount + */ + + /** + * Constructs a new ActivePamCountResponse. + * @memberof BI + * @classdesc Represents an ActivePamCountResponse. + * @implements IActivePamCountResponse + * @constructor + * @param {BI.IActivePamCountResponse=} [properties] Properties to set + */ + function ActivePamCountResponse(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ActivePamCountResponse pamCount. + * @member {number} pamCount + * @memberof BI.ActivePamCountResponse + * @instance + */ + ActivePamCountResponse.prototype.pamCount = 0; + + /** + * Creates a new ActivePamCountResponse instance using the specified properties. + * @function create + * @memberof BI.ActivePamCountResponse + * @static + * @param {BI.IActivePamCountResponse=} [properties] Properties to set + * @returns {BI.ActivePamCountResponse} ActivePamCountResponse instance + */ + ActivePamCountResponse.create = function create(properties) { + return new ActivePamCountResponse(properties); + }; + + /** + * Encodes the specified ActivePamCountResponse message. Does not implicitly {@link BI.ActivePamCountResponse.verify|verify} messages. + * @function encode + * @memberof BI.ActivePamCountResponse + * @static + * @param {BI.IActivePamCountResponse} message ActivePamCountResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ActivePamCountResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pamCount != null && Object.hasOwnProperty.call(message, "pamCount")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.pamCount); + return writer; + }; + + /** + * Encodes the specified ActivePamCountResponse message, length delimited. Does not implicitly {@link BI.ActivePamCountResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof BI.ActivePamCountResponse + * @static + * @param {BI.IActivePamCountResponse} message ActivePamCountResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ActivePamCountResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ActivePamCountResponse message from the specified reader or buffer. + * @function decode + * @memberof BI.ActivePamCountResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {BI.ActivePamCountResponse} ActivePamCountResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ActivePamCountResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.BI.ActivePamCountResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.pamCount = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ActivePamCountResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof BI.ActivePamCountResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {BI.ActivePamCountResponse} ActivePamCountResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ActivePamCountResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ActivePamCountResponse message. + * @function verify + * @memberof BI.ActivePamCountResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ActivePamCountResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.pamCount != null && message.hasOwnProperty("pamCount")) + if (!$util.isInteger(message.pamCount)) + return "pamCount: integer expected"; + return null; + }; + + /** + * Creates an ActivePamCountResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof BI.ActivePamCountResponse + * @static + * @param {Object.} object Plain object + * @returns {BI.ActivePamCountResponse} ActivePamCountResponse + */ + ActivePamCountResponse.fromObject = function fromObject(object) { + if (object instanceof $root.BI.ActivePamCountResponse) + return object; + let message = new $root.BI.ActivePamCountResponse(); + if (object.pamCount != null) + message.pamCount = object.pamCount | 0; + return message; + }; + + /** + * Creates a plain object from an ActivePamCountResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof BI.ActivePamCountResponse + * @static + * @param {BI.ActivePamCountResponse} message ActivePamCountResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ActivePamCountResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) + object.pamCount = 0; + if (message.pamCount != null && message.hasOwnProperty("pamCount")) + object.pamCount = message.pamCount; + return object; + }; + + /** + * Converts this ActivePamCountResponse to JSON. + * @function toJSON + * @memberof BI.ActivePamCountResponse + * @instance + * @returns {Object.} JSON object + */ + ActivePamCountResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ActivePamCountResponse + * @function getTypeUrl + * @memberof BI.ActivePamCountResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ActivePamCountResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/BI.ActivePamCountResponse"; + }; + + return ActivePamCountResponse; + })(); + return BI; })(); diff --git a/keeperapi/src/qrc/constants.ts b/keeperapi/src/qrc/constants.ts new file mode 100644 index 0000000..7e4efdd --- /dev/null +++ b/keeperapi/src/qrc/constants.ts @@ -0,0 +1,87 @@ +/** + * Constants for Quantum Resistant Cryptography (QRC) implementation + * Based on ML-KEM and HPKE standards + */ + +// Ciphertext lengths by ML-KEM variant (in bytes) +export const ML_KEM_768_CIPHERTEXT_LENGTH = 1088; +export const ML_KEM_1024_CIPHERTEXT_LENGTH = 1568; + +// ML-KEM public key lengths (in bytes) +export const ML_KEM_768_PUBLIC_KEY_LENGTH = 1184; +export const ML_KEM_1024_PUBLIC_KEY_LENGTH = 1568; + +// ML-KEM private key lengths (in bytes) +export const ML_KEM_768_PRIVATE_KEY_LENGTH = 2400; +export const ML_KEM_1024_PRIVATE_KEY_LENGTH = 3168; + +// ML-KEM shared secret length (same for all variants) +export const ML_KEM_SHARED_SECRET_LENGTH = 32; + +// ECDH key lengths +export const EC_PUBLIC_KEY_LENGTH = 65; // Uncompressed P-256 public key (0x04 + x + y) +export const EC_PRIVATE_KEY_LENGTH = 32; // P-256 private key scalar +export const EC_SHARED_SECRET_LENGTH = 32; // ECDH shared secret with P-256 + +// AES-GCM parameters +export const AES_KEY_LENGTH = 32; // AES-256 +export const AES_GCM_IV_LENGTH = 12; // 96-bit IV for GCM +export const AES_GCM_TAG_LENGTH = 16; // 128-bit authentication tag + +// HKDF parameters +export const HKDF_SALT_LENGTH = 32; // SHA-256 output size +export const HKDF_OUTPUT_LENGTH = 32; // AES-256 key size + +// Protocol version +export const QRC_PROTOCOL_VERSION = 1; + +// Optional data (recommended size for additional security) +export const OPTIONAL_DATA_LENGTH = 16; + +// Ciphersuite identifiers (must match server implementation) +export enum Ciphersuite { + HPKE_MLKEM768_ECDHP256_HKDFSHA256_AESGCM256 = 'HPKE_ML-KEM-768_ECDH-P256_HKDF-SHA256_AES-GCM-256', + HPKE_MLKEM1024_ECDHP256_HKDFSHA256_AESGCM256 = 'HPKE_ML-KEM-1024_ECDH-P256_HKDF-SHA256_AES-GCM-256' +} + +// ML-KEM variant types +export enum MlKemVariant { + ML_KEM_768 = 768, + ML_KEM_1024 = 1024 +} + +// Map ciphersuite to ML-KEM variant +export function getMlKemVariant(ciphersuite: Ciphersuite): MlKemVariant { + switch (ciphersuite) { + case Ciphersuite.HPKE_MLKEM768_ECDHP256_HKDFSHA256_AESGCM256: + return MlKemVariant.ML_KEM_768; + case Ciphersuite.HPKE_MLKEM1024_ECDHP256_HKDFSHA256_AESGCM256: + return MlKemVariant.ML_KEM_1024; + default: + throw new Error(`Unknown ciphersuite: ${ciphersuite}`); + } +} + +// Get ML-KEM ciphertext length for a given variant +export function getMlKemCiphertextLength(variant: MlKemVariant): number { + switch (variant) { + case MlKemVariant.ML_KEM_768: + return ML_KEM_768_CIPHERTEXT_LENGTH; + case MlKemVariant.ML_KEM_1024: + return ML_KEM_1024_CIPHERTEXT_LENGTH; + default: + throw new Error(`Unknown ML-KEM variant: ${variant}`); + } +} + +// Get ML-KEM public key length for a given variant +export function getMlKemPublicKeyLength(variant: MlKemVariant): number { + switch (variant) { + case MlKemVariant.ML_KEM_768: + return ML_KEM_768_PUBLIC_KEY_LENGTH; + case MlKemVariant.ML_KEM_1024: + return ML_KEM_1024_PUBLIC_KEY_LENGTH; + default: + throw new Error(`Unknown ML-KEM variant: ${variant}`); + } +} diff --git a/keeperapi/src/qrc/context.ts b/keeperapi/src/qrc/context.ts new file mode 100644 index 0000000..a9a2128 --- /dev/null +++ b/keeperapi/src/qrc/context.ts @@ -0,0 +1,82 @@ +/** + * Context info builder for HKDF + * Critical for security - binds key derivation to specific parameters + */ + +import { concatUint8Arrays } from './utils'; +import { Ciphersuite, EC_PUBLIC_KEY_LENGTH } from './constants'; + +/** + * Builds the context info for HKDF key derivation + * + * The order and composition of fields is critical and must match the server implementation: + * contextInfo = [optionalData] || ciphersuiteString || serverEcPublicKey || + * clientEphemeralEcPublicKey || sha256(mlKemCiphertext) || version + * + * @param ciphersuite - Ciphersuite identifier + * @param serverEcPublicKey - Server's EC public key (65 bytes) + * @param clientEphemeralEcPublicKey - Client's ephemeral EC public key (65 bytes) + * @param mlKemCiphertextHash - SHA-256 hash of ML-KEM ciphertext (32 bytes) + * @param version - Protocol version (1 byte) + * @param optionalData - Optional data for additional security (optional) + * @returns Context info byte array + */ +export function buildContextInfo( + ciphersuite: Ciphersuite, + serverEcPublicKey: Uint8Array, + clientEphemeralEcPublicKey: Uint8Array, + mlKemCiphertextHash: Uint8Array, + version: number, + optionalData?: Uint8Array +): Uint8Array { + const parts: Uint8Array[] = []; + + // Optional data (if present) comes first + if (optionalData && optionalData.length > 0) { + parts.push(optionalData); + } + + // Ciphersuite string (UTF-8 encoded) + const ciphersuiteBytes = new TextEncoder().encode(ciphersuite); + parts.push(ciphersuiteBytes); + + // Server EC public key + parts.push(serverEcPublicKey); + + // Client ephemeral EC public key + parts.push(clientEphemeralEcPublicKey); + + // SHA-256 hash of ML-KEM ciphertext + parts.push(mlKemCiphertextHash); + + // Protocol version (single byte) + parts.push(new Uint8Array([version])); + + // Concatenate all parts + return concatUint8Arrays(...parts); +} + +/** + * Validates context info parameters + * @param serverEcPublicKey - Server's EC public key + * @param clientEphemeralEcPublicKey - Client's ephemeral EC public key + * @param mlKemCiphertextHash - SHA-256 hash of ML-KEM ciphertext + * @throws Error if parameters are invalid + */ +export function validateContextInfoParams( + serverEcPublicKey: Uint8Array, + clientEphemeralEcPublicKey: Uint8Array, + mlKemCiphertextHash: Uint8Array +): void { + if (serverEcPublicKey.length !== EC_PUBLIC_KEY_LENGTH) { + throw new Error(`Invalid server EC public key length: ${serverEcPublicKey.length}, expected ${EC_PUBLIC_KEY_LENGTH}`); + } + + if (clientEphemeralEcPublicKey.length !== EC_PUBLIC_KEY_LENGTH) { + throw new Error(`Invalid client EC public key length: ${clientEphemeralEcPublicKey.length}, expected ${EC_PUBLIC_KEY_LENGTH}`); + } + + if (mlKemCiphertextHash.length !== 32) { + throw new Error(`Invalid ML-KEM ciphertext hash length: ${mlKemCiphertextHash.length}, expected 32`); + } +} diff --git a/keeperapi/src/qrc/hpke.ts b/keeperapi/src/qrc/hpke.ts new file mode 100644 index 0000000..1c46939 --- /dev/null +++ b/keeperapi/src/qrc/hpke.ts @@ -0,0 +1,178 @@ +/** + * HPKE (Hybrid Public Key Encryption) implementation + * Combines ECDH-P256 and ML-KEM for quantum-resistant encryption + */ + +import type { MlKemKeyPair, QrcEncryptionResult } from './types'; +import { + Ciphersuite, + MlKemVariant, + getMlKemVariant, + getMlKemCiphertextLength, + QRC_PROTOCOL_VERSION, + AES_KEY_LENGTH, + HKDF_SALT_LENGTH, +} from './constants'; +import { mlKemKeygen, mlKemEncapsulate, mlKemDecapsulate } from './mlkem'; +import { buildContextInfo, validateContextInfoParams } from './context'; +import { concatUint8Arrays } from './utils'; +import { platform } from '../platform'; + +/** + * HPKE implementation with ECDH-P256 and ML-KEM + */ +export class HPKE_ECDH_KYBER { + private readonly ciphersuite: Ciphersuite; + private readonly mlKemVariant: MlKemVariant; + private readonly mlKemCiphertextLength: number; + + /** + * Creates a new HPKE instance + * @param ciphersuite - Ciphersuite to use (defaults to ML-KEM-1024) + */ + constructor(ciphersuite: Ciphersuite = Ciphersuite.HPKE_MLKEM1024_ECDHP256_HKDFSHA256_AESGCM256) { + this.ciphersuite = ciphersuite; + this.mlKemVariant = getMlKemVariant(ciphersuite); + this.mlKemCiphertextLength = getMlKemCiphertextLength(this.mlKemVariant); + } + + /** + * Generates an ML-KEM key pair + * @param seed - Optional seed for deterministic generation (testing only) + * @returns ML-KEM key pair + */ + generateMlKemKeys(seed?: Uint8Array): MlKemKeyPair { + return mlKemKeygen(this.mlKemVariant, seed); + } + + /** + * Encrypts data using hybrid ECDH + ML-KEM approach + * + * @param message - Data to encrypt (e.g., transmission key) + * @param serverEcPublicKey - Server's EC P-256 public key (65 bytes) + * @param serverMlKemPublicKey - Server's ML-KEM public key + * @param optionalData - Optional data for additional security (recommended: 16 bytes) + * @returns Encryption result + */ + async encrypt( + message: Uint8Array, + serverEcPublicKey: Uint8Array, + serverMlKemPublicKey: Uint8Array, + optionalData?: Uint8Array + ): Promise { + // Generate ephemeral ECDH key pair + const ephemeralKeyPair = await platform.generateECKeyPair(); + + // Perform ECDH with server's EC public key + const ecSharedSecret = await platform.ecdhComputeSharedSecret( + ephemeralKeyPair.privateKey, + serverEcPublicKey, + ephemeralKeyPair.publicKey + ); + + // Perform ML-KEM encapsulation + const { ciphertext: mlKemCiphertext, sharedSecret: mlKemSharedSecret } = + mlKemEncapsulate(serverMlKemPublicKey, this.mlKemVariant); + + // Combine both shared secrets (concatenate) + const combinedSecret = concatUint8Arrays(ecSharedSecret, mlKemSharedSecret); + + // Hash the ML-KEM ciphertext for context binding + const mlKemCiphertextHash = await platform.sha256(mlKemCiphertext); + + // Build context info for HKDF + validateContextInfoParams(serverEcPublicKey, ephemeralKeyPair.publicKey, mlKemCiphertextHash); + const contextInfo = buildContextInfo( + this.ciphersuite, + serverEcPublicKey, + ephemeralKeyPair.publicKey, + mlKemCiphertextHash, + QRC_PROTOCOL_VERSION, + optionalData + ); + + // Derive AES key using HKDF + const salt = new Uint8Array(HKDF_SALT_LENGTH); // Empty salt (all zeros) + const aesKey = await platform.hkdf(salt, combinedSecret, contextInfo, AES_KEY_LENGTH); + + // Encrypt data with AES-256-GCM + const encryptedData = await platform.aesGcmEncrypt(message, aesKey); + + // Return encryption result + return { + clientEcPublicKey: ephemeralKeyPair.publicKey, + mlKemEncapsulatedKey: mlKemCiphertext, + encryptedData: encryptedData, + msgVersion: QRC_PROTOCOL_VERSION, + }; + } + + /** + * Decrypts data using hybrid ECDH + ML-KEM approach + * + * @param clientEcPublicKey - Client's ephemeral EC public key (from QrcMessageKey) + * @param mlKemEncapsulatedKey - ML-KEM ciphertext (from QrcMessageKey) + * @param encryptedData - AES-GCM encrypted data (from QrcMessageKey) + * @param msgVersion - Protocol version (from QrcMessageKey) + * @param serverEcPrivateKey - Server's EC private key (32 bytes) + * @param serverEcPublicKey - Server's EC public key (65 bytes) + * @param serverMlKemPrivateKey - Server's ML-KEM private key + * @param optionalData - Optional data used during encryption + * @returns Decrypted plaintext + */ + async decrypt( + clientEcPublicKey: Uint8Array, + mlKemEncapsulatedKey: Uint8Array, + encryptedData: Uint8Array, + msgVersion: number, + serverEcPrivateKey: Uint8Array, + serverEcPublicKey: Uint8Array, + serverMlKemPrivateKey: Uint8Array, + optionalData?: Uint8Array + ): Promise { + // Validate version + if (msgVersion !== QRC_PROTOCOL_VERSION) { + throw new Error(`Unsupported QRC protocol version: ${msgVersion}, expected ${QRC_PROTOCOL_VERSION}`); + } + + // Perform ECDH with client's ephemeral public key + const ecSharedSecret = await platform.ecdhComputeSharedSecret( + serverEcPrivateKey, + clientEcPublicKey, + serverEcPublicKey + ); + + // Perform ML-KEM decapsulation + const mlKemSharedSecret = mlKemDecapsulate( + mlKemEncapsulatedKey, + serverMlKemPrivateKey, + this.mlKemVariant + ); + + // Combine both shared secrets (concatenate) + const combinedSecret = concatUint8Arrays(ecSharedSecret, mlKemSharedSecret); + + // Hash the ML-KEM ciphertext for context binding + const mlKemCiphertextHash = await platform.sha256(mlKemEncapsulatedKey); + + // Build context info for HKDF + validateContextInfoParams(serverEcPublicKey, clientEcPublicKey, mlKemCiphertextHash); + const contextInfo = buildContextInfo( + this.ciphersuite, + serverEcPublicKey, + clientEcPublicKey, + mlKemCiphertextHash, + msgVersion, + optionalData + ); + + // Derive AES key using HKDF + const salt = new Uint8Array(HKDF_SALT_LENGTH); // Empty salt (all zeros) + const aesKey = await platform.hkdf(salt, combinedSecret, contextInfo, AES_KEY_LENGTH); + + // Decrypt data with AES-256-GCM + const plaintext = await platform.aesGcmDecrypt(encryptedData, aesKey); + + return plaintext; + } +} diff --git a/keeperapi/src/qrc/index.ts b/keeperapi/src/qrc/index.ts new file mode 100644 index 0000000..cf3728c --- /dev/null +++ b/keeperapi/src/qrc/index.ts @@ -0,0 +1,50 @@ +/** + * Quantum Resistant Cryptography (QRC) module + * Implements HPKE with ECDH-P256 and ML-KEM for quantum-resistant encryption + */ + +// Main HPKE class +export { HPKE_ECDH_KYBER } from './hpke'; + +// Types +export type { + MlKemKeyPair, + QrcEncryptionResult, + MlKemEncapsulation, +} from './types'; + +// Constants +export { + Ciphersuite, + MlKemVariant, + getMlKemVariant, + getMlKemCiphertextLength, + getMlKemPublicKeyLength, + QRC_PROTOCOL_VERSION, + OPTIONAL_DATA_LENGTH, + ML_KEM_768_CIPHERTEXT_LENGTH, + ML_KEM_1024_CIPHERTEXT_LENGTH, + ML_KEM_768_PUBLIC_KEY_LENGTH, + ML_KEM_1024_PUBLIC_KEY_LENGTH, + EC_PUBLIC_KEY_LENGTH, + EC_PRIVATE_KEY_LENGTH, + AES_KEY_LENGTH +} from './constants'; + +// Utilities +export { + concatUint8Arrays, +} from './utils'; + +// ML-KEM operations +export { + mlKemKeygen, + mlKemEncapsulate, + mlKemDecapsulate +} from './mlkem'; + +// Context info builder +export { + buildContextInfo, + validateContextInfoParams +} from './context'; diff --git a/keeperapi/src/qrc/mlkem.ts b/keeperapi/src/qrc/mlkem.ts new file mode 100644 index 0000000..8e1b83b --- /dev/null +++ b/keeperapi/src/qrc/mlkem.ts @@ -0,0 +1,89 @@ +/** + * ML-KEM (Kyber) operations using @noble/post-quantum + */ + +import * as mlKem from '@noble/post-quantum/ml-kem.js'; +import type { MlKemKeyPair, MlKemEncapsulation } from './types'; +import { MlKemVariant, getMlKemPublicKeyLength } from './constants'; +import { extractRawMlKemPublicKey } from './utils'; + +/** + * Generates an ML-KEM key pair + * @param variant - ML-KEM variant (768, or 1024) + * @param seed - Optional seed for deterministic key generation (for testing) + * @returns ML-KEM key pair + */ +export function mlKemKeygen(variant: MlKemVariant, seed?: Uint8Array): MlKemKeyPair { + let result: { publicKey: Uint8Array; secretKey: Uint8Array }; + + switch (variant) { + case MlKemVariant.ML_KEM_768: + result = seed !== undefined ? mlKem.ml_kem768.keygen(seed) : mlKem.ml_kem768.keygen(); + break; + case MlKemVariant.ML_KEM_1024: + result = seed !== undefined ? mlKem.ml_kem1024.keygen(seed) : mlKem.ml_kem1024.keygen(); + break; + default: + throw new Error(`Unknown ML-KEM variant: ${variant}`); + } + + return { + publicKey: result.publicKey, + privateKey: result.secretKey + }; +} + +/** + * Encapsulates a shared secret using ML-KEM + * @param publicKey - ML-KEM public key (PEM-encoded or raw bytes) + * @param variant - ML-KEM variant + * @returns Encapsulation (ciphertext and shared secret) + */ +export function mlKemEncapsulate( + publicKey: Uint8Array, + variant: MlKemVariant +): MlKemEncapsulation { + // Extract raw public key from PEM format if needed + const expectedLength = getMlKemPublicKeyLength(variant); + const rawPublicKey = extractRawMlKemPublicKey(publicKey, expectedLength); + + let result: { cipherText: Uint8Array; sharedSecret: Uint8Array }; + + switch (variant) { + case MlKemVariant.ML_KEM_768: + result = mlKem.ml_kem768.encapsulate(rawPublicKey); + break; + case MlKemVariant.ML_KEM_1024: + result = mlKem.ml_kem1024.encapsulate(rawPublicKey); + break; + default: + throw new Error(`Unknown ML-KEM variant: ${variant}`); + } + + return { + ciphertext: result.cipherText, + sharedSecret: result.sharedSecret + }; +} + +/** + * Decapsulates a shared secret using ML-KEM + * @param ciphertext - ML-KEM ciphertext + * @param privateKey - ML-KEM private key + * @param variant - ML-KEM variant + * @returns Shared secret + */ +export function mlKemDecapsulate( + ciphertext: Uint8Array, + privateKey: Uint8Array, + variant: MlKemVariant +): Uint8Array { + switch (variant) { + case MlKemVariant.ML_KEM_768: + return mlKem.ml_kem768.decapsulate(ciphertext, privateKey); + case MlKemVariant.ML_KEM_1024: + return mlKem.ml_kem1024.decapsulate(ciphertext, privateKey); + default: + throw new Error(`Unknown ML-KEM variant: ${variant}`); + } +} diff --git a/keeperapi/src/qrc/types.ts b/keeperapi/src/qrc/types.ts new file mode 100644 index 0000000..45675cd --- /dev/null +++ b/keeperapi/src/qrc/types.ts @@ -0,0 +1,37 @@ +/** + * TypeScript type definitions for Quantum Resistant Cryptography (QRC) + */ + +/** + * ML-KEM key pair + */ +export interface MlKemKeyPair { + /** ML-KEM public key (1184 or 1568 bytes depending on variant) */ + publicKey: Uint8Array; + /** ML-KEM private key (2400 or 3168 bytes depending on variant) */ + privateKey: Uint8Array; +} + +/** + * Result of QRC encryption operation + */ +export interface QrcEncryptionResult { + /** Client's ephemeral EC public key */ + clientEcPublicKey: Uint8Array; + /** ML-KEM encapsulated key (ciphertext) */ + mlKemEncapsulatedKey: Uint8Array; + /** AES-GCM encrypted transmission key */ + encryptedData: Uint8Array; + /** Protocol version (currently 1) */ + msgVersion: number; +} + +/** + * ML-KEM encapsulation result + */ +export interface MlKemEncapsulation { + /** Encapsulated key (ciphertext) */ + ciphertext: Uint8Array; + /** Shared secret */ + sharedSecret: Uint8Array; +} diff --git a/keeperapi/src/qrc/utils.ts b/keeperapi/src/qrc/utils.ts new file mode 100644 index 0000000..454af12 --- /dev/null +++ b/keeperapi/src/qrc/utils.ts @@ -0,0 +1,113 @@ +/** + * Utility functions for QRC implementation + * Leverages existing platform utilities where possible + */ + +import { platform } from "../platform"; + +/** + * Concatenates multiple Uint8Arrays into a single Uint8Array + * @param arrays - Arrays to concatenate + * @returns Concatenated array + */ +export function concatUint8Arrays(...arrays: Uint8Array[]): Uint8Array { + // Calculate total length + const totalLength = arrays.reduce((sum, arr) => sum + arr.length, 0); + + // Create result array + const result = new Uint8Array(totalLength); + + // Copy each array into result + let offset = 0; + for (const arr of arrays) { + result.set(arr, offset); + offset += arr.length; + } + + return result; +} + +/** + * Decodes a PEM-encoded key to DER format + * @param pemKey - PEM-encoded key as Uint8Array + * @returns DER-encoded key bytes + */ +function decodePem(pemKey: Uint8Array): Uint8Array { + // Convert to string + const pemString = new TextDecoder().decode(pemKey); + + // Check if it's actually PEM + if (!pemString.includes('-----BEGIN')) { + throw new Error('Invalid PEM format: missing BEGIN header'); + } + + // Extract base64 content between headers + const base64Match = pemString.match(/-----BEGIN [^-]+-----\s*([A-Za-z0-9+/=\s]+)\s*-----END [^-]+-----/); + if (!base64Match) { + throw new Error('Invalid PEM format: could not extract base64 content'); + } + + // Remove whitespace from base64 string + const base64 = base64Match[1].replace(/\s/g, ''); + + // Convert base64 to bytes + return platform.base64ToBytes(base64); +} + +/** + * Extracts raw ML-KEM public key bytes from PEM-encoded SubjectPublicKeyInfo or raw bytes + * + * Expected format: PEM-encoded (-----BEGIN PUBLIC KEY-----) or raw key bytes + * + * The PEM contains DER-encoded SubjectPublicKeyInfo: + * SEQUENCE { + * AlgorithmIdentifier (SEQUENCE with OID), + * BIT STRING containing raw public key + * } + * + * @param keyData - PEM-encoded ML-KEM public key or raw key bytes + * @param expectedRawLength - Expected length of raw key (800, 1184, or 1568 bytes) + * @returns Raw ML-KEM public key bytes + */ +export function extractRawMlKemPublicKey(keyData: Uint8Array, expectedRawLength: number): Uint8Array { + // If the key is already the expected raw length, return it directly + if (keyData.length === expectedRawLength) { + return keyData; + } + + // Otherwise, try to parse it as PEM + const spkiDER = decodePem(keyData); + const spki = parseDER(spkiDER); // SEQUENCE (outer) + const algId = parseDER(spki.data); // SEQUENCE (AlgorithmIdentifier) + const pubKey = parseDER(spki.data, algId.next); // BIT STRING + const rawPublicKey = pubKey.data.subarray(1); // skip unused-bits byte + if (rawPublicKey.length !== expectedRawLength) { + throw new Error(`Extracted key length ${rawPublicKey.length} does not match expected ${expectedRawLength}`); + } + // Ensure we return a proper Uint8Array (not a Buffer subarray if this is node) + return new Uint8Array(rawPublicKey); +} + +type DERElement = { + tag: number; + len: number; + data: Uint8Array; + next: number; +} + +function parseDER(buf: Uint8Array, offset: number = 0): DERElement { + const tag = buf[offset]; + let len = buf[offset + 1]; + let dataOffset = offset + 2; + + if (len & 0x80) { + const lenBytes = len & 0x7f; + len = 0; + for (let i = 0; i < lenBytes; i++) { + len = (len << 8) | buf[offset + 2 + i]; + } + dataOffset += lenBytes; + } + + return { tag, len, data: buf.subarray(dataOffset, dataOffset + len), next: dataOffset + len }; +} diff --git a/keeperapi/src/transmissionKeys.ts b/keeperapi/src/transmissionKeys.ts index 91c1070..86fa37e 100644 --- a/keeperapi/src/transmissionKeys.ts +++ b/keeperapi/src/transmissionKeys.ts @@ -1,6 +1,6 @@ -import { normal64Bytes } from "./utils" +import { MlKemVariant } from "./qrc" -export type AllowedNumbers = +export type AllowedEcKeyIds = | 7 | 8 | 9 @@ -13,7 +13,7 @@ export type AllowedNumbers = | 16 | 17 -export function isAllowedNumber(num:number):num is AllowedNumbers { +export function isAllowedEcKeyId(num:number):num is AllowedEcKeyIds { return num >= 7 && num <= 17 } @@ -37,3 +37,58 @@ export function getKeeperKeys(fct:(source: string) => Uint8Array){ }, []) } +export type AllowedMlKemKeyIds = +| 100 +| 107 +| 124 +| 136 + +export function isAllowedMlKemKeyId(num: number): num is AllowedMlKemKeyIds { + return [100, 107, 124, 136].includes(num) +} + +export function getKeeperMlKemKeyVariant(keyId: AllowedMlKemKeyIds): MlKemVariant { + switch (keyId) { + case 100: + return MlKemVariant.ML_KEM_768 + case 107: + case 124: + case 136: + return MlKemVariant.ML_KEM_1024 + default: + throw new Error(`Unsupported ML-KEM key ID: ${keyId}`) + } +} + +// ML-KEM public keys for QRC encryption +export function getKeeperMlKemKeys(fct: (source: string) => Uint8Array): Uint8Array[] { + const mlKemKeys: Uint8Array[] = []; + + // DEV ML-KEM-768 + mlKemKeys[100] = fct( + "LS0tLS1CRUdJTiBQVUJMSUMgS0VZLS0tLS0KTUlJRXNqQUxCZ2xnaGtnQlpRTUVCQUlEZ2dTaEFLYlFCS0ZSa3JRNkFnTjNvcGhuUXFHREpLZ1VQeDR6YmJYUgp0cDBJSEp1a052R1lIUnUwcVBicGx6YWdFdEJaRkVEQnNucUN6SnlZQ1R3d1JvT1VOaTdNSVJIQU5sRmtmYmt4Clg3S2txSVZHQVRkWVVzU25rcjZNSlNGR3VLMERBQnZtdXdUbVFld0FQU1VoWERIcU1USUpUQm1ScmthV2JSd0YKbVRRaXRLM3FVcXRidHF6bVdxVklCajVFZ0VYb3czMHdVSXNEbEwrSmNnOXp0bzBuVDh6VHBjK2hySFNuTUJraApuUTZZQnJWa1BiYnBXN0puQnlVV2NXT3NZcnJEQkpxWkNMTWtxRS96Qk4zZ1Q4NE1WQXNxaEdGOG5DZ1FiNGhTCmhQclZJanBRUWhGenBIcGtHQzlzVzI5TUxXdFpVbUFUdWl4eFBncGlJTFYxT3R4c0l5OVRtbHdNeFVtVm9KVFcKWXdhN0Z6bTBBamRVZi9Ib29Ba0FxcDRvTkJvUnVSUThUZEUwY2pLckpEaG1OekFKdFhUaVVQZWtTRnM1ZkNsRwpHbXZUR1N6WmM2cEVpbzJHZEpWcVpTemtXNVNwREVGeHBod0Vsc0c1bWR5V05peTFjWVVHZklFZ2hONW9sZ3pZCkRPbURZdUFSQStibkN3K3hjM1FJTnluak9VTWl1TlFndWNKbFBrWEpOQ3dKTGQ4RFR3L0tkUm9ZRWt2VFk1UEIKUDJlYnBPSU1vWUlsakhJRENZQkRKMGlzb2VVaHFvUUxnMzBneUhickR4cXlqQlNTYldsTFpaWEtaandHQndTNgppQzI1WTdNYXNFZFNBZGZxS3FWSlpyZTZ3TkpXRHRvalY4aXhHYVdTWVhSSWFQa2tPdGhaWDRpWmdCSjNzQVRhCmlrbHpZMnNGSFJSSXpkSFJRM1N3R3dYcFNCOElpcyt3TlJPc3ZwQVp4MVpxc1lzNVBvTUJ1Vk0yaGxPVlJaTFUKU29DVlZPWXF4N1RWQU4wVmI3bTZvRFpDdUJWanM2djVEakY4Y2dCN3pLNlJvV2JYSThUcUdUMEdXWXNFQ08vWAplS2lCajJsNXVOcXhST2tTZ0NIVnIyYzZiU016S2pibkVQRjRILzM0b2k4OFFzVGhzbjBHeUtqSmpsSGtnam4zCmcvRjhtd2drVWRVQ3hNMzJ6VWRyZnY4SU1GOWNRQ0tGdFhCeVA3RUhDVzk2YXg5VEZDcU1vRjFhUmt3MkozWXkKWTlWVEliaThOQ3c2RHEwWG5VK1hRWDhvU1RSU0RVVnBnMFIyQTZxNXhrN0NKQ0xFQWFObnBuQVdBK1JpZFhONApSZXBjS1NubUl2R2psRmFXRjZ1S3JoNWNoNW5DakZ1eUJxWkRCTGoyYlN4RUtBYkNYMjlzRlI3d3JabDJWQ2hqCnRTbVhPMVdZYVNSRG9zVXBBVFdhcXBBUnRYTkhYNjZRVmZIR2p4UWNNanoxQ01CWkNJbjZ2UlBKajRrYW0vZ0wKQU80YXZLRUVkeURIbFE5QlJLQU1qS3pDbytyaXV2SktkSXRGbFM3YXFLRWllcUpVaTJVS3RIODNwSTFJVUNDTQp5SERvZE1IMGtzNjdUa1VsdjR1WlJ5K3JkeUpCaWNpaWtxNENMWk5JQWllMmt0TnNLRUFRRzRTMVFrNHhlM0hNCkdsSG9VV2huaWtpRkNWck10OGR6ZGMyVG96eTdaMGNEUmQvWXlrNFZkeUJUdG52NEw0dm1BaTBiRWIwQUxmZUsKSk9GeUdYR1dZT2h4UGR5eW9UUnFJcHBJRkpiN0dLYVJkT2hNdjZtMXRHd0x0K0hFclRQc00wVGlrWGhLanBabQpnNWlKZEk5YWRBNkxyYThrbVdPVEdsK0dUaU0zRXZzY0dwRXFCRG5VTHYrSU5sdkNnSEk3UnQrenQ4dUpzLytxCnZXS3drRGlyZE1ueFY0NUVyejlNang4cGw5WThUcWQ0alJ4ek42TXNvQmkyYXI0a2xjTWt5VDhBVW9saEs0QWsKaERLV3JWMEhYcnFSejFQWFZ6bTVDUkx6ZGU2S3BqNU9ZaTNydktLOGZGNy9SaEl5TDA3dzlFNjNNdWJHbGRwUQpnNUltdVBBVAotLS0tLUVORCBQVUJMSUMgS0VZLS0tLS0K" + ); + + // QA ML-KEM-1024 + mlKemKeys[107] = fct('LS0tLS1CRUdJTiBQVUJMSUMgS0VZLS0tLS0KTUlJR01qQUxCZ2xnaGtnQlpRTUVCQU1EZ2dZaEFLN0VwZURueVNIM3p0QmNhZXFBWUJxaWJaNGpQSHNvWXVaYwpKVG9sV1o4QnE1LzZwMDNJZVgxMnljS1FHNTc2Q0d1bFV0TkRIalVvUWJ3Nk9telNFZGtVYnF1SlpJQjFGelgyCnFlL1pmQ1E0dXNaWlgxU3lrWithYkZheHFsNU1tOFl5Ui9WRFVGaVNxK1U3cTEwWnh2VnBaZE1Wd2d1cWFSemIKTTJkM3V3LzhiZVpCVHRqVXVUMVpmTjdqYWZrS2U0a1FNM0JMWXM3d2VlYVpLd0c4aHBBQUM1UXFyRGtqRDFseQpPZU9McGJmQkZRb0ZOUWtaUEx6TERVcGpSdkpqdHhYQW9OSzVnTzVZelhVa0QwSTBOdDlUU2FnM2tYWlZBR1hKClN2SUpMTjFpaGRBaUxHMVptMDJTQWhYckhlTmdzUFFteDdyR1ZJeXFNbFNBejFhTUJaaDRPOXBISmo2THdjREwKbnJCb04zS0FJL3phQlFKVXNvbDdMNER6VEEzSWpRL21lem9rYVN2bmh1a1JzbEw0WEhaY09wT1JjNDN6V20rVwpZc2ZZUjVLR1laTWh2b2ZYc2MwOGNZSFhydWdEQ3hDcGRrQjdWNmFwWHVNM3BUa29qclpJQXZBVWNqMzR3K1R3CmNLeWJIYnNLRjM5Q3BZdzF6OUhIZ0pqMnpHa2pHbTNqSTl3aVdQRHJoMlRpTWMwQmRpZk1SSndBdmNMamc5aEoKVFhGY2prT3BjaFFybmwzNkh4M0h2NERBQ0dhUUFXVldROGJBZG95d1Z0VlJkY3BMRVc5VEFJejJBUnhWZTJDWQpSOG9qQ04rRlVXejZOYU41YXZiNVB1SzhEOEdGRmcxa0hqdzFKSW1Mc1VFN04rbHNGMVFMV1BsemhmUnpKNUVZCnl0dWJLbGY3c00yd0NCd01uL0VxSmxSMUYrd0xZOGpHTHVkbmQ5NUpCNFlnTzZINmw0OEFTdXZhSFVmQXBNMnAKdm5vQ3BMbEZwWkR5WGcxOGtmd0lhV0lRS204Nm9FQjhPMElhUkdzZ1NFdmNVWEFvc1RqU3hwQ3JaL01TTFB1aAp5b1R3bzB4QXhEZnlJMWNUUGh4R1A2eDZXUDhFbG9tN1RUeER3SUFCTFdVa0NGc295Y2p6RVdFeElDV1JBVkZKCk5ZWXJqWXZ4UllqVE85Y0pDWlhjWjRJcVhWbUhmU2hiZWJJUk1UdUFnTThiWGR6RGs2eDBCQWJsemMraGkrZEgKWWdTYm9xRVVlVUlZQW5YVFhvd0hIcmZGSmRIYmdGN2dzaU5rQTJad2tIOUVUdmUyZldwY0dKWld3T3V4R1RFbgpBYXVyUE5aUUtxbDFqeVRUVmtHMEJGYzRuWm5WdHZHU0cyam1qeXpsTGlLbUNiL3lldEY3aXkzR0QrSWF6QVFECmFyY0FHL3h6WlZ4bWx0T3J5VSs4R3JCRE00UXlsVFVxUmJPRldFakpOYlNFZXNJN0tSbUNVUmhoTzRhWW1nd2oKeWprRVh0dUdOaHp5UkFaalJscGpJMFJDcVdXQ29OcDdGZloxcncxVW9TcUpkU2FXVE5wQ1BRQkVEeUNLUFdZaAp3WlhvZnpwOHAxbkFsUUhaZldiRHBLVHJUQlQyV3FmSUtLS3FqTGRoVHZvS0gwcVJwQlpEYk9OV3VZTVJucWtSCkU0Z2JLR3ZtVGNxcXRzQ1p1KzZpYWtyd3VlS0Jqb3hSUDVueVFSOUNPQldvY3VpcEp2c3lxeVJBTG5vV2xVMTEKUjJwb0NYa3BIeTNwcmQxbFpZRDhHWXpTVEllUmJEUEZ2SzNKUk8vTWlObG1LV1BZdEVZVGlaRFZZZ1JuSitSSwpMNEJFU1R4TEN6dTBnYjRpY0hyWmxFTWxGV3pnTWwrR29QM0FTZG41bEpNRlVMb1ZlajNiSjA2aFgxZG5UTnFiClcwSUhLS2NxYng4b0lJZGJ4YUtER0F5RkFtZTZud1dXTWUyWEpWZE1LSG5DUm80aXZaaW9FNWJwcHg3Wk1kY3cKaEU3VGJtMEdnd0RaS1FKV1pDcmt1TmxuTTFBeE02Y252RHFYbUlHaGVqU0tKYWpSYlA2WllHVllZUGYyUVJDRwpYSnpSbmRiSUc0TjRyZjBaT3hHVnlReHdmK25GcUV2RlZ0Vm5LdTloUWFSUXpsZzRvZ21xY05FSkp3dmFYd2Y0CkZlODV1cHlhY3hVWENKeUtocmpUU1hUSEFtNWp3RmRIQ2djUmtlejN5a3VDZ2k2RXdobkxVdDN5cVJQa1BtU1EKVGNGa2NBZm5LSUhyTG4wSGE5YUNpZDhWeWJjeG5LREN0cC9Ua2dBRXJiZHdQMWZtTDVGVmMyOUdkOWh6QnUvVApZQUFIZ2h2Y1Y1SW5WU3lLY3k3b1lPQUVFVmM2VjMvSUs4dXFnV1ZLYVd6d3E0a2tnYS9ydzVTU0I0ZW9MdS9zCnRYQzR0c3g0cDY0anFCSlRDdDMxaU5TVHV4MUNMY1N3aDY1TXliZUVkamZaemcvSUE2aUN0ZXZqaHZVckxFRFoKWHNlWHRERlpHd0FOQVVkWnArekVrd2IzcjhObFhMRXlhQ01WeENJMHZPMzBiN21uY0t5cXNONXloVGowZ21jNApBdTF4YmM4U0tXczBnaGxvditVVWcxcDBseGl5YnpYQ29YTDRINllKT0kwcUJIUXlDZDlCVkF4Y3g1THJGSjMxClFHMDV3aUZnbUF5bHNwT3h2RzdFWEZXY0RjY0NpZXh0ak0rR3Q4cTVHTHNXaFpoaVYrUkhRaERPQkZuSGhlYTEKVnQyVUxyODYKLS0tLS1FTkQgUFVCTElDIEtFWS0tLS0tCg==') + + // STAGING ML-KEM-1024 + mlKemKeys[124] = fct('LS0tLS1CRUdJTiBQVUJMSUMgS0VZLS0tLS0KTUlJR01qQUxCZ2xnaGtnQlpRTUVCQU1EZ2dZaEFLRGxrU0FJWDVyaFZkRm9oOTBNWnpkVHZOVmFwVkhUemx5YQpzU0Y2U2hTaGNXYUNYeXJoa2owV1E4MjRSV0xzRUhIRGJNTWlaYnpHZEF1UnJqMzhLQmxzajdkaFRqaW5LRFBLCndFZzZhOVpZcnVaMFpvZ1N4U2s4VEJ1cW5IQ0V3K0YyY3NlcEcvQ21XVFo4cnRYcmtrQmhPM1ZaZmd5RE5ja28KdVRDalVTWUZxOXhxVzRTUU5LQ2NaN2NhZjFscFhRSjZoS3RyYnBGcUNvbkl0K0dCQ0laMEhsNXdiWHBGUURORgpPNCt4Y3h4R3VRV2luV3lLVCsrRlFFdTBuTEVqSEVhSmFFRmtySU9YaURqM0FFKzJYTW5GSWJXNG91Nkp1alVCCkVoQ2NZVkhZekZrMHhZbEJoS0VRWUxTV0dPZmNKTWRDTDBHNmxFL0trcE5DSk4zMnJINHlFVUhvVm5pcE91OUMKbnhRYk1CMGFvS3phbU4rOEFsRHpyZzB5bytKcHpxdVlKRUVvcnVlUnIyTTZWRmVKdUdDVE1VVDRLZmtjejJNSgpHN3lyV1NDb0RMQ3pua2RHaGdrd0tYVkFKOXhhTVVEY1lDMUtrRnZtakRjbExSeUxNUFdjRjhaMEFKaEpJbitWCkRZaGd3MzRFbkpwSVNoeXJRdE5CYlVjRFJVWm1tYmkxTUtxNWN1QXlwODM4Q1RpWXp3QXdnMHFhSHBjTVVDT3kKUk5jakdmZjFGc2NFZ0pPUUlCUURWd243bTY3SmV5ZTRvUldzc01mbElWaGxGOXVNUWNseHdMQmx2NFR3RVRqMQpmcS9aUVdKTFdoWkFYMlpxSTRvMFFqdW5kS0JGYzZIeWFaRURJMlpsUk04bWFJaGNOWmlURjZhYUVsbFFmNVJDCnZ5NllyRm1sSms5U2M3YUFEWlMyWEcrWHdaTGFZb1REUU96UndmNHFDblExaGpjV3RKb3JyV2FvVmd6enJQTzQKRHIvRGJ1OUVYUmNhRkJwd2pJQUVNS3h4SzNtMVhXU2doanNYZkgyRHF4bnFCOUpGZ3ZaZ08vdkJpa0tuYkpqbApMVlhNa0U2QXE3RDVGd2I0eW9iNnNIeklxN0k1TzlMb21la0FBWFFjdTQvYkx3c29zbzJsUnlXSWtuMFNRNmpRCmVPejhsYkpJUjkxckp6Nm9YeW5FSzZFeU9xVTV3bUhTWGlSNEtpZ3FkaUFubG1XQ20wVzNpa0RpUC93NW1LZGcKdFFBZFR3ZTV4UTlRRmJyNXhwem5pMmtXaE85b2RYVGNsVUNCY3N5RHNQRm1OdVBnZjROU1YxSnNtb2tGT003NgpLQmlaUXE1cHVwL3pEZCtydEVkbk1Gc0tmUlkwUEcxakdBcmFtMGw3Y0xha0t6TkR5Q2g4YlhsS3FrdXBGcG81CnN1LzRUMU1HRzJJaExNeGltQ04zeFEraHk3cllwdkR5RW9lc2c1WDVjTTRXbVR1Q28zc0dITkUzU3FiSHJaangKZlFMQVU1UVhJajhwVHV1cFBZaEp3c0NBWUIwcXJRNjJsRkRWVVd6V2xNLzFVb3NWZjdoQ1BHYjZBYzRSTVZzTAp4OVljUXRNa1hTckpHZlJuWWxNNVh2b2dFZUdBVU5LSWx6L0xneFFveGU2b1AvNUJ3RGo3VmdZeW96ZDdWOEFwCnNDWjdjTVZFY1d6UUJhbWhrbktpVXNCcEVKUmh6bHZ4UzVVWkdUb0RmODdhUThpc2VFNjZ1RW9EbmZpaFlnSG4KdEJvS1J2VUtLdFAzeDJDWXVsN0NuUzRsekhlV1UxQUZxSkFwT0ZhR1hpV0RXTytXZUc1R1JSSUp3bk9Ub3hieQpaaXNEYzFyN3VmM25lVUtJaThYZ0ZuYWJNcUJreXNhN2lVZlZSd3FqRnBHWW5rNTdmclVCalY2bk10bWFuTnB3CmMvSnJwTllJelplcmRuR1RyNXdBbWx1SnpjWVdKVXloemVQY3d5ejJKbGMwRk8yQUJIUzFQclNNYi95QmpodmIKcFNvVVhhR0FxellEaUowRmFlOHlWRWxTRlE2Q3ZZNXNjYTdyVE1zcGRNVzNyQWZKV0hnRHUzK1F3cmpoZVVwSwp1Q2d4ekdOaGdLTnN5eUJ5WXVKVWU1azRxeW9BcGNnVkZBUzJTUUVFbmdLNHA1OGtSc3RtUFdnYm5CMjNhcjU2CnFvd1lCVjV4UTJTMnJIZzd0R3pBQnJGVFM2aHpGSDJncXVaNFIxQXlIdnFRV2pMaHBxdmFUR3pLZFpEVUkvRVgKaVZSS2dTd0l0bVhFZFVIaXZNN3NzUGZDUmVIQ3dMMlNmZHp6V1puVHZPMUpxUVZDUys5a2w1aWxDWmMyYlJkcApabXRVR284R0FqazVja0hEVDkzSkhkeW9yZEZZbndqMWNTV3FvOFFneTU0WW1rQWdDeXhXWndPMUxoL0JSRm5pCldYYWNzV0JEcXN6c0FOVUt1eVkyR0hWaWZxRkVud3hwZW5ZRHhhU0pGYmRvZCt4UlE4K0lUZ3N6UGtpSUtwUksKcUFPcXhnd2dGcTcwcjRyM3JKUUZWRWRvZzRwU3NwYVNvbFB5dG85b1NoWjJld2RFTC9xeGZybEJCeHZtV002RApwcENKZ0szWG1yOVl1MVBrdUEyVXJoRFNaenVEWXNDcGNzWEFINjNIZnhtQ0JxSlZtdWFRenlITFZjSTZtMUxZClJzYzdwSWhwTHUrckxuNnJ0bjBYVDJyaXk3akhVNTMrcjF6ZEUwYVBrVDIzL0JxNG8wb3ZWRGZ1ZGpsT3hPd3UKNmxDU3hNWlkKLS0tLS1FTkQgUFVCTElDIEtFWS0tLS0tCg==') + + // PROD ML-KEM-1024 + mlKemKeys[136] = fct('LS0tLS1CRUdJTiBQVUJMSUMgS0VZLS0tLS0KTUlJR01qQUxCZ2xnaGtnQlpRTUVCQU1EZ2dZaEFCZlJTaTlXaEttekRMR2toL2lJTnhEbXRheVZIUzliendGeApOOEhCVXFXOFBNbElDTnpWbTBuRFAwdDRhTnhFRmNYYmtvMHdWbjZYRzdGYlpNZW5PVUdybEdGY2Q2N2NlVzRJCkRLL2xmeWtrd3VVWUdLWkNHY0Iwa3FNYUR2ajFXcGpscVp4aW16UUxGYkprRm5QRm92Q1RFQnd4Wis3c09hVlQKR1ZoS3VialNVU3dDcjZwVmFPRk1kWFUwaUdrSUxBWHl6YjJHVHZhaGFYTzF3cFdsUGpZWHgzbkRadDRSQjBJSgpwWXNjYk5CMnprS3BvdmRHS3dtY0V0NXBJeFlMd0RXcms1b1V4WXJsbTRLRkc5eEZvV3JyR3M1VU53T2JabzhrClVadkNFcDRsYXdwanEyeE12dmRxbnRzMnJCTXN5K0pxWFZsRFk4d2tBdXFxeW5PQ244aDJpWWNIV3FxSEdLZFYKWnNCSmtxNW5iK2J5cVI2RWhuQUdSQWpEaFVGUkRicmhGNVhMQnU1R0JEcHhKOUpaWlpZRGsyMmNEYkt5S1ZZeAp3Q2hpU0dqZ284VHJIT09uUWRWNk14MExtYlAwSTJVYVNoRDdDU1kzRGQyRmNJSldnN2l3ZDE0SFlyUkNTZGFKCksxbUlBdUhvUjZwQ21Ha2txRS93VTRlbnZJNm5yR0tSZVVqb3hqTFFFdEtZbVJ2OHhsOFlHTGdtbVZGS2JXaW8KdGhYY243WDRBaVJMU3hmWnhhelNQeGpxTEEzTW5RUVZ0bWRMRVg5V2xBNHlONXlTcnpEYUpDRTBPKzUwUjQvTQpvNkhoSVF3R2Vuclp2bzB3d2tUaHlIajZLSTREc0tVWWt5VWNYZ0Vjdlp2WXRnVmhtYnFLdmQzbGNjN2pML1oyCnhVK1RaS2NjS05XSnl0S2dJYWVnSzVDMG9WeURNdTNaQzBFVkZiVmFpb0Q1ZHBjbGNLb2xrbXN6UDdkaXBnTW0KUFMyQ2ZjUWlNVlRTVkFyemEyY3hDNnlMQ1hVVWF2UW5kQ2dZYmhKc1ZNQmd3OU5hamMxVG5KWU1KOGtBekpregpSN1owdU9vbkY5UUpROEpLdDFkMnRjUTRSZGVFak1GV1N4NUlzWThxTUZSaWhhQkxNSGVsTWRoZ0d1VGxmdkNUCmcxbFJzWVNJTFZiS1daSldyclh4akpWMFpmYklmRklndXQzY3FLN0R4NmZFS3l1N2dhZG1RSVpKa0F4U0s2ME0KblZJV0pJRkxSQU53UGNZYUhXam12VjhtZWhsVnhSQXdkVU40cll0Z1pLR2dXWEN5SGZERW9JMm9UbE02dUdHRApFOUpzRC9xS3hKSUxvNzlnWVVwckxoWkFycnBwTEVzVkRzNlltdmVwYkg2V3pmdnJyYklpSVpxb0p2YXpQVFFICkkrWmpHd3NITHJtQVcyajRWdkVJd0lXTGY5cmd1ZDNCQ3VBVk1ZTUZEZnNnbnpLaG1jTzFwU0pYcHJsRWVjekEKSkxFOGxqN0t2SHJIWHg1MXYwUGxvZkxJVXppVUVRODVMNk9DbFFZeUNxRHlUenNDcHFQMUw5TklDSXNBZWZZcApwMElSSnV6R01sdWJMblRaQTVjRVk3UDNvYldGVTRJbGNvZ1VTaDk2eWxaaVVGMGdHNUZWYm1uY2pHUzBNdWtwCkZyMjVxWHBGTThJQWhIV0dZN056SU9yMXdZaUJtZW1Kdml1MmJLK3dzMjVnbHEzR1c1WW54YXpoQ0JHb0ZlNFIKbThuaFppS1dmclZjRlJJNEtVenl3RzZzWDI3Y2h6YnJpdGtjVGVUVEM4TzFjY3lTVXprOEwzWFpQVGt6U1pOawpPV3pHU1hmb051ZkdqbFBxcGcyZ1NNbUdqN2g2VXY5NUk0TkxQR1Z4dE1QRERtUmpkdm5tcXZHMWtkMDJ4WGZyCm83STBkckVwR0ZYbUJuRWllbDc3UmUxTFZ5K3dueE5ybzBUSGZKUDVWdXJXdzJlTGdOZXdiOWwxWnFOWEZoRFcKSXN0bGVRbHlaT0ZKdmFrV3JZWmNVYlk3SW56MnJKR01kdWt3dHNoWldEWENmdXdzQ3NGMGI0T0ZGakVtTnA0RAplZDBWQ1lvS0VQTnBZdVk3SDkxN1VNQVNMZWZFTXVzWlU4dzBrOWJISDB6cnNuUHdNSWk0Q2hBamdtTVVrNHBvCnF1S2pyN013U2Fmd0FCeGpSM1Y3SUtNWWs1WkRReStrQ0MvcVNBM0x0KytLSk0rcHVYdUxkdk1NRm9nMWo0VnIKdGNBQlpxZExiQ3ZEUG5mbWVGRldQQlptQjYySUdEWndPNHRZeDFJc0dJbzRScGNsZHlsSWxvYWpzWWhuemVDMgpFWENTb3RMNXBWS01mZSt4ZDhxa2ZRVERHc2lIYmg4NHE3QWt1a3FnbkZ0M1diSkZHNVBZeWl5d2EvUHlIWnJtCnFHUlRScDVsQUVMbkRyQjNHdXFxVE41NmZwRlpDUHc1ZktJUUJuRGpwUTFvVTYvZ2htbDNIZDhTZXQwRUJqQzIKRVJTWXE1RkREOXVxcnVvYW00WkxtVjRqdTlkcFdsK01tM1ZIWnNYWHRocEpnNXk4czRXRGtFa2xJakpndzJJSgpvMjFITnhnbkZhd2tSNXJHeVU4cEt1cDNrQWZ5bzlaVGhaUUdyWHVFUTFQeXhsOGxzYVNKcmtLUndxakdzeWFWCmdxUGhtcmdBZ1VnWVJRN25LTDh5bTE0M25iT21hYXQ1UVN2MC9SR2o3eGdFZytoVHR0NnIvaDhWQk1oNEoxdmwKWkI0VllxNU8KLS0tLS1FTkQgUFVCTElDIEtFWS0tLS0tCg==') + + // GOV DEV ML-KEM-1024 + // mlKemKeys[148] = fct('...') + + // GOV ML-KEM-1024 + // mlKemKeys[160] = fct('...') + // + // IL5 DEV ML-KEM-1024 + // mlKemKeys[172] = fct('...') + + // IL5 ML-KEM-1024 + // mlKemKeys[186] = fct('...') + + return mlKemKeys; +} diff --git a/keeperapi/src/utils.ts b/keeperapi/src/utils.ts index 92fb584..94d2a4f 100644 --- a/keeperapi/src/utils.ts +++ b/keeperapi/src/utils.ts @@ -1,6 +1,7 @@ import {KeyWrapper, LogOptions, Platform, platform} from "./platform"; -import type {KeeperHost, TransmissionKey} from './configuration'; -import { AllowedNumbers } from "./transmissionKeys"; +import type {KeeperHost, TransmissionKey, TransmissionKeyHpke} from './configuration'; +import { AllowedEcKeyIds, AllowedMlKemKeyIds, getKeeperMlKemKeyVariant, isAllowedEcKeyId, isAllowedMlKemKeyId } from "./transmissionKeys"; +import { Ciphersuite, HPKE_ECDH_KYBER, MlKemVariant, OPTIONAL_DATA_LENGTH } from "./qrc"; export const log = (message: string, options: LogOptions = 'default') => { platform.log(message, options) @@ -44,15 +45,76 @@ export function getKeeperAutomatorAdminUrl(host: KeeperHost, forPath: string, au } } -export async function generateTransmissionKey(keyNumber: AllowedNumbers): Promise { +export async function generateTransmissionKey(ecKeyId: AllowedEcKeyIds, mlKemKeyId: AllowedMlKemKeyIds): Promise { const transmissionKey = platform.getRandomBytes(32) return { - publicKeyId: keyNumber, + ecKeyId, key: transmissionKey, - encryptedKey: await platform.publicEncryptEC(transmissionKey, platform.keys[keyNumber]) + ecEncryptedKey: await platform.publicEncryptEC(transmissionKey, platform.keys[ecKeyId]), + mlKemKeyId } } +export async function generateHpkeTransmissionKey( + transmissionKey: TransmissionKey, + useOptionalData: boolean = true +): Promise { + // Validate and get server public keys + const {ecKeyId, mlKemKeyId} = transmissionKey + if (!isAllowedEcKeyId(ecKeyId)) { + throw new Error(`Invalid EC key ID: ${ecKeyId}`) + } + if (!isAllowedMlKemKeyId(mlKemKeyId)) { + throw new Error(`Invalid ML-KEM key ID: ${mlKemKeyId}`) + } + const serverEcPublicKey = platform.keys[ecKeyId] + const serverMlKemPublicKey = platform.mlKemKeys[mlKemKeyId] + if (!serverEcPublicKey) { + throw new Error(`EC public key not found for ID: ${ecKeyId}`) + } + if (!serverMlKemPublicKey) { + throw new Error(`ML-KEM public key not found for ID: ${mlKemKeyId}`) + } + + // Generate optional data if requested (recommended for unique request binding) + const optionalData = useOptionalData ? platform.getRandomBytes(OPTIONAL_DATA_LENGTH) : undefined; + + // Initialize HPKE with appropriate ciphersuite + const mlKemVariant = getKeeperMlKemKeyVariant(mlKemKeyId); + let hpke: HPKE_ECDH_KYBER; + switch (mlKemVariant) { + case MlKemVariant.ML_KEM_768: + hpke = new HPKE_ECDH_KYBER(Ciphersuite.HPKE_MLKEM768_ECDHP256_HKDFSHA256_AESGCM256); + break; + case MlKemVariant.ML_KEM_1024: + hpke = new HPKE_ECDH_KYBER(Ciphersuite.HPKE_MLKEM1024_ECDHP256_HKDFSHA256_AESGCM256); + break; + default: + throw new Error(`Unsupported ML-KEM variant: ${mlKemVariant}`); + } + + // Encrypt transmission key using QRC + const qrcResult = await hpke.encrypt( + transmissionKey.key, + serverEcPublicKey, + serverMlKemPublicKey, + optionalData + ); + + return { + mlKemKeyId, + key: transmissionKey.key, + qrcMessageKey: { + clientEcPublicKey: qrcResult.clientEcPublicKey, + mlKemEncapsulatedKey: qrcResult.mlKemEncapsulatedKey, + data: qrcResult.encryptedData, + msgVersion: qrcResult.msgVersion, + ecKeyId: ecKeyId + }, + optionalData: optionalData + }; +} + export function webSafe64(source: string): string { return source.replace(/\+/g, '-').replace(/\//g, '_').replace(/=+$/, ''); } diff --git a/keeperapi/tsconfig.json b/keeperapi/tsconfig.json index 94b6a58..199269c 100644 --- a/keeperapi/tsconfig.json +++ b/keeperapi/tsconfig.json @@ -8,7 +8,8 @@ "lib": [ "dom", "esnext" - ] + ], + "skipLibCheck": true }, "include": [ "src/**/*",