@roketus/loyalty-js-sdk 5.4.0 → 5.4.2
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/README.dev.md +29 -0
- package/README.md +4 -6
- package/dist/cjs/api/issuer/getCardBonuses.d.ts +1 -4
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/interfaces/IRequestWithCancelAndData.d.ts +1 -1
- package/dist/cjs/interfaces/analyticsInterfaces.d.ts +6 -6
- package/dist/cjs/interfaces/campaigns/ICampaignAction.d.ts +1 -1
- package/dist/cjs/interfaces/campaigns/campaignInterfaces.d.ts +3 -3
- package/dist/cjs/interfaces/campaigns/campaignPayloads.d.ts +4 -4
- package/dist/cjs/interfaces/card/IGetBonuses.d.ts +1 -1
- package/dist/cjs/interfaces/cardInterfaces.d.ts +1 -1
- package/dist/cjs/interfaces/cardManagement/cardManagementInterfaces.d.ts +3 -3
- package/dist/cjs/interfaces/cohorts/ICohort.d.ts +1 -1
- package/dist/cjs/interfaces/cohorts/cohortsInterfaces.d.ts +7 -7
- package/dist/cjs/interfaces/excludes/excludeInterfaces.d.ts +5 -5
- package/dist/cjs/interfaces/excludes/listExcludesInterfaces.d.ts +2 -2
- package/dist/cjs/interfaces/issuer/IGetCardSpends.d.ts +2 -2
- package/dist/cjs/interfaces/issuer/issuerInterface.d.ts +3 -3
- package/dist/cjs/interfaces/json.d.ts +2 -2
- package/dist/cjs/interfaces/order/orderInterfaces.d.ts +10 -10
- package/dist/cjs/interfaces/products/TGetGroupById.d.ts +2 -2
- package/dist/cjs/interfaces/products/TGetProductById.d.ts +2 -2
- package/dist/cjs/interfaces/products/categoryInterfaces.d.ts +1 -1
- package/dist/cjs/interfaces/products/listCategoriesInterfaces.d.ts +2 -2
- package/dist/cjs/interfaces/products/listProductsInterfaces.d.ts +2 -2
- package/dist/cjs/interfaces/products/productInterfaces.d.ts +1 -1
- package/dist/cjs/interfaces/promoCodes/promocodeInterfaces.d.ts +10 -10
- package/dist/cjs/interfaces/referralProgram/ICreateRefProgramPayload.d.ts +1 -1
- package/dist/cjs/interfaces/referralProgram/IReferralProgram.d.ts +1 -1
- package/dist/cjs/interfaces/referralProgram/influencerInterfaces.d.ts +4 -4
- package/dist/cjs/interfaces/referralProgram/referralProgramInterfaces.d.ts +4 -4
- package/dist/cjs/interfaces/rewardProgram/IProgramRule.d.ts +4 -4
- package/dist/cjs/interfaces/rewardProgram/programRulesInterfaces.d.ts +1 -1
- package/dist/cjs/interfaces/rewardProgram/rewardProgramInterfaces.d.ts +1 -1
- package/dist/cjs/interfaces/rewardProgram/tierInterfaces.d.ts +1 -1
- package/dist/cjs/interfaces/shortLinkActionInterface.d.ts +12 -12
- package/dist/cjs/interfaces/shortLinkInterface.d.ts +1 -1
- package/dist/cjs/interfaces/tiers/IGetTiersByCard.d.ts +1 -1
- package/dist/cjs/interfaces/transactions/IGetTransactionsByCard.d.ts +1 -1
- package/dist/cjs/interfaces/urlInterfaces.d.ts +1 -1
- package/dist/cjs/interfaces/user/IUser.d.ts +1 -0
- package/dist/cjs/interfaces/user/IUserCreate.d.ts +1 -1
- package/dist/cjs/interfaces/user/userNotificationsInterfaces.d.ts +1 -1
- package/dist/cjs/utils/toFilterQueryParams.d.ts +2 -2
- package/dist/esm5/api/issuer/getCardBonuses.d.ts +1 -4
- package/dist/esm5/index.js +1 -1
- package/dist/esm5/interfaces/IRequestWithCancelAndData.d.ts +1 -1
- package/dist/esm5/interfaces/analyticsInterfaces.d.ts +6 -6
- package/dist/esm5/interfaces/campaigns/ICampaignAction.d.ts +1 -1
- package/dist/esm5/interfaces/campaigns/campaignInterfaces.d.ts +3 -3
- package/dist/esm5/interfaces/campaigns/campaignPayloads.d.ts +4 -4
- package/dist/esm5/interfaces/card/IGetBonuses.d.ts +1 -1
- package/dist/esm5/interfaces/cardInterfaces.d.ts +1 -1
- package/dist/esm5/interfaces/cardManagement/cardManagementInterfaces.d.ts +3 -3
- package/dist/esm5/interfaces/cohorts/ICohort.d.ts +1 -1
- package/dist/esm5/interfaces/cohorts/cohortsInterfaces.d.ts +7 -7
- package/dist/esm5/interfaces/excludes/excludeInterfaces.d.ts +5 -5
- package/dist/esm5/interfaces/excludes/listExcludesInterfaces.d.ts +2 -2
- package/dist/esm5/interfaces/issuer/IGetCardSpends.d.ts +2 -2
- package/dist/esm5/interfaces/issuer/issuerInterface.d.ts +3 -3
- package/dist/esm5/interfaces/json.d.ts +2 -2
- package/dist/esm5/interfaces/order/orderInterfaces.d.ts +10 -10
- package/dist/esm5/interfaces/products/TGetGroupById.d.ts +2 -2
- package/dist/esm5/interfaces/products/TGetProductById.d.ts +2 -2
- package/dist/esm5/interfaces/products/categoryInterfaces.d.ts +1 -1
- package/dist/esm5/interfaces/products/listCategoriesInterfaces.d.ts +2 -2
- package/dist/esm5/interfaces/products/listProductsInterfaces.d.ts +2 -2
- package/dist/esm5/interfaces/products/productInterfaces.d.ts +1 -1
- package/dist/esm5/interfaces/promoCodes/promocodeInterfaces.d.ts +10 -10
- package/dist/esm5/interfaces/referralProgram/ICreateRefProgramPayload.d.ts +1 -1
- package/dist/esm5/interfaces/referralProgram/IReferralProgram.d.ts +1 -1
- package/dist/esm5/interfaces/referralProgram/influencerInterfaces.d.ts +4 -4
- package/dist/esm5/interfaces/referralProgram/referralProgramInterfaces.d.ts +4 -4
- package/dist/esm5/interfaces/rewardProgram/IProgramRule.d.ts +4 -4
- package/dist/esm5/interfaces/rewardProgram/programRulesInterfaces.d.ts +1 -1
- package/dist/esm5/interfaces/rewardProgram/rewardProgramInterfaces.d.ts +1 -1
- package/dist/esm5/interfaces/rewardProgram/tierInterfaces.d.ts +1 -1
- package/dist/esm5/interfaces/shortLinkActionInterface.d.ts +12 -12
- package/dist/esm5/interfaces/shortLinkInterface.d.ts +1 -1
- package/dist/esm5/interfaces/tiers/IGetTiersByCard.d.ts +1 -1
- package/dist/esm5/interfaces/transactions/IGetTransactionsByCard.d.ts +1 -1
- package/dist/esm5/interfaces/urlInterfaces.d.ts +1 -1
- package/dist/esm5/interfaces/user/IUser.d.ts +1 -0
- package/dist/esm5/interfaces/user/IUserCreate.d.ts +1 -1
- package/dist/esm5/interfaces/user/userNotificationsInterfaces.d.ts +1 -1
- package/dist/esm5/utils/toFilterQueryParams.d.ts +2 -2
- package/package.json +5 -4
package/README.dev.md
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# loyalty-js-sdk
|
|
2
|
+
JS SDK for loyalty API
|
|
3
|
+
|
|
4
|
+
# How to publish package
|
|
5
|
+
|
|
6
|
+
## [OLD for Github Packages]
|
|
7
|
+
Note: This method is deprecated as GitHub Packages requires authentication, which caused access issues.
|
|
8
|
+
+ Generate PAT in your github account page go to `Settings->Developer Setting->Personal Access Token`
|
|
9
|
+
+ Login to your registry
|
|
10
|
+
+ `npm login --scope=@roketus --registry=https://npm.pkg.github.com`
|
|
11
|
+
+ When prompting for a password fill you PAT
|
|
12
|
+
|
|
13
|
+
## [NEW for npmjs]
|
|
14
|
+
The registry for SDK packages has been updated to registry.npmjs.org to resolve access issues, allowing anyone to install the package without specific permissions.
|
|
15
|
+
|
|
16
|
+
1. Login to your registry
|
|
17
|
+
+ `npm login --scope=@roketus --registry=https://registry.npmjs.org/`
|
|
18
|
+
+ When prompted, press ENTER to proceed.
|
|
19
|
+
+ Enter the two-factor authentication code (contact your manager for the code).
|
|
20
|
+
|
|
21
|
+
2. After changes are merged into the `main` branch
|
|
22
|
+
+ `npm version <update_type>` (Replace <update_type> with major | minor | patch as needed.)
|
|
23
|
+
+ `npm publish --access public --registry=https://registry.npmjs.org/`
|
|
24
|
+
+ `git push origin <tag_name>` (Replace <tag_name> with the version tag (e.g., v0.0.0))
|
|
25
|
+
+ `git push origin main`
|
|
26
|
+
|
|
27
|
+
# Installing the SDK
|
|
28
|
+
Once published, the new version of the SDK can be installed in your project using:
|
|
29
|
+
`npm install @roketus/loyalty-js-sdk`
|
package/README.md
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
# loyalty-js-sdk
|
|
2
|
-
JS
|
|
2
|
+
JS SDK for loyalty API
|
|
3
3
|
|
|
4
|
-
#
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
+ `npm login --scope=@roketus --registry=https://npm.pkg.github.com`
|
|
8
|
-
+ When prompting for a password fill you PAT
|
|
4
|
+
# Installing the SDK
|
|
5
|
+
The new version of the SDK can be installed in your project using:
|
|
6
|
+
`npm install @roketus/loyalty-js-sdk`
|
|
@@ -5,9 +5,6 @@ export declare const commonGetCardBonuses: (client: IHTTPClientInstance, url: st
|
|
|
5
5
|
jsonAPI: any;
|
|
6
6
|
data: any;
|
|
7
7
|
}>;
|
|
8
|
-
abort:
|
|
9
|
-
(reason?: any): void;
|
|
10
|
-
(): void;
|
|
11
|
-
};
|
|
8
|
+
abort: (reason?: any) => void;
|
|
12
9
|
};
|
|
13
10
|
export declare const getCardBonuses: IGetCardBonuses;
|
package/dist/cjs/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@roketus/web-toolkit"),t=function(){return t=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},t.apply(this,arguments)};function r(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{c(n.next(e))}catch(e){o(e)}}function s(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))}function n(e,t){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,n=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=t.call(e,a)}catch(e){o=[6,e],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}var i=e.createContainer(),o=i.initContainer,a=i.getContainer,s="unknown",c=function(){return s},u="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},l="object"==typeof u&&u&&u.Object===Object&&u,d="object"==typeof self&&self&&self.Object===Object&&self,p=(l||d||Function("return this")()).Symbol,f=p,v=Object.prototype,h=v.hasOwnProperty,m=v.toString,y=f?f.toStringTag:void 0;var g=function(e){var t=h.call(e,y),r=e[y];try{e[y]=void 0;var n=!0}catch(e){}var i=m.call(e);return n&&(t?e[y]=r:delete e[y]),i},b=Object.prototype.toString;var C=g,w=function(e){return b.call(e)},E=p?p.toStringTag:void 0;var A=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":E&&E in Object(e)?C(e):w(e)},D=Array.isArray;var P=A,T=D,_=function(e){return null!=e&&"object"==typeof e};var O=function(e){return"string"==typeof e||!T(e)&&_(e)&&"[object String]"==P(e)},S=function(e){/^((?!chrome|android).)*safari/i.test(navigator.userAgent)?function(e){var t=new FileReader;t.onload=function(){if(!O(t.result))throw new Error("Invalid response, expected string");window.location.href=t.result},t.readAsDataURL(e.data)}(e):function(e){var t=window.URL.createObjectURL(new Blob([e.data])),r=document.createElement("a");r.href=t,r.setAttribute("download","yourpass.pkpass"),document.body.appendChild(r),r.click()}(e)},k=2e4,x="https://api.dev.loyalty.roket.us/",z=function(t){return e.HTTPStatic.create({staticConfig:{baseURL:null!=t?t:x,timeout:k}})},R=function(t){return e.HTTPStatic.create({staticConfig:{baseURL:null!=t?t:x,timeout:k}})},L=function(t){return e.HTTPStatic.create({staticConfig:{baseURL:null!=t?t:x,timeout:k}})},N=function(t){return e.HTTPStatic.create({staticConfig:{baseURL:null!=t?t:x,timeout:k}})};!function(e,t){if(!e.setImmediate){var r,n,i,o,a,s=1,c={},u=!1,l=e.document,d=Object.getPrototypeOf&&Object.getPrototypeOf(e);d=d&&d.setTimeout?d:e,"[object process]"==={}.toString.call(e.process)?r=function(e){process.nextTick((function(){f(e)}))}:!function(){if(e.postMessage&&!e.importScripts){var t=!0,r=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=r,t}}()?e.MessageChannel?((i=new MessageChannel).port1.onmessage=function(e){f(e.data)},r=function(e){i.port2.postMessage(e)}):l&&"onreadystatechange"in l.createElement("script")?(n=l.documentElement,r=function(e){var t=l.createElement("script");t.onreadystatechange=function(){f(e),t.onreadystatechange=null,n.removeChild(t),t=null},n.appendChild(t)}):r=function(e){setTimeout(f,0,e)}:(o="setImmediate$"+Math.random()+"$",a=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(o)&&f(+t.data.slice(o.length))},e.addEventListener?e.addEventListener("message",a,!1):e.attachEvent("onmessage",a),r=function(t){e.postMessage(o+t,"*")}),d.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),n=0;n<t.length;n++)t[n]=arguments[n+1];var i={callback:e,args:t};return c[s]=i,r(s),s++},d.clearImmediate=p}function p(e){delete c[e]}function f(e){if(u)setTimeout(f,0,e);else{var t=c[e];if(t){u=!0;try{!function(e){var t=e.callback,r=e.args;switch(r.length){case 0:t();break;case 1:t(r[0]);break;case 2:t(r[0],r[1]);break;case 3:t(r[0],r[1],r[2]);break;default:t.apply(void 0,r)}}(t)}finally{p(e),u=!1}}}}}("undefined"==typeof self?u:self);class j{constructor(e,t){this.key=e,this.data=t,this.previous=null,this.next=null}}var I={get:(e,t,r)=>{const n=String.prototype.split.call(t,/[,[\].]+?/).filter(Boolean).reduce(((e,t)=>null!=e?e[t]:e),e);return void 0===n||n===e?r:n},set:(e,t,r)=>(Object(e)!==e||(Array.isArray(t)||(t=t.toString().match(/[^.[\]]+/g)||[]),t.slice(0,-1).reduce(((e,r,n)=>Object(e[r])===e[r]?e[r]:e[r]=Math.abs(t[n+1])>>0==+t[n+1]?[]:{}),e)[t[t.length-1]]=r),e),pick:(e,t)=>t.reduce(((t,r)=>(r in e&&(t[r]=e[r]),t)),{}),isEmpty:e=>null==e||!(Object.keys(e)||e).length,omit:(e,t)=>Object.keys(e).filter((e=>!t.includes(e))).reduce(((t,r)=>(t[r]=e[r],t)),{}),isPlainObject:e=>!!e&&"object"==typeof e&&e.constructor===Object,isObjectLike:e=>null!==e&&"object"==typeof e,transform:(e,t,r)=>Object.keys(e).reduce(((r,n)=>t(r,e[n],n,e)),r),toKebabCase:e=>{const t=e&&e.match(/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g);return t?t.map((e=>e.toLowerCase())).join("-"):e},toSnakeCase:e=>{const t=e&&e.match(/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g);return t?t.map((e=>e.toLowerCase())).join("_"):e},toCamelCase:e=>{const t=e&&e.match(/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g);if(!t)return e;const r=t.map((e=>e.slice(0,1).toUpperCase()+e.slice(1).toLowerCase())).join("");return r.slice(0,1).toLowerCase()+r.slice(1)},LRU:class{constructor(e){this.capacity=0===e?1/0:e,this.map={},this.head=null,this.tail=null}get(e){if(void 0!==this.map[e]){const t=this.map[e];return this._moveFirst(t),t.data}}set(e,t){if(void 0!==this.map[e]){const r=this.map[e];return r.data=t,void this._moveFirst(r)}if(Object.keys(this.map).length>=this.capacity){const e=this.tail.key;this._removeLast(),delete this.map[e]}const r=new j(e,t);this._add(r),this.map[e]=r}_add(e){e.next=null,e.previous=e.next,null===this.head?(this.head=e,this.tail=e):(this.head.previous=e,e.next=this.head,this.head=e)}_remove(e){return this.head===e&&this.tail===e?(this.tail=null,void(this.head=this.tail)):this.head===e?(this.head.next.previous=null,void(this.head=this.head.next)):this.tail===e?(this.tail.previous.next=null,void(this.tail=this.tail.previous)):(e.previous.next=e.next,void(e.next.previous=e.previous))}_moveFirst(e){this._remove(e),this._add(e)}_removeLast(){this._remove(this.tail)}}};var U={validateOptions:function(e){if(e={id:"id",blacklist:[],whitelist:[],links:{},relationships:{},topLevelLinks:{},topLevelMeta:{},meta:{},blacklistOnDeserialize:[],whitelistOnDeserialize:[],jsonapiObject:!0,...e},!Array.isArray(e.blacklist))throw new Error("option 'blacklist' must be an array");if(!Array.isArray(e.whitelist))throw new Error("option 'whitelist' must be an array");if("object"!=typeof e.links&&"function"!=typeof e.links)throw new Error("option 'links' must be an object or a function");if(!Array.isArray(e.blacklistOnDeserialize))throw new Error("option 'blacklistOnDeserialize' must be an array");if(!Array.isArray(e.whitelistOnDeserialize))throw new Error("option 'whitelistOnDeserialize' must be an array");if(e.topLevelLinks&&"object"!=typeof e.topLevelLinks&&"function"!=typeof e.topLevelLinks)throw new Error("option 'topLevelLinks' must be an object or a function");if(e.topLevelMeta&&"object"!=typeof e.topLevelMeta&&"function"!=typeof e.topLevelMeta)throw new Error("option 'topLevelMeta' must be an object or a function");if(e.meta&&"object"!=typeof e.meta&&"function"!=typeof e.meta)throw new Error("option 'meta' must be an object or a function");if("boolean"!=typeof e.jsonapiObject)throw new Error("option 'jsonapiObject' must a boolean");if(e.convertCase&&!["kebab-case","snake_case","camelCase"].includes(e.convertCase))throw new Error("option 'convertCase' must be one of 'kebab-case', 'snake_case', 'camelCase'");if(e.unconvertCase&&!["kebab-case","snake_case","camelCase"].includes(e.unconvertCase))throw new Error("option 'unconvertCase' must be one of 'kebab-case', 'snake_case', 'camelCase'");if(e.beforeSerialize&&"function"!=typeof e.beforeSerialize)throw new Error("option 'beforeSerialize' must be function");if(e.afterDeserialize&&"function"!=typeof e.afterDeserialize)throw new Error("option 'afterDeserialize' must be function");const{relationships:t}=e;return Object.keys(t).forEach((e=>{if(t[e]={schema:"default",links:{},meta:{},...t[e]},!t[e].type)throw new Error(`option 'type' for relationship '${e}' is required`);if("string"!=typeof t[e].type&&"function"!=typeof t[e].type)throw new Error(`option 'type' for relationship '${e}' must be a string or a function`);if(t[e].alternativeKey&&"string"!=typeof t[e].alternativeKey)throw new Error(`option 'alternativeKey' for relationship '${e}' must be a string`);if(t[e].schema&&"string"!=typeof t[e].schema)throw new Error(`option 'schema' for relationship '${e}' must be a string`);if("object"!=typeof t[e].links&&"function"!=typeof t[e].links)throw new Error(`option 'links' for relationship '${e}' must be an object or a function`);if("object"!=typeof t[e].meta&&"function"!=typeof t[e].meta)throw new Error(`option 'meta' for relationship '${e}' must be an object or a function`);if(t[e].deserialize&&"function"!=typeof t[e].deserialize)throw new Error(`option 'deserialize' for relationship '${e}' must be a function`)})),e},validateDynamicTypeOptions:function(e){if(!(e={topLevelLinks:{},topLevelMeta:{},jsonapiObject:!0,...e}).type)throw new Error("option 'type' is required");if("string"!=typeof e.type&&"function"!=typeof e.type)throw new Error("option 'type' must be a string or a function");if(e.topLevelLinks&&"object"!=typeof e.topLevelLinks&&"function"!=typeof e.topLevelLinks)throw new Error("option 'topLevelLinks' must be an object or a function");if(e.topLevelMeta&&"object"!=typeof e.topLevelMeta&&"function"!=typeof e.topLevelMeta)throw new Error("option 'topLevelMeta' must be an object or a function");if(e.meta&&"object"!=typeof e.meta&&"function"!=typeof e.meta)throw new Error("option 'meta' must be an object or a function");if("boolean"!=typeof e.jsonapiObject)throw new Error("option 'jsonapiObject' must a boolean");return e},validateError:function(e){if("object"!=typeof e)throw new Error("error must be an object");const{id:t,links:r,status:n,statusCode:i,code:o,title:a,detail:s,source:c,meta:u}=e,l={};return t&&(l.id=t),r&&Object.keys(r).length&&(l.links=function(e){const t=["about"];if("object"!=typeof e)throw new Error("error 'link' property must be an object");if(Object.keys(e).forEach((e=>{if(!t.includes(e))throw new Error(`error 'links.${e}' is not permitted`)})),e.about&&"string"!=typeof e.about)throw new Error("'links.about' property must be a string");return r}(r)),(n||i)&&(l.status=function(e){const t=Number(e);if(Number.isNaN(t))throw new Error("error 'status' must be a number");if(!function(e){return[100,101,102,200,201,202,203,204,205,206,207,208,226,300,301,302,303,304,305,307,308,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,421,422,423,424,426,428,429,431,444,451,499,500,501,502,503,504,505,506,507,508,510,511,599].includes(e)}(t))throw new Error("error 'status' must be a valid HTTP status code");return t.toString()}(n||i)),o&&(l.code=o.toString()),a?l.title=a.toString():"Object"!==e.constructor.name&&(l.title=e.constructor.name),l.detail=s?s.toString():e.message,c&&Object.keys(c).length&&(l.source=function(e){const t=["pointer","parameter"];if("object"!=typeof e)throw new Error("error 'source' property must be an object");if(Object.keys(e).forEach((e=>{if(!t.includes(e))throw new Error(`error 'source.${e}' is not permitted`)})),e.pointer&&"string"!=typeof e.pointer)throw new Error("error 'source.pointer' property must be a string");if(e.parameter&&"string"!=typeof e.parameter)throw new Error("error 'source.parameter' property must be a string");return c}(c)),u&&Object.keys(u).length&&(l.meta=function(e){if("object"!=typeof e)throw new Error("error 'meta' property must be an object");return u}(u)),l}};const{pick:M,isEmpty:B,omit:H,isPlainObject:$,isObjectLike:W,transform:K,get:V,set:G,toCamelCase:Y,toKebabCase:F,toSnakeCase:Z,LRU:Q}=I,{validateOptions:q,validateDynamicTypeOptions:J,validateError:X}=U;var ee=class{constructor(e){this.opts=e||{},this.schemas={};const{convertCaseCacheSize:t=5e3}=this.opts;this.convertCaseMap={camelCase:new Q(t),kebabCase:new Q(t),snakeCase:new Q(t)}}register(e,t,r){"object"==typeof t&&(r=t,t="default"),t=t||"default",r={...this.opts,...r},this.schemas[e]=this.schemas[e]||{},this.schemas[e][t]=q(r)}serialize(e,t,r,n,i,o={}){3===arguments.length&&"object"==typeof r&&(n=r,r="default"),r=r||"default",n=n||{};const a=new Map,s="object"==typeof e,c=this._getSchemaOptions(e,r,o);let u;return u=i?void 0:s?this.serializeMixedResource(c,t,a,n,o):this.serializeResource(e,t,c,a,n,o),{jsonapi:c.jsonapiObject?{version:"1.0"}:void 0,meta:this.processOptionsValues(t,n,c.topLevelMeta,"extraData"),links:this.processOptionsValues(t,n,c.topLevelLinks,"extraData"),data:u,included:a.size?[...a.values()]:void 0}}serializeAsync(e,t,r,n,i,o={}){3===arguments.length&&"object"==typeof r&&(n=r,r="default"),r=r||"default",n=n||{};const a=new Map,s=Array.isArray(t),c="object"==typeof e,u=s?t:[t],l=[],d=this;let p=0;const f=this._getSchemaOptions(e,r,o);return new Promise(((t,r)=>{!function s(){setImmediate((()=>{if(i)return t();if(p>=u.length)return t(l);try{const t=c?d.serializeMixedResource(e,u[p],a,n,o):d.serializeResource(e,u[p],f,a,n,o);return null!==t&&l.push(t),p+=1,s()}catch(e){return r(e)}}))}()})).then((e=>{let r;return r=void 0===e?void 0:s?e:e[0]||null,{jsonapi:f.jsonapiObject?{version:"1.0"}:void 0,meta:this.processOptionsValues(t,n,f.topLevelMeta,"extraData"),links:this.processOptionsValues(t,n,f.topLevelLinks,"extraData"),data:r,included:a.size?[...a.values()]:void 0}}))}deserialize(e,t,r){if(r=r||"default","object"==typeof e)e=J(e);else{if(!this.schemas[e])throw new Error(`No type registered for ${e}`);if(r&&!this.schemas[e][r])throw new Error(`No schema ${r} registered for ${e}`)}let n={};return t.data&&(n=Array.isArray(t.data)?t.data.map((n=>this.deserializeResource(e,n,r,t.included))):this.deserializeResource(e,t.data,r,t.included)),n}deserializeAsync(e,t,r){if(r=r||"default","object"==typeof e)e=J(e);else{if(!this.schemas[e])throw new Error(`No type registered for ${e}`);if(r&&!this.schemas[e][r])throw new Error(`No schema ${r} registered for ${e}`)}const n=Array.isArray(t.data);let i=0;const o=n?t.data:[t.data],a=[],s=this;return new Promise(((c,u)=>{!function l(){setImmediate((()=>{if(i>=o.length)return c(n?a:a[0]);try{const n=s.deserializeResource(e,o[i],r,t.included);return a.push(n),i+=1,l()}catch(e){return u(e)}}))}()}))}serializeError(e){return{errors:Array.isArray(e)?e.map((e=>X(e))):[X(e)]}}deserializeResource(e,t,r="default",n,i=[]){if("object"==typeof e&&(e="function"==typeof e.type?e.type(t):V(t,e.type)),!e)throw new Error(`No type can be resolved from data: ${JSON.stringify(t)}`);if(!this.schemas[e])throw new Error(`No type registered for ${e}`);const o=this.schemas[e][r];let a={};return void 0!==t.id&&(a[o.id]=t.id),t.attributes&&o.whitelistOnDeserialize.length&&(t.attributes=M(t.attributes,o.whitelistOnDeserialize)),t.attributes&&o.blacklistOnDeserialize.length&&(t.attributes=H(t.attributes,o.blacklistOnDeserialize)),Object.assign(a,t.attributes),t.relationships&&Object.keys(t.relationships).forEach((e=>{const r=t.relationships[e],s=this._getRelationshipDataType(r.data),c=o.unconvertCase?this._convertCase(e,o.unconvertCase):e,u=o.relationships[c]||this.schemas[s],l=e=>u&&u.deserialize?u.deserialize(e):e.id;if(void 0!==r.data)if(null===r.data)G(a,u&&u.alternativeKey||c,null);else if((u&&u.alternativeKey||!n)&&G(a,u&&u.alternativeKey||c,Array.isArray(r.data)?r.data.map((e=>l(e))):l(r.data)),n){const e=e=>{const t=[...i],r=`${e.type}-${e.id}`;return t.includes(r)?l(e):(t.push(r),this.deserializeIncluded(e.type,e.id,u,n,t,l))},t=Array.isArray(r.data)?r.data.map((t=>e(t))):e(r.data);u&&u.alternativeKey&&t.toString()===V(a,u.alternativeKey).toString()||G(a,c,t)}})),o.unconvertCase&&(a=this._convertCase(a,o.unconvertCase)),t.links&&(a.links=t.links),t.meta&&(a.meta=t.meta),o.afterDeserialize?o.afterDeserialize(a):a}deserializeIncluded(e,t,r,n,i,o){const a=n.find((r=>r.type===e&&r.id===t));if(!a)return o({type:e,id:t});if(!r)throw new Error(`No type registered for ${e}`);return this.deserializeResource(e,a,r.schema,n,i)}serializeResource(e,t,r,n,i,o={}){return B(t)?Array.isArray(t)?t:null:Array.isArray(t)?t.map((t=>this.serializeResource(e,t,r,n,i,o))):(r.beforeSerialize&&(t=r.beforeSerialize(t)),{type:e,id:t[r.id]?t[r.id].toString():void 0,attributes:this.serializeAttributes(t,r),relationships:this.serializeRelationships(t,r,n,i,o),meta:this.processOptionsValues(t,i,r.meta),links:this.processOptionsValues(t,i,r.links)})}serializeMixedResource(e,t,r,n,i={}){if(B(t))return Array.isArray(t)?t:null;if(Array.isArray(t))return t.map((t=>this.serializeMixedResource(e,t,r,n,i)));const o="function"==typeof e.type?e.type(t):V(t,e.type);if(!o)throw new Error(`No type can be resolved from data: ${JSON.stringify(t)}`);if(!this.schemas[o])throw new Error(`No type registered for ${o}`);const a=this._getSchemaOptions(o,"default",i);return this.serializeResource(o,t,a,r,n,i)}serializeAttributes(e,t){t.whitelist&&t.whitelist.length&&(e=M(e,t.whitelist));const r=[];Object.keys(t.relationships).forEach((e=>{const n=t.relationships[e];n.alternativeKey&&r.push(n.alternativeKey)}));let n=H(e,[t.id,...Object.keys(t.relationships),...r,...t.blacklist]);return t.convertCase&&(n=this._convertCase(n,t.convertCase)),Object.keys(n).length?n:void 0}serializeRelationships(e,t,r,n,i={}){const o={};return Object.keys(t.relationships).forEach((a=>{const s=t.relationships[a];let c=a;!e[a]&&s.alternativeKey&&(c=s.alternativeKey);const u={links:this.processOptionsValues(e,n,s.links),meta:this.processOptionsValues(e,n,s.meta),data:this.serializeRelationship(s.type,s.schema,V(e,c),r,e,n,i)};void 0===u.data&&void 0===u.links&&void 0===u.meta||(a=t.convertCase?this._convertCase(a,t.convertCase):a,o[a]=u)})),Object.keys(o).length?o:void 0}serializeRelationship(e,t,r,n,i,o,a={}){n=n||new Map;const s=t||"default";if(null==r)return r;if("object"==typeof r&&B(r))return Array.isArray(r)?[]:null;if(Array.isArray(r))return r.map((t=>this.serializeRelationship(e,s,t,n,i,o,a)));const c="function"==typeof e?e(r,i):e;if(!c)throw new Error(`No type can be resolved from relationship's data: ${JSON.stringify(r)}`);if(!this.schemas[c])throw new Error(`No type registered for "${c}"`);if(!this.schemas[c][s])throw new Error(`No schema "${s}" registered for type "${c}"`);let u=this.schemas[c][s];a[c]&&(u={...u,...a[c]});const l={type:c};if(W(r)){const e=this.serializeResource(c,r,u,n,o,a);l.id=e.id;const t=`${c}-${l.id}`;if(e.attributes&&Object.keys(e.attributes).length||e.relationships&&Object.keys(e.relationships).length)if(n.has(t)){const r=n.get(t);e.relationships&&(r.relationships={...r.relationships,...e.relationships},n.set(t,r))}else n.set(t,e)}else l.id=r.toString();return l}processOptionsValues(e,t,r,n){let i={};return r&&"function"==typeof r?i="extraData"===n&&1===r.length?r(t):r(e,t):Object.keys(r).forEach((o=>{let a={};a=r[o]&&"function"==typeof r[o]?"extraData"===n&&1===r[o].length?r[o](t):r[o](e,t):r[o],Object.assign(i,{[o]:a})})),i&&Object.keys(i).length?i:void 0}_getSchemaOptions(e,t,r={}){const n="object"==typeof e,i={...r[n?e.type:e]||{}};if(n)return J(e);if(!this.schemas[e])throw new Error(`No type registered for ${e}`);if(t&&!this.schemas[e][t])throw new Error(`No schema ${t} registered for ${e}`);return{...this.schemas[e][t],...i}}_getRelationshipDataType(e){return null==e?null:Array.isArray(e)?V(e[0],"type"):e.type}_convertCase(e,t){if(Array.isArray(e))return e.map((e=>e&&(Array.isArray(e)||$(e))?this._convertCase(e,t):e));if($(e))return K(e,((e,r,n)=>{let i;return i=r&&(Array.isArray(r)||$(r))?this._convertCase(r,t):r,e[this._convertCase(n,t)]=i,e}),{});if("string"==typeof e){let r;switch(t){case"snake_case":r=this.convertCaseMap.snakeCase.get(e),r||(r=Z(e),this.convertCaseMap.snakeCase.set(e,r));break;case"kebab-case":r=this.convertCaseMap.kebabCase.get(e),r||(r=F(e),this.convertCaseMap.kebabCase.set(e,r));break;case"camelCase":r=this.convertCaseMap.camelCase.get(e),r||(r=Y(e),this.convertCaseMap.camelCase.set(e,r))}return r}return e}},te=function(e){var t=e.cardNumber,r=e.data,n=e.type,i={data:{attributes:{type:void 0===n?"bonus":n,value:r}}};return a().getDependency("issuerClient").put("/card/update/".concat(t),i)},re=function(e){var t=e.cardNumber;return a().getDependency("issuerClient").get("/card/balanceHistory/".concat(t))},ne=function(){var e=new ee;return e.register("issuer"),e},ie=["webPush","passPush"],oe={serviceName:"unknown",environment:"develop"},ae=function(){return oe},se=function(e){var t=-e.getTimezoneOffset(),r=t>=0?"+":"-",n=function(e){var t=Math.floor(Math.abs(e));return(t<10?"0":"")+t};return e.getFullYear()+"-"+n(e.getMonth()+1)+"-"+n(e.getDate())+"T"+n(e.getHours())+":"+n(e.getMinutes())+":"+n(e.getSeconds())+r+n(t/60)+":"+n(t%60)},ce=function(){var e=new ee;return e.register("action"),e.register("smart_link",{id:"id",relationships:{action:{type:"action"}}}),e},ue=function(e){var t=e.page,r=void 0===t?0:t,n=e.pageSize,i=e.filter,o=e.sort,a=e.status,s={"page[limit]":n,"page[offset]":n?r*n:0};if(i&&Object.keys(i).length&&Object.keys(i).forEach((function(e){i[e]&&(s["filter[".concat(e,"]")]=Array.isArray(i[e])?i[e].join(","):i[e])})),o&&Object.keys(o).length){var c=Object.keys(o).reduce((function(e,t){return o[t]?(e.length&&(e+=","),e+="".concat(t,"_").concat(o[t])):e}),"");c&&(s.sort=c)}return a&&(s.status=a),s},le=function(e){var t;return e?{page:e.current_page?e.current_page-1:Math.ceil(e.offset/e.limit),pageSize:e.limit,totalData:e.total_items,totalPages:null!==(t=e.total_pages)&&void 0!==t?t:Math.ceil(e.total_items/e.limit)}:{}};function de(e){return e.toLocaleDateString("en-CA")}var pe,fe=["webPush","passPush"],ve=function(e,t){void 0===t&&(t="unknown");var r=a().getDependency("anonymousUserClient"),n=ae(),i=n.serviceName,o=n.environment,s=new Date,c={correlation_id:t,env:o,payload:e,service_name:i,timestamp:se(s)};return r.post("/logger/addInfo",c)},he=void 0!==u&&(u.crypto||u.msCrypto);if(he&&he.getRandomValues){var me=new Uint8Array(16);pe=function(){return he.getRandomValues(me),me}}if(!pe){var ye=new Array(16);pe=function(){for(var e,t=0;t<16;t++)0==(3&t)&&(e=4294967296*Math.random()),ye[t]=e>>>((3&t)<<3)&255;return ye}}for(var ge=pe,be=[],Ce=0;Ce<256;++Ce)be[Ce]=(Ce+256).toString(16).substr(1);var we=function(e,t){var r=t||0,n=be;return n[e[r++]]+n[e[r++]]+n[e[r++]]+n[e[r++]]+"-"+n[e[r++]]+n[e[r++]]+"-"+n[e[r++]]+n[e[r++]]+"-"+n[e[r++]]+n[e[r++]]+"-"+n[e[r++]]+n[e[r++]]+n[e[r++]]+n[e[r++]]+n[e[r++]]+n[e[r++]]},Ee=ge,Ae=we;var De,Pe,Te,_e,Oe,Se,ke,xe,ze,Re,Le,Ne,je,Ie,Ue,Me,Be,He,$e,We,Ke,Ve,Ge,Ye,Fe,Ze,Qe,qe,Je,Xe,et,tt,rt=function(e,t,r){var n=t&&r||0;"string"==typeof e&&(t="binary"==e?new Array(16):null,e=null);var i=(e=e||{}).random||(e.rng||Ee)();if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,t)for(var o=0;o<16;++o)t[n+o]=i[o];return t||Ae(i)},nt="rk-jssdk",it=function(){var e=new ee;return e.register("campaign"),e.register("campaign_run"),e.register("campaign_action"),e.register("cohort"),e.register("location"),e},ot=function(){var e=new ee;return e.register("cohort"),e},at=function(e,t){var r=new AbortController,n=new ee;n.register("bonuses");var i={activeWithDates:[],inactiveWithDates:[],totalActive:{USD:0,UAH:0,EUR:0},totalInactive:{}};return{result:e.get(t,{signal:r.signal}).then((function(e){return Promise.all([e.data,n.deserializeAsync("bonuses",e.data)])})).then((function(e){var t,r=null!==(t=e[1][0])&&void 0!==t?t:i;return Promise.resolve({jsonAPI:e[0],data:r})})),abort:r.abort}},st=function(){var e=new ee;return e.register("promocode"),e},ct=function(){var e=new ee;return e.register("exclude",{id:"id",relationships:{group:{type:"group",jsonApi:"hasMany"},product:{type:"product",jsonApi:"hasMany"}}}),e.register("group",{id:"id",attributes:["title"]}),e.register("product",{id:"id",attributes:["title"]}),e},ut=function(){var e=new ee({});return e.register("product",{relationships:{model:{type:"model"},properties:{type:"property"}}}),e.register("model",{relationships:{brand:{type:"brand"},properties:{type:"property"}}}),e.register("brand"),e.register("property"),e},lt=function(){var e=new ee({});return e.register("category"),e},dt=function(){var e=new ee({});return e.register("user"),e.register("promo_code"),e.register("card",{id:"id",relationships:{user:{type:"user"}}}),e},pt=function(){var e=new ee;return e.register("order"),e.register("consumer"),e.register("receipt"),e.register("receipt_item"),e},ft=function(){var e=new ee;return e.register("referral_program"),e.register("influencer"),e},vt=function(){var e=new ee;return e.register("influencer"),e},ht=function(){var e=new ee;return e.register("loyalty_program"),e.register("program_rule"),e},mt=function(){var e=new ee;return e.register("tier"),e.register("tier_level"),e},yt={init:function(e){!function(e){o({userClient:z(e),issuerClient:R(e),anonymousUserClient:L(e),anonymousUserClientWithIssuer:N(e)})}(e)},user:{setIssuer:function(e){var t=a().getDependency("anonymousUserClientWithIssuer");s=e,t.defaults.headers.common["x-issuer-sys-name"]=e},setUserToken:function(e){a().getDependency("userClient").defaults.headers.common.Authorization="Bearer ".concat(e)},createUser:function(e){return r(void 0,void 0,void 0,(function(){var t,r;return n(this,(function(n){switch(n.label){case 0:return t=a().getDependency("userClient"),r={data:{attributes:e}},[4,t.post("/user/create",r)];case 1:return[2,n.sent()]}}))}))},changeEmail:function(e){return r(void 0,void 0,void 0,(function(){var t,r;return n(this,(function(n){switch(n.label){case 0:return t=a().getDependency("userClient"),r={data:{attributes:{email:e}}},[4,t.post("/user/mail/change",r)];case 1:return[2,n.sent()]}}))}))},changePhone:function(e){var t={data:{attributes:{phone:e}}};return a().getDependency("userClient").post("/user/phone/change",t)},changeProfileData:function(e,t){return r(void 0,void 0,void 0,(function(){var r,i;return n(this,(function(n){switch(n.label){case 0:return r=a().getDependency("userClient"),i={data:{attributes:{firstName:e,lastName:t}}},[4,r.put("/user/profile",i)];case 1:return[2,n.sent()]}}))}))},updateProfileByIssuer:function(e,t){return r(void 0,void 0,void 0,(function(){var r,i;return n(this,(function(n){switch(n.label){case 0:return r=a().getDependency("issuerClient"),i={data:{attributes:t}},[4,r.put("/user/".concat(e,"/profile"),i)];case 1:return n.sent(),[2]}}))}))},getProfile:function(){return r(void 0,void 0,void 0,(function(){return n(this,(function(e){switch(e.label){case 0:return[4,a().getDependency("userClient").get("/user/profile")];case 1:return[2,e.sent()]}}))}))},validateNewPhoneOtp:function(e){return r(void 0,void 0,void 0,(function(){var t,r;return n(this,(function(n){switch(n.label){case 0:return t=a().getDependency("userClient"),r={data:{attributes:{code:e}}},[4,t.post("/user/phone/activation/check",r)];case 1:return[2,n.sent()]}}))}))},notification:{subscribeToWebPushNotifications:function(e){var r=a().getDependency("userClient"),n={data:{attributes:t({},e)}};return r.post("/user-notification/push/subscribe",n)},sendEmailByEvent:function(e,t){return r(void 0,void 0,void 0,(function(){var r,i;return n(this,(function(n){switch(n.label){case 0:return r=a().getDependency("userClient"),i={data:{attributes:{event:e,user_id:t}}},[4,r.put("/user/sendEmailByEvent",i)];case 1:return[2,n.sent()]}}))}))},sendCompanyEmailByEvent:function(e,t){return r(void 0,void 0,void 0,(function(){var r,i;return n(this,(function(n){switch(n.label){case 0:return r=a().getDependency("userClient"),i={data:{attributes:{event:e,company_id:t}}},[4,r.put("/user/sendCompanyEmailByEvent",i)];case 1:return[2,n.sent()]}}))}))},sendCompanySmsByEvent:function(e,t){return r(void 0,void 0,void 0,(function(){var r,i;return n(this,(function(n){switch(n.label){case 0:return r=a().getDependency("userClient"),i={data:{attributes:{event:e,company_id:t}}},[4,r.put("/user/sendCompanySmsByEvent",i)];case 1:return[2,n.sent()]}}))}))},listEmailTemplates:function(){return r(void 0,void 0,void 0,(function(){var e,t;return n(this,(function(r){switch(r.label){case 0:return e=a().getDependency("userClient"),(t=new ee).register("template"),[4,e.get("/user-notification/issuer/template/my").then((function(e){return Promise.all([t.deserializeAsync("template",e.data)])})).then((function(e){return Promise.resolve({data:e[0]})}))];case 1:return[2,{data:r.sent().data}]}}))}))}},card:{downloadIOSCard:function(){var e;return a().getDependency("userClient").get("/card/ios/download",{responseType:"blob",timeout:k,headers:(e={},e["x-issuer-sys-name"]=c(),e)}).then(S)},getAndroidCardDownloadLink:function(){return r(void 0,void 0,void 0,(function(){var e;return n(this,(function(t){switch(t.label){case 0:return[4,a().getDependency("userClient").get("/card/android",{headers:(e={},e["x-issuer-sys-name"]=c(),e)})];case 1:return[2,t.sent().data.data[0].attributes.google_pass_url]}}))}))},createAnonymousUserCard:function(e){return void 0===e&&(e=""),r(void 0,void 0,void 0,(function(){var t,r,i,o;return n(this,(function(n){switch(n.label){case 0:return t=a().getDependency("anonymousUserClientWithIssuer"),r={data:{attributes:{referral_id:"",card_type:"gold",logo_text:e}}},[4,t.post("/card/create/info",r)];case 1:return i=n.sent(),[2,{cardNumber:(o=i.data.data[0].attributes).card_number,androidCardDownloadLink:o.android_card_file_link,iosCardDownloadLink:o.ios_card_file_link,cardJwt:o.card_jwt}]}}))}))},getBalanceHistory:function(){return a().getDependency("userClient").get("/card/balanceHistory")},getCardBalanceHistory:re,getReferral:function(){return a().getDependency("userClient").get("/card/referral")},getUserCard:function(){return r(void 0,void 0,void 0,(function(){return n(this,(function(e){switch(e.label){case 0:return[4,a().getDependency("userClient").get("/card/my")];case 1:return[2,e.sent()]}}))}))},restoreCard:function(){return a().getDependency("userClient").get("/card/download",{responseType:"blob",timeout:k})},addPoints:function(e){var t={data:{attributes:{card_number:e.cardNumber,description:e.description,amount:e.amount}}};return a().getDependency("issuerClient").post("/card/balance/addPoints",t)},addReserve:function(e){var t={data:{attributes:{amount:e.amount}}};return a().getDependency("issuerClient").post("/card/balance/addReserve",t)},setTypeCard:function(e){var t={data:{attributes:{card_number:e.cardNumber,type:e.type}}};return a().getDependency("userClient").put("/card/setType/",t)},spendPoints:function(e){var t={data:{attributes:{card_number:e.cardNumber,description:e.description,amount:e.amount}}};return a().getDependency("userClient").post("/card/balance/spendPoints",t)},updateCard:te,updateDiscountPercent:function(e){var t={data:{attributes:{card_number:e.cardNumber,percent:e.discountPercent}}};return a().getDependency("userClient").put("/card/updateDiscountPercent",t)},downloadAnonymousCard:function(e,t){void 0===t&&(t="");var r={data:{attributes:{issuer:e,referral_id:t}}};return a().getDependency("anonymousUserClientWithIssuer").post("/card/create",r,{responseType:"blob",timeout:k}).then(S)},getBonuses:function(){var e=a().getDependency("userClient");return at(e,"/bonuses/my")}}},cardManagement:{listCards:function(e){return r(void 0,void 0,void 0,(function(){var t,r,i;return n(this,(function(n){switch(n.label){case 0:return t=a().getDependency("userClient"),r=dt(),[4,t.get("/card/all",{params:ue(e)}).then((function(e){return Promise.all([r.deserializeAsync("card",e.data),e.data.meta])})).then((function(e){return Promise.resolve({data:e[0],meta:e[1]})}))];case 1:return[2,{data:(i=n.sent()).data,meta:le(i.meta)}]}}))}))},createCard:function(e){return r(void 0,void 0,void 0,(function(){var t,r,i;return n(this,(function(n){switch(n.label){case 0:return t=a().getDependency("userClient"),r={data:{attributes:e}},i=dt(),[4,t.post("/card/createFromExternal",r).then((function(e){return Promise.resolve(i.deserializeAsync("card",e.data))})).then((function(e){return Promise.resolve(e[0])}))];case 1:return[2,n.sent()]}}))}))},issueCard:function(e){return r(void 0,void 0,void 0,(function(){return n(this,(function(t){switch(t.label){case 0:return[4,a().getDependency("userClient").post("/card/issue/".concat(e))];case 1:return t.sent(),[2]}}))}))},deactivateCard:function(e){return r(void 0,void 0,void 0,(function(){return n(this,(function(t){switch(t.label){case 0:return[4,a().getDependency("userClient").put("/card/".concat(e,"/deactivate"))];case 1:return t.sent(),[2]}}))}))},updateCustomParams:function(e,t){return r(void 0,void 0,void 0,(function(){var r,i;return n(this,(function(n){switch(n.label){case 0:return r=a().getDependency("userClient"),i={data:{attributes:t}},[4,r.put("/card/".concat(e,"/customParam"),i)];case 1:return n.sent(),[2]}}))}))},updateExpirationDate:function(e,t){return r(void 0,void 0,void 0,(function(){var r,i;return n(this,(function(n){switch(n.label){case 0:return r=a().getDependency("userClient"),i={data:{attributes:t}},[4,r.put("/card/".concat(e,"/expirationDate"),i)];case 1:return n.sent(),[2]}}))}))}},auth:{getUserTokenByIssuerAPIKey:function(e){return r(void 0,void 0,void 0,(function(){var t,r;return n(this,(function(n){switch(n.label){case 0:return t=a().getDependency("anonymousUserClient"),r={data:{attributes:{apiKey:e}}},[4,t.post("/issuer/auth/by-pass-key",r)];case 1:return[2,n.sent().data.data[0].attributes.jwt]}}))}))},getUserData:function(){return a().getDependency("userClient").get("/user/me")},signInByPhone:function(e){var t={data:{attributes:{phone:e}}};return a().getDependency("anonymousUserClientWithIssuer").post("/user/loginByPhone",t)},validatePhoneOtp:function(e,t){return r(void 0,void 0,void 0,(function(){var r,i;return n(this,(function(n){switch(n.label){case 0:return r=a().getDependency("anonymousUserClientWithIssuer"),i={data:{attributes:{phone:e,code:t}}},[4,r.post("/user/loginByPhone/check",i)];case 1:return[2,n.sent()]}}))}))}},issuer:{setIssuerToken:function(e){a().getDependency("issuerClient").defaults.headers.common.Authorization="Bearer ".concat(e)},sendPushNotification:function(e,t,r){var n={data:{attributes:{title:t,msg:r}}};return a().getDependency("userClient").post("/notification/webPush/".concat(e,"/send"),n)},authByPassToken:function(e){return a().getDependency("issuerClient").post("/issuer/auth/by-pass-token",{},{headers:{Authorization:"Bearer ".concat(e)}})},authByToken:function(e){var t={data:{attributes:{token:e.token}}};return a().getDependency("userClient").post("/issuer/auth/by-token",t)},createIssuer:function(e){var t=e.name,i=e.systemName;return r(void 0,void 0,void 0,(function(){var e,r;return n(this,(function(n){switch(n.label){case 0:return e=a().getDependency("userClient"),r={data:{attributes:{name:t,system_name:i}}},[4,e.post("/issuer/create",r)];case 1:return[2,n.sent()]}}))}))},getIssuer:function(){return a().getDependency("userClient").get("/issuer")},refreshApiKey:function(){return r(void 0,void 0,void 0,(function(){return n(this,(function(e){switch(e.label){case 0:return[4,a().getDependency("userClient").post("/issuer/refresh-apiKey")];case 1:return[2,e.sent()]}}))}))},getSettings:function(){return r(void 0,void 0,void 0,(function(){var e,t;return n(this,(function(r){switch(r.label){case 0:return e=a().getDependency("issuerClient"),t=ne(),[4,e.get("/issuer/me").then((function(e){return Promise.resolve(t.deserializeAsync("issuer",e.data))})).then((function(e){return Promise.resolve(e[0])}))];case 1:return[2,r.sent()]}}))}))},setSettings:function(e){return r(void 0,void 0,void 0,(function(){var t,r,i;return n(this,(function(n){switch(n.label){case 0:return t=a().getDependency("issuerClient"),r={data:{attributes:e}},i=ne(),[4,t.post("/issuer/set-settings",r).then((function(e){return Promise.resolve(i.deserializeAsync("issuer",e.data))})).then((function(e){return Promise.resolve(e[0])}))];case 1:return[2,n.sent().data]}}))}))},sendToAllIssuerCards:function(e){var t=e.channels,r={data:{attributes:{gateways:void 0===t?ie:t,title:e.title,msg:e.message}}};return a().getDependency("userClient").post("/user-notification/push/sendToAllIssuerCards",r)},sendNotificationToCards:function(e){var t=e.cardNumbers,i=e.message,o=e.channels,s=void 0===o?fe:o,c=e.smart,u=void 0===c||c;return r(void 0,void 0,void 0,(function(){var e,r;return n(this,(function(n){switch(n.label){case 0:return e=a().getDependency("userClient"),r={data:{attributes:{gateways:s,cards:t,title:i,msg:i,smart:u}}},[4,e.post("/user-notification/push/sendToCards",r,{})];case 1:return[2,n.sent()]}}))}))},dispatchCustomEvent:function(e){var t=e.card,r=e.eventName,n=e.actions,i=a().getDependency("issuerClient"),o={data:{attributes:{event_name:r,card_number:t}}};return n&&(o.data.attributes.payloads=n),i.post("/loyalty-program/custom-event",o)},getCardById:function(e){var t=a().getDependency("issuerClient"),r=new AbortController,n=new ee;return n.register("card"),{result:t.get("/card/".concat(e),{signal:r.signal}).then((function(e){return Promise.all([e.data,n.deserializeAsync("card",e.data)])})).then((function(e){return Promise.resolve({jsonAPI:e[0],data:e[1][0]})})),abort:r.abort}},getCardByPhone:function(e){var t=a().getDependency("issuerClient"),r=new AbortController,n=new ee;return n.register("card"),{result:t.get("/card/byPhone/".concat(e),{signal:r.signal}).then((function(e){return Promise.all([e.data,n.deserializeAsync("card",e.data)])})).then((function(e){return Promise.resolve({jsonAPI:e[0],data:e[1][0]})})),abort:r.abort}},getCardBalanceHistory:re,setCardName:function(e){var t=e.cardNumber,r=e.data;return te({cardNumber:t,data:r,type:"name"})},getCardBonuses:function(e){var t=a().getDependency("issuerClient");return at(t,"/bonuses/card/".concat(e))},getCardSpends:function(e){var t=a().getDependency("issuerClient"),r=new AbortController,n=new ee;return n.register("spends"),{result:t.get("/bonuses/spends/".concat(e),{signal:r.signal}).then((function(e){return Promise.all([e.data,n.deserializeAsync("spends",e.data)])})).then((function(e){return Promise.resolve({jsonAPI:e[0],data:e[1]})})),abort:r.abort}}},logger:{logError:function(e,t){void 0===t&&(t="unknown");var r=a().getDependency("anonymousUserClient"),n=ae(),i=n.serviceName,o=n.environment,s=new Date,c={correlation_id:t,env:o,payload:e,service_name:i,timestamp:se(s)};return r.post("/logger/addError",c)},logDebug:function(e,t){void 0===t&&(t="unknown");var r=a().getDependency("anonymousUserClient"),n=ae(),i=n.serviceName,o=n.environment,s=new Date,c={correlation_id:t,env:o,payload:e,service_name:i,timestamp:se(s)};return r.post("/logger/addDebug",c)},logInfo:ve,setup:function(e){oe=e}},telemetry:{send:function(e,i){return r(void 0,void 0,void 0,(function(){var r,o;return n(this,(function(n){switch(n.label){case 0:return(r=localStorage.getItem(nt))||function(e){localStorage.setItem(nt,e)}(r=rt()),o={uuid:r,appName:e,appVersion:i,userAgent:window.navigator.userAgent},[4,ve(o)];case 1:return n.sent(),[2,t(t({},o),{dateTime:se(new Date)})]}}))}))}},signup:{acceptTerms:function(e,t){return r(void 0,void 0,void 0,(function(){var r,i,o;return n(this,(function(n){switch(n.label){case 0:switch(r=a().getDependency("anonymousUserClientWithIssuer"),i={data:{attributes:{agreement:!0}}},t&&(i.data.attributes.ref_id=t),o="",e){case"basic":o="/user/activation/".concat(e,"/terms");break;case"standard":case"fd61387f":case"498c83ac":o="/user/registration/".concat(e,"/start/terms")}return[4,r.post(o,i)];case 1:return[2,n.sent()]}}))}))},activateEmail:function(e){return r(void 0,void 0,void 0,(function(){var t,r;return n(this,(function(n){switch(n.label){case 0:return t=a().getDependency("userClient"),r={data:{attributes:{}}},[4,t.post("/user/activation/".concat(e,"/emailActivation"),r)];case 1:return[2,n.sent()]}}))}))},activatePhone:function(e,t){return r(void 0,void 0,void 0,(function(){var r,i;return n(this,(function(n){switch(n.label){case 0:return r=a().getDependency("userClient"),i={data:{attributes:{code:e}}},[4,r.post("/user/activation/".concat(t,"/phoneActivation"),i)];case 1:return[2,n.sent()]}}))}))},resendActivationCode:function(){return r(void 0,void 0,void 0,(function(){return n(this,(function(e){switch(e.label){case 0:return[4,a().getDependency("userClient").post("/user/phone/activation/resend")];case 1:return[2,e.sent()]}}))}))},setEmail:function(e,t){return r(void 0,void 0,void 0,(function(){var r,i;return n(this,(function(n){switch(n.label){case 0:return r=a().getDependency("userClient"),i={data:{attributes:{email:e}}},[4,r.post("/user/activation/".concat(t,"/setEmail"),i)];case 1:return[2,n.sent()]}}))}))},setPhone:function(e,t){return r(void 0,void 0,void 0,(function(){var r,i;return n(this,(function(n){switch(n.label){case 0:return r=a().getDependency("userClient"),i={data:{attributes:{phone:e}}},[4,r.post("/user/activation/".concat(t,"/setPhone"),i)];case 1:return[2,n.sent()]}}))}))},setProfile:function(e,t){return r(void 0,void 0,void 0,(function(){var r,i,o;return n(this,(function(n){switch(n.label){case 0:switch(r=a().getDependency("userClient"),i={data:{attributes:{firstName:e.firstName,lastName:e.lastName}}},o="",t){case"basic":o="/user/".concat(e.userId,"/activation/").concat(t,"/start/profile");break;case"standard":case"fd61387f":case"498c83ac":o="/user/activation/".concat(t,"/profile")}return[4,r.post(o,i)];case 1:return[2,n.sent()]}}))}))},setBirthdate:function(e,t){return r(void 0,void 0,void 0,(function(){var r,i;return n(this,(function(n){switch(n.label){case 0:return r=a().getDependency("userClient"),i={data:{attributes:{birth:e}}},[4,r.post("/user/activation/".concat(t,"/birth"),i)];case 1:return[2,n.sent()]}}))}))},skipEmail:function(e){return r(void 0,void 0,void 0,(function(){return n(this,(function(t){switch(t.label){case 0:return[4,a().getDependency("userClient").post("/user/activation/".concat(e,"/skip/setEmail"))];case 1:return[2,t.sent()]}}))}))},skipEmailActivation:function(e){return r(void 0,void 0,void 0,(function(){return n(this,(function(t){switch(t.label){case 0:return[4,a().getDependency("userClient").post("/user/activation/".concat(e,"/skip/emailActivation"))];case 1:return[2,t.sent()]}}))}))},skipProfile:function(e){return r(void 0,void 0,void 0,(function(){return n(this,(function(t){switch(t.label){case 0:return[4,a().getDependency("userClient").post("/user/activation/".concat(e,"/skip/profile"))];case 1:return[2,t.sent()]}}))}))},setEmailWithoutActivation:function(e,t){return r(void 0,void 0,void 0,(function(){var r,i;return n(this,(function(n){switch(n.label){case 0:return r=a().getDependency("userClient"),i={data:{attributes:{email:e}}},[4,r.post("/user/activation/".concat(t,"/setEmailWithoutActivation"),i)];case 1:return[2,n.sent()]}}))}))}},url:{getShortUrl:function(e){return r(void 0,void 0,void 0,(function(){var t,r;return n(this,(function(n){switch(n.label){case 0:return t=a().getDependency("anonymousUserClient"),r={data:{attributes:{target_url:e}}},[4,t.post("/link/create",r)];case 1:return[2,n.sent()]}}))}))}},analytics:{createEvent:function(e,t,i,o,s){return void 0===o&&(o="unknown"),void 0===s&&(s="unknown"),r(void 0,void 0,void 0,(function(){var r,c;return n(this,(function(n){switch(n.label){case 0:return r=a().getDependency("userClient"),c={data:{attributes:{action:e,metadata:{OSType:o,OSVersion:s,section:t},user_identifier:i}}},[4,r.post("/event/create",c)];case 1:return n.sent(),[2]}}))}))},getGeneralCardsData:function(e,t){return r(void 0,void 0,void 0,(function(){return n(this,(function(r){return[2,a().getDependency("userClient").get("/event/stats/metrics?from=".concat(de(e),"&to=").concat(de(t)))]}))}))},getActiveUsersData:function(e,t){return r(void 0,void 0,void 0,(function(){return n(this,(function(r){return[2,a().getDependency("userClient").get("/event/stats/active-users?from=".concat(de(e),"&to=").concat(de(t)))]}))}))},getPointsData:function(e,t){return r(void 0,void 0,void 0,(function(){var r,i;return n(this,(function(n){switch(n.label){case 0:return r=a().getDependency("userClient"),(i=new ee).register("points_cumulative"),[4,r.get("/event/stats/points-cumulative",{params:{from:de(e),to:de(t)}}).then((function(e){return Promise.resolve(i.deserializeAsync("points_cumulative",e.data))})).then((function(e){return Promise.resolve(e[0])}))];case 1:return[2,n.sent()]}}))}))},getPointsAddedStats:function(e,t){return r(void 0,void 0,void 0,(function(){var r,i;return n(this,(function(n){switch(n.label){case 0:return r=a().getDependency("userClient"),(i=new ee).register("bonus_points_added_cumulative"),[4,r.get("/event/stats/bonus-points-added",{params:{from:de(e),to:de(t)}}).then((function(e){return Promise.resolve(i.deserializeAsync("bonus_points_added_cumulative",e.data))})).then((function(e){return Promise.resolve(e[0])}))];case 1:return[2,n.sent()]}}))}))},getPointsUsedStats:function(e,t){return r(void 0,void 0,void 0,(function(){var r,i;return n(this,(function(n){switch(n.label){case 0:return r=a().getDependency("userClient"),(i=new ee).register("bonus_points_used_daily"),[4,r.get("/event/stats/bonus-points-used",{params:{from:de(e),to:de(t)}}).then((function(e){return Promise.resolve(i.deserializeAsync("bonus_points_used_daily",e.data))})).then((function(e){return Promise.resolve(e[0])}))];case 1:return[2,n.sent()]}}))}))},getMyNotificationStats:function(e,t){var r=a().getDependency("issuerClient"),n=new AbortController,i=new ee;return i.register("issuer_stats"),{result:r.get("/loyalty-notification/stats?from=".concat(de(e),"&to=").concat(de(t)),{signal:n.signal}).then((function(e){return Promise.all([e.data,i.deserializeAsync("issuer_stats",e.data)])})).then((function(e){return Promise.resolve({jsonAPI:e[0],data:e[1][0]})})),abort:n.abort}},getIssuedCardsStats:function(e,t){return r(void 0,void 0,void 0,(function(){var r,i;return n(this,(function(n){switch(n.label){case 0:return r=a().getDependency("userClient"),(i=new ee).register("issued_cards"),[4,r.get("/event/stats/issued-cards",{params:{from:de(e),to:de(t)}}).then((function(e){return Promise.resolve(i.deserializeAsync("issued_cards",e.data))})).then((function(e){return Promise.resolve(e[0])}))];case 1:return[2,n.sent()]}}))}))},getPurchasesStats:function(e,t){return r(void 0,void 0,void 0,(function(){var r,i;return n(this,(function(n){switch(n.label){case 0:return r=a().getDependency("userClient"),(i=new ee).register("purchases"),[4,r.get("/event/stats/purchases",{params:{from:de(e),to:de(t)}}).then((function(e){return Promise.resolve(i.deserializeAsync("purchases",e.data))})).then((function(e){return Promise.resolve(e[0])}))];case 1:return[2,n.sent()]}}))}))},getUniquePurchasesStats:function(e,t){return r(void 0,void 0,void 0,(function(){var r,i;return n(this,(function(n){switch(n.label){case 0:return r=a().getDependency("userClient"),(i=new ee).register("unique_client_purchases"),[4,r.get("/event/stats/unique-purchases",{params:{from:de(e),to:de(t)}}).then((function(e){return Promise.resolve(i.deserializeAsync("unique_client_purchases",e.data))})).then((function(e){return Promise.resolve(e[0])}))];case 1:return[2,n.sent()]}}))}))},getCardConversionStats:function(e,t){return r(void 0,void 0,void 0,(function(){var r,i;return n(this,(function(n){switch(n.label){case 0:return r=a().getDependency("userClient"),(i=new ee).register("card_conversion"),[4,r.get("/event/stats/card-conversion",{params:{from:de(e),to:de(t)}}).then((function(e){return Promise.resolve(i.deserializeAsync("card_conversion",e.data))})).then((function(e){return Promise.resolve(e[0])}))];case 1:return[2,n.sent()]}}))}))},getUserCompositionStats:function(e,t){return r(void 0,void 0,void 0,(function(){var r,i;return n(this,(function(n){switch(n.label){case 0:return r=a().getDependency("userClient"),(i=new ee).register("user_composition"),[4,r.get("/event/stats/user-composition",{params:{from:de(e),to:de(t)}}).then((function(e){return Promise.resolve(i.deserializeAsync("user_composition",e.data))})).then((function(e){return Promise.resolve(e[0])}))];case 1:return[2,n.sent()]}}))}))}},shortLink:{createLink:function(e){var t=e.name,i=e.linkType,o=e.url,s=e.meta,c=e.params;return r(void 0,void 0,void 0,(function(){var e,r,u;return n(this,(function(n){switch(n.label){case 0:return e=a().getDependency("userClient"),r={data:{attributes:{name:t,link_type:i,url:o,meta:s,params:c}}},u=ce(),[4,e.post("/smart-link/create",r).then((function(e){return Promise.resolve(u.deserializeAsync("smart_link",e.data))})).then((function(e){return Promise.resolve(e[0])}))];case 1:return[2,n.sent()]}}))}))},editLink:function(e,i){return r(void 0,void 0,void 0,(function(){var r,o;return n(this,(function(n){switch(n.label){case 0:return r=a().getDependency("userClient"),o={data:{attributes:t(t({},i),{link_type:i.linkType})}},[4,r.put("/smart-link/".concat(e),o)];case 1:return n.sent(),[2]}}))}))},deleteLink:function(e){return r(void 0,void 0,void 0,(function(){return n(this,(function(t){switch(t.label){case 0:return[4,a().getDependency("userClient").delete("/smart-link/".concat(e))];case 1:return t.sent(),[2]}}))}))},listLinks:function(e){return r(void 0,void 0,void 0,(function(){var t,r,i;return n(this,(function(n){switch(n.label){case 0:return t=a().getDependency("userClient"),r=ce(),[4,t.get("/smart-link/my",{params:ue(e)}).then((function(e){return Promise.all([r.deserializeAsync("smart_link",e.data),e.data.meta])})).then((function(e){return Promise.resolve({data:e[0],meta:e[1]})}))];case 1:return[2,{data:(i=n.sent()).data,meta:(o=i.meta,o?{page:Math.ceil(o.Offset/o.Limit),pageSize:o.Limit,totalData:o.TotalItems,totalPages:Math.ceil(o.TotalItems/o.Limit)}:{})}]}var o}))}))},viewLink:function(e){return r(void 0,void 0,void 0,(function(){var t,r;return n(this,(function(n){switch(n.label){case 0:return t=a().getDependency("userClient"),r=ce(),[4,t.get("/smart-link/".concat(e)).then((function(e){return Promise.resolve(r.deserializeAsync("smart_link",e.data))})).then((function(e){return Promise.resolve(e[0])}))];case 1:return[2,n.sent()]}}))}))}},shortLinkAction:{createLinkAction:function(e,t){var i=t.type,o=t.payload;return r(void 0,void 0,void 0,(function(){var t;return n(this,(function(r){return t={data:{attributes:{type:i,payload:o}}},[2,a().getDependency("userClient").put("/smart-link/".concat(e,"/action"),t)]}))}))},editLinkAction:function(e,t,i){var o=i.type,s=i.payload;return r(void 0,void 0,void 0,(function(){var r;return n(this,(function(n){return r={data:{attributes:{type:o,payload:s}}},[2,a().getDependency("userClient").put("/smart-link/".concat(e,"/action/").concat(t),r)]}))}))},deleteLinkAction:function(e,t){return r(void 0,void 0,void 0,(function(){return n(this,(function(r){return a().getDependency("userClient").delete("/smart-link/".concat(e,"/action/").concat(t)),[2]}))}))}},campaign:{createCampaign:function(e){return r(void 0,void 0,void 0,(function(){var t,r,i;return n(this,(function(n){switch(n.label){case 0:return t=a().getDependency("issuerClient"),r={data:{type:"campaign",attributes:e}},i=it(),[4,t.post("/campaign/v2/campaigns",r).then((function(e){return Promise.resolve(i.deserializeAsync("campaign",e.data))}))];case 1:return[2,n.sent()[0]]}}))}))},getCampaignById:function(e){return r(void 0,void 0,void 0,(function(){var t,r,i;return n(this,(function(n){switch(n.label){case 0:return t=a().getDependency("issuerClient"),r=new AbortController,i=it(),[4,t.get("/campaign/v2/campaigns/".concat(e),{signal:r.signal}).then((function(e){return Promise.resolve(i.deserializeAsync("campaign",e.data))})).then((function(e){return Promise.resolve(e[0])}))];case 1:return[2,n.sent()]}}))}))},listCampaigns:function(e){return r(void 0,void 0,void 0,(function(){var t,r,i,o;return n(this,(function(n){switch(n.label){case 0:return t=a().getDependency("issuerClient"),r=new AbortController,i=it(),[4,t.get("/campaign/v2/campaigns",{params:e,signal:r.signal}).then((function(e){return Promise.all([i.deserializeAsync("campaign",e.data),e.data.meta])})).then((function(e){return Promise.resolve({data:e[0],meta:e[1]})}))];case 1:return[2,{data:(o=n.sent()).data,meta:le(o.meta)}]}}))}))},deleteCampaign:function(e){return a().getDependency("issuerClient").delete("/campaign/v2/campaigns/".concat(e))},updateCampaignInfo:function(e,t){return r(void 0,void 0,void 0,(function(){var r,i,o;return n(this,(function(n){switch(n.label){case 0:return r=a().getDependency("issuerClient"),i={data:{type:"campaign",attributes:t}},o=it(),[4,r.put("/campaign/v2/campaigns/".concat(e),i).then((function(e){return Promise.resolve(o.deserializeAsync("campaign",e.data))}))];case 1:return[2,n.sent()[0]]}}))}))},updateCampaignDates:function(e,t){return r(void 0,void 0,void 0,(function(){var r,i,o;return n(this,(function(n){switch(n.label){case 0:return r=a().getDependency("issuerClient"),i={data:{type:"campaign_schedule",attributes:t}},o=it(),[4,r.post("/campaign/v2/campaigns/".concat(e,"/schedule"),i).then((function(e){return Promise.resolve(o.deserializeAsync("campaign",e.data))}))];case 1:return[2,n.sent()[0]]}}))}))},updateCampaignLocations:function(e,t){return r(void 0,void 0,void 0,(function(){var r,i,o;return n(this,(function(n){switch(n.label){case 0:return r=a().getDependency("issuerClient"),i={data:{type:"campaign_locations",attributes:t}},o=it(),[4,r.put("/campaign/v2/campaigns/".concat(e,"/locations"),i).then((function(e){return Promise.resolve(o.deserializeAsync("campaign",e.data))}))];case 1:return[2,n.sent()[0]]}}))}))},addActionToCampaign:function(e,t){return r(void 0,void 0,void 0,(function(){var r,i,o;return n(this,(function(n){switch(n.label){case 0:return r=a().getDependency("issuerClient"),i={data:{type:"campaign_action",attributes:t}},o=it(),[4,r.post("/campaign/v2/campaigns/".concat(e,"/actions"),i).then((function(e){return Promise.resolve(o.deserializeAsync("campaign",e.data))}))];case 1:return[2,n.sent()[0]]}}))}))},updateCampaignAction:function(e,t,i,o){return void 0===o&&(o="campaign_action"),r(void 0,void 0,void 0,(function(){var r,s,c;return n(this,(function(n){switch(n.label){case 0:return r=a().getDependency("issuerClient"),s={data:{type:o,attributes:i}},c=it(),[4,r.put("/campaign/v2/campaigns/".concat(e,"/actions/").concat(t),s).then((function(e){return Promise.resolve(c.deserializeAsync("campaign",e.data))}))];case 1:return[2,n.sent()[0]]}}))}))},deleteActionFromCampaign:function(e,t){return a().getDependency("issuerClient").delete("/campaign/v2/campaigns/".concat(e,"/actions/").concat(t))},executeCampaign:function(e,t){return r(void 0,void 0,void 0,(function(){var r,i,o,s;return n(this,(function(n){switch(n.label){case 0:return r=a().getDependency("issuerClient"),i={data:{type:"campaign_execution",attributes:{parameters:{execution_mode:null!==(s=t.execution_mode)&&void 0!==s?s:"immediate",notification_channels:t.notification_channels}}}},(o=new ee).register("execution_report"),o.register("action_result"),[4,r.post("/campaign/v2/campaigns/".concat(e,"/execute"),i).then((function(e){return Promise.resolve(o.deserializeAsync("execution_report",e.data))}))];case 1:return[2,n.sent()[0]]}}))}))},activateCampaign:function(e){return a().getDependency("issuerClient").post("/campaign/v2/campaigns/".concat(e,"/activate"))},pauseCampaign:function(e){return a().getDependency("issuerClient").post("/campaign/v2/campaigns/".concat(e,"/pause"))},resumeCampaign:function(e){return a().getDependency("issuerClient").post("/campaign/v2/campaigns/".concat(e,"/resume"))},cancelCampaign:function(e){return a().getDependency("issuerClient").post("/campaign/v2/campaigns/".concat(e,"/cancel"))},completeCampaign:function(e){return a().getDependency("issuerClient").post("/campaign/v2/campaigns/".concat(e,"/complete"))},getCampaignStatistics:function(e){return r(void 0,void 0,void 0,(function(){var t,r,i;return n(this,(function(n){switch(n.label){case 0:return t=a().getDependency("issuerClient"),r=new AbortController,(i=new ee).register("campaign_statistics"),[4,t.get("/campaign/v2/campaigns/".concat(e,"/statistics"),{signal:r.signal}).then((function(e){return Promise.resolve(i.deserializeAsync("campaign_statistics",e.data))})).then((function(e){return Promise.resolve(e[0])}))];case 1:return[2,n.sent()]}}))}))}},cohorts:{listCohorts:function(e){return r(void 0,void 0,void 0,(function(){var t,r,i;return n(this,(function(n){switch(n.label){case 0:return t=a().getDependency("userClient"),r=ot(),[4,t.get("/campaign/cohorts/v2/cohort",{params:e}).then((function(e){return Promise.all([r.deserializeAsync("cohort",e.data),e.data.meta])})).then((function(e){return Promise.resolve({data:e[0],meta:e[1]})}))];case 1:return[2,{data:(i=n.sent()).data,meta:le(i.meta)}]}}))}))},getCohortById:function(e){return r(void 0,void 0,void 0,(function(){var t,r;return n(this,(function(n){switch(n.label){case 0:return t=a().getDependency("userClient"),r=ot(),[4,t.get("/campaign/cohorts/v2/cohort/".concat(e)).then((function(e){return Promise.resolve(r.deserializeAsync("cohort",e.data))})).then((function(e){return Promise.resolve(e[0])}))];case 1:return[2,n.sent()]}}))}))},createCohort:function(e){return r(void 0,void 0,void 0,(function(){var t,r,i;return n(this,(function(n){switch(n.label){case 0:return t=a().getDependency("userClient"),r=ot(),i={data:{attributes:e}},[4,t.post("/campaign/cohorts/v2/cohort",i).then((function(e){return Promise.resolve(r.deserializeAsync("cohort",e.data))})).then((function(e){return Promise.resolve(e[0])}))];case 1:return[2,n.sent()]}}))}))},updateCohort:function(e,t){return r(void 0,void 0,void 0,(function(){var r,i;return n(this,(function(n){switch(n.label){case 0:return r=a().getDependency("userClient"),i={data:{attributes:t}},[4,r.put("/campaign/cohorts/v2/cohort/".concat(e),i)];case 1:return n.sent(),[2]}}))}))},deleteCohort:function(e){return r(void 0,void 0,void 0,(function(){return n(this,(function(t){switch(t.label){case 0:return[4,a().getDependency("userClient").delete("/campaign/cohorts/v2/cohort/".concat(e))];case 1:return t.sent(),[2]}}))}))}},messengerHub:{sendTelegramMsg:function(e){return r(void 0,void 0,void 0,(function(){var t,r;return n(this,(function(n){switch(n.label){case 0:return t=a().getDependency("issuerClient"),r={data:{attributes:e}},[4,t.put("/messenger-hub/send-msg",r,{timeout:3e5})];case 1:return[2,n.sent().data]}}))}))}},transactions:{getTransactionsByCard:function(e){var t=a().getDependency("issuerClient"),r=new AbortController,n=new ee;return n.register("transactions"),{result:t.get("/bonuses/transactions/card/".concat(e),{signal:r.signal}).then((function(e){return Promise.all([e.data,n.deserializeAsync("transactions",e.data)])})).then((function(e){return Promise.resolve({jsonAPI:e[0],data:e[1]})})),abort:r.abort}}},tiers:{getAllTiers:function(){var e=a().getDependency("issuerClient"),t=new AbortController,r=new ee;return r.register("tier"),r.register("tier_level"),{result:e.get("/loyalty-program/tier/my",{signal:t.signal}).then((function(e){return Promise.all([e.data,r.deserializeAsync("tier",e.data)])})).then((function(e){return Promise.resolve({jsonAPI:e[0],data:e[1][0]})})),abort:t.abort}},getTiersByCard:function(e){var t=a().getDependency("issuerClient"),r=new AbortController,n=new ee;return n.register("userTier"),{result:t.get("/loyalty-program/tier/card/".concat(e),{signal:r.signal}).then((function(e){return Promise.all([e.data,n.deserializeAsync("userTier",e.data)])})).then((function(e){return Promise.resolve({jsonAPI:e[0],data:e[1][0]})})),abort:r.abort}},setTierByCard:function(e){var t=e.disableAutoUpdate,r=void 0===t||t,n=e.tierID,i=e.cardNumber,o=a().getDependency("issuerClient"),s=new AbortController,c=new ee;c.register("tier"),c.register("tier_level");var u={data:{attributes:{level_id:n,is_on_hold:r}}};return{result:o.put("/loyalty-program/tier/card/".concat(i),u,{signal:s.signal}).then((function(e){return Promise.all([e.data,c.deserializeAsync("tier",e.data)])})).then((function(e){return Promise.resolve({jsonAPI:e[0],data:e[1][0]})})),abort:s.abort}}},promocodes:{listPromocodes:function(e){return r(void 0,void 0,void 0,(function(){var t,r,i;return n(this,(function(n){switch(n.label){case 0:return t=a().getDependency("userClient"),r=st(),[4,t.get("/loyalty-program/promocode",{params:ue(e)}).then((function(e){return Promise.all([r.deserializeAsync("promocode",e.data),e.data.meta])})).then((function(e){return Promise.resolve({data:e[0],meta:e[1]})}))];case 1:return[2,{data:(i=n.sent()).data,meta:le(i.meta)}]}}))}))},getPromocodeById:function(e){return r(void 0,void 0,void 0,(function(){var t,r;return n(this,(function(n){switch(n.label){case 0:return t=a().getDependency("userClient"),r=st(),[4,t.get("/loyalty-program/promocode/".concat(e)).then((function(e){return Promise.resolve(r.deserializeAsync("promocode",e.data))})).then((function(e){return Promise.resolve(e[0])}))];case 1:return[2,n.sent()]}}))}))},createPromocode:function(e){return r(void 0,void 0,void 0,(function(){var t,r,i;return n(this,(function(n){switch(n.label){case 0:return t=a().getDependency("userClient"),r=st(),i={data:{attributes:e}},[4,t.post("/loyalty-program/promocode",i).then((function(e){return Promise.resolve(r.deserializeAsync("promocode",e.data))})).then((function(e){return Promise.resolve(e[0])}))];case 1:return[2,n.sent()]}}))}))},updatePromocode:function(e,t){return r(void 0,void 0,void 0,(function(){var r,i;return n(this,(function(n){switch(n.label){case 0:return r=a().getDependency("userClient"),i={data:{attributes:t}},[4,r.put("/loyalty-program/promocode/".concat(e),i)];case 1:return n.sent(),[2]}}))}))},enablePromocode:function(e){return r(void 0,void 0,void 0,(function(){return n(this,(function(t){switch(t.label){case 0:return[4,a().getDependency("userClient").put("/loyalty-program/promocode/".concat(e,"/enable"))];case 1:return t.sent(),[2]}}))}))},disablePromocode:function(e){return r(void 0,void 0,void 0,(function(){return n(this,(function(t){switch(t.label){case 0:return[4,a().getDependency("userClient").put("/loyalty-program/promocode/".concat(e,"/disable"))];case 1:return t.sent(),[2]}}))}))},archivePromocode:function(e){return r(void 0,void 0,void 0,(function(){return n(this,(function(t){switch(t.label){case 0:return[4,a().getDependency("userClient").put("/loyalty-program/promocode/".concat(e,"/archive"))];case 1:return t.sent(),[2]}}))}))},unarchivePromocode:function(e){return r(void 0,void 0,void 0,(function(){return n(this,(function(t){switch(t.label){case 0:return[4,a().getDependency("userClient").put("/loyalty-program/promocode/".concat(e,"/unarchive"))];case 1:return t.sent(),[2]}}))}))},usePromocode:function(e){return r(void 0,void 0,void 0,(function(){return n(this,(function(t){switch(t.label){case 0:return[4,a().getDependency("userClient").put("/loyalty-program/user-promo-code/".concat(e,"/use"))];case 1:return t.sent(),[2]}}))}))}},excludes:{listExcludes:function(e){return r(void 0,void 0,void 0,(function(){var t,r,i;return n(this,(function(n){switch(n.label){case 0:return t=a().getDependency("userClient"),r=ct(),[4,t.get("/loyalty-program/settings/exclude",{params:ue(e)}).then((function(e){return Promise.all([r.deserializeAsync("exclude",e.data),e.data.meta])})).then((function(e){return Promise.resolve({data:e[0],meta:e[1]})}))];case 1:return[2,{data:(i=n.sent()).data,meta:le(i.meta)}]}}))}))},getExclude:function(e){return r(void 0,void 0,void 0,(function(){var t,r;return n(this,(function(n){switch(n.label){case 0:return t=a().getDependency("userClient"),r=ct(),[4,t.get("/loyalty-program/settings/exclude/".concat(e)).then((function(e){return Promise.resolve(r.deserializeAsync("exclude",e.data))})).then((function(e){return Promise.resolve(e[0])}))];case 1:return[2,n.sent()]}}))}))},createExclude:function(e){return r(void 0,void 0,void 0,(function(){var t,r,i;return n(this,(function(n){switch(n.label){case 0:return t=a().getDependency("userClient"),r={data:{attributes:e}},i=ct(),[4,t.post("/loyalty-program/settings/exclude",r).then((function(e){return Promise.resolve(i.deserializeAsync("exclude",e.data))})).then((function(e){return Promise.resolve(e[0])}))];case 1:return[2,n.sent()]}}))}))},updateExclude:function(e,t){return r(void 0,void 0,void 0,(function(){var r,i,o;return n(this,(function(n){switch(n.label){case 0:return r=a().getDependency("userClient"),i={data:{attributes:t}},o=ct(),[4,r.put("/loyalty-program/settings/exclude/".concat(e),i).then((function(e){return Promise.resolve(o.deserializeAsync("exclude",e.data))})).then((function(e){return Promise.resolve(e[0])}))];case 1:return[2,n.sent()]}}))}))},deleteExclude:function(e){return r(void 0,void 0,void 0,(function(){return n(this,(function(t){switch(t.label){case 0:return[4,a().getDependency("userClient").delete("/loyalty-program/settings/exclude/".concat(e))];case 1:return t.sent(),[2]}}))}))}},products:{searchProducts:function(e){var t=e.page,i=e.pageSize,o=e.search,s=void 0===o?"":o;return r(void 0,void 0,void 0,(function(){var e,r,o;return n(this,(function(n){switch(n.label){case 0:return e=a().getDependency("userClient"),r=ut(),[4,e.get("loyalty-products/search/".concat(s),{params:ue({page:t,pageSize:i})}).then((function(e){return Promise.all([r.deserializeAsync("product",e.data),e.data.meta])})).then((function(e){return Promise.resolve({data:e[0],meta:e[1]})}))];case 1:return[2,{data:(o=n.sent()).data,meta:le(o.meta)}]}}))}))},searchCategories:function(e){var t=e.page,i=e.pageSize,o=e.search,s=void 0===o?"":o;return r(void 0,void 0,void 0,(function(){var e,r,o;return n(this,(function(n){switch(n.label){case 0:return e=a().getDependency("userClient"),r=lt(),[4,e.get("loyalty-products/category-search/".concat(s),{params:ue({page:t,pageSize:i}),timeout:6e4}).then((function(e){return Promise.all([r.deserializeAsync("category",e.data),e.data.meta])})).then((function(e){return Promise.resolve({data:e[0],meta:e[1]})}))];case 1:return[2,{data:(o=n.sent()).data,meta:le(o.meta)}]}}))}))},getProductById:function(e){return r(void 0,void 0,void 0,(function(){var t,r;return n(this,(function(n){switch(n.label){case 0:return t=a().getDependency("userClient"),r=ut(),[4,t.get("loyalty-products/product/".concat(e)).then((function(e){return Promise.resolve(r.deserializeAsync("product",e.data))})).then((function(e){return Promise.resolve(e[0])}))];case 1:return[2,n.sent()]}}))}))},getCategoryById:function(e){return r(void 0,void 0,void 0,(function(){var t,r;return n(this,(function(n){switch(n.label){case 0:return t=a().getDependency("userClient"),r=lt(),[4,t.get("loyalty-products/category/".concat(e)).then((function(e){return Promise.resolve(r.deserializeAsync("category",e.data))})).then((function(e){return Promise.resolve(e[0])}))];case 1:return[2,n.sent()]}}))}))}},orders:{openOrder:function(e){return r(void 0,void 0,void 0,(function(){var t,r,i;return n(this,(function(n){switch(n.label){case 0:return t=a().getDependency("userClient"),r={data:{attributes:e}},i=pt(),[4,t.post("/loyalty-program/order/open",r).then((function(e){return Promise.resolve(i.deserializeAsync("order",e.data))})).then((function(e){return Promise.resolve(e[0])}))];case 1:return[2,n.sent()]}}))}))},closeOrder:function(e){return r(void 0,void 0,void 0,(function(){var t,r;return n(this,(function(n){switch(n.label){case 0:return t=a().getDependency("userClient"),r=pt(),[4,t.put("/loyalty-program/order/".concat(e,"/close")).then((function(e){return Promise.resolve(r.deserializeAsync("order",e.data))})).then((function(e){return Promise.resolve(e[0])}))];case 1:return[2,n.sent()]}}))}))}},referralProgram:{createRefProgram:function(e){return r(void 0,void 0,void 0,(function(){var t,r;return n(this,(function(n){switch(n.label){case 0:return t=a().getDependency("userClient"),r=ft(),[4,t.post("/loyalty-program/referral/program",e).then((function(e){return Promise.resolve(r.deserializeAsync("referral_program",e.data))})).then((function(e){return Promise.resolve(e[0])}))];case 1:return[2,n.sent()]}}))}))},updateRefProgram:function(e,t){return r(void 0,void 0,void 0,(function(){return n(this,(function(r){switch(r.label){case 0:return[4,a().getDependency("userClient").put("/loyalty-program/referral/program/".concat(e),t)];case 1:return r.sent(),[2]}}))}))},enableRefProgram:function(e){return r(void 0,void 0,void 0,(function(){return n(this,(function(t){switch(t.label){case 0:return[4,a().getDependency("userClient").put("/loyalty-program/referral/program/".concat(e,"/enable"))];case 1:return t.sent(),[2]}}))}))},disableRefProgram:function(e){return r(void 0,void 0,void 0,(function(){return n(this,(function(t){switch(t.label){case 0:return[4,a().getDependency("userClient").put("/loyalty-program/referral/program/".concat(e,"/disable"))];case 1:return t.sent(),[2]}}))}))},archiveRefProgram:function(e){return r(void 0,void 0,void 0,(function(){return n(this,(function(t){switch(t.label){case 0:return[4,a().getDependency("userClient").put("/loyalty-program/referral/program/".concat(e,"/archive"))];case 1:return t.sent(),[2]}}))}))},listRefPrograms:function(e){return r(void 0,void 0,void 0,(function(){var t,r,i;return n(this,(function(n){switch(n.label){case 0:return t=a().getDependency("userClient"),r=ft(),[4,t.get("/loyalty-program/referral/program",{params:ue(e)}).then((function(e){return Promise.all([r.deserializeAsync("referral_program",e.data),e.data.meta])})).then((function(e){return Promise.resolve({data:e[0],meta:e[1]})}))];case 1:return[2,{data:(i=n.sent()).data,meta:le(i.meta)}]}}))}))},getRefProgram:function(e){return r(void 0,void 0,void 0,(function(){var t,r;return n(this,(function(n){switch(n.label){case 0:return t=a().getDependency("userClient"),r=ft(),[4,t.get("/loyalty-program/referral/program/".concat(e)).then((function(e){return Promise.resolve(r.deserializeAsync("referral_program",e.data))})).then((function(e){return Promise.resolve(e[0])}))];case 1:return[2,n.sent()]}}))}))},getRefProgramAnalytics:function(e){return r(void 0,void 0,void 0,(function(){var t,r;return n(this,(function(n){switch(n.label){case 0:return t=a().getDependency("userClient"),(r=new ee).register("program_analytics"),[4,t.get("/loyalty-program/referral/program/".concat(e,"/analytics")).then((function(e){return Promise.resolve(r.deserializeAsync("program_analytics",e.data))})).then((function(e){return Promise.resolve(e[0])}))];case 1:return[2,n.sent()]}}))}))},getRefProgramMetrics:function(e,t){return r(void 0,void 0,void 0,(function(){return n(this,(function(r){switch(r.label){case 0:return[4,a().getDependency("userClient").get("/loyalty-program/referral/analytics/program/".concat(e,"/metrics"),{params:t})];case 1:return[2,r.sent().data]}}))}))},addInfluencer:function(e,t){return r(void 0,void 0,void 0,(function(){var r,i;return n(this,(function(n){switch(n.label){case 0:return r=a().getDependency("userClient"),i=vt(),[4,r.post("loyalty-program/referral/program/".concat(e,"/influencer"),t).then((function(e){return Promise.resolve(i.deserializeAsync("influencer",e.data))})).then((function(e){return Promise.resolve(e[0])}))];case 1:return[2,n.sent()]}}))}))},updateInfluencer:function(e,t,i){return r(void 0,void 0,void 0,(function(){var r,o;return n(this,(function(n){switch(n.label){case 0:return r=a().getDependency("userClient"),o=vt(),[4,r.put("/loyalty-program/referral/program/".concat(e,"/influencer/").concat(t),i).then((function(e){return Promise.resolve(o.deserializeAsync("influencer",e.data))})).then((function(e){return Promise.resolve(e[0])}))];case 1:return[2,n.sent()]}}))}))},updateInfluencerReward:function(e,t,i){return r(void 0,void 0,void 0,(function(){var r,o;return n(this,(function(n){switch(n.label){case 0:return r=a().getDependency("userClient"),o=vt(),[4,r.put("/loyalty-program/referral/program/".concat(e,"/influencer/").concat(t,"/reward-condition"),i).then((function(e){return Promise.resolve(o.deserializeAsync("influencer",e.data))})).then((function(e){return Promise.resolve(e[0])}))];case 1:return[2,n.sent()]}}))}))},deleteInfluencer:function(e,t){return r(void 0,void 0,void 0,(function(){return n(this,(function(r){switch(r.label){case 0:return[4,a().getDependency("userClient").delete("/loyalty-program/referral/program/".concat(e,"/influencer/").concat(t))];case 1:return r.sent(),[2]}}))}))},listInfluencers:function(e,t){return r(void 0,void 0,void 0,(function(){var r,i,o;return n(this,(function(n){switch(n.label){case 0:return r=a().getDependency("userClient"),i=vt(),[4,r.get("/loyalty-program/referral/program/".concat(e,"/influencer"),{params:ue(t)}).then((function(e){return Promise.all([i.deserializeAsync("influencer",e.data),e.data.meta])})).then((function(e){return Promise.resolve({data:e[0],meta:e[1]})}))];case 1:return[2,{data:(o=n.sent()).data,meta:le(o.meta)}]}}))}))},getInfluencerPerfomance:function(e,t){return r(void 0,void 0,void 0,(function(){var r,i;return n(this,(function(n){switch(n.label){case 0:return r=a().getDependency("userClient"),(i=new ee).register("influencer_performance"),[4,r.get("/loyalty-program/referral/program/".concat(e,"/influencer/").concat(t,"/analytics")).then((function(e){return Promise.resolve(i.deserializeAsync("influencer_performance",e.data))})).then((function(e){return Promise.resolve(e[0])}))];case 1:return[2,n.sent()]}}))}))}},rewardProgram:{createProgram:function(e){return r(void 0,void 0,void 0,(function(){var t,r,i;return n(this,(function(n){switch(n.label){case 0:return t=a().getDependency("userClient"),r=ht(),i={data:{attributes:e}},[4,t.post("/loyalty-program/program",i).then((function(e){return Promise.resolve(r.deserializeAsync("loyalty_program",e.data))})).then((function(e){return Promise.resolve(e[0])}))];case 1:return[2,n.sent()]}}))}))},updateProgram:function(e,t){return r(void 0,void 0,void 0,(function(){var r,i,o;return n(this,(function(n){switch(n.label){case 0:return r=a().getDependency("userClient"),i=ht(),o={data:{attributes:t}},[4,r.put("/loyalty-program/program/".concat(e),o).then((function(e){return Promise.resolve(i.deserializeAsync("loyalty_program",e.data))})).then((function(e){return Promise.resolve(e[0])}))];case 1:return[2,n.sent()]}}))}))},deleteProgram:function(e){return r(void 0,void 0,void 0,(function(){return n(this,(function(t){switch(t.label){case 0:return[4,a().getDependency("userClient").delete("/loyalty-program/program/".concat(e))];case 1:return[2,t.sent()]}}))}))},listPrograms:function(){return r(void 0,void 0,void 0,(function(){var e,t;return n(this,(function(r){switch(r.label){case 0:return e=a().getDependency("userClient"),t=ht(),[4,e.get("/loyalty-program/program/all").then((function(e){return Promise.resolve(t.deserializeAsync("loyalty_program",e.data))}))];case 1:return[2,r.sent()]}}))}))},getProgram:function(e){return r(void 0,void 0,void 0,(function(){var t,r;return n(this,(function(n){switch(n.label){case 0:return t=a().getDependency("userClient"),r=ht(),[4,t.get("/loyalty-program/program/".concat(e)).then((function(e){return Promise.resolve(r.deserializeAsync("loyalty_program",e.data))})).then((function(e){return Promise.resolve(e[0])}))];case 1:return[2,n.sent()]}}))}))},getProgramByTitle:function(e){return r(void 0,void 0,void 0,(function(){var t,r;return n(this,(function(n){switch(n.label){case 0:return t=a().getDependency("userClient"),r=ht(),[4,t.get("/loyalty-program/program/title/".concat(e)).then((function(e){return Promise.resolve(r.deserializeAsync("loyalty_program",e.data))})).then((function(e){return Promise.resolve(e[0])}))];case 1:return[2,n.sent()]}}))}))},addRule:function(e,t){return r(void 0,void 0,void 0,(function(){var r,i;return n(this,(function(n){switch(n.label){case 0:return r=a().getDependency("userClient"),i={data:{attributes:t}},[4,r.post("/loyalty-program/program/".concat(e,"/rule"),i)];case 1:return[2,n.sent()]}}))}))},updateRule:function(e,t){return r(void 0,void 0,void 0,(function(){var r,i;return n(this,(function(n){switch(n.label){case 0:return r=a().getDependency("userClient"),i={data:{attributes:t}},[4,r.put("/loyalty-program/program/".concat(e,"/rules"),i)];case 1:return[2,n.sent()]}}))}))},removeRule:function(e,t){return r(void 0,void 0,void 0,(function(){return n(this,(function(r){switch(r.label){case 0:return[4,a().getDependency("userClient").delete("/loyalty-program/program/".concat(e,"/rule/").concat(t))];case 1:return[2,r.sent()]}}))}))},createTier:function(e){return r(void 0,void 0,void 0,(function(){var t,r,i;return n(this,(function(n){switch(n.label){case 0:return t=a().getDependency("userClient"),r=mt(),i={data:{attributes:e}},[4,t.post("/loyalty-program/tier",i).then((function(e){return Promise.resolve(r.deserializeAsync("tier",e.data))})).then((function(e){return Promise.resolve(e[0])}))];case 1:return[2,n.sent()]}}))}))},deleteTier:function(e){return r(void 0,void 0,void 0,(function(){return n(this,(function(t){switch(t.label){case 0:return[4,a().getDependency("userClient").delete("/loyalty-program/tier/".concat(e))];case 1:return[2,t.sent()]}}))}))},listTiers:function(){return r(void 0,void 0,void 0,(function(){var e,t;return n(this,(function(r){switch(r.label){case 0:return e=a().getDependency("userClient"),t=mt(),[4,e.get("/loyalty-program/tier/my").then((function(e){return Promise.resolve(t.deserializeAsync("tier",e.data))}))];case 1:return[2,r.sent()]}}))}))}}};exports.ECampaignType=void 0,(De=exports.ECampaignType||(exports.ECampaignType={})).UNIVERSAL="UNIVERSAL",De.LIMITED="LIMITED",exports.ECampaignStatus=void 0,(Pe=exports.ECampaignStatus||(exports.ECampaignStatus={})).DRAFT="DRAFT",Pe.SCHEDULED="SCHEDULED",Pe.ACTIVE="ACTIVE",Pe.PAUSED="PAUSED",Pe.COMPLETED="COMPLETED",Pe.CANCELLED="CANCELLED",exports.ECampaignExecutionMode=void 0,(Te=exports.ECampaignExecutionMode||(exports.ECampaignExecutionMode={})).NonStrict="NON_STRICT",Te.Strict="STRICT",exports.ECampaignActionType=void 0,(_e=exports.ECampaignActionType||(exports.ECampaignActionType={})).PROMOCODE="PROMOCODE",_e.NOTIFICATION="NOTIFICATION",_e.BONUS_ACCRUAL="BONUS_ACCRUAL",exports.ENotificationDeliveryGuarantee=void 0,(Oe=exports.ENotificationDeliveryGuarantee||(exports.ENotificationDeliveryGuarantee={})).AtLeastOnce="AT_LEAST_ONCE",Oe.AtMostOnce="AT_MOST_ONCE",Oe.ExactlyOnce="EXACTLY_ONCE",exports.ENotificationChannel=void 0,(Se=exports.ENotificationChannel||(exports.ENotificationChannel={})).EMAIL="EMAIL",Se.SMS="SMS",Se.PUSH="PUSH",Se.TELEGRAM="TELEGRAM",Se.RCS="RCS",exports.EMediaType=void 0,(ke=exports.EMediaType||(exports.EMediaType={})).Image="IMAGE",ke.Video="VIDEO",exports.ECardType=void 0,(xe=exports.ECardType||(exports.ECardType={})).GENERAL="general",xe.ANONYMOUS="coupon",exports.NotificationChannel=void 0,(ze=exports.NotificationChannel||(exports.NotificationChannel={})).Email="email",ze.Sms="sms",ze.WebPush="webPush",ze.PassPush="passPush",exports.CurrencyCode=void 0,(Re=exports.CurrencyCode||(exports.CurrencyCode={})).UAH="UAH",Re.USD="USD",Re.EUR="EUR",exports.EPromocodeStatus=void 0,(Le=exports.EPromocodeStatus||(exports.EPromocodeStatus={})).STARTED="started",Le.NOT_STARTED="notStarted",Le.COMPLETED="completed",Le.DISABLED="disabled",Le.ARCHIVED="archived",exports.EPromocodeDiscountType=void 0,(Ne=exports.EPromocodeDiscountType||(exports.EPromocodeDiscountType={})).PERCENT="percent",Ne.PRODUCT_PRICE="product_price",Ne.N_PLUS_1="buy_n_get_one_free",Ne.BONUS="bonus",exports.EPromocodeType=void 0,(je=exports.EPromocodeType||(exports.EPromocodeType={})).GENERAL="general",je.PERSONAL="personal",exports.EExcludeType=void 0,(Ie=exports.EExcludeType||(exports.EExcludeType={})).CASHBACK="cashback",Ie.BONUS_PAYMENT="bonus_payment",exports.EProductSearchType=void 0,(Ue=exports.EProductSearchType||(exports.EProductSearchType={})).PRODUCT="product",Ue.GROUP="group",exports.EListSort=void 0,(Me=exports.EListSort||(exports.EListSort={})).ASC="asc",Me.DESC="desc",exports.EOrderState=void 0,(Be=exports.EOrderState||(exports.EOrderState={})).NEW="new",Be.CLOSED="closed",exports.EOrderDiscountType=void 0,(He=exports.EOrderDiscountType||(exports.EOrderDiscountType={})).COUPON="coupon",He.BONUS="bonus",He.PERCENTAGE="percentage",He.USER_PROMO_CODE="userPromoCode",He.PROMO_CODE="promoCode",exports.ERefProgramStatus=void 0,($e=exports.ERefProgramStatus||(exports.ERefProgramStatus={})).NotStarted="notStarted",$e.Active="active",$e.Expired="expired",$e.Paused="paused",$e.Completed="completed",$e.Archive="archived",exports.ERefProgramActionType=void 0,(We=exports.ERefProgramActionType||(exports.ERefProgramActionType={})).REGISTRATION="registration",We.PURCHASE="purchase",exports.ERefProgramRewardType=void 0,(Ke=exports.ERefProgramRewardType||(exports.ERefProgramRewardType={})).BONUS="points",Ke.COUPON="coupon",exports.ERewardProgramType=void 0,(Ve=exports.ERewardProgramType||(exports.ERewardProgramType={})).stateFullProgram="stateFullProgram",Ve.statelessRulesProgram="statelessRulesProgram",exports.ERewardProgramTitle=void 0,(Ge=exports.ERewardProgramTitle||(exports.ERewardProgramTitle={})).SenseCardTransformation="SenseCardTransformation",Ge.referralSystemProgram="referralSystemProgram",exports.ECohortStatus=void 0,(Ye=exports.ECohortStatus||(exports.ECohortStatus={})).STARTED="started",Ye.NOT_STARTED="notStarted",Ye.COMPLETED="completed",Ye.DISABLED="disabled",Ye.ARCHIVED="archived",exports.ECohortUserType=void 0,(Fe=exports.ECohortUserType||(exports.ECohortUserType={})).ALL="ALL",Fe.NEW="NEW",Fe.WITH_CONDITIONS="CONDITIONAL",exports.ECohortType=void 0,(Ze=exports.ECohortType||(exports.ECohortType={})).DYNAMIC="DYNAMIC",Ze.STATIC="STATIC",exports.ECohortOS=void 0,(Qe=exports.ECohortOS||(exports.ECohortOS={})).IOS="IOS",Qe.ANDROID="ANDROID",Qe.WEB="WEB",exports.ECohortAction=void 0,(qe=exports.ECohortAction||(exports.ECohortAction={})).REGISTRATION="REGISTRATION",qe.PURCHASE="PURCHASE",qe.TRANSITION_TO_NEW_LEVEL="LEVEL_TRANSITION",qe.ADDED_CARD_TO_WALLET="ADD_CARD_TO_WALLET",qe.REMOVED_CARD="REMOVE_CARD",exports.ECohortConditionsType=void 0,(Je=exports.ECohortConditionsType||(exports.ECohortConditionsType={})).LESS="LESS",Je.GREATER="GREATER",Je.LESS_EQUAL="LESS_EQUAL",Je.GREATER_EQUAL="GREATER_EQUAL",Je.EQUAL="EQUAL",Je.NOT_EQUAL="NOT_EQUAL",exports.ECohortTimePeriod=void 0,(Xe=exports.ECohortTimePeriod||(exports.ECohortTimePeriod={})).YESTERDAY="YESTERDAY",Xe.LAST_WEEK="LAST_WEEK",Xe.MONTH="MONTH",Xe.QUARTER="QUARTER",Xe.SINCE="SINCE",Xe.CUSTOM="CUSTOM",Xe.WITHIN="WITHIN",Xe.IN_EACH="IN_EACH",Xe.DURING="DURING",exports.ECohortDuration=void 0,(et=exports.ECohortDuration||(exports.ECohortDuration={})).DAYS="DAYS",et.WEEKS="WEEKS",et.MONTHS="MONTHS",exports.ECohortDurationPeriodicity=void 0,(tt=exports.ECohortDurationPeriodicity||(exports.ECohortDurationPeriodicity={})).DAILY="DAILY",tt.WEEKLY="WEEKLY",tt.MONTHLY="MONTHLY",exports.sdk=yt,exports.toFilterQueryParams=ue;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@roketus/web-toolkit"),t=require("json-api-serializer"),n=require("uuid-browser/v4");function r(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var i=r(t),o=r(n),a=function(){return a=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},a.apply(this,arguments)};function s(e,t,n,r){return new(n||(n=Promise))(function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function s(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(a,s)}u((r=r.apply(e,t||[])).next())})}function u(e,t){var n,r,i,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(u){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,r=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!(i=o.trys,(i=i.length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){o.label=s[1];break}if(6===s[0]&&o.label<i[1]){o.label=i[1],i=s;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(s);break}i[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,u])}}}"function"==typeof SuppressedError&&SuppressedError;var c=e.createContainer(),d=c.initContainer,l=c.getContainer,p="unknown",v=function(){return p},f="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},g="object"==typeof f&&f&&f.Object===Object&&f,m="object"==typeof self&&self&&self.Object===Object&&self,y=(g||m||Function("return this")()).Symbol,h=y,C=Object.prototype,b=C.hasOwnProperty,P=C.toString,D=h?h.toStringTag:void 0;var E=function(e){var t=b.call(e,D),n=e[D];try{e[D]=void 0;var r=!0}catch(e){}var i=P.call(e);return r&&(t?e[D]=n:delete e[D]),i},w=Object.prototype.toString;var A=E,T=function(e){return w.call(e)},_=y?y.toStringTag:void 0;var S=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":_&&_ in Object(e)?A(e):T(e)},x=Array.isArray;var I=S,R=x,O=function(e){return null!=e&&"object"==typeof e};var N=function(e){return"string"==typeof e||!R(e)&&O(e)&&"[object String]"==I(e)},L=function(e){/^((?!chrome|android).)*safari/i.test(navigator.userAgent)?function(e){var t=new FileReader;t.onload=function(){if(!N(t.result))throw new Error("Invalid response, expected string");window.location.href=t.result},t.readAsDataURL(e.data)}(e):function(e){var t=window.URL.createObjectURL(new Blob([e.data])),n=document.createElement("a");n.href=t,n.setAttribute("download","yourpass.pkpass"),document.body.appendChild(n),n.click()}(e)},U=2e4,z="https://api.dev.loyalty.roket.us/",k=function(t){return e.HTTPStatic.create({staticConfig:{baseURL:null!=t?t:z,timeout:U}})},M=function(t){return e.HTTPStatic.create({staticConfig:{baseURL:null!=t?t:z,timeout:U}})},B=function(t){return e.HTTPStatic.create({staticConfig:{baseURL:null!=t?t:z,timeout:U}})},j=function(t){return e.HTTPStatic.create({staticConfig:{baseURL:null!=t?t:z,timeout:U}})},H=function(e){var t=e.cardNumber,n=e.data,r=e.type,i={data:{attributes:{type:void 0===r?"bonus":r,value:n}}};return l().getDependency("issuerClient").put("/card/update/".concat(t),i)},W=function(e){var t=e.cardNumber;return l().getDependency("issuerClient").get("/card/balanceHistory/".concat(t))},G=function(){var e=new i.default;return e.register("issuer"),e},Y=["webPush","passPush"],V={serviceName:"unknown",environment:"develop"},F=function(){return V},K=function(e){var t=-e.getTimezoneOffset(),n=t>=0?"+":"-",r=function(e){var t=Math.floor(Math.abs(e));return(t<10?"0":"")+t};return e.getFullYear()+"-"+r(e.getMonth()+1)+"-"+r(e.getDate())+"T"+r(e.getHours())+":"+r(e.getMinutes())+":"+r(e.getSeconds())+n+r(t/60)+":"+r(t%60)},Q=function(){var e=new i.default;return e.register("action"),e.register("smart_link",{id:"id",relationships:{action:{type:"action"}}}),e},q=function(e){var t=e.page,n=void 0===t?0:t,r=e.pageSize,i=e.filter,o=e.sort,a=e.status,s={"page[limit]":r,"page[offset]":r?n*r:0};if(i&&Object.keys(i).length&&Object.keys(i).forEach(function(e){i[e]&&(s["filter[".concat(e,"]")]=Array.isArray(i[e])?i[e].join(","):i[e])}),o&&Object.keys(o).length){var u=Object.keys(o).reduce(function(e,t){return o[t]?(e.length&&(e+=","),e+="".concat(t,"_").concat(o[t])):e},"");u&&(s.sort=u)}return a&&(s.status=a),s},J=function(e){var t;return e?{page:e.current_page?e.current_page-1:Math.ceil(e.offset/e.limit),pageSize:e.limit,totalData:e.total_items,totalPages:null!==(t=e.total_pages)&&void 0!==t?t:Math.ceil(e.total_items/e.limit)}:{}};function X(e){return e.toLocaleDateString("en-CA")}var Z,$,ee,te,ne,re,ie,oe,ae,se,ue,ce,de,le,pe,ve,fe,ge,me,ye,he,Ce,be,Pe,De,Ee,we,Ae,Te,_e,Se,xe,Ie=["webPush","passPush"],Re=function(e,t){void 0===t&&(t="unknown");var n=l().getDependency("anonymousUserClient"),r=F(),i=r.serviceName,o=r.environment,a=new Date,s={correlation_id:t,env:o,payload:e,service_name:i,timestamp:K(a)};return n.post("/logger/addInfo",s)},Oe="rk-jssdk",Ne=function(){var e=new i.default;return e.register("campaign"),e.register("campaign_run"),e.register("campaign_action"),e.register("cohort"),e.register("location"),e},Le=function(){var e=new i.default;return e.register("cohort"),e},Ue=function(e,t){var n=new AbortController,r=new i.default;r.register("bonuses");var o={activeWithDates:[],inactiveWithDates:[],totalActive:{USD:0,UAH:0,EUR:0},totalInactive:{}};return{result:e.get(t,{signal:n.signal}).then(function(e){return Promise.all([e.data,r.deserializeAsync("bonuses",e.data)])}).then(function(e){var t,n=null!==(t=e[1][0])&&void 0!==t?t:o;return Promise.resolve({jsonAPI:e[0],data:n})}),abort:n.abort}},ze=function(){var e=new i.default;return e.register("promocode"),e},ke=function(){var e=new i.default;return e.register("exclude",{id:"id",relationships:{group:{type:"group",jsonApi:"hasMany"},product:{type:"product",jsonApi:"hasMany"}}}),e.register("group",{id:"id",attributes:["title"]}),e.register("product",{id:"id",attributes:["title"]}),e},Me=function(){var e=new i.default({});return e.register("product",{relationships:{model:{type:"model"},properties:{type:"property"}}}),e.register("model",{relationships:{brand:{type:"brand"},properties:{type:"property"}}}),e.register("brand"),e.register("property"),e},Be=function(){var e=new i.default({});return e.register("category"),e},je=function(){var e=new i.default({});return e.register("user"),e.register("promo_code"),e.register("card",{id:"id",relationships:{user:{type:"user"}}}),e},He=function(){var e=new i.default;return e.register("order"),e.register("consumer"),e.register("receipt"),e.register("receipt_item"),e},We=function(){var e=new i.default;return e.register("referral_program"),e.register("influencer"),e},Ge=function(){var e=new i.default;return e.register("influencer"),e},Ye=function(){var e=new i.default;return e.register("loyalty_program"),e.register("program_rule"),e},Ve=function(){var e=new i.default;return e.register("tier"),e.register("tier_level"),e},Fe={init:function(e){!function(e){d({userClient:k(e),issuerClient:M(e),anonymousUserClient:B(e),anonymousUserClientWithIssuer:j(e)})}(e)},user:{setIssuer:function(e){var t=l().getDependency("anonymousUserClientWithIssuer");p=e,t.defaults.headers.common["x-issuer-sys-name"]=e},setUserToken:function(e){l().getDependency("userClient").defaults.headers.common.Authorization="Bearer ".concat(e)},createUser:function(e){return s(void 0,void 0,void 0,function(){var t,n;return u(this,function(r){switch(r.label){case 0:return t=l().getDependency("userClient"),n={data:{attributes:e}},[4,t.post("/user/create",n)];case 1:return[2,r.sent()]}})})},changeEmail:function(e){return s(void 0,void 0,void 0,function(){var t,n;return u(this,function(r){switch(r.label){case 0:return t=l().getDependency("userClient"),n={data:{attributes:{email:e}}},[4,t.post("/user/mail/change",n)];case 1:return[2,r.sent()]}})})},changePhone:function(e){var t={data:{attributes:{phone:e}}};return l().getDependency("userClient").post("/user/phone/change",t)},changeProfileData:function(e,t){return s(void 0,void 0,void 0,function(){var n,r;return u(this,function(i){switch(i.label){case 0:return n=l().getDependency("userClient"),r={data:{attributes:{firstName:e,lastName:t}}},[4,n.put("/user/profile",r)];case 1:return[2,i.sent()]}})})},updateProfileByIssuer:function(e,t){return s(void 0,void 0,void 0,function(){var n,r;return u(this,function(i){switch(i.label){case 0:return n=l().getDependency("issuerClient"),r={data:{attributes:t}},[4,n.put("/user/".concat(e,"/profile"),r)];case 1:return i.sent(),[2]}})})},getProfile:function(){return s(void 0,void 0,void 0,function(){return u(this,function(e){switch(e.label){case 0:return[4,l().getDependency("userClient").get("/user/profile")];case 1:return[2,e.sent()]}})})},validateNewPhoneOtp:function(e){return s(void 0,void 0,void 0,function(){var t,n;return u(this,function(r){switch(r.label){case 0:return t=l().getDependency("userClient"),n={data:{attributes:{code:e}}},[4,t.post("/user/phone/activation/check",n)];case 1:return[2,r.sent()]}})})},notification:{subscribeToWebPushNotifications:function(e){var t=l().getDependency("userClient"),n={data:{attributes:a({},e)}};return t.post("/user-notification/push/subscribe",n)},sendEmailByEvent:function(e,t){return s(void 0,void 0,void 0,function(){var n,r;return u(this,function(i){switch(i.label){case 0:return n=l().getDependency("userClient"),r={data:{attributes:{event:e,user_id:t}}},[4,n.put("/user/sendEmailByEvent",r)];case 1:return[2,i.sent()]}})})},sendCompanyEmailByEvent:function(e,t){return s(void 0,void 0,void 0,function(){var n,r;return u(this,function(i){switch(i.label){case 0:return n=l().getDependency("userClient"),r={data:{attributes:{event:e,company_id:t}}},[4,n.put("/user/sendCompanyEmailByEvent",r)];case 1:return[2,i.sent()]}})})},sendCompanySmsByEvent:function(e,t){return s(void 0,void 0,void 0,function(){var n,r;return u(this,function(i){switch(i.label){case 0:return n=l().getDependency("userClient"),r={data:{attributes:{event:e,company_id:t}}},[4,n.put("/user/sendCompanySmsByEvent",r)];case 1:return[2,i.sent()]}})})},listEmailTemplates:function(){return s(void 0,void 0,void 0,function(){var e,t;return u(this,function(n){switch(n.label){case 0:return e=l().getDependency("userClient"),(t=new i.default).register("template"),[4,e.get("/user-notification/issuer/template/my").then(function(e){return Promise.all([t.deserializeAsync("template",e.data)])}).then(function(e){return Promise.resolve({data:e[0]})})];case 1:return[2,{data:n.sent().data}]}})})}},card:{downloadIOSCard:function(){var e;return l().getDependency("userClient").get("/card/ios/download",{responseType:"blob",timeout:U,headers:(e={},e["x-issuer-sys-name"]=v(),e)}).then(L)},getAndroidCardDownloadLink:function(){return s(void 0,void 0,void 0,function(){var e;return u(this,function(t){switch(t.label){case 0:return[4,l().getDependency("userClient").get("/card/android",{headers:(e={},e["x-issuer-sys-name"]=v(),e)})];case 1:return[2,t.sent().data.data[0].attributes.google_pass_url]}})})},createAnonymousUserCard:function(e){return void 0===e&&(e=""),s(void 0,void 0,void 0,function(){var t,n,r,i;return u(this,function(o){switch(o.label){case 0:return t=l().getDependency("anonymousUserClientWithIssuer"),n={data:{attributes:{referral_id:"",card_type:"gold",logo_text:e}}},[4,t.post("/card/create/info",n)];case 1:return r=o.sent(),[2,{cardNumber:(i=r.data.data[0].attributes).card_number,androidCardDownloadLink:i.android_card_file_link,iosCardDownloadLink:i.ios_card_file_link,cardJwt:i.card_jwt}]}})})},getBalanceHistory:function(){return l().getDependency("userClient").get("/card/balanceHistory")},getCardBalanceHistory:W,getReferral:function(){return l().getDependency("userClient").get("/card/referral")},getUserCard:function(){return s(void 0,void 0,void 0,function(){return u(this,function(e){switch(e.label){case 0:return[4,l().getDependency("userClient").get("/card/my")];case 1:return[2,e.sent()]}})})},restoreCard:function(){return l().getDependency("userClient").get("/card/download",{responseType:"blob",timeout:U})},addPoints:function(e){var t={data:{attributes:{card_number:e.cardNumber,description:e.description,amount:e.amount}}};return l().getDependency("issuerClient").post("/card/balance/addPoints",t)},addReserve:function(e){var t={data:{attributes:{amount:e.amount}}};return l().getDependency("issuerClient").post("/card/balance/addReserve",t)},setTypeCard:function(e){var t={data:{attributes:{card_number:e.cardNumber,type:e.type}}};return l().getDependency("userClient").put("/card/setType/",t)},spendPoints:function(e){var t={data:{attributes:{card_number:e.cardNumber,description:e.description,amount:e.amount}}};return l().getDependency("userClient").post("/card/balance/spendPoints",t)},updateCard:H,updateDiscountPercent:function(e){var t={data:{attributes:{card_number:e.cardNumber,percent:e.discountPercent}}};return l().getDependency("userClient").put("/card/updateDiscountPercent",t)},downloadAnonymousCard:function(e,t){void 0===t&&(t="");var n={data:{attributes:{issuer:e,referral_id:t}}};return l().getDependency("anonymousUserClientWithIssuer").post("/card/create",n,{responseType:"blob",timeout:U}).then(L)},getBonuses:function(){var e=l().getDependency("userClient");return Ue(e,"/bonuses/my")}}},cardManagement:{listCards:function(e){return s(void 0,void 0,void 0,function(){var t,n,r;return u(this,function(i){switch(i.label){case 0:return t=l().getDependency("userClient"),n=je(),[4,t.get("/card/all",{params:q(e)}).then(function(e){return Promise.all([n.deserializeAsync("card",e.data),e.data.meta])}).then(function(e){return Promise.resolve({data:e[0],meta:e[1]})})];case 1:return[2,{data:(r=i.sent()).data,meta:J(r.meta)}]}})})},createCard:function(e){return s(void 0,void 0,void 0,function(){var t,n,r;return u(this,function(i){switch(i.label){case 0:return t=l().getDependency("userClient"),n={data:{attributes:e}},r=je(),[4,t.post("/card/createFromExternal",n).then(function(e){return Promise.resolve(r.deserializeAsync("card",e.data))}).then(function(e){return Promise.resolve(e[0])})];case 1:return[2,i.sent()]}})})},issueCard:function(e){return s(void 0,void 0,void 0,function(){return u(this,function(t){switch(t.label){case 0:return[4,l().getDependency("userClient").post("/card/issue/".concat(e))];case 1:return t.sent(),[2]}})})},deactivateCard:function(e){return s(void 0,void 0,void 0,function(){return u(this,function(t){switch(t.label){case 0:return[4,l().getDependency("userClient").put("/card/".concat(e,"/deactivate"))];case 1:return t.sent(),[2]}})})},updateCustomParams:function(e,t){return s(void 0,void 0,void 0,function(){var n,r;return u(this,function(i){switch(i.label){case 0:return n=l().getDependency("userClient"),r={data:{attributes:t}},[4,n.put("/card/".concat(e,"/customParam"),r)];case 1:return i.sent(),[2]}})})},updateExpirationDate:function(e,t){return s(void 0,void 0,void 0,function(){var n,r;return u(this,function(i){switch(i.label){case 0:return n=l().getDependency("userClient"),r={data:{attributes:t}},[4,n.put("/card/".concat(e,"/expirationDate"),r)];case 1:return i.sent(),[2]}})})}},auth:{getUserTokenByIssuerAPIKey:function(e){return s(void 0,void 0,void 0,function(){var t,n;return u(this,function(r){switch(r.label){case 0:return t=l().getDependency("anonymousUserClient"),n={data:{attributes:{apiKey:e}}},[4,t.post("/issuer/auth/by-pass-key",n)];case 1:return[2,r.sent().data.data[0].attributes.jwt]}})})},getUserData:function(){return l().getDependency("userClient").get("/user/me")},signInByPhone:function(e){var t={data:{attributes:{phone:e}}};return l().getDependency("anonymousUserClientWithIssuer").post("/user/loginByPhone",t)},validatePhoneOtp:function(e,t){return s(void 0,void 0,void 0,function(){var n,r;return u(this,function(i){switch(i.label){case 0:return n=l().getDependency("anonymousUserClientWithIssuer"),r={data:{attributes:{phone:e,code:t}}},[4,n.post("/user/loginByPhone/check",r)];case 1:return[2,i.sent()]}})})}},issuer:{setIssuerToken:function(e){l().getDependency("issuerClient").defaults.headers.common.Authorization="Bearer ".concat(e)},sendPushNotification:function(e,t,n){var r={data:{attributes:{title:t,msg:n}}};return l().getDependency("userClient").post("/notification/webPush/".concat(e,"/send"),r)},authByPassToken:function(e){return l().getDependency("issuerClient").post("/issuer/auth/by-pass-token",{},{headers:{Authorization:"Bearer ".concat(e)}})},authByToken:function(e){var t={data:{attributes:{token:e.token}}};return l().getDependency("userClient").post("/issuer/auth/by-token",t)},createIssuer:function(e){var t=e.name,n=e.systemName;return s(void 0,void 0,void 0,function(){var e,r;return u(this,function(i){switch(i.label){case 0:return e=l().getDependency("userClient"),r={data:{attributes:{name:t,system_name:n}}},[4,e.post("/issuer/create",r)];case 1:return[2,i.sent()]}})})},getIssuer:function(){return l().getDependency("userClient").get("/issuer")},refreshApiKey:function(){return s(void 0,void 0,void 0,function(){return u(this,function(e){switch(e.label){case 0:return[4,l().getDependency("userClient").post("/issuer/refresh-apiKey")];case 1:return[2,e.sent()]}})})},getSettings:function(){return s(void 0,void 0,void 0,function(){var e,t;return u(this,function(n){switch(n.label){case 0:return e=l().getDependency("issuerClient"),t=G(),[4,e.get("/issuer/me").then(function(e){return Promise.resolve(t.deserializeAsync("issuer",e.data))}).then(function(e){return Promise.resolve(e[0])})];case 1:return[2,n.sent()]}})})},setSettings:function(e){return s(void 0,void 0,void 0,function(){var t,n,r;return u(this,function(i){switch(i.label){case 0:return t=l().getDependency("issuerClient"),n={data:{attributes:e}},r=G(),[4,t.post("/issuer/set-settings",n).then(function(e){return Promise.resolve(r.deserializeAsync("issuer",e.data))}).then(function(e){return Promise.resolve(e[0])})];case 1:return[2,i.sent().data]}})})},sendToAllIssuerCards:function(e){var t=e.channels,n={data:{attributes:{gateways:void 0===t?Y:t,title:e.title,msg:e.message}}};return l().getDependency("userClient").post("/user-notification/push/sendToAllIssuerCards",n)},sendNotificationToCards:function(e){var t=e.cardNumbers,n=e.message,r=e.channels,i=void 0===r?Ie:r,o=e.smart,a=void 0===o||o;return s(void 0,void 0,void 0,function(){var e,r;return u(this,function(o){switch(o.label){case 0:return e=l().getDependency("userClient"),r={data:{attributes:{gateways:i,cards:t,title:n,msg:n,smart:a}}},[4,e.post("/user-notification/push/sendToCards",r,{})];case 1:return[2,o.sent()]}})})},dispatchCustomEvent:function(e){var t=e.card,n=e.eventName,r=e.actions,i=l().getDependency("issuerClient"),o={data:{attributes:{event_name:n,card_number:t}}};return r&&(o.data.attributes.payloads=r),i.post("/loyalty-program/custom-event",o)},getCardById:function(e){var t=l().getDependency("issuerClient"),n=new AbortController,r=new i.default;return r.register("card"),{result:t.get("/card/".concat(e),{signal:n.signal}).then(function(e){return Promise.all([e.data,r.deserializeAsync("card",e.data)])}).then(function(e){return Promise.resolve({jsonAPI:e[0],data:e[1][0]})}),abort:n.abort}},getCardByPhone:function(e){var t=l().getDependency("issuerClient"),n=new AbortController,r=new i.default;return r.register("card"),{result:t.get("/card/byPhone/".concat(e),{signal:n.signal}).then(function(e){return Promise.all([e.data,r.deserializeAsync("card",e.data)])}).then(function(e){return Promise.resolve({jsonAPI:e[0],data:e[1][0]})}),abort:n.abort}},getCardBalanceHistory:W,setCardName:function(e){var t=e.cardNumber,n=e.data;return H({cardNumber:t,data:n,type:"name"})},getCardBonuses:function(e){var t=l().getDependency("issuerClient");return Ue(t,"/bonuses/card/".concat(e))},getCardSpends:function(e){var t=l().getDependency("issuerClient"),n=new AbortController,r=new i.default;return r.register("spends"),{result:t.get("/bonuses/spends/".concat(e),{signal:n.signal}).then(function(e){return Promise.all([e.data,r.deserializeAsync("spends",e.data)])}).then(function(e){return Promise.resolve({jsonAPI:e[0],data:e[1]})}),abort:n.abort}}},logger:{logError:function(e,t){void 0===t&&(t="unknown");var n=l().getDependency("anonymousUserClient"),r=F(),i=r.serviceName,o=r.environment,a=new Date,s={correlation_id:t,env:o,payload:e,service_name:i,timestamp:K(a)};return n.post("/logger/addError",s)},logDebug:function(e,t){void 0===t&&(t="unknown");var n=l().getDependency("anonymousUserClient"),r=F(),i=r.serviceName,o=r.environment,a=new Date,s={correlation_id:t,env:o,payload:e,service_name:i,timestamp:K(a)};return n.post("/logger/addDebug",s)},logInfo:Re,setup:function(e){V=e}},telemetry:{send:function(e,t){return s(void 0,void 0,void 0,function(){var n,r;return u(this,function(i){switch(i.label){case 0:return(n=localStorage.getItem(Oe))||function(e){localStorage.setItem(Oe,e)}(n=o.default()),r={uuid:n,appName:e,appVersion:t,userAgent:window.navigator.userAgent},[4,Re(r)];case 1:return i.sent(),[2,a(a({},r),{dateTime:K(new Date)})]}})})}},signup:{acceptTerms:function(e,t){return s(void 0,void 0,void 0,function(){var n,r,i;return u(this,function(o){switch(o.label){case 0:switch(n=l().getDependency("anonymousUserClientWithIssuer"),r={data:{attributes:{agreement:!0}}},t&&(r.data.attributes.ref_id=t),i="",e){case"basic":i="/user/activation/".concat(e,"/terms");break;case"standard":case"fd61387f":case"498c83ac":i="/user/registration/".concat(e,"/start/terms")}return[4,n.post(i,r)];case 1:return[2,o.sent()]}})})},activateEmail:function(e){return s(void 0,void 0,void 0,function(){var t,n;return u(this,function(r){switch(r.label){case 0:return t=l().getDependency("userClient"),n={data:{attributes:{}}},[4,t.post("/user/activation/".concat(e,"/emailActivation"),n)];case 1:return[2,r.sent()]}})})},activatePhone:function(e,t){return s(void 0,void 0,void 0,function(){var n,r;return u(this,function(i){switch(i.label){case 0:return n=l().getDependency("userClient"),r={data:{attributes:{code:e}}},[4,n.post("/user/activation/".concat(t,"/phoneActivation"),r)];case 1:return[2,i.sent()]}})})},resendActivationCode:function(){return s(void 0,void 0,void 0,function(){return u(this,function(e){switch(e.label){case 0:return[4,l().getDependency("userClient").post("/user/phone/activation/resend")];case 1:return[2,e.sent()]}})})},setEmail:function(e,t){return s(void 0,void 0,void 0,function(){var n,r;return u(this,function(i){switch(i.label){case 0:return n=l().getDependency("userClient"),r={data:{attributes:{email:e}}},[4,n.post("/user/activation/".concat(t,"/setEmail"),r)];case 1:return[2,i.sent()]}})})},setPhone:function(e,t){return s(void 0,void 0,void 0,function(){var n,r;return u(this,function(i){switch(i.label){case 0:return n=l().getDependency("userClient"),r={data:{attributes:{phone:e}}},[4,n.post("/user/activation/".concat(t,"/setPhone"),r)];case 1:return[2,i.sent()]}})})},setProfile:function(e,t){return s(void 0,void 0,void 0,function(){var n,r,i;return u(this,function(o){switch(o.label){case 0:switch(n=l().getDependency("userClient"),r={data:{attributes:{firstName:e.firstName,lastName:e.lastName}}},i="",t){case"basic":i="/user/".concat(e.userId,"/activation/").concat(t,"/start/profile");break;case"standard":case"fd61387f":case"498c83ac":i="/user/activation/".concat(t,"/profile")}return[4,n.post(i,r)];case 1:return[2,o.sent()]}})})},setBirthdate:function(e,t){return s(void 0,void 0,void 0,function(){var n,r;return u(this,function(i){switch(i.label){case 0:return n=l().getDependency("userClient"),r={data:{attributes:{birth:e}}},[4,n.post("/user/activation/".concat(t,"/birth"),r)];case 1:return[2,i.sent()]}})})},skipEmail:function(e){return s(void 0,void 0,void 0,function(){return u(this,function(t){switch(t.label){case 0:return[4,l().getDependency("userClient").post("/user/activation/".concat(e,"/skip/setEmail"))];case 1:return[2,t.sent()]}})})},skipEmailActivation:function(e){return s(void 0,void 0,void 0,function(){return u(this,function(t){switch(t.label){case 0:return[4,l().getDependency("userClient").post("/user/activation/".concat(e,"/skip/emailActivation"))];case 1:return[2,t.sent()]}})})},skipProfile:function(e){return s(void 0,void 0,void 0,function(){return u(this,function(t){switch(t.label){case 0:return[4,l().getDependency("userClient").post("/user/activation/".concat(e,"/skip/profile"))];case 1:return[2,t.sent()]}})})},setEmailWithoutActivation:function(e,t){return s(void 0,void 0,void 0,function(){var n,r;return u(this,function(i){switch(i.label){case 0:return n=l().getDependency("userClient"),r={data:{attributes:{email:e}}},[4,n.post("/user/activation/".concat(t,"/setEmailWithoutActivation"),r)];case 1:return[2,i.sent()]}})})}},url:{getShortUrl:function(e){return s(void 0,void 0,void 0,function(){var t,n;return u(this,function(r){switch(r.label){case 0:return t=l().getDependency("anonymousUserClient"),n={data:{attributes:{target_url:e}}},[4,t.post("/link/create",n)];case 1:return[2,r.sent()]}})})}},analytics:{createEvent:function(e,t,n,r,i){return void 0===r&&(r="unknown"),void 0===i&&(i="unknown"),s(void 0,void 0,void 0,function(){var o,a;return u(this,function(s){switch(s.label){case 0:return o=l().getDependency("userClient"),a={data:{attributes:{action:e,metadata:{OSType:r,OSVersion:i,section:t},user_identifier:n}}},[4,o.post("/event/create",a)];case 1:return s.sent(),[2]}})})},getGeneralCardsData:function(e,t){return s(void 0,void 0,void 0,function(){return u(this,function(n){return[2,l().getDependency("userClient").get("/event/stats/metrics?from=".concat(X(e),"&to=").concat(X(t)))]})})},getActiveUsersData:function(e,t){return s(void 0,void 0,void 0,function(){return u(this,function(n){return[2,l().getDependency("userClient").get("/event/stats/active-users?from=".concat(X(e),"&to=").concat(X(t)))]})})},getPointsData:function(e,t){return s(void 0,void 0,void 0,function(){var n,r;return u(this,function(o){switch(o.label){case 0:return n=l().getDependency("userClient"),(r=new i.default).register("points_cumulative"),[4,n.get("/event/stats/points-cumulative",{params:{from:X(e),to:X(t)}}).then(function(e){return Promise.resolve(r.deserializeAsync("points_cumulative",e.data))}).then(function(e){return Promise.resolve(e[0])})];case 1:return[2,o.sent()]}})})},getPointsAddedStats:function(e,t){return s(void 0,void 0,void 0,function(){var n,r;return u(this,function(o){switch(o.label){case 0:return n=l().getDependency("userClient"),(r=new i.default).register("bonus_points_added_cumulative"),[4,n.get("/event/stats/bonus-points-added",{params:{from:X(e),to:X(t)}}).then(function(e){return Promise.resolve(r.deserializeAsync("bonus_points_added_cumulative",e.data))}).then(function(e){return Promise.resolve(e[0])})];case 1:return[2,o.sent()]}})})},getPointsUsedStats:function(e,t){return s(void 0,void 0,void 0,function(){var n,r;return u(this,function(o){switch(o.label){case 0:return n=l().getDependency("userClient"),(r=new i.default).register("bonus_points_used_daily"),[4,n.get("/event/stats/bonus-points-used",{params:{from:X(e),to:X(t)}}).then(function(e){return Promise.resolve(r.deserializeAsync("bonus_points_used_daily",e.data))}).then(function(e){return Promise.resolve(e[0])})];case 1:return[2,o.sent()]}})})},getMyNotificationStats:function(e,t){var n=l().getDependency("issuerClient"),r=new AbortController,o=new i.default;return o.register("issuer_stats"),{result:n.get("/loyalty-notification/stats?from=".concat(X(e),"&to=").concat(X(t)),{signal:r.signal}).then(function(e){return Promise.all([e.data,o.deserializeAsync("issuer_stats",e.data)])}).then(function(e){return Promise.resolve({jsonAPI:e[0],data:e[1][0]})}),abort:r.abort}},getIssuedCardsStats:function(e,t){return s(void 0,void 0,void 0,function(){var n,r;return u(this,function(o){switch(o.label){case 0:return n=l().getDependency("userClient"),(r=new i.default).register("issued_cards"),[4,n.get("/event/stats/issued-cards",{params:{from:X(e),to:X(t)}}).then(function(e){return Promise.resolve(r.deserializeAsync("issued_cards",e.data))}).then(function(e){return Promise.resolve(e[0])})];case 1:return[2,o.sent()]}})})},getPurchasesStats:function(e,t){return s(void 0,void 0,void 0,function(){var n,r;return u(this,function(o){switch(o.label){case 0:return n=l().getDependency("userClient"),(r=new i.default).register("purchases"),[4,n.get("/event/stats/purchases",{params:{from:X(e),to:X(t)}}).then(function(e){return Promise.resolve(r.deserializeAsync("purchases",e.data))}).then(function(e){return Promise.resolve(e[0])})];case 1:return[2,o.sent()]}})})},getUniquePurchasesStats:function(e,t){return s(void 0,void 0,void 0,function(){var n,r;return u(this,function(o){switch(o.label){case 0:return n=l().getDependency("userClient"),(r=new i.default).register("unique_client_purchases"),[4,n.get("/event/stats/unique-purchases",{params:{from:X(e),to:X(t)}}).then(function(e){return Promise.resolve(r.deserializeAsync("unique_client_purchases",e.data))}).then(function(e){return Promise.resolve(e[0])})];case 1:return[2,o.sent()]}})})},getCardConversionStats:function(e,t){return s(void 0,void 0,void 0,function(){var n,r;return u(this,function(o){switch(o.label){case 0:return n=l().getDependency("userClient"),(r=new i.default).register("card_conversion"),[4,n.get("/event/stats/card-conversion",{params:{from:X(e),to:X(t)}}).then(function(e){return Promise.resolve(r.deserializeAsync("card_conversion",e.data))}).then(function(e){return Promise.resolve(e[0])})];case 1:return[2,o.sent()]}})})},getUserCompositionStats:function(e,t){return s(void 0,void 0,void 0,function(){var n,r;return u(this,function(o){switch(o.label){case 0:return n=l().getDependency("userClient"),(r=new i.default).register("user_composition"),[4,n.get("/event/stats/user-composition",{params:{from:X(e),to:X(t)}}).then(function(e){return Promise.resolve(r.deserializeAsync("user_composition",e.data))}).then(function(e){return Promise.resolve(e[0])})];case 1:return[2,o.sent()]}})})}},shortLink:{createLink:function(e){var t=e.name,n=e.linkType,r=e.url,i=e.meta,o=e.params;return s(void 0,void 0,void 0,function(){var e,a,s;return u(this,function(u){switch(u.label){case 0:return e=l().getDependency("userClient"),a={data:{attributes:{name:t,link_type:n,url:r,meta:i,params:o}}},s=Q(),[4,e.post("/smart-link/create",a).then(function(e){return Promise.resolve(s.deserializeAsync("smart_link",e.data))}).then(function(e){return Promise.resolve(e[0])})];case 1:return[2,u.sent()]}})})},editLink:function(e,t){return s(void 0,void 0,void 0,function(){var n,r;return u(this,function(i){switch(i.label){case 0:return n=l().getDependency("userClient"),r={data:{attributes:a(a({},t),{link_type:t.linkType})}},[4,n.put("/smart-link/".concat(e),r)];case 1:return i.sent(),[2]}})})},deleteLink:function(e){return s(void 0,void 0,void 0,function(){return u(this,function(t){switch(t.label){case 0:return[4,l().getDependency("userClient").delete("/smart-link/".concat(e))];case 1:return t.sent(),[2]}})})},listLinks:function(e){return s(void 0,void 0,void 0,function(){var t,n,r;return u(this,function(i){switch(i.label){case 0:return t=l().getDependency("userClient"),n=Q(),[4,t.get("/smart-link/my",{params:q(e)}).then(function(e){return Promise.all([n.deserializeAsync("smart_link",e.data),e.data.meta])}).then(function(e){return Promise.resolve({data:e[0],meta:e[1]})})];case 1:return[2,{data:(r=i.sent()).data,meta:(o=r.meta,o?{page:Math.ceil(o.Offset/o.Limit),pageSize:o.Limit,totalData:o.TotalItems,totalPages:Math.ceil(o.TotalItems/o.Limit)}:{})}]}var o})})},viewLink:function(e){return s(void 0,void 0,void 0,function(){var t,n;return u(this,function(r){switch(r.label){case 0:return t=l().getDependency("userClient"),n=Q(),[4,t.get("/smart-link/".concat(e)).then(function(e){return Promise.resolve(n.deserializeAsync("smart_link",e.data))}).then(function(e){return Promise.resolve(e[0])})];case 1:return[2,r.sent()]}})})}},shortLinkAction:{createLinkAction:function(e,t){var n=t.type,r=t.payload;return s(void 0,void 0,void 0,function(){var t;return u(this,function(i){return t={data:{attributes:{type:n,payload:r}}},[2,l().getDependency("userClient").put("/smart-link/".concat(e,"/action"),t)]})})},editLinkAction:function(e,t,n){var r=n.type,i=n.payload;return s(void 0,void 0,void 0,function(){var n;return u(this,function(o){return n={data:{attributes:{type:r,payload:i}}},[2,l().getDependency("userClient").put("/smart-link/".concat(e,"/action/").concat(t),n)]})})},deleteLinkAction:function(e,t){return s(void 0,void 0,void 0,function(){return u(this,function(n){return l().getDependency("userClient").delete("/smart-link/".concat(e,"/action/").concat(t)),[2]})})}},campaign:{createCampaign:function(e){return s(void 0,void 0,void 0,function(){var t,n,r;return u(this,function(i){switch(i.label){case 0:return t=l().getDependency("issuerClient"),n={data:{type:"campaign",attributes:e}},r=Ne(),[4,t.post("/campaign/v2/campaigns",n).then(function(e){return Promise.resolve(r.deserializeAsync("campaign",e.data))})];case 1:return[2,i.sent()[0]]}})})},getCampaignById:function(e){return s(void 0,void 0,void 0,function(){var t,n,r;return u(this,function(i){switch(i.label){case 0:return t=l().getDependency("issuerClient"),n=new AbortController,r=Ne(),[4,t.get("/campaign/v2/campaigns/".concat(e),{signal:n.signal}).then(function(e){return Promise.resolve(r.deserializeAsync("campaign",e.data))}).then(function(e){return Promise.resolve(e[0])})];case 1:return[2,i.sent()]}})})},listCampaigns:function(e){return s(void 0,void 0,void 0,function(){var t,n,r,i;return u(this,function(o){switch(o.label){case 0:return t=l().getDependency("issuerClient"),n=new AbortController,r=Ne(),[4,t.get("/campaign/v2/campaigns",{params:e,signal:n.signal}).then(function(e){return Promise.all([r.deserializeAsync("campaign",e.data),e.data.meta])}).then(function(e){return Promise.resolve({data:e[0],meta:e[1]})})];case 1:return[2,{data:(i=o.sent()).data,meta:J(i.meta)}]}})})},deleteCampaign:function(e){return l().getDependency("issuerClient").delete("/campaign/v2/campaigns/".concat(e))},updateCampaignInfo:function(e,t){return s(void 0,void 0,void 0,function(){var n,r,i;return u(this,function(o){switch(o.label){case 0:return n=l().getDependency("issuerClient"),r={data:{type:"campaign",attributes:t}},i=Ne(),[4,n.put("/campaign/v2/campaigns/".concat(e),r).then(function(e){return Promise.resolve(i.deserializeAsync("campaign",e.data))})];case 1:return[2,o.sent()[0]]}})})},updateCampaignDates:function(e,t){return s(void 0,void 0,void 0,function(){var n,r,i;return u(this,function(o){switch(o.label){case 0:return n=l().getDependency("issuerClient"),r={data:{type:"campaign_schedule",attributes:t}},i=Ne(),[4,n.post("/campaign/v2/campaigns/".concat(e,"/schedule"),r).then(function(e){return Promise.resolve(i.deserializeAsync("campaign",e.data))})];case 1:return[2,o.sent()[0]]}})})},updateCampaignLocations:function(e,t){return s(void 0,void 0,void 0,function(){var n,r,i;return u(this,function(o){switch(o.label){case 0:return n=l().getDependency("issuerClient"),r={data:{type:"campaign_locations",attributes:t}},i=Ne(),[4,n.put("/campaign/v2/campaigns/".concat(e,"/locations"),r).then(function(e){return Promise.resolve(i.deserializeAsync("campaign",e.data))})];case 1:return[2,o.sent()[0]]}})})},addActionToCampaign:function(e,t){return s(void 0,void 0,void 0,function(){var n,r,i;return u(this,function(o){switch(o.label){case 0:return n=l().getDependency("issuerClient"),r={data:{type:"campaign_action",attributes:t}},i=Ne(),[4,n.post("/campaign/v2/campaigns/".concat(e,"/actions"),r).then(function(e){return Promise.resolve(i.deserializeAsync("campaign",e.data))})];case 1:return[2,o.sent()[0]]}})})},updateCampaignAction:function(e,t,n,r){return void 0===r&&(r="campaign_action"),s(void 0,void 0,void 0,function(){var i,o,a;return u(this,function(s){switch(s.label){case 0:return i=l().getDependency("issuerClient"),o={data:{type:r,attributes:n}},a=Ne(),[4,i.put("/campaign/v2/campaigns/".concat(e,"/actions/").concat(t),o).then(function(e){return Promise.resolve(a.deserializeAsync("campaign",e.data))})];case 1:return[2,s.sent()[0]]}})})},deleteActionFromCampaign:function(e,t){return l().getDependency("issuerClient").delete("/campaign/v2/campaigns/".concat(e,"/actions/").concat(t))},executeCampaign:function(e,t){return s(void 0,void 0,void 0,function(){var n,r,o,a;return u(this,function(s){switch(s.label){case 0:return n=l().getDependency("issuerClient"),r={data:{type:"campaign_execution",attributes:{parameters:{execution_mode:null!==(a=t.execution_mode)&&void 0!==a?a:"immediate",notification_channels:t.notification_channels}}}},(o=new i.default).register("execution_report"),o.register("action_result"),[4,n.post("/campaign/v2/campaigns/".concat(e,"/execute"),r).then(function(e){return Promise.resolve(o.deserializeAsync("execution_report",e.data))})];case 1:return[2,s.sent()[0]]}})})},activateCampaign:function(e){return l().getDependency("issuerClient").post("/campaign/v2/campaigns/".concat(e,"/activate"))},pauseCampaign:function(e){return l().getDependency("issuerClient").post("/campaign/v2/campaigns/".concat(e,"/pause"))},resumeCampaign:function(e){return l().getDependency("issuerClient").post("/campaign/v2/campaigns/".concat(e,"/resume"))},cancelCampaign:function(e){return l().getDependency("issuerClient").post("/campaign/v2/campaigns/".concat(e,"/cancel"))},completeCampaign:function(e){return l().getDependency("issuerClient").post("/campaign/v2/campaigns/".concat(e,"/complete"))},getCampaignStatistics:function(e){return s(void 0,void 0,void 0,function(){var t,n,r;return u(this,function(o){switch(o.label){case 0:return t=l().getDependency("issuerClient"),n=new AbortController,(r=new i.default).register("campaign_statistics"),[4,t.get("/campaign/v2/campaigns/".concat(e,"/statistics"),{signal:n.signal}).then(function(e){return Promise.resolve(r.deserializeAsync("campaign_statistics",e.data))}).then(function(e){return Promise.resolve(e[0])})];case 1:return[2,o.sent()]}})})}},cohorts:{listCohorts:function(e){return s(void 0,void 0,void 0,function(){var t,n,r;return u(this,function(i){switch(i.label){case 0:return t=l().getDependency("userClient"),n=Le(),[4,t.get("/campaign/cohorts/v2/cohort",{params:e}).then(function(e){return Promise.all([n.deserializeAsync("cohort",e.data),e.data.meta])}).then(function(e){return Promise.resolve({data:e[0],meta:e[1]})})];case 1:return[2,{data:(r=i.sent()).data,meta:J(r.meta)}]}})})},getCohortById:function(e){return s(void 0,void 0,void 0,function(){var t,n;return u(this,function(r){switch(r.label){case 0:return t=l().getDependency("userClient"),n=Le(),[4,t.get("/campaign/cohorts/v2/cohort/".concat(e)).then(function(e){return Promise.resolve(n.deserializeAsync("cohort",e.data))}).then(function(e){return Promise.resolve(e[0])})];case 1:return[2,r.sent()]}})})},createCohort:function(e){return s(void 0,void 0,void 0,function(){var t,n,r;return u(this,function(i){switch(i.label){case 0:return t=l().getDependency("userClient"),n=Le(),r={data:{attributes:e}},[4,t.post("/campaign/cohorts/v2/cohort",r).then(function(e){return Promise.resolve(n.deserializeAsync("cohort",e.data))}).then(function(e){return Promise.resolve(e[0])})];case 1:return[2,i.sent()]}})})},updateCohort:function(e,t){return s(void 0,void 0,void 0,function(){var n,r;return u(this,function(i){switch(i.label){case 0:return n=l().getDependency("userClient"),r={data:{attributes:t}},[4,n.put("/campaign/cohorts/v2/cohort/".concat(e),r)];case 1:return i.sent(),[2]}})})},deleteCohort:function(e){return s(void 0,void 0,void 0,function(){return u(this,function(t){switch(t.label){case 0:return[4,l().getDependency("userClient").delete("/campaign/cohorts/v2/cohort/".concat(e))];case 1:return t.sent(),[2]}})})}},messengerHub:{sendTelegramMsg:function(e){return s(void 0,void 0,void 0,function(){var t,n;return u(this,function(r){switch(r.label){case 0:return t=l().getDependency("issuerClient"),n={data:{attributes:e}},[4,t.put("/messenger-hub/send-msg",n,{timeout:3e5})];case 1:return[2,r.sent().data]}})})}},transactions:{getTransactionsByCard:function(e){var t=l().getDependency("issuerClient"),n=new AbortController,r=new i.default;return r.register("transactions"),{result:t.get("/bonuses/transactions/card/".concat(e),{signal:n.signal}).then(function(e){return Promise.all([e.data,r.deserializeAsync("transactions",e.data)])}).then(function(e){return Promise.resolve({jsonAPI:e[0],data:e[1]})}),abort:n.abort}}},tiers:{getAllTiers:function(){var e=l().getDependency("issuerClient"),t=new AbortController,n=new i.default;return n.register("tier"),n.register("tier_level"),{result:e.get("/loyalty-program/tier/my",{signal:t.signal}).then(function(e){return Promise.all([e.data,n.deserializeAsync("tier",e.data)])}).then(function(e){return Promise.resolve({jsonAPI:e[0],data:e[1][0]})}),abort:t.abort}},getTiersByCard:function(e){var t=l().getDependency("issuerClient"),n=new AbortController,r=new i.default;return r.register("userTier"),{result:t.get("/loyalty-program/tier/card/".concat(e),{signal:n.signal}).then(function(e){return Promise.all([e.data,r.deserializeAsync("userTier",e.data)])}).then(function(e){return Promise.resolve({jsonAPI:e[0],data:e[1][0]})}),abort:n.abort}},setTierByCard:function(e){var t=e.disableAutoUpdate,n=void 0===t||t,r=e.tierID,o=e.cardNumber,a=l().getDependency("issuerClient"),s=new AbortController,u=new i.default;u.register("tier"),u.register("tier_level");var c={data:{attributes:{level_id:r,is_on_hold:n}}};return{result:a.put("/loyalty-program/tier/card/".concat(o),c,{signal:s.signal}).then(function(e){return Promise.all([e.data,u.deserializeAsync("tier",e.data)])}).then(function(e){return Promise.resolve({jsonAPI:e[0],data:e[1][0]})}),abort:s.abort}}},promocodes:{listPromocodes:function(e){return s(void 0,void 0,void 0,function(){var t,n,r;return u(this,function(i){switch(i.label){case 0:return t=l().getDependency("userClient"),n=ze(),[4,t.get("/loyalty-program/promocode",{params:q(e)}).then(function(e){return Promise.all([n.deserializeAsync("promocode",e.data),e.data.meta])}).then(function(e){return Promise.resolve({data:e[0],meta:e[1]})})];case 1:return[2,{data:(r=i.sent()).data,meta:J(r.meta)}]}})})},getPromocodeById:function(e){return s(void 0,void 0,void 0,function(){var t,n;return u(this,function(r){switch(r.label){case 0:return t=l().getDependency("userClient"),n=ze(),[4,t.get("/loyalty-program/promocode/".concat(e)).then(function(e){return Promise.resolve(n.deserializeAsync("promocode",e.data))}).then(function(e){return Promise.resolve(e[0])})];case 1:return[2,r.sent()]}})})},createPromocode:function(e){return s(void 0,void 0,void 0,function(){var t,n,r;return u(this,function(i){switch(i.label){case 0:return t=l().getDependency("userClient"),n=ze(),r={data:{attributes:e}},[4,t.post("/loyalty-program/promocode",r).then(function(e){return Promise.resolve(n.deserializeAsync("promocode",e.data))}).then(function(e){return Promise.resolve(e[0])})];case 1:return[2,i.sent()]}})})},updatePromocode:function(e,t){return s(void 0,void 0,void 0,function(){var n,r;return u(this,function(i){switch(i.label){case 0:return n=l().getDependency("userClient"),r={data:{attributes:t}},[4,n.put("/loyalty-program/promocode/".concat(e),r)];case 1:return i.sent(),[2]}})})},enablePromocode:function(e){return s(void 0,void 0,void 0,function(){return u(this,function(t){switch(t.label){case 0:return[4,l().getDependency("userClient").put("/loyalty-program/promocode/".concat(e,"/enable"))];case 1:return t.sent(),[2]}})})},disablePromocode:function(e){return s(void 0,void 0,void 0,function(){return u(this,function(t){switch(t.label){case 0:return[4,l().getDependency("userClient").put("/loyalty-program/promocode/".concat(e,"/disable"))];case 1:return t.sent(),[2]}})})},archivePromocode:function(e){return s(void 0,void 0,void 0,function(){return u(this,function(t){switch(t.label){case 0:return[4,l().getDependency("userClient").put("/loyalty-program/promocode/".concat(e,"/archive"))];case 1:return t.sent(),[2]}})})},unarchivePromocode:function(e){return s(void 0,void 0,void 0,function(){return u(this,function(t){switch(t.label){case 0:return[4,l().getDependency("userClient").put("/loyalty-program/promocode/".concat(e,"/unarchive"))];case 1:return t.sent(),[2]}})})},usePromocode:function(e){return s(void 0,void 0,void 0,function(){return u(this,function(t){switch(t.label){case 0:return[4,l().getDependency("userClient").put("/loyalty-program/user-promo-code/".concat(e,"/use"))];case 1:return t.sent(),[2]}})})}},excludes:{listExcludes:function(e){return s(void 0,void 0,void 0,function(){var t,n,r;return u(this,function(i){switch(i.label){case 0:return t=l().getDependency("userClient"),n=ke(),[4,t.get("/loyalty-program/settings/exclude",{params:q(e)}).then(function(e){return Promise.all([n.deserializeAsync("exclude",e.data),e.data.meta])}).then(function(e){return Promise.resolve({data:e[0],meta:e[1]})})];case 1:return[2,{data:(r=i.sent()).data,meta:J(r.meta)}]}})})},getExclude:function(e){return s(void 0,void 0,void 0,function(){var t,n;return u(this,function(r){switch(r.label){case 0:return t=l().getDependency("userClient"),n=ke(),[4,t.get("/loyalty-program/settings/exclude/".concat(e)).then(function(e){return Promise.resolve(n.deserializeAsync("exclude",e.data))}).then(function(e){return Promise.resolve(e[0])})];case 1:return[2,r.sent()]}})})},createExclude:function(e){return s(void 0,void 0,void 0,function(){var t,n,r;return u(this,function(i){switch(i.label){case 0:return t=l().getDependency("userClient"),n={data:{attributes:e}},r=ke(),[4,t.post("/loyalty-program/settings/exclude",n).then(function(e){return Promise.resolve(r.deserializeAsync("exclude",e.data))}).then(function(e){return Promise.resolve(e[0])})];case 1:return[2,i.sent()]}})})},updateExclude:function(e,t){return s(void 0,void 0,void 0,function(){var n,r,i;return u(this,function(o){switch(o.label){case 0:return n=l().getDependency("userClient"),r={data:{attributes:t}},i=ke(),[4,n.put("/loyalty-program/settings/exclude/".concat(e),r).then(function(e){return Promise.resolve(i.deserializeAsync("exclude",e.data))}).then(function(e){return Promise.resolve(e[0])})];case 1:return[2,o.sent()]}})})},deleteExclude:function(e){return s(void 0,void 0,void 0,function(){return u(this,function(t){switch(t.label){case 0:return[4,l().getDependency("userClient").delete("/loyalty-program/settings/exclude/".concat(e))];case 1:return t.sent(),[2]}})})}},products:{searchProducts:function(e){var t=e.page,n=e.pageSize,r=e.search,i=void 0===r?"":r;return s(void 0,void 0,void 0,function(){var e,r,o;return u(this,function(a){switch(a.label){case 0:return e=l().getDependency("userClient"),r=Me(),[4,e.get("loyalty-products/search/".concat(i),{params:q({page:t,pageSize:n})}).then(function(e){return Promise.all([r.deserializeAsync("product",e.data),e.data.meta])}).then(function(e){return Promise.resolve({data:e[0],meta:e[1]})})];case 1:return[2,{data:(o=a.sent()).data,meta:J(o.meta)}]}})})},searchCategories:function(e){var t=e.page,n=e.pageSize,r=e.search,i=void 0===r?"":r;return s(void 0,void 0,void 0,function(){var e,r,o;return u(this,function(a){switch(a.label){case 0:return e=l().getDependency("userClient"),r=Be(),[4,e.get("loyalty-products/category-search/".concat(i),{params:q({page:t,pageSize:n}),timeout:6e4}).then(function(e){return Promise.all([r.deserializeAsync("category",e.data),e.data.meta])}).then(function(e){return Promise.resolve({data:e[0],meta:e[1]})})];case 1:return[2,{data:(o=a.sent()).data,meta:J(o.meta)}]}})})},getProductById:function(e){return s(void 0,void 0,void 0,function(){var t,n;return u(this,function(r){switch(r.label){case 0:return t=l().getDependency("userClient"),n=Me(),[4,t.get("loyalty-products/product/".concat(e)).then(function(e){return Promise.resolve(n.deserializeAsync("product",e.data))}).then(function(e){return Promise.resolve(e[0])})];case 1:return[2,r.sent()]}})})},getCategoryById:function(e){return s(void 0,void 0,void 0,function(){var t,n;return u(this,function(r){switch(r.label){case 0:return t=l().getDependency("userClient"),n=Be(),[4,t.get("loyalty-products/category/".concat(e)).then(function(e){return Promise.resolve(n.deserializeAsync("category",e.data))}).then(function(e){return Promise.resolve(e[0])})];case 1:return[2,r.sent()]}})})}},orders:{openOrder:function(e){return s(void 0,void 0,void 0,function(){var t,n,r;return u(this,function(i){switch(i.label){case 0:return t=l().getDependency("userClient"),n={data:{attributes:e}},r=He(),[4,t.post("/loyalty-program/order/open",n).then(function(e){return Promise.resolve(r.deserializeAsync("order",e.data))}).then(function(e){return Promise.resolve(e[0])})];case 1:return[2,i.sent()]}})})},closeOrder:function(e){return s(void 0,void 0,void 0,function(){var t,n;return u(this,function(r){switch(r.label){case 0:return t=l().getDependency("userClient"),n=He(),[4,t.put("/loyalty-program/order/".concat(e,"/close")).then(function(e){return Promise.resolve(n.deserializeAsync("order",e.data))}).then(function(e){return Promise.resolve(e[0])})];case 1:return[2,r.sent()]}})})}},referralProgram:{createRefProgram:function(e){return s(void 0,void 0,void 0,function(){var t,n;return u(this,function(r){switch(r.label){case 0:return t=l().getDependency("userClient"),n=We(),[4,t.post("/loyalty-program/referral/program",e).then(function(e){return Promise.resolve(n.deserializeAsync("referral_program",e.data))}).then(function(e){return Promise.resolve(e[0])})];case 1:return[2,r.sent()]}})})},updateRefProgram:function(e,t){return s(void 0,void 0,void 0,function(){return u(this,function(n){switch(n.label){case 0:return[4,l().getDependency("userClient").put("/loyalty-program/referral/program/".concat(e),t)];case 1:return n.sent(),[2]}})})},enableRefProgram:function(e){return s(void 0,void 0,void 0,function(){return u(this,function(t){switch(t.label){case 0:return[4,l().getDependency("userClient").put("/loyalty-program/referral/program/".concat(e,"/enable"))];case 1:return t.sent(),[2]}})})},disableRefProgram:function(e){return s(void 0,void 0,void 0,function(){return u(this,function(t){switch(t.label){case 0:return[4,l().getDependency("userClient").put("/loyalty-program/referral/program/".concat(e,"/disable"))];case 1:return t.sent(),[2]}})})},archiveRefProgram:function(e){return s(void 0,void 0,void 0,function(){return u(this,function(t){switch(t.label){case 0:return[4,l().getDependency("userClient").put("/loyalty-program/referral/program/".concat(e,"/archive"))];case 1:return t.sent(),[2]}})})},listRefPrograms:function(e){return s(void 0,void 0,void 0,function(){var t,n,r;return u(this,function(i){switch(i.label){case 0:return t=l().getDependency("userClient"),n=We(),[4,t.get("/loyalty-program/referral/program",{params:q(e)}).then(function(e){return Promise.all([n.deserializeAsync("referral_program",e.data),e.data.meta])}).then(function(e){return Promise.resolve({data:e[0],meta:e[1]})})];case 1:return[2,{data:(r=i.sent()).data,meta:J(r.meta)}]}})})},getRefProgram:function(e){return s(void 0,void 0,void 0,function(){var t,n;return u(this,function(r){switch(r.label){case 0:return t=l().getDependency("userClient"),n=We(),[4,t.get("/loyalty-program/referral/program/".concat(e)).then(function(e){return Promise.resolve(n.deserializeAsync("referral_program",e.data))}).then(function(e){return Promise.resolve(e[0])})];case 1:return[2,r.sent()]}})})},getRefProgramAnalytics:function(e){return s(void 0,void 0,void 0,function(){var t,n;return u(this,function(r){switch(r.label){case 0:return t=l().getDependency("userClient"),(n=new i.default).register("program_analytics"),[4,t.get("/loyalty-program/referral/program/".concat(e,"/analytics")).then(function(e){return Promise.resolve(n.deserializeAsync("program_analytics",e.data))}).then(function(e){return Promise.resolve(e[0])})];case 1:return[2,r.sent()]}})})},getRefProgramMetrics:function(e,t){return s(void 0,void 0,void 0,function(){return u(this,function(n){switch(n.label){case 0:return[4,l().getDependency("userClient").get("/loyalty-program/referral/analytics/program/".concat(e,"/metrics"),{params:t})];case 1:return[2,n.sent().data]}})})},addInfluencer:function(e,t){return s(void 0,void 0,void 0,function(){var n,r;return u(this,function(i){switch(i.label){case 0:return n=l().getDependency("userClient"),r=Ge(),[4,n.post("loyalty-program/referral/program/".concat(e,"/influencer"),t).then(function(e){return Promise.resolve(r.deserializeAsync("influencer",e.data))}).then(function(e){return Promise.resolve(e[0])})];case 1:return[2,i.sent()]}})})},updateInfluencer:function(e,t,n){return s(void 0,void 0,void 0,function(){var r,i;return u(this,function(o){switch(o.label){case 0:return r=l().getDependency("userClient"),i=Ge(),[4,r.put("/loyalty-program/referral/program/".concat(e,"/influencer/").concat(t),n).then(function(e){return Promise.resolve(i.deserializeAsync("influencer",e.data))}).then(function(e){return Promise.resolve(e[0])})];case 1:return[2,o.sent()]}})})},updateInfluencerReward:function(e,t,n){return s(void 0,void 0,void 0,function(){var r,i;return u(this,function(o){switch(o.label){case 0:return r=l().getDependency("userClient"),i=Ge(),[4,r.put("/loyalty-program/referral/program/".concat(e,"/influencer/").concat(t,"/reward-condition"),n).then(function(e){return Promise.resolve(i.deserializeAsync("influencer",e.data))}).then(function(e){return Promise.resolve(e[0])})];case 1:return[2,o.sent()]}})})},deleteInfluencer:function(e,t){return s(void 0,void 0,void 0,function(){return u(this,function(n){switch(n.label){case 0:return[4,l().getDependency("userClient").delete("/loyalty-program/referral/program/".concat(e,"/influencer/").concat(t))];case 1:return n.sent(),[2]}})})},listInfluencers:function(e,t){return s(void 0,void 0,void 0,function(){var n,r,i;return u(this,function(o){switch(o.label){case 0:return n=l().getDependency("userClient"),r=Ge(),[4,n.get("/loyalty-program/referral/program/".concat(e,"/influencer"),{params:q(t)}).then(function(e){return Promise.all([r.deserializeAsync("influencer",e.data),e.data.meta])}).then(function(e){return Promise.resolve({data:e[0],meta:e[1]})})];case 1:return[2,{data:(i=o.sent()).data,meta:J(i.meta)}]}})})},getInfluencerPerfomance:function(e,t){return s(void 0,void 0,void 0,function(){var n,r;return u(this,function(o){switch(o.label){case 0:return n=l().getDependency("userClient"),(r=new i.default).register("influencer_performance"),[4,n.get("/loyalty-program/referral/program/".concat(e,"/influencer/").concat(t,"/analytics")).then(function(e){return Promise.resolve(r.deserializeAsync("influencer_performance",e.data))}).then(function(e){return Promise.resolve(e[0])})];case 1:return[2,o.sent()]}})})}},rewardProgram:{createProgram:function(e){return s(void 0,void 0,void 0,function(){var t,n,r;return u(this,function(i){switch(i.label){case 0:return t=l().getDependency("userClient"),n=Ye(),r={data:{attributes:e}},[4,t.post("/loyalty-program/program",r).then(function(e){return Promise.resolve(n.deserializeAsync("loyalty_program",e.data))}).then(function(e){return Promise.resolve(e[0])})];case 1:return[2,i.sent()]}})})},updateProgram:function(e,t){return s(void 0,void 0,void 0,function(){var n,r,i;return u(this,function(o){switch(o.label){case 0:return n=l().getDependency("userClient"),r=Ye(),i={data:{attributes:t}},[4,n.put("/loyalty-program/program/".concat(e),i).then(function(e){return Promise.resolve(r.deserializeAsync("loyalty_program",e.data))}).then(function(e){return Promise.resolve(e[0])})];case 1:return[2,o.sent()]}})})},deleteProgram:function(e){return s(void 0,void 0,void 0,function(){return u(this,function(t){switch(t.label){case 0:return[4,l().getDependency("userClient").delete("/loyalty-program/program/".concat(e))];case 1:return[2,t.sent()]}})})},listPrograms:function(){return s(void 0,void 0,void 0,function(){var e,t;return u(this,function(n){switch(n.label){case 0:return e=l().getDependency("userClient"),t=Ye(),[4,e.get("/loyalty-program/program/all").then(function(e){return Promise.resolve(t.deserializeAsync("loyalty_program",e.data))})];case 1:return[2,n.sent()]}})})},getProgram:function(e){return s(void 0,void 0,void 0,function(){var t,n;return u(this,function(r){switch(r.label){case 0:return t=l().getDependency("userClient"),n=Ye(),[4,t.get("/loyalty-program/program/".concat(e)).then(function(e){return Promise.resolve(n.deserializeAsync("loyalty_program",e.data))}).then(function(e){return Promise.resolve(e[0])})];case 1:return[2,r.sent()]}})})},getProgramByTitle:function(e){return s(void 0,void 0,void 0,function(){var t,n;return u(this,function(r){switch(r.label){case 0:return t=l().getDependency("userClient"),n=Ye(),[4,t.get("/loyalty-program/program/title/".concat(e)).then(function(e){return Promise.resolve(n.deserializeAsync("loyalty_program",e.data))}).then(function(e){return Promise.resolve(e[0])})];case 1:return[2,r.sent()]}})})},addRule:function(e,t){return s(void 0,void 0,void 0,function(){var n,r;return u(this,function(i){switch(i.label){case 0:return n=l().getDependency("userClient"),r={data:{attributes:t}},[4,n.post("/loyalty-program/program/".concat(e,"/rule"),r)];case 1:return[2,i.sent()]}})})},updateRule:function(e,t){return s(void 0,void 0,void 0,function(){var n,r;return u(this,function(i){switch(i.label){case 0:return n=l().getDependency("userClient"),r={data:{attributes:t}},[4,n.put("/loyalty-program/program/".concat(e,"/rules"),r)];case 1:return[2,i.sent()]}})})},removeRule:function(e,t){return s(void 0,void 0,void 0,function(){return u(this,function(n){switch(n.label){case 0:return[4,l().getDependency("userClient").delete("/loyalty-program/program/".concat(e,"/rule/").concat(t))];case 1:return[2,n.sent()]}})})},createTier:function(e){return s(void 0,void 0,void 0,function(){var t,n,r;return u(this,function(i){switch(i.label){case 0:return t=l().getDependency("userClient"),n=Ve(),r={data:{attributes:e}},[4,t.post("/loyalty-program/tier",r).then(function(e){return Promise.resolve(n.deserializeAsync("tier",e.data))}).then(function(e){return Promise.resolve(e[0])})];case 1:return[2,i.sent()]}})})},deleteTier:function(e){return s(void 0,void 0,void 0,function(){return u(this,function(t){switch(t.label){case 0:return[4,l().getDependency("userClient").delete("/loyalty-program/tier/".concat(e))];case 1:return[2,t.sent()]}})})},listTiers:function(){return s(void 0,void 0,void 0,function(){var e,t;return u(this,function(n){switch(n.label){case 0:return e=l().getDependency("userClient"),t=Ve(),[4,e.get("/loyalty-program/tier/my").then(function(e){return Promise.resolve(t.deserializeAsync("tier",e.data))})];case 1:return[2,n.sent()]}})})}}};exports.ECampaignType=void 0,(Z=exports.ECampaignType||(exports.ECampaignType={})).UNIVERSAL="UNIVERSAL",Z.LIMITED="LIMITED",exports.ECampaignStatus=void 0,($=exports.ECampaignStatus||(exports.ECampaignStatus={})).DRAFT="DRAFT",$.SCHEDULED="SCHEDULED",$.ACTIVE="ACTIVE",$.PAUSED="PAUSED",$.COMPLETED="COMPLETED",$.CANCELLED="CANCELLED",exports.ECampaignExecutionMode=void 0,(ee=exports.ECampaignExecutionMode||(exports.ECampaignExecutionMode={})).NonStrict="NON_STRICT",ee.Strict="STRICT",exports.ECampaignActionType=void 0,(te=exports.ECampaignActionType||(exports.ECampaignActionType={})).PROMOCODE="PROMOCODE",te.NOTIFICATION="NOTIFICATION",te.BONUS_ACCRUAL="BONUS_ACCRUAL",exports.ENotificationDeliveryGuarantee=void 0,(ne=exports.ENotificationDeliveryGuarantee||(exports.ENotificationDeliveryGuarantee={})).AtLeastOnce="AT_LEAST_ONCE",ne.AtMostOnce="AT_MOST_ONCE",ne.ExactlyOnce="EXACTLY_ONCE",exports.ENotificationChannel=void 0,(re=exports.ENotificationChannel||(exports.ENotificationChannel={})).EMAIL="EMAIL",re.SMS="SMS",re.PUSH="PUSH",re.TELEGRAM="TELEGRAM",re.RCS="RCS",exports.EMediaType=void 0,(ie=exports.EMediaType||(exports.EMediaType={})).Image="IMAGE",ie.Video="VIDEO",exports.ECardType=void 0,(oe=exports.ECardType||(exports.ECardType={})).GENERAL="general",oe.ANONYMOUS="coupon",exports.NotificationChannel=void 0,(ae=exports.NotificationChannel||(exports.NotificationChannel={})).Email="email",ae.Sms="sms",ae.WebPush="webPush",ae.PassPush="passPush",exports.CurrencyCode=void 0,(se=exports.CurrencyCode||(exports.CurrencyCode={})).UAH="UAH",se.USD="USD",se.EUR="EUR",exports.EPromocodeStatus=void 0,(ue=exports.EPromocodeStatus||(exports.EPromocodeStatus={})).STARTED="started",ue.NOT_STARTED="notStarted",ue.COMPLETED="completed",ue.DISABLED="disabled",ue.ARCHIVED="archived",exports.EPromocodeDiscountType=void 0,(ce=exports.EPromocodeDiscountType||(exports.EPromocodeDiscountType={})).PERCENT="percent",ce.PRODUCT_PRICE="product_price",ce.N_PLUS_1="buy_n_get_one_free",ce.BONUS="bonus",exports.EPromocodeType=void 0,(de=exports.EPromocodeType||(exports.EPromocodeType={})).GENERAL="general",de.PERSONAL="personal",exports.EExcludeType=void 0,(le=exports.EExcludeType||(exports.EExcludeType={})).CASHBACK="cashback",le.BONUS_PAYMENT="bonus_payment",exports.EProductSearchType=void 0,(pe=exports.EProductSearchType||(exports.EProductSearchType={})).PRODUCT="product",pe.GROUP="group",exports.EListSort=void 0,(ve=exports.EListSort||(exports.EListSort={})).ASC="asc",ve.DESC="desc",exports.EOrderState=void 0,(fe=exports.EOrderState||(exports.EOrderState={})).NEW="new",fe.CLOSED="closed",exports.EOrderDiscountType=void 0,(ge=exports.EOrderDiscountType||(exports.EOrderDiscountType={})).COUPON="coupon",ge.BONUS="bonus",ge.PERCENTAGE="percentage",ge.USER_PROMO_CODE="userPromoCode",ge.PROMO_CODE="promoCode",exports.ERefProgramStatus=void 0,(me=exports.ERefProgramStatus||(exports.ERefProgramStatus={})).NotStarted="notStarted",me.Active="active",me.Expired="expired",me.Paused="paused",me.Completed="completed",me.Archive="archived",exports.ERefProgramActionType=void 0,(ye=exports.ERefProgramActionType||(exports.ERefProgramActionType={})).REGISTRATION="registration",ye.PURCHASE="purchase",exports.ERefProgramRewardType=void 0,(he=exports.ERefProgramRewardType||(exports.ERefProgramRewardType={})).BONUS="points",he.COUPON="coupon",exports.ERewardProgramType=void 0,(Ce=exports.ERewardProgramType||(exports.ERewardProgramType={})).stateFullProgram="stateFullProgram",Ce.statelessRulesProgram="statelessRulesProgram",exports.ERewardProgramTitle=void 0,(be=exports.ERewardProgramTitle||(exports.ERewardProgramTitle={})).SenseCardTransformation="SenseCardTransformation",be.referralSystemProgram="referralSystemProgram",exports.ECohortStatus=void 0,(Pe=exports.ECohortStatus||(exports.ECohortStatus={})).STARTED="started",Pe.NOT_STARTED="notStarted",Pe.COMPLETED="completed",Pe.DISABLED="disabled",Pe.ARCHIVED="archived",exports.ECohortUserType=void 0,(De=exports.ECohortUserType||(exports.ECohortUserType={})).ALL="ALL",De.NEW="NEW",De.WITH_CONDITIONS="CONDITIONAL",exports.ECohortType=void 0,(Ee=exports.ECohortType||(exports.ECohortType={})).DYNAMIC="DYNAMIC",Ee.STATIC="STATIC",exports.ECohortOS=void 0,(we=exports.ECohortOS||(exports.ECohortOS={})).IOS="IOS",we.ANDROID="ANDROID",we.WEB="WEB",exports.ECohortAction=void 0,(Ae=exports.ECohortAction||(exports.ECohortAction={})).REGISTRATION="REGISTRATION",Ae.PURCHASE="PURCHASE",Ae.TRANSITION_TO_NEW_LEVEL="LEVEL_TRANSITION",Ae.ADDED_CARD_TO_WALLET="ADD_CARD_TO_WALLET",Ae.REMOVED_CARD="REMOVE_CARD",exports.ECohortConditionsType=void 0,(Te=exports.ECohortConditionsType||(exports.ECohortConditionsType={})).LESS="LESS",Te.GREATER="GREATER",Te.LESS_EQUAL="LESS_EQUAL",Te.GREATER_EQUAL="GREATER_EQUAL",Te.EQUAL="EQUAL",Te.NOT_EQUAL="NOT_EQUAL",exports.ECohortTimePeriod=void 0,(_e=exports.ECohortTimePeriod||(exports.ECohortTimePeriod={})).YESTERDAY="YESTERDAY",_e.LAST_WEEK="LAST_WEEK",_e.MONTH="MONTH",_e.QUARTER="QUARTER",_e.SINCE="SINCE",_e.CUSTOM="CUSTOM",_e.WITHIN="WITHIN",_e.IN_EACH="IN_EACH",_e.DURING="DURING",exports.ECohortDuration=void 0,(Se=exports.ECohortDuration||(exports.ECohortDuration={})).DAYS="DAYS",Se.WEEKS="WEEKS",Se.MONTHS="MONTHS",exports.ECohortDurationPeriodicity=void 0,(xe=exports.ECohortDurationPeriodicity||(exports.ECohortDurationPeriodicity={})).DAILY="DAILY",xe.WEEKLY="WEEKLY",xe.MONTHLY="MONTHLY",exports.sdk=Fe,exports.toFilterQueryParams=q;
|
|
@@ -33,7 +33,7 @@ export interface IGetCardConversionStats {
|
|
|
33
33
|
export interface IGetUserCompositionStats {
|
|
34
34
|
(startDate: Date, endDate: Date): Promise<IUserCompositionAttributes>;
|
|
35
35
|
}
|
|
36
|
-
|
|
36
|
+
type ActiveUsersDataResponseDTO = IHTTPClientResponse<IGetActiveUsersDataResponse>;
|
|
37
37
|
interface IGetActiveUsersDataResponse {
|
|
38
38
|
data: [
|
|
39
39
|
{
|
|
@@ -45,7 +45,7 @@ interface IGetActiveUsersDataResponse {
|
|
|
45
45
|
}
|
|
46
46
|
];
|
|
47
47
|
}
|
|
48
|
-
|
|
48
|
+
type GeneralCardsDataResponseDTO = IHTTPClientResponse<IGetGeneralCardsDataResponse>;
|
|
49
49
|
interface IGetGeneralCardsDataResponse {
|
|
50
50
|
data: [
|
|
51
51
|
{
|
|
@@ -60,20 +60,20 @@ interface IGetGeneralCardsDataResponse {
|
|
|
60
60
|
}
|
|
61
61
|
];
|
|
62
62
|
}
|
|
63
|
-
export
|
|
63
|
+
export type PointsDataResponseDTO = I_JSON_API_Response_Many<IPointsAttributes>;
|
|
64
64
|
export interface IPointsAttributes {
|
|
65
65
|
received: Record<string, number>;
|
|
66
66
|
used: Record<string, number>;
|
|
67
67
|
}
|
|
68
|
-
export
|
|
68
|
+
export type IAnalyticResponseDTO = I_JSON_API_Response_Many<IAnalyticsAttributes>;
|
|
69
69
|
export interface IAnalyticsAttributes {
|
|
70
70
|
daily_stats: Record<string, number>;
|
|
71
71
|
}
|
|
72
|
-
export
|
|
72
|
+
export type IUserCompositionResponseDTO = I_JSON_API_Response_Many<IUserCompositionAttributes>;
|
|
73
73
|
export interface IUserCompositionAttributes {
|
|
74
74
|
os_distribution: Record<string, number>;
|
|
75
75
|
}
|
|
76
|
-
export
|
|
76
|
+
export type ICardConversionResponseDto = I_JSON_API_Response_Many<ICardConversionAttributes>;
|
|
77
77
|
export interface ICardConversionAttributes {
|
|
78
78
|
action_stats: {
|
|
79
79
|
CardCreated?: number;
|
|
@@ -5,7 +5,7 @@ export declare enum ECampaignActionType {
|
|
|
5
5
|
NOTIFICATION = "NOTIFICATION",
|
|
6
6
|
BONUS_ACCRUAL = "BONUS_ACCRUAL"
|
|
7
7
|
}
|
|
8
|
-
export
|
|
8
|
+
export type TCampaignAction = IPromoCodeAction | INotificationAction | IBonusAccrualAction;
|
|
9
9
|
export interface INotificationChannelSetting {
|
|
10
10
|
enabled: boolean;
|
|
11
11
|
priority?: number;
|
|
@@ -9,7 +9,7 @@ import { ICampaignRun } from './ICampaignRun';
|
|
|
9
9
|
import { ICreateCampaignPayload, IUpdateCampaignDatesPayload, IUpdateCampaignLocationsPayload, IUpdateCampaignPayload, IUpdateCampaignActionPayload, TCampaignActionPayload, IExecuteCampaignPayload } from './campaignPayloads';
|
|
10
10
|
import { ICampaignActionResult, IExecuteCampaignResponse } from './IExecuteCampaignResult';
|
|
11
11
|
import { ICampaignStatistics } from './ICampaignStatistics';
|
|
12
|
-
export
|
|
12
|
+
export type CampaignResponseDTO = I_JSON_API_Response_Many<ICampaign, ICampaignCohort | TCampaignAction | ICampaignRun | ICampaignLocation>;
|
|
13
13
|
export interface IListCampaignsResponse {
|
|
14
14
|
data: ICampaign[];
|
|
15
15
|
meta: IPaginationData;
|
|
@@ -59,11 +59,11 @@ export interface ICompleteCampaign {
|
|
|
59
59
|
export interface ICancelCampaign {
|
|
60
60
|
(id: string): Promise<IHTTPClientResponse<void>>;
|
|
61
61
|
}
|
|
62
|
-
export
|
|
62
|
+
export type IExecuteCampaignResponseDTO = I_JSON_API_Response_Many<IExecuteCampaignResponse, ICampaignActionResult>;
|
|
63
63
|
export interface IExecuteCampaign {
|
|
64
64
|
(id: string, payload: IExecuteCampaignPayload): Promise<IExecuteCampaignResponse>;
|
|
65
65
|
}
|
|
66
|
-
export
|
|
66
|
+
export type IGetCampaignStatisticsResponseDTO = I_JSON_API_Response_Many<ICampaignStatistics>;
|
|
67
67
|
export interface IGetCampaignStatistics {
|
|
68
68
|
(id: string): Promise<ICampaignStatistics>;
|
|
69
69
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { ENotificationChannel } from './ENotificationChannel';
|
|
2
2
|
import { ECampaignExecutionMode, ECampaignType } from './ICampaign';
|
|
3
3
|
import type { IBonusAccrualAction, INotificationAction, IPromoCodeAction } from './ICampaignAction';
|
|
4
|
-
export
|
|
5
|
-
export
|
|
6
|
-
export
|
|
7
|
-
export
|
|
4
|
+
export type IPromoCodeActionPayload = Omit<IPromoCodeAction, 'id' | 'name' | 'version' | 'created_at'>;
|
|
5
|
+
export type INotificationActionPayload = Omit<INotificationAction, 'id' | 'version' | 'created_at'>;
|
|
6
|
+
export type IBonusAccrualActionPayload = Omit<IBonusAccrualAction, 'id' | 'version' | 'created_at'>;
|
|
7
|
+
export type TCampaignActionPayload = IPromoCodeActionPayload | INotificationActionPayload | IBonusAccrualActionPayload;
|
|
8
8
|
export interface ICreateCampaignPayload {
|
|
9
9
|
name: string;
|
|
10
10
|
description?: string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { IGetCardBonusesResponseDTO } from '../issuer/IGetCardBonuses';
|
|
2
2
|
import { IRequestWithCancelAndData } from '../IRequestWithCancelAndData';
|
|
3
3
|
import { I_JSON_API_Response_Many } from '../I_JSON_API_ResponseDTO';
|
|
4
|
-
export
|
|
4
|
+
export type IGetBonusesResponseDTO = IGetCardBonusesResponseDTO;
|
|
5
5
|
export interface IGetBonuses {
|
|
6
6
|
(): IRequestWithCancelAndData<IGetBonusesResponseDTO, I_JSON_API_Response_Many>;
|
|
7
7
|
}
|
|
@@ -76,7 +76,7 @@ export interface IUpdateDiscountPercent {
|
|
|
76
76
|
export interface IDownloadAnonymousCard {
|
|
77
77
|
(issuer: string, referral_id?: string): Promise<unknown>;
|
|
78
78
|
}
|
|
79
|
-
export
|
|
79
|
+
export type DownloadAnonymousCardRequestDTO = JsonApiRequestDTO<{
|
|
80
80
|
issuer: string;
|
|
81
81
|
referral_id: string;
|
|
82
82
|
}>;
|
|
@@ -39,7 +39,7 @@ export interface CardResponseDTO {
|
|
|
39
39
|
issuer: string;
|
|
40
40
|
};
|
|
41
41
|
}
|
|
42
|
-
export
|
|
42
|
+
export type CardJsonApiResponseDTO = I_JSON_API_Response_Many<CardResponseDTO>;
|
|
43
43
|
export interface ICreateCard {
|
|
44
44
|
(payload: ICardPayload): Promise<ICard>;
|
|
45
45
|
}
|
|
@@ -63,5 +63,5 @@ export interface IDeactivateCard {
|
|
|
63
63
|
export interface IListCards {
|
|
64
64
|
(params: IListFiltersPayload): Promise<IListCardsResponse>;
|
|
65
65
|
}
|
|
66
|
-
export
|
|
67
|
-
export
|
|
66
|
+
export type ListCardsResponseDTO = I_JSON_API_Response_Many<CardResponseDTO>;
|
|
67
|
+
export type IListCardsResponse = I_Deserialized_List_Response_DTO<ICard>;
|