@wavemaker/app-rn-runtime 11.5.0-next.26225 → 11.5.0-next.26226

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.
@@ -1,4 +1,5 @@
1
1
  import { BaseAction } from "./base-action";
2
+ import { VariableEvents } from '../variables/base-variable';
2
3
  import { get } from 'lodash';
3
4
  export class LoginAction extends BaseAction {
4
5
  constructor(config) {
@@ -9,6 +10,7 @@ export class LoginAction extends BaseAction {
9
10
  if (!get(options, 'formData')) {
10
11
  params = this.config.paramProvider();
11
12
  }
13
+ this.notify(VariableEvents.BEFORE_INVOKE, [this, params]);
12
14
  return this.config.securityService().appLogin({
13
15
  baseURL: this.config.baseURL,
14
16
  formData: get(options, 'formData') || params,
@@ -16,12 +18,14 @@ export class LoginAction extends BaseAction {
16
18
  }).then(data => {
17
19
  this.config.onSuccess && this.config.onSuccess(this, get(data, 'userInfo'));
18
20
  successcb && successcb(data);
21
+ this.notify(VariableEvents.AFTER_INVOKE, [this, data]);
19
22
  if (this.config.useDefaultSuccessHandler) {
20
23
  this.config.securityService().navigateToLandingPage(data);
21
24
  }
22
25
  }).catch(error => {
23
26
  this.config.onError && this.config.onError(this, error);
24
27
  errorcb && errorcb(error);
28
+ this.notify(VariableEvents.AFTER_INVOKE, [this, error]);
25
29
  });
26
30
  }
27
31
  }
@@ -1 +1 @@
1
- {"version":3,"names":["BaseAction","get","LoginAction","constructor","config","invoke","options","successcb","errorcb","params","paramProvider","securityService","appLogin","baseURL","formData","useDefaultSuccessHandler","then","data","onSuccess","navigateToLandingPage","catch","error","onError"],"sources":["login-action.ts"],"sourcesContent":["import { ActionConfig, BaseAction } from \"./base-action\";\nimport { SecurityService } from \"@wavemaker/app-rn-runtime/core/security.service\";\nimport { get } from 'lodash';\nexport interface LoginActionConfig extends ActionConfig {\n securityService: () => SecurityService;\n baseURL: String;\n useDefaultSuccessHandler: boolean;\n}\nexport class LoginAction extends BaseAction<LoginActionConfig> {\n constructor(config: LoginActionConfig) {\n super(config);\n }\n\n invoke(options: any, successcb?: Function, errorcb?: Function) {\n let params;\n if (!get(options, 'formData')) {\n params = this.config.paramProvider();\n }\n return this.config.securityService().appLogin(\n {\n baseURL: this.config.baseURL,\n formData: get(options, 'formData') || params,\n useDefaultSuccessHandler: this.config.useDefaultSuccessHandler\n })\n .then((data: any) => {\n this.config.onSuccess && this.config.onSuccess(this, get(data, 'userInfo'));\n successcb && successcb(data);\n if (this.config.useDefaultSuccessHandler) {\n this.config.securityService().navigateToLandingPage(data);\n }\n })\n .catch((error: any) => {\n this.config.onError && this.config.onError(this, error);\n errorcb && errorcb(error);\n });\n }\n}\n"],"mappings":"AAAA,SAAuBA,UAAU,QAAQ,eAAe;AAExD,SAASC,GAAG,QAAQ,QAAQ;AAM5B,OAAO,MAAMC,WAAW,SAASF,UAAU,CAAoB;EAC3DG,WAAWA,CAACC,MAAyB,EAAE;IACnC,KAAK,CAACA,MAAM,CAAC;EACjB;EAEAC,MAAMA,CAACC,OAAY,EAAEC,SAAoB,EAAEC,OAAkB,EAAE;IAC7D,IAAIC,MAAM;IACV,IAAI,CAACR,GAAG,CAACK,OAAO,EAAE,UAAU,CAAC,EAAE;MAC7BG,MAAM,GAAG,IAAI,CAACL,MAAM,CAACM,aAAa,CAAC,CAAC;IACtC;IACA,OAAO,IAAI,CAACN,MAAM,CAACO,eAAe,CAAC,CAAC,CAACC,QAAQ,CAC3C;MACEC,OAAO,EAAE,IAAI,CAACT,MAAM,CAACS,OAAO;MAC5BC,QAAQ,EAAEb,GAAG,CAACK,OAAO,EAAE,UAAU,CAAC,IAAIG,MAAM;MAC5CM,wBAAwB,EAAE,IAAI,CAACX,MAAM,CAACW;IAC1C,CAAC,CAAC,CACCC,IAAI,CAAEC,IAAS,IAAK;MACjB,IAAI,CAACb,MAAM,CAACc,SAAS,IAAI,IAAI,CAACd,MAAM,CAACc,SAAS,CAAC,IAAI,EAAEjB,GAAG,CAACgB,IAAI,EAAE,UAAU,CAAC,CAAC;MAC3EV,SAAS,IAAIA,SAAS,CAACU,IAAI,CAAC;MAC5B,IAAI,IAAI,CAACb,MAAM,CAACW,wBAAwB,EAAE;QACxC,IAAI,CAACX,MAAM,CAACO,eAAe,CAAC,CAAC,CAACQ,qBAAqB,CAACF,IAAI,CAAC;MAC3D;IACJ,CAAC,CAAC,CACDG,KAAK,CAAEC,KAAU,IAAK;MACnB,IAAI,CAACjB,MAAM,CAACkB,OAAO,IAAI,IAAI,CAAClB,MAAM,CAACkB,OAAO,CAAC,IAAI,EAAED,KAAK,CAAC;MACvDb,OAAO,IAAIA,OAAO,CAACa,KAAK,CAAC;IAC7B,CAAC,CAAC;EACN;AACJ"}
1
+ {"version":3,"names":["BaseAction","VariableEvents","get","LoginAction","constructor","config","invoke","options","successcb","errorcb","params","paramProvider","notify","BEFORE_INVOKE","securityService","appLogin","baseURL","formData","useDefaultSuccessHandler","then","data","onSuccess","AFTER_INVOKE","navigateToLandingPage","catch","error","onError"],"sources":["login-action.ts"],"sourcesContent":["import { ActionConfig, BaseAction } from \"./base-action\";\nimport { VariableEvents } from '../variables/base-variable';\nimport { SecurityService } from \"@wavemaker/app-rn-runtime/core/security.service\";\nimport { get } from 'lodash';\nexport interface LoginActionConfig extends ActionConfig {\n securityService: () => SecurityService;\n baseURL: String;\n useDefaultSuccessHandler: boolean;\n}\nexport class LoginAction extends BaseAction<LoginActionConfig> {\n constructor(config: LoginActionConfig) {\n super(config);\n }\n\n invoke(options: any, successcb?: Function, errorcb?: Function) {\n let params;\n if (!get(options, 'formData')) {\n params = this.config.paramProvider();\n }\n this.notify(VariableEvents.BEFORE_INVOKE, [this, params]);\n return this.config.securityService().appLogin(\n {\n baseURL: this.config.baseURL,\n formData: get(options, 'formData') || params,\n useDefaultSuccessHandler: this.config.useDefaultSuccessHandler\n })\n .then((data: any) => {\n this.config.onSuccess && this.config.onSuccess(this, get(data, 'userInfo'));\n successcb && successcb(data);\n this.notify(VariableEvents.AFTER_INVOKE, [this, data]);\n if (this.config.useDefaultSuccessHandler) {\n this.config.securityService().navigateToLandingPage(data);\n }\n })\n .catch((error: any) => {\n this.config.onError && this.config.onError(this, error);\n errorcb && errorcb(error);\n this.notify(VariableEvents.AFTER_INVOKE, [this, error]);\n });\n }\n}\n"],"mappings":"AAAA,SAAuBA,UAAU,QAAQ,eAAe;AACxD,SAASC,cAAc,QAAQ,4BAA4B;AAE3D,SAASC,GAAG,QAAQ,QAAQ;AAM5B,OAAO,MAAMC,WAAW,SAASH,UAAU,CAAoB;EAC3DI,WAAWA,CAACC,MAAyB,EAAE;IACnC,KAAK,CAACA,MAAM,CAAC;EACjB;EAEAC,MAAMA,CAACC,OAAY,EAAEC,SAAoB,EAAEC,OAAkB,EAAE;IAC7D,IAAIC,MAAM;IACV,IAAI,CAACR,GAAG,CAACK,OAAO,EAAE,UAAU,CAAC,EAAE;MAC7BG,MAAM,GAAG,IAAI,CAACL,MAAM,CAACM,aAAa,CAAC,CAAC;IACtC;IACA,IAAI,CAACC,MAAM,CAACX,cAAc,CAACY,aAAa,EAAE,CAAC,IAAI,EAAEH,MAAM,CAAC,CAAC;IACzD,OAAO,IAAI,CAACL,MAAM,CAACS,eAAe,CAAC,CAAC,CAACC,QAAQ,CAC3C;MACEC,OAAO,EAAE,IAAI,CAACX,MAAM,CAACW,OAAO;MAC5BC,QAAQ,EAAEf,GAAG,CAACK,OAAO,EAAE,UAAU,CAAC,IAAIG,MAAM;MAC5CQ,wBAAwB,EAAE,IAAI,CAACb,MAAM,CAACa;IAC1C,CAAC,CAAC,CACCC,IAAI,CAAEC,IAAS,IAAK;MACjB,IAAI,CAACf,MAAM,CAACgB,SAAS,IAAI,IAAI,CAAChB,MAAM,CAACgB,SAAS,CAAC,IAAI,EAAEnB,GAAG,CAACkB,IAAI,EAAE,UAAU,CAAC,CAAC;MAC3EZ,SAAS,IAAIA,SAAS,CAACY,IAAI,CAAC;MAC5B,IAAI,CAACR,MAAM,CAACX,cAAc,CAACqB,YAAY,EAAE,CAAC,IAAI,EAAEF,IAAI,CAAC,CAAC;MACtD,IAAI,IAAI,CAACf,MAAM,CAACa,wBAAwB,EAAE;QACxC,IAAI,CAACb,MAAM,CAACS,eAAe,CAAC,CAAC,CAACS,qBAAqB,CAACH,IAAI,CAAC;MAC3D;IACJ,CAAC,CAAC,CACDI,KAAK,CAAEC,KAAU,IAAK;MACnB,IAAI,CAACpB,MAAM,CAACqB,OAAO,IAAI,IAAI,CAACrB,MAAM,CAACqB,OAAO,CAAC,IAAI,EAAED,KAAK,CAAC;MACvDhB,OAAO,IAAIA,OAAO,CAACgB,KAAK,CAAC;MACzB,IAAI,CAACb,MAAM,CAACX,cAAc,CAACqB,YAAY,EAAE,CAAC,IAAI,EAAEG,KAAK,CAAC,CAAC;IAC3D,CAAC,CAAC;EACN;AACJ"}
@@ -1,17 +1,21 @@
1
1
  import { BaseAction } from "./base-action";
2
+ import { VariableEvents } from '../variables/base-variable';
2
3
  export class LogoutAction extends BaseAction {
3
4
  constructor(config) {
4
5
  super(config);
5
6
  }
6
7
  invoke(options, successcb, errorcb) {
8
+ this.notify(VariableEvents.BEFORE_INVOKE, [this]);
7
9
  return this.config.securityService().appLogout({
8
10
  baseURL: this.config.baseURL
9
11
  }).then(data => {
12
+ this.notify(VariableEvents.AFTER_INVOKE, [this, data]);
10
13
  this.config.onSuccess && this.config.onSuccess(this, data);
11
14
  successcb && successcb(data);
12
15
  }).catch(error => {
13
16
  this.config.onError && this.config.onError(this, error);
14
17
  errorcb && errorcb(error);
18
+ this.notify(VariableEvents.AFTER_INVOKE, [this, error]);
15
19
  });
16
20
  }
17
21
  }
@@ -1 +1 @@
1
- {"version":3,"names":["BaseAction","LogoutAction","constructor","config","invoke","options","successcb","errorcb","securityService","appLogout","baseURL","then","data","onSuccess","catch","error","onError"],"sources":["logout-action.ts"],"sourcesContent":["import { ActionConfig, BaseAction } from \"./base-action\";\nimport { SecurityService } from \"@wavemaker/app-rn-runtime/core/security.service\";\nexport interface LogoutActionConfig extends ActionConfig {\n securityService: () => SecurityService;\n baseURL: String;\n}\nexport class LogoutAction extends BaseAction<LogoutActionConfig> {\n constructor(config: LogoutActionConfig) {\n super(config);\n }\n\n invoke(options: any, successcb?: Function, errorcb?: Function) {\n return this.config.securityService().appLogout({baseURL: this.config.baseURL})\n .then((data: any) => {\n this.config.onSuccess && this.config.onSuccess(this, data);\n successcb && successcb(data);\n })\n .catch((error: any) => {\n this.config.onError && this.config.onError(this, error);\n errorcb && errorcb(error);\n });\n }\n}"],"mappings":"AAAA,SAAuBA,UAAU,QAAQ,eAAe;AAMxD,OAAO,MAAMC,YAAY,SAASD,UAAU,CAAqB;EAC7DE,WAAWA,CAACC,MAA0B,EAAE;IACpC,KAAK,CAACA,MAAM,CAAC;EACjB;EAEAC,MAAMA,CAACC,OAAY,EAAEC,SAAoB,EAAEC,OAAkB,EAAE;IAC3D,OAAO,IAAI,CAACJ,MAAM,CAACK,eAAe,CAAC,CAAC,CAACC,SAAS,CAAC;MAACC,OAAO,EAAE,IAAI,CAACP,MAAM,CAACO;IAAO,CAAC,CAAC,CAC7EC,IAAI,CAAEC,IAAS,IAAK;MACjB,IAAI,CAACT,MAAM,CAACU,SAAS,IAAI,IAAI,CAACV,MAAM,CAACU,SAAS,CAAC,IAAI,EAAED,IAAI,CAAC;MAC1DN,SAAS,IAAIA,SAAS,CAACM,IAAI,CAAC;IAChC,CAAC,CAAC,CACDE,KAAK,CAAEC,KAAU,IAAK;MACnB,IAAI,CAACZ,MAAM,CAACa,OAAO,IAAI,IAAI,CAACb,MAAM,CAACa,OAAO,CAAC,IAAI,EAAED,KAAK,CAAC;MACvDR,OAAO,IAAIA,OAAO,CAACQ,KAAK,CAAC;IAC7B,CAAC,CAAC;EACN;AACJ"}
1
+ {"version":3,"names":["BaseAction","VariableEvents","LogoutAction","constructor","config","invoke","options","successcb","errorcb","notify","BEFORE_INVOKE","securityService","appLogout","baseURL","then","data","AFTER_INVOKE","onSuccess","catch","error","onError"],"sources":["logout-action.ts"],"sourcesContent":["import { ActionConfig, BaseAction } from \"./base-action\";\nimport { SecurityService } from \"@wavemaker/app-rn-runtime/core/security.service\";\nimport { VariableEvents } from '../variables/base-variable';\nexport interface LogoutActionConfig extends ActionConfig {\n securityService: () => SecurityService;\n baseURL: String;\n}\nexport class LogoutAction extends BaseAction<LogoutActionConfig> {\n constructor(config: LogoutActionConfig) {\n super(config);\n }\n\n invoke(options: any, successcb?: Function, errorcb?: Function) {\n this.notify(VariableEvents.BEFORE_INVOKE, [this]);\n return this.config.securityService().appLogout({baseURL: this.config.baseURL})\n .then((data: any) => {\n this.notify(VariableEvents.AFTER_INVOKE, [this, data]);\n this.config.onSuccess && this.config.onSuccess(this, data);\n successcb && successcb(data); \n })\n .catch((error: any) => {\n this.config.onError && this.config.onError(this, error);\n errorcb && errorcb(error);\n this.notify(VariableEvents.AFTER_INVOKE, [this, error]);\n });\n }\n}"],"mappings":"AAAA,SAAuBA,UAAU,QAAQ,eAAe;AAExD,SAASC,cAAc,QAAQ,4BAA4B;AAK3D,OAAO,MAAMC,YAAY,SAASF,UAAU,CAAqB;EAC7DG,WAAWA,CAACC,MAA0B,EAAE;IACpC,KAAK,CAACA,MAAM,CAAC;EACjB;EAEAC,MAAMA,CAACC,OAAY,EAAEC,SAAoB,EAAEC,OAAkB,EAAE;IAC3D,IAAI,CAACC,MAAM,CAACR,cAAc,CAACS,aAAa,EAAE,CAAC,IAAI,CAAC,CAAC;IACjD,OAAO,IAAI,CAACN,MAAM,CAACO,eAAe,CAAC,CAAC,CAACC,SAAS,CAAC;MAACC,OAAO,EAAE,IAAI,CAACT,MAAM,CAACS;IAAO,CAAC,CAAC,CAC7EC,IAAI,CAAEC,IAAS,IAAK;MACjB,IAAI,CAACN,MAAM,CAACR,cAAc,CAACe,YAAY,EAAE,CAAC,IAAI,EAAED,IAAI,CAAC,CAAC;MACtD,IAAI,CAACX,MAAM,CAACa,SAAS,IAAI,IAAI,CAACb,MAAM,CAACa,SAAS,CAAC,IAAI,EAAEF,IAAI,CAAC;MAC1DR,SAAS,IAAIA,SAAS,CAACQ,IAAI,CAAC;IAChC,CAAC,CAAC,CACDG,KAAK,CAAEC,KAAU,IAAK;MACnB,IAAI,CAACf,MAAM,CAACgB,OAAO,IAAI,IAAI,CAAChB,MAAM,CAACgB,OAAO,CAAC,IAAI,EAAED,KAAK,CAAC;MACvDX,OAAO,IAAIA,OAAO,CAACW,KAAK,CAAC;MACzB,IAAI,CAACV,MAAM,CAACR,cAAc,CAACe,YAAY,EAAE,CAAC,IAAI,EAAEG,KAAK,CAAC,CAAC;IAC3D,CAAC,CAAC;EACN;AACJ"}
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wavemaker/app-rn-runtime",
3
- "version": "11.5.0-next.26225",
3
+ "version": "11.5.0-next.26226",
4
4
  "description": "''",
5
5
  "main": "index",
6
6
  "module": "index",
@@ -49,7 +49,7 @@
49
49
  "@react-navigation/native": "6.1.7",
50
50
  "@react-navigation/stack": "^6.3.7",
51
51
  "@types/lodash-es": "^4.17.6",
52
- "@wavemaker/variables": "11.5.0-next.26225",
52
+ "@wavemaker/variables": "11.5.0-next.26226",
53
53
  "axios": "^1.4.0",
54
54
  "color": "4.2.3",
55
55
  "cross-env": "^5.2.0",
@@ -128,7 +128,7 @@
128
128
  "typescript": "^5.1.3",
129
129
  "victory-native": "36.6.11",
130
130
  "yargs": "^16.2.0",
131
- "@wavemaker/variables": "11.5.0-next.26225"
131
+ "@wavemaker/variables": "11.5.0-next.26226"
132
132
  },
133
133
  "jest": {
134
134
  "preset": "react-native",