diff --git a/package-lock.json b/package-lock.json index c582ea9..8c0530c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2491,8 +2491,7 @@ "asynckit": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=", - "dev": true + "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" }, "asyncro": { "version": "3.0.0", @@ -3458,7 +3457,6 @@ "version": "1.0.8", "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", - "dev": true, "requires": { "delayed-stream": "~1.0.0" } @@ -3654,6 +3652,7 @@ "version": "7.0.3", "resolved": "https://registry.npmjs.org/cross-env/-/cross-env-7.0.3.tgz", "integrity": "sha512-+/HKd6EgcQCJGh2PSjZuUitQBQynKor4wrFbRg4DtAgS1aWO+gU52xpH7M9ScGgXSYmAVS9bIJ8EzuaGw0oNAw==", + "dev": true, "requires": { "cross-spawn": "^7.0.1" }, @@ -3662,6 +3661,7 @@ "version": "7.0.3", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "dev": true, "requires": { "path-key": "^3.1.0", "shebang-command": "^2.0.0", @@ -3671,12 +3671,14 @@ "path-key": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", - "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==" + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true }, "shebang-command": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, "requires": { "shebang-regex": "^3.0.0" } @@ -3684,12 +3686,14 @@ "shebang-regex": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", - "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==" + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true }, "which": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, "requires": { "isexe": "^2.0.0" } @@ -4007,8 +4011,7 @@ "delayed-stream": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", - "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", - "dev": true + "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=" }, "des.js": { "version": "1.0.1", @@ -5300,13 +5303,12 @@ "dev": true }, "form-data": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", - "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", - "dev": true, + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", + "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", "requires": { "asynckit": "^0.4.0", - "combined-stream": "^1.0.6", + "combined-stream": "^1.0.8", "mime-types": "^2.1.12" } }, @@ -5329,6 +5331,11 @@ "readable-stream": "^2.0.0" } }, + "fs": { + "version": "0.0.1-security", + "resolved": "https://registry.npmjs.org/fs/-/fs-0.0.1-security.tgz", + "integrity": "sha1-invTcYa23d84E/I4WLV+yq9eQdQ=" + }, "fs-extra": { "version": "9.1.0", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.1.0.tgz", @@ -6248,7 +6255,8 @@ "isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=" + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", + "dev": true }, "isobject": { "version": "3.0.1", @@ -7741,14 +7749,12 @@ "mime-db": { "version": "1.49.0", "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.49.0.tgz", - "integrity": "sha512-CIc8j9URtOVApSFCQIF+VBkX1RwXp/oMMOrqdyXSBXq5RWNEsRfyj1kiRnQgmNXmHxPoFIxOroKA3zcU9P+nAA==", - "dev": true + "integrity": "sha512-CIc8j9URtOVApSFCQIF+VBkX1RwXp/oMMOrqdyXSBXq5RWNEsRfyj1kiRnQgmNXmHxPoFIxOroKA3zcU9P+nAA==" }, "mime-types": { "version": "2.1.32", "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.32.tgz", "integrity": "sha512-hJGaVS4G4c9TSMYh2n6SQAGrC4RnfU+daP8G7cSCmaqNjiOoUY0VHCMS42pxnQmVF1GWwFhbHWn3RIxCqTmZ9A==", - "dev": true, "requires": { "mime-db": "1.49.0" } @@ -9409,6 +9415,17 @@ "uuid": "^3.3.2" }, "dependencies": { + "form-data": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", + "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", + "dev": true, + "requires": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.6", + "mime-types": "^2.1.12" + } + }, "tough-cookie": { "version": "2.5.0", "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz", diff --git a/package.json b/package.json index 94722fe..1b54d34 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,6 @@ "typings": "dist/index.d.ts", "files": [ "dist" - ], "engines": { "node": ">=12" @@ -66,6 +65,8 @@ "dependencies": { "@auth0/auth0-spa-js": "^1.18.0", "axios": "^0.21.1", + "form-data": "^4.0.0", + "fs": "0.0.1-security", "openid-client": "^4.7.4", "rxjs": "^6.6.7" } diff --git a/src/services/base-service.ts b/src/services/base-service.ts index 6b5def5..46ac8f6 100644 --- a/src/services/base-service.ts +++ b/src/services/base-service.ts @@ -24,6 +24,10 @@ export default class BaseService { return this.instance.post>(url, data, config); } + protected put = async (url: string, data?: any, config?: AxiosRequestConfig): Promise> => { + await this.setToken(); + return this.instance.put>(url, data, config); + } private setToken = async () => { if (!auth) diff --git a/src/services/network-service.ts b/src/services/network-service.ts index 11d37e6..262b168 100644 --- a/src/services/network-service.ts +++ b/src/services/network-service.ts @@ -1,14 +1,15 @@ import { AxiosResponse } from 'axios'; import config from '../config.json'; import BaseService from './base-service'; -import { SideDrawer } from '../types/sidedrawer'; +import { SideDrawerMain } from '../types'; export interface INetworkService { - getTimeline(sidedrawer_id: string, type: string): Promise>; - getShared(): Promise>; - getOwned(): Promise>; + getTimeline(sidedrawer_id: string, type: string, locale: string, page: number): Promise>; + getShared(): Promise>; + getOwned(): Promise>; + remove(sidedrawer_id: string): Promise>; } @@ -18,22 +19,28 @@ export default class NetworkService extends BaseService implements INetworkServi } - getTimeline = async (sidedrawer_id: string, type: string): Promise> => { + getTimeline = async (sidedrawer_id: string, type: string, locale: string, page: number): Promise> => { - return this.get(`sidedrawer/sidedrawer-id/${sidedrawer_id}/log?locale=en-CA&page=1&entityType=${type}`); + return this.get(`sidedrawer/sidedrawer-id/${sidedrawer_id}/log?locale==${locale}&page=${page}&entityType=${type}`); }; - getShared = async (): Promise> => { + getShared = async (): Promise> => { - return this.get(`sidedrawer/shared`); + return this.get(`sidedrawer/shared`); }; - getOwned = async (): Promise> => { + getOwned = async (): Promise> => { - return this.get(`sidedrawer/owned`); + return this.get(`sidedrawer/owned`); }; + remove = async (sidedrawer_id: string): Promise> => { + + return this.delete(`sidedrawer/sidedrawer-id/${sidedrawer_id}`); + }; + + } diff --git a/src/services/record-service.ts b/src/services/record-service.ts index 45b1a25..551a851 100644 --- a/src/services/record-service.ts +++ b/src/services/record-service.ts @@ -1,12 +1,13 @@ import config from '../config.json'; import BaseService from './base-service'; import { AxiosResponse } from 'axios'; +import { Record } from '../types'; export interface IRecordService { - getBySidedrawer(sidedrawer_id: string): Promise>; - getUserSetting(user_id: string): Promise>; + getBySidedrawer(sidedrawer_id: string): Promise>; + } export default class RecordService extends BaseService implements IRecordService { @@ -14,16 +15,12 @@ export default class RecordService extends BaseService implements IRecordService super(config.apiRecord); } - getBySidedrawer = async (sidedrawer_id: string): Promise> => { - return this.get(`sidedrawer/sidedrawer-id/${sidedrawer_id}/records`); + getBySidedrawer = async (sidedrawer_id: string): Promise> => { + return this.get(`sidedrawer/sidedrawer-id/${sidedrawer_id}/records`); }; - getUserSetting = async (user_id: string): Promise> => { - - return this.get(`/accounts/account-id/${user_id}/settings`); - }; } diff --git a/src/services/recordFile-service.ts b/src/services/recordFile-service.ts index e54193e..44fccb7 100644 --- a/src/services/recordFile-service.ts +++ b/src/services/recordFile-service.ts @@ -1,7 +1,9 @@ import config from '../config.json'; import BaseService from './base-service'; import { AxiosResponse } from 'axios'; -import { RecordFile } from '../types/recordFile'; +import { RecordFile } from '../types'; +import FormData from 'form-data'; +import fs from 'fs'; export interface IRecordFileService { @@ -9,6 +11,7 @@ export interface IRecordFileService { getByRecord(sidedrawer_id: string, record_id: string): Promise>; remove(sidedrawer_id: string, record_id: string, fileName: string): Promise>; getStreamByUrl(url: string): Promise>; + postLocalFile(sidedrawer_id: string, record_id: string, urlFile: string, recordFile: RecordFile): Promise>; } export default class RecordFileService extends BaseService implements IRecordFileService { @@ -32,6 +35,22 @@ export default class RecordFileService extends BaseService implements IRecordFil }; + postLocalFile = async (sidedrawer_id: string, record_id: string, urlFile: string, recordFile: RecordFile): Promise> => { + + const formData = new FormData(); + formData.append('file', fs.createReadStream(urlFile)); + + const params = new URLSearchParams({ + fileName: recordFile.fileName!, correlationId: recordFile.correlationId!, uploadTitle: recordFile.uploadTitle!, fileType: recordFile.fileType! + }).toString(); + const url = `sidedrawer/sidedrawer-id/${sidedrawer_id}/records/record-id/${record_id}/record-files?${params}`; + + return this.post(url, formData); + + }; + + + } diff --git a/src/services/sidedrawer-service.ts b/src/services/sidedrawer-service.ts index 25b4f70..f0b8fa9 100644 --- a/src/services/sidedrawer-service.ts +++ b/src/services/sidedrawer-service.ts @@ -1,12 +1,13 @@ import config from '../config.json'; import BaseService from './base-service'; import { AxiosResponse } from 'axios'; +import { SideDrawer } from '../types'; export interface ISidedrawerSevice { - getHome(sidedrawer_id: string): Promise>; - getById(user_id: string): Promise>; + getHome(sidedrawer_id: string, locale: string): Promise>; + getById(user_id: string): Promise>; } @@ -15,13 +16,13 @@ export default class SidedrawerSevice extends BaseService implements ISidedrawer super(config.apiRecord); } - getHome = async (sidedrawer_id: string) => { - return this.get(`sidedrawer/sidedrawer-id/${sidedrawer_id}/home?locale=en-CA`); + getHome = async (sidedrawer_id: string, locale: string): Promise> => { + return this.get(`sidedrawer/sidedrawer-id/${sidedrawer_id}/home?locale=${locale}`); }; - getById = async (sidedrawer_id: string) => { - return this.get(`sidedrawer/sidedrawer-id/${sidedrawer_id}`); + getById = async (sidedrawer_id: string): Promise> => { + return this.get(`sidedrawer/sidedrawer-id/${sidedrawer_id}`); }; diff --git a/src/types/account.ts b/src/types/account.ts new file mode 100644 index 0000000..f27a4f4 --- /dev/null +++ b/src/types/account.ts @@ -0,0 +1,25 @@ +import { Settings } from './settings' +import { PrimaryResidence } from './primaryResidence' +import { Email } from './Email' +import { Agreement } from './agreement' +import { Phone } from './phone' + + +export interface Account { + id?: string, + username?: string, + firstName?: string, + lastName?: string, + profilePhoto?: string, + dateOfBirth?: string, + maritalStatus?: string, + primaryResidence?: PrimaryResidence, + gender?: string, + emails?: Email[], + phones?: Phone[], + settings?: Settings, + agreements?: Agreement[], + openId?: string, + customerId?: string + +} \ No newline at end of file diff --git a/src/types/agreement.ts b/src/types/agreement.ts new file mode 100644 index 0000000..090137f --- /dev/null +++ b/src/types/agreement.ts @@ -0,0 +1,7 @@ +export interface Agreement { + locale: string, + type: string, + version: number, + consent: boolean + +} \ No newline at end of file diff --git a/src/types/contributor.ts b/src/types/contributor.ts new file mode 100644 index 0000000..1284a96 --- /dev/null +++ b/src/types/contributor.ts @@ -0,0 +1,12 @@ +import { DisplayValue } from './displayValue' + +export interface Contributor { + + openId?: string, + firstName?: string, + lastName?: string, + email?: string, + phoneNumber?: string, + teamId?: string, + +} diff --git a/src/types/customField.ts b/src/types/customField.ts new file mode 100644 index 0000000..502182c --- /dev/null +++ b/src/types/customField.ts @@ -0,0 +1,11 @@ + +import { SpecificFieldType } from './specificFieldType'; + +export interface CustomField { + + label?: string, + value?: string | Date, + formType?: SpecificFieldType, + id?: string + +} \ No newline at end of file diff --git a/src/types/displayValue.ts b/src/types/displayValue.ts new file mode 100644 index 0000000..dfd3fc8 --- /dev/null +++ b/src/types/displayValue.ts @@ -0,0 +1,7 @@ +export interface DisplayValue { + + locale?: string, + value?: string, + description?: string, + +} \ No newline at end of file diff --git a/src/types/email.ts b/src/types/email.ts new file mode 100644 index 0000000..277aef8 --- /dev/null +++ b/src/types/email.ts @@ -0,0 +1,6 @@ +export interface Email { + + primary: boolean, + verified: boolean, + address: string +} \ No newline at end of file diff --git a/src/types/fileHistory.ts b/src/types/fileHistory.ts new file mode 100644 index 0000000..b5dfd5e --- /dev/null +++ b/src/types/fileHistory.ts @@ -0,0 +1,15 @@ + +import { FileType } from './fileType'; +import { FileItem } from './fileItem'; +import { CloudStorageFolder } from './cloudStorageFolder'; + +export interface FileHistory { + + correlationId?: string, + uploadTitle?: string, + uploadDetail?: string, + fileType?: FileType, + files?: FileItem[], + cloudStorageFolder?: CloudStorageFolder, + +} \ No newline at end of file diff --git a/src/types/index.ts b/src/types/index.ts index 9568361..139b158 100644 --- a/src/types/index.ts +++ b/src/types/index.ts @@ -1,11 +1,11 @@ -export * from './sidedrawer'; +export * from './sidedrawerMain'; export * from './sidedrawerRoles'; -export * from './cloudStorageFile'; -export * from './cloudStorageFolder'; -export * from './fileItem'; -export * from './fileType'; -export * from './provider'; export * from './recordFile'; +export * from './sidedrawer'; +export * from './record'; +export * from './recordType'; +export * from './recordSubType'; + diff --git a/src/types/phone.ts b/src/types/phone.ts new file mode 100644 index 0000000..8c1a7ff --- /dev/null +++ b/src/types/phone.ts @@ -0,0 +1,9 @@ +export interface Phone { + primary: boolean, + // tslint:disable-next-line:variable-name + number: number, + ext: number, + mobile: boolean, + verified: boolean, + +} \ No newline at end of file diff --git a/src/types/primaryResidence.ts b/src/types/primaryResidence.ts new file mode 100644 index 0000000..4ed9bb5 --- /dev/null +++ b/src/types/primaryResidence.ts @@ -0,0 +1,10 @@ +export interface PrimaryResidence { + buildingNumber?: string, + streetName?: string, + unitNumber?: string, + city?: string, + provinceState?: string, + postalZip?: string, + country?: string, + +} \ No newline at end of file diff --git a/src/types/record.ts b/src/types/record.ts new file mode 100644 index 0000000..fa01721 --- /dev/null +++ b/src/types/record.ts @@ -0,0 +1,33 @@ + +import { RecordType } from './recordType'; +import { RecordSubType } from './recordSubType'; +import { Contributor } from './contributor'; +import { RecordDetails } from './recordDetails'; +import { SidedrawerRoles } from './sidedrawerRoles'; +import { RecordsRoles } from './recordsRoles'; +import { FileHistory } from './fileHistory'; + + +export interface Record { + id?: string, + name?: string, + storageLocation?: string, + recordSubtypeOther?: string, + description?: string, + recordSubtype?: RecordSubType, + recordType?: RecordType, + updatedAt?: Date, + lastModifiedBy?: string, + status?: any, + editable?: boolean, + contributors?: Contributor[], + uniqueReference?: string, + recordSubtypeName?: string, + recordTypeName?: string, + active?: boolean, + recordDetails?: RecordDetails, + userSidedrawerRole?: SidedrawerRoles[], + userRecordRole?: RecordsRoles[], + filesHistory?: FileHistory[], + +} \ No newline at end of file diff --git a/src/types/recordDetails.ts b/src/types/recordDetails.ts new file mode 100644 index 0000000..fdc8e49 --- /dev/null +++ b/src/types/recordDetails.ts @@ -0,0 +1,13 @@ + +import { CustomField } from './customField'; + +export interface RecordDetails { + + cloudStorageFolder?: string[], + assetCurrentValue?: string, + assetHistory?: string[], + liabilityCurrentValue?: string, + liabilityHistory?: string[], + customFields?: CustomField[], + +} \ No newline at end of file diff --git a/src/types/recordFile.ts b/src/types/recordFile.ts index 8dcf866..edfe779 100644 --- a/src/types/recordFile.ts +++ b/src/types/recordFile.ts @@ -3,7 +3,7 @@ import { FileItem } from './fileItem'; import { CloudStorageFolder } from './cloudStorageFolder'; export interface RecordFile { - + fileName?: string, correlationId?: string, uploadTitle?: string, uploadDetail?: string, diff --git a/src/types/recordSubType.ts b/src/types/recordSubType.ts new file mode 100644 index 0000000..f39ccfe --- /dev/null +++ b/src/types/recordSubType.ts @@ -0,0 +1,13 @@ +import { DisplayValue } from './displayValue'; +import { RecordsSections } from './recordsSections'; + +export interface RecordSubType { + + name?: string, + logo?: string, + displayValue?: DisplayValue[], + id?: string, + orderId?: number, + recordsSections?: RecordsSections, + +} \ No newline at end of file diff --git a/src/types/recordType.ts b/src/types/recordType.ts new file mode 100644 index 0000000..bc7edbf --- /dev/null +++ b/src/types/recordType.ts @@ -0,0 +1,13 @@ +import { DisplayValue } from './displayValue' + +export interface RecordType { + + name?: string, + logo?: string, + displayValue?: DisplayValue[], + id?: string, + count?: number, + sidedrawerType?: string, + orderId?: number, + +} diff --git a/src/types/recordsRoles.ts b/src/types/recordsRoles.ts new file mode 100644 index 0000000..8285c45 --- /dev/null +++ b/src/types/recordsRoles.ts @@ -0,0 +1,6 @@ +export enum RecordsRoles { + info = 'rec_info', + viewer = 'rec_viewer', + editor = 'rec_editor', + owner = 'rec_owner', +} diff --git a/src/types/recordsSections.ts b/src/types/recordsSections.ts new file mode 100644 index 0000000..5c82587 --- /dev/null +++ b/src/types/recordsSections.ts @@ -0,0 +1,12 @@ + + +export interface RecordsSections { + + sectionDescription?: boolean, + sectionFiles?: boolean, + sectionLinkedRecords?: boolean, + sectionCollaborators?: boolean, + sectionSpecificFields?: boolean, + sectionCustomFields?: boolean, + +} diff --git a/src/types/settings.ts b/src/types/settings.ts new file mode 100644 index 0000000..acefaee --- /dev/null +++ b/src/types/settings.ts @@ -0,0 +1,10 @@ +export interface Settings { + notificationMethod?: string, + communicationLanguage?: string, + country?: string, + preferredLanguage?: string, + mfaDisabled?: boolean, + mfaMode?: string, + currency?: string, + +} diff --git a/src/types/sidedrawer.ts b/src/types/sidedrawer.ts index 9cc4cc5..6762c51 100644 --- a/src/types/sidedrawer.ts +++ b/src/types/sidedrawer.ts @@ -1,14 +1,28 @@ import { SidedrawerRoles } from './sidedrawerRoles' +import { Provider } from './provider' +import { SubscriptionFeatures } from './subscriptionFeatures' +import { Account } from './account' +import { RecordType } from './recordType' export interface SideDrawer { id?: string, name?: string, - networkId?: string, - plan?: string, - sdPhoto?: string, - sdRole?: SidedrawerRoles, + firstName?: string, + lastName?: string, + email?: string, + profilePhoto?: string, isDefault?: boolean, + status?: string, + userSidedrawerRole?: SidedrawerRoles[], + subscriptionFeatures?: SubscriptionFeatures, + type?: string, + recordsType?: RecordType[], + active?: boolean, + maxRecordsReached?: boolean, + integrations?: Provider[], + licenseKey?: string, + brandCode?: string, + owners?: Account[] } - diff --git a/src/types/sidedrawerMain.ts b/src/types/sidedrawerMain.ts new file mode 100644 index 0000000..69682cf --- /dev/null +++ b/src/types/sidedrawerMain.ts @@ -0,0 +1,14 @@ +import { SidedrawerRoles } from './sidedrawerRoles' + +export interface SideDrawerMain { + + id?: string, + name?: string, + networkId?: string, + plan?: string, + sdPhoto?: string, + sdRole?: SidedrawerRoles, + isDefault?: boolean + + +} diff --git a/src/types/specificFieldType.ts b/src/types/specificFieldType.ts new file mode 100644 index 0000000..43c29df --- /dev/null +++ b/src/types/specificFieldType.ts @@ -0,0 +1,16 @@ + + +export enum SpecificFieldType { + integer = 'integer', + number = 'number', + address = 'address', + email = 'email', + url = 'url', + rtf = 'rtf', + money = 'money', + percentage = 'percentage', + date = 'date', + enum = 'enum', + string = 'string', + password = 'password' +} \ No newline at end of file diff --git a/src/types/subscriptionFeatures.ts b/src/types/subscriptionFeatures.ts new file mode 100644 index 0000000..5d5a687 --- /dev/null +++ b/src/types/subscriptionFeatures.ts @@ -0,0 +1,29 @@ +export interface SubscriptionFeatures { + 'account.featureAddOn': string; + 'account.licensePriority': string; + 'account.sponsorSideDrawers': string; + 'sidedrawer.maxSDGBs': string; + 'sidedrawer.maxSDRecords': string; + 'sidedrawer.maxUploadMBs': string; + 'account.guest.sd.editor': string; + 'account.guest.sd.viewer': string; + 'account.guest.sd.info': string; + 'account.guest.record.editor': string; + 'account.guest.record.viewer': string; + 'account.guest.record.info': string; + 'sidedrawer.guest.sd.editor': string; + 'sidedrawer.guest.sd.viewer': string; + 'sidedrawer.guest.sd.info': string; + 'sidedrawer.guest.record.editor': string; + 'sidedrawer.guest.record.viewer': string; + 'sidedrawer.guest.record.info': string; + 'sidedrawer.guest.any.notifications': string; + 'sidedrawer.owned.any.notifications': string; + 'sidedrawer.owned.sd.transferOwnership': string; + 'sidedrawer.owned.sd.deleteSD': string; + 'sidedrawer.owned.sd.multipleOwners': string; + 'sidedrawer.any.sd.featureInbox': string; + 'product.display': string; + 'product.disabled': string; + 'product.cancelPeriodEnd': string; +} \ No newline at end of file