@learncard/learn-cloud-service 2.5.35 → 2.5.36

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.
Files changed (43) hide show
  1. package/.env.example +24 -25
  2. package/CHANGELOG.md +24 -0
  3. package/bootstrapLambda.test.ts +68 -0
  4. package/config/config.dev.json +8 -0
  5. package/config/config.example.json +8 -0
  6. package/config/config.json +1 -0
  7. package/config/config.production.json +8 -0
  8. package/config/config.scouts.dev.json +3 -0
  9. package/config/config.scouts.production.json +4 -0
  10. package/didWebLambda.test.ts +41 -0
  11. package/didWebLambda.ts +13 -19
  12. package/didWebLambdaApp.ts +23 -0
  13. package/dist/config/applyDockerStageConfig.d.ts +2 -0
  14. package/dist/config/applyDockerStageConfig.d.ts.map +1 -0
  15. package/dist/config/serverlessFunctionEnv.test.d.ts +2 -0
  16. package/dist/config/serverlessFunctionEnv.test.d.ts.map +1 -0
  17. package/dist/config/stageConfig.d.ts +10 -0
  18. package/dist/config/stageConfig.d.ts.map +1 -0
  19. package/dist/config/stageConfig.test.d.ts +2 -0
  20. package/dist/config/stageConfig.test.d.ts.map +1 -0
  21. package/dist/didkit_wasm_bg.wasm +0 -0
  22. package/dist/docker-entry.d.ts +1 -1
  23. package/dist/docker-entry.d.ts.map +1 -1
  24. package/dist/index.js +2 -2
  25. package/esbuildPlugins.cjs +1 -0
  26. package/lambda.ts +22 -153
  27. package/lambdaApp.ts +163 -0
  28. package/oidcLambda.test.ts +41 -0
  29. package/oidcLambda.ts +13 -19
  30. package/oidcLambdaApp.ts +23 -0
  31. package/package.json +18 -16
  32. package/serverless-local.yml +3 -1
  33. package/serverless.function-env.cjs +31 -0
  34. package/serverless.yml +13 -29
  35. package/src/config/applyDockerStageConfig.ts +6 -0
  36. package/src/config/serverlessFunctionEnv.test.ts +81 -0
  37. package/src/config/stageConfig.test.ts +26 -0
  38. package/src/config/stageConfig.ts +24 -0
  39. package/src/docker-entry.ts +2 -0
  40. package/vitest.config.ts +3 -0
  41. package/xApiLambda.test.ts +41 -0
  42. package/xApiLambda.ts +13 -19
  43. package/xApiLambdaApp.ts +23 -0
package/xApiLambda.ts CHANGED
@@ -1,23 +1,17 @@
1
- import serverlessHttp from 'serverless-http';
2
- import * as Sentry from '@sentry/serverless';
1
+ import { bootstrapLambda } from '@learncard/service-config';
3
2
 
4
- import xApiApp from './src/xapi';
5
- import { environment } from './src/config/environment';
6
- import { toServerlessApplication } from './src/helpers/serverlessApplication';
3
+ import { base, stages } from './src/config/stageConfig';
7
4
 
8
- Sentry.AWSLambda.init({
9
- dsn: environment.SENTRY_DSN,
10
- environment: environment.SENTRY_ENV,
11
- enabled: Boolean(environment.SENTRY_DSN),
12
- tracesSampleRate: 1.0,
13
- integrations: [
14
- new Sentry.Integrations.Console(),
15
- new Sentry.Integrations.Http(),
16
- new Sentry.Integrations.ContextLines(),
17
- new Sentry.Integrations.Mongo(),
18
- ],
5
+ type XApiApp = typeof import('./xApiLambdaApp');
6
+
7
+ const getApplication = bootstrapLambda<XApiApp>({
8
+ base,
9
+ stages,
10
+ stage: process.env.AWS_LAMBDA_FUNCTION_NAME
11
+ ? process.env.LAMBDA_STAGE
12
+ : process.env.CONFIG_STAGE,
13
+ importApp: () => import('./xApiLambdaApp'),
19
14
  });
20
15
 
21
- export const xApiHandler = Sentry.AWSLambda.wrapHandler(
22
- serverlessHttp(toServerlessApplication(xApiApp))
23
- );
16
+ export const xApiHandler = async (...args: Parameters<XApiApp['xApiHandler']>) =>
17
+ (await getApplication()).xApiHandler(...args);
@@ -0,0 +1,23 @@
1
+ import serverlessHttp from 'serverless-http';
2
+ import * as Sentry from '@sentry/serverless';
3
+
4
+ import xApiApp from './src/xapi';
5
+ import { environment } from './src/config/environment';
6
+ import { toServerlessApplication } from './src/helpers/serverlessApplication';
7
+
8
+ Sentry.AWSLambda.init({
9
+ dsn: environment.SENTRY_DSN,
10
+ environment: environment.SENTRY_ENV,
11
+ enabled: Boolean(environment.SENTRY_DSN),
12
+ tracesSampleRate: 1.0,
13
+ integrations: [
14
+ new Sentry.Integrations.Console(),
15
+ new Sentry.Integrations.Http(),
16
+ new Sentry.Integrations.ContextLines(),
17
+ new Sentry.Integrations.Mongo(),
18
+ ],
19
+ });
20
+
21
+ export const xApiHandler = Sentry.AWSLambda.wrapHandler(
22
+ serverlessHttp(toServerlessApplication(xApiApp))
23
+ );