eservices-core 1.0.343 → 1.0.344

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -93,8 +93,9 @@ import WidgetSection from "./widgets/section/widget-section.vue";
93
93
  import WidgetTableController from "./widgets/tables/table-with-form/widget-table-controller.vue";
94
94
  import WidgetSpinner from "./widgets/spinner/WidgetSpinner.vue";
95
95
  import WidgetTable from './widgets/tables/table-with-form/widget-table.vue';
96
+ import WidgetForm from "./widgets/forms/naomi/WidgetForm.vue";
96
97
  import ModalValidation from "./widgets/modals/modal-validation/modal-validation.vue";
97
- export { ModalValidation, WidgetTable, WidgetTableController, WidgetSpinner, WidgetBreadcrumbs, WidgetCommunication, WidgetList, WidgetSection };
98
+ export { WidgetForm, ModalValidation, WidgetTable, WidgetTableController, WidgetSpinner, WidgetBreadcrumbs, WidgetCommunication, WidgetList, WidgetSection };
98
99
  import valuesToUpperCase from "./utils/values-to-upper-case";
99
100
  declare const utils: {
100
101
  valuesToUpperCase: typeof valuesToUpperCase;
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * eservices-core v1.0.343
2
+ * eservices-core v1.0.344
3
3
  * (c) 2022 ESERVICES
4
4
  */
5
5
  'use strict';
@@ -4714,6 +4714,9 @@ class authService {
4714
4714
  })
4715
4715
  .catch(authService.parseError);
4716
4716
  }
4717
+ /**
4718
+ * @deprecated
4719
+ * */
4717
4720
  static registration(values) {
4718
4721
  values.AppName = configuration.applicationName;
4719
4722
  return Request(configuration.identityServerURL + "/api/Authenticate/Registration", {
@@ -4726,6 +4729,41 @@ class authService {
4726
4729
  })
4727
4730
  .catch(authService.parseError);
4728
4731
  }
4732
+ static parseProcessAnswer(answer) {
4733
+ const wrongStatus = ['PhoneCodeIncorrect', 'EmailCodeIncorrect'];
4734
+ const status = answer.statusName;
4735
+ if (wrongStatus.includes(status))
4736
+ throw CoreError.UndefinedError(status);
4737
+ return answer;
4738
+ }
4739
+ static startRegistrationProcess(values) {
4740
+ return authService.requestStepRegistrationProcess('StartRegistration', values);
4741
+ }
4742
+ static confirmPhoneRegistrationProcess(values) {
4743
+ return authService.requestStepRegistrationProcess('ConfirmPhoneNumberByRegistration', values);
4744
+ }
4745
+ static confirmEmailRegistrationProcess(values) {
4746
+ return authService.requestStepRegistrationProcess('ConfirmEmailByRegistration', values);
4747
+ }
4748
+ static finishEmailRegistrationProcess(values) {
4749
+ return authService.requestStepRegistrationProcess('FinishRegistration', values);
4750
+ }
4751
+ /**
4752
+ * @description Steps of registration process are the same. Current method provide one requestInterface for all
4753
+ * steps.
4754
+ * */
4755
+ static requestStepRegistrationProcess(name, values) {
4756
+ return Request(`${configuration.identityServerURL}api/Authenticate/${name}`, {
4757
+ method: 'POST',
4758
+ headers: {
4759
+ 'Content-Type': 'application/json',
4760
+ },
4761
+ credentials: 'include',
4762
+ body: JSON.stringify(values)
4763
+ })
4764
+ .catch(authService.parseError)
4765
+ .then(authService.parseProcessAnswer);
4766
+ }
4729
4767
  }
4730
4768
 
4731
4769
  class ActionService {
@@ -6002,6 +6040,7 @@ exports.ProcessWrap = ProcessWrap;
6002
6040
  exports.Table = Table;
6003
6041
  exports.WidgetBreadcrumbs = script$a;
6004
6042
  exports.WidgetCommunication = script$4;
6043
+ exports.WidgetForm = script$I;
6005
6044
  exports.WidgetList = script$y;
6006
6045
  exports.WidgetSection = script$3;
6007
6046
  exports.WidgetSpinner = script$K;
@@ -15,6 +15,29 @@ interface ResponseInterface {
15
15
  export default class authService {
16
16
  static parseError(data: ResponseInterface): void;
17
17
  static login(values: LoginValues): Promise<any>;
18
+ /**
19
+ * @deprecated
20
+ * */
18
21
  static registration(values: any): Promise<any>;
22
+ static parseProcessAnswer(answer: IRegistrationAnswer): IRegistrationAnswer;
23
+ static startRegistrationProcess(values: any): Promise<IRegistrationAnswer>;
24
+ static confirmPhoneRegistrationProcess(values: any): Promise<IRegistrationAnswer>;
25
+ static confirmEmailRegistrationProcess(values: any): Promise<IRegistrationAnswer>;
26
+ static finishEmailRegistrationProcess(values: any): Promise<IRegistrationAnswer>;
27
+ /**
28
+ * @description Steps of registration process are the same. Current method provide one requestInterface for all
29
+ * steps.
30
+ * */
31
+ static requestStepRegistrationProcess(name: string, values: any): Promise<IRegistrationAnswer>;
19
32
  }
33
+ interface IRegistrationAnswer {
34
+ appName: string;
35
+ maskedAddress: string;
36
+ otpCodeAttempts: number;
37
+ otpPrefix: string;
38
+ statusCode: number;
39
+ statusName: statusName;
40
+ token: string;
41
+ }
42
+ declare type statusName = 'EmailCodeRequired' | 'PhoneCodeRequired' | 'FinishRequired' | 'Registred' | 'EmailIncorrect' | 'PhoneIncorrect' | 'EmailCodeIncorrect' | 'PhoneCodeIncorrect' | 'EmailCodeExpired' | 'PhoneCodeExpired' | 'PasswordIncorrect' | 'TokenIncorrect' | 'ApplicationNotSupported';
20
43
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eservices-core",
3
- "version": "1.0.343",
3
+ "version": "1.0.344",
4
4
  "description": "----",
5
5
  "author": "",
6
6
  "scripts": {