@luminix/core 0.0.1-beta.19 → 0.0.1-beta.20

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.
Files changed (48) hide show
  1. package/dist/contracts/Builder.d.ts +0 -1
  2. package/dist/contracts/Collection.d.ts +0 -1
  3. package/dist/contracts/ModelCollection.d.ts +0 -1
  4. package/dist/contracts/Plugin.d.ts +0 -1
  5. package/dist/contracts/PropertyBag.d.ts +0 -1
  6. package/dist/contracts/Relation/BelongsTo.d.ts +0 -1
  7. package/dist/contracts/Relation/BelongsToMany.d.ts +0 -1
  8. package/dist/contracts/Relation/HasMany.d.ts +0 -1
  9. package/dist/contracts/Relation/HasOne.d.ts +0 -1
  10. package/dist/contracts/Relation/HasOneOrMany.d.ts +0 -1
  11. package/dist/contracts/Relation/MorphMany.d.ts +0 -1
  12. package/dist/contracts/Relation/MorphOne.d.ts +0 -1
  13. package/dist/contracts/Relation/MorphOneOrMany.d.ts +0 -1
  14. package/dist/contracts/Relation/MorphTo.d.ts +0 -1
  15. package/dist/contracts/Relation/MorphToMany.d.ts +0 -1
  16. package/dist/contracts/Relation.d.ts +0 -1
  17. package/dist/facades/App.d.ts +0 -1
  18. package/dist/facades/Auth.d.ts +0 -1
  19. package/dist/facades/Error.d.ts +0 -1
  20. package/dist/facades/Log.d.ts +0 -1
  21. package/dist/facades/Model.d.ts +0 -1
  22. package/dist/facades/Route.d.ts +0 -1
  23. package/dist/helpers/app.d.ts +0 -1
  24. package/dist/helpers/auth.d.ts +0 -1
  25. package/dist/helpers/config.d.ts +0 -1
  26. package/dist/helpers/error.d.ts +0 -1
  27. package/dist/helpers/log.d.ts +0 -1
  28. package/dist/helpers/model.d.ts +0 -1
  29. package/dist/helpers/route.d.ts +0 -1
  30. package/dist/index.d.ts +0 -1
  31. package/dist/mixins/BaseModel.d.ts +0 -1
  32. package/dist/mixins/HasEvents.d.ts +0 -1
  33. package/dist/mixins/Reducible.d.ts +0 -1
  34. package/dist/support/collection.d.ts +0 -1
  35. package/dist/support/model.d.ts +0 -1
  36. package/dist/types/App.d.ts +0 -1
  37. package/dist/types/Auth.d.ts +0 -1
  38. package/dist/types/Builder.d.ts +0 -1
  39. package/dist/types/Collection.d.ts +0 -1
  40. package/dist/types/Config.d.ts +0 -1
  41. package/dist/types/Error.d.ts +0 -1
  42. package/dist/types/Event.d.ts +0 -1
  43. package/dist/types/Model.d.ts +0 -1
  44. package/dist/types/PropertyBag.d.ts +0 -1
  45. package/dist/types/Reducer.d.ts +0 -1
  46. package/dist/types/Relation.d.ts +0 -1
  47. package/dist/types/Route.d.ts +0 -1
  48. package/package.json +1 -1
@@ -5,7 +5,6 @@ import { EventData } from '../types/Event';
5
5
  import { Model, ModelPaginatedResponse, ModelQuery } from '../types/Model';
6
6
  import { JsonValue } from '../types/Support';
7
7
  import { Collection as CollectionInterface } from '../types/Collection';
8
-
9
8
  type BuilderInterface = BuilderBase<Model, ModelPaginatedResponse>;
10
9
  type BuilderEventMap = BuilderEvents<Model, ModelPaginatedResponse>;
11
10
  declare class Builder implements BuilderInterface {
@@ -1,7 +1,6 @@
1
1
  import { CollectionEvents, Operator, Collection as CollectionInterface, CollectionIteratorCallback, CollectionPipeCallback, CollectionSortCallback } from '../types/Collection';
2
2
  import { JsonValue, Constructor, TypeOf } from '../types/Support';
3
3
  import { Unsubscribe } from 'nanoevents';
4
-
5
4
  export declare function collect<T = unknown, C extends typeof Collection<T> = typeof Collection<T>>(items?: T[], constructor?: C): CollectionInterface<T>;
6
5
  export declare class Collection<T> implements CollectionInterface<T> {
7
6
  #private;
@@ -1,7 +1,6 @@
1
1
  import { Collection } from './Collection';
2
2
  import { Model } from '../types/Model';
3
3
  import { Collection as CollectionInterface } from '../types/Collection';
4
-
5
4
  declare class ModelCollection extends Collection<Model> {
6
5
  [Symbol.toStringTag]: string;
7
6
  intersect(values: Collection<Model> | Model[]): CollectionInterface<Model>;
@@ -1,5 +1,4 @@
1
1
  import { AppFacade, AppFacades } from '../types/App';
2
-
3
2
  export default abstract class Plugin {
4
3
  readonly name?: string;
5
4
  readonly version?: string;
@@ -1,6 +1,5 @@
1
1
  import { PropertyBag as PropertyBagInterface, PropertyBagEventMap } from '../types/PropertyBag';
2
2
  import { Unsubscribe } from 'nanoevents';
3
-
4
3
  declare class PropertyBag<T extends object> implements PropertyBagInterface<T> {
5
4
  private bag;
6
5
  private locked;
@@ -2,7 +2,6 @@ import { default as Relation } from '../Relation';
2
2
  import { Model, ModelPaginatedResponse, RelationMetaData } from '../../types/Model';
3
3
  import { AppFacades } from '../../types/App';
4
4
  import { BuilderInterface as Builder } from '../../types/Builder';
5
-
6
5
  type BuilderInterface = Builder<Model, ModelPaginatedResponse>;
7
6
  export default class BelongsTo extends Relation {
8
7
  protected meta: RelationMetaData;
@@ -4,7 +4,6 @@ import { AppFacades } from '../../types/App';
4
4
  import { BuilderInterface as Builder } from '../../types/Builder';
5
5
  import { Collection as CollectionInterface } from '../../types/Collection';
6
6
  import { JsonObject } from '../../types/Support';
7
-
8
7
  type BuilderInterface = Builder<Model, ModelPaginatedResponse>;
9
8
  export default class BelongsToMany extends Relation {
10
9
  protected meta: RelationMetaData;
@@ -2,7 +2,6 @@ import { AppFacades } from '../../types/App';
2
2
  import { Model, RelationMetaData } from '../../types/Model';
3
3
  import { default as HasOneOrMany } from './HasOneOrMany';
4
4
  import { Collection as CollectionInterface } from '../../types/Collection';
5
-
6
5
  export default class HasMany extends HasOneOrMany {
7
6
  protected meta: RelationMetaData;
8
7
  protected facades: AppFacades;
@@ -1,7 +1,6 @@
1
1
  import { Model, RelationMetaData } from '../../types/Model';
2
2
  import { AppFacades } from '../../types/App';
3
3
  import { default as HasOneOrMany } from './HasOneOrMany';
4
-
5
4
  export default class HasOne extends HasOneOrMany {
6
5
  protected meta: RelationMetaData;
7
6
  protected facades: AppFacades;
@@ -1,7 +1,6 @@
1
1
  import { BuilderInterface as Builder } from '../../types/Builder';
2
2
  import { Model, ModelPaginatedResponse } from '../../types/Model';
3
3
  import { default as Relation } from '../Relation';
4
-
5
4
  type BuilderInterface = Builder<Model, ModelPaginatedResponse>;
6
5
  export default class HasOneOrMany extends Relation {
7
6
  query(): BuilderInterface;
@@ -2,7 +2,6 @@ import { AppFacades } from '../../types/App';
2
2
  import { Model, RelationMetaData } from '../../types/Model';
3
3
  import { default as MorphOneOrMany } from './MorphOneOrMany';
4
4
  import { Collection as CollectionInterface } from '../../types/Collection';
5
-
6
5
  export default class MorphMany extends MorphOneOrMany {
7
6
  protected meta: RelationMetaData;
8
7
  protected facades: AppFacades;
@@ -1,7 +1,6 @@
1
1
  import { AppFacades } from '../../types/App';
2
2
  import { Model, RelationMetaData } from '../../types/Model';
3
3
  import { default as MorphOneOrMany } from './MorphOneOrMany';
4
-
5
4
  export default class MorphOne extends MorphOneOrMany {
6
5
  protected meta: RelationMetaData;
7
6
  protected facades: AppFacades;
@@ -1,7 +1,6 @@
1
1
  import { BuilderInterface as Builder } from '../../types/Builder';
2
2
  import { Model, ModelPaginatedResponse } from '../../types/Model';
3
3
  import { default as HasOneOrMany } from './HasOneOrMany';
4
-
5
4
  type BuilderInterface = Builder<Model, ModelPaginatedResponse>;
6
5
  export default class MorphOneOrMany extends HasOneOrMany {
7
6
  query(): BuilderInterface;
@@ -1,6 +1,5 @@
1
1
  import { Model } from '../../types/Model';
2
2
  import { default as BelongsTo } from './BelongsTo';
3
-
4
3
  export default class MorphTo extends BelongsTo {
5
4
  getRelated(): typeof Model;
6
5
  associate(item: Model): Promise<void>;
@@ -3,7 +3,6 @@ import { BuilderInterface as Builder } from '../../types/Builder';
3
3
  import { Model, ModelPaginatedResponse, RelationMetaData } from '../../types/Model';
4
4
  import { Collection } from '../../types/Collection';
5
5
  import { default as BelongsToMany } from './BelongsToMany';
6
-
7
6
  type BuilderInterface = Builder<Model, ModelPaginatedResponse>;
8
7
  export default class MorphToMany extends BelongsToMany {
9
8
  protected meta: RelationMetaData;
@@ -4,7 +4,6 @@ import { BuilderInterface as Builder, Scope as ScopeBase, ExtendedOperator } fro
4
4
  import { Collection as CollectionInterface } from '../types/Collection';
5
5
  import { RelationInterface as RelationBase } from '../types/Relation';
6
6
  import { JsonValue } from '../types/Support';
7
-
8
7
  type RelationInterface = RelationBase<Model, ModelPaginatedResponse>;
9
8
  type BuilderInterface = Builder<Model, ModelPaginatedResponse>;
10
9
  type Scope = ScopeBase<Model, ModelPaginatedResponse>;
@@ -3,7 +3,6 @@ import { default as Plugin } from '../contracts/Plugin';
3
3
  import { AppConfiguration } from '../types/Config';
4
4
  import { Unsubscribe } from 'nanoevents';
5
5
  import { Constructor } from '../types/Support';
6
-
7
6
  declare class App implements AppFacade {
8
7
  private facades;
9
8
  private booted;
@@ -1,7 +1,6 @@
1
1
  import { AppFacade } from '../types/App';
2
2
  import { AuthCredentials, AuthFacade } from '../types/Auth';
3
3
  import { Model } from '../types/Model';
4
-
5
4
  export default class Auth implements AuthFacade {
6
5
  private readonly app;
7
6
  private _user;
@@ -1,6 +1,5 @@
1
1
  import { default as PropertyBag } from '../contracts/PropertyBag';
2
2
  import { ErrorFacade, ValidationError } from '../types/Error';
3
-
4
3
  export declare const isValidationError: (error: unknown) => error is ValidationError;
5
4
  declare class Error implements ErrorFacade {
6
5
  private bags;
@@ -1,5 +1,4 @@
1
1
  import { LogFacade } from '../types/Log';
2
-
3
2
  export default class Log implements LogFacade {
4
3
  private _debug;
5
4
  constructor(_debug: boolean);
@@ -3,7 +3,6 @@ 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
-
7
6
  declare class ModelFacade implements ModelFacadeInterface {
8
7
  private readonly _schema;
9
8
  private _models;
@@ -1,6 +1,5 @@
1
1
  import { RouteDefinition, RouteTuple as RouteTuple, HttpMethod, RouteGenerator, RouteCallConfig } from '../types/Route';
2
2
  import { ErrorFacade } from '../types/Error';
3
-
4
3
  declare class Route {
5
4
  private routes;
6
5
  private error;
@@ -1,5 +1,4 @@
1
1
  import { AppExternal, AppFacades } from '../types/App';
2
-
3
2
  declare function app(): AppExternal;
4
3
  declare function app<T extends keyof AppFacades>(facade: T): AppFacades[T];
5
4
  export default app;
@@ -1,3 +1,2 @@
1
1
  import { AuthFacade } from '../types/Auth';
2
-
3
2
  export default function (): AuthFacade;
@@ -1,5 +1,4 @@
1
1
  import { ConfigFacade } from '../types/Config';
2
-
3
2
  declare function config(): ConfigFacade;
4
3
  declare function config(path: string, defaultValue?: unknown): unknown;
5
4
  export default config;
@@ -1,4 +1,3 @@
1
1
  import { ErrorFacade } from '../types/Error';
2
-
3
2
  export default function error(): ErrorFacade;
4
3
  export default function error(key: string, bag?: string): string | null;
@@ -1,5 +1,4 @@
1
1
  import { LogFacade } from '../types/Log';
2
-
3
2
  declare function log(): LogFacade;
4
3
  declare function log(...data: any[]): void;
5
4
  export default log;
@@ -1,6 +1,5 @@
1
1
  import { Model } from '../types/Model';
2
2
  import { ModelFacade } from '../types/App';
3
-
4
3
  declare function model(): ModelFacade;
5
4
  declare function model(abstract: string): typeof Model;
6
5
  export default model;
@@ -1,5 +1,4 @@
1
1
  import { RouteFacade, RouteReplacer } from '../types/Route';
2
-
3
2
  declare function route(): RouteFacade;
4
3
  declare function route(name: string, parameters?: RouteReplacer): string;
5
4
  export default route;
package/dist/index.d.ts CHANGED
@@ -14,7 +14,6 @@ import { isModel } from './support/model';
14
14
  import { isCollection } from './support/collection';
15
15
  import { Reducible } from './mixins/Reducible';
16
16
  import { HasEvents } from './mixins/HasEvents';
17
-
18
17
  export { app, App, auth, collect, config, error, log, model, route, isCollection, isValidationError, isModel, Plugin, PropertyBag, Reducible, HasEvents, };
19
18
  export type { AppFacade } from './types/App';
20
19
  export type { AuthFacade } from './types/Auth';
@@ -1,5 +1,4 @@
1
1
  import { BaseModel, Model as ModelInterface } from '../types/Model';
2
2
  import { AppFacade, AppFacades } from '../types/App';
3
-
4
3
  export declare function BaseModelFactory(app: AppFacade, abstract: string): typeof BaseModel;
5
4
  export declare function ModelFactory(facades: AppFacades, abstract: string, CustomModel: typeof BaseModel): typeof ModelInterface;
@@ -1,7 +1,6 @@
1
1
  import { Emitter } from 'nanoevents';
2
2
  import { EventSourceEvents, EventSource } from '../types/Event';
3
3
  import { Constructor } from '../types/Support';
4
-
5
4
  export declare function isEventSource<T>(value: T): value is T & EventSource<any>;
6
5
  export declare function HasEvents<T extends EventSourceEvents, U extends Constructor>(Base: U): {
7
6
  new (...args: any[]): {
@@ -1,7 +1,6 @@
1
1
  import { ReducerCallback, Reducer } from '../types/Reducer';
2
2
  import { Constructor } from '../types/Support';
3
3
  import { Collection } from '../types/Collection';
4
-
5
4
  export declare function Reducible<T extends Constructor>(Base: T): {
6
5
  new (...args: any[]): {
7
6
  reducers: {
@@ -1,4 +1,3 @@
1
1
  import { Collection } from '../types/Collection';
2
-
3
2
  export declare function cartesian<T>(...arrays: T[][]): T[][];
4
3
  export declare function isCollection(instance: unknown): instance is Collection;
@@ -1,3 +1,2 @@
1
1
  import { Model } from '../types/Model';
2
-
3
2
  export declare function isModel(value: unknown): value is Model;
@@ -8,7 +8,6 @@ import { EventSource, Event } from './Event';
8
8
  import { ErrorFacade } from './Error';
9
9
  import { ReducibleInterface } from './Reducer';
10
10
  import { Constructor } from './Support';
11
-
12
11
  type Plugin = PluginInterface<AppFacade, AppFacades>;
13
12
  export type GlobalModelEvents = {
14
13
  'save': (e: ModelGlobalEvent) => void;
@@ -1,5 +1,4 @@
1
1
  import { Model } from './Model';
2
-
3
2
  export type AuthCredentials = {
4
3
  email: string;
5
4
  password: string;
@@ -3,7 +3,6 @@ import { Event, EventSource } from './Event';
3
3
  import { JsonObject, JsonValue } from './Support';
4
4
  import { Operator, Collection } from './Collection';
5
5
  import { PropertyBagEventMap } from './PropertyBag';
6
-
7
6
  export type Scope<R, C> = (builder: BuilderInterface<R, C>) => BuilderInterface<R, C> | void;
8
7
  export type ExtendedOperator = Operator | 'like' | 'notLike' | 'between' | 'notBetween' | 'isNull' | 'isNotNull';
9
8
  export type BuilderInterface<R, C> = EventSource<BuilderEventMap<R, C>> & {
@@ -1,6 +1,5 @@
1
1
  import { Event, EventSource } from './Event';
2
2
  import { Constructor, TypeOf, JsonValue } from './Support';
3
-
4
3
  export type CollectionEvents<T = unknown> = {
5
4
  'change': (e: CollectionChangeEvent<T>) => void;
6
5
  };
@@ -1,7 +1,6 @@
1
1
  import { PropertyBag } from './PropertyBag';
2
2
  import { ModelSchema } from './Model';
3
3
  import { RouteDefinition } from './Route';
4
-
5
4
  export type AppConfiguration = {
6
5
  app?: {
7
6
  name?: string;
@@ -1,7 +1,6 @@
1
1
  import { default as PropertyBag } from '../contracts/PropertyBag';
2
2
  import { Event, EventSource } from './Event';
3
3
  import { PropertyBagEventMap } from './PropertyBag';
4
-
5
4
  export type ErrorEventMap = {
6
5
  change: (e: ErrorChangeEvent) => void;
7
6
  };
@@ -1,5 +1,4 @@
1
1
  import { Unsubscribe } from 'nanoevents';
2
-
3
2
  export type Event<S = any> = {
4
3
  source: S;
5
4
  };
@@ -4,7 +4,6 @@ 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
-
8
7
  export type RelationRepository = Record<string, RelationInterface<Model, ModelPaginatedResponse>>;
9
8
  export type ModelEvents = {
10
9
  'change': (e: ModelChangeEvent) => void;
@@ -1,6 +1,5 @@
1
1
  import { Unsubscribe } from 'nanoevents';
2
2
  import { Event } from './Event';
3
-
4
3
  export type PropertyBagChangeEvent<T extends object> = Event<PropertyBag<T>> & {
5
4
  path: string;
6
5
  value: unknown;
@@ -1,5 +1,4 @@
1
1
  import { Collection } from './Collection';
2
-
3
2
  export type ReducerCallback = (value: any, ...params: any[]) => any;
4
3
  export interface Reducer {
5
4
  callback: ReducerCallback;
@@ -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;
@@ -1,6 +1,5 @@
1
1
  import { AxiosRequestConfig, AxiosResponse } from 'axios';
2
2
  import { ReducibleInterface } from './Reducer';
3
-
4
3
  export type RouteReplacer = {
5
4
  [key: string]: string | number;
6
5
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@luminix/core",
3
- "version": "0.0.1-beta.19",
3
+ "version": "0.0.1-beta.20",
4
4
  "description": "> Projeto em desenvolvimento",
5
5
  "main": "dist/core.umd.cjs",
6
6
  "module": "dist/core.js",