nestjs-typesense 0.1.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/LICENSE +21 -0
- package/README.md +318 -0
- package/dist/client/typesense.client.d.ts +38 -0
- package/dist/client/typesense.client.d.ts.map +1 -0
- package/dist/client/typesense.client.js +100 -0
- package/dist/client/typesense.client.js.map +1 -0
- package/dist/collections/typesense-collections.d.ts +21 -0
- package/dist/collections/typesense-collections.d.ts.map +1 -0
- package/dist/collections/typesense-collections.js +120 -0
- package/dist/collections/typesense-collections.js.map +1 -0
- package/dist/collectors/typesense-collector.d.ts +22 -0
- package/dist/collectors/typesense-collector.d.ts.map +1 -0
- package/dist/collectors/typesense-collector.decorator.d.ts +11 -0
- package/dist/collectors/typesense-collector.decorator.d.ts.map +1 -0
- package/dist/collectors/typesense-collector.decorator.js +27 -0
- package/dist/collectors/typesense-collector.decorator.js.map +1 -0
- package/dist/collectors/typesense-collector.js +3 -0
- package/dist/collectors/typesense-collector.js.map +1 -0
- package/dist/collectors/typesense-indexer.d.ts +34 -0
- package/dist/collectors/typesense-indexer.d.ts.map +1 -0
- package/dist/collectors/typesense-indexer.js +110 -0
- package/dist/collectors/typesense-indexer.js.map +1 -0
- package/dist/index.d.ts +18 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +44 -0
- package/dist/index.js.map +1 -0
- package/dist/schema/collection.d.ts +87 -0
- package/dist/schema/collection.d.ts.map +1 -0
- package/dist/schema/collection.js +64 -0
- package/dist/schema/collection.js.map +1 -0
- package/dist/schema/decorators.d.ts +73 -0
- package/dist/schema/decorators.d.ts.map +1 -0
- package/dist/schema/decorators.js +126 -0
- package/dist/schema/decorators.js.map +1 -0
- package/dist/schema/field.d.ts +71 -0
- package/dist/schema/field.d.ts.map +1 -0
- package/dist/schema/field.js +40 -0
- package/dist/schema/field.js.map +1 -0
- package/dist/typesense.constants.d.ts +9 -0
- package/dist/typesense.constants.d.ts.map +1 -0
- package/dist/typesense.constants.js +12 -0
- package/dist/typesense.constants.js.map +1 -0
- package/dist/typesense.module-options.d.ts +24 -0
- package/dist/typesense.module-options.d.ts.map +1 -0
- package/dist/typesense.module-options.js +3 -0
- package/dist/typesense.module-options.js.map +1 -0
- package/dist/typesense.module.d.ts +13 -0
- package/dist/typesense.module.d.ts.map +1 -0
- package/dist/typesense.module.js +42 -0
- package/dist/typesense.module.js.map +1 -0
- package/package.json +64 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typesense-collector.d.ts","sourceRoot":"","sources":["../../src/collectors/typesense-collector.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAElF;;;;;;;;;GASG;AACH,MAAM,WAAW,kBAAkB,CAAC,WAAW,SAAS,mBAAmB,GAAG,mBAAmB;IAC/F,yDAAyD;IACzD,SAAS,CAAC,QAAQ,EAAE,OAAO,EAAE,GAAG,aAAa,CAAC,WAAW,CAAC,EAAE,CAAC;IAE7D,0EAA0E;IAC1E,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,EAAE,GAAG,cAAc,CAAC,OAAO,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;IAEhE,sEAAsE;IACtE,YAAY,CAAC,KAAK,EAAE,IAAI,GAAG,cAAc,CAAC,OAAO,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;IAEjE,wEAAwE;IACxE,YAAY,CAAC,CAAC,KAAK,EAAE,IAAI,GAAG,cAAc,CAAC,MAAM,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;CAClE"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import "reflect-metadata";
|
|
2
|
+
import type { TypesenseCollection } from "../schema/collection.js";
|
|
3
|
+
/**
|
|
4
|
+
* Marks a provider as the collector for a collection. The class must implement
|
|
5
|
+
* `TypesenseCollector`. Applies `@Injectable()` so the class can be listed directly
|
|
6
|
+
* in a module's `providers`.
|
|
7
|
+
*/
|
|
8
|
+
export declare function RegisterTypesenseCollector(collection: TypesenseCollection | string): ClassDecorator;
|
|
9
|
+
export declare function isTypesenseCollector(target: object): boolean;
|
|
10
|
+
export declare function getCollectorCollectionName(target: object): string | undefined;
|
|
11
|
+
//# sourceMappingURL=typesense-collector.decorator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typesense-collector.decorator.d.ts","sourceRoot":"","sources":["../../src/collectors/typesense-collector.decorator.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,CAAC;AAE1B,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAGnE;;;;GAIG;AACH,wBAAgB,0BAA0B,CACxC,UAAU,EAAE,mBAAmB,GAAG,MAAM,GACvC,cAAc,CAOhB;AAED,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAE5D;AAED,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAE7E"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RegisterTypesenseCollector = RegisterTypesenseCollector;
|
|
4
|
+
exports.isTypesenseCollector = isTypesenseCollector;
|
|
5
|
+
exports.getCollectorCollectionName = getCollectorCollectionName;
|
|
6
|
+
require("reflect-metadata");
|
|
7
|
+
const common_1 = require("@nestjs/common");
|
|
8
|
+
const typesense_constants_js_1 = require("../typesense.constants.js");
|
|
9
|
+
/**
|
|
10
|
+
* Marks a provider as the collector for a collection. The class must implement
|
|
11
|
+
* `TypesenseCollector`. Applies `@Injectable()` so the class can be listed directly
|
|
12
|
+
* in a module's `providers`.
|
|
13
|
+
*/
|
|
14
|
+
function RegisterTypesenseCollector(collection) {
|
|
15
|
+
const name = typeof collection === "string" ? collection : collection.name;
|
|
16
|
+
return (target) => {
|
|
17
|
+
Reflect.defineMetadata(typesense_constants_js_1.TYPESENSE_COLLECTOR, name, target);
|
|
18
|
+
(0, common_1.Injectable)()(target);
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
function isTypesenseCollector(target) {
|
|
22
|
+
return Reflect.hasMetadata(typesense_constants_js_1.TYPESENSE_COLLECTOR, target);
|
|
23
|
+
}
|
|
24
|
+
function getCollectorCollectionName(target) {
|
|
25
|
+
return Reflect.getMetadata(typesense_constants_js_1.TYPESENSE_COLLECTOR, target);
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=typesense-collector.decorator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typesense-collector.decorator.js","sourceRoot":"","sources":["../../src/collectors/typesense-collector.decorator.ts"],"names":[],"mappings":";;AAUA,gEASC;AAED,oDAEC;AAED,gEAEC;AA3BD,4BAA0B;AAC1B,2CAA4C;AAE5C,sEAAgE;AAEhE;;;;GAIG;AACH,SAAgB,0BAA0B,CACxC,UAAwC;IAExC,MAAM,IAAI,GAAG,OAAO,UAAU,KAAK,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC;IAE3E,OAAO,CAAC,MAAM,EAAE,EAAE;QAChB,OAAO,CAAC,cAAc,CAAC,4CAAmB,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;QAC1D,IAAA,mBAAU,GAAE,CAAC,MAAM,CAAC,CAAC;IACvB,CAAC,CAAC;AACJ,CAAC;AAED,SAAgB,oBAAoB,CAAC,MAAc;IACjD,OAAO,OAAO,CAAC,WAAW,CAAC,4CAAmB,EAAE,MAAM,CAAC,CAAC;AAC1D,CAAC;AAED,SAAgB,0BAA0B,CAAC,MAAc;IACvD,OAAO,OAAO,CAAC,WAAW,CAAC,4CAAmB,EAAE,MAAM,CAAuB,CAAC;AAChF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typesense-collector.js","sourceRoot":"","sources":["../../src/collectors/typesense-collector.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { ModulesContainer } from "@nestjs/core";
|
|
2
|
+
import { TypesenseClient } from "../client/typesense.client.js";
|
|
3
|
+
import { TypesenseCollections } from "../collections/typesense-collections.js";
|
|
4
|
+
import type { TypesenseCollection } from "../schema/collection.js";
|
|
5
|
+
export interface IndexResult {
|
|
6
|
+
collection: string;
|
|
7
|
+
indexed: number;
|
|
8
|
+
removed: number;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Drives the registered collectors. Call `reindex` from a CLI command or a startup task,
|
|
12
|
+
* and `sync` from a cron job for incremental catch-up.
|
|
13
|
+
*/
|
|
14
|
+
export declare class TypesenseIndexer {
|
|
15
|
+
private readonly modules;
|
|
16
|
+
private readonly client;
|
|
17
|
+
private readonly collections;
|
|
18
|
+
private readonly logger;
|
|
19
|
+
constructor(modules: ModulesContainer, client: TypesenseClient, collections: TypesenseCollections);
|
|
20
|
+
/** Full rebuild of one collection. Existing documents are upserted, not dropped. */
|
|
21
|
+
reindex(collection: TypesenseCollection | string, ids?: string[]): Promise<IndexResult>;
|
|
22
|
+
/** Incremental pass: everything created, updated or deleted since `since`. */
|
|
23
|
+
sync(collection: TypesenseCollection | string, since: Date): Promise<IndexResult>;
|
|
24
|
+
/** Runs `sync` for every collection that has a collector. */
|
|
25
|
+
syncAll(since: Date): Promise<IndexResult[]>;
|
|
26
|
+
private resolve;
|
|
27
|
+
private collectorFor;
|
|
28
|
+
/**
|
|
29
|
+
* Scans the Nest container for providers carrying the collector metadata. Done lazily
|
|
30
|
+
* rather than at construction so collectors declared in any module are visible.
|
|
31
|
+
*/
|
|
32
|
+
private findCollector;
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=typesense-indexer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typesense-indexer.d.ts","sourceRoot":"","sources":["../../src/collectors/typesense-indexer.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAE,oBAAoB,EAAE,MAAM,yCAAyC,CAAC;AAC/E,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAInE,MAAM,WAAW,WAAW;IAC1B,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;;GAGG;AACH,qBACa,gBAAgB;IAIzB,OAAO,CAAC,QAAQ,CAAC,OAAO;IACxB,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,WAAW;IAL9B,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAqC;gBAGzC,OAAO,EAAE,gBAAgB,EACzB,MAAM,EAAE,eAAe,EACvB,WAAW,EAAE,oBAAoB;IAGpD,oFAAoF;IAC9E,OAAO,CAAC,UAAU,EAAE,mBAAmB,GAAG,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,WAAW,CAAC;IAe7F,8EAA8E;IACxE,IAAI,CAAC,UAAU,EAAE,mBAAmB,GAAG,MAAM,EAAE,KAAK,EAAE,IAAI,GAAG,OAAO,CAAC,WAAW,CAAC;IAsBvF,6DAA6D;IACvD,OAAO,CAAC,KAAK,EAAE,IAAI,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC;IAWlD,OAAO,CAAC,OAAO;IAIf,OAAO,CAAC,YAAY;IAUpB;;;OAGG;IACH,OAAO,CAAC,aAAa;CAYtB"}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var TypesenseIndexer_1;
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.TypesenseIndexer = void 0;
|
|
14
|
+
const common_1 = require("@nestjs/common");
|
|
15
|
+
const core_1 = require("@nestjs/core");
|
|
16
|
+
const typesense_client_js_1 = require("../client/typesense.client.js");
|
|
17
|
+
const typesense_collections_js_1 = require("../collections/typesense-collections.js");
|
|
18
|
+
const typesense_collector_decorator_js_1 = require("./typesense-collector.decorator.js");
|
|
19
|
+
/**
|
|
20
|
+
* Drives the registered collectors. Call `reindex` from a CLI command or a startup task,
|
|
21
|
+
* and `sync` from a cron job for incremental catch-up.
|
|
22
|
+
*/
|
|
23
|
+
let TypesenseIndexer = TypesenseIndexer_1 = class TypesenseIndexer {
|
|
24
|
+
modules;
|
|
25
|
+
client;
|
|
26
|
+
collections;
|
|
27
|
+
logger = new common_1.Logger(TypesenseIndexer_1.name);
|
|
28
|
+
constructor(modules, client, collections) {
|
|
29
|
+
this.modules = modules;
|
|
30
|
+
this.client = client;
|
|
31
|
+
this.collections = collections;
|
|
32
|
+
}
|
|
33
|
+
/** Full rebuild of one collection. Existing documents are upserted, not dropped. */
|
|
34
|
+
async reindex(collection, ids) {
|
|
35
|
+
const resolved = this.resolve(collection);
|
|
36
|
+
const collector = this.collectorFor(resolved.name);
|
|
37
|
+
let indexed = 0;
|
|
38
|
+
for await (const batch of collector.fetchAll(ids)) {
|
|
39
|
+
const documents = collector.transform(batch);
|
|
40
|
+
await this.client.upsert(resolved, documents);
|
|
41
|
+
indexed += documents.length;
|
|
42
|
+
}
|
|
43
|
+
this.logger.log(`Reindexed ${indexed} document(s) into "${resolved.name}"`);
|
|
44
|
+
return { collection: resolved.name, indexed, removed: 0 };
|
|
45
|
+
}
|
|
46
|
+
/** Incremental pass: everything created, updated or deleted since `since`. */
|
|
47
|
+
async sync(collection, since) {
|
|
48
|
+
const resolved = this.resolve(collection);
|
|
49
|
+
const collector = this.collectorFor(resolved.name);
|
|
50
|
+
let indexed = 0;
|
|
51
|
+
let removed = 0;
|
|
52
|
+
for await (const batch of collector.fetchChanged(since)) {
|
|
53
|
+
const documents = collector.transform(batch);
|
|
54
|
+
await this.client.upsert(resolved, documents);
|
|
55
|
+
indexed += documents.length;
|
|
56
|
+
}
|
|
57
|
+
if (collector.fetchRemoved) {
|
|
58
|
+
for await (const ids of collector.fetchRemoved(since)) {
|
|
59
|
+
await this.client.delete(resolved, ids);
|
|
60
|
+
removed += ids.length;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
return { collection: resolved.name, indexed, removed };
|
|
64
|
+
}
|
|
65
|
+
/** Runs `sync` for every collection that has a collector. */
|
|
66
|
+
async syncAll(since) {
|
|
67
|
+
const results = [];
|
|
68
|
+
for (const collection of this.collections.all()) {
|
|
69
|
+
if (!this.findCollector(collection.name))
|
|
70
|
+
continue;
|
|
71
|
+
results.push(await this.sync(collection, since));
|
|
72
|
+
}
|
|
73
|
+
return results;
|
|
74
|
+
}
|
|
75
|
+
resolve(collection) {
|
|
76
|
+
return typeof collection === "string" ? this.collections.get(collection) : collection;
|
|
77
|
+
}
|
|
78
|
+
collectorFor(name) {
|
|
79
|
+
const collector = this.findCollector(name);
|
|
80
|
+
if (!collector) {
|
|
81
|
+
throw new Error(`No collector registered for collection "${name}". Decorate a provider with @RegisterTypesenseCollector().`);
|
|
82
|
+
}
|
|
83
|
+
return collector;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Scans the Nest container for providers carrying the collector metadata. Done lazily
|
|
87
|
+
* rather than at construction so collectors declared in any module are visible.
|
|
88
|
+
*/
|
|
89
|
+
findCollector(name) {
|
|
90
|
+
for (const module of this.modules.values()) {
|
|
91
|
+
for (const provider of module.providers.values()) {
|
|
92
|
+
const instance = provider.instance;
|
|
93
|
+
if (!instance || typeof instance !== "object")
|
|
94
|
+
continue;
|
|
95
|
+
if ((0, typesense_collector_decorator_js_1.getCollectorCollectionName)(instance.constructor) === name) {
|
|
96
|
+
return instance;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
return undefined;
|
|
101
|
+
}
|
|
102
|
+
};
|
|
103
|
+
exports.TypesenseIndexer = TypesenseIndexer;
|
|
104
|
+
exports.TypesenseIndexer = TypesenseIndexer = TypesenseIndexer_1 = __decorate([
|
|
105
|
+
(0, common_1.Injectable)(),
|
|
106
|
+
__metadata("design:paramtypes", [core_1.ModulesContainer,
|
|
107
|
+
typesense_client_js_1.TypesenseClient,
|
|
108
|
+
typesense_collections_js_1.TypesenseCollections])
|
|
109
|
+
], TypesenseIndexer);
|
|
110
|
+
//# sourceMappingURL=typesense-indexer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typesense-indexer.js","sourceRoot":"","sources":["../../src/collectors/typesense-indexer.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,2CAAoD;AACpD,uCAAgD;AAChD,uEAAgE;AAChE,sFAA+E;AAE/E,yFAAgF;AAShF;;;GAGG;AAEI,IAAM,gBAAgB,wBAAtB,MAAM,gBAAgB;IAIR;IACA;IACA;IALF,MAAM,GAAG,IAAI,eAAM,CAAC,kBAAgB,CAAC,IAAI,CAAC,CAAC;IAE5D,YACmB,OAAyB,EACzB,MAAuB,EACvB,WAAiC;QAFjC,YAAO,GAAP,OA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AC,SAAS,EAAE,CAAC;YACf,MAAM,IAAI,KAAK,CACb,2CAA2C,IAAI,4DAA4D,CAC5G,CAAC;QACJ,CAAC;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;IAED;;;OAGG;IACK,aAAa,CAAC,IAAY;QAChC,KAAK,MAAM,MAAM,IAAI,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC;YAC3C,KAAK,MAAM,QAAQ,IAAI,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE,EAAE,CAAC;gBACjD,MAAM,QAAQ,GAAG,QAAQ,CAAC,QAA8B,CAAC;gBACzD,IAAI,CAAC,QAAQ,IAAI,OAAO,QAAQ,KAAK,QAAQ;oBAAE,SAAS;gBACxD,IAAI,IAAA,6DAA0B,EAAC,QAAQ,CAAC,WAAW,CAAC,KAAK,IAAI,EAAE,CAAC;oBAC9D,OAAO,QAA8B,CAAC;gBACxC,CAAC;YACH,CAAC;QACH,CAAC;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;CACF,CAAA;AA1FY,4CAAgB;2BAAhB,gBAAgB;IAD5B,IAAA,mBAAU,GAAE;qCAKiB,uBAAgB;QACjB,qCAAe;QACV,+CAAoB;GANzC,gBAAgB,CA0F5B"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export type { SearchParams, SearchResult } from "./client/typesense.client.js";
|
|
2
|
+
export { TypesenseClient } from "./client/typesense.client.js";
|
|
3
|
+
export { TypesenseCollections } from "./collections/typesense-collections.js";
|
|
4
|
+
export { getCollectorCollectionName, isTypesenseCollector, RegisterTypesenseCollector, } from "./collectors/typesense-collector.decorator.js";
|
|
5
|
+
export type { TypesenseCollector } from "./collectors/typesense-collector.js";
|
|
6
|
+
export type { IndexResult } from "./collectors/typesense-indexer.js";
|
|
7
|
+
export { TypesenseIndexer } from "./collectors/typesense-indexer.js";
|
|
8
|
+
export type { InferDocument, InvalidCollectionFields, TypesenseCollection, TypesenseCollectionDefinition, TypesenseCollectionSchema, TypesenseFieldRecord, } from "./schema/collection.js";
|
|
9
|
+
export { defineCollection, isCollection, toSchema } from "./schema/collection.js";
|
|
10
|
+
export type { TypesenseArrayElementType, TypesenseCollectionSource, TypesenseDocumentClass, TypesenseSchemaOptions, } from "./schema/decorators.js";
|
|
11
|
+
export { getTypesenseCollection, resolveCollection, TypesenseArray, TypesenseAuto, TypesenseBool, TypesenseFloat, TypesenseGeopoint, TypesenseInt32, TypesenseInt64, TypesenseObject, TypesenseProp, TypesenseSchema, TypesenseString, } from "./schema/decorators.js";
|
|
12
|
+
export type { TypesenseField, TypesenseFieldOptions, TypesenseFieldType, TypesenseFieldTypeMap, } from "./schema/field.js";
|
|
13
|
+
export { createField, field } from "./schema/field.js";
|
|
14
|
+
export { TYPESENSE_CLIENT, TYPESENSE_COLLECTION, TYPESENSE_COLLECTIONS, TYPESENSE_COLLECTOR, TYPESENSE_FIELDS, TYPESENSE_MODULE_OPTIONS, } from "./typesense.constants.js";
|
|
15
|
+
export type { TypesenseModuleAsyncOptions } from "./typesense.module.js";
|
|
16
|
+
export { TypesenseModule } from "./typesense.module.js";
|
|
17
|
+
export type { TypesenseMigrationStrategy, TypesenseModuleOptions, } from "./typesense.module-options.js";
|
|
18
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC/E,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAAE,oBAAoB,EAAE,MAAM,wCAAwC,CAAC;AAC9E,OAAO,EACL,0BAA0B,EAC1B,oBAAoB,EACpB,0BAA0B,GAC3B,MAAM,+CAA+C,CAAC;AACvD,YAAY,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AAC9E,YAAY,EAAE,WAAW,EAAE,MAAM,mCAAmC,CAAC;AACrE,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AACrE,YAAY,EACV,aAAa,EACb,uBAAuB,EACvB,mBAAmB,EACnB,6BAA6B,EAC7B,yBAAyB,EACzB,oBAAoB,GACrB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClF,YAAY,EACV,yBAAyB,EACzB,yBAAyB,EACzB,sBAAsB,EACtB,sBAAsB,GACvB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,sBAAsB,EACtB,iBAAiB,EACjB,cAAc,EACd,aAAa,EACb,aAAa,EACb,cAAc,EACd,iBAAiB,EACjB,cAAc,EACd,cAAc,EACd,eAAe,EACf,aAAa,EACb,eAAe,EACf,eAAe,GAChB,MAAM,wBAAwB,CAAC;AAChC,YAAY,EACV,cAAc,EACd,qBAAqB,EACrB,kBAAkB,EAClB,qBAAqB,GACtB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EACL,gBAAgB,EAChB,oBAAoB,EACpB,qBAAqB,EACrB,mBAAmB,EACnB,gBAAgB,EAChB,wBAAwB,GACzB,MAAM,0BAA0B,CAAC;AAClC,YAAY,EAAE,2BAA2B,EAAE,MAAM,uBAAuB,CAAC;AACzE,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,YAAY,EACV,0BAA0B,EAC1B,sBAAsB,GACvB,MAAM,+BAA+B,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TypesenseModule = exports.TYPESENSE_MODULE_OPTIONS = exports.TYPESENSE_FIELDS = exports.TYPESENSE_COLLECTOR = exports.TYPESENSE_COLLECTIONS = exports.TYPESENSE_COLLECTION = exports.TYPESENSE_CLIENT = exports.field = exports.createField = exports.TypesenseString = exports.TypesenseSchema = exports.TypesenseProp = exports.TypesenseObject = exports.TypesenseInt64 = exports.TypesenseInt32 = exports.TypesenseGeopoint = exports.TypesenseFloat = exports.TypesenseBool = exports.TypesenseAuto = exports.TypesenseArray = exports.resolveCollection = exports.getTypesenseCollection = exports.toSchema = exports.isCollection = exports.defineCollection = exports.TypesenseIndexer = exports.RegisterTypesenseCollector = exports.isTypesenseCollector = exports.getCollectorCollectionName = exports.TypesenseCollections = exports.TypesenseClient = void 0;
|
|
4
|
+
var typesense_client_js_1 = require("./client/typesense.client.js");
|
|
5
|
+
Object.defineProperty(exports, "TypesenseClient", { enumerable: true, get: function () { return typesense_client_js_1.TypesenseClient; } });
|
|
6
|
+
var typesense_collections_js_1 = require("./collections/typesense-collections.js");
|
|
7
|
+
Object.defineProperty(exports, "TypesenseCollections", { enumerable: true, get: function () { return typesense_collections_js_1.TypesenseCollections; } });
|
|
8
|
+
var typesense_collector_decorator_js_1 = require("./collectors/typesense-collector.decorator.js");
|
|
9
|
+
Object.defineProperty(exports, "getCollectorCollectionName", { enumerable: true, get: function () { return typesense_collector_decorator_js_1.getCollectorCollectionName; } });
|
|
10
|
+
Object.defineProperty(exports, "isTypesenseCollector", { enumerable: true, get: function () { return typesense_collector_decorator_js_1.isTypesenseCollector; } });
|
|
11
|
+
Object.defineProperty(exports, "RegisterTypesenseCollector", { enumerable: true, get: function () { return typesense_collector_decorator_js_1.RegisterTypesenseCollector; } });
|
|
12
|
+
var typesense_indexer_js_1 = require("./collectors/typesense-indexer.js");
|
|
13
|
+
Object.defineProperty(exports, "TypesenseIndexer", { enumerable: true, get: function () { return typesense_indexer_js_1.TypesenseIndexer; } });
|
|
14
|
+
var collection_js_1 = require("./schema/collection.js");
|
|
15
|
+
Object.defineProperty(exports, "defineCollection", { enumerable: true, get: function () { return collection_js_1.defineCollection; } });
|
|
16
|
+
Object.defineProperty(exports, "isCollection", { enumerable: true, get: function () { return collection_js_1.isCollection; } });
|
|
17
|
+
Object.defineProperty(exports, "toSchema", { enumerable: true, get: function () { return collection_js_1.toSchema; } });
|
|
18
|
+
var decorators_js_1 = require("./schema/decorators.js");
|
|
19
|
+
Object.defineProperty(exports, "getTypesenseCollection", { enumerable: true, get: function () { return decorators_js_1.getTypesenseCollection; } });
|
|
20
|
+
Object.defineProperty(exports, "resolveCollection", { enumerable: true, get: function () { return decorators_js_1.resolveCollection; } });
|
|
21
|
+
Object.defineProperty(exports, "TypesenseArray", { enumerable: true, get: function () { return decorators_js_1.TypesenseArray; } });
|
|
22
|
+
Object.defineProperty(exports, "TypesenseAuto", { enumerable: true, get: function () { return decorators_js_1.TypesenseAuto; } });
|
|
23
|
+
Object.defineProperty(exports, "TypesenseBool", { enumerable: true, get: function () { return decorators_js_1.TypesenseBool; } });
|
|
24
|
+
Object.defineProperty(exports, "TypesenseFloat", { enumerable: true, get: function () { return decorators_js_1.TypesenseFloat; } });
|
|
25
|
+
Object.defineProperty(exports, "TypesenseGeopoint", { enumerable: true, get: function () { return decorators_js_1.TypesenseGeopoint; } });
|
|
26
|
+
Object.defineProperty(exports, "TypesenseInt32", { enumerable: true, get: function () { return decorators_js_1.TypesenseInt32; } });
|
|
27
|
+
Object.defineProperty(exports, "TypesenseInt64", { enumerable: true, get: function () { return decorators_js_1.TypesenseInt64; } });
|
|
28
|
+
Object.defineProperty(exports, "TypesenseObject", { enumerable: true, get: function () { return decorators_js_1.TypesenseObject; } });
|
|
29
|
+
Object.defineProperty(exports, "TypesenseProp", { enumerable: true, get: function () { return decorators_js_1.TypesenseProp; } });
|
|
30
|
+
Object.defineProperty(exports, "TypesenseSchema", { enumerable: true, get: function () { return decorators_js_1.TypesenseSchema; } });
|
|
31
|
+
Object.defineProperty(exports, "TypesenseString", { enumerable: true, get: function () { return decorators_js_1.TypesenseString; } });
|
|
32
|
+
var field_js_1 = require("./schema/field.js");
|
|
33
|
+
Object.defineProperty(exports, "createField", { enumerable: true, get: function () { return field_js_1.createField; } });
|
|
34
|
+
Object.defineProperty(exports, "field", { enumerable: true, get: function () { return field_js_1.field; } });
|
|
35
|
+
var typesense_constants_js_1 = require("./typesense.constants.js");
|
|
36
|
+
Object.defineProperty(exports, "TYPESENSE_CLIENT", { enumerable: true, get: function () { return typesense_constants_js_1.TYPESENSE_CLIENT; } });
|
|
37
|
+
Object.defineProperty(exports, "TYPESENSE_COLLECTION", { enumerable: true, get: function () { return typesense_constants_js_1.TYPESENSE_COLLECTION; } });
|
|
38
|
+
Object.defineProperty(exports, "TYPESENSE_COLLECTIONS", { enumerable: true, get: function () { return typesense_constants_js_1.TYPESENSE_COLLECTIONS; } });
|
|
39
|
+
Object.defineProperty(exports, "TYPESENSE_COLLECTOR", { enumerable: true, get: function () { return typesense_constants_js_1.TYPESENSE_COLLECTOR; } });
|
|
40
|
+
Object.defineProperty(exports, "TYPESENSE_FIELDS", { enumerable: true, get: function () { return typesense_constants_js_1.TYPESENSE_FIELDS; } });
|
|
41
|
+
Object.defineProperty(exports, "TYPESENSE_MODULE_OPTIONS", { enumerable: true, get: function () { return typesense_constants_js_1.TYPESENSE_MODULE_OPTIONS; } });
|
|
42
|
+
var typesense_module_js_1 = require("./typesense.module.js");
|
|
43
|
+
Object.defineProperty(exports, "TypesenseModule", { enumerable: true, get: function () { return typesense_module_js_1.TypesenseModule; } });
|
|
44
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AACA,oEAA+D;AAAtD,sHAAA,eAAe,OAAA;AACxB,mFAA8E;AAArE,gIAAA,oBAAoB,OAAA;AAC7B,kGAIuD;AAHrD,8IAAA,0BAA0B,OAAA;AAC1B,wIAAA,oBAAoB,OAAA;AACpB,8IAAA,0BAA0B,OAAA;AAI5B,0EAAqE;AAA5D,wHAAA,gBAAgB,OAAA;AASzB,wDAAkF;AAAzE,iHAAA,gBAAgB,OAAA;AAAE,6GAAA,YAAY,OAAA;AAAE,yGAAA,QAAQ,OAAA;AAOjD,wDAcgC;AAb9B,uHAAA,sBAAsB,OAAA;AACtB,kHAAA,iBAAiB,OAAA;AACjB,+GAAA,cAAc,OAAA;AACd,8GAAA,aAAa,OAAA;AACb,8GAAA,aAAa,OAAA;AACb,+GAAA,cAAc,OAAA;AACd,kHAAA,iBAAiB,OAAA;AACjB,+GAAA,cAAc,OAAA;AACd,+GAAA,cAAc,OAAA;AACd,gHAAA,eAAe,OAAA;AACf,8GAAA,aAAa,OAAA;AACb,gHAAA,eAAe,OAAA;AACf,gHAAA,eAAe,OAAA;AAQjB,8CAAuD;AAA9C,uGAAA,WAAW,OAAA;AAAE,iGAAA,KAAK,OAAA;AAC3B,mEAOkC;AANhC,0HAAA,gBAAgB,OAAA;AAChB,8HAAA,oBAAoB,OAAA;AACpB,+HAAA,qBAAqB,OAAA;AACrB,6HAAA,mBAAmB,OAAA;AACnB,0HAAA,gBAAgB,OAAA;AAChB,kIAAA,wBAAwB,OAAA;AAG1B,6DAAwD;AAA/C,sHAAA,eAAe,OAAA"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import type { TypesenseField, TypesenseFieldType, TypesenseFieldTypeMap } from "./field.js";
|
|
2
|
+
/**
|
|
3
|
+
* Constraint for a collection's field map.
|
|
4
|
+
*
|
|
5
|
+
* The `optional` flag is left as `any` rather than `boolean` on purpose: a `boolean` here
|
|
6
|
+
* widens the literal `true`/`false` carried by each field during inference, which would
|
|
7
|
+
* collapse the required/optional split that `InferDocument` depends on.
|
|
8
|
+
*/
|
|
9
|
+
export type TypesenseFieldRecord = Record<string, TypesenseField<TypesenseFieldType, any>>;
|
|
10
|
+
/** Resolves a field declaration to its TypeScript value type, honouring `optional`. */
|
|
11
|
+
type FieldValue<TField extends TypesenseField> = TypesenseFieldTypeMap[TField["type"]];
|
|
12
|
+
type RequiredKeys<TFields extends TypesenseFieldRecord> = {
|
|
13
|
+
[K in keyof TFields]: TFields[K]["optional"] extends true ? never : K;
|
|
14
|
+
}[keyof TFields];
|
|
15
|
+
type OptionalKeys<TFields extends TypesenseFieldRecord> = {
|
|
16
|
+
[K in keyof TFields]: TFields[K]["optional"] extends true ? K : never;
|
|
17
|
+
}[keyof TFields];
|
|
18
|
+
/**
|
|
19
|
+
* The document shape for a collection, inferred from its field declarations.
|
|
20
|
+
* `id` is always present — Typesense requires it and we always index it.
|
|
21
|
+
*/
|
|
22
|
+
export type InferDocument<TCollection extends TypesenseCollection> = {
|
|
23
|
+
id: string;
|
|
24
|
+
} & {
|
|
25
|
+
[K in RequiredKeys<TCollection["fields"]>]: FieldValue<TCollection["fields"][K]>;
|
|
26
|
+
} & {
|
|
27
|
+
[K in OptionalKeys<TCollection["fields"]>]?: FieldValue<TCollection["fields"][K]>;
|
|
28
|
+
};
|
|
29
|
+
export interface TypesenseCollectionDefinition<TFields> {
|
|
30
|
+
/** Collection name in Typesense. Also the key used to resolve collectors. */
|
|
31
|
+
name: string;
|
|
32
|
+
fields: TFields;
|
|
33
|
+
/** Must name an int32/int64/float field. Typesense uses it to order unranked results. */
|
|
34
|
+
defaultSortingField?: keyof TFields & string;
|
|
35
|
+
/** Fields whose tokens are used for typo-tolerant matching by default. */
|
|
36
|
+
tokenSeparators?: string[];
|
|
37
|
+
symbolsToIndex?: string[];
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Returned instead of a collection when `fields` was not built with the `field.*` helpers.
|
|
41
|
+
* Surfaces as a type error at the definition site with a readable message.
|
|
42
|
+
*/
|
|
43
|
+
export interface InvalidCollectionFields<TMessage extends string> {
|
|
44
|
+
readonly __typesenseError: TMessage;
|
|
45
|
+
}
|
|
46
|
+
export interface TypesenseCollection<TFields extends TypesenseFieldRecord = TypesenseFieldRecord> {
|
|
47
|
+
readonly name: string;
|
|
48
|
+
readonly fields: TFields;
|
|
49
|
+
readonly defaultSortingField?: string;
|
|
50
|
+
readonly tokenSeparators?: string[];
|
|
51
|
+
readonly symbolsToIndex?: string[];
|
|
52
|
+
/** Stable hash of the schema. Changes whenever the shape changes. */
|
|
53
|
+
readonly hash: string;
|
|
54
|
+
}
|
|
55
|
+
/** Serialised form handed to the Typesense HTTP API. */
|
|
56
|
+
export interface TypesenseCollectionSchema {
|
|
57
|
+
name: string;
|
|
58
|
+
fields: {
|
|
59
|
+
name: string;
|
|
60
|
+
type: string;
|
|
61
|
+
index: boolean;
|
|
62
|
+
optional: boolean;
|
|
63
|
+
facet: boolean;
|
|
64
|
+
sort?: boolean;
|
|
65
|
+
}[];
|
|
66
|
+
default_sorting_field?: string;
|
|
67
|
+
token_separators?: string[];
|
|
68
|
+
symbols_to_index?: string[];
|
|
69
|
+
}
|
|
70
|
+
export declare function toSchema(collection: TypesenseCollection): TypesenseCollectionSchema;
|
|
71
|
+
/**
|
|
72
|
+
* Declares a collection. The returned object carries a schema hash used to detect drift
|
|
73
|
+
* between the code definition and the live collection at bootstrap.
|
|
74
|
+
*/
|
|
75
|
+
/**
|
|
76
|
+
* Declares a collection. The returned object carries a schema hash used to detect drift
|
|
77
|
+
* between the code definition and the live collection at bootstrap.
|
|
78
|
+
*
|
|
79
|
+
* `TFields` is intentionally unconstrained. A constraint mentioning `TypesenseField` becomes
|
|
80
|
+
* the inference target for each property and resets the field's `optional` flag to `boolean`,
|
|
81
|
+
* which would collapse the required/optional split in `InferDocument`. Validation therefore
|
|
82
|
+
* happens in the return type, where it cannot interfere with inference.
|
|
83
|
+
*/
|
|
84
|
+
export declare function defineCollection<TFields>(definition: TypesenseCollectionDefinition<TFields>): TFields extends TypesenseFieldRecord ? TypesenseCollection<TFields> : InvalidCollectionFields<"`fields` must be declared with the `field.*` builders">;
|
|
85
|
+
export declare function isCollection(value: unknown): value is TypesenseCollection;
|
|
86
|
+
export {};
|
|
87
|
+
//# sourceMappingURL=collection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collection.d.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F;AAED;;;GAGG;AACH;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EACtC,UAAU,EAAE,6BAA6B,CAAC,OAAO,CAAC,GACjD,OAAO,SAAS,oBAAoB,GACnC,mBAAmB,CAAC,OAAO,CAAC,GAC5B,uBAAuB,CAAC,uDAAuD,CAAC,CAiBnF;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,mBAAmB,CAOzE"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.toSchema = toSchema;
|
|
4
|
+
exports.defineCollection = defineCollection;
|
|
5
|
+
exports.isCollection = isCollection;
|
|
6
|
+
const node_crypto_1 = require("node:crypto");
|
|
7
|
+
function toSchema(collection) {
|
|
8
|
+
const fields = Object.entries(collection.fields)
|
|
9
|
+
// Sort by name so the emitted schema — and therefore the hash — is order-independent.
|
|
10
|
+
.sort(([a], [b]) => a.localeCompare(b))
|
|
11
|
+
.map(([name, f]) => ({
|
|
12
|
+
name,
|
|
13
|
+
type: f.type,
|
|
14
|
+
index: f.index,
|
|
15
|
+
optional: f.optional,
|
|
16
|
+
facet: f.facet,
|
|
17
|
+
...(f.sort === undefined ? {} : { sort: f.sort }),
|
|
18
|
+
}));
|
|
19
|
+
return {
|
|
20
|
+
name: collection.name,
|
|
21
|
+
fields: [{ name: "id", type: "string", index: true, optional: false, facet: false }, ...fields],
|
|
22
|
+
...(collection.defaultSortingField
|
|
23
|
+
? { default_sorting_field: collection.defaultSortingField }
|
|
24
|
+
: {}),
|
|
25
|
+
...(collection.tokenSeparators ? { token_separators: collection.tokenSeparators } : {}),
|
|
26
|
+
...(collection.symbolsToIndex ? { symbols_to_index: collection.symbolsToIndex } : {}),
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Declares a collection. The returned object carries a schema hash used to detect drift
|
|
31
|
+
* between the code definition and the live collection at bootstrap.
|
|
32
|
+
*/
|
|
33
|
+
/**
|
|
34
|
+
* Declares a collection. The returned object carries a schema hash used to detect drift
|
|
35
|
+
* between the code definition and the live collection at bootstrap.
|
|
36
|
+
*
|
|
37
|
+
* `TFields` is intentionally unconstrained. A constraint mentioning `TypesenseField` becomes
|
|
38
|
+
* the inference target for each property and resets the field's `optional` flag to `boolean`,
|
|
39
|
+
* which would collapse the required/optional split in `InferDocument`. Validation therefore
|
|
40
|
+
* happens in the return type, where it cannot interfere with inference.
|
|
41
|
+
*/
|
|
42
|
+
function defineCollection(definition) {
|
|
43
|
+
const collection = {
|
|
44
|
+
name: definition.name,
|
|
45
|
+
fields: definition.fields,
|
|
46
|
+
...(definition.defaultSortingField
|
|
47
|
+
? { defaultSortingField: definition.defaultSortingField }
|
|
48
|
+
: {}),
|
|
49
|
+
...(definition.tokenSeparators ? { tokenSeparators: definition.tokenSeparators } : {}),
|
|
50
|
+
...(definition.symbolsToIndex ? { symbolsToIndex: definition.symbolsToIndex } : {}),
|
|
51
|
+
hash: "",
|
|
52
|
+
};
|
|
53
|
+
const hash = (0, node_crypto_1.createHash)("sha256")
|
|
54
|
+
.update(JSON.stringify(toSchema(collection)))
|
|
55
|
+
.digest("hex");
|
|
56
|
+
return { ...collection, hash: hash.slice(0, 16) };
|
|
57
|
+
}
|
|
58
|
+
function isCollection(value) {
|
|
59
|
+
return (typeof value === "object" &&
|
|
60
|
+
value !== null &&
|
|
61
|
+
typeof value.name === "string" &&
|
|
62
|
+
typeof value.hash === "string");
|
|
63
|
+
}
|
|
64
|
+
//# sourceMappingURL=collection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collection.js","sourceRoot":"","sources":["../../src/schema/collection.ts"],"names":[],"mappings":";;AA+EA,4BAsBC;AAeD,4CAqBC;AAED,oCAOC;AAlJD,6CAAyC;AA+EzC,SAAgB,QAAQ,CAAC,UAA+B;IACtD,MAAM,MAAM,GAAG,MA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GAGG;AACH;;;;;;;;GAQG;AACH,SAAgB,gBAAgB,CAC9B,UAAkD;IAIlD,MAAM,UAAU,GAAG;QACjB,IAAI,EAAE,UAAU,CAAC,IAAI;QACrB,MAAM,EAAE,UAAU,CAAC,MAAM;QACzB,GAAG,CAAC,UAAU,CAAC,mBAAmB;YAChC,CAAC,CAAC,EAAE,mBAAmB,EAAE,UAAU,CAAC,mBAAmB,EAAE;YACzD,CAAC,CAAC,EAAE,CAAC;QACP,GAAG,CAAC,UAAU,CAAC,eAAe,CAAC,CAAC,CAAC,EAAE,eAAe,EAAE,UAAU,CAAC,eAAe,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACtF,GAAG,CAAC,UAAU,CAAC,cAAc,CAAC,CAAC,CAAC,EAAE,cAAc,EAAE,UAAU,CAAC,cAAc,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACnF,IAAI,EAAE,EAAE;KACyB,CAAC;IAEpC,MAAM,IAAI,GAAG,IAAA,wBAAU,EAAC,QAAQ,CAAC;SAC9B,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC,CAAC;SAC5C,MAAM,CAAC,KAAK,CAAC,CAAC;IAEjB,OAAO,EAAE,GAAG,UAAU,EAAE,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,EAAW,CAAC;AAC7D,CAAC;AAED,SAAgB,YAAY,CAAC,KAAc;IACzC,OAAO,CACL,OAAO,KAAK,KAAK,QAAQ;QACzB,KAAK,KAAK,IAAI;QACd,OAAQ,KAA6B,CAAC,IAAI,KAAK,QAAQ;QACvD,OAAQ,KAA6B,CAAC,IAAI,KAAK,QAAQ,CACxD,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import "reflect-metadata";
|
|
2
|
+
import { type TypesenseCollection } from "./collection.js";
|
|
3
|
+
import { type TypesenseFieldOptions, type TypesenseFieldType, type TypesenseFieldTypeMap } from "./field.js";
|
|
4
|
+
/** A class decorated with `@TypesenseSchema`. */
|
|
5
|
+
export type TypesenseDocumentClass = abstract new (...args: never[]) => object;
|
|
6
|
+
/** Either declaration style is accepted wherever a collection is expected. */
|
|
7
|
+
export type TypesenseCollectionSource = TypesenseCollection | TypesenseDocumentClass;
|
|
8
|
+
/**
|
|
9
|
+
* The property shape a field decorator demands of the class it annotates.
|
|
10
|
+
*
|
|
11
|
+
* This is what makes the decorators type-safe: `TOptional` and the field type both come
|
|
12
|
+
* from the same decorator call, so TypeScript can check the annotated property against
|
|
13
|
+
* them and reject a disagreement (as TS1240) at the declaration site. Splitting optionality
|
|
14
|
+
* into a separate stacked decorator would break this — the two calls are checked
|
|
15
|
+
* independently, so neither could see the other's flag.
|
|
16
|
+
*/
|
|
17
|
+
type PropTarget<TKey extends string, TType extends TypesenseFieldType, TOptional extends boolean> = TOptional extends true ? {
|
|
18
|
+
[K in TKey]?: TypesenseFieldTypeMap[TType];
|
|
19
|
+
} : {
|
|
20
|
+
[K in TKey]: TypesenseFieldTypeMap[TType];
|
|
21
|
+
};
|
|
22
|
+
export interface TypesenseSchemaOptions<TSortField extends string = string> {
|
|
23
|
+
/** Collection name in Typesense. Also the key used to resolve collectors. */
|
|
24
|
+
name: string;
|
|
25
|
+
/** Must name a decorated property. Typesense uses it to order unranked results. */
|
|
26
|
+
defaultSortingField?: TSortField;
|
|
27
|
+
tokenSeparators?: string[];
|
|
28
|
+
symbolsToIndex?: string[];
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Declares a class as a Typesense collection, using the fields its properties declare.
|
|
32
|
+
*
|
|
33
|
+
* Builds the same object `defineCollection` returns — including the schema hash — so the
|
|
34
|
+
* two declaration styles are interchangeable everywhere downstream.
|
|
35
|
+
*
|
|
36
|
+
* `TSortField` defaults to `never`, which makes the class constraint `Record<never, unknown>`
|
|
37
|
+
* (i.e. no constraint) when `defaultSortingField` is omitted, and requires the named property
|
|
38
|
+
* to exist on the class when it is given.
|
|
39
|
+
*/
|
|
40
|
+
export declare function TypesenseSchema<TSortField extends string = never>(options: TypesenseSchemaOptions<TSortField>): <TClass extends abstract new (...args: never[]) => Record<TSortField, unknown>>(target: TClass) => TClass;
|
|
41
|
+
/**
|
|
42
|
+
* Declares a field, naming its Typesense type explicitly.
|
|
43
|
+
*
|
|
44
|
+
* The per-type decorators below are the same thing with the type baked in; use whichever
|
|
45
|
+
* reads better. Both reject a property whose TypeScript type disagrees with the field.
|
|
46
|
+
*/
|
|
47
|
+
export declare function TypesenseProp<TType extends TypesenseFieldType, TOptional extends boolean = false>(options: TypesenseFieldOptions<TOptional> & {
|
|
48
|
+
type: TType;
|
|
49
|
+
}): <TKey extends string, TTarget extends PropTarget<TKey, TType, TOptional>>(target: TTarget, key: TKey) => void;
|
|
50
|
+
export declare const TypesenseString: <TOptional extends boolean = false>(options?: TypesenseFieldOptions<TOptional> | undefined) => <TKey extends string, TTarget extends PropTarget<TKey, "string", TOptional>>(target: TTarget, key: TKey) => void;
|
|
51
|
+
export declare const TypesenseInt32: <TOptional extends boolean = false>(options?: TypesenseFieldOptions<TOptional> | undefined) => <TKey extends string, TTarget extends PropTarget<TKey, "int32", TOptional>>(target: TTarget, key: TKey) => void;
|
|
52
|
+
export declare const TypesenseInt64: <TOptional extends boolean = false>(options?: TypesenseFieldOptions<TOptional> | undefined) => <TKey extends string, TTarget extends PropTarget<TKey, "int64", TOptional>>(target: TTarget, key: TKey) => void;
|
|
53
|
+
export declare const TypesenseFloat: <TOptional extends boolean = false>(options?: TypesenseFieldOptions<TOptional> | undefined) => <TKey extends string, TTarget extends PropTarget<TKey, "float", TOptional>>(target: TTarget, key: TKey) => void;
|
|
54
|
+
export declare const TypesenseBool: <TOptional extends boolean = false>(options?: TypesenseFieldOptions<TOptional> | undefined) => <TKey extends string, TTarget extends PropTarget<TKey, "bool", TOptional>>(target: TTarget, key: TKey) => void;
|
|
55
|
+
export declare const TypesenseGeopoint: <TOptional extends boolean = false>(options?: TypesenseFieldOptions<TOptional> | undefined) => <TKey extends string, TTarget extends PropTarget<TKey, "geopoint", TOptional>>(target: TTarget, key: TKey) => void;
|
|
56
|
+
export declare const TypesenseObject: <TOptional extends boolean = false>(options?: TypesenseFieldOptions<TOptional> | undefined) => <TKey extends string, TTarget extends PropTarget<TKey, "object", TOptional>>(target: TTarget, key: TKey) => void;
|
|
57
|
+
export declare const TypesenseAuto: <TOptional extends boolean = false>(options?: TypesenseFieldOptions<TOptional> | undefined) => <TKey extends string, TTarget extends PropTarget<TKey, "auto", TOptional>>(target: TTarget, key: TKey) => void;
|
|
58
|
+
/**
|
|
59
|
+
* Scalars that have an array counterpart. `auto` is absent from this union because
|
|
60
|
+
* `TypesenseFieldTypeMap` has no `auto[]` key — the exclusion is structural, not hardcoded.
|
|
61
|
+
*/
|
|
62
|
+
export type TypesenseArrayElementType = "string" | "int32" | "int64" | "float" | "bool" | "geopoint" | "object";
|
|
63
|
+
type ArrayOf<TElement extends TypesenseArrayElementType> = `${TElement}[]` & TypesenseFieldType;
|
|
64
|
+
/** Declares an array field. One decorator covers all seven array types. */
|
|
65
|
+
export declare function TypesenseArray<TElement extends TypesenseArrayElementType, TOptional extends boolean = false>(options: TypesenseFieldOptions<TOptional> & {
|
|
66
|
+
type: TElement;
|
|
67
|
+
}): <TKey extends string, TTarget extends PropTarget<TKey, ArrayOf<TElement>, TOptional>>(target: TTarget, key: TKey) => void;
|
|
68
|
+
/** The collection built for a decorated class, or undefined if it has no `@TypesenseSchema`. */
|
|
69
|
+
export declare function getTypesenseCollection(target: object): TypesenseCollection | undefined;
|
|
70
|
+
/** Normalises either declaration style to a collection. */
|
|
71
|
+
export declare function resolveCollection(source: TypesenseCollectionSource): TypesenseCollection;
|
|
72
|
+
export {};
|
|
73
|
+
//# sourceMappingURL=decorators.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"decorators.d.ts","sourceRoot":"","sources":["../../src/schema/decorators.ts"],"names":[],"mapp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