@kaspernj/api-maker 1.0.2139 → 1.0.2142
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/api.js +2 -2
- package/build/base-error.d.ts +112 -1
- package/build/base-error.d.ts.map +1 -1
- package/build/base-model.d.ts +328 -0
- package/build/base-model.d.ts.map +1 -0
- package/build/base-model.js +40 -53
- package/build/bootstrap/card.js +2 -2
- package/build/bootstrap/checkboxes.js +3 -3
- package/build/collection.d.ts +671 -5
- package/build/collection.d.ts.map +1 -1
- package/build/config.d.ts +8 -0
- package/build/config.d.ts.map +1 -1
- package/build/config.js +9 -1
- package/build/devise.d.ts.map +1 -1
- package/build/devise.js +18 -23
- package/build/draggable-sort/index.js +5 -1
- package/build/draggable-sort/item.js +7 -1
- package/build/inputs/input.js +3 -3
- package/build/inputs/money.js +5 -5
- package/build/link.js +4 -4
- package/build/model-class-require.d.ts +2 -2
- package/build/model-class-require.d.ts.map +1 -1
- package/build/model-class-require.js +2 -2
- package/build/model-events.d.ts +336 -3
- package/build/model-events.d.ts.map +1 -1
- package/build/model-recipes-model-loader.d.ts +1357 -67
- package/build/model-recipes-model-loader.d.ts.map +1 -1
- package/build/models-response-reader.d.ts +336 -3
- package/build/models-response-reader.d.ts.map +1 -1
- package/build/models.d.ts +1 -1
- package/build/models.d.ts.map +1 -1
- package/build/models.js +2 -1
- package/build/preloaded.d.ts +112 -1
- package/build/preloaded.d.ts.map +1 -1
- package/build/result.d.ts +336 -3
- package/build/result.d.ts.map +1 -1
- package/build/router/switch.d.ts +1 -1
- package/build/router/switch.d.ts.map +1 -1
- package/build/router/switch.js +2 -2
- package/build/routes-native.d.ts.map +1 -1
- package/build/routes-native.js +4 -3
- package/build/services.d.ts +2 -2
- package/build/services.d.ts.map +1 -1
- package/build/services.js +2 -2
- package/build/super-admin/config-reader.js +2 -2
- package/build/super-admin/edit-page/edit-attribute.js +2 -1
- package/build/super-admin/layout/header/index.js +6 -5
- package/build/super-admin/layout/index.js +6 -4
- package/build/super-admin/layout/menu/index.js +2 -2
- package/build/super-admin/models.d.ts.map +1 -1
- package/build/super-admin/models.js +2 -1
- package/build/table/column-content.d.ts +11 -2
- package/build/table/column-content.d.ts.map +1 -1
- package/build/table/column-content.js +10 -1
- package/build/table/components/flat-list.js +2 -2
- package/build/table/filters/filter-form.js +2 -2
- package/build/table/filters/index.js +2 -1
- package/build/table/filters/load-search-modal.js +4 -3
- package/build/table/filters/save-search-modal.js +2 -2
- package/build/table/settings/column-row.js +3 -3
- package/build/table/settings/download-action.js +2 -1
- package/build/table/settings/index.js +2 -2
- package/build/table/table.js +13 -12
- package/build/table/use-sorting.d.ts +2 -2
- package/build/table/use-sorting.d.ts.map +1 -1
- package/build/table/use-sorting.js +2 -2
- package/build/table/worker-plugins-check-all-checkbox.js +4 -4
- package/build/table/worker-plugins-checkbox.js +2 -2
- package/build/use-collection.d.ts +112 -1
- package/build/use-collection.d.ts.map +1 -1
- package/build/use-current-user.d.ts +113 -2
- package/build/use-current-user.d.ts.map +1 -1
- package/build/use-current-user.js +2 -2
- package/build/use-input.d.ts +8 -23
- package/build/use-input.d.ts.map +1 -1
- package/build/use-input.js +6 -12
- package/build/use-model.d.ts +112 -1
- package/build/use-model.d.ts.map +1 -1
- package/build/use-model.js +19 -5
- package/build/use-router.js +2 -2
- package/build/use-updated-event.d.ts +225 -3
- package/build/use-updated-event.d.ts.map +1 -1
- package/build/use-updated-event.js +2 -2
- package/build/utils/checkbox.js +2 -1
- package/build/utils/checkboxes.js +3 -3
- package/build/utils/default-style.d.ts +2 -4
- package/build/utils/default-style.d.ts.map +1 -1
- package/build/utils/default-style.js +4 -3
- package/build/utils/header.d.ts +1 -1
- package/build/utils/header.js +2 -2
- package/build/utils/text.js +2 -2
- package/build/with-api-maker.js +2 -2
- package/build/with-collection.d.ts.map +1 -1
- package/build/with-collection.js +4 -2
- package/package.json +2 -2
package/build/collection.d.ts
CHANGED
|
@@ -59,7 +59,118 @@ export default class ApiMakerCollection<MC extends typeof import("./base-model.j
|
|
|
59
59
|
* @param {function(import("./base-model.js").default) : void} callback
|
|
60
60
|
* @returns {Promise<void>}
|
|
61
61
|
*/
|
|
62
|
-
each(callback: (arg0:
|
|
62
|
+
each(callback: (arg0: {
|
|
63
|
+
changes: {};
|
|
64
|
+
newRecord: boolean;
|
|
65
|
+
relationshipsCache: {};
|
|
66
|
+
relationships: {};
|
|
67
|
+
abilities: Record<string, any>;
|
|
68
|
+
modelData: {};
|
|
69
|
+
assignAttributes(newAttributes: Record<string, any>): void;
|
|
70
|
+
attributes(): Record<string, any>;
|
|
71
|
+
can(givenAbilityName: string): boolean;
|
|
72
|
+
clone(): /*elided*/ any;
|
|
73
|
+
cacheKey(): number | string;
|
|
74
|
+
localCacheKey(): string;
|
|
75
|
+
fullCacheKey(): string;
|
|
76
|
+
create(attributes?: Record<string, any>, options?: object): Promise<{
|
|
77
|
+
model: /*elided*/ any;
|
|
78
|
+
response: object;
|
|
79
|
+
}>;
|
|
80
|
+
createRaw(rawData: FormData | Record<string, any>, options?: object): Promise<{
|
|
81
|
+
model: /*elided*/ any;
|
|
82
|
+
response: any;
|
|
83
|
+
}>;
|
|
84
|
+
destroy(): Promise<{
|
|
85
|
+
model: /*elided*/ any;
|
|
86
|
+
response: object;
|
|
87
|
+
}>;
|
|
88
|
+
ensureAbilities(listOfAbilities: string[]): Promise<void>;
|
|
89
|
+
getAttributes(): Record<string, any>;
|
|
90
|
+
handleResponseError(response: object): never;
|
|
91
|
+
identifierKey(): number | string;
|
|
92
|
+
_identifierKey: string | number;
|
|
93
|
+
isAssociationLoaded(associationName: string): boolean;
|
|
94
|
+
isAssociationLoadedUnderscore(associationNameUnderscore: string): boolean;
|
|
95
|
+
isAssociationPresent(associationName: string): boolean;
|
|
96
|
+
ensureAssociationLoaded(associationName: string): Promise<any>;
|
|
97
|
+
ensureAssociationLoadedUnderscore(associationNameUnderscore: string): Promise<any>;
|
|
98
|
+
isAttributeChanged(attributeName: string): boolean;
|
|
99
|
+
isChanged(): boolean;
|
|
100
|
+
isNewRecord(): boolean;
|
|
101
|
+
isPersisted(): boolean;
|
|
102
|
+
savedChangeToAttribute(attributeName: string): boolean;
|
|
103
|
+
setNewModel(model: /*elided*/ any): void;
|
|
104
|
+
setNewModelData(model: /*elided*/ any): void;
|
|
105
|
+
previousModelData: any;
|
|
106
|
+
_isDateChanged(oldValue: any, newValue: any): boolean | void;
|
|
107
|
+
_isIntegerChanged(oldValue: any, newValue: any): boolean | void;
|
|
108
|
+
_isStringChanged(oldValue: any, newValue: any): boolean | void;
|
|
109
|
+
modelClassData(): ModelClassDataType;
|
|
110
|
+
reload(): Promise<void>;
|
|
111
|
+
save(): Promise<{
|
|
112
|
+
model: /*elided*/ any;
|
|
113
|
+
response?: object;
|
|
114
|
+
}>;
|
|
115
|
+
saveRaw(rawData: any, options?: {}): Promise<{
|
|
116
|
+
model: /*elided*/ any;
|
|
117
|
+
response: object;
|
|
118
|
+
}>;
|
|
119
|
+
update(newAttributes?: Record<string, any>, options?: ParseValidationErrorsOptions): Promise<{
|
|
120
|
+
model: /*elided*/ any;
|
|
121
|
+
response?: object;
|
|
122
|
+
}>;
|
|
123
|
+
_refreshModelFromResponse(response: object): void;
|
|
124
|
+
_refreshModelDataFromResponse(response: object): void;
|
|
125
|
+
updateRaw(rawData: FormData | Record<string, any>, options?: ParseValidationErrorsOptions & {
|
|
126
|
+
simpleModelErrors?: boolean;
|
|
127
|
+
}): Promise<{
|
|
128
|
+
response: object;
|
|
129
|
+
model: /*elided*/ any;
|
|
130
|
+
}>;
|
|
131
|
+
isValid(): never;
|
|
132
|
+
isValidOnServer(): Promise<{
|
|
133
|
+
valid: boolean;
|
|
134
|
+
errors: Record<string, any>;
|
|
135
|
+
}>;
|
|
136
|
+
modelClass(): Record<string, any>;
|
|
137
|
+
preloadRelationship(relationshipName: string, model: /*elided*/ any | /*elided*/ any[] | null): void;
|
|
138
|
+
markForDestruction(): void;
|
|
139
|
+
_markedForDestruction: boolean;
|
|
140
|
+
markedForDestruction(): boolean;
|
|
141
|
+
uniqueKey(): number;
|
|
142
|
+
uniqueKeyValue: number;
|
|
143
|
+
_callMemberCommand(args: Record<string, any>, commandArgs: Record<string, any>): Promise<object>;
|
|
144
|
+
readAttribute(attributeName: string): any;
|
|
145
|
+
readAttributeUnderscore(attributeName: string): any;
|
|
146
|
+
isAttributeLoaded(attributeName: any): boolean;
|
|
147
|
+
_isPresent(value: any): boolean;
|
|
148
|
+
_loadBelongsToReflection(args: import("./collection.js").CollectionArgsType<any>, queryArgs?: import("./collection.js").QueryArgsType): Promise<any | null>;
|
|
149
|
+
_readBelongsToReflection({ reflectionName }: {
|
|
150
|
+
modelClass: any;
|
|
151
|
+
reflectionName: string;
|
|
152
|
+
}): any | null;
|
|
153
|
+
_loadHasManyReflection(args: import("./collection.js").CollectionArgsType<any>, queryArgs?: import("./collection.js").QueryArgsType): Promise<Array<any>>;
|
|
154
|
+
_loadHasOneReflection(args: import("./collection.js").CollectionArgsType<any>, queryArgs?: import("./collection.js").QueryArgsType): Promise<any>;
|
|
155
|
+
_readHasOneReflection({ reflectionName }: {
|
|
156
|
+
modelClass: any;
|
|
157
|
+
reflectionName: string;
|
|
158
|
+
}): any | null;
|
|
159
|
+
_readModelDataFromArgs(args?: {
|
|
160
|
+
data?: {
|
|
161
|
+
b?: Record<string, any>;
|
|
162
|
+
a?: Record<string, any>;
|
|
163
|
+
r?: any;
|
|
164
|
+
};
|
|
165
|
+
collection?: ApiMakerCollection<any>;
|
|
166
|
+
}): void;
|
|
167
|
+
collection: ApiMakerCollection<any>;
|
|
168
|
+
preloadedRelationships: any;
|
|
169
|
+
_readPreloadedRelationships(preloaded: {
|
|
170
|
+
getModel: (relationshipType: string, relationshipId: number | string) => /*elided*/ any;
|
|
171
|
+
}): void;
|
|
172
|
+
primaryKey(): number | string;
|
|
173
|
+
}) => void): Promise<void>;
|
|
63
174
|
/**
|
|
64
175
|
* @param {...string} keys
|
|
65
176
|
* @returns {this}
|
|
@@ -101,17 +212,461 @@ export default class ApiMakerCollection<MC extends typeof import("./base-model.j
|
|
|
101
212
|
* @param {function(import("./base-model.js").default): boolean} callback
|
|
102
213
|
* @returns {import("./base-model.js").default}
|
|
103
214
|
*/
|
|
104
|
-
find(callback: (arg0:
|
|
215
|
+
find(callback: (arg0: {
|
|
216
|
+
changes: {};
|
|
217
|
+
newRecord: boolean;
|
|
218
|
+
relationshipsCache: {};
|
|
219
|
+
relationships: {};
|
|
220
|
+
abilities: Record<string, any>;
|
|
221
|
+
modelData: {};
|
|
222
|
+
assignAttributes(newAttributes: Record<string, any>): void;
|
|
223
|
+
attributes(): Record<string, any>;
|
|
224
|
+
can(givenAbilityName: string): boolean;
|
|
225
|
+
clone(): /*elided*/ any;
|
|
226
|
+
cacheKey(): number | string;
|
|
227
|
+
localCacheKey(): string;
|
|
228
|
+
fullCacheKey(): string;
|
|
229
|
+
create(attributes?: Record<string, any>, options?: object): Promise<{
|
|
230
|
+
model: /*elided*/ any;
|
|
231
|
+
response: object;
|
|
232
|
+
}>;
|
|
233
|
+
createRaw(rawData: FormData | Record<string, any>, options?: object): Promise<{
|
|
234
|
+
model: /*elided*/ any;
|
|
235
|
+
response: any;
|
|
236
|
+
}>;
|
|
237
|
+
destroy(): Promise<{
|
|
238
|
+
model: /*elided*/ any;
|
|
239
|
+
response: object;
|
|
240
|
+
}>;
|
|
241
|
+
ensureAbilities(listOfAbilities: string[]): Promise<void>;
|
|
242
|
+
getAttributes(): Record<string, any>;
|
|
243
|
+
handleResponseError(response: object): never;
|
|
244
|
+
identifierKey(): number | string;
|
|
245
|
+
_identifierKey: string | number;
|
|
246
|
+
isAssociationLoaded(associationName: string): boolean;
|
|
247
|
+
isAssociationLoadedUnderscore(associationNameUnderscore: string): boolean;
|
|
248
|
+
isAssociationPresent(associationName: string): boolean;
|
|
249
|
+
ensureAssociationLoaded(associationName: string): Promise<any>;
|
|
250
|
+
ensureAssociationLoadedUnderscore(associationNameUnderscore: string): Promise<any>;
|
|
251
|
+
isAttributeChanged(attributeName: string): boolean;
|
|
252
|
+
isChanged(): boolean;
|
|
253
|
+
isNewRecord(): boolean;
|
|
254
|
+
isPersisted(): boolean;
|
|
255
|
+
savedChangeToAttribute(attributeName: string): boolean;
|
|
256
|
+
setNewModel(model: /*elided*/ any): void;
|
|
257
|
+
setNewModelData(model: /*elided*/ any): void;
|
|
258
|
+
previousModelData: any;
|
|
259
|
+
_isDateChanged(oldValue: any, newValue: any): boolean | void;
|
|
260
|
+
_isIntegerChanged(oldValue: any, newValue: any): boolean | void;
|
|
261
|
+
_isStringChanged(oldValue: any, newValue: any): boolean | void;
|
|
262
|
+
modelClassData(): ModelClassDataType;
|
|
263
|
+
reload(): Promise<void>;
|
|
264
|
+
save(): Promise<{
|
|
265
|
+
model: /*elided*/ any;
|
|
266
|
+
response?: object;
|
|
267
|
+
}>;
|
|
268
|
+
saveRaw(rawData: any, options?: {}): Promise<{
|
|
269
|
+
model: /*elided*/ any;
|
|
270
|
+
response: object;
|
|
271
|
+
}>;
|
|
272
|
+
update(newAttributes?: Record<string, any>, options?: ParseValidationErrorsOptions): Promise<{
|
|
273
|
+
model: /*elided*/ any;
|
|
274
|
+
response?: object;
|
|
275
|
+
}>;
|
|
276
|
+
_refreshModelFromResponse(response: object): void;
|
|
277
|
+
_refreshModelDataFromResponse(response: object): void;
|
|
278
|
+
updateRaw(rawData: FormData | Record<string, any>, options?: ParseValidationErrorsOptions & {
|
|
279
|
+
simpleModelErrors?: boolean;
|
|
280
|
+
}): Promise<{
|
|
281
|
+
response: object;
|
|
282
|
+
model: /*elided*/ any;
|
|
283
|
+
}>;
|
|
284
|
+
isValid(): never;
|
|
285
|
+
isValidOnServer(): Promise<{
|
|
286
|
+
valid: boolean;
|
|
287
|
+
errors: Record<string, any>;
|
|
288
|
+
}>;
|
|
289
|
+
modelClass(): Record<string, any>;
|
|
290
|
+
preloadRelationship(relationshipName: string, model: /*elided*/ any | /*elided*/ any[] | null): void;
|
|
291
|
+
markForDestruction(): void;
|
|
292
|
+
_markedForDestruction: boolean;
|
|
293
|
+
markedForDestruction(): boolean;
|
|
294
|
+
uniqueKey(): number;
|
|
295
|
+
uniqueKeyValue: number;
|
|
296
|
+
_callMemberCommand(args: Record<string, any>, commandArgs: Record<string, any>): Promise<object>;
|
|
297
|
+
readAttribute(attributeName: string): any;
|
|
298
|
+
readAttributeUnderscore(attributeName: string): any;
|
|
299
|
+
isAttributeLoaded(attributeName: any): boolean;
|
|
300
|
+
_isPresent(value: any): boolean;
|
|
301
|
+
_loadBelongsToReflection(args: import("./collection.js").CollectionArgsType<any>, queryArgs?: import("./collection.js").QueryArgsType): Promise<any | null>;
|
|
302
|
+
_readBelongsToReflection({ reflectionName }: {
|
|
303
|
+
modelClass: any;
|
|
304
|
+
reflectionName: string;
|
|
305
|
+
}): any | null;
|
|
306
|
+
_loadHasManyReflection(args: import("./collection.js").CollectionArgsType<any>, queryArgs?: import("./collection.js").QueryArgsType): Promise<Array<any>>;
|
|
307
|
+
_loadHasOneReflection(args: import("./collection.js").CollectionArgsType<any>, queryArgs?: import("./collection.js").QueryArgsType): Promise<any>;
|
|
308
|
+
_readHasOneReflection({ reflectionName }: {
|
|
309
|
+
modelClass: any;
|
|
310
|
+
reflectionName: string;
|
|
311
|
+
}): any | null;
|
|
312
|
+
_readModelDataFromArgs(args?: {
|
|
313
|
+
data?: {
|
|
314
|
+
b?: Record<string, any>;
|
|
315
|
+
a?: Record<string, any>;
|
|
316
|
+
r?: any;
|
|
317
|
+
};
|
|
318
|
+
collection?: ApiMakerCollection<any>;
|
|
319
|
+
}): void;
|
|
320
|
+
collection: ApiMakerCollection<any>;
|
|
321
|
+
preloadedRelationships: any;
|
|
322
|
+
_readPreloadedRelationships(preloaded: {
|
|
323
|
+
getModel: (relationshipType: string, relationshipId: number | string) => /*elided*/ any;
|
|
324
|
+
}): void;
|
|
325
|
+
primaryKey(): number | string;
|
|
326
|
+
}) => boolean): {
|
|
327
|
+
changes: {};
|
|
328
|
+
newRecord: boolean;
|
|
329
|
+
relationshipsCache: {};
|
|
330
|
+
relationships: {};
|
|
331
|
+
abilities: Record<string, any>;
|
|
332
|
+
modelData: {};
|
|
333
|
+
assignAttributes(newAttributes: Record<string, any>): void;
|
|
334
|
+
attributes(): Record<string, any>;
|
|
335
|
+
can(givenAbilityName: string): boolean;
|
|
336
|
+
clone(): /*elided*/ any;
|
|
337
|
+
cacheKey(): number | string;
|
|
338
|
+
localCacheKey(): string;
|
|
339
|
+
fullCacheKey(): string;
|
|
340
|
+
create(attributes?: Record<string, any>, options?: object): Promise<{
|
|
341
|
+
model: /*elided*/ any;
|
|
342
|
+
response: object;
|
|
343
|
+
}>;
|
|
344
|
+
createRaw(rawData: FormData | Record<string, any>, options?: object): Promise<{
|
|
345
|
+
model: /*elided*/ any;
|
|
346
|
+
response: any;
|
|
347
|
+
}>;
|
|
348
|
+
destroy(): Promise<{
|
|
349
|
+
model: /*elided*/ any;
|
|
350
|
+
response: object;
|
|
351
|
+
}>;
|
|
352
|
+
ensureAbilities(listOfAbilities: string[]): Promise<void>;
|
|
353
|
+
getAttributes(): Record<string, any>;
|
|
354
|
+
handleResponseError(response: object): never;
|
|
355
|
+
identifierKey(): number | string;
|
|
356
|
+
_identifierKey: string | number;
|
|
357
|
+
isAssociationLoaded(associationName: string): boolean;
|
|
358
|
+
isAssociationLoadedUnderscore(associationNameUnderscore: string): boolean;
|
|
359
|
+
isAssociationPresent(associationName: string): boolean;
|
|
360
|
+
ensureAssociationLoaded(associationName: string): Promise<any>;
|
|
361
|
+
ensureAssociationLoadedUnderscore(associationNameUnderscore: string): Promise<any>;
|
|
362
|
+
isAttributeChanged(attributeName: string): boolean;
|
|
363
|
+
isChanged(): boolean;
|
|
364
|
+
isNewRecord(): boolean;
|
|
365
|
+
isPersisted(): boolean;
|
|
366
|
+
savedChangeToAttribute(attributeName: string): boolean;
|
|
367
|
+
setNewModel(model: /*elided*/ any): void;
|
|
368
|
+
setNewModelData(model: /*elided*/ any): void;
|
|
369
|
+
previousModelData: any;
|
|
370
|
+
_isDateChanged(oldValue: any, newValue: any): boolean | void;
|
|
371
|
+
_isIntegerChanged(oldValue: any, newValue: any): boolean | void;
|
|
372
|
+
_isStringChanged(oldValue: any, newValue: any): boolean | void;
|
|
373
|
+
modelClassData(): ModelClassDataType;
|
|
374
|
+
reload(): Promise<void>;
|
|
375
|
+
save(): Promise<{
|
|
376
|
+
model: /*elided*/ any;
|
|
377
|
+
response?: object;
|
|
378
|
+
}>;
|
|
379
|
+
saveRaw(rawData: any, options?: {}): Promise<{
|
|
380
|
+
model: /*elided*/ any;
|
|
381
|
+
response: object;
|
|
382
|
+
}>;
|
|
383
|
+
update(newAttributes?: Record<string, any>, options?: ParseValidationErrorsOptions): Promise<{
|
|
384
|
+
model: /*elided*/ any;
|
|
385
|
+
response?: object;
|
|
386
|
+
}>;
|
|
387
|
+
_refreshModelFromResponse(response: object): void;
|
|
388
|
+
_refreshModelDataFromResponse(response: object): void;
|
|
389
|
+
updateRaw(rawData: FormData | Record<string, any>, options?: ParseValidationErrorsOptions & {
|
|
390
|
+
simpleModelErrors?: boolean;
|
|
391
|
+
}): Promise<{
|
|
392
|
+
response: object;
|
|
393
|
+
model: /*elided*/ any;
|
|
394
|
+
}>;
|
|
395
|
+
isValid(): never;
|
|
396
|
+
isValidOnServer(): Promise<{
|
|
397
|
+
valid: boolean;
|
|
398
|
+
errors: Record<string, any>;
|
|
399
|
+
}>;
|
|
400
|
+
modelClass(): Record<string, any>;
|
|
401
|
+
preloadRelationship(relationshipName: string, model: /*elided*/ any | /*elided*/ any[] | null): void;
|
|
402
|
+
markForDestruction(): void;
|
|
403
|
+
_markedForDestruction: boolean;
|
|
404
|
+
markedForDestruction(): boolean;
|
|
405
|
+
uniqueKey(): number;
|
|
406
|
+
uniqueKeyValue: number;
|
|
407
|
+
_callMemberCommand(args: Record<string, any>, commandArgs: Record<string, any>): Promise<object>;
|
|
408
|
+
readAttribute(attributeName: string): any;
|
|
409
|
+
readAttributeUnderscore(attributeName: string): any;
|
|
410
|
+
isAttributeLoaded(attributeName: any): boolean;
|
|
411
|
+
_isPresent(value: any): boolean;
|
|
412
|
+
_loadBelongsToReflection(args: import("./collection.js").CollectionArgsType<any>, queryArgs?: import("./collection.js").QueryArgsType): Promise<any | null>;
|
|
413
|
+
_readBelongsToReflection({ reflectionName }: {
|
|
414
|
+
modelClass: any;
|
|
415
|
+
reflectionName: string;
|
|
416
|
+
}): any | null;
|
|
417
|
+
_loadHasManyReflection(args: import("./collection.js").CollectionArgsType<any>, queryArgs?: import("./collection.js").QueryArgsType): Promise<Array<any>>;
|
|
418
|
+
_loadHasOneReflection(args: import("./collection.js").CollectionArgsType<any>, queryArgs?: import("./collection.js").QueryArgsType): Promise<any>;
|
|
419
|
+
_readHasOneReflection({ reflectionName }: {
|
|
420
|
+
modelClass: any;
|
|
421
|
+
reflectionName: string;
|
|
422
|
+
}): any | null;
|
|
423
|
+
_readModelDataFromArgs(args?: {
|
|
424
|
+
data?: {
|
|
425
|
+
b?: Record<string, any>;
|
|
426
|
+
a?: Record<string, any>;
|
|
427
|
+
r?: any;
|
|
428
|
+
};
|
|
429
|
+
collection?: ApiMakerCollection<any>;
|
|
430
|
+
}): void;
|
|
431
|
+
collection: ApiMakerCollection<any>;
|
|
432
|
+
preloadedRelationships: any;
|
|
433
|
+
_readPreloadedRelationships(preloaded: {
|
|
434
|
+
getModel: (relationshipType: string, relationshipId: number | string) => /*elided*/ any;
|
|
435
|
+
}): void;
|
|
436
|
+
primaryKey(): number | string;
|
|
437
|
+
};
|
|
105
438
|
/**
|
|
106
439
|
* @param {function(import("./base-model.js").default): void} callback
|
|
107
440
|
* @returns {void}
|
|
108
441
|
*/
|
|
109
|
-
forEach(callback: (arg0:
|
|
442
|
+
forEach(callback: (arg0: {
|
|
443
|
+
changes: {};
|
|
444
|
+
newRecord: boolean;
|
|
445
|
+
relationshipsCache: {};
|
|
446
|
+
relationships: {};
|
|
447
|
+
abilities: Record<string, any>;
|
|
448
|
+
modelData: {};
|
|
449
|
+
assignAttributes(newAttributes: Record<string, any>): void;
|
|
450
|
+
attributes(): Record<string, any>;
|
|
451
|
+
can(givenAbilityName: string): boolean;
|
|
452
|
+
clone(): /*elided*/ any;
|
|
453
|
+
cacheKey(): number | string;
|
|
454
|
+
localCacheKey(): string;
|
|
455
|
+
fullCacheKey(): string;
|
|
456
|
+
create(attributes?: Record<string, any>, options?: object): Promise<{
|
|
457
|
+
model: /*elided*/ any;
|
|
458
|
+
response: object;
|
|
459
|
+
}>;
|
|
460
|
+
createRaw(rawData: FormData | Record<string, any>, options?: object): Promise<{
|
|
461
|
+
model: /*elided*/ any;
|
|
462
|
+
response: any;
|
|
463
|
+
}>;
|
|
464
|
+
destroy(): Promise<{
|
|
465
|
+
model: /*elided*/ any;
|
|
466
|
+
response: object;
|
|
467
|
+
}>;
|
|
468
|
+
ensureAbilities(listOfAbilities: string[]): Promise<void>;
|
|
469
|
+
getAttributes(): Record<string, any>;
|
|
470
|
+
handleResponseError(response: object): never;
|
|
471
|
+
identifierKey(): number | string;
|
|
472
|
+
_identifierKey: string | number;
|
|
473
|
+
isAssociationLoaded(associationName: string): boolean;
|
|
474
|
+
isAssociationLoadedUnderscore(associationNameUnderscore: string): boolean;
|
|
475
|
+
isAssociationPresent(associationName: string): boolean;
|
|
476
|
+
ensureAssociationLoaded(associationName: string): Promise<any>;
|
|
477
|
+
ensureAssociationLoadedUnderscore(associationNameUnderscore: string): Promise<any>;
|
|
478
|
+
isAttributeChanged(attributeName: string): boolean;
|
|
479
|
+
isChanged(): boolean;
|
|
480
|
+
isNewRecord(): boolean;
|
|
481
|
+
isPersisted(): boolean;
|
|
482
|
+
savedChangeToAttribute(attributeName: string): boolean;
|
|
483
|
+
setNewModel(model: /*elided*/ any): void;
|
|
484
|
+
setNewModelData(model: /*elided*/ any): void;
|
|
485
|
+
previousModelData: any;
|
|
486
|
+
_isDateChanged(oldValue: any, newValue: any): boolean | void;
|
|
487
|
+
_isIntegerChanged(oldValue: any, newValue: any): boolean | void;
|
|
488
|
+
_isStringChanged(oldValue: any, newValue: any): boolean | void;
|
|
489
|
+
modelClassData(): ModelClassDataType;
|
|
490
|
+
reload(): Promise<void>;
|
|
491
|
+
save(): Promise<{
|
|
492
|
+
model: /*elided*/ any;
|
|
493
|
+
response?: object;
|
|
494
|
+
}>;
|
|
495
|
+
saveRaw(rawData: any, options?: {}): Promise<{
|
|
496
|
+
model: /*elided*/ any;
|
|
497
|
+
response: object;
|
|
498
|
+
}>;
|
|
499
|
+
update(newAttributes?: Record<string, any>, options?: ParseValidationErrorsOptions): Promise<{
|
|
500
|
+
model: /*elided*/ any;
|
|
501
|
+
response?: object;
|
|
502
|
+
}>;
|
|
503
|
+
_refreshModelFromResponse(response: object): void;
|
|
504
|
+
_refreshModelDataFromResponse(response: object): void;
|
|
505
|
+
updateRaw(rawData: FormData | Record<string, any>, options?: ParseValidationErrorsOptions & {
|
|
506
|
+
simpleModelErrors?: boolean;
|
|
507
|
+
}): Promise<{
|
|
508
|
+
response: object;
|
|
509
|
+
model: /*elided*/ any;
|
|
510
|
+
}>;
|
|
511
|
+
isValid(): never;
|
|
512
|
+
isValidOnServer(): Promise<{
|
|
513
|
+
valid: boolean;
|
|
514
|
+
errors: Record<string, any>;
|
|
515
|
+
}>;
|
|
516
|
+
modelClass(): Record<string, any>;
|
|
517
|
+
preloadRelationship(relationshipName: string, model: /*elided*/ any | /*elided*/ any[] | null): void;
|
|
518
|
+
markForDestruction(): void;
|
|
519
|
+
_markedForDestruction: boolean;
|
|
520
|
+
markedForDestruction(): boolean;
|
|
521
|
+
uniqueKey(): number;
|
|
522
|
+
uniqueKeyValue: number;
|
|
523
|
+
_callMemberCommand(args: Record<string, any>, commandArgs: Record<string, any>): Promise<object>;
|
|
524
|
+
readAttribute(attributeName: string): any;
|
|
525
|
+
readAttributeUnderscore(attributeName: string): any;
|
|
526
|
+
isAttributeLoaded(attributeName: any): boolean;
|
|
527
|
+
_isPresent(value: any): boolean;
|
|
528
|
+
_loadBelongsToReflection(args: import("./collection.js").CollectionArgsType<any>, queryArgs?: import("./collection.js").QueryArgsType): Promise<any | null>;
|
|
529
|
+
_readBelongsToReflection({ reflectionName }: {
|
|
530
|
+
modelClass: any;
|
|
531
|
+
reflectionName: string;
|
|
532
|
+
}): any | null;
|
|
533
|
+
_loadHasManyReflection(args: import("./collection.js").CollectionArgsType<any>, queryArgs?: import("./collection.js").QueryArgsType): Promise<Array<any>>;
|
|
534
|
+
_loadHasOneReflection(args: import("./collection.js").CollectionArgsType<any>, queryArgs?: import("./collection.js").QueryArgsType): Promise<any>;
|
|
535
|
+
_readHasOneReflection({ reflectionName }: {
|
|
536
|
+
modelClass: any;
|
|
537
|
+
reflectionName: string;
|
|
538
|
+
}): any | null;
|
|
539
|
+
_readModelDataFromArgs(args?: {
|
|
540
|
+
data?: {
|
|
541
|
+
b?: Record<string, any>;
|
|
542
|
+
a?: Record<string, any>;
|
|
543
|
+
r?: any;
|
|
544
|
+
};
|
|
545
|
+
collection?: ApiMakerCollection<any>;
|
|
546
|
+
}): void;
|
|
547
|
+
collection: ApiMakerCollection<any>;
|
|
548
|
+
preloadedRelationships: any;
|
|
549
|
+
_readPreloadedRelationships(preloaded: {
|
|
550
|
+
getModel: (relationshipType: string, relationshipId: number | string) => /*elided*/ any;
|
|
551
|
+
}): void;
|
|
552
|
+
primaryKey(): number | string;
|
|
553
|
+
}) => void): void;
|
|
110
554
|
/**
|
|
111
555
|
* @param {function(import("./base-model.js").default): void} callback
|
|
112
556
|
* @returns {any[]}
|
|
113
557
|
*/
|
|
114
|
-
map(callback: (arg0:
|
|
558
|
+
map(callback: (arg0: {
|
|
559
|
+
changes: {};
|
|
560
|
+
newRecord: boolean;
|
|
561
|
+
relationshipsCache: {};
|
|
562
|
+
relationships: {};
|
|
563
|
+
abilities: Record<string, any>;
|
|
564
|
+
modelData: {};
|
|
565
|
+
assignAttributes(newAttributes: Record<string, any>): void;
|
|
566
|
+
attributes(): Record<string, any>;
|
|
567
|
+
can(givenAbilityName: string): boolean;
|
|
568
|
+
clone(): /*elided*/ any;
|
|
569
|
+
cacheKey(): number | string;
|
|
570
|
+
localCacheKey(): string;
|
|
571
|
+
fullCacheKey(): string;
|
|
572
|
+
create(attributes?: Record<string, any>, options?: object): Promise<{
|
|
573
|
+
model: /*elided*/ any;
|
|
574
|
+
response: object;
|
|
575
|
+
}>;
|
|
576
|
+
createRaw(rawData: FormData | Record<string, any>, options?: object): Promise<{
|
|
577
|
+
model: /*elided*/ any;
|
|
578
|
+
response: any;
|
|
579
|
+
}>;
|
|
580
|
+
destroy(): Promise<{
|
|
581
|
+
model: /*elided*/ any;
|
|
582
|
+
response: object;
|
|
583
|
+
}>;
|
|
584
|
+
ensureAbilities(listOfAbilities: string[]): Promise<void>;
|
|
585
|
+
getAttributes(): Record<string, any>;
|
|
586
|
+
handleResponseError(response: object): never;
|
|
587
|
+
identifierKey(): number | string;
|
|
588
|
+
_identifierKey: string | number;
|
|
589
|
+
isAssociationLoaded(associationName: string): boolean;
|
|
590
|
+
isAssociationLoadedUnderscore(associationNameUnderscore: string): boolean;
|
|
591
|
+
isAssociationPresent(associationName: string): boolean;
|
|
592
|
+
ensureAssociationLoaded(associationName: string): Promise<any>;
|
|
593
|
+
ensureAssociationLoadedUnderscore(associationNameUnderscore: string): Promise<any>;
|
|
594
|
+
isAttributeChanged(attributeName: string): boolean;
|
|
595
|
+
isChanged(): boolean;
|
|
596
|
+
isNewRecord(): boolean;
|
|
597
|
+
isPersisted(): boolean;
|
|
598
|
+
savedChangeToAttribute(attributeName: string): boolean;
|
|
599
|
+
setNewModel(model: /*elided*/ any): void;
|
|
600
|
+
setNewModelData(model: /*elided*/ any): void;
|
|
601
|
+
previousModelData: any;
|
|
602
|
+
_isDateChanged(oldValue: any, newValue: any): boolean | void;
|
|
603
|
+
_isIntegerChanged(oldValue: any, newValue: any): boolean | void;
|
|
604
|
+
_isStringChanged(oldValue: any, newValue: any): boolean | void;
|
|
605
|
+
modelClassData(): ModelClassDataType;
|
|
606
|
+
reload(): Promise<void>;
|
|
607
|
+
save(): Promise<{
|
|
608
|
+
model: /*elided*/ any;
|
|
609
|
+
response?: object;
|
|
610
|
+
}>;
|
|
611
|
+
saveRaw(rawData: any, options?: {}): Promise<{
|
|
612
|
+
model: /*elided*/ any;
|
|
613
|
+
response: object;
|
|
614
|
+
}>;
|
|
615
|
+
update(newAttributes?: Record<string, any>, options?: ParseValidationErrorsOptions): Promise<{
|
|
616
|
+
model: /*elided*/ any;
|
|
617
|
+
response?: object;
|
|
618
|
+
}>;
|
|
619
|
+
_refreshModelFromResponse(response: object): void;
|
|
620
|
+
_refreshModelDataFromResponse(response: object): void;
|
|
621
|
+
updateRaw(rawData: FormData | Record<string, any>, options?: ParseValidationErrorsOptions & {
|
|
622
|
+
simpleModelErrors?: boolean;
|
|
623
|
+
}): Promise<{
|
|
624
|
+
response: object;
|
|
625
|
+
model: /*elided*/ any;
|
|
626
|
+
}>;
|
|
627
|
+
isValid(): never;
|
|
628
|
+
isValidOnServer(): Promise<{
|
|
629
|
+
valid: boolean;
|
|
630
|
+
errors: Record<string, any>;
|
|
631
|
+
}>;
|
|
632
|
+
modelClass(): Record<string, any>;
|
|
633
|
+
preloadRelationship(relationshipName: string, model: /*elided*/ any | /*elided*/ any[] | null): void;
|
|
634
|
+
markForDestruction(): void;
|
|
635
|
+
_markedForDestruction: boolean;
|
|
636
|
+
markedForDestruction(): boolean;
|
|
637
|
+
uniqueKey(): number;
|
|
638
|
+
uniqueKeyValue: number;
|
|
639
|
+
_callMemberCommand(args: Record<string, any>, commandArgs: Record<string, any>): Promise<object>;
|
|
640
|
+
readAttribute(attributeName: string): any;
|
|
641
|
+
readAttributeUnderscore(attributeName: string): any;
|
|
642
|
+
isAttributeLoaded(attributeName: any): boolean;
|
|
643
|
+
_isPresent(value: any): boolean;
|
|
644
|
+
_loadBelongsToReflection(args: import("./collection.js").CollectionArgsType<any>, queryArgs?: import("./collection.js").QueryArgsType): Promise<any | null>;
|
|
645
|
+
_readBelongsToReflection({ reflectionName }: {
|
|
646
|
+
modelClass: any;
|
|
647
|
+
reflectionName: string;
|
|
648
|
+
}): any | null;
|
|
649
|
+
_loadHasManyReflection(args: import("./collection.js").CollectionArgsType<any>, queryArgs?: import("./collection.js").QueryArgsType): Promise<Array<any>>;
|
|
650
|
+
_loadHasOneReflection(args: import("./collection.js").CollectionArgsType<any>, queryArgs?: import("./collection.js").QueryArgsType): Promise<any>;
|
|
651
|
+
_readHasOneReflection({ reflectionName }: {
|
|
652
|
+
modelClass: any;
|
|
653
|
+
reflectionName: string;
|
|
654
|
+
}): any | null;
|
|
655
|
+
_readModelDataFromArgs(args?: {
|
|
656
|
+
data?: {
|
|
657
|
+
b?: Record<string, any>;
|
|
658
|
+
a?: Record<string, any>;
|
|
659
|
+
r?: any;
|
|
660
|
+
};
|
|
661
|
+
collection?: ApiMakerCollection<any>;
|
|
662
|
+
}): void;
|
|
663
|
+
collection: ApiMakerCollection<any>;
|
|
664
|
+
preloadedRelationships: any;
|
|
665
|
+
_readPreloadedRelationships(preloaded: {
|
|
666
|
+
getModel: (relationshipType: string, relationshipId: number | string) => /*elided*/ any;
|
|
667
|
+
}): void;
|
|
668
|
+
primaryKey(): number | string;
|
|
669
|
+
}) => void): any[];
|
|
115
670
|
/**
|
|
116
671
|
* @param {PreloadValue} preloadValue
|
|
117
672
|
* @returns {this}
|
|
@@ -198,7 +753,118 @@ export type ModelOf<MC extends typeof import("./base-model.js").default> = Insta
|
|
|
198
753
|
export type PreloadMap = Record<string, any>;
|
|
199
754
|
export type PreloadValue = string | Array<string | PreloadMap> | PreloadMap;
|
|
200
755
|
export type CollectionArgsType<MC extends typeof import("./base-model.js").default> = {
|
|
201
|
-
model?:
|
|
756
|
+
model?: {
|
|
757
|
+
changes: {};
|
|
758
|
+
newRecord: boolean;
|
|
759
|
+
relationshipsCache: {};
|
|
760
|
+
relationships: {};
|
|
761
|
+
abilities: Record<string, any>;
|
|
762
|
+
modelData: {};
|
|
763
|
+
assignAttributes(newAttributes: Record<string, any>): void;
|
|
764
|
+
attributes(): Record<string, any>;
|
|
765
|
+
can(givenAbilityName: string): boolean;
|
|
766
|
+
clone(): /*elided*/ any;
|
|
767
|
+
cacheKey(): number | string;
|
|
768
|
+
localCacheKey(): string;
|
|
769
|
+
fullCacheKey(): string;
|
|
770
|
+
create(attributes?: Record<string, any>, options?: object): Promise<{
|
|
771
|
+
model: /*elided*/ any;
|
|
772
|
+
response: object;
|
|
773
|
+
}>;
|
|
774
|
+
createRaw(rawData: FormData | Record<string, any>, options?: object): Promise<{
|
|
775
|
+
model: /*elided*/ any;
|
|
776
|
+
response: any;
|
|
777
|
+
}>;
|
|
778
|
+
destroy(): Promise<{
|
|
779
|
+
model: /*elided*/ any;
|
|
780
|
+
response: object;
|
|
781
|
+
}>;
|
|
782
|
+
ensureAbilities(listOfAbilities: string[]): Promise<void>;
|
|
783
|
+
getAttributes(): Record<string, any>;
|
|
784
|
+
handleResponseError(response: object): never;
|
|
785
|
+
identifierKey(): number | string;
|
|
786
|
+
_identifierKey: string | number;
|
|
787
|
+
isAssociationLoaded(associationName: string): boolean;
|
|
788
|
+
isAssociationLoadedUnderscore(associationNameUnderscore: string): boolean;
|
|
789
|
+
isAssociationPresent(associationName: string): boolean;
|
|
790
|
+
ensureAssociationLoaded(associationName: string): Promise<any>;
|
|
791
|
+
ensureAssociationLoadedUnderscore(associationNameUnderscore: string): Promise<any>;
|
|
792
|
+
isAttributeChanged(attributeName: string): boolean;
|
|
793
|
+
isChanged(): boolean;
|
|
794
|
+
isNewRecord(): boolean;
|
|
795
|
+
isPersisted(): boolean;
|
|
796
|
+
savedChangeToAttribute(attributeName: string): boolean;
|
|
797
|
+
setNewModel(model: /*elided*/ any): void;
|
|
798
|
+
setNewModelData(model: /*elided*/ any): void;
|
|
799
|
+
previousModelData: any;
|
|
800
|
+
_isDateChanged(oldValue: any, newValue: any): boolean | void;
|
|
801
|
+
_isIntegerChanged(oldValue: any, newValue: any): boolean | void;
|
|
802
|
+
_isStringChanged(oldValue: any, newValue: any): boolean | void;
|
|
803
|
+
modelClassData(): ModelClassDataType;
|
|
804
|
+
reload(): Promise<void>;
|
|
805
|
+
save(): Promise<{
|
|
806
|
+
model: /*elided*/ any;
|
|
807
|
+
response?: object;
|
|
808
|
+
}>;
|
|
809
|
+
saveRaw(rawData: any, options?: {}): Promise<{
|
|
810
|
+
model: /*elided*/ any;
|
|
811
|
+
response: object;
|
|
812
|
+
}>;
|
|
813
|
+
update(newAttributes?: Record<string, any>, options?: ParseValidationErrorsOptions): Promise<{
|
|
814
|
+
model: /*elided*/ any;
|
|
815
|
+
response?: object;
|
|
816
|
+
}>;
|
|
817
|
+
_refreshModelFromResponse(response: object): void;
|
|
818
|
+
_refreshModelDataFromResponse(response: object): void;
|
|
819
|
+
updateRaw(rawData: FormData | Record<string, any>, options?: ParseValidationErrorsOptions & {
|
|
820
|
+
simpleModelErrors?: boolean;
|
|
821
|
+
}): Promise<{
|
|
822
|
+
response: object;
|
|
823
|
+
model: /*elided*/ any;
|
|
824
|
+
}>;
|
|
825
|
+
isValid(): never;
|
|
826
|
+
isValidOnServer(): Promise<{
|
|
827
|
+
valid: boolean;
|
|
828
|
+
errors: Record<string, any>;
|
|
829
|
+
}>;
|
|
830
|
+
modelClass(): Record<string, any>;
|
|
831
|
+
preloadRelationship(relationshipName: string, model: /*elided*/ any | /*elided*/ any[] | null): void;
|
|
832
|
+
markForDestruction(): void;
|
|
833
|
+
_markedForDestruction: boolean;
|
|
834
|
+
markedForDestruction(): boolean;
|
|
835
|
+
uniqueKey(): number;
|
|
836
|
+
uniqueKeyValue: number;
|
|
837
|
+
_callMemberCommand(args: Record<string, any>, commandArgs: Record<string, any>): Promise<object>;
|
|
838
|
+
readAttribute(attributeName: string): any;
|
|
839
|
+
readAttributeUnderscore(attributeName: string): any;
|
|
840
|
+
isAttributeLoaded(attributeName: any): boolean;
|
|
841
|
+
_isPresent(value: any): boolean;
|
|
842
|
+
_loadBelongsToReflection(args: import("./collection.js").CollectionArgsType<any>, queryArgs?: import("./collection.js").QueryArgsType): Promise<any | null>;
|
|
843
|
+
_readBelongsToReflection({ reflectionName }: {
|
|
844
|
+
modelClass: any;
|
|
845
|
+
reflectionName: string;
|
|
846
|
+
}): any | null;
|
|
847
|
+
_loadHasManyReflection(args: import("./collection.js").CollectionArgsType<any>, queryArgs?: import("./collection.js").QueryArgsType): Promise<Array<any>>;
|
|
848
|
+
_loadHasOneReflection(args: import("./collection.js").CollectionArgsType<any>, queryArgs?: import("./collection.js").QueryArgsType): Promise<any>;
|
|
849
|
+
_readHasOneReflection({ reflectionName }: {
|
|
850
|
+
modelClass: any;
|
|
851
|
+
reflectionName: string;
|
|
852
|
+
}): any | null;
|
|
853
|
+
_readModelDataFromArgs(args?: {
|
|
854
|
+
data?: {
|
|
855
|
+
b?: Record<string, any>;
|
|
856
|
+
a?: Record<string, any>;
|
|
857
|
+
r?: any;
|
|
858
|
+
};
|
|
859
|
+
collection?: ApiMakerCollection<any>;
|
|
860
|
+
}): void;
|
|
861
|
+
collection: ApiMakerCollection<any>;
|
|
862
|
+
preloadedRelationships: any;
|
|
863
|
+
_readPreloadedRelationships(preloaded: {
|
|
864
|
+
getModel: (relationshipType: string, relationshipId: number | string) => /*elided*/ any;
|
|
865
|
+
}): void;
|
|
866
|
+
primaryKey(): number | string;
|
|
867
|
+
};
|
|
202
868
|
modelClass: MC;
|
|
203
869
|
reflectionName?: string;
|
|
204
870
|
};
|