@squiz/render-runtime-lib 1.64.0 → 1.65.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/lib/ioc.d.ts CHANGED
@@ -23,6 +23,9 @@ export interface Services {
23
23
  renderInputService: RenderInputService;
24
24
  componentRootUrlResolver: ComponentRootUrlResolver;
25
25
  }
26
+ export interface Config {
27
+ enableDevMode?: boolean;
28
+ }
26
29
  declare let iocContainer: IocContainer;
27
- export declare const initIocContainer: (services: Services) => Container;
30
+ export declare const initIocContainer: (services: Services, config: Config) => Container;
28
31
  export { iocContainer };
@@ -4953,13 +4953,32 @@
4953
4953
  ],
4954
4954
  "type": "object",
4955
4955
  "additionalProperties": {}
4956
+ },
4957
+ "ComponentManifest": {
4958
+ "$ref": "#/components/schemas/MANIFEST_MODELS.v1.ComponentManifest"
4959
+ },
4960
+ "ComponentSchema": {
4961
+ "properties": {
4962
+ "schema": {
4963
+ "additionalProperties": false,
4964
+ "type": "object"
4965
+ },
4966
+ "name": {
4967
+ "type": "string"
4968
+ }
4969
+ },
4970
+ "required": [
4971
+ "schema",
4972
+ "name"
4973
+ ],
4974
+ "type": "object"
4956
4975
  }
4957
4976
  },
4958
4977
  "securitySchemes": {}
4959
4978
  },
4960
4979
  "info": {
4961
4980
  "title": "@squiz/render-runtime-lib",
4962
- "version": "1.63.4",
4981
+ "version": "1.64.0",
4963
4982
  "description": "Package of rendering utilities for components",
4964
4983
  "license": {
4965
4984
  "name": "ISC"
@@ -4,13 +4,13 @@ import supertest from 'supertest';
4
4
  import { type Express } from 'express';
5
5
  import { NodeSandbox } from '@squiz/runtime-sandbox-node';
6
6
  import { Logger } from '@squiz/dx-logger-lib';
7
- import { Services } from '../../ioc';
7
+ import { Services, Config } from '../../ioc';
8
8
  import { ComponentLogger } from '@squiz/component-logger-lib';
9
9
  export declare const testLogger: Logger;
10
10
  export declare const testComponentLogger: ComponentLogger;
11
11
  export declare const createTestSandbox: () => NodeSandbox;
12
12
  export declare function getTestComponentFolder(): string;
13
- export declare function setupTestApp(services?: Partial<Services>): {
13
+ export declare function setupTestApp(services?: Partial<Services>, config?: Partial<Config>): {
14
14
  server: http.Server;
15
15
  app: Express;
16
16
  };
@@ -18,7 +18,7 @@ export declare function getTestWebServer(services?: Partial<Services>): supertes
18
18
  export declare class TestServer {
19
19
  private server;
20
20
  private app;
21
- constructor(services?: Partial<Services>);
21
+ constructor(services?: Partial<Services>, config?: Partial<Config>);
22
22
  get request(): supertest.SuperTest<supertest.Test>;
23
23
  start(): void;
24
24
  stop(): void;
@@ -1,3 +1,3 @@
1
1
  import { type Express } from 'express';
2
- import { type Services } from '../ioc';
3
- export declare function setupApp(services: Services): Express;
2
+ import { type Services, type Config } from '../ioc';
3
+ export declare function setupApp(services: Services, config?: Config): Express;
@@ -0,0 +1,20 @@
1
+ import { Controller } from 'tsoa';
2
+ import { ManifestService } from '@squiz/component-lib';
3
+ import { MANIFEST_MODELS } from '@squiz/dx-json-schema-lib';
4
+ import { ComponentRunnerService } from '../../component-runner';
5
+ import { Config } from '../../ioc';
6
+ type ComponentManifest = MANIFEST_MODELS.v1.ComponentManifest;
7
+ type ComponentSchema = {
8
+ name: string;
9
+ schema: object;
10
+ };
11
+ export declare class DevelopmentController extends Controller {
12
+ private config;
13
+ private manifestService;
14
+ private componentRunnerService;
15
+ constructor(config: Config, manifestService: ManifestService, componentRunnerService: ComponentRunnerService);
16
+ getComponents(): Promise<ComponentManifest[]>;
17
+ Manifest(namespace: string, componentName: string, version: string): Promise<ComponentManifest>;
18
+ getContentSchema(namespace: string, componentName: string, version: string): Promise<ComponentSchema[]>;
19
+ }
20
+ export {};
@@ -0,0 +1,2 @@
1
+ import supertest from 'supertest';
2
+ export declare function developmentRouteTests(request: () => supertest.SuperTest<supertest.Test>, devModeEnabled: boolean): void;
@@ -20219,9 +20219,9 @@ var require_errorMiddleware = __commonJS({
20219
20219
  "function-name": error.functionName,
20220
20220
  "component-name": error.componentName,
20221
20221
  "component-version": error.componentVersion,
20222
- "set-web-path": error.setWebPath,
20223
20222
  "log-command": "exception-handler"
20224
20223
  });
20224
+ return res.status(statusCode).send(`<!-- ${error.message} -->`);
20225
20225
  } else if ((error === null || error === void 0 ? void 0 : error.name) === "ValidateError") {
20226
20226
  req.log.error(`Caught validation error for ${req.path}:`, error.fields);
20227
20227
  return res.status(error.status).json({
@@ -61091,7 +61091,8 @@ var require_CloudflareApiKeyService = __commonJS({
61091
61091
  constructor(secretName, logger) {
61092
61092
  this.secretName = secretName;
61093
61093
  this.secretsClient = new client_secrets_manager_1.SecretsManagerClient({
61094
- region: "ap-southeast-2"
61094
+ // TODO: requires release
61095
+ // region: 'ap-southeast-2',
61095
61096
  });
61096
61097
  if (!logger) {
61097
61098
  logger = (0, dx_logger_lib_1.getLogger)({ name: "CloudflareApiKeyService" });
@@ -82126,9 +82127,9 @@ var require_lib6 = __commonJS({
82126
82127
  "function-name": error.functionName,
82127
82128
  "component-name": error.componentName,
82128
82129
  "component-version": error.componentVersion,
82129
- "set-web-path": error.setWebPath,
82130
82130
  "log-command": "exception-handler"
82131
82131
  });
82132
+ return res.status(statusCode).send(`<!-- ${error.message} -->`);
82132
82133
  } else if ((error === null || error === void 0 ? void 0 : error.name) === "ValidateError") {
82133
82134
  req.log.error(`Caught validation error for ${req.path}:`, error.fields);
82134
82135
  return res.status(error.status).json({
@@ -120869,7 +120870,8 @@ ${originalIndentation}`;
120869
120870
  constructor(secretName, logger2) {
120870
120871
  this.secretName = secretName;
120871
120872
  this.secretsClient = new client_secrets_manager_1.SecretsManagerClient({
120872
- region: "ap-southeast-2"
120873
+ // TODO: requires release
120874
+ // region: 'ap-southeast-2',
120873
120875
  });
120874
120876
  if (!logger2) {
120875
120877
  logger2 = (0, dx_logger_lib_1.getLogger)({ name: "CloudflareApiKeyService" });
@@ -241597,7 +241599,7 @@ tslib/tslib.es6.js:
241597
241599
  */
241598
241600
  /**
241599
241601
  * @title @squiz/content-api
241600
- * @version 1.63.5
241602
+ * @version 1.65.0
241601
241603
  * @license ISC
241602
241604
  * @baseUrl /
241603
241605
  * @contact