Upgrade Prettier to 2.4.1
This commit is contained in:
parent
f204784afe
commit
5619eeca83
176 changed files with 1961 additions and 2465 deletions
|
@ -18,10 +18,8 @@ export class AbortableProcess<Result> implements IController {
|
|||
private readonly controller: IController,
|
||||
resultPromise: Promise<Result>
|
||||
) {
|
||||
const {
|
||||
promise: abortPromise,
|
||||
reject: abortReject,
|
||||
} = explodePromise<Result>();
|
||||
const { promise: abortPromise, reject: abortReject } =
|
||||
explodePromise<Result>();
|
||||
|
||||
this.abortReject = abortReject;
|
||||
this.resultPromise = Promise.race([abortPromise, resultPromise]);
|
||||
|
|
|
@ -18,11 +18,8 @@ export function arePinnedConversationsEqual(
|
|||
(localPinnedConversation: PinnedConversation, index: number) => {
|
||||
const remotePinnedConversation = remoteValue[index];
|
||||
|
||||
const {
|
||||
contact,
|
||||
groupMasterKey,
|
||||
legacyGroupId,
|
||||
} = localPinnedConversation;
|
||||
const { contact, groupMasterKey, legacyGroupId } =
|
||||
localPinnedConversation;
|
||||
|
||||
if (contact) {
|
||||
return (
|
||||
|
|
|
@ -14,14 +14,14 @@ const STICKER_PATH = 'stickers.noindex';
|
|||
const TEMP_PATH = 'temp';
|
||||
const DRAFT_PATH = 'drafts.noindex';
|
||||
|
||||
const createPathGetter = (subpath: string) => (
|
||||
userDataPath: string
|
||||
): string => {
|
||||
if (!isString(userDataPath)) {
|
||||
throw new TypeError("'userDataPath' must be a string");
|
||||
}
|
||||
return join(userDataPath, subpath);
|
||||
};
|
||||
const createPathGetter =
|
||||
(subpath: string) =>
|
||||
(userDataPath: string): string => {
|
||||
if (!isString(userDataPath)) {
|
||||
throw new TypeError("'userDataPath' must be a string");
|
||||
}
|
||||
return join(userDataPath, subpath);
|
||||
};
|
||||
|
||||
export const getAvatarsPath = createPathGetter(AVATAR_PATH);
|
||||
export const getBadgesPath = createPathGetter(BADGES_PATH);
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
// Copyright 2021 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
export async function awaitObject<Result extends { [key: string]: unknown }>(
|
||||
settings: {
|
||||
[key in keyof Result]: Promise<Result[key]>;
|
||||
}
|
||||
): Promise<Result> {
|
||||
export async function awaitObject<
|
||||
Result extends { [key: string]: unknown }
|
||||
>(settings: {
|
||||
[key in keyof Result]: Promise<Result[key]>;
|
||||
}): Promise<Result> {
|
||||
const keys = Object.keys(settings);
|
||||
const promises = new Array<Promise<unknown>>();
|
||||
for (const key of keys) {
|
||||
|
|
|
@ -16,10 +16,14 @@ const CJK_Strokes = /[\u31C0-\u31EF]/;
|
|||
const CJK_Symbols_And_Punctuation = /[\u3000-\u303F]/;
|
||||
const CJK_Unified_Ideographs = /[\u4E00-\u9FFF]/;
|
||||
const CJK_Unified_Ideographs_Extension_A = /[\u3400-\u4DBF]/;
|
||||
const CJK_Unified_Ideographs_Extension_B = /[\uD840-\uD868][\uDC00-\uDFFF]|\uD869[\uDC00-\uDEDF]/;
|
||||
const CJK_Unified_Ideographs_Extension_C = /\uD869[\uDF00-\uDFFF]|[\uD86A-\uD86C][\uDC00-\uDFFF]|\uD86D[\uDC00-\uDF3F]/;
|
||||
const CJK_Unified_Ideographs_Extension_D = /\uD86D[\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1F]/;
|
||||
const CJK_Unified_Ideographs_Extension_E = /\uD86E[\uDC20-\uDFFF]|[\uD86F-\uD872][\uDC00-\uDFFF]|\uD873[\uDC00-\uDEAF]/;
|
||||
const CJK_Unified_Ideographs_Extension_B =
|
||||
/[\uD840-\uD868][\uDC00-\uDFFF]|\uD869[\uDC00-\uDEDF]/;
|
||||
const CJK_Unified_Ideographs_Extension_C =
|
||||
/\uD869[\uDF00-\uDFFF]|[\uD86A-\uD86C][\uDC00-\uDFFF]|\uD86D[\uDC00-\uDF3F]/;
|
||||
const CJK_Unified_Ideographs_Extension_D =
|
||||
/\uD86D[\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1F]/;
|
||||
const CJK_Unified_Ideographs_Extension_E =
|
||||
/\uD86E[\uDC20-\uDFFF]|[\uD86F-\uD872][\uDC00-\uDFFF]|\uD873[\uDC00-\uDEAF]/;
|
||||
const Enclosed_CJK_Letters_And_Months = /[\u3200-\u32FF]/;
|
||||
const Kangxi_Radicals = /[\u2F00-\u2FDF]/;
|
||||
const Ideographic_Description_Characters = /[\u2FF0-\u2FFF]/;
|
||||
|
@ -33,7 +37,8 @@ const Hangul_Jamo_Extended_B = /[\uD7B0-\uD7FF]/;
|
|||
const Hangul_Syllables = /[\uAC00-\uD7AF]/;
|
||||
|
||||
// From https://github.com/mathiasbynens/unicode-12.1.0/tree/master/Binary_Property/Ideographic
|
||||
const isIdeographic = /[\u3006\u3007\u3021-\u3029\u3038-\u303A\u3400-\u4DB5\u4E00-\u9FEF\uF900-\uFA6D\uFA70-\uFAD9]|[\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD821[\uDC00-\uDFF7]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDD70-\uDEFB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]/;
|
||||
const isIdeographic =
|
||||
/[\u3006\u3007\u3021-\u3029\u3038-\u303A\u3400-\u4DB5\u4E00-\u9FEF\uF900-\uFA6D\uFA70-\uFAD9]|[\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD821[\uDC00-\uDFF7]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDD70-\uDEFB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]/;
|
||||
|
||||
export function combineNames(
|
||||
given?: string,
|
||||
|
|
|
@ -133,13 +133,11 @@ type ValuesWithSetters = Omit<
|
|||
| 'mediaCameraPermissions'
|
||||
>;
|
||||
|
||||
export type IPCEventGetterType<
|
||||
Key extends keyof IPCEventsValuesType
|
||||
> = `get${Capitalize<Key>}`;
|
||||
export type IPCEventGetterType<Key extends keyof IPCEventsValuesType> =
|
||||
`get${Capitalize<Key>}`;
|
||||
|
||||
export type IPCEventSetterType<
|
||||
Key extends keyof IPCEventsValuesType
|
||||
> = `set${Capitalize<Key>}`;
|
||||
export type IPCEventSetterType<Key extends keyof IPCEventsValuesType> =
|
||||
`set${Capitalize<Key>}`;
|
||||
|
||||
export type IPCEventsGettersType = {
|
||||
[Key in keyof ValuesWithGetters as IPCEventGetterType<Key>]: () => ValuesWithGetters[Key];
|
||||
|
@ -214,11 +212,8 @@ export function createIPCEvents(
|
|||
|
||||
// Getters only
|
||||
getAvailableIODevices: async () => {
|
||||
const {
|
||||
availableCameras,
|
||||
availableMicrophones,
|
||||
availableSpeakers,
|
||||
} = await calling.getAvailableIODevices();
|
||||
const { availableCameras, availableMicrophones, availableSpeakers } =
|
||||
await calling.getAvailableIODevices();
|
||||
|
||||
return {
|
||||
// mapping it to a pojo so that it is IPC friendly
|
||||
|
@ -352,7 +347,8 @@ export function createIPCEvents(
|
|||
await universalExpireTimer.set(newValue);
|
||||
|
||||
// Update account in Storage Service
|
||||
const conversationId = window.ConversationController.getOurConversationIdOrThrow();
|
||||
const conversationId =
|
||||
window.ConversationController.getOurConversationIdOrThrow();
|
||||
const account = window.ConversationController.get(conversationId);
|
||||
assert(account, "Account wasn't found");
|
||||
|
||||
|
|
|
@ -16,14 +16,8 @@ export async function encryptProfileData(
|
|||
conversation: ConversationType,
|
||||
avatarBuffer?: Uint8Array
|
||||
): Promise<[ProfileRequestDataType, Uint8Array | undefined]> {
|
||||
const {
|
||||
aboutEmoji,
|
||||
aboutText,
|
||||
familyName,
|
||||
firstName,
|
||||
profileKey,
|
||||
uuid,
|
||||
} = conversation;
|
||||
const { aboutEmoji, aboutText, familyName, firstName, profileKey, uuid } =
|
||||
conversation;
|
||||
|
||||
assert(profileKey, 'profileKey');
|
||||
assert(uuid, 'uuid');
|
||||
|
|
|
@ -36,11 +36,11 @@ export function getCollisionsFromMemberships(
|
|||
// Alternatively, we could filter undefined keys or something like that.
|
||||
//
|
||||
// [0]: https://www.typescriptlang.org/play?#code/C4TwDgpgBAYg9nKBeKAFAhgJ2AS3QGwB4AlCAYzkwBNCBnYTHAOwHMAaKJgVwFsAjCJgB8QgNwAoCk3pQAZgC5YCZFADeUABY5FAVigBfCeNCQoAISwrSFanQbN2nXgOESpMvoouYVs0UA
|
||||
return (pickBy(
|
||||
return pickBy(
|
||||
groupedByTitle,
|
||||
group =>
|
||||
group.length >= 2 && !group.every(person => isInSystemContacts(person))
|
||||
) as unknown) as GroupNameCollisionsWithConversationsByTitle;
|
||||
) as unknown as GroupNameCollisionsWithConversationsByTitle;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -36,7 +36,11 @@ export async function handleImageAttachment(
|
|||
processedFile = new Blob([convertedFile]);
|
||||
}
|
||||
|
||||
const { contentType, file: resizedBlob, fileName } = await autoScale({
|
||||
const {
|
||||
contentType,
|
||||
file: resizedBlob,
|
||||
fileName,
|
||||
} = await autoScale({
|
||||
contentType: isHeic(file.type) ? IMAGE_JPEG : stringToMIMEType(file.type),
|
||||
fileName: file.name,
|
||||
file: processedFile,
|
||||
|
|
|
@ -358,9 +358,10 @@ async function maybeAddSenderKeyDistributionMessage({
|
|||
|
||||
const senderKeyInfo = conversation.get('senderKeyInfo');
|
||||
if (senderKeyInfo && senderKeyInfo.distributionId) {
|
||||
const senderKeyDistributionMessage = await window.textsecure.messaging.getSenderKeyDistributionMessage(
|
||||
senderKeyInfo.distributionId
|
||||
);
|
||||
const senderKeyDistributionMessage =
|
||||
await window.textsecure.messaging.getSenderKeyDistributionMessage(
|
||||
senderKeyInfo.distributionId
|
||||
);
|
||||
|
||||
return {
|
||||
contentProto: {
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
// Copyright 2018-2020 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
const DANGEROUS_FILE_TYPES = /\.(ADE|ADP|APK|BAT|CAB|CHM|CMD|COM|CPL|DIAGCAB|DLL|DMG|EXE|HTA|INF|INS|ISP|JAR|JS|JSE|LIB|LNK|MDE|MHT|MSC|MSI|MSP|MST|NSH|PIF|PS1|PSC1|PSM1|PSRC|REG|SCR|SCT|SETTINGCONTENT-MS|SHB|SYS|VB|VBE|VBS|VXD|WSC|WSF|WSH)\.?$/i;
|
||||
const DANGEROUS_FILE_TYPES =
|
||||
/\.(ADE|ADP|APK|BAT|CAB|CHM|CMD|COM|CPL|DIAGCAB|DLL|DMG|EXE|HTA|INF|INS|ISP|JAR|JS|JSE|LIB|LNK|MDE|MHT|MSC|MSI|MSP|MST|NSH|PIF|PS1|PSC1|PSM1|PSRC|REG|SCR|SCT|SETTINGCONTENT-MS|SHB|SYS|VB|VBE|VBS|VXD|WSC|WSF|WSH)\.?$/i;
|
||||
|
||||
export function isFileDangerous(fileName: string): boolean {
|
||||
return DANGEROUS_FILE_TYPES.test(fileName);
|
||||
|
|
|
@ -4,9 +4,8 @@
|
|||
export function isWindowDragElement(el: Readonly<Element>): boolean {
|
||||
let currentEl: Element | null = el;
|
||||
do {
|
||||
const appRegion = getComputedStyle(currentEl).getPropertyValue(
|
||||
'-webkit-app-region'
|
||||
);
|
||||
const appRegion =
|
||||
getComputedStyle(currentEl).getPropertyValue('-webkit-app-region');
|
||||
switch (appRegion) {
|
||||
case 'no-drag':
|
||||
return false;
|
||||
|
|
|
@ -10698,7 +10698,7 @@
|
|||
{
|
||||
"rule": "React-createRef",
|
||||
"path": "ts/components/conversation/Message.tsx",
|
||||
"line": " public reactionsContainerRef: React.RefObject<HTMLDivElement> = React.createRef();",
|
||||
"line": " React.createRef();",
|
||||
"reasonCategory": "usageTrusted",
|
||||
"updated": "2021-03-05T19:57:01.431Z",
|
||||
"reasonDetail": "Used for detecting clicks outside reaction viewer"
|
||||
|
|
|
@ -43,5 +43,5 @@ export function memoizeByRoot<F extends Function>(
|
|||
return partial(...rest);
|
||||
};
|
||||
|
||||
return (wrap as unknown) as F;
|
||||
return wrap as unknown as F;
|
||||
}
|
||||
|
|
|
@ -12,7 +12,8 @@ import { escapeRegExp } from 'lodash';
|
|||
export const APP_ROOT_PATH = pathJoin(__dirname, '..', '..');
|
||||
|
||||
const PHONE_NUMBER_PATTERN = /\+\d{7,12}(\d{3})/g;
|
||||
const UUID_PATTERN = /[0-9A-F]{8}-[0-9A-F]{4}-4[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{9}([0-9A-F]{3})/gi;
|
||||
const UUID_PATTERN =
|
||||
/[0-9A-F]{8}-[0-9A-F]{4}-4[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{9}([0-9A-F]{3})/gi;
|
||||
const GROUP_ID_PATTERN = /(group\()([^)]+)(\))/g;
|
||||
const GROUP_V2_ID_PATTERN = /(groupv2\()([^=)]+)(=?=?\))/g;
|
||||
const REDACTION_PLACEHOLDER = '[REDACTED]';
|
||||
|
|
|
@ -96,9 +96,8 @@ export async function sendToGroup({
|
|||
const recipients = getRecipients(groupSendOptions);
|
||||
|
||||
// First, do the attachment upload and prepare the proto we'll be sending
|
||||
const protoAttributes = window.textsecure.messaging.getAttrsFromGroupOptions(
|
||||
groupSendOptions
|
||||
);
|
||||
const protoAttributes =
|
||||
window.textsecure.messaging.getAttrsFromGroupOptions(groupSendOptions);
|
||||
const contentMessage = await window.textsecure.messaging.getContentMessage(
|
||||
protoAttributes
|
||||
);
|
||||
|
@ -145,7 +144,8 @@ export async function sendContentMessageToGroup({
|
|||
'sendContentMessageToGroup: textsecure.messaging not available!'
|
||||
);
|
||||
|
||||
const ourConversationId = window.ConversationController.getOurConversationIdOrThrow();
|
||||
const ourConversationId =
|
||||
window.ConversationController.getOurConversationIdOrThrow();
|
||||
const ourConversation = window.ConversationController.get(ourConversationId);
|
||||
|
||||
if (
|
||||
|
@ -260,9 +260,8 @@ export async function sendToGroupViaSenderKey(options: {
|
|||
'sendToGroupViaSenderKey: textsecure.messaging not available!'
|
||||
);
|
||||
|
||||
const {
|
||||
attributes,
|
||||
}: { attributes: ConversationAttributesType } = conversation;
|
||||
const { attributes }: { attributes: ConversationAttributesType } =
|
||||
conversation;
|
||||
|
||||
// 1. Add sender key info if we have none, or clear out if it's too old
|
||||
const THIRTY_DAYS = 30 * DAY;
|
||||
|
@ -288,13 +287,11 @@ export async function sendToGroupViaSenderKey(options: {
|
|||
|
||||
// 2. Fetch all devices we believe we'll be sending to
|
||||
const ourUuid = window.textsecure.storage.user.getCheckedUuid();
|
||||
const {
|
||||
devices: currentDevices,
|
||||
emptyIdentifiers,
|
||||
} = await window.textsecure.storage.protocol.getOpenDevices(
|
||||
ourUuid,
|
||||
recipients
|
||||
);
|
||||
const { devices: currentDevices, emptyIdentifiers } =
|
||||
await window.textsecure.storage.protocol.getOpenDevices(
|
||||
ourUuid,
|
||||
recipients
|
||||
);
|
||||
|
||||
// 3. If we have no open sessions with people we believe we are sending to, and we
|
||||
// believe that any have signal accounts, fetch their prekey bundle and start
|
||||
|
@ -317,11 +314,8 @@ export async function sendToGroupViaSenderKey(options: {
|
|||
`sendToGroupViaSenderKey/${logId}: expect senderKeyInfo`
|
||||
);
|
||||
// Note: From here on, we will need to recurse if we change senderKeyInfo
|
||||
const {
|
||||
memberDevices,
|
||||
distributionId,
|
||||
createdAtDate,
|
||||
} = attributes.senderKeyInfo;
|
||||
const { memberDevices, distributionId, createdAtDate } =
|
||||
attributes.senderKeyInfo;
|
||||
|
||||
const memberSet = new Set(conversation.getMembers());
|
||||
|
||||
|
@ -466,8 +460,8 @@ export async function sendToGroupViaSenderKey(options: {
|
|||
const { uuids404 } = parsed.data;
|
||||
if (uuids404 && uuids404.length > 0) {
|
||||
await _waitForAll({
|
||||
tasks: uuids404.map(uuid => async () =>
|
||||
markIdentifierUnregistered(uuid)
|
||||
tasks: uuids404.map(
|
||||
uuid => async () => markIdentifierUnregistered(uuid)
|
||||
),
|
||||
});
|
||||
}
|
||||
|
@ -753,9 +747,8 @@ async function handle410Response(
|
|||
// been re-registered or re-linked.
|
||||
const senderKeyInfo = conversation.get('senderKeyInfo');
|
||||
if (senderKeyInfo) {
|
||||
const devicesToRemove: Array<PartialDeviceType> = devices.staleDevices.map(
|
||||
id => ({ id, identifier: uuid })
|
||||
);
|
||||
const devicesToRemove: Array<PartialDeviceType> =
|
||||
devices.staleDevices.map(id => ({ id, identifier: uuid }));
|
||||
conversation.set({
|
||||
senderKeyInfo: {
|
||||
...senderKeyInfo,
|
||||
|
@ -849,10 +842,11 @@ async function encryptForSenderKey({
|
|||
const senderKeyStore = new SenderKeys({ ourUuid });
|
||||
const message = Buffer.from(padMessage(contentMessage));
|
||||
|
||||
const ciphertextMessage = await window.textsecure.storage.protocol.enqueueSenderKeyJob(
|
||||
new QualifiedAddress(ourUuid, ourAddress),
|
||||
() => groupEncrypt(sender, distributionId, senderKeyStore, message)
|
||||
);
|
||||
const ciphertextMessage =
|
||||
await window.textsecure.storage.protocol.enqueueSenderKeyJob(
|
||||
new QualifiedAddress(ourUuid, ourAddress),
|
||||
() => groupEncrypt(sender, distributionId, senderKeyStore, message)
|
||||
);
|
||||
|
||||
const groupIdBuffer = Buffer.from(groupId, 'base64');
|
||||
const senderCertificateObject = await senderCertificateService.get(
|
||||
|
@ -1025,9 +1019,8 @@ async function resetSenderKey(conversation: ConversationModel): Promise<void> {
|
|||
const logId = conversation.idForLogging();
|
||||
|
||||
log.info(`resetSenderKey/${logId}: Sender key needs reset. Clearing data...`);
|
||||
const {
|
||||
attributes,
|
||||
}: { attributes: ConversationAttributesType } = conversation;
|
||||
const { attributes }: { attributes: ConversationAttributesType } =
|
||||
conversation;
|
||||
const { senderKeyInfo } = attributes;
|
||||
if (!senderKeyInfo) {
|
||||
log.warn(`resetSenderKey/${logId}: No sender key info`);
|
||||
|
@ -1082,8 +1075,8 @@ async function fetchKeysForIdentifiers(
|
|||
|
||||
try {
|
||||
await _waitForAll({
|
||||
tasks: identifiers.map(identifier => async () =>
|
||||
fetchKeysForIdentifier(identifier)
|
||||
tasks: identifiers.map(
|
||||
identifier => async () => fetchKeysForIdentifier(identifier)
|
||||
),
|
||||
});
|
||||
} catch (error) {
|
||||
|
|
|
@ -153,7 +153,8 @@ function toProtobufSession(
|
|||
// Pending PreKey
|
||||
|
||||
if (session.pendingPreKey) {
|
||||
proto.pendingPreKey = new signal.proto.storage.SessionStructure.PendingPreKey();
|
||||
proto.pendingPreKey =
|
||||
new signal.proto.storage.SessionStructure.PendingPreKey();
|
||||
proto.pendingPreKey.baseKey = binaryToUint8Array(
|
||||
session,
|
||||
'pendingPreKey.baseKey',
|
||||
|
|
|
@ -55,49 +55,18 @@ const TYPES: Array<Type> = [
|
|||
{
|
||||
mimeType: IMAGE_WEBP,
|
||||
bytePattern: new Uint8Array([
|
||||
0x52,
|
||||
0x49,
|
||||
0x46,
|
||||
0x46,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x57,
|
||||
0x45,
|
||||
0x42,
|
||||
0x50,
|
||||
0x56,
|
||||
0x50,
|
||||
0x52, 0x49, 0x46, 0x46, 0x00, 0x00, 0x00, 0x00, 0x57, 0x45, 0x42, 0x50,
|
||||
0x56, 0x50,
|
||||
]),
|
||||
patternMask: new Uint8Array([
|
||||
0xff,
|
||||
0xff,
|
||||
0xff,
|
||||
0xff,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0xff,
|
||||
0xff,
|
||||
0xff,
|
||||
0xff,
|
||||
0xff,
|
||||
0xff,
|
||||
0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff,
|
||||
0xff, 0xff,
|
||||
]),
|
||||
},
|
||||
{
|
||||
mimeType: IMAGE_PNG,
|
||||
bytePattern: new Uint8Array([
|
||||
0x89,
|
||||
0x50,
|
||||
0x4e,
|
||||
0x47,
|
||||
0x0d,
|
||||
0x0a,
|
||||
0x1a,
|
||||
0x0a,
|
||||
0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a,
|
||||
]),
|
||||
},
|
||||
{
|
||||
|
|
|
@ -143,10 +143,11 @@ export function generateProfileKeyCredentialRequest(
|
|||
const profileKeyArray = Buffer.from(profileKeyBase64, 'base64');
|
||||
const profileKey = new ProfileKey(profileKeyArray);
|
||||
|
||||
const context = clientZkProfileCipher.createProfileKeyCredentialRequestContext(
|
||||
uuid,
|
||||
profileKey
|
||||
);
|
||||
const context =
|
||||
clientZkProfileCipher.createProfileKeyCredentialRequestContext(
|
||||
uuid,
|
||||
profileKey
|
||||
);
|
||||
const request = context.getRequest();
|
||||
const requestArray = request.serialize();
|
||||
|
||||
|
@ -191,10 +192,11 @@ export function createProfileKeyCredentialPresentation(
|
|||
Buffer.from(groupSecretParamsBase64, 'base64')
|
||||
);
|
||||
|
||||
const presentation = clientZkProfileCipher.createProfileKeyCredentialPresentation(
|
||||
secretParams,
|
||||
profileKeyCredential
|
||||
);
|
||||
const presentation =
|
||||
clientZkProfileCipher.createProfileKeyCredentialPresentation(
|
||||
secretParams,
|
||||
profileKeyCredential
|
||||
);
|
||||
|
||||
return presentation.serialize();
|
||||
}
|
||||
|
@ -237,10 +239,8 @@ export function handleProfileKeyCredential(
|
|||
const response = new ProfileKeyCredentialResponse(
|
||||
Buffer.from(responseBase64, 'base64')
|
||||
);
|
||||
const profileKeyCredential = clientZkProfileCipher.receiveProfileKeyCredential(
|
||||
context,
|
||||
response
|
||||
);
|
||||
const profileKeyCredential =
|
||||
clientZkProfileCipher.receiveProfileKeyCredential(context, response);
|
||||
|
||||
const credentialArray = profileKeyCredential.serialize();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue