sequelastic
Advanced tools
Comparing version 0.0.5 to 1.0.1
import "colors"; | ||
import elasticSearch, { ClientOptions } from "@elastic/elasticsearch"; | ||
import { Model } from "sequelize-typescript"; | ||
import { ModelType } from "sequelize-typescript"; | ||
declare type SequelasticModelType = { | ||
model: typeof Model; | ||
model: ModelType<any, any>; | ||
as?: string; | ||
@@ -13,3 +13,3 @@ attributes?: string[] | { | ||
declare type SequelasticConstructorProps = { | ||
models: (typeof Model | SequelasticModelType)[]; | ||
models: (ModelType<any, any> | SequelasticModelType)[]; | ||
exclude?: string[]; | ||
@@ -48,3 +48,3 @@ } & ClientOptions; | ||
elastic: elasticSearch.Client; | ||
models: (SequelasticModelType | typeof Model)[]; | ||
models: (SequelasticModelType | ModelType<any, any>)[]; | ||
constructor(options: SequelasticConstructorProps); | ||
@@ -51,0 +51,0 @@ sync(options?: SequelasticSyncOptions): Promise<any>; |
{ | ||
"name": "sequelastic", | ||
"version": "0.0.5", | ||
"version": "1.0.1", | ||
"description": "bridge utility between sequelize-typescript and ElasticSearch", | ||
@@ -34,3 +34,3 @@ "main": "dist/index.js", | ||
"pluralize": "^8.0.0", | ||
"sequelize-typescript": "^1.1.0", | ||
"sequelize-typescript": "^2.1.0", | ||
"tslib": "^2.2.0" | ||
@@ -37,0 +37,0 @@ }, |
# Sequelastic | ||
:warning: **This version only works with sequelize-typescript 1.1.x** | ||
:warning: This only works with sequelize-typescript@2, in order to use it with sequelize-typescript@1 use: | ||
``` | ||
npm install sequelastic@0.0.5 | ||
``` | ||
## The first sequelize-typescript and ElasticSearch bridge tool | ||
@@ -6,0 +10,0 @@ |
import "colors"; | ||
import elasticSearch, { ClientOptions } from "@elastic/elasticsearch"; | ||
import pluralize from "pluralize"; | ||
import { Model } from "sequelize-typescript"; | ||
import { Model, ModelType } from "sequelize-typescript"; | ||
type SequelasticModelType = { | ||
model: typeof Model; | ||
model: ModelType<any, any>; | ||
as?: string; | ||
@@ -14,3 +14,3 @@ attributes?: string[] | { exclude: string[] }; | ||
type SequelasticConstructorProps = { | ||
models: (typeof Model | SequelasticModelType)[]; | ||
models: (ModelType<any, any> | SequelasticModelType)[]; | ||
exclude?: string[]; | ||
@@ -55,3 +55,3 @@ } & ClientOptions; | ||
public elastic: elasticSearch.Client; | ||
public models: (SequelasticModelType | typeof Model)[]; | ||
public models: (SequelasticModelType | ModelType<any, any>)[]; | ||
#fieldsToExclude: string[]; | ||
@@ -92,3 +92,3 @@ // constructor(options: SqlasticConstructorProps) { | ||
properties: parseSqlAttributesToElastic( | ||
model.model.rawAttributes | ||
(model.model as any as typeof Model).rawAttributes | ||
), | ||
@@ -101,3 +101,3 @@ }, | ||
index: pluralize.plural( | ||
(model as typeof Model).name.toLowerCase() | ||
(model as ModelType<any, any>).name.toLowerCase() | ||
), | ||
@@ -104,0 +104,0 @@ body: { |
Sorry, the diff of this file is not supported yet
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
54534
18
757
0
0
243
+ Added@types/debug@4.1.12(transitive)
+ Added@types/ms@2.1.0(transitive)
+ Addedglob@7.2.0(transitive)
+ Addedinflection@1.13.4(transitive)
+ Addedpg-connection-string@2.7.0(transitive)
+ Addedretry-as-promised@7.0.4(transitive)
+ Addedsemver@7.7.1(transitive)
+ Addedsequelize@6.37.5(transitive)
+ Addedsequelize-pool@7.1.0(transitive)
+ Addedsequelize-typescript@2.1.6(transitive)
+ Addedwkx@0.5.0(transitive)
- Removed@types/bluebird@3.5.42(transitive)
- Removedany-promise@1.3.0(transitive)
- Removedbluebird@3.7.2(transitive)
- Removedcls-bluebird@2.1.0(transitive)
- Removedglob@7.1.2(transitive)
- Removedinflection@1.12.0(transitive)
- Removedis-bluebird@1.0.2(transitive)
- Removedretry-as-promised@3.2.0(transitive)
- Removedsemver@6.3.1(transitive)
- Removedsequelize@5.22.5(transitive)
- Removedsequelize-pool@2.3.0(transitive)
- Removedsequelize-typescript@1.1.0(transitive)
- Removedshimmer@1.2.1(transitive)
- Removedwkx@0.4.8(transitive)
Updatedsequelize-typescript@^2.1.0