oneentry 1.0.69 → 1.0.71

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,5 +1,5 @@
1
1
  import AsyncModules from "../base/asyncModules";
2
- import { ITemplatesPreview, ITemplatesPreviewEntity } from "./templatesPreviewInterfaces";
2
+ import { ITemplatesPreview, ITemplatesPreviewEntity, ITemplatePreviewEntity } from "./templatesPreviewInterfaces";
3
3
  import StateModule from "../base/stateModule";
4
4
  /**
5
5
  * Controllers for working with template objects for preview
@@ -23,7 +23,7 @@ export default class TemplatePreviewsApi extends AsyncModules implements ITempla
23
23
  *
24
24
  * @returns Returns a TemplatePreviewsEntity object
25
25
  */
26
- getTemplatePreviewById(id: number, langCode?: string): Promise<ITemplatesPreviewEntity>;
26
+ getTemplatePreviewById(id: number, langCode?: string): Promise<ITemplatePreviewEntity>;
27
27
  /**
28
28
  * Get one template object by marker.
29
29
  *
@@ -32,5 +32,5 @@ export default class TemplatePreviewsApi extends AsyncModules implements ITempla
32
32
  *
33
33
  * @returns Returns a TemplatePreviewsEntity object
34
34
  */
35
- getTemplatePreviewByMarker(marker: string, langCode?: string): Promise<ITemplatesPreviewEntity>;
35
+ getTemplatePreviewByMarker(marker: string, langCode?: string): Promise<ITemplatePreviewEntity>;
36
36
  }
@@ -9,8 +9,8 @@
9
9
  */
10
10
  interface ITemplatesPreview {
11
11
  getTemplatePreviews(langCode: string): Promise<Array<ITemplatesPreviewEntity>>;
12
- getTemplatePreviewById(id: number, langCode: string): Promise<ITemplatesPreviewEntity>;
13
- getTemplatePreviewByMarker(marker: string, langCode: string): Promise<ITemplatesPreviewEntity>;
12
+ getTemplatePreviewById(id: number, langCode: string): Promise<ITemplatePreviewEntity>;
13
+ getTemplatePreviewByMarker(marker: string, langCode: string): Promise<ITemplatePreviewEntity>;
14
14
  }
15
15
  /**
16
16
  * Represents a template preview entity object.
@@ -37,17 +37,40 @@ interface ITemplatesPreviewEntity {
37
37
  title: string;
38
38
  position: number;
39
39
  }
40
+ /**
41
+ * Represents a template preview entity object.
42
+ *
43
+ * @interface
44
+ * @property {number} id - The unique identifier of the position.
45
+ * @property {Date | string} updatedDate - The date of last updated.
46
+ * @property {string} identifier - The textual identifier for the record field.
47
+ * @property {object} proportion - Object contains info by proportion template preview.
48
+ * @property {Record<string, any>} localizeInfos - The name of the template, taking into account localization.
49
+ * @property {number} position - The position of the object.
50
+ *
51
+ */
52
+ interface ITemplatePreviewEntity {
53
+ id: number;
54
+ updatedDate: string | Date;
55
+ version: number;
56
+ identifier: string;
57
+ proportion: {
58
+ horizontal: IProportion | null;
59
+ vertical: IProportion | null;
60
+ square: ISquare;
61
+ };
62
+ title: string;
63
+ position: number;
64
+ }
40
65
  interface IProportion {
41
66
  height: number | null;
42
67
  weight: number | null;
43
68
  marker: string;
44
- title: string;
45
69
  alignmentType: string;
46
70
  }
47
71
  interface ISquare {
48
72
  marker: string;
49
- title: string;
50
73
  slide: number;
51
74
  alignmentType: string;
52
75
  }
53
- export { ITemplatesPreview, ITemplatesPreviewEntity, ISquare, IProportion, };
76
+ export { ITemplatesPreview, ITemplatesPreviewEntity, ISquare, IProportion, ITemplatePreviewEntity };
@@ -39,5 +39,5 @@ export default class UsersApi extends AsyncModules implements IUsers {
39
39
  * }
40
40
  * }
41
41
  */
42
- updateUser(data: IUserBody, langCode?: string): Promise<any>;
42
+ updateUser(data: IUserBody, langCode?: string): Promise<boolean>;
43
43
  }
@@ -44,7 +44,9 @@ class UsersApi extends asyncModules_1.default {
44
44
  * }
45
45
  */
46
46
  async updateUser(data, langCode = this.state.lang) {
47
- const result = await this._fetchPut('', this._normalizePostBody(data));
47
+ if (!('langCode' in data))
48
+ data['langCode'] = langCode;
49
+ const result = await this._fetchPut('/me', this._normalizePostBody(data, langCode));
48
50
  return result;
49
51
  }
50
52
  }
@@ -7,7 +7,7 @@ import { IAuthFormData } from "../auth-provider/authProvidersInterfaces";
7
7
  */
8
8
  interface IUsers {
9
9
  getUser(langCode?: string): Promise<IUserEntity>;
10
- updateUser(data: IUserBody, langCode?: string): Promise<any>;
10
+ updateUser(data: IUserBody, langCode?: string): Promise<boolean>;
11
11
  }
12
12
  interface IUserEntity {
13
13
  id: number;
@@ -18,13 +18,16 @@ interface IUserEntity {
18
18
  }
19
19
  interface IUserBody {
20
20
  formIdentifier: string;
21
+ langCode?: string;
21
22
  authData: Array<{
22
- marker: 'login' | 'password';
23
+ marker: string;
23
24
  value: string;
24
25
  }>;
25
26
  formData: IAuthFormData | Array<IAuthFormData>;
26
27
  notificationData: {
27
- [key: string]: string;
28
+ email: string;
29
+ phonePush: string;
30
+ phoneSMS: string;
28
31
  };
29
32
  }
30
33
  export { IUsers, IUserEntity, IUserBody, };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oneentry",
3
- "version": "1.0.69",
3
+ "version": "1.0.71",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -13,7 +13,7 @@
13
13
  "bin": {
14
14
  "oneentry": "./configure.js"
15
15
  },
16
- "author": "ONEENTRY PORTAL CO.",
16
+ "author": "ONEENTRY ",
17
17
  "license": "ISC",
18
18
  "dependencies": {
19
19
  "jsdoc": "^4.0.2"