@cloudsnorkel/cdk-github-runners 0.7.5 → 0.7.6

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
@@ -3184,7 +3184,7 @@
3184
3184
  },
3185
3185
  "locationInModule": {
3186
3186
  "filename": "src/providers/image-builders/ami.ts",
3187
- "line": 223
3187
+ "line": 230
3188
3188
  },
3189
3189
  "parameters": [
3190
3190
  {
@@ -3215,7 +3215,7 @@
3215
3215
  "kind": "class",
3216
3216
  "locationInModule": {
3217
3217
  "filename": "src/providers/image-builders/ami.ts",
3218
- "line": 220
3218
+ "line": 227
3219
3219
  },
3220
3220
  "methods": [
3221
3221
  {
@@ -3225,7 +3225,7 @@
3225
3225
  },
3226
3226
  "locationInModule": {
3227
3227
  "filename": "src/providers/image-builders/ami.ts",
3228
- "line": 285
3228
+ "line": 296
3229
3229
  },
3230
3230
  "name": "addComponent",
3231
3231
  "parameters": [
@@ -3245,7 +3245,7 @@
3245
3245
  },
3246
3246
  "locationInModule": {
3247
3247
  "filename": "src/providers/image-builders/ami.ts",
3248
- "line": 300
3248
+ "line": 311
3249
3249
  },
3250
3250
  "name": "addExtraCertificates",
3251
3251
  "parameters": [
@@ -3267,7 +3267,7 @@
3267
3267
  },
3268
3268
  "locationInModule": {
3269
3269
  "filename": "src/providers/image-builders/ami.ts",
3270
- "line": 313
3270
+ "line": 324
3271
3271
  },
3272
3272
  "name": "bind",
3273
3273
  "overrides": "@cloudsnorkel/cdk-github-runners.IAmiBuilder",
@@ -3438,7 +3438,7 @@
3438
3438
  },
3439
3439
  "locationInModule": {
3440
3440
  "filename": "src/providers/image-builders/ami.ts",
3441
- "line": 271
3441
+ "line": 282
3442
3442
  },
3443
3443
  "name": "prependComponent",
3444
3444
  "parameters": [
@@ -3599,6 +3599,25 @@
3599
3599
  "fqn": "@cloudsnorkel/cdk-github-runners.Architecture"
3600
3600
  }
3601
3601
  },
3602
+ {
3603
+ "abstract": true,
3604
+ "docs": {
3605
+ "default": "true",
3606
+ "remarks": "You may want to disable this if you are building a Windows image and don't have a Docker Desktop license.",
3607
+ "stability": "experimental",
3608
+ "summary": "Install Docker inside the image, so it can be used by the runner."
3609
+ },
3610
+ "immutable": true,
3611
+ "locationInModule": {
3612
+ "filename": "src/providers/image-builders/ami.ts",
3613
+ "line": 115
3614
+ },
3615
+ "name": "installDocker",
3616
+ "optional": true,
3617
+ "type": {
3618
+ "primitive": "boolean"
3619
+ }
3620
+ },
3602
3621
  {
3603
3622
  "abstract": true,
3604
3623
  "docs": {
@@ -4480,7 +4499,16 @@
4480
4499
  {
4481
4500
  "name": "task",
4482
4501
  "type": {
4483
- "fqn": "aws-cdk-lib.aws_stepfunctions.TaskStateBase"
4502
+ "union": {
4503
+ "types": [
4504
+ {
4505
+ "fqn": "aws-cdk-lib.aws_stepfunctions.Parallel"
4506
+ },
4507
+ {
4508
+ "fqn": "aws-cdk-lib.aws_stepfunctions.TaskStateBase"
4509
+ }
4510
+ ]
4511
+ }
4484
4512
  }
4485
4513
  },
4486
4514
  {
@@ -5680,7 +5708,16 @@
5680
5708
  {
5681
5709
  "name": "task",
5682
5710
  "type": {
5683
- "fqn": "aws-cdk-lib.aws_stepfunctions.TaskStateBase"
5711
+ "union": {
5712
+ "types": [
5713
+ {
5714
+ "fqn": "aws-cdk-lib.aws_stepfunctions.Parallel"
5715
+ },
5716
+ {
5717
+ "fqn": "aws-cdk-lib.aws_stepfunctions.TaskStateBase"
5718
+ }
5719
+ ]
5720
+ }
5684
5721
  }
5685
5722
  },
5686
5723
  {
@@ -5734,7 +5771,7 @@
5734
5771
  },
5735
5772
  "locationInModule": {
5736
5773
  "filename": "src/providers/ec2.ts",
5737
- "line": 370
5774
+ "line": 402
5738
5775
  },
5739
5776
  "name": "grantStateMachine",
5740
5777
  "overrides": "@cloudsnorkel/cdk-github-runners.IRunnerProvider",
@@ -5803,7 +5840,7 @@
5803
5840
  },
5804
5841
  "locationInModule": {
5805
5842
  "filename": "src/providers/ec2.ts",
5806
- "line": 400
5843
+ "line": 432
5807
5844
  },
5808
5845
  "name": "status",
5809
5846
  "overrides": "@cloudsnorkel/cdk-github-runners.IRunnerProvider",
@@ -5832,7 +5869,7 @@
5832
5869
  "immutable": true,
5833
5870
  "locationInModule": {
5834
5871
  "filename": "src/providers/ec2.ts",
5835
- "line": 421
5872
+ "line": 453
5836
5873
  },
5837
5874
  "name": "connections",
5838
5875
  "overrides": "aws-cdk-lib.aws_ec2.IConnectable",
@@ -6177,7 +6214,16 @@
6177
6214
  {
6178
6215
  "name": "task",
6179
6216
  "type": {
6180
- "fqn": "aws-cdk-lib.aws_stepfunctions.TaskStateBase"
6217
+ "union": {
6218
+ "types": [
6219
+ {
6220
+ "fqn": "aws-cdk-lib.aws_stepfunctions.Parallel"
6221
+ },
6222
+ {
6223
+ "fqn": "aws-cdk-lib.aws_stepfunctions.TaskStateBase"
6224
+ }
6225
+ ]
6226
+ }
6181
6227
  }
6182
6228
  },
6183
6229
  {
@@ -6825,7 +6871,7 @@
6825
6871
  },
6826
6872
  "locationInModule": {
6827
6873
  "filename": "src/runner.ts",
6828
- "line": 187
6874
+ "line": 188
6829
6875
  },
6830
6876
  "parameters": [
6831
6877
  {
@@ -6852,7 +6898,7 @@
6852
6898
  "kind": "class",
6853
6899
  "locationInModule": {
6854
6900
  "filename": "src/runner.ts",
6855
- "line": 169
6901
+ "line": 170
6856
6902
  },
6857
6903
  "name": "GitHubRunners",
6858
6904
  "properties": [
@@ -6864,7 +6910,7 @@
6864
6910
  "immutable": true,
6865
6911
  "locationInModule": {
6866
6912
  "filename": "src/runner.ts",
6867
- "line": 173
6913
+ "line": 174
6868
6914
  },
6869
6915
  "name": "providers",
6870
6916
  "type": {
@@ -6884,7 +6930,7 @@
6884
6930
  "immutable": true,
6885
6931
  "locationInModule": {
6886
6932
  "filename": "src/runner.ts",
6887
- "line": 178
6933
+ "line": 179
6888
6934
  },
6889
6935
  "name": "secrets",
6890
6936
  "type": {
@@ -6898,7 +6944,7 @@
6898
6944
  "immutable": true,
6899
6945
  "locationInModule": {
6900
6946
  "filename": "src/runner.ts",
6901
- "line": 187
6947
+ "line": 188
6902
6948
  },
6903
6949
  "name": "props",
6904
6950
  "optional": true,
@@ -6920,7 +6966,7 @@
6920
6966
  "kind": "interface",
6921
6967
  "locationInModule": {
6922
6968
  "filename": "src/runner.ts",
6923
- "line": 24
6969
+ "line": 25
6924
6970
  },
6925
6971
  "name": "GitHubRunnersProps",
6926
6972
  "properties": [
@@ -6935,7 +6981,7 @@
6935
6981
  "immutable": true,
6936
6982
  "locationInModule": {
6937
6983
  "filename": "src/runner.ts",
6938
- "line": 47
6984
+ "line": 48
6939
6985
  },
6940
6986
  "name": "allowPublicSubnet",
6941
6987
  "optional": true,
@@ -6953,7 +6999,7 @@
6953
6999
  "immutable": true,
6954
7000
  "locationInModule": {
6955
7001
  "filename": "src/runner.ts",
6956
- "line": 79
7002
+ "line": 80
6957
7003
  },
6958
7004
  "name": "extraCertificates",
6959
7005
  "optional": true,
@@ -6972,7 +7018,7 @@
6972
7018
  "immutable": true,
6973
7019
  "locationInModule": {
6974
7020
  "filename": "src/runner.ts",
6975
- "line": 86
7021
+ "line": 87
6976
7022
  },
6977
7023
  "name": "idleTimeout",
6978
7024
  "optional": true,
@@ -6990,7 +7036,7 @@
6990
7036
  "immutable": true,
6991
7037
  "locationInModule": {
6992
7038
  "filename": "src/runner.ts",
6993
- "line": 93
7039
+ "line": 94
6994
7040
  },
6995
7041
  "name": "logOptions",
6996
7042
  "optional": true,
@@ -7009,7 +7055,7 @@
7009
7055
  "immutable": true,
7010
7056
  "locationInModule": {
7011
7057
  "filename": "src/runner.ts",
7012
- "line": 30
7058
+ "line": 31
7013
7059
  },
7014
7060
  "name": "providers",
7015
7061
  "optional": true,
@@ -7032,7 +7078,7 @@
7032
7078
  "immutable": true,
7033
7079
  "locationInModule": {
7034
7080
  "filename": "src/runner.ts",
7035
- "line": 52
7081
+ "line": 53
7036
7082
  },
7037
7083
  "name": "securityGroup",
7038
7084
  "optional": true,
@@ -7050,7 +7096,7 @@
7050
7096
  "immutable": true,
7051
7097
  "locationInModule": {
7052
7098
  "filename": "src/runner.ts",
7053
- "line": 35
7099
+ "line": 36
7054
7100
  },
7055
7101
  "name": "vpc",
7056
7102
  "optional": true,
@@ -7068,7 +7114,7 @@
7068
7114
  "immutable": true,
7069
7115
  "locationInModule": {
7070
7116
  "filename": "src/runner.ts",
7071
- "line": 40
7117
+ "line": 41
7072
7118
  },
7073
7119
  "name": "vpcSubnets",
7074
7120
  "optional": true,
@@ -7279,7 +7325,8 @@
7279
7325
  "fqn": "@cloudsnorkel/cdk-github-runners.IRunnerProvider",
7280
7326
  "interfaces": [
7281
7327
  "aws-cdk-lib.aws_ec2.IConnectable",
7282
- "aws-cdk-lib.aws_iam.IGrantable"
7328
+ "aws-cdk-lib.aws_iam.IGrantable",
7329
+ "constructs.IConstruct"
7283
7330
  ],
7284
7331
  "kind": "interface",
7285
7332
  "locationInModule": {
@@ -7898,7 +7945,16 @@
7898
7945
  {
7899
7946
  "name": "task",
7900
7947
  "type": {
7901
- "fqn": "aws-cdk-lib.aws_stepfunctions.TaskStateBase"
7948
+ "union": {
7949
+ "types": [
7950
+ {
7951
+ "fqn": "aws-cdk-lib.aws_stepfunctions.Parallel"
7952
+ },
7953
+ {
7954
+ "fqn": "aws-cdk-lib.aws_stepfunctions.TaskStateBase"
7955
+ }
7956
+ ]
7957
+ }
7902
7958
  }
7903
7959
  },
7904
7960
  {
@@ -8710,7 +8766,7 @@
8710
8766
  "kind": "interface",
8711
8767
  "locationInModule": {
8712
8768
  "filename": "src/runner.ts",
8713
- "line": 99
8769
+ "line": 100
8714
8770
  },
8715
8771
  "name": "LogOptions",
8716
8772
  "properties": [
@@ -8724,7 +8780,7 @@
8724
8780
  "immutable": true,
8725
8781
  "locationInModule": {
8726
8782
  "filename": "src/runner.ts",
8727
- "line": 110
8783
+ "line": 111
8728
8784
  },
8729
8785
  "name": "includeExecutionData",
8730
8786
  "optional": true,
@@ -8742,7 +8798,7 @@
8742
8798
  "immutable": true,
8743
8799
  "locationInModule": {
8744
8800
  "filename": "src/runner.ts",
8745
- "line": 117
8801
+ "line": 118
8746
8802
  },
8747
8803
  "name": "level",
8748
8804
  "optional": true,
@@ -8759,7 +8815,7 @@
8759
8815
  "immutable": true,
8760
8816
  "locationInModule": {
8761
8817
  "filename": "src/runner.ts",
8762
- "line": 103
8818
+ "line": 104
8763
8819
  },
8764
8820
  "name": "logGroupName",
8765
8821
  "optional": true,
@@ -8778,7 +8834,7 @@
8778
8834
  "immutable": true,
8779
8835
  "locationInModule": {
8780
8836
  "filename": "src/runner.ts",
8781
- "line": 126
8837
+ "line": 127
8782
8838
  },
8783
8839
  "name": "logRetention",
8784
8840
  "optional": true,
@@ -9994,6 +10050,6 @@
9994
10050
  "symbolId": "src/providers/image-builders/windows-components:WindowsComponents"
9995
10051
  }
9996
10052
  },
9997
- "version": "0.7.5",
9998
- "fingerprint": "laqJPG7tuKfwHJxSKRBzkd+Ep19fgids70hLEG6AxIE="
10053
+ "version": "0.7.6",
10054
+ "fingerprint": "ZZyPQhyjY7Cdx+RPoiCGbrij9KNR68fpSulMzukmnhg="
9999
10055
  }
package/API.md CHANGED
@@ -2379,6 +2379,7 @@ const amiBuilderProps: AmiBuilderProps = { ... }
2379
2379
  | **Name** | **Type** | **Description** |
2380
2380
  | --- | --- | --- |
2381
2381
  | <code><a href="#@cloudsnorkel/cdk-github-runners.AmiBuilderProps.property.architecture">architecture</a></code> | <code><a href="#@cloudsnorkel/cdk-github-runners.Architecture">Architecture</a></code> | Image architecture. |
2382
+ | <code><a href="#@cloudsnorkel/cdk-github-runners.AmiBuilderProps.property.installDocker">installDocker</a></code> | <code>boolean</code> | Install Docker inside the image, so it can be used by the runner. |
2382
2383
  | <code><a href="#@cloudsnorkel/cdk-github-runners.AmiBuilderProps.property.instanceType">instanceType</a></code> | <code>aws-cdk-lib.aws_ec2.InstanceType</code> | The instance type used to build the image. |
2383
2384
  | <code><a href="#@cloudsnorkel/cdk-github-runners.AmiBuilderProps.property.logRemovalPolicy">logRemovalPolicy</a></code> | <code>aws-cdk-lib.RemovalPolicy</code> | Removal policy for logs of image builds. |
2384
2385
  | <code><a href="#@cloudsnorkel/cdk-github-runners.AmiBuilderProps.property.logRetention">logRetention</a></code> | <code>aws-cdk-lib.aws_logs.RetentionDays</code> | The number of days log events are kept in CloudWatch Logs. |
@@ -2405,6 +2406,21 @@ Image architecture.
2405
2406
 
2406
2407
  ---
2407
2408
 
2409
+ ##### `installDocker`<sup>Optional</sup> <a name="installDocker" id="@cloudsnorkel/cdk-github-runners.AmiBuilderProps.property.installDocker"></a>
2410
+
2411
+ ```typescript
2412
+ public readonly installDocker: boolean;
2413
+ ```
2414
+
2415
+ - *Type:* boolean
2416
+ - *Default:* true
2417
+
2418
+ Install Docker inside the image, so it can be used by the runner.
2419
+
2420
+ You may want to disable this if you are building a Windows image and don't have a Docker Desktop license.
2421
+
2422
+ ---
2423
+
2408
2424
  ##### `instanceType`<sup>Optional</sup> <a name="instanceType" id="@cloudsnorkel/cdk-github-runners.AmiBuilderProps.property.instanceType"></a>
2409
2425
 
2410
2426
  ```typescript
@@ -5691,7 +5707,7 @@ Log group name for the image builder where history of image builds can be analyz
5691
5707
 
5692
5708
  ### IRunnerProvider <a name="IRunnerProvider" id="@cloudsnorkel/cdk-github-runners.IRunnerProvider"></a>
5693
5709
 
5694
- - *Extends:* aws-cdk-lib.aws_ec2.IConnectable, aws-cdk-lib.aws_iam.IGrantable
5710
+ - *Extends:* aws-cdk-lib.aws_ec2.IConnectable, aws-cdk-lib.aws_iam.IGrantable, constructs.IConstruct
5695
5711
 
5696
5712
  - *Implemented By:* <a href="#@cloudsnorkel/cdk-github-runners.CodeBuildRunner">CodeBuildRunner</a>, <a href="#@cloudsnorkel/cdk-github-runners.Ec2Runner">Ec2Runner</a>, <a href="#@cloudsnorkel/cdk-github-runners.FargateRunner">FargateRunner</a>, <a href="#@cloudsnorkel/cdk-github-runners.LambdaRunner">LambdaRunner</a>, <a href="#@cloudsnorkel/cdk-github-runners.IRunnerProvider">IRunnerProvider</a>
5697
5713
 
@@ -5770,6 +5786,7 @@ grantable for the status function.
5770
5786
  | --- | --- | --- |
5771
5787
  | <code><a href="#@cloudsnorkel/cdk-github-runners.IRunnerProvider.property.connections">connections</a></code> | <code>aws-cdk-lib.aws_ec2.Connections</code> | The network connections associated with this resource. |
5772
5788
  | <code><a href="#@cloudsnorkel/cdk-github-runners.IRunnerProvider.property.grantPrincipal">grantPrincipal</a></code> | <code>aws-cdk-lib.aws_iam.IPrincipal</code> | The principal to grant permissions to. |
5789
+ | <code><a href="#@cloudsnorkel/cdk-github-runners.IRunnerProvider.property.node">node</a></code> | <code>constructs.Node</code> | The tree node. |
5773
5790
  | <code><a href="#@cloudsnorkel/cdk-github-runners.IRunnerProvider.property.labels">labels</a></code> | <code>string[]</code> | GitHub Actions labels used for this provider. |
5774
5791
 
5775
5792
  ---
@@ -5798,6 +5815,18 @@ The principal to grant permissions to.
5798
5815
 
5799
5816
  ---
5800
5817
 
5818
+ ##### `node`<sup>Required</sup> <a name="node" id="@cloudsnorkel/cdk-github-runners.IRunnerProvider.property.node"></a>
5819
+
5820
+ ```typescript
5821
+ public readonly node: Node;
5822
+ ```
5823
+
5824
+ - *Type:* constructs.Node
5825
+
5826
+ The tree node.
5827
+
5828
+ ---
5829
+
5801
5830
  ##### `labels`<sup>Required</sup> <a name="labels" id="@cloudsnorkel/cdk-github-runners.IRunnerProvider.property.labels"></a>
5802
5831
 
5803
5832
  ```typescript
@@ -6849,6 +6849,11 @@ var require_lib3 = __commonJS({
6849
6849
  const dest = new URL$1(destination).hostname;
6850
6850
  return orig === dest || orig[orig.length - dest.length - 1] === "." && orig.endsWith(dest);
6851
6851
  };
6852
+ var isSameProtocol = function isSameProtocol2(destination, original) {
6853
+ const orig = new URL$1(original).protocol;
6854
+ const dest = new URL$1(destination).protocol;
6855
+ return orig === dest;
6856
+ };
6852
6857
  function fetch(url, opts) {
6853
6858
  if (!fetch.Promise) {
6854
6859
  throw new Error("native promise missing, set fetch.Promise to your favorite alternative");
@@ -6864,7 +6869,7 @@ var require_lib3 = __commonJS({
6864
6869
  let error = new AbortError("The user aborted a request.");
6865
6870
  reject(error);
6866
6871
  if (request.body && request.body instanceof Stream.Readable) {
6867
- request.body.destroy(error);
6872
+ destroyStream(request.body, error);
6868
6873
  }
6869
6874
  if (!response || !response.body)
6870
6875
  return;
@@ -6899,8 +6904,29 @@ var require_lib3 = __commonJS({
6899
6904
  }
6900
6905
  req.on("error", function(err) {
6901
6906
  reject(new FetchError(`request to ${request.url} failed, reason: ${err.message}`, "system", err));
6907
+ if (response && response.body) {
6908
+ destroyStream(response.body, err);
6909
+ }
6902
6910
  finalize();
6903
6911
  });
6912
+ fixResponseChunkedTransferBadEnding(req, function(err) {
6913
+ if (signal && signal.aborted) {
6914
+ return;
6915
+ }
6916
+ destroyStream(response.body, err);
6917
+ });
6918
+ if (parseInt(process.version.substring(1)) < 14) {
6919
+ req.on("socket", function(s) {
6920
+ s.addListener("close", function(hadError) {
6921
+ const hasDataListener = s.listenerCount("data") > 0;
6922
+ if (response && hasDataListener && !hadError && !(signal && signal.aborted)) {
6923
+ const err = new Error("Premature close");
6924
+ err.code = "ERR_STREAM_PREMATURE_CLOSE";
6925
+ response.body.emit("error", err);
6926
+ }
6927
+ });
6928
+ });
6929
+ }
6904
6930
  req.on("response", function(res) {
6905
6931
  clearTimeout(reqTimeout);
6906
6932
  const headers = createHeadersLenient(res.headers);
@@ -6951,7 +6977,7 @@ var require_lib3 = __commonJS({
6951
6977
  timeout: request.timeout,
6952
6978
  size: request.size
6953
6979
  };
6954
- if (!isDomainOrSubdomain(request.url, locationURL)) {
6980
+ if (!isDomainOrSubdomain(request.url, locationURL) || !isSameProtocol(request.url, locationURL)) {
6955
6981
  for (const name of ["authorization", "www-authenticate", "cookie", "cookie2"]) {
6956
6982
  requestOpts.headers.delete(name);
6957
6983
  }
@@ -7012,6 +7038,12 @@ var require_lib3 = __commonJS({
7012
7038
  response = new Response(body, response_options);
7013
7039
  resolve(response);
7014
7040
  });
7041
+ raw.on("end", function() {
7042
+ if (!response) {
7043
+ response = new Response(body, response_options);
7044
+ resolve(response);
7045
+ }
7046
+ });
7015
7047
  return;
7016
7048
  }
7017
7049
  if (codings == "br" && typeof zlib.createBrotliDecompress === "function") {
@@ -7026,6 +7058,33 @@ var require_lib3 = __commonJS({
7026
7058
  writeToStream(req, request);
7027
7059
  });
7028
7060
  }
7061
+ function fixResponseChunkedTransferBadEnding(request, errorCallback) {
7062
+ let socket;
7063
+ request.on("socket", function(s) {
7064
+ socket = s;
7065
+ });
7066
+ request.on("response", function(response) {
7067
+ const headers = response.headers;
7068
+ if (headers["transfer-encoding"] === "chunked" && !headers["content-length"]) {
7069
+ response.once("close", function(hadError) {
7070
+ const hasDataListener = socket.listenerCount("data") > 0;
7071
+ if (hasDataListener && !hadError) {
7072
+ const err = new Error("Premature close");
7073
+ err.code = "ERR_STREAM_PREMATURE_CLOSE";
7074
+ errorCallback(err);
7075
+ }
7076
+ });
7077
+ }
7078
+ });
7079
+ }
7080
+ function destroyStream(stream, err) {
7081
+ if (stream.destroy) {
7082
+ stream.destroy(err);
7083
+ } else {
7084
+ stream.emit("error", err);
7085
+ stream.end();
7086
+ }
7087
+ }
7029
7088
  fetch.isRedirect = function(code) {
7030
7089
  return code === 301 || code === 302 || code === 303 || code === 307 || code === 308;
7031
7090
  };
@@ -8785,7 +8844,7 @@ var require_dist_node14 = __commonJS({
8785
8844
  var authOauthDevice = require_dist_node13();
8786
8845
  var oauthMethods = require_dist_node12();
8787
8846
  var btoa = _interopDefault(require_btoa_node());
8788
- var VERSION = "2.0.4";
8847
+ var VERSION = "2.1.0";
8789
8848
  async function getAuthentication(state) {
8790
8849
  if ("code" in state.strategyOptions) {
8791
8850
  const {
@@ -8794,6 +8853,7 @@ var require_dist_node14 = __commonJS({
8794
8853
  clientId: state.clientId,
8795
8854
  clientSecret: state.clientSecret,
8796
8855
  clientType: state.clientType,
8856
+ onTokenCreated: state.onTokenCreated,
8797
8857
  ...state.strategyOptions,
8798
8858
  request: state.request
8799
8859
  });
@@ -8807,6 +8867,7 @@ var require_dist_node14 = __commonJS({
8807
8867
  const deviceAuth = authOauthDevice.createOAuthDeviceAuth({
8808
8868
  clientType: state.clientType,
8809
8869
  clientId: state.clientId,
8870
+ onTokenCreated: state.onTokenCreated,
8810
8871
  ...state.strategyOptions,
8811
8872
  request: state.request
8812
8873
  });
@@ -8825,6 +8886,7 @@ var require_dist_node14 = __commonJS({
8825
8886
  clientId: state.clientId,
8826
8887
  clientSecret: state.clientSecret,
8827
8888
  clientType: state.clientType,
8889
+ onTokenCreated: state.onTokenCreated,
8828
8890
  ...state.strategyOptions
8829
8891
  };
8830
8892
  }
@@ -8857,12 +8919,16 @@ var require_dist_node14 = __commonJS({
8857
8919
  }
8858
8920
  }
8859
8921
  if (options.type === "refresh") {
8922
+ var _state$onTokenCreated;
8860
8923
  if (state.clientType === "oauth-app") {
8861
8924
  throw new Error("[@octokit/auth-oauth-user] OAuth Apps do not support expiring tokens");
8862
8925
  }
8863
8926
  if (!currentAuthentication.hasOwnProperty("expiresAt")) {
8864
8927
  throw new Error("[@octokit/auth-oauth-user] Refresh token missing");
8865
8928
  }
8929
+ await ((_state$onTokenCreated = state.onTokenCreated) === null || _state$onTokenCreated === void 0 ? void 0 : _state$onTokenCreated.call(state, state.authentication, {
8930
+ type: options.type
8931
+ }));
8866
8932
  }
8867
8933
  if (options.type === "check" || options.type === "reset") {
8868
8934
  const method = options.type === "check" ? oauthMethods.checkToken : oauthMethods.resetToken;
@@ -8883,6 +8949,12 @@ var require_dist_node14 = __commonJS({
8883
8949
  // @ts-expect-error TBD
8884
8950
  ...authentication
8885
8951
  };
8952
+ if (options.type === "reset") {
8953
+ var _state$onTokenCreated2;
8954
+ await ((_state$onTokenCreated2 = state.onTokenCreated) === null || _state$onTokenCreated2 === void 0 ? void 0 : _state$onTokenCreated2.call(state, state.authentication, {
8955
+ type: options.type
8956
+ }));
8957
+ }
8886
8958
  return state.authentication;
8887
8959
  } catch (error) {
8888
8960
  if (error.status === 404) {
@@ -8947,12 +9019,14 @@ var require_dist_node14 = __commonJS({
8947
9019
  "user-agent": `octokit-auth-oauth-app.js/${VERSION} ${universalUserAgent.getUserAgent()}`
8948
9020
  }
8949
9021
  }),
9022
+ onTokenCreated,
8950
9023
  ...strategyOptions
8951
9024
  }) {
8952
9025
  const state = Object.assign({
8953
9026
  clientType,
8954
9027
  clientId,
8955
9028
  clientSecret,
9029
+ onTokenCreated,
8956
9030
  strategyOptions,
8957
9031
  request: request$1
8958
9032
  });
@@ -13796,7 +13870,9 @@ var require_lodash = __commonJS({
13796
13870
  var isArr = isArray(value), isArg = !isArr && isArguments(value), isBuff = !isArr && !isArg && isBuffer(value), isType = !isArr && !isArg && !isBuff && isTypedArray(value), skipIndexes = isArr || isArg || isBuff || isType, result2 = skipIndexes ? baseTimes(value.length, String2) : [], length = result2.length;
13797
13871
  for (var key in value) {
13798
13872
  if ((inherited || hasOwnProperty.call(value, key)) && !(skipIndexes && // Safari 9 has enumerable `arguments.length` in strict mode.
13799
- (key == "length" || isBuff && (key == "offset" || key == "parent") || isType && (key == "buffer" || key == "byteLength" || key == "byteOffset") || // Skip index properties.
13873
+ (key == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
13874
+ isBuff && (key == "offset" || key == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
13875
+ isType && (key == "buffer" || key == "byteLength" || key == "byteOffset") || // Skip index properties.
13800
13876
  isIndex(key, length)))) {
13801
13877
  result2.push(key);
13802
13878
  }