@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.
- package/.env.example +24 -25
- package/CHANGELOG.md +24 -0
- package/bootstrapLambda.test.ts +68 -0
- package/config/config.dev.json +8 -0
- package/config/config.example.json +8 -0
- package/config/config.json +1 -0
- package/config/config.production.json +8 -0
- package/config/config.scouts.dev.json +3 -0
- package/config/config.scouts.production.json +4 -0
- package/didWebLambda.test.ts +41 -0
- package/didWebLambda.ts +13 -19
- package/didWebLambdaApp.ts +23 -0
- package/dist/config/applyDockerStageConfig.d.ts +2 -0
- package/dist/config/applyDockerStageConfig.d.ts.map +1 -0
- package/dist/config/serverlessFunctionEnv.test.d.ts +2 -0
- package/dist/config/serverlessFunctionEnv.test.d.ts.map +1 -0
- package/dist/config/stageConfig.d.ts +10 -0
- package/dist/config/stageConfig.d.ts.map +1 -0
- package/dist/config/stageConfig.test.d.ts +2 -0
- package/dist/config/stageConfig.test.d.ts.map +1 -0
- package/dist/didkit_wasm_bg.wasm +0 -0
- package/dist/docker-entry.d.ts +1 -1
- package/dist/docker-entry.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/esbuildPlugins.cjs +1 -0
- package/lambda.ts +22 -153
- package/lambdaApp.ts +163 -0
- package/oidcLambda.test.ts +41 -0
- package/oidcLambda.ts +13 -19
- package/oidcLambdaApp.ts +23 -0
- package/package.json +18 -16
- package/serverless-local.yml +3 -1
- package/serverless.function-env.cjs +31 -0
- package/serverless.yml +13 -29
- package/src/config/applyDockerStageConfig.ts +6 -0
- package/src/config/serverlessFunctionEnv.test.ts +81 -0
- package/src/config/stageConfig.test.ts +26 -0
- package/src/config/stageConfig.ts +24 -0
- package/src/docker-entry.ts +2 -0
- package/vitest.config.ts +3 -0
- package/xApiLambda.test.ts +41 -0
- package/xApiLambda.ts +13 -19
- package/xApiLambdaApp.ts +23 -0
package/xApiLambda.ts
CHANGED
|
@@ -1,23 +1,17 @@
|
|
|
1
|
-
import
|
|
2
|
-
import * as Sentry from '@sentry/serverless';
|
|
1
|
+
import { bootstrapLambda } from '@learncard/service-config';
|
|
3
2
|
|
|
4
|
-
import
|
|
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
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
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 =
|
|
22
|
-
|
|
23
|
-
);
|
|
16
|
+
export const xApiHandler = async (...args: Parameters<XApiApp['xApiHandler']>) =>
|
|
17
|
+
(await getApplication()).xApiHandler(...args);
|
package/xApiLambdaApp.ts
ADDED
|
@@ -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
|
+
);
|