@aventusjs/cli 0.0.39 → 0.0.40

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.
@@ -4,7 +4,6 @@
4
4
  declare global {
5
5
 
6
6
  namespace AventusPhp{
7
- @Required()
8
7
  @Convertible()
9
8
  class LaravelResult<T> extends Aventus.ResultWithError<T> {
10
9
  static get Fullname(): string;
@@ -38,11 +37,10 @@ abstract class AventusFile<T = any> {
38
37
  toJSON(): any;
39
38
  }
40
39
 
41
- abstract class AventusImage<T = any> extends AventusFile<T> {
40
+ abstract class AventusImage<T = any> extends AventusPhp.AventusFile<T> {
42
41
  static get Fullname(): string;
43
42
  }
44
43
 
45
- @Required()
46
44
  @Convertible()
47
45
  class AventusError<T extends (number | Aventus.Enum) = any> extends Aventus.GenericError<T> {
48
46
  static get Fullname(): string;
@@ -75,15 +73,15 @@ abstract class ModelController<T extends Aventus.IData, U extends object = any,
75
73
  toRequest(resource: R | S): U;
76
74
  }
77
75
 
78
- type RamHttpResource<C> = C extends ModelController<any, any, infer Res, any> ? Res : never;
76
+ type RamHttpResource<C> = C extends AventusPhp.ModelController<any, any, infer Res, any> ? Res : never;
79
77
 
80
- type RamHttpRequest<C> = C extends ModelController<any, infer Req, any, any> ? Req : never;
78
+ type RamHttpRequest<C> = C extends AventusPhp.ModelController<any, infer Req, any, any> ? Req : never;
81
79
 
82
- type RamHttpData<C> = C extends ModelController<infer D, any, any, any> ? D & {
80
+ type RamHttpData<C> = C extends AventusPhp.ModelController<infer D, any, any, any> ? D & {
83
81
  id: string | number;
84
82
  } : never;
85
83
 
86
- type RamHttpResourceDetails<C> = C extends ModelController<any, any, any, infer Res> ? Res : never;
84
+ type RamHttpResourceDetails<C> = C extends AventusPhp.ModelController<any, any, any, infer Res> ? Res : never;
87
85
 
88
86
  class RamCompletor<T extends Aventus.IRamData> {
89
87
  protected objects: T[];
@@ -94,7 +92,7 @@ class RamCompletor<T extends Aventus.IRamData> {
94
92
  run(): Promise<Aventus.VoidWithError>;
95
93
  }
96
94
 
97
- abstract class GenericRamHttp<Index extends string | number, C extends ModelController<any, any, any, any>> implements Aventus.IRam {
95
+ abstract class GenericRamHttp<Index extends string | number, C extends AventusPhp.ModelController<any, any, any, any>> implements Aventus.IRam {
98
96
  /**
99
97
  * The current namespace
100
98
  */
@@ -104,13 +102,13 @@ abstract class GenericRamHttp<Index extends string | number, C extends ModelCont
104
102
  */
105
103
  static get Fullname(): string;
106
104
  private subscribers;
107
- protected recordsSubscribers: Map<Index, ___AventusPhp.RamSubscribers<Aventus.RamItem<RamHttpResourceDetails<C>>>>;
105
+ protected recordsSubscribers: Map<Index, ___AventusPhp.RamSubscribers<Aventus.RamItem<AventusPhp.RamHttpResourceDetails<C>>>>;
108
106
  /**
109
107
  * List of stored item by index key
110
108
  */
111
- protected records: Map<Index, Aventus.RamItem<RamHttpResourceDetails<C>>>;
109
+ protected records: Map<Index, Aventus.RamItem<AventusPhp.RamHttpResourceDetails<C>>>;
112
110
  protected actionGuard: Aventus.ActionGuard;
113
- protected routes: ModelController<RamHttpData<C>, RamHttpRequest<C>, RamHttpResource<C>, RamHttpResourceDetails<C>>;
111
+ protected routes: AventusPhp.ModelController<AventusPhp.RamHttpData<C>, AventusPhp.RamHttpRequest<C>, AventusPhp.RamHttpResource<C>, AventusPhp.RamHttpResourceDetails<C>>;
114
112
  protected getAllDone: boolean;
115
113
  protected getByIdDone: Index[];
116
114
  protected hasDetails: boolean;
@@ -120,19 +118,19 @@ abstract class GenericRamHttp<Index extends string | number, C extends ModelCont
120
118
  * Define the field where the index key is location
121
119
  * Example : 'id';
122
120
  */
123
- abstract defineIndexKey(): keyof RamHttpResourceDetails<C>;
121
+ abstract defineIndexKey(): keyof AventusPhp.RamHttpResourceDetails<C>;
124
122
  /**
125
123
  * Get item id
126
124
  */
127
125
  @BindThis()
128
- getIdWithError(item: Aventus.KeysObject<RamHttpResourceDetails<C>> | RamHttpResourceDetails<C>): Aventus.ResultRamWithError<Index>;
126
+ getIdWithError(item: Aventus.KeysObject<AventusPhp.RamHttpResourceDetails<C>> | AventusPhp.RamHttpResourceDetails<C>): Aventus.ResultRamWithError<Index>;
129
127
  /**
130
128
  * Get item id
131
129
  */
132
130
  @BindThis()
133
- getId(item: Aventus.KeysObject<RamHttpResourceDetails<C>> | RamHttpResourceDetails<C>): Index;
131
+ getId(item: Aventus.KeysObject<AventusPhp.RamHttpResourceDetails<C>> | AventusPhp.RamHttpResourceDetails<C>): Index;
134
132
  private isResource;
135
- toRequest(resource: RamHttpResource<C> | RamHttpResourceDetails<C>): RamHttpRequest<C>;
133
+ toRequest(resource: AventusPhp.RamHttpResource<C> | AventusPhp.RamHttpResourceDetails<C>): AventusPhp.RamHttpRequest<C>;
136
134
  /**
137
135
  * Prevent adding Watch element
138
136
  */
@@ -146,273 +144,273 @@ abstract class GenericRamHttp<Index extends string | number, C extends ModelCont
146
144
  new (...args: any[]): Aventus.IRamData;
147
145
  get className(): string;
148
146
  } & B;
149
- protected getTypeForData(objJson: Aventus.KeysObject<RamHttpResourceDetails<C>> | RamHttpResourceDetails<C>): new () => RamHttpResourceDetails<C>;
147
+ protected getTypeForData(objJson: Aventus.KeysObject<AventusPhp.RamHttpResourceDetails<C>> | AventusPhp.RamHttpResourceDetails<C>): new () => AventusPhp.RamHttpResourceDetails<C>;
150
148
  /**
151
149
  * Transform the object into the object stored inside Ram
152
150
  */
153
- protected getObjectForRam(objJson: Aventus.KeysObject<RamHttpResourceDetails<C>> | RamHttpResourceDetails<C>): Aventus.RamItem<RamHttpResourceDetails<C>>;
151
+ protected getObjectForRam(objJson: Aventus.KeysObject<AventusPhp.RamHttpResourceDetails<C>> | AventusPhp.RamHttpResourceDetails<C>): Aventus.RamItem<AventusPhp.RamHttpResourceDetails<C>>;
154
152
  /**
155
153
  * Add element inside Ram or update it. The instance inside the ram is unique and ll never be replaced
156
154
  */
157
- protected addOrUpdateData(item: Aventus.KeysObject<RamHttpResourceDetails<C>>, result: Aventus.ResultWithError<Aventus.RamItem<RamHttpResourceDetails<C>>>, options?: Aventus.JsonFromOptions): Promise<'created' | 'updated' | null>;
155
+ protected addOrUpdateData(item: Aventus.KeysObject<AventusPhp.RamHttpResourceDetails<C>>, result: Aventus.ResultWithError<Aventus.RamItem<AventusPhp.RamHttpResourceDetails<C>>>, options?: Aventus.JsonFromOptions): Promise<'created' | 'updated' | null>;
158
156
  /**
159
157
  * Merge object and create real instance of class
160
158
  */
161
- protected mergeObject(item: RamHttpResourceDetails<C> | undefined, objJson: Aventus.KeysObject<RamHttpResourceDetails<C>> | RamHttpResourceDetails<C>, options?: Aventus.JsonFromOptions): void;
159
+ protected mergeObject(item: AventusPhp.RamHttpResourceDetails<C> | undefined, objJson: Aventus.KeysObject<AventusPhp.RamHttpResourceDetails<C>> | AventusPhp.RamHttpResourceDetails<C>, options?: Aventus.JsonFromOptions): void;
162
160
  /**
163
161
  * Create or update the item
164
162
  */
165
163
  @BindThis()
166
- save(item: RamHttpRequest<C>, ...args: any[]): Promise<Aventus.RamItem<RamHttpResourceDetails<C>> | undefined>;
164
+ save(item: AventusPhp.RamHttpRequest<C>, ...args: any[]): Promise<Aventus.RamItem<AventusPhp.RamHttpResourceDetails<C>> | undefined>;
167
165
  /**
168
166
  * Create or update the item
169
167
  */
170
168
  @BindThis()
171
- saveWithError(item: RamHttpRequest<C>, ...args: any[]): Promise<Aventus.ResultRamWithError<Aventus.RamItem<RamHttpResourceDetails<C>>>>;
172
- protected beforeRecordSet(item: Aventus.RamItem<RamHttpResourceDetails<C>>): Promise<void>;
173
- protected afterRecordSet(item: Aventus.RamItem<RamHttpResourceDetails<C>>): Promise<void>;
174
- protected beforeRecordDelete(item: Aventus.RamItem<RamHttpResourceDetails<C>>): Promise<void>;
175
- protected afterRecordDelete(item: Aventus.RamItem<RamHttpResourceDetails<C>>): Promise<void>;
176
- protected publish(type: 'created' | 'updated' | 'deleted', data: Aventus.RamItem<RamHttpResourceDetails<C>>): void;
169
+ saveWithError(item: AventusPhp.RamHttpRequest<C>, ...args: any[]): Promise<Aventus.ResultRamWithError<Aventus.RamItem<AventusPhp.RamHttpResourceDetails<C>>>>;
170
+ protected beforeRecordSet(item: Aventus.RamItem<AventusPhp.RamHttpResourceDetails<C>>): Promise<void>;
171
+ protected afterRecordSet(item: Aventus.RamItem<AventusPhp.RamHttpResourceDetails<C>>): Promise<void>;
172
+ protected beforeRecordDelete(item: Aventus.RamItem<AventusPhp.RamHttpResourceDetails<C>>): Promise<void>;
173
+ protected afterRecordDelete(item: Aventus.RamItem<AventusPhp.RamHttpResourceDetails<C>>): Promise<void>;
174
+ protected publish(type: 'created' | 'updated' | 'deleted', data: Aventus.RamItem<AventusPhp.RamHttpResourceDetails<C>>): void;
177
175
  private subscribe;
178
176
  private unsubscribe;
179
177
  /**
180
178
  * Add a callback that ll be triggered when a new item is stored
181
179
  */
182
180
  @BindThis()
183
- onCreated(cb: (item: Aventus.RamItem<RamHttpResourceDetails<C>>) => void): void;
181
+ onCreated(cb: (item: Aventus.RamItem<AventusPhp.RamHttpResourceDetails<C>>) => void): void;
184
182
  /**
185
183
  * Remove a created callback
186
184
  */
187
185
  @BindThis()
188
- offCreated(cb: (item: Aventus.RamItem<RamHttpResourceDetails<C>>) => void): void;
186
+ offCreated(cb: (item: Aventus.RamItem<AventusPhp.RamHttpResourceDetails<C>>) => void): void;
189
187
  /**
190
188
  * Add a callback that ll be triggered when an item is updated
191
189
  */
192
190
  @BindThis()
193
- onUpdated(cb: (item: Aventus.RamItem<RamHttpResourceDetails<C>>) => void): void;
191
+ onUpdated(cb: (item: Aventus.RamItem<AventusPhp.RamHttpResourceDetails<C>>) => void): void;
194
192
  /**
195
193
  * Remove an updated callback
196
194
  */
197
195
  @BindThis()
198
- offUpdated(cb: (item: Aventus.RamItem<RamHttpResourceDetails<C>>) => void): void;
196
+ offUpdated(cb: (item: Aventus.RamItem<AventusPhp.RamHttpResourceDetails<C>>) => void): void;
199
197
  /**
200
198
  * Add a callback that ll be triggered when an item is deleted
201
199
  */
202
200
  @BindThis()
203
- onDeleted(cb: (item: Aventus.RamItem<RamHttpResourceDetails<C>>) => void): void;
201
+ onDeleted(cb: (item: Aventus.RamItem<AventusPhp.RamHttpResourceDetails<C>>) => void): void;
204
202
  /**
205
203
  * Remove an deleted callback
206
204
  */
207
205
  @BindThis()
208
- offDeleted(cb: (item: Aventus.RamItem<RamHttpResourceDetails<C>>) => void): void;
206
+ offDeleted(cb: (item: Aventus.RamItem<AventusPhp.RamHttpResourceDetails<C>>) => void): void;
209
207
  /**
210
208
  * Get an item by id if exist (alias for getById)
211
209
  */
212
210
  @BindThis()
213
- get(id: Index): Promise<Aventus.RamItem<RamHttpResourceDetails<C>> | undefined>;
211
+ get(id: Index): Promise<Aventus.RamItem<AventusPhp.RamHttpResourceDetails<C>> | undefined>;
214
212
  /**
215
213
  * Get an item by id if exist (alias for getById)
216
214
  */
217
215
  @BindThis()
218
- getWithError(id: Index): Promise<Aventus.ResultRamWithError<Aventus.RamItem<RamHttpResourceDetails<C>>>>;
216
+ getWithError(id: Index): Promise<Aventus.ResultRamWithError<Aventus.RamItem<AventusPhp.RamHttpResourceDetails<C>>>>;
219
217
  /**
220
218
  * Get an item by id if exist
221
219
  */
222
220
  @BindThis()
223
- getById(id: Index): Promise<Aventus.RamItem<RamHttpResourceDetails<C>> | undefined>;
221
+ getById(id: Index): Promise<Aventus.RamItem<AventusPhp.RamHttpResourceDetails<C>> | undefined>;
224
222
  /**
225
223
  * Get an item by id if exist
226
224
  */
227
225
  @BindThis()
228
- getByIdWithError(id: Index): Promise<Aventus.ResultRamWithError<Aventus.RamItem<RamHttpResourceDetails<C>>>>;
229
- protected queryGetById(id: Index, result: Aventus.ResultRamWithError<Aventus.RamItem<RamHttpResourceDetails<C>>>): Promise<void>;
226
+ getByIdWithError(id: Index): Promise<Aventus.ResultRamWithError<Aventus.RamItem<AventusPhp.RamHttpResourceDetails<C>>>>;
227
+ protected queryGetById(id: Index, result: Aventus.ResultRamWithError<Aventus.RamItem<AventusPhp.RamHttpResourceDetails<C>>>): Promise<void>;
230
228
  /**
231
229
  * Trigger before getting an item by id
232
230
  */
233
- protected beforeGetById(id: Index, result: Aventus.ResultRamWithError<Aventus.RamItem<RamHttpResourceDetails<C>>>): Promise<void>;
231
+ protected beforeGetById(id: Index, result: Aventus.ResultRamWithError<Aventus.RamItem<AventusPhp.RamHttpResourceDetails<C>>>): Promise<void>;
234
232
  /**
235
233
  * Trigger after getting an item by id
236
234
  */
237
- protected afterGetById(result: Aventus.ResultRamWithError<Aventus.RamItem<RamHttpResourceDetails<C>>>): Promise<void>;
235
+ protected afterGetById(result: Aventus.ResultRamWithError<Aventus.RamItem<AventusPhp.RamHttpResourceDetails<C>>>): Promise<void>;
238
236
  /**
239
237
  * Get multiple items by ids
240
238
  */
241
239
  @BindThis()
242
- getByIds(ids: Index[]): Promise<Aventus.RamItem<RamHttpResourceDetails<C>>[]>;
240
+ getByIds(ids: Index[]): Promise<Aventus.RamItem<AventusPhp.RamHttpResourceDetails<C>>[]>;
243
241
  /**
244
242
  * Get multiple items by ids
245
243
  */
246
244
  @BindThis()
247
- getByIdsWithError(ids: Index[]): Promise<Aventus.ResultRamWithError<Aventus.RamItem<RamHttpResourceDetails<C>>[]>>;
248
- protected queryGetByIds(ids: Index[], result: Aventus.ResultRamWithError<Aventus.RamItem<RamHttpResourceDetails<C>>[]>): Promise<void>;
245
+ getByIdsWithError(ids: Index[]): Promise<Aventus.ResultRamWithError<Aventus.RamItem<AventusPhp.RamHttpResourceDetails<C>>[]>>;
246
+ protected queryGetByIds(ids: Index[], result: Aventus.ResultRamWithError<Aventus.RamItem<AventusPhp.RamHttpResourceDetails<C>>[]>): Promise<void>;
249
247
  /**
250
248
  * Trigger before getting a list of items by id
251
249
  */
252
- protected beforeGetByIds(ids: Index[], result: Aventus.ResultRamWithError<Aventus.RamItem<RamHttpResourceDetails<C>>[]>): Promise<void>;
250
+ protected beforeGetByIds(ids: Index[], result: Aventus.ResultRamWithError<Aventus.RamItem<AventusPhp.RamHttpResourceDetails<C>>[]>): Promise<void>;
253
251
  /**
254
252
  * Trigger after getting a list of items by id
255
253
  */
256
- protected afterGetByIds(result: Aventus.ResultRamWithError<Aventus.RamItem<RamHttpResourceDetails<C>>[]>): Promise<void>;
254
+ protected afterGetByIds(result: Aventus.ResultRamWithError<Aventus.RamItem<AventusPhp.RamHttpResourceDetails<C>>[]>): Promise<void>;
257
255
  /**
258
256
  * Get all elements inside the Ram
259
257
  */
260
258
  @BindThis()
261
- getAll(): Promise<Map<Index, Aventus.RamItem<RamHttpResource<C>>>>;
259
+ getAll(): Promise<Map<Index, Aventus.RamItem<AventusPhp.RamHttpResource<C>>>>;
262
260
  /**
263
261
  * Get all elements inside the Ram
264
262
  */
265
263
  @BindThis()
266
- getAllWithError(): Promise<Aventus.ResultRamWithError<Map<Index, Aventus.RamItem<RamHttpResource<C>>>>>;
267
- protected queryGetAll(result: Aventus.ResultRamWithError<Map<Index, Aventus.RamItem<RamHttpResource<C>>>>): any;
264
+ getAllWithError(): Promise<Aventus.ResultRamWithError<Map<Index, Aventus.RamItem<AventusPhp.RamHttpResource<C>>>>>;
265
+ protected queryGetAll(result: Aventus.ResultRamWithError<Map<Index, Aventus.RamItem<AventusPhp.RamHttpResource<C>>>>): any;
268
266
  /**
269
267
  * Trigger before getting all items inside Ram
270
268
  */
271
- protected beforeGetAll(result: Aventus.ResultRamWithError<Map<Index, Aventus.RamItem<RamHttpResource<C>>>>): Promise<void>;
269
+ protected beforeGetAll(result: Aventus.ResultRamWithError<Map<Index, Aventus.RamItem<AventusPhp.RamHttpResource<C>>>>): Promise<void>;
272
270
  /**
273
271
  * Trigger after getting all items inside Ram
274
272
  */
275
- protected afterGetAll(result: Aventus.ResultRamWithError<Map<Index, Aventus.RamItem<RamHttpResource<C>>>>): Promise<void>;
273
+ protected afterGetAll(result: Aventus.ResultRamWithError<Map<Index, Aventus.RamItem<AventusPhp.RamHttpResource<C>>>>): Promise<void>;
276
274
  /**
277
275
  * Get all elements inside the Ram
278
276
  */
279
277
  @BindThis()
280
- getList(): Promise<Aventus.RamItem<RamHttpResource<C>>[]>;
278
+ getList(): Promise<Aventus.RamItem<AventusPhp.RamHttpResource<C>>[]>;
281
279
  /**
282
280
  * Get all elements inside the Ram
283
281
  */
284
282
  @BindThis()
285
- getListWithError(): Promise<Aventus.ResultRamWithError<Aventus.RamItem<RamHttpResource<C>>[]>>;
283
+ getListWithError(): Promise<Aventus.ResultRamWithError<Aventus.RamItem<AventusPhp.RamHttpResource<C>>[]>>;
286
284
  /**
287
285
  * Create a list of items inside ram
288
286
  */
289
287
  @BindThis()
290
- createList(list: RamHttpRequest<C>[]): Promise<Aventus.RamItem<RamHttpResourceDetails<C>>[]>;
288
+ createList(list: AventusPhp.RamHttpRequest<C>[]): Promise<Aventus.RamItem<AventusPhp.RamHttpResourceDetails<C>>[]>;
291
289
  /**
292
290
  * Create a list of items inside ram
293
291
  */
294
292
  @BindThis()
295
- createListWithError(list: RamHttpRequest<C>[]): Promise<Aventus.ResultRamWithError<Aventus.RamItem<RamHttpResourceDetails<C>>[]>>;
293
+ createListWithError(list: AventusPhp.RamHttpRequest<C>[]): Promise<Aventus.ResultRamWithError<Aventus.RamItem<AventusPhp.RamHttpResourceDetails<C>>[]>>;
296
294
  /**
297
295
  * Create an item inside ram
298
296
  */
299
297
  @BindThis()
300
- create(item: RamHttpRequest<C>, ...args: any[]): Promise<Aventus.RamItem<RamHttpResourceDetails<C>> | undefined>;
298
+ create(item: AventusPhp.RamHttpRequest<C>, ...args: any[]): Promise<Aventus.RamItem<AventusPhp.RamHttpResourceDetails<C>> | undefined>;
301
299
  /**
302
300
  * Create an item inside ram
303
301
  */
304
302
  @BindThis()
305
- createWithError(item: RamHttpRequest<C>, ...args: any[]): Promise<Aventus.ResultRamWithError<Aventus.RamItem<RamHttpResourceDetails<C>>>>;
303
+ createWithError(item: AventusPhp.RamHttpRequest<C>, ...args: any[]): Promise<Aventus.ResultRamWithError<Aventus.RamItem<AventusPhp.RamHttpResourceDetails<C>>>>;
306
304
  private _create;
307
- protected queryCreateList(list: RamHttpRequest<C>[], resultTemp: Aventus.ResultRamWithError<Aventus.RamItem<RamHttpRequest<C>>[]>): Promise<Aventus.ResultRamWithError<Aventus.RamItem<RamHttpResourceDetails<C>>[]>>;
305
+ protected queryCreateList(list: AventusPhp.RamHttpRequest<C>[], resultTemp: Aventus.ResultRamWithError<Aventus.RamItem<AventusPhp.RamHttpRequest<C>>[]>): Promise<Aventus.ResultRamWithError<Aventus.RamItem<AventusPhp.RamHttpResourceDetails<C>>[]>>;
308
306
  /**
309
307
  * Trigger before creating a list of items
310
308
  */
311
- protected beforeCreateList(list: RamHttpRequest<C>[], result: Aventus.ResultRamWithError<Aventus.RamItem<RamHttpRequest<C>>[]>): Promise<void>;
312
- protected queryCreateItem(item: RamHttpRequest<C>, fromList: boolean, resultTemp: Aventus.ResultRamWithError<Aventus.RamItem<RamHttpRequest<C>>>): Promise<Aventus.ResultRamWithError<Aventus.RamItem<RamHttpResourceDetails<C>>>>;
309
+ protected beforeCreateList(list: AventusPhp.RamHttpRequest<C>[], result: Aventus.ResultRamWithError<Aventus.RamItem<AventusPhp.RamHttpRequest<C>>[]>): Promise<void>;
310
+ protected queryCreateItem(item: AventusPhp.RamHttpRequest<C>, fromList: boolean, resultTemp: Aventus.ResultRamWithError<Aventus.RamItem<AventusPhp.RamHttpRequest<C>>>): Promise<Aventus.ResultRamWithError<Aventus.RamItem<AventusPhp.RamHttpResourceDetails<C>>>>;
313
311
  /**
314
312
  * Trigger before creating an item
315
313
  */
316
- protected beforeCreateItem(item: RamHttpRequest<C> | RamHttpResourceDetails<C>, fromList: boolean, result: Aventus.ResultRamWithError<Aventus.RamItem<RamHttpRequest<C>>>): Promise<void>;
314
+ protected beforeCreateItem(item: AventusPhp.RamHttpRequest<C> | AventusPhp.RamHttpResourceDetails<C>, fromList: boolean, result: Aventus.ResultRamWithError<Aventus.RamItem<AventusPhp.RamHttpRequest<C>>>): Promise<void>;
317
315
  /**
318
316
  * Trigger after creating an item
319
317
  */
320
- protected afterCreateItem(result: Aventus.ResultRamWithError<Aventus.RamItem<RamHttpResourceDetails<C>>>, fromList: boolean): Promise<void>;
318
+ protected afterCreateItem(result: Aventus.ResultRamWithError<Aventus.RamItem<AventusPhp.RamHttpResourceDetails<C>>>, fromList: boolean): Promise<void>;
321
319
  /**
322
320
  * Trigger after creating a list of items
323
321
  */
324
- protected afterCreateList(result: Aventus.ResultRamWithError<Aventus.RamItem<RamHttpResourceDetails<C>>[]>): Promise<void>;
322
+ protected afterCreateList(result: Aventus.ResultRamWithError<Aventus.RamItem<AventusPhp.RamHttpResourceDetails<C>>[]>): Promise<void>;
325
323
  /**
326
324
  * Update a list of items inside ram
327
325
  */
328
326
  @BindThis()
329
- updateList(list: RamHttpRequest<C>[]): Promise<Aventus.RamItem<RamHttpResourceDetails<C>>[]>;
327
+ updateList(list: AventusPhp.RamHttpRequest<C>[]): Promise<Aventus.RamItem<AventusPhp.RamHttpResourceDetails<C>>[]>;
330
328
  /**
331
329
  * Update a list of items inside ram
332
330
  */
333
331
  @BindThis()
334
- updateListWithError(list: RamHttpRequest<C>[]): Promise<Aventus.ResultRamWithError<Aventus.RamItem<RamHttpResourceDetails<C>>[]>>;
332
+ updateListWithError(list: AventusPhp.RamHttpRequest<C>[]): Promise<Aventus.ResultRamWithError<Aventus.RamItem<AventusPhp.RamHttpResourceDetails<C>>[]>>;
335
333
  /**
336
334
  * Update an item inside ram
337
335
  */
338
336
  @BindThis()
339
- update(item: RamHttpRequest<C>, ...args: any[]): Promise<Aventus.RamItem<RamHttpResourceDetails<C>> | undefined>;
337
+ update(item: AventusPhp.RamHttpRequest<C>, ...args: any[]): Promise<Aventus.RamItem<AventusPhp.RamHttpResourceDetails<C>> | undefined>;
340
338
  /**
341
339
  * Update an item inside ram
342
340
  */
343
341
  @BindThis()
344
- updateWithError(item: RamHttpRequest<C>, ...args: any[]): Promise<Aventus.ResultRamWithError<Aventus.RamItem<RamHttpResourceDetails<C>>>>;
342
+ updateWithError(item: AventusPhp.RamHttpRequest<C>, ...args: any[]): Promise<Aventus.ResultRamWithError<Aventus.RamItem<AventusPhp.RamHttpResourceDetails<C>>>>;
345
343
  private _update;
346
- protected queryUpdateList(list: RamHttpRequest<C>[], resultTemp: Aventus.ResultRamWithError<Aventus.RamItem<RamHttpRequest<C>>[]>): Promise<Aventus.ResultRamWithError<Aventus.RamItem<RamHttpResourceDetails<C>>[]>>;
344
+ protected queryUpdateList(list: AventusPhp.RamHttpRequest<C>[], resultTemp: Aventus.ResultRamWithError<Aventus.RamItem<AventusPhp.RamHttpRequest<C>>[]>): Promise<Aventus.ResultRamWithError<Aventus.RamItem<AventusPhp.RamHttpResourceDetails<C>>[]>>;
347
345
  /**
348
346
  * Trigger before updating a list of items
349
347
  */
350
- protected beforeUpdateList(list: RamHttpRequest<C>[], result: Aventus.ResultRamWithError<Aventus.RamItem<RamHttpRequest<C>>[]>): Promise<void>;
351
- protected queryUpdateItem(item: RamHttpRequest<C>, fromList: boolean, resultTemp: Aventus.ResultRamWithError<Aventus.RamItem<RamHttpResourceDetails<C>>>): Promise<Aventus.ResultRamWithError<Aventus.RamItem<RamHttpResourceDetails<C>>>>;
348
+ protected beforeUpdateList(list: AventusPhp.RamHttpRequest<C>[], result: Aventus.ResultRamWithError<Aventus.RamItem<AventusPhp.RamHttpRequest<C>>[]>): Promise<void>;
349
+ protected queryUpdateItem(item: AventusPhp.RamHttpRequest<C>, fromList: boolean, resultTemp: Aventus.ResultRamWithError<Aventus.RamItem<AventusPhp.RamHttpResourceDetails<C>>>): Promise<Aventus.ResultRamWithError<Aventus.RamItem<AventusPhp.RamHttpResourceDetails<C>>>>;
352
350
  /**
353
351
  * Trigger before updating an item
354
352
  */
355
- protected beforeUpdateItem(item: RamHttpRequest<C> | RamHttpResourceDetails<C>, fromList: boolean, result: Aventus.ResultRamWithError<Aventus.RamItem<RamHttpResourceDetails<C>>>): Promise<void>;
353
+ protected beforeUpdateItem(item: AventusPhp.RamHttpRequest<C> | AventusPhp.RamHttpResourceDetails<C>, fromList: boolean, result: Aventus.ResultRamWithError<Aventus.RamItem<AventusPhp.RamHttpResourceDetails<C>>>): Promise<void>;
356
354
  /**
357
355
  * Trigger after updating an item
358
356
  */
359
- protected afterUpdateItem(result: Aventus.ResultRamWithError<Aventus.RamItem<RamHttpResourceDetails<C>>>, fromList: boolean): Promise<void>;
357
+ protected afterUpdateItem(result: Aventus.ResultRamWithError<Aventus.RamItem<AventusPhp.RamHttpResourceDetails<C>>>, fromList: boolean): Promise<void>;
360
358
  /**
361
359
  * Trigger after updating a list of items
362
360
  */
363
- protected afterUpdateList(result: Aventus.ResultRamWithError<Aventus.RamItem<RamHttpResourceDetails<C>>[]>): Promise<void>;
361
+ protected afterUpdateList(result: Aventus.ResultRamWithError<Aventus.RamItem<AventusPhp.RamHttpResourceDetails<C>>[]>): Promise<void>;
364
362
  /**
365
363
  * Delete a list of items inside ram
366
364
  */
367
365
  @BindThis()
368
- deleteList(list: RamHttpResourceDetails<C>[]): Promise<Aventus.RamItem<RamHttpResourceDetails<C>>[]>;
366
+ deleteList(list: AventusPhp.RamHttpResourceDetails<C>[]): Promise<Aventus.RamItem<AventusPhp.RamHttpResourceDetails<C>>[]>;
369
367
  /**
370
368
  * Delete a list of items inside ram
371
369
  */
372
370
  @BindThis()
373
- deleteListWithError(list: RamHttpResourceDetails<C>[]): Promise<Aventus.ResultRamWithError<Aventus.RamItem<RamHttpResourceDetails<C>>[]>>;
371
+ deleteListWithError(list: AventusPhp.RamHttpResourceDetails<C>[]): Promise<Aventus.ResultRamWithError<Aventus.RamItem<AventusPhp.RamHttpResourceDetails<C>>[]>>;
374
372
  /**
375
373
  * Delete an item inside ram
376
374
  */
377
375
  @BindThis()
378
- delete(item: RamHttpResourceDetails<C>, ...args: any[]): Promise<Aventus.RamItem<RamHttpResourceDetails<C>> | undefined>;
376
+ delete(item: AventusPhp.RamHttpResourceDetails<C>, ...args: any[]): Promise<Aventus.RamItem<AventusPhp.RamHttpResourceDetails<C>> | undefined>;
379
377
  /**
380
378
  * Delete an item inside ram
381
379
  */
382
380
  @BindThis()
383
- deleteWithError(item: RamHttpResourceDetails<C>, ...args: any[]): Promise<Aventus.ResultRamWithError<Aventus.RamItem<RamHttpResourceDetails<C>>>>;
381
+ deleteWithError(item: AventusPhp.RamHttpResourceDetails<C>, ...args: any[]): Promise<Aventus.ResultRamWithError<Aventus.RamItem<AventusPhp.RamHttpResourceDetails<C>>>>;
384
382
  /**
385
383
  * Delete an item by id inside ram
386
384
  */
387
385
  @BindThis()
388
- deleteById(id: Index): Promise<Aventus.RamItem<RamHttpResourceDetails<C>> | undefined>;
386
+ deleteById(id: Index): Promise<Aventus.RamItem<AventusPhp.RamHttpResourceDetails<C>> | undefined>;
389
387
  /**
390
388
  * Delete an item by id inside ram
391
389
  */
392
390
  @BindThis()
393
- deleteByIdWithError(id: Index): Promise<Aventus.ResultRamWithError<Aventus.RamItem<RamHttpResourceDetails<C>>>>;
391
+ deleteByIdWithError(id: Index): Promise<Aventus.ResultRamWithError<Aventus.RamItem<AventusPhp.RamHttpResourceDetails<C>>>>;
394
392
  private _delete;
395
- protected queryDeleteList(list: RamHttpResourceDetails<C>[], result: Aventus.VoidWithError): Promise<void>;
393
+ protected queryDeleteList(list: AventusPhp.RamHttpResourceDetails<C>[], result: Aventus.VoidWithError): Promise<void>;
396
394
  /**
397
395
  * Trigger before deleting a list of items
398
396
  */
399
- protected beforeDeleteList(list: RamHttpResourceDetails<C>[], result: Aventus.VoidWithError): Promise<void>;
400
- protected queryDeleteItem(item: RamHttpResourceDetails<C>, fromList: boolean, result: Aventus.VoidWithError): Promise<void>;
397
+ protected beforeDeleteList(list: AventusPhp.RamHttpResourceDetails<C>[], result: Aventus.VoidWithError): Promise<void>;
398
+ protected queryDeleteItem(item: AventusPhp.RamHttpResourceDetails<C>, fromList: boolean, result: Aventus.VoidWithError): Promise<void>;
401
399
  /**
402
400
  * Trigger before deleting an item
403
401
  */
404
- protected beforeDeleteItem(item: RamHttpResourceDetails<C>, fromList: boolean, result: Aventus.VoidWithError): Promise<void>;
402
+ protected beforeDeleteItem(item: AventusPhp.RamHttpResourceDetails<C>, fromList: boolean, result: Aventus.VoidWithError): Promise<void>;
405
403
  /**
406
404
  * Trigger after deleting an item
407
405
  */
408
- protected afterDeleteItem(result: Aventus.ResultRamWithError<Aventus.RamItem<RamHttpResourceDetails<C>>>, fromList: boolean): Promise<void>;
406
+ protected afterDeleteItem(result: Aventus.ResultRamWithError<Aventus.RamItem<AventusPhp.RamHttpResourceDetails<C>>>, fromList: boolean): Promise<void>;
409
407
  /**
410
408
  * Trigger after deleting a list of items
411
409
  */
412
- protected afterDeleteList(result: Aventus.ResultRamWithError<Aventus.RamItem<RamHttpResourceDetails<C>>[]>): Promise<void>;
410
+ protected afterDeleteList(result: Aventus.ResultRamWithError<Aventus.RamItem<AventusPhp.RamHttpResourceDetails<C>>[]>): Promise<void>;
413
411
  }
414
412
 
415
- abstract class RamHttp<C extends ModelController<any, any, any, any>> extends GenericRamHttp<number, C> {
413
+ abstract class RamHttp<C extends AventusPhp.ModelController<any, any, any, any>> extends AventusPhp.GenericRamHttp<number, C> {
416
414
  }
417
415
 
418
416
  }
@@ -433,13 +431,13 @@ type NumberKeys<T> = {
433
431
  }[keyof T];
434
432
 
435
433
  type ItemField<T extends Aventus.IRamData, U extends Aventus.IRamData> = {
436
- id: NumberKeys<T>;
437
- obj: KeysOfType<T, U>;
434
+ id: AventusPhp.NumberKeys<T>;
435
+ obj: AventusPhp.KeysOfType<T, U>;
438
436
  ram: typeof Aventus.Ram<U>;
439
437
  };
440
438
  }//#endregion js def //
441
439
  //#region js src //
442
- {"namespace":"AventusPhp","available":[{"code":"let LaravelResult=class LaravelResult extends Aventus.ResultWithError {\n static get Fullname() { return \"Aventus.Laraventus.Helpers.LaravelResult\"; }\n}\nLaravelResult.Namespace=`AventusPhp`;\r\nLaravelResult.$schema={...(Aventus.ResultWithError?.$schema ?? {}), };\r\nAventus.Converter.register(LaravelResult.Fullname, LaravelResult);\r\n__as1(_, 'LaravelResult', LaravelResult);\r\n","dependencies":[{"fullName":"Aventus.ResultWithError","isStrong":true},{"fullName":"Convertible","isStrong":false},{"fullName":"Required","isStrong":false}],"fullName":"AventusPhp.LaravelResult","required":true,"type":1,"isExported":true,"convertibleName":"Fullname"},{"code":"var LaraventusErrorEnum;\n(function (LaraventusErrorEnum) {\n LaraventusErrorEnum[LaraventusErrorEnum[\"AuthenticationError\"] = 401] = \"AuthenticationError\";\n LaraventusErrorEnum[LaraventusErrorEnum[\"ValidationError\"] = 422] = \"ValidationError\";\n LaraventusErrorEnum[LaraventusErrorEnum[\"UnknowError\"] = 500] = \"UnknowError\";\n})(LaraventusErrorEnum || (LaraventusErrorEnum = {}));\n__as1(_, 'LaraventusErrorEnum', LaraventusErrorEnum);\r\n","dependencies":[],"fullName":"AventusPhp.LaraventusErrorEnum","required":false,"type":6,"isExported":true,"convertibleName":""},{"code":"let IdsManyRequest=class IdsManyRequest {\n ids = [];\n}\nIdsManyRequest.Namespace=`AventusPhp`;\r\n__as1(_, 'IdsManyRequest', IdsManyRequest);\r\n","dependencies":[],"fullName":"AventusPhp.IdsManyRequest","required":false,"type":1,"isExported":true,"convertibleName":""},{"code":"let ItemsManyRequest=class ItemsManyRequest {\n items;\n}\nItemsManyRequest.Namespace=`AventusPhp`;\r\n__as1(_, 'ItemsManyRequest', ItemsManyRequest);\r\n","dependencies":[{"fullName":"Aventus.IData","isStrong":false}],"fullName":"AventusPhp.ItemsManyRequest","required":false,"type":1,"isExported":true,"convertibleName":""},{"code":"let AventusFile=class AventusFile {\n static get Fullname() { return \"Aventus.Laraventus.Models.AventusFile\"; }\n uri;\n upload;\n /**\n * Get the unique type for the data. Define it as the namespace + class name\n */\n get $type() {\n return this.constructor['Fullname'];\n }\n /**\n * @inerhit\n */\n toJSON() {\n let toAvoid = ['className', 'namespace'];\n return Aventus.Json.classToJson(this, {\n isValidKey: (key) => !toAvoid.includes(key),\n beforeEnd: (result) => {\n let resultTemp = {};\n if (result.$type) {\n resultTemp.$type = result.$type;\n for (let key in result) {\n if (key != '$type') {\n resultTemp[key] = result[key];\n }\n }\n return resultTemp;\n }\n return result;\n }\n });\n }\n}\nAventusFile.Namespace=`AventusPhp`;\r\n__as1(_, 'AventusFile', AventusFile);\r\n","dependencies":[{"fullName":"File","isStrong":false},{"fullName":"Aventus.Json","isStrong":false}],"fullName":"AventusPhp.AventusFile","required":false,"type":1,"isExported":true,"convertibleName":""},{"code":"let AventusImage=class AventusImage extends AventusFile {\n static get Fullname() { return \"Aventus.Laraventus.Models.AventusImage\"; }\n}\nAventusImage.Namespace=`AventusPhp`;\r\n__as1(_, 'AventusImage', AventusImage);\r\n","dependencies":[{"fullName":"AventusPhp.AventusFile","isStrong":true}],"fullName":"AventusPhp.AventusImage","required":false,"type":1,"isExported":true,"convertibleName":""},{"code":"let AventusError=class AventusError extends Aventus.GenericError {\n static get Fullname() { return \"Aventus.Laraventus.Helpers.AventusError\"; }\n}\nAventusError.Namespace=`AventusPhp`;\r\nAventusError.$schema={...(Aventus.GenericError?.$schema ?? {}), };\r\nAventus.Converter.register(AventusError.Fullname, AventusError);\r\n__as1(_, 'AventusError', AventusError);\r\n","dependencies":[{"fullName":"Aventus.GenericError","isStrong":true},{"fullName":"Convertible","isStrong":false},{"fullName":"Required","isStrong":false},{"fullName":"Aventus.Enum","isStrong":false}],"fullName":"AventusPhp.AventusError","required":true,"type":1,"isExported":true,"convertibleName":"Fullname"},{"code":"let ModelController=class ModelController extends Aventus.HttpRoute {\n constructor(router) {\n super(router);\n this.index = this.index.bind(this);\n this.store = this.store.bind(this);\n this.storeMany = this.storeMany.bind(this);\n this.show = this.show.bind(this);\n this.showMany = this.showMany.bind(this);\n this.update = this.update.bind(this);\n this.updateMany = this.updateMany.bind(this);\n this.destroy = this.destroy.bind(this);\n this.destroyMany = this.destroyMany.bind(this);\n }\n getResourceDetails() {\n return undefined;\n }\n async index() {\n const request = new Aventus.HttpRequest(`${this.getPrefix()}/${this.getUri()}`, Aventus.HttpMethod.GET);\n return await request.queryJSON(this.router);\n }\n async store(body) {\n const request = new Aventus.HttpRequest(`${this.getPrefix()}/${this.getUri()}`, Aventus.HttpMethod.POST);\n request.setBody(body);\n return await request.queryJSON(this.router);\n }\n async storeMany(body) {\n const requestBody = new ItemsManyRequest();\n requestBody.items = body;\n const request = new Aventus.HttpRequest(`${this.getPrefix()}/${this.getUri()}/many`, Aventus.HttpMethod.POST);\n request.setBody(requestBody);\n return await request.queryJSON(this.router);\n }\n async show(id) {\n const request = new Aventus.HttpRequest(`${this.getPrefix()}/${this.getUri()}/${id}`, Aventus.HttpMethod.GET);\n return await request.queryJSON(this.router);\n }\n async showMany(ids) {\n const requestBody = new IdsManyRequest();\n requestBody.ids = ids;\n const request = new Aventus.HttpRequest(`${this.getPrefix()}/${this.getUri()}/show_many`, Aventus.HttpMethod.POST);\n request.setBody(requestBody);\n return await request.queryJSON(this.router);\n }\n async update(id, body) {\n const request = new Aventus.HttpRequest(`${this.getPrefix()}/${this.getUri()}/${id}`, Aventus.HttpMethod.PUT);\n request.enableMethodSpoofing();\n request.setBody(body);\n return await request.queryJSON(this.router);\n }\n async updateMany(body) {\n const requestBody = new ItemsManyRequest();\n requestBody.items = body;\n const request = new Aventus.HttpRequest(`${this.getPrefix()}/${this.getUri()}/many`, Aventus.HttpMethod.PUT);\n request.enableMethodSpoofing();\n request.setBody(requestBody);\n return await request.queryJSON(this.router);\n }\n async destroy(id) {\n const request = new Aventus.HttpRequest(`${this.getPrefix()}/${this.getUri()}/${id}`, Aventus.HttpMethod.DELETE);\n return await request.queryJSON(this.router);\n }\n async destroyMany(ids) {\n const requestBody = new IdsManyRequest();\n requestBody.ids = ids;\n const request = new Aventus.HttpRequest(`${this.getPrefix()}/${this.getUri()}/many`, Aventus.HttpMethod.DELETE);\n request.enableMethodSpoofing();\n request.setBody(requestBody);\n return await request.queryJSON(this.router);\n }\n toRequest(resource) {\n const Request = this.getRequest();\n const result = new Request();\n const resourceClone = Aventus.clone(resource);\n Aventus.Json.classFromJson(result, resourceClone, {\n replaceUndefined: true\n });\n return result;\n }\n}\nModelController.Namespace=`AventusPhp`;\r\n__as1(_, 'ModelController', ModelController);\r\n","dependencies":[{"fullName":"Aventus.HttpRoute","isStrong":true},{"fullName":"Aventus.IData","isStrong":false},{"fullName":"BindThis","isStrong":false},{"fullName":"Promise","isStrong":false},{"fullName":"Aventus.ResultWithError","isStrong":false},{"fullName":"Aventus.HttpRequest","isStrong":false},{"fullName":"Aventus.HttpMethod","isStrong":false},{"fullName":"AventusPhp.ItemsManyRequest","isStrong":false},{"fullName":"AventusPhp.IdsManyRequest","isStrong":false},{"fullName":"Aventus.clone","isStrong":false},{"fullName":"Aventus.Json","isStrong":false}],"fullName":"AventusPhp.ModelController","required":false,"type":1,"isExported":true,"convertibleName":""},{"code":"let RamCompletor=class RamCompletor {\n objects = [];\n fields = [];\n error;\n constructor(objects, error) {\n if (!objects) {\n objects = [];\n }\n else if (!Array.isArray(objects)) {\n objects = [objects];\n }\n this.objects = objects;\n this.error = error;\n }\n add(field) {\n this.fields.push(field);\n return this;\n }\n async run() {\n const objects = this.objects;\n const fields = this.fields;\n const result = new Aventus.VoidWithError();\n if (objects.length == 0)\n return result;\n const listIds = {};\n const mapRecords = {};\n for (let field of fields) {\n let objKey = field.obj;\n let idKey = field.id;\n listIds[objKey] = [];\n mapRecords[objKey] = {};\n for (let value of objects) {\n if (value[idKey]) {\n const listId = listIds[objKey];\n const mapRecord = mapRecords[objKey];\n if (value[objKey])\n continue;\n if (!listId.includes(value[idKey]))\n listId.push(value[idKey]);\n if (!mapRecord[value[idKey]]) {\n mapRecord[value[idKey]] = [];\n }\n mapRecord[value[idKey]].push(value);\n }\n }\n }\n for (let field of fields) {\n let objKey = field.obj;\n if (!listIds[objKey] || !mapRecords[objKey])\n continue;\n const listId = listIds[objKey];\n const mapRecord = mapRecords[objKey];\n if (listId.length > 0) {\n const ram = Aventus.Instance.get(field.ram);\n const query = await ram.getByIdsWithError(listId);\n if (query.success && query.result) {\n for (let item of query.result) {\n if (mapRecord[item.Id]) {\n for (let record of mapRecord[item.Id]) {\n record[objKey] = item;\n }\n }\n }\n }\n else {\n result.errors = [...result.errors, ...query.errors];\n if (this.error) {\n this.error.errors = [...this.error.errors, ...query.errors];\n }\n }\n }\n }\n return result;\n }\n}\nRamCompletor.Namespace=`AventusPhp`;\r\n__as1(_, 'RamCompletor', RamCompletor);\r\n","dependencies":[{"fullName":"Aventus.IRamData","isStrong":false},{"fullName":"AventusPhp.ItemField","isStrong":false},{"fullName":"Aventus.VoidWithError","isStrong":false},{"fullName":"Aventus.IData","isStrong":false},{"fullName":"U","isStrong":false},{"fullName":"Promise","isStrong":false},{"fullName":"Aventus.VoidWithError","isStrong":false},{"fullName":"Aventus.Instance","isStrong":false}],"fullName":"AventusPhp.RamCompletor","required":false,"type":1,"isExported":true,"convertibleName":""},{"code":"let GenericRamHttp=class GenericRamHttp {\n /**\n * The current namespace\n */\n static Namespace = \"\";\n // public static get Namespace(): string { return \"\"; }\n /**\n * Get the unique type for the data. Define it as the namespace + class name\n */\n static get Fullname() { return this.Namespace + \".\" + this.name; }\n subscribers = {\n created: [],\n updated: [],\n deleted: [],\n };\n recordsSubscribers = new Map();\n /**\n * List of stored item by index key\n */\n records = new Map();\n actionGuard = new Aventus.ActionGuard();\n routes;\n getAllDone = false;\n getByIdDone = [];\n hasDetails;\n constructor() {\n if (this.constructor == Aventus.GenericRam) {\n throw \"can't instanciate an abstract class\";\n }\n this.routes = this.defineRoutes();\n if (!this.routes.getResourceDetails()) {\n this.hasDetails = false;\n }\n else {\n this.hasDetails = this.routes.getResourceDetails() != this.routes.getResource();\n }\n this.getIdWithError = this.getIdWithError.bind(this);\n this.getId = this.getId.bind(this);\n this.save = this.save.bind(this);\n this.saveWithError = this.saveWithError.bind(this);\n this.onCreated = this.onCreated.bind(this);\n this.offCreated = this.offCreated.bind(this);\n this.onUpdated = this.onUpdated.bind(this);\n this.offUpdated = this.offUpdated.bind(this);\n this.onDeleted = this.onDeleted.bind(this);\n this.offDeleted = this.offDeleted.bind(this);\n this.get = this.get.bind(this);\n this.getWithError = this.getWithError.bind(this);\n this.getById = this.getById.bind(this);\n this.getByIdWithError = this.getByIdWithError.bind(this);\n this.getByIds = this.getByIds.bind(this);\n this.getByIdsWithError = this.getByIdsWithError.bind(this);\n this.getAll = this.getAll.bind(this);\n this.getAllWithError = this.getAllWithError.bind(this);\n this.getList = this.getList.bind(this);\n this.getListWithError = this.getListWithError.bind(this);\n this.createList = this.createList.bind(this);\n this.createListWithError = this.createListWithError.bind(this);\n this.create = this.create.bind(this);\n this.createWithError = this.createWithError.bind(this);\n this.updateList = this.updateList.bind(this);\n this.updateListWithError = this.updateListWithError.bind(this);\n this.update = this.update.bind(this);\n this.updateWithError = this.updateWithError.bind(this);\n this.deleteList = this.deleteList.bind(this);\n this.deleteListWithError = this.deleteListWithError.bind(this);\n this.delete = this.delete.bind(this);\n this.deleteWithError = this.deleteWithError.bind(this);\n this.deleteById = this.deleteById.bind(this);\n this.deleteByIdWithError = this.deleteByIdWithError.bind(this);\n }\n // public ramForTypes(): (new () => RamHttpResourceDetails<C>)[] {\n // return [this.getTypeForData({})];\n /**\n * Get item id\n */\n getIdWithError(item) {\n let action = new Aventus.ResultRamWithError();\n let idTemp = item[this.defineIndexKey()];\n if (idTemp !== undefined) {\n action.result = idTemp;\n }\n else {\n action.errors.push(new Aventus.RamError(Aventus.RamErrorCode.noId, \"no key found for item\"));\n }\n return action;\n }\n /**\n * Get item id\n */\n getId(item) {\n let result = this.getIdWithError(item);\n if (result.success) {\n return result.result;\n }\n throw 'no key found for item';\n }\n isResource(item) {\n const ResourceType = this.routes.getResource();\n const ResourceDetailsType = this.routes.getResourceDetails();\n if (item instanceof ResourceType) {\n return true;\n }\n if (ResourceDetailsType) {\n return item instanceof ResourceDetailsType;\n }\n return false;\n }\n toRequest(resource) {\n return this.routes.toRequest(resource);\n }\n /**\n * Prevent adding Watch element\n */\n removeWatch(element) {\n let byPass = element;\n if (byPass.__isProxy) {\n return byPass.getTarget();\n }\n return element;\n }\n /**\n * Add function update, onUpdate, offUpdate, delete, onDelete, offDelete\n */\n addRamAction(Base) {\n let that = this;\n return class ActionClass extends Base {\n static get className() {\n return Base.className || Base.name;\n }\n get className() {\n return Base.className || Base.name;\n }\n async update(newData) {\n let id = that.getId(this);\n let oldData = that.records.get(id);\n if (oldData) {\n let result = await that.update(newData);\n return result;\n }\n return undefined;\n }\n async updateWithError(newData) {\n const result = new Aventus.ResultRamWithError();\n let queryId = that.getIdWithError(this);\n if (!queryId.success || !queryId.result) {\n result.errors = queryId.errors;\n return result;\n }\n let oldData = that.records.get(queryId.result);\n if (oldData) {\n let result = await that.updateWithError(newData);\n return result;\n }\n result.errors.push(new Aventus.RamError(Aventus.RamErrorCode.noItemInsideRam, \"Can't find this item inside the ram\"));\n return result;\n }\n onUpdate(callback) {\n let id = that.getId(this);\n if (!that.recordsSubscribers.has(id)) {\n that.recordsSubscribers.set(id, {\n created: [],\n updated: [],\n deleted: []\n });\n }\n let sub = that.recordsSubscribers.get(id);\n if (sub && !sub.updated.includes(callback)) {\n sub.updated.push(callback);\n }\n }\n offUpdate(callback) {\n let id = that.getId(this);\n let sub = that.recordsSubscribers.get(id);\n if (sub) {\n let index = sub.updated.indexOf(callback);\n if (index != -1) {\n sub.updated.splice(index, 1);\n }\n }\n }\n async delete() {\n let id = that.getId(this);\n await that.deleteById(id);\n }\n async deleteWithError() {\n const result = new Aventus.VoidRamWithError();\n let queryId = that.getIdWithError(this);\n if (!queryId.success || !queryId.result) {\n result.errors = queryId.errors;\n return result;\n }\n const queryDelete = await that.deleteByIdWithError(queryId.result);\n result.errors = queryDelete.errors;\n return result;\n }\n onDelete(callback) {\n let id = that.getId(this);\n if (!that.recordsSubscribers.has(id)) {\n that.recordsSubscribers.set(id, {\n created: [],\n updated: [],\n deleted: []\n });\n }\n let sub = that.recordsSubscribers.get(id);\n if (sub && !sub.deleted.includes(callback)) {\n sub.deleted.push(callback);\n }\n }\n offDelete(callback) {\n let id = that.getId(this);\n let sub = that.recordsSubscribers.get(id);\n if (sub) {\n let index = sub.deleted.indexOf(callback);\n if (index != -1) {\n sub.deleted.splice(index, 1);\n }\n }\n }\n };\n }\n getTypeForData(objJson) {\n return this.routes.getResourceDetails() ?? this.routes.getResource();\n }\n /**\n * Transform the object into the object stored inside Ram\n */\n getObjectForRam(objJson) {\n let T = this.addRamAction(this.getTypeForData(objJson));\n let item = new T();\n this.mergeObject(item, objJson);\n return item;\n }\n /**\n * Add element inside Ram or update it. The instance inside the ram is unique and ll never be replaced\n */\n async addOrUpdateData(item, result, options) {\n let resultTemp = null;\n try {\n let idWithError = this.getIdWithError(item);\n if (idWithError.success && idWithError.result !== undefined) {\n let id = idWithError.result;\n if (this.records.has(id)) {\n let uniqueRecord = this.records.get(id);\n await this.beforeRecordSet(uniqueRecord);\n this.mergeObject(uniqueRecord, item, options);\n await this.afterRecordSet(uniqueRecord);\n resultTemp = 'updated';\n }\n else {\n let realObject = this.getObjectForRam(item);\n await this.beforeRecordSet(realObject);\n this.records.set(id, realObject);\n await this.afterRecordSet(realObject);\n resultTemp = 'created';\n }\n result.result = this.records.get(id);\n }\n else {\n result.errors = [...result.errors, ...idWithError.errors];\n resultTemp = null;\n }\n }\n catch (e) {\n result.errors.push(new Aventus.RamError(Aventus.RamErrorCode.unknow, e));\n resultTemp = null;\n }\n return resultTemp;\n }\n /**\n * Merge object and create real instance of class\n */\n mergeObject(item, objJson, options) {\n if (!item) {\n return;\n }\n if (!options) {\n options = {\n replaceUndefined: true\n };\n }\n Aventus.Json.classFromJson(item, objJson, options);\n }\n /**\n * Create or update the item\n */\n async save(item, ...args) {\n let action = await this.saveWithError(item, ...args);\n if (action.success) {\n return action.result;\n }\n return undefined;\n }\n /**\n * Create or update the item\n */\n async saveWithError(item, ...args) {\n let action = new Aventus.ResultRamWithError();\n let resultTemp = await this.getIdWithError(item);\n if (resultTemp.success && resultTemp.result !== undefined) {\n if (resultTemp.result) {\n return this.updateWithError(item, ...args);\n }\n else {\n return this.createWithError(item, ...args);\n }\n }\n else {\n action.errors = resultTemp.errors;\n }\n return action;\n }\n async beforeRecordSet(item) { }\n async afterRecordSet(item) { }\n async beforeRecordDelete(item) { }\n async afterRecordDelete(item) { }\n publish(type, data) {\n let callbacks = [...this.subscribers[type]];\n for (let callback of callbacks) {\n callback(data);\n }\n let sub = this.recordsSubscribers.get(this.getId(data));\n if (sub) {\n let localCallbacks = [...sub[type]];\n for (let localCallback of localCallbacks) {\n localCallback(data);\n }\n }\n }\n subscribe(type, cb) {\n if (!this.subscribers[type].includes(cb)) {\n this.subscribers[type].push(cb);\n }\n }\n unsubscribe(type, cb) {\n let index = this.subscribers[type].indexOf(cb);\n if (index != -1) {\n this.subscribers[type].splice(index, 1);\n }\n }\n /**\n * Add a callback that ll be triggered when a new item is stored\n */\n onCreated(cb) {\n this.subscribe('created', cb);\n }\n /**\n * Remove a created callback\n */\n offCreated(cb) {\n this.unsubscribe('created', cb);\n }\n /**\n * Add a callback that ll be triggered when an item is updated\n */\n onUpdated(cb) {\n this.subscribe('updated', cb);\n }\n /**\n * Remove an updated callback\n */\n offUpdated(cb) {\n this.unsubscribe('updated', cb);\n }\n /**\n * Add a callback that ll be triggered when an item is deleted\n */\n onDeleted(cb) {\n this.subscribe('deleted', cb);\n }\n /**\n * Remove an deleted callback\n */\n offDeleted(cb) {\n this.unsubscribe('deleted', cb);\n }\n /**\n * Get an item by id if exist (alias for getById)\n */\n async get(id) {\n return await this.getById(id);\n }\n ;\n /**\n * Get an item by id if exist (alias for getById)\n */\n async getWithError(id) {\n return await this.getByIdWithError(id);\n }\n ;\n /**\n * Get an item by id if exist\n */\n async getById(id) {\n let action = await this.getByIdWithError(id);\n if (action.success) {\n return action.result;\n }\n return undefined;\n }\n /**\n * Get an item by id if exist\n */\n async getByIdWithError(id) {\n return this.actionGuard.run(['getByIdWithError', id], async () => {\n let action = new Aventus.ResultRamWithError();\n await this.beforeGetById(id, action);\n await this.queryGetById(id, action);\n if (action.success) {\n if (this.records.has(id)) {\n action.result = this.records.get(id);\n await this.afterGetById(action);\n }\n else {\n action.errors.push(new Aventus.RamError(Aventus.RamErrorCode.noItemInsideRam, \"can't find the item \" + id + \" inside ram\"));\n }\n }\n return action;\n });\n }\n async queryGetById(id, result) {\n if (!this.hasDetails && this.records.has(id)) {\n return;\n }\n if (this.hasDetails && this.getByIdDone.includes(id)) {\n return;\n }\n else {\n let response = await this.routes.show(id);\n if (response.success && response.result) {\n let resultTemp = new Aventus.ResultRamWithError();\n await this.addOrUpdateData(response.result, resultTemp);\n if (!resultTemp.success) {\n result.errors = [...result.errors, ...resultTemp.errors];\n }\n else {\n result.result = resultTemp.result;\n if (this.hasDetails) {\n this.getByIdDone.push(id);\n }\n }\n }\n else {\n result.errors = [...result.errors, ...response.errors];\n }\n }\n }\n /**\n * Trigger before getting an item by id\n */\n async beforeGetById(id, result) { }\n ;\n /**\n * Trigger after getting an item by id\n */\n async afterGetById(result) { }\n ;\n /**\n * Get multiple items by ids\n */\n async getByIds(ids) {\n let result = await this.getByIdsWithError(ids);\n if (result.success) {\n return result.result ?? [];\n }\n return [];\n }\n /**\n * Get multiple items by ids\n */\n async getByIdsWithError(ids) {\n return this.actionGuard.run(['getByIdsWithError', ids], async () => {\n let action = new Aventus.ResultRamWithError();\n action.result = [];\n await this.queryGetByIds(ids, action);\n await this.beforeGetByIds(ids, action);\n if (action.success) {\n action.result = [];\n for (let id of ids) {\n let rec = this.records.get(id);\n if (rec) {\n action.result.push(rec);\n }\n else {\n action.errors.push(new Aventus.RamError(Aventus.RamErrorCode.noItemInsideRam, \"can't find the item \" + id + \" inside ram\"));\n }\n }\n if (action.success) {\n await this.afterGetByIds(action);\n }\n }\n return action;\n });\n }\n async queryGetByIds(ids, result) {\n let missingIds = [];\n if (this.hasDetails) {\n for (let id of ids) {\n if (!this.getByIdDone.includes(id)) {\n missingIds.push(id);\n }\n }\n }\n else {\n for (let id of ids) {\n if (!this.records.has(id)) {\n missingIds.push(id);\n }\n }\n }\n if (missingIds.length > 0) {\n result.result = [];\n let response = await this.routes.showMany(missingIds);\n if (response.success && response.result) {\n for (let item of response.result) {\n let resultTemp = new Aventus.ResultRamWithError();\n await this.addOrUpdateData(item, resultTemp);\n if (!resultTemp.success || !resultTemp.result) {\n result.errors = [...result.errors, ...resultTemp.errors];\n }\n else if (!result.result.includes(resultTemp.result)) {\n result.result.push(resultTemp.result);\n }\n }\n if (this.hasDetails) {\n for (let item of result.result) {\n this.getByIdDone.push(this.getId(item));\n }\n }\n }\n else {\n result.errors = [...result.errors, ...response.errors];\n }\n }\n }\n /**\n * Trigger before getting a list of items by id\n */\n async beforeGetByIds(ids, result) { }\n ;\n /**\n * Trigger after getting a list of items by id\n */\n async afterGetByIds(result) { }\n ;\n /**\n * Get all elements inside the Ram\n */\n async getAll() {\n let result = await this.getAllWithError();\n if (result.success) {\n return result.result ?? new Map();\n }\n return new Map();\n }\n /**\n * Get all elements inside the Ram\n */\n async getAllWithError() {\n return this.actionGuard.run(['getAllWithError'], async () => {\n let action = new Aventus.ResultRamWithError();\n action.result = new Map();\n await this.beforeGetAll(action);\n await this.queryGetAll(action);\n if (action.success) {\n action.result = this.records;\n await this.afterGetAll(action);\n }\n return action;\n });\n }\n async queryGetAll(result) {\n if (!this.getAllDone) {\n let response = await this.routes.index();\n if (response.success && response.result) {\n for (let item of response.result) {\n let resultTemp = new Aventus.ResultRamWithError();\n await this.addOrUpdateData(item, resultTemp, { replaceUndefined: false });\n if (!resultTemp.success) {\n result.errors = [...result.errors, ...resultTemp.errors];\n }\n }\n this.getAllDone = true;\n }\n else {\n result.errors = [...result.errors, ...response.errors];\n }\n }\n }\n /**\n * Trigger before getting all items inside Ram\n */\n async beforeGetAll(result) { }\n ;\n /**\n * Trigger after getting all items inside Ram\n */\n async afterGetAll(result) { }\n ;\n /**\n * Get all elements inside the Ram\n */\n async getList() {\n let data = await this.getAll();\n return Array.from(data.values());\n }\n ;\n /**\n * Get all elements inside the Ram\n */\n async getListWithError() {\n let action = new Aventus.ResultRamWithError();\n action.result = [];\n let result = await this.getAllWithError();\n if (result.success) {\n if (result.result) {\n action.result = Array.from(result.result.values());\n }\n else {\n action.result = [];\n }\n }\n else {\n action.errors = result.errors;\n }\n return action;\n }\n /**\n * Create a list of items inside ram\n */\n async createList(list) {\n let result = await this.createListWithError(list);\n return result.result ?? [];\n }\n /**\n * Create a list of items inside ram\n */\n async createListWithError(list) {\n list = this.removeWatch(list);\n let actionTemp = new Aventus.ResultRamWithError();\n actionTemp.result = [];\n await this.beforeCreateList(list, actionTemp);\n let action = await this.queryCreateList(list, actionTemp);\n if (!action.result) {\n action.result = [];\n }\n if (action.success && action.result.length > 0) {\n const resources = action.result;\n action.result = [];\n for (let resource of resources) {\n let resultItem = await this._create(resource, true);\n if (resultItem.success && resultItem.result) {\n action.result.push(resultItem.result);\n }\n else {\n action.errors = [...action.errors, ...resultItem.errors];\n }\n }\n if (action.success) {\n await this.afterCreateList(action);\n }\n }\n return action;\n }\n /**\n * Create an item inside ram\n */\n async create(item, ...args) {\n let action = await this.createWithError(item, args);\n if (action.success) {\n return action.result;\n }\n return undefined;\n }\n /**\n * Create an item inside ram\n */\n async createWithError(item, ...args) {\n return await this._create(item, false);\n }\n async _create(item, fromList) {\n item = this.removeWatch(item);\n return this.actionGuard.run(['_create', item], async () => {\n let actionTemp = new Aventus.ResultRamWithError();\n let action;\n await this.beforeCreateItem(item, fromList, actionTemp);\n if (this.isResource(item)) {\n action = new Aventus.ResultRamWithError();\n action.errors = actionTemp.errors;\n }\n else {\n action = await this.queryCreateItem(item, fromList, actionTemp);\n }\n if (action.success && action.result) {\n const resource = action.result;\n let resultTemp = this.getIdWithError(resource);\n if (resultTemp.success) {\n await this.addOrUpdateData(resource, action);\n if (!action.success) {\n return action;\n }\n await this.afterCreateItem(action, fromList);\n if (!action.success) {\n action.result = undefined;\n }\n else if (action.result) {\n this.publish('created', resource);\n }\n }\n else {\n action.errors = resultTemp.errors;\n }\n }\n return action;\n });\n }\n async queryCreateList(list, resultTemp) {\n const result = new Aventus.ResultRamWithError();\n let response = await this.routes.storeMany(list);\n if (response.success && response.result) {\n result.result = [];\n for (let element of response.result) {\n result.result.push(this.getObjectForRam(element));\n }\n if (this.hasDetails) {\n for (let element of result.result) {\n const id = this.getId(element);\n if (!this.getByIdDone.includes(id)) {\n this.getByIdDone.push(id);\n }\n }\n }\n }\n else {\n result.errors = [...result.errors, ...response.errors];\n }\n return result;\n }\n /**\n * Trigger before creating a list of items\n */\n async beforeCreateList(list, result) {\n }\n async queryCreateItem(item, fromList, resultTemp) {\n const result = new Aventus.ResultRamWithError();\n result.errors = resultTemp.errors;\n if (fromList) {\n return result;\n }\n let response = await this.routes.store(item);\n if (response.success && response.result) {\n result.result = this.getObjectForRam(response.result);\n if (this.hasDetails && result.result) {\n const id = this.getId(result.result);\n if (!this.getByIdDone.includes(id)) {\n this.getByIdDone.push(id);\n }\n }\n }\n else {\n result.errors = [...result.errors, ...response.errors];\n }\n return result;\n }\n /**\n * Trigger before creating an item\n */\n async beforeCreateItem(item, fromList, result) {\n }\n /**\n * Trigger after creating an item\n */\n async afterCreateItem(result, fromList) {\n }\n /**\n * Trigger after creating a list of items\n */\n async afterCreateList(result) {\n }\n /**\n * Update a list of items inside ram\n */\n async updateList(list) {\n let result = await this.updateListWithError(list);\n return result.result ?? [];\n }\n ;\n /**\n * Update a list of items inside ram\n */\n async updateListWithError(list) {\n list = this.removeWatch(list);\n let actionTemp = new Aventus.ResultRamWithError();\n actionTemp.result = [];\n await this.beforeUpdateList(list, actionTemp);\n let action = await this.queryUpdateList(list, actionTemp);\n if (!action.result) {\n action.result = [];\n }\n if (action.success && action.result.length > 0) {\n const resources = action.result;\n action.result = [];\n for (let resource of resources) {\n let resultItem = await this._update(resource, true);\n if (resultItem.success && resultItem.result) {\n action.result.push(resultItem.result);\n }\n else {\n action.errors = [...action.errors, ...resultItem.errors];\n }\n }\n if (action.success) {\n await this.afterUpdateList(action);\n }\n }\n return action;\n }\n ;\n /**\n * Update an item inside ram\n */\n async update(item, ...args) {\n let action = await this.updateWithError(item, args);\n if (action.success) {\n return action.result;\n }\n return undefined;\n }\n /**\n * Update an item inside ram\n */\n async updateWithError(item, ...args) {\n return await this._update(item, false);\n }\n async _update(item, fromList) {\n item = this.removeWatch(item);\n return this.actionGuard.run(['_update', item], async () => {\n let actionTemp = new Aventus.ResultRamWithError();\n let resultTemp = await this.getIdWithError(item);\n let actionError = new Aventus.ResultRamWithError();\n if (resultTemp.success && resultTemp.result !== undefined) {\n let key = resultTemp.result;\n if (this.records.has(key)) {\n if (this.records.get(key) == item) {\n console.warn(\"You are updating the same item. You should clone the object first to avoid weird effect\");\n }\n await this.beforeUpdateItem(item, fromList, actionTemp);\n let action;\n if (this.isResource(item)) {\n action = new Aventus.ResultRamWithError();\n action.errors = actionTemp.errors;\n }\n else {\n action = await this.queryUpdateItem(item, fromList, actionTemp);\n }\n if (!action.success) {\n return action;\n }\n if (action.result) {\n const resource = action.result;\n await this.addOrUpdateData(resource, action);\n if (!action.success) {\n return action;\n }\n await this.afterUpdateItem(action, fromList);\n if (!action.success) {\n action.result = undefined;\n }\n else if (action.result) {\n this.publish('updated', action.result);\n }\n }\n return action;\n }\n else {\n actionError.errors.push(new Aventus.RamError(Aventus.RamErrorCode.noItemInsideRam, \"can't update the item \" + key + \" because it wasn't found inside ram\"));\n }\n }\n else {\n actionError.errors = resultTemp.errors;\n }\n return actionError;\n });\n }\n async queryUpdateList(list, resultTemp) {\n const result = new Aventus.ResultRamWithError();\n result.errors = resultTemp.errors;\n let response = await this.routes.updateMany(list);\n if (response.success && response.result) {\n result.result = [];\n for (let element of response.result) {\n result.result.push(this.getObjectForRam(element));\n }\n if (this.hasDetails) {\n for (let element of result.result) {\n const id = this.getId(element);\n if (!this.getByIdDone.includes(id)) {\n this.getByIdDone.push(id);\n }\n }\n }\n }\n else {\n result.errors = [...result.errors, ...response.errors];\n }\n return result;\n }\n /**\n * Trigger before updating a list of items\n */\n async beforeUpdateList(list, result) {\n }\n async queryUpdateItem(item, fromList, resultTemp) {\n const result = new Aventus.ResultRamWithError();\n result.errors = resultTemp.errors;\n if (fromList) {\n return result;\n }\n let response = await this.routes.update(item.id, item);\n if (response.success && response.result) {\n result.result = this.getObjectForRam(response.result);\n if (this.hasDetails && result.result) {\n const id = this.getId(result.result);\n if (!this.getByIdDone.includes(id)) {\n this.getByIdDone.push(id);\n }\n }\n }\n else {\n result.errors = [...result.errors, ...response.errors];\n }\n return result;\n }\n /**\n * Trigger before updating an item\n */\n async beforeUpdateItem(item, fromList, result) {\n }\n /**\n * Trigger after updating an item\n */\n async afterUpdateItem(result, fromList) {\n }\n /**\n * Trigger after updating a list of items\n */\n async afterUpdateList(result) {\n }\n /**\n * Delete a list of items inside ram\n */\n async deleteList(list) {\n let result = await this.deleteListWithError(list);\n return result.result ?? [];\n }\n ;\n /**\n * Delete a list of items inside ram\n */\n async deleteListWithError(list) {\n list = this.removeWatch(list);\n let action = new Aventus.ResultRamWithError();\n action.result = [];\n let deleteResult = new Aventus.VoidWithError();\n await this.beforeDeleteList(list, deleteResult);\n await this.queryDeleteList(list, deleteResult);\n if (!deleteResult.success) {\n action.errors = deleteResult.errors;\n }\n for (let item of list) {\n let resultItem = await this._delete(item, true);\n if (resultItem.success && resultItem.result) {\n action.result.push(resultItem.result);\n }\n else {\n action.errors = [...action.errors, ...resultItem.errors];\n }\n }\n if (action.success) {\n await this.afterDeleteList(action);\n }\n return action;\n }\n ;\n /**\n * Delete an item inside ram\n */\n async delete(item, ...args) {\n let action = await this.deleteWithError(item, args);\n if (action.success) {\n return action.result;\n }\n return undefined;\n }\n ;\n /**\n * Delete an item inside ram\n */\n async deleteWithError(item, ...args) {\n return await this._delete(item, false);\n }\n ;\n /**\n * Delete an item by id inside ram\n */\n async deleteById(id) {\n let action = await this.deleteByIdWithError(id);\n if (action.success) {\n return action.result;\n }\n return undefined;\n }\n /**\n * Delete an item by id inside ram\n */\n async deleteByIdWithError(id) {\n let item = this.records.get(id);\n if (item) {\n return await this._delete(item, false);\n }\n let result = new Aventus.ResultRamWithError();\n result.errors.push(new Aventus.RamError(Aventus.RamErrorCode.noItemInsideRam, \"can't delete the item \" + id + \" because it wasn't found inside ram\"));\n return result;\n }\n async _delete(item, fromList) {\n item = this.removeWatch(item);\n return this.actionGuard.run(['_delete', item], async () => {\n let action = new Aventus.ResultRamWithError();\n let resultTemp = await this.getIdWithError(item);\n if (resultTemp.success && resultTemp.result) {\n let key = resultTemp.result;\n let oldItem = this.records.get(key);\n if (oldItem) {\n let deleteResult = new Aventus.VoidWithError();\n await this.beforeDeleteItem(oldItem, fromList, deleteResult);\n if (!deleteResult.success) {\n action.errors = deleteResult.errors;\n return action;\n }\n await this.queryDeleteItem(oldItem, fromList, deleteResult);\n this.beforeRecordDelete(oldItem);\n this.records.delete(key);\n this.afterRecordDelete(oldItem);\n action.result = oldItem;\n await this.afterDeleteItem(action, fromList);\n if (!action.success) {\n action.result = undefined;\n }\n else {\n this.publish('deleted', action.result);\n }\n this.recordsSubscribers.delete(key);\n }\n else {\n action.errors.push(new Aventus.RamError(Aventus.RamErrorCode.noItemInsideRam, \"can't delete the item \" + key + \" because it wasn't found inside ram\"));\n }\n }\n else {\n action.errors = resultTemp.errors;\n }\n return action;\n });\n }\n async queryDeleteList(list, result) {\n let response = await this.routes.destroyMany(list.map(t => t.id));\n if (!response.success) {\n result.errors = [...result.errors, ...response.errors];\n }\n else if (this.hasDetails) {\n for (let item of list) {\n const id = this.getId(item);\n const index = this.getByIdDone.indexOf(id);\n if (index != -1) {\n this.getByIdDone.splice(index, 1);\n }\n }\n }\n }\n /**\n * Trigger before deleting a list of items\n */\n async beforeDeleteList(list, result) { }\n async queryDeleteItem(item, fromList, result) {\n if (fromList) {\n return;\n }\n let response = await this.routes.destroy(item.id);\n if (!response.success) {\n result.errors = [...result.errors, ...response.errors];\n }\n else if (this.hasDetails) {\n const id = this.getId(item);\n const index = this.getByIdDone.indexOf(id);\n if (index != -1) {\n this.getByIdDone.splice(index, 1);\n }\n }\n }\n /**\n * Trigger before deleting an item\n */\n async beforeDeleteItem(item, fromList, result) { }\n /**\n * Trigger after deleting an item\n */\n async afterDeleteItem(result, fromList) { }\n /**\n * Trigger after deleting a list of items\n */\n async afterDeleteList(result) { }\n}\nGenericRamHttp.Namespace=`AventusPhp`;\r\n__as1(_, 'GenericRamHttp', GenericRamHttp);\r\n","dependencies":[{"fullName":"Aventus.IRam","isStrong":true},{"fullName":"AventusPhp.ModelController","isStrong":false},{"fullName":"AventusPhp.RamSubscribers","isStrong":false},{"fullName":"AventusPhp.RamHttpResourceDetails","isStrong":false},{"fullName":"Map","isStrong":false},{"fullName":"Aventus.RamItem","isStrong":false},{"fullName":"Aventus.ActionGuard","isStrong":false},{"fullName":"AventusPhp.RamHttpData","isStrong":false},{"fullName":"AventusPhp.RamHttpRequest","isStrong":false},{"fullName":"AventusPhp.RamHttpResource","isStrong":false},{"fullName":"Aventus.GenericRam","isStrong":false},{"fullName":"BindThis","isStrong":false},{"fullName":"Aventus.KeysObject","isStrong":false},{"fullName":"Aventus.ResultRamWithError","isStrong":false},{"fullName":"Aventus.RamError","isStrong":false},{"fullName":"Aventus.RamErrorCode","isStrong":false},{"fullName":"X","isStrong":false},{"fullName":"Aventus.IRamData","isStrong":false},{"fullName":"B","isStrong":false},{"fullName":"Base","isStrong":false},{"fullName":"Aventus.IRamAction","isStrong":false},{"fullName":"Promise","isStrong":false},{"fullName":"Aventus.VoidRamWithError","isStrong":false},{"fullName":"Aventus.ResultWithError","isStrong":false},{"fullName":"Aventus.JsonFromOptions","isStrong":false},{"fullName":"Aventus.Json","isStrong":false},{"fullName":"Aventus.ResultRamWithError","isStrong":false},{"fullName":"Aventus.RamItem","isStrong":false},{"fullName":"Aventus.VoidWithError","isStrong":false}],"fullName":"AventusPhp.GenericRamHttp","required":false,"type":1,"isExported":true,"convertibleName":""},{"code":"let RamHttp=class RamHttp extends GenericRamHttp {\n}\nRamHttp.Namespace=`AventusPhp`;\r\n__as1(_, 'RamHttp', RamHttp);\r\n","dependencies":[{"fullName":"AventusPhp.GenericRamHttp","isStrong":true},{"fullName":"AventusPhp.ModelController","isStrong":false}],"fullName":"AventusPhp.RamHttp","required":false,"type":1,"isExported":true,"convertibleName":""}],"existing":[{"fullName":"AventusPhp.RamSubscribers","dependencies":[]},{"fullName":"AventusPhp.KeysOfType","dependencies":[{"fullName":"T","isStrong":false},{"fullName":"NonNullable","isStrong":false},{"fullName":"U","isStrong":false},{"fullName":"K","isStrong":false}]},{"fullName":"AventusPhp.NumberKeys","dependencies":[{"fullName":"T","isStrong":false},{"fullName":"K","isStrong":false}]},{"fullName":"AventusPhp.RamHttpResource","dependencies":[{"fullName":"C","isStrong":false},{"fullName":"AventusPhp.ModelController","isStrong":false},{"fullName":"Res","isStrong":false}]},{"fullName":"AventusPhp.RamHttpRequest","dependencies":[{"fullName":"C","isStrong":false},{"fullName":"AventusPhp.ModelController","isStrong":false},{"fullName":"Req","isStrong":false}]},{"fullName":"AventusPhp.RamHttpData","dependencies":[{"fullName":"C","isStrong":false},{"fullName":"AventusPhp.ModelController","isStrong":false},{"fullName":"D","isStrong":false}]},{"fullName":"AventusPhp.RamHttpResourceDetails","dependencies":[{"fullName":"C","isStrong":false},{"fullName":"AventusPhp.ModelController","isStrong":false},{"fullName":"Res","isStrong":false}]},{"fullName":"AventusPhp.ItemField","dependencies":[{"fullName":"Aventus.IRamData","isStrong":false},{"fullName":"AventusPhp.NumberKeys","isStrong":false},{"fullName":"T","isStrong":false},{"fullName":"AventusPhp.KeysOfType","isStrong":false},{"fullName":"U","isStrong":false},{"fullName":"Ram","isStrong":false}]}]}
440
+ {"namespace":"AventusPhp","available":[{"code":"let LaravelResult=class LaravelResult extends Aventus.ResultWithError {\n static get Fullname() { return \"Aventus.Laraventus.Helpers.LaravelResult\"; }\n}\nLaravelResult.Namespace=`AventusPhp`;\nLaravelResult.$schema={...(Aventus.ResultWithError?.$schema ?? {}), };\nAventus.Converter.register(LaravelResult.Fullname, LaravelResult);\n__as1(_, 'LaravelResult', LaravelResult);\n","dependencies":[{"fullName":"Aventus.ResultWithError","isStrong":true}],"fullName":"AventusPhp.LaravelResult","required":false,"type":1,"isExported":true,"convertibleName":"Fullname"},{"code":"var LaraventusErrorEnum;\n(function (LaraventusErrorEnum) {\n LaraventusErrorEnum[LaraventusErrorEnum[\"AuthenticationError\"] = 401] = \"AuthenticationError\";\n LaraventusErrorEnum[LaraventusErrorEnum[\"ValidationError\"] = 422] = \"ValidationError\";\n LaraventusErrorEnum[LaraventusErrorEnum[\"UnknowError\"] = 500] = \"UnknowError\";\n})(LaraventusErrorEnum || (LaraventusErrorEnum = {}));\n__as1(_, 'LaraventusErrorEnum', LaraventusErrorEnum);\n","dependencies":[],"fullName":"AventusPhp.LaraventusErrorEnum","required":false,"type":6,"isExported":true,"convertibleName":""},{"code":"let IdsManyRequest=class IdsManyRequest {\n ids = [];\n}\nIdsManyRequest.Namespace=`AventusPhp`;\n__as1(_, 'IdsManyRequest', IdsManyRequest);\n","dependencies":[],"fullName":"AventusPhp.IdsManyRequest","required":false,"type":1,"isExported":true,"convertibleName":""},{"code":"let ItemsManyRequest=class ItemsManyRequest {\n items;\n}\nItemsManyRequest.Namespace=`AventusPhp`;\n__as1(_, 'ItemsManyRequest', ItemsManyRequest);\n","dependencies":[{"fullName":"Aventus.IData","isStrong":false}],"fullName":"AventusPhp.ItemsManyRequest","required":false,"type":1,"isExported":true,"convertibleName":""},{"code":"let AventusFile=class AventusFile {\n static get Fullname() { return \"Aventus.Laraventus.Models.AventusFile\"; }\n uri;\n upload;\n /**\n * Get the unique type for the data. Define it as the namespace + class name\n */\n get $type() {\n return this.constructor['Fullname'];\n }\n /**\n * @inerhit\n */\n toJSON() {\n let toAvoid = ['className', 'namespace'];\n return Aventus.Json.classToJson(this, {\n isValidKey: (key) => !toAvoid.includes(key),\n beforeEnd: (result) => {\n let resultTemp = {};\n if (result.$type) {\n resultTemp.$type = result.$type;\n for (let key in result) {\n if (key != '$type') {\n resultTemp[key] = result[key];\n }\n }\n return resultTemp;\n }\n return result;\n }\n });\n }\n}\nAventusFile.Namespace=`AventusPhp`;\n__as1(_, 'AventusFile', AventusFile);\n","dependencies":[{"fullName":"Aventus.Json","isStrong":false}],"fullName":"AventusPhp.AventusFile","required":false,"type":1,"isExported":true,"convertibleName":""},{"code":"let AventusImage=class AventusImage extends AventusFile {\n static get Fullname() { return \"Aventus.Laraventus.Models.AventusImage\"; }\n}\nAventusImage.Namespace=`AventusPhp`;\n__as1(_, 'AventusImage', AventusImage);\n","dependencies":[{"fullName":"AventusPhp.AventusFile","isStrong":true}],"fullName":"AventusPhp.AventusImage","required":false,"type":1,"isExported":true,"convertibleName":""},{"code":"let AventusError=class AventusError extends Aventus.GenericError {\n static get Fullname() { return \"Aventus.Laraventus.Helpers.AventusError\"; }\n}\nAventusError.Namespace=`AventusPhp`;\nAventusError.$schema={...(Aventus.GenericError?.$schema ?? {}), };\nAventus.Converter.register(AventusError.Fullname, AventusError);\n__as1(_, 'AventusError', AventusError);\n","dependencies":[{"fullName":"Aventus.GenericError","isStrong":true},{"fullName":"Aventus.Enum","isStrong":false}],"fullName":"AventusPhp.AventusError","required":false,"type":1,"isExported":true,"convertibleName":"Fullname"},{"code":"let ModelController=class ModelController extends Aventus.HttpRoute {\n constructor(router) {\n super(router);\n this.index = this.index.bind(this);\n this.store = this.store.bind(this);\n this.storeMany = this.storeMany.bind(this);\n this.show = this.show.bind(this);\n this.showMany = this.showMany.bind(this);\n this.update = this.update.bind(this);\n this.updateMany = this.updateMany.bind(this);\n this.destroy = this.destroy.bind(this);\n this.destroyMany = this.destroyMany.bind(this);\n }\n getResourceDetails() {\n return undefined;\n }\n async index() {\n const request = new Aventus.HttpRequest(`${this.getPrefix()}/${this.getUri()}`, Aventus.HttpMethod.GET);\n return await request.queryJSON(this.router);\n }\n async store(body) {\n const request = new Aventus.HttpRequest(`${this.getPrefix()}/${this.getUri()}`, Aventus.HttpMethod.POST);\n request.setBody(body);\n return await request.queryJSON(this.router);\n }\n async storeMany(body) {\n const requestBody = new ItemsManyRequest();\n requestBody.items = body;\n const request = new Aventus.HttpRequest(`${this.getPrefix()}/${this.getUri()}/many`, Aventus.HttpMethod.POST);\n request.setBody(requestBody);\n return await request.queryJSON(this.router);\n }\n async show(id) {\n const request = new Aventus.HttpRequest(`${this.getPrefix()}/${this.getUri()}/${id}`, Aventus.HttpMethod.GET);\n return await request.queryJSON(this.router);\n }\n async showMany(ids) {\n const requestBody = new IdsManyRequest();\n requestBody.ids = ids;\n const request = new Aventus.HttpRequest(`${this.getPrefix()}/${this.getUri()}/show_many`, Aventus.HttpMethod.POST);\n request.setBody(requestBody);\n return await request.queryJSON(this.router);\n }\n async update(id, body) {\n const request = new Aventus.HttpRequest(`${this.getPrefix()}/${this.getUri()}/${id}`, Aventus.HttpMethod.PUT);\n request.enableMethodSpoofing();\n request.setBody(body);\n return await request.queryJSON(this.router);\n }\n async updateMany(body) {\n const requestBody = new ItemsManyRequest();\n requestBody.items = body;\n const request = new Aventus.HttpRequest(`${this.getPrefix()}/${this.getUri()}/many`, Aventus.HttpMethod.PUT);\n request.enableMethodSpoofing();\n request.setBody(requestBody);\n return await request.queryJSON(this.router);\n }\n async destroy(id) {\n const request = new Aventus.HttpRequest(`${this.getPrefix()}/${this.getUri()}/${id}`, Aventus.HttpMethod.DELETE);\n return await request.queryJSON(this.router);\n }\n async destroyMany(ids) {\n const requestBody = new IdsManyRequest();\n requestBody.ids = ids;\n const request = new Aventus.HttpRequest(`${this.getPrefix()}/${this.getUri()}/many`, Aventus.HttpMethod.DELETE);\n request.enableMethodSpoofing();\n request.setBody(requestBody);\n return await request.queryJSON(this.router);\n }\n toRequest(resource) {\n const Request = this.getRequest();\n const result = new Request();\n const resourceClone = Aventus.clone(resource);\n Aventus.Json.classFromJson(result, resourceClone, {\n replaceUndefined: true\n });\n return result;\n }\n}\nModelController.Namespace=`AventusPhp`;\n__as1(_, 'ModelController', ModelController);\n","dependencies":[{"fullName":"Aventus.HttpRoute","isStrong":true},{"fullName":"Aventus.IData","isStrong":false},{"fullName":"Aventus.ResultWithError","isStrong":false},{"fullName":"Aventus.HttpRequest","isStrong":false},{"fullName":"Aventus.HttpMethod","isStrong":false},{"fullName":"AventusPhp.ItemsManyRequest","isStrong":false},{"fullName":"AventusPhp.IdsManyRequest","isStrong":false},{"fullName":"Aventus.clone","isStrong":false},{"fullName":"Aventus.Json","isStrong":false}],"fullName":"AventusPhp.ModelController","required":false,"type":1,"isExported":true,"convertibleName":""},{"code":"let RamCompletor=class RamCompletor {\n objects = [];\n fields = [];\n error;\n constructor(objects, error) {\n if (!objects) {\n objects = [];\n }\n else if (!Array.isArray(objects)) {\n objects = [objects];\n }\n this.objects = objects;\n this.error = error;\n }\n add(field) {\n this.fields.push(field);\n return this;\n }\n async run() {\n const objects = this.objects;\n const fields = this.fields;\n const result = new Aventus.VoidWithError();\n if (objects.length == 0)\n return result;\n const listIds = {};\n const mapRecords = {};\n for (let field of fields) {\n let objKey = field.obj;\n let idKey = field.id;\n listIds[objKey] = [];\n mapRecords[objKey] = {};\n for (let value of objects) {\n const v = value;\n if (v[idKey]) {\n const listId = listIds[objKey];\n const mapRecord = mapRecords[objKey];\n if (v[objKey])\n continue;\n if (!listId.includes(v[idKey]))\n listId.push(v[idKey]);\n if (!mapRecord[v[idKey]]) {\n mapRecord[v] = [];\n }\n mapRecord[v[idKey]].push(value);\n }\n }\n }\n for (let field of fields) {\n let objKey = field.obj;\n if (!listIds[objKey] || !mapRecords[objKey])\n continue;\n const listId = listIds[objKey];\n const mapRecord = mapRecords[objKey];\n if (listId.length > 0) {\n const ram = Aventus.Instance.get(field.ram);\n const query = await ram.getByIdsWithError(listId);\n if (query.success && query.result) {\n for (let item of query.result) {\n if (mapRecord[item.Id]) {\n for (let record of mapRecord[item.Id]) {\n const r = record;\n r[objKey] = item;\n }\n }\n }\n }\n else {\n result.errors = [...result.errors, ...query.errors];\n if (this.error) {\n this.error.errors = [...this.error.errors, ...query.errors];\n }\n }\n }\n }\n return result;\n }\n}\nRamCompletor.Namespace=`AventusPhp`;\n__as1(_, 'RamCompletor', RamCompletor);\n","dependencies":[{"fullName":"Aventus.IRamData","isStrong":false},{"fullName":"AventusPhp.ItemField","isStrong":false},{"fullName":"Aventus.VoidWithError","isStrong":false},{"fullName":"Aventus.IData","isStrong":false},{"fullName":"U","isStrong":false},{"fullName":"Aventus.VoidWithError","isStrong":false},{"fullName":"Aventus.Instance","isStrong":false}],"fullName":"AventusPhp.RamCompletor","required":false,"type":1,"isExported":true,"convertibleName":""},{"code":"let GenericRamHttp=class GenericRamHttp {\n /**\n * The current namespace\n */\n static Namespace = \"\";\n // public static get Namespace(): string { return \"\"; }\n /**\n * Get the unique type for the data. Define it as the namespace + class name\n */\n static get Fullname() { return this.Namespace + \".\" + this.name; }\n subscribers = {\n created: [],\n updated: [],\n deleted: [],\n };\n recordsSubscribers = new Map();\n /**\n * List of stored item by index key\n */\n records = new Map();\n actionGuard = new Aventus.ActionGuard();\n routes;\n getAllDone = false;\n getByIdDone = [];\n hasDetails;\n constructor() {\n if (this.constructor == Aventus.GenericRam) {\n throw \"can't instanciate an abstract class\";\n }\n this.routes = this.defineRoutes();\n if (!this.routes.getResourceDetails()) {\n this.hasDetails = false;\n }\n else {\n this.hasDetails = this.routes.getResourceDetails() != this.routes.getResource();\n }\n this.getIdWithError = this.getIdWithError.bind(this);\n this.getId = this.getId.bind(this);\n this.save = this.save.bind(this);\n this.saveWithError = this.saveWithError.bind(this);\n this.onCreated = this.onCreated.bind(this);\n this.offCreated = this.offCreated.bind(this);\n this.onUpdated = this.onUpdated.bind(this);\n this.offUpdated = this.offUpdated.bind(this);\n this.onDeleted = this.onDeleted.bind(this);\n this.offDeleted = this.offDeleted.bind(this);\n this.get = this.get.bind(this);\n this.getWithError = this.getWithError.bind(this);\n this.getById = this.getById.bind(this);\n this.getByIdWithError = this.getByIdWithError.bind(this);\n this.getByIds = this.getByIds.bind(this);\n this.getByIdsWithError = this.getByIdsWithError.bind(this);\n this.getAll = this.getAll.bind(this);\n this.getAllWithError = this.getAllWithError.bind(this);\n this.getList = this.getList.bind(this);\n this.getListWithError = this.getListWithError.bind(this);\n this.createList = this.createList.bind(this);\n this.createListWithError = this.createListWithError.bind(this);\n this.create = this.create.bind(this);\n this.createWithError = this.createWithError.bind(this);\n this.updateList = this.updateList.bind(this);\n this.updateListWithError = this.updateListWithError.bind(this);\n this.update = this.update.bind(this);\n this.updateWithError = this.updateWithError.bind(this);\n this.deleteList = this.deleteList.bind(this);\n this.deleteListWithError = this.deleteListWithError.bind(this);\n this.delete = this.delete.bind(this);\n this.deleteWithError = this.deleteWithError.bind(this);\n this.deleteById = this.deleteById.bind(this);\n this.deleteByIdWithError = this.deleteByIdWithError.bind(this);\n }\n // public ramForTypes(): (new () => RamHttpResourceDetails<C>)[] {\n // return [this.getTypeForData({})];\n /**\n * Get item id\n */\n getIdWithError(item) {\n let action = new Aventus.ResultRamWithError();\n let idTemp = item[this.defineIndexKey()];\n if (idTemp !== undefined) {\n action.result = idTemp;\n }\n else {\n action.errors.push(new Aventus.RamError(Aventus.RamErrorCode.noId, \"no key found for item\"));\n }\n return action;\n }\n /**\n * Get item id\n */\n getId(item) {\n let result = this.getIdWithError(item);\n if (result.success) {\n return result.result;\n }\n throw 'no key found for item';\n }\n isResource(item) {\n const ResourceType = this.routes.getResource();\n const ResourceDetailsType = this.routes.getResourceDetails();\n if (item instanceof ResourceType) {\n return true;\n }\n if (ResourceDetailsType) {\n return item instanceof ResourceDetailsType;\n }\n return false;\n }\n toRequest(resource) {\n return this.routes.toRequest(resource);\n }\n /**\n * Prevent adding Watch element\n */\n removeWatch(element) {\n let byPass = element;\n if (byPass.__isProxy) {\n return byPass.getTarget();\n }\n return element;\n }\n /**\n * Add function update, onUpdate, offUpdate, delete, onDelete, offDelete\n */\n addRamAction(Base) {\n let that = this;\n return class ActionClass extends Base {\n static get className() {\n return Base.className || Base.name;\n }\n get className() {\n return Base.className || Base.name;\n }\n async update(newData) {\n let id = that.getId(this);\n let oldData = that.records.get(id);\n if (oldData) {\n let result = await that.update(newData);\n return result;\n }\n return undefined;\n }\n async updateWithError(newData) {\n const result = new Aventus.ResultRamWithError();\n let queryId = that.getIdWithError(this);\n if (!queryId.success || !queryId.result) {\n result.errors = queryId.errors;\n return result;\n }\n let oldData = that.records.get(queryId.result);\n if (oldData) {\n let result = await that.updateWithError(newData);\n return result;\n }\n result.errors.push(new Aventus.RamError(Aventus.RamErrorCode.noItemInsideRam, \"Can't find this item inside the ram\"));\n return result;\n }\n onUpdate(callback) {\n let id = that.getId(this);\n if (!that.recordsSubscribers.has(id)) {\n that.recordsSubscribers.set(id, {\n created: [],\n updated: [],\n deleted: []\n });\n }\n let sub = that.recordsSubscribers.get(id);\n if (sub && !sub.updated.includes(callback)) {\n sub.updated.push(callback);\n }\n }\n offUpdate(callback) {\n let id = that.getId(this);\n let sub = that.recordsSubscribers.get(id);\n if (sub) {\n let index = sub.updated.indexOf(callback);\n if (index != -1) {\n sub.updated.splice(index, 1);\n }\n }\n }\n async delete() {\n let id = that.getId(this);\n await that.deleteById(id);\n }\n async deleteWithError() {\n const result = new Aventus.VoidRamWithError();\n let queryId = that.getIdWithError(this);\n if (!queryId.success || !queryId.result) {\n result.errors = queryId.errors;\n return result;\n }\n const queryDelete = await that.deleteByIdWithError(queryId.result);\n result.errors = queryDelete.errors;\n return result;\n }\n onDelete(callback) {\n let id = that.getId(this);\n if (!that.recordsSubscribers.has(id)) {\n that.recordsSubscribers.set(id, {\n created: [],\n updated: [],\n deleted: []\n });\n }\n let sub = that.recordsSubscribers.get(id);\n if (sub && !sub.deleted.includes(callback)) {\n sub.deleted.push(callback);\n }\n }\n offDelete(callback) {\n let id = that.getId(this);\n let sub = that.recordsSubscribers.get(id);\n if (sub) {\n let index = sub.deleted.indexOf(callback);\n if (index != -1) {\n sub.deleted.splice(index, 1);\n }\n }\n }\n };\n }\n getTypeForData(objJson) {\n return this.routes.getResourceDetails() ?? this.routes.getResource();\n }\n /**\n * Transform the object into the object stored inside Ram\n */\n getObjectForRam(objJson) {\n let T = this.addRamAction(this.getTypeForData(objJson));\n let item = new T();\n this.mergeObject(item, objJson);\n return item;\n }\n /**\n * Add element inside Ram or update it. The instance inside the ram is unique and ll never be replaced\n */\n async addOrUpdateData(item, result, options) {\n let resultTemp = null;\n try {\n let idWithError = this.getIdWithError(item);\n if (idWithError.success && idWithError.result !== undefined) {\n let id = idWithError.result;\n if (this.records.has(id)) {\n let uniqueRecord = this.records.get(id);\n await this.beforeRecordSet(uniqueRecord);\n this.mergeObject(uniqueRecord, item, options);\n await this.afterRecordSet(uniqueRecord);\n resultTemp = 'updated';\n }\n else {\n let realObject = this.getObjectForRam(item);\n await this.beforeRecordSet(realObject);\n this.records.set(id, realObject);\n await this.afterRecordSet(realObject);\n resultTemp = 'created';\n }\n result.result = this.records.get(id);\n }\n else {\n result.errors = [...result.errors, ...idWithError.errors];\n resultTemp = null;\n }\n }\n catch (e) {\n result.errors.push(new Aventus.RamError(Aventus.RamErrorCode.unknow, e));\n resultTemp = null;\n }\n return resultTemp;\n }\n /**\n * Merge object and create real instance of class\n */\n mergeObject(item, objJson, options) {\n if (!item) {\n return;\n }\n if (!options) {\n options = {\n replaceUndefined: true\n };\n }\n Aventus.Json.classFromJson(item, objJson, options);\n }\n /**\n * Create or update the item\n */\n async save(item, ...args) {\n let action = await this.saveWithError(item, ...args);\n if (action.success) {\n return action.result;\n }\n return undefined;\n }\n /**\n * Create or update the item\n */\n async saveWithError(item, ...args) {\n let action = new Aventus.ResultRamWithError();\n let resultTemp = await this.getIdWithError(item);\n if (resultTemp.success && resultTemp.result !== undefined) {\n if (resultTemp.result) {\n return this.updateWithError(item, ...args);\n }\n else {\n return this.createWithError(item, ...args);\n }\n }\n else {\n action.errors = resultTemp.errors;\n }\n return action;\n }\n async beforeRecordSet(item) { }\n async afterRecordSet(item) { }\n async beforeRecordDelete(item) { }\n async afterRecordDelete(item) { }\n publish(type, data) {\n let callbacks = [...this.subscribers[type]];\n for (let callback of callbacks) {\n callback(data);\n }\n let sub = this.recordsSubscribers.get(this.getId(data));\n if (sub) {\n let localCallbacks = [...sub[type]];\n for (let localCallback of localCallbacks) {\n localCallback(data);\n }\n }\n }\n subscribe(type, cb) {\n if (!this.subscribers[type].includes(cb)) {\n this.subscribers[type].push(cb);\n }\n }\n unsubscribe(type, cb) {\n let index = this.subscribers[type].indexOf(cb);\n if (index != -1) {\n this.subscribers[type].splice(index, 1);\n }\n }\n /**\n * Add a callback that ll be triggered when a new item is stored\n */\n onCreated(cb) {\n this.subscribe('created', cb);\n }\n /**\n * Remove a created callback\n */\n offCreated(cb) {\n this.unsubscribe('created', cb);\n }\n /**\n * Add a callback that ll be triggered when an item is updated\n */\n onUpdated(cb) {\n this.subscribe('updated', cb);\n }\n /**\n * Remove an updated callback\n */\n offUpdated(cb) {\n this.unsubscribe('updated', cb);\n }\n /**\n * Add a callback that ll be triggered when an item is deleted\n */\n onDeleted(cb) {\n this.subscribe('deleted', cb);\n }\n /**\n * Remove an deleted callback\n */\n offDeleted(cb) {\n this.unsubscribe('deleted', cb);\n }\n /**\n * Get an item by id if exist (alias for getById)\n */\n async get(id) {\n return await this.getById(id);\n }\n ;\n /**\n * Get an item by id if exist (alias for getById)\n */\n async getWithError(id) {\n return await this.getByIdWithError(id);\n }\n ;\n /**\n * Get an item by id if exist\n */\n async getById(id) {\n let action = await this.getByIdWithError(id);\n if (action.success) {\n return action.result;\n }\n return undefined;\n }\n /**\n * Get an item by id if exist\n */\n async getByIdWithError(id) {\n return this.actionGuard.run(['getByIdWithError', id], async () => {\n let action = new Aventus.ResultRamWithError();\n await this.beforeGetById(id, action);\n await this.queryGetById(id, action);\n if (action.success) {\n if (this.records.has(id)) {\n action.result = this.records.get(id);\n await this.afterGetById(action);\n }\n else {\n action.errors.push(new Aventus.RamError(Aventus.RamErrorCode.noItemInsideRam, \"can't find the item \" + id + \" inside ram\"));\n }\n }\n return action;\n });\n }\n async queryGetById(id, result) {\n if (!this.hasDetails && this.records.has(id)) {\n return;\n }\n if (this.hasDetails && this.getByIdDone.includes(id)) {\n return;\n }\n else {\n let response = await this.routes.show(id);\n if (response.success && response.result) {\n let resultTemp = new Aventus.ResultRamWithError();\n await this.addOrUpdateData(response.result, resultTemp);\n if (!resultTemp.success) {\n result.errors = [...result.errors, ...resultTemp.errors];\n }\n else {\n result.result = resultTemp.result;\n if (this.hasDetails) {\n this.getByIdDone.push(id);\n }\n }\n }\n else {\n result.errors = [...result.errors, ...response.errors];\n }\n }\n }\n /**\n * Trigger before getting an item by id\n */\n async beforeGetById(id, result) { }\n ;\n /**\n * Trigger after getting an item by id\n */\n async afterGetById(result) { }\n ;\n /**\n * Get multiple items by ids\n */\n async getByIds(ids) {\n let result = await this.getByIdsWithError(ids);\n if (result.success) {\n return result.result ?? [];\n }\n return [];\n }\n /**\n * Get multiple items by ids\n */\n async getByIdsWithError(ids) {\n return this.actionGuard.run(['getByIdsWithError', ids], async () => {\n let action = new Aventus.ResultRamWithError();\n action.result = [];\n await this.queryGetByIds(ids, action);\n await this.beforeGetByIds(ids, action);\n if (action.success) {\n action.result = [];\n for (let id of ids) {\n let rec = this.records.get(id);\n if (rec) {\n action.result.push(rec);\n }\n else {\n action.errors.push(new Aventus.RamError(Aventus.RamErrorCode.noItemInsideRam, \"can't find the item \" + id + \" inside ram\"));\n }\n }\n if (action.success) {\n await this.afterGetByIds(action);\n }\n }\n return action;\n });\n }\n async queryGetByIds(ids, result) {\n let missingIds = [];\n if (this.hasDetails) {\n for (let id of ids) {\n if (!this.getByIdDone.includes(id)) {\n missingIds.push(id);\n }\n }\n }\n else {\n for (let id of ids) {\n if (!this.records.has(id)) {\n missingIds.push(id);\n }\n }\n }\n if (missingIds.length > 0) {\n result.result = [];\n let response = await this.routes.showMany(missingIds);\n if (response.success && response.result) {\n for (let item of response.result) {\n let resultTemp = new Aventus.ResultRamWithError();\n await this.addOrUpdateData(item, resultTemp);\n if (!resultTemp.success || !resultTemp.result) {\n result.errors = [...result.errors, ...resultTemp.errors];\n }\n else if (!result.result.includes(resultTemp.result)) {\n result.result.push(resultTemp.result);\n }\n }\n if (this.hasDetails) {\n for (let item of result.result) {\n this.getByIdDone.push(this.getId(item));\n }\n }\n }\n else {\n result.errors = [...result.errors, ...response.errors];\n }\n }\n }\n /**\n * Trigger before getting a list of items by id\n */\n async beforeGetByIds(ids, result) { }\n ;\n /**\n * Trigger after getting a list of items by id\n */\n async afterGetByIds(result) { }\n ;\n /**\n * Get all elements inside the Ram\n */\n async getAll() {\n let result = await this.getAllWithError();\n if (result.success) {\n return result.result ?? new Map();\n }\n return new Map();\n }\n /**\n * Get all elements inside the Ram\n */\n async getAllWithError() {\n return this.actionGuard.run(['getAllWithError'], async () => {\n let action = new Aventus.ResultRamWithError();\n action.result = new Map();\n await this.beforeGetAll(action);\n await this.queryGetAll(action);\n if (action.success) {\n action.result = this.records;\n await this.afterGetAll(action);\n }\n return action;\n });\n }\n async queryGetAll(result) {\n if (!this.getAllDone) {\n let response = await this.routes.index();\n if (response.success && response.result) {\n for (let item of response.result) {\n let resultTemp = new Aventus.ResultRamWithError();\n await this.addOrUpdateData(item, resultTemp, { replaceUndefined: false });\n if (!resultTemp.success) {\n result.errors = [...result.errors, ...resultTemp.errors];\n }\n }\n this.getAllDone = true;\n }\n else {\n result.errors = [...result.errors, ...response.errors];\n }\n }\n }\n /**\n * Trigger before getting all items inside Ram\n */\n async beforeGetAll(result) { }\n ;\n /**\n * Trigger after getting all items inside Ram\n */\n async afterGetAll(result) { }\n ;\n /**\n * Get all elements inside the Ram\n */\n async getList() {\n let data = await this.getAll();\n return Array.from(data.values());\n }\n ;\n /**\n * Get all elements inside the Ram\n */\n async getListWithError() {\n let action = new Aventus.ResultRamWithError();\n action.result = [];\n let result = await this.getAllWithError();\n if (result.success) {\n if (result.result) {\n action.result = Array.from(result.result.values());\n }\n else {\n action.result = [];\n }\n }\n else {\n action.errors = result.errors;\n }\n return action;\n }\n /**\n * Create a list of items inside ram\n */\n async createList(list) {\n let result = await this.createListWithError(list);\n return result.result ?? [];\n }\n /**\n * Create a list of items inside ram\n */\n async createListWithError(list) {\n list = this.removeWatch(list);\n let actionTemp = new Aventus.ResultRamWithError();\n actionTemp.result = [];\n await this.beforeCreateList(list, actionTemp);\n let action = await this.queryCreateList(list, actionTemp);\n if (!action.result) {\n action.result = [];\n }\n if (action.success && action.result.length > 0) {\n const resources = action.result;\n action.result = [];\n for (let resource of resources) {\n let resultItem = await this._create(resource, true);\n if (resultItem.success && resultItem.result) {\n action.result.push(resultItem.result);\n }\n else {\n action.errors = [...action.errors, ...resultItem.errors];\n }\n }\n if (action.success) {\n await this.afterCreateList(action);\n }\n }\n return action;\n }\n /**\n * Create an item inside ram\n */\n async create(item, ...args) {\n let action = await this.createWithError(item, args);\n if (action.success) {\n return action.result;\n }\n return undefined;\n }\n /**\n * Create an item inside ram\n */\n async createWithError(item, ...args) {\n return await this._create(item, false);\n }\n async _create(item, fromList) {\n item = this.removeWatch(item);\n return this.actionGuard.run(['_create', item], async () => {\n let actionTemp = new Aventus.ResultRamWithError();\n let action;\n await this.beforeCreateItem(item, fromList, actionTemp);\n if (this.isResource(item)) {\n action = new Aventus.ResultRamWithError();\n action.errors = actionTemp.errors;\n }\n else {\n action = await this.queryCreateItem(item, fromList, actionTemp);\n }\n if (action.success && action.result) {\n const resource = action.result;\n let resultTemp = this.getIdWithError(resource);\n if (resultTemp.success) {\n await this.addOrUpdateData(resource, action);\n if (!action.success) {\n return action;\n }\n await this.afterCreateItem(action, fromList);\n if (!action.success) {\n action.result = undefined;\n }\n else if (action.result) {\n this.publish('created', resource);\n }\n }\n else {\n action.errors = resultTemp.errors;\n }\n }\n return action;\n });\n }\n async queryCreateList(list, resultTemp) {\n const result = new Aventus.ResultRamWithError();\n let response = await this.routes.storeMany(list);\n if (response.success && response.result) {\n result.result = [];\n for (let element of response.result) {\n result.result.push(this.getObjectForRam(element));\n }\n if (this.hasDetails) {\n for (let element of result.result) {\n const id = this.getId(element);\n if (!this.getByIdDone.includes(id)) {\n this.getByIdDone.push(id);\n }\n }\n }\n }\n else {\n result.errors = [...result.errors, ...response.errors];\n }\n return result;\n }\n /**\n * Trigger before creating a list of items\n */\n async beforeCreateList(list, result) {\n }\n async queryCreateItem(item, fromList, resultTemp) {\n const result = new Aventus.ResultRamWithError();\n result.errors = resultTemp.errors;\n if (fromList) {\n return result;\n }\n let response = await this.routes.store(item);\n if (response.success && response.result) {\n result.result = this.getObjectForRam(response.result);\n if (this.hasDetails && result.result) {\n const id = this.getId(result.result);\n if (!this.getByIdDone.includes(id)) {\n this.getByIdDone.push(id);\n }\n }\n }\n else {\n result.errors = [...result.errors, ...response.errors];\n }\n return result;\n }\n /**\n * Trigger before creating an item\n */\n async beforeCreateItem(item, fromList, result) {\n }\n /**\n * Trigger after creating an item\n */\n async afterCreateItem(result, fromList) {\n }\n /**\n * Trigger after creating a list of items\n */\n async afterCreateList(result) {\n }\n /**\n * Update a list of items inside ram\n */\n async updateList(list) {\n let result = await this.updateListWithError(list);\n return result.result ?? [];\n }\n ;\n /**\n * Update a list of items inside ram\n */\n async updateListWithError(list) {\n list = this.removeWatch(list);\n let actionTemp = new Aventus.ResultRamWithError();\n actionTemp.result = [];\n await this.beforeUpdateList(list, actionTemp);\n let action = await this.queryUpdateList(list, actionTemp);\n if (!action.result) {\n action.result = [];\n }\n if (action.success && action.result.length > 0) {\n const resources = action.result;\n action.result = [];\n for (let resource of resources) {\n let resultItem = await this._update(resource, true);\n if (resultItem.success && resultItem.result) {\n action.result.push(resultItem.result);\n }\n else {\n action.errors = [...action.errors, ...resultItem.errors];\n }\n }\n if (action.success) {\n await this.afterUpdateList(action);\n }\n }\n return action;\n }\n ;\n /**\n * Update an item inside ram\n */\n async update(item, ...args) {\n let action = await this.updateWithError(item, args);\n if (action.success) {\n return action.result;\n }\n return undefined;\n }\n /**\n * Update an item inside ram\n */\n async updateWithError(item, ...args) {\n return await this._update(item, false);\n }\n async _update(item, fromList) {\n item = this.removeWatch(item);\n return this.actionGuard.run(['_update', item], async () => {\n let actionTemp = new Aventus.ResultRamWithError();\n let resultTemp = await this.getIdWithError(item);\n let actionError = new Aventus.ResultRamWithError();\n if (resultTemp.success && resultTemp.result !== undefined) {\n let key = resultTemp.result;\n if (this.records.has(key)) {\n if (this.records.get(key) == item) {\n console.warn(\"You are updating the same item. You should clone the object first to avoid weird effect\");\n }\n await this.beforeUpdateItem(item, fromList, actionTemp);\n let action;\n if (this.isResource(item)) {\n action = new Aventus.ResultRamWithError();\n action.errors = actionTemp.errors;\n }\n else {\n action = await this.queryUpdateItem(item, fromList, actionTemp);\n }\n if (!action.success) {\n return action;\n }\n if (action.result) {\n const resource = action.result;\n await this.addOrUpdateData(resource, action);\n if (!action.success) {\n return action;\n }\n await this.afterUpdateItem(action, fromList);\n if (!action.success) {\n action.result = undefined;\n }\n else if (action.result) {\n this.publish('updated', action.result);\n }\n }\n return action;\n }\n else {\n actionError.errors.push(new Aventus.RamError(Aventus.RamErrorCode.noItemInsideRam, \"can't update the item \" + key + \" because it wasn't found inside ram\"));\n }\n }\n else {\n actionError.errors = resultTemp.errors;\n }\n return actionError;\n });\n }\n async queryUpdateList(list, resultTemp) {\n const result = new Aventus.ResultRamWithError();\n result.errors = resultTemp.errors;\n let response = await this.routes.updateMany(list);\n if (response.success && response.result) {\n result.result = [];\n for (let element of response.result) {\n result.result.push(this.getObjectForRam(element));\n }\n if (this.hasDetails) {\n for (let element of result.result) {\n const id = this.getId(element);\n if (!this.getByIdDone.includes(id)) {\n this.getByIdDone.push(id);\n }\n }\n }\n }\n else {\n result.errors = [...result.errors, ...response.errors];\n }\n return result;\n }\n /**\n * Trigger before updating a list of items\n */\n async beforeUpdateList(list, result) {\n }\n async queryUpdateItem(item, fromList, resultTemp) {\n const result = new Aventus.ResultRamWithError();\n result.errors = resultTemp.errors;\n if (fromList) {\n return result;\n }\n let response = await this.routes.update(item.id, item);\n if (response.success && response.result) {\n result.result = this.getObjectForRam(response.result);\n if (this.hasDetails && result.result) {\n const id = this.getId(result.result);\n if (!this.getByIdDone.includes(id)) {\n this.getByIdDone.push(id);\n }\n }\n }\n else {\n result.errors = [...result.errors, ...response.errors];\n }\n return result;\n }\n /**\n * Trigger before updating an item\n */\n async beforeUpdateItem(item, fromList, result) {\n }\n /**\n * Trigger after updating an item\n */\n async afterUpdateItem(result, fromList) {\n }\n /**\n * Trigger after updating a list of items\n */\n async afterUpdateList(result) {\n }\n /**\n * Delete a list of items inside ram\n */\n async deleteList(list) {\n let result = await this.deleteListWithError(list);\n return result.result ?? [];\n }\n ;\n /**\n * Delete a list of items inside ram\n */\n async deleteListWithError(list) {\n list = this.removeWatch(list);\n let action = new Aventus.ResultRamWithError();\n action.result = [];\n let deleteResult = new Aventus.VoidWithError();\n await this.beforeDeleteList(list, deleteResult);\n await this.queryDeleteList(list, deleteResult);\n if (!deleteResult.success) {\n action.errors = deleteResult.errors;\n }\n for (let item of list) {\n let resultItem = await this._delete(item, true);\n if (resultItem.success && resultItem.result) {\n action.result.push(resultItem.result);\n }\n else {\n action.errors = [...action.errors, ...resultItem.errors];\n }\n }\n if (action.success) {\n await this.afterDeleteList(action);\n }\n return action;\n }\n ;\n /**\n * Delete an item inside ram\n */\n async delete(item, ...args) {\n let action = await this.deleteWithError(item, args);\n if (action.success) {\n return action.result;\n }\n return undefined;\n }\n ;\n /**\n * Delete an item inside ram\n */\n async deleteWithError(item, ...args) {\n return await this._delete(item, false);\n }\n ;\n /**\n * Delete an item by id inside ram\n */\n async deleteById(id) {\n let action = await this.deleteByIdWithError(id);\n if (action.success) {\n return action.result;\n }\n return undefined;\n }\n /**\n * Delete an item by id inside ram\n */\n async deleteByIdWithError(id) {\n let item = this.records.get(id);\n if (item) {\n return await this._delete(item, false);\n }\n let result = new Aventus.ResultRamWithError();\n result.errors.push(new Aventus.RamError(Aventus.RamErrorCode.noItemInsideRam, \"can't delete the item \" + id + \" because it wasn't found inside ram\"));\n return result;\n }\n async _delete(item, fromList) {\n item = this.removeWatch(item);\n return this.actionGuard.run(['_delete', item], async () => {\n let action = new Aventus.ResultRamWithError();\n let resultTemp = await this.getIdWithError(item);\n if (resultTemp.success && resultTemp.result) {\n let key = resultTemp.result;\n let oldItem = this.records.get(key);\n if (oldItem) {\n let deleteResult = new Aventus.VoidWithError();\n await this.beforeDeleteItem(oldItem, fromList, deleteResult);\n if (!deleteResult.success) {\n action.errors = deleteResult.errors;\n return action;\n }\n await this.queryDeleteItem(oldItem, fromList, deleteResult);\n this.beforeRecordDelete(oldItem);\n this.records.delete(key);\n this.afterRecordDelete(oldItem);\n action.result = oldItem;\n await this.afterDeleteItem(action, fromList);\n if (!action.success) {\n action.result = undefined;\n }\n else {\n this.publish('deleted', action.result);\n }\n this.recordsSubscribers.delete(key);\n }\n else {\n action.errors.push(new Aventus.RamError(Aventus.RamErrorCode.noItemInsideRam, \"can't delete the item \" + key + \" because it wasn't found inside ram\"));\n }\n }\n else {\n action.errors = resultTemp.errors;\n }\n return action;\n });\n }\n async queryDeleteList(list, result) {\n let response = await this.routes.destroyMany(list.map(t => t.id));\n if (!response.success) {\n result.errors = [...result.errors, ...response.errors];\n }\n else if (this.hasDetails) {\n for (let item of list) {\n const id = this.getId(item);\n const index = this.getByIdDone.indexOf(id);\n if (index != -1) {\n this.getByIdDone.splice(index, 1);\n }\n }\n }\n }\n /**\n * Trigger before deleting a list of items\n */\n async beforeDeleteList(list, result) { }\n async queryDeleteItem(item, fromList, result) {\n if (fromList) {\n return;\n }\n let response = await this.routes.destroy(item.id);\n if (!response.success) {\n result.errors = [...result.errors, ...response.errors];\n }\n else if (this.hasDetails) {\n const id = this.getId(item);\n const index = this.getByIdDone.indexOf(id);\n if (index != -1) {\n this.getByIdDone.splice(index, 1);\n }\n }\n }\n /**\n * Trigger before deleting an item\n */\n async beforeDeleteItem(item, fromList, result) { }\n /**\n * Trigger after deleting an item\n */\n async afterDeleteItem(result, fromList) { }\n /**\n * Trigger after deleting a list of items\n */\n async afterDeleteList(result) { }\n}\nGenericRamHttp.Namespace=`AventusPhp`;\n__as1(_, 'GenericRamHttp', GenericRamHttp);\n","dependencies":[{"fullName":"Aventus.IRam","isStrong":true},{"fullName":"AventusPhp.ModelController","isStrong":false},{"fullName":"AventusPhp.RamSubscribers","isStrong":false},{"fullName":"AventusPhp.RamHttpResourceDetails","isStrong":false},{"fullName":"Aventus.RamItem","isStrong":false},{"fullName":"Aventus.ActionGuard","isStrong":false},{"fullName":"AventusPhp.RamHttpData","isStrong":false},{"fullName":"AventusPhp.RamHttpRequest","isStrong":false},{"fullName":"AventusPhp.RamHttpResource","isStrong":false},{"fullName":"Aventus.GenericRam","isStrong":false},{"fullName":"Aventus.KeysObject","isStrong":false},{"fullName":"Aventus.ResultRamWithError","isStrong":false},{"fullName":"Aventus.RamError","isStrong":false},{"fullName":"Aventus.RamErrorCode","isStrong":false},{"fullName":"X","isStrong":false},{"fullName":"Aventus.IRamData","isStrong":false},{"fullName":"B","isStrong":false},{"fullName":"Base","isStrong":false},{"fullName":"Aventus.IRamAction","isStrong":false},{"fullName":"Aventus.VoidRamWithError","isStrong":false},{"fullName":"Aventus.ResultWithError","isStrong":false},{"fullName":"Aventus.JsonFromOptions","isStrong":false},{"fullName":"Aventus.Json","isStrong":false},{"fullName":"Aventus.ResultRamWithError","isStrong":false},{"fullName":"Aventus.RamItem","isStrong":false},{"fullName":"Aventus.VoidWithError","isStrong":false}],"fullName":"AventusPhp.GenericRamHttp","required":false,"type":1,"isExported":true,"convertibleName":""},{"code":"let RamHttp=class RamHttp extends GenericRamHttp {\n}\nRamHttp.Namespace=`AventusPhp`;\n__as1(_, 'RamHttp', RamHttp);\n","dependencies":[{"fullName":"AventusPhp.GenericRamHttp","isStrong":true},{"fullName":"AventusPhp.ModelController","isStrong":false}],"fullName":"AventusPhp.RamHttp","required":false,"type":1,"isExported":true,"convertibleName":""}],"existing":[{"fullName":"AventusPhp.RamSubscribers","dependencies":[]},{"fullName":"AventusPhp.KeysOfType","dependencies":[{"fullName":"T","isStrong":false},{"fullName":"U","isStrong":false},{"fullName":"K","isStrong":false}]},{"fullName":"AventusPhp.NumberKeys","dependencies":[{"fullName":"T","isStrong":false},{"fullName":"K","isStrong":false}]},{"fullName":"AventusPhp.RamHttpResource","dependencies":[{"fullName":"C","isStrong":false},{"fullName":"AventusPhp.ModelController","isStrong":false},{"fullName":"Res","isStrong":false}]},{"fullName":"AventusPhp.RamHttpRequest","dependencies":[{"fullName":"C","isStrong":false},{"fullName":"AventusPhp.ModelController","isStrong":false},{"fullName":"Req","isStrong":false}]},{"fullName":"AventusPhp.RamHttpData","dependencies":[{"fullName":"C","isStrong":false},{"fullName":"AventusPhp.ModelController","isStrong":false},{"fullName":"D","isStrong":false}]},{"fullName":"AventusPhp.RamHttpResourceDetails","dependencies":[{"fullName":"C","isStrong":false},{"fullName":"AventusPhp.ModelController","isStrong":false},{"fullName":"Res","isStrong":false}]},{"fullName":"AventusPhp.ItemField","dependencies":[{"fullName":"Aventus.IRamData","isStrong":false},{"fullName":"AventusPhp.NumberKeys","isStrong":false},{"fullName":"T","isStrong":false},{"fullName":"AventusPhp.KeysOfType","isStrong":false},{"fullName":"U","isStrong":false}]}]}
443
441
  //#endregion js src //
444
442
  //#region css def //
445
443
  {}