Skip to content

Commit

Permalink
fix: some types are fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
mohammeds1992 committed Mar 13, 2024
1 parent 0eab986 commit 2cbb86b
Show file tree
Hide file tree
Showing 32 changed files with 34 additions and 35 deletions.
2 changes: 1 addition & 1 deletion packages/restapi/src/lib/chat/addAdmins.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ALPHA_FEATURE_CONFIG } from '../config';
import Constants, { PACKAGE_BUILD } from '../constants';
import { handleError } from '../errors/ValidationError';
import { handleError } from '../errors/validationError';
import { EnvOptionsType, SignerType, GroupInfoDTO } from '../types';
import {
GroupMemberUpdateOptions,
Expand Down
2 changes: 1 addition & 1 deletion packages/restapi/src/lib/chat/addMembers.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ALPHA_FEATURE_CONFIG } from '../config';
import Constants, { PACKAGE_BUILD } from '../constants';
import { handleError } from '../errors/ValidationError';
import { handleError } from '../errors/validationError';
import { EnvOptionsType, SignerType, GroupInfoDTO } from '../types';
import { updateGroupMembers } from './updateGroupMembers';
import { GroupMemberUpdateOptions } from './updateGroupMembers';
Expand Down
2 changes: 1 addition & 1 deletion packages/restapi/src/lib/chat/approveRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import * as AES from '../chat/helpers/aes';
import { getGroupInfo } from './getGroupInfo';
import { getAllGroupMembersPublicKeys } from './getAllGroupMembersPublicKeys';
import { ALPHA_FEATURE_CONFIG } from '../config';
import { handleError } from '../errors/ValidationError';
import { handleError } from '../errors/validationError';

export interface ApproveRequestOptionsType extends EnvOptionsType {
/**
Expand Down
2 changes: 1 addition & 1 deletion packages/restapi/src/lib/chat/chat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import Constants, { ENV } from '../constants';
import { IFeeds } from '../types';
import { axiosGet } from '../utils/axiosUtil';
import { PGPHelper, addDeprecatedInfo, getInboxLists, getUserDID } from './helpers';
import { handleError } from '../errors/ValidationError';
import { handleError } from '../errors/validationError';

export const chat = async (options: {
account: string;
Expand Down
2 changes: 1 addition & 1 deletion packages/restapi/src/lib/chat/chats.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import Constants, { ENV } from '../constants';
import { IFeeds } from '../types';
import { getInboxLists, getUserDID, addDeprecatedInfo, IPGPHelper, PGPHelper } from './helpers';
import { axiosGet } from '../utils/axiosUtil';
import { handleError } from '../errors/ValidationError';
import { handleError } from '../errors/validationError';

export type ChatsOptionsType = {
account: string;
Expand Down
2 changes: 1 addition & 1 deletion packages/restapi/src/lib/chat/conversationHash.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Constants from '../constants';
import { handleError } from '../errors/ValidationError';
import { handleError } from '../errors/validationError';
import { isValidETHAddress } from '../helpers';
import { ConversationHashOptionsType } from '../types';
import { getConversationHashService, getUserDID } from './helpers';
Expand Down
2 changes: 1 addition & 1 deletion packages/restapi/src/lib/chat/createGroup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
} from './helpers';
import * as CryptoJS from 'crypto-js';
import { axiosPost } from '../utils/axiosUtil';
import { handleError } from '../errors/ValidationError';
import { handleError } from '../errors/validationError';

export interface ChatCreateGroupType extends EnvOptionsType {
account?: string | null;
Expand Down
4 changes: 2 additions & 2 deletions packages/restapi/src/lib/chat/createGroupV2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ import {
ValidationError,
handleError,
isErrorWithResponse,
} from '../errors/ValidationError';
} from '../errors/validationError';
import { axiosPost } from '../utils/axiosUtil';
import { HttpStatus } from '../errors/HttpStatus';
import { HttpStatus } from '../errors/httpStatus';

export interface ChatCreateGroupTypeV2 extends EnvOptionsType {
account?: string | null;
Expand Down
2 changes: 1 addition & 1 deletion packages/restapi/src/lib/chat/getChatInfo.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { getAPIBaseUrls } from '../helpers';
import Constants, { ENV } from '../constants';
import { axiosGet } from '../utils/axiosUtil';
import { handleError } from '../errors/ValidationError';
import { handleError } from '../errors/validationError';
import { getUserDID } from './helpers';

/**
Expand Down
2 changes: 1 addition & 1 deletion packages/restapi/src/lib/chat/getGroup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { getAPIBaseUrls } from '../helpers';
import Constants, { ENV } from '../constants';
import { GroupDTO } from '../types';
import { axiosGet } from '../utils/axiosUtil';
import { handleError } from '../errors/ValidationError';
import { handleError } from '../errors/validationError';

/**
* GET /v1/chat/groups/:chatId
Expand Down
2 changes: 1 addition & 1 deletion packages/restapi/src/lib/chat/getGroupAccess.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import Constants, { ENV } from '../constants';
import { GroupAccess } from '../types';
import { getUserDID } from './helpers';
import { axiosGet } from '../utils/axiosUtil';
import { handleError } from '../errors/ValidationError';
import { handleError } from '../errors/validationError';

/**
* GET /v1/chat/groups/:chatId/access/:did
Expand Down
2 changes: 1 addition & 1 deletion packages/restapi/src/lib/chat/getGroupByName.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
GroupDTO
} from '../types';
import { axiosGet } from '../utils/axiosUtil';
import { handleError } from '../errors/ValidationError';
import { handleError } from '../errors/validationError';


/**
Expand Down
2 changes: 1 addition & 1 deletion packages/restapi/src/lib/chat/getGroupInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { getAPIBaseUrls } from '../helpers';
import Constants, { ENV } from '../constants';
import { GroupDTO, GroupInfoDTO } from '../types';
import { GetGroupType } from './getGroup';
import { handleError } from '../errors/ValidationError';
import { handleError } from '../errors/validationError';

/**
* GET /v2/chat/groups/:chatId
Expand Down
2 changes: 1 addition & 1 deletion packages/restapi/src/lib/chat/getGroupMemberCount.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import axios from 'axios';
import { getAPIBaseUrls } from '../helpers';
import Constants, { ENV } from '../constants';
import { ChatMemberCounts } from '../types';
import { handleError } from '../errors/ValidationError';
import { handleError } from '../errors/validationError';

/**
* GET /v1/chat/:chatId/members/count
Expand Down
2 changes: 1 addition & 1 deletion packages/restapi/src/lib/chat/getGroupMemberStatus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import Constants, { ENV } from '../constants';
import { GroupMemberStatus } from '../types';
import { getUserDID } from './helpers';
import { axiosGet } from '../utils/axiosUtil';
import { handleError } from '../errors/ValidationError';
import { handleError } from '../errors/validationError';

/**
* GET /v1/chat/groups/:chatId/access/:did
Expand Down
2 changes: 1 addition & 1 deletion packages/restapi/src/lib/chat/getGroupMembers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import axios from 'axios';
import { getAPIBaseUrls } from '../helpers';
import Constants, { ENV } from '../constants';
import { ChatMemberProfile } from '../types';
import { handleError } from '../errors/ValidationError';
import { handleError } from '../errors/validationError';

/**
* GET /v1/chat/:chatId/members
Expand Down
2 changes: 1 addition & 1 deletion packages/restapi/src/lib/chat/getGroupMembersPublicKeys.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { getAPIBaseUrls } from '../helpers';
import Constants, { ENV } from '../constants';
import { ChatMemberCounts, ChatMemberProfile } from '../types';
import { FetchChatGroupInfoType } from './getGroupMembers';
import { handleError } from '../errors/ValidationError';
import { handleError } from '../errors/validationError';

/**
* GET /v1/chat/:chatId/members/public/keys
Expand Down
2 changes: 1 addition & 1 deletion packages/restapi/src/lib/chat/historicalMessages.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Constants from '../constants';
import { handleError } from '../errors/ValidationError';
import { handleError } from '../errors/validationError';
import { pCAIP10ToWallet } from '../helpers';
import { AccountEnvOptionsType, IMessageIPFS } from '../types';
import { get } from '../user';
Expand Down
2 changes: 1 addition & 1 deletion packages/restapi/src/lib/chat/ipfs.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Constants, { ENV } from '../constants';
import { handleError } from '../errors/ValidationError';
import { handleError } from '../errors/validationError';
import { getAPIBaseUrls } from '../helpers';
import { axiosGet } from '../utils/axiosUtil';

Expand Down
2 changes: 1 addition & 1 deletion packages/restapi/src/lib/chat/modifyRole.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ALPHA_FEATURE_CONFIG } from '../config';
import Constants, { PACKAGE_BUILD } from '../constants';
import { handleError } from '../errors/ValidationError';
import { handleError } from '../errors/validationError';
import { EnvOptionsType, SignerType, GroupInfoDTO } from '../types';
import {
GroupMemberUpdateOptions,
Expand Down
2 changes: 1 addition & 1 deletion packages/restapi/src/lib/chat/rejectRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
} from './helpers';
import * as CryptoJS from 'crypto-js';
import { axiosPut } from '../utils/axiosUtil';
import { handleError } from '../errors/ValidationError';
import { handleError } from '../errors/validationError';

interface RejectRequestOptionsType extends EnvOptionsType {
/**
Expand Down
2 changes: 1 addition & 1 deletion packages/restapi/src/lib/chat/removeAdmins.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ALPHA_FEATURE_CONFIG } from '../config';
import Constants, { PACKAGE_BUILD } from '../constants';
import { handleError } from '../errors/ValidationError';
import { handleError } from '../errors/validationError';
import { EnvOptionsType, SignerType, GroupInfoDTO } from '../types';
import {
GroupMemberUpdateOptions,
Expand Down
2 changes: 1 addition & 1 deletion packages/restapi/src/lib/chat/removeMembers.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ALPHA_FEATURE_CONFIG } from '../config';
import Constants, { PACKAGE_BUILD } from '../constants';
import { handleError } from '../errors/ValidationError';
import { handleError } from '../errors/validationError';
import { EnvOptionsType, SignerType, GroupInfoDTO } from '../types';
import {
GroupMemberUpdateOptions,
Expand Down
2 changes: 1 addition & 1 deletion packages/restapi/src/lib/chat/requests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import Constants, { ENV } from '../constants';
import { IFeeds } from '../types';
import { axiosGet } from '../utils/axiosUtil';
import { IPGPHelper, PGPHelper, addDeprecatedInfo, getInboxLists, getUserDID } from './helpers';
import { handleError } from '../errors/ValidationError';
import { handleError } from '../errors/validationError';

export type RequestOptionsType = {
account: string;
Expand Down
2 changes: 1 addition & 1 deletion packages/restapi/src/lib/chat/searchGroups.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { getAPIBaseUrls } from '../helpers';
import Constants, { ENV } from '../constants';
import { GroupDTO } from '../types';
import { axiosPost } from '../utils/axiosUtil';
import { handleError } from '../errors/ValidationError';
import { handleError } from '../errors/validationError';

/**
* POST /v1/chat/groups/search
Expand Down
2 changes: 1 addition & 1 deletion packages/restapi/src/lib/chat/send.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { MessageObj } from '../types/messageTypes';
import { validateMessageObj } from '../validations/messageObject';
import { axiosPost } from '../utils/axiosUtil';
import { getGroupInfo } from './getGroupInfo';
import { handleError } from '../errors/ValidationError';
import { handleError } from '../errors/validationError';

/**
* SENDS A PUSH CHAT MESSAGE
Expand Down
2 changes: 1 addition & 1 deletion packages/restapi/src/lib/chat/updateGroup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import { axiosPut } from '../utils/axiosUtil';
import { getGroup } from './getGroup';
import * as AES from '../chat/helpers/aes';
import { getGroupMemberStatus } from './getGroupMemberStatus';
import { handleError } from '../errors/ValidationError';
import { handleError } from '../errors/validationError';

export interface ChatUpdateGroupType extends EnvOptionsType {
account?: string | null;
Expand Down
2 changes: 1 addition & 1 deletion packages/restapi/src/lib/chat/updateGroupConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { ChatStatus, EnvOptionsType, GroupInfoDTO, SignerType } from '../types';
import { sign, getWallet, getConnectedUserV2 } from './helpers';
import * as CryptoJS from 'crypto-js';
import { axiosPut } from '../utils/axiosUtil';
import { handleError } from '../errors/ValidationError';
import { handleError } from '../errors/validationError';

export interface ChatUpdateConfigProfileType extends EnvOptionsType {
account?: string | null;
Expand Down
2 changes: 1 addition & 1 deletion packages/restapi/src/lib/chat/updateGroupMembers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import * as AES from '../chat/helpers/aes';
import { getAllGroupMembersPublicKeys } from './getAllGroupMembersPublicKeys';
import { ALPHA_FEATURE_CONFIG } from '../config';
import { axiosPut } from '../utils/axiosUtil';
import { handleError } from '../errors/ValidationError';
import { handleError } from '../errors/validationError';

export interface GroupMemberUpdateOptions extends EnvOptionsType {
chatId: string;
Expand Down
2 changes: 1 addition & 1 deletion packages/restapi/src/lib/chat/updateGroupProfile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import {
import * as CryptoJS from 'crypto-js';
import { axiosPut } from '../utils/axiosUtil';
import { getGroupInfo } from './getGroupInfo';
import { handleError } from '../errors/ValidationError';
import { handleError } from '../errors/validationError';

export interface ChatUpdateGroupProfileType extends EnvOptionsType {
account?: string | null;
Expand Down
2 changes: 1 addition & 1 deletion packages/restapi/src/lib/errors/validationError.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { HttpStatus } from './HttpStatus';
import { HttpStatus } from "./httpStatus";

export class ValidationError extends Error {
status: HttpStatus;
Expand Down
5 changes: 2 additions & 3 deletions packages/restapi/tests/loaders/envVerifier.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
// Load FS and Other dependency
import * as fs from 'fs'
import * as envfile from 'envfile'
import * as readline from 'readline'

export default async () => {
try {
/* try {
// Load environment files
const envpath = `${__dirname}/../.env`
const envsamplepath = `${__dirname}/../.env.sample`
Expand Down Expand Up @@ -77,5 +76,5 @@ export default async () => {
} catch (e) {
console.log(' Error on env verifier loader: %o ', e)
throw e
}
}*/
}

0 comments on commit 2cbb86b

Please sign in to comment.