@lti-tool/core 1.0.0 → 1.0.1

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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @lti-tool/core
2
2
 
3
+ ## 1.0.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 162f5e0: Initial commit of production MySql storage adapter.
8
+
3
9
  ## 1.0.0
4
10
 
5
11
  ### Major Changes
package/dist/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  export * from './interfaces/index.js';
2
2
  export * from './schemas/index.js';
3
+ export { isServerlessEnvironment } from './utils/environment.js';
3
4
  export { LTITool } from './ltiTool.js';
4
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC;AACnC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC;AACnC,OAAO,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AACjE,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC"}
package/dist/index.js CHANGED
@@ -1,3 +1,4 @@
1
1
  export * from './interfaces/index.js';
2
2
  export * from './schemas/index.js';
3
+ export { isServerlessEnvironment } from './utils/environment.js';
3
4
  export { LTITool } from './ltiTool.js';
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Detects if the application is running in a serverless environment.
3
+ *
4
+ * Checks for environment variables commonly set by serverless platforms:
5
+ * - AWS Lambda: AWS_LAMBDA_FUNCTION_NAME, AWS_EXECUTION_ENV, LAMBDA_TASK_ROOT
6
+ * - Google Cloud Functions/Run: FUNCTION_NAME, FUNCTION_TARGET, K_SERVICE
7
+ * - Azure Functions: FUNCTIONS_WORKER_RUNTIME, AZURE_FUNCTIONS_ENVIRONMENT
8
+ * - Vercel: VERCEL, VERCEL_ENV
9
+ * - Netlify Functions: NETLIFY
10
+ *
11
+ * @returns true if serverless environment detected, false otherwise
12
+ */
13
+ export declare function isServerlessEnvironment(): boolean;
14
+ //# sourceMappingURL=environment.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"environment.d.ts","sourceRoot":"","sources":["../../src/utils/environment.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,wBAAgB,uBAAuB,IAAI,OAAO,CAoBjD"}
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Detects if the application is running in a serverless environment.
3
+ *
4
+ * Checks for environment variables commonly set by serverless platforms:
5
+ * - AWS Lambda: AWS_LAMBDA_FUNCTION_NAME, AWS_EXECUTION_ENV, LAMBDA_TASK_ROOT
6
+ * - Google Cloud Functions/Run: FUNCTION_NAME, FUNCTION_TARGET, K_SERVICE
7
+ * - Azure Functions: FUNCTIONS_WORKER_RUNTIME, AZURE_FUNCTIONS_ENVIRONMENT
8
+ * - Vercel: VERCEL, VERCEL_ENV
9
+ * - Netlify Functions: NETLIFY
10
+ *
11
+ * @returns true if serverless environment detected, false otherwise
12
+ */
13
+ export function isServerlessEnvironment() {
14
+ return !!(
15
+ // AWS Lambda
16
+ (process.env.AWS_LAMBDA_FUNCTION_NAME ||
17
+ process.env.AWS_EXECUTION_ENV ||
18
+ process.env.LAMBDA_TASK_ROOT ||
19
+ // Google Cloud Functions / Cloud Run
20
+ process.env.FUNCTION_NAME ||
21
+ process.env.FUNCTION_TARGET ||
22
+ process.env.K_SERVICE ||
23
+ // Azure Functions
24
+ process.env.FUNCTIONS_WORKER_RUNTIME ||
25
+ process.env.AZURE_FUNCTIONS_ENVIRONMENT ||
26
+ // Vercel
27
+ process.env.VERCEL ||
28
+ // Netlify Functions
29
+ process.env.NETLIFY));
30
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lti-tool/core",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "LTI 1.3 implementation for Node.js",
5
5
  "keywords": [
6
6
  "lti",
package/src/index.ts CHANGED
@@ -1,3 +1,4 @@
1
1
  export * from './interfaces/index.js';
2
2
  export * from './schemas/index.js';
3
+ export { isServerlessEnvironment } from './utils/environment.js';
3
4
  export { LTITool } from './ltiTool.js';
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Detects if the application is running in a serverless environment.
3
+ *
4
+ * Checks for environment variables commonly set by serverless platforms:
5
+ * - AWS Lambda: AWS_LAMBDA_FUNCTION_NAME, AWS_EXECUTION_ENV, LAMBDA_TASK_ROOT
6
+ * - Google Cloud Functions/Run: FUNCTION_NAME, FUNCTION_TARGET, K_SERVICE
7
+ * - Azure Functions: FUNCTIONS_WORKER_RUNTIME, AZURE_FUNCTIONS_ENVIRONMENT
8
+ * - Vercel: VERCEL, VERCEL_ENV
9
+ * - Netlify Functions: NETLIFY
10
+ *
11
+ * @returns true if serverless environment detected, false otherwise
12
+ */
13
+ export function isServerlessEnvironment(): boolean {
14
+ return !!(
15
+ // AWS Lambda
16
+ (
17
+ process.env.AWS_LAMBDA_FUNCTION_NAME ||
18
+ process.env.AWS_EXECUTION_ENV ||
19
+ process.env.LAMBDA_TASK_ROOT ||
20
+ // Google Cloud Functions / Cloud Run
21
+ process.env.FUNCTION_NAME ||
22
+ process.env.FUNCTION_TARGET ||
23
+ process.env.K_SERVICE ||
24
+ // Azure Functions
25
+ process.env.FUNCTIONS_WORKER_RUNTIME ||
26
+ process.env.AZURE_FUNCTIONS_ENVIRONMENT ||
27
+ // Vercel
28
+ process.env.VERCEL ||
29
+ // Netlify Functions
30
+ process.env.NETLIFY
31
+ )
32
+ );
33
+ }