@gadmin2n/react-common 0.0.44
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/LICENSE +7 -0
- package/README.md +102 -0
- package/dist/lib/data-provider/gadmin-data-provider.js +438 -0
- package/dist/lib/data-provider/gadmin-data-provider.js.map +1 -0
- package/dist/lib/data-provider/index.js +18 -0
- package/dist/lib/data-provider/index.js.map +1 -0
- package/dist/lib/index.esm.js +32443 -0
- package/dist/lib/index.esm.js.map +1 -0
- package/dist/lib/index.js +23 -0
- package/dist/lib/index.js.map +1 -0
- package/dist/lib/index.umd.js +32482 -0
- package/dist/lib/index.umd.js.map +1 -0
- package/dist/lib/types/types.js +3 -0
- package/dist/lib/types/types.js.map +1 -0
- package/dist/lib/utils/common-helpers.js +134 -0
- package/dist/lib/utils/common-helpers.js.map +1 -0
- package/dist/lib/utils/form-helpers.js +272 -0
- package/dist/lib/utils/form-helpers.js.map +1 -0
- package/dist/lib/utils/index.js +21 -0
- package/dist/lib/utils/index.js.map +1 -0
- package/dist/lib/utils/prisma-helpers.js +94 -0
- package/dist/lib/utils/prisma-helpers.js.map +1 -0
- package/dist/lib/utils/table-helpers.js +163 -0
- package/dist/lib/utils/table-helpers.js.map +1 -0
- package/dist/types/data-provider/gadmin-data-provider.d.ts +3 -0
- package/dist/types/data-provider/index.d.ts +1 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/types/types/types.d.ts +420 -0
- package/dist/types/utils/common-helpers.d.ts +12 -0
- package/dist/types/utils/form-helpers.d.ts +13 -0
- package/dist/types/utils/index.d.ts +4 -0
- package/dist/types/utils/prisma-helpers.d.ts +22 -0
- package/dist/types/utils/table-helpers.d.ts +20 -0
- package/package.json +143 -0
|
@@ -0,0 +1,163 @@
|
|
|
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 __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
14
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
15
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
16
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
17
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
18
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
19
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
20
|
+
});
|
|
21
|
+
};
|
|
22
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
23
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
24
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
25
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
26
|
+
function step(op) {
|
|
27
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
28
|
+
while (_) try {
|
|
29
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
30
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
31
|
+
switch (op[0]) {
|
|
32
|
+
case 0: case 1: t = op; break;
|
|
33
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
34
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
35
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
36
|
+
default:
|
|
37
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
38
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
39
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
40
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
41
|
+
if (t[2]) _.ops.pop();
|
|
42
|
+
_.trys.pop(); continue;
|
|
43
|
+
}
|
|
44
|
+
op = body.call(thisArg, _);
|
|
45
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
46
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
50
|
+
exports.getColumns = exports.tableSearchBar = exports.formatDate = exports.requestModel = exports.DEFAUTL_SORT = exports.DEFAULT_TABLE_PAGE_SIZE = exports.TEA_PRO_TABLE_PARAMS_FIELDS = exports.ALL_VALUE = void 0;
|
|
51
|
+
var common_helpers_1 = require("./common-helpers");
|
|
52
|
+
exports.ALL_VALUE = '__ALL__';
|
|
53
|
+
exports.TEA_PRO_TABLE_PARAMS_FIELDS = ['pageSize', 'pageIndex', 'current'];
|
|
54
|
+
exports.DEFAULT_TABLE_PAGE_SIZE = 10;
|
|
55
|
+
exports.DEFAUTL_SORT = { by: 'id', order: 'desc' };
|
|
56
|
+
function requestModel(url, method, body) {
|
|
57
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
58
|
+
var response;
|
|
59
|
+
return __generator(this, function (_a) {
|
|
60
|
+
switch (_a.label) {
|
|
61
|
+
case 0: return [4 /*yield*/, fetch(url, {
|
|
62
|
+
method: method,
|
|
63
|
+
headers: {
|
|
64
|
+
'Content-Type': 'application/json;charset=utf-8'
|
|
65
|
+
},
|
|
66
|
+
body: JSON.stringify(body)
|
|
67
|
+
})];
|
|
68
|
+
case 1:
|
|
69
|
+
response = _a.sent();
|
|
70
|
+
if (!response.ok) {
|
|
71
|
+
throw new Error("response error ".concat(response.status, ",").concat(response.statusText));
|
|
72
|
+
}
|
|
73
|
+
return [4 /*yield*/, response.json()];
|
|
74
|
+
case 2: return [2 /*return*/, _a.sent()];
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
exports.requestModel = requestModel;
|
|
80
|
+
function formatDate(date) {
|
|
81
|
+
var month = String(date.getMonth() + 1);
|
|
82
|
+
var day = String(date.getDate());
|
|
83
|
+
var year = date.getFullYear();
|
|
84
|
+
if (month.length < 2) {
|
|
85
|
+
month = "0".concat(month);
|
|
86
|
+
}
|
|
87
|
+
if (day.length < 2) {
|
|
88
|
+
day = "0".concat(day);
|
|
89
|
+
}
|
|
90
|
+
return [year, month, day].join('-');
|
|
91
|
+
}
|
|
92
|
+
exports.formatDate = formatDate;
|
|
93
|
+
function tableSearchBar(searchConfig, model) {
|
|
94
|
+
var fields = searchConfig.fields
|
|
95
|
+
.filter(function (name) { return !name.includes('.'); })
|
|
96
|
+
.map(function (name) { return model[name]; })
|
|
97
|
+
.filter(function (field) {
|
|
98
|
+
return ['string', 'boolean', 'number', 'Date', 'bigint'].includes(field.tsType);
|
|
99
|
+
});
|
|
100
|
+
return {
|
|
101
|
+
placeholder: searchConfig.placeholder || fields.map(function (field) { return field.name; }).join(', '),
|
|
102
|
+
getSearchFilters: function (keyword) {
|
|
103
|
+
return fields
|
|
104
|
+
.map(function (field) { return ({
|
|
105
|
+
field: field.name,
|
|
106
|
+
dataType: field.tsType,
|
|
107
|
+
searchType: (searchConfig.containsFields || []).includes(field.name)
|
|
108
|
+
? 'contains'
|
|
109
|
+
: 'equals'
|
|
110
|
+
}); })
|
|
111
|
+
.map(function (item) {
|
|
112
|
+
if (item.searchType === 'contains') {
|
|
113
|
+
return {
|
|
114
|
+
field: item.field,
|
|
115
|
+
operator: 'contains',
|
|
116
|
+
value: keyword
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
else {
|
|
120
|
+
var data = (0, common_helpers_1.stringToTsType)(keyword, item.dataType);
|
|
121
|
+
if (item.dataType === 'number' &&
|
|
122
|
+
(keyword === '' || isNaN(data))) {
|
|
123
|
+
return {
|
|
124
|
+
field: '',
|
|
125
|
+
operator: 'null',
|
|
126
|
+
value: ''
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
return {
|
|
130
|
+
field: item.field,
|
|
131
|
+
operator: 'eq',
|
|
132
|
+
value: data
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
})
|
|
136
|
+
.filter(function (item) { return item.field !== ''; });
|
|
137
|
+
}
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
exports.tableSearchBar = tableSearchBar;
|
|
141
|
+
function getColumns(modelName, fields, modelsMap) {
|
|
142
|
+
var columns = [];
|
|
143
|
+
fields.forEach(function (fieldName) {
|
|
144
|
+
var _a, _b, _c, _d, _e, _f;
|
|
145
|
+
var field = (_b = (_a = modelsMap[modelName]) === null || _a === void 0 ? void 0 : _a['model']) === null || _b === void 0 ? void 0 : _b[fieldName];
|
|
146
|
+
if (!field && fieldName.includes('.')) {
|
|
147
|
+
var _g = fieldName.split('.'), newModelName = _g[0], newFieldName = _g[1];
|
|
148
|
+
if ((_d = (_c = modelsMap[modelName]) === null || _c === void 0 ? void 0 : _c['model']) === null || _d === void 0 ? void 0 : _d[newModelName]) {
|
|
149
|
+
newModelName = modelsMap[modelName]['model'][newModelName]['type'];
|
|
150
|
+
}
|
|
151
|
+
field = (_f = (_e = modelsMap[newModelName]) === null || _e === void 0 ? void 0 : _e['model']) === null || _f === void 0 ? void 0 : _f[newFieldName];
|
|
152
|
+
if (field) {
|
|
153
|
+
field = __assign(__assign({}, field), { name: fieldName });
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
if (field) {
|
|
157
|
+
columns.push(field);
|
|
158
|
+
}
|
|
159
|
+
});
|
|
160
|
+
return columns;
|
|
161
|
+
}
|
|
162
|
+
exports.getColumns = getColumns;
|
|
163
|
+
//# sourceMappingURL=table-helpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"table-helpers.js","sourceRoot":"","sources":["../../../src/utils/table-helpers.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './gadmin-data-provider';
|
|
@@ -0,0 +1,420 @@
|
|
|
1
|
+
import { ModelConfig } from './config.types';
|
|
2
|
+
export declare type I18N_T = {
|
|
3
|
+
(key: string, options?: any, defaultMessage?: string | undefined): string;
|
|
4
|
+
(key: string, defaultMessage?: string | undefined): string;
|
|
5
|
+
};
|
|
6
|
+
declare type FieldKind = 'scalar' | 'object' | 'enum' | 'unsupported';
|
|
7
|
+
interface DMMFField {
|
|
8
|
+
kind: FieldKind;
|
|
9
|
+
name: string;
|
|
10
|
+
isRequired: boolean;
|
|
11
|
+
isList: boolean;
|
|
12
|
+
isUnique: boolean;
|
|
13
|
+
isId: boolean;
|
|
14
|
+
isReadOnly: boolean;
|
|
15
|
+
isGenerated: boolean;
|
|
16
|
+
isUpdatedAt: boolean;
|
|
17
|
+
type: string;
|
|
18
|
+
dbNames?: string[] | null;
|
|
19
|
+
hasDefaultValue: boolean;
|
|
20
|
+
default?: FieldDefault | string | boolean | number;
|
|
21
|
+
relationFromFields?: string[];
|
|
22
|
+
relationToFields?: string[];
|
|
23
|
+
relationOnDelete?: string;
|
|
24
|
+
relationName?: string;
|
|
25
|
+
documentation?: string;
|
|
26
|
+
[key: string]: any;
|
|
27
|
+
}
|
|
28
|
+
interface FieldDefault {
|
|
29
|
+
name: string;
|
|
30
|
+
args: any[];
|
|
31
|
+
}
|
|
32
|
+
export declare type ChangeValueModal = {
|
|
33
|
+
visible: boolean;
|
|
34
|
+
keys: string[];
|
|
35
|
+
fields: string[];
|
|
36
|
+
initialValues: {};
|
|
37
|
+
};
|
|
38
|
+
export declare type FieldDataType = DMMFField & {
|
|
39
|
+
tsType: TsTypeString;
|
|
40
|
+
uiType: {
|
|
41
|
+
formItem: {
|
|
42
|
+
type: 'File' | 'Image';
|
|
43
|
+
args: {
|
|
44
|
+
maxCount: number;
|
|
45
|
+
accept: string;
|
|
46
|
+
sizeLimit: number;
|
|
47
|
+
};
|
|
48
|
+
} | {
|
|
49
|
+
type: 'Text';
|
|
50
|
+
args: {
|
|
51
|
+
rows: number;
|
|
52
|
+
};
|
|
53
|
+
} | {
|
|
54
|
+
type: 'CheckBox' | 'Radio';
|
|
55
|
+
args: {
|
|
56
|
+
options: string[];
|
|
57
|
+
};
|
|
58
|
+
} | {
|
|
59
|
+
type: 'Select';
|
|
60
|
+
args: {
|
|
61
|
+
options: string[];
|
|
62
|
+
mode?: 'multiple' | 'tags' | undefined;
|
|
63
|
+
};
|
|
64
|
+
} | {
|
|
65
|
+
type: 'String' | 'Boolean' | 'Int' | 'BigInt' | 'Float' | 'Decimal' | 'DateTime' | 'Markdown' | 'JSON' | 'Html' | 'Url' | 'Email' | 'Other';
|
|
66
|
+
args: {};
|
|
67
|
+
};
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
export declare type ModelType = Record<string, FieldDataType>;
|
|
71
|
+
export declare type ModelsFieldsTypeMap = Record<string, {
|
|
72
|
+
model: ModelType;
|
|
73
|
+
meta: ModelConfig['metadata'];
|
|
74
|
+
}>;
|
|
75
|
+
export declare type Enumerable<T> = T | Array<T>;
|
|
76
|
+
export declare type ScalarType = string | number | bigint | boolean | Date | undefined | null;
|
|
77
|
+
export declare type XOR<T, U> = T extends object ? U extends object ? (Without<T, U> & U) | (Without<U, T> & T) : U : T;
|
|
78
|
+
export declare type SortOrder = 'desc' | 'asc';
|
|
79
|
+
export declare type Without<T, U> = {
|
|
80
|
+
[P in Exclude<keyof T, keyof U>]?: never;
|
|
81
|
+
};
|
|
82
|
+
export declare type PageMetaDto = {
|
|
83
|
+
page: number;
|
|
84
|
+
take: number;
|
|
85
|
+
itemCount: number;
|
|
86
|
+
pageCount: number;
|
|
87
|
+
hasPreviousPage: boolean;
|
|
88
|
+
hasNextPage: boolean;
|
|
89
|
+
};
|
|
90
|
+
export declare type PageDto<T> = {
|
|
91
|
+
data: T[];
|
|
92
|
+
meta: PageMetaDto;
|
|
93
|
+
};
|
|
94
|
+
export declare type IntFilter = {
|
|
95
|
+
equals?: number;
|
|
96
|
+
in?: Enumerable<number>;
|
|
97
|
+
notIn?: Enumerable<number>;
|
|
98
|
+
lt?: number;
|
|
99
|
+
lte?: number;
|
|
100
|
+
gt?: number;
|
|
101
|
+
gte?: number;
|
|
102
|
+
not?: NestedIntFilter | number;
|
|
103
|
+
};
|
|
104
|
+
export declare type DateTimeFilter = {
|
|
105
|
+
equals?: Date | string;
|
|
106
|
+
in?: Enumerable<Date> | Enumerable<string>;
|
|
107
|
+
notIn?: Enumerable<Date> | Enumerable<string>;
|
|
108
|
+
lt?: Date | string;
|
|
109
|
+
lte?: Date | string;
|
|
110
|
+
gt?: Date | string;
|
|
111
|
+
gte?: Date | string;
|
|
112
|
+
not?: NestedDateTimeFilter | Date | string;
|
|
113
|
+
};
|
|
114
|
+
export declare type StringFilter = {
|
|
115
|
+
equals?: string;
|
|
116
|
+
in?: Enumerable<string>;
|
|
117
|
+
notIn?: Enumerable<string>;
|
|
118
|
+
lt?: string;
|
|
119
|
+
lte?: string;
|
|
120
|
+
gt?: string;
|
|
121
|
+
gte?: string;
|
|
122
|
+
contains?: string;
|
|
123
|
+
startsWith?: string;
|
|
124
|
+
endsWith?: string;
|
|
125
|
+
not?: NestedStringFilter | string;
|
|
126
|
+
};
|
|
127
|
+
export declare type StringNullableFilter = {
|
|
128
|
+
equals?: string | null;
|
|
129
|
+
in?: Enumerable<string> | null;
|
|
130
|
+
notIn?: Enumerable<string> | null;
|
|
131
|
+
lt?: string;
|
|
132
|
+
lte?: string;
|
|
133
|
+
gt?: string;
|
|
134
|
+
gte?: string;
|
|
135
|
+
contains?: string;
|
|
136
|
+
startsWith?: string;
|
|
137
|
+
endsWith?: string;
|
|
138
|
+
not?: NestedStringNullableFilter | string | null;
|
|
139
|
+
};
|
|
140
|
+
export declare type FloatFilter = {
|
|
141
|
+
equals?: number;
|
|
142
|
+
in?: Enumerable<number>;
|
|
143
|
+
notIn?: Enumerable<number>;
|
|
144
|
+
lt?: number;
|
|
145
|
+
lte?: number;
|
|
146
|
+
gt?: number;
|
|
147
|
+
gte?: number;
|
|
148
|
+
not?: NestedFloatFilter | number;
|
|
149
|
+
};
|
|
150
|
+
export declare type BoolFilter = {
|
|
151
|
+
equals?: boolean;
|
|
152
|
+
not?: NestedBoolFilter | boolean;
|
|
153
|
+
};
|
|
154
|
+
export declare type NestedIntFilter = {
|
|
155
|
+
equals?: number;
|
|
156
|
+
in?: Enumerable<number>;
|
|
157
|
+
notIn?: Enumerable<number>;
|
|
158
|
+
lt?: number;
|
|
159
|
+
lte?: number;
|
|
160
|
+
gt?: number;
|
|
161
|
+
gte?: number;
|
|
162
|
+
not?: NestedIntFilter | number;
|
|
163
|
+
};
|
|
164
|
+
export declare type NestedDateTimeFilter = {
|
|
165
|
+
equals?: Date | string;
|
|
166
|
+
in?: Enumerable<Date> | Enumerable<string>;
|
|
167
|
+
notIn?: Enumerable<Date> | Enumerable<string>;
|
|
168
|
+
lt?: Date | string;
|
|
169
|
+
lte?: Date | string;
|
|
170
|
+
gt?: Date | string;
|
|
171
|
+
gte?: Date | string;
|
|
172
|
+
not?: NestedDateTimeFilter | Date | string;
|
|
173
|
+
};
|
|
174
|
+
export declare type NestedStringFilter = {
|
|
175
|
+
equals?: string;
|
|
176
|
+
in?: Enumerable<string>;
|
|
177
|
+
notIn?: Enumerable<string>;
|
|
178
|
+
lt?: string;
|
|
179
|
+
lte?: string;
|
|
180
|
+
gt?: string;
|
|
181
|
+
gte?: string;
|
|
182
|
+
contains?: string;
|
|
183
|
+
startsWith?: string;
|
|
184
|
+
endsWith?: string;
|
|
185
|
+
not?: NestedStringFilter | string;
|
|
186
|
+
};
|
|
187
|
+
export declare type NestedStringNullableFilter = {
|
|
188
|
+
equals?: string | null;
|
|
189
|
+
in?: Enumerable<string> | null;
|
|
190
|
+
notIn?: Enumerable<string> | null;
|
|
191
|
+
lt?: string;
|
|
192
|
+
lte?: string;
|
|
193
|
+
gt?: string;
|
|
194
|
+
gte?: string;
|
|
195
|
+
contains?: string;
|
|
196
|
+
startsWith?: string;
|
|
197
|
+
endsWith?: string;
|
|
198
|
+
not?: NestedStringNullableFilter | string | null;
|
|
199
|
+
};
|
|
200
|
+
export declare type NestedFloatFilter = {
|
|
201
|
+
equals?: number;
|
|
202
|
+
in?: Enumerable<number>;
|
|
203
|
+
notIn?: Enumerable<number>;
|
|
204
|
+
lt?: number;
|
|
205
|
+
lte?: number;
|
|
206
|
+
gt?: number;
|
|
207
|
+
gte?: number;
|
|
208
|
+
not?: NestedFloatFilter | number;
|
|
209
|
+
};
|
|
210
|
+
export declare type NestedBoolFilter = {
|
|
211
|
+
equals?: boolean;
|
|
212
|
+
not?: NestedBoolFilter | boolean;
|
|
213
|
+
};
|
|
214
|
+
export declare type NestedIntWithAggregatesFilter = {
|
|
215
|
+
equals?: number;
|
|
216
|
+
in?: Enumerable<number>;
|
|
217
|
+
notIn?: Enumerable<number>;
|
|
218
|
+
lt?: number;
|
|
219
|
+
lte?: number;
|
|
220
|
+
gt?: number;
|
|
221
|
+
gte?: number;
|
|
222
|
+
not?: NestedIntWithAggregatesFilter | number;
|
|
223
|
+
_count?: NestedIntFilter;
|
|
224
|
+
_avg?: NestedFloatFilter;
|
|
225
|
+
_sum?: NestedIntFilter;
|
|
226
|
+
_min?: NestedIntFilter;
|
|
227
|
+
_max?: NestedIntFilter;
|
|
228
|
+
};
|
|
229
|
+
export declare type NestedDateTimeWithAggregatesFilter = {
|
|
230
|
+
equals?: Date | string;
|
|
231
|
+
in?: Enumerable<Date> | Enumerable<string>;
|
|
232
|
+
notIn?: Enumerable<Date> | Enumerable<string>;
|
|
233
|
+
lt?: Date | string;
|
|
234
|
+
lte?: Date | string;
|
|
235
|
+
gt?: Date | string;
|
|
236
|
+
gte?: Date | string;
|
|
237
|
+
not?: NestedDateTimeWithAggregatesFilter | Date | string;
|
|
238
|
+
_count?: NestedIntFilter;
|
|
239
|
+
_min?: NestedDateTimeFilter;
|
|
240
|
+
_max?: NestedDateTimeFilter;
|
|
241
|
+
};
|
|
242
|
+
export declare type NestedStringWithAggregatesFilter = {
|
|
243
|
+
equals?: string;
|
|
244
|
+
in?: Enumerable<string>;
|
|
245
|
+
notIn?: Enumerable<string>;
|
|
246
|
+
lt?: string;
|
|
247
|
+
lte?: string;
|
|
248
|
+
gt?: string;
|
|
249
|
+
gte?: string;
|
|
250
|
+
contains?: string;
|
|
251
|
+
startsWith?: string;
|
|
252
|
+
endsWith?: string;
|
|
253
|
+
not?: NestedStringWithAggregatesFilter | string;
|
|
254
|
+
_count?: NestedIntFilter;
|
|
255
|
+
_min?: NestedStringFilter;
|
|
256
|
+
_max?: NestedStringFilter;
|
|
257
|
+
};
|
|
258
|
+
export declare type NestedStringNullableWithAggregatesFilter = {
|
|
259
|
+
equals?: string | null;
|
|
260
|
+
in?: Enumerable<string> | null;
|
|
261
|
+
notIn?: Enumerable<string> | null;
|
|
262
|
+
lt?: string;
|
|
263
|
+
lte?: string;
|
|
264
|
+
gt?: string;
|
|
265
|
+
gte?: string;
|
|
266
|
+
contains?: string;
|
|
267
|
+
startsWith?: string;
|
|
268
|
+
endsWith?: string;
|
|
269
|
+
not?: NestedStringNullableWithAggregatesFilter | string | null;
|
|
270
|
+
_count?: NestedIntNullableFilter;
|
|
271
|
+
_min?: NestedStringNullableFilter;
|
|
272
|
+
_max?: NestedStringNullableFilter;
|
|
273
|
+
};
|
|
274
|
+
export declare type NestedIntNullableFilter = {
|
|
275
|
+
equals?: number | null;
|
|
276
|
+
in?: Enumerable<number> | null;
|
|
277
|
+
notIn?: Enumerable<number> | null;
|
|
278
|
+
lt?: number;
|
|
279
|
+
lte?: number;
|
|
280
|
+
gt?: number;
|
|
281
|
+
gte?: number;
|
|
282
|
+
not?: NestedIntNullableFilter | number | null;
|
|
283
|
+
};
|
|
284
|
+
export declare type NestedFloatWithAggregatesFilter = {
|
|
285
|
+
equals?: number;
|
|
286
|
+
in?: Enumerable<number>;
|
|
287
|
+
notIn?: Enumerable<number>;
|
|
288
|
+
lt?: number;
|
|
289
|
+
lte?: number;
|
|
290
|
+
gt?: number;
|
|
291
|
+
gte?: number;
|
|
292
|
+
not?: NestedFloatWithAggregatesFilter | number;
|
|
293
|
+
_count?: NestedIntFilter;
|
|
294
|
+
_avg?: NestedFloatFilter;
|
|
295
|
+
_sum?: NestedFloatFilter;
|
|
296
|
+
_min?: NestedFloatFilter;
|
|
297
|
+
_max?: NestedFloatFilter;
|
|
298
|
+
};
|
|
299
|
+
export declare type NestedBoolWithAggregatesFilter = {
|
|
300
|
+
equals?: boolean;
|
|
301
|
+
not?: NestedBoolWithAggregatesFilter | boolean;
|
|
302
|
+
_count?: NestedIntFilter;
|
|
303
|
+
_min?: NestedBoolFilter;
|
|
304
|
+
_max?: NestedBoolFilter;
|
|
305
|
+
};
|
|
306
|
+
export declare type NestedIntNullableWithAggregatesFilter = {
|
|
307
|
+
equals?: number | null;
|
|
308
|
+
in?: Enumerable<number> | null;
|
|
309
|
+
notIn?: Enumerable<number> | null;
|
|
310
|
+
lt?: number;
|
|
311
|
+
lte?: number;
|
|
312
|
+
gt?: number;
|
|
313
|
+
gte?: number;
|
|
314
|
+
not?: NestedIntNullableWithAggregatesFilter | number | null;
|
|
315
|
+
_count?: NestedIntNullableFilter;
|
|
316
|
+
_avg?: NestedFloatNullableFilter;
|
|
317
|
+
_sum?: NestedIntNullableFilter;
|
|
318
|
+
_min?: NestedIntNullableFilter;
|
|
319
|
+
_max?: NestedIntNullableFilter;
|
|
320
|
+
};
|
|
321
|
+
export declare type NestedFloatNullableFilter = {
|
|
322
|
+
equals?: number | null;
|
|
323
|
+
in?: Enumerable<number> | null;
|
|
324
|
+
notIn?: Enumerable<number> | null;
|
|
325
|
+
lt?: number;
|
|
326
|
+
lte?: number;
|
|
327
|
+
gt?: number;
|
|
328
|
+
gte?: number;
|
|
329
|
+
not?: NestedFloatNullableFilter | number | null;
|
|
330
|
+
};
|
|
331
|
+
export declare type Model = {
|
|
332
|
+
[k: string]: ScalarType;
|
|
333
|
+
};
|
|
334
|
+
export declare type ModelCountOutputTypeSelect = {
|
|
335
|
+
[k: string]: boolean | undefined;
|
|
336
|
+
};
|
|
337
|
+
export declare type ModelCountOutputType = {
|
|
338
|
+
[k: string]: number;
|
|
339
|
+
};
|
|
340
|
+
export declare type ModelCountOutputTypeArgs = {
|
|
341
|
+
select?: ModelCountOutputTypeSelect | null;
|
|
342
|
+
};
|
|
343
|
+
export declare type ModelSelect = {
|
|
344
|
+
[k: string]: boolean | ModelFindManyArgs | ModelCountOutputTypeArgs | undefined;
|
|
345
|
+
};
|
|
346
|
+
export declare type ModelWhereInput = {
|
|
347
|
+
AND?: Enumerable<ModelWhereInput>;
|
|
348
|
+
OR?: Enumerable<ModelWhereInput>;
|
|
349
|
+
NOT?: Enumerable<ModelWhereInput>;
|
|
350
|
+
[k: string]: any;
|
|
351
|
+
};
|
|
352
|
+
export declare type ModelOrderByRelationAggregateInput = {
|
|
353
|
+
_count?: SortOrder;
|
|
354
|
+
};
|
|
355
|
+
export declare type ModelOrderByWithRelationInput = {
|
|
356
|
+
[k: string]: SortOrder | ModelOrderByRelationAggregateInput | ModelOrderByWithRelationInput | undefined;
|
|
357
|
+
};
|
|
358
|
+
export declare type ModelFindManyArgs = {
|
|
359
|
+
select?: ModelSelect | null | undefined;
|
|
360
|
+
where?: ModelWhereInput | undefined;
|
|
361
|
+
orderBy?: Enumerable<ModelOrderByWithRelationInput> | undefined;
|
|
362
|
+
take?: number | undefined;
|
|
363
|
+
skip?: number | undefined;
|
|
364
|
+
distinct?: Enumerable<string> | undefined;
|
|
365
|
+
};
|
|
366
|
+
export declare type SystemFields = 'id' | 'createdAt' | 'updatedAt';
|
|
367
|
+
export declare type RequiredFields<T> = Exclude<keyof T, SystemFields>;
|
|
368
|
+
export declare type CreateEntity<T> = Pick<T, RequiredFields<T>>;
|
|
369
|
+
export declare type UpdateEntity<T> = Partial<CreateEntity<T>>;
|
|
370
|
+
export declare type CreateModel = CreateEntity<Model>;
|
|
371
|
+
export declare type UpdateModel = UpdateEntity<Model>;
|
|
372
|
+
export declare type TeaProTableParams = ModelFindManyArgs & {
|
|
373
|
+
pageSize?: number;
|
|
374
|
+
current?: number;
|
|
375
|
+
pageIndex?: number;
|
|
376
|
+
};
|
|
377
|
+
export declare type FindManyResut = PageDto<Model>;
|
|
378
|
+
export declare type EffectedCount = {
|
|
379
|
+
count: number;
|
|
380
|
+
};
|
|
381
|
+
export declare type ModelInclude = {
|
|
382
|
+
[k: string]: boolean | ModelFindManyArgs | ModelCountOutputTypeArgs | undefined;
|
|
383
|
+
};
|
|
384
|
+
export declare type ModelWhereUniqueInput = {
|
|
385
|
+
id?: number;
|
|
386
|
+
};
|
|
387
|
+
export declare type ModelCreateInput = {
|
|
388
|
+
[k: string]: any;
|
|
389
|
+
};
|
|
390
|
+
export declare type ModelCreateArgs = {
|
|
391
|
+
select?: ModelSelect | null;
|
|
392
|
+
include?: ModelInclude | null;
|
|
393
|
+
data: any;
|
|
394
|
+
};
|
|
395
|
+
export declare type ModelUpdateArgs = {
|
|
396
|
+
select?: ModelSelect | null;
|
|
397
|
+
data: any;
|
|
398
|
+
where: any;
|
|
399
|
+
};
|
|
400
|
+
export declare type ModelUpdateManyArgs = {
|
|
401
|
+
data: any;
|
|
402
|
+
where?: ModelWhereInput;
|
|
403
|
+
};
|
|
404
|
+
export declare type ModelDeleteManyArgs = {
|
|
405
|
+
where?: ModelWhereInput;
|
|
406
|
+
};
|
|
407
|
+
export declare type TsTypeString = 'string' | 'boolean' | 'number' | 'Date' | 'bigint' | 'undefined' | 'null' | 'Prisma.JsonValue';
|
|
408
|
+
export interface IStringToTsType {
|
|
409
|
+
(value: ScalarType, dataTypeString: TsTypeString): ScalarType;
|
|
410
|
+
}
|
|
411
|
+
export declare type RequestMethod = 'GET' | 'POST' | 'PATCH' | 'DELETE';
|
|
412
|
+
export declare type RequestAction = 'createOne' | 'findUnique' | 'findMany' | 'updateUnique' | 'updateMany' | 'deleteUnique' | 'deleteMany' | 'count' | 'groupBy' | 'aggregate';
|
|
413
|
+
export declare type TABLE_ACTIONS = 'INSERT' | 'CHANGE_STATUS' | 'DELETE' | 'EXPORT';
|
|
414
|
+
export declare type ExportDataType<T> = {
|
|
415
|
+
records: T[];
|
|
416
|
+
fields: (keyof T)[];
|
|
417
|
+
fieldNames: string[];
|
|
418
|
+
fileName?: string;
|
|
419
|
+
};
|
|
420
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { When } from '../types/config.types';
|
|
2
|
+
import { IStringToTsType } from '../types/types';
|
|
3
|
+
export declare function uncapitalize(string: string): string;
|
|
4
|
+
export declare function capitalize(string: string): string;
|
|
5
|
+
export declare function isObject(item: any): any;
|
|
6
|
+
export declare function omit(obj: Record<string, any>, fields: string[]): Record<string, any>;
|
|
7
|
+
export declare function pick(obj: Record<string, any>, fields: string[]): Record<string, any>;
|
|
8
|
+
export declare function mergeDeep(target: any, source: any): any;
|
|
9
|
+
export declare function deepClone(obj: any): any;
|
|
10
|
+
export declare const stringToTsType: IStringToTsType;
|
|
11
|
+
export declare function whenIsTrue(expact: When, realValues: Record<string, any>): boolean;
|
|
12
|
+
export declare function recipeRunner(recipe: Function | undefined, state: any): any;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import 'reflect-metadata';
|
|
2
|
+
import { ChangeValueModal, FieldDataType, ModelType, ScalarType, TsTypeString } from '../types/types';
|
|
3
|
+
export declare function inputValidator(transformClass: FunctionConstructor, field: string, tsType: TsTypeString): ({ getFieldValue }: {
|
|
4
|
+
getFieldValue: any;
|
|
5
|
+
}) => {
|
|
6
|
+
validator(_: any, value: ScalarType): Promise<void>;
|
|
7
|
+
};
|
|
8
|
+
export declare function addValidator(field: any, transformClass: any): (base?: ((draft: any) => void) | undefined, ...args: unknown[]) => ((draft: any) => void) | Promise<(draft: any) => void>;
|
|
9
|
+
export declare function produceModel(model: ModelType, propsObj: any, transformClass?: any, permanentProps?: any): ModelType;
|
|
10
|
+
export declare function formStringValuesToTs(transformClass: FunctionConstructor, values: Record<string, any>): {};
|
|
11
|
+
export declare function getModalFormFields(changeValueModal: ChangeValueModal, fieldsComponent: any): any;
|
|
12
|
+
export declare function handleOnFinish(values: Record<string, any>, fields: FieldDataType[], action?: 'edit' | 'create' | 'clone' | undefined): Record<string, any>;
|
|
13
|
+
export declare function handleInitialValues(initialValues: Record<string, any>, fields: FieldDataType[]): Record<string, any>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export declare const scalarToTS: (scalar: string, useInputTypes?: boolean) => string;
|
|
2
|
+
export declare function prismaEnumToOptions(enumObject: {
|
|
3
|
+
[s: string]: string;
|
|
4
|
+
}): {
|
|
5
|
+
value: string;
|
|
6
|
+
text: string;
|
|
7
|
+
}[];
|
|
8
|
+
/**
|
|
9
|
+
* Check if a value is a Prisma Decimal object.
|
|
10
|
+
* Prisma Decimal objects have the format {s: sign, e: exponent, d: digits[]}
|
|
11
|
+
* when serialized through JSON (losing prototype methods).
|
|
12
|
+
*/
|
|
13
|
+
export declare function isPrismaDecimal(value: any): boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Convert Prisma Decimal object (from decimal.js) to a displayable value.
|
|
16
|
+
* Prisma Decimal objects have the format {s: sign, e: exponent, d: digits[]}
|
|
17
|
+
* when serialized through JSON (losing prototype methods).
|
|
18
|
+
*
|
|
19
|
+
* @param value - The value to convert (may or may not be a Decimal object)
|
|
20
|
+
* @returns The converted value as a string/number, or the original value if not a Decimal
|
|
21
|
+
*/
|
|
22
|
+
export declare function convertPrismaDecimal(value: any): string | number | any;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { FieldDataType, ModelsFieldsTypeMap, RequestMethod } from '../types/types';
|
|
2
|
+
import { ModelConfig } from '../types/config.types';
|
|
3
|
+
export declare const ALL_VALUE = "__ALL__";
|
|
4
|
+
export declare const TEA_PRO_TABLE_PARAMS_FIELDS: string[];
|
|
5
|
+
export declare const DEFAULT_TABLE_PAGE_SIZE = 10;
|
|
6
|
+
export declare const DEFAUTL_SORT: {
|
|
7
|
+
readonly by: "id";
|
|
8
|
+
readonly order: "desc";
|
|
9
|
+
};
|
|
10
|
+
export declare function requestModel<T, K>(url: string, method: RequestMethod, body: T): Promise<K>;
|
|
11
|
+
export declare function formatDate(date: Date): string;
|
|
12
|
+
export declare function tableSearchBar(searchConfig: ModelConfig['table']['toolbar']['searchBar'], model: any): {
|
|
13
|
+
placeholder: string;
|
|
14
|
+
getSearchFilters: (keyword: string) => {
|
|
15
|
+
field: any;
|
|
16
|
+
operator: string;
|
|
17
|
+
value: import("../types/types").ScalarType;
|
|
18
|
+
}[];
|
|
19
|
+
};
|
|
20
|
+
export declare function getColumns(modelName: string, fields: string[], modelsMap: ModelsFieldsTypeMap): FieldDataType[];
|