@atscript/moost-db 0.1.46 → 0.1.48

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/index.cjs CHANGED
@@ -209,14 +209,11 @@ let AsDbReadableController = class AsDbReadableController {
209
209
  _serializedType;
210
210
  /** Moost application instance. */
211
211
  app;
212
- /** Cached search index list (static, computed once). */
213
- _searchIndexes;
214
212
  /** Cached full meta response (computed lazily on first meta() call). */
215
213
  _metaResponse;
216
214
  constructor(readable, app) {
217
215
  this.readable = readable;
218
216
  this.app = app;
219
- this._searchIndexes = readable.getSearchIndexes();
220
217
  this.logger = app.getLogger(`db [${readable.tableName}]`);
221
218
  this.logger.info(`Initializing ${readable.isView ? "view" : "table"} controller`);
222
219
  this._resolveHttpPath();
@@ -236,7 +233,7 @@ let AsDbReadableController = class AsDbReadableController {
236
233
  if (overview?.computedPrefix) this.readable.type.metadata.set("db.http.path", overview.computedPrefix);
237
234
  }
238
235
  /** Lazily serializes the type (after all controllers have set their @db.http.path). */
239
- get serializedType() {
236
+ getSerializedType() {
240
237
  if (!this._serializedType) this._serializedType = (0, _atscript_typescript_utils.serializeAnnotatedType)(this.readable.type, this.getSerializeOptions());
241
238
  return this._serializedType;
242
239
  }
@@ -529,12 +526,12 @@ let AsDbReadableController = class AsDbReadableController {
529
526
  this._metaResponse = {
530
527
  searchable: this.readable.isSearchable(),
531
528
  vectorSearchable: this.readable.isVectorSearchable(),
532
- searchIndexes: this._searchIndexes,
529
+ searchIndexes: this.readable.getSearchIndexes(),
533
530
  primaryKeys: [...this.readable.primaryKeys],
534
531
  readOnly: this._isReadOnly(),
535
532
  relations,
536
533
  fields,
537
- type: this.serializedType
534
+ type: this.getSerializedType()
538
535
  };
539
536
  return this._metaResponse;
540
537
  }
package/dist/index.d.cts CHANGED
@@ -23,15 +23,13 @@ declare class AsDbReadableController<T extends TAtscriptAnnotatedType = TAtscrip
23
23
  private _serializedType?;
24
24
  /** Moost application instance. */
25
25
  protected app: Moost;
26
- /** Cached search index list (static, computed once). */
27
- private _searchIndexes;
28
26
  /** Cached full meta response (computed lazily on first meta() call). */
29
27
  private _metaResponse?;
30
28
  constructor(readable: AtscriptDbReadable<T>, app: Moost);
31
29
  /** Sets @db.http.path on the type metadata from the controller's computed prefix. */
32
30
  private _resolveHttpPath;
33
31
  /** Lazily serializes the type (after all controllers have set their @db.http.path). */
34
- protected get serializedType(): _atscript_typescript_utils0.TSerializedAnnotatedType;
32
+ protected getSerializedType(): _atscript_typescript_utils0.TSerializedAnnotatedType;
35
33
  /**
36
34
  * One-time initialization hook. Override to seed data, register watchers, etc.
37
35
  */
package/dist/index.d.mts CHANGED
@@ -23,15 +23,13 @@ declare class AsDbReadableController<T extends TAtscriptAnnotatedType = TAtscrip
23
23
  private _serializedType?;
24
24
  /** Moost application instance. */
25
25
  protected app: Moost;
26
- /** Cached search index list (static, computed once). */
27
- private _searchIndexes;
28
26
  /** Cached full meta response (computed lazily on first meta() call). */
29
27
  private _metaResponse?;
30
28
  constructor(readable: AtscriptDbReadable<T>, app: Moost);
31
29
  /** Sets @db.http.path on the type metadata from the controller's computed prefix. */
32
30
  private _resolveHttpPath;
33
31
  /** Lazily serializes the type (after all controllers have set their @db.http.path). */
34
- protected get serializedType(): _atscript_typescript_utils0.TSerializedAnnotatedType;
32
+ protected getSerializedType(): _atscript_typescript_utils0.TSerializedAnnotatedType;
35
33
  /**
36
34
  * One-time initialization hook. Override to seed data, register watchers, etc.
37
35
  */
package/dist/index.mjs CHANGED
@@ -208,14 +208,11 @@ let AsDbReadableController = class AsDbReadableController {
208
208
  _serializedType;
209
209
  /** Moost application instance. */
210
210
  app;
211
- /** Cached search index list (static, computed once). */
212
- _searchIndexes;
213
211
  /** Cached full meta response (computed lazily on first meta() call). */
214
212
  _metaResponse;
215
213
  constructor(readable, app) {
216
214
  this.readable = readable;
217
215
  this.app = app;
218
- this._searchIndexes = readable.getSearchIndexes();
219
216
  this.logger = app.getLogger(`db [${readable.tableName}]`);
220
217
  this.logger.info(`Initializing ${readable.isView ? "view" : "table"} controller`);
221
218
  this._resolveHttpPath();
@@ -235,7 +232,7 @@ let AsDbReadableController = class AsDbReadableController {
235
232
  if (overview?.computedPrefix) this.readable.type.metadata.set("db.http.path", overview.computedPrefix);
236
233
  }
237
234
  /** Lazily serializes the type (after all controllers have set their @db.http.path). */
238
- get serializedType() {
235
+ getSerializedType() {
239
236
  if (!this._serializedType) this._serializedType = serializeAnnotatedType(this.readable.type, this.getSerializeOptions());
240
237
  return this._serializedType;
241
238
  }
@@ -528,12 +525,12 @@ let AsDbReadableController = class AsDbReadableController {
528
525
  this._metaResponse = {
529
526
  searchable: this.readable.isSearchable(),
530
527
  vectorSearchable: this.readable.isVectorSearchable(),
531
- searchIndexes: this._searchIndexes,
528
+ searchIndexes: this.readable.getSearchIndexes(),
532
529
  primaryKeys: [...this.readable.primaryKeys],
533
530
  readOnly: this._isReadOnly(),
534
531
  relations,
535
532
  fields,
536
- type: this.serializedType
533
+ type: this.getSerializedType()
537
534
  };
538
535
  return this._metaResponse;
539
536
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atscript/moost-db",
3
- "version": "0.1.46",
3
+ "version": "0.1.48",
4
4
  "description": "Generic database controller for Moost with Atscript.",
5
5
  "keywords": [
6
6
  "annotations",
@@ -38,22 +38,22 @@
38
38
  "access": "public"
39
39
  },
40
40
  "dependencies": {
41
- "@uniqu/url": "^0.1.2"
41
+ "@uniqu/url": "^0.1.3"
42
42
  },
43
43
  "devDependencies": {
44
44
  "@atscript/core": "^0.1.47",
45
45
  "@atscript/typescript": "^0.1.47",
46
46
  "@moostjs/event-http": "^0.6.6",
47
- "@uniqu/core": "^0.1.2",
47
+ "@uniqu/core": "^0.1.3",
48
48
  "moost": "^0.6.6",
49
49
  "unplugin-atscript": "^0.1.47"
50
50
  },
51
51
  "peerDependencies": {
52
52
  "@atscript/typescript": "^0.1.47",
53
53
  "@moostjs/event-http": "^0.6.6",
54
- "@uniqu/core": "^0.1.2",
54
+ "@uniqu/core": "^0.1.3",
55
55
  "moost": "^0.6.6",
56
- "@atscript/db": "^0.1.46"
56
+ "@atscript/db": "^0.1.48"
57
57
  },
58
58
  "scripts": {
59
59
  "postinstall": "asc -f dts",