@luminix/core 0.0.1-beta.2 → 0.0.1-beta.21
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 +5 -3
- package/dist/contracts/Collection.d.ts +4 -6
- package/dist/contracts/ModelCollection.d.ts +1 -2
- package/dist/contracts/Plugin.d.ts +0 -1
- package/dist/contracts/PropertyBag.d.ts +0 -1
- package/dist/contracts/Relation/BelongsTo.d.ts +0 -1
- package/dist/contracts/Relation/BelongsToMany.d.ts +0 -1
- package/dist/contracts/Relation/HasMany.d.ts +0 -1
- package/dist/contracts/Relation/HasOne.d.ts +0 -1
- package/dist/contracts/Relation/HasOneOrMany.d.ts +0 -1
- package/dist/contracts/Relation/MorphMany.d.ts +0 -1
- package/dist/contracts/Relation/MorphOne.d.ts +0 -1
- package/dist/contracts/Relation/MorphOneOrMany.d.ts +0 -1
- package/dist/contracts/Relation/MorphTo.d.ts +0 -1
- package/dist/contracts/Relation/MorphToMany.d.ts +0 -1
- package/dist/contracts/Relation.d.ts +0 -1
- package/dist/core.js +906 -825
- package/dist/core.umd.cjs +4 -0
- 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 +9 -3
- package/dist/facades/Auth.d.ts +0 -1
- package/dist/facades/Error.d.ts +0 -1
- package/dist/facades/Log.d.ts +0 -1
- package/dist/facades/Model.d.ts +2 -4
- package/dist/facades/Route.d.ts +0 -1
- package/dist/helpers/app.d.ts +0 -1
- package/dist/helpers/auth.d.ts +0 -1
- package/dist/helpers/config.d.ts +0 -1
- package/dist/helpers/error.d.ts +0 -1
- package/dist/helpers/log.d.ts +0 -1
- package/dist/helpers/model.d.ts +0 -1
- package/dist/helpers/route.d.ts +0 -1
- package/dist/index.d.ts +2 -2
- package/dist/mixins/BaseModel.d.ts +2 -3
- package/dist/mixins/HasEvents.d.ts +1 -3
- package/dist/mixins/Reducible.d.ts +0 -1
- package/dist/support/collection.d.ts +0 -1
- package/dist/support/model.d.ts +0 -1
- package/dist/types/App.d.ts +10 -2
- package/dist/types/Auth.d.ts +0 -1
- package/dist/types/Builder.d.ts +4 -1
- package/dist/types/Collection.d.ts +3 -4
- package/dist/types/Config.d.ts +3 -1
- package/dist/types/Error.d.ts +0 -1
- package/dist/types/Event.d.ts +0 -1
- package/dist/types/Model.d.ts +32 -7
- package/dist/types/PropertyBag.d.ts +0 -1
- package/dist/types/Reducer.d.ts +0 -1
- package/dist/types/Relation.d.ts +0 -1
- package/dist/types/Route.d.ts +0 -1
- package/package.json +5 -3
- package/vite.config.js +5 -2
- package/graph.png +0 -0
package/dist/types/Model.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ 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
|
-
|
|
6
|
+
import { RouteGenerator } from './Route';
|
|
7
7
|
export type RelationRepository = Record<string, RelationInterface<Model, ModelPaginatedResponse>>;
|
|
8
8
|
export type ModelEvents = {
|
|
9
9
|
'change': (e: ModelChangeEvent) => void;
|
|
@@ -41,22 +41,29 @@ export declare class BaseModel implements EventSource<ModelEvents> {
|
|
|
41
41
|
get isDirty(): boolean;
|
|
42
42
|
get casts(): ModelSchemaAttributes['casts'];
|
|
43
43
|
exists: boolean;
|
|
44
|
+
wasRecentlyCreated: boolean;
|
|
44
45
|
getAttribute(key: string): unknown;
|
|
45
46
|
setAttribute(key: string, value: unknown): void;
|
|
46
47
|
getKey(): string | number;
|
|
47
48
|
getKeyName(): string;
|
|
48
|
-
|
|
49
|
+
getLabel(): string;
|
|
50
|
+
fill(attributes: object): void;
|
|
49
51
|
toJson(): JsonObject;
|
|
50
52
|
diff(): JsonObject;
|
|
51
53
|
getType(): string;
|
|
52
54
|
dump(): void;
|
|
53
|
-
save(options?: ModelSaveOptions): Promise<AxiosResponse
|
|
55
|
+
save(options?: ModelSaveOptions): Promise<AxiosResponse | void>;
|
|
54
56
|
update(attributes: JsonObject): Promise<void>;
|
|
55
|
-
delete(): Promise<AxiosResponse
|
|
56
|
-
forceDelete(): Promise<AxiosResponse
|
|
57
|
-
restore(): Promise<AxiosResponse
|
|
57
|
+
delete(): Promise<AxiosResponse>;
|
|
58
|
+
forceDelete(): Promise<AxiosResponse>;
|
|
59
|
+
restore(): Promise<AxiosResponse>;
|
|
58
60
|
refresh(): Promise<void>;
|
|
59
61
|
relation(relationName: string): RelationInterface<Model, ModelPaginatedResponse> | undefined;
|
|
62
|
+
getErrorBag(method: string): string;
|
|
63
|
+
getRouteForSave(): RouteGenerator;
|
|
64
|
+
getRouteForUpdate(): RouteGenerator;
|
|
65
|
+
getRouteForDelete(): RouteGenerator;
|
|
66
|
+
getRouteForRefresh(): RouteGenerator;
|
|
60
67
|
static getSchemaName(): string;
|
|
61
68
|
static getSchema(): ModelSchemaAttributes;
|
|
62
69
|
static query(): BuilderInterface<Model, ModelPaginatedResponse>;
|
|
@@ -91,7 +98,7 @@ export declare class BaseModel implements EventSource<ModelEvents> {
|
|
|
91
98
|
}
|
|
92
99
|
export declare class Model extends BaseModel {
|
|
93
100
|
[key: string]: any;
|
|
94
|
-
|
|
101
|
+
[Symbol.toStringTag]: string;
|
|
95
102
|
}
|
|
96
103
|
export interface ModelSaveOptions {
|
|
97
104
|
additionalPayload?: object;
|
|
@@ -106,7 +113,23 @@ export interface ModelTableColumnDefinition {
|
|
|
106
113
|
label: string;
|
|
107
114
|
sortable?: boolean;
|
|
108
115
|
}
|
|
116
|
+
export type ModelAttribute = {
|
|
117
|
+
appended: true | null;
|
|
118
|
+
cast: string | null;
|
|
119
|
+
default: string | null;
|
|
120
|
+
fillable: boolean;
|
|
121
|
+
hidden: boolean;
|
|
122
|
+
increments: boolean;
|
|
123
|
+
name: string;
|
|
124
|
+
nullable: boolean;
|
|
125
|
+
phpType: string | null;
|
|
126
|
+
primary: boolean;
|
|
127
|
+
type: string | null;
|
|
128
|
+
unique: boolean;
|
|
129
|
+
virtual: boolean;
|
|
130
|
+
};
|
|
109
131
|
export interface ModelSchemaAttributes {
|
|
132
|
+
attributes: ModelAttribute[];
|
|
110
133
|
displayName: {
|
|
111
134
|
singular: string;
|
|
112
135
|
plural: string;
|
|
@@ -117,6 +140,8 @@ export interface ModelSchemaAttributes {
|
|
|
117
140
|
primaryKey: string;
|
|
118
141
|
timestamps: boolean;
|
|
119
142
|
labeledBy: string;
|
|
143
|
+
softDeletes: boolean;
|
|
144
|
+
[key: string]: any;
|
|
120
145
|
}
|
|
121
146
|
export interface RelationMetaData {
|
|
122
147
|
model: string;
|
package/dist/types/Reducer.d.ts
CHANGED
package/dist/types/Relation.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { BuilderInterface, ExtendedOperator, Scope } from './Builder';
|
|
2
2
|
import { Collection } from './Collection';
|
|
3
3
|
import { Constructor, JsonValue } from './Support';
|
|
4
|
-
|
|
5
4
|
export type { BuilderInterface, ExtendedOperator, Scope, };
|
|
6
5
|
export type RelationInterface<R, C> = {
|
|
7
6
|
guessInverseRelation(): string;
|
package/dist/types/Route.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@luminix/core",
|
|
3
|
-
"version": "0.0.1-beta.
|
|
3
|
+
"version": "0.0.1-beta.21",
|
|
4
4
|
"description": "> Projeto em desenvolvimento",
|
|
5
|
-
"main": "dist/core.
|
|
5
|
+
"main": "dist/core.umd.cjs",
|
|
6
|
+
"module": "dist/core.js",
|
|
6
7
|
"types": "dist/index.d.ts",
|
|
7
8
|
"type": "module",
|
|
8
9
|
"scripts": {
|
|
@@ -11,7 +12,8 @@
|
|
|
11
12
|
"lint:fix": "eslint ./src ./tests --ext .ts --fix",
|
|
12
13
|
"test": "jest",
|
|
13
14
|
"test:coverage": "jest --coverage",
|
|
14
|
-
"ci": "npm run lint && npm run test"
|
|
15
|
+
"ci": "npm run lint && npm run test",
|
|
16
|
+
"publish:beta": "npm run build && npm publish --tag beta"
|
|
15
17
|
},
|
|
16
18
|
"author": "",
|
|
17
19
|
"license": "MIT",
|
package/vite.config.js
CHANGED
|
@@ -3,15 +3,18 @@ import { resolve } from 'path';
|
|
|
3
3
|
|
|
4
4
|
import dts from 'vite-plugin-dts';
|
|
5
5
|
|
|
6
|
+
import packageJson from './package.json';
|
|
7
|
+
|
|
6
8
|
export default defineConfig({
|
|
7
9
|
plugins: [dts({ insertTypesEntry: true })],
|
|
8
10
|
build: {
|
|
9
11
|
lib: {
|
|
10
12
|
entry: resolve(__dirname, 'src/index.ts'),
|
|
11
|
-
|
|
13
|
+
name: 'LuminixCore',
|
|
14
|
+
// formats: ['es']
|
|
12
15
|
},
|
|
13
16
|
rollupOptions: {
|
|
14
|
-
external:
|
|
17
|
+
external: Object.keys(packageJson.peerDependencies),
|
|
15
18
|
}
|
|
16
19
|
},
|
|
17
20
|
|
package/graph.png
DELETED
|
Binary file
|