corequery 0.21.2 → 0.22.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "corequery",
3
- "version": "0.21.2",
3
+ "version": "0.22.0",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "server/dist",
@@ -29,7 +29,7 @@
29
29
  "@dan-schel/js-utils": "^4.14.1",
30
30
  "express": "^5.2.1",
31
31
  "node-html-parser": "^9.0.1",
32
- "sharp": "^0.34.5",
32
+ "sharp": "^0.35.3",
33
33
  "temporal-polyfill": "1.0.4",
34
34
  "zod": "^4.4.3"
35
35
  },
@@ -2,7 +2,7 @@ import type { AboutPageConfig, AssetConfig, FooterConfig, LandingPageConfig, Lin
2
2
  import type { Logger } from "../../server/logger/logger.js";
3
3
  import type { GetCanonicalLinesServingStopConfig } from "../../server/config/types/get-canonical-lines-serving-stop-config-func.js";
4
4
  import type { ServiceSourcesConfig } from "../../server/config/types/service-sources-config.js";
5
- export type CorequeryConfig = {
5
+ export type CorequeryConfig<CustomContextType = unknown> = {
6
6
  readonly logger: Logger;
7
7
  readonly port: number;
8
8
  readonly version: string;
@@ -17,4 +17,5 @@ export type CorequeryConfig = {
17
17
  readonly tags: TagsConfig;
18
18
  readonly getCanonicalLinesServingStop: GetCanonicalLinesServingStopConfig;
19
19
  readonly serviceSources: ServiceSourcesConfig;
20
+ readonly custom: CustomContextType;
20
21
  };
@@ -3,8 +3,8 @@ import { StopCollection } from "../server/data/stop-collection.js";
3
3
  import { LineCollection } from "../server/data/line-collection.js";
4
4
  import type { AboutPageConfig, FooterConfig, LandingPageConfig, TerminologyConfig } from "../server/config/index.js";
5
5
  import type { Logger } from "../server/logger/logger.js";
6
- export type CorequeryConfigBuilder = (corequery: Corequery) => CorequeryConfig;
7
- export declare class Corequery {
6
+ export type CorequeryConfigBuilder<CustomContextType> = (corequery: Corequery<CustomContextType>) => CorequeryConfig<CustomContextType>;
7
+ export declare class Corequery<CustomContextType = unknown> {
8
8
  private readonly _config;
9
9
  private readonly _webServer;
10
10
  readonly log: Logger;
@@ -17,7 +17,8 @@ export declare class Corequery {
17
17
  readonly footerConfig: FooterConfig;
18
18
  readonly aboutPageConfig: AboutPageConfig;
19
19
  readonly terminologyConfig: TerminologyConfig;
20
- constructor(configBuilder: CorequeryConfigBuilder);
20
+ readonly custom: CustomContextType;
21
+ constructor(configBuilder: CorequeryConfigBuilder<CustomContextType>);
21
22
  getCorequeryPackageVersion(): string;
22
23
  getFrontendVersion(): string;
23
24
  start(): Promise<void>;
@@ -19,6 +19,7 @@ export class Corequery {
19
19
  footerConfig;
20
20
  aboutPageConfig;
21
21
  terminologyConfig;
22
+ custom;
22
23
  constructor(configBuilder) {
23
24
  this._config = configBuilder(this);
24
25
  this._webServer = new WebServer(this, this._config.port, this._config.assets, env.COREQUERY_HOT_RELOAD ? "vite-middleware" : "dist-folder", serverFolderPath);
@@ -34,6 +35,7 @@ export class Corequery {
34
35
  this.footerConfig = this._config.footer;
35
36
  this.aboutPageConfig = this._config.aboutPage;
36
37
  this.terminologyConfig = this._config.terminology;
38
+ this.custom = this._config.custom;
37
39
  }
38
40
  getCorequeryPackageVersion() {
39
41
  if (this._corequeryPackageVersion == null) {
@@ -1 +1 @@
1
- {"version":3,"file":"corequery.js","sourceRoot":"","sources":["../../corequery.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAC;AACtC,OAAO,EAAE,SAAS,EAAE,MAAM,mCAAmC,CAAC;AAC9D,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAClE,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAOlE,OAAO,EAAE,0BAA0B,EAAE,MAAM,2CAA2C,CAAC;AAKvF,MAAM,OAAO,SAAS;IACH,OAAO,CAAkB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