@antelopejs/interface-data-api 0.4.0 → 0.5.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.
Files changed (121) hide show
  1. package/dist/components.d.ts +15 -7
  2. package/dist/components.js +98 -645
  3. package/dist/components.js.map +1 -1
  4. package/dist/index.d.ts +41 -36
  5. package/dist/index.js +94 -92
  6. package/dist/index.js.map +1 -1
  7. package/dist/internal/computed.d.ts +6 -0
  8. package/dist/internal/computed.js +43 -0
  9. package/dist/internal/computed.js.map +1 -0
  10. package/dist/internal/controller-types.d.ts +19 -0
  11. package/dist/internal/controller-types.js +4 -0
  12. package/dist/internal/controller-types.js.map +1 -0
  13. package/dist/internal/default-filter.d.ts +4 -0
  14. package/dist/internal/default-filter.js +19 -0
  15. package/dist/internal/default-filter.js.map +1 -0
  16. package/dist/internal/deferred-joined-stream.d.ts +11 -0
  17. package/dist/internal/deferred-joined-stream.js +112 -0
  18. package/dist/internal/deferred-joined-stream.js.map +1 -0
  19. package/dist/internal/field-types.d.ts +183 -0
  20. package/dist/internal/field-types.js +4 -0
  21. package/dist/internal/field-types.js.map +1 -0
  22. package/dist/internal/filters.d.ts +4 -0
  23. package/dist/internal/filters.js +15 -0
  24. package/dist/internal/filters.js.map +1 -0
  25. package/dist/internal/foreign.d.ts +6 -0
  26. package/dist/internal/foreign.js +116 -0
  27. package/dist/internal/foreign.js.map +1 -0
  28. package/dist/internal/guards.d.ts +20 -0
  29. package/dist/internal/guards.js +74 -0
  30. package/dist/internal/guards.js.map +1 -0
  31. package/dist/internal/joined.d.ts +28 -0
  32. package/dist/internal/joined.js +127 -0
  33. package/dist/internal/joined.js.map +1 -0
  34. package/dist/internal/list.d.ts +16 -0
  35. package/dist/internal/list.js +178 -0
  36. package/dist/internal/list.js.map +1 -0
  37. package/dist/internal/meta-records.d.ts +17 -0
  38. package/dist/internal/meta-records.js +73 -0
  39. package/dist/internal/meta-records.js.map +1 -0
  40. package/dist/internal/properties.d.ts +4 -0
  41. package/dist/internal/properties.js +43 -0
  42. package/dist/internal/properties.js.map +1 -0
  43. package/dist/internal/table-reference.d.ts +11 -0
  44. package/dist/internal/table-reference.js +46 -0
  45. package/dist/internal/table-reference.js.map +1 -0
  46. package/dist/internal/tables.d.ts +18 -0
  47. package/dist/internal/tables.js +37 -0
  48. package/dist/internal/tables.js.map +1 -0
  49. package/dist/internal/validation.d.ts +11 -0
  50. package/dist/internal/validation.js +88 -0
  51. package/dist/internal/validation.js.map +1 -0
  52. package/dist/metadata.d.ts +27 -228
  53. package/dist/metadata.js +61 -188
  54. package/dist/metadata.js.map +1 -1
  55. package/dist/tests/components/access_control.test.js +20 -20
  56. package/dist/tests/components/access_control.test.js.map +1 -1
  57. package/dist/tests/components/computed.test.js +28 -30
  58. package/dist/tests/components/computed.test.js.map +1 -1
  59. package/dist/tests/components/cross_instance.test.js +8 -6
  60. package/dist/tests/components/cross_instance.test.js.map +1 -1
  61. package/dist/tests/components/deferred_joined.test.js +56 -53
  62. package/dist/tests/components/deferred_joined.test.js.map +1 -1
  63. package/dist/tests/components/filter_options.test.js +8 -7
  64. package/dist/tests/components/filter_options.test.js.map +1 -1
  65. package/dist/tests/components/foreign_computed.test.js +14 -16
  66. package/dist/tests/components/foreign_computed.test.js.map +1 -1
  67. package/dist/tests/components/foreign_joined.test.js +19 -27
  68. package/dist/tests/components/foreign_joined.test.js.map +1 -1
  69. package/dist/tests/components/joined.test.js +41 -45
  70. package/dist/tests/components/joined.test.js.map +1 -1
  71. package/dist/tests/components/listable.test.js +59 -58
  72. package/dist/tests/components/listable.test.js.map +1 -1
  73. package/dist/tests/components/localized_sort.test.js +10 -11
  74. package/dist/tests/components/localized_sort.test.js.map +1 -1
  75. package/dist/tests/components/mandatory.test.js +25 -25
  76. package/dist/tests/components/mandatory.test.js.map +1 -1
  77. package/dist/tests/components/modifier_key.test.js +19 -18
  78. package/dist/tests/components/modifier_key.test.js.map +1 -1
  79. package/dist/tests/components/parse_body.test.d.ts +1 -0
  80. package/dist/tests/components/parse_body.test.js +75 -0
  81. package/dist/tests/components/parse_body.test.js.map +1 -0
  82. package/dist/tests/components/parsed_value.test.js +23 -21
  83. package/dist/tests/components/parsed_value.test.js.map +1 -1
  84. package/dist/tests/components/partial_edit.test.js +33 -32
  85. package/dist/tests/components/partial_edit.test.js.map +1 -1
  86. package/dist/tests/components/per_action_access.test.js +12 -12
  87. package/dist/tests/components/per_action_access.test.js.map +1 -1
  88. package/dist/tests/components/validator.test.js +45 -37
  89. package/dist/tests/components/validator.test.js.map +1 -1
  90. package/dist/tests/helpers/other-instance.d.ts +11 -1
  91. package/dist/tests/helpers/other-instance.js +27 -5
  92. package/dist/tests/helpers/other-instance.js.map +1 -1
  93. package/dist/tests/index/get_guard.test.js +6 -6
  94. package/dist/tests/index/get_guard.test.js.map +1 -1
  95. package/dist/tests/index/inheritance.test.js +10 -9
  96. package/dist/tests/index/inheritance.test.js.map +1 -1
  97. package/dist/tests/index/routes.test.js +40 -44
  98. package/dist/tests/index/routes.test.js.map +1 -1
  99. package/dist/tests/integration.test.d.ts +1 -1
  100. package/dist/tests/integration.test.js +53 -729
  101. package/dist/tests/integration.test.js.map +1 -1
  102. package/dist/tests/internal/http.d.ts +23 -0
  103. package/dist/tests/internal/http.js +35 -0
  104. package/dist/tests/internal/http.js.map +1 -0
  105. package/dist/tests/internal/shop-api.d.ts +1 -0
  106. package/dist/tests/internal/shop-api.js +331 -0
  107. package/dist/tests/internal/shop-api.js.map +1 -0
  108. package/dist/tests/internal/shop-schema.d.ts +154 -0
  109. package/dist/tests/internal/shop-schema.js +387 -0
  110. package/dist/tests/internal/shop-schema.js.map +1 -0
  111. package/dist/tests/utils.d.ts +5 -5
  112. package/dist/tests/utils.js +1 -3
  113. package/dist/tests/utils.js.map +1 -1
  114. package/dist/tests/utils.test.js +10 -11
  115. package/dist/tests/utils.test.js.map +1 -1
  116. package/docs/3.routes.md +8 -3
  117. package/docs/5.validators.md +12 -3
  118. package/docs/8.filters.md +7 -3
  119. package/package.json +14 -3
  120. package/skills/data-api-interface/SKILL.md +4 -0
  121. package/skills/data-api-interface/cases.json +99 -0
@@ -0,0 +1,154 @@
1
+ /** @internal @packageDocumentation */
2
+ import { Table } from "@antelopejs/interface-database-decorators";
3
+ export declare class Customer extends Table {
4
+ _id: string;
5
+ email: string;
6
+ firstName: string;
7
+ lastName: string;
8
+ phone: string;
9
+ address: string;
10
+ city: string;
11
+ postalCode: string;
12
+ country: string;
13
+ registrationDate: Date;
14
+ isActive: boolean;
15
+ loyaltyPoints: number;
16
+ preferences: string[];
17
+ }
18
+ export declare class Product extends Table {
19
+ _id: string;
20
+ sku: string;
21
+ name: string;
22
+ description: string;
23
+ price: number;
24
+ costPrice: number;
25
+ stockQuantity: number;
26
+ category: string;
27
+ brand: string;
28
+ tags: string[];
29
+ images: string[];
30
+ isActive: boolean;
31
+ createdAt: Date;
32
+ updatedAt: Date;
33
+ }
34
+ export declare class Order extends Table {
35
+ _id: string;
36
+ orderNumber: string;
37
+ customerId: string;
38
+ status: string;
39
+ totalAmount: number;
40
+ shippingCost: number;
41
+ taxAmount: number;
42
+ discountAmount: number;
43
+ finalAmount: number;
44
+ shippingAddress: string;
45
+ billingAddress: string;
46
+ paymentMethod: string;
47
+ notes: string;
48
+ createdAt: Date;
49
+ updatedAt: Date;
50
+ }
51
+ export declare class OrderItem extends Table {
52
+ _id: string;
53
+ orderId: string;
54
+ productId: string;
55
+ quantity: number;
56
+ unitPrice: number;
57
+ totalPrice: number;
58
+ finalPrice: number;
59
+ discount: number;
60
+ }
61
+ declare const CustomerModel_base: {
62
+ new (database: import("@antelopejs/interface-database").SchemaInstance<any>): {
63
+ readonly table: import("@antelopejs/interface-database").Table<Customer>;
64
+ readonly database: import("@antelopejs/interface-database").SchemaInstance<any>;
65
+ get(id: string): PromiseLike<Customer | undefined>;
66
+ getBy(index: keyof Customer, ...keys: any[]): PromiseLike<Customer[]>;
67
+ getAll(): PromiseLike<Customer[]>;
68
+ insert(obj: import("@antelopejs/interface-database-decorators").DeepPartial<Customer> | import("@antelopejs/interface-database-decorators").DeepPartial<Customer>[], options?: import("@antelopejs/interface-database-decorators").ValidateOptions): Promise<string[]>;
69
+ update(id: string, obj: import("@antelopejs/interface-database-decorators").DeepPartial<Customer>, options?: import("@antelopejs/interface-database-decorators").ValidateOptions): Promise<number>;
70
+ update(obj: import("@antelopejs/interface-database-decorators").DeepPartial<Customer>, options?: import("@antelopejs/interface-database-decorators").ValidateOptions): Promise<number>;
71
+ delete(id: string): Promise<number>;
72
+ };
73
+ readonly schemaName: string;
74
+ readonly tableClass: import("@antelopejs/interface-database-decorators").Constructible<Customer>;
75
+ fromPlainData(obj: any): Customer;
76
+ fromDatabase(obj: any): Customer | undefined;
77
+ toDatabase(obj: any): Record<string, any>;
78
+ validate(obj: unknown, options?: import("@antelopejs/interface-database-decorators").ValidateInputOptions): import("@antelopejs/interface-database-decorators").ValidationResult;
79
+ };
80
+ export declare class CustomerModel extends CustomerModel_base {
81
+ }
82
+ declare const ProductModel_base: {
83
+ new (database: import("@antelopejs/interface-database").SchemaInstance<any>): {
84
+ readonly table: import("@antelopejs/interface-database").Table<Product>;
85
+ readonly database: import("@antelopejs/interface-database").SchemaInstance<any>;
86
+ get(id: string): PromiseLike<Product | undefined>;
87
+ getBy(index: keyof Product, ...keys: any[]): PromiseLike<Product[]>;
88
+ getAll(): PromiseLike<Product[]>;
89
+ insert(obj: import("@antelopejs/interface-database-decorators").DeepPartial<Product> | import("@antelopejs/interface-database-decorators").DeepPartial<Product>[], options?: import("@antelopejs/interface-database-decorators").ValidateOptions): Promise<string[]>;
90
+ update(id: string, obj: import("@antelopejs/interface-database-decorators").DeepPartial<Product>, options?: import("@antelopejs/interface-database-decorators").ValidateOptions): Promise<number>;
91
+ update(obj: import("@antelopejs/interface-database-decorators").DeepPartial<Product>, options?: import("@antelopejs/interface-database-decorators").ValidateOptions): Promise<number>;
92
+ delete(id: string): Promise<number>;
93
+ };
94
+ readonly schemaName: string;
95
+ readonly tableClass: import("@antelopejs/interface-database-decorators").Constructible<Product>;
96
+ fromPlainData(obj: any): Product;
97
+ fromDatabase(obj: any): Product | undefined;
98
+ toDatabase(obj: any): Record<string, any>;
99
+ validate(obj: unknown, options?: import("@antelopejs/interface-database-decorators").ValidateInputOptions): import("@antelopejs/interface-database-decorators").ValidationResult;
100
+ };
101
+ export declare class ProductModel extends ProductModel_base {
102
+ }
103
+ declare const OrderModel_base: {
104
+ new (database: import("@antelopejs/interface-database").SchemaInstance<any>): {
105
+ readonly table: import("@antelopejs/interface-database").Table<Order>;
106
+ readonly database: import("@antelopejs/interface-database").SchemaInstance<any>;
107
+ get(id: string): PromiseLike<Order | undefined>;
108
+ getBy(index: keyof Order, ...keys: any[]): PromiseLike<Order[]>;
109
+ getAll(): PromiseLike<Order[]>;
110
+ insert(obj: import("@antelopejs/interface-database-decorators").DeepPartial<Order> | import("@antelopejs/interface-database-decorators").DeepPartial<Order>[], options?: import("@antelopejs/interface-database-decorators").ValidateOptions): Promise<string[]>;
111
+ update(id: string, obj: import("@antelopejs/interface-database-decorators").DeepPartial<Order>, options?: import("@antelopejs/interface-database-decorators").ValidateOptions): Promise<number>;
112
+ update(obj: import("@antelopejs/interface-database-decorators").DeepPartial<Order>, options?: import("@antelopejs/interface-database-decorators").ValidateOptions): Promise<number>;
113
+ delete(id: string): Promise<number>;
114
+ };
115
+ readonly schemaName: string;
116
+ readonly tableClass: import("@antelopejs/interface-database-decorators").Constructible<Order>;
117
+ fromPlainData(obj: any): Order;
118
+ fromDatabase(obj: any): Order | undefined;
119
+ toDatabase(obj: any): Record<string, any>;
120
+ validate(obj: unknown, options?: import("@antelopejs/interface-database-decorators").ValidateInputOptions): import("@antelopejs/interface-database-decorators").ValidationResult;
121
+ };
122
+ export declare class OrderModel extends OrderModel_base {
123
+ }
124
+ declare const OrderItemModel_base: {
125
+ new (database: import("@antelopejs/interface-database").SchemaInstance<any>): {
126
+ readonly table: import("@antelopejs/interface-database").Table<OrderItem>;
127
+ readonly database: import("@antelopejs/interface-database").SchemaInstance<any>;
128
+ get(id: string): PromiseLike<OrderItem | undefined>;
129
+ getBy(index: keyof OrderItem, ...keys: any[]): PromiseLike<OrderItem[]>;
130
+ getAll(): PromiseLike<OrderItem[]>;
131
+ insert(obj: import("@antelopejs/interface-database-decorators").DeepPartial<OrderItem> | import("@antelopejs/interface-database-decorators").DeepPartial<OrderItem>[], options?: import("@antelopejs/interface-database-decorators").ValidateOptions): Promise<string[]>;
132
+ update(id: string, obj: import("@antelopejs/interface-database-decorators").DeepPartial<OrderItem>, options?: import("@antelopejs/interface-database-decorators").ValidateOptions): Promise<number>;
133
+ update(obj: import("@antelopejs/interface-database-decorators").DeepPartial<OrderItem>, options?: import("@antelopejs/interface-database-decorators").ValidateOptions): Promise<number>;
134
+ delete(id: string): Promise<number>;
135
+ };
136
+ readonly schemaName: string;
137
+ readonly tableClass: import("@antelopejs/interface-database-decorators").Constructible<OrderItem>;
138
+ fromPlainData(obj: any): OrderItem;
139
+ fromDatabase(obj: any): OrderItem | undefined;
140
+ toDatabase(obj: any): Record<string, any>;
141
+ validate(obj: unknown, options?: import("@antelopejs/interface-database-decorators").ValidateInputOptions): import("@antelopejs/interface-database-decorators").ValidationResult;
142
+ };
143
+ export declare class OrderItemModel extends OrderItemModel_base {
144
+ }
145
+ export declare function initializeDatabase(): Promise<void>;
146
+ export declare function cleanTables(): Promise<void>;
147
+ export declare function createTestData(): Promise<{
148
+ customerIds: string[];
149
+ productIds: string[];
150
+ customerModel: CustomerModel;
151
+ productModel: ProductModel;
152
+ orderModel: OrderModel;
153
+ }>;
154
+ export {};
@@ -0,0 +1,387 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.OrderItemModel = exports.OrderModel = exports.ProductModel = exports.CustomerModel = exports.OrderItem = exports.Order = exports.Product = exports.Customer = void 0;
13
+ exports.initializeDatabase = initializeDatabase;
14
+ exports.cleanTables = cleanTables;
15
+ exports.createTestData = createTestData;
16
+ /** @internal @packageDocumentation */
17
+ const interface_database_decorators_1 = require("@antelopejs/interface-database-decorators");
18
+ const utils_1 = require("../utils");
19
+ const currentTestName = "integration";
20
+ const customerTableName = `customers-${currentTestName}`;
21
+ const productTableName = `products-${currentTestName}`;
22
+ const orderTableName = `orders-${currentTestName}`;
23
+ const orderItemTableName = `order_items-${currentTestName}`;
24
+ const schemaName = "default";
25
+ let Customer = class Customer extends interface_database_decorators_1.Table {
26
+ };
27
+ exports.Customer = Customer;
28
+ __decorate([
29
+ (0, interface_database_decorators_1.Index)(),
30
+ (0, interface_database_decorators_1.Field)("string"),
31
+ __metadata("design:type", String)
32
+ ], Customer.prototype, "email", void 0);
33
+ __decorate([
34
+ (0, interface_database_decorators_1.Field)("string"),
35
+ __metadata("design:type", String)
36
+ ], Customer.prototype, "firstName", void 0);
37
+ __decorate([
38
+ (0, interface_database_decorators_1.Field)("string"),
39
+ __metadata("design:type", String)
40
+ ], Customer.prototype, "lastName", void 0);
41
+ __decorate([
42
+ (0, interface_database_decorators_1.Field)("string"),
43
+ __metadata("design:type", String)
44
+ ], Customer.prototype, "phone", void 0);
45
+ __decorate([
46
+ (0, interface_database_decorators_1.Field)("string"),
47
+ __metadata("design:type", String)
48
+ ], Customer.prototype, "address", void 0);
49
+ __decorate([
50
+ (0, interface_database_decorators_1.Field)("string"),
51
+ __metadata("design:type", String)
52
+ ], Customer.prototype, "city", void 0);
53
+ __decorate([
54
+ (0, interface_database_decorators_1.Field)("string"),
55
+ __metadata("design:type", String)
56
+ ], Customer.prototype, "postalCode", void 0);
57
+ __decorate([
58
+ (0, interface_database_decorators_1.Field)("string"),
59
+ __metadata("design:type", String)
60
+ ], Customer.prototype, "country", void 0);
61
+ __decorate([
62
+ (0, interface_database_decorators_1.Field)("date"),
63
+ __metadata("design:type", Date)
64
+ ], Customer.prototype, "registrationDate", void 0);
65
+ __decorate([
66
+ (0, interface_database_decorators_1.Field)("boolean"),
67
+ __metadata("design:type", Boolean)
68
+ ], Customer.prototype, "isActive", void 0);
69
+ __decorate([
70
+ (0, interface_database_decorators_1.Field)("number"),
71
+ __metadata("design:type", Number)
72
+ ], Customer.prototype, "loyaltyPoints", void 0);
73
+ __decorate([
74
+ (0, interface_database_decorators_1.Field)(["string"]),
75
+ __metadata("design:type", Array)
76
+ ], Customer.prototype, "preferences", void 0);
77
+ exports.Customer = Customer = __decorate([
78
+ (0, interface_database_decorators_1.RegisterTable)(customerTableName, schemaName)
79
+ ], Customer);
80
+ let Product = class Product extends interface_database_decorators_1.Table {
81
+ };
82
+ exports.Product = Product;
83
+ __decorate([
84
+ (0, interface_database_decorators_1.Index)(),
85
+ (0, interface_database_decorators_1.Field)("string"),
86
+ __metadata("design:type", String)
87
+ ], Product.prototype, "sku", void 0);
88
+ __decorate([
89
+ (0, interface_database_decorators_1.Field)("string"),
90
+ __metadata("design:type", String)
91
+ ], Product.prototype, "name", void 0);
92
+ __decorate([
93
+ (0, interface_database_decorators_1.Field)("string"),
94
+ __metadata("design:type", String)
95
+ ], Product.prototype, "description", void 0);
96
+ __decorate([
97
+ (0, interface_database_decorators_1.Field)("number"),
98
+ __metadata("design:type", Number)
99
+ ], Product.prototype, "price", void 0);
100
+ __decorate([
101
+ (0, interface_database_decorators_1.Field)("number"),
102
+ __metadata("design:type", Number)
103
+ ], Product.prototype, "costPrice", void 0);
104
+ __decorate([
105
+ (0, interface_database_decorators_1.Field)("number"),
106
+ __metadata("design:type", Number)
107
+ ], Product.prototype, "stockQuantity", void 0);
108
+ __decorate([
109
+ (0, interface_database_decorators_1.Field)("string"),
110
+ __metadata("design:type", String)
111
+ ], Product.prototype, "category", void 0);
112
+ __decorate([
113
+ (0, interface_database_decorators_1.Field)("string"),
114
+ __metadata("design:type", String)
115
+ ], Product.prototype, "brand", void 0);
116
+ __decorate([
117
+ (0, interface_database_decorators_1.Field)(["string"]),
118
+ __metadata("design:type", Array)
119
+ ], Product.prototype, "tags", void 0);
120
+ __decorate([
121
+ (0, interface_database_decorators_1.Field)(["string"]),
122
+ __metadata("design:type", Array)
123
+ ], Product.prototype, "images", void 0);
124
+ __decorate([
125
+ (0, interface_database_decorators_1.Field)("boolean"),
126
+ __metadata("design:type", Boolean)
127
+ ], Product.prototype, "isActive", void 0);
128
+ __decorate([
129
+ (0, interface_database_decorators_1.Field)("date"),
130
+ __metadata("design:type", Date)
131
+ ], Product.prototype, "createdAt", void 0);
132
+ __decorate([
133
+ (0, interface_database_decorators_1.Field)("date"),
134
+ __metadata("design:type", Date)
135
+ ], Product.prototype, "updatedAt", void 0);
136
+ exports.Product = Product = __decorate([
137
+ (0, interface_database_decorators_1.RegisterTable)(productTableName, schemaName)
138
+ ], Product);
139
+ let Order = class Order extends interface_database_decorators_1.Table {
140
+ };
141
+ exports.Order = Order;
142
+ __decorate([
143
+ (0, interface_database_decorators_1.Index)(),
144
+ (0, interface_database_decorators_1.Field)("string"),
145
+ __metadata("design:type", String)
146
+ ], Order.prototype, "orderNumber", void 0);
147
+ __decorate([
148
+ (0, interface_database_decorators_1.Index)(),
149
+ (0, interface_database_decorators_1.Field)("string"),
150
+ (0, interface_database_decorators_1.Relation)({ to: () => Customer }),
151
+ __metadata("design:type", String)
152
+ ], Order.prototype, "customerId", void 0);
153
+ __decorate([
154
+ (0, interface_database_decorators_1.Field)("string"),
155
+ __metadata("design:type", String)
156
+ ], Order.prototype, "status", void 0);
157
+ __decorate([
158
+ (0, interface_database_decorators_1.Field)("number"),
159
+ __metadata("design:type", Number)
160
+ ], Order.prototype, "totalAmount", void 0);
161
+ __decorate([
162
+ (0, interface_database_decorators_1.Field)("number"),
163
+ __metadata("design:type", Number)
164
+ ], Order.prototype, "shippingCost", void 0);
165
+ __decorate([
166
+ (0, interface_database_decorators_1.Field)("number"),
167
+ __metadata("design:type", Number)
168
+ ], Order.prototype, "taxAmount", void 0);
169
+ __decorate([
170
+ (0, interface_database_decorators_1.Field)("number"),
171
+ __metadata("design:type", Number)
172
+ ], Order.prototype, "discountAmount", void 0);
173
+ __decorate([
174
+ (0, interface_database_decorators_1.Field)("number"),
175
+ __metadata("design:type", Number)
176
+ ], Order.prototype, "finalAmount", void 0);
177
+ __decorate([
178
+ (0, interface_database_decorators_1.Field)("string"),
179
+ __metadata("design:type", String)
180
+ ], Order.prototype, "shippingAddress", void 0);
181
+ __decorate([
182
+ (0, interface_database_decorators_1.Field)("string"),
183
+ __metadata("design:type", String)
184
+ ], Order.prototype, "billingAddress", void 0);
185
+ __decorate([
186
+ (0, interface_database_decorators_1.Field)("string"),
187
+ __metadata("design:type", String)
188
+ ], Order.prototype, "paymentMethod", void 0);
189
+ __decorate([
190
+ (0, interface_database_decorators_1.Field)("string"),
191
+ __metadata("design:type", String)
192
+ ], Order.prototype, "notes", void 0);
193
+ __decorate([
194
+ (0, interface_database_decorators_1.Field)("date"),
195
+ __metadata("design:type", Date)
196
+ ], Order.prototype, "createdAt", void 0);
197
+ __decorate([
198
+ (0, interface_database_decorators_1.Field)("date"),
199
+ __metadata("design:type", Date)
200
+ ], Order.prototype, "updatedAt", void 0);
201
+ exports.Order = Order = __decorate([
202
+ (0, interface_database_decorators_1.RegisterTable)(orderTableName, schemaName)
203
+ ], Order);
204
+ let OrderItem = class OrderItem extends interface_database_decorators_1.Table {
205
+ };
206
+ exports.OrderItem = OrderItem;
207
+ __decorate([
208
+ (0, interface_database_decorators_1.Index)(),
209
+ (0, interface_database_decorators_1.Field)("string"),
210
+ (0, interface_database_decorators_1.Relation)({ to: () => Order }),
211
+ __metadata("design:type", String)
212
+ ], OrderItem.prototype, "orderId", void 0);
213
+ __decorate([
214
+ (0, interface_database_decorators_1.Index)(),
215
+ (0, interface_database_decorators_1.Field)("string"),
216
+ (0, interface_database_decorators_1.Relation)({ to: () => Product }),
217
+ __metadata("design:type", String)
218
+ ], OrderItem.prototype, "productId", void 0);
219
+ __decorate([
220
+ (0, interface_database_decorators_1.Field)("number"),
221
+ __metadata("design:type", Number)
222
+ ], OrderItem.prototype, "quantity", void 0);
223
+ __decorate([
224
+ (0, interface_database_decorators_1.Field)("number"),
225
+ __metadata("design:type", Number)
226
+ ], OrderItem.prototype, "unitPrice", void 0);
227
+ __decorate([
228
+ (0, interface_database_decorators_1.Field)("number"),
229
+ __metadata("design:type", Number)
230
+ ], OrderItem.prototype, "totalPrice", void 0);
231
+ __decorate([
232
+ (0, interface_database_decorators_1.Field)("number"),
233
+ __metadata("design:type", Number)
234
+ ], OrderItem.prototype, "finalPrice", void 0);
235
+ __decorate([
236
+ (0, interface_database_decorators_1.Field)("number"),
237
+ __metadata("design:type", Number)
238
+ ], OrderItem.prototype, "discount", void 0);
239
+ exports.OrderItem = OrderItem = __decorate([
240
+ (0, interface_database_decorators_1.RegisterTable)(orderItemTableName, schemaName)
241
+ ], OrderItem);
242
+ class CustomerModel extends (0, interface_database_decorators_1.BasicDataModel)(Customer, customerTableName) {
243
+ }
244
+ exports.CustomerModel = CustomerModel;
245
+ class ProductModel extends (0, interface_database_decorators_1.BasicDataModel)(Product, productTableName) {
246
+ }
247
+ exports.ProductModel = ProductModel;
248
+ class OrderModel extends (0, interface_database_decorators_1.BasicDataModel)(Order, orderTableName) {
249
+ }
250
+ exports.OrderModel = OrderModel;
251
+ class OrderItemModel extends (0, interface_database_decorators_1.BasicDataModel)(OrderItem, orderItemTableName) {
252
+ }
253
+ exports.OrderItemModel = OrderItemModel;
254
+ const testCustomers = [
255
+ {
256
+ firstName: "Bob",
257
+ lastName: "Bobberson",
258
+ email: "bob.bobberson@email.com",
259
+ phone: "+1234567890",
260
+ address: "123 Poutine Square",
261
+ city: "Quebec City",
262
+ postalCode: "G1K 1K1",
263
+ country: "Canada",
264
+ registrationDate: new Date("2023-01-15"),
265
+ isActive: true,
266
+ loyaltyPoints: 150,
267
+ preferences: ["electronics", "books"],
268
+ },
269
+ {
270
+ firstName: "Alice",
271
+ lastName: "Alison",
272
+ email: "alice.alison@email.com",
273
+ phone: "+33123456789",
274
+ address: "456 Baguette Street",
275
+ city: "Lyon",
276
+ postalCode: "69001",
277
+ country: "France",
278
+ registrationDate: new Date("2023-03-20"),
279
+ isActive: true,
280
+ loyaltyPoints: 75,
281
+ preferences: ["fashion", "home"],
282
+ },
283
+ {
284
+ firstName: "John",
285
+ lastName: "Doe",
286
+ email: "john.doe@email.com",
287
+ phone: "+32123456789",
288
+ address: "789 Fries Avenue",
289
+ city: "Brussels",
290
+ postalCode: "1000",
291
+ country: "Belgium",
292
+ registrationDate: new Date("2023-06-10"),
293
+ isActive: false,
294
+ loyaltyPoints: 0,
295
+ preferences: ["sports"],
296
+ },
297
+ ];
298
+ const testProducts = [
299
+ {
300
+ sku: "LAPTOP-001",
301
+ name: "Gaming Laptop",
302
+ description: "High performance gaming laptop",
303
+ price: 1299.99,
304
+ costPrice: 899.99,
305
+ stockQuantity: 15,
306
+ category: "electronics",
307
+ brand: "TechCorp",
308
+ tags: ["gaming", "laptop", "high-performance"],
309
+ images: ["laptop1.jpg", "laptop2.jpg"],
310
+ isActive: true,
311
+ createdAt: new Date("2023-01-01"),
312
+ updatedAt: new Date("2023-12-01"),
313
+ },
314
+ {
315
+ sku: "PHONE-002",
316
+ name: "Premium Smartphone",
317
+ description: "Professional camera smartphone",
318
+ price: 899.99,
319
+ costPrice: 599.99,
320
+ stockQuantity: 25,
321
+ category: "electronics",
322
+ brand: "MobileTech",
323
+ tags: ["smartphone", "camera", "premium"],
324
+ images: ["phone1.jpg", "phone2.jpg"],
325
+ isActive: true,
326
+ createdAt: new Date("2023-02-15"),
327
+ updatedAt: new Date("2023-11-15"),
328
+ },
329
+ {
330
+ sku: "BOOK-003",
331
+ name: "The Soldering Bible",
332
+ description: "Complete guide to soldering components",
333
+ price: 49.99,
334
+ costPrice: 25.99,
335
+ stockQuantity: 50,
336
+ category: "books",
337
+ brand: "TechBooks",
338
+ tags: ["soldering", "electronics", "education"],
339
+ images: ["book1.jpg"],
340
+ isActive: true,
341
+ createdAt: new Date("2023-03-01"),
342
+ updatedAt: new Date("2023-10-01"),
343
+ },
344
+ {
345
+ sku: "SHIRT-004",
346
+ name: "Organic Cotton T-shirt",
347
+ description: "Comfortable organic cotton t-shirt",
348
+ price: 29.99,
349
+ costPrice: 15.99,
350
+ stockQuantity: 100,
351
+ category: "fashion",
352
+ brand: "EcoFashion",
353
+ tags: ["cotton", "organic", "comfortable"],
354
+ images: ["shirt1.jpg", "shirt2.jpg"],
355
+ isActive: true,
356
+ createdAt: new Date("2023-04-10"),
357
+ updatedAt: new Date("2023-09-10"),
358
+ },
359
+ ];
360
+ async function initializeDatabase() {
361
+ await (0, interface_database_decorators_1.RegisterSchema)(schemaName);
362
+ }
363
+ async function cleanTables() {
364
+ const db = (0, utils_1.getSchemaInstance)(schemaName);
365
+ await Promise.all([
366
+ db.table(customerTableName).delete(),
367
+ db.table(productTableName).delete(),
368
+ db.table(orderTableName).delete(),
369
+ db.table(orderItemTableName).delete(),
370
+ ]);
371
+ }
372
+ async function createTestData() {
373
+ const db = (0, utils_1.getSchemaInstance)(schemaName);
374
+ const customerModel = new CustomerModel(db);
375
+ const productModel = new ProductModel(db);
376
+ const orderModel = new OrderModel(db);
377
+ const customerResults = await customerModel.insert(testCustomers);
378
+ const productResults = await productModel.insert(testProducts);
379
+ return {
380
+ customerIds: customerResults,
381
+ productIds: productResults,
382
+ customerModel,
383
+ productModel,
384
+ orderModel,
385
+ };
386
+ }
387
+ //# sourceMappingURL=shop-schema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shop-schema.js","sourceRoot":"","sources":["../../../src/tests/internal/shop-schema.ts"],"names":[],"mappings":";;;;;;;;;;;;AAkTA,gDAEC;AAED,kCAQC;AAED,wCAeC;AA/UD,sCAAsC;AACtC,6FAQmD;AAEnD,oCAA6C;AAE7C,MAAM,eAAe,GAAG,aAAa,CAAC;AACtC,MAAM,iBAAiB,GAAG,aAAa,eAAe,EAAE,CAAC;AACzD,MAAM,gBAAgB,GAAG,YAAY,eAAe,EAAE,CAAC;AACvD,MAAM,cAAc,GAAG,UAAU,eAAe,EAAE,CAAC;AACnD,MAAM,kBAAkB,GAAG,eAAe,eAAe,EAAE,CAAC;AAC5D,MAAM,UAAU,GAAG,SAAS,CAAC;AAGtB,IAAM,QAAQ,GAAd,MAAM,QAAS,SAAQ,qCAAK;CAuClC,CAAA;AAvCY,4BAAQ;AAKX;IAFP,IAAA,qCAAK,GAAE;IACP,IAAA,qCAAK,EAAC,QAAQ,CAAC;;uCACM;AAGd;IADP,IAAA,qCAAK,EAAC,QAAQ,CAAC;;2CACU;AAGlB;IADP,IAAA,qCAAK,EAAC,QAAQ,CAAC;;0CACS;AAGjB;IADP,IAAA,qCAAK,EAAC,QAAQ,CAAC;;uCACM;AAGd;IADP,IAAA,qCAAK,EAAC,QAAQ,CAAC;;yCACQ;AAGhB;IADP,IAAA,qCAAK,EAAC,QAAQ,CAAC;;sCACK;AAGb;IADP,IAAA,qCAAK,EAAC,QAAQ,CAAC;;4CACW;AAGnB;IADP,IAAA,qCAAK,EAAC,QAAQ,CAAC;;yCACQ;AAGhB;IADP,IAAA,qCAAK,EAAC,MAAM,CAAC;8BACY,IAAI;kDAAC;AAGvB;IADP,IAAA,qCAAK,EAAC,SAAS,CAAC;;0CACS;AAGlB;IADP,IAAA,qCAAK,EAAC,QAAQ,CAAC;;+CACc;AAGtB;IADP,IAAA,qCAAK,EAAC,CAAC,QA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IAC/B,MAAM,EAAE,GAAG,IAAA,yBAAiB,EAAC,UAAU,CAAC,CAAC;IACzC,MAAM,OAAO,CAAC,GAAG,CAAC;QAChB,EAAE,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC,MAAM,EAAE;QACpC,EAAE,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC,MAAM,EAAE;QACnC,EAAE,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC,MAAM,EAAE;QACjC,EAAE,CAAC,KAAK,CAAC,kBAAkB,CAAC,CAAC,MAAM,EAAE;KACtC,CAAC,CAAC;AACL,CAAC;AAEM,KAAK,UAAU,cAAc;IAClC,MAAM,EAAE,GAAG,IAAA,yBAAiB,EAAC,UAAU,CAAC,CAAC;IACzC,MAAM,aAAa,GAAG,IAAI,aAAa,CAAC,EAAE,CAAC,CAAC;IAC5C,MAAM,YAAY,GAAG,IAAI,YAAY,CAAC,EAAE,CAAC,CAAC;IAC1C,MAAM,UAAU,GAAG,IAAI,UAAU,CAAC,EAAE,CAAC,CAAC;IACtC,MAAM,eAAe,GAAG,MAAM,aAAa,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC;IAClE,MAAM,cAAc,GAAG,MAAM,YAAY,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;IAE/D,OAAO;QACL,WAAW,EAAE,eAAe;QAC5B,UAAU,EAAE,cAAc;QAC1B,aAAa;QACb,YAAY;QACZ,UAAU;KACX,CAAC;AACJ,CAAC"}
@@ -1,3 +1,4 @@
1
+ import type { FieldValue, FieldValues } from "../metadata";
1
2
  /**
2
3
  * Returns the name of the test function that called it.
3
4
  *
@@ -6,11 +7,11 @@
6
7
  * context wrappers) do not change the result.
7
8
  */
8
9
  export declare function getFunctionName(): string;
9
- export declare function request(functionName: string, uri: string, method: string, payload?: unknown, queryParams?: Record<string, string> | [string, string][]): Promise<Response>;
10
- export declare function newRequest(functionName: string, payload: unknown, queryParams?: Record<string, string>): Promise<Response>;
10
+ export declare function request(functionName: string, uri: string, method: string, payload?: FieldValue, queryParams?: Record<string, string> | [string, string][]): Promise<Response>;
11
+ export declare function newRequest(functionName: string, payload: FieldValue, queryParams?: Record<string, string>): Promise<Response>;
11
12
  export declare function getRequest(functionName: string, queryParams?: Record<string, string>): Promise<Response>;
12
13
  export declare function listRequest(functionName: string, queryParams?: Record<string, string>): Promise<Response>;
13
- export declare function editRequest(functionName: string, payload: unknown, queryParams?: Record<string, string>): Promise<Response>;
14
+ export declare function editRequest(functionName: string, payload: FieldValue, queryParams?: Record<string, string>): Promise<Response>;
14
15
  export declare function deleteRequest(functionName: string, queryParams?: Record<string, string>): Promise<Response>;
15
16
  export declare function validateObject<T>(object: T, expectedObject: Partial<T>, fieldsToCheck: (keyof T)[]): Promise<void>;
16
17
  export declare function getSchemaInstance(schemaName: string): import("@antelopejs/interface-database").SchemaInstance<any>;
@@ -18,7 +19,6 @@ export declare function validateObjectList<T extends {
18
19
  _id: string;
19
20
  }>(objectList: T[], expectedObjectList: Partial<T>[], fieldsToCheck: (keyof T)[]): Promise<void>;
20
21
  /** What the `new` route answers: the created row, with its key. */
21
- export interface CreatedRow {
22
+ export interface CreatedRow extends FieldValues {
22
23
  _id: string;
23
- [field: string]: unknown;
24
24
  }
@@ -62,9 +62,7 @@ function getFunctionName() {
62
62
  const caller = captureCallSites().find(isTestCallSite);
63
63
  return caller?.getFunctionName() ?? UNKNOWN_FUNCTION_NAME;
64
64
  }
65
- async function request(functionName, uri, method, payload,
66
- // Pairs repeat a key (`filter_x=a&filter_x=b`).
67
- queryParams) {
65
+ async function request(functionName, uri, method, payload, queryParams) {
68
66
  return await fetch(`${constants_1.URL_BASE}/${functionName}/${uri}?${new URLSearchParams(queryParams).toString()}`, {
69
67
  method,
70
68
  headers: {
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/tests/utils.ts"],"names":[],"mappings":";;;;;AA6DA,0CAGC;AAED,0BAkBC;AAED,gCAMC;AAED,gCAKC;AAED,kCA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MAAM,IAAI,KAAK,CAAC,WAAW,UAAU,aAAa,CAAC,CAAC;IACjE,OAAO,MAAM,CAAC,QAAQ,EAAE,CAAC;AAC3B,CAAC;AAEM,KAAK,UAAU,kBAAkB,CACtC,UAAe,EACf,kBAAgC,EAChC,aAA0B;IAE1B,KAAK,MAAM,MAAM,IAAI,UAAU,EAAE,CAAC;QAChC,MAAM,EAAE,GAAG,MAAM,CAAC,GAAG,CAAC;QACtB,MAAM,cAAc,GAAG,kBAAkB,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,GAAG,KAAK,EAAE,CAAC,CAAC;QAC1E,IAAI,CAAC,cAAc,EAAE,CAAC;YACpB,IAAA,aAAM,EAAC,KAAK,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,IAAI,EAAE,qCAAqC,EAAE,EAAE,CAAC,CAAC;QAC1E,CAAC;aAAM,CAAC;YACN,MAAM,cAAc,CAAC,MAAM,EAAE,cAAc,EAAE,aAAa,CAAC,CAAC;QAC9D,CAAC;IACH,CAAC;AACH,CAAC"}
@@ -5,22 +5,21 @@ const chai_1 = require("chai");
5
5
  const utils_1 = require("./utils");
6
6
  const WRAPPER_DEPTHS = [1, 2, 5, 20];
7
7
  describe("Test utils", () => {
8
- it("returns the name of the calling function", () => returnsTheCallerName());
9
- it("skips frames added outside the tests folder", () => skipsFramesAddedOutsideTheTestsFolder());
8
+ it("returns the name of the calling function", () => expectReturnsTheCallerName());
9
+ it("skips frames added outside the tests folder", () => expectSkipsFramesAddedOutsideTheTestsFolder());
10
10
  });
11
- function returnsTheCallerName() {
12
- (0, chai_1.expect)((0, utils_1.getFunctionName)()).to.equal("returnsTheCallerName");
11
+ function expectReturnsTheCallerName() {
12
+ (0, chai_1.expect)((0, utils_1.getFunctionName)()).to.equal("expectReturnsTheCallerName");
13
13
  }
14
14
  function nameSeenThroughAsyncContexts(depth) {
15
15
  const storage = new node_async_hooks_1.AsyncLocalStorage();
16
- const run = storage.run.bind(storage);
17
- const nestedRuns = Array.from({ length: depth - 1 }, (_, store) => [
18
- run,
19
- store,
20
- ]).flat();
21
- return run(depth, ...nestedRuns, utils_1.getFunctionName);
16
+ let read = utils_1.getFunctionName;
17
+ for (let store = 0; store < depth; store++) {
18
+ read = storage.run.bind(storage, store, read);
19
+ }
20
+ return read();
22
21
  }
23
- function skipsFramesAddedOutsideTheTestsFolder() {
22
+ function expectSkipsFramesAddedOutsideTheTestsFolder() {
24
23
  for (const depth of WRAPPER_DEPTHS) {
25
24
  (0, chai_1.expect)(nameSeenThroughAsyncContexts(depth)).to.equal("nameSeenThroughAsyncContexts");
26
25
  }
@@ -1 +1 @@
1
- {"version":3,"file":"utils.test.js","sourceRoot":"","sources":["../../src/tests/utils.test.ts"],"names":[],"mappings":";;AAAA,uDAAqD;AACrD,+BAA8B;AAE9B,mCAA0C;AAI1C,MAAM,cAAc,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;AAErC,QAAQ,CAAC,YAAY,EAAE,GAAG,EAAE;IAC1B,EAAE,CAAC,0CAA0C,EAAE,GAAG,EAAE,CAAC,oBAAoB,EAAE,CAAC,CAAC;IAC7E,EAAE,CAAC,6CAA6C,EAAE,GAAG,EAAE,CACrD,qCAAqC,EAAE,CAAC,CAAC;AAC7C,CAAC,CAAC,CAAC;AAEH,SAAS,oBAAoB;IAC3B,IAAA,aAAM,EAAC,IAAA,uBAAe,GAAE,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,sBAAsB,CAAC,CAAC;AAC7D,CAAC;AAED,SAAS,4BAA4B,CAAC,KAAa;IACjD,MAAM,OAAO,GAAG,IAAI,oCAAiB,EAAU,CAAC;IAChD,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAa,CAAC;IAClD,MAAM,UAAU,GAAG,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,KAAK,GAAG,CAAC,EAAE,EAA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