@salesforce/core 2.28.2 → 2.30.0

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 CHANGED
@@ -2,186 +2,195 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
- ### [2.28.2](https://github.com/forcedotcom/sfdx-core/compare/v2.28.1...v2.28.2) (2021-10-13)
5
+ ## [2.30.0](https://github.com/forcedotcom/sfdx-core/compare/v2.29.0...v2.30.0) (2021-11-25)
6
+
7
+
8
+ ### Features
9
+
10
+ * delete scratch orgs and sandboxes ([#491](https://github.com/forcedotcom/sfdx-core/issues/491)) ([468c348](https://github.com/forcedotcom/sfdx-core/commit/468c348f0ecc69ddeea02927bf7a26ca660a86ca))
11
+
12
+ ## [2.29.0](https://github.com/forcedotcom/sfdx-core/compare/v2.28.4...v2.29.0) (2021-11-17)
6
13
 
14
+ ### Features
15
+
16
+ - cleans up old listeners from upgraded instance ([e3f2d69](https://github.com/forcedotcom/sfdx-core/commit/e3f2d69ccd5c096d37addb1b982e19354175f11a))
17
+ - use warnings instead of process in sfdx-core ([c1f7e98](https://github.com/forcedotcom/sfdx-core/commit/c1f7e98f6b19d57da1a2ee0cdf58e449079f0ee7))
18
+ - warning and telemetry events ([80a8039](https://github.com/forcedotcom/sfdx-core/commit/80a8039e2f686d973ddbc24c9a2980fb93928d13))
19
+ - warning and telemetry events ([a04b293](https://github.com/forcedotcom/sfdx-core/commit/a04b29355c8ca6c7e37e071ccc159aff5e5e9ca0))
7
20
 
8
21
  ### Bug Fixes
9
22
 
10
- * support for .mil sandboxes ([9ef35c7](https://github.com/forcedotcom/sfdx-core/commit/9ef35c7b1ef0fe974c3bd3b89b862a436e00f7d9))
23
+ - transfer listeners when upgrading the global instance to newer version ([0a40831](https://github.com/forcedotcom/sfdx-core/commit/0a408317c132548771ced0fe196178d2e9c76232))
11
24
 
12
- ### [2.28.1](https://github.com/forcedotcom/sfdx-core/compare/v2.28.0...v2.28.1) (2021-10-06)
25
+ ### [2.28.4](https://github.com/forcedotcom/sfdx-core/compare/v2.28.3...v2.28.4) (2021-11-10)
26
+
27
+ ### Bug Fixes
28
+
29
+ - bump jsforce types and run unit tests on Windows ([#485](https://github.com/forcedotcom/sfdx-core/issues/485)) ([3952c8f](https://github.com/forcedotcom/sfdx-core/commit/3952c8fe248531a0597477ed12240f611048caba))
13
30
 
31
+ ### [2.28.3](https://github.com/forcedotcom/sfdx-core/compare/v2.28.2...v2.28.3) (2021-11-08)
14
32
 
15
33
  ### Bug Fixes
16
34
 
17
- * crmforce.mil ([e263d5d](https://github.com/forcedotcom/sfdx-core/commit/e263d5d74be9c0651e5c2676d6eec1c31fca05e4))
35
+ - fix unit test ([d903c04](https://github.com/forcedotcom/sfdx-core/commit/d903c04e5f3e4f01fccb3f00b91560c443013ddf))
36
+ - force new release ([124bb74](https://github.com/forcedotcom/sfdx-core/commit/124bb744c5ecc28cb8babf285c6d8c3032eb7ef6))
37
+ - improve error message when providing an invalid username ([2ab4bbd](https://github.com/forcedotcom/sfdx-core/commit/2ab4bbdefd962283d88ccb735de88c88fe189d39))
18
38
 
19
- ## [2.28.0](https://github.com/forcedotcom/sfdx-core/compare/v2.27.2...v2.28.0) (2021-09-16)
39
+ ### [2.28.2](https://github.com/forcedotcom/sfdx-core/compare/v2.28.1...v2.28.2) (2021-10-13)
40
+
41
+ ### Bug Fixes
42
+
43
+ - support for .mil sandboxes ([9ef35c7](https://github.com/forcedotcom/sfdx-core/commit/9ef35c7b1ef0fe974c3bd3b89b862a436e00f7d9))
20
44
 
45
+ ### [2.28.1](https://github.com/forcedotcom/sfdx-core/compare/v2.28.0...v2.28.1) (2021-10-06)
46
+
47
+ ### Bug Fixes
48
+
49
+ - crmforce.mil ([e263d5d](https://github.com/forcedotcom/sfdx-core/commit/e263d5d74be9c0651e5c2676d6eec1c31fca05e4))
50
+
51
+ ## [2.28.0](https://github.com/forcedotcom/sfdx-core/compare/v2.27.2...v2.28.0) (2021-09-16)
21
52
 
22
53
  ### Features
23
54
 
24
- * add custom templates config ([3cf8a8c](https://github.com/forcedotcom/sfdx-core/commit/3cf8a8cee1e7196efced989dcca9b545e1283386))
25
- * add validator for custom templates config ([dd2bcfe](https://github.com/forcedotcom/sfdx-core/commit/dd2bcfe8e7fee5c5c1c6321189ec04288103d5b6))
26
- * update config name ([72e84bf](https://github.com/forcedotcom/sfdx-core/commit/72e84bfacef48a1c2d00a61ebbae3f632601abbd))
55
+ - add custom templates config ([3cf8a8c](https://github.com/forcedotcom/sfdx-core/commit/3cf8a8cee1e7196efced989dcca9b545e1283386))
56
+ - add validator for custom templates config ([dd2bcfe](https://github.com/forcedotcom/sfdx-core/commit/dd2bcfe8e7fee5c5c1c6321189ec04288103d5b6))
57
+ - update config name ([72e84bf](https://github.com/forcedotcom/sfdx-core/commit/72e84bfacef48a1c2d00a61ebbae3f632601abbd))
27
58
 
28
59
  ### [2.27.2](https://github.com/forcedotcom/sfdx-core/compare/v2.27.1...v2.27.2) (2021-08-05)
29
60
 
30
-
31
61
  ### Bug Fixes
32
62
 
33
- * improve error handling while removing config props ([eecf7b0](https://github.com/forcedotcom/sfdx-core/commit/eecf7b0d0cf14e1371dc4c5ef03a413f864b0a8b))
63
+ - improve error handling while removing config props ([eecf7b0](https://github.com/forcedotcom/sfdx-core/commit/eecf7b0d0cf14e1371dc4c5ef03a413f864b0a8b))
34
64
 
35
65
  ### [2.27.1](https://github.com/forcedotcom/sfdx-core/compare/v2.27.0...v2.27.1) (2021-08-05)
36
66
 
37
-
38
67
  ### Bug Fixes
39
68
 
40
- * dont fail when trying to unset sf config keys ([#456](https://github.com/forcedotcom/sfdx-core/issues/456)) ([8aff9fd](https://github.com/forcedotcom/sfdx-core/commit/8aff9fd4bdb73ec20e58f5a16a8192a8eecba912))
69
+ - dont fail when trying to unset sf config keys ([#456](https://github.com/forcedotcom/sfdx-core/issues/456)) ([8aff9fd](https://github.com/forcedotcom/sfdx-core/commit/8aff9fd4bdb73ec20e58f5a16a8192a8eecba912))
41
70
 
42
71
  ## [2.27.0](https://github.com/forcedotcom/sfdx-core/compare/v2.26.1...v2.27.0) (2021-07-29)
43
72
 
44
-
45
73
  ### Features
46
74
 
47
- * Core URL class SfdcUrl ([#420](https://github.com/forcedotcom/sfdx-core/issues/420)) ([66881ea](https://github.com/forcedotcom/sfdx-core/commit/66881eae2f30215c862ea398bfc1630d9a5898fe))
75
+ - Core URL class SfdcUrl ([#420](https://github.com/forcedotcom/sfdx-core/issues/420)) ([66881ea](https://github.com/forcedotcom/sfdx-core/commit/66881eae2f30215c862ea398bfc1630d9a5898fe))
48
76
 
49
77
  ### [2.26.1](https://github.com/forcedotcom/sfdx-core/compare/v2.26.0...v2.26.1) (2021-07-19)
50
78
 
51
-
52
79
  ### Bug Fixes
53
80
 
54
- * force:org:open force:org:open --urlonly display bug ([#439](https://github.com/forcedotcom/sfdx-core/issues/439)) ([2ea0e74](https://github.com/forcedotcom/sfdx-core/commit/2ea0e74b8bf1bff6de8af70372025cac10fc8c18))
81
+ - force:org:open force:org:open --urlonly display bug ([#439](https://github.com/forcedotcom/sfdx-core/issues/439)) ([2ea0e74](https://github.com/forcedotcom/sfdx-core/commit/2ea0e74b8bf1bff6de8af70372025cac10fc8c18))
55
82
 
56
83
  ## [2.26.0](https://github.com/forcedotcom/sfdx-core/compare/v2.25.1...v2.26.0) (2021-07-13)
57
84
 
58
-
59
85
  ### Features
60
86
 
61
- * update generate password functionality ([#432](https://github.com/forcedotcom/sfdx-core/issues/432)) ([ed65e83](https://github.com/forcedotcom/sfdx-core/commit/ed65e83da3afe0d101743ee89cc7b2a7a38d5254))
87
+ - update generate password functionality ([#432](https://github.com/forcedotcom/sfdx-core/issues/432)) ([ed65e83](https://github.com/forcedotcom/sfdx-core/commit/ed65e83da3afe0d101743ee89cc7b2a7a38d5254))
62
88
 
63
89
  ### [2.25.1](https://github.com/forcedotcom/sfdx-core/compare/v3.1.1-3.2...v2.25.1) (2021-06-30)
64
90
 
65
-
66
91
  ### Bug Fixes
67
92
 
68
- * set retries to INFINITELY for polling client ([31539b4](https://github.com/forcedotcom/sfdx-core/commit/31539b4f0edd0cc1c049f70331ed5e40b8af55ea))
93
+ - set retries to INFINITELY for polling client ([31539b4](https://github.com/forcedotcom/sfdx-core/commit/31539b4f0edd0cc1c049f70331ed5e40b8af55ea))
69
94
 
70
95
  ## [2.25.0](https://github.com/forcedotcom/sfdx-core/compare/v2.24.2...v2.25.0) (2021-06-30)
71
96
 
72
-
73
97
  ### Features
74
98
 
75
- * @W-9517449@ Allow signupTargetLoginUrl to be overridden via env var ([#429](https://github.com/forcedotcom/sfdx-core/issues/429)) ([e2b8b36](https://github.com/forcedotcom/sfdx-core/commit/e2b8b36b2836b5277c83ffe22922978dc32e7b11)), closes [#427](https://github.com/forcedotcom/sfdx-core/issues/427)
99
+ - @W-9517449@ Allow signupTargetLoginUrl to be overridden via env var ([#429](https://github.com/forcedotcom/sfdx-core/issues/429)) ([e2b8b36](https://github.com/forcedotcom/sfdx-core/commit/e2b8b36b2836b5277c83ffe22922978dc32e7b11)), closes [#427](https://github.com/forcedotcom/sfdx-core/issues/427)
76
100
 
77
101
  ### [2.24.2](https://github.com/forcedotcom/sfdx-core/compare/v3.1.1-3.1...v2.24.2) (2021-06-23)
78
102
 
79
-
80
103
  ### Bug Fixes
81
104
 
82
- * puts some types back in dependencies ([94bea31](https://github.com/forcedotcom/sfdx-core/commit/94bea31037a41d4377faecb22bce8a2d12e95f4f))
105
+ - puts some types back in dependencies ([94bea31](https://github.com/forcedotcom/sfdx-core/commit/94bea31037a41d4377faecb22bce8a2d12e95f4f))
83
106
 
84
107
  ### [2.24.1](https://github.com/forcedotcom/sfdx-core/compare/v2.24.0...v2.24.1) (2021-06-23)
85
108
 
86
-
87
109
  ### Bug Fixes
88
110
 
89
- * rewrite polling client ([8d363d1](https://github.com/forcedotcom/sfdx-core/commit/8d363d13616f5efa944d4bb717a010add3c996b5))
111
+ - rewrite polling client ([8d363d1](https://github.com/forcedotcom/sfdx-core/commit/8d363d13616f5efa944d4bb717a010add3c996b5))
90
112
 
91
113
  ## [2.24.0](https://github.com/forcedotcom/sfdx-core/compare/v2.23.5...v2.24.0) (2021-06-08)
92
114
 
93
-
94
115
  ### Features
95
116
 
96
- * exported function checkLightningDomain() ([#415](https://github.com/forcedotcom/sfdx-core/issues/415)) ([8e75231](https://github.com/forcedotcom/sfdx-core/commit/8e752313abf4a383a6ef18250ffac78b398987dd))
117
+ - exported function checkLightningDomain() ([#415](https://github.com/forcedotcom/sfdx-core/issues/415)) ([8e75231](https://github.com/forcedotcom/sfdx-core/commit/8e752313abf4a383a6ef18250ffac78b398987dd))
97
118
 
98
119
  ### [2.23.5](https://github.com/forcedotcom/sfdx-core/compare/v3.1.1-3.0...v2.23.5) (2021-06-07)
99
120
 
100
-
101
121
  ### Bug Fixes
102
122
 
103
- * w-9299422 (login url from config) and fs-parallelization ([043bb17](https://github.com/forcedotcom/sfdx-core/commit/043bb179dbf64f9c4522a4c0f0720ae09794227c))
123
+ - w-9299422 (login url from config) and fs-parallelization ([043bb17](https://github.com/forcedotcom/sfdx-core/commit/043bb179dbf64f9c4522a4c0f0720ae09794227c))
104
124
 
105
125
  ### [2.23.4](https://github.com/forcedotcom/sfdx-core/compare/v2.23.3...v2.23.4) (2021-06-03)
106
126
 
107
-
108
127
  ### Bug Fixes
109
128
 
110
- * works with TS4+ and jsforce types ([#413](https://github.com/forcedotcom/sfdx-core/issues/413)) ([b77cdad](https://github.com/forcedotcom/sfdx-core/commit/b77cdad56b114290b8e5fd23d968e23e7d4eedf4))
129
+ - works with TS4+ and jsforce types ([#413](https://github.com/forcedotcom/sfdx-core/issues/413)) ([b77cdad](https://github.com/forcedotcom/sfdx-core/commit/b77cdad56b114290b8e5fd23d968e23e7d4eedf4))
111
130
 
112
131
  ### [2.23.3](https://github.com/forcedotcom/sfdx-core/compare/v2.23.2...v2.23.3) (2021-06-03)
113
132
 
114
133
  ### [2.23.2](https://github.com/forcedotcom/sfdx-core/compare/v2.23.1...v2.23.2) (2021-06-02)
115
134
 
116
-
117
135
  ### Bug Fixes
118
136
 
119
- * authinfo returning only lowercase usernames. ([#411](https://github.com/forcedotcom/sfdx-core/issues/411)) ([243668e](https://github.com/forcedotcom/sfdx-core/commit/243668e61cd8418b6acb2f0d4806da50ccf37b29)), closes [#405](https://github.com/forcedotcom/sfdx-core/issues/405)
137
+ - authinfo returning only lowercase usernames. ([#411](https://github.com/forcedotcom/sfdx-core/issues/411)) ([243668e](https://github.com/forcedotcom/sfdx-core/commit/243668e61cd8418b6acb2f0d4806da50ccf37b29)), closes [#405](https://github.com/forcedotcom/sfdx-core/issues/405)
120
138
 
121
139
  ### [2.23.1](https://github.com/forcedotcom/sfdx-core/compare/v2.23.0...v2.23.1) (2021-05-27)
122
140
 
123
141
  ## [2.23.0](https://github.com/forcedotcom/sfdx-core/compare/v2.22.0...v2.23.0) (2021-05-26)
124
142
 
125
-
126
143
  ### Features
127
144
 
128
- * export getJwtAudienceUrl ([e7d26d2](https://github.com/forcedotcom/sfdx-core/commit/e7d26d20106d6abb6b424936bdf26c0a9f8cd175))
129
-
145
+ - export getJwtAudienceUrl ([e7d26d2](https://github.com/forcedotcom/sfdx-core/commit/e7d26d20106d6abb6b424936bdf26c0a9f8cd175))
130
146
 
131
147
  ### Bug Fixes
132
148
 
133
- * export library method ([d0016f9](https://github.com/forcedotcom/sfdx-core/commit/d0016f96da1246535049884c1043399239a33c00))
149
+ - export library method ([d0016f9](https://github.com/forcedotcom/sfdx-core/commit/d0016f96da1246535049884c1043399239a33c00))
134
150
 
135
151
  ## [2.22.0](https://github.com/forcedotcom/sfdx-core/compare/v2.21.0...v2.22.0) (2021-05-24)
136
152
 
137
-
138
153
  ### Features
139
154
 
140
- * export getJwtAudienceUrl ([#407](https://github.com/forcedotcom/sfdx-core/issues/407)) ([585bb07](https://github.com/forcedotcom/sfdx-core/commit/585bb073434d73473a855ee52b7ddc6f0228aae1))
155
+ - export getJwtAudienceUrl ([#407](https://github.com/forcedotcom/sfdx-core/issues/407)) ([585bb07](https://github.com/forcedotcom/sfdx-core/commit/585bb073434d73473a855ee52b7ddc6f0228aae1))
141
156
 
142
157
  ## [2.21.0](https://github.com/forcedotcom/sfdx-core/compare/v2.20.11...v2.21.0) (2021-05-24)
143
158
 
144
-
145
159
  ### Features
146
160
 
147
- * modify authInfo to return username for access token auth ([160b7d2](https://github.com/forcedotcom/sfdx-core/commit/160b7d20e32b80d7a54c8cf679154fcbaa9e8cda))
161
+ - modify authInfo to return username for access token auth ([160b7d2](https://github.com/forcedotcom/sfdx-core/commit/160b7d20e32b80d7a54c8cf679154fcbaa9e8cda))
148
162
 
149
163
  ### [2.20.11](https://github.com/forcedotcom/sfdx-core/compare/v3.1.0-3.0...v2.20.11) (2021-05-12)
150
164
 
151
-
152
165
  ### Bug Fixes
153
166
 
154
- * force release ([f0b837a](https://github.com/forcedotcom/sfdx-core/commit/f0b837ab7b4d0361c2fa3ba15fe56cd2f7cc1fd0))
167
+ - force release ([f0b837a](https://github.com/forcedotcom/sfdx-core/commit/f0b837ab7b4d0361c2fa3ba15fe56cd2f7cc1fd0))
155
168
 
156
169
  ### [2.20.10](https://github.com/forcedotcom/sfdx-core/compare/v2.20.9...v2.20.10) (2021-04-14)
157
170
 
158
-
159
171
  ### Bug Fixes
160
172
 
161
- * add another internal test env domain ([6ea538f](https://github.com/forcedotcom/sfdx-core/commit/6ea538f2ce62daba7262a247472ce821c6e2616f))
173
+ - add another internal test env domain ([6ea538f](https://github.com/forcedotcom/sfdx-core/commit/6ea538f2ce62daba7262a247472ce821c6e2616f))
162
174
 
163
175
  ### [2.20.9](https://github.com/forcedotcom/sfdx-core/compare/v2.20.8...v2.20.9) (2021-04-05)
164
176
 
165
-
166
177
  ### Bug Fixes
167
178
 
168
- * allow = in authUrl tokens ([2337fcd](https://github.com/forcedotcom/sfdx-core/commit/2337fcddfb1907a7092cd52f5b3ad73ae963d59e))
179
+ - allow = in authUrl tokens ([2337fcd](https://github.com/forcedotcom/sfdx-core/commit/2337fcddfb1907a7092cd52f5b3ad73ae963d59e))
169
180
 
170
181
  ### [2.20.8](https://github.com/forcedotcom/sfdx-core/compare/v2.20.7...v2.20.8) (2021-04-03)
171
182
 
172
-
173
183
  ### Bug Fixes
174
184
 
175
- * debugEnabled should be public ([dbd0124](https://github.com/forcedotcom/sfdx-core/commit/dbd01243003f555b8b4db45c83e81cc08b8cb9a1))
185
+ - debugEnabled should be public ([dbd0124](https://github.com/forcedotcom/sfdx-core/commit/dbd01243003f555b8b4db45c83e81cc08b8cb9a1))
176
186
 
177
187
  ### [2.20.7](https://github.com/forcedotcom/sfdx-core/compare/v2.20.6...v2.20.7) (2021-04-02)
178
188
 
179
-
180
189
  ### Bug Fixes
181
190
 
182
- * add deployRecentValidation ([62d367b](https://github.com/forcedotcom/sfdx-core/commit/62d367b217e6b552573bd7176b064e28252348c5))
183
- * add deployRecentValidation ([a39c329](https://github.com/forcedotcom/sfdx-core/commit/a39c329b3fab603b537ae5ed8cce4773bdf24eb6))
184
- * add test, clarify comments ([8d5679e](https://github.com/forcedotcom/sfdx-core/commit/8d5679ecbd482af84842f5c1c8908a059d97ef3f))
191
+ - add deployRecentValidation ([62d367b](https://github.com/forcedotcom/sfdx-core/commit/62d367b217e6b552573bd7176b064e28252348c5))
192
+ - add deployRecentValidation ([a39c329](https://github.com/forcedotcom/sfdx-core/commit/a39c329b3fab603b537ae5ed8cce4773bdf24eb6))
193
+ - add test, clarify comments ([8d5679e](https://github.com/forcedotcom/sfdx-core/commit/8d5679ecbd482af84842f5c1c8908a059d97ef3f))
185
194
 
186
195
  ### [2.20.6](https://github.com/forcedotcom/sfdx-core/compare/v2.20.5...v2.20.6) (2021-04-02)
187
196
 
package/lib/authInfo.d.ts CHANGED
@@ -202,12 +202,7 @@ export declare class AuthInfo extends AsyncCreatable<AuthInfo.Options> {
202
202
  * ```
203
203
  * @param sfdxAuthUrl
204
204
  */
205
- static parseSfdxAuthUrl(sfdxAuthUrl: string): {
206
- clientId: string;
207
- clientSecret: string;
208
- refreshToken: string;
209
- loginUrl: string;
210
- };
205
+ static parseSfdxAuthUrl(sfdxAuthUrl: string): Pick<AuthFields, 'clientId' | 'clientSecret' | 'refreshToken' | 'loginUrl'>;
211
206
  /**
212
207
  * Get the username.
213
208
  */
@@ -343,5 +338,6 @@ export declare namespace AuthInfo {
343
338
  * creation.
344
339
  */
345
340
  parentUsername?: string;
341
+ isDevHub?: boolean;
346
342
  }
347
343
  }
package/lib/authInfo.js CHANGED
@@ -87,6 +87,7 @@ class OAuth2WithVerifier extends jsforce_1.OAuth2 {
87
87
  *
88
88
  * See https://github.com/jsforce/jsforce/issues/665
89
89
  */
90
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
90
91
  async _postParams(params, callback) {
91
92
  kit_1.set(params, 'code_verifier', this.codeVerifier);
92
93
  // @ts-ignore TODO: need better typings for jsforce
@@ -664,7 +665,10 @@ class AuthInfo extends kit_1.AsyncCreatable {
664
665
  }
665
666
  catch (e) {
666
667
  if (e.code === 'ENOENT') {
667
- throw sfdxError_1.SfdxError.create('@salesforce/core', 'core', 'NamedOrgNotFound', [username]);
668
+ throw sfdxError_1.SfdxError.create('@salesforce/core', 'core', 'NamedOrgNotFound', [
669
+ this.options.isDevHub ? 'devhub username' : 'username',
670
+ username,
671
+ ]);
668
672
  }
669
673
  else {
670
674
  throw e;
package/lib/connection.js CHANGED
@@ -19,6 +19,7 @@ const configAggregator_1 = require("./config/configAggregator");
19
19
  const logger_1 = require("./logger");
20
20
  const sfdxError_1 = require("./sfdxError");
21
21
  const sfdc_1 = require("./util/sfdc");
22
+ const lifecycleEvents_1 = require("./lifecycleEvents");
22
23
  /**
23
24
  * The 'async' in our request override replaces the jsforce promise with the node promise, then returns it back to
24
25
  * jsforce which expects .thenCall. Add .thenCall to the node promise to prevent breakage.
@@ -356,7 +357,7 @@ class Connection extends jsforce_1.Connection {
356
357
  .on('end', () => {
357
358
  const totalSize = ts_types_1.getNumber(query, 'totalSize') || 0;
358
359
  if (totalSize > records.length) {
359
- process.emitWarning(`The query result is missing ${totalSize - records.length} records due to a ${maxFetch} record limit. Increase the number of records returned by setting the config value "maxQueryLimit" or the environment variable "SFDX_MAX_QUERY_LIMIT" to ${totalSize} or greater than ${maxFetch}.`);
360
+ void lifecycleEvents_1.Lifecycle.getInstance().emitWarning(`The query result is missing ${totalSize - records.length} records due to a ${maxFetch} record limit. Increase the number of records returned by setting the config value "maxQueryLimit" or the environment variable "SFDX_MAX_QUERY_LIMIT" to ${totalSize} or greater than ${maxFetch}.`);
360
361
  }
361
362
  resolve({
362
363
  done: true,
@@ -16,16 +16,29 @@ declare type callback = (data: any) => Promise<void>;
16
16
  *
17
17
  * // Deep in the deploy code, fire the event for all libraries and plugins to hear.
18
18
  * Lifecycle.getInstance().emit('deploy-metadata', metadataToBeDeployed);
19
+ *
20
+ * // if you don't need to await anything
21
+ * use `void Lifecycle.getInstance().emit('deploy-metadata', metadataToBeDeployed)` ;
19
22
  * ```
20
23
  */
21
24
  export declare class Lifecycle {
22
- private debug;
23
25
  private readonly listeners;
26
+ static readonly telemetryEventName = "telemetry";
27
+ static readonly warningEventName = "warning";
28
+ private debug;
24
29
  private constructor();
30
+ /**
31
+ * return the package.json version of the sfdx-core library.
32
+ */
33
+ static staticVersion(): string;
25
34
  /**
26
35
  * Retrieve the singleton instance of this class so that all listeners and emitters can interact from any library or tool
27
36
  */
28
37
  static getInstance(): Lifecycle;
38
+ /**
39
+ * return the package.json version of the sfdx-core library.
40
+ */
41
+ version(): string;
29
42
  /**
30
43
  * Remove all listeners for a given event
31
44
  *
@@ -38,6 +51,18 @@ export declare class Lifecycle {
38
51
  * @param eventName The name of the event to get listeners of
39
52
  */
40
53
  getListeners(eventName: string): callback[];
54
+ /**
55
+ * Create a listener for the `telemetry` event
56
+ *
57
+ * @param cb The callback function to run when the event is emitted
58
+ */
59
+ onTelemetry(cb: (data: Record<string, unknown>) => Promise<void>): void;
60
+ /**
61
+ * Create a listener for the `warning` event
62
+ *
63
+ * @param cb The callback function to run when the event is emitted
64
+ */
65
+ onWarning(cb: (warning: string) => Promise<void>): void;
41
66
  /**
42
67
  * Create a new listener for a given event
43
68
  *
@@ -45,6 +70,18 @@ export declare class Lifecycle {
45
70
  * @param cb The callback function to run when the event is emitted
46
71
  */
47
72
  on<T = AnyJson>(eventName: string, cb: (data: T) => Promise<void>): void;
73
+ /**
74
+ * Emit a `telemetry` event, causing all callback functions to be run in the order they were registered
75
+ *
76
+ * @param data The data to emit
77
+ */
78
+ emitTelemetry(data: AnyJson): Promise<void>;
79
+ /**
80
+ * Emit a `warning` event, causing all callback functions to be run in the order they were registered
81
+ *
82
+ * @param data The warning (string) to emit
83
+ */
84
+ emitWarning(warning: string): Promise<void>;
48
85
  /**
49
86
  * Emit a given event, causing all callback functions to be run in the order they were registered
50
87
  *
@@ -8,6 +8,10 @@
8
8
  Object.defineProperty(exports, "__esModule", { value: true });
9
9
  exports.Lifecycle = void 0;
10
10
  const Debug = require("debug");
11
+ const semver_1 = require("semver");
12
+ // needed for TS to not put everything inside /lib/src
13
+ // @ts-ignore
14
+ const pjson = require("../package.json");
11
15
  /**
12
16
  * An asynchronous event listener and emitter that follows the singleton pattern. The singleton pattern allows lifecycle
13
17
  * events to be emitted from deep within a library and still be consumed by any other library or tool. It allows other
@@ -24,12 +28,21 @@ const Debug = require("debug");
24
28
  *
25
29
  * // Deep in the deploy code, fire the event for all libraries and plugins to hear.
26
30
  * Lifecycle.getInstance().emit('deploy-metadata', metadataToBeDeployed);
31
+ *
32
+ * // if you don't need to await anything
33
+ * use `void Lifecycle.getInstance().emit('deploy-metadata', metadataToBeDeployed)` ;
27
34
  * ```
28
35
  */
29
36
  class Lifecycle {
30
- constructor() {
37
+ constructor(listeners = {}) {
38
+ this.listeners = listeners;
31
39
  this.debug = Debug(`sfdx:${this.constructor.name}`);
32
- this.listeners = {};
40
+ }
41
+ /**
42
+ * return the package.json version of the sfdx-core library.
43
+ */
44
+ static staticVersion() {
45
+ return pjson.version;
33
46
  }
34
47
  /**
35
48
  * Retrieve the singleton instance of this class so that all listeners and emitters can interact from any library or tool
@@ -52,10 +65,29 @@ class Lifecycle {
52
65
  //
53
66
  // Nothing should EVER be removed, even across major versions.
54
67
  if (!global.salesforceCoreLifecycle) {
68
+ // it's not been loaded yet (basic singleton pattern)
55
69
  global.salesforceCoreLifecycle = new Lifecycle();
56
70
  }
71
+ else if (
72
+ // an older version was loaded that should be replaced
73
+ semver_1.compare(global.salesforceCoreLifecycle.version(), Lifecycle.staticVersion()) === -1) {
74
+ const oldInstance = global.salesforceCoreLifecycle;
75
+ // use the newer version and transfer any listeners from the old version
76
+ // object spread keeps them from being references
77
+ global.salesforceCoreLifecycle = new Lifecycle({ ...oldInstance.listeners });
78
+ // clean up any listeners on the old version
79
+ Object.keys(oldInstance.listeners).map((eventName) => {
80
+ oldInstance.removeAllListeners(eventName);
81
+ });
82
+ }
57
83
  return global.salesforceCoreLifecycle;
58
84
  }
85
+ /**
86
+ * return the package.json version of the sfdx-core library.
87
+ */
88
+ version() {
89
+ return pjson.version;
90
+ }
59
91
  /**
60
92
  * Remove all listeners for a given event
61
93
  *
@@ -79,6 +111,22 @@ class Lifecycle {
79
111
  return [];
80
112
  }
81
113
  }
114
+ /**
115
+ * Create a listener for the `telemetry` event
116
+ *
117
+ * @param cb The callback function to run when the event is emitted
118
+ */
119
+ onTelemetry(cb) {
120
+ this.on(Lifecycle.telemetryEventName, cb);
121
+ }
122
+ /**
123
+ * Create a listener for the `warning` event
124
+ *
125
+ * @param cb The callback function to run when the event is emitted
126
+ */
127
+ onWarning(cb) {
128
+ this.on(Lifecycle.warningEventName, cb);
129
+ }
82
130
  /**
83
131
  * Create a new listener for a given event
84
132
  *
@@ -93,6 +141,27 @@ class Lifecycle {
93
141
  listeners.push(cb);
94
142
  this.listeners[eventName] = listeners;
95
143
  }
144
+ /**
145
+ * Emit a `telemetry` event, causing all callback functions to be run in the order they were registered
146
+ *
147
+ * @param data The data to emit
148
+ */
149
+ async emitTelemetry(data) {
150
+ return this.emit(Lifecycle.telemetryEventName, data);
151
+ }
152
+ /**
153
+ * Emit a `warning` event, causing all callback functions to be run in the order they were registered
154
+ *
155
+ * @param data The warning (string) to emit
156
+ */
157
+ async emitWarning(warning) {
158
+ // if there are no listeners, warnings should go to the node process so they're not lost
159
+ // this also preserves behavior in UT where there's a spy on process.emitWarning
160
+ if (this.getListeners(Lifecycle.warningEventName).length === 0) {
161
+ process.emitWarning(warning);
162
+ }
163
+ return this.emit(Lifecycle.warningEventName, warning);
164
+ }
96
165
  /**
97
166
  * Emit a given event, causing all callback functions to be run in the order they were registered
98
167
  *
@@ -112,4 +181,6 @@ class Lifecycle {
112
181
  }
113
182
  }
114
183
  exports.Lifecycle = Lifecycle;
184
+ Lifecycle.telemetryEventName = 'telemetry';
185
+ Lifecycle.warningEventName = 'warning';
115
186
  //# sourceMappingURL=lifecycleEvents.js.map
package/lib/logger.js CHANGED
@@ -343,6 +343,7 @@ class Logger {
343
343
  /**
344
344
  * Gets the underlying Bunyan logger.
345
345
  */
346
+ // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
346
347
  getBunyanLogger() {
347
348
  return this.bunyan;
348
349
  }
package/lib/org.d.ts CHANGED
@@ -60,6 +60,11 @@ export declare class Org extends AsyncCreatable<Org.Options> {
60
60
  * @param throwWhenRemoveFails Determines if the call should throw an error or fail silently.
61
61
  */
62
62
  remove(throwWhenRemoveFails?: boolean): Promise<void>;
63
+ /**
64
+ * Check if org is a sandbox org by checking its SandboxOrgConfig.
65
+ *
66
+ */
67
+ isSandbox(): Promise<boolean>;
63
68
  /**
64
69
  * Check that this org is a scratch org by asking the dev hub if it knows about it.
65
70
  *
@@ -82,6 +87,16 @@ export declare class Org extends AsyncCreatable<Org.Options> {
82
87
  * dev hub**. If you need accuracy, use the {@link Org.determineIfDevHubOrg} method.
83
88
  */
84
89
  isDevHubOrg(): boolean;
90
+ /**
91
+ * Will delete 'this' instance remotely and any files locally
92
+ *
93
+ * @param controllingOrg username or Org that 'this.devhub' or 'this.production' refers to. AKA a DevHub for a scratch org, or a Production Org for a sandbox
94
+ */
95
+ deleteFrom(controllingOrg: string | Org): Promise<void>;
96
+ /**
97
+ * Will delete 'this' instance remotely and any files locally
98
+ */
99
+ delete(): Promise<void>;
85
100
  /**
86
101
  * Returns `true` if the org is a Dev Hub.
87
102
  *
@@ -177,6 +192,21 @@ export declare class Org extends AsyncCreatable<Org.Options> {
177
192
  * **Throws** *{@link SfdxError} Throws and unsupported error.
178
193
  */
179
194
  protected getDefaultOptions(): Org.Options;
195
+ private queryProduction;
196
+ /**
197
+ * this method will delete the sandbox org from the production org and clean up any local files
198
+ *
199
+ * @param prodOrg - Production org associated with this sandbox
200
+ * @private
201
+ */
202
+ private deleteSandbox;
203
+ /**
204
+ * If this Org is a scratch org, calling this method will delete the scratch org from the DevHub and clean up any local files
205
+ *
206
+ * @param devHub - optional DevHub Org of the to-be-deleted scratch org
207
+ * @private
208
+ */
209
+ private deleteScratchOrg;
180
210
  /**
181
211
  * Returns a promise to delete an auth info file from the local file system and any related cache information for
182
212
  * this Org.. You don't want to call this method directly. Instead consider calling Org.remove()
package/lib/org.js CHANGED
@@ -72,7 +72,7 @@ class Org extends kit_1.AsyncCreatable {
72
72
  this.logger.debug(`cleaning data for path: ${dataPath}`);
73
73
  }
74
74
  catch (err) {
75
- if (err.name === 'InvalidProjectWorkspace') {
75
+ if (err instanceof Error && err.name === 'InvalidProjectWorkspace') {
76
76
  // If we aren't in a project dir, we can't clean up data files.
77
77
  // If the user unlink this org outside of the workspace they used it in,
78
78
  // data files will be left over.
@@ -110,6 +110,13 @@ class Org extends kit_1.AsyncCreatable {
110
110
  // So, just in case no users are added to this org we will try the remove again.
111
111
  await this.removeAuth();
112
112
  }
113
+ /**
114
+ * Check if org is a sandbox org by checking its SandboxOrgConfig.
115
+ *
116
+ */
117
+ async isSandbox() {
118
+ return !!(await this.getSandboxOrgConfigField(sandboxOrgConfig_1.SandboxOrgConfig.Fields.PROD_ORG_USERNAME));
119
+ }
113
120
  /**
114
121
  * Check that this org is a scratch org by asking the dev hub if it knows about it.
115
122
  *
@@ -133,7 +140,7 @@ class Org extends kit_1.AsyncCreatable {
133
140
  results = await devHubConnection.query(DEV_HUB_SOQL);
134
141
  }
135
142
  catch (err) {
136
- if (err.name === 'INVALID_TYPE') {
143
+ if (err instanceof Error && err.name === 'INVALID_TYPE') {
137
144
  throw sfdxError_1.SfdxError.create('@salesforce/core', 'org', 'NotADevHub', [devHubConnection.getUsername()]);
138
145
  }
139
146
  throw err;
@@ -175,6 +182,36 @@ class Org extends kit_1.AsyncCreatable {
175
182
  return false;
176
183
  }
177
184
  }
185
+ /**
186
+ * Will delete 'this' instance remotely and any files locally
187
+ *
188
+ * @param controllingOrg username or Org that 'this.devhub' or 'this.production' refers to. AKA a DevHub for a scratch org, or a Production Org for a sandbox
189
+ */
190
+ async deleteFrom(controllingOrg) {
191
+ if (typeof controllingOrg === 'string') {
192
+ controllingOrg = await Org.create({
193
+ aggregator: this.configAggregator,
194
+ aliasOrUsername: controllingOrg,
195
+ });
196
+ }
197
+ if (await this.isSandbox()) {
198
+ await this.deleteSandbox(controllingOrg);
199
+ }
200
+ else {
201
+ await this.deleteScratchOrg(controllingOrg);
202
+ }
203
+ }
204
+ /**
205
+ * Will delete 'this' instance remotely and any files locally
206
+ */
207
+ async delete() {
208
+ if (await this.isSandbox()) {
209
+ await this.deleteSandbox();
210
+ }
211
+ else {
212
+ await this.deleteScratchOrg();
213
+ }
214
+ }
178
215
  /**
179
216
  * Returns `true` if the org is a Dev Hub.
180
217
  *
@@ -402,6 +439,7 @@ class Org extends kit_1.AsyncCreatable {
402
439
  // If no username is provided or resolvable from an alias, AuthInfo will throw an SfdxError.
403
440
  authInfo: await authInfo_1.AuthInfo.create({
404
441
  username: (username != null && (await aliases_1.Aliases.fetch(username))) || username,
442
+ isDevHub: this.options.isDevHub,
405
443
  }),
406
444
  });
407
445
  }
@@ -415,6 +453,98 @@ class Org extends kit_1.AsyncCreatable {
415
453
  getDefaultOptions() {
416
454
  throw new sfdxError_1.SfdxError('Not Supported');
417
455
  }
456
+ async queryProduction(org, field, value) {
457
+ return org.connection.singleRecordQuery(`SELECT SandboxInfoId FROM SandboxProcess WHERE ${field} ='${value}' AND Status NOT IN ('D', 'E')`, { tooling: true });
458
+ }
459
+ /**
460
+ * this method will delete the sandbox org from the production org and clean up any local files
461
+ *
462
+ * @param prodOrg - Production org associated with this sandbox
463
+ * @private
464
+ */
465
+ async deleteSandbox(prodOrg) {
466
+ prodOrg !== null && prodOrg !== void 0 ? prodOrg : (prodOrg = await Org.create({
467
+ aggregator: this.configAggregator,
468
+ aliasOrUsername: await this.getSandboxOrgConfigField(sandboxOrgConfig_1.SandboxOrgConfig.Fields.PROD_ORG_USERNAME),
469
+ }));
470
+ let result;
471
+ // attempt to locate sandbox id by username
472
+ try {
473
+ // try to calculate sandbox name from the production org
474
+ // production org: admin@integrationtesthub.org
475
+ // this.getUsername: admin@integrationtesthub.org.dev1
476
+ // sandboxName in Production: dev1
477
+ const sandboxName = (this.getUsername() || '').split(`${prodOrg.getUsername()}.`)[1];
478
+ if (!sandboxName) {
479
+ this.logger.debug('Could not construct a sandbox name');
480
+ throw new Error();
481
+ }
482
+ this.logger.debug(`attempting to locate sandbox with username ${sandboxName}`);
483
+ result = await this.queryProduction(prodOrg, 'SandboxName', sandboxName);
484
+ if (!result) {
485
+ this.logger.debug(`Failed to find sandbox with username: ${sandboxName}`);
486
+ throw new Error();
487
+ }
488
+ }
489
+ catch {
490
+ // if an error is thrown, don't panic yet. we'll try querying by orgId
491
+ const trimmedId = sfdc_1.sfdc.trimTo15(this.getOrgId());
492
+ this.logger.debug(`defaulting to trimming id from ${this.getOrgId()} to ${trimmedId}`);
493
+ try {
494
+ result = await this.queryProduction(prodOrg, 'SandboxOrganization', trimmedId);
495
+ }
496
+ catch {
497
+ throw sfdxError_1.SfdxError.create('@salesforce/core', 'org', 'SandboxNotFound', [trimmedId]);
498
+ }
499
+ }
500
+ const deleteResult = await prodOrg.connection.tooling.delete('SandboxInfo', result.SandboxInfoId);
501
+ this.logger.debug('Return from calling tooling.delete: %o ', deleteResult);
502
+ await this.remove();
503
+ if (Array.isArray(deleteResult) || !deleteResult.success) {
504
+ throw sfdxError_1.SfdxError.create('@salesforce/core', 'org', 'SandboxDeleteFailed', [JSON.stringify(deleteResult)]);
505
+ }
506
+ }
507
+ /**
508
+ * If this Org is a scratch org, calling this method will delete the scratch org from the DevHub and clean up any local files
509
+ *
510
+ * @param devHub - optional DevHub Org of the to-be-deleted scratch org
511
+ * @private
512
+ */
513
+ async deleteScratchOrg(devHub) {
514
+ // if we didn't get a devHub, we'll get it from the this org
515
+ devHub !== null && devHub !== void 0 ? devHub : (devHub = await this.getDevHubOrg());
516
+ if (!devHub) {
517
+ throw sfdxError_1.SfdxError.create('@salesforce/core', 'org', 'NoDevHubFound');
518
+ }
519
+ if (devHub.getOrgId() === this.getOrgId()) {
520
+ // we're attempting to delete a DevHub
521
+ throw sfdxError_1.SfdxError.create('@salesforce/core', 'org', 'DeleteOrgHubError');
522
+ }
523
+ try {
524
+ const devHubConn = devHub.getConnection();
525
+ const username = this.getUsername();
526
+ const activeScratchOrgRecordId = (await devHubConn.singleRecordQuery(`SELECT Id FROM ActiveScratchOrg WHERE SignupUsername='${username}'`)).Id;
527
+ this.logger.trace(`found matching ActiveScratchOrg with SignupUsername: ${username}. Deleting...`);
528
+ await devHubConn.delete('ActiveScratchOrg', activeScratchOrgRecordId);
529
+ await this.remove();
530
+ }
531
+ catch (err) {
532
+ this.logger.info(err instanceof Error ? err.message : err);
533
+ if (err instanceof Error && (err.name === 'INVALID_TYPE' || err.name === 'INSUFFICIENT_ACCESS_OR_READONLY')) {
534
+ // most likely from devHubConn.delete
535
+ this.logger.info('Insufficient privilege to access ActiveScratchOrgs.');
536
+ throw sfdxError_1.SfdxError.create('@salesforce/core', 'org', 'InsufficientAccessToDelete');
537
+ }
538
+ if (err instanceof Error && err.name === connection_1.SingleRecordQueryErrors.NoRecords) {
539
+ // most likely from singleRecordQuery
540
+ this.logger.info('The above error can be the result of deleting an expired or already deleted org.');
541
+ this.logger.info('attempting to cleanup the auth file');
542
+ await this.removeAuth();
543
+ throw sfdxError_1.SfdxError.create('@salesforce/core', 'org', 'ScratchOrgNotFound');
544
+ }
545
+ throw err;
546
+ }
547
+ }
418
548
  /**
419
549
  * Returns a promise to delete an auth info file from the local file system and any related cache information for
420
550
  * this Org.. You don't want to call this method directly. Instead consider calling Org.remove()
@@ -464,7 +594,6 @@ class Org extends kit_1.AsyncCreatable {
464
594
  *
465
595
  * @param throwWhenRemoveFails true if manageDelete should throw or not if the deleted fails.
466
596
  */
467
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
468
597
  async removeUsers(throwWhenRemoveFails) {
469
598
  this.logger.debug(`Removing users associate with org: ${this.getOrgId()}`);
470
599
  const config = await this.retrieveOrgUsersConfig();
@@ -149,7 +149,7 @@ export declare class SfdxError extends NamedError {
149
149
  * @param err The error to convert.
150
150
  */
151
151
  static wrap(err: Error | string): SfdxError;
152
- get code(): string;
152
+ get code(): string | undefined | any;
153
153
  set code(code: string);
154
154
  /**
155
155
  * Sets the name of the command. For convenience `this` object is returned.
package/lib/sfdxError.js CHANGED
@@ -179,6 +179,7 @@ class SfdxError extends kit_1.NamedError {
179
179
  }
180
180
  return sfdxError;
181
181
  }
182
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
182
183
  get code() {
183
184
  return this._code || this.name;
184
185
  }
@@ -388,7 +388,9 @@ export declare class MockTestOrgData {
388
388
  refreshToken: string;
389
389
  userId: string;
390
390
  redirectUri: string;
391
- constructor(id?: string);
391
+ constructor(id?: string, options?: {
392
+ username: string;
393
+ });
392
394
  createDevHubUsername(username: string): void;
393
395
  makeDevHub(): void;
394
396
  createUser(user: string): MockTestOrgData;
package/lib/testSetup.js CHANGED
@@ -63,7 +63,7 @@ function defaultFakeConnectionRequest() {
63
63
  * ```
64
64
  * @param sinon
65
65
  */
66
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
66
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types
67
67
  const instantiateContext = (sinon) => {
68
68
  if (!sinon) {
69
69
  try {
@@ -464,11 +464,11 @@ exports.StreamingMockCometClient = StreamingMockCometClient;
464
464
  * Mock class for OrgData.
465
465
  */
466
466
  class MockTestOrgData {
467
- constructor(id = uniqid()) {
467
+ constructor(id = uniqid(), options) {
468
468
  this.testId = id;
469
469
  this.userId = `user_id_${this.testId}`;
470
470
  this.orgId = `${this.testId}`;
471
- this.username = `admin_${this.testId}@gb.org`;
471
+ this.username = (options === null || options === void 0 ? void 0 : options.username) || `admin_${this.testId}@gb.org`;
472
472
  this.loginUrl = `http://login.${this.testId}.salesforce.com`;
473
473
  this.instanceUrl = `http://instance.${this.testId}.salesforce.com`;
474
474
  this.clientId = `${this.testId}/client_id`;
@@ -12,12 +12,13 @@ const kit_1 = require("@salesforce/kit");
12
12
  const ts_types_1 = require("@salesforce/ts-types");
13
13
  const myDomainResolver_1 = require("../status/myDomainResolver");
14
14
  const logger_1 = require("../logger");
15
+ const lifecycleEvents_1 = require("../lifecycleEvents");
15
16
  class SfdcUrl extends url_1.URL {
16
17
  constructor(input, base) {
17
18
  super(input.toString(), base);
18
19
  if (this.protocol !== 'https:' && !SfdcUrl.cache.has(this.origin)) {
19
20
  SfdcUrl.cache.add(this.origin);
20
- process.emitWarning('Using insecure protocol: ' + this.protocol + ' on url: ' + this.origin);
21
+ void lifecycleEvents_1.Lifecycle.getInstance().emitWarning(`Using insecure protocol: ${this.protocol} on url: ${this.origin}`);
21
22
  }
22
23
  }
23
24
  /**
@@ -12,9 +12,9 @@
12
12
  "OrgDataNotAvailableErrorAction2": "Use `sfdx force:config:set` to update the defaultusername.",
13
13
  "OrgDataNotAvailableErrorAction3": "Use `sfdx force:org:create` to create a new org.",
14
14
  "OrgDataNotAvailableErrorAction4": "Use `sfdx force:auth` to authenticate an existing org.",
15
- "NamedOrgNotFound": "No AuthInfo found for name %s",
16
- "NoAliasesFound": "Nothing to set",
17
- "InvalidFormat": "Setting aliases must be in the format <key>=<value> but found: [%s]",
15
+ "NamedOrgNotFound": "No authorization information found for %s %s.",
16
+ "NoAliasesFound": "Nothing to set.",
17
+ "InvalidFormat": "Setting aliases must be in the format <key>=<value> but found: [%s].",
18
18
  "NoAuthInfoFound": "No authorization information can be found.",
19
19
  "InvalidJsonCasing": "All JSON input must have heads down camelcase keys. E.g., { sfdcLoginUrl: \"https://login.salesforce.com\" }\nFound \"%s\" at %s"
20
20
  }
package/messages/org.json CHANGED
@@ -1,4 +1,10 @@
1
1
  {
2
- "NotFoundOnDevHub": "The scratch org does not belong to the dev hub username %s.",
3
- "NotADevHub": "The provided dev hub username %s is not a valid dev hub."
4
- }
2
+ "NotFoundOnDevHub": "The scratch org does not belong to the dev hub username %s.",
3
+ "NotADevHub": "The provided dev hub username %s is not a valid dev hub.",
4
+ "NoDevHubFound": "Unable to associate this scratch org with a DevHub",
5
+ "DeleteOrgHubError": "The Dev Hub org cannot be deleted.",
6
+ "InsufficientAccessToDelete": "You do not have the appropriate permissions to delete a scratch org. Please contact your Salesforce admin.",
7
+ "ScratchOrgNotFound": "Attempting to delete an expired or deleted org",
8
+ "SandboxDeleteFailed": "The sandbox org deletion failed with a result of %s.",
9
+ "SandboxNotFound": "We can't find a SandboxProcess for the sandbox org %s."
10
+ }
package/package.json CHANGED
@@ -1,20 +1,21 @@
1
1
  {
2
2
  "name": "@salesforce/core",
3
- "version": "2.28.2",
3
+ "version": "2.30.0",
4
4
  "description": "Core libraries to interact with SFDX projects, orgs, and APIs.",
5
5
  "main": "lib/exported",
6
+ "types": "lib/exported.d.ts",
6
7
  "license": "BSD-3-Clause",
7
8
  "scripts": {
8
9
  "build": "sf-build",
9
10
  "ci-docs": "yarn sf-ci-docs",
10
11
  "clean": "sf-clean",
11
- "clean-all": "-clean all",
12
+ "clean-all": "sf-clean all",
12
13
  "compile": "sf-compile",
13
14
  "docs": "sf-docs",
14
15
  "format": "sf-format",
15
16
  "lint": "sf-lint",
16
17
  "lint-fix": "yarn sf-lint --fix",
17
- "postcompile": "tsc -p test; tsc -p typedocExamples",
18
+ "postcompile": "tsc -p test && tsc -p typedocExamples",
18
19
  "prepack": "sf-build",
19
20
  "pretest": "sf-compile-test",
20
21
  "test": "sf-test"
@@ -44,7 +45,7 @@
44
45
  "@salesforce/schemas": "^1.0.1",
45
46
  "@salesforce/ts-types": "^1.5.13",
46
47
  "@types/graceful-fs": "^4.1.5",
47
- "@types/jsforce": "^1.9.29",
48
+ "@types/jsforce": "^1.9.35",
48
49
  "@types/mkdirp": "^1.0.1",
49
50
  "debug": "^3.1.0",
50
51
  "graceful-fs": "^4.2.4",
@@ -52,19 +53,21 @@
52
53
  "jsforce": "^1.10.1",
53
54
  "jsonwebtoken": "8.5.0",
54
55
  "mkdirp": "1.0.4",
56
+ "semver": "^7.3.5",
55
57
  "sfdx-faye": "^1.0.9",
56
58
  "ts-retry-promise": "^0.6.0"
57
59
  },
58
60
  "devDependencies": {
59
61
  "@salesforce/dev-config": "^2.0.0",
60
- "@salesforce/dev-scripts": "^0.6.2",
61
- "@salesforce/prettier-config": "^0.0.1",
62
+ "@salesforce/dev-scripts": "^0.9.18",
63
+ "@salesforce/prettier-config": "^0.0.2",
62
64
  "@salesforce/ts-sinon": "^1.3.15",
63
65
  "@types/debug": "0.0.30",
64
66
  "@types/jsen": "0.0.19",
65
67
  "@types/jsonwebtoken": "8.3.2",
68
+ "@types/semver": "^7.3.9",
66
69
  "@types/shelljs": "0.7.8",
67
- "@types/sinon": "^9.0.8",
70
+ "@types/sinon": "^10.0.6",
68
71
  "@typescript-eslint/eslint-plugin": "^4.2.0",
69
72
  "@typescript-eslint/parser": "4.26.0",
70
73
  "chai": "^4.2.0",
@@ -84,11 +87,10 @@
84
87
  "prettier": "^2.0.5",
85
88
  "pretty-quick": "^2.0.1",
86
89
  "shelljs": "0.8.1",
87
- "sinon": "^9.0.2",
90
+ "sinon": "10.0.0",
88
91
  "ts-node": "^8.10.2",
89
92
  "typescript": "^4.1.3"
90
93
  },
91
- "types": "lib/exported.d.ts",
92
94
  "repository": {
93
95
  "type": "git",
94
96
  "url": "https://github.com/forcedotcom/sfdx-core.git"