diff --git a/example/src/LaunchScreen.tsx b/example/src/LaunchScreen.tsx index fef32a9f..27a387bc 100644 --- a/example/src/LaunchScreen.tsx +++ b/example/src/LaunchScreen.tsx @@ -208,7 +208,7 @@ export default function LaunchScreen( console.log( 'Using network ' + selectedNetwork + - ' and enableAlphaMLS ' + + ' and enableV3 ' + enableGroups ) @@ -224,7 +224,7 @@ export default function LaunchScreen( appVersion, preCreateIdentityCallback, preEnableIdentityCallback, - enableAlphaMls: enableGroups === 'true', + enableV3: enableGroups === 'true', dbEncryptionKey, }) ) @@ -243,7 +243,7 @@ export default function LaunchScreen( console.log( 'Using network ' + selectedNetwork + - ' and enableAlphaMLS ' + + ' and enableV3 ' + enableGroups ) const dbEncryptionKey = await getDbEncryptionKey( @@ -258,7 +258,7 @@ export default function LaunchScreen( codecs: supportedCodecs, preCreateIdentityCallback, preEnableIdentityCallback, - enableAlphaMls: enableGroups === 'true', + enableV3: enableGroups === 'true', dbEncryptionKey, }) ) @@ -277,7 +277,7 @@ export default function LaunchScreen( console.log( 'Using network ' + selectedNetwork + - ' and enableAlphaMLS ' + + ' and enableV3 ' + enableGroups ) const dbEncryptionKey = @@ -288,7 +288,7 @@ export default function LaunchScreen( env: selectedNetwork, appVersion, codecs: supportedCodecs, - enableAlphaMls: enableGroups === 'true', + enableV3: enableGroups === 'true', dbEncryptionKey, }) ) diff --git a/example/src/tests/groupTests.ts b/example/src/tests/groupTests.ts index bcc05f18..a73aa79b 100644 --- a/example/src/tests/groupTests.ts +++ b/example/src/tests/groupTests.ts @@ -30,7 +30,7 @@ test('can make a MLS V3 client', async () => { const client = await Client.createRandom({ env: 'local', appVersion: 'Testing/0.0.0', - enableAlphaMls: true, + enableV3: true, }) return true @@ -52,7 +52,7 @@ test('can delete a local database', async () => { client = await Client.createRandom({ env: 'local', appVersion: 'Testing/0.0.0', - enableAlphaMls: true, + enableV3: true, dbEncryptionKey: new Uint8Array([ 233, 120, 198, 96, 154, 65, 132, 17, 132, 96, 250, 40, 103, 35, 125, 64, 166, 83, 208, 224, 254, 44, 205, 227, 175, 49, 234, 129, 74, 252, 135, @@ -85,7 +85,7 @@ test('can make a MLS V3 client with encryption key and database directory', asyn const client = await Client.createRandom({ env: 'local', appVersion: 'Testing/0.0.0', - enableAlphaMls: true, + enableV3: true, dbEncryptionKey: key, dbDirectory: dbDirPath, }) @@ -93,7 +93,7 @@ test('can make a MLS V3 client with encryption key and database directory', asyn const anotherClient = await Client.createRandom({ env: 'local', appVersion: 'Testing/0.0.0', - enableAlphaMls: true, + enableV3: true, dbEncryptionKey: key, }) @@ -109,7 +109,7 @@ test('can make a MLS V3 client with encryption key and database directory', asyn const clientFromBundle = await Client.createFromKeyBundle(bundle, { env: 'local', appVersion: 'Testing/0.0.0', - enableAlphaMls: true, + enableV3: true, dbEncryptionKey: key, dbDirectory: dbDirPath, }) @@ -162,14 +162,14 @@ test('can make a MLS V3 client from bundle', async () => { const client = await Client.createRandom({ env: 'local', appVersion: 'Testing/0.0.0', - enableAlphaMls: true, + enableV3: true, dbEncryptionKey: key, }) const anotherClient = await Client.createRandom({ env: 'local', appVersion: 'Testing/0.0.0', - enableAlphaMls: true, + enableV3: true, dbEncryptionKey: key, }) @@ -184,7 +184,7 @@ test('can make a MLS V3 client from bundle', async () => { const client2 = await Client.createFromKeyBundle(bundle, { env: 'local', appVersion: 'Testing/0.0.0', - enableAlphaMls: true, + enableV3: true, dbEncryptionKey: key, }) @@ -206,7 +206,7 @@ test('can make a MLS V3 client from bundle', async () => { const randomClient = await Client.createRandom({ env: 'local', appVersion: 'Testing/0.0.0', - enableAlphaMls: true, + enableV3: true, dbEncryptionKey: key, }) @@ -230,7 +230,7 @@ test('production MLS V3 client creation throws error', async () => { await Client.createRandom({ env: 'production', appVersion: 'Testing/0.0.0', - enableAlphaMls: true, + enableV3: true, dbEncryptionKey: key, }) // eslint-disable-next-line @typescript-eslint/no-unused-vars @@ -1661,11 +1661,11 @@ test('can read and update group name', async () => { // Commenting this out so it doesn't block people, but nice to have? // test('can stream messages for a long time', async () => { -// const bo = await Client.createRandom({ env: 'local', enableAlphaMls: true }) +// const bo = await Client.createRandom({ env: 'local', enableV3: true }) // await delayToPropogate() -// const alix = await Client.createRandom({ env: 'local', enableAlphaMls: true }) +// const alix = await Client.createRandom({ env: 'local', enableV3: true }) // await delayToPropogate() -// const caro = await Client.createRandom({ env: 'local', enableAlphaMls: true }) +// const caro = await Client.createRandom({ env: 'local', enableV3: true }) // await delayToPropogate() // // Setup stream alls diff --git a/example/src/tests/test-utils.ts b/example/src/tests/test-utils.ts index 41798896..8818c044 100644 --- a/example/src/tests/test-utils.ts +++ b/example/src/tests/test-utils.ts @@ -34,7 +34,7 @@ export async function createClients( clients.push( await Client.createRandom({ env: 'local', - enableAlphaMls: true, + enableV3: true, dbEncryptionKey: keyBytes, }) ) diff --git a/example/src/tests/tests.ts b/example/src/tests/tests.ts index c76afc0b..641ba65d 100644 --- a/example/src/tests/tests.ts +++ b/example/src/tests/tests.ts @@ -348,12 +348,12 @@ test('canMessage', async () => { const caro = await Client.createRandom({ env: 'local', - enableAlphaMls: true, + enableV3: true, dbEncryptionKey: keyBytes, }) const chux = await Client.createRandom({ env: 'local', - enableAlphaMls: true, + enableV3: true, dbEncryptionKey: keyBytes, }) diff --git a/src/index.ts b/src/index.ts index 7ab57618..e292dfdc 100644 --- a/src/index.ts +++ b/src/index.ts @@ -64,7 +64,7 @@ export async function auth( appVersion?: string | undefined, hasCreateIdentityCallback?: boolean | undefined, hasEnableIdentityCallback?: boolean | undefined, - enableAlphaMls?: boolean | undefined, + enableV3?: boolean | undefined, dbEncryptionKey?: Uint8Array | undefined, dbDirectory?: string | undefined ) { @@ -74,7 +74,7 @@ export async function auth( appVersion, hasCreateIdentityCallback, hasEnableIdentityCallback, - enableAlphaMls, + enableV3, dbEncryptionKey ? Array.from(dbEncryptionKey) : undefined, dbDirectory ) @@ -89,7 +89,7 @@ export async function createRandom( appVersion?: string | undefined, hasCreateIdentityCallback?: boolean | undefined, hasEnableIdentityCallback?: boolean | undefined, - enableAlphaMls?: boolean | undefined, + enableV3?: boolean | undefined, dbEncryptionKey?: Uint8Array | undefined, dbDirectory?: string | undefined ): Promise { @@ -98,7 +98,7 @@ export async function createRandom( appVersion, hasCreateIdentityCallback, hasEnableIdentityCallback, - enableAlphaMls, + enableV3, dbEncryptionKey ? Array.from(dbEncryptionKey) : undefined, dbDirectory ) @@ -108,7 +108,7 @@ export async function createFromKeyBundle( keyBundle: string, environment: 'local' | 'dev' | 'production', appVersion?: string | undefined, - enableAlphaMls?: boolean | undefined, + enableV3?: boolean | undefined, dbEncryptionKey?: Uint8Array | undefined, dbDirectory?: string | undefined ): Promise { @@ -116,7 +116,7 @@ export async function createFromKeyBundle( keyBundle, environment, appVersion, - enableAlphaMls, + enableV3, dbEncryptionKey ? Array.from(dbEncryptionKey) : undefined, dbDirectory ) diff --git a/src/lib/Client.ts b/src/lib/Client.ts index f259a157..ce888bf8 100644 --- a/src/lib/Client.ts +++ b/src/lib/Client.ts @@ -120,7 +120,7 @@ export class Client< options.appVersion, Boolean(createSubscription), Boolean(enableSubscription), - Boolean(options.enableAlphaMls), + Boolean(options.enableV3), options.dbEncryptionKey, options.dbDirectory ) @@ -161,7 +161,7 @@ export class Client< options.appVersion, Boolean(createSubscription), Boolean(enableSubscription), - Boolean(options.enableAlphaMls), + Boolean(options.enableV3), options.dbEncryptionKey, options.dbDirectory ) @@ -197,7 +197,7 @@ export class Client< keyBundle, options.env, options.appVersion, - Boolean(options.enableAlphaMls), + Boolean(options.enableV3), options.dbEncryptionKey, options.dbDirectory ) @@ -483,7 +483,7 @@ export type ClientOptions = { /** * Specify whether to enable Alpha version of MLS (Group Chat) */ - enableAlphaMls?: boolean + enableV3?: boolean /** * OPTIONAL specify the encryption key for the database. The encryption key must be exactly 32 bytes. */ @@ -507,7 +507,7 @@ export type KeyType = { export function defaultOptions(opts?: Partial): ClientOptions { const _defaultOptions: ClientOptions = { env: 'dev', - enableAlphaMls: false, + enableV3: false, dbEncryptionKey: undefined, dbDirectory: undefined, }