{"version":3,"sources":["webpack:///./src/actions/post-contact-us-form.action.ts?4c7d","webpack:///./src/actions/get-crm-token.action.ts?9dd2","webpack:///./src/actions/post-business-op-case.action.ts?1b1f","webpack:///./src/actions/get-existing-contact.action.ts?deef","webpack:///./src/actions/get-crm-nationality-ids-for-tefanawwal.action.ts?4398","webpack:///./src/actions/get-inquery-options.action.ts?ea32","webpack:///./src/actions/get-crm-token-for-tefan-awaal-category.action.ts?d603","webpack:///./src/actions/get-category-details.action.ts?f156","webpack:///./src/actions/get-sharepoint-token.action.ts?433c","webpack:///./src/actions/post-tefanawwal-form.action.ts?23d5","webpack:///./src/actions/get-crm-category-ids-for-tefanawwal.action.ts?baa8","webpack:///./src/actions/get-payment-status.action.ts?3a86","webpack:///./src/actions/get-crm-existing-category-record-for-tefanawwal.action.ts?7db6","webpack:///./src/actions/get-my-fatoorah-payment-methods.action.ts?b1f7","webpack:///./src/actions/post-checkout-data-to-crm.action.ts?a619","webpack:///external \"React\"?c481","webpack:///./src/actions/get-fatoorah-payment-state.action.ts?6510","webpack:///./src/actions/get-categories.action.ts?cf7e","webpack:///external \"ReactDOM\"?4b2d","webpack:///./lib/__local__/module-registration.js?8a42","webpack:///./src/actions/MyFatoorahPaymentDataServiceEntities.g.ts?fcd2","webpack:///./src/actions/MyFatoorahPaymentDataActionExtension.g.ts?8dfc","webpack:///./src/actions/post-new-contact.action.ts?8eb0","webpack:///./src/actions/create-order-for-payment.action.ts?3d75","webpack:///./src/actions/get-payment-access-token.action.ts?7d4d"],"names":["PostContactUsFormInput","constructor","data","file","fileBase64Code","CRMtoken","contactID","getCacheKey","getCacheObjectType","dataCacheType","this","Inquiry","description","email","firstName","lastName","phone","countryCode","updateNpromotion","token","Msdyn365","action","async","input","ctx","szfCRMDomain","requestContext","app","config","_input$file","_input$file2","name","response","timeout","headers","incidentid","status","msg","id","error","message","undefined","contactFormInput","args","inputData","GetCrmTokenInput","szfCRMClientSecret","qs","stringify","access_token","PostBusinessOpCaseInput","szf_name","fullName","szf_organizationname","organizationName","szf_email","szf_phoneno","szf_participatedwithszfpreviously","previousParticipant","szf_typeofparticipation","previousParticipantType","szf_heardaboutus","hearAbout","szf_heardaboutusother","others","szf_categories","categories","szf_countrypavilion","listOfCountryPavilions","toString","szf_productsshowcase","typeOfProducts","szf_type","typeOfRestaurantsCoffeeShops","typeOfKiosksFoodTrucks","szf_kioskactivity","kioskActivity","szf_serviceactivity","serviceActivity","szf_description","tradeLicenseFile","fileData","base64","tradeLicensefileBase64Code","presentationFile","presentationfileBase64Code","_input$tradeLicenseFi","_input$presentationFi","_input$tradeLicenseFi2","_input$tradeLicenseFi3","_input$presentationFi2","_input$presentationFi3","szf_businessopportunity_Annotations","_objectSpread","axios","post","szf_businessopportunityid","createBOCaseInput","GetExistingContactInput","value","length","contactid","createExistingContactInput","GetCrmNationalityIdsForTefanawwalInput","szfCRMDomainForTefanAwwal","createNationalityIdsInput","GetInqueryOptionsInput","createInqueryOptionInput","GetCrmTokenForTefanAwaalCategoryInput","szfCRMClientSecretForTefanAwwal","szfCRMClientIdForTefanAwwal","client_id","client_secret","grant_type","resource","GetCategoryDetailsInput","_ctx$requestContext$q","categoryId","Number","query","getCategories","getCategoriesAsync","callerContext","apiSettings","channelId","categoryDetails","find","item","RecordId","GetTokenInput","getToken","PostTefanawwalFormInput","target","Targets","map","i","nationality","emiratesID","contactNumber","termsAndCondition","Ids","tefanAwwalCaseCreateInput","GetCrmCategoryIdsForTefanawwalInput","createCategoryIdsInput","GetPaymentStatusInput","text","GetCrmExistingCategoryRecordForTefanawwalInput","console","log","ResponseMessage","JSON","parse","createExistingCategoryRecordInput","GetMyFatoorahPaymentMethodsInput","paymentCurrencyISO","initiatePaymentAsync","IsSuccess","Message","Data","PostCheckoutDataToCrmInput","createInput","module","exports","React","GetFatoorahPaymentStateInput","paymentState","GetCategoriesInput","recId","urlTokens","recordId","filteredCategories","filter","ParentCategory","parentCategory","ReactDOM","binding","modules","dataActions","registerActionId","actionPath","default","prototype","Object","keys","forEach","exportName","Action","require","window","__bindings__","packageDataActions","VSICategoryEXTExtensionClass","odataObject","parseInt","Id","Name","DisplayOrder","parseFloat","Description","TextValueTranslation","className","substr","lastIndexOf","concat","EntityClasses","ExtensionProperties","ij","className1","PaymentMethodExtensionClass","PaymentMethodId","PaymentMethodAr","PaymentMethodEn","PaymentMethodCode","IsDirectPayment","ServiceCharge","TotalAmount","CurrencyIso","ImageUrl","IsEmbeddedSupported","PaymentCurrencyIso","DataExtensionClass","PaymentMethods","InitiatePaymentResponseExtensionClass","_odataObject","InvoiceTransactionExtensionClass","TransactionDate","Date","jsonLightReadStringPropertyValue","PaymentGateway","ReferenceId","TrackId","TransactionId","PaymentId","AuthorizationId","TransactionStatus","TransationValue","CustomerServiceCharge","TotalServiceCharge","DueValue","PaidCurrency","PaidCurrencyValue","VatAmount","IpAddress","Country","Currency","CardNumber","ErrorCode","GetPaymentStatusResponseDataExtensionClass","InvoiceId","InvoiceStatus","InvoiceReference","CustomerReference","CreatedDate","ExpiryDate","ExpiryTime","InvoiceValue","CustomerName","CustomerMobile","CustomerEmail","InvoiceDisplayValue","DueDeposit","DepositStatus","InvoiceTransactions","GetPaymentStatusResponseExtensionClass","_odataObject2","ExecutePaymentResponseDataExtensionClass","PaymentURL","RecurringId","ExecutePaymentResponseExtensionClass","_odataObject3","orderExtControllerQuery","key","DataServiceQuery","DataServiceEntities","context","invoiceAmount","currencyIso","request","createDataServiceRequestForOperation","bypassCache","returnEntity","createInitiatePaymentInput","callActionOrExecute","getPaymentStatusAsync","keyType","createGetPaymentStatusInput","executePaymentAsync","paymentMethodId","customerName","displayCurrencyIso","mobileCountryCode","customerMobile","customerEmail","invoiceValue","callBackUrl","errorUrl","language","customerReference","createExecutePaymentInput","PostNewContactInput","createNewContactInput","CreateOrderForPaymentInput","LariToken","amount","emailAddress","merchantAttributesRedirectUrl","url","URL","success","err","GetPaymentAccessTokenInput","_response$data"],"mappings":";gMAYM,MAAOA,EAaTC,YACIC,EACAC,EAC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aAGxC,OAAG9Q,IAA+B,MAAlBA,EAASI,QAAgBJ,EAAS9B,MACvC,CACHiT,IAAK,0BACLC,SAAS,EACT7Q,WAAOE,GAGJ,CACH0Q,SAAK1Q,EACL2Q,SAAS,EACT7Q,MAAO,gDAGlB,MAAM8Q,GAEH,OADAlK,QAAQC,IAAI,gBAAgBiK,GACrB,CACHF,SAAK1Q,EACL2Q,SAAS,EACT7Q,MAAO,kDAQfD,GAAI,wBACJf,MAxDgByI,CAACrH,EAAoCC,IAC9C,IAAIiQ,EAA2BjQ,M,8HC/BpC,MAAO0Q,EAETrT,cAIO,KAAAM,YAAc,IAAM,yBACpB,KAAAC,mBAAqB,IAAM,yBAC3B,KAAAC,cAAgB,IAA0B,QAiDtCW,cAAoC,CAC/CC,OA/BJC,eAAkCC,EAAmCC,GAQjE,IACI,MAAMQ,QAAiBZ,IAA0B,8EAAkD,OAAQ,GAAI,CAC3Gc,QAAS,CACL,eAAgB,sCAChB,cAAiB,gHAG+B,IAAAqR,EAAxD,OAAGvR,IAA+B,MAAlBA,EAASI,QAAgBJ,EAAS9B,MACvC,CACHiB,MAAqB,QAAhBoS,EAAGvR,EAAS9B,YAAI,IAAAqT,OAAA,EAAbA,EAAetQ,aACvBmQ,SAAS,GAGN,CAAEjS,WAAQsB,EAAW2Q,SAAS,GAE5C,MAAMC,GAEH,OADAlK,QAAQC,IAAI,gBAAgBiK,GACrB,CAAElS,WAAOsB,EAAW2Q,SAAS,KAQxC9Q,GAAI,wBACJf,MAzCiBoB,GACV,IAAI2Q,M","file":"static/js/24.9bb090a5787dd7687e97.chunk.js","sourcesContent":["/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\n\r\n/**\r\n * PostContactUsForm Input Action\r\n */\r\n\r\nimport { IPostContactUsFormInput } from './../modules/szf-contact-us/szf-contact-us.view';\r\nexport class PostContactUsFormInput implements Msdyn365.IActionInput {\r\n public Inquiry:string;\r\n public description: string;\r\n public email: string;\r\n public firstName: string;\r\n public lastName: string;\r\n public phone: string;\r\n // public termNcondition: boolean;\r\n public updateNpromotion: boolean;\r\n public fileBase64Code: string | ArrayBuffer | null | undefined;\r\n public file: File | undefined | null;\r\n public token: string | undefined;\r\n public contactID: string | undefined;\r\n constructor(\r\n data:IPostContactUsFormInput,\r\n file: File | undefined | null,\r\n fileBase64Code: string | ArrayBuffer | null | undefined,\r\n CRMtoken: string | undefined,\r\n contactID: string | undefined\r\n ) {\r\n this.Inquiry = data.Inquiry;\r\n this.description = data.description;\r\n this.email = data.email;\r\n this.firstName = data.firstName;\r\n this.lastName = data.lastName;\r\n this.phone = `+${data.countryCode}${data.phone}`;\r\n // this.termNcondition = data.termNcondition;\r\n this.updateNpromotion = data.updateNpromotion;\r\n this.file = file;\r\n this.fileBase64Code = fileBase64Code;\r\n this.token = CRMtoken;\r\n this.contactID = contactID;\r\n }\r\n // TODO: Determine if the results of this get action should cache the results and if so provide\r\n // a cache object type and an appropriate cache key\r\n public getCacheKey = () => `CONTACTUSFORM`;\r\n public getCacheObjectType = () => 'CONTACTUSFORM';\r\n public dataCacheType = (): Msdyn365.CacheType => 'none';\r\n}\r\n\r\n// TODO: Create a data model here or import one to capture the response of the action\r\nexport interface IPostContactUsFormData {\r\n status: boolean;\r\n msg:string | undefined;\r\n id: string | undefined;\r\n}\r\n\r\n\r\n/**\r\n * TODO: Use this function to create the input required to make the action call\r\n */\r\nconst contactFormInput = (args: Msdyn365.ICreateActionContext,inputData:IPostContactUsFormInput,file: File | undefined | null,fileBase64Code: string | ArrayBuffer | null | undefined , CRMtoken: string | undefined, contactID:string|undefined ): Msdyn365.IActionInput => {\r\n return new PostContactUsFormInput(inputData,file,fileBase64Code,CRMtoken,contactID);\r\n};\r\n\r\n\r\n/**\r\n * TODO: Use this function to call your action and process the results as needed\r\n */\r\nasync function contactFormDataAction(input: PostContactUsFormInput, ctx: Msdyn365.IActionContext): Promise {\r\n try{\r\n const token = input.token;\r\n const szfCRMDomain = ctx.requestContext.app.config.szfCRMDomain;\r\n let data = {};\r\n if(input.file && input.file.name){\r\n data = {\r\n \"title\" : `Case by {${input.firstName} ${input.lastName}_${input.email}}`,\r\n \"customerid_contact@odata.bind\": `/contacts(${input.contactID})`, //Contact, to be replaced by contact created\r\n \"szf_CaseType@odata.bind\": `/szf_casetypes(${input.Inquiry})`, //Get case type first, then replace it with the ID\r\n \"caseorigincode\":3, //Website, will remain hardcoded\r\n \"prioritycode\": 2, //Normal, will remain hardcoded\r\n \"szf_description\":`${input.description}`, // Details of case\r\n \"Incident_Annotation\":[{ //File\r\n \"filename\" :`${input.file?.name}`,\r\n \"isdocument\" : true,\r\n \"subject\":`${input.file?.name}`,\r\n \"documentbody\" : `${input.fileBase64Code}`\r\n }]\r\n };\r\n }else{\r\n data = {\r\n \"title\" : `Case by {${input.firstName} ${input.lastName}_${input.email}}`,\r\n \"customerid_contact@odata.bind\": `/contacts(${input.contactID})`, //Contact, to be replaced by contact created\r\n \"szf_CaseType@odata.bind\": `/szf_casetypes(${input.Inquiry})`, //Get case type first, then replace it with the ID\r\n \"caseorigincode\":3, //Website, will remain hardcoded\r\n \"prioritycode\": 2, //Normal, will remain hardcoded\r\n \"szf_description\":`${input.description}`, // Details of case\r\n };\r\n }\r\n \r\n const response = await Msdyn365.sendRequest(`${szfCRMDomain}/api/data/v9.2//incidents`, \"post\", data, {\r\n timeout: 15000,\r\n headers: {\r\n 'Prefer': 'return=representation',\r\n 'Authorization':`Bearer ${token}`,\r\n 'Content-Type': 'application/json'\r\n }\r\n });\r\n if(response && response.data && response.data.incidentid){\r\n return {\r\n status: true,\r\n msg: 'success',\r\n id: response.data.incidentid\r\n };\r\n }else if (response && response.data && response.data.error){\r\n return {\r\n status: false,\r\n msg: response.data.error.message,\r\n id: undefined\r\n };\r\n }else{\r\n return {\r\n status: false,\r\n msg: undefined,\r\n id: undefined\r\n };\r\n }\r\n }catch(error){\r\n return {\r\n status: false,\r\n id: undefined,\r\n msg: 'Something went wrong, Please try again later.'\r\n };\r\n }\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >contactFormDataAction,\r\n // TODO: Give your data action a unique id\r\n id: 'PostContactUsForm',\r\n input: contactFormInput\r\n // TODO: Uncomment the below line if this is a meant to be a batched data action\r\n // isBatched: true\r\n});\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\nimport qs from 'querystring';\r\n/**\r\n * GetCrmToken Input Action\r\n */\r\n\r\n export interface IToken {\r\n token_type: string;\r\n expires_in: string;\r\n ext_expires_in: string;\r\n expires_on: string;\r\n not_before: string;\r\n resource: string;\r\n access_token: string;\r\n}\r\n\r\nexport class GetCrmTokenInput implements Msdyn365.IActionInput {\r\n // TODO: Construct the input needed to run the action\r\n constructor() {}\r\n\r\n // TODO: Determine if the results of this get action should cache the results and if so provide\r\n // a cache object type and an appropriate cache key\r\n public getCacheKey = () => `CRMTOKEN`;\r\n public getCacheObjectType = () => 'CRMTOKEN';\r\n public dataCacheType = (): Msdyn365.CacheType => 'none';\r\n}\r\n\r\n// TODO: Create a data model here or import one to capture the response of the action\r\nexport interface IGetCrmTokenData {\r\n token: string;\r\n}\r\n\r\n/**\r\n * TODO: Use this function to create the input required to make the action call\r\n */\r\nconst createInput = (args: Msdyn365.ICreateActionContext): Msdyn365.IActionInput => {\r\n return new GetCrmTokenInput();\r\n};\r\n\r\n/**\r\n * TODO: Use this function to call your action and process the results as needed\r\n */\r\nasync function action(input: GetCrmTokenInput, ctx: Msdyn365.IActionContext): Promise {\r\n // const apiSettings = Msdyn365.msdyn365Commerce.apiSettings;\r\n\r\n // TODO: Uncomment the below line to get the value from a service\r\n // const response = await Msdyn365.sendRequest('/get/example/id/1', 'get');\r\n const { szfCRMDomain, szfCRMClientSecret} = ctx.requestContext.app.config;\r\n const data = qs.stringify({\r\n 'resource': `${szfCRMDomain}`,\r\n 'client_id': '1d4d5b5c-c710-472d-b8ac-104788da8da1',\r\n 'client_secret': `${szfCRMClientSecret}`,\r\n 'grant_type': 'client_credentials'\r\n });\r\n const response = await Msdyn365.sendRequest(\"https://login.microsoftonline.com/c03a7c9b-0691-48f2-a884-93fe49a74786/oauth2/token\", \"post\", data, {\r\n headers: {\r\n 'Content-Type': 'application/x-www-form-urlencoded',\r\n 'Cookie': 'fpc=AopThjyphGZIqV8tMvZOskskZZdbAQAAAETfudgOAAAA; stsservicecookie=estsfd; x-ms-gateway-slice=estsfd'\r\n }\r\n });\r\n if(response && response.status===200){\r\n return {\r\n token : response.data.access_token\r\n };\r\n }else{\r\n return {token : ''};\r\n }\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >action,\r\n // TODO: Give your data action a unique id\r\n id: 'GetCrmToken',\r\n input: createInput\r\n // TODO: Uncomment the below line if this is a meant to be a batched data action\r\n // isBatched: true\r\n});\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\nimport {IPostBOInput} from './../modules/szf-business-op-form/szf-business-op-form.view';\r\nimport axios from 'axios';\r\n/**\r\n * PostBusinessOpCase Input Action\r\n */\r\nexport interface IFile{\r\n fileData: File | undefined;\r\n base64: string | ArrayBuffer | null | undefined;\r\n}\r\nexport interface IBOCaseAPIPayLoad {\r\n szf_name: string;\r\n szf_organizationname: string;\r\n szf_email: string;\r\n szf_phoneno: string;\r\n szf_participatedwithszfpreviously: boolean;\r\n szf_typeofparticipation: string | null;\r\n szf_heardaboutus: string | null;\r\n szf_heardaboutusother: string | null;\r\n szf_categories: number;\r\n szf_countrypavilion: string | null;\r\n szf_productsshowcase: string | null;\r\n szf_type: string | null;\r\n szf_source: number;\r\n szf_kioskactivity: string | null;\r\n szf_serviceactivity: string | null;\r\n szf_description: string;\r\n szf_businessopportunity_Annotations?: {\r\n filename: string;\r\n isdocument: boolean;\r\n subject: string;\r\n documentbody: string;\r\n }[];\r\n \"szf_Customer_contact@odata.bind\": string;\r\n}\r\nexport class PostBusinessOpCaseInput implements Msdyn365.IActionInput {\r\n // TODO: Construct the input needed to run the action\r\n public szf_name: string;\r\n public szf_organizationname: string;\r\n public szf_email: string;\r\n public szf_phoneno: string;\r\n public szf_participatedwithszfpreviously: boolean;\r\n public szf_typeofparticipation: string;\r\n public szf_heardaboutus: string;\r\n public szf_heardaboutusother: string;\r\n public szf_categories: number;\r\n public szf_countrypavilion: string;\r\n public szf_productsshowcase: string;\r\n public szf_type: string;\r\n public szf_kioskactivity: string;\r\n public szf_serviceactivity: string;\r\n public szf_description: string;\r\n public tradeLicenseFile: IFile;\r\n public presentationFile: IFile;\r\n public CRMtoken: string | undefined;\r\n public contactID: string | undefined;\r\n // public termNcondition: boolean;\r\n // public updateNpromotion: boolean;\r\n constructor(data:IPostBOInput) {\r\n this.szf_name = data.fullName;\r\n this.szf_organizationname= data.organizationName;\r\n this.szf_email= data.email;\r\n this.szf_phoneno= `${data.countryCode}${data.phone}`;\r\n this.szf_participatedwithszfpreviously= data.previousParticipant ==='1' ? true: false;\r\n this.szf_typeofparticipation= data.previousParticipantType;\r\n this.szf_heardaboutus= data.hearAbout;\r\n this.szf_heardaboutusother= data.others;\r\n this.szf_categories= data.categories;\r\n this.szf_countrypavilion= data.listOfCountryPavilions.toString();\r\n this.szf_productsshowcase= data.typeOfProducts.toString();\r\n this.szf_type= data.typeOfRestaurantsCoffeeShops ? data.typeOfRestaurantsCoffeeShops : data.typeOfKiosksFoodTrucks;\r\n this.szf_kioskactivity= data.kioskActivity;\r\n this.szf_serviceactivity= data.serviceActivity;\r\n this.szf_description= data.description;\r\n this.CRMtoken= data.CRMtoken;\r\n this.contactID= data.contactID;\r\n this.tradeLicenseFile = {\r\n fileData: data.tradeLicenseFile,\r\n base64: data.tradeLicensefileBase64Code\r\n };\r\n this.presentationFile = {\r\n fileData: data.presentationFile,\r\n base64: data.presentationfileBase64Code\r\n };\r\n // this.termNcondition= data.termNcondition;\r\n // this.updateNpromotion= data.updateNpromotion;\r\n }\r\n\r\n // TODO: Determine if the results of this get action should cache the results and if so provide\r\n // a cache object type and an appropriate cache key\r\n public getCacheKey = () => `SZFBUSINESSOPPCASE`;\r\n public getCacheObjectType = () => 'SZFBUSINESSOPPCASE';\r\n public dataCacheType = (): Msdyn365.CacheType => 'none';\r\n}\r\n\r\n// TODO: Create a data model here or import one to capture the response of the action\r\nexport interface IPostBusinessOpCaseData {\r\n status: boolean;\r\n msg:string | undefined;\r\n id: string | undefined;\r\n}\r\n\r\n/**\r\n * TODO: Use this function to create the input required to make the action call\r\n */\r\nconst createBOCaseInput = (args: Msdyn365.ICreateActionContext,inputData:IPostBOInput): Msdyn365.IActionInput => {\r\n return new PostBusinessOpCaseInput(inputData);\r\n};\r\n\r\n/**\r\n * TODO: Use this function to call your action and process the results as needed\r\n */\r\nasync function BOCaseDataAction(input: PostBusinessOpCaseInput, ctx: Msdyn365.IActionContext): Promise {\r\n // const apiSettings = Msdyn365.msdyn365Commerce.apiSettings;\r\n const szfCRMDomain = ctx.requestContext.app.config.szfCRMDomain;\r\n let data: IBOCaseAPIPayLoad = {\r\n \"szf_name\": input.szf_name,\r\n \"szf_organizationname\": input.szf_organizationname,\r\n \"szf_email\": input.szf_email,\r\n \"szf_phoneno\": input.szf_phoneno,\r\n \"szf_participatedwithszfpreviously\": input.szf_participatedwithszfpreviously,\r\n \"szf_typeofparticipation\": input.szf_typeofparticipation ? input.szf_typeofparticipation : null,\r\n \"szf_heardaboutus\": input.szf_heardaboutus ? input.szf_heardaboutus : null,\r\n \"szf_heardaboutusother\": input.szf_heardaboutusother ? input.szf_heardaboutusother : null,\r\n \"szf_categories\": input.szf_categories,\r\n \"szf_countrypavilion\": input.szf_countrypavilion ? input.szf_countrypavilion : null,\r\n \"szf_productsshowcase\": input.szf_productsshowcase ? input.szf_productsshowcase : null,\r\n \"szf_type\": input.szf_type ? input.szf_type : null,\r\n \"szf_source\": 1,\r\n \"szf_kioskactivity\": input.szf_kioskactivity ? input.szf_kioskactivity : null,\r\n \"szf_serviceactivity\": input.szf_serviceactivity ? input.szf_serviceactivity : null,\r\n \"szf_description\": input.szf_description,\r\n \"szf_Customer_contact@odata.bind\": `/contacts(${input.contactID})` //test contact\r\n };\r\n if(input.tradeLicenseFile && input.tradeLicenseFile.fileData && input.tradeLicenseFile.fileData?.name){\r\n if(data.szf_businessopportunity_Annotations){\r\n data = {\r\n ...data,\r\n \"szf_businessopportunity_Annotations\": [\r\n ...data.szf_businessopportunity_Annotations,\r\n {\r\n \"filename\" :`${input.tradeLicenseFile.fileData?.name}`,\r\n \"isdocument\" : true,\r\n \"subject\":`Trade License`,\r\n \"documentbody\" : `${input.tradeLicenseFile.base64}`\r\n }\r\n ]\r\n }\r\n }else{\r\n data = {\r\n ...data,\r\n \"szf_businessopportunity_Annotations\": [\r\n {\r\n \"filename\" :`${input.tradeLicenseFile.fileData?.name}`,\r\n \"isdocument\" : true,\r\n \"subject\":`Trade License`,\r\n \"documentbody\" : `${input.tradeLicenseFile.base64}`\r\n }\r\n ]\r\n }\r\n }\r\n }\r\n if(input.presentationFile && input.presentationFile.fileData && input.presentationFile.fileData?.name){\r\n if(data.szf_businessopportunity_Annotations){\r\n data = {\r\n ...data,\r\n \"szf_businessopportunity_Annotations\": [\r\n ...data.szf_businessopportunity_Annotations,\r\n {\r\n \"filename\" :`${input.presentationFile.fileData?.name}`,\r\n \"isdocument\" : true,\r\n \"subject\":`Presentation`,\r\n \"documentbody\" : `${input.presentationFile.base64}`\r\n }\r\n ]\r\n }\r\n }else{\r\n data = {\r\n ...data,\r\n \"szf_businessopportunity_Annotations\": [\r\n {\r\n \"filename\" :`${input.presentationFile.fileData?.name}`,\r\n \"isdocument\" : true,\r\n \"subject\":`Presentation`,\r\n \"documentbody\" : `${input.presentationFile.base64}`\r\n }\r\n ]\r\n }\r\n }\r\n }\r\n const response = await axios.post(`${szfCRMDomain}/api/data/v9.2//szf_businessopportunities`,data,{\r\n headers: { \r\n 'Prefer': 'return=representation', \r\n 'Content-Type': 'application/json', \r\n 'Authorization': `Bearer ${input.CRMtoken}`,\r\n 'Cookie': 'ARRAffinity=a0cabaca1e89d18f0f4123d056dbb9e1cefb17d8da01b66962b2dc7ffb4a189deb29bb4b19df1459d2ea781b605f33064b9fea1f144b525b9d7676625c4ffb5408DB5EAB3C80FFDC613303632; ReqClientId=797635cc-3220-4d23-95ab-4c1fd0f38f88; orgId=df0699dc-bf43-4643-8928-2934590e2913'\r\n },\r\n timeout: 25000\r\n })\r\n\r\n // const response = await Msdyn365.sendRequest(`https://operations-szf-uat.crm15.dynamics.com/api/data/v9.2//szf_businessopportunities`, \"post\", data, {\r\n // headers: {\r\n // 'Prefer': 'return=representation',\r\n // 'Content-Type': 'application/json',\r\n // 'content-length': '999999999999',\r\n // 'Authorization': `Bearer ${input.CRMtoken}`,\r\n // 'Cookie': 'ARRAffinity=a0cabaca1e89d18f0f4123d056dbb9e1cefb17d8da01b66962b2dc7ffb4a189deb29bb4b19df1459d2ea781b605f33064b9fea1f144b525b9d7676625c4ffb5408DB5EAB3C80FFDC613303632; ReqClientId=797635cc-3220-4d23-95ab-4c1fd0f38f88; orgId=df0699dc-bf43-4643-8928-2934590e2913'\r\n // }\r\n // });\r\n if(response && response.data && response.data.szf_businessopportunityid){\r\n return {\r\n status: true,\r\n msg: 'success',\r\n id: response.data.szf_businessopportunityid\r\n };\r\n }else if (response && response.data && response.data.error){\r\n return {\r\n status: false,\r\n msg: response.data.error.message,\r\n id: undefined\r\n };\r\n }else{\r\n return {\r\n status: false,\r\n msg: undefined,\r\n id: undefined\r\n };\r\n }\r\n // TODO: Uncomment the below line to get the value from a service\r\n // const response = await Msdyn365.sendRequest('/get/example/id/1', 'get');\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >BOCaseDataAction,\r\n // TODO: Give your data action a unique id\r\n id: 'PostBusinessOpCase',\r\n input: createBOCaseInput\r\n // TODO: Uncomment the below line if this is a meant to be a batched data action\r\n // isBatched: true\r\n});\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\n\r\n/**\r\n * GetExistingContact Input Action\r\n */\r\n\r\nexport class GetExistingContactInput implements Msdyn365.IActionInput {\r\n // TODO: Construct the input needed to run the action\r\n public token: string | undefined;\r\n public email: string | undefined;\r\n public phone: string | undefined;\r\n constructor(token : string | undefined, email: string | undefined,phone:string | undefined) {\r\n this.phone = phone;\r\n this.email = email;\r\n this.token = token;\r\n }\r\n // TODO: Determine if the results of this get action should cache the results and if so provide\r\n // a cache object type and an appropriate cache key\r\n public getCacheKey = () => `SZFEXISTINGCONTACT`;\r\n public getCacheObjectType = () => 'SZFEXISTINGCONTACT';\r\n public dataCacheType = (): Msdyn365.CacheType => 'none';\r\n}\r\n\r\n// TODO: Create a data model here or import one to capture the response of the action\r\nexport interface IGetExistingContactData {\r\n status: boolean;\r\n id: string | undefined;\r\n}\r\n\r\n/**\r\n * TODO: Use this function to create the input required to make the action call\r\n */\r\nconst createExistingContactInput = (args: Msdyn365.ICreateActionContext, token: string, email: string,phone: string): Msdyn365.IActionInput => {\r\n return new GetExistingContactInput(token, email,phone);\r\n};\r\n\r\n/**\r\n * TODO: Use this function to call your action and process the results as needed\r\n */\r\nasync function existingContactDataAction(input: GetExistingContactInput, ctx: Msdyn365.IActionContext): Promise {\r\n const token = input.token;\r\n const email = input.email;\r\n const phone = input.phone;\r\n const szfCRMDomain = ctx.requestContext.app.config.szfCRMDomain;\r\n const response = await Msdyn365.sendRequest(`${szfCRMDomain}/api/data/v9.2//contacts?$select=emailaddress1,firstname,lastname,mobilephone &$filter=emailaddress1 eq \\'${email}\\' or mobilephone eq \\'%2B${phone}\\'`, \"get\", {}, {\r\n headers: {\r\n 'Authorization':`Bearer ${token}`\r\n }\r\n });\r\n if(response && response.data && response.data.value && response.data.value.length > 0 && response.data.value[0].contactid){\r\n return {\r\n status: true,\r\n id: response.data.value[0].contactid\r\n };\r\n }else{\r\n return {\r\n status: false,\r\n id: undefined\r\n };\r\n }\r\n // const apiSettings = Msdyn365.msdyn365Commerce.apiSettings;\r\n\r\n // TODO: Uncomment the below line to get the value from a service\r\n // const response = await Msdyn365.sendRequest('/get/example/id/1', 'get');\r\n // return { text: 'Static data from action' };\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >existingContactDataAction,\r\n // TODO: Give your data action a unique id\r\n id: 'GetExistingContact',\r\n input: createExistingContactInput\r\n // TODO: Uncomment the below line if this is a meant to be a batched data action\r\n // isBatched: true\r\n});\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\n\r\n/**\r\n * GetCrmNationalityIdsForTefanawwal Input Action\r\n */\r\nexport class GetCrmNationalityIdsForTefanawwalInput implements Msdyn365.IActionInput {\r\n // TODO: Construct the input needed to run the action\r\n public token: string | undefined;\r\n constructor(token : string | undefined) {\r\n this.token = token;\r\n }\r\n\r\n // TODO: Determine if the results of this get action should cache the results and if so provide\r\n // a cache object type and an appropriate cache key\r\n public getCacheKey = () => `CRMNATIONALITYIDS`;\r\n public getCacheObjectType = () => 'CRMNATIONALITYIDS';\r\n public dataCacheType = (): Msdyn365.CacheType => 'none';\r\n}\r\n\r\n// TODO: Create a data model here or import one to capture the response of the action\r\nexport interface IGetCrmNationalityIdsForTefanawwalData {\r\n szf_nationalityid: string;\r\n szf_name: string;\r\n szf_name_arabic: string;\r\n\r\n}\r\n\r\nexport interface IGetTefanNationalityOptionsData {\r\n status: boolean,\r\n data: IGetCrmNationalityIdsForTefanawwalData[] | undefined,\r\n}\r\n\r\n/**\r\n * TODO: Use this function to create the input required to make the action call\r\n */\r\nconst createNationalityIdsInput = (args: Msdyn365.ICreateActionContext,token:string): Msdyn365.IActionInput => {\r\n return new GetCrmNationalityIdsForTefanawwalInput(token);\r\n};\r\n\r\n/**\r\n * TODO: Use this function to call your action and process the results as needed\r\n */\r\nasync function nationalityIdsDataAction(input: GetCrmNationalityIdsForTefanawwalInput, ctx: Msdyn365.IActionContext): Promise {\r\n // const apiSettings = Msdyn365.msdyn365Commerce.apiSettings;\r\n\r\n const token = input.token;\r\n const szfCRMDomainForTefanAwwal = ctx.requestContext.app.config.szfCRMDomainForTefanAwwal;\r\n\r\n const response = await Msdyn365.sendRequest(`${szfCRMDomainForTefanAwwal}/api/data/v9.1/szf_nationalities?$select=szf_nationalityid,szf_name,szf_name_arabic`, \"get\", {}, {\r\n headers: {\r\n 'Authorization':`Bearer ${token}`\r\n }\r\n });\r\n if(response && response.data && response.data.value && response.data.value.length > 0){\r\n return {\r\n status: true,\r\n data: response.data.value\r\n };\r\n }else{\r\n return {\r\n status: false,\r\n data: undefined\r\n };\r\n }\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >nationalityIdsDataAction,\r\n // TODO: Give your data action a unique id\r\n id: 'GetCrmNationalityIdsForTefanawwal',\r\n input: createNationalityIdsInput\r\n // TODO: Uncomment the below line if this is a meant to be a batched data action\r\n // isBatched: true\r\n});\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\n\r\n/**\r\n * GetInqueryOptions Input Action\r\n */\r\nexport class GetInqueryOptionsInput implements Msdyn365.IActionInput {\r\n // TODO: Construct the input needed to run the action\r\n public token: string | undefined;\r\n constructor(token: string| undefined) {\r\n this.token = token;\r\n }\r\n\r\n // TODO: Determine if the results of this get action should cache the results and if so provide\r\n // a cache object type and an appropriate cache key\r\n public getCacheKey = () => `SZFCONTACTUSINQUERYOPTIONS`;\r\n public getCacheObjectType = () => 'SZFCONTACTUSINQUERYOPTIONS';\r\n public dataCacheType = (): Msdyn365.CacheType => 'none';\r\n}\r\n\r\n// TODO: Create a data model here or import one to capture the response of the action\r\nexport interface IGetInqueryOptionsData {\r\n status: boolean,\r\n data: any[] | undefined,\r\n}\r\n\r\n/**\r\n * TODO: Use this function to create the input required to make the action call\r\n */\r\nconst createInqueryOptionInput = (args: Msdyn365.ICreateActionContext,token:string): Msdyn365.IActionInput => {\r\n return new GetInqueryOptionsInput(token);\r\n};\r\n\r\n/**\r\n * TODO: Use this function to call your action and process the results as needed\r\n */\r\nasync function getInqueryOptionsDataAction(input: GetInqueryOptionsInput, ctx: Msdyn365.IActionContext): Promise {\r\n const token = input.token;\r\n const szfCRMDomain = ctx.requestContext.app.config.szfCRMDomain;\r\n const response = await Msdyn365.sendRequest(`${szfCRMDomain}/api/data/v9.2//szf_casetypes?$select=szf_name,szf_arabic`, \"get\", {}, {\r\n headers: {\r\n 'Authorization':`Bearer ${token}`\r\n }\r\n });\r\n if(response && response.data && response.data.value && response.data.value.length > 0){\r\n return {\r\n status: true,\r\n data: response.data.value\r\n };\r\n }else{\r\n return {\r\n status: false,\r\n data: undefined\r\n };\r\n }\r\n\r\n // const apiSettings = Msdyn365.msdyn365Commerce.apiSettings;\r\n\r\n // TODO: Uncomment the below line to get the value from a service\r\n // const response = await Msdyn365.sendRequest('/get/example/id/1', 'get');\r\n // return { text: 'Static data from action' };\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >getInqueryOptionsDataAction,\r\n // TODO: Give your data action a unique id\r\n id: 'GetInqueryOptions',\r\n input: createInqueryOptionInput\r\n // TODO: Uncomment the below line if this is a meant to be a batched data action\r\n // isBatched: true\r\n});\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\nimport qs from 'querystring';\r\nimport { IToken } from './get-crm-token.action';\r\n\r\n\r\n/**\r\n * GetCrmTokenForTefanAwaalCategory Input Action\r\n */\r\n\r\nexport class GetCrmTokenForTefanAwaalCategoryInput implements Msdyn365.IActionInput {\r\n // TODO: Construct the input needed to run the action\r\n constructor() {}\r\n\r\n // TODO: Determine if the results of this get action should cache the results and if so provide\r\n // a cache object type and an appropriate cache key\r\n public getCacheKey = () => `CRMTOKEN1`;\r\n public getCacheObjectType = () => 'CRMTOKEN1';\r\n public dataCacheType = (): Msdyn365.CacheType => 'none';\r\n}\r\n\r\n// TODO: Create a data model here or import one to capture the response of the action\r\nexport interface IGetCrmTokenForTefanAwaalCategoryData {\r\n token: string;\r\n}\r\n\r\n/**\r\n * TODO: Use this function to create the input required to make the action call\r\n */\r\nconst createInput = (args: Msdyn365.ICreateActionContext): Msdyn365.IActionInput => {\r\n return new GetCrmTokenForTefanAwaalCategoryInput();\r\n};\r\n\r\n/**\r\n * TODO: Use this function to call your action and process the results as needed\r\n */\r\nasync function action(\r\n input: GetCrmTokenForTefanAwaalCategoryInput,\r\n ctx: Msdyn365.IActionContext\r\n): Promise {\r\n \r\n const { szfCRMDomainForTefanAwwal, szfCRMClientSecretForTefanAwwal, szfCRMClientIdForTefanAwwal } = ctx.requestContext.app.config;\r\n\r\n const data = qs.stringify({\r\n client_id: szfCRMClientIdForTefanAwwal && szfCRMClientIdForTefanAwwal,\r\n client_secret: szfCRMClientSecretForTefanAwwal && szfCRMClientSecretForTefanAwwal,\r\n grant_type: 'client_credentials',\r\n resource: `${szfCRMDomainForTefanAwwal && szfCRMDomainForTefanAwwal}/`\r\n });\r\n\r\n const response = await Msdyn365.sendRequest(\"https://login.microsoftonline.com/c03a7c9b-0691-48f2-a884-93fe49a74786/oauth2/token\", \"get\", data, {\r\n headers: {\r\n 'Content-Type': 'application/x-www-form-urlencoded',\r\n 'Cookie': 'fpc=AtsmsMTTjZxGgn3xxGhR2NIkPfoRAQAAAMaXLd0OAAAA; stsservicecookie=estsfd; x-ms-gateway-slice=estsfd'\r\n }\r\n });\r\n if(response && response.status===200){\r\n return {\r\n token : response.data.access_token\r\n };\r\n }else{\r\n return {token : ''};\r\n }\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >action,\r\n // TODO: Give your data action a unique id\r\n id: 'GetCrmTokenForTefanAwaalCategory',\r\n input: createInput\r\n // TODO: Uncomment the below line if this is a meant to be a batched data action\r\n // isBatched: true\r\n});\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\nimport { getCategoriesAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/CategoriesDataActions.g';\r\nimport { Category } from '@msdyn365-commerce/retail-proxy';\r\n/**\r\n * GetCategoryDetails Input Action\r\n */\r\nexport class GetCategoryDetailsInput implements Msdyn365.IActionInput {\r\n constructor() {}\r\n public getCacheKey = () => `get-category-details`;\r\n public getCacheObjectType = () => 'get-category-details';\r\n public dataCacheType = (): Msdyn365.CacheType => 'request';\r\n}\r\n\r\nexport interface IGetCategoryDetailsData {\r\n categoryDetails: Category | undefined;\r\n}\r\n\r\nconst createInput = (args: Msdyn365.ICreateActionContext): Msdyn365.IActionInput => {\r\n return new GetCategoryDetailsInput();\r\n};\r\n\r\nasync function action(input: GetCategoryDetailsInput, ctx: Msdyn365.IActionContext): Promise {\r\n const categoryId = Number(ctx.requestContext.query?.categoryId);\r\n const getCategories = await getCategoriesAsync(\r\n { callerContext: ctx },\r\n ctx.requestContext.apiSettings.channelId\r\n );\r\n const getCategoryDetails: Category | undefined = getCategories?.find((item: Category) => item.RecordId === categoryId);\r\n return {\r\n categoryDetails: getCategoryDetails\r\n };\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >action,\r\n id: 'GetCategoryDetails',\r\n input: createInput\r\n});\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport * as Msdyn365 from \"@msdyn365-commerce/core\";\r\nimport axios from \"axios\";\r\nimport querystring from 'querystring';\r\n// const querystring = require('querystring');\r\n\r\n/**\r\n * GetAtpToken Input Action\r\n */\r\n// interface IToken {\r\n// token_type: string;\r\n// expires_in: string;\r\n// ext_expires_in: string;\r\n// expires_on: string;\r\n// not_before: string;\r\n// resource: string;\r\n// access_token: string;\r\n// }\r\n\r\nexport class GetTokenInput implements Msdyn365.IActionInput {\r\n // TODO: Construct the input needed to run the action\r\n constructor() { }\r\n\r\n // TODO: Determine if the results of this get action should cache the results and if so provide\r\n // a cache object type and an appropriate cache key\r\n public getCacheKey = () => `GetSharePointToken`;\r\n public getCacheObjectType = () => \"GetSharePointToken\";\r\n public dataCacheType = (): Msdyn365.CacheType => \"none\";\r\n}\r\n\r\n/**\r\n * TODO: Use this function to create the input required to make the action call\r\n */\r\nconst createInput = (\r\n args: Msdyn365.ICreateActionContext\r\n): Msdyn365.IActionInput => {\r\n return new GetTokenInput();\r\n};\r\n\r\nconst fetchResourceAndTenant = async (domain: any, siteName: any): Promise<{ tenatId: string , resource: string }> => {\r\n try {\r\n await axios(\r\n `https://${domain}.sharepoint.com/sites/${siteName}/_vti_bin/client.svc/`,\r\n {\r\n method: \"GET\",\r\n headers: {\r\n Authorization: `Bearer`,\r\n }\r\n }\r\n );\r\n } catch (error) {\r\n // @ts-ignore\r\n const response = error?.response?.headers?.[\"www-authenticate\"];\r\n const regex = /realm=\"([^\"]*)\".*client_id=\"([^\"]*)\"/;\r\n const matches = response.match(regex);\r\n const tenatId = matches[1];\r\n const resource = matches[2];\r\n return { tenatId, resource };\r\n }\r\n return { tenatId: '', resource: '' }; \r\n};\r\n\r\nconst fetchToken = async (tenatId: string | undefined, resource: string | undefined, clientId: string, secret: string, domain: string): Promise => {\r\n if (tenatId && resource) {\r\n\r\n\r\n const url = `https://accounts.accesscontrol.windows.net/${tenatId}/tokens/OAuth/2`;\r\n const headers = {\r\n Authorization: 'Bearer',\r\n 'Content-Type': 'application/x-www-form-urlencoded',\r\n };\r\n\r\n const data = {\r\n grant_type: 'client_credentials',\r\n client_id: `${clientId}@${tenatId}`,\r\n client_secret: `${secret}`,\r\n resource: `${resource}/${domain}.sharepoint.com@${tenatId}`,\r\n };\r\n\r\n const requestBody = querystring.stringify(data);\r\n\r\n return axios.post(url, requestBody, { headers })\r\n .then((response) => {\r\n return response?.data?.access_token\r\n })\r\n .catch((error) => {\r\n console.error('Error getting token:', error);\r\n });\r\n }\r\n return undefined;\r\n};\r\n\r\n\r\nasync function getToken(ctx: Msdyn365.IRequestContext) {\r\n let token: string | undefined;\r\n\r\n /**\r\n * we need to create sharepoint site first \r\n * and then needs to generate client id and it's secret and give all permisions\r\n * Register Add-In using the AppRegNew form\r\n * try to get token SSR\r\n */\r\n if (process.env.CURRENT_ENVIRONMENT === \"node\") {\r\n // const siteName = \"SZF\";\r\n // const domain = \"visionetsys\";\r\n // const secret = \"gWq9FCsXH2VA06zh28N/2L9SeVw1qJTe1pwxTZHe/VU=\";\r\n // const clientId = '24c715c7-8a12-4dd6-80a6-902efba3667b';\r\n\r\n // const siteName = \"SZFEcommerce\";\r\n // const domain = \"zayedfestival\";\r\n // const secret = \"j/hcvlz0kWhvlVHhlDbGwSN/VdD855DPqeFN3CO6tNk=\";\r\n // const clientId = '6a1e8d91-af56-4d02-a7d1-b601df3cbb71';\r\n\r\n const siteName = \"SZF-Ecommerce\";\r\n const domain = \"zayedfestival\";\r\n const secret = \"UFvBGJ3TdJYQ8DmIlGEe9nxNmQJYZyw4LPsfTUYT4y4=\";\r\n const clientId = '95ba8411-3d62-4e2d-95c9-dcf08f6473f1';\r\n\r\n const { tenatId, resource } = await fetchResourceAndTenant(domain, siteName);\r\n token = await fetchToken(tenatId, resource, clientId, secret, domain);\r\n }\r\n\r\n return { token: token };\r\n}\r\n\r\n/**\r\n * TODO: Use this function to call your action and process the results as needed\r\n */\r\nasync function getTokenAction(\r\n input: GetTokenInput,\r\n ctx: Msdyn365.IActionContext\r\n): Promise {\r\n const response = await getToken(ctx.requestContext);\r\n return response;\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >getTokenAction,\r\n // TODO: Give your data action a unique id\r\n id: \"GetToken\",\r\n input: createInput,\r\n // TODO: Uncomment the below line if this is a meant to be a batched data action\r\n // isBatched: true\r\n});\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\nimport { ITefanAwwalCaseInput } from './../modules/szf-tefan-awal-form/szf-tefan-awal-form.view';\r\n/**\r\n * PostTefanawwalForm Input Action\r\n */\r\n\r\n export interface ICategoryDataActionInput {\r\n fullName: string;\r\n contactNumber: string;\r\n email: string;\r\n emiratesID: string;\r\n nationality: string;\r\n categoryId: string;\r\n termsAndCondition: boolean;\r\n categories?: string[];\r\n}\r\nexport class PostTefanawwalFormInput implements Msdyn365.IActionInput {\r\n // TODO: Construct the input needed to run the action\r\n public token: string | undefined;\r\n public target: ICategoryDataActionInput[]\r\n constructor(data: ITefanAwwalCaseInput) {\r\n this.token=data.token;\r\n this.target = data.target;\r\n }\r\n\r\n // TODO: Determine if the results of this get action should cache the results and if so provide\r\n // a cache object type and an appropriate cache key\r\n public getCacheKey = () => `TEFANAWWALCASE`;\r\n public getCacheObjectType = () => 'TEFANAWWALCASE';\r\n public dataCacheType = (): Msdyn365.CacheType => 'none';\r\n}\r\n\r\n// TODO: Create a data model here or import one to capture the response of the action\r\nexport interface IPostTefanawwalFormData {\r\n status: boolean;\r\n msg: string | undefined;\r\n id: string | undefined;\r\n}\r\n\r\n/**\r\n * TODO: Use this function to create the input required to make the action call\r\n */\r\nconst tefanAwwalCaseCreateInput = (args: Msdyn365.ICreateActionContext, inputData: ITefanAwwalCaseInput): Msdyn365.IActionInput => {\r\n return new PostTefanawwalFormInput(inputData);\r\n};\r\n\r\n/**\r\n * TODO: Use this function to call your action and process the results as needed\r\n */\r\nasync function tefanAwwalDataAction(input: PostTefanawwalFormInput, ctx: Msdyn365.IActionContext): Promise {\r\n // const apiSettings = Msdyn365.msdyn365Commerce.apiSettings;\r\n try{\r\n const token = input.token;\r\n const szfCRMDomainForTefanAwwal = ctx.requestContext.app.config.szfCRMDomainForTefanAwwal;\r\n const data = {\r\n Targets : input.target.map((i) => {\r\n return {\r\n \"szf_name\" : i.fullName ? i.fullName : '',\r\n \"szf_Nationality@odata.bind\" : `/szf_nationalities(${i.nationality ? i.nationality : ''})`,\r\n \"szf_Category@odata.bind\" : `/szf_tefanalawwalcategories(${i.categoryId ? i.categoryId : ''})`,\r\n \"szf_emiratesid\" : i.emiratesID ? i.emiratesID : '',\r\n \"szf_email\" : i.email ? i.email : '',\r\n \"szf_contactnumber\" : i.contactNumber ? i.contactNumber : '',\r\n \"szf_iacceptfield\" : i.termsAndCondition ? i.termsAndCondition : '',\r\n \"@odata.type\": \"Microsoft.Dynamics.CRM.szf_tefanalawwal\"\r\n };\r\n })\r\n }\r\n const response = await Msdyn365.sendRequest(`${szfCRMDomainForTefanAwwal}/api/data/v9.1/szf_tefanalawwals/Microsoft.Dynamics.CRM.CreateMultiple`, \"post\", data, {\r\n timeout: 15000,\r\n headers: {\r\n 'Prefer': 'return=representation',\r\n 'Authorization':`Bearer ${token}`,\r\n 'Content-Type': 'application/json'\r\n }\r\n }); \r\n if(response && response.data && response.data.Ids && response.data.Ids.length > 0){\r\n return {\r\n status: true,\r\n msg: 'success',\r\n id: response.data.Ids[0]\r\n };\r\n }else if (response && response.data && response.data.error){\r\n return {\r\n status: false,\r\n msg: response.data.error.message,\r\n id: undefined\r\n };\r\n }else{\r\n return {\r\n status: false,\r\n msg: undefined,\r\n id: undefined\r\n };\r\n }\r\n }catch(error){\r\n return {\r\n status: false,\r\n id: undefined,\r\n msg: 'Something went wrong, Please try again later.'\r\n };\r\n }\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >tefanAwwalDataAction,\r\n // TODO: Give your data action a unique id\r\n id: 'PostTefanawwalForm',\r\n input: tefanAwwalCaseCreateInput\r\n // TODO: Uncomment the below line if this is a meant to be a batched data action\r\n // isBatched: true\r\n});\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\n\r\n/**\r\n * GetCrmCategoryIdsForTefanawwal Input Action\r\n */\r\nexport class GetCrmCategoryIdsForTefanawwalInput implements Msdyn365.IActionInput {\r\n // TODO: Construct the input needed to run the action\r\n public token: string | undefined;\r\n constructor(token : string | undefined) {\r\n this.token = token;\r\n }\r\n\r\n // TODO: Determine if the results of this get action should cache the results and if so provide\r\n // a cache object type and an appropriate cache key\r\n public getCacheKey = () => `CRMCATEGORYIDS`;\r\n public getCacheObjectType = () => 'CRMCATEGORYIDS';\r\n public dataCacheType = (): Msdyn365.CacheType => 'none';\r\n}\r\n\r\n// TODO: Create a data model here or import one to capture the response of the action\r\nexport interface IGetCrmCategoryIdsForTefanawwalData {\r\n szf_tefanalawwalcategoryid: string;\r\n szf_hqid: string;\r\n szf_name: string;\r\n szf_arabicname: string;\r\n\r\n}\r\nexport interface IGetTefanCategoryOptionsData {\r\n status: boolean,\r\n data: IGetCrmCategoryIdsForTefanawwalData[] | undefined,\r\n}\r\n/**\r\n * TODO: Use this function to create the input required to make the action call\r\n */\r\nconst createCategoryIdsInput = (args: Msdyn365.ICreateActionContext, token: string): Msdyn365.IActionInput => {\r\n return new GetCrmCategoryIdsForTefanawwalInput(token);\r\n};\r\n\r\n/**\r\n * TODO: Use this function to call your action and process the results as needed\r\n */\r\nasync function categoryIdsDataAction(input: GetCrmCategoryIdsForTefanawwalInput, ctx: Msdyn365.IActionContext): Promise {\r\n const token = input.token;\r\n const szfCRMDomainForTefanAwwal = ctx.requestContext.app.config.szfCRMDomainForTefanAwwal;\r\n\r\n const response = await Msdyn365.sendRequest(`${szfCRMDomainForTefanAwwal}/api/data/v9.1/szf_tefanalawwalcategories?$select=szf_tefanalawwalcategoryid,szf_name,szf_arabicname`, \"get\", {}, {\r\n headers: {\r\n 'Authorization':`Bearer ${token}`\r\n }\r\n });\r\n if(response && response.data && response.data.value && response.data.value.length > 0){\r\n return {\r\n status: true,\r\n data: response.data.value\r\n };\r\n }else{\r\n return {\r\n status: false,\r\n data: undefined\r\n };\r\n }\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >categoryIdsDataAction,\r\n // TODO: Give your data action a unique id\r\n id: 'GetCrmCategoryIdsForTefanawwal',\r\n input: createCategoryIdsInput\r\n // TODO: Uncomment the below line if this is a meant to be a batched data action\r\n // isBatched: true\r\n});\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\n\r\n/**\r\n * GetPaymentStatus Input Action\r\n */\r\nexport class GetPaymentStatusInput implements Msdyn365.IActionInput {\r\n // TODO: Construct the input needed to run the action\r\n constructor() {}\r\n\r\n // TODO: Determine if the results of this get action should cache the results and if so provide\r\n // a cache object type and an appropriate cache key\r\n public getCacheKey = () => `LARIPAYMENTSTATUS`;\r\n public getCacheObjectType = () => 'LARIPAYMENTSTATUS';\r\n public dataCacheType = (): Msdyn365.CacheType => 'none';\r\n}\r\n\r\n// TODO: Create a data model here or import one to capture the response of the action\r\nexport interface IGetPaymentStatusData {\r\n text: string;\r\n}\r\n\r\n/**\r\n * TODO: Use this function to create the input required to make the action call\r\n */\r\nconst createInput = (args: Msdyn365.ICreateActionContext): Msdyn365.IActionInput => {\r\n return new GetPaymentStatusInput();\r\n};\r\n\r\n/**\r\n * TODO: Use this function to call your action and process the results as needed\r\n */\r\nasync function action(input: GetPaymentStatusInput, ctx: Msdyn365.IActionContext): Promise {\r\n // const apiSettings = Msdyn365.msdyn365Commerce.apiSettings;\r\n\r\n // TODO: Uncomment the below line to get the value from a service\r\n // const response = await Msdyn365.sendRequest('/get/example/id/1', 'get');\r\n return { text: 'Static data from action' };\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >action,\r\n // TODO: Give your data action a unique id\r\n id: 'GetPaymentStatus',\r\n input: createInput\r\n // TODO: Uncomment the below line if this is a meant to be a batched data action\r\n // isBatched: true\r\n});\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\n\r\n/**\r\n * GetCrmExistingCategoryRecordForTefanawwal Input Action\r\n */\r\n\r\nexport interface IExistingCategoryDataActionInput {\r\n token: string,\r\n emiratesID: string,\r\n}\r\nexport interface IGetCrmCategoryIdsForTefanawwalData {\r\n categoryID: string;\r\n categoryNameArabic: string;\r\n categoryNameEnglish: string;\r\n emiratesID: string;\r\n hqID: string\r\n\r\n}\r\nexport class GetCrmExistingCategoryRecordForTefanawwalInput implements Msdyn365.IActionInput {\r\n // TODO: Construct the input needed to run the action\r\n public token: string | undefined;\r\n public emiratesID: string | undefined;\r\n constructor(data: IExistingCategoryDataActionInput) {\r\n this.token = data.token;\r\n this.emiratesID = data.emiratesID;\r\n }\r\n\r\n // TODO: Determine if the results of this get action should cache the results and if so provide\r\n // a cache object type and an appropriate cache key\r\n public getCacheKey = () => `GETEXISTINGCATEGORYRECORD`;\r\n public getCacheObjectType = () => 'GETEXISTINGCATEGORYRECORD';\r\n public dataCacheType = (): Msdyn365.CacheType => 'none';\r\n}\r\n\r\n// TODO: Create a data model here or import one to capture the response of the action\r\nexport interface IGetCrmExistingCategoryRecordForTefanawwalData {\r\n status: boolean,\r\n data: IGetCrmCategoryIdsForTefanawwalData[] | undefined,\r\n}\r\n\r\n/**\r\n * TODO: Use this function to create the input required to make the action call\r\n */\r\nconst createExistingCategoryRecordInput = (args: Msdyn365.ICreateActionContext,inputData:IExistingCategoryDataActionInput ): Msdyn365.IActionInput => {\r\n return new GetCrmExistingCategoryRecordForTefanawwalInput(inputData);\r\n};\r\n\r\n/**\r\n * TODO: Use this function to call your action and process the results as needed\r\n */\r\nasync function getExistingCategoryRecordAction(input: GetCrmExistingCategoryRecordForTefanawwalInput, ctx: Msdyn365.IActionContext): Promise {\r\n const token = input.token;\r\n const szfCRMDomainForTefanAwwal = ctx.requestContext.app.config.szfCRMDomainForTefanAwwal;\r\n const data = { \r\n \"ActionName\": \"GetEmiratesById\",\r\n \"EmiratesID\": input.emiratesID ? `${input.emiratesID}` : ''\r\n }\r\n const response = await Msdyn365.sendRequest(`${szfCRMDomainForTefanAwwal}/api/data/v9.2/sys_Invoke`, \"post\", data, {\r\n headers: {\r\n 'Authorization':`Bearer ${token}`\r\n }\r\n });\r\n console.log('response',response)\r\n \r\n if(response && response.data && response.data.ResponseMessage && response.data.ResponseMessage.length > 0){\r\n const responseInJson = JSON.parse(response.data.ResponseMessage)\r\n return {\r\n status: true,\r\n data: responseInJson\r\n };\r\n }else{\r\n return {\r\n status: false,\r\n data: undefined\r\n };\r\n }\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >getExistingCategoryRecordAction,\r\n // TODO: Give your data action a unique id\r\n id: 'GetCrmExistingCategoryRecordForTefanawwal',\r\n input: createExistingCategoryRecordInput\r\n // TODO: Uncomment the below line if this is a meant to be a batched data action\r\n // isBatched: true\r\n});\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\nimport { initiatePaymentAsync } from './MyFatoorahPaymentDataActionExtension.g';\r\nimport { IInitiatePaymentResponse } from './MyFatoorahPaymentDataServiceEntities.g';\r\n/**\r\n * GetMyFatoorahPaymentMethods Input Action\r\n */\r\nexport class GetMyFatoorahPaymentMethodsInput implements Msdyn365.IActionInput {\r\n // TODO: Construct the input needed to run the action\r\n constructor() {}\r\n\r\n // TODO: Determine if the results of this get action should cache the results and if so provide\r\n // a cache object type and an appropriate cache key\r\n public getCacheKey = () => `MYFATOORAHPAYMENTMETHODS`;\r\n public getCacheObjectType = () => 'MYFATOORAHPAYMENTMETHODS';\r\n public dataCacheType = (): Msdyn365.CacheType => 'application';\r\n}\r\n\r\n// TODO: Create a data model here or import one to capture the response of the action\r\nexport interface IGetMyFatoorahPaymentMethodsData extends IInitiatePaymentResponse {\r\n text?: string;\r\n}\r\n\r\n/**\r\n * TODO: Use this function to create the input required to make the action call\r\n */\r\nconst createInput = (args: Msdyn365.ICreateActionContext): Msdyn365.IActionInput => {\r\n return new GetMyFatoorahPaymentMethodsInput();\r\n};\r\n\r\n/**\r\n * TODO: Use this function to call your action and process the results as needed\r\n */\r\nasync function action(input: GetMyFatoorahPaymentMethodsInput, ctx: Msdyn365.IActionContext): Promise {\r\n // const apiSettings = Msdyn365.msdyn365Commerce.apiSettings;\r\n try{\r\n const paymentCurrencyISO = ctx.requestContext.app.config.paymentCurrencyISO || \"AED\" ;\r\n const paymentMethodList = await initiatePaymentAsync({callerContext: ctx},1,paymentCurrencyISO)\r\n return paymentMethodList;\r\n }catch(error){\r\n console.log(error)\r\n return { \r\n IsSuccess: false,\r\n Message: \"Something went wrong.\",\r\n Data: {},\r\n }\r\n }\r\n // TODO: Uncomment the below line to get the value from a service\r\n // const response = await Msdyn365.sendRequest('/get/example/id/1', 'get');\r\n // return { text: 'Static data from action' };\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >action,\r\n // TODO: Give your data action a unique id\r\n id: 'GetMyFatoorahPaymentMethods',\r\n input: createInput\r\n // TODO: Uncomment the below line if this is a meant to be a batched data action\r\n // isBatched: true\r\n});\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\nimport {IPostBOInput} from './../modules/szf-business-op-form/szf-business-op-form.view';\r\nimport axios from 'axios';\r\n\r\n\r\nexport interface IFile{\r\n fileData: File | undefined;\r\n base64: string | ArrayBuffer | null | undefined;\r\n}\r\n\r\n/**\r\n * PostCheckoutDataToCrm Input Action\r\n */\r\nexport class PostCheckoutDataToCrmInput implements Msdyn365.IActionInput {\r\n // TODO: Construct the input needed to run the action\r\n public szf_name: string;\r\n public szf_organizationname: string;\r\n public szf_email: string;\r\n public szf_phoneno: string;\r\n public szf_participatedwithszfpreviously: boolean;\r\n public szf_typeofparticipation: string;\r\n public szf_heardaboutus: string;\r\n public szf_heardaboutusother: string;\r\n public szf_categories: number;\r\n public szf_countrypavilion: string;\r\n public szf_productsshowcase: string;\r\n public szf_type: string;\r\n public szf_kioskactivity: string;\r\n public szf_serviceactivity: string;\r\n public szf_description: string;\r\n public tradeLicenseFile: IFile;\r\n public presentationFile: IFile;\r\n public CRMtoken: string | undefined;\r\n public contactID: string | undefined;\r\n // public termNcondition: boolean;\r\n // public updateNpromotion: boolean;\r\n constructor(data:IPostBOInput) {\r\n this.szf_name = data.fullName;\r\n this.szf_organizationname= data.organizationName;\r\n this.szf_email= data.email;\r\n this.szf_phoneno= `${data.countryCode}${data.phone}`;\r\n this.szf_participatedwithszfpreviously= data.previousParticipant ==='1' ? true: false;\r\n this.szf_typeofparticipation= data.previousParticipantType;\r\n this.szf_heardaboutus= data.hearAbout;\r\n this.szf_heardaboutusother= data.others;\r\n this.szf_categories= data.categories;\r\n this.szf_countrypavilion= data.listOfCountryPavilions.toString();\r\n this.szf_productsshowcase= data.typeOfProducts.toString();\r\n this.szf_type= data.typeOfRestaurantsCoffeeShops ? data.typeOfRestaurantsCoffeeShops : data.typeOfKiosksFoodTrucks;\r\n this.szf_kioskactivity= data.kioskActivity;\r\n this.szf_serviceactivity= data.serviceActivity;\r\n this.szf_description= data.description;\r\n this.CRMtoken= data.CRMtoken;\r\n this.contactID= data.contactID;\r\n this.tradeLicenseFile = {\r\n fileData: data.tradeLicenseFile,\r\n base64: data.tradeLicensefileBase64Code\r\n };\r\n this.presentationFile = {\r\n fileData: data.presentationFile,\r\n base64: data.presentationfileBase64Code\r\n };\r\n // this.termNcondition= data.termNcondition;\r\n // this.updateNpromotion= data.updateNpromotion;\r\n }\r\n // TODO: Determine if the results of this get action should cache the results and if so provide\r\n // a cache object type and an appropriate cache key\r\n public getCacheKey = () => `CRMCHECKOUT`;\r\n public getCacheObjectType = () => 'CRMCHECKOUT';\r\n public dataCacheType = (): Msdyn365.CacheType => 'none';\r\n}\r\n\r\n// TODO: Create a data model here or import one to capture the response of the action\r\nexport interface IPostCheckoutDataToCrmData {\r\n status: boolean;\r\n msg:string | undefined;\r\n id: string | undefined;\r\n}\r\n\r\n/**\r\n * TODO: Use this function to create the input required to make the action call\r\n */\r\nconst createInput = (\r\n args: Msdyn365.ICreateActionContext,\r\n inputData:IPostBOInput\r\n ): Msdyn365.IActionInput => {\r\n return new PostCheckoutDataToCrmInput(inputData);\r\n};\r\n\r\n/**\r\n * TODO: Use this function to call your action and process the results as needed\r\n */\r\nasync function action(input: PostCheckoutDataToCrmInput, ctx: Msdyn365.IActionContext): Promise {\r\n // const apiSettings = Msdyn365.msdyn365Commerce.apiSettings;\r\n\r\n // TODO: Uncomment the below line to get the value from a service\r\n // const response = await Msdyn365.sendRequest('/get/example/id/1', 'get');\r\n // return { text: 'Static data from action' };\r\n\r\n const szfCRMDomain = ctx.requestContext.app.config.szfCRMDomain;\r\n const data = {\r\n \"szf_name\": input.szf_name,\r\n \"szf_organizationname\": input.szf_organizationname,\r\n \"szf_email\": input.szf_email,\r\n \"szf_phoneno\": input.szf_phoneno,\r\n \"szf_participatedwithszfpreviously\": input.szf_participatedwithszfpreviously,\r\n \"szf_typeofparticipation\": input.szf_typeofparticipation ? input.szf_typeofparticipation : null,\r\n \"szf_heardaboutus\": input.szf_heardaboutus ? input.szf_heardaboutus : null,\r\n \"szf_heardaboutusother\": input.szf_heardaboutusother ? input.szf_heardaboutusother : null,\r\n \"szf_categories\": input.szf_categories,\r\n \"szf_countrypavilion\": input.szf_countrypavilion ? input.szf_countrypavilion : null,\r\n \"szf_productsshowcase\": input.szf_productsshowcase ? input.szf_productsshowcase : null,\r\n \"szf_type\": input.szf_type ? input.szf_type : null,\r\n \"szf_source\": 1,\r\n \"szf_kioskactivity\": input.szf_kioskactivity ? input.szf_kioskactivity : null,\r\n \"szf_serviceactivity\": input.szf_serviceactivity ? input.szf_serviceactivity : null,\r\n \"szf_description\": input.szf_description,\r\n \"szf_businessopportunity_Annotations\": [\r\n {\r\n \"filename\" :`${input.tradeLicenseFile.fileData?.name}`,\r\n \"isdocument\" : true,\r\n \"subject\":`Trade License`,\r\n \"documentbody\" : `${input.tradeLicenseFile.base64}`\r\n },\r\n {\r\n \"filename\" :`${input.presentationFile.fileData?.name}`,\r\n \"isdocument\" : true,\r\n \"subject\":`Presentation`,\r\n \"documentbody\" : `${input.presentationFile.base64}`\r\n }\r\n ],\r\n \"szf_Customer_contact@odata.bind\": `/contacts(${input.contactID})` //test contact\r\n };\r\n const response = await axios.post(`${szfCRMDomain}/api/data/v9.2//szf_businessopportunities`,data,{\r\n headers: { \r\n 'Prefer': 'return=representation', \r\n 'Content-Type': 'application/json', \r\n 'Authorization': `Bearer ${input.CRMtoken}`,\r\n 'Cookie': 'ARRAffinity=a0cabaca1e89d18f0f4123d056dbb9e1cefb17d8da01b66962b2dc7ffb4a189deb29bb4b19df1459d2ea781b605f33064b9fea1f144b525b9d7676625c4ffb5408DB5EAB3C80FFDC613303632; ReqClientId=797635cc-3220-4d23-95ab-4c1fd0f38f88; orgId=df0699dc-bf43-4643-8928-2934590e2913'\r\n },\r\n timeout: 25000\r\n })\r\n\r\n if( response \r\n && response.data \r\n // && response.data.szf_businessopportunityid\r\n ){\r\n return {\r\n status: true,\r\n msg: 'success',\r\n id: undefined\r\n // id: response.data.szf_businessopportunityid\r\n };\r\n }else if (response && response.data && response.data.error){\r\n return {\r\n status: false,\r\n msg: response.data.error.message,\r\n id: undefined\r\n };\r\n }else{\r\n return {\r\n status: false,\r\n msg: undefined,\r\n id: undefined\r\n };\r\n }\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >action,\r\n // TODO: Give your data action a unique id\r\n id: 'PostCheckoutDataToCrm',\r\n input: createInput\r\n // TODO: Uncomment the below line if this is a meant to be a batched data action\r\n // isBatched: true\r\n});\r\n","module.exports = React;","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\n\r\n/**\r\n * GetFatoorahPaymentState Input Action\r\n */\r\nexport class GetFatoorahPaymentStateInput implements Msdyn365.IActionInput {\r\n // TODO: Construct the input needed to run the action\r\n constructor() {}\r\n\r\n // TODO: Determine if the results of this get action should cache the results and if so provide\r\n // a cache object type and an appropriate cache key\r\n public getCacheKey = () => `FATOORAHPAYMENTSTATE`;\r\n public getCacheObjectType = () => 'FATOORAHPAYMENTSTATE';\r\n public dataCacheType = (): Msdyn365.CacheType => 'request';\r\n}\r\n\r\n// TODO: Create a data model here or import one to capture the response of the action\r\nexport interface IGetFatoorahPaymentStateData {\r\n paymentState: boolean;\r\n}\r\n\r\n/**\r\n * TODO: Use this function to create the input required to make the action call\r\n */\r\nconst createInput = (args: Msdyn365.ICreateActionContext): Msdyn365.IActionInput => {\r\n return new GetFatoorahPaymentStateInput();\r\n};\r\n\r\n/**\r\n * TODO: Use this function to call your action and process the results as needed\r\n */\r\nasync function action(input: GetFatoorahPaymentStateInput, ctx: Msdyn365.IActionContext): Promise {\r\n // const apiSettings = Msdyn365.msdyn365Commerce.apiSettings;\r\n\r\n // TODO: Uncomment the below line to get the value from a service\r\n // const response = await Msdyn365.sendRequest('/get/example/id/1', 'get');\r\n return { paymentState: false };\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >action,\r\n // TODO: Give your data action a unique id\r\n id: 'GetFatoorahPaymentState',\r\n input: createInput\r\n // TODO: Uncomment the below line if this is a meant to be a batched data action\r\n // isBatched: true\r\n});\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\nimport { getCategoriesAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/CategoriesDataActions.g';\r\nimport { Category } from '@msdyn365-commerce/retail-proxy';\r\n\r\nexport class GetCategoriesInput implements Msdyn365.IActionInput {\r\n constructor() {}\r\n public getCacheKey = () => `Get-Categories`;\r\n public getCacheObjectType = () => 'Get-Categories';\r\n public dataCacheType = (): Msdyn365.CacheType => 'request';\r\n}\r\nexport interface IGetCategoriesData {\r\n filteredCategories: Category[];\r\n parentCategory?: Category | undefined;\r\n}\r\n\r\nconst createInput = (args: Msdyn365.ICreateActionContext): Msdyn365.IActionInput => {\r\n return new GetCategoriesInput();\r\n};\r\n\r\nasync function action(input: GetCategoriesInput, ctx: Msdyn365.IActionContext): Promise {\r\n const recId = Number(ctx.requestContext.urlTokens.recordId);\r\n const getCategories: Category[] = await getCategoriesAsync(\r\n { callerContext: ctx },\r\n ctx.requestContext.apiSettings.channelId\r\n );\r\n\r\n const filteredCategories = recId ? getCategories.filter((item: Category) => item.ParentCategory === recId) : getCategories;\r\n const category = getCategories.find((item: Category) => item.RecordId === recId);\r\n\r\n return { filteredCategories: filteredCategories, parentCategory: category };\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >action,\r\n id: 'GetCategories',\r\n input: createInput\r\n});\r\n","module.exports = ReactDOM;","const binding = { modules: {}, dataActions: {} };\n\n const registerActionId = (actionPath) => {\n if (binding.dataActions[actionPath] &&\n binding.dataActions[actionPath].default &&\n binding.dataActions[actionPath].default.prototype &&\n binding.dataActions[actionPath].default.prototype.id) {\n binding.dataActions[binding.dataActions[actionPath].default.prototype.id] = binding.dataActions[actionPath];\n } else {\n Object.keys(binding.dataActions[actionPath] || {}).forEach(exportName => {\n if (binding.dataActions[actionPath][exportName] &&\n binding.dataActions[actionPath][exportName].prototype &&\n binding.dataActions[actionPath][exportName].prototype.Action) {\n binding.dataActions[binding.dataActions[actionPath][exportName].prototype.id] = binding.dataActions[actionPath][exportName];\n }\n })\n }\n };\n\n const registerSanitizedActionPath = (sanitizedActionPath, dataAction) => {\n if (process.env.NODE_ENV === 'development') {\n if (!dataAction.default) {\n throw new Error('Data action path does not have a default export');\n }\n if (!(dataAction.default.prototype.id && binding.dataActions[dataAction.default.prototype.id]) || !binding.dataActions[sanitizedActionPath]) {\n binding.dataActions[sanitizedActionPath] = dataAction;\n }\n } else {\n binding.dataActions[sanitizedActionPath] = dataAction;\n if (!binding.dataActions[sanitizedActionPath].default) {\n throw new Error('Data action path ' + sanitizedActionPath + ' does not have a default export');\n }\n binding.dataActions[sanitizedActionPath].default.prototype.RegistrationId = sanitizedActionPath;\n if (binding.dataActions[sanitizedActionPath].default.prototype.id) {\n binding.dataActions[binding.dataActions[sanitizedActionPath].default.prototype.id] = sanitizedActionPath;\n }\n }\n };\n \n\n { \n const actionPath = 'actions/create-order-for-payment.action';\n binding.dataActions[actionPath] = require('partner/actions/create-order-for-payment.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'actions/get-categories.action';\n binding.dataActions[actionPath] = require('partner/actions/get-categories.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'actions/get-category-details.action';\n binding.dataActions[actionPath] = require('partner/actions/get-category-details.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'actions/get-crm-category-ids-for-tefanawwal.action';\n binding.dataActions[actionPath] = require('partner/actions/get-crm-category-ids-for-tefanawwal.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'actions/get-crm-existing-category-record-for-tefanawwal.action';\n binding.dataActions[actionPath] = require('partner/actions/get-crm-existing-category-record-for-tefanawwal.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'actions/get-crm-nationality-ids-for-tefanawwal.action';\n binding.dataActions[actionPath] = require('partner/actions/get-crm-nationality-ids-for-tefanawwal.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'actions/get-crm-token-for-tefan-awaal-category.action';\n binding.dataActions[actionPath] = require('partner/actions/get-crm-token-for-tefan-awaal-category.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'actions/get-crm-token.action';\n binding.dataActions[actionPath] = require('partner/actions/get-crm-token.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'actions/get-existing-contact.action';\n binding.dataActions[actionPath] = require('partner/actions/get-existing-contact.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'actions/get-fatoorah-payment-state.action';\n binding.dataActions[actionPath] = require('partner/actions/get-fatoorah-payment-state.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'actions/get-inquery-options.action';\n binding.dataActions[actionPath] = require('partner/actions/get-inquery-options.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'actions/get-my-fatoorah-payment-methods.action';\n binding.dataActions[actionPath] = require('partner/actions/get-my-fatoorah-payment-methods.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'actions/get-payment-access-token.action';\n binding.dataActions[actionPath] = require('partner/actions/get-payment-access-token.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'actions/get-payment-status.action';\n binding.dataActions[actionPath] = require('partner/actions/get-payment-status.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'actions/get-sharepoint-token.action';\n binding.dataActions[actionPath] = require('partner/actions/get-sharepoint-token.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'actions/post-business-op-case.action';\n binding.dataActions[actionPath] = require('partner/actions/post-business-op-case.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'actions/post-checkout-data-to-crm.action';\n binding.dataActions[actionPath] = require('partner/actions/post-checkout-data-to-crm.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'actions/post-contact-us-form.action';\n binding.dataActions[actionPath] = require('partner/actions/post-contact-us-form.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'actions/post-new-contact.action';\n binding.dataActions[actionPath] = require('partner/actions/post-new-contact.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'actions/post-tefanawwal-form.action';\n binding.dataActions[actionPath] = require('partner/actions/post-tefanawwal-form.action');\n registerActionId(actionPath);\n }\n\n \n window.__bindings__ = window.__bindings__ || {};\n window.__bindings__.modules = {\n ...window.__bindings__.modules || {},\n ...binding.modules\n };\n \n window.__bindings__.packageDataActions = {};\n window.__bindings__.packageDataActions['__local__'] = {\n ...binding.dataActions\n };","// @ts-ignore -- Unused import\r\nimport * as EntityClasses from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceModels.g';\r\nimport * as Entities from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\r\n// @ts-ignore -- Unused import\r\nimport { jsonLightReadStringPropertyValue } from '@msdyn365-commerce/retail-proxy/dist/externals';\r\n\r\n/**\r\n * VSICategoryEXT entity interface.\r\n */\r\nexport interface IVSICategoryEXT {\r\n RecordId: number;\r\n Id: number;\r\n Name?: string;\r\n ParentCategory: number;\r\n DisplayOrder: number;\r\n Description?: string;\r\n TextValueTranslation?: Entities.TextValueTranslation[];\r\n ExtensionProperties?: Entities.CommerceProperty[];\r\n}\r\n\r\n/**\r\n * PaymentMethod entity interface.\r\n */\r\nexport interface IPaymentMethod {\r\n PaymentMethodId: number;\r\n PaymentMethodAr?: string;\r\n PaymentMethodEn?: string;\r\n PaymentMethodCode?: string;\r\n IsDirectPayment: boolean;\r\n ServiceCharge: number;\r\n TotalAmount: number;\r\n CurrencyIso?: string;\r\n ImageUrl?: string;\r\n IsEmbeddedSupported: boolean;\r\n PaymentCurrencyIso?: string;\r\n}\r\n\r\n/**\r\n * Data entity interface.\r\n */\r\nexport interface IData {\r\n PaymentMethods?: IPaymentMethod[];\r\n}\r\n\r\n/**\r\n * InitiatePaymentResponse entity interface.\r\n */\r\nexport interface IInitiatePaymentResponse {\r\n IsSuccess?: boolean;\r\n Message?: string;\r\n Data?: IData;\r\n}\r\n\r\n/**\r\n * InvoiceTransaction entity interface.\r\n */\r\nexport interface IInvoiceTransaction {\r\n TransactionDate: Date;\r\n PaymentGateway?: string;\r\n ReferenceId?: string;\r\n TrackId?: string;\r\n TransactionId?: string;\r\n PaymentId?: string;\r\n AuthorizationId?: string;\r\n TransactionStatus?: string;\r\n TransationValue?: string;\r\n CustomerServiceCharge?: string;\r\n TotalServiceCharge?: string;\r\n DueValue?: string;\r\n PaidCurrency?: string;\r\n PaidCurrencyValue?: string;\r\n VatAmount?: string;\r\n IpAddress?: string;\r\n Country?: string;\r\n Currency?: string;\r\n CardNumber?: string;\r\n ErrorCode?: string;\r\n}\r\n\r\n/**\r\n * GetPaymentStatusResponseData entity interface.\r\n */\r\nexport interface IGetPaymentStatusResponseData {\r\n InvoiceId: number;\r\n InvoiceStatus?: string;\r\n InvoiceReference?: string;\r\n CustomerReference?: string;\r\n CreatedDate: Date;\r\n ExpiryDate?: string;\r\n ExpiryTime?: string;\r\n InvoiceValue: number;\r\n CustomerName?: string;\r\n CustomerMobile?: string;\r\n CustomerEmail?: string;\r\n InvoiceDisplayValue?: string;\r\n DueDeposit: number;\r\n DepositStatus?: string;\r\n InvoiceTransactions?: IInvoiceTransaction[];\r\n}\r\n\r\n/**\r\n * GetPaymentStatusResponse entity interface.\r\n */\r\nexport interface IGetPaymentStatusResponse {\r\n IsSuccess?: boolean;\r\n Message?: string;\r\n Data?: IGetPaymentStatusResponseData;\r\n}\r\n\r\n/**\r\n * ExecutePaymentResponseData entity interface.\r\n */\r\nexport interface IExecutePaymentResponseData {\r\n InvoiceId: number;\r\n IsDirectPayment: boolean;\r\n PaymentURL?: string;\r\n CustomerReference?: string;\r\n RecurringId?: string;\r\n}\r\n\r\n/**\r\n * ExecutePaymentResponse entity interface.\r\n */\r\nexport interface IExecutePaymentResponse {\r\n IsSuccess?: boolean;\r\n Message?: string;\r\n Data?: IExecutePaymentResponseData;\r\n}\r\n\r\n/**\r\n * VSICategoryEXT entity class.\r\n */\r\nexport class VSICategoryEXTExtensionClass implements IVSICategoryEXT {\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public RecordId: number;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public Id: number;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public Name: string;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public ParentCategory: number;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public DisplayOrder: number;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public Description: string;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public TextValueTranslation: Entities.TextValueTranslation[];\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public ExtensionProperties: Entities.CommerceProperty[];\r\n\r\n // Navigation properties names\r\n\r\n /**\r\n * Construct an object from odata response.\r\n * @param {any} odataObject The odata result object.\r\n */\r\n constructor(odataObject?: any) {\r\n odataObject = odataObject || {};\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.RecordId = odataObject.RecordId ? parseInt(odataObject.RecordId, 10) : 0;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.Id = odataObject.Id ? parseInt(odataObject.Id, 10) : 0;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.Name = odataObject.Name;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.ParentCategory = odataObject.ParentCategory ? parseInt(odataObject.ParentCategory, 10) : 0;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.DisplayOrder = odataObject.DisplayOrder ? parseFloat(odataObject.DisplayOrder) : 0;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.Description = odataObject.Description;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.TextValueTranslation = undefined;\r\n if (odataObject.TextValueTranslation) {\r\n this.TextValueTranslation = [];\r\n for (var i = 0; i < odataObject.TextValueTranslation.length; i++) {\r\n if (odataObject.TextValueTranslation[i]) {\r\n if (odataObject.TextValueTranslation[i]['@odata.type']) {\r\n var className: string = odataObject.TextValueTranslation[i]['@odata.type'];\r\n className = className.substr(className.lastIndexOf('.') + 1).concat('Class');\r\n if (EntityClasses[className]) {\r\n this.TextValueTranslation[i] = new EntityClasses[className](odataObject.TextValueTranslation[i]);\r\n }\r\n } else {\r\n this.TextValueTranslation[i] = new EntityClasses.TextValueTranslationClass(odataObject.TextValueTranslation[i]);\r\n }\r\n } else {\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.TextValueTranslation[i] = undefined;\r\n }\r\n }\r\n }\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.ExtensionProperties = undefined;\r\n if (odataObject.ExtensionProperties) {\r\n this.ExtensionProperties = [];\r\n for (var ij = 0; ij < odataObject.ExtensionProperties.length; ij++) {\r\n if (odataObject.ExtensionProperties[ij]) {\r\n if (odataObject.ExtensionProperties[ij]['@odata.type']) {\r\n var className1: string = odataObject.ExtensionProperties[ij]['@odata.type'];\r\n className1 = className1.substr(className1.lastIndexOf('.') + 1).concat('Class');\r\n if (EntityClasses[className1]) {\r\n this.ExtensionProperties[ij] = new EntityClasses[className1](odataObject.ExtensionProperties[ij]);\r\n }\r\n } else {\r\n this.ExtensionProperties[ij] = new EntityClasses.CommercePropertyClass(odataObject.ExtensionProperties[ij]);\r\n }\r\n } else {\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.ExtensionProperties[ij] = undefined;\r\n }\r\n }\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * PaymentMethod entity class.\r\n */\r\nexport class PaymentMethodExtensionClass implements IPaymentMethod {\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public PaymentMethodId: number;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public PaymentMethodAr: string;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public PaymentMethodEn: string;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public PaymentMethodCode: string;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public IsDirectPayment: boolean;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public ServiceCharge: number;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public TotalAmount: number;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public CurrencyIso: string;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public ImageUrl: string;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public IsEmbeddedSupported: boolean;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public PaymentCurrencyIso: string;\r\n\r\n // Navigation properties names\r\n\r\n /**\r\n * Construct an object from odata response.\r\n * @param {any} odataObject The odata result object.\r\n */\r\n constructor(odataObject?: any) {\r\n odataObject = odataObject || {};\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.PaymentMethodId = odataObject.PaymentMethodId;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.PaymentMethodAr = odataObject.PaymentMethodAr;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.PaymentMethodEn = odataObject.PaymentMethodEn;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.PaymentMethodCode = odataObject.PaymentMethodCode;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.IsDirectPayment = odataObject.IsDirectPayment;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.ServiceCharge = odataObject.ServiceCharge ? parseFloat(odataObject.ServiceCharge) : 0;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.TotalAmount = odataObject.TotalAmount ? parseFloat(odataObject.TotalAmount) : 0;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.CurrencyIso = odataObject.CurrencyIso;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.ImageUrl = odataObject.ImageUrl;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.IsEmbeddedSupported = odataObject.IsEmbeddedSupported;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.PaymentCurrencyIso = odataObject.PaymentCurrencyIso;\r\n }\r\n}\r\n\r\n/**\r\n * Data entity class.\r\n */\r\nexport class DataExtensionClass implements IData {\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public PaymentMethods: IPaymentMethod[];\r\n\r\n // Navigation properties names\r\n\r\n /**\r\n * Construct an object from odata response.\r\n * @param {any} odataObject The odata result object.\r\n */\r\n constructor(odataObject?: any) {\r\n odataObject = odataObject || {};\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.PaymentMethods = undefined;\r\n if (odataObject.PaymentMethods) {\r\n this.PaymentMethods = [];\r\n for (var i = 0; i < odataObject.PaymentMethods.length; i++) {\r\n if (odataObject.PaymentMethods[i]) {\r\n if (odataObject.PaymentMethods[i]['@odata.type']) {\r\n var className: string = odataObject.PaymentMethods[i]['@odata.type'];\r\n className = className.substr(className.lastIndexOf('.') + 1).concat('Class');\r\n if (EntityClasses[className]) {\r\n this.PaymentMethods[i] = new EntityClasses[className](odataObject.PaymentMethods[i]);\r\n }\r\n } else {\r\n this.PaymentMethods[i] = new PaymentMethodExtensionClass(odataObject.PaymentMethods[i]);\r\n }\r\n } else {\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.PaymentMethods[i] = undefined;\r\n }\r\n }\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * InitiatePaymentResponse entity class.\r\n */\r\nexport class InitiatePaymentResponseExtensionClass implements IInitiatePaymentResponse {\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public IsSuccess: boolean;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public Message: string;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public Data: IData;\r\n\r\n // Navigation properties names\r\n\r\n /**\r\n * Construct an object from odata response.\r\n * @param {any} odataObject The odata result object.\r\n */\r\n constructor(odataObject?: any) {\r\n odataObject = odataObject || {};\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.IsSuccess = odataObject.IsSuccess;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.Message = odataObject.Message;\r\n if (odataObject.Data === null) {\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.Data = undefined;\r\n } else if (odataObject.Data['@odata.type'] === null) {\r\n this.Data = new DataExtensionClass(odataObject.Data);\r\n } else {\r\n this.Data = odataObject?.Data!;\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * InvoiceTransaction entity class.\r\n */\r\nexport class InvoiceTransactionExtensionClass implements IInvoiceTransaction {\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public TransactionDate: Date;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public PaymentGateway: string;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public ReferenceId: string;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public TrackId: string;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public TransactionId: string;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public PaymentId: string;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public AuthorizationId: string;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public TransactionStatus: string;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public TransationValue: string;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public CustomerServiceCharge: string;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public TotalServiceCharge: string;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public DueValue: string;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public PaidCurrency: string;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public PaidCurrencyValue: string;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public VatAmount: string;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public IpAddress: string;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public Country: string;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public Currency: string;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public CardNumber: string;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public ErrorCode: string;\r\n\r\n // Navigation properties names\r\n\r\n /**\r\n * Construct an object from odata response.\r\n * @param {any} odataObject The odata result object.\r\n */\r\n constructor(odataObject?: any) {\r\n odataObject = odataObject || {};\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.TransactionDate =\r\n odataObject.TransactionDate instanceof Date\r\n ? odataObject.TransactionDate\r\n : odataObject.TransactionDate\r\n ? jsonLightReadStringPropertyValue(odataObject.TransactionDate, 'Edm.DateTimeOffset', false)\r\n : undefined;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.PaymentGateway = odataObject.PaymentGateway;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.ReferenceId = odataObject.ReferenceId;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.TrackId = odataObject.TrackId;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.TransactionId = odataObject.TransactionId;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.PaymentId = odataObject.PaymentId;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.AuthorizationId = odataObject.AuthorizationId;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.TransactionStatus = odataObject.TransactionStatus;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.TransationValue = odataObject.TransationValue;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.CustomerServiceCharge = odataObject.CustomerServiceCharge;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.TotalServiceCharge = odataObject.TotalServiceCharge;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.DueValue = odataObject.DueValue;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.PaidCurrency = odataObject.PaidCurrency;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.PaidCurrencyValue = odataObject.PaidCurrencyValue;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.VatAmount = odataObject.VatAmount;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.IpAddress = odataObject.IpAddress;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.Country = odataObject.Country;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.Currency = odataObject.Currency;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.CardNumber = odataObject.CardNumber;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.ErrorCode = odataObject.ErrorCode;\r\n }\r\n}\r\n\r\n/**\r\n * GetPaymentStatusResponseData entity class.\r\n */\r\nexport class GetPaymentStatusResponseDataExtensionClass implements IGetPaymentStatusResponseData {\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public InvoiceId: number;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public InvoiceStatus: string;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public InvoiceReference: string;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public CustomerReference: string;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public CreatedDate: Date;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public ExpiryDate: string;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public ExpiryTime: string;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public InvoiceValue: number;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public CustomerName: string;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public CustomerMobile: string;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public CustomerEmail: string;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public InvoiceDisplayValue: string;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public DueDeposit: number;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public DepositStatus: string;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public InvoiceTransactions: IInvoiceTransaction[];\r\n\r\n // Navigation properties names\r\n\r\n /**\r\n * Construct an object from odata response.\r\n * @param {any} odataObject The odata result object.\r\n */\r\n constructor(odataObject?: any) {\r\n odataObject = odataObject || {};\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.InvoiceId = odataObject.InvoiceId;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.InvoiceStatus = odataObject.InvoiceStatus;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.InvoiceReference = odataObject.InvoiceReference;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.CustomerReference = odataObject.CustomerReference;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.CreatedDate =\r\n odataObject.CreatedDate instanceof Date\r\n ? odataObject.CreatedDate\r\n : odataObject.CreatedDate\r\n ? jsonLightReadStringPropertyValue(odataObject.CreatedDate, 'Edm.DateTimeOffset', false)\r\n : undefined;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.ExpiryDate = odataObject.ExpiryDate;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.ExpiryTime = odataObject.ExpiryTime;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.InvoiceValue = odataObject.InvoiceValue ? parseFloat(odataObject.InvoiceValue) : 0;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.CustomerName = odataObject.CustomerName;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.CustomerMobile = odataObject.CustomerMobile;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.CustomerEmail = odataObject.CustomerEmail;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.InvoiceDisplayValue = odataObject.InvoiceDisplayValue;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.DueDeposit = odataObject.DueDeposit ? parseFloat(odataObject.DueDeposit) : 0;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.DepositStatus = odataObject.DepositStatus;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.InvoiceTransactions = undefined;\r\n if (odataObject.InvoiceTransactions) {\r\n this.InvoiceTransactions = [];\r\n for (var i = 0; i < odataObject.InvoiceTransactions.length; i++) {\r\n if (odataObject.InvoiceTransactions[i]) {\r\n if (odataObject.InvoiceTransactions[i]['@odata.type']) {\r\n var className: string = odataObject.InvoiceTransactions[i]['@odata.type'];\r\n className = className.substr(className.lastIndexOf('.') + 1).concat('Class');\r\n if (EntityClasses[className]) {\r\n this.InvoiceTransactions[i] = new EntityClasses[className](odataObject.InvoiceTransactions[i]);\r\n }\r\n } else {\r\n this.InvoiceTransactions[i] = new InvoiceTransactionExtensionClass(odataObject.InvoiceTransactions[i]);\r\n }\r\n } else {\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.InvoiceTransactions[i] = undefined;\r\n }\r\n }\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * GetPaymentStatusResponse entity class.\r\n */\r\nexport class GetPaymentStatusResponseExtensionClass implements IGetPaymentStatusResponse {\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public IsSuccess: boolean;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public Message: string;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public Data: IGetPaymentStatusResponseData;\r\n\r\n // Navigation properties names\r\n\r\n /**\r\n * Construct an object from odata response.\r\n * @param {any} odataObject The odata result object.\r\n */\r\n constructor(odataObject?: any) {\r\n odataObject = odataObject || {};\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.IsSuccess = odataObject.IsSuccess;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.Message = odataObject.Message;\r\n\r\n if (odataObject.Data === null) {\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.Data = undefined;\r\n } else if (odataObject.Data['@odata.type'] === null) {\r\n this.Data = new GetPaymentStatusResponseDataExtensionClass(odataObject.Data);\r\n } else {\r\n this.Data = odataObject?.Data!;\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * ExecutePaymentResponseData entity class.\r\n */\r\nexport class ExecutePaymentResponseDataExtensionClass implements IExecutePaymentResponseData {\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public InvoiceId: number;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public IsDirectPayment: boolean;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public PaymentURL: string;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public CustomerReference: string;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public RecurringId: string;\r\n\r\n // Navigation properties names\r\n\r\n /**\r\n * Construct an object from odata response.\r\n * @param {any} odataObject The odata result object.\r\n */\r\n constructor(odataObject?: any) {\r\n odataObject = odataObject || {};\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.InvoiceId = odataObject.InvoiceId;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.IsDirectPayment = odataObject.IsDirectPayment;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.PaymentURL = odataObject.PaymentURL;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.CustomerReference = odataObject.CustomerReference;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.RecurringId = odataObject.RecurringId;\r\n }\r\n}\r\n\r\n/**\r\n * ExecutePaymentResponse entity class.\r\n */\r\nexport class ExecutePaymentResponseExtensionClass implements IExecutePaymentResponse {\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public IsSuccess: boolean;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public Message: string;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public Data: IExecutePaymentResponseData;\r\n\r\n // Navigation properties names\r\n\r\n /**\r\n * Construct an object from odata response.\r\n * @param {any} odataObject The odata result object.\r\n */\r\n constructor(odataObject?: any) {\r\n odataObject = odataObject || {};\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.IsSuccess = odataObject.IsSuccess;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.Message = odataObject.Message;\r\n\r\n if (odataObject.Data === null) {\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.Data = undefined;\r\n } else if (odataObject.Data['@odata.type'] === null) {\r\n this.Data = new ExecutePaymentResponseDataExtensionClass(odataObject.Data);\r\n } else {\r\n this.Data = odataObject?.Data!;\r\n }\r\n }\r\n}\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n * THIS FILE IS AN AUTOGENERATED TYPESCRIPT PROXY EXTENSION.\r\n * TO USE THIS FILE, IT MUST BE ADDED TO A D365COMMERCE APPLICATION\r\n */\r\nimport {\r\n AsyncResult,\r\n callActionOrExecute,\r\n DataServiceQuery,\r\n IContext,\r\n IDataServiceRequest,\r\n // IQueryResultSettings,\r\n // @ts-ignore -- Unused import\r\n NullResult\r\n} from '@msdyn365-commerce/retail-proxy';\r\n// @ts-ignore -- Unused import\r\nimport * as EntityClasses from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceModels.g';\r\n// @ts-ignore -- Unused import\r\nimport * as Entities from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\r\nimport * as DataServiceEntities from './MyFatoorahPaymentDataServiceEntities.g';\r\n\r\n// @ts-ignore\r\nfunction orderExtControllerQuery(id?: number): DataServiceQuery {\r\n const key = id ? { Id: id } : null;\r\n return new DataServiceQuery('OrderExtController', 'VSICategoryEXT', DataServiceEntities.VSICategoryEXTExtensionClass, key);\r\n}\r\n\r\nexport function createInitiatePaymentInput(invoiceAmount: number, currencyIso: string): IDataServiceRequest {\r\n const query = orderExtControllerQuery();\r\n return query.createDataServiceRequestForOperation(\r\n 'InitiatePayment',\r\n true,\r\n DataServiceEntities.InitiatePaymentResponseExtensionClass,\r\n 'false',\r\n { bypassCache: 'get', returnEntity: 'DataServiceEntities.IInitiatePaymentResponse' },\r\n { invoiceAmount: invoiceAmount, currencyIso: currencyIso }\r\n );\r\n}\r\n\r\nexport function initiatePaymentAsync(\r\n context: IContext,\r\n invoiceAmount: number,\r\n currencyIso: string\r\n): AsyncResult {\r\n const request = createInitiatePaymentInput(invoiceAmount, currencyIso);\r\n return callActionOrExecute(request, context.callerContext);\r\n}\r\n\r\nexport function createGetPaymentStatusInput(key: string, keyType: string): IDataServiceRequest {\r\n const query = orderExtControllerQuery();\r\n return query.createDataServiceRequestForOperation(\r\n 'GetPaymentStatus',\r\n true,\r\n DataServiceEntities.GetPaymentStatusResponseExtensionClass,\r\n 'false',\r\n { bypassCache: 'none', returnEntity: 'DataServiceEntities.IGetPaymentStatusResponse' },\r\n { key: key, keyType: keyType }\r\n );\r\n}\r\n\r\nexport function getPaymentStatusAsync(\r\n context: IContext,\r\n key: string,\r\n keyType: string\r\n): AsyncResult {\r\n const request = createGetPaymentStatusInput(key, keyType);\r\n return callActionOrExecute(request, context.callerContext);\r\n}\r\n\r\nexport function createExecutePaymentInput(\r\n paymentMethodId: number,\r\n customerName: string,\r\n displayCurrencyIso: string,\r\n mobileCountryCode: string,\r\n customerMobile: string,\r\n customerEmail: string,\r\n invoiceValue: number,\r\n callBackUrl: string,\r\n errorUrl: string,\r\n language: string,\r\n customerReference: string\r\n): IDataServiceRequest {\r\n const query = orderExtControllerQuery();\r\n return query.createDataServiceRequestForOperation(\r\n 'ExecutePayment',\r\n true,\r\n DataServiceEntities.ExecutePaymentResponseExtensionClass,\r\n 'false',\r\n { bypassCache: 'get', returnEntity: 'DataServiceEntities.IExecutePaymentResponse' },\r\n {\r\n paymentMethodId: paymentMethodId,\r\n customerName: customerName,\r\n displayCurrencyIso: displayCurrencyIso,\r\n mobileCountryCode: mobileCountryCode,\r\n customerMobile: customerMobile,\r\n customerEmail: customerEmail,\r\n invoiceValue: invoiceValue,\r\n callBackUrl: callBackUrl,\r\n errorUrl: errorUrl,\r\n language: language,\r\n customerReference: customerReference\r\n }\r\n );\r\n}\r\n\r\nexport function executePaymentAsync(\r\n context: IContext,\r\n paymentMethodId: number,\r\n customerName: string,\r\n displayCurrencyIso: string,\r\n mobileCountryCode: string,\r\n customerMobile: string,\r\n customerEmail: string,\r\n invoiceValue: number,\r\n callBackUrl: string,\r\n errorUrl: string,\r\n language: string,\r\n customerReference: string\r\n): AsyncResult {\r\n const request = createExecutePaymentInput(\r\n paymentMethodId,\r\n customerName,\r\n displayCurrencyIso,\r\n mobileCountryCode,\r\n customerMobile,\r\n customerEmail,\r\n invoiceValue,\r\n callBackUrl,\r\n errorUrl,\r\n language,\r\n customerReference\r\n );\r\n return callActionOrExecute(request, context.callerContext);\r\n}\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\nimport { INewContactCreation } from './../modules/szf-contact-us/szf-contact-us.view';\r\n/**\r\n * PostNewContact Input Action\r\n */\r\nexport class PostNewContactInput implements Msdyn365.IActionInput {\r\n // TODO: Construct the input needed to run the action\r\n public token: string;\r\n public firstName: string;\r\n public lastName: string;\r\n public email: string;\r\n public phone: string;\r\n public countryCode: string;\r\n public updateNpromotion: boolean;\r\n constructor(token:string,data:INewContactCreation) {\r\n this.token= token;\r\n this.email= data.email;\r\n this.firstName= data.firstName;\r\n this.lastName= data.lastName;\r\n this.phone= data.phone;\r\n this.countryCode= data.countryCode;\r\n this.updateNpromotion= data.updateNpromotion;\r\n }\r\n\r\n // TODO: Determine if the results of this get action should cache the results and if so provide\r\n // a cache object type and an appropriate cache key\r\n public getCacheKey = () => `SZFCREATECONTACT`;\r\n public getCacheObjectType = () => 'SZFCREATECONTACT';\r\n public dataCacheType = (): Msdyn365.CacheType => 'none';\r\n}\r\n\r\n// TODO: Create a data model here or import one to capture the response of the action\r\nexport interface IPostNewContactData {\r\n status: boolean;\r\n msg:string | undefined;\r\n id: string | undefined;\r\n}\r\n\r\n/**\r\n * TODO: Use this function to create the input required to make the action call\r\n */\r\nconst createNewContactInput = (args: Msdyn365.ICreateActionContext,token:string, inputData:INewContactCreation): Msdyn365.IActionInput => {\r\n return new PostNewContactInput(token, inputData);\r\n};\r\n\r\n/**\r\n * TODO: Use this function to call your action and process the results as needed\r\n */\r\nasync function createNewContactDataAction(input: PostNewContactInput, ctx: Msdyn365.IActionContext): Promise {\r\n // const apiSettings = Msdyn365.msdyn365Commerce.apiSettings;\r\n const token = input.token;\r\n const szfCRMDomain = ctx.requestContext.app.config.szfCRMDomain;\r\n const data = {\r\n \"firstname\": input.firstName,\r\n \"lastname\": input.lastName,\r\n \"emailaddress1\": input.email,\r\n \"szf_mblregion\": input.countryCode,\r\n \"szf_mbllocalnumber\": input.phone,\r\n \"donotsendmm\": !input.updateNpromotion\r\n };\r\n const response = await Msdyn365.sendRequest(`${szfCRMDomain}/api/data/v9.2//contacts`, \"post\", data, {\r\n headers: {\r\n 'Prefer': 'return=representation',\r\n 'MSCRM.SuppressDuplicateDetection': 'false',\r\n 'Authorization':`Bearer ${token}`,\r\n 'Content-Type': 'application/json'\r\n }\r\n });\r\n if(response && response.data && response.data.contactid){\r\n return {\r\n status: true,\r\n msg: 'success',\r\n id: response.data.contactid\r\n };\r\n }else if (response && response.data && response.data.error){\r\n return {\r\n status: false,\r\n msg: response.data.error.message,\r\n id: undefined\r\n };\r\n }else{\r\n return {\r\n status: false,\r\n msg: undefined,\r\n id: undefined\r\n };\r\n }\r\n // TODO: Uncomment the below line to get the value from a service\r\n // const response = await Msdyn365.sendRequest('/get/example/id/1', 'get');\r\n // return { text: 'Static data from action' };\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >createNewContactDataAction,\r\n // TODO: Give your data action a unique id\r\n id: 'PostNewContact',\r\n input: createNewContactInput\r\n // TODO: Uncomment the below line if this is a meant to be a batched data action\r\n // isBatched: true\r\n});\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\n\r\n/**\r\n * CreateOrderForPayment Input Action\r\n */\r\nexport class CreateOrderForPaymentInput implements Msdyn365.IActionInput {\r\n // TODO: Construct the input needed to run the action\r\n public LariToken: string;\r\n public amount: number;\r\n public emailAddress: string;\r\n public merchantAttributesRedirectUrl: string;\r\n constructor(data:any) {\r\n this.LariToken= data.token;\r\n this.amount= data.amount;\r\n this.emailAddress= data.email;\r\n this.merchantAttributesRedirectUrl= data.url;\r\n }\r\n\r\n // TODO: Determine if the results of this get action should cache the results and if so provide\r\n // a cache object type and an appropriate cache key\r\n public getCacheKey = () => `LARICREATEPAYMENTORDER`;\r\n public getCacheObjectType = () => 'LARICREATEPAYMENTORDER';\r\n public dataCacheType = (): Msdyn365.CacheType => 'none';\r\n}\r\n\r\n// TODO: Create a data model here or import one to capture the response of the action\r\nexport interface ICreateOrderForPaymentData {\r\n URL: string | undefined;\r\n success: boolean;\r\n error: string | undefined;\r\n}\r\n\r\n/**\r\n * TODO: Use this function to create the input required to make the action call\r\n */\r\nconst createInput = (args: Msdyn365.ICreateActionContext,inputData:any): Msdyn365.IActionInput => {\r\n return new CreateOrderForPaymentInput(inputData);\r\n};\r\n\r\n/**\r\n * TODO: Use this function to call your action and process the results as needed\r\n */\r\nasync function createOrderForPayment(input: CreateOrderForPaymentInput, ctx: Msdyn365.IActionContext): Promise {\r\n // const apiSettings = Msdyn365.msdyn365Commerce.apiSettings;\r\n // const { szfPaymentDomain, szfPaymentOutletReference } = ctx.requestContext.app.config;\r\n const szfPaymentDomain = \"https://api-gateway.sandbox.ngenius-payments.com\";\r\n const szfPaymentOutletReference = \"OGNjZWM1YmMtMWUzNi00NDkyLWFlNmItMGQ4NDQ5MDdkMTAxOmVmNDQ2NGYxLWI0MTctNDlkOC05ZmZmLTA1YzA1YWQ1Nzk0YQ==\";\r\n // TODO: Uncomment the below line to get the value from a service\r\n // const response = await Msdyn365.sendRequest('/get/example/id/1', 'get');\r\n const data = { \r\n \"action\": \"PURCHASE\", \r\n \"amount\" : { \"currencyCode\" : \"AED\", \"value\" : input.amount },\r\n \"emailAddress\" : input.emailAddress,\r\n \"merchantAttributes\":{\r\n \"redirectUrl\": input.merchantAttributesRedirectUrl\r\n }\r\n }\r\n try{\r\n const response = await Msdyn365.sendRequest(`${szfPaymentDomain}/transactions/outlets/${szfPaymentOutletReference}/orders`, \"post\", data, {\r\n headers: {\r\n 'Content-Type': 'application/vnd.ni-identity.v1+json',\r\n 'authorization': `Basic ${input.LariToken}`\r\n }\r\n });\r\n if(response && (response.status===200 || response.data)){\r\n return {\r\n URL: 'Static data from action',\r\n success: true,\r\n error: undefined\r\n };\r\n }else{\r\n return { \r\n URL: undefined, \r\n success: false,\r\n error: \"Something went Wrong, Please try again later\"\r\n };\r\n }\r\n }catch(err){\r\n console.log(\"Payment error\",err)\r\n return { \r\n URL: undefined, \r\n success: false,\r\n error: \"Something went Wrong, Please try again later\"\r\n };\r\n }\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >createOrderForPayment,\r\n // TODO: Give your data action a unique id\r\n id: 'CreateOrderForPayment',\r\n input: createInput\r\n // TODO: Uncomment the below line if this is a meant to be a batched data action\r\n // isBatched: true\r\n});\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\n\r\n/**\r\n * GetPaymentAccessToken Input Action\r\n */\r\nexport class GetPaymentAccessTokenInput implements Msdyn365.IActionInput {\r\n // TODO: Construct the input needed to run the action\r\n constructor() {}\r\n\r\n // TODO: Determine if the results of this get action should cache the results and if so provide\r\n // a cache object type and an appropriate cache key\r\n public getCacheKey = () => `LARIPAYMENTACCESSTOKEN`;\r\n public getCacheObjectType = () => 'LARIPAYMENTACCESSTOKEN';\r\n public dataCacheType = (): Msdyn365.CacheType => 'none';\r\n}\r\n\r\n// TODO: Create a data model here or import one to capture the response of the action\r\nexport interface IGetPaymentAccessTokenData {\r\n token: string | undefined;\r\n success: boolean;\r\n}\r\n\r\n/**\r\n * TODO: Use this function to create the input required to make the action call\r\n */\r\nconst createInput = (args: Msdyn365.ICreateActionContext): Msdyn365.IActionInput => {\r\n return new GetPaymentAccessTokenInput();\r\n};\r\n\r\n/**\r\n * TODO: Use this function to call your action and process the results as needed\r\n */\r\nasync function getPaymentAPIToken(input: GetPaymentAccessTokenInput, ctx: Msdyn365.IActionContext): Promise {\r\n // const apiSettings = Msdyn365.msdyn365Commerce.apiSettings;\r\n\r\n // TODO: Uncomment the below line to get the value from a service\r\n // const response = await Msdyn365.sendRequest('/get/example/id/1', 'get');\r\n // const { szfPaymentDomain, szfPaymentAPIKey} = ctx.requestContext.app.config;\r\n const szfPaymentDomain = \"https://api-gateway.sandbox.ngenius-payments.com\";\r\n const szfPaymentAPIKey = \"OGNjZWM1YmMtMWUzNi00NDkyLWFlNmItMGQ4NDQ5MDdkMTAxOmVmNDQ2NGYxLWI0MTctNDlkOC05ZmZmLTA1YzA1YWQ1Nzk0YQ==\";\r\n try{\r\n const response = await Msdyn365.sendRequest(`${szfPaymentDomain}/identity/auth/access-token`, \"post\", {}, {\r\n headers: {\r\n 'Content-Type': 'application/vnd.ni-identity.v1+json',\r\n 'authorization': `Basic ${szfPaymentAPIKey}`\r\n }\r\n });\r\n if(response && (response.status===200 || response.data)){\r\n return {\r\n token : response.data?.access_token!,\r\n success: true\r\n };\r\n }else{\r\n return { token : undefined, success: false };\r\n }\r\n }catch(err){\r\n console.log(\"Payment error\",err)\r\n return { token: undefined, success: false };\r\n }\r\n \r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >getPaymentAPIToken,\r\n // TODO: Give your data action a unique id\r\n id: 'GetPaymentAccessToken',\r\n input: createInput\r\n // TODO: Uncomment the below line if this is a meant to be a batched data action\r\n // isBatched: true\r\n});"],"sourceRoot":""}