ia-common 1.0.1-beta.2 → 1.0.1-beta.4
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/@utils.d.ts +2 -0
- package/build/@utils.js +18 -0
- package/build/interface/api/create-registration.interface.d.ts +2 -2
- package/build/interface/key-value.interface.d.ts +3 -0
- package/build/interface/key-value.interface.js +2 -0
- package/build/utils/string-to-date-conversion-methods.d.ts +19 -0
- package/build/utils/string-to-date-conversion-methods.js +48 -0
- package/package.json +1 -1
package/build/@utils.js
ADDED
|
@@ -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);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { RegistrationStatus } from "../../@enum";
|
|
2
2
|
import { IModifyEntity, IWithoutTokenRegistrationEntity } from "../../@type";
|
|
3
3
|
export interface ICreateRegistrationResponse extends IModifyEntity<IWithoutTokenRegistrationEntity> {
|
|
4
4
|
}
|
|
@@ -6,6 +6,6 @@ export interface ICreateRegistrationRequest {
|
|
|
6
6
|
name: string;
|
|
7
7
|
contact: string;
|
|
8
8
|
email: string;
|
|
9
|
-
status:
|
|
9
|
+
status: RegistrationStatus;
|
|
10
10
|
comments?: string;
|
|
11
11
|
}
|
|
@@ -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;
|