@friggframework/core 2.0.0--canary.664.a0b36e4.0 → 2.0.0--canary.666.81647c4.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.
@@ -1,6 +1,9 @@
1
1
  const { findNearestBackendPackageJson } = require('@friggframework/core/utils');
2
2
  const path = require('node:path');
3
3
  const fs = require('fs-extra');
4
+ const {
5
+ applyAppDefinitionDefaults,
6
+ } = require('@friggframework/schemas/app-definition');
4
7
  const { resolveTelemetryConfig } = require('../telemetry/telemetry-config');
5
8
  const { registerDeniedKeys } = require('../logs/denied-keys');
6
9
  const {
@@ -33,7 +36,9 @@ function registerCredentialLogKeys(appDefinition, integrations) {
33
36
  * @function loadAppDefinition
34
37
  * @description Searches for the nearest backend package.json, loads the corresponding index.js file,
35
38
  * and extracts the application definition containing integrations and user configuration.
36
- * @returns {{integrations: Array<object>, userConfig: object | null, adminScripts: Array<object>, reports: Array<object>, admin: object, telemetry: object, logging: object | null}} An object containing the application definition.
39
+ * The defaults declared in the app-definition schema are applied first (ADR-051), so
40
+ * `userConfig` always holds a complete user config, also when the app omits `user`.
41
+ * @returns {{integrations: Array<object>, userConfig: object, adminScripts: Array<object>, reports: Array<object>, admin: object, telemetry: object, logging: object | null}} An object containing the application definition.
37
42
  * @throws {Error} Throws error if backend package.json cannot be found.
38
43
  * @throws {Error} Throws error if index.js file cannot be found in the backend directory.
39
44
  * @example
@@ -53,7 +58,9 @@ function loadAppDefinition() {
53
58
  }
54
59
 
55
60
  const backendJsFile = require(backendFilePath);
56
- const appDefinition = backendJsFile.Definition;
61
+ // The one place schema defaults are applied at runtime (ADR-051): a
62
+ // default in app-definition.schema.json is the value core sees.
63
+ const appDefinition = applyAppDefinitionDefaults(backendJsFile.Definition);
57
64
 
58
65
  const {
59
66
  integrations = [],
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@friggframework/core",
3
3
  "prettier": "@friggframework/prettier-config",
4
- "version": "2.0.0--canary.664.a0b36e4.0",
4
+ "version": "2.0.0--canary.666.81647c4.0",
5
5
  "dependencies": {
6
6
  "@aws-sdk/client-apigatewaymanagementapi": "^3.588.0",
7
7
  "@aws-sdk/client-kms": "^3.588.0",
@@ -10,6 +10,7 @@
10
10
  "@aws-sdk/client-sqs": "^3.588.0",
11
11
  "@aws-sdk/client-ssm": "^3.588.0",
12
12
  "@aws-sdk/s3-request-presigner": "^3.588.0",
13
+ "@friggframework/schemas": "2.0.0--canary.666.81647c4.0",
13
14
  "@hapi/boom": "^10.0.1",
14
15
  "@opentelemetry/api": "^1.9.1",
15
16
  "@opentelemetry/context-async-hooks": "^2.9.0",
@@ -47,9 +48,9 @@
47
48
  }
48
49
  },
49
50
  "devDependencies": {
50
- "@friggframework/eslint-config": "2.0.0--canary.664.a0b36e4.0",
51
- "@friggframework/prettier-config": "2.0.0--canary.664.a0b36e4.0",
52
- "@friggframework/test": "2.0.0--canary.664.a0b36e4.0",
51
+ "@friggframework/eslint-config": "2.0.0--canary.666.81647c4.0",
52
+ "@friggframework/prettier-config": "2.0.0--canary.666.81647c4.0",
53
+ "@friggframework/test": "2.0.0--canary.666.81647c4.0",
53
54
  "@prisma/client": "^6.19.3",
54
55
  "@types/lodash": "4.17.15",
55
56
  "@typescript-eslint/eslint-plugin": "^8.0.0",
@@ -89,5 +90,5 @@
89
90
  "publishConfig": {
90
91
  "access": "public"
91
92
  },
92
- "gitHead": "a0b36e4677d1a9b2b0387e9b2b6b59ab76cf8098"
93
+ "gitHead": "81647c4f85dd9b1e8e69b2bddcb09b1759341bf8"
93
94
  }