ia-common 1.0.1-beta.1 → 1.0.1-beta.3

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/build/@type.d.ts CHANGED
@@ -1,3 +1,8 @@
1
1
  export * from "./interface/entity";
2
+ export * from "./interface/api";
2
3
  export * from "./interface/controller.interface";
3
4
  export * from "./interface/upload-multer-file.interface";
5
+ export * from "./interface/without-token-registration-entity.interface";
6
+ export * from "./interface/modify-entity.interface";
7
+ export * from "./interface/modify.interface";
8
+ export * from "./interface/update-user-info.interface";
package/build/@type.js CHANGED
@@ -15,5 +15,10 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./interface/entity"), exports);
18
+ __exportStar(require("./interface/api"), exports);
18
19
  __exportStar(require("./interface/controller.interface"), exports);
19
20
  __exportStar(require("./interface/upload-multer-file.interface"), exports);
21
+ __exportStar(require("./interface/without-token-registration-entity.interface"), exports);
22
+ __exportStar(require("./interface/modify-entity.interface"), exports);
23
+ __exportStar(require("./interface/modify.interface"), exports);
24
+ __exportStar(require("./interface/update-user-info.interface"), exports);
@@ -0,0 +1,2 @@
1
+ export * from "./utils/string-to-date-conversion-methods";
2
+ export * from "./utils/string-utils";
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./utils/string-to-date-conversion-methods"), exports);
18
+ __exportStar(require("./utils/string-utils"), exports);
@@ -0,0 +1,11 @@
1
+ import { OrganizationStatus } from "../../@enum";
2
+ import { IModifyEntity, IWithoutTokenRegistrationEntity } from "../../@type";
3
+ export interface ICreateRegistrationResponse extends IModifyEntity<IWithoutTokenRegistrationEntity> {
4
+ }
5
+ export interface ICreateRegistrationRequest {
6
+ name: string;
7
+ contact: string;
8
+ email: string;
9
+ status: OrganizationStatus;
10
+ comments?: string;
11
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,3 @@
1
+ export * from "./update-organization.interface";
2
+ export * from "./create-registration.interface";
3
+ export * from "./update-organization.interface";
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./update-organization.interface"), exports);
18
+ __exportStar(require("./create-registration.interface"), exports);
19
+ __exportStar(require("./update-organization.interface"), exports);
@@ -0,0 +1,22 @@
1
+ export interface ILoginResponse {
2
+ UIMessage: string;
3
+ tokenType: string;
4
+ accessToken: string;
5
+ id: string;
6
+ firstname: string;
7
+ status: string;
8
+ requireNewPassword: boolean;
9
+ userId: number;
10
+ role: string;
11
+ email: string | null;
12
+ imageUrl: string | null;
13
+ userPermissions: string[];
14
+ registrationId: number;
15
+ organizationId: number;
16
+ subscriptionStatus: string | null;
17
+ contact: string;
18
+ }
19
+ export interface ILoginRequest {
20
+ username: string;
21
+ password: string;
22
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,20 @@
1
+ import { OrganizationStatus } from "../../@enum";
2
+ import { IOrganizationEntity, IUserInfo, Modify } from "../../@type";
3
+ export interface IUpdateOrganizationResponse extends Modify<IOrganizationEntity, {
4
+ createdOn: string;
5
+ updatedOn: string;
6
+ }> {
7
+ imageUrl?: string;
8
+ owners?: IUserInfo[];
9
+ }
10
+ export interface IUpdateOrganizationRequest {
11
+ name?: string;
12
+ owners?: IUserInfo[];
13
+ email?: string;
14
+ phone?: number;
15
+ type?: string;
16
+ pan?: string;
17
+ gst?: string;
18
+ deed?: string;
19
+ status?: OrganizationStatus;
20
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,3 @@
1
+ export interface IKeyValue<T> {
2
+ [key: string]: T;
3
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,5 @@
1
+ import { Modify } from "../@type";
2
+ export type IModifyEntity<T> = Modify<T, {
3
+ createdOn: string;
4
+ updatedOn: string;
5
+ }>;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1 @@
1
+ export type Modify<T, R> = Omit<T, keyof R> & R;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,16 @@
1
+ import { UserStatus } from "../@enum";
2
+ import { IUploadedMulterFile } from "./upload-multer-file.interface";
3
+ export interface IUserInfo {
4
+ id?: number;
5
+ name?: string;
6
+ email?: string;
7
+ phone?: number;
8
+ operation?: string;
9
+ password?: string;
10
+ status?: UserStatus;
11
+ isEmailVerified?: boolean;
12
+ isMobileVerified?: boolean;
13
+ isAccountVerified?: boolean;
14
+ requiredNewPassword?: boolean;
15
+ image?: IUploadedMulterFile | string;
16
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,3 @@
1
+ import { IRegistrationEntity } from "../@type";
2
+ export interface IWithoutTokenRegistrationEntity extends Omit<IRegistrationEntity, "token"> {
3
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,19 @@
1
+ import { IModifyEntity, Modify } from "../@type";
2
+ import { IKeyValue } from "../interface/key-value.interface";
3
+ export declare function ConvertCommonEntries<T extends {
4
+ createdOn: Date;
5
+ updatedOn: Date;
6
+ }>(inputObject: {
7
+ [key: string]: T;
8
+ }): IKeyValue<IModifyEntity<T>>;
9
+ export declare function ConvertToCommonEntities<T extends {
10
+ createdOn: Date;
11
+ updatedOn: Date;
12
+ }>(inputObject: T[]): IModifyEntity<T>[];
13
+ export declare function ConvertToCommonEntity<T extends {
14
+ createdOn: Date;
15
+ updatedOn: Date;
16
+ }, R extends Modify<T, {
17
+ createdOn: string;
18
+ updatedOn: string;
19
+ }>>(obj: T): R;
@@ -0,0 +1,48 @@
1
+ "use strict";
2
+ var __assign = (this && this.__assign) || function () {
3
+ __assign = Object.assign || function(t) {
4
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
5
+ s = arguments[i];
6
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
+ t[p] = s[p];
8
+ }
9
+ return t;
10
+ };
11
+ return __assign.apply(this, arguments);
12
+ };
13
+ var __rest = (this && this.__rest) || function (s, e) {
14
+ var t = {};
15
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
16
+ t[p] = s[p];
17
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
18
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
19
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
20
+ t[p[i]] = s[p[i]];
21
+ }
22
+ return t;
23
+ };
24
+ Object.defineProperty(exports, "__esModule", { value: true });
25
+ exports.ConvertToCommonEntity = exports.ConvertToCommonEntities = exports.ConvertCommonEntries = void 0;
26
+ //key - value converter
27
+ function ConvertCommonEntries(inputObject) {
28
+ return Object.entries(inputObject).reduce(function (acc, _a) {
29
+ var key = _a[0], value = _a[1];
30
+ acc[key] = ConvertToCommonEntity(value);
31
+ return acc;
32
+ }, {});
33
+ }
34
+ exports.ConvertCommonEntries = ConvertCommonEntries;
35
+ function ConvertToCommonEntities(inputObject) {
36
+ return inputObject.reduce(function (acc, value) {
37
+ var modifiedEntity = ConvertToCommonEntity(value);
38
+ acc.push(modifiedEntity);
39
+ return acc;
40
+ }, []);
41
+ }
42
+ exports.ConvertToCommonEntities = ConvertToCommonEntities;
43
+ function ConvertToCommonEntity(obj) {
44
+ var _a, _b;
45
+ var _ = obj.createdOn, __ = obj.updatedOn, objectToAssign = __rest(obj, ["createdOn", "updatedOn"]);
46
+ return __assign({ createdOn: (_a = obj.createdOn) === null || _a === void 0 ? void 0 : _a.toISOString(), updatedOn: (_b = obj.updatedOn) === null || _b === void 0 ? void 0 : _b.toISOString() }, objectToAssign);
47
+ }
48
+ exports.ConvertToCommonEntity = ConvertToCommonEntity;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ia-common",
3
- "version": "1.0.1-beta.1",
3
+ "version": "1.0.1-beta.3",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",