Skip to content

Commit

Permalink
feat(lib): rename cryptoModule
Browse files Browse the repository at this point in the history
  • Loading branch information
piotr-suwala committed Dec 4, 2023
1 parent 59ae13d commit abd385b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion lib/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ export * from "./timetoken-utils"
export * from "./crypto-utils"
export * from "./constants"

export const PubNubCryptoModule = PubNub.CryptoModule
export const CryptoModule = PubNub.CryptoModule
16 changes: 8 additions & 8 deletions lib/tests/message.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
Message,
MessageDraft,
CryptoUtils,
PubNubCryptoModule,
CryptoModule,
} from "../src"
import {
createChatInstance,
Expand Down Expand Up @@ -936,7 +936,7 @@ describe("Send message test", () => {
const encryptedChat = await createChatInstance({
shouldCreateNewInstance: true,
config: {
cryptoModule: PubNubCryptoModule.aesCbcCryptoModule({ cipherKey: "pubnubenigma" }),
cryptoModule: CryptoModule.aesCbcCryptoModule({ cipherKey: "pubnubenigma" }),
userId: "another-user",
},
})
Expand Down Expand Up @@ -984,7 +984,7 @@ describe("Send message test", () => {
const encryptedChat = await createChatInstance({
shouldCreateNewInstance: true,
config: {
cryptoModule: PubNubCryptoModule.aesCbcCryptoModule({ cipherKey: "pubnubenigma" }),
cryptoModule: CryptoModule.aesCbcCryptoModule({ cipherKey: "pubnubenigma" }),
userId: "another-user",
},
})
Expand Down Expand Up @@ -1024,7 +1024,7 @@ describe("Send message test", () => {
const encryptedChat = await createChatInstance({
shouldCreateNewInstance: true,
config: {
cryptoModule: PubNubCryptoModule.aesCbcCryptoModule({ cipherKey: "pubnubenigma" }),
cryptoModule: CryptoModule.aesCbcCryptoModule({ cipherKey: "pubnubenigma" }),
userId: "another-user",
},
})
Expand Down Expand Up @@ -1075,7 +1075,7 @@ describe("Send message test", () => {
const encryptedChat = await createChatInstance({
shouldCreateNewInstance: true,
config: {
cryptoModule: PubNubCryptoModule.aesCbcCryptoModule({ cipherKey: "pubnubenigma" }),
cryptoModule: CryptoModule.aesCbcCryptoModule({ cipherKey: "pubnubenigma" }),
userId: "another-user",
},
})
Expand Down Expand Up @@ -1128,14 +1128,14 @@ describe("Send message test", () => {
const encryptedChat1 = await createChatInstance({
shouldCreateNewInstance: true,
config: {
cryptoModule: PubNubCryptoModule.aesCbcCryptoModule({ cipherKey: "pubnubenigma" }),
cryptoModule: CryptoModule.aesCbcCryptoModule({ cipherKey: "pubnubenigma" }),
userId: "some-user-1",
},
})
const encryptedChat2 = await createChatInstance({
shouldCreateNewInstance: true,
config: {
cryptoModule: PubNubCryptoModule.aesCbcCryptoModule({ cipherKey: "another-pubnubenigma" }),
cryptoModule: CryptoModule.aesCbcCryptoModule({ cipherKey: "another-pubnubenigma" }),
userId: "some-user-2",
},
})
Expand Down Expand Up @@ -1165,7 +1165,7 @@ describe("Send message test", () => {
chat: encryptedChat2,
message: msg,
decryptor: (encryptedContent) => {
const cryptoModule = PubNubCryptoModule.aesCbcCryptoModule({
const cryptoModule = CryptoModule.aesCbcCryptoModule({
cipherKey: "pubnubenigma",
})
const enc = new TextDecoder("utf-8")
Expand Down
2 changes: 1 addition & 1 deletion samples/react-native-group-chat/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { NavigationContainer } from "@react-navigation/native"
import { createStackNavigator, StackScreenProps } from "@react-navigation/stack"
import { MaterialCommunityIcons } from "@expo/vector-icons"
import { StatusBar } from "expo-status-bar"
import { Channel, Chat, Membership, User, PubNubCryptoModule } from "@pubnub/chat"
import { Channel, Chat, Membership, User } from "@pubnub/chat"
import {
useFonts,
Roboto_400Regular,
Expand Down

0 comments on commit abd385b

Please sign in to comment.