@orcabus/platform-cdk-constructs 0.0.99 → 0.0.101

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/.jsii CHANGED
@@ -7163,6 +7163,6 @@
7163
7163
  "symbolId": "shared-config/slack:SlackAlerts"
7164
7164
  }
7165
7165
  },
7166
- "version": "0.0.99",
7167
- "fingerprint": "BNtXshN3DS2beoDlgK1LGEgZsu9g5SSO+xhoDSiVLSE="
7166
+ "version": "0.0.101",
7167
+ "fingerprint": "zvLwqJtTziHgrpFnG4EL5SxYV18znkqslm91rEBOpXI="
7168
7168
  }
@@ -15,7 +15,7 @@ const aws_lambda_1 = require("aws-cdk-lib/aws-lambda");
15
15
  const aws_route53_targets_1 = require("aws-cdk-lib/aws-route53-targets");
16
16
  const config_1 = require("./config");
17
17
  class OrcaBusApiGateway extends constructs_1.Construct {
18
- static [JSII_RTTI_SYMBOL_1] = { fqn: "@orcabus/platform-cdk-constructs.apigateway.OrcaBusApiGateway", version: "0.0.99" };
18
+ static [JSII_RTTI_SYMBOL_1] = { fqn: "@orcabus/platform-cdk-constructs.apigateway.OrcaBusApiGateway", version: "0.0.101" };
19
19
  /**
20
20
  * The AWS region where the API Gateway is deployed.
21
21
  */
@@ -13,7 +13,7 @@ exports.CROSS_DEPLOYMENT_ARTIFACT_BUCKET_NAME = "orcabus-cross-deployment-codepi
13
13
  exports.CROSS_DEPLOYMENT_ARTIFACT_KMS_ALIAS = "orcabus-cross-deployment-codepipeline-artifact";
14
14
  exports.CROSS_DEPLOYMENT_ARTIFACT_KMS_ARN_SSM_PARAMETER_NAME = "/orcabus/deployment-stack-pipeline/artifact-bucket/kms-key-arn";
15
15
  class CrossDeploymentArtifactBucket extends constructs_1.Construct {
16
- static [JSII_RTTI_SYMBOL_1] = { fqn: "@orcabus/platform-cdk-constructs.deploymentPipeline.CrossDeploymentArtifactBucket", version: "0.0.99" };
16
+ static [JSII_RTTI_SYMBOL_1] = { fqn: "@orcabus/platform-cdk-constructs.deploymentPipeline.CrossDeploymentArtifactBucket", version: "0.0.101" };
17
17
  /**
18
18
  * The S3 bucket used to store artifacts for cross-deployment pipelines.
19
19
  */
@@ -32,7 +32,7 @@ exports.DEFAULT_SYNTH_STEP_PARTIAL_BUILD_SPEC = {
32
32
  * before using this construct.
33
33
  */
34
34
  class DeploymentStackPipeline extends constructs_1.Construct {
35
- static [JSII_RTTI_SYMBOL_1] = { fqn: "@orcabus/platform-cdk-constructs.deploymentPipeline.DeploymentStackPipeline", version: "0.0.99" };
35
+ static [JSII_RTTI_SYMBOL_1] = { fqn: "@orcabus/platform-cdk-constructs.deploymentPipeline.DeploymentStackPipeline", version: "0.0.101" };
36
36
  /**
37
37
  * The code pipeline construct that is created.
38
38
  */
package/dynamodb/index.js CHANGED
@@ -40,7 +40,7 @@ const dynamodb = __importStar(require("aws-cdk-lib/aws-dynamodb"));
40
40
  const aws_cdk_lib_1 = require("aws-cdk-lib");
41
41
  const config_1 = require("./config");
42
42
  class DynamoDbPartitionedConstruct extends constructs_1.Construct {
43
- static [JSII_RTTI_SYMBOL_1] = { fqn: "@orcabus/platform-cdk-constructs.dynamodb.DynamoDbPartitionedConstruct", version: "0.0.99" };
43
+ static [JSII_RTTI_SYMBOL_1] = { fqn: "@orcabus/platform-cdk-constructs.dynamodb.DynamoDbPartitionedConstruct", version: "0.0.101" };
44
44
  table;
45
45
  constructor(scope, id, props) {
46
46
  super(scope, id);
@@ -75,7 +75,7 @@ class DynamoDbPartitionedConstruct extends constructs_1.Construct {
75
75
  }
76
76
  exports.DynamoDbPartitionedConstruct = DynamoDbPartitionedConstruct;
77
77
  class DynamoDbNonPartitionedConstruct extends constructs_1.Construct {
78
- static [JSII_RTTI_SYMBOL_1] = { fqn: "@orcabus/platform-cdk-constructs.dynamodb.DynamoDbNonPartitionedConstruct", version: "0.0.99" };
78
+ static [JSII_RTTI_SYMBOL_1] = { fqn: "@orcabus/platform-cdk-constructs.dynamodb.DynamoDbNonPartitionedConstruct", version: "0.0.101" };
79
79
  table;
80
80
  constructor(scope, id, props) {
81
81
  super(scope, id);
package/ecs/index.js CHANGED
@@ -55,7 +55,7 @@ exports.LAMBDA_ARCHITECTURE_MAP = {
55
55
  ['ARM64']: lambda.Architecture.ARM_64
56
56
  };
57
57
  class EcsFargateTaskConstruct extends constructs_1.Construct {
58
- static [JSII_RTTI_SYMBOL_1] = { fqn: "@orcabus/platform-cdk-constructs.ecs.EcsFargateTaskConstruct", version: "0.0.99" };
58
+ static [JSII_RTTI_SYMBOL_1] = { fqn: "@orcabus/platform-cdk-constructs.ecs.EcsFargateTaskConstruct", version: "0.0.101" };
59
59
  cluster;
60
60
  taskDefinition;
61
61
  taskExecutionRole;
@@ -17,7 +17,7 @@ var SfnEventStatus;
17
17
  SfnEventStatus["ABORTED"] = "ABORTED";
18
18
  })(SfnEventStatus || (exports.SfnEventStatus = SfnEventStatus = {}));
19
19
  class SfnSlackNotification extends constructs_1.Construct {
20
- static [JSII_RTTI_SYMBOL_1] = { fqn: "@orcabus/platform-cdk-constructs.eventbridgeRule.SfnSlackNotification", version: "0.0.99" };
20
+ static [JSII_RTTI_SYMBOL_1] = { fqn: "@orcabus/platform-cdk-constructs.eventbridgeRule.SfnSlackNotification", version: "0.0.101" };
21
21
  rule;
22
22
  constructor(scope, id, props) {
23
23
  super(scope, id);
package/lambda/index.js CHANGED
@@ -57,7 +57,7 @@ function getPythonUvDockerImage() {
57
57
  return aws_cdk_lib_1.DockerImage.fromBuild(path_1.default.join(__dirname, 'build_python'));
58
58
  }
59
59
  class PythonUvFunction extends aws_lambda_python_alpha_1.PythonFunction {
60
- static [JSII_RTTI_SYMBOL_1] = { fqn: "@orcabus/platform-cdk-constructs.lambda.PythonUvFunction", version: "0.0.99" };
60
+ static [JSII_RTTI_SYMBOL_1] = { fqn: "@orcabus/platform-cdk-constructs.lambda.PythonUvFunction", version: "0.0.101" };
61
61
  // Class constructs, to be used for caching the layers
62
62
  // This means that if there are multiple lambdas throughout the stack
63
63
  // They will all use the same layer
@@ -7,7 +7,8 @@ from typing import Dict, Optional
7
7
  from ..utils.requests_helpers import (
8
8
  get_request_response_results,
9
9
  get_request,
10
- get_url
10
+ get_url,
11
+ post_request
11
12
  )
12
13
  from .globals import SEQUENCE_SUBDOMAIN_NAME
13
14
  from .models import Sequence, SequenceDetail, SampleSheet
@@ -39,6 +40,15 @@ def get_sequence_request_response_results(
39
40
  return get_request_response_results(get_sequence_url(endpoint), params=params)
40
41
 
41
42
 
43
+ def sequence_post_request(
44
+ endpoint: str,
45
+ json_data: Optional[Dict] = None,
46
+ ) -> Dict:
47
+ return post_request(
48
+ get_sequence_url(endpoint),
49
+ json_data=json_data
50
+ )
51
+
42
52
 
43
53
  from .sequence_helpers import (
44
54
  get_sequence_object_from_instrument_run_id,
@@ -47,7 +57,8 @@ from .sequence_helpers import (
47
57
  get_libraries_from_instrument_run_id, # Deprecated
48
58
  get_sample_sheet_from_orcabus_id,
49
59
  get_library_ids_in_sequence, # Deprecated
50
- get_sample_sheet_from_instrument_run_id
60
+ get_sample_sheet_from_instrument_run_id,
61
+ add_samplesheet,
51
62
  )
52
63
 
53
64
  __all__ = [
@@ -58,6 +69,7 @@ __all__ = [
58
69
  "get_sample_sheet_from_instrument_run_id",
59
70
  "get_library_id_list_in_sequence",
60
71
  "get_library_id_list_from_instrument_run_id",
72
+ "add_samplesheet",
61
73
  ]
62
74
 
63
75
 
@@ -1,14 +1,19 @@
1
1
  #!/usr/bin/env python3
2
- import warnings
2
+
3
+ """
4
+ Interact with the SRM service
5
+ """
6
+
3
7
  # Standard imports
4
- from typing import Optional, cast, List
8
+ from pathlib import Path
9
+ import warnings
10
+ from typing import Optional, cast, List, Dict
5
11
  import logging
6
12
 
7
-
8
13
  # Local imports
9
- from . import get_sequence_request
14
+ from . import get_sequence_request, sequence_post_request
10
15
  from .globals import SEQUENCE_RUN_ENDPOINT, SEQUENCE_ENDPOINT
11
- from .models import SequenceDetail, SampleSheet, Sequence
16
+ from .models import SampleSheet, Sequence
12
17
 
13
18
 
14
19
  def get_sample_sheet_from_instrument_run_id(instrument_run_id: str) -> Optional[SampleSheet]:
@@ -121,3 +126,30 @@ def get_sample_sheet_from_orcabus_id(sequence_orcabus_id: str) -> SampleSheet:
121
126
  )
122
127
 
123
128
 
129
+ def add_samplesheet(
130
+ instrument_run_id: str,
131
+ samplesheet_path: Path,
132
+ created_by: str,
133
+ comment: str
134
+ ) -> Dict:
135
+ """
136
+ Add a sample sheet to the sequence run.
137
+ :param instrument_run_id: The instrument run identifier for which the sample sheet is being added.
138
+ :param samplesheet: Path to the sample sheet file to be uploaded.
139
+ :param created_by: The user who is adding the sample sheet.
140
+ :param comment: A comment describing the sample sheet or the reason for adding it.
141
+ :return: Response from the API containing the updated sequence information.
142
+ """
143
+ # Open the sample sheet file
144
+ with open(samplesheet, 'r') as ss_file:
145
+ ss_content = ss_file.read()
146
+
147
+ return sequence_post_request(
148
+ endpoint=f"{SEQUENCE_RUN_ENDPOINT}/action/add_samplesheet/",
149
+ json_data={
150
+ "file": ss_content,
151
+ "instrument_run_id": instrument_run_id,
152
+ "created_by": created_by,
153
+ "comment": comment
154
+ }
155
+ )
@@ -13,7 +13,7 @@ const aws_cloudwatch_actions_1 = require("aws-cdk-lib/aws-cloudwatch-actions");
13
13
  * SNS topic.
14
14
  */
15
15
  class MonitoredQueue extends constructs_1.Construct {
16
- static [JSII_RTTI_SYMBOL_1] = { fqn: "@orcabus/platform-cdk-constructs.monitoredQueue.MonitoredQueue", version: "0.0.99" };
16
+ static [JSII_RTTI_SYMBOL_1] = { fqn: "@orcabus/platform-cdk-constructs.monitoredQueue.MonitoredQueue", version: "0.0.101" };
17
17
  queue;
18
18
  deadLetterQueue;
19
19
  alarm;
@@ -7,7 +7,7 @@ const aws_iam_1 = require("aws-cdk-lib/aws-iam");
7
7
  * A construct which represents a named role that a Lambda function can assume.
8
8
  */
9
9
  class NamedLambdaRole extends aws_iam_1.Role {
10
- static [JSII_RTTI_SYMBOL_1] = { fqn: "@orcabus/platform-cdk-constructs.namedLambdaRole.NamedLambdaRole", version: "0.0.99" };
10
+ static [JSII_RTTI_SYMBOL_1] = { fqn: "@orcabus/platform-cdk-constructs.namedLambdaRole.NamedLambdaRole", version: "0.0.101" };
11
11
  constructor(scope, id, props) {
12
12
  super(scope, id, {
13
13
  assumedBy: new aws_iam_1.ServicePrincipal("lambda.amazonaws.com"),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@orcabus/platform-cdk-constructs",
3
- "version": "0.0.99",
3
+ "version": "0.0.101",
4
4
  "description": "CDK Package for OrcaBus infrastructure.",
5
5
  "main": "index.ts",
6
6
  "types": "index.d.ts",
@@ -15,7 +15,7 @@ const aws_cdk_lib_1 = require("aws-cdk-lib");
15
15
  * to the provider framework.
16
16
  */
17
17
  class ProviderFunction extends constructs_1.Construct {
18
- static [JSII_RTTI_SYMBOL_1] = { fqn: "@orcabus/platform-cdk-constructs.provider.ProviderFunction", version: "0.0.99" };
18
+ static [JSII_RTTI_SYMBOL_1] = { fqn: "@orcabus/platform-cdk-constructs.provider.ProviderFunction", version: "0.0.101" };
19
19
  _function;
20
20
  _response;
21
21
  constructor(scope, id, props) {
@@ -23,7 +23,7 @@ exports.VPC_LOOKUP_PROPS = {
23
23
  * Helper for looking up the shared OrcaBus VPC.
24
24
  */
25
25
  class OrcaBusVpc {
26
- static [JSII_RTTI_SYMBOL_1] = { fqn: "@orcabus/platform-cdk-constructs.sharedConfig.networking.OrcaBusVpc", version: "0.0.99" };
26
+ static [JSII_RTTI_SYMBOL_1] = { fqn: "@orcabus/platform-cdk-constructs.sharedConfig.networking.OrcaBusVpc", version: "0.0.101" };
27
27
  /**
28
28
  * The shared VPC that is used by OrcaBus.
29
29
  * @param scope
@@ -42,7 +42,7 @@ exports.SHARED_SECURITY_GROUP_NAME = "OrcaBusSharedComputeSecurityGroup";
42
42
  * Helper for looking up the shared compute security group by name.
43
43
  */
44
44
  class OrcaBusSharedComputeSecurityGroup {
45
- static [JSII_RTTI_SYMBOL_1] = { fqn: "@orcabus/platform-cdk-constructs.sharedConfig.networking.OrcaBusSharedComputeSecurityGroup", version: "0.0.99" };
45
+ static [JSII_RTTI_SYMBOL_1] = { fqn: "@orcabus/platform-cdk-constructs.sharedConfig.networking.OrcaBusSharedComputeSecurityGroup", version: "0.0.101" };
46
46
  /**
47
47
  * The shared security group that is used by compute resources to access the database.
48
48
  * @param scope
@@ -11,7 +11,7 @@ exports.SLACK_ALERTS_SNS_TOPIC = "AwsChatBotTopic-alerts";
11
11
  * A helper class to construct the arn for the slack SNS topic.
12
12
  */
13
13
  class SlackAlerts {
14
- static [JSII_RTTI_SYMBOL_1] = { fqn: "@orcabus/platform-cdk-constructs.sharedConfig.slack.SlackAlerts", version: "0.0.99" };
14
+ static [JSII_RTTI_SYMBOL_1] = { fqn: "@orcabus/platform-cdk-constructs.sharedConfig.slack.SlackAlerts", version: "0.0.101" };
15
15
  /**
16
16
  * Format the ARN for the slack alerts SNS topic for the current stack.
17
17
  * @param stack