@quiltdata/benchling-webhook 0.4.13

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/index.ts ADDED
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Benchling Webhook Integration for Quilt
3
+ *
4
+ * This module exports CDK constructs for deploying a Benchling webhook integration
5
+ * that creates Quilt packages from Benchling lab notebook entries.
6
+ *
7
+ * @example Basic usage
8
+ * ```typescript
9
+ * import * as cdk from 'aws-cdk-lib';
10
+ * import { BenchlingWebhookStack } from 'quilt-benchling-webhook';
11
+ *
12
+ * const app = new cdk.App();
13
+ * new BenchlingWebhookStack(app, 'MyBenchlingWebhook', {
14
+ * env: { account: '123456789012', region: 'us-east-1' },
15
+ * bucketName: 'my-data-bucket',
16
+ * queueName: 'my-packager-queue',
17
+ * benchlingClientId: process.env.BENCHLING_CLIENT_ID!,
18
+ * benchlingClientSecret: process.env.BENCHLING_CLIENT_SECRET!,
19
+ * benchlingTenant: 'my-org',
20
+ * quiltCatalog: 'my-catalog.quiltdata.com',
21
+ * quiltDatabase: 'my_athena_db',
22
+ * });
23
+ * ```
24
+ *
25
+ * @module quilt-benchling-webhook
26
+ */
27
+
28
+ export { BenchlingWebhookStack, type BenchlingWebhookStackProps } from './benchling-webhook-stack';
29
+ export { FargateService } from './fargate-service';
30
+ export { AlbApiGateway } from './alb-api-gateway';
31
+ export { EcrRepository } from './ecr-repository';
@@ -0,0 +1,35 @@
1
+ {
2
+ "Comment": "OAuth 2.0 with EventBridge Connection in Step Functions",
3
+ "StartAt": "RequestAccessToken",
4
+ "States": {
5
+ "RequestAccessToken": {
6
+ "Type": "Task",
7
+ "Resource": "arn:aws:states:::http:invoke",
8
+ "Parameters": {
9
+ "Method": "POST",
10
+ "ApiEndpoint": "https://quilt-dtt.benchling.com/api/v2/token",
11
+ "Authentication": {
12
+ "ConnectionArn": "arn:aws:events:us-east-1:123456789012:connection/BenchlingOAuthConnection"
13
+ }
14
+ },
15
+ "ResultSelector": {
16
+ "access_token": "$.Body.access_token"
17
+ },
18
+ "ResultPath": "$.auth",
19
+ "Next": "CallListEntries"
20
+ },
21
+ "CallListEntries": {
22
+ "Type": "Task",
23
+ "Resource": "arn:aws:states:::http:invoke",
24
+ "Parameters": {
25
+ "Method": "GET",
26
+ "ApiEndpoint": "https://quilt-dtt.benchling.com/api/v2/entries",
27
+ "Headers": {
28
+ "Authorization.$": "States.Format('Bearer {}', $.auth.access_token)",
29
+ "Content-Type": "application/json"
30
+ }
31
+ },
32
+ "End": true
33
+ }
34
+ }
35
+ }
package/package.json ADDED
@@ -0,0 +1,79 @@
1
+ {
2
+ "name": "@quiltdata/benchling-webhook",
3
+ "version": "0.4.13",
4
+ "description": "AWS CDK deployment for Benchling webhook processing using Fargate",
5
+ "main": "lib/index.ts",
6
+ "bin": {
7
+ "benchling-webhook": "bin/benchling-webhook.ts"
8
+ },
9
+ "scripts": {
10
+ "sync-version": "node bin/sync-version.js",
11
+ "clean": "rm -rf cdk.out */{*.js,*.d.ts}",
12
+ "test": "NODE_ENV=test TMPDIR=./.tmp node --max-old-space-size=4096 ./node_modules/.bin/jest",
13
+ "cdk": "npm run test && npx cdk deploy --require-approval never",
14
+ "lint": "eslint . --ext .ts --fix",
15
+ "build": "tsc --noEmit",
16
+ "watch": "tsc --noEmit -w",
17
+ "synth": "npx cdk synth",
18
+ "diff": "npx cdk diff",
19
+ "logs": "node bin/check-logs.js",
20
+ "event": "node bin/send-event.js",
21
+ "check": "npm run cdk && npm run event && sleep 45 && npm run logs",
22
+ "get-env": "node bin/get-env.js",
23
+ "dev": "npm run build && npm run docker:test && npm run lint",
24
+ "docker:test": "make -C docker test",
25
+ "docker-push": "make -C docker push-local",
26
+ "docker-check": "make -C docker docker-validate",
27
+ "release": "node bin/release.js",
28
+ "release:dev": "node bin/release.js dev",
29
+ "version:major": "node bin/version.js major",
30
+ "version:minor": "node bin/version.js minor",
31
+ "version:patch": "node bin/version.js patch",
32
+ "version:dev": "node bin/version.js dev",
33
+ "publish:manual": "node bin/publish-manual.js"
34
+ },
35
+ "keywords": [
36
+ "benchling",
37
+ "webhook",
38
+ "aws",
39
+ "cdk",
40
+ "fargate",
41
+ "docker",
42
+ "quilt"
43
+ ],
44
+ "author": "Quilt Data",
45
+ "license": "Apache-2.0",
46
+ "repository": {
47
+ "type": "git",
48
+ "url": "https://github.com/quiltdata/benchling-webhook.git"
49
+ },
50
+ "devDependencies": {
51
+ "@eslint/js": "^9.22.0",
52
+ "@types/adm-zip": "^0.5.7",
53
+ "@types/aws-lambda": "^8.10.156",
54
+ "@types/jest": "^30.0.0",
55
+ "@types/node": "^24.0.0",
56
+ "@typescript-eslint/eslint-plugin": "^8.26.1",
57
+ "@typescript-eslint/parser": "^8.26.1",
58
+ "aws-cdk": "2.1031.0",
59
+ "dotenv": "^17.2.3",
60
+ "esbuild": "0.25.11",
61
+ "eslint": "^9.22.0",
62
+ "globals": "^16.0.0",
63
+ "jest": "^30.0.0",
64
+ "ts-jest": "^29.2.5",
65
+ "ts-node": "^10.9.2",
66
+ "typescript": "~5.9.0"
67
+ },
68
+ "dependencies": {
69
+ "@aws-sdk/client-s3": "^3.758.0",
70
+ "adm-zip": "^0.5.10",
71
+ "aws-cdk-lib": "2.221.0",
72
+ "aws-sdk": "^2.1574.0",
73
+ "constructs": "^10.0.0"
74
+ },
75
+ "engines": {
76
+ "node": ">=18.0.0",
77
+ "npm": ">=9.0.0"
78
+ }
79
+ }
package/tsconfig.json ADDED
@@ -0,0 +1,34 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2020",
4
+ "module": "node20",
5
+ "lib": [
6
+ "es2020",
7
+ "dom"
8
+ ],
9
+ "declaration": true,
10
+ "strict": true,
11
+ "noImplicitAny": true,
12
+ "strictNullChecks": true,
13
+ "noImplicitThis": true,
14
+ "alwaysStrict": true,
15
+ "noUnusedLocals": false,
16
+ "noUnusedParameters": false,
17
+ "noImplicitReturns": true,
18
+ "noFallthroughCasesInSwitch": false,
19
+ "inlineSourceMap": true,
20
+ "inlineSources": true,
21
+ "experimentalDecorators": true,
22
+ "strictPropertyInitialization": false,
23
+ "esModuleInterop": true,
24
+ "resolveJsonModule": true,
25
+ "noEmit": true,
26
+ "typeRoots": [
27
+ "./node_modules/@types"
28
+ ]
29
+ },
30
+ "exclude": [
31
+ "node_modules",
32
+ "cdk.out"
33
+ ]
34
+ }