@carbonorm/carbonnode 3.3.4 → 3.3.6
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.
|
@@ -139,8 +139,8 @@ export type tColumns<TableName extends string, T extends {
|
|
|
139
139
|
export type tPrimaryKeys<TableName extends string, PK extends string> = `${TableName}.${PK}`;
|
|
140
140
|
export type C6RestfulModel<RestShortTableName extends string, RestTableInterface extends Record<string, any> = any, PrimaryKey extends keyof RestTableInterface & string = keyof RestTableInterface & string> = {
|
|
141
141
|
TABLE_NAME: RestShortTableName;
|
|
142
|
-
PRIMARY: tPrimaryKeys<RestShortTableName, PrimaryKey
|
|
143
|
-
PRIMARY_SHORT: PrimaryKey
|
|
142
|
+
PRIMARY: Array<tPrimaryKeys<RestShortTableName, PrimaryKey>>;
|
|
143
|
+
PRIMARY_SHORT: Array<PrimaryKey>;
|
|
144
144
|
COLUMNS: tColumns<RestShortTableName, RestTableInterface>;
|
|
145
145
|
TYPE_VALIDATION: {
|
|
146
146
|
[key: string]: iTypeValidation;
|
|
@@ -203,26 +203,13 @@ export interface iRestApiFunctions<RestData extends {
|
|
|
203
203
|
Get: (request?: RequestQueryBody<'GET', RestData>) => iGetC6RestResponse<RestData>;
|
|
204
204
|
Put: (request?: RequestQueryBody<'PUT', RestData>) => iPutC6RestResponse<RestData>;
|
|
205
205
|
}
|
|
206
|
-
export interface iC6Object<
|
|
207
|
-
[key: string]: any;
|
|
208
|
-
} = any, PrimaryKey extends keyof RestTableInterface & string = keyof RestTableInterface & string> {
|
|
206
|
+
export interface iC6Object<Tables extends Record<string, C6RestfulModel<any, any, any>> = Record<string, C6RestfulModel<any, any, any>>> {
|
|
209
207
|
C6VERSION: string;
|
|
210
|
-
TABLES:
|
|
211
|
-
[key: string]: C6RestfulModel<RestShortTableName, RestTableInterface, PrimaryKey> & {
|
|
212
|
-
[key: string]: string | number;
|
|
213
|
-
};
|
|
214
|
-
};
|
|
208
|
+
TABLES: Tables;
|
|
215
209
|
PREFIX: string;
|
|
216
210
|
IMPORT: (tableName: string) => Promise<iDynamicApiImport>;
|
|
217
211
|
[key: string]: any;
|
|
218
212
|
}
|
|
219
|
-
export interface tC6Tables<RestShortTableName extends string = any, RestTableInterface extends {
|
|
220
|
-
[key: string]: any;
|
|
221
|
-
} = any, PrimaryKey extends keyof RestTableInterface & string = keyof RestTableInterface & string> {
|
|
222
|
-
[key: string]: C6RestfulModel<RestShortTableName, RestTableInterface, PrimaryKey> & {
|
|
223
|
-
[key: string]: any;
|
|
224
|
-
};
|
|
225
|
-
}
|
|
226
213
|
export interface tC6RestApi {
|
|
227
214
|
[key: string]: {
|
|
228
215
|
REST: iRestApiFunctions;
|
package/package.json
CHANGED
|
@@ -182,15 +182,15 @@ export type C6RestfulModel<
|
|
|
182
182
|
PrimaryKey extends keyof RestTableInterface & string = keyof RestTableInterface & string
|
|
183
183
|
> = {
|
|
184
184
|
TABLE_NAME: RestShortTableName;
|
|
185
|
-
PRIMARY: tPrimaryKeys<RestShortTableName, PrimaryKey
|
|
186
|
-
PRIMARY_SHORT: PrimaryKey
|
|
185
|
+
PRIMARY: Array<tPrimaryKeys<RestShortTableName, PrimaryKey>>;
|
|
186
|
+
PRIMARY_SHORT: Array<PrimaryKey>;
|
|
187
187
|
COLUMNS: tColumns<RestShortTableName, RestTableInterface>;
|
|
188
188
|
TYPE_VALIDATION: { [key: string]: iTypeValidation };
|
|
189
189
|
REGEX_VALIDATION: RegExpMap;
|
|
190
190
|
LIFECYCLE_HOOKS: iRestHooks<OrmGenerics<any, RestShortTableName, RestTableInterface, PrimaryKey>>;
|
|
191
191
|
TABLE_REFERENCES: { [columnName: string]: iConstraint[] };
|
|
192
192
|
TABLE_REFERENCED_BY: { [columnName: string]: iConstraint[] };
|
|
193
|
-
}
|
|
193
|
+
} & Required<{ [K in keyof RestTableInterface as Uppercase<string & K>]: string }>
|
|
194
194
|
|
|
195
195
|
export type iRestReactiveLifecycle<G extends OrmGenerics> = {
|
|
196
196
|
beforeProcessing?: {
|
|
@@ -240,30 +240,15 @@ export interface iRestApiFunctions<RestData extends { [key: string]: any } = any
|
|
|
240
240
|
}
|
|
241
241
|
|
|
242
242
|
export interface iC6Object<
|
|
243
|
-
|
|
244
|
-
RestTableInterface extends { [key: string]: any } = any,
|
|
245
|
-
PrimaryKey extends keyof RestTableInterface & string = keyof RestTableInterface & string
|
|
243
|
+
Tables extends Record<string, C6RestfulModel<any, any, any>> = Record<string, C6RestfulModel<any, any, any>>
|
|
246
244
|
> {
|
|
247
245
|
C6VERSION: string;
|
|
248
|
-
TABLES:
|
|
249
|
-
[key: string]: C6RestfulModel<RestShortTableName, RestTableInterface, PrimaryKey> & {
|
|
250
|
-
[key: string]: string | number;
|
|
251
|
-
};
|
|
252
|
-
};
|
|
246
|
+
TABLES: Tables;
|
|
253
247
|
PREFIX: string;
|
|
254
248
|
IMPORT: (tableName: string) => Promise<iDynamicApiImport>;
|
|
255
|
-
|
|
256
249
|
[key: string]: any;
|
|
257
250
|
}
|
|
258
251
|
|
|
259
|
-
export interface tC6Tables<
|
|
260
|
-
RestShortTableName extends string = any,
|
|
261
|
-
RestTableInterface extends { [key: string]: any } = any,
|
|
262
|
-
PrimaryKey extends keyof RestTableInterface & string = keyof RestTableInterface & string
|
|
263
|
-
> {
|
|
264
|
-
[key: string]: C6RestfulModel<RestShortTableName, RestTableInterface, PrimaryKey> & { [key: string]: any };
|
|
265
|
-
}
|
|
266
|
-
|
|
267
252
|
export interface tC6RestApi {
|
|
268
253
|
[key: string]: {
|
|
269
254
|
REST: iRestApiFunctions;
|