UNPKG

bpixrm

Version:

Bpifrance XRM Package

329 lines (214 loc) 6.99 kB
import { composeWithDevTools } from 'redux-devtools-extension'; export interface IType { value: string, formatted: string, } export enum ExtendedBoolean { All, True, False, } export interface AddressType { eTag: string, //address1_addressid id: string, //address1_addressid name: string, //address1_name typeCode: IType, //address1_addresstypecode line1: string, //address1_line1 line2: string, //address1_line2 line3: string, //address1_line1 postalCode: string, //address1_postalcode city: string, //address1_city state: string, //address1_stateorprovince country: string, //address1_country composite: string, //address1_composite latitude: string, //address1_latitude longitude: string, //address1_longitude telephone1: string, //address1_telephone1 telephone2: string, //address1_telephone1 telephone3: string, //address1_telephone1 fax: string, //address1_fax primaryContact: IType, //address1_primarycontactname } export interface CompanyType { eTag: string, guid: string; //accountid accountid: string, bpi_siren: string, bpi_codecp: string, bpi_nom: string, bpi_prenom: string, name: string, imageUrl: string, //entityimage_url image: string, //entityimage bpi_nomcommercial: string, bpi_nomcommercialbcp: string, bpi_fondeele: string, websiteurl: string, address1: AddressType, bpi_adresse: string, telephone1: string, bpi_hub40: string, bpi_investissement: string, bpi_investissement_gp: string, bpi_network: string, bpi_nbrsuivipar: string, derniereInteraction: IType, derniereInteractionType: String, derniereActiviteType: IType, derniereActiviteDate: IType, dateDernierProjetInvest: IType, dateDernierProjetFinance: IType, dateDernierProjetAccomp: IType, primaryContact?: IType, parent: IType, isPivot: boolean, contacts: Array<UserType>, establishments: Array<EstablishmentType>, } export interface EstablishmentType { eTag: string, guid: string; //bpi_etablissementsid bpi_codecp: string, bpi_codepostal: string, bpi_date_creation: IType, bpi_date_fermeture: IType, bpi_etablissementsid: string, bpi_name: string, bpi_numeroetablissement: string, bpi_phone: string, bpi_siegesocial: IType, bpi_siret: string, bpi_ville: string, bpi_voie: string, createdOn: IType, //createdon modifiedOn: IType, //modifiedon } export interface UserType { eTag: string, guid: string, //contactid contactid: string; civility: IType, //bpi_civilite fullname: string, firstname: string, lastname: string, emailaddress: string, address1: AddressType, fonction: IType, //_bpi_fonction_value company: IType, //_bpi_etablissement_value birthDate: IType, mobilephone: string, telephone1: string, telephone2: string, telephone3: string, createdOn: IType, //createdon modifiedOn: IType, //modifiedon createdBy: IType, //_createdby_value modifiedBy: IType, //_modifiedby_value } export interface SystemUserType { eTag: string, guid: string, //systemuserid systemuserid: string, fullname: string, firstname: string, lastname: string, windowsliveid: string, emailaddress: string, internalemailaddress: string, address1: AddressType, metier: IType, //bpi_metier fonction: IType, //_bpi_fonction_value } export interface BpiUsersType extends SystemUserType { } export interface PortfolioItemType { eTag: string, guid: string, //bpi_suiviparid bpi_suiviparid: string, //bpi_suiviparid bpi_name: string, // bpi_name bpi_suivre_societe: IType, //bpi_suivre_societe createdOn: IType, //createdon modifiedOn: IType, //modifiedon statecode: IType, //statecode statuscode: IType, //statuscode user: BpiUsersType, company: CompanyType, } export enum InteractionType { Activite = "Activite", Invest = "Invest", Finance = "Finance", Accomp = "Accomp", None = "None", } export interface CommunityType { eTag: string, name: string, //bpi_name typePprogrammeAccelerateur: IType, //_bpi_typeprogrammeaccelerateurid_value promotion: IType, // _bpi_promotionid_value statutDemande: IType, //bpi_statutdemande demandePar: IType, //_bpi_demande_par_value dateEntree: IType, //bpi_datedentreenew dateDeSortie: IType, //bpi_date_sortie dateDeValidation: IType, //bpi_date_entree alumni: IType, //bpi_alumnicalculated statecode: IType, //statecode statuscode: IType, //statuscode contact: IType, //_bpi_contact_societe_value dateDemande: IType, //bpi_sortiedemandee dateCandidature: IType, //bpi_date_candidature directionRegionale: IType, //_bpi_direction_regionale_value isValid: boolean, // Calculated } export class EException extends Error { protected code: string; public message: string; protected date: any; protected extendedMessage: any; constructor(code: string, message: string, extendedMessage:any, ...params) { super(...params); // Maintenir dans la pile une trace adéquate de l'endroit où l'erreur a été déclenchée (disponible seulement en V8) if (Error.captureStackTrace) { Error.captureStackTrace(this, E401); } // Set the prototype explicitly. Object.setPrototypeOf(this, EException.prototype); // restore prototype chain const actualProto = EException.prototype; if (Object.setPrototypeOf) { Object.setPrototypeOf(this, actualProto); } else { this.__proto__ = actualProto; } // Informations de déboguage personnalisées this.code = code; this.message = message; this.date = new Date(); this.extendedMessage = extendedMessage; } public getInfos():any { return { code: this.code, message: this.message, extendedMessage: this.extendedMessage, stack: { stack: this.stack }, } } } export class E401 extends EException { constructor(message: string ,extendedMessage:any, ...params) { super("401", message, extendedMessage, ...params); Object.setPrototypeOf(this, E401.prototype); } } export class E404 extends EException { constructor(message: string ,extendedMessage:any, ...params) { super("E404", message, extendedMessage, ...params); Object.setPrototypeOf(this, E404.prototype); } } export class ENot200 extends EException { constructor(message: string ,extendedMessage:any, ...params) { super("E !=200", message, extendedMessage, ...params); Object.setPrototypeOf(this, ENot200.prototype); } }