@orchestr-sh/orchestr 1.2.0 → 1.3.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.
- package/README.md +67 -4
- package/dist/Routing/Route.d.ts +1 -1
- package/dist/Routing/Route.d.ts.map +1 -1
- package/dist/Routing/Router.d.ts +5 -0
- package/dist/Routing/Router.d.ts.map +1 -1
- package/dist/Routing/Router.js +19 -0
- package/dist/Routing/Router.js.map +1 -1
- package/dist/Support/Injectable.d.ts +21 -0
- package/dist/Support/Injectable.d.ts.map +1 -0
- package/dist/Support/Injectable.js +30 -0
- package/dist/Support/Injectable.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/Database/Eloquent/Builder.d.ts +0 -76
- package/dist/Database/Eloquent/Builder.d.ts.map +0 -1
- package/dist/Database/Eloquent/Builder.js +0 -154
- package/dist/Database/Eloquent/Builder.js.map +0 -1
- package/dist/Database/Eloquent/Collection.d.ts +0 -137
- package/dist/Database/Eloquent/Collection.d.ts.map +0 -1
- package/dist/Database/Eloquent/Collection.js +0 -284
- package/dist/Database/Eloquent/Collection.js.map +0 -1
- package/dist/Database/Eloquent/Concerns/HasAttributes.d.ts +0 -44
- package/dist/Database/Eloquent/Concerns/HasAttributes.d.ts.map +0 -1
- package/dist/Database/Eloquent/Concerns/HasAttributes.js +0 -8
- package/dist/Database/Eloquent/Concerns/HasAttributes.js.map +0 -1
- package/dist/Database/Eloquent/Concerns/HasTimestamps.d.ts +0 -41
- package/dist/Database/Eloquent/Concerns/HasTimestamps.d.ts.map +0 -1
- package/dist/Database/Eloquent/Concerns/HasTimestamps.js +0 -14
- package/dist/Database/Eloquent/Concerns/HasTimestamps.js.map +0 -1
- package/dist/Database/Eloquent/Model.d.ts +0 -265
- package/dist/Database/Eloquent/Model.d.ts.map +0 -1
- package/dist/Database/Eloquent/Model.js +0 -523
- package/dist/Database/Eloquent/Model.js.map +0 -1
- package/dist/Database/Eloquent/SoftDeletes.d.ts +0 -41
- package/dist/Database/Eloquent/SoftDeletes.d.ts.map +0 -1
- package/dist/Database/Eloquent/SoftDeletes.js +0 -22
- package/dist/Database/Eloquent/SoftDeletes.js.map +0 -1
|
@@ -1,137 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Collection Class
|
|
3
|
-
*
|
|
4
|
-
* A collection of Eloquent models
|
|
5
|
-
*/
|
|
6
|
-
import { Model } from './Model';
|
|
7
|
-
export declare class Collection<T extends Model> extends Array<T> {
|
|
8
|
-
/**
|
|
9
|
-
* Create a new collection
|
|
10
|
-
*/
|
|
11
|
-
constructor(items?: T[]);
|
|
12
|
-
/**
|
|
13
|
-
* Get all items in the collection
|
|
14
|
-
*/
|
|
15
|
-
all(): T[];
|
|
16
|
-
/**
|
|
17
|
-
* Get the first item from the collection
|
|
18
|
-
*/
|
|
19
|
-
first(callback?: (item: T) => boolean): T | undefined;
|
|
20
|
-
/**
|
|
21
|
-
* Get the last item from the collection
|
|
22
|
-
*/
|
|
23
|
-
last(callback?: (item: T) => boolean): T | undefined;
|
|
24
|
-
/**
|
|
25
|
-
* Reject items from the collection using a callback
|
|
26
|
-
*/
|
|
27
|
-
reject(callback: (item: T, index: number) => boolean): Collection<T>;
|
|
28
|
-
/**
|
|
29
|
-
* Map the collection and return a new collection
|
|
30
|
-
*/
|
|
31
|
-
mapIntoCollection<U>(callback: (item: T, index: number) => U): U[];
|
|
32
|
-
/**
|
|
33
|
-
* Get a collection with only unique items
|
|
34
|
-
*/
|
|
35
|
-
unique(key?: keyof T): Collection<T>;
|
|
36
|
-
/**
|
|
37
|
-
* Get the collection of items as a plain array
|
|
38
|
-
*/
|
|
39
|
-
toArray(): Record<string, any>[];
|
|
40
|
-
/**
|
|
41
|
-
* Get the collection of items as JSON
|
|
42
|
-
*/
|
|
43
|
-
toJSON(): Record<string, any>[];
|
|
44
|
-
/**
|
|
45
|
-
* Determine if the collection is empty
|
|
46
|
-
*/
|
|
47
|
-
isEmpty(): boolean;
|
|
48
|
-
/**
|
|
49
|
-
* Determine if the collection is not empty
|
|
50
|
-
*/
|
|
51
|
-
isNotEmpty(): boolean;
|
|
52
|
-
/**
|
|
53
|
-
* Get the sum of the given values
|
|
54
|
-
*/
|
|
55
|
-
sum(key?: keyof T): number;
|
|
56
|
-
/**
|
|
57
|
-
* Get the average value of a given key
|
|
58
|
-
*/
|
|
59
|
-
avg(key?: keyof T): number;
|
|
60
|
-
/**
|
|
61
|
-
* Get the min value of a given key
|
|
62
|
-
*/
|
|
63
|
-
min(key?: keyof T): number | undefined;
|
|
64
|
-
/**
|
|
65
|
-
* Get the max value of a given key
|
|
66
|
-
*/
|
|
67
|
-
max(key?: keyof T): number | undefined;
|
|
68
|
-
/**
|
|
69
|
-
* Pluck an attribute from each model
|
|
70
|
-
*/
|
|
71
|
-
pluck(key: keyof T): any[];
|
|
72
|
-
/**
|
|
73
|
-
* Get the keys of the collection items
|
|
74
|
-
*/
|
|
75
|
-
modelKeys(): any[];
|
|
76
|
-
/**
|
|
77
|
-
* Sort the collection by a callback or key
|
|
78
|
-
*/
|
|
79
|
-
sortBy(keyOrCallback: keyof T | ((a: T, b: T) => number)): Collection<T>;
|
|
80
|
-
/**
|
|
81
|
-
* Sort the collection in descending order
|
|
82
|
-
*/
|
|
83
|
-
sortByDesc(key: keyof T): Collection<T>;
|
|
84
|
-
/**
|
|
85
|
-
* Group the collection by a given key
|
|
86
|
-
*/
|
|
87
|
-
groupBy(key: keyof T): Record<string, Collection<T>>;
|
|
88
|
-
/**
|
|
89
|
-
* Chunk the collection into smaller collections
|
|
90
|
-
*/
|
|
91
|
-
chunkModels(size: number): Collection<T>[];
|
|
92
|
-
/**
|
|
93
|
-
* Take the first n items
|
|
94
|
-
*/
|
|
95
|
-
take(limit: number): Collection<T>;
|
|
96
|
-
/**
|
|
97
|
-
* Skip the first n items
|
|
98
|
-
*/
|
|
99
|
-
skip(count: number): Collection<T>;
|
|
100
|
-
/**
|
|
101
|
-
* Merge the collection with the given items
|
|
102
|
-
*/
|
|
103
|
-
merge(items: T[]): Collection<T>;
|
|
104
|
-
/**
|
|
105
|
-
* Get the collection without the specified items
|
|
106
|
-
*/
|
|
107
|
-
except(keys: any[]): Collection<T>;
|
|
108
|
-
/**
|
|
109
|
-
* Get only the specified items from the collection
|
|
110
|
-
*/
|
|
111
|
-
only(keys: any[]): Collection<T>;
|
|
112
|
-
/**
|
|
113
|
-
* Load a set of relationships onto the collection
|
|
114
|
-
*/
|
|
115
|
-
load(relations: string | string[]): Promise<this>;
|
|
116
|
-
/**
|
|
117
|
-
* Find a model in the collection by key
|
|
118
|
-
*/
|
|
119
|
-
find(keyOrCallback: any | ((item: T) => boolean)): T | undefined;
|
|
120
|
-
/**
|
|
121
|
-
* Determine if a key exists in the collection
|
|
122
|
-
*/
|
|
123
|
-
contains(keyOrCallback: any | ((item: T) => boolean)): boolean;
|
|
124
|
-
/**
|
|
125
|
-
* Get the items with the specified keys
|
|
126
|
-
*/
|
|
127
|
-
whereIn(key: keyof T, values: any[]): Collection<T>;
|
|
128
|
-
/**
|
|
129
|
-
* Get the items where a key is not in the given values
|
|
130
|
-
*/
|
|
131
|
-
whereNotIn(key: keyof T, values: any[]): Collection<T>;
|
|
132
|
-
/**
|
|
133
|
-
* Count the number of items in the collection
|
|
134
|
-
*/
|
|
135
|
-
count(): number;
|
|
136
|
-
}
|
|
137
|
-
//# sourceMappingURL=Collection.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Collection.d.ts","sourceRoot":"","sources":["../../../src/Database/Eloquent/Collection.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAEhC,qBAAa,UAAU,CAAC,CAAC,SAAS,KAAK,CAAE,SAAQ,KAAK,CAAC,CAAC,CAAC;IACvD;;OAEG;gBACS,KAAK,GAA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AI,EAAE,CAAC,KAAK,OAAO,CAAC,GAAG,OAAO;IAI9D;;OAEG;IACH,OAAO,CAAC,GAAG,EAAE,MAAM,CAAC,EAAE,MAAM,EAAE,GAAG,EAAE,GAAG,UAAU,CAAC,CAAC,CAAC;IAKnD;;OAEG;IACH,UAAU,CAAC,GAAG,EAAE,MAAM,CAAC,EAAE,MAAM,EAAE,GAAG,EAAE,GAAG,UAAU,CAAC,CAAC,CAAC;IAKtD;;OAEG;IACH,KAAK,IAAI,MAAM;CAGhB"}
|
|
@@ -1,284 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Collection Class
|
|
4
|
-
*
|
|
5
|
-
* A collection of Eloquent models
|
|
6
|
-
*/
|
|
7
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
-
exports.Collection = void 0;
|
|
9
|
-
class Collection extends Array {
|
|
10
|
-
/**
|
|
11
|
-
* Create a new collection
|
|
12
|
-
*/
|
|
13
|
-
constructor(items = []) {
|
|
14
|
-
super(...items);
|
|
15
|
-
Object.setPrototypeOf(this, Collection.prototype);
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* Get all items in the collection
|
|
19
|
-
*/
|
|
20
|
-
all() {
|
|
21
|
-
return [...this];
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* Get the first item from the collection
|
|
25
|
-
*/
|
|
26
|
-
first(callback) {
|
|
27
|
-
if (callback) {
|
|
28
|
-
return this.find(callback);
|
|
29
|
-
}
|
|
30
|
-
return this[0];
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* Get the last item from the collection
|
|
34
|
-
*/
|
|
35
|
-
last(callback) {
|
|
36
|
-
if (callback) {
|
|
37
|
-
const filtered = this.filter(callback);
|
|
38
|
-
return filtered[filtered.length - 1];
|
|
39
|
-
}
|
|
40
|
-
return this[this.length - 1];
|
|
41
|
-
}
|
|
42
|
-
/**
|
|
43
|
-
* Reject items from the collection using a callback
|
|
44
|
-
*/
|
|
45
|
-
reject(callback) {
|
|
46
|
-
return new Collection(this.filter((item, index) => !callback(item, index)));
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* Map the collection and return a new collection
|
|
50
|
-
*/
|
|
51
|
-
mapIntoCollection(callback) {
|
|
52
|
-
return this.map((item, index) => callback(item, index));
|
|
53
|
-
}
|
|
54
|
-
/**
|
|
55
|
-
* Get a collection with only unique items
|
|
56
|
-
*/
|
|
57
|
-
unique(key) {
|
|
58
|
-
if (!key) {
|
|
59
|
-
return new Collection([...new Set(this)]);
|
|
60
|
-
}
|
|
61
|
-
const seen = new Set();
|
|
62
|
-
const unique = [];
|
|
63
|
-
for (const item of this) {
|
|
64
|
-
const value = item[key];
|
|
65
|
-
if (!seen.has(value)) {
|
|
66
|
-
seen.add(value);
|
|
67
|
-
unique.push(item);
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
return new Collection(unique);
|
|
71
|
-
}
|
|
72
|
-
/**
|
|
73
|
-
* Get the collection of items as a plain array
|
|
74
|
-
*/
|
|
75
|
-
toArray() {
|
|
76
|
-
return this.map((item) => item.toObject());
|
|
77
|
-
}
|
|
78
|
-
/**
|
|
79
|
-
* Get the collection of items as JSON
|
|
80
|
-
*/
|
|
81
|
-
toJSON() {
|
|
82
|
-
return this.toArray();
|
|
83
|
-
}
|
|
84
|
-
/**
|
|
85
|
-
* Determine if the collection is empty
|
|
86
|
-
*/
|
|
87
|
-
isEmpty() {
|
|
88
|
-
return this.length === 0;
|
|
89
|
-
}
|
|
90
|
-
/**
|
|
91
|
-
* Determine if the collection is not empty
|
|
92
|
-
*/
|
|
93
|
-
isNotEmpty() {
|
|
94
|
-
return this.length > 0;
|
|
95
|
-
}
|
|
96
|
-
/**
|
|
97
|
-
* Get the sum of the given values
|
|
98
|
-
*/
|
|
99
|
-
sum(key) {
|
|
100
|
-
if (!key) {
|
|
101
|
-
return 0;
|
|
102
|
-
}
|
|
103
|
-
return this.reduce((sum, item) => sum + Number(item[key] || 0), 0);
|
|
104
|
-
}
|
|
105
|
-
/**
|
|
106
|
-
* Get the average value of a given key
|
|
107
|
-
*/
|
|
108
|
-
avg(key) {
|
|
109
|
-
if (this.isEmpty()) {
|
|
110
|
-
return 0;
|
|
111
|
-
}
|
|
112
|
-
return this.sum(key) / this.length;
|
|
113
|
-
}
|
|
114
|
-
/**
|
|
115
|
-
* Get the min value of a given key
|
|
116
|
-
*/
|
|
117
|
-
min(key) {
|
|
118
|
-
if (this.isEmpty() || !key) {
|
|
119
|
-
return undefined;
|
|
120
|
-
}
|
|
121
|
-
return Math.min(...this.map((item) => Number(item[key] || 0)));
|
|
122
|
-
}
|
|
123
|
-
/**
|
|
124
|
-
* Get the max value of a given key
|
|
125
|
-
*/
|
|
126
|
-
max(key) {
|
|
127
|
-
if (this.isEmpty() || !key) {
|
|
128
|
-
return undefined;
|
|
129
|
-
}
|
|
130
|
-
return Math.max(...this.map((item) => Number(item[key] || 0)));
|
|
131
|
-
}
|
|
132
|
-
/**
|
|
133
|
-
* Pluck an attribute from each model
|
|
134
|
-
*/
|
|
135
|
-
pluck(key) {
|
|
136
|
-
return this.map((item) => item[key]);
|
|
137
|
-
}
|
|
138
|
-
/**
|
|
139
|
-
* Get the keys of the collection items
|
|
140
|
-
*/
|
|
141
|
-
modelKeys() {
|
|
142
|
-
return this.map((item) => item.getKey());
|
|
143
|
-
}
|
|
144
|
-
/**
|
|
145
|
-
* Sort the collection by a callback or key
|
|
146
|
-
*/
|
|
147
|
-
sortBy(keyOrCallback) {
|
|
148
|
-
const sorted = [...this];
|
|
149
|
-
if (typeof keyOrCallback === 'function') {
|
|
150
|
-
sorted.sort(keyOrCallback);
|
|
151
|
-
}
|
|
152
|
-
else {
|
|
153
|
-
sorted.sort((a, b) => {
|
|
154
|
-
const aVal = a[keyOrCallback];
|
|
155
|
-
const bVal = b[keyOrCallback];
|
|
156
|
-
if (aVal < bVal)
|
|
157
|
-
return -1;
|
|
158
|
-
if (aVal > bVal)
|
|
159
|
-
return 1;
|
|
160
|
-
return 0;
|
|
161
|
-
});
|
|
162
|
-
}
|
|
163
|
-
return new Collection(sorted);
|
|
164
|
-
}
|
|
165
|
-
/**
|
|
166
|
-
* Sort the collection in descending order
|
|
167
|
-
*/
|
|
168
|
-
sortByDesc(key) {
|
|
169
|
-
return this.sortBy((a, b) => {
|
|
170
|
-
const aVal = a[key];
|
|
171
|
-
const bVal = b[key];
|
|
172
|
-
if (aVal < bVal)
|
|
173
|
-
return 1;
|
|
174
|
-
if (aVal > bVal)
|
|
175
|
-
return -1;
|
|
176
|
-
return 0;
|
|
177
|
-
});
|
|
178
|
-
}
|
|
179
|
-
/**
|
|
180
|
-
* Group the collection by a given key
|
|
181
|
-
*/
|
|
182
|
-
groupBy(key) {
|
|
183
|
-
const groups = {};
|
|
184
|
-
for (const item of this) {
|
|
185
|
-
const groupKey = String(item[key]);
|
|
186
|
-
if (!groups[groupKey]) {
|
|
187
|
-
groups[groupKey] = [];
|
|
188
|
-
}
|
|
189
|
-
groups[groupKey].push(item);
|
|
190
|
-
}
|
|
191
|
-
const result = {};
|
|
192
|
-
for (const [key, items] of Object.entries(groups)) {
|
|
193
|
-
result[key] = new Collection(items);
|
|
194
|
-
}
|
|
195
|
-
return result;
|
|
196
|
-
}
|
|
197
|
-
/**
|
|
198
|
-
* Chunk the collection into smaller collections
|
|
199
|
-
*/
|
|
200
|
-
chunkModels(size) {
|
|
201
|
-
const chunks = [];
|
|
202
|
-
for (let i = 0; i < this.length; i += size) {
|
|
203
|
-
chunks.push(new Collection(this.slice(i, i + size)));
|
|
204
|
-
}
|
|
205
|
-
return chunks;
|
|
206
|
-
}
|
|
207
|
-
/**
|
|
208
|
-
* Take the first n items
|
|
209
|
-
*/
|
|
210
|
-
take(limit) {
|
|
211
|
-
return new Collection(this.slice(0, limit));
|
|
212
|
-
}
|
|
213
|
-
/**
|
|
214
|
-
* Skip the first n items
|
|
215
|
-
*/
|
|
216
|
-
skip(count) {
|
|
217
|
-
return new Collection(this.slice(count));
|
|
218
|
-
}
|
|
219
|
-
/**
|
|
220
|
-
* Merge the collection with the given items
|
|
221
|
-
*/
|
|
222
|
-
merge(items) {
|
|
223
|
-
return new Collection([...this, ...items]);
|
|
224
|
-
}
|
|
225
|
-
/**
|
|
226
|
-
* Get the collection without the specified items
|
|
227
|
-
*/
|
|
228
|
-
except(keys) {
|
|
229
|
-
const keySet = new Set(keys);
|
|
230
|
-
return new Collection(this.filter((item) => !keySet.has(item.getKey())));
|
|
231
|
-
}
|
|
232
|
-
/**
|
|
233
|
-
* Get only the specified items from the collection
|
|
234
|
-
*/
|
|
235
|
-
only(keys) {
|
|
236
|
-
const keySet = new Set(keys);
|
|
237
|
-
return new Collection(this.filter((item) => keySet.has(item.getKey())));
|
|
238
|
-
}
|
|
239
|
-
/**
|
|
240
|
-
* Load a set of relationships onto the collection
|
|
241
|
-
*/
|
|
242
|
-
async load(relations) {
|
|
243
|
-
// TODO: Implement eager loading
|
|
244
|
-
// This will be implemented when we add relationship support
|
|
245
|
-
return this;
|
|
246
|
-
}
|
|
247
|
-
/**
|
|
248
|
-
* Find a model in the collection by key
|
|
249
|
-
*/
|
|
250
|
-
find(keyOrCallback) {
|
|
251
|
-
if (typeof keyOrCallback === 'function') {
|
|
252
|
-
return super.find(keyOrCallback);
|
|
253
|
-
}
|
|
254
|
-
return super.find((item) => item.getKey() === keyOrCallback);
|
|
255
|
-
}
|
|
256
|
-
/**
|
|
257
|
-
* Determine if a key exists in the collection
|
|
258
|
-
*/
|
|
259
|
-
contains(keyOrCallback) {
|
|
260
|
-
return this.find(keyOrCallback) !== undefined;
|
|
261
|
-
}
|
|
262
|
-
/**
|
|
263
|
-
* Get the items with the specified keys
|
|
264
|
-
*/
|
|
265
|
-
whereIn(key, values) {
|
|
266
|
-
const valueSet = new Set(values);
|
|
267
|
-
return new Collection(super.filter((item) => valueSet.has(item[key])));
|
|
268
|
-
}
|
|
269
|
-
/**
|
|
270
|
-
* Get the items where a key is not in the given values
|
|
271
|
-
*/
|
|
272
|
-
whereNotIn(key, values) {
|
|
273
|
-
const valueSet = new Set(values);
|
|
274
|
-
return new Collection(super.filter((item) => !valueSet.has(item[key])));
|
|
275
|
-
}
|
|
276
|
-
/**
|
|
277
|
-
* Count the number of items in the collection
|
|
278
|
-
*/
|
|
279
|
-
count() {
|
|
280
|
-
return this.length;
|
|
281
|
-
}
|
|
282
|
-
}
|
|
283
|
-
exports.Collection = Collection;
|
|
284
|
-
//# sourceMappingURL=Collection.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Collection.js","sourceRoot":"","sources":["../../../src/Database/Eloquent/Collection.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAIH,MAAa,UAA4B,SAAQ,KAAQ;IACvD;;OAEG;IACH,YAAY,QAAa,EAAE;QACzB,KAAK,CAAC,GAAG,KAAK,CAAC,CAAC;QAChB,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,UAAU,CAAC,SAAS,CAAC,CAAC;IACpD,CAAC;IAED;;OAEG;IACH,GAAG;QACD,OAAO,CAAC,GAAG,IAAI,CAAC,CAAC;IACnB,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,QAA+B;QACnC,IAAI,QAAQ,EAAE,CAAC;YACb,OAAO,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAC7B,CAAC;QACD,OAAO,IAAI,CAAC,CAAC,CAAC,CAAC;IACjB,CAAC;IAED;;OAEG;IACH,IAAI,CAAC,QAA+B;QAClC,IAAI,QAAQ,EAAE,CAAC;YACb,MAAM,QAAQ,GAAG,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;YACvC,OAAO,QAAQ,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;QACvC,CAAC;QACD,OAAO,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IAC/B,CAAC;IAED;;OAEG;IACH,MAAM,CAAC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IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,KAAK,SAAS,CAAC;IAChD,CAAC;IAED;;OAEG;IACH,OAAO,CAAC,GAAY,EAAE,MAAa;QACjC,MAAM,QAAQ,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,CAAC;QACjC,OAAO,IAAI,UAAU,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IACzE,CAAC;IAED;;OAEG;IACH,UAAU,CAAC,GAAY,EAAE,MAAa;QACpC,MAAM,QAAQ,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,CAAC;QACjC,OAAO,IAAI,UAAU,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IAC1E,CAAC;IAED;;OAEG;IACH,KAAK;QACH,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;CACF;AA9TD,gCA8TC"}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* HasAttributes Concern
|
|
3
|
-
*
|
|
4
|
-
* Provides attribute handling functionality for models
|
|
5
|
-
*/
|
|
6
|
-
export interface HasAttributes {
|
|
7
|
-
/**
|
|
8
|
-
* The model's attributes
|
|
9
|
-
*/
|
|
10
|
-
attributes: Record<string, any>;
|
|
11
|
-
/**
|
|
12
|
-
* The model's original attributes
|
|
13
|
-
*/
|
|
14
|
-
original: Record<string, any>;
|
|
15
|
-
/**
|
|
16
|
-
* The attributes that should be cast
|
|
17
|
-
*/
|
|
18
|
-
casts: Record<string, string>;
|
|
19
|
-
/**
|
|
20
|
-
* The attributes that should be hidden
|
|
21
|
-
*/
|
|
22
|
-
hidden: string[];
|
|
23
|
-
/**
|
|
24
|
-
* The attributes that should be visible
|
|
25
|
-
*/
|
|
26
|
-
visible: string[];
|
|
27
|
-
/**
|
|
28
|
-
* The accessors to append
|
|
29
|
-
*/
|
|
30
|
-
appends: string[];
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* Cast types supported by the model
|
|
34
|
-
*/
|
|
35
|
-
export type CastType = 'int' | 'integer' | 'real' | 'float' | 'double' | 'decimal' | 'string' | 'bool' | 'boolean' | 'object' | 'array' | 'json' | 'collection' | 'date' | 'datetime' | 'timestamp';
|
|
36
|
-
/**
|
|
37
|
-
* Attribute mutator function type
|
|
38
|
-
*/
|
|
39
|
-
export type AttributeMutator = (value: any) => void;
|
|
40
|
-
/**
|
|
41
|
-
* Attribute accessor function type
|
|
42
|
-
*/
|
|
43
|
-
export type AttributeAccessor = () => any;
|
|
44
|
-
//# sourceMappingURL=HasAttributes.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"HasAttributes.d.ts","sourceRoot":"","sources":["../../../../src/Database/Eloquent/Concerns/HasAttributes.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,MAAM,WAAW,aAAa;IAC5B;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAEhC;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAE9B;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAE9B;;OAEG;IACH,MAAM,EAAE,MAAM,EAAE,CAAC;IAEjB;;OAEG;IACH,OAAO,EAAE,MAAM,EAAE,CAAC;IAElB;;OAEG;IACH,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,MAAM,QAAQ,GAChB,KAAK,GACL,SAAS,GACT,MAAM,GACN,OAAO,GACP,QAAQ,GACR,SAAS,GACT,QAAQ,GACR,MAAM,GACN,SAAS,GACT,QAAQ,GACR,OAAO,GACP,MAAM,GACN,YAAY,GACZ,MAAM,GACN,UAAU,GACV,WAAW,CAAC;AAEhB;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,CAAC,KAAK,EAAE,GAAG,KAAK,IAAI,CAAC;AAEpD;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG,MAAM,GAAG,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"HasAttributes.js","sourceRoot":"","sources":["../../../../src/Database/Eloquent/Concerns/HasAttributes.ts"],"names":[],"mappings":";AAAA;;;;GAIG"}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* HasTimestamps Concern
|
|
3
|
-
*
|
|
4
|
-
* Provides timestamp handling functionality for models
|
|
5
|
-
*/
|
|
6
|
-
export interface HasTimestamps {
|
|
7
|
-
/**
|
|
8
|
-
* Indicates if the model should be timestamped
|
|
9
|
-
*/
|
|
10
|
-
timestamps: boolean;
|
|
11
|
-
/**
|
|
12
|
-
* Update the model's timestamps
|
|
13
|
-
*/
|
|
14
|
-
updateTimestamps(): void;
|
|
15
|
-
/**
|
|
16
|
-
* Set the value of the "created at" attribute
|
|
17
|
-
*/
|
|
18
|
-
setCreatedAt(value: Date): void;
|
|
19
|
-
/**
|
|
20
|
-
* Set the value of the "updated at" attribute
|
|
21
|
-
*/
|
|
22
|
-
setUpdatedAt(value: Date): void;
|
|
23
|
-
/**
|
|
24
|
-
* Get the name of the "created at" column
|
|
25
|
-
*/
|
|
26
|
-
getCreatedAtColumn(): string;
|
|
27
|
-
/**
|
|
28
|
-
* Get the name of the "updated at" column
|
|
29
|
-
*/
|
|
30
|
-
getUpdatedAtColumn(): string;
|
|
31
|
-
/**
|
|
32
|
-
* Determine if the model uses timestamps
|
|
33
|
-
*/
|
|
34
|
-
usesTimestamps(): boolean;
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* Default timestamp column names
|
|
38
|
-
*/
|
|
39
|
-
export declare const CREATED_AT = "created_at";
|
|
40
|
-
export declare const UPDATED_AT = "updated_at";
|
|
41
|
-
//# sourceMappingURL=HasTimestamps.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"HasTimestamps.d.ts","sourceRoot":"","sources":["../../../../src/Database/Eloquent/Concerns/HasTimestamps.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,MAAM,WAAW,aAAa;IAC5B;;OAEG;IACH,UAAU,EAAE,OAAO,CAAC;IAEpB;;OAEG;IACH,gBAAgB,IAAI,IAAI,CAAC;IAEzB;;OAEG;IACH,YAAY,CAAC,KAAK,EAAE,IAAI,GAAG,IAAI,CAAC;IAEhC;;OAEG;IACH,YAAY,CAAC,KAAK,EAAE,IAAI,GAAG,IAAI,CAAC;IAEhC;;OAEG;IACH,kBAAkB,IAAI,MAAM,CAAC;IAE7B;;OAEG;IACH,kBAAkB,IAAI,MAAM,CAAC;IAE7B;;OAEG;IACH,cAAc,IAAI,OAAO,CAAC;CAC3B;AAED;;GAEG;AACH,eAAO,MAAM,UAAU,eAAe,CAAC;AACvC,eAAO,MAAM,UAAU,eAAe,CAAC"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* HasTimestamps Concern
|
|
4
|
-
*
|
|
5
|
-
* Provides timestamp handling functionality for models
|
|
6
|
-
*/
|
|
7
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
-
exports.UPDATED_AT = exports.CREATED_AT = void 0;
|
|
9
|
-
/**
|
|
10
|
-
* Default timestamp column names
|
|
11
|
-
*/
|
|
12
|
-
exports.CREATED_AT = 'created_at';
|
|
13
|
-
exports.UPDATED_AT = 'updated_at';
|
|
14
|
-
//# sourceMappingURL=HasTimestamps.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"HasTimestamps.js","sourceRoot":"","sources":["../../../../src/Database/Eloquent/Concerns/HasTimestamps.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAuCH;;GAEG;AACU,QAAA,UAAU,GAAG,YAAY,CAAC;AAC1B,QAAA,UAAU,GAAG,YAAY,CAAC"}
|