@cloudsnorkel/cdk-github-runners 0.11.2 → 0.11.4

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 (63) hide show
  1. package/.gitattributes +1 -0
  2. package/.jsii +21 -20
  3. package/API.md +5 -5
  4. package/assets/delete-failed-runner.lambda/index.js +24 -32
  5. package/assets/idle-runner-repear.lambda/index.js +29 -37
  6. package/assets/image-builders/aws-image-builder/delete-ami.lambda/index.js +14 -28
  7. package/assets/image-builders/aws-image-builder/filter-failed-builds.lambda/index.js +4 -14
  8. package/assets/image-builders/aws-image-builder/reaper.lambda/index.js +18 -30
  9. package/assets/image-builders/aws-image-builder/versioner.lambda/index.js +10 -16
  10. package/assets/providers/ami-root-device.lambda/index.js +12 -23
  11. package/assets/providers/build-image.lambda/index.js +16 -24
  12. package/assets/providers/update-lambda.lambda/index.js +5 -15
  13. package/assets/setup.lambda/index.html +1 -1
  14. package/assets/setup.lambda/index.js +4 -4
  15. package/assets/status.lambda/index.js +48 -55
  16. package/assets/token-retriever.lambda/index.js +24 -32
  17. package/assets/webhook-handler.lambda/index.js +32 -42
  18. package/lib/access.js +1 -1
  19. package/lib/delete-failed-runner-function.js +2 -2
  20. package/lib/idle-runner-repear-function.js +2 -2
  21. package/lib/idle-runner-repear.lambda.js +6 -6
  22. package/lib/image-builders/api.js +1 -1
  23. package/lib/image-builders/aws-image-builder/builder.js +1 -1
  24. package/lib/image-builders/aws-image-builder/delete-ami-function.js +2 -2
  25. package/lib/image-builders/aws-image-builder/delete-ami.lambda.js +11 -11
  26. package/lib/image-builders/aws-image-builder/deprecated/ami.js +1 -1
  27. package/lib/image-builders/aws-image-builder/deprecated/container.js +1 -1
  28. package/lib/image-builders/aws-image-builder/deprecated/linux-components.js +1 -1
  29. package/lib/image-builders/aws-image-builder/deprecated/windows-components.js +1 -1
  30. package/lib/image-builders/aws-image-builder/filter-failed-builds-function.js +2 -2
  31. package/lib/image-builders/aws-image-builder/filter-failed-builds.lambda.js +5 -5
  32. package/lib/image-builders/aws-image-builder/reaper-function.js +2 -2
  33. package/lib/image-builders/aws-image-builder/reaper.lambda.js +15 -13
  34. package/lib/image-builders/aws-image-builder/versioner-function.js +2 -2
  35. package/lib/image-builders/aws-image-builder/versioner.lambda.js +9 -9
  36. package/lib/image-builders/codebuild-deprecated.js +1 -1
  37. package/lib/image-builders/components.d.ts +2 -0
  38. package/lib/image-builders/components.js +5 -43
  39. package/lib/image-builders/static.js +1 -1
  40. package/lib/lambda-helpers.js +5 -5
  41. package/lib/providers/ami-root-device-function.js +2 -2
  42. package/lib/providers/ami-root-device.lambda.js +8 -7
  43. package/lib/providers/build-image-function.js +2 -2
  44. package/lib/providers/build-image.lambda.js +15 -13
  45. package/lib/providers/codebuild.d.ts +2 -2
  46. package/lib/providers/codebuild.js +5 -5
  47. package/lib/providers/common.js +3 -3
  48. package/lib/providers/ec2.js +2 -2
  49. package/lib/providers/ecs.d.ts +1 -1
  50. package/lib/providers/ecs.js +4 -4
  51. package/lib/providers/fargate.js +2 -2
  52. package/lib/providers/lambda.js +2 -2
  53. package/lib/providers/update-lambda-function.js +2 -2
  54. package/lib/providers/update-lambda.lambda.js +6 -6
  55. package/lib/runner.js +5 -2
  56. package/lib/secrets.js +1 -1
  57. package/lib/setup-function.js +2 -2
  58. package/lib/status-function.js +2 -2
  59. package/lib/status.lambda.js +20 -17
  60. package/lib/token-retriever-function.js +2 -2
  61. package/lib/webhook-handler-function.js +2 -2
  62. package/lib/webhook-handler.lambda.js +5 -5
  63. package/package.json +17 -9
package/.gitattributes CHANGED
@@ -22,6 +22,7 @@
22
22
  /.projen/deps.json linguist-generated
23
23
  /.projen/files.json linguist-generated
24
24
  /.projen/tasks.json linguist-generated
25
+ /.vscode/settings.json linguist-generated
25
26
  /API.md linguist-generated
26
27
  /cdk.json linguist-generated
27
28
  /LICENSE linguist-generated
package/.jsii CHANGED
@@ -5113,7 +5113,7 @@
5113
5113
  "methods": [
5114
5114
  {
5115
5115
  "docs": {
5116
- "remarks": "Included components:\n * `RunnerImageComponent.requiredPackages()`\n * `RunnerImageComponent.runnerUser()`\n * `RunnerImageComponent.git()`\n * `RunnerImageComponent.githubCli()`\n * `RunnerImageComponent.awsCli()`\n * `RunnerImageComponent.dockerInDocker()`\n * `RunnerImageComponent.githubRunner()`",
5116
+ "remarks": "Included components:\n * `RunnerImageComponent.requiredPackages()`\n * `RunnerImageComponent.runnerUser()`\n * `RunnerImageComponent.git()`\n * `RunnerImageComponent.githubCli()`\n * `RunnerImageComponent.awsCli()`\n * `RunnerImageComponent.docker()`\n * `RunnerImageComponent.githubRunner()`",
5117
5117
  "stability": "experimental",
5118
5118
  "summary": "Create new image builder that builds CodeBuild specific runner images using Ubuntu."
5119
5119
  },
@@ -5499,7 +5499,7 @@
5499
5499
  "abstract": true,
5500
5500
  "docs": {
5501
5501
  "default": "CodeBuildRunnerProvider.imageBuilder()",
5502
- "remarks": "The image builder must contain the {@link RunnerImageComponent.dockerInDocker} component unless `dockerInDocker` is set to false.\n\nThe image builder determines the OS and architecture of the runner.",
5502
+ "remarks": "The image builder must contain the {@link RunnerImageComponent.docker} component unless `dockerInDocker` is set to false.\n\nThe image builder determines the OS and architecture of the runner.",
5503
5503
  "stability": "experimental",
5504
5504
  "summary": "Runner image builder used to build Docker images containing GitHub Runner and all requirements."
5505
5505
  },
@@ -6986,7 +6986,7 @@
6986
6986
  "methods": [
6987
6987
  {
6988
6988
  "docs": {
6989
- "remarks": "Included components:\n * `RunnerImageComponent.requiredPackages()`\n * `RunnerImageComponent.runnerUser()`\n * `RunnerImageComponent.git()`\n * `RunnerImageComponent.githubCli()`\n * `RunnerImageComponent.awsCli()`\n * `RunnerImageComponent.dockerInDocker()`\n * `RunnerImageComponent.githubRunner()`",
6989
+ "remarks": "Included components:\n * `RunnerImageComponent.requiredPackages()`\n * `RunnerImageComponent.runnerUser()`\n * `RunnerImageComponent.git()`\n * `RunnerImageComponent.githubCli()`\n * `RunnerImageComponent.awsCli()`\n * `RunnerImageComponent.docker()`\n * `RunnerImageComponent.githubRunner()`",
6990
6990
  "stability": "experimental",
6991
6991
  "summary": "Create new image builder that builds ECS specific runner images using Ubuntu."
6992
6992
  },
@@ -8435,7 +8435,7 @@
8435
8435
  },
8436
8436
  "locationInModule": {
8437
8437
  "filename": "src/runner.ts",
8438
- "line": 766
8438
+ "line": 770
8439
8439
  },
8440
8440
  "name": "createLogsInsightsQueries"
8441
8441
  },
@@ -8447,7 +8447,7 @@
8447
8447
  },
8448
8448
  "locationInModule": {
8449
8449
  "filename": "src/runner.ts",
8450
- "line": 746
8450
+ "line": 750
8451
8451
  },
8452
8452
  "name": "failedImageBuildsTopic",
8453
8453
  "returns": {
@@ -8464,7 +8464,7 @@
8464
8464
  },
8465
8465
  "locationInModule": {
8466
8466
  "filename": "src/runner.ts",
8467
- "line": 728
8467
+ "line": 732
8468
8468
  },
8469
8469
  "name": "metricFailed",
8470
8470
  "parameters": [
@@ -8490,7 +8490,7 @@
8490
8490
  },
8491
8491
  "locationInModule": {
8492
8492
  "filename": "src/runner.ts",
8493
- "line": 673
8493
+ "line": 677
8494
8494
  },
8495
8495
  "name": "metricJobCompleted",
8496
8496
  "parameters": [
@@ -8516,7 +8516,7 @@
8516
8516
  },
8517
8517
  "locationInModule": {
8518
8518
  "filename": "src/runner.ts",
8519
- "line": 719
8519
+ "line": 723
8520
8520
  },
8521
8521
  "name": "metricSucceeded",
8522
8522
  "parameters": [
@@ -8542,7 +8542,7 @@
8542
8542
  },
8543
8543
  "locationInModule": {
8544
8544
  "filename": "src/runner.ts",
8545
- "line": 735
8545
+ "line": 739
8546
8546
  },
8547
8547
  "name": "metricTime",
8548
8548
  "parameters": [
@@ -12120,12 +12120,13 @@
12120
12120
  },
12121
12121
  {
12122
12122
  "docs": {
12123
- "stability": "experimental",
12123
+ "deprecated": "use `docker()`",
12124
+ "stability": "deprecated",
12124
12125
  "summary": "A component to install Docker-in-Docker."
12125
12126
  },
12126
12127
  "locationInModule": {
12127
12128
  "filename": "src/image-builders/components.ts",
12128
- "line": 397
12129
+ "line": 399
12129
12130
  },
12130
12131
  "name": "dockerInDocker",
12131
12132
  "returns": {
@@ -12143,7 +12144,7 @@
12143
12144
  },
12144
12145
  "locationInModule": {
12145
12146
  "filename": "src/image-builders/components.ts",
12146
- "line": 445
12147
+ "line": 409
12147
12148
  },
12148
12149
  "name": "extraCertificates",
12149
12150
  "parameters": [
@@ -12244,7 +12245,7 @@
12244
12245
  },
12245
12246
  "locationInModule": {
12246
12247
  "filename": "src/image-builders/components.ts",
12247
- "line": 495
12248
+ "line": 459
12248
12249
  },
12249
12250
  "name": "lambdaEntrypoint",
12250
12251
  "returns": {
@@ -12296,7 +12297,7 @@
12296
12297
  },
12297
12298
  "locationInModule": {
12298
12299
  "filename": "src/image-builders/components.ts",
12299
- "line": 544
12300
+ "line": 508
12300
12301
  },
12301
12302
  "name": "getAssets",
12302
12303
  "parameters": [
@@ -12333,7 +12334,7 @@
12333
12334
  },
12334
12335
  "locationInModule": {
12335
12336
  "filename": "src/image-builders/components.ts",
12336
- "line": 539
12337
+ "line": 503
12337
12338
  },
12338
12339
  "name": "getCommands",
12339
12340
  "parameters": [
@@ -12369,7 +12370,7 @@
12369
12370
  },
12370
12371
  "locationInModule": {
12371
12372
  "filename": "src/image-builders/components.ts",
12372
- "line": 553
12373
+ "line": 517
12373
12374
  },
12374
12375
  "name": "getDockerCommands",
12375
12376
  "parameters": [
@@ -12404,7 +12405,7 @@
12404
12405
  },
12405
12406
  "locationInModule": {
12406
12407
  "filename": "src/image-builders/components.ts",
12407
- "line": 560
12408
+ "line": 524
12408
12409
  },
12409
12410
  "name": "shouldReboot",
12410
12411
  "parameters": [
@@ -12440,7 +12441,7 @@
12440
12441
  "immutable": true,
12441
12442
  "locationInModule": {
12442
12443
  "filename": "src/image-builders/components.ts",
12443
- "line": 534
12444
+ "line": 498
12444
12445
  },
12445
12446
  "name": "name",
12446
12447
  "type": {
@@ -13324,6 +13325,6 @@
13324
13325
  "symbolId": "src/image-builders/aws-image-builder/deprecated/windows-components:WindowsComponents"
13325
13326
  }
13326
13327
  },
13327
- "version": "0.11.2",
13328
- "fingerprint": "XlwlwdmWIqrhmlFSA6MkbBJIgaPaI/R/2vAxLO2aaus="
13328
+ "version": "0.11.4",
13329
+ "fingerprint": "KthUiQVwpzTb/QtJKrWJAhhvTFEFTIvTI7p6ho0YCs4="
13329
13330
  }
package/API.md CHANGED
@@ -669,7 +669,7 @@ Included components:
669
669
  * `RunnerImageComponent.git()`
670
670
  * `RunnerImageComponent.githubCli()`
671
671
  * `RunnerImageComponent.awsCli()`
672
- * `RunnerImageComponent.dockerInDocker()`
672
+ * `RunnerImageComponent.docker()`
673
673
  * `RunnerImageComponent.githubRunner()`
674
674
 
675
675
  ###### `scope`<sup>Required</sup> <a name="scope" id="@cloudsnorkel/cdk-github-runners.CodeBuildRunner.imageBuilder.parameter.scope"></a>
@@ -1035,7 +1035,7 @@ Included components:
1035
1035
  * `RunnerImageComponent.git()`
1036
1036
  * `RunnerImageComponent.githubCli()`
1037
1037
  * `RunnerImageComponent.awsCli()`
1038
- * `RunnerImageComponent.dockerInDocker()`
1038
+ * `RunnerImageComponent.docker()`
1039
1039
  * `RunnerImageComponent.githubRunner()`
1040
1040
 
1041
1041
  ###### `scope`<sup>Required</sup> <a name="scope" id="@cloudsnorkel/cdk-github-runners.CodeBuildRunnerProvider.imageBuilder.parameter.scope"></a>
@@ -2148,7 +2148,7 @@ Included components:
2148
2148
  * `RunnerImageComponent.git()`
2149
2149
  * `RunnerImageComponent.githubCli()`
2150
2150
  * `RunnerImageComponent.awsCli()`
2151
- * `RunnerImageComponent.dockerInDocker()`
2151
+ * `RunnerImageComponent.docker()`
2152
2152
  * `RunnerImageComponent.githubRunner()`
2153
2153
 
2154
2154
  ###### `scope`<sup>Required</sup> <a name="scope" id="@cloudsnorkel/cdk-github-runners.EcsRunnerProvider.imageBuilder.parameter.scope"></a>
@@ -5476,7 +5476,7 @@ public readonly imageBuilder: IRunnerImageBuilder;
5476
5476
 
5477
5477
  Runner image builder used to build Docker images containing GitHub Runner and all requirements.
5478
5478
 
5479
- The image builder must contain the {@link RunnerImageComponent.dockerInDocker} component unless `dockerInDocker` is set to false.
5479
+ The image builder must contain the {@link RunnerImageComponent.docker} component unless `dockerInDocker` is set to false.
5480
5480
 
5481
5481
  The image builder determines the OS and architecture of the runner.
5482
5482
 
@@ -8873,7 +8873,7 @@ A component to install Docker.
8873
8873
 
8874
8874
  On Windows this sets up dockerd for Windows containers without Docker Desktop. If you need Linux containers on Windows, you'll need to install Docker Desktop which doesn't seem to play well with servers (PRs welcome).
8875
8875
 
8876
- ##### `dockerInDocker` <a name="dockerInDocker" id="@cloudsnorkel/cdk-github-runners.RunnerImageComponent.dockerInDocker"></a>
8876
+ ##### ~~`dockerInDocker`~~ <a name="dockerInDocker" id="@cloudsnorkel/cdk-github-runners.RunnerImageComponent.dockerInDocker"></a>
8877
8877
 
8878
8878
  ```typescript
8879
8879
  import { RunnerImageComponent } from '@cloudsnorkel/cdk-github-runners'
@@ -12865,7 +12865,6 @@ var require_cjs = __commonJS({
12865
12865
  };
12866
12866
  var AC = globalThis.AbortController;
12867
12867
  var AS = globalThis.AbortSignal;
12868
- var _a;
12869
12868
  if (typeof AC === "undefined") {
12870
12869
  AS = class AbortSignal {
12871
12870
  onabort;
@@ -12882,7 +12881,6 @@ var require_cjs = __commonJS({
12882
12881
  }
12883
12882
  signal = new AS();
12884
12883
  abort(reason) {
12885
- var _a2, _b;
12886
12884
  if (this.signal.aborted)
12887
12885
  return;
12888
12886
  this.signal.reason = reason;
@@ -12890,10 +12888,10 @@ var require_cjs = __commonJS({
12890
12888
  for (const fn of this.signal._onabort) {
12891
12889
  fn(reason);
12892
12890
  }
12893
- (_b = (_a2 = this.signal).onabort) == null ? void 0 : _b.call(_a2, reason);
12891
+ this.signal.onabort?.(reason);
12894
12892
  }
12895
12893
  };
12896
- let printACPolyfillWarning = ((_a = PROCESS.env) == null ? void 0 : _a.LRU_CACHE_IGNORE_AC_WARNING) !== "1";
12894
+ let printACPolyfillWarning = PROCESS.env?.LRU_CACHE_IGNORE_AC_WARNING !== "1";
12897
12895
  const warnACPolyfill = () => {
12898
12896
  if (!printACPolyfillWarning)
12899
12897
  return;
@@ -13548,7 +13546,6 @@ var require_cjs = __commonJS({
13548
13546
  * {@link LRUCache#delete}
13549
13547
  */
13550
13548
  set(k, v, setOptions = {}) {
13551
- var _a2, _b, _c;
13552
13549
  if (v === void 0) {
13553
13550
  this.delete(k);
13554
13551
  return this;
@@ -13586,10 +13583,10 @@ var require_cjs = __commonJS({
13586
13583
  oldVal.__abortController.abort(new Error("replaced"));
13587
13584
  } else if (!noDisposeOnSet) {
13588
13585
  if (this.#hasDispose) {
13589
- (_a2 = this.#dispose) == null ? void 0 : _a2.call(this, oldVal, k, "set");
13586
+ this.#dispose?.(oldVal, k, "set");
13590
13587
  }
13591
13588
  if (this.#hasDisposeAfter) {
13592
- (_b = this.#disposed) == null ? void 0 : _b.push([oldVal, k, "set"]);
13589
+ this.#disposed?.push([oldVal, k, "set"]);
13593
13590
  }
13594
13591
  }
13595
13592
  this.#removeItemSize(index);
@@ -13618,8 +13615,8 @@ var require_cjs = __commonJS({
13618
13615
  if (!noDisposeOnSet && this.#hasDisposeAfter && this.#disposed) {
13619
13616
  const dt = this.#disposed;
13620
13617
  let task;
13621
- while (task = dt == null ? void 0 : dt.shift()) {
13622
- (_c = this.#disposeAfter) == null ? void 0 : _c.call(this, ...task);
13618
+ while (task = dt?.shift()) {
13619
+ this.#disposeAfter?.(...task);
13623
13620
  }
13624
13621
  }
13625
13622
  return this;
@@ -13629,7 +13626,6 @@ var require_cjs = __commonJS({
13629
13626
  * `undefined` if cache is empty.
13630
13627
  */
13631
13628
  pop() {
13632
- var _a2;
13633
13629
  try {
13634
13630
  while (this.#size) {
13635
13631
  const val = this.#valList[this.#head];
@@ -13646,14 +13642,13 @@ var require_cjs = __commonJS({
13646
13642
  if (this.#hasDisposeAfter && this.#disposed) {
13647
13643
  const dt = this.#disposed;
13648
13644
  let task;
13649
- while (task = dt == null ? void 0 : dt.shift()) {
13650
- (_a2 = this.#disposeAfter) == null ? void 0 : _a2.call(this, ...task);
13645
+ while (task = dt?.shift()) {
13646
+ this.#disposeAfter?.(...task);
13651
13647
  }
13652
13648
  }
13653
13649
  }
13654
13650
  }
13655
13651
  #evict(free) {
13656
- var _a2, _b;
13657
13652
  const head = this.#head;
13658
13653
  const k = this.#keyList[head];
13659
13654
  const v = this.#valList[head];
@@ -13661,10 +13656,10 @@ var require_cjs = __commonJS({
13661
13656
  v.__abortController.abort(new Error("evicted"));
13662
13657
  } else if (this.#hasDispose || this.#hasDisposeAfter) {
13663
13658
  if (this.#hasDispose) {
13664
- (_a2 = this.#dispose) == null ? void 0 : _a2.call(this, v, k, "evict");
13659
+ this.#dispose?.(v, k, "evict");
13665
13660
  }
13666
13661
  if (this.#hasDisposeAfter) {
13667
- (_b = this.#disposed) == null ? void 0 : _b.push([v, k, "evict"]);
13662
+ this.#disposed?.push([v, k, "evict"]);
13668
13663
  }
13669
13664
  }
13670
13665
  this.#removeItemSize(head);
@@ -13739,7 +13734,7 @@ var require_cjs = __commonJS({
13739
13734
  }
13740
13735
  const ac = new AC();
13741
13736
  const { signal } = options;
13742
- signal == null ? void 0 : signal.addEventListener("abort", () => ac.abort(signal.reason), {
13737
+ signal?.addEventListener("abort", () => ac.abort(signal.reason), {
13743
13738
  signal: ac.signal
13744
13739
  });
13745
13740
  const fetchOpts = {
@@ -13810,8 +13805,7 @@ var require_cjs = __commonJS({
13810
13805
  }
13811
13806
  };
13812
13807
  const pcall = (res, rej) => {
13813
- var _a2;
13814
- const fmp = (_a2 = this.#fetchMethod) == null ? void 0 : _a2.call(this, k, v, fetchOpts);
13808
+ const fmp = this.#fetchMethod?.(k, v, fetchOpts);
13815
13809
  if (fmp && fmp instanceof Promise) {
13816
13810
  fmp.then((v2) => res(v2), rej);
13817
13811
  }
@@ -14000,7 +13994,6 @@ var require_cjs = __commonJS({
14000
13994
  * Returns true if the key was deleted, false otherwise.
14001
13995
  */
14002
13996
  delete(k) {
14003
- var _a2, _b, _c, _d;
14004
13997
  let deleted = false;
14005
13998
  if (this.#size !== 0) {
14006
13999
  const index = this.#keyMap.get(k);
@@ -14015,10 +14008,10 @@ var require_cjs = __commonJS({
14015
14008
  v.__abortController.abort(new Error("deleted"));
14016
14009
  } else if (this.#hasDispose || this.#hasDisposeAfter) {
14017
14010
  if (this.#hasDispose) {
14018
- (_a2 = this.#dispose) == null ? void 0 : _a2.call(this, v, k, "delete");
14011
+ this.#dispose?.(v, k, "delete");
14019
14012
  }
14020
14013
  if (this.#hasDisposeAfter) {
14021
- (_b = this.#disposed) == null ? void 0 : _b.push([v, k, "delete"]);
14014
+ this.#disposed?.push([v, k, "delete"]);
14022
14015
  }
14023
14016
  }
14024
14017
  this.#keyMap.delete(k);
@@ -14037,11 +14030,11 @@ var require_cjs = __commonJS({
14037
14030
  }
14038
14031
  }
14039
14032
  }
14040
- if (this.#hasDisposeAfter && ((_c = this.#disposed) == null ? void 0 : _c.length)) {
14033
+ if (this.#hasDisposeAfter && this.#disposed?.length) {
14041
14034
  const dt = this.#disposed;
14042
14035
  let task;
14043
- while (task = dt == null ? void 0 : dt.shift()) {
14044
- (_d = this.#disposeAfter) == null ? void 0 : _d.call(this, ...task);
14036
+ while (task = dt?.shift()) {
14037
+ this.#disposeAfter?.(...task);
14045
14038
  }
14046
14039
  }
14047
14040
  return deleted;
@@ -14050,7 +14043,6 @@ var require_cjs = __commonJS({
14050
14043
  * Clear the cache entirely, throwing away all values.
14051
14044
  */
14052
14045
  clear() {
14053
- var _a2, _b, _c;
14054
14046
  for (const index of this.#rindexes({ allowStale: true })) {
14055
14047
  const v = this.#valList[index];
14056
14048
  if (this.#isBackgroundFetch(v)) {
@@ -14058,10 +14050,10 @@ var require_cjs = __commonJS({
14058
14050
  } else {
14059
14051
  const k = this.#keyList[index];
14060
14052
  if (this.#hasDispose) {
14061
- (_a2 = this.#dispose) == null ? void 0 : _a2.call(this, v, k, "delete");
14053
+ this.#dispose?.(v, k, "delete");
14062
14054
  }
14063
14055
  if (this.#hasDisposeAfter) {
14064
- (_b = this.#disposed) == null ? void 0 : _b.push([v, k, "delete"]);
14056
+ this.#disposed?.push([v, k, "delete"]);
14065
14057
  }
14066
14058
  }
14067
14059
  }
@@ -14083,8 +14075,8 @@ var require_cjs = __commonJS({
14083
14075
  if (this.#hasDisposeAfter && this.#disposed) {
14084
14076
  const dt = this.#disposed;
14085
14077
  let task;
14086
- while (task = dt == null ? void 0 : dt.shift()) {
14087
- (_c = this.#disposeAfter) == null ? void 0 : _c.call(this, ...task);
14078
+ while (task = dt?.shift()) {
14079
+ this.#disposeAfter?.(...task);
14088
14080
  }
14089
14081
  }
14090
14082
  }
@@ -17502,13 +17494,13 @@ var import_auth_app = __toESM(require_dist_node12());
17502
17494
  var import_rest = __toESM(require_dist_node19());
17503
17495
 
17504
17496
  // src/lambda-helpers.ts
17505
- var AWS = __toESM(require("aws-sdk"));
17506
- var sm = new AWS.SecretsManager();
17497
+ var import_client_secrets_manager = require("@aws-sdk/client-secrets-manager");
17498
+ var sm = new import_client_secrets_manager.SecretsManagerClient();
17507
17499
  async function getSecretValue(arn) {
17508
17500
  if (!arn) {
17509
17501
  throw new Error("Missing secret ARN");
17510
17502
  }
17511
- const secret = await sm.getSecretValue({ SecretId: arn }).promise();
17503
+ const secret = await sm.send(new import_client_secrets_manager.GetSecretValueCommand({ SecretId: arn }));
17512
17504
  if (!secret.SecretString) {
17513
17505
  throw new Error(`No SecretString in ${arn}`);
17514
17506
  }
@@ -12865,7 +12865,6 @@ var require_cjs = __commonJS({
12865
12865
  };
12866
12866
  var AC = globalThis.AbortController;
12867
12867
  var AS = globalThis.AbortSignal;
12868
- var _a;
12869
12868
  if (typeof AC === "undefined") {
12870
12869
  AS = class AbortSignal {
12871
12870
  onabort;
@@ -12882,7 +12881,6 @@ var require_cjs = __commonJS({
12882
12881
  }
12883
12882
  signal = new AS();
12884
12883
  abort(reason) {
12885
- var _a2, _b;
12886
12884
  if (this.signal.aborted)
12887
12885
  return;
12888
12886
  this.signal.reason = reason;
@@ -12890,10 +12888,10 @@ var require_cjs = __commonJS({
12890
12888
  for (const fn of this.signal._onabort) {
12891
12889
  fn(reason);
12892
12890
  }
12893
- (_b = (_a2 = this.signal).onabort) == null ? void 0 : _b.call(_a2, reason);
12891
+ this.signal.onabort?.(reason);
12894
12892
  }
12895
12893
  };
12896
- let printACPolyfillWarning = ((_a = PROCESS.env) == null ? void 0 : _a.LRU_CACHE_IGNORE_AC_WARNING) !== "1";
12894
+ let printACPolyfillWarning = PROCESS.env?.LRU_CACHE_IGNORE_AC_WARNING !== "1";
12897
12895
  const warnACPolyfill = () => {
12898
12896
  if (!printACPolyfillWarning)
12899
12897
  return;
@@ -13548,7 +13546,6 @@ var require_cjs = __commonJS({
13548
13546
  * {@link LRUCache#delete}
13549
13547
  */
13550
13548
  set(k, v, setOptions = {}) {
13551
- var _a2, _b, _c;
13552
13549
  if (v === void 0) {
13553
13550
  this.delete(k);
13554
13551
  return this;
@@ -13586,10 +13583,10 @@ var require_cjs = __commonJS({
13586
13583
  oldVal.__abortController.abort(new Error("replaced"));
13587
13584
  } else if (!noDisposeOnSet) {
13588
13585
  if (this.#hasDispose) {
13589
- (_a2 = this.#dispose) == null ? void 0 : _a2.call(this, oldVal, k, "set");
13586
+ this.#dispose?.(oldVal, k, "set");
13590
13587
  }
13591
13588
  if (this.#hasDisposeAfter) {
13592
- (_b = this.#disposed) == null ? void 0 : _b.push([oldVal, k, "set"]);
13589
+ this.#disposed?.push([oldVal, k, "set"]);
13593
13590
  }
13594
13591
  }
13595
13592
  this.#removeItemSize(index);
@@ -13618,8 +13615,8 @@ var require_cjs = __commonJS({
13618
13615
  if (!noDisposeOnSet && this.#hasDisposeAfter && this.#disposed) {
13619
13616
  const dt = this.#disposed;
13620
13617
  let task;
13621
- while (task = dt == null ? void 0 : dt.shift()) {
13622
- (_c = this.#disposeAfter) == null ? void 0 : _c.call(this, ...task);
13618
+ while (task = dt?.shift()) {
13619
+ this.#disposeAfter?.(...task);
13623
13620
  }
13624
13621
  }
13625
13622
  return this;
@@ -13629,7 +13626,6 @@ var require_cjs = __commonJS({
13629
13626
  * `undefined` if cache is empty.
13630
13627
  */
13631
13628
  pop() {
13632
- var _a2;
13633
13629
  try {
13634
13630
  while (this.#size) {
13635
13631
  const val = this.#valList[this.#head];
@@ -13646,14 +13642,13 @@ var require_cjs = __commonJS({
13646
13642
  if (this.#hasDisposeAfter && this.#disposed) {
13647
13643
  const dt = this.#disposed;
13648
13644
  let task;
13649
- while (task = dt == null ? void 0 : dt.shift()) {
13650
- (_a2 = this.#disposeAfter) == null ? void 0 : _a2.call(this, ...task);
13645
+ while (task = dt?.shift()) {
13646
+ this.#disposeAfter?.(...task);
13651
13647
  }
13652
13648
  }
13653
13649
  }
13654
13650
  }
13655
13651
  #evict(free) {
13656
- var _a2, _b;
13657
13652
  const head = this.#head;
13658
13653
  const k = this.#keyList[head];
13659
13654
  const v = this.#valList[head];
@@ -13661,10 +13656,10 @@ var require_cjs = __commonJS({
13661
13656
  v.__abortController.abort(new Error("evicted"));
13662
13657
  } else if (this.#hasDispose || this.#hasDisposeAfter) {
13663
13658
  if (this.#hasDispose) {
13664
- (_a2 = this.#dispose) == null ? void 0 : _a2.call(this, v, k, "evict");
13659
+ this.#dispose?.(v, k, "evict");
13665
13660
  }
13666
13661
  if (this.#hasDisposeAfter) {
13667
- (_b = this.#disposed) == null ? void 0 : _b.push([v, k, "evict"]);
13662
+ this.#disposed?.push([v, k, "evict"]);
13668
13663
  }
13669
13664
  }
13670
13665
  this.#removeItemSize(head);
@@ -13739,7 +13734,7 @@ var require_cjs = __commonJS({
13739
13734
  }
13740
13735
  const ac = new AC();
13741
13736
  const { signal } = options;
13742
- signal == null ? void 0 : signal.addEventListener("abort", () => ac.abort(signal.reason), {
13737
+ signal?.addEventListener("abort", () => ac.abort(signal.reason), {
13743
13738
  signal: ac.signal
13744
13739
  });
13745
13740
  const fetchOpts = {
@@ -13810,8 +13805,7 @@ var require_cjs = __commonJS({
13810
13805
  }
13811
13806
  };
13812
13807
  const pcall = (res, rej) => {
13813
- var _a2;
13814
- const fmp = (_a2 = this.#fetchMethod) == null ? void 0 : _a2.call(this, k, v, fetchOpts);
13808
+ const fmp = this.#fetchMethod?.(k, v, fetchOpts);
13815
13809
  if (fmp && fmp instanceof Promise) {
13816
13810
  fmp.then((v2) => res(v2), rej);
13817
13811
  }
@@ -14000,7 +13994,6 @@ var require_cjs = __commonJS({
14000
13994
  * Returns true if the key was deleted, false otherwise.
14001
13995
  */
14002
13996
  delete(k) {
14003
- var _a2, _b, _c, _d;
14004
13997
  let deleted = false;
14005
13998
  if (this.#size !== 0) {
14006
13999
  const index = this.#keyMap.get(k);
@@ -14015,10 +14008,10 @@ var require_cjs = __commonJS({
14015
14008
  v.__abortController.abort(new Error("deleted"));
14016
14009
  } else if (this.#hasDispose || this.#hasDisposeAfter) {
14017
14010
  if (this.#hasDispose) {
14018
- (_a2 = this.#dispose) == null ? void 0 : _a2.call(this, v, k, "delete");
14011
+ this.#dispose?.(v, k, "delete");
14019
14012
  }
14020
14013
  if (this.#hasDisposeAfter) {
14021
- (_b = this.#disposed) == null ? void 0 : _b.push([v, k, "delete"]);
14014
+ this.#disposed?.push([v, k, "delete"]);
14022
14015
  }
14023
14016
  }
14024
14017
  this.#keyMap.delete(k);
@@ -14037,11 +14030,11 @@ var require_cjs = __commonJS({
14037
14030
  }
14038
14031
  }
14039
14032
  }
14040
- if (this.#hasDisposeAfter && ((_c = this.#disposed) == null ? void 0 : _c.length)) {
14033
+ if (this.#hasDisposeAfter && this.#disposed?.length) {
14041
14034
  const dt = this.#disposed;
14042
14035
  let task;
14043
- while (task = dt == null ? void 0 : dt.shift()) {
14044
- (_d = this.#disposeAfter) == null ? void 0 : _d.call(this, ...task);
14036
+ while (task = dt?.shift()) {
14037
+ this.#disposeAfter?.(...task);
14045
14038
  }
14046
14039
  }
14047
14040
  return deleted;
@@ -14050,7 +14043,6 @@ var require_cjs = __commonJS({
14050
14043
  * Clear the cache entirely, throwing away all values.
14051
14044
  */
14052
14045
  clear() {
14053
- var _a2, _b, _c;
14054
14046
  for (const index of this.#rindexes({ allowStale: true })) {
14055
14047
  const v = this.#valList[index];
14056
14048
  if (this.#isBackgroundFetch(v)) {
@@ -14058,10 +14050,10 @@ var require_cjs = __commonJS({
14058
14050
  } else {
14059
14051
  const k = this.#keyList[index];
14060
14052
  if (this.#hasDispose) {
14061
- (_a2 = this.#dispose) == null ? void 0 : _a2.call(this, v, k, "delete");
14053
+ this.#dispose?.(v, k, "delete");
14062
14054
  }
14063
14055
  if (this.#hasDisposeAfter) {
14064
- (_b = this.#disposed) == null ? void 0 : _b.push([v, k, "delete"]);
14056
+ this.#disposed?.push([v, k, "delete"]);
14065
14057
  }
14066
14058
  }
14067
14059
  }
@@ -14083,8 +14075,8 @@ var require_cjs = __commonJS({
14083
14075
  if (this.#hasDisposeAfter && this.#disposed) {
14084
14076
  const dt = this.#disposed;
14085
14077
  let task;
14086
- while (task = dt == null ? void 0 : dt.shift()) {
14087
- (_c = this.#disposeAfter) == null ? void 0 : _c.call(this, ...task);
14078
+ while (task = dt?.shift()) {
14079
+ this.#disposeAfter?.(...task);
14088
14080
  }
14089
14081
  }
14090
14082
  }
@@ -17496,20 +17488,20 @@ __export(idle_runner_repear_lambda_exports, {
17496
17488
  handler: () => handler
17497
17489
  });
17498
17490
  module.exports = __toCommonJS(idle_runner_repear_lambda_exports);
17499
- var AWS2 = __toESM(require("aws-sdk"));
17491
+ var import_client_sfn = require("@aws-sdk/client-sfn");
17500
17492
 
17501
17493
  // src/lambda-github.ts
17502
17494
  var import_auth_app = __toESM(require_dist_node12());
17503
17495
  var import_rest = __toESM(require_dist_node19());
17504
17496
 
17505
17497
  // src/lambda-helpers.ts
17506
- var AWS = __toESM(require("aws-sdk"));
17507
- var sm = new AWS.SecretsManager();
17498
+ var import_client_secrets_manager = require("@aws-sdk/client-secrets-manager");
17499
+ var sm = new import_client_secrets_manager.SecretsManagerClient();
17508
17500
  async function getSecretValue(arn) {
17509
17501
  if (!arn) {
17510
17502
  throw new Error("Missing secret ARN");
17511
17503
  }
17512
- const secret = await sm.getSecretValue({ SecretId: arn }).promise();
17504
+ const secret = await sm.send(new import_client_secrets_manager.GetSecretValueCommand({ SecretId: arn }));
17513
17505
  if (!secret.SecretString) {
17514
17506
  throw new Error(`No SecretString in ${arn}`);
17515
17507
  }
@@ -17597,7 +17589,7 @@ async function getRunner(octokit, owner, repo, name) {
17597
17589
  }
17598
17590
 
17599
17591
  // src/idle-runner-repear.lambda.ts
17600
- var sfn = new AWS2.StepFunctions();
17592
+ var sfn = new import_client_sfn.SFNClient();
17601
17593
  async function handler(event) {
17602
17594
  const result = { batchItemFailures: [] };
17603
17595
  const octokitCache2 = {};
@@ -17605,7 +17597,7 @@ async function handler(event) {
17605
17597
  const input = JSON.parse(record.body);
17606
17598
  console.log(`Checking runner for ${input.owner}/${input.repo} [execution-id=${input.runnerName}]`);
17607
17599
  const retryLater = () => result.batchItemFailures.push({ itemIdentifier: record.messageId });
17608
- const execution = await sfn.describeExecution({ executionArn: input.executionArn }).promise();
17600
+ const execution = await sfn.send(new import_client_sfn.DescribeExecutionCommand({ executionArn: input.executionArn }));
17609
17601
  if (execution.status != "RUNNING") {
17610
17602
  console.log("Runner already finished");
17611
17603
  continue;
@@ -17639,11 +17631,11 @@ async function handler(event) {
17639
17631
  console.log(`Runner ${input.runnerName} is idle for too long`);
17640
17632
  try {
17641
17633
  console.log(`Stopping step function ${input.executionArn}...`);
17642
- await sfn.stopExecution({
17634
+ await sfn.send(new import_client_sfn.StopExecutionCommand({
17643
17635
  executionArn: input.executionArn,
17644
17636
  error: "IdleRunner",
17645
17637
  cause: `Runner ${input.runnerName} on ${input.owner}/${input.repo} is idle for too long (${diffMs / 1e3} seconds and limit is ${input.maxIdleSeconds} seconds)`
17646
- }).promise();
17638
+ }));
17647
17639
  } catch (e) {
17648
17640
  console.error(`Failed to stop step function ${input.executionArn}: ${e}`);
17649
17641
  retryLater();