pure-orm 4.0.0-3 → 4.0.0-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.
- package/README.md +46 -3
- package/coverage/clover.xml +347 -343
- package/coverage/coverage-final.json +2 -2
- package/coverage/lcov-report/dist/src/factory.js.html +41 -17
- package/coverage/lcov-report/dist/src/index.html +14 -14
- package/coverage/lcov-report/dist/src/index.js.html +1 -1
- package/coverage/lcov-report/dist/test-utils/blog/index.html +1 -1
- package/coverage/lcov-report/dist/test-utils/blog/models/article.js.html +1 -1
- package/coverage/lcov-report/dist/test-utils/blog/models/article_tag.js.html +1 -1
- package/coverage/lcov-report/dist/test-utils/blog/models/index.html +1 -1
- package/coverage/lcov-report/dist/test-utils/blog/models/person.js.html +1 -1
- package/coverage/lcov-report/dist/test-utils/blog/models/tag.js.html +1 -1
- package/coverage/lcov-report/dist/test-utils/blog/orm.js.html +1 -1
- package/coverage/lcov-report/dist/test-utils/five/index.html +1 -1
- package/coverage/lcov-report/dist/test-utils/five/models/index.html +1 -1
- package/coverage/lcov-report/dist/test-utils/five/models/line-item.js.html +1 -1
- package/coverage/lcov-report/dist/test-utils/five/models/order.js.html +1 -1
- package/coverage/lcov-report/dist/test-utils/five/models/parcel-event.js.html +1 -1
- package/coverage/lcov-report/dist/test-utils/five/models/parcel-line-item.js.html +1 -1
- package/coverage/lcov-report/dist/test-utils/five/models/parcel.js.html +1 -1
- package/coverage/lcov-report/dist/test-utils/five/orm.js.html +1 -1
- package/coverage/lcov-report/dist/test-utils/nine/index.html +1 -1
- package/coverage/lcov-report/dist/test-utils/nine/models/feature-switch.js.html +1 -1
- package/coverage/lcov-report/dist/test-utils/nine/models/index.html +1 -1
- package/coverage/lcov-report/dist/test-utils/nine/orm.js.html +1 -1
- package/coverage/lcov-report/dist/test-utils/order/index.html +1 -1
- package/coverage/lcov-report/dist/test-utils/order/models/index.html +1 -1
- package/coverage/lcov-report/dist/test-utils/order/models/line-item.js.html +1 -1
- package/coverage/lcov-report/dist/test-utils/order/models/order.js.html +1 -1
- package/coverage/lcov-report/dist/test-utils/order/models/product-variant.js.html +1 -1
- package/coverage/lcov-report/dist/test-utils/order/models/product.js.html +1 -1
- package/coverage/lcov-report/dist/test-utils/order/models/utm-source.js.html +1 -1
- package/coverage/lcov-report/dist/test-utils/order/orm.js.html +1 -1
- package/coverage/lcov-report/dist/test-utils/order-more/index.html +1 -1
- package/coverage/lcov-report/dist/test-utils/order-more/models/actual-product-variant.js.html +1 -1
- package/coverage/lcov-report/dist/test-utils/order-more/models/color.js.html +1 -1
- package/coverage/lcov-report/dist/test-utils/order-more/models/customer.js.html +1 -1
- package/coverage/lcov-report/dist/test-utils/order-more/models/gender.js.html +1 -1
- package/coverage/lcov-report/dist/test-utils/order-more/models/index.html +1 -1
- package/coverage/lcov-report/dist/test-utils/order-more/models/inventory-level.js.html +1 -1
- package/coverage/lcov-report/dist/test-utils/order-more/models/line-item.js.html +1 -1
- package/coverage/lcov-report/dist/test-utils/order-more/models/order.js.html +1 -1
- package/coverage/lcov-report/dist/test-utils/order-more/models/parcel-event.js.html +1 -1
- package/coverage/lcov-report/dist/test-utils/order-more/models/parcel-line-item.js.html +1 -1
- package/coverage/lcov-report/dist/test-utils/order-more/models/parcel.js.html +1 -1
- package/coverage/lcov-report/dist/test-utils/order-more/models/physical-address.js.html +1 -1
- package/coverage/lcov-report/dist/test-utils/order-more/models/product-variant-image.js.html +1 -1
- package/coverage/lcov-report/dist/test-utils/order-more/models/product-variant.js.html +1 -1
- package/coverage/lcov-report/dist/test-utils/order-more/models/product.js.html +1 -1
- package/coverage/lcov-report/dist/test-utils/order-more/models/refund.js.html +1 -1
- package/coverage/lcov-report/dist/test-utils/order-more/models/shipment-actual-product-variant.js.html +1 -1
- package/coverage/lcov-report/dist/test-utils/order-more/models/shipment.js.html +1 -1
- package/coverage/lcov-report/dist/test-utils/order-more/models/size.js.html +1 -1
- package/coverage/lcov-report/dist/test-utils/order-more/models/utm-medium.js.html +1 -1
- package/coverage/lcov-report/dist/test-utils/order-more/models/utm-source.js.html +1 -1
- package/coverage/lcov-report/dist/test-utils/order-more/orm.js.html +1 -1
- package/coverage/lcov-report/dist/test-utils/six/index.html +1 -1
- package/coverage/lcov-report/dist/test-utils/six/models/customer.js.html +1 -1
- package/coverage/lcov-report/dist/test-utils/six/models/index.html +1 -1
- package/coverage/lcov-report/dist/test-utils/six/models/line-item.js.html +1 -1
- package/coverage/lcov-report/dist/test-utils/six/models/order.js.html +1 -1
- package/coverage/lcov-report/dist/test-utils/six/models/parcel-line-item.js.html +1 -1
- package/coverage/lcov-report/dist/test-utils/six/models/parcel.js.html +1 -1
- package/coverage/lcov-report/dist/test-utils/six/orm.js.html +1 -1
- package/coverage/lcov-report/dist/test-utils/thirteen/index.html +1 -1
- package/coverage/lcov-report/dist/test-utils/thirteen/models/audience.js.html +1 -1
- package/coverage/lcov-report/dist/test-utils/thirteen/models/brand.js.html +1 -1
- package/coverage/lcov-report/dist/test-utils/thirteen/models/category.js.html +1 -1
- package/coverage/lcov-report/dist/test-utils/thirteen/models/index.html +1 -1
- package/coverage/lcov-report/dist/test-utils/thirteen/models/member.js.html +1 -1
- package/coverage/lcov-report/dist/test-utils/thirteen/models/passion.js.html +1 -1
- package/coverage/lcov-report/dist/test-utils/thirteen/models/product.js.html +1 -1
- package/coverage/lcov-report/dist/test-utils/thirteen/models/recommendation-audience.js.html +1 -1
- package/coverage/lcov-report/dist/test-utils/thirteen/models/recommendation.js.html +1 -1
- package/coverage/lcov-report/dist/test-utils/thirteen/orm.js.html +1 -1
- package/coverage/lcov-report/dist/test-utils/three/index.html +1 -1
- package/coverage/lcov-report/dist/test-utils/three/results.js.html +1 -1
- package/coverage/lcov-report/dist/test-utils/twelve/index.html +1 -1
- package/coverage/lcov-report/dist/test-utils/twelve/models/index.html +1 -1
- package/coverage/lcov-report/dist/test-utils/twelve/models/member.js.html +1 -1
- package/coverage/lcov-report/dist/test-utils/twelve/models/prompt.js.html +1 -1
- package/coverage/lcov-report/dist/test-utils/twelve/orm.js.html +1 -1
- package/coverage/lcov-report/dist/test-utils/two/index.html +1 -1
- package/coverage/lcov-report/dist/test-utils/two/results.js.html +1 -1
- package/coverage/lcov-report/index.html +21 -21
- package/coverage/lcov-report/src/factory.ts.html +55 -25
- package/coverage/lcov-report/src/index.html +14 -14
- package/coverage/lcov-report/src/index.ts.html +1 -1
- package/coverage/lcov-report/test-utils/blog/index.html +1 -1
- package/coverage/lcov-report/test-utils/blog/models/article.ts.html +1 -1
- package/coverage/lcov-report/test-utils/blog/models/article_tag.ts.html +1 -1
- package/coverage/lcov-report/test-utils/blog/models/index.html +1 -1
- package/coverage/lcov-report/test-utils/blog/models/person.ts.html +1 -1
- package/coverage/lcov-report/test-utils/blog/models/tag.ts.html +1 -1
- package/coverage/lcov-report/test-utils/blog/orm.ts.html +1 -1
- package/coverage/lcov-report/test-utils/five/index.html +1 -1
- package/coverage/lcov-report/test-utils/five/models/index.html +1 -1
- package/coverage/lcov-report/test-utils/five/models/line-item.ts.html +1 -1
- package/coverage/lcov-report/test-utils/five/models/order.ts.html +1 -1
- package/coverage/lcov-report/test-utils/five/models/parcel-event.ts.html +1 -1
- package/coverage/lcov-report/test-utils/five/models/parcel-line-item.ts.html +1 -1
- package/coverage/lcov-report/test-utils/five/models/parcel.ts.html +1 -1
- package/coverage/lcov-report/test-utils/five/orm.ts.html +1 -1
- package/coverage/lcov-report/test-utils/nine/index.html +1 -1
- package/coverage/lcov-report/test-utils/nine/models/feature-switch.ts.html +1 -1
- package/coverage/lcov-report/test-utils/nine/models/index.html +1 -1
- package/coverage/lcov-report/test-utils/nine/orm.ts.html +1 -1
- package/coverage/lcov-report/test-utils/order/index.html +1 -1
- package/coverage/lcov-report/test-utils/order/models/index.html +1 -1
- package/coverage/lcov-report/test-utils/order/models/line-item.ts.html +1 -1
- package/coverage/lcov-report/test-utils/order/models/order.ts.html +1 -1
- package/coverage/lcov-report/test-utils/order/models/product-variant.ts.html +1 -1
- package/coverage/lcov-report/test-utils/order/models/product.ts.html +1 -1
- package/coverage/lcov-report/test-utils/order/models/utm-source.ts.html +1 -1
- package/coverage/lcov-report/test-utils/order/orm.ts.html +1 -1
- package/coverage/lcov-report/test-utils/order-more/index.html +1 -1
- package/coverage/lcov-report/test-utils/order-more/models/actual-product-variant.ts.html +1 -1
- package/coverage/lcov-report/test-utils/order-more/models/color.ts.html +1 -1
- package/coverage/lcov-report/test-utils/order-more/models/customer.ts.html +1 -1
- package/coverage/lcov-report/test-utils/order-more/models/gender.ts.html +1 -1
- package/coverage/lcov-report/test-utils/order-more/models/index.html +1 -1
- package/coverage/lcov-report/test-utils/order-more/models/inventory-level.ts.html +1 -1
- package/coverage/lcov-report/test-utils/order-more/models/line-item.ts.html +1 -1
- package/coverage/lcov-report/test-utils/order-more/models/order.ts.html +1 -1
- package/coverage/lcov-report/test-utils/order-more/models/parcel-event.ts.html +1 -1
- package/coverage/lcov-report/test-utils/order-more/models/parcel-line-item.ts.html +1 -1
- package/coverage/lcov-report/test-utils/order-more/models/parcel.ts.html +1 -1
- package/coverage/lcov-report/test-utils/order-more/models/physical-address.ts.html +1 -1
- package/coverage/lcov-report/test-utils/order-more/models/product-variant-image.ts.html +1 -1
- package/coverage/lcov-report/test-utils/order-more/models/product-variant.ts.html +1 -1
- package/coverage/lcov-report/test-utils/order-more/models/product.ts.html +1 -1
- package/coverage/lcov-report/test-utils/order-more/models/refund.ts.html +1 -1
- package/coverage/lcov-report/test-utils/order-more/models/shipment-actual-product-variant.ts.html +1 -1
- package/coverage/lcov-report/test-utils/order-more/models/shipment.ts.html +1 -1
- package/coverage/lcov-report/test-utils/order-more/models/size.ts.html +1 -1
- package/coverage/lcov-report/test-utils/order-more/models/utm-medium.ts.html +1 -1
- package/coverage/lcov-report/test-utils/order-more/models/utm-source.ts.html +1 -1
- package/coverage/lcov-report/test-utils/order-more/orm.ts.html +1 -1
- package/coverage/lcov-report/test-utils/six/index.html +1 -1
- package/coverage/lcov-report/test-utils/six/models/customer.ts.html +1 -1
- package/coverage/lcov-report/test-utils/six/models/index.html +1 -1
- package/coverage/lcov-report/test-utils/six/models/line-item.ts.html +1 -1
- package/coverage/lcov-report/test-utils/six/models/order.ts.html +1 -1
- package/coverage/lcov-report/test-utils/six/models/parcel-line-item.ts.html +1 -1
- package/coverage/lcov-report/test-utils/six/models/parcel.ts.html +1 -1
- package/coverage/lcov-report/test-utils/six/orm.ts.html +1 -1
- package/coverage/lcov-report/test-utils/thirteen/index.html +1 -1
- package/coverage/lcov-report/test-utils/thirteen/models/audience.ts.html +1 -1
- package/coverage/lcov-report/test-utils/thirteen/models/brand.ts.html +1 -1
- package/coverage/lcov-report/test-utils/thirteen/models/category.ts.html +1 -1
- package/coverage/lcov-report/test-utils/thirteen/models/index.html +1 -1
- package/coverage/lcov-report/test-utils/thirteen/models/member.ts.html +1 -1
- package/coverage/lcov-report/test-utils/thirteen/models/passion.ts.html +1 -1
- package/coverage/lcov-report/test-utils/thirteen/models/product.ts.html +1 -1
- package/coverage/lcov-report/test-utils/thirteen/models/recommendation-audience.ts.html +1 -1
- package/coverage/lcov-report/test-utils/thirteen/models/recommendation.ts.html +1 -1
- package/coverage/lcov-report/test-utils/thirteen/orm.ts.html +1 -1
- package/coverage/lcov-report/test-utils/three/index.html +1 -1
- package/coverage/lcov-report/test-utils/three/results.js.html +1 -1
- package/coverage/lcov-report/test-utils/twelve/index.html +1 -1
- package/coverage/lcov-report/test-utils/twelve/models/index.html +1 -1
- package/coverage/lcov-report/test-utils/twelve/models/member.ts.html +1 -1
- package/coverage/lcov-report/test-utils/twelve/models/prompt.ts.html +1 -1
- package/coverage/lcov-report/test-utils/twelve/orm.ts.html +1 -1
- package/coverage/lcov-report/test-utils/two/index.html +1 -1
- package/coverage/lcov-report/test-utils/two/results.js.html +1 -1
- package/coverage/lcov.info +688 -668
- package/dist/example/factories/orm.d.ts +3 -2
- package/dist/example/models/employer.d.ts +1 -1
- package/dist/example/models/job.d.ts +1 -1
- package/dist/example/models/person.d.ts +1 -1
- package/dist/src/factory.d.ts +5 -4
- package/dist/src/factory.js +14 -6
- package/dist/src/factory.spec.js +5 -5
- package/dist/test-utils/blog/models/article.d.ts +1 -1
- package/dist/test-utils/blog/models/article_tag.d.ts +1 -1
- package/dist/test-utils/blog/models/person.d.ts +1 -1
- package/dist/test-utils/blog/models/tag.d.ts +1 -1
- package/dist/test-utils/five/models/line-item.d.ts +1 -1
- package/dist/test-utils/five/models/order.d.ts +1 -1
- package/dist/test-utils/five/models/parcel-event.d.ts +1 -1
- package/dist/test-utils/five/models/parcel-line-item.d.ts +1 -1
- package/dist/test-utils/five/models/parcel.d.ts +1 -1
- package/dist/test-utils/five/orm.d.ts +3 -2
- package/dist/test-utils/nine/models/feature-switch.d.ts +1 -1
- package/dist/test-utils/nine/orm.d.ts +3 -2
- package/dist/test-utils/order/models/line-item.d.ts +1 -1
- package/dist/test-utils/order/models/order.d.ts +1 -1
- package/dist/test-utils/order/models/product-variant.d.ts +1 -1
- package/dist/test-utils/order/models/product.d.ts +1 -1
- package/dist/test-utils/order/models/utm-source.d.ts +1 -1
- package/dist/test-utils/order/orm.d.ts +3 -2
- package/dist/test-utils/order-more/models/actual-product-variant.d.ts +1 -1
- package/dist/test-utils/order-more/models/color.d.ts +1 -1
- package/dist/test-utils/order-more/models/customer.d.ts +1 -1
- package/dist/test-utils/order-more/models/gender.d.ts +1 -1
- package/dist/test-utils/order-more/models/inventory-level.d.ts +1 -1
- package/dist/test-utils/order-more/models/line-item.d.ts +1 -1
- package/dist/test-utils/order-more/models/order.d.ts +1 -1
- package/dist/test-utils/order-more/models/parcel-event.d.ts +1 -1
- package/dist/test-utils/order-more/models/parcel-line-item.d.ts +1 -1
- package/dist/test-utils/order-more/models/parcel.d.ts +1 -1
- package/dist/test-utils/order-more/models/physical-address.d.ts +1 -1
- package/dist/test-utils/order-more/models/product-variant-image.d.ts +1 -1
- package/dist/test-utils/order-more/models/product-variant.d.ts +1 -1
- package/dist/test-utils/order-more/models/product.d.ts +1 -1
- package/dist/test-utils/order-more/models/refund.d.ts +1 -1
- package/dist/test-utils/order-more/models/shipment-actual-product-variant.d.ts +1 -1
- package/dist/test-utils/order-more/models/shipment.d.ts +1 -1
- package/dist/test-utils/order-more/models/size.d.ts +1 -1
- package/dist/test-utils/order-more/models/utm-medium.d.ts +1 -1
- package/dist/test-utils/order-more/models/utm-source.d.ts +1 -1
- package/dist/test-utils/order-more/orm.d.ts +3 -2
- package/dist/test-utils/six/models/customer.d.ts +1 -1
- package/dist/test-utils/six/models/line-item.d.ts +1 -1
- package/dist/test-utils/six/models/order.d.ts +1 -1
- package/dist/test-utils/six/models/parcel-line-item.d.ts +1 -1
- package/dist/test-utils/six/models/parcel.d.ts +1 -1
- package/dist/test-utils/six/orm.d.ts +3 -2
- package/dist/test-utils/thirteen/models/audience.d.ts +1 -1
- package/dist/test-utils/thirteen/models/brand.d.ts +1 -1
- package/dist/test-utils/thirteen/models/category.d.ts +1 -1
- package/dist/test-utils/thirteen/models/member.d.ts +1 -1
- package/dist/test-utils/thirteen/models/passion.d.ts +1 -1
- package/dist/test-utils/thirteen/models/product.d.ts +1 -1
- package/dist/test-utils/thirteen/models/recommendation-audience.d.ts +1 -1
- package/dist/test-utils/thirteen/models/recommendation.d.ts +1 -1
- package/dist/test-utils/thirteen/orm.d.ts +3 -2
- package/dist/test-utils/twelve/models/member.d.ts +1 -1
- package/dist/test-utils/twelve/models/prompt.d.ts +1 -1
- package/dist/test-utils/twelve/orm.d.ts +3 -2
- package/package.json +1 -1
- package/src/factory.spec.ts +5 -5
- package/src/factory.ts +24 -14
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
declare const orm: {
|
|
2
2
|
nestClump: (clump: import("../../src/factory").IModel[][]) => object;
|
|
3
3
|
clumpIntoGroups: (processed: import("../../src/factory").IModel[][]) => import("../../src/factory").IModel[][][];
|
|
4
|
-
mapToBos: (objectified: any) =>
|
|
4
|
+
mapToBos: (objectified: any) => import("../../src/factory").IModel[];
|
|
5
5
|
objectifyDatabaseResult: (result: object) => any;
|
|
6
|
-
createFromDatabase: <T extends import("../../src/factory").ICollection<import("../../src/factory").IModel>>(_result:
|
|
6
|
+
createFromDatabase: <T extends import("../../src/factory").ICollection<import("../../src/factory").IModel>>(_result: any) => T | undefined;
|
|
7
7
|
createOneFromDatabase: <T_1 extends import("../../src/factory").IModel>(_result: any) => T_1;
|
|
8
8
|
createOneOrNoneFromDatabase: <T_2 extends import("../../src/factory").IModel>(_result: any) => void | T_2;
|
|
9
9
|
createManyFromDatabase: <T_3 extends import("../../src/factory").ICollection<import("../../src/factory").IModel>>(_result: any) => T_3;
|
|
@@ -43,5 +43,6 @@ declare const orm: {
|
|
|
43
43
|
getAnyMatching: <T_14 extends import("../../src/factory").ICollection<import("../../src/factory").IModel>>(model: import("../../src/factory").IModel) => void | T_14;
|
|
44
44
|
getAllMatching: <T_15 extends import("../../src/factory").ICollection<import("../../src/factory").IModel>>(model: import("../../src/factory").IModel) => T_15;
|
|
45
45
|
tables: any;
|
|
46
|
+
db: any;
|
|
46
47
|
};
|
|
47
48
|
export default orm;
|
|
@@ -16,7 +16,7 @@ export declare class Employers implements ICollection<Employer> {
|
|
|
16
16
|
}
|
|
17
17
|
export declare const employerEntity: {
|
|
18
18
|
tableName: string;
|
|
19
|
-
columns:
|
|
19
|
+
columns: import("../../src/factory").IColumn[];
|
|
20
20
|
Model: typeof Employer;
|
|
21
21
|
Collection: typeof Employers;
|
|
22
22
|
};
|
|
@@ -18,7 +18,7 @@ export declare class Persons implements ICollection<Person> {
|
|
|
18
18
|
}
|
|
19
19
|
export declare const personEntity: {
|
|
20
20
|
tableName: string;
|
|
21
|
-
columns:
|
|
21
|
+
columns: import("../../src/factory").IColumn[];
|
|
22
22
|
Model: typeof Person;
|
|
23
23
|
Collection: typeof Persons;
|
|
24
24
|
};
|
package/dist/src/factory.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ export interface IColumnData {
|
|
|
5
5
|
primaryKey?: boolean;
|
|
6
6
|
}
|
|
7
7
|
export declare type IColumn = IColumnData | string;
|
|
8
|
-
export declare type IColumns = Array<IColumn
|
|
8
|
+
export declare type IColumns = Array<IColumn> | (() => Array<IColumn>);
|
|
9
9
|
export interface IColumnInternalData {
|
|
10
10
|
column: string;
|
|
11
11
|
property: string;
|
|
@@ -47,16 +47,16 @@ export interface IEntityInternal<T extends IModel> {
|
|
|
47
47
|
}
|
|
48
48
|
export declare type IEntitiesInternal<T extends IModel> = Array<IEntityInternal<T>>;
|
|
49
49
|
export interface CreateOptions {
|
|
50
|
-
entities: IEntities<
|
|
50
|
+
entities: IEntities<IModel>;
|
|
51
51
|
db: any;
|
|
52
52
|
logError?: (err: Error) => void;
|
|
53
53
|
}
|
|
54
54
|
export declare const create: ({ entities: externalEntities, db, logError }: CreateOptions) => {
|
|
55
55
|
nestClump: (clump: Array<Array<IModel>>) => object;
|
|
56
56
|
clumpIntoGroups: (processed: Array<Array<IModel>>) => Array<Array<Array<IModel>>>;
|
|
57
|
-
mapToBos: (objectified: any) =>
|
|
57
|
+
mapToBos: (objectified: any) => IModel[];
|
|
58
58
|
objectifyDatabaseResult: (result: object) => any;
|
|
59
|
-
createFromDatabase: <T extends ICollection<IModel>>(_result:
|
|
59
|
+
createFromDatabase: <T extends ICollection<IModel>>(_result: any) => T | undefined;
|
|
60
60
|
createOneFromDatabase: <T_1 extends IModel>(_result: any) => T_1;
|
|
61
61
|
createOneOrNoneFromDatabase: <T_2 extends IModel>(_result: any) => void | T_2;
|
|
62
62
|
createManyFromDatabase: <T_3 extends ICollection<IModel>>(_result: any) => T_3;
|
|
@@ -96,4 +96,5 @@ export declare const create: ({ entities: externalEntities, db, logError }: Crea
|
|
|
96
96
|
getAnyMatching: <T_14 extends ICollection<IModel>>(model: IModel) => void | T_14;
|
|
97
97
|
getAllMatching: <T_15 extends ICollection<IModel>>(model: IModel) => T_15;
|
|
98
98
|
tables: any;
|
|
99
|
+
db: any;
|
|
99
100
|
};
|
package/dist/src/factory.js
CHANGED
|
@@ -7,7 +7,7 @@ const create = ({ entities: externalEntities, db, logError }) => {
|
|
|
7
7
|
const tableName = d.tableName;
|
|
8
8
|
const displayName = d.displayName || camelCase(d.tableName);
|
|
9
9
|
const collectionDisplayName = d.collectionDisplayName || `${displayName}s`;
|
|
10
|
-
const columns = d.columns.map((d) => {
|
|
10
|
+
const columns = (typeof d.columns === 'function' ? d.columns() : d.columns).map((d) => {
|
|
11
11
|
if (typeof d === 'string') {
|
|
12
12
|
return {
|
|
13
13
|
column: d,
|
|
@@ -249,12 +249,18 @@ const create = ({ entities: externalEntities, db, logError }) => {
|
|
|
249
249
|
return Object.keys(result).reduce((obj, text) => {
|
|
250
250
|
const tableName = text.split('#')[0];
|
|
251
251
|
const column = text.split('#')[1];
|
|
252
|
+
if (!tableName || !column) {
|
|
253
|
+
throw new Error('Column names must be namespaced to table');
|
|
254
|
+
}
|
|
252
255
|
obj[tableName] = obj[tableName] || {};
|
|
253
256
|
obj[tableName][column] = result[text];
|
|
254
257
|
return obj;
|
|
255
258
|
}, {});
|
|
256
259
|
};
|
|
257
260
|
const createFromDatabase = (_result) => {
|
|
261
|
+
if (!_result || !_result.length) {
|
|
262
|
+
return void 0;
|
|
263
|
+
}
|
|
258
264
|
const result = Array.isArray(_result) ? _result : [_result];
|
|
259
265
|
const objectified = result.map(objectifyDatabaseResult);
|
|
260
266
|
const boified = objectified.map(mapToBos);
|
|
@@ -278,9 +284,6 @@ const create = ({ entities: externalEntities, db, logError }) => {
|
|
|
278
284
|
return collection.models[0];
|
|
279
285
|
};
|
|
280
286
|
const createOneOrNoneFromDatabase = (_result) => {
|
|
281
|
-
if (!_result) {
|
|
282
|
-
return _result;
|
|
283
|
-
}
|
|
284
287
|
const collection = createFromDatabase(_result);
|
|
285
288
|
if (collection && collection.models.length > 1) {
|
|
286
289
|
throw Error('Got more than one.');
|
|
@@ -503,10 +506,15 @@ const create = ({ entities: externalEntities, db, logError }) => {
|
|
|
503
506
|
getOneOrNoneMatching,
|
|
504
507
|
getAnyMatching,
|
|
505
508
|
getAllMatching,
|
|
509
|
+
// tables property for access to select columns clause string
|
|
506
510
|
tables: entities.reduce((accum, data) => {
|
|
507
|
-
accum[data.displayName] =
|
|
511
|
+
accum[data.displayName] = {
|
|
512
|
+
columns: data.selectColumnsClause
|
|
513
|
+
};
|
|
508
514
|
return accum;
|
|
509
|
-
}, {})
|
|
515
|
+
}, {}),
|
|
516
|
+
// provide direct access to db
|
|
517
|
+
db
|
|
510
518
|
};
|
|
511
519
|
};
|
|
512
520
|
exports.create = create;
|
package/dist/src/factory.spec.js
CHANGED
|
@@ -558,9 +558,9 @@ test('Bo#parseFromDatabase 13', () => {
|
|
|
558
558
|
});
|
|
559
559
|
test('orm.tables', () => {
|
|
560
560
|
expect(Object.keys(orm_1.default.tables).length).toEqual(5);
|
|
561
|
-
expect(orm_1.default.tables.utmSource).toEqual('"utm_source".id as "utm_source#id", "utm_source".value as "utm_source#value", "utm_source".label as "utm_source#label", "utm_source".internal as "utm_source#internal"');
|
|
562
|
-
expect(orm_1.default.tables.order).toEqual('"order".id as "order#id", "order".email as "order#email", "order".browser_ip as "order#browser_ip", "order".browser_user_agent as "order#browser_user_agent", "order".kujo_imported_date as "order#kujo_imported_date", "order".created_date as "order#created_date", "order".cancel_reason as "order#cancel_reason", "order".cancelled_date as "order#cancelled_date", "order".closed_date as "order#closed_date", "order".processed_date as "order#processed_date", "order".updated_date as "order#updated_date", "order".note as "order#note", "order".subtotal_price as "order#subtotal_price", "order".taxes_included as "order#taxes_included", "order".total_discounts as "order#total_discounts", "order".total_price as "order#total_price", "order".total_tax as "order#total_tax", "order".total_weight as "order#total_weight", "order".order_status_url as "order#order_status_url", "order".utm_source_id as "order#utm_source_id", "order".utm_medium_id as "order#utm_medium_id", "order".utm_campaign as "order#utm_campaign", "order".utm_content as "order#utm_content", "order".utm_term as "order#utm_term"');
|
|
563
|
-
expect(orm_1.default.tables.lineItem).toEqual('"line_item".id as "line_item#id", "line_item".product_variant_id as "line_item#product_variant_id", "line_item".order_id as "line_item#order_id", "line_item".fulfillment_status_id as "line_item#fulfillment_status_id", "line_item".fulfillable_quantity as "line_item#fulfillable_quantity", "line_item".fulfillment_service as "line_item#fulfillment_service", "line_item".grams as "line_item#grams", "line_item".price as "line_item#price", "line_item".quantity as "line_item#quantity", "line_item".requires_shipping as "line_item#requires_shipping", "line_item".taxable as "line_item#taxable", "line_item".total_discount as "line_item#total_discount"');
|
|
564
|
-
expect(orm_1.default.tables.productVariant).toEqual('"product_variant".id as "product_variant#id", "product_variant".product_id as "product_variant#product_id", "product_variant".actual_product_variant_id as "product_variant#actual_product_variant_id", "product_variant".color_id as "product_variant#color_id", "product_variant".gender_id as "product_variant#gender_id", "product_variant".size_id as "product_variant#size_id", "product_variant".barcode as "product_variant#barcode", "product_variant".price as "product_variant#price", "product_variant".compare_at_price as "product_variant#compare_at_price", "product_variant".created_date as "product_variant#created_date", "product_variant".updated_date as "product_variant#updated_date", "product_variant".grams as "product_variant#grams", "product_variant".requires_shipping as "product_variant#requires_shipping"');
|
|
565
|
-
expect(orm_1.default.tables.product).toEqual('"product".id as "product#id", "product".vendor_id as "product#vendor_id", "product".value as "product#value", "product".label as "product#label", "product".product_type as "product#product_type", "product".created_date as "product#created_date", "product".updated_date as "product#updated_date", "product".published_date as "product#published_date", "product".category as "product#category"');
|
|
561
|
+
expect(orm_1.default.tables.utmSource.columns).toEqual('"utm_source".id as "utm_source#id", "utm_source".value as "utm_source#value", "utm_source".label as "utm_source#label", "utm_source".internal as "utm_source#internal"');
|
|
562
|
+
expect(orm_1.default.tables.order.columns).toEqual('"order".id as "order#id", "order".email as "order#email", "order".browser_ip as "order#browser_ip", "order".browser_user_agent as "order#browser_user_agent", "order".kujo_imported_date as "order#kujo_imported_date", "order".created_date as "order#created_date", "order".cancel_reason as "order#cancel_reason", "order".cancelled_date as "order#cancelled_date", "order".closed_date as "order#closed_date", "order".processed_date as "order#processed_date", "order".updated_date as "order#updated_date", "order".note as "order#note", "order".subtotal_price as "order#subtotal_price", "order".taxes_included as "order#taxes_included", "order".total_discounts as "order#total_discounts", "order".total_price as "order#total_price", "order".total_tax as "order#total_tax", "order".total_weight as "order#total_weight", "order".order_status_url as "order#order_status_url", "order".utm_source_id as "order#utm_source_id", "order".utm_medium_id as "order#utm_medium_id", "order".utm_campaign as "order#utm_campaign", "order".utm_content as "order#utm_content", "order".utm_term as "order#utm_term"');
|
|
563
|
+
expect(orm_1.default.tables.lineItem.columns).toEqual('"line_item".id as "line_item#id", "line_item".product_variant_id as "line_item#product_variant_id", "line_item".order_id as "line_item#order_id", "line_item".fulfillment_status_id as "line_item#fulfillment_status_id", "line_item".fulfillable_quantity as "line_item#fulfillable_quantity", "line_item".fulfillment_service as "line_item#fulfillment_service", "line_item".grams as "line_item#grams", "line_item".price as "line_item#price", "line_item".quantity as "line_item#quantity", "line_item".requires_shipping as "line_item#requires_shipping", "line_item".taxable as "line_item#taxable", "line_item".total_discount as "line_item#total_discount"');
|
|
564
|
+
expect(orm_1.default.tables.productVariant.columns).toEqual('"product_variant".id as "product_variant#id", "product_variant".product_id as "product_variant#product_id", "product_variant".actual_product_variant_id as "product_variant#actual_product_variant_id", "product_variant".color_id as "product_variant#color_id", "product_variant".gender_id as "product_variant#gender_id", "product_variant".size_id as "product_variant#size_id", "product_variant".barcode as "product_variant#barcode", "product_variant".price as "product_variant#price", "product_variant".compare_at_price as "product_variant#compare_at_price", "product_variant".created_date as "product_variant#created_date", "product_variant".updated_date as "product_variant#updated_date", "product_variant".grams as "product_variant#grams", "product_variant".requires_shipping as "product_variant#requires_shipping"');
|
|
565
|
+
expect(orm_1.default.tables.product.columns).toEqual('"product".id as "product#id", "product".vendor_id as "product#vendor_id", "product".value as "product#value", "product".label as "product#label", "product".product_type as "product#product_type", "product".created_date as "product#created_date", "product".updated_date as "product#updated_date", "product".published_date as "product#published_date", "product".category as "product#category"');
|
|
566
566
|
});
|
|
@@ -24,7 +24,7 @@ export declare class Articles implements ICollection<Article> {
|
|
|
24
24
|
}
|
|
25
25
|
export declare const articleEntity: {
|
|
26
26
|
tableName: string;
|
|
27
|
-
columns:
|
|
27
|
+
columns: import("../../../src/factory").IColumn[];
|
|
28
28
|
Model: typeof Article;
|
|
29
29
|
Collection: typeof Articles;
|
|
30
30
|
};
|
|
@@ -17,7 +17,7 @@ export declare class ArticleTags implements ICollection<ArticleTag> {
|
|
|
17
17
|
}
|
|
18
18
|
export declare const articleTagEntity: {
|
|
19
19
|
tableName: string;
|
|
20
|
-
columns:
|
|
20
|
+
columns: import("../../../src/factory").IColumn[];
|
|
21
21
|
Model: typeof ArticleTag;
|
|
22
22
|
Collection: typeof ArticleTags;
|
|
23
23
|
};
|
|
@@ -36,7 +36,7 @@ export declare class Persons implements ICollection<Person> {
|
|
|
36
36
|
}
|
|
37
37
|
export declare const personEntity: {
|
|
38
38
|
tableName: string;
|
|
39
|
-
columns:
|
|
39
|
+
columns: import("../../../src/factory").IColumn[];
|
|
40
40
|
Model: typeof Person;
|
|
41
41
|
Collection: typeof Persons;
|
|
42
42
|
};
|
|
@@ -14,7 +14,7 @@ export declare class LineItems implements ICollection<LineItem> {
|
|
|
14
14
|
}
|
|
15
15
|
export declare const lineItemEntity: {
|
|
16
16
|
tableName: string;
|
|
17
|
-
columns:
|
|
17
|
+
columns: import("../../../src/factory").IColumn[];
|
|
18
18
|
Model: typeof LineItem;
|
|
19
19
|
Collection: typeof LineItems;
|
|
20
20
|
};
|
|
@@ -12,7 +12,7 @@ export declare class Orders implements ICollection<Order> {
|
|
|
12
12
|
}
|
|
13
13
|
export declare const orderEntity: {
|
|
14
14
|
tableName: string;
|
|
15
|
-
columns:
|
|
15
|
+
columns: import("../../../src/factory").IColumn[];
|
|
16
16
|
Model: typeof Order;
|
|
17
17
|
Collection: typeof Orders;
|
|
18
18
|
};
|
|
@@ -16,7 +16,7 @@ export declare class ParcelEvents implements ICollection<ParcelEvent> {
|
|
|
16
16
|
}
|
|
17
17
|
export declare const parcelEventEntity: {
|
|
18
18
|
tableName: string;
|
|
19
|
-
columns:
|
|
19
|
+
columns: import("../../../src/factory").IColumn[];
|
|
20
20
|
Model: typeof ParcelEvent;
|
|
21
21
|
Collection: typeof ParcelEvents;
|
|
22
22
|
};
|
|
@@ -17,7 +17,7 @@ export declare class ParcelLineItems implements ICollection<ParcelLineItem> {
|
|
|
17
17
|
}
|
|
18
18
|
export declare const parcelLineItemEntity: {
|
|
19
19
|
tableName: string;
|
|
20
|
-
columns:
|
|
20
|
+
columns: import("../../../src/factory").IColumn[];
|
|
21
21
|
Model: typeof ParcelLineItem;
|
|
22
22
|
Collection: typeof ParcelLineItems;
|
|
23
23
|
};
|
|
@@ -11,7 +11,7 @@ export declare class Parcels implements ICollection<Parcel> {
|
|
|
11
11
|
}
|
|
12
12
|
export declare const parcelEntity: {
|
|
13
13
|
tableName: string;
|
|
14
|
-
columns:
|
|
14
|
+
columns: import("../../../src/factory").IColumn[];
|
|
15
15
|
Model: typeof Parcel;
|
|
16
16
|
Collection: typeof Parcels;
|
|
17
17
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
declare const orm: {
|
|
2
2
|
nestClump: (clump: import("../../src/factory").IModel[][]) => object;
|
|
3
3
|
clumpIntoGroups: (processed: import("../../src/factory").IModel[][]) => import("../../src/factory").IModel[][][];
|
|
4
|
-
mapToBos: (objectified: any) =>
|
|
4
|
+
mapToBos: (objectified: any) => import("../../src/factory").IModel[];
|
|
5
5
|
objectifyDatabaseResult: (result: object) => any;
|
|
6
|
-
createFromDatabase: <T extends import("../../src/factory").ICollection<import("../../src/factory").IModel>>(_result:
|
|
6
|
+
createFromDatabase: <T extends import("../../src/factory").ICollection<import("../../src/factory").IModel>>(_result: any) => T | undefined;
|
|
7
7
|
createOneFromDatabase: <T_1 extends import("../../src/factory").IModel>(_result: any) => T_1;
|
|
8
8
|
createOneOrNoneFromDatabase: <T_2 extends import("../../src/factory").IModel>(_result: any) => void | T_2;
|
|
9
9
|
createManyFromDatabase: <T_3 extends import("../../src/factory").ICollection<import("../../src/factory").IModel>>(_result: any) => T_3;
|
|
@@ -43,5 +43,6 @@ declare const orm: {
|
|
|
43
43
|
getAnyMatching: <T_14 extends import("../../src/factory").ICollection<import("../../src/factory").IModel>>(model: import("../../src/factory").IModel) => void | T_14;
|
|
44
44
|
getAllMatching: <T_15 extends import("../../src/factory").ICollection<import("../../src/factory").IModel>>(model: import("../../src/factory").IModel) => T_15;
|
|
45
45
|
tables: any;
|
|
46
|
+
db: any;
|
|
46
47
|
};
|
|
47
48
|
export default orm;
|
|
@@ -18,7 +18,7 @@ export declare class FeatureSwitches implements ICollection<FeatureSwitch> {
|
|
|
18
18
|
}
|
|
19
19
|
export declare const featureSwitchEntity: {
|
|
20
20
|
tableName: string;
|
|
21
|
-
columns:
|
|
21
|
+
columns: import("../../../src/factory").IColumn[];
|
|
22
22
|
Model: typeof FeatureSwitch;
|
|
23
23
|
Collection: typeof FeatureSwitches;
|
|
24
24
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
declare const orm: {
|
|
2
2
|
nestClump: (clump: import("../../src/factory").IModel[][]) => object;
|
|
3
3
|
clumpIntoGroups: (processed: import("../../src/factory").IModel[][]) => import("../../src/factory").IModel[][][];
|
|
4
|
-
mapToBos: (objectified: any) =>
|
|
4
|
+
mapToBos: (objectified: any) => import("../../src/factory").IModel[];
|
|
5
5
|
objectifyDatabaseResult: (result: object) => any;
|
|
6
|
-
createFromDatabase: <T extends import("../../src/factory").ICollection<import("../../src/factory").IModel>>(_result:
|
|
6
|
+
createFromDatabase: <T extends import("../../src/factory").ICollection<import("../../src/factory").IModel>>(_result: any) => T | undefined;
|
|
7
7
|
createOneFromDatabase: <T_1 extends import("../../src/factory").IModel>(_result: any) => T_1;
|
|
8
8
|
createOneOrNoneFromDatabase: <T_2 extends import("../../src/factory").IModel>(_result: any) => void | T_2;
|
|
9
9
|
createManyFromDatabase: <T_3 extends import("../../src/factory").ICollection<import("../../src/factory").IModel>>(_result: any) => T_3;
|
|
@@ -43,5 +43,6 @@ declare const orm: {
|
|
|
43
43
|
getAnyMatching: <T_14 extends import("../../src/factory").ICollection<import("../../src/factory").IModel>>(model: import("../../src/factory").IModel) => void | T_14;
|
|
44
44
|
getAllMatching: <T_15 extends import("../../src/factory").ICollection<import("../../src/factory").IModel>>(model: import("../../src/factory").IModel) => T_15;
|
|
45
45
|
tables: any;
|
|
46
|
+
db: any;
|
|
46
47
|
};
|
|
47
48
|
export default orm;
|
|
@@ -25,7 +25,7 @@ export declare class LineItems implements ICollection<LineItem> {
|
|
|
25
25
|
}
|
|
26
26
|
export declare const lineItemEntity: {
|
|
27
27
|
tableName: string;
|
|
28
|
-
columns:
|
|
28
|
+
columns: import("../../../src/factory").IColumn[];
|
|
29
29
|
Model: typeof LineItem;
|
|
30
30
|
Collection: typeof LineItems;
|
|
31
31
|
};
|
|
@@ -36,7 +36,7 @@ export declare class Orders implements ICollection<Order> {
|
|
|
36
36
|
}
|
|
37
37
|
export declare const orderEntity: {
|
|
38
38
|
tableName: string;
|
|
39
|
-
columns:
|
|
39
|
+
columns: import("../../../src/factory").IColumn[];
|
|
40
40
|
Model: typeof Order;
|
|
41
41
|
Collection: typeof Orders;
|
|
42
42
|
};
|
|
@@ -25,7 +25,7 @@ export declare class ProductVariants implements ICollection<ProductVariant> {
|
|
|
25
25
|
}
|
|
26
26
|
export declare const productVariantEntity: {
|
|
27
27
|
tableName: string;
|
|
28
|
-
columns:
|
|
28
|
+
columns: import("../../../src/factory").IColumn[];
|
|
29
29
|
Model: typeof ProductVariant;
|
|
30
30
|
Collection: typeof ProductVariants;
|
|
31
31
|
};
|
|
@@ -19,7 +19,7 @@ export declare class Products implements ICollection<Product> {
|
|
|
19
19
|
}
|
|
20
20
|
export declare const productEntity: {
|
|
21
21
|
tableName: string;
|
|
22
|
-
columns:
|
|
22
|
+
columns: import("../../../src/factory").IColumn[];
|
|
23
23
|
Model: typeof Product;
|
|
24
24
|
Collection: typeof Products;
|
|
25
25
|
};
|
|
@@ -14,7 +14,7 @@ export declare class UtmSources implements ICollection<UtmSource> {
|
|
|
14
14
|
}
|
|
15
15
|
export declare const utmSourceEntity: {
|
|
16
16
|
tableName: string;
|
|
17
|
-
columns:
|
|
17
|
+
columns: import("../../../src/factory").IColumn[];
|
|
18
18
|
Model: typeof UtmSource;
|
|
19
19
|
Collection: typeof UtmSources;
|
|
20
20
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
declare const orm: {
|
|
2
2
|
nestClump: (clump: import("../../src/factory").IModel[][]) => object;
|
|
3
3
|
clumpIntoGroups: (processed: import("../../src/factory").IModel[][]) => import("../../src/factory").IModel[][][];
|
|
4
|
-
mapToBos: (objectified: any) =>
|
|
4
|
+
mapToBos: (objectified: any) => import("../../src/factory").IModel[];
|
|
5
5
|
objectifyDatabaseResult: (result: object) => any;
|
|
6
|
-
createFromDatabase: <T extends import("../../src/factory").ICollection<import("../../src/factory").IModel>>(_result:
|
|
6
|
+
createFromDatabase: <T extends import("../../src/factory").ICollection<import("../../src/factory").IModel>>(_result: any) => T | undefined;
|
|
7
7
|
createOneFromDatabase: <T_1 extends import("../../src/factory").IModel>(_result: any) => T_1;
|
|
8
8
|
createOneOrNoneFromDatabase: <T_2 extends import("../../src/factory").IModel>(_result: any) => void | T_2;
|
|
9
9
|
createManyFromDatabase: <T_3 extends import("../../src/factory").ICollection<import("../../src/factory").IModel>>(_result: any) => T_3;
|
|
@@ -43,5 +43,6 @@ declare const orm: {
|
|
|
43
43
|
getAnyMatching: <T_14 extends import("../../src/factory").ICollection<import("../../src/factory").IModel>>(model: import("../../src/factory").IModel) => void | T_14;
|
|
44
44
|
getAllMatching: <T_15 extends import("../../src/factory").ICollection<import("../../src/factory").IModel>>(model: import("../../src/factory").IModel) => T_15;
|
|
45
45
|
tables: any;
|
|
46
|
+
db: any;
|
|
46
47
|
};
|
|
47
48
|
export default orm;
|
|
@@ -12,7 +12,7 @@ export declare class ActualProductVariants implements ICollection<ActualProductV
|
|
|
12
12
|
}
|
|
13
13
|
export declare const actualProductVariantEntity: {
|
|
14
14
|
tableName: string;
|
|
15
|
-
columns:
|
|
15
|
+
columns: import("../../../src/factory").IColumn[];
|
|
16
16
|
Model: typeof ActualProductVariant;
|
|
17
17
|
Collection: typeof ActualProductVariants;
|
|
18
18
|
};
|
|
@@ -15,7 +15,7 @@ export declare class Colors implements ICollection<Color> {
|
|
|
15
15
|
}
|
|
16
16
|
export declare const colorEntity: {
|
|
17
17
|
tableName: string;
|
|
18
|
-
columns:
|
|
18
|
+
columns: import("../../../src/factory").IColumn[];
|
|
19
19
|
Model: typeof Color;
|
|
20
20
|
Collection: typeof Colors;
|
|
21
21
|
};
|
|
@@ -12,7 +12,7 @@ export declare class Customers implements ICollection<Customer> {
|
|
|
12
12
|
}
|
|
13
13
|
export declare const customerEntity: {
|
|
14
14
|
tableName: string;
|
|
15
|
-
columns:
|
|
15
|
+
columns: import("../../../src/factory").IColumn[];
|
|
16
16
|
Model: typeof Customer;
|
|
17
17
|
Collection: typeof Customers;
|
|
18
18
|
};
|
|
@@ -13,7 +13,7 @@ export declare class Genders implements ICollection<Gender> {
|
|
|
13
13
|
}
|
|
14
14
|
export declare const genderEntity: {
|
|
15
15
|
tableName: string;
|
|
16
|
-
columns:
|
|
16
|
+
columns: import("../../../src/factory").IColumn[];
|
|
17
17
|
Model: typeof Gender;
|
|
18
18
|
Collection: typeof Genders;
|
|
19
19
|
};
|
|
@@ -21,7 +21,7 @@ export declare class InventoryLevels implements ICollection<InventoryLevel> {
|
|
|
21
21
|
}
|
|
22
22
|
export declare const inventoryLevelEntity: {
|
|
23
23
|
tableName: string;
|
|
24
|
-
columns:
|
|
24
|
+
columns: import("../../../src/factory").IColumn[];
|
|
25
25
|
Model: typeof InventoryLevel;
|
|
26
26
|
Collection: typeof InventoryLevels;
|
|
27
27
|
};
|
|
@@ -25,7 +25,7 @@ export declare class LineItems implements ICollection<LineItem> {
|
|
|
25
25
|
}
|
|
26
26
|
export declare const lineItemEntity: {
|
|
27
27
|
tableName: string;
|
|
28
|
-
columns:
|
|
28
|
+
columns: import("../../../src/factory").IColumn[];
|
|
29
29
|
Model: typeof LineItem;
|
|
30
30
|
Collection: typeof LineItems;
|
|
31
31
|
};
|
|
@@ -44,7 +44,7 @@ export declare class Orders implements ICollection<Order> {
|
|
|
44
44
|
}
|
|
45
45
|
export declare const orderEntity: {
|
|
46
46
|
tableName: string;
|
|
47
|
-
columns:
|
|
47
|
+
columns: import("../../../src/factory").IColumn[];
|
|
48
48
|
Model: typeof Order;
|
|
49
49
|
Collection: typeof Orders;
|
|
50
50
|
};
|
|
@@ -16,7 +16,7 @@ export declare class ParcelEvents implements ICollection<ParcelEvent> {
|
|
|
16
16
|
}
|
|
17
17
|
export declare const parcelEventEntity: {
|
|
18
18
|
tableName: string;
|
|
19
|
-
columns:
|
|
19
|
+
columns: import("../../../src/factory").IColumn[];
|
|
20
20
|
Model: typeof ParcelEvent;
|
|
21
21
|
Collection: typeof ParcelEvents;
|
|
22
22
|
};
|
|
@@ -17,7 +17,7 @@ export declare class ParcelLineItems implements ICollection<ParcelLineItem> {
|
|
|
17
17
|
}
|
|
18
18
|
export declare const parcelLineItemEntity: {
|
|
19
19
|
tableName: string;
|
|
20
|
-
columns:
|
|
20
|
+
columns: import("../../../src/factory").IColumn[];
|
|
21
21
|
Model: typeof ParcelLineItem;
|
|
22
22
|
Collection: typeof ParcelLineItems;
|
|
23
23
|
};
|
|
@@ -11,7 +11,7 @@ export declare class Parcels implements ICollection<Parcel> {
|
|
|
11
11
|
}
|
|
12
12
|
export declare const parcelEntity: {
|
|
13
13
|
tableName: string;
|
|
14
|
-
columns:
|
|
14
|
+
columns: import("../../../src/factory").IColumn[];
|
|
15
15
|
Model: typeof Parcel;
|
|
16
16
|
Collection: typeof Parcels;
|
|
17
17
|
};
|
|
@@ -21,7 +21,7 @@ export declare class PhysicalAddresses implements ICollection<PhysicalAddress> {
|
|
|
21
21
|
}
|
|
22
22
|
export declare const physicalAddressEntity: {
|
|
23
23
|
tableName: string;
|
|
24
|
-
columns:
|
|
24
|
+
columns: import("../../../src/factory").IColumn[];
|
|
25
25
|
Model: typeof PhysicalAddress;
|
|
26
26
|
Collection: typeof PhysicalAddresses;
|
|
27
27
|
};
|
|
@@ -17,7 +17,7 @@ export declare class ProductVariantImages implements ICollection<ProductVariantI
|
|
|
17
17
|
}
|
|
18
18
|
export declare const productVariantImageEntity: {
|
|
19
19
|
tableName: string;
|
|
20
|
-
columns:
|
|
20
|
+
columns: import("../../../src/factory").IColumn[];
|
|
21
21
|
Model: typeof ProductVariantImage;
|
|
22
22
|
Collection: typeof ProductVariantImages;
|
|
23
23
|
};
|
|
@@ -35,7 +35,7 @@ export declare class ProductVariants implements ICollection<ProductVariant> {
|
|
|
35
35
|
}
|
|
36
36
|
export declare const productVariantEntity: {
|
|
37
37
|
tableName: string;
|
|
38
|
-
columns:
|
|
38
|
+
columns: import("../../../src/factory").IColumn[];
|
|
39
39
|
Model: typeof ProductVariant;
|
|
40
40
|
Collection: typeof ProductVariants;
|
|
41
41
|
};
|
|
@@ -20,7 +20,7 @@ export declare class Products implements ICollection<Product> {
|
|
|
20
20
|
}
|
|
21
21
|
export declare const productEntity: {
|
|
22
22
|
tableName: string;
|
|
23
|
-
columns:
|
|
23
|
+
columns: import("../../../src/factory").IColumn[];
|
|
24
24
|
Model: typeof Product;
|
|
25
25
|
Collection: typeof Products;
|
|
26
26
|
};
|
|
@@ -21,7 +21,7 @@ export declare class Refunds implements ICollection<Refund> {
|
|
|
21
21
|
}
|
|
22
22
|
export declare const refundEntity: {
|
|
23
23
|
tableName: string;
|
|
24
|
-
columns:
|
|
24
|
+
columns: import("../../../src/factory").IColumn[];
|
|
25
25
|
Model: typeof Refund;
|
|
26
26
|
Collection: typeof Refunds;
|
|
27
27
|
};
|
|
@@ -19,7 +19,7 @@ export declare class ShipmentActualProductVariants implements ICollection<Shipme
|
|
|
19
19
|
}
|
|
20
20
|
export declare const shipmentActualProductVariantEntity: {
|
|
21
21
|
tableName: string;
|
|
22
|
-
columns:
|
|
22
|
+
columns: import("../../../src/factory").IColumn[];
|
|
23
23
|
Model: typeof ShipmentActualProductVariant;
|
|
24
24
|
Collection: typeof ShipmentActualProductVariants;
|
|
25
25
|
};
|
|
@@ -13,7 +13,7 @@ export declare class Shipments implements ICollection<Shipment> {
|
|
|
13
13
|
}
|
|
14
14
|
export declare const shipmentEntity: {
|
|
15
15
|
tableName: string;
|
|
16
|
-
columns:
|
|
16
|
+
columns: import("../../../src/factory").IColumn[];
|
|
17
17
|
Model: typeof Shipment;
|
|
18
18
|
Collection: typeof Shipments;
|
|
19
19
|
};
|
|
@@ -13,7 +13,7 @@ export declare class UtmMediums implements ICollection<UtmMedium> {
|
|
|
13
13
|
}
|
|
14
14
|
export declare const utmMediumEntity: {
|
|
15
15
|
tableName: string;
|
|
16
|
-
columns:
|
|
16
|
+
columns: import("../../../src/factory").IColumn[];
|
|
17
17
|
Model: typeof UtmMedium;
|
|
18
18
|
Collection: typeof UtmMediums;
|
|
19
19
|
};
|
|
@@ -14,7 +14,7 @@ export declare class UtmSources implements ICollection<UtmSource> {
|
|
|
14
14
|
}
|
|
15
15
|
export declare const utmSourceEntity: {
|
|
16
16
|
tableName: string;
|
|
17
|
-
columns:
|
|
17
|
+
columns: import("../../../src/factory").IColumn[];
|
|
18
18
|
Model: typeof UtmSource;
|
|
19
19
|
Collection: typeof UtmSources;
|
|
20
20
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
declare const orm: {
|
|
2
2
|
nestClump: (clump: import("../../src/factory").IModel[][]) => object;
|
|
3
3
|
clumpIntoGroups: (processed: import("../../src/factory").IModel[][]) => import("../../src/factory").IModel[][][];
|
|
4
|
-
mapToBos: (objectified: any) =>
|
|
4
|
+
mapToBos: (objectified: any) => import("../../src/factory").IModel[];
|
|
5
5
|
objectifyDatabaseResult: (result: object) => any;
|
|
6
|
-
createFromDatabase: <T extends import("../../src/factory").ICollection<import("../../src/factory").IModel>>(_result:
|
|
6
|
+
createFromDatabase: <T extends import("../../src/factory").ICollection<import("../../src/factory").IModel>>(_result: any) => T | undefined;
|
|
7
7
|
createOneFromDatabase: <T_1 extends import("../../src/factory").IModel>(_result: any) => T_1;
|
|
8
8
|
createOneOrNoneFromDatabase: <T_2 extends import("../../src/factory").IModel>(_result: any) => void | T_2;
|
|
9
9
|
createManyFromDatabase: <T_3 extends import("../../src/factory").ICollection<import("../../src/factory").IModel>>(_result: any) => T_3;
|
|
@@ -43,5 +43,6 @@ declare const orm: {
|
|
|
43
43
|
getAnyMatching: <T_14 extends import("../../src/factory").ICollection<import("../../src/factory").IModel>>(model: import("../../src/factory").IModel) => void | T_14;
|
|
44
44
|
getAllMatching: <T_15 extends import("../../src/factory").ICollection<import("../../src/factory").IModel>>(model: import("../../src/factory").IModel) => T_15;
|
|
45
45
|
tables: any;
|
|
46
|
+
db: any;
|
|
46
47
|
};
|
|
47
48
|
export default orm;
|
|
@@ -12,7 +12,7 @@ export declare class Customers implements ICollection<Customer> {
|
|
|
12
12
|
}
|
|
13
13
|
export declare const customerEntity: {
|
|
14
14
|
tableName: string;
|
|
15
|
-
columns:
|
|
15
|
+
columns: import("../../../src/factory").IColumn[];
|
|
16
16
|
Model: typeof Customer;
|
|
17
17
|
Collection: typeof Customers;
|
|
18
18
|
};
|