@luminix/core 0.0.1-beta.0 → 0.0.1-beta.10
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/dist/contracts/Builder.d.ts +7 -3
- package/dist/contracts/Collection.d.ts +3 -4
- package/dist/contracts/ModelCollection.d.ts +2 -1
- package/dist/contracts/Plugin.d.ts +1 -0
- package/dist/contracts/PropertyBag.d.ts +4 -11
- package/dist/contracts/Relation/BelongsTo.d.ts +2 -1
- package/dist/contracts/Relation/BelongsToMany.d.ts +3 -2
- package/dist/contracts/Relation/HasMany.d.ts +3 -2
- package/dist/contracts/Relation/HasOne.d.ts +2 -1
- package/dist/contracts/Relation/HasOneOrMany.d.ts +2 -1
- package/dist/contracts/Relation/MorphMany.d.ts +3 -2
- package/dist/contracts/Relation/MorphOne.d.ts +2 -1
- package/dist/contracts/Relation/MorphOneOrMany.d.ts +2 -1
- package/dist/contracts/Relation/MorphTo.d.ts +2 -1
- package/dist/contracts/Relation/MorphToMany.d.ts +2 -1
- package/dist/contracts/Relation.d.ts +1 -0
- package/dist/core.js +1531 -1460
- package/dist/exceptions/AttributeNotFillableException.d.ts +1 -1
- package/dist/exceptions/FacadeNotFoundException.d.ts +1 -1
- package/dist/exceptions/MethodNotImplementedException.d.ts +1 -1
- package/dist/exceptions/ModelInvalidRelatedTypeException.d.ts +1 -1
- package/dist/exceptions/ModelNotFoundException.d.ts +1 -1
- package/dist/exceptions/ModelNotPersistedException.d.ts +1 -1
- package/dist/exceptions/ModelWithoutPrimaryKeyException.d.ts +1 -1
- package/dist/exceptions/NoEmbedException.d.ts +1 -1
- package/dist/exceptions/NoInverseRelationException.d.ts +1 -1
- package/dist/exceptions/NotModelException.d.ts +1 -1
- package/dist/exceptions/NotReducibleException.d.ts +1 -1
- package/dist/exceptions/ReducerOverrideException.d.ts +1 -1
- package/dist/exceptions/RouteNotFoundException.d.ts +1 -1
- package/dist/exceptions/UnsupportedRelationException.d.ts +1 -1
- package/dist/facades/App.d.ts +11 -4
- package/dist/facades/Auth.d.ts +1 -0
- package/dist/facades/Error.d.ts +2 -1
- package/dist/facades/Log.d.ts +1 -0
- package/dist/facades/Model.d.ts +4 -4
- package/dist/facades/Route.d.ts +6 -5
- package/dist/helpers/app.d.ts +1 -0
- package/dist/helpers/auth.d.ts +3 -1
- package/dist/helpers/collect.d.ts +1 -1
- package/dist/helpers/config.d.ts +1 -0
- package/dist/helpers/error.d.ts +1 -0
- package/dist/helpers/log.d.ts +1 -0
- package/dist/helpers/model.d.ts +1 -0
- package/dist/helpers/route.d.ts +1 -0
- package/dist/index.d.ts +11 -10
- package/dist/mixins/BaseModel.d.ts +3 -2
- package/dist/mixins/HasEvents.d.ts +3 -3
- package/dist/mixins/Reducible.d.ts +1 -0
- package/dist/support/collection.d.ts +1 -0
- package/dist/support/model.d.ts +1 -0
- package/dist/types/App.d.ts +8 -0
- package/dist/types/Auth.d.ts +1 -0
- package/dist/types/Builder.d.ts +7 -1
- package/dist/types/Collection.d.ts +1 -0
- package/dist/types/Config.d.ts +2 -1
- package/dist/types/Error.d.ts +3 -1
- package/dist/types/Event.d.ts +1 -0
- package/dist/types/Model.d.ts +32 -7
- package/dist/types/PropertyBag.d.ts +25 -0
- package/dist/types/Reducer.d.ts +1 -0
- package/dist/types/Relation.d.ts +1 -0
- package/dist/types/Route.d.ts +1 -0
- package/package.json +4 -3
- package/vite.config.js +3 -1
- package/graph.png +0 -0
package/dist/facades/App.d.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { AppFacades, AppFacade, AppEvents } from '../types/App';
|
|
2
|
-
import Plugin from '../contracts/Plugin';
|
|
2
|
+
import { default as Plugin } from '../contracts/Plugin';
|
|
3
3
|
import { AppConfiguration } from '../types/Config';
|
|
4
4
|
import { Unsubscribe } from 'nanoevents';
|
|
5
|
+
import { Constructor } from '../types/Support';
|
|
6
|
+
|
|
5
7
|
declare class App implements AppFacade {
|
|
6
8
|
private facades;
|
|
7
9
|
private booted;
|
|
@@ -12,19 +14,24 @@ declare class App implements AppFacade {
|
|
|
12
14
|
bind<K extends keyof AppFacades>(key: K, facade: AppFacades[K]): void;
|
|
13
15
|
plugins(): Plugin[];
|
|
14
16
|
boot(configObject?: AppConfiguration): Promise<AppFacades>;
|
|
17
|
+
environment(): string;
|
|
18
|
+
environment(...environments: string[]): boolean;
|
|
19
|
+
getPlugin<T extends Plugin>(abstract: Constructor<T>): T | undefined;
|
|
20
|
+
hasDebugModeEnabled(): boolean;
|
|
21
|
+
isLocal(): boolean;
|
|
22
|
+
isProduction(): boolean;
|
|
15
23
|
on<E extends keyof AppEvents>(_: E, __: AppEvents[E]): Unsubscribe;
|
|
16
24
|
once<E extends keyof AppEvents>(_: E, __: AppEvents[E]): void;
|
|
17
25
|
emit<E extends keyof AppEvents>(_: E, __?: Omit<Parameters<AppEvents[E]>[0], 'source'>): void;
|
|
18
26
|
}
|
|
19
27
|
declare const _default: {
|
|
20
28
|
new (...args: any[]): {
|
|
21
|
-
|
|
22
|
-
"__#1@#createNanoEvents"(): import(
|
|
29
|
+
emitter: import('nanoevents').Emitter<import('../types/Event').EventSourceEvents>;
|
|
30
|
+
"__#1@#createNanoEvents"(): import('nanoevents').Emitter<import('../types/Event').EventSourceEvents>;
|
|
23
31
|
on<E extends keyof AppEvents>(event: E, callback: AppEvents[E]): Unsubscribe;
|
|
24
32
|
once<E_1 extends keyof AppEvents>(event: E_1, callback: AppEvents[E_1]): void;
|
|
25
33
|
emit<E_2 extends keyof AppEvents>(event: E_2, data?: Omit<Parameters<AppEvents[E_2]>[0], "source">): void;
|
|
26
34
|
[Symbol.toStringTag]: string;
|
|
27
35
|
};
|
|
28
|
-
name: string;
|
|
29
36
|
} & typeof App;
|
|
30
37
|
export default _default;
|
package/dist/facades/Auth.d.ts
CHANGED
package/dist/facades/Error.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import PropertyBag from '../contracts/PropertyBag';
|
|
1
|
+
import { default as PropertyBag } from '../contracts/PropertyBag';
|
|
2
2
|
import { ErrorFacade, ValidationError } from '../types/Error';
|
|
3
|
+
|
|
3
4
|
export declare const isValidationError: (error: unknown) => error is ValidationError;
|
|
4
5
|
declare class Error implements ErrorFacade {
|
|
5
6
|
private bags;
|
package/dist/facades/Log.d.ts
CHANGED
package/dist/facades/Model.d.ts
CHANGED
|
@@ -3,10 +3,11 @@ import { AppFacade, GlobalModelEvents, ModelFacade as ModelFacadeInterface } fro
|
|
|
3
3
|
import { Unsubscribe } from 'nanoevents';
|
|
4
4
|
import { Reducer, ReducerCallback, Unsubscribe as UnsubscribeReducer } from '../types/Reducer';
|
|
5
5
|
import { Collection } from '../contracts/Collection';
|
|
6
|
+
|
|
6
7
|
declare class ModelFacade implements ModelFacadeInterface {
|
|
7
8
|
private readonly _schema;
|
|
8
9
|
private _models;
|
|
9
|
-
|
|
10
|
+
[Symbol.toStringTag]: string;
|
|
10
11
|
constructor(_schema: ModelSchema);
|
|
11
12
|
boot(app: AppFacade): void;
|
|
12
13
|
schema(): ModelSchema;
|
|
@@ -29,13 +30,12 @@ declare class ModelFacade implements ModelFacadeInterface {
|
|
|
29
30
|
}
|
|
30
31
|
declare const _default: {
|
|
31
32
|
new (...args: any[]): {
|
|
32
|
-
|
|
33
|
-
"__#1@#createNanoEvents"(): import(
|
|
33
|
+
emitter: import('nanoevents').Emitter<import('../types/Event').EventSourceEvents>;
|
|
34
|
+
"__#1@#createNanoEvents"(): import('nanoevents').Emitter<import('../types/Event').EventSourceEvents>;
|
|
34
35
|
on<E extends keyof GlobalModelEvents>(event: E, callback: GlobalModelEvents[E]): Unsubscribe;
|
|
35
36
|
once<E_1 extends keyof GlobalModelEvents>(event: E_1, callback: GlobalModelEvents[E_1]): void;
|
|
36
37
|
emit<E_2 extends keyof GlobalModelEvents>(event: E_2, data?: Omit<Parameters<GlobalModelEvents[E_2]>[0], "source">): void;
|
|
37
38
|
[Symbol.toStringTag]: string;
|
|
38
39
|
};
|
|
39
|
-
name: string;
|
|
40
40
|
} & typeof ModelFacade;
|
|
41
41
|
export default _default;
|
package/dist/facades/Route.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { RouteDefinition, RouteTuple as RouteTuple, HttpMethod, RouteGenerator, RouteCallConfig } from '../types/Route';
|
|
2
2
|
import { ErrorFacade } from '../types/Error';
|
|
3
|
+
|
|
3
4
|
declare class Route {
|
|
4
5
|
private routes;
|
|
5
6
|
private error;
|
|
@@ -11,18 +12,18 @@ declare class Route {
|
|
|
11
12
|
url(generator: RouteGenerator): string;
|
|
12
13
|
methods(generator: RouteGenerator): HttpMethod[];
|
|
13
14
|
exists(name: string): boolean;
|
|
14
|
-
call(generator: RouteGenerator, config?: RouteCallConfig): Promise<import(
|
|
15
|
+
call(generator: RouteGenerator, config?: RouteCallConfig): Promise<import('axios').AxiosResponse<any, any>>;
|
|
15
16
|
toString(): string;
|
|
16
17
|
[reducer: string]: unknown;
|
|
17
18
|
}
|
|
18
19
|
declare const _default: {
|
|
19
20
|
new (...args: any[]): {
|
|
20
21
|
reducers: {
|
|
21
|
-
[name: string]: import(
|
|
22
|
+
[name: string]: import('../types/Collection').Collection<import('../types/Reducer').Reducer>;
|
|
22
23
|
};
|
|
23
|
-
reducer(name: string, callback: import(
|
|
24
|
-
removeReducer(name: string, callback: import(
|
|
25
|
-
getReducer(name: string): import(
|
|
24
|
+
reducer(name: string, callback: import('../types/Reducer').ReducerCallback, priority?: number): () => void;
|
|
25
|
+
removeReducer(name: string, callback: import('../types/Reducer').ReducerCallback): void;
|
|
26
|
+
getReducer(name: string): import('../types/Collection').Collection<import('../types/Reducer').Reducer>;
|
|
26
27
|
hasReducer(name: string): boolean;
|
|
27
28
|
clearReducer(name: string): void;
|
|
28
29
|
flushReducers(): void;
|
package/dist/helpers/app.d.ts
CHANGED
package/dist/helpers/auth.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export default function collect<T = unknown>(items: T[]): import(
|
|
1
|
+
export default function collect<T = unknown>(items: T[]): import('../types/Collection').Collection<T>;
|
package/dist/helpers/config.d.ts
CHANGED
package/dist/helpers/error.d.ts
CHANGED
package/dist/helpers/log.d.ts
CHANGED
package/dist/helpers/model.d.ts
CHANGED
package/dist/helpers/route.d.ts
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -1,18 +1,19 @@
|
|
|
1
|
-
import app from './helpers/app';
|
|
2
|
-
import auth from './helpers/auth';
|
|
3
|
-
import collect from './helpers/collect';
|
|
4
|
-
import config from './helpers/config';
|
|
5
|
-
import error from './helpers/error';
|
|
6
|
-
import log from './helpers/log';
|
|
7
|
-
import model from './helpers/model';
|
|
8
|
-
import route from './helpers/route';
|
|
1
|
+
import { default as app } from './helpers/app';
|
|
2
|
+
import { default as auth } from './helpers/auth';
|
|
3
|
+
import { default as collect } from './helpers/collect';
|
|
4
|
+
import { default as config } from './helpers/config';
|
|
5
|
+
import { default as error } from './helpers/error';
|
|
6
|
+
import { default as log } from './helpers/log';
|
|
7
|
+
import { default as model } from './helpers/model';
|
|
8
|
+
import { default as route } from './helpers/route';
|
|
9
9
|
import { isValidationError } from './facades/Error';
|
|
10
|
-
import Plugin from './contracts/Plugin';
|
|
11
|
-
import PropertyBag from './contracts/PropertyBag';
|
|
10
|
+
import { default as Plugin } from './contracts/Plugin';
|
|
11
|
+
import { default as PropertyBag } from './contracts/PropertyBag';
|
|
12
12
|
import { isModel } from './support/model';
|
|
13
13
|
import { isCollection } from './support/collection';
|
|
14
14
|
import { Reducible } from './mixins/Reducible';
|
|
15
15
|
import { HasEvents } from './mixins/HasEvents';
|
|
16
|
+
|
|
16
17
|
export { app, auth, collect, config, error, log, model, route, isCollection, isValidationError, isModel, Plugin, PropertyBag, Reducible, HasEvents, };
|
|
17
18
|
export type { AppFacade } from './types/App';
|
|
18
19
|
export type { AuthFacade } from './types/Auth';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { BaseModel, Model as ModelInterface } from '../types/Model';
|
|
2
|
-
import { AppFacades } from '../types/App';
|
|
3
|
-
|
|
2
|
+
import { AppFacade, AppFacades } from '../types/App';
|
|
3
|
+
|
|
4
|
+
export declare function BaseModelFactory(app: AppFacade, abstract: string): typeof BaseModel;
|
|
4
5
|
export declare function ModelFactory(facades: AppFacades, abstract: string, CustomModel: typeof BaseModel): typeof ModelInterface;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { Emitter } from 'nanoevents';
|
|
2
2
|
import { EventSourceEvents, EventSource } from '../types/Event';
|
|
3
3
|
import { Constructor } from '../types/Support';
|
|
4
|
+
|
|
4
5
|
export declare function isEventSource<T>(value: T): value is T & EventSource<any>;
|
|
5
6
|
export declare function HasEvents<T extends EventSourceEvents, U extends Constructor>(Base: U): {
|
|
6
7
|
new (...args: any[]): {
|
|
7
|
-
|
|
8
|
+
emitter: Emitter<EventSourceEvents>;
|
|
8
9
|
"__#1@#createNanoEvents"(): Emitter<EventSourceEvents>;
|
|
9
|
-
on<E extends keyof T>(event: E, callback: T[E]): import(
|
|
10
|
+
on<E extends keyof T>(event: E, callback: T[E]): import('nanoevents').Unsubscribe;
|
|
10
11
|
once<E_1 extends keyof T>(event: E_1, callback: T[E_1]): void;
|
|
11
12
|
emit<E_2 extends keyof T>(event: E_2, data?: Omit<Parameters<T[E_2]>[0], "source">): void;
|
|
12
13
|
[Symbol.toStringTag]: string;
|
|
13
14
|
};
|
|
14
|
-
name: string;
|
|
15
15
|
} & U;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ReducerCallback, Reducer } from '../types/Reducer';
|
|
2
2
|
import { Constructor } from '../types/Support';
|
|
3
3
|
import { Collection } from '../types/Collection';
|
|
4
|
+
|
|
4
5
|
export declare function Reducible<T extends Constructor>(Base: T): {
|
|
5
6
|
new (...args: any[]): {
|
|
6
7
|
reducers: {
|
package/dist/support/model.d.ts
CHANGED
package/dist/types/App.d.ts
CHANGED
|
@@ -7,6 +7,8 @@ import { RouteFacade } from './Route';
|
|
|
7
7
|
import { EventSource, Event } from './Event';
|
|
8
8
|
import { ErrorFacade } from './Error';
|
|
9
9
|
import { ReducibleInterface } from './Reducer';
|
|
10
|
+
import { Constructor } from './Support';
|
|
11
|
+
|
|
10
12
|
type Plugin = PluginInterface<AppFacade, AppFacades>;
|
|
11
13
|
export type GlobalModelEvents = {
|
|
12
14
|
'save': (e: ModelGlobalEvent) => void;
|
|
@@ -47,6 +49,12 @@ export type AppExternal = {
|
|
|
47
49
|
make<T extends keyof AppFacades>(key: T): AppFacades[T];
|
|
48
50
|
plugins: () => Plugin[];
|
|
49
51
|
on: EventSource<AppEvents>['once'];
|
|
52
|
+
environment(): string;
|
|
53
|
+
environment(...environments: string[]): boolean;
|
|
54
|
+
getPlugin<T extends Plugin>(abstract: Constructor<T>): T | undefined;
|
|
55
|
+
hasDebugModeEnabled(): boolean;
|
|
56
|
+
isLocal(): boolean;
|
|
57
|
+
isProduction(): boolean;
|
|
50
58
|
};
|
|
51
59
|
export type AppFacade = AppExternal & {
|
|
52
60
|
has(key: string): boolean;
|
package/dist/types/Auth.d.ts
CHANGED
package/dist/types/Builder.d.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { default as PropertyBag } from '../contracts/PropertyBag';
|
|
2
2
|
import { Event, EventSource } from './Event';
|
|
3
3
|
import { JsonObject, JsonValue } from './Support';
|
|
4
4
|
import { Operator, Collection } from './Collection';
|
|
5
|
+
import { PropertyBagEventMap } from './PropertyBag';
|
|
6
|
+
|
|
5
7
|
export type Scope<R, C> = (builder: BuilderInterface<R, C>) => BuilderInterface<R, C> | void;
|
|
6
8
|
export type ExtendedOperator = Operator | 'like' | 'notLike' | 'between' | 'notBetween' | 'isNull' | 'isNotNull';
|
|
7
9
|
export type BuilderInterface<R, C> = EventSource<BuilderEventMap<R, C>> & {
|
|
@@ -10,6 +12,9 @@ export type BuilderInterface<R, C> = EventSource<BuilderEventMap<R, C>> & {
|
|
|
10
12
|
where(key: string, value: JsonValue): BuilderInterface<R, C>;
|
|
11
13
|
where(key: string, operator: ExtendedOperator, value: JsonValue): BuilderInterface<R, C>;
|
|
12
14
|
where(key: string | Scope<R, C>, operatorOrValue?: ExtendedOperator | JsonValue, value?: JsonValue): BuilderInterface<R, C>;
|
|
15
|
+
with(relation: string | string[]): BuilderInterface<R, C>;
|
|
16
|
+
withOnly(relation: string | string[]): BuilderInterface<R, C>;
|
|
17
|
+
without(relation: string | string[]): BuilderInterface<R, C>;
|
|
13
18
|
whereNull(key: string): BuilderInterface<R, C>;
|
|
14
19
|
whereNotNull(key: string): BuilderInterface<R, C>;
|
|
15
20
|
whereBetween(key: string, value: [JsonValue, JsonValue]): BuilderInterface<R, C>;
|
|
@@ -18,6 +23,7 @@ export type BuilderInterface<R, C> = EventSource<BuilderEventMap<R, C>> & {
|
|
|
18
23
|
searchBy(term: string): BuilderInterface<R, C>;
|
|
19
24
|
minified(): BuilderInterface<R, C>;
|
|
20
25
|
limit(value: number): BuilderInterface<R, C>;
|
|
26
|
+
include(searchParams: URLSearchParams): BuilderInterface<R, C>;
|
|
21
27
|
get(page?: number, replaceLinksWith?: string): Promise<C>;
|
|
22
28
|
all(): Promise<Collection<R>>;
|
|
23
29
|
first(): Promise<R | null>;
|
package/dist/types/Config.d.ts
CHANGED
package/dist/types/Error.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { default as PropertyBag } from '../contracts/PropertyBag';
|
|
2
2
|
import { Event, EventSource } from './Event';
|
|
3
|
+
import { PropertyBagEventMap } from './PropertyBag';
|
|
4
|
+
|
|
3
5
|
export type ErrorEventMap = {
|
|
4
6
|
change: (e: ErrorChangeEvent) => void;
|
|
5
7
|
};
|
package/dist/types/Event.d.ts
CHANGED
package/dist/types/Model.d.ts
CHANGED
|
@@ -3,6 +3,8 @@ import { EventSource, Event } from './Event';
|
|
|
3
3
|
import { Collection } from './Collection';
|
|
4
4
|
import { RelationInterface, BuilderInterface, Scope, ExtendedOperator } from './Relation';
|
|
5
5
|
import { JsonObject, JsonValue } from './Support';
|
|
6
|
+
import { RouteGenerator } from './Route';
|
|
7
|
+
|
|
6
8
|
export type RelationRepository = Record<string, RelationInterface<Model, ModelPaginatedResponse>>;
|
|
7
9
|
export type ModelEvents = {
|
|
8
10
|
'change': (e: ModelChangeEvent) => void;
|
|
@@ -44,18 +46,25 @@ export declare class BaseModel implements EventSource<ModelEvents> {
|
|
|
44
46
|
setAttribute(key: string, value: unknown): void;
|
|
45
47
|
getKey(): string | number;
|
|
46
48
|
getKeyName(): string;
|
|
47
|
-
fill(attributes:
|
|
49
|
+
fill(attributes: object): void;
|
|
48
50
|
toJson(): JsonObject;
|
|
49
51
|
diff(): JsonObject;
|
|
50
52
|
getType(): string;
|
|
51
53
|
dump(): void;
|
|
52
|
-
save(options?: ModelSaveOptions): Promise<AxiosResponse
|
|
54
|
+
save(options?: ModelSaveOptions): Promise<AxiosResponse | void>;
|
|
53
55
|
update(attributes: JsonObject): Promise<void>;
|
|
54
|
-
delete(): Promise<AxiosResponse
|
|
55
|
-
forceDelete(): Promise<AxiosResponse
|
|
56
|
-
restore(): Promise<AxiosResponse
|
|
56
|
+
delete(): Promise<AxiosResponse>;
|
|
57
|
+
forceDelete(): Promise<AxiosResponse>;
|
|
58
|
+
restore(): Promise<AxiosResponse>;
|
|
57
59
|
refresh(): Promise<void>;
|
|
58
60
|
relation(relationName: string): RelationInterface<Model, ModelPaginatedResponse> | undefined;
|
|
61
|
+
getErrorBag(method: string): string;
|
|
62
|
+
getRouteForSave(): RouteGenerator;
|
|
63
|
+
getRouteForUpdate(): RouteGenerator;
|
|
64
|
+
getRouteForDelete(): RouteGenerator;
|
|
65
|
+
getRouteForRestore(): RouteGenerator;
|
|
66
|
+
getRouteForForceDelete(): RouteGenerator;
|
|
67
|
+
getRouteForRefresh(): RouteGenerator;
|
|
59
68
|
static getSchemaName(): string;
|
|
60
69
|
static getSchema(): ModelSchemaAttributes;
|
|
61
70
|
static query(): BuilderInterface<Model, ModelPaginatedResponse>;
|
|
@@ -90,7 +99,7 @@ export declare class BaseModel implements EventSource<ModelEvents> {
|
|
|
90
99
|
}
|
|
91
100
|
export declare class Model extends BaseModel {
|
|
92
101
|
[key: string]: any;
|
|
93
|
-
|
|
102
|
+
[Symbol.toStringTag]: string;
|
|
94
103
|
}
|
|
95
104
|
export interface ModelSaveOptions {
|
|
96
105
|
additionalPayload?: object;
|
|
@@ -106,6 +115,21 @@ export interface ModelTableColumnDefinition {
|
|
|
106
115
|
sortable?: boolean;
|
|
107
116
|
}
|
|
108
117
|
export interface ModelSchemaAttributes {
|
|
118
|
+
attributes: {
|
|
119
|
+
appended: true | null;
|
|
120
|
+
cast: string | null;
|
|
121
|
+
default: string | null;
|
|
122
|
+
fillable: boolean;
|
|
123
|
+
hidden: boolean;
|
|
124
|
+
increments: boolean;
|
|
125
|
+
name: string;
|
|
126
|
+
nullable: boolean;
|
|
127
|
+
phpType: string | null;
|
|
128
|
+
primary: boolean;
|
|
129
|
+
type: string | null;
|
|
130
|
+
unique: boolean;
|
|
131
|
+
virtual: boolean;
|
|
132
|
+
}[];
|
|
109
133
|
displayName: {
|
|
110
134
|
singular: string;
|
|
111
135
|
plural: string;
|
|
@@ -116,6 +140,7 @@ export interface ModelSchemaAttributes {
|
|
|
116
140
|
primaryKey: string;
|
|
117
141
|
timestamps: boolean;
|
|
118
142
|
labeledBy: string;
|
|
143
|
+
[key: string]: any;
|
|
119
144
|
}
|
|
120
145
|
export interface RelationMetaData {
|
|
121
146
|
model: string;
|
|
@@ -131,7 +156,7 @@ export type ModelQuery = JsonObject & {
|
|
|
131
156
|
page?: number;
|
|
132
157
|
per_page?: number;
|
|
133
158
|
order_by?: string;
|
|
134
|
-
|
|
159
|
+
where?: JsonObject;
|
|
135
160
|
tab?: string;
|
|
136
161
|
minified?: boolean;
|
|
137
162
|
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Unsubscribe } from 'nanoevents';
|
|
2
|
+
import { Event } from './Event';
|
|
3
|
+
|
|
4
|
+
export type PropertyBagChangeEvent<T extends object> = Event<PropertyBag<T>> & {
|
|
5
|
+
path: string;
|
|
6
|
+
value: unknown;
|
|
7
|
+
type: 'set' | 'merge' | 'delete';
|
|
8
|
+
};
|
|
9
|
+
export type PropertyBagEventMap<T extends object = any> = {
|
|
10
|
+
'change': (e: PropertyBagChangeEvent<T>) => void;
|
|
11
|
+
};
|
|
12
|
+
export type PropertyBag<T extends object> = {
|
|
13
|
+
get(path: string, defaultValue?: unknown): unknown;
|
|
14
|
+
set(path: string, value: unknown): void;
|
|
15
|
+
merge(path: string, value: unknown): void;
|
|
16
|
+
has(path: string): boolean;
|
|
17
|
+
delete(path: string): void;
|
|
18
|
+
lock(path: string): void;
|
|
19
|
+
clone(): PropertyBag<T>;
|
|
20
|
+
all(): T;
|
|
21
|
+
isEmpty(): boolean;
|
|
22
|
+
on<K extends keyof PropertyBagEventMap<T>>(event: K, callback: PropertyBagEventMap<T>[K]): Unsubscribe;
|
|
23
|
+
once<K extends keyof PropertyBagEventMap<T>>(event: K, callback: PropertyBagEventMap<T>[K]): void;
|
|
24
|
+
emit<K extends keyof PropertyBagEventMap<T>>(event: K, payload: Omit<Parameters<PropertyBagEventMap<T>[K]>[0], 'source'>): void;
|
|
25
|
+
};
|
package/dist/types/Reducer.d.ts
CHANGED
package/dist/types/Relation.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { BuilderInterface, ExtendedOperator, Scope } from './Builder';
|
|
2
2
|
import { Collection } from './Collection';
|
|
3
3
|
import { Constructor, JsonValue } from './Support';
|
|
4
|
+
|
|
4
5
|
export type { BuilderInterface, ExtendedOperator, Scope, };
|
|
5
6
|
export type RelationInterface<R, C> = {
|
|
6
7
|
guessInverseRelation(): string;
|
package/dist/types/Route.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@luminix/core",
|
|
3
|
-
"version": "0.0.1-beta.
|
|
3
|
+
"version": "0.0.1-beta.10",
|
|
4
4
|
"description": "> Projeto em desenvolvimento",
|
|
5
5
|
"main": "dist/core.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -11,7 +11,8 @@
|
|
|
11
11
|
"lint:fix": "eslint ./src ./tests --ext .ts --fix",
|
|
12
12
|
"test": "jest",
|
|
13
13
|
"test:coverage": "jest --coverage",
|
|
14
|
-
"ci": "npm run lint && npm run test"
|
|
14
|
+
"ci": "npm run lint && npm run test",
|
|
15
|
+
"publish:beta": "npm run build && npm publish --tag beta"
|
|
15
16
|
},
|
|
16
17
|
"author": "",
|
|
17
18
|
"license": "MIT",
|
|
@@ -28,7 +29,7 @@
|
|
|
28
29
|
"ts-jest": "^29.1.2",
|
|
29
30
|
"typescript": "^5.3.3",
|
|
30
31
|
"vite": "^5.0.12",
|
|
31
|
-
"vite-plugin-dts": "^
|
|
32
|
+
"vite-plugin-dts": "^4.0.0-beta.1"
|
|
32
33
|
},
|
|
33
34
|
"peerDependencies": {
|
|
34
35
|
"axios": "^1.6.4",
|