@luminix/core 0.0.1-beta.9 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -28
- package/dist/core.js +1042 -1925
- package/package.json +5 -9
- package/types/contracts/Builder.d.ts +46 -0
- package/types/contracts/ModelCollection.d.ts +7 -0
- package/{dist → types}/contracts/Plugin.d.ts +3 -3
- package/{dist → types}/contracts/Relation/BelongsTo.d.ts +3 -5
- package/{dist → types}/contracts/Relation/BelongsToMany.d.ts +7 -9
- package/{dist → types}/contracts/Relation/HasMany.d.ts +6 -7
- package/{dist → types}/contracts/Relation/HasOne.d.ts +3 -4
- package/{dist → types}/contracts/Relation/HasOneOrMany.d.ts +0 -1
- package/{dist → types}/contracts/Relation/MorphMany.d.ts +6 -7
- package/{dist → types}/contracts/Relation/MorphOne.d.ts +3 -4
- package/{dist → types}/contracts/Relation/MorphOneOrMany.d.ts +0 -1
- package/{dist → types}/contracts/Relation/MorphTo.d.ts +0 -1
- package/types/contracts/Relation/MorphToMany.d.ts +8 -0
- package/{dist → types}/contracts/Relation.d.ts +12 -9
- package/types/extensions.d.ts +10 -0
- package/types/facades/App.d.ts +8 -0
- package/types/facades/Auth.d.ts +7 -0
- package/types/facades/Config.d.ts +7 -0
- package/types/facades/Error.d.ts +10 -0
- package/types/facades/Http.d.ts +8 -0
- package/types/facades/Log.d.ts +7 -0
- package/types/facades/Model.d.ts +8 -0
- package/types/facades/Route.d.ts +8 -0
- package/types/helpers/app.d.ts +4 -0
- package/{dist → types}/helpers/auth.d.ts +0 -1
- package/types/helpers/collect.d.ts +2 -0
- package/{dist → types}/helpers/config.d.ts +0 -1
- package/{dist → types}/helpers/error.d.ts +0 -1
- package/types/helpers/log.d.ts +5 -0
- package/{dist → types}/helpers/model.d.ts +2 -3
- package/{dist → types}/helpers/route.d.ts +2 -2
- package/types/index.d.ts +26 -0
- package/types/mixins/BaseModel.d.ts +7 -0
- package/types/providers/LuminixServiceProvider.d.ts +8 -0
- package/types/services/AuthService.d.ts +18 -0
- package/{dist/facades/Error.d.ts → types/services/ErrorService.d.ts} +2 -6
- package/types/services/HttpService.d.ts +21 -0
- package/{dist/facades/Log.d.ts → types/services/LogService.d.ts} +2 -4
- package/types/services/ModelService.d.ts +21 -0
- package/types/services/RouteService.d.ts +21 -0
- package/{dist → types}/support/model.d.ts +1 -1
- package/types/types/App.d.ts +88 -0
- package/{dist → types}/types/Auth.d.ts +0 -1
- package/types/types/Builder.d.ts +46 -0
- package/{dist → types}/types/Config.d.ts +4 -2
- package/types/types/Error.d.ts +17 -0
- package/types/types/Http.d.ts +20 -0
- package/{dist → types}/types/Model.d.ts +61 -43
- package/{dist → types}/types/Relation.d.ts +1 -3
- package/types/types/Route.d.ts +28 -0
- package/{dist → types}/types/Support.d.ts +3 -2
- package/.eslintignore +0 -3
- package/.eslintrc.cjs +0 -39
- package/dist/contracts/Builder.d.ts +0 -53
- package/dist/contracts/Collection.d.ts +0 -190
- package/dist/contracts/ModelCollection.d.ts +0 -9
- package/dist/contracts/PropertyBag.d.ts +0 -21
- package/dist/contracts/Relation/MorphToMany.d.ts +0 -16
- package/dist/facades/App.d.ts +0 -37
- package/dist/facades/Auth.d.ts +0 -14
- package/dist/facades/Model.d.ts +0 -41
- package/dist/facades/Route.d.ts +0 -32
- package/dist/helpers/app.d.ts +0 -5
- package/dist/helpers/collect.d.ts +0 -1
- package/dist/helpers/log.d.ts +0 -5
- package/dist/index.d.ts +0 -24
- package/dist/mixins/BaseModel.d.ts +0 -5
- package/dist/mixins/HasEvents.d.ts +0 -15
- package/dist/mixins/Reducible.d.ts +0 -17
- package/dist/support/collection.d.ts +0 -4
- package/dist/support/reader.d.ts +0 -2
- package/dist/support/searchParams.d.ts +0 -1
- package/dist/types/App.d.ts +0 -79
- package/dist/types/Builder.d.ts +0 -51
- package/dist/types/Collection.d.ts +0 -1804
- package/dist/types/Error.d.ts +0 -31
- package/dist/types/Event.d.ts +0 -14
- package/dist/types/PropertyBag.d.ts +0 -25
- package/dist/types/Reducer.d.ts +0 -17
- package/dist/types/Route.d.ts +0 -22
- package/index.html +0 -13
- package/jest.config.js +0 -15
- package/tsconfig.json +0 -25
- package/vite.config.js +0 -20
- /package/{dist → types}/exceptions/AttributeNotFillableException.d.ts +0 -0
- /package/{dist → types}/exceptions/FacadeNotFoundException.d.ts +0 -0
- /package/{dist → types}/exceptions/MethodNotImplementedException.d.ts +0 -0
- /package/{dist → types}/exceptions/ModelInvalidRelatedTypeException.d.ts +0 -0
- /package/{dist → types}/exceptions/ModelNotFoundException.d.ts +0 -0
- /package/{dist → types}/exceptions/ModelNotPersistedException.d.ts +0 -0
- /package/{dist → types}/exceptions/ModelWithoutPrimaryKeyException.d.ts +0 -0
- /package/{dist → types}/exceptions/NoEmbedException.d.ts +0 -0
- /package/{dist → types}/exceptions/NoInverseRelationException.d.ts +0 -0
- /package/{dist → types}/exceptions/NotModelException.d.ts +0 -0
- /package/{dist → types}/exceptions/NotReducibleException.d.ts +0 -0
- /package/{dist → types}/exceptions/ReducerOverrideException.d.ts +0 -0
- /package/{dist → types}/exceptions/RouteNotFoundException.d.ts +0 -0
- /package/{dist → types}/exceptions/UnsupportedRelationException.d.ts +0 -0
- /package/{dist → types}/types/Log.d.ts +0 -0
- /package/{dist → types}/types/Plugin.d.ts +0 -0
package/dist/types/Error.d.ts
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { default as PropertyBag } from '../contracts/PropertyBag';
|
|
2
|
-
import { Event, EventSource } from './Event';
|
|
3
|
-
import { PropertyBagEventMap } from './PropertyBag';
|
|
4
|
-
|
|
5
|
-
export type ErrorEventMap = {
|
|
6
|
-
change: (e: ErrorChangeEvent) => void;
|
|
7
|
-
};
|
|
8
|
-
export type ErrorChangeEvent = Event<ErrorFacade> & {
|
|
9
|
-
value: string | null;
|
|
10
|
-
key: string;
|
|
11
|
-
};
|
|
12
|
-
export type ErrorBag = EventSource<PropertyBagEventMap> & PropertyBag<Record<string, string>>;
|
|
13
|
-
export type ErrorFacade = {
|
|
14
|
-
add(key: string, value: string, bag?: string): void;
|
|
15
|
-
set(errors: Record<string, string>, bag?: string): void;
|
|
16
|
-
get(key: string, bag?: string): string | null;
|
|
17
|
-
all(bag?: string): Record<string, string>;
|
|
18
|
-
clear(bag?: string): void;
|
|
19
|
-
bag(name?: string): ErrorBag;
|
|
20
|
-
};
|
|
21
|
-
export type ValidationError = Error & {
|
|
22
|
-
response: {
|
|
23
|
-
status: 422;
|
|
24
|
-
data: {
|
|
25
|
-
message: string;
|
|
26
|
-
errors: {
|
|
27
|
-
[key: string]: string[];
|
|
28
|
-
};
|
|
29
|
-
};
|
|
30
|
-
};
|
|
31
|
-
};
|
package/dist/types/Event.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { Unsubscribe } from 'nanoevents';
|
|
2
|
-
|
|
3
|
-
export type Event<S = any> = {
|
|
4
|
-
source: S;
|
|
5
|
-
};
|
|
6
|
-
export type EventSourceEvents = {
|
|
7
|
-
[event: string]: (e: any) => void;
|
|
8
|
-
};
|
|
9
|
-
export type EventSource<T extends EventSourceEvents> = {
|
|
10
|
-
on<E extends keyof T>(event: E, callback: T[E]): Unsubscribe;
|
|
11
|
-
once<E extends keyof T>(event: E, callback: T[E]): void;
|
|
12
|
-
emit<E extends keyof T>(event: E, data?: EventData<T, E>): void;
|
|
13
|
-
};
|
|
14
|
-
export type EventData<T extends EventSourceEvents, E extends keyof T> = Omit<Parameters<T[E]>[0], 'source'>;
|
|
@@ -1,25 +0,0 @@
|
|
|
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
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { Collection } from './Collection';
|
|
2
|
-
|
|
3
|
-
export type ReducerCallback = (value: any, ...params: any[]) => any;
|
|
4
|
-
export interface Reducer {
|
|
5
|
-
callback: ReducerCallback;
|
|
6
|
-
priority: number;
|
|
7
|
-
}
|
|
8
|
-
export type Unsubscribe = () => void;
|
|
9
|
-
export type ReducibleInterface = {
|
|
10
|
-
reducer(name: string, callback: ReducerCallback, priority?: number): Unsubscribe;
|
|
11
|
-
removeReducer(name: string, callback: ReducerCallback): void;
|
|
12
|
-
getReducer(name: string): Collection<Reducer>;
|
|
13
|
-
hasReducer(name: string): boolean;
|
|
14
|
-
clearReducer(name: string): void;
|
|
15
|
-
flushReducers(): void;
|
|
16
|
-
[reducer: string]: unknown;
|
|
17
|
-
};
|
package/dist/types/Route.d.ts
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { AxiosRequestConfig, AxiosResponse } from 'axios';
|
|
2
|
-
import { ReducibleInterface } from './Reducer';
|
|
3
|
-
|
|
4
|
-
export type RouteReplacer = {
|
|
5
|
-
[key: string]: string | number;
|
|
6
|
-
};
|
|
7
|
-
export type RouteFacade = ReducibleInterface & {
|
|
8
|
-
get(name: string): RouteTuple;
|
|
9
|
-
url(generator: RouteGenerator): string;
|
|
10
|
-
exists(name: string): boolean;
|
|
11
|
-
call(generator: RouteGenerator, config?: RouteCallConfig): Promise<AxiosResponse>;
|
|
12
|
-
methods(generator: RouteGenerator): HttpMethod[];
|
|
13
|
-
};
|
|
14
|
-
export type RouteGenerator = string | [string, RouteReplacer];
|
|
15
|
-
export type HttpMethod = 'get' | 'post' | 'put' | 'patch' | 'delete';
|
|
16
|
-
export type RouteTuple = [string, ...HttpMethod[]];
|
|
17
|
-
export type RouteDefinition = {
|
|
18
|
-
[routeName: string]: RouteTuple | RouteDefinition;
|
|
19
|
-
};
|
|
20
|
-
export type RouteCallConfig = Omit<AxiosRequestConfig, 'url'> & {
|
|
21
|
-
errorBag?: string;
|
|
22
|
-
};
|
package/index.html
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
<!doctype html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="UTF-8" />
|
|
5
|
-
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
|
6
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
|
-
<title>Vite + TS</title>
|
|
8
|
-
</head>
|
|
9
|
-
<body>
|
|
10
|
-
<div id="app"></div>
|
|
11
|
-
<script type="module" src="/src/index.ts"></script>
|
|
12
|
-
</body>
|
|
13
|
-
</html>
|
package/jest.config.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
export default {
|
|
3
|
-
transform: {
|
|
4
|
-
// '^.+\\.ts?$': 'ts-jest',
|
|
5
|
-
// use babel for js
|
|
6
|
-
'^.+\\.js?$': 'babel-jest',
|
|
7
|
-
'^.+\\.ts?$': 'ts-jest',
|
|
8
|
-
},
|
|
9
|
-
testEnvironment: 'jsdom',
|
|
10
|
-
testRegex: '/tests/.*\\.(test|spec)?\\.(ts|tsx)$',
|
|
11
|
-
moduleFileExtensions: ['ts', 'js'],
|
|
12
|
-
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
|
package/tsconfig.json
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"target": "ESNext",
|
|
4
|
-
"useDefineForClassFields": true,
|
|
5
|
-
"module": "ESNext",
|
|
6
|
-
"lib": ["DOM", "DOM.Iterable", "ESNext"],
|
|
7
|
-
"skipLibCheck": false,
|
|
8
|
-
|
|
9
|
-
/* Bundler mode */
|
|
10
|
-
"moduleResolution": "Node",
|
|
11
|
-
"allowImportingTsExtensions": true,
|
|
12
|
-
"esModuleInterop": true,
|
|
13
|
-
"resolveJsonModule": true,
|
|
14
|
-
"isolatedModules": true,
|
|
15
|
-
"noEmit": true,
|
|
16
|
-
|
|
17
|
-
/* Linting */
|
|
18
|
-
"strict": true,
|
|
19
|
-
"noUnusedLocals": true,
|
|
20
|
-
"noUnusedParameters": true,
|
|
21
|
-
"noFallthroughCasesInSwitch": true,
|
|
22
|
-
},
|
|
23
|
-
"include": ["src"],
|
|
24
|
-
"exclude": ["node_modules", "dist", "tests"]
|
|
25
|
-
}
|
package/vite.config.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { defineConfig } from 'vite';
|
|
2
|
-
import { resolve } from 'path';
|
|
3
|
-
|
|
4
|
-
import dts from 'vite-plugin-dts';
|
|
5
|
-
|
|
6
|
-
import packageJson from './package.json';
|
|
7
|
-
|
|
8
|
-
export default defineConfig({
|
|
9
|
-
plugins: [dts({ insertTypesEntry: true })],
|
|
10
|
-
build: {
|
|
11
|
-
lib: {
|
|
12
|
-
entry: resolve(__dirname, 'src/index.ts'),
|
|
13
|
-
formats: ['es']
|
|
14
|
-
},
|
|
15
|
-
rollupOptions: {
|
|
16
|
-
external: Object.keys(packageJson.peerDependencies),
|
|
17
|
-
}
|
|
18
|
-
},
|
|
19
|
-
|
|
20
|
-
});
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|