-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: added channel setting parse logic #1107
Conversation
File: packages/restapi/src/lib/channels/getChannel.ts
.catch((err) => {
throw new Error(`[Push SDK] - API ${requestUrl}: ${err}`);
}); File: packages/restapi/src/lib/pushNotification/PushNotificationTypes.ts
export type NotificationOptions = {
notification: INotification;
payload?: IPayload;
config?: IConfig;
advanced?: IAdvance;
channel?: string;
};
export type CreateChannelOptions = {
name: string;
description: string;
icon: string;
url: string;
alias?: string;
progressHook?: (progress: ProgressHookType) => void;
};
export type NotificationSetting = {
type: number;
default: number | { upper: number; lower: number };
data?: {
upper: number;
lower: number;
enabled?: boolean;
ticker?: number;
};
};
export type NotificationSettings = NotificationSetting[];
export type ChannelOptions = {
raw: boolean;
}; File: packages/restapi/src/lib/pushNotification/channel.ts
import * as wien from 'wien';
import {
ChannelInfoOptions,
ChannelSearchOptions,
NotificationOptions,
CreateChannelOptions,
NotificationSettings,
ChannelOptions,
} from './PushNotificationTypes'; File: packages/restapi/src/lib/types/index.ts
import { VideoNotificationRules } from './VideoNotificationRules';
import { ISendNotificationInputOptions } from './ISendNotificationInputOptions';
export interface ApiSubscribersType {
itemcount: number;
subscribers: {
subscriber: string;
settings: string | null;
}[];
}
export interface VideoNotificationRules {
access: {
type: VIDEO_NOTIFICATION_ACCESS_TYPE;
data: {
chatId?: string;
};
};
}
export type SendNotificationRules = VideoNotificationRules; File: packages/restapi/src/lib/utils/parseSettings.ts
import { NotificationSettingType } from '../types/index';
data: {
upper: setting.upperLimit,
lower: setting.lowerLimit,
ticker: setting.ticker ?? 1,
},
enabled: setting.enabled,
File: packages/restapi/tests/lib/notification/channel.test.ts
import { ethers } from 'ethers';
import { ethers } from './ethers';
import {
SignerType,
ProgressHookType,
ProgressHookTypeFunction,
} from '../types';
import {
ChannelInfoOptions,
ChannelSearchOptions,
Notification |
* feat(video-v2): add highlevel video class * feat(video): add video stream * fix(sendnotification): modify rules.access.data to be an object & code cleanup * fix(video): remove signer from input, throw err if signer, decrypted pgp key not found * feat(video): add sendNotification calls in connect, disconnect methods * fix(videonotificationrules): typo in VideoNotificationRules interface * add: useStream.ts video-v2-example-app * add: videoV2.tsx in video-v2-example-app * feat(video stream): handle connect, retry internally from the SDK * feat(video connect): remove the connect method from the videov2 SDK * fix(videov2): create push signer instance to get chain id in initialize() * fix(videov2-example): refactor react example component & remove useStream hook * fix(video stream): add backwards compatibilty to rules object for older SDK versions * fix(video stream): fix bug in rules object creation * fix(video stream): call connect() for ApproveVideo event * feat(example-video-1.5): video v2 example app implementation * feat(sdk-frontend): few ui changes * fix(video-v2-example-app): initialisevdeo call after a call ends * feat(video stream): add request, deny evennt handlers * feat(sdk-frontend and sdk-frontend-react): added video-v2 example implementation * fix: few fixes * refactor: refator and remove console logs * fix: fix import error * feat(video): update param names for video.initialize() * fix: param name changes * chore: added few comments * chore: ui toast added * fix(video example): remove pushprotocol sdk direct dir reference for initVideoCallData * fix(video example): import React in examples & update SDK version in sdk-frontend * feat(video example): replace video events from CONSTANTS obj * Edited video example to make it more versatile * Update index.js * fix: fixed message parsing (#1051) * Minor fixes and improvements in video v2 (#1062) * feat(video v2): add VIDEO constants and types * feat(video v2): modify approve, deny to use internally stored peerInfo * fix(video constants): rename DEFAULT_DATA to INITIAL_DATA * 1050 update video example implementation in sdk-frontend (#1070) * fix: use latest imports in example app * feat: use latest rainbowkit library * chore: use latest restapi package * chore: remove unnecessary libs * fix: fixed signer bug (#1073) * fix: send intent in history and latest. (#1069) * fix: send intent in history and latest. * fix: get chat info API sdk changes * fix: stream helper functions * fix: caching implementation on user profile API (#1053) * fix: caching implementation on user profile API * fix: cache code review comments * fix: fix public key in read mode (#1074) * fix: added notification widget layout * fix: fixed naming convention * fix: added layout for hyperlink * Pub key cache to speed up chat messages verification (#1081) * fix: minor fixes * fix: cache implementation for public keys * fix: fix encV1 key decryption (#1088) * fix: add benchamark tests, fix reference msgs' (#1089) * fix: added resuables * bolierplate examples * bolierplate examples * bolierplate examples * fix: added connect button * fix: fixed lint * fix: v2 user creation / upgrades / downgrades (#1099) * fix: fix v2 user * test: remove only * Add filter for subscription (#1102) * fix: added parsing for settings * fix: minor fixes * fix: added manage notifiction * fix: added channel setting parse logic (#1107) * fix: fixed css * added user downgrade example * fix: fixed lint * fix: fixed connect modal * fix: added readmode * fix: fixed readMode --------- Co-authored-by: Madhur Gupta <madhur@push.org> Co-authored-by: Siddesh Sankhya <79219618+Siddesh7@users.noreply.github.com> Co-authored-by: Siddesh <siddeshsankhya@gmail.com> Co-authored-by: harshrajat <harsh@epns.io> Co-authored-by: Harsh | Push <harsh@push.org> Co-authored-by: Aman Gupta <guptaaman200115@gmail.com> Co-authored-by: Mohammed S <shoaib@push.org> Co-authored-by: Ashis Kumar Pradhan <38760485+akp111@users.noreply.github.com> Co-authored-by: Mohammed S <shoaibmohammed92@gmail.com>
Fixes Issue
Changes proposed
Check List (Check all the applicable boxes)
Screenshots
Note to reviewers