@smartsoft001/trans-shell-dtos-services 2.147.0 → 2.149.0
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/package.json +10 -3
- package/src/index.js +5 -0
- package/src/index.js.map +1 -0
- package/src/lib/trans-create.dto.js +52 -0
- package/src/lib/trans-create.dto.js.map +1 -0
- package/test-setup.js +2 -0
- package/test-setup.js.map +1 -0
- package/index.js +0 -213
package/package.json
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@smartsoft001/trans-shell-dtos-services",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.149.0",
|
|
4
|
+
"type": "commonjs",
|
|
5
|
+
"main": "./src/index.js",
|
|
6
|
+
"typings": "./src/index.d.ts",
|
|
7
|
+
"description": "TransCreateDto: the decorated request model for creating a payment transaction.",
|
|
4
8
|
"publishConfig": {
|
|
5
9
|
"access": "public"
|
|
6
10
|
},
|
|
7
|
-
"description": "This library was generated with [Nx](https://nx.dev).",
|
|
8
11
|
"repository": {
|
|
9
12
|
"type": "git",
|
|
10
13
|
"url": "git+https://github.com/emiljuchnikowski/smartsoft.git"
|
|
@@ -14,5 +17,9 @@
|
|
|
14
17
|
"bugs": {
|
|
15
18
|
"url": "https://github.com/emiljuchnikowski/smartsoft/issues"
|
|
16
19
|
},
|
|
17
|
-
"homepage": "https://github.com/emiljuchnikowski/smartsoft#readme"
|
|
20
|
+
"homepage": "https://github.com/emiljuchnikowski/smartsoft#readme",
|
|
21
|
+
"peerDependencies": {
|
|
22
|
+
"@smartsoft001/models": "2.149.0"
|
|
23
|
+
},
|
|
24
|
+
"types": "./src/index.d.ts"
|
|
18
25
|
}
|
package/src/index.js
ADDED
package/src/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/trans/shell/dtos/src/index.ts"],"names":[],"mappings":";;;AAAA,iEAAuC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TransCreateDto = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const models_1 = require("@smartsoft001/models");
|
|
6
|
+
let TransCreateDto = class TransCreateDto {
|
|
7
|
+
amount;
|
|
8
|
+
system;
|
|
9
|
+
data;
|
|
10
|
+
name;
|
|
11
|
+
firstName;
|
|
12
|
+
lastName;
|
|
13
|
+
email;
|
|
14
|
+
contactPhone;
|
|
15
|
+
};
|
|
16
|
+
exports.TransCreateDto = TransCreateDto;
|
|
17
|
+
tslib_1.__decorate([
|
|
18
|
+
(0, models_1.Field)({ required: true, type: models_1.FieldType.currency }),
|
|
19
|
+
tslib_1.__metadata("design:type", Number)
|
|
20
|
+
], TransCreateDto.prototype, "amount", void 0);
|
|
21
|
+
tslib_1.__decorate([
|
|
22
|
+
(0, models_1.Field)({ required: true, type: models_1.FieldType.text }),
|
|
23
|
+
tslib_1.__metadata("design:type", String)
|
|
24
|
+
], TransCreateDto.prototype, "system", void 0);
|
|
25
|
+
tslib_1.__decorate([
|
|
26
|
+
(0, models_1.Field)({ required: true }),
|
|
27
|
+
tslib_1.__metadata("design:type", Object)
|
|
28
|
+
], TransCreateDto.prototype, "data", void 0);
|
|
29
|
+
tslib_1.__decorate([
|
|
30
|
+
(0, models_1.Field)({ required: true, type: models_1.FieldType.text }),
|
|
31
|
+
tslib_1.__metadata("design:type", String)
|
|
32
|
+
], TransCreateDto.prototype, "name", void 0);
|
|
33
|
+
tslib_1.__decorate([
|
|
34
|
+
(0, models_1.Field)({ type: models_1.FieldType.text }),
|
|
35
|
+
tslib_1.__metadata("design:type", String)
|
|
36
|
+
], TransCreateDto.prototype, "firstName", void 0);
|
|
37
|
+
tslib_1.__decorate([
|
|
38
|
+
(0, models_1.Field)({ type: models_1.FieldType.text }),
|
|
39
|
+
tslib_1.__metadata("design:type", String)
|
|
40
|
+
], TransCreateDto.prototype, "lastName", void 0);
|
|
41
|
+
tslib_1.__decorate([
|
|
42
|
+
(0, models_1.Field)({ type: models_1.FieldType.email }),
|
|
43
|
+
tslib_1.__metadata("design:type", String)
|
|
44
|
+
], TransCreateDto.prototype, "email", void 0);
|
|
45
|
+
tslib_1.__decorate([
|
|
46
|
+
(0, models_1.Field)({ type: models_1.FieldType.text }),
|
|
47
|
+
tslib_1.__metadata("design:type", String)
|
|
48
|
+
], TransCreateDto.prototype, "contactPhone", void 0);
|
|
49
|
+
exports.TransCreateDto = TransCreateDto = tslib_1.__decorate([
|
|
50
|
+
(0, models_1.Model)({})
|
|
51
|
+
], TransCreateDto);
|
|
52
|
+
//# sourceMappingURL=trans-create.dto.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trans-create.dto.js","sourceRoot":"","sources":["../../../../../../../packages/trans/shell/dtos/src/lib/trans-create.dto.ts"],"names":[],"mappings":";;;;AAAA,iDAA+D;AAGxD,IAAM,cAAc,GAApB,MAAM,cAAc;IAC4B,MAAM,CAAS;IACnB,MAAM,CAAS;IACrC,IAAI,CAAI;IACc,IAAI,CAAS;IAC7B,SAAS,CAAS;IAClB,QAAQ,CAAS;IAChB,KAAK,CAAS;IACf,YAAY,CAAS;CACvD,CAAA;AATY,wCAAc;AAC4B;IAApD,IAAA,cAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,kBAAS,CAAC,QAAQ,EAAE,CAAC;;8CAAgB;AACnB;IAAhD,IAAA,cAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,kBAAS,CAAC,IAAI,EAAE,CAAC;;8CAAgB;AACrC;IAA1B,IAAA,cAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;4CAAS;AACc;IAAhD,IAAA,cAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,kBAAS,CAAC,IAAI,EAAE,CAAC;;4CAAc;AAC7B;IAAhC,IAAA,cAAK,EAAC,EAAE,IAAI,EAAE,kBAAS,CAAC,IAAI,EAAE,CAAC;;iDAAmB;AAClB;IAAhC,IAAA,cAAK,EAAC,EAAE,IAAI,EAAE,kBAAS,CAAC,IAAI,EAAE,CAAC;;gDAAkB;AAChB;IAAjC,IAAA,cAAK,EAAC,EAAE,IAAI,EAAE,kBAAS,CAAC,KAAK,EAAE,CAAC;;6CAAe;AACf;IAAhC,IAAA,cAAK,EAAC,EAAE,IAAI,EAAE,kBAAS,CAAC,IAAI,EAAE,CAAC;;oDAAsB;yBAR3C,cAAc;IAD1B,IAAA,cAAK,EAAC,EAAE,CAAC;GACG,cAAc,CAS1B"}
|
package/test-setup.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"test-setup.js","sourceRoot":"","sources":["../../../../../packages/trans/shell/dtos/test-setup.ts"],"names":[],"mappings":""}
|
package/index.js
DELETED
|
@@ -1,213 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __decorateClass = (decorators, target, key, kind) => {
|
|
4
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
5
|
-
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
6
|
-
if (decorator = decorators[i])
|
|
7
|
-
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
8
|
-
if (kind && result) __defProp(target, key, result);
|
|
9
|
-
return result;
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
// packages/shared/models/src/lib/symbols.ts
|
|
13
|
-
var SYMBOL_MODEL = /* @__PURE__ */ Symbol.for("smartsoft:model");
|
|
14
|
-
var SYMBOL_FIELD = /* @__PURE__ */ Symbol.for("smartsoft:field");
|
|
15
|
-
|
|
16
|
-
// packages/shared/models/src/lib/interfaces.ts
|
|
17
|
-
var FieldTypeDef = /* @__PURE__ */ ((FieldTypeDef2) => {
|
|
18
|
-
FieldTypeDef2["address"] = "address";
|
|
19
|
-
FieldTypeDef2["currency"] = "currency";
|
|
20
|
-
FieldTypeDef2["date"] = "date";
|
|
21
|
-
FieldTypeDef2["dateTime"] = "dateTime";
|
|
22
|
-
FieldTypeDef2["dateWithEdit"] = "dateWithEdit";
|
|
23
|
-
FieldTypeDef2["email"] = "email";
|
|
24
|
-
FieldTypeDef2["enum"] = "enum";
|
|
25
|
-
FieldTypeDef2["file"] = "file";
|
|
26
|
-
FieldTypeDef2["flag"] = "flag";
|
|
27
|
-
FieldTypeDef2["int"] = "int";
|
|
28
|
-
FieldTypeDef2["nip"] = "nip";
|
|
29
|
-
FieldTypeDef2["object"] = "object";
|
|
30
|
-
FieldTypeDef2["array"] = "array";
|
|
31
|
-
FieldTypeDef2["password"] = "password";
|
|
32
|
-
FieldTypeDef2["radio"] = "radio";
|
|
33
|
-
FieldTypeDef2["text"] = "text";
|
|
34
|
-
FieldTypeDef2["strings"] = "strings";
|
|
35
|
-
FieldTypeDef2["ints"] = "ints";
|
|
36
|
-
FieldTypeDef2["longText"] = "longText";
|
|
37
|
-
FieldTypeDef2["color"] = "color";
|
|
38
|
-
FieldTypeDef2["logo"] = "logo";
|
|
39
|
-
FieldTypeDef2["check"] = "check";
|
|
40
|
-
FieldTypeDef2["phoneNumber"] = "phoneNumber";
|
|
41
|
-
FieldTypeDef2["phoneNumberPl"] = "phoneNumberPl";
|
|
42
|
-
FieldTypeDef2["pesel"] = "pesel";
|
|
43
|
-
FieldTypeDef2["pdf"] = "pdf";
|
|
44
|
-
FieldTypeDef2["video"] = "video";
|
|
45
|
-
FieldTypeDef2["attachment"] = "attachment";
|
|
46
|
-
FieldTypeDef2["dateRange"] = "dateRange";
|
|
47
|
-
FieldTypeDef2["image"] = "image";
|
|
48
|
-
FieldTypeDef2["float"] = "float";
|
|
49
|
-
return FieldTypeDef2;
|
|
50
|
-
})(FieldTypeDef || {});
|
|
51
|
-
var FieldType = FieldTypeDef;
|
|
52
|
-
|
|
53
|
-
// packages/shared/models/src/lib/decorators/model/model.decorator.ts
|
|
54
|
-
import "reflect-metadata";
|
|
55
|
-
var Model = ModelDecorator;
|
|
56
|
-
function ModelDecorator(options) {
|
|
57
|
-
return function(target) {
|
|
58
|
-
options = options ? { ...options } : {};
|
|
59
|
-
Reflect.defineMetadata(SYMBOL_MODEL, options, target);
|
|
60
|
-
target.prototype.toJSON = function() {
|
|
61
|
-
const result = { ...this };
|
|
62
|
-
if (this.constructor["__properties"]) {
|
|
63
|
-
Object.keys(this.constructor["__properties"]).forEach((protoKey) => {
|
|
64
|
-
result[protoKey] = this["_" + protoKey];
|
|
65
|
-
});
|
|
66
|
-
}
|
|
67
|
-
return result;
|
|
68
|
-
};
|
|
69
|
-
};
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
// packages/shared/models/src/lib/decorators/field/field.decorator.ts
|
|
73
|
-
import "reflect-metadata";
|
|
74
|
-
|
|
75
|
-
// packages/shared/utils/src/lib/services/array/array.service.ts
|
|
76
|
-
import * as _ from "lodash";
|
|
77
|
-
|
|
78
|
-
// packages/shared/utils/src/lib/services/guid/guid.service.ts
|
|
79
|
-
import { Guid } from "guid-typescript";
|
|
80
|
-
|
|
81
|
-
// packages/shared/utils/src/lib/services/object/object.service.ts
|
|
82
|
-
import { stringify } from "flatted";
|
|
83
|
-
var ObjectService = class {
|
|
84
|
-
/***
|
|
85
|
-
* Create object with data
|
|
86
|
-
* @param data {object} - data to set
|
|
87
|
-
* @param type {type} - new type
|
|
88
|
-
* @return - new type object
|
|
89
|
-
*/
|
|
90
|
-
static createByType(data, type) {
|
|
91
|
-
if (!data) return data;
|
|
92
|
-
try {
|
|
93
|
-
if (data instanceof type) return data;
|
|
94
|
-
} catch (e) {
|
|
95
|
-
console.warn(e);
|
|
96
|
-
}
|
|
97
|
-
const result = new type();
|
|
98
|
-
Object.keys(data).forEach((key) => {
|
|
99
|
-
result[key] = data[key];
|
|
100
|
-
});
|
|
101
|
-
return result;
|
|
102
|
-
}
|
|
103
|
-
/***
|
|
104
|
-
* Remove object type from data
|
|
105
|
-
* @param obj {object} - object
|
|
106
|
-
* @return - object without type
|
|
107
|
-
*/
|
|
108
|
-
static removeTypes(obj) {
|
|
109
|
-
if (!obj) return obj;
|
|
110
|
-
const result = {};
|
|
111
|
-
Object.keys(obj).forEach((key) => {
|
|
112
|
-
if (obj[key] && obj[key].constructor && !(obj[key] instanceof Date)) {
|
|
113
|
-
let stringValue = "";
|
|
114
|
-
try {
|
|
115
|
-
stringValue = JSON.stringify(obj[key]);
|
|
116
|
-
} catch (e) {
|
|
117
|
-
console.warn("can't stringify without circular package");
|
|
118
|
-
stringValue = stringify(obj[key]);
|
|
119
|
-
}
|
|
120
|
-
result[key] = JSON.parse(stringValue);
|
|
121
|
-
} else {
|
|
122
|
-
result[key] = obj[key];
|
|
123
|
-
}
|
|
124
|
-
});
|
|
125
|
-
return result;
|
|
126
|
-
}
|
|
127
|
-
};
|
|
128
|
-
|
|
129
|
-
// packages/shared/utils/src/lib/services/password/password.service.ts
|
|
130
|
-
import md5 from "md5";
|
|
131
|
-
|
|
132
|
-
// packages/shared/models/src/lib/decorators/field/field.decorator.ts
|
|
133
|
-
var Field = FieldDecorator;
|
|
134
|
-
function FieldDecorator(options) {
|
|
135
|
-
return (target, key) => {
|
|
136
|
-
options = options ? { ...options } : {};
|
|
137
|
-
if (!target.constructor["__fields"]) {
|
|
138
|
-
target.constructor["__fields"] = {};
|
|
139
|
-
}
|
|
140
|
-
target.constructor["__fields"][key] = true;
|
|
141
|
-
if (!options.type && key === "password") {
|
|
142
|
-
options.type = FieldType.password;
|
|
143
|
-
} else if (!options.type) {
|
|
144
|
-
options.type = FieldType.text;
|
|
145
|
-
}
|
|
146
|
-
if (options.classType) {
|
|
147
|
-
target["_" + key] = target[key];
|
|
148
|
-
delete target[key];
|
|
149
|
-
Object.defineProperty(target, key, {
|
|
150
|
-
get: function() {
|
|
151
|
-
if (!this["_" + key] && options?.type === FieldType.array) {
|
|
152
|
-
this["_" + key] = [];
|
|
153
|
-
}
|
|
154
|
-
return this["_" + key];
|
|
155
|
-
},
|
|
156
|
-
set: function(v) {
|
|
157
|
-
this["_" + key] = options?.type === FieldType.array && v ? v.map(
|
|
158
|
-
(i) => ObjectService.createByType(i, options?.classType)
|
|
159
|
-
) : ObjectService.createByType(v, options?.classType);
|
|
160
|
-
},
|
|
161
|
-
enumerable: true,
|
|
162
|
-
configurable: true
|
|
163
|
-
});
|
|
164
|
-
if (!target.constructor["__properties"]) {
|
|
165
|
-
target.constructor["__properties"] = {};
|
|
166
|
-
}
|
|
167
|
-
target.constructor["__properties"][key] = true;
|
|
168
|
-
}
|
|
169
|
-
Reflect.defineMetadata(SYMBOL_FIELD, options, target, key);
|
|
170
|
-
};
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
// packages/trans/shell/dtos/src/lib/trans-create.dto.ts
|
|
174
|
-
var TransCreateDto = class {
|
|
175
|
-
amount;
|
|
176
|
-
system;
|
|
177
|
-
data;
|
|
178
|
-
name;
|
|
179
|
-
firstName;
|
|
180
|
-
lastName;
|
|
181
|
-
email;
|
|
182
|
-
contactPhone;
|
|
183
|
-
};
|
|
184
|
-
__decorateClass([
|
|
185
|
-
Field({ required: true, type: FieldType.currency })
|
|
186
|
-
], TransCreateDto.prototype, "amount", 2);
|
|
187
|
-
__decorateClass([
|
|
188
|
-
Field({ required: true, type: FieldType.text })
|
|
189
|
-
], TransCreateDto.prototype, "system", 2);
|
|
190
|
-
__decorateClass([
|
|
191
|
-
Field({ required: true })
|
|
192
|
-
], TransCreateDto.prototype, "data", 2);
|
|
193
|
-
__decorateClass([
|
|
194
|
-
Field({ required: true, type: FieldType.text })
|
|
195
|
-
], TransCreateDto.prototype, "name", 2);
|
|
196
|
-
__decorateClass([
|
|
197
|
-
Field({ type: FieldType.text })
|
|
198
|
-
], TransCreateDto.prototype, "firstName", 2);
|
|
199
|
-
__decorateClass([
|
|
200
|
-
Field({ type: FieldType.text })
|
|
201
|
-
], TransCreateDto.prototype, "lastName", 2);
|
|
202
|
-
__decorateClass([
|
|
203
|
-
Field({ type: FieldType.email })
|
|
204
|
-
], TransCreateDto.prototype, "email", 2);
|
|
205
|
-
__decorateClass([
|
|
206
|
-
Field({ type: FieldType.text })
|
|
207
|
-
], TransCreateDto.prototype, "contactPhone", 2);
|
|
208
|
-
TransCreateDto = __decorateClass([
|
|
209
|
-
Model({})
|
|
210
|
-
], TransCreateDto);
|
|
211
|
-
export {
|
|
212
|
-
TransCreateDto
|
|
213
|
-
};
|