crmbonus-component-wake 1.0.44 → 1.0.46
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/app-modal_4.cjs.entry.js +4 -6
- package/dist/cjs/app-modal_4.cjs.entry.js.map +1 -1
- package/dist/cjs/crm-bonus.cjs.entry.js +10 -5
- package/dist/cjs/crm-bonus.cjs.entry.js.map +1 -1
- package/dist/cjs/crmbonus-component-wake.cjs.js +1 -1
- package/dist/cjs/{crmbonus.service-ad521d7d.js → crmbonus.service-e375ebfe.js} +55 -15
- package/dist/cjs/crmbonus.service-e375ebfe.js.map +1 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/pedido-finalizado.cjs.entry.js +3 -6
- package/dist/cjs/pedido-finalizado.cjs.entry.js.map +1 -1
- package/dist/collection/components/crm-bonus/crm-bonus.js +11 -5
- package/dist/collection/components/crm-bonus/crm-bonus.js.map +1 -1
- package/dist/collection/components/crm-bonus-form/crm-bonus-form.js +3 -5
- package/dist/collection/components/crm-bonus-form/crm-bonus-form.js.map +1 -1
- package/dist/collection/components/pedido/pedido.js +2 -5
- package/dist/collection/components/pedido/pedido.js.map +1 -1
- package/dist/collection/services/crmbonus.service.js +53 -13
- package/dist/collection/services/crmbonus.service.js.map +1 -1
- package/dist/components/crm-bonus-form.js +1 -1
- package/dist/components/crm-bonus.js +13 -7
- package/dist/components/crm-bonus.js.map +1 -1
- package/dist/components/{p-0ebfe0d3.js → p-03c2447c.js} +5 -7
- package/dist/components/p-03c2447c.js.map +1 -0
- package/dist/components/{p-aeaad64e.js → p-878c694e.js} +55 -15
- package/dist/components/p-878c694e.js.map +1 -0
- package/dist/components/pedido-finalizado.js +3 -6
- package/dist/components/pedido-finalizado.js.map +1 -1
- package/dist/crmbonus-component-wake/crmbonus-component-wake.esm.js +1 -1
- package/dist/crmbonus-component-wake/crmbonus-component-wake.esm.js.map +1 -1
- package/dist/crmbonus-component-wake/p-001e3e2b.entry.js +2 -0
- package/dist/crmbonus-component-wake/p-001e3e2b.entry.js.map +1 -0
- package/dist/crmbonus-component-wake/p-3582baf8.entry.js +2 -0
- package/dist/crmbonus-component-wake/p-3582baf8.entry.js.map +1 -0
- package/dist/crmbonus-component-wake/p-878c694e.js +2 -0
- package/dist/crmbonus-component-wake/p-878c694e.js.map +1 -0
- package/dist/crmbonus-component-wake/p-dbb64825.entry.js +2 -0
- package/dist/crmbonus-component-wake/p-dbb64825.entry.js.map +1 -0
- package/dist/env.js +1 -1
- package/dist/env.js.map +1 -1
- package/dist/esm/app-modal_4.entry.js +4 -6
- package/dist/esm/app-modal_4.entry.js.map +1 -1
- package/dist/esm/crm-bonus.entry.js +10 -5
- package/dist/esm/crm-bonus.entry.js.map +1 -1
- package/dist/esm/crmbonus-component-wake.js +1 -1
- package/dist/esm/{crmbonus.service-dda2d96b.js → crmbonus.service-4ee773c8.js} +55 -15
- package/dist/esm/crmbonus.service-4ee773c8.js.map +1 -0
- package/dist/esm/loader.js +1 -1
- package/dist/esm/pedido-finalizado.entry.js +3 -6
- package/dist/esm/pedido-finalizado.entry.js.map +1 -1
- package/dist/types/components/crm-bonus/crm-bonus.d.ts +2 -0
- package/dist/types/home/darlison/Projects/crmbonus/app/crmbonus-component/.stencil/env.d.ts +1 -1
- package/dist/types/services/crmbonus.service.d.ts +6 -2
- package/package.json +1 -1
- package/dist/cjs/crmbonus.service-ad521d7d.js.map +0 -1
- package/dist/components/p-0ebfe0d3.js.map +0 -1
- package/dist/components/p-aeaad64e.js.map +0 -1
- package/dist/crmbonus-component-wake/p-04db24fc.entry.js +0 -2
- package/dist/crmbonus-component-wake/p-04db24fc.entry.js.map +0 -1
- package/dist/crmbonus-component-wake/p-60249052.entry.js +0 -2
- package/dist/crmbonus-component-wake/p-60249052.entry.js.map +0 -1
- package/dist/crmbonus-component-wake/p-6de2e9c3.entry.js +0 -2
- package/dist/crmbonus-component-wake/p-6de2e9c3.entry.js.map +0 -1
- package/dist/crmbonus-component-wake/p-aeaad64e.js +0 -2
- package/dist/crmbonus-component-wake/p-aeaad64e.js.map +0 -1
- package/dist/esm/crmbonus.service-dda2d96b.js.map +0 -1
@@ -3749,7 +3749,7 @@ axios.default = axios;
|
|
3749
3749
|
// this module should only have a default export
|
3750
3750
|
const axios$1 = axios;
|
3751
3751
|
|
3752
|
-
const CRM_BONUS_API_URL = "https://crmbonus-wake-hub-staging-5daedbc4e22b.herokuapp.com/api"
|
3752
|
+
const CRM_BONUS_API_URL = "https://wake-middleware.crmbonus.com/api"; // "https://crmbonus-wake-hub-staging-5daedbc4e22b.herokuapp.com/api" //"https://crmbonus-service-staging-d15ba5377115.herokuapp.com"; //"https://typically-workable-perch.ngrok-free.app"; // "http://localhost:3500";
|
3753
3753
|
|
3754
3754
|
class CrmBonusService {
|
3755
3755
|
constructor() {
|
@@ -3761,42 +3761,82 @@ class CrmBonusService {
|
|
3761
3761
|
},
|
3762
3762
|
});
|
3763
3763
|
}
|
3764
|
+
static getInstance() {
|
3765
|
+
if (this._instance) {
|
3766
|
+
return this._instance;
|
3767
|
+
}
|
3768
|
+
this._instance = new CrmBonusService();
|
3769
|
+
return this._instance;
|
3770
|
+
}
|
3764
3771
|
async getCustomer(userId, store) {
|
3765
|
-
|
3766
|
-
|
3767
|
-
|
3772
|
+
var _a, _b;
|
3773
|
+
const headers = {
|
3774
|
+
'Content-Type': 'application/json',
|
3775
|
+
'Authorization': `Bearer ${this.token}`
|
3776
|
+
};
|
3777
|
+
const response = await this.axiosInstance.get(`/store/${store}/customer/${userId}`, { headers: headers });
|
3778
|
+
this.token = (_a = response === null || response === void 0 ? void 0 : response.data) === null || _a === void 0 ? void 0 : _a.token;
|
3779
|
+
return (_b = response === null || response === void 0 ? void 0 : response.data) === null || _b === void 0 ? void 0 : _b.customer;
|
3768
3780
|
}
|
3769
3781
|
async updateOrder(updateOrderDTO) {
|
3770
|
-
const
|
3782
|
+
const token = localStorage.getItem("@BYCODERS_KEY");
|
3783
|
+
const headers = {
|
3784
|
+
'Content-Type': 'application/json',
|
3785
|
+
'Authorization': `Bearer ${token}`
|
3786
|
+
};
|
3787
|
+
await this.axiosInstance.patch(`/checkouts/${updateOrderDTO.cartId}/updateOrder`, {
|
3771
3788
|
orderId: updateOrderDTO.orderId,
|
3772
3789
|
externalId: updateOrderDTO.cartIdCrm
|
3773
|
-
}, { headers:
|
3774
|
-
|
3790
|
+
}, { headers: headers });
|
3791
|
+
localStorage.removeItem("@BYCODERS_KEY");
|
3775
3792
|
}
|
3776
3793
|
async sendPin(phone, name, store) {
|
3777
|
-
const
|
3794
|
+
const headers = {
|
3795
|
+
'Content-Type': 'application/json',
|
3796
|
+
'Authorization': `Bearer ${this.token}`
|
3797
|
+
};
|
3798
|
+
const response = await this.axiosInstance.post("/crmbonus/send-pin", { cellphone: phone, name: name, storeName: store }, { headers: headers });
|
3778
3799
|
return {
|
3779
3800
|
storeId: response.data.storeId,
|
3780
3801
|
userId: response.data.userId
|
3781
3802
|
};
|
3782
3803
|
}
|
3783
|
-
async validatePinBonus(payload
|
3784
|
-
|
3785
|
-
|
3804
|
+
async validatePinBonus(payload) {
|
3805
|
+
const headers = {
|
3806
|
+
'Content-Type': 'application/json',
|
3807
|
+
'Authorization': `Bearer ${this.token}`
|
3808
|
+
};
|
3809
|
+
const response = await this.axiosInstance.post("/crmbonus/process-pin-bonus", payload, { headers });
|
3786
3810
|
return response.data;
|
3787
3811
|
}
|
3788
3812
|
async reserve(payload) {
|
3789
|
-
const
|
3813
|
+
const headers = {
|
3814
|
+
'Content-Type': 'application/json',
|
3815
|
+
'Authorization': `Bearer ${this.token}`
|
3816
|
+
};
|
3817
|
+
const response = await this.axiosInstance.post("/crmbonus/redeem-bonus", payload, { headers });
|
3790
3818
|
return response.data;
|
3791
3819
|
}
|
3792
|
-
async cancel(cartId
|
3820
|
+
async cancel(cartId) {
|
3821
|
+
const headers = {
|
3822
|
+
'Content-Type': 'application/json',
|
3823
|
+
'Authorization': `Bearer ${this.token}`
|
3824
|
+
};
|
3793
3825
|
const response = await this.axiosInstance.post("/crmbonus/cancel-apply-bonus", {
|
3794
3826
|
ticket: cartId
|
3795
|
-
}, { headers
|
3827
|
+
}, { headers });
|
3796
3828
|
return response.data;
|
3797
3829
|
}
|
3830
|
+
async getToken(store) {
|
3831
|
+
var _a, _b;
|
3832
|
+
const response = await this.axiosInstance.post("/wake/requestToken", { storeName: store });
|
3833
|
+
this.token = (_a = response === null || response === void 0 ? void 0 : response.data) === null || _a === void 0 ? void 0 : _a.token;
|
3834
|
+
localStorage.setItem("@BYCODERS_KEY", this.token);
|
3835
|
+
return (_b = response === null || response === void 0 ? void 0 : response.data) === null || _b === void 0 ? void 0 : _b.token;
|
3836
|
+
}
|
3798
3837
|
}
|
3838
|
+
CrmBonusService._instance = null;
|
3799
3839
|
|
3800
3840
|
export { CrmBonusService as C };
|
3801
3841
|
|
3802
|
-
//# sourceMappingURL=p-
|
3842
|
+
//# sourceMappingURL=p-878c694e.js.map
|