@graphql-hive/gateway 2.0.0-next-599fa70cae41e9a42a343ea73b7dee5d36bf3517 → 2.0.0-next-e2698677f10276e29194b5559409235a15f2f324
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 +62 -35
- package/dist/bin.cjs +1 -1
- package/dist/bin.js +1 -1
- package/dist/{cli-BG8XaVLT.js → cli-CP9iY6tm.js} +27 -6
- package/dist/{cli-DqXsx5Cd.cjs → cli-CPxULGJb.cjs} +26 -5
- package/dist/execAsync-CZu27rRM.cjs +44 -0
- package/dist/execAsync-DmTy47v9.js +21 -0
- package/dist/getMachineId-bsd-B4KI42yf.js +40 -0
- package/dist/getMachineId-bsd-Bm_iwnsS.cjs +42 -0
- package/dist/getMachineId-darwin-BDexu45J.cjs +43 -0
- package/dist/getMachineId-darwin-c7bqIReD.js +41 -0
- package/dist/getMachineId-linux-D2g1lfzo.js +33 -0
- package/dist/getMachineId-linux-sJzq0whF.cjs +35 -0
- package/dist/getMachineId-unsupported-C6mI58qQ.js +23 -0
- package/dist/getMachineId-unsupported-Cmowwltd.cjs +25 -0
- package/dist/getMachineId-win-5mPgREt3.cjs +63 -0
- package/dist/getMachineId-win-CvE0ShWu.js +41 -0
- package/dist/index-61dm03o3.js +279698 -0
- package/dist/index-B44NjpxU.cjs +843 -0
- package/dist/index-DWaHa380.cjs +279743 -0
- package/dist/index-Dw4Doxg2.js +821 -0
- package/dist/index.cjs +5 -14
- package/dist/index.d.cts +14 -16
- package/dist/index.d.ts +14 -16
- package/dist/index.js +2 -3
- package/dist/opentelemetry/api.cjs +12 -0
- package/dist/opentelemetry/api.d.cts +1 -0
- package/dist/opentelemetry/api.d.ts +1 -0
- package/dist/opentelemetry/api.js +1 -0
- package/dist/opentelemetry/index.cjs +12 -0
- package/dist/opentelemetry/index.d.cts +3 -0
- package/dist/opentelemetry/index.d.ts +3 -0
- package/dist/opentelemetry/index.js +1 -0
- package/dist/opentelemetry/setup.cjs +12 -0
- package/dist/opentelemetry/setup.d.cts +1 -0
- package/dist/opentelemetry/setup.d.ts +1 -0
- package/dist/opentelemetry/setup.js +1 -0
- package/package.json +46 -16
package/CHANGELOG.md
CHANGED
@@ -1,46 +1,53 @@
|
|
1
1
|
# @graphql-hive/gateway
|
2
2
|
|
3
|
-
## 2.0.0-next-
|
3
|
+
## 2.0.0-next-e2698677f10276e29194b5559409235a15f2f324
|
4
4
|
### Major Changes
|
5
5
|
|
6
6
|
|
7
7
|
|
8
|
-
- [#956](https://github.com/graphql-hive/gateway/pull/956) [`
|
8
|
+
- [#956](https://github.com/graphql-hive/gateway/pull/956) [`e02059f`](https://github.com/graphql-hive/gateway/commit/e02059fc50ed05ef18f025d4cb0d354b909716b9) Thanks [@EmrysMyrddin](https://github.com/EmrysMyrddin)! - Drop Node 18 support
|
9
9
|
|
10
10
|
Least supported Node version is now v20.
|
11
11
|
|
12
12
|
|
13
|
-
- [#956](https://github.com/graphql-hive/gateway/pull/956) [`
|
13
|
+
- [#956](https://github.com/graphql-hive/gateway/pull/956) [`6f3c563`](https://github.com/graphql-hive/gateway/commit/6f3c56315923713ae23014482e542e15de47f0eb) Thanks [@EmrysMyrddin](https://github.com/EmrysMyrddin)! - Introduce and use the new Hive Logger
|
14
14
|
|
15
15
|
- [Read more about it on the Hive Logger documentation here.](https://the-guild.dev/graphql/hive/docs/logger)
|
16
16
|
|
17
17
|
- If coming from Hive Gateway v1, [read the migration guide here.](https://the-guild.dev/graphql/hive/docs/migration-guides/gateway-v1-v2)
|
18
18
|
|
19
19
|
|
20
|
-
- [#956](https://github.com/graphql-hive/gateway/pull/956) [`
|
20
|
+
- [#956](https://github.com/graphql-hive/gateway/pull/956) [`ba88bbe`](https://github.com/graphql-hive/gateway/commit/ba88bbe719b25ccebd5ab98b8d64463ac4601386) Thanks [@EmrysMyrddin](https://github.com/EmrysMyrddin)! - Disable forking even if NODE_ENV=production
|
21
21
|
|
22
22
|
Forking workers for concurrent processing is a delicate process and if not done carefully can lead to performance degradations. It should be configured with careful consideration by advanced users.
|
23
23
|
|
24
24
|
|
25
|
-
- [#956](https://github.com/graphql-hive/gateway/pull/956) [`
|
25
|
+
- [#956](https://github.com/graphql-hive/gateway/pull/956) [`b554f41`](https://github.com/graphql-hive/gateway/commit/b554f416b24b660eaf80053013dcd2d28ff85115) Thanks [@EmrysMyrddin](https://github.com/EmrysMyrddin)! - Remove mocking plugin from Hive Gateway built-ins
|
26
26
|
|
27
27
|
There is no need to provide the `useMock` plugin alongside Hive Gateway built-ins. Not only is the mock plugin 2MB in size (minified), but installing and using it is very simple.
|
28
28
|
|
29
29
|
|
30
|
-
- [#956](https://github.com/graphql-hive/gateway/pull/956) [`
|
30
|
+
- [#956](https://github.com/graphql-hive/gateway/pull/956) [`63d9312`](https://github.com/graphql-hive/gateway/commit/63d9312a4b499d5d7f2f5254ab566287de02834f) Thanks [@EmrysMyrddin](https://github.com/EmrysMyrddin)! - Load schema on initialization
|
31
31
|
|
32
32
|
Failing to start if the schema is not loaded for whatever reason.
|
33
33
|
|
34
|
+
### Minor Changes
|
35
|
+
|
36
|
+
|
37
|
+
|
38
|
+
- [#956](https://github.com/graphql-hive/gateway/pull/956) [`9300d32`](https://github.com/graphql-hive/gateway/commit/9300d32b65af8eaf1e250eec8dbc3b7c27f795cb) Thanks [@EmrysMyrddin](https://github.com/EmrysMyrddin)! - The `defineConfig` accepts a TContext generic
|
39
|
+
|
40
|
+
|
34
41
|
### Patch Changes
|
35
42
|
|
36
43
|
|
37
44
|
|
38
|
-
- [#956](https://github.com/graphql-hive/gateway/pull/956) [`
|
45
|
+
- [#956](https://github.com/graphql-hive/gateway/pull/956) [`6f3c563`](https://github.com/graphql-hive/gateway/commit/6f3c56315923713ae23014482e542e15de47f0eb) Thanks [@EmrysMyrddin](https://github.com/EmrysMyrddin)! - dependencies updates:
|
39
46
|
|
40
47
|
- Added dependency [`@graphql-hive/logger@workspace:^` ↗︎](https://www.npmjs.com/package/@graphql-hive/logger/v/workspace:^) (to `dependencies`)
|
41
48
|
|
42
49
|
|
43
|
-
- [#956](https://github.com/graphql-hive/gateway/pull/956) [`
|
50
|
+
- [#956](https://github.com/graphql-hive/gateway/pull/956) [`2eb2b77`](https://github.com/graphql-hive/gateway/commit/2eb2b77c3d985f5e132726b235f4f4241c552d05) Thanks [@EmrysMyrddin](https://github.com/EmrysMyrddin)! - dependencies updates:
|
44
51
|
|
45
52
|
- Added dependency [`@opentelemetry/api@^1.9.0` ↗︎](https://www.npmjs.com/package/@opentelemetry/api/v/1.9.0) (to `dependencies`)
|
46
53
|
- Added dependency [`@opentelemetry/context-zone@^2.0.1` ↗︎](https://www.npmjs.com/package/@opentelemetry/context-zone/v/2.0.1) (to `dependencies`)
|
@@ -53,29 +60,19 @@
|
|
53
60
|
- Added dependency [`@opentelemetry/sdk-metrics@^2.0.1` ↗︎](https://www.npmjs.com/package/@opentelemetry/sdk-metrics/v/2.0.1) (to `dependencies`)
|
54
61
|
|
55
62
|
|
56
|
-
- [#956](https://github.com/graphql-hive/gateway/pull/956) [`
|
63
|
+
- [#956](https://github.com/graphql-hive/gateway/pull/956) [`de31f51`](https://github.com/graphql-hive/gateway/commit/de31f519ebf9f688592674a6ac32c5ba74f096b3) Thanks [@EmrysMyrddin](https://github.com/EmrysMyrddin)! - dependencies updates:
|
57
64
|
|
58
65
|
- Added dependency [`@opentelemetry/api-logs@^0.202.0` ↗︎](https://www.npmjs.com/package/@opentelemetry/api-logs/v/0.202.0) (to `dependencies`)
|
59
66
|
- Added dependency [`@opentelemetry/sdk-logs@^0.202.0` ↗︎](https://www.npmjs.com/package/@opentelemetry/sdk-logs/v/0.202.0) (to `dependencies`)
|
60
67
|
|
61
68
|
|
62
|
-
- [#956](https://github.com/graphql-hive/gateway/pull/956) [`
|
69
|
+
- [#956](https://github.com/graphql-hive/gateway/pull/956) [`cdd4b8c`](https://github.com/graphql-hive/gateway/commit/cdd4b8cb0d4b28279bf559bf9788bfe25b05eb59) Thanks [@EmrysMyrddin](https://github.com/EmrysMyrddin)! - dependencies updates:
|
63
70
|
|
64
71
|
- Added dependency [`@opentelemetry/context-async-hooks@^2.0.1` ↗︎](https://www.npmjs.com/package/@opentelemetry/context-async-hooks/v/2.0.1) (to `dependencies`)
|
65
72
|
- Added dependency [`@opentelemetry/sdk-trace-base@^2.0.1` ↗︎](https://www.npmjs.com/package/@opentelemetry/sdk-trace-base/v/2.0.1) (to `dependencies`)
|
66
73
|
|
67
74
|
|
68
|
-
- [#
|
69
|
-
|
70
|
-
- Updated dependency [`@graphql-mesh/cache-cfw-kv@^0.105.8` ↗︎](https://www.npmjs.com/package/@graphql-mesh/cache-cfw-kv/v/0.105.8) (from `^0.105.7`, in `dependencies`)
|
71
|
-
- Updated dependency [`@graphql-mesh/cache-localforage@^0.105.9` ↗︎](https://www.npmjs.com/package/@graphql-mesh/cache-localforage/v/0.105.9) (from `^0.105.8`, in `dependencies`)
|
72
|
-
- Updated dependency [`@graphql-mesh/cache-redis@^0.104.8` ↗︎](https://www.npmjs.com/package/@graphql-mesh/cache-redis/v/0.104.8) (from `^0.104.7`, in `dependencies`)
|
73
|
-
- Updated dependency [`@graphql-mesh/cache-upstash-redis@^0.1.8` ↗︎](https://www.npmjs.com/package/@graphql-mesh/cache-upstash-redis/v/0.1.8) (from `^0.1.7`, in `dependencies`)
|
74
|
-
- Updated dependency [`@graphql-mesh/types@^0.104.8` ↗︎](https://www.npmjs.com/package/@graphql-mesh/types/v/0.104.8) (from `^0.104.7`, in `dependencies`)
|
75
|
-
- Updated dependency [`@graphql-mesh/utils@^0.104.8` ↗︎](https://www.npmjs.com/package/@graphql-mesh/utils/v/0.104.8) (from `^0.104.7`, in `dependencies`)
|
76
|
-
|
77
|
-
|
78
|
-
- [#956](https://github.com/graphql-hive/gateway/pull/956) [`8db36e9`](https://github.com/graphql-hive/gateway/commit/8db36e9e19e0885d498dd44575ebdf4e25d5bd34) Thanks [@EmrysMyrddin](https://github.com/EmrysMyrddin)! - dependencies updates:
|
75
|
+
- [#956](https://github.com/graphql-hive/gateway/pull/956) [`e4552c6`](https://github.com/graphql-hive/gateway/commit/e4552c647da81995c93dff91cc05d1b67b4589a6) Thanks [@EmrysMyrddin](https://github.com/EmrysMyrddin)! - dependencies updates:
|
79
76
|
|
80
77
|
- Added dependency [`@graphql-hive/logger@workspace:^` ↗︎](https://www.npmjs.com/package/@graphql-hive/logger/v/workspace:^) (to `dependencies`)
|
81
78
|
- Added dependency [`@opentelemetry/api@^1.9.0` ↗︎](https://www.npmjs.com/package/@opentelemetry/api/v/1.9.0) (to `dependencies`)
|
@@ -92,20 +89,50 @@
|
|
92
89
|
- Added dependency [`@opentelemetry/sdk-metrics@^2.0.1` ↗︎](https://www.npmjs.com/package/@opentelemetry/sdk-metrics/v/2.0.1) (to `dependencies`)
|
93
90
|
- Added dependency [`@opentelemetry/sdk-trace-base@^2.0.1` ↗︎](https://www.npmjs.com/package/@opentelemetry/sdk-trace-base/v/2.0.1) (to `dependencies`)
|
94
91
|
- Removed dependency [`@graphql-mesh/plugin-mock@^0.105.8` ↗︎](https://www.npmjs.com/package/@graphql-mesh/plugin-mock/v/0.105.8) (from `dependencies`)
|
95
|
-
- Updated dependencies [[`
|
96
|
-
- @graphql-hive/gateway-runtime@2.0.0-next-
|
97
|
-
- @graphql-
|
98
|
-
- @graphql-
|
99
|
-
- @graphql-mesh/hmac-upstream-signature@2.0.0-next-
|
100
|
-
- @graphql-
|
101
|
-
- @graphql-mesh/
|
102
|
-
- @graphql-
|
103
|
-
- @graphql-mesh/
|
104
|
-
- @graphql-mesh/transport-http
|
105
|
-
- @graphql-mesh/transport-ws@2.0.0-next-
|
106
|
-
- @graphql-hive/
|
107
|
-
- @graphql-hive/
|
108
|
-
- @graphql-hive/logger@1.0.1-next-
|
92
|
+
- Updated dependencies [[`6f3c563`](https://github.com/graphql-hive/gateway/commit/6f3c56315923713ae23014482e542e15de47f0eb), [`725d369`](https://github.com/graphql-hive/gateway/commit/725d3691f1fe77927a702ee5e3cb3822d088fe38), [`9300d32`](https://github.com/graphql-hive/gateway/commit/9300d32b65af8eaf1e250eec8dbc3b7c27f795cb), [`e4552c6`](https://github.com/graphql-hive/gateway/commit/e4552c647da81995c93dff91cc05d1b67b4589a6), [`2eb2b77`](https://github.com/graphql-hive/gateway/commit/2eb2b77c3d985f5e132726b235f4f4241c552d05), [`de31f51`](https://github.com/graphql-hive/gateway/commit/de31f519ebf9f688592674a6ac32c5ba74f096b3), [`cdd4b8c`](https://github.com/graphql-hive/gateway/commit/cdd4b8cb0d4b28279bf559bf9788bfe25b05eb59), [`725d369`](https://github.com/graphql-hive/gateway/commit/725d3691f1fe77927a702ee5e3cb3822d088fe38), [`9b4d15f`](https://github.com/graphql-hive/gateway/commit/9b4d15fed19089fcc01ef8058baa0ac9b106fb4f), [`e4552c6`](https://github.com/graphql-hive/gateway/commit/e4552c647da81995c93dff91cc05d1b67b4589a6), [`7e8a3d8`](https://github.com/graphql-hive/gateway/commit/7e8a3d83e66bb62787f637bb97ea057cdf5f8f1e), [`6f3c563`](https://github.com/graphql-hive/gateway/commit/6f3c56315923713ae23014482e542e15de47f0eb), [`e4552c6`](https://github.com/graphql-hive/gateway/commit/e4552c647da81995c93dff91cc05d1b67b4589a6), [`e02059f`](https://github.com/graphql-hive/gateway/commit/e02059fc50ed05ef18f025d4cb0d354b909716b9), [`6f3c563`](https://github.com/graphql-hive/gateway/commit/6f3c56315923713ae23014482e542e15de47f0eb), [`6500ade`](https://github.com/graphql-hive/gateway/commit/6500adeaf57e20d826b00da2d025e9acacfc9047), [`0c02723`](https://github.com/graphql-hive/gateway/commit/0c0272369bec3a52e3425c4156b1fd624b144f48), [`d7cc9d1`](https://github.com/graphql-hive/gateway/commit/d7cc9d17f5fc28d0f0577ea57f5e2b5ed5a92327), [`5b50531`](https://github.com/graphql-hive/gateway/commit/5b505319d0308461122e6696595fc9dc604f60fe), [`87f8cf2`](https://github.com/graphql-hive/gateway/commit/87f8cf22ec82d1e486d4f7601895e552f4b2282d), [`6500ade`](https://github.com/graphql-hive/gateway/commit/6500adeaf57e20d826b00da2d025e9acacfc9047), [`f3a3bd4`](https://github.com/graphql-hive/gateway/commit/f3a3bd408b75cb0612523a987143aaa74f8c35f8), [`7e8a3d8`](https://github.com/graphql-hive/gateway/commit/7e8a3d83e66bb62787f637bb97ea057cdf5f8f1e), [`6f3c563`](https://github.com/graphql-hive/gateway/commit/6f3c56315923713ae23014482e542e15de47f0eb), [`625c5fd`](https://github.com/graphql-hive/gateway/commit/625c5fd162f730735c408f42403ac514eee0a20e)]:
|
93
|
+
- @graphql-hive/gateway-runtime@2.0.0-next-e2698677f10276e29194b5559409235a15f2f324
|
94
|
+
- @graphql-mesh/plugin-opentelemetry@2.0.0-next-e2698677f10276e29194b5559409235a15f2f324
|
95
|
+
- @graphql-mesh/plugin-prometheus@2.0.0-next-e2698677f10276e29194b5559409235a15f2f324
|
96
|
+
- @graphql-mesh/hmac-upstream-signature@2.0.0-next-e2698677f10276e29194b5559409235a15f2f324
|
97
|
+
- @graphql-hive/plugin-deduplicate-request@2.0.0-next-e2698677f10276e29194b5559409235a15f2f324
|
98
|
+
- @graphql-mesh/transport-http-callback@1.0.0-next-e2698677f10276e29194b5559409235a15f2f324
|
99
|
+
- @graphql-hive/plugin-aws-sigv4@2.0.0-next-e2698677f10276e29194b5559409235a15f2f324
|
100
|
+
- @graphql-mesh/plugin-jwt-auth@2.0.0-next-e2698677f10276e29194b5559409235a15f2f324
|
101
|
+
- @graphql-mesh/transport-http@1.0.0-next-e2698677f10276e29194b5559409235a15f2f324
|
102
|
+
- @graphql-mesh/transport-ws@2.0.0-next-e2698677f10276e29194b5559409235a15f2f324
|
103
|
+
- @graphql-hive/importer@2.0.0-next-e2698677f10276e29194b5559409235a15f2f324
|
104
|
+
- @graphql-hive/pubsub@2.0.0-next-e2698677f10276e29194b5559409235a15f2f324
|
105
|
+
- @graphql-hive/logger@1.0.1-next-e2698677f10276e29194b5559409235a15f2f324
|
106
|
+
|
107
|
+
## 1.16.4
|
108
|
+
### Patch Changes
|
109
|
+
|
110
|
+
|
111
|
+
|
112
|
+
- [#1408](https://github.com/graphql-hive/gateway/pull/1408) [`5aefad2`](https://github.com/graphql-hive/gateway/commit/5aefad2ac4abe40fd1cb141218bd2679b3e0047d) Thanks [@enisdenjo](https://github.com/enisdenjo)! - dependencies updates:
|
113
|
+
|
114
|
+
- Updated dependency [`@graphql-mesh/cache-cfw-kv@^0.105.8` ↗︎](https://www.npmjs.com/package/@graphql-mesh/cache-cfw-kv/v/0.105.8) (from `^0.105.7`, in `dependencies`)
|
115
|
+
- Updated dependency [`@graphql-mesh/cache-localforage@^0.105.9` ↗︎](https://www.npmjs.com/package/@graphql-mesh/cache-localforage/v/0.105.9) (from `^0.105.8`, in `dependencies`)
|
116
|
+
- Updated dependency [`@graphql-mesh/cache-redis@^0.104.8` ↗︎](https://www.npmjs.com/package/@graphql-mesh/cache-redis/v/0.104.8) (from `^0.104.7`, in `dependencies`)
|
117
|
+
- Updated dependency [`@graphql-mesh/cache-upstash-redis@^0.1.8` ↗︎](https://www.npmjs.com/package/@graphql-mesh/cache-upstash-redis/v/0.1.8) (from `^0.1.7`, in `dependencies`)
|
118
|
+
- Updated dependency [`@graphql-mesh/types@^0.104.8` ↗︎](https://www.npmjs.com/package/@graphql-mesh/types/v/0.104.8) (from `^0.104.7`, in `dependencies`)
|
119
|
+
- Updated dependency [`@graphql-mesh/utils@^0.104.8` ↗︎](https://www.npmjs.com/package/@graphql-mesh/utils/v/0.104.8) (from `^0.104.7`, in `dependencies`)
|
120
|
+
|
121
|
+
|
122
|
+
- [#1424](https://github.com/graphql-hive/gateway/pull/1424) [`fe9b42f`](https://github.com/graphql-hive/gateway/commit/fe9b42f02ca6e3fbe6defd83e21e283dedf7481a) Thanks [@enisdenjo](https://github.com/enisdenjo)! - dependencies updates:
|
123
|
+
|
124
|
+
- Updated dependency [`@graphql-mesh/utils@^0.104.11` ↗︎](https://www.npmjs.com/package/@graphql-mesh/utils/v/0.104.11) (from `^0.104.8`, in `dependencies`)
|
125
|
+
- Updated dependencies [[`5aefad2`](https://github.com/graphql-hive/gateway/commit/5aefad2ac4abe40fd1cb141218bd2679b3e0047d), [`37113d1`](https://github.com/graphql-hive/gateway/commit/37113d1a446748fd83da9823e27a0f56872317df), [`fe9b42f`](https://github.com/graphql-hive/gateway/commit/fe9b42f02ca6e3fbe6defd83e21e283dedf7481a), [`5aefad2`](https://github.com/graphql-hive/gateway/commit/5aefad2ac4abe40fd1cb141218bd2679b3e0047d), [`fe9b42f`](https://github.com/graphql-hive/gateway/commit/fe9b42f02ca6e3fbe6defd83e21e283dedf7481a), [`5aefad2`](https://github.com/graphql-hive/gateway/commit/5aefad2ac4abe40fd1cb141218bd2679b3e0047d), [`fe9b42f`](https://github.com/graphql-hive/gateway/commit/fe9b42f02ca6e3fbe6defd83e21e283dedf7481a), [`5aefad2`](https://github.com/graphql-hive/gateway/commit/5aefad2ac4abe40fd1cb141218bd2679b3e0047d), [`fe9b42f`](https://github.com/graphql-hive/gateway/commit/fe9b42f02ca6e3fbe6defd83e21e283dedf7481a), [`5aefad2`](https://github.com/graphql-hive/gateway/commit/5aefad2ac4abe40fd1cb141218bd2679b3e0047d), [`fe9b42f`](https://github.com/graphql-hive/gateway/commit/fe9b42f02ca6e3fbe6defd83e21e283dedf7481a), [`5aefad2`](https://github.com/graphql-hive/gateway/commit/5aefad2ac4abe40fd1cb141218bd2679b3e0047d), [`fe9b42f`](https://github.com/graphql-hive/gateway/commit/fe9b42f02ca6e3fbe6defd83e21e283dedf7481a), [`5aefad2`](https://github.com/graphql-hive/gateway/commit/5aefad2ac4abe40fd1cb141218bd2679b3e0047d), [`fe9b42f`](https://github.com/graphql-hive/gateway/commit/fe9b42f02ca6e3fbe6defd83e21e283dedf7481a), [`5aefad2`](https://github.com/graphql-hive/gateway/commit/5aefad2ac4abe40fd1cb141218bd2679b3e0047d), [`37113d1`](https://github.com/graphql-hive/gateway/commit/37113d1a446748fd83da9823e27a0f56872317df), [`fe9b42f`](https://github.com/graphql-hive/gateway/commit/fe9b42f02ca6e3fbe6defd83e21e283dedf7481a), [`5aefad2`](https://github.com/graphql-hive/gateway/commit/5aefad2ac4abe40fd1cb141218bd2679b3e0047d), [`fe9b42f`](https://github.com/graphql-hive/gateway/commit/fe9b42f02ca6e3fbe6defd83e21e283dedf7481a), [`e5eb881`](https://github.com/graphql-hive/gateway/commit/e5eb881e8a063accc55b750e613f4baefa21dda5), [`e5eb881`](https://github.com/graphql-hive/gateway/commit/e5eb881e8a063accc55b750e613f4baefa21dda5)]:
|
126
|
+
- @graphql-hive/gateway-runtime@1.11.0
|
127
|
+
- @graphql-hive/plugin-deduplicate-request@1.0.5
|
128
|
+
- @graphql-mesh/hmac-upstream-signature@1.2.32
|
129
|
+
- @graphql-mesh/plugin-jwt-auth@1.5.9
|
130
|
+
- @graphql-mesh/plugin-opentelemetry@1.3.67
|
131
|
+
- @graphql-mesh/plugin-prometheus@1.3.55
|
132
|
+
- @graphql-mesh/transport-http@0.7.3
|
133
|
+
- @graphql-mesh/transport-http-callback@0.7.3
|
134
|
+
- @graphql-mesh/transport-ws@1.1.3
|
135
|
+
- @graphql-hive/plugin-aws-sigv4@1.0.19
|
109
136
|
|
110
137
|
## 1.16.3
|
111
138
|
|
package/dist/bin.cjs
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
require('dotenv/config');
|
4
4
|
var module$1 = require('node:module');
|
5
5
|
var logger = require('@graphql-hive/logger');
|
6
|
-
var cli = require('./cli-
|
6
|
+
var cli = require('./cli-CPxULGJb.cjs');
|
7
7
|
require('node:cluster');
|
8
8
|
require('node:os');
|
9
9
|
require('node:path');
|
package/dist/bin.js
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
import 'dotenv/config';
|
3
3
|
import module from 'node:module';
|
4
4
|
import { Logger } from '@graphql-hive/logger';
|
5
|
-
import { e as enableModuleCachingIfPossible, h as handleNodeWarnings, r as run } from './cli-
|
5
|
+
import { e as enableModuleCachingIfPossible, h as handleNodeWarnings, r as run } from './cli-CP9iY6tm.js';
|
6
6
|
import 'node:cluster';
|
7
7
|
import 'node:os';
|
8
8
|
import 'node:path';
|
@@ -6,7 +6,7 @@ import { Option, Command, InvalidArgumentError } from '@commander-js/extra-typin
|
|
6
6
|
import { LegacyLogger, Logger } from '@graphql-hive/logger';
|
7
7
|
import { renderGraphiQL } from '@graphql-yoga/render-graphiql';
|
8
8
|
import { getGraphQLWSOptions, createLoggerFromLogging, createGatewayRuntime } from '@graphql-hive/gateway-runtime';
|
9
|
-
import {
|
9
|
+
import { PubSub } from '@graphql-hive/pubsub';
|
10
10
|
import { registerTerminateHandler, isUrl } from '@graphql-mesh/utils';
|
11
11
|
import { lstat, watch } from 'node:fs/promises';
|
12
12
|
import { pathToFileURL } from 'node:url';
|
@@ -46,6 +46,9 @@ function strToBool(str) {
|
|
46
46
|
function isDebug() {
|
47
47
|
return getEnvBool("DEBUG");
|
48
48
|
}
|
49
|
+
function isNode() {
|
50
|
+
return typeof process !== "undefined" && process.versions && process.versions.node && typeof Bun === "undefined";
|
51
|
+
}
|
49
52
|
|
50
53
|
const unit = Object.create(null);
|
51
54
|
const m = 60000, h = m * 60, d = h * 24, y = d * 365.25;
|
@@ -527,7 +530,7 @@ async function handleOpenTelemetryConfig(ctx, cliOpts) {
|
|
527
530
|
"Initializing OpenTelemetry SDK"
|
528
531
|
);
|
529
532
|
return fakePromise().then(async () => {
|
530
|
-
const { openTelemetrySetup, HiveTracingSpanProcessor
|
533
|
+
const { openTelemetrySetup, HiveTracingSpanProcessor } = await import('@graphql-mesh/plugin-opentelemetry/setup');
|
531
534
|
const processors = [];
|
532
535
|
const logAttributes = {
|
533
536
|
traceEndpoints: [],
|
@@ -535,7 +538,7 @@ async function handleOpenTelemetryConfig(ctx, cliOpts) {
|
|
535
538
|
};
|
536
539
|
let integrationName;
|
537
540
|
if (openTelemetry) {
|
538
|
-
const otelEndpoint = typeof openTelemetry === "string" ? openTelemetry :
|
541
|
+
const otelEndpoint = typeof openTelemetry === "string" ? openTelemetry : getEnvStr("OTEL_EXPORTER_OTLP_ENDPOINT");
|
539
542
|
log.debug({ exporterType, otelEndpoint }, "Setting up OTLP Exporter");
|
540
543
|
integrationName = "OpenTelemetry";
|
541
544
|
logAttributes.traceEndpoints.push({
|
@@ -577,6 +580,16 @@ async function handleOpenTelemetryConfig(ctx, cliOpts) {
|
|
577
580
|
}).catch(() => null);
|
578
581
|
openTelemetrySetup({
|
579
582
|
traces: { processors },
|
583
|
+
resource: await detectResource().catch((err) => {
|
584
|
+
if (err && typeof err === "object" && "code" in err && err.code === "ERR_MODULE_NOT_FOUND") {
|
585
|
+
ctx.log.warn(
|
586
|
+
err,
|
587
|
+
`NodeJS modules necessary for environment detection is missing, please install it to auto-detect the environment`
|
588
|
+
);
|
589
|
+
return void 0;
|
590
|
+
}
|
591
|
+
throw err;
|
592
|
+
}),
|
580
593
|
contextManager
|
581
594
|
});
|
582
595
|
log.info(logAttributes, `${integrationName} integration is enabled`);
|
@@ -585,6 +598,14 @@ async function handleOpenTelemetryConfig(ctx, cliOpts) {
|
|
585
598
|
}
|
586
599
|
return false;
|
587
600
|
}
|
601
|
+
async function detectResource() {
|
602
|
+
if (isNode()) {
|
603
|
+
const { getResourceDetectors } = await import('./index-61dm03o3.js').then(function (n) { return n.i; });
|
604
|
+
const { detectResources } = await import('./index-Dw4Doxg2.js').then(function (n) { return n.e; });
|
605
|
+
return detectResources({ detectors: getResourceDetectors() });
|
606
|
+
}
|
607
|
+
return void 0;
|
608
|
+
}
|
588
609
|
|
589
610
|
function handleReportingConfig(ctx, loadedConfig, cliOpts) {
|
590
611
|
const confOpts = {
|
@@ -764,7 +785,7 @@ const addCommand$2 = (ctx, cli) => cli.command("proxy").description(
|
|
764
785
|
if (reporting) {
|
765
786
|
registryConfig.reporting = reporting;
|
766
787
|
}
|
767
|
-
const pubsub = loadedConfig.pubsub || new
|
788
|
+
const pubsub = loadedConfig.pubsub || new PubSub();
|
768
789
|
const cwd = loadedConfig.cwd || process.cwd();
|
769
790
|
if (loadedConfig.logging != null) {
|
770
791
|
ctx.log = createLoggerFromLogging(loadedConfig.logging);
|
@@ -902,7 +923,7 @@ const addCommand$1 = (ctx, cli) => cli.command("subgraph").description(
|
|
902
923
|
if (reporting) {
|
903
924
|
registryConfig.reporting = reporting;
|
904
925
|
}
|
905
|
-
const pubsub = loadedConfig.pubsub || new
|
926
|
+
const pubsub = loadedConfig.pubsub || new PubSub();
|
906
927
|
const cwd = loadedConfig.cwd || process.cwd();
|
907
928
|
if (loadedConfig.logging != null) {
|
908
929
|
ctx.log = createLoggerFromLogging(loadedConfig.logging);
|
@@ -1136,7 +1157,7 @@ const addCommand = (ctx, cli) => cli.command("supergraph").description(
|
|
1136
1157
|
if (reporting) {
|
1137
1158
|
registryConfig.reporting = reporting;
|
1138
1159
|
}
|
1139
|
-
const pubsub = loadedConfig.pubsub || new
|
1160
|
+
const pubsub = loadedConfig.pubsub || new PubSub();
|
1140
1161
|
const cwd = loadedConfig.cwd || process.cwd();
|
1141
1162
|
if (loadedConfig.logging != null) {
|
1142
1163
|
ctx.log = createLoggerFromLogging(loadedConfig.logging);
|
@@ -53,6 +53,9 @@ function strToBool(str) {
|
|
53
53
|
function isDebug() {
|
54
54
|
return getEnvBool("DEBUG");
|
55
55
|
}
|
56
|
+
function isNode() {
|
57
|
+
return typeof process !== "undefined" && process.versions && process.versions.node && typeof Bun === "undefined";
|
58
|
+
}
|
56
59
|
|
57
60
|
const unit = Object.create(null);
|
58
61
|
const m = 60000, h = m * 60, d = h * 24, y = d * 365.25;
|
@@ -534,7 +537,7 @@ async function handleOpenTelemetryConfig(ctx, cliOpts) {
|
|
534
537
|
"Initializing OpenTelemetry SDK"
|
535
538
|
);
|
536
539
|
return utils$1.fakePromise().then(async () => {
|
537
|
-
const { openTelemetrySetup, HiveTracingSpanProcessor
|
540
|
+
const { openTelemetrySetup, HiveTracingSpanProcessor } = await import('@graphql-mesh/plugin-opentelemetry/setup');
|
538
541
|
const processors = [];
|
539
542
|
const logAttributes = {
|
540
543
|
traceEndpoints: [],
|
@@ -542,7 +545,7 @@ async function handleOpenTelemetryConfig(ctx, cliOpts) {
|
|
542
545
|
};
|
543
546
|
let integrationName;
|
544
547
|
if (openTelemetry) {
|
545
|
-
const otelEndpoint = typeof openTelemetry === "string" ? openTelemetry :
|
548
|
+
const otelEndpoint = typeof openTelemetry === "string" ? openTelemetry : getEnvStr("OTEL_EXPORTER_OTLP_ENDPOINT");
|
546
549
|
log.debug({ exporterType, otelEndpoint }, "Setting up OTLP Exporter");
|
547
550
|
integrationName = "OpenTelemetry";
|
548
551
|
logAttributes.traceEndpoints.push({
|
@@ -584,6 +587,16 @@ async function handleOpenTelemetryConfig(ctx, cliOpts) {
|
|
584
587
|
}).catch(() => null);
|
585
588
|
openTelemetrySetup({
|
586
589
|
traces: { processors },
|
590
|
+
resource: await detectResource().catch((err) => {
|
591
|
+
if (err && typeof err === "object" && "code" in err && err.code === "ERR_MODULE_NOT_FOUND") {
|
592
|
+
ctx.log.warn(
|
593
|
+
err,
|
594
|
+
`NodeJS modules necessary for environment detection is missing, please install it to auto-detect the environment`
|
595
|
+
);
|
596
|
+
return void 0;
|
597
|
+
}
|
598
|
+
throw err;
|
599
|
+
}),
|
587
600
|
contextManager
|
588
601
|
});
|
589
602
|
log.info(logAttributes, `${integrationName} integration is enabled`);
|
@@ -592,6 +605,14 @@ async function handleOpenTelemetryConfig(ctx, cliOpts) {
|
|
592
605
|
}
|
593
606
|
return false;
|
594
607
|
}
|
608
|
+
async function detectResource() {
|
609
|
+
if (isNode()) {
|
610
|
+
const { getResourceDetectors } = await Promise.resolve().then(function () { return require('./index-DWaHa380.cjs'); }).then(function (n) { return n.index; });
|
611
|
+
const { detectResources } = await Promise.resolve().then(function () { return require('./index-B44NjpxU.cjs'); }).then(function (n) { return n.esm; });
|
612
|
+
return detectResources({ detectors: getResourceDetectors() });
|
613
|
+
}
|
614
|
+
return void 0;
|
615
|
+
}
|
595
616
|
|
596
617
|
function handleReportingConfig(ctx, loadedConfig, cliOpts) {
|
597
618
|
const confOpts = {
|
@@ -771,7 +792,7 @@ const addCommand$2 = (ctx, cli) => cli.command("proxy").description(
|
|
771
792
|
if (reporting) {
|
772
793
|
registryConfig.reporting = reporting;
|
773
794
|
}
|
774
|
-
const pubsub$1 = loadedConfig.pubsub || new pubsub.
|
795
|
+
const pubsub$1 = loadedConfig.pubsub || new pubsub.PubSub();
|
775
796
|
const cwd = loadedConfig.cwd || process.cwd();
|
776
797
|
if (loadedConfig.logging != null) {
|
777
798
|
ctx.log = gatewayRuntime.createLoggerFromLogging(loadedConfig.logging);
|
@@ -909,7 +930,7 @@ const addCommand$1 = (ctx, cli) => cli.command("subgraph").description(
|
|
909
930
|
if (reporting) {
|
910
931
|
registryConfig.reporting = reporting;
|
911
932
|
}
|
912
|
-
const pubsub$1 = loadedConfig.pubsub || new pubsub.
|
933
|
+
const pubsub$1 = loadedConfig.pubsub || new pubsub.PubSub();
|
913
934
|
const cwd = loadedConfig.cwd || process.cwd();
|
914
935
|
if (loadedConfig.logging != null) {
|
915
936
|
ctx.log = gatewayRuntime.createLoggerFromLogging(loadedConfig.logging);
|
@@ -1143,7 +1164,7 @@ const addCommand = (ctx, cli) => cli.command("supergraph").description(
|
|
1143
1164
|
if (reporting) {
|
1144
1165
|
registryConfig.reporting = reporting;
|
1145
1166
|
}
|
1146
|
-
const pubsub$1 = loadedConfig.pubsub || new pubsub.
|
1167
|
+
const pubsub$1 = loadedConfig.pubsub || new pubsub.PubSub();
|
1147
1168
|
const cwd = loadedConfig.cwd || process.cwd();
|
1148
1169
|
if (loadedConfig.logging != null) {
|
1149
1170
|
ctx.log = gatewayRuntime.createLoggerFromLogging(loadedConfig.logging);
|
@@ -0,0 +1,44 @@
|
|
1
|
+
'use strict';
|
2
|
+
|
3
|
+
var child_process = require('child_process');
|
4
|
+
var util = require('util');
|
5
|
+
|
6
|
+
function _interopNamespace(e) {
|
7
|
+
if (e && e.__esModule) return e;
|
8
|
+
var n = Object.create(null);
|
9
|
+
if (e) {
|
10
|
+
Object.keys(e).forEach(function (k) {
|
11
|
+
if (k !== 'default') {
|
12
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
13
|
+
Object.defineProperty(n, k, d.get ? d : {
|
14
|
+
enumerable: true,
|
15
|
+
get: function () { return e[k]; }
|
16
|
+
});
|
17
|
+
}
|
18
|
+
});
|
19
|
+
}
|
20
|
+
n.default = e;
|
21
|
+
return Object.freeze(n);
|
22
|
+
}
|
23
|
+
|
24
|
+
var child_process__namespace = /*#__PURE__*/_interopNamespace(child_process);
|
25
|
+
var util__namespace = /*#__PURE__*/_interopNamespace(util);
|
26
|
+
|
27
|
+
/*
|
28
|
+
* Copyright The OpenTelemetry Authors
|
29
|
+
*
|
30
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
31
|
+
* you may not use this file except in compliance with the License.
|
32
|
+
* You may obtain a copy of the License at
|
33
|
+
*
|
34
|
+
* https://www.apache.org/licenses/LICENSE-2.0
|
35
|
+
*
|
36
|
+
* Unless required by applicable law or agreed to in writing, software
|
37
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
38
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
39
|
+
* See the License for the specific language governing permissions and
|
40
|
+
* limitations under the License.
|
41
|
+
*/
|
42
|
+
const execAsync = util__namespace.promisify(child_process__namespace.exec);
|
43
|
+
|
44
|
+
exports.execAsync = execAsync;
|
@@ -0,0 +1,21 @@
|
|
1
|
+
import * as child_process from 'child_process';
|
2
|
+
import * as util from 'util';
|
3
|
+
|
4
|
+
/*
|
5
|
+
* Copyright The OpenTelemetry Authors
|
6
|
+
*
|
7
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
8
|
+
* you may not use this file except in compliance with the License.
|
9
|
+
* You may obtain a copy of the License at
|
10
|
+
*
|
11
|
+
* https://www.apache.org/licenses/LICENSE-2.0
|
12
|
+
*
|
13
|
+
* Unless required by applicable law or agreed to in writing, software
|
14
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
15
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
16
|
+
* See the License for the specific language governing permissions and
|
17
|
+
* limitations under the License.
|
18
|
+
*/
|
19
|
+
const execAsync = util.promisify(child_process.exec);
|
20
|
+
|
21
|
+
export { execAsync as e };
|
@@ -0,0 +1,40 @@
|
|
1
|
+
import { promises } from 'fs';
|
2
|
+
import { e as execAsync } from './execAsync-DmTy47v9.js';
|
3
|
+
import { diag } from '@opentelemetry/api';
|
4
|
+
import 'child_process';
|
5
|
+
import 'util';
|
6
|
+
|
7
|
+
/*
|
8
|
+
* Copyright The OpenTelemetry Authors
|
9
|
+
*
|
10
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
11
|
+
* you may not use this file except in compliance with the License.
|
12
|
+
* You may obtain a copy of the License at
|
13
|
+
*
|
14
|
+
* https://www.apache.org/licenses/LICENSE-2.0
|
15
|
+
*
|
16
|
+
* Unless required by applicable law or agreed to in writing, software
|
17
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
18
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
19
|
+
* See the License for the specific language governing permissions and
|
20
|
+
* limitations under the License.
|
21
|
+
*/
|
22
|
+
async function getMachineId() {
|
23
|
+
try {
|
24
|
+
const result = await promises.readFile('/etc/hostid', { encoding: 'utf8' });
|
25
|
+
return result.trim();
|
26
|
+
}
|
27
|
+
catch (e) {
|
28
|
+
diag.debug(`error reading machine id: ${e}`);
|
29
|
+
}
|
30
|
+
try {
|
31
|
+
const result = await execAsync('kenv -q smbios.system.uuid');
|
32
|
+
return result.stdout.trim();
|
33
|
+
}
|
34
|
+
catch (e) {
|
35
|
+
diag.debug(`error reading machine id: ${e}`);
|
36
|
+
}
|
37
|
+
return undefined;
|
38
|
+
}
|
39
|
+
|
40
|
+
export { getMachineId };
|
@@ -0,0 +1,42 @@
|
|
1
|
+
'use strict';
|
2
|
+
|
3
|
+
var fs = require('fs');
|
4
|
+
var execAsync = require('./execAsync-CZu27rRM.cjs');
|
5
|
+
var require$$0 = require('@opentelemetry/api');
|
6
|
+
require('child_process');
|
7
|
+
require('util');
|
8
|
+
|
9
|
+
/*
|
10
|
+
* Copyright The OpenTelemetry Authors
|
11
|
+
*
|
12
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
13
|
+
* you may not use this file except in compliance with the License.
|
14
|
+
* You may obtain a copy of the License at
|
15
|
+
*
|
16
|
+
* https://www.apache.org/licenses/LICENSE-2.0
|
17
|
+
*
|
18
|
+
* Unless required by applicable law or agreed to in writing, software
|
19
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
20
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
21
|
+
* See the License for the specific language governing permissions and
|
22
|
+
* limitations under the License.
|
23
|
+
*/
|
24
|
+
async function getMachineId() {
|
25
|
+
try {
|
26
|
+
const result = await fs.promises.readFile('/etc/hostid', { encoding: 'utf8' });
|
27
|
+
return result.trim();
|
28
|
+
}
|
29
|
+
catch (e) {
|
30
|
+
require$$0.diag.debug(`error reading machine id: ${e}`);
|
31
|
+
}
|
32
|
+
try {
|
33
|
+
const result = await execAsync.execAsync('kenv -q smbios.system.uuid');
|
34
|
+
return result.stdout.trim();
|
35
|
+
}
|
36
|
+
catch (e) {
|
37
|
+
require$$0.diag.debug(`error reading machine id: ${e}`);
|
38
|
+
}
|
39
|
+
return undefined;
|
40
|
+
}
|
41
|
+
|
42
|
+
exports.getMachineId = getMachineId;
|
@@ -0,0 +1,43 @@
|
|
1
|
+
'use strict';
|
2
|
+
|
3
|
+
var execAsync = require('./execAsync-CZu27rRM.cjs');
|
4
|
+
var require$$0 = require('@opentelemetry/api');
|
5
|
+
require('child_process');
|
6
|
+
require('util');
|
7
|
+
|
8
|
+
/*
|
9
|
+
* Copyright The OpenTelemetry Authors
|
10
|
+
*
|
11
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
12
|
+
* you may not use this file except in compliance with the License.
|
13
|
+
* You may obtain a copy of the License at
|
14
|
+
*
|
15
|
+
* https://www.apache.org/licenses/LICENSE-2.0
|
16
|
+
*
|
17
|
+
* Unless required by applicable law or agreed to in writing, software
|
18
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
19
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
20
|
+
* See the License for the specific language governing permissions and
|
21
|
+
* limitations under the License.
|
22
|
+
*/
|
23
|
+
async function getMachineId() {
|
24
|
+
try {
|
25
|
+
const result = await execAsync.execAsync('ioreg -rd1 -c "IOPlatformExpertDevice"');
|
26
|
+
const idLine = result.stdout
|
27
|
+
.split('\n')
|
28
|
+
.find(line => line.includes('IOPlatformUUID'));
|
29
|
+
if (!idLine) {
|
30
|
+
return undefined;
|
31
|
+
}
|
32
|
+
const parts = idLine.split('" = "');
|
33
|
+
if (parts.length === 2) {
|
34
|
+
return parts[1].slice(0, -1);
|
35
|
+
}
|
36
|
+
}
|
37
|
+
catch (e) {
|
38
|
+
require$$0.diag.debug(`error reading machine id: ${e}`);
|
39
|
+
}
|
40
|
+
return undefined;
|
41
|
+
}
|
42
|
+
|
43
|
+
exports.getMachineId = getMachineId;
|
@@ -0,0 +1,41 @@
|
|
1
|
+
import { e as execAsync } from './execAsync-DmTy47v9.js';
|
2
|
+
import { diag } from '@opentelemetry/api';
|
3
|
+
import 'child_process';
|
4
|
+
import 'util';
|
5
|
+
|
6
|
+
/*
|
7
|
+
* Copyright The OpenTelemetry Authors
|
8
|
+
*
|
9
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
10
|
+
* you may not use this file except in compliance with the License.
|
11
|
+
* You may obtain a copy of the License at
|
12
|
+
*
|
13
|
+
* https://www.apache.org/licenses/LICENSE-2.0
|
14
|
+
*
|
15
|
+
* Unless required by applicable law or agreed to in writing, software
|
16
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
17
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
18
|
+
* See the License for the specific language governing permissions and
|
19
|
+
* limitations under the License.
|
20
|
+
*/
|
21
|
+
async function getMachineId() {
|
22
|
+
try {
|
23
|
+
const result = await execAsync('ioreg -rd1 -c "IOPlatformExpertDevice"');
|
24
|
+
const idLine = result.stdout
|
25
|
+
.split('\n')
|
26
|
+
.find(line => line.includes('IOPlatformUUID'));
|
27
|
+
if (!idLine) {
|
28
|
+
return undefined;
|
29
|
+
}
|
30
|
+
const parts = idLine.split('" = "');
|
31
|
+
if (parts.length === 2) {
|
32
|
+
return parts[1].slice(0, -1);
|
33
|
+
}
|
34
|
+
}
|
35
|
+
catch (e) {
|
36
|
+
diag.debug(`error reading machine id: ${e}`);
|
37
|
+
}
|
38
|
+
return undefined;
|
39
|
+
}
|
40
|
+
|
41
|
+
export { getMachineId };
|