tsense 0.0.1 → 0.0.2

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 CHANGED
@@ -4,7 +4,7 @@ Opinionated, fully-typed typesense client
4
4
 
5
5
  # TO-DO
6
6
  - [ ] Remove base typesense dependency
7
- - [ ] Better filter support
7
+ - [ ] Better filter support (includes, exact, etc...)
8
8
  - [ ] Documentation
9
9
  - [ ] Improve tests
10
10
  - [ ] Facet
@@ -72,7 +72,9 @@ const results = await UsersCollection.searchDocuments({
72
72
  search: "john",
73
73
  search_keys: ["name"],
74
74
  // can sort multiple fields
75
- order_by: ["age desc", "id asc"],
75
+ order_by: ["age desc", "name asc"],
76
+ // compiles into
77
+ // age:>=20&&((email:=@google.com)||(email:=@netflix.com))
76
78
  filter: {
77
79
  // min and max range on numbers
78
80
  age: {
@@ -89,4 +91,4 @@ const results = await UsersCollection.searchDocuments({
89
91
  ],
90
92
  },
91
93
  });
92
- ```
94
+ ```
@@ -115,7 +115,12 @@ export class TSense {
115
115
  }
116
116
  create() {
117
117
  return __awaiter(this, void 0, void 0, function* () {
118
- const fields = [];
118
+ const fields = [
119
+ {
120
+ name: "id",
121
+ type: "int32",
122
+ },
123
+ ];
119
124
  for (const [name, field] of Object.entries(this.data.fields)) {
120
125
  const isSimpleField = typeof field === "string";
121
126
  if (isSimpleField) {
package/package.json CHANGED
@@ -1,11 +1,18 @@
1
1
  {
2
2
  "name": "tsense",
3
- "version": "0.0.1",
3
+ "version": "0.0.2",
4
4
  "main": "dist/index.js",
5
+ "types": "dist/index.d.ts",
6
+ "exports": {
7
+ ".": {
8
+ "types": "./dist/index.d.ts",
9
+ "import": "./dist/index.js"
10
+ }
11
+ },
5
12
  "files": [
6
13
  "dist"
7
14
  ],
8
- "description": "Opinionated, fully typed typesense client, inspired by prisma syntax",
15
+ "description": "Opinionated, fully typed typesense client",
9
16
  "license": "MIT",
10
17
  "keywords": [
11
18
  "typesense"