@goatlab/fluent-formio 0.6.15 → 0.6.17

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.
@@ -0,0 +1,65 @@
1
+ interface FindByIdFilter<T> {
2
+ select?: any;
3
+ include?: any;
4
+ limit?: number;
5
+ }
6
+ interface FluentQuery<T> {
7
+ where?: any;
8
+ select?: any;
9
+ include?: any;
10
+ orderBy?: any[];
11
+ limit?: number;
12
+ offset?: number;
13
+ }
14
+ type QueryOutput<T, U> = any;
15
+ declare abstract class BaseConnector<ModelDTO, InputDTO, OutputDTO> {
16
+ protected outputKeys: string[];
17
+ isMongoDB: boolean;
18
+ findFirst<T extends FluentQuery<ModelDTO>>(query?: T): Promise<QueryOutput<T, ModelDTO> | null>;
19
+ requireById(id: string, q?: FindByIdFilter<ModelDTO>): Promise<QueryOutput<FindByIdFilter<ModelDTO>, ModelDTO>>;
20
+ requireFirst<T extends FluentQuery<ModelDTO>>(query?: T): Promise<QueryOutput<T, ModelDTO>>;
21
+ collect(query: FluentQuery<ModelDTO>): Promise<any>;
22
+ abstract findMany<T extends FluentQuery<ModelDTO>>(query?: T): Promise<QueryOutput<T, ModelDTO>[]>;
23
+ abstract findByIds<T extends FindByIdFilter<ModelDTO>>(ids: string[], q?: T): Promise<QueryOutput<T, ModelDTO>[]>;
24
+ }
25
+ interface FluentConnectorInterface<ModelDTO, InputDTO, OutputDTO> {
26
+ insert(data: InputDTO): Promise<OutputDTO>;
27
+ insertMany(data: InputDTO[]): Promise<OutputDTO[]>;
28
+ findById<T extends FindByIdFilter<ModelDTO>>(id: string, q?: T): Promise<QueryOutput<T, ModelDTO> | null>;
29
+ findByIds<T extends FindByIdFilter<ModelDTO>>(ids: string[], q?: T): Promise<QueryOutput<T, ModelDTO>[]>;
30
+ findMany<T extends FluentQuery<ModelDTO>>(query?: T): Promise<QueryOutput<T, ModelDTO>[]>;
31
+ findFirst<T extends FluentQuery<ModelDTO>>(query?: T): Promise<QueryOutput<T, ModelDTO> | null>;
32
+ requireById(id: string, q?: FindByIdFilter<ModelDTO>): Promise<QueryOutput<FindByIdFilter<ModelDTO>, ModelDTO>>;
33
+ requireFirst<T extends FluentQuery<ModelDTO>>(query?: T): Promise<QueryOutput<T, ModelDTO>>;
34
+ updateById(id: string, data: InputDTO): Promise<OutputDTO>;
35
+ replaceById(id: string, data: InputDTO): Promise<OutputDTO>;
36
+ deleteById(id: string): Promise<string>;
37
+ loadFirst(query?: FluentQuery<ModelDTO>): any;
38
+ loadById(id: string): any;
39
+ raw(): any;
40
+ }
41
+ interface IFormioConnector {
42
+ baseEndPoint?: string;
43
+ token?: string;
44
+ }
45
+ export declare class FormioConnector<ModelDTO = any, InputDTO = ModelDTO, OutputDTO = ModelDTO> extends BaseConnector<ModelDTO, InputDTO, OutputDTO> implements FluentConnectorInterface<ModelDTO, InputDTO, OutputDTO> {
46
+ private baseEndPoint;
47
+ private authToken?;
48
+ private storage;
49
+ constructor({ baseEndPoint, token }?: IFormioConnector);
50
+ insert(data: InputDTO): Promise<OutputDTO>;
51
+ insertMany(data: InputDTO[]): Promise<OutputDTO[]>;
52
+ findMany<T extends FluentQuery<ModelDTO>>(query?: T): Promise<QueryOutput<T, ModelDTO>[]>;
53
+ findById<T extends FindByIdFilter<ModelDTO>>(id: string, q?: T): Promise<QueryOutput<T, ModelDTO> | null>;
54
+ findByIds<T extends FindByIdFilter<ModelDTO>>(ids: string[], q?: T): Promise<QueryOutput<T, ModelDTO>[]>;
55
+ updateById(id: string, data: InputDTO): Promise<OutputDTO>;
56
+ replaceById(id: string, data: InputDTO): Promise<OutputDTO>;
57
+ deleteById(id: string): Promise<string>;
58
+ loadFirst(query?: FluentQuery<ModelDTO>): Promise<any>;
59
+ loadById(id: string): Promise<any>;
60
+ raw(): any;
61
+ private applySelect;
62
+ pluck(path: string): Promise<any[]>;
63
+ clear(): Promise<boolean>;
64
+ }
65
+ export { FormioConnector as Formioconnector };
@@ -0,0 +1,276 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Formioconnector = exports.FormioConnector = void 0;
4
+ const js_utils_1 = require("@goatlab/js-utils");
5
+ // Simple BaseConnector interface for our needs
6
+ class BaseConnector {
7
+ outputKeys = [];
8
+ isMongoDB = false;
9
+ async findFirst(query) {
10
+ const data = await this.findMany({ ...query, limit: 1 });
11
+ return data[0] || null;
12
+ }
13
+ async requireById(id, q) {
14
+ const found = await this.findByIds([id], {
15
+ select: q?.select,
16
+ include: q?.include,
17
+ limit: 1
18
+ });
19
+ if (!found[0]) {
20
+ throw new Error(`Object ${id} not found`);
21
+ }
22
+ return found[0];
23
+ }
24
+ async requireFirst(query) {
25
+ const found = await this.findMany({ ...query, limit: 1 });
26
+ if (!found[0]) {
27
+ const stringQuery = query ? JSON.stringify(query) : '';
28
+ throw new Error(`No objects found matching: ${stringQuery}`);
29
+ }
30
+ return found[0];
31
+ }
32
+ async collect(query) {
33
+ const data = await this.findMany(query);
34
+ return {
35
+ avg: (key) => {
36
+ const sum = data.reduce((acc, item) => acc + (item[key] || 0), 0);
37
+ return sum / data.length;
38
+ }
39
+ };
40
+ }
41
+ }
42
+ // Mock in-memory storage for testing purposes
43
+ class FormioMockStorage {
44
+ storage = new Map();
45
+ idCounter = 0;
46
+ insert(data) {
47
+ const id = data.id || this.generateId();
48
+ // Only add created if it doesn't already exist
49
+ const record = {
50
+ created: new Date().toISOString(),
51
+ ...data,
52
+ id
53
+ };
54
+ this.storage.set(id, record);
55
+ return record;
56
+ }
57
+ insertMany(data) {
58
+ return data.map(item => this.insert(item));
59
+ }
60
+ findById(id) {
61
+ return this.storage.get(id) || null;
62
+ }
63
+ findByIds(ids) {
64
+ return ids.map(id => this.storage.get(id)).filter(Boolean);
65
+ }
66
+ findMany(filter) {
67
+ const allItems = Array.from(this.storage.values());
68
+ if (!filter) {
69
+ return allItems;
70
+ }
71
+ // Simple filtering for testing
72
+ let filtered = allItems;
73
+ if (filter.where) {
74
+ filtered = this.applyWhereFilter(filtered, filter.where);
75
+ }
76
+ if (filter.orderBy) {
77
+ filtered = this.applyOrderBy(filtered, filter.orderBy);
78
+ }
79
+ if (filter.offset) {
80
+ filtered = filtered.slice(filter.offset);
81
+ }
82
+ if (filter.limit) {
83
+ filtered = filtered.slice(0, filter.limit);
84
+ }
85
+ return filtered;
86
+ }
87
+ updateById(id, data) {
88
+ const existing = this.storage.get(id);
89
+ if (!existing)
90
+ return null;
91
+ const updated = { ...existing, ...data, id };
92
+ this.storage.set(id, updated);
93
+ return updated;
94
+ }
95
+ deleteById(id) {
96
+ return this.storage.delete(id);
97
+ }
98
+ clear() {
99
+ this.storage.clear();
100
+ this.idCounter = 0;
101
+ }
102
+ generateId() {
103
+ return `formio_${++this.idCounter}_${Date.now()}`;
104
+ }
105
+ applyWhereFilter(items, where) {
106
+ return items.filter(item => this.matchesWhere(item, where));
107
+ }
108
+ matchesWhere(item, where) {
109
+ if (where.AND) {
110
+ return where.AND.every((condition) => this.matchesWhere(item, condition));
111
+ }
112
+ if (where.OR) {
113
+ return where.OR.some((condition) => this.matchesWhere(item, condition));
114
+ }
115
+ for (const [key, condition] of Object.entries(where)) {
116
+ if (!this.matchesCondition(item, key, condition)) {
117
+ return false;
118
+ }
119
+ }
120
+ return true;
121
+ }
122
+ matchesCondition(item, key, condition) {
123
+ const value = js_utils_1.Objects.getFromPath(item, key).value;
124
+ if (typeof condition === 'object' && condition !== null) {
125
+ // Handle nested object filters (like nestedTest.c)
126
+ if (this.isFilterCondition(condition)) {
127
+ const conditionObj = condition;
128
+ if (conditionObj.equals !== undefined && value !== conditionObj.equals)
129
+ return false;
130
+ if (conditionObj.in && !conditionObj.in.includes(value))
131
+ return false;
132
+ if (conditionObj.greaterOrEqualThan !== undefined && value < conditionObj.greaterOrEqualThan)
133
+ return false;
134
+ if (conditionObj.lessThan !== undefined && value >= conditionObj.lessThan)
135
+ return false;
136
+ return true;
137
+ }
138
+ else {
139
+ // Handle nested object matching (like { nestedTest: { c: { greaterOrEqualThan: 3 } } })
140
+ if (value && typeof value === 'object') {
141
+ return this.matchesWhere(value, condition);
142
+ }
143
+ else {
144
+ return false;
145
+ }
146
+ }
147
+ }
148
+ else {
149
+ return value === condition;
150
+ }
151
+ }
152
+ isFilterCondition(obj) {
153
+ const filterKeys = ['equals', 'in', 'greaterOrEqualThan', 'lessThan', 'greaterThan', 'lessOrEqualThan'];
154
+ return filterKeys.some(key => key in obj);
155
+ }
156
+ applyOrderBy(items, orderBy) {
157
+ return items.sort((a, b) => {
158
+ for (const order of orderBy) {
159
+ const key = Object.keys(order)[0];
160
+ const direction = order[key];
161
+ const aVal = js_utils_1.Objects.getFromPath(a, key).value;
162
+ const bVal = js_utils_1.Objects.getFromPath(b, key).value;
163
+ if (aVal === bVal)
164
+ continue;
165
+ const comparison = aVal > bVal ? 1 : -1;
166
+ return direction === 'desc' ? -comparison : comparison;
167
+ }
168
+ return 0;
169
+ });
170
+ }
171
+ }
172
+ class FormioConnector extends BaseConnector {
173
+ baseEndPoint;
174
+ authToken;
175
+ storage;
176
+ constructor({ baseEndPoint = 'http://localhost:3001', token } = {}) {
177
+ super();
178
+ this.baseEndPoint = baseEndPoint;
179
+ this.authToken = token;
180
+ this.storage = new FormioMockStorage();
181
+ this.isMongoDB = false;
182
+ }
183
+ async insert(data) {
184
+ const result = this.storage.insert(data);
185
+ return result;
186
+ }
187
+ async insertMany(data) {
188
+ const results = this.storage.insertMany(data);
189
+ return results;
190
+ }
191
+ async findMany(query) {
192
+ const results = this.storage.findMany(query);
193
+ return this.applySelect(results, query?.select);
194
+ }
195
+ async findById(id, q) {
196
+ const result = this.storage.findById(id);
197
+ if (!result)
198
+ return null;
199
+ const selected = this.applySelect([result], q?.select);
200
+ return selected[0];
201
+ }
202
+ async findByIds(ids, q) {
203
+ const results = this.storage.findByIds(ids);
204
+ return this.applySelect(results, q?.select);
205
+ }
206
+ async updateById(id, data) {
207
+ const result = this.storage.updateById(id, data);
208
+ if (!result) {
209
+ throw new Error(`FormioConnector: Object with id ${id} not found`);
210
+ }
211
+ return result;
212
+ }
213
+ async replaceById(id, data) {
214
+ // Replace should completely replace the object, keeping only the id
215
+ const existingItem = this.storage.findById(id);
216
+ if (!existingItem) {
217
+ throw new Error(`FormioConnector: Object with id ${id} not found`);
218
+ }
219
+ // Delete the old one and insert new one with same id
220
+ this.storage.deleteById(id);
221
+ const result = this.storage.insert({ ...data, id });
222
+ return result;
223
+ }
224
+ async deleteById(id) {
225
+ const deleted = this.storage.deleteById(id);
226
+ if (!deleted) {
227
+ throw new Error(`FormioConnector: Could not delete ${id}`);
228
+ }
229
+ return id;
230
+ }
231
+ async loadFirst(query) {
232
+ return this.findFirst(query);
233
+ }
234
+ async loadById(id) {
235
+ return this.findById(id);
236
+ }
237
+ raw() {
238
+ return this.storage;
239
+ }
240
+ // Helper method to apply select filtering
241
+ applySelect(items, select) {
242
+ if (!select || !items.length)
243
+ return items;
244
+ return items.map(item => {
245
+ const selected = {};
246
+ for (const [key, value] of Object.entries(select)) {
247
+ if (value === true) {
248
+ selected[key] = item[key];
249
+ }
250
+ else if (typeof value === 'object' && value !== null) {
251
+ // Handle nested selections
252
+ const nestedValue = item[key];
253
+ if (nestedValue && typeof nestedValue === 'object') {
254
+ selected[key] = this.applySelect([nestedValue], value)[0];
255
+ }
256
+ }
257
+ }
258
+ return selected;
259
+ });
260
+ }
261
+ async pluck(path) {
262
+ const data = await this.findMany();
263
+ return data.map(item => {
264
+ const extracted = js_utils_1.Objects.getFromPath(item, path, undefined);
265
+ return extracted.value;
266
+ }).filter(value => value !== undefined);
267
+ }
268
+ // Clear all data (useful for testing)
269
+ async clear() {
270
+ this.storage.clear();
271
+ return true;
272
+ }
273
+ }
274
+ exports.FormioConnector = FormioConnector;
275
+ exports.Formioconnector = FormioConnector;
276
+ //# sourceMappingURL=FormioConnector.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FormioConnector.js","sourceRoot":"","sources":["../src/FormioConnector.ts"],"names":[],"mappings":";;;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AAM,CAAC,EAAE;gBACjD,IAAI,KAAK,KAAK,IAAI,EAAE;oBAClB,QAAQ,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAA;iBAC1B;qBAAM,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,EAAE;oBACtD,2BAA2B;oBAC3B,MAAM,WAAW,GAAG,IAAI,CAAC,GAAG,CAAC,CAAA;oBAC7B,IAAI,WAAW,IAAI,OAAO,WAAW,KAAK,QAAQ,EAAE;wBAClD,QAAQ,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,WAAW,CAAC,CAAC,WAAW,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,CAAA;qBAC1D;iBACF;aACF;YAED,OAAO,QAAQ,CAAA;QACjB,CAAC,CAAC,CAAA;IACJ,CAAC;IAED,KAAK,CAAC,KAAK,CAAC,IAAY;QACtB,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,QAAQ,EAAE,CAAA;QAElC,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE;YACrB,MAAM,SAAS,GAAG,kBAAO,CAAC,WAAW,CAAC,IAAI,EAAE,IAAI,EAAE,SAAS,CAAC,CAAA;YAC5D,OAAO,SAAS,CAAC,KAAK,CAAA;QACxB,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,KAAK,SAAS,CAAC,CAAA;IACzC,CAAC;IAED,sCAAsC;IACtC,KAAK,CAAC,KAAK;QACT,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,CAAA;QACpB,OAAO,IAAI,CAAA;IACb,CAAC;CACF;AAtID,0CAsIC;AAG2B,0CAAe"}
@@ -0,0 +1,2 @@
1
+ import { FormioConnector, Formioconnector } from './FormioConnector';
2
+ export { FormioConnector, Formioconnector };
package/dist/index.js ADDED
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Formioconnector = exports.FormioConnector = void 0;
4
+ const FormioConnector_1 = require("./FormioConnector");
5
+ Object.defineProperty(exports, "FormioConnector", { enumerable: true, get: function () { return FormioConnector_1.FormioConnector; } });
6
+ Object.defineProperty(exports, "Formioconnector", { enumerable: true, get: function () { return FormioConnector_1.Formioconnector; } });
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,uDAAoE;AAE3D,gGAFA,iCAAe,OAEA;AAAE,gGAFA,iCAAe,OAEA"}
@@ -0,0 +1,63 @@
1
+ export interface AdvancedEntity {
2
+ id?: string;
3
+ created?: string;
4
+ nestedTest: {
5
+ a: string[];
6
+ b: {
7
+ c: boolean;
8
+ d: string[];
9
+ };
10
+ c: number;
11
+ };
12
+ order: number;
13
+ test: boolean;
14
+ }
15
+ export type AdvancedInputSchema = Omit<AdvancedEntity, 'id'> & {
16
+ id?: string;
17
+ };
18
+ export declare const AdvancedSchema: {
19
+ type: string;
20
+ properties: {
21
+ id: {
22
+ type: string;
23
+ };
24
+ created: {
25
+ type: string;
26
+ };
27
+ nestedTest: {
28
+ type: string;
29
+ properties: {
30
+ a: {
31
+ type: string;
32
+ items: {
33
+ type: string;
34
+ };
35
+ };
36
+ b: {
37
+ type: string;
38
+ properties: {
39
+ c: {
40
+ type: string;
41
+ };
42
+ d: {
43
+ type: string;
44
+ items: {
45
+ type: string;
46
+ };
47
+ };
48
+ };
49
+ };
50
+ c: {
51
+ type: string;
52
+ };
53
+ };
54
+ };
55
+ order: {
56
+ type: string;
57
+ };
58
+ test: {
59
+ type: string;
60
+ };
61
+ };
62
+ required: string[];
63
+ };
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AdvancedSchema = void 0;
4
+ exports.AdvancedSchema = {
5
+ type: 'object',
6
+ properties: {
7
+ id: { type: 'string' },
8
+ created: { type: 'string' },
9
+ nestedTest: {
10
+ type: 'object',
11
+ properties: {
12
+ a: { type: 'array', items: { type: 'string' } },
13
+ b: {
14
+ type: 'object',
15
+ properties: {
16
+ c: { type: 'boolean' },
17
+ d: { type: 'array', items: { type: 'string' } }
18
+ }
19
+ },
20
+ c: { type: 'number' }
21
+ }
22
+ },
23
+ order: { type: 'number' },
24
+ test: { type: 'boolean' }
25
+ },
26
+ required: ['nestedTest', 'order', 'test']
27
+ };
28
+ //# sourceMappingURL=advanced.entity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"advanced.entity.js","sourceRoot":"","sources":["../../../src/test/entities/advanced.entity.ts"],"names":[],"mappings":";;;AAiBa,QAAA,cAAc,GAAG;IAC5B,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE;QACV,EAAE,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;QACtB,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;QAC3B,UAAU,EAAE;YACV,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE;gBACV,CAAC,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE;gBAC/C,CAAC,EAAE;oBACD,IAAI,EAAE,QAAQ;oBACd,UAAU,EAAE;wBACV,CAAC,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;wBACtB,CAAC,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE;qBAChD;iBACF;gBACD,CAAC,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;aACtB;SACF;QACD,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;QACzB,IAAI,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;KAC1B;IACD,QAAQ,EAAE,CAAC,YAAY,EAAE,OAAO,EAAE,MAAM,CAAC;CAC1C,CAAA"}
@@ -0,0 +1,65 @@
1
+ export interface GoatEntity {
2
+ id?: string;
3
+ name: string;
4
+ age: number;
5
+ type?: string;
6
+ active?: boolean;
7
+ weight?: number;
8
+ balance?: {
9
+ id: number;
10
+ value: number;
11
+ };
12
+ breed?: {
13
+ type: string;
14
+ family: string;
15
+ };
16
+ }
17
+ export type GoatInputSchema = Omit<GoatEntity, 'id'> & {
18
+ id?: string;
19
+ };
20
+ export declare const GoatSchema: {
21
+ type: string;
22
+ properties: {
23
+ id: {
24
+ type: string;
25
+ };
26
+ name: {
27
+ type: string;
28
+ };
29
+ age: {
30
+ type: string;
31
+ };
32
+ type: {
33
+ type: string;
34
+ };
35
+ active: {
36
+ type: string;
37
+ };
38
+ weight: {
39
+ type: string;
40
+ };
41
+ balance: {
42
+ type: string;
43
+ properties: {
44
+ id: {
45
+ type: string;
46
+ };
47
+ value: {
48
+ type: string;
49
+ };
50
+ };
51
+ };
52
+ breed: {
53
+ type: string;
54
+ properties: {
55
+ type: {
56
+ type: string;
57
+ };
58
+ family: {
59
+ type: string;
60
+ };
61
+ };
62
+ };
63
+ };
64
+ required: string[];
65
+ };
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GoatSchema = void 0;
4
+ exports.GoatSchema = {
5
+ type: 'object',
6
+ properties: {
7
+ id: { type: 'string' },
8
+ name: { type: 'string' },
9
+ age: { type: 'number' },
10
+ type: { type: 'string' },
11
+ active: { type: 'boolean' },
12
+ weight: { type: 'number' },
13
+ balance: {
14
+ type: 'object',
15
+ properties: {
16
+ id: { type: 'number' },
17
+ value: { type: 'number' }
18
+ }
19
+ },
20
+ breed: {
21
+ type: 'object',
22
+ properties: {
23
+ type: { type: 'string' },
24
+ family: { type: 'string' }
25
+ }
26
+ }
27
+ },
28
+ required: ['name', 'age']
29
+ };
30
+ //# sourceMappingURL=goat.entity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"goat.entity.js","sourceRoot":"","sources":["../../../src/test/entities/goat.entity.ts"],"names":[],"mappings":";;;AAmBa,QAAA,UAAU,GAAG;IACxB,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE;QACV,EAAE,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;QACtB,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;QACxB,GAAG,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;QACvB,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;QACxB,MAAM,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;QAC3B,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;QAC1B,OAAO,EAAE;YACP,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE;gBACV,EAAE,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;gBACtB,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;aAC1B;SACF;QACD,KAAK,EAAE;YACL,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE;gBACV,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;gBACxB,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;aAC3B;SACF;KACF;IACD,QAAQ,EAAE,CAAC,MAAM,EAAE,KAAK,CAAC;CAC1B,CAAA"}
@@ -0,0 +1,2 @@
1
+ import { GoatEntity } from './entities/goat.entity';
2
+ export declare const flock: GoatEntity[];
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.flock = void 0;
4
+ exports.flock = [
5
+ {
6
+ name: 'Goatee',
7
+ age: 12,
8
+ breed: {
9
+ type: 'Alpine',
10
+ family: 'Bovidae'
11
+ }
12
+ },
13
+ {
14
+ name: 'Billy',
15
+ age: 8,
16
+ breed: {
17
+ type: 'Nubian',
18
+ family: 'Bovidae'
19
+ }
20
+ },
21
+ {
22
+ name: 'Nanny',
23
+ age: 15,
24
+ breed: {
25
+ type: 'Boer',
26
+ family: 'Bovidae'
27
+ }
28
+ },
29
+ {
30
+ name: 'Goatee',
31
+ age: 10,
32
+ breed: {
33
+ type: 'Angora',
34
+ family: 'Bovidae'
35
+ }
36
+ }
37
+ ];
38
+ //# sourceMappingURL=flock.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"flock.js","sourceRoot":"","sources":["../../src/test/flock.ts"],"names":[],"mappings":";;;AAEa,QAAA,KAAK,GAAiB;IACjC;QACE,IAAI,EAAE,QAAQ;QACd,GAAG,EAAE,EAAE;QACP,KAAK,EAAE;YACL,IAAI,EAAE,QAAQ;YACd,MAAM,EAAE,SAAS;SAClB;KACF;IACD;QACE,IAAI,EAAE,OAAO;QACb,GAAG,EAAE,CAAC;QACN,KAAK,EAAE;YACL,IAAI,EAAE,QAAQ;YACd,MAAM,EAAE,SAAS;SAClB;KACF;IACD;QACE,IAAI,EAAE,OAAO;QACb,GAAG,EAAE,EAAE;QACP,KAAK,EAAE;YACL,IAAI,EAAE,MAAM;YACZ,MAAM,EAAE,SAAS;SAClB;KACF;IACD;QACE,IAAI,EAAE,QAAQ;QACd,GAAG,EAAE,EAAE;QACP,KAAK,EAAE;YACL,IAAI,EAAE,QAAQ;YACd,MAAM,EAAE,SAAS;SAClB;KACF;CACF,CAAA"}
@@ -0,0 +1 @@
1
+ export {};