@salesforce/core 4.0.0 → 4.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (153) hide show
  1. package/LICENSE.txt +1 -1
  2. package/README.md +93 -44
  3. package/lib/config/aliasesConfig.d.ts +12 -0
  4. package/lib/config/aliasesConfig.js +28 -0
  5. package/lib/config/authInfoConfig.d.ts +19 -0
  6. package/lib/config/authInfoConfig.js +35 -0
  7. package/lib/config/config.d.ts +87 -22
  8. package/lib/config/config.js +117 -65
  9. package/lib/config/configAggregator.d.ts +41 -35
  10. package/lib/config/configAggregator.js +102 -73
  11. package/lib/config/configFile.d.ts +2 -2
  12. package/lib/config/configFile.js +38 -29
  13. package/lib/config/configGroup.d.ts +141 -0
  14. package/lib/config/configGroup.js +225 -0
  15. package/lib/config/configStore.d.ts +9 -9
  16. package/lib/config/configStore.js +17 -15
  17. package/lib/config/envVars.d.ts +15 -9
  18. package/lib/config/envVars.js +71 -47
  19. package/lib/config/orgUsersConfig.js +2 -0
  20. package/lib/config/sandboxOrgConfig.js +2 -0
  21. package/lib/config/sandboxProcessCache.d.ts +16 -0
  22. package/lib/config/sandboxProcessCache.js +38 -0
  23. package/lib/config/tokensConfig.d.ts +10 -0
  24. package/lib/config/tokensConfig.js +29 -0
  25. package/lib/config/ttlConfig.d.ts +34 -0
  26. package/lib/config/ttlConfig.js +50 -0
  27. package/lib/crypto/crypto.js +15 -22
  28. package/lib/crypto/keyChain.js +2 -3
  29. package/lib/crypto/keyChainImpl.d.ts +5 -3
  30. package/lib/crypto/keyChainImpl.js +58 -61
  31. package/lib/crypto/secureBuffer.d.ts +1 -1
  32. package/lib/deviceOauthService.d.ts +3 -3
  33. package/lib/deviceOauthService.js +27 -25
  34. package/lib/exported.d.ts +15 -12
  35. package/lib/exported.js +28 -16
  36. package/lib/global.d.ts +11 -3
  37. package/lib/global.js +39 -12
  38. package/lib/lifecycleEvents.d.ts +1 -1
  39. package/lib/lifecycleEvents.js +3 -0
  40. package/lib/logger.d.ts +19 -9
  41. package/lib/logger.js +112 -86
  42. package/lib/messages.d.ts +53 -36
  43. package/lib/messages.js +81 -91
  44. package/lib/org/authInfo.d.ts +56 -20
  45. package/lib/org/authInfo.js +232 -131
  46. package/lib/org/authRemover.d.ts +8 -7
  47. package/lib/org/authRemover.js +32 -28
  48. package/lib/org/connection.d.ts +13 -37
  49. package/lib/org/connection.js +78 -124
  50. package/lib/org/index.js +5 -1
  51. package/lib/org/org.d.ts +151 -48
  52. package/lib/org/org.js +466 -220
  53. package/lib/org/orgConfigProperties.d.ts +64 -3
  54. package/lib/org/orgConfigProperties.js +96 -4
  55. package/lib/org/permissionSetAssignment.js +4 -13
  56. package/lib/org/scratchOrgCache.d.ts +20 -0
  57. package/lib/org/scratchOrgCache.js +33 -0
  58. package/lib/org/scratchOrgCreate.d.ts +28 -17
  59. package/lib/org/scratchOrgCreate.js +125 -53
  60. package/lib/org/scratchOrgErrorCodes.d.ts +9 -3
  61. package/lib/org/scratchOrgErrorCodes.js +34 -17
  62. package/lib/org/scratchOrgFeatureDeprecation.js +1 -6
  63. package/lib/org/scratchOrgInfoApi.d.ts +21 -47
  64. package/lib/org/scratchOrgInfoApi.js +129 -63
  65. package/lib/org/scratchOrgInfoGenerator.d.ts +6 -5
  66. package/lib/org/scratchOrgInfoGenerator.js +76 -62
  67. package/lib/org/scratchOrgLifecycleEvents.d.ts +10 -0
  68. package/lib/org/scratchOrgLifecycleEvents.js +41 -0
  69. package/lib/org/scratchOrgSettingsGenerator.d.ts +44 -21
  70. package/lib/org/scratchOrgSettingsGenerator.js +165 -98
  71. package/lib/org/scratchOrgTypes.d.ts +43 -0
  72. package/lib/org/scratchOrgTypes.js +9 -0
  73. package/lib/org/user.d.ts +1 -1
  74. package/lib/org/user.js +25 -34
  75. package/lib/schema/printer.d.ts +6 -0
  76. package/lib/schema/printer.js +34 -31
  77. package/lib/schema/validator.d.ts +12 -10
  78. package/lib/schema/validator.js +56 -76
  79. package/lib/{sfdxError.d.ts → sfError.d.ts} +12 -20
  80. package/lib/{sfdxError.js → sfError.js} +40 -30
  81. package/lib/{sfdxProject.d.ts → sfProject.d.ts} +75 -35
  82. package/lib/sfProject.js +651 -0
  83. package/lib/{globalInfo → stateAggregator}/accessors/aliasAccessor.d.ts +27 -12
  84. package/lib/{globalInfo → stateAggregator}/accessors/aliasAccessor.js +47 -31
  85. package/lib/stateAggregator/accessors/orgAccessor.d.ts +101 -0
  86. package/lib/stateAggregator/accessors/orgAccessor.js +240 -0
  87. package/lib/stateAggregator/accessors/sandboxAccessor.d.ts +8 -0
  88. package/lib/stateAggregator/accessors/sandboxAccessor.js +28 -0
  89. package/lib/stateAggregator/accessors/tokenAccessor.d.ts +63 -0
  90. package/lib/stateAggregator/accessors/tokenAccessor.js +80 -0
  91. package/lib/stateAggregator/index.d.ts +4 -0
  92. package/lib/stateAggregator/index.js +27 -0
  93. package/lib/stateAggregator/stateAggregator.d.ts +25 -0
  94. package/lib/stateAggregator/stateAggregator.js +46 -0
  95. package/lib/status/myDomainResolver.d.ts +1 -1
  96. package/lib/status/myDomainResolver.js +4 -4
  97. package/lib/status/pollingClient.js +4 -4
  98. package/lib/status/streamingClient.d.ts +2 -2
  99. package/lib/status/streamingClient.js +58 -63
  100. package/lib/status/types.d.ts +2 -2
  101. package/lib/testSetup.d.ts +206 -75
  102. package/lib/testSetup.js +463 -165
  103. package/lib/util/cache.d.ts +2 -2
  104. package/lib/util/cache.js +6 -6
  105. package/lib/util/checkLightningDomain.js +3 -4
  106. package/lib/util/directoryWriter.d.ts +12 -0
  107. package/lib/util/directoryWriter.js +54 -0
  108. package/lib/util/getJwtAudienceUrl.js +1 -1
  109. package/lib/util/internal.d.ts +28 -2
  110. package/lib/util/internal.js +65 -8
  111. package/lib/util/jsonXmlTools.js +2 -4
  112. package/lib/util/mapKeys.d.ts +9 -9
  113. package/lib/util/mapKeys.js +13 -9
  114. package/lib/util/sfdc.d.ts +51 -51
  115. package/lib/util/sfdc.js +74 -79
  116. package/lib/util/sfdcUrl.d.ts +5 -19
  117. package/lib/util/sfdcUrl.js +40 -49
  118. package/lib/util/structuredWriter.d.ts +9 -0
  119. package/lib/util/structuredWriter.js +3 -0
  120. package/lib/util/zipWriter.d.ts +8 -6
  121. package/lib/util/zipWriter.js +13 -13
  122. package/lib/webOAuthServer.d.ts +20 -6
  123. package/lib/webOAuthServer.js +102 -56
  124. package/messageTransformer/messageTransformer.ts +93 -0
  125. package/messages/auth.md +9 -1
  126. package/messages/config.md +42 -6
  127. package/messages/connection.md +8 -0
  128. package/messages/core.md +10 -0
  129. package/messages/envVars.md +37 -3
  130. package/messages/org.md +21 -1
  131. package/messages/scratchOrgCreate.md +2 -6
  132. package/messages/scratchOrgErrorCodes.md +17 -1
  133. package/messages/scratchOrgInfoApi.md +9 -0
  134. package/messages/scratchOrgInfoGenerator.md +9 -1
  135. package/package.json +121 -46
  136. package/CHANGELOG.md +0 -1244
  137. package/lib/config/keychainConfig.d.ts +0 -19
  138. package/lib/config/keychainConfig.js +0 -43
  139. package/lib/globalInfo/accessors/orgAccessor.d.ts +0 -13
  140. package/lib/globalInfo/accessors/orgAccessor.js +0 -45
  141. package/lib/globalInfo/accessors/tokenAccessor.d.ts +0 -13
  142. package/lib/globalInfo/accessors/tokenAccessor.js +0 -35
  143. package/lib/globalInfo/globalInfoConfig.d.ts +0 -36
  144. package/lib/globalInfo/globalInfoConfig.js +0 -105
  145. package/lib/globalInfo/index.d.ts +0 -6
  146. package/lib/globalInfo/index.js +0 -29
  147. package/lib/globalInfo/sfdxDataHandler.d.ts +0 -43
  148. package/lib/globalInfo/sfdxDataHandler.js +0 -217
  149. package/lib/globalInfo/types.d.ts +0 -39
  150. package/lib/globalInfo/types.js +0 -10
  151. package/lib/sfdxProject.js +0 -557
  152. package/lib/util/fs.d.ts +0 -201
  153. package/lib/util/fs.js +0 -378
package/messages/org.md CHANGED
@@ -28,7 +28,7 @@ The sandbox org deletion failed with a result of %s.
28
28
 
29
29
  # sandboxNotFound
30
30
 
31
- We can't find a SandboxProcess for the sandbox org %s.
31
+ We can't find a SandboxProcess for the sandbox %s.
32
32
 
33
33
  # sandboxInfoCreateFailed
34
34
 
@@ -45,3 +45,23 @@ Sandbox status is %s; timed out waiting for completion.
45
45
  # NotFoundOnDevHub
46
46
 
47
47
  The scratch org does not belong to the dev hub username %s.
48
+
49
+ # AuthInfoOrgIdUndefined
50
+
51
+ AuthInfo orgId is undefined.
52
+
53
+ # sandboxCreateNotComplete
54
+
55
+ The sandbox creation has not completed.
56
+
57
+ # SandboxProcessNotFoundBySandboxName
58
+
59
+ We can't find a SandboxProcess with the SandboxName %s.
60
+
61
+ # MultiSandboxProcessNotFoundBySandboxName
62
+
63
+ We found more than one SandboxProcess with the SandboxName %s.
64
+
65
+ # sandboxNotResumable
66
+
67
+ The sandbox %s cannot resume with status of %s.
@@ -2,10 +2,6 @@
2
2
 
3
3
  Org snapshots don’t support one or more options you specified: %s.
4
4
 
5
- # SourceStatusResetFailureError
6
-
7
- Successfully created org with ID: %s and name: %s. Unfortunately, source tracking isn’t working as expected. If you run force:source:status, the results may be incorrect. Try again by creating another scratch org.
8
-
9
5
  # DurationDaysValidationMinError
10
6
 
11
7
  Expected 'durationDays' greater than or equal to %s but received %s.
@@ -22,6 +18,6 @@ Expected 'durationDays' to be an integer number.
22
18
 
23
19
  Expected 'retry' to be an integer number.
24
20
 
25
- # WaitValidationMaxError
21
+ # CacheMissError
26
22
 
27
- Expected 'wait' greater than or equal to %s but received %s.
23
+ The ScratchOrgInfoId %s was not found in the cache.
@@ -8,12 +8,28 @@ An unknown server error occurred. Please try again. If you still see this error,
8
8
 
9
9
  # SignupFailedActionError
10
10
 
11
- See https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_objects_signuprequest.htm for information on error code %s.
11
+ See https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_scratch_orgs_error_codes.htm for information on error code %s.
12
12
 
13
13
  # SignupUnexpectedError
14
14
 
15
15
  The request to create a scratch org returned an unexpected status
16
16
 
17
+ # StillInProgressError
18
+
19
+ The scratch org is not ready yet (Status = %s).
20
+
21
+ # action.StillInProgress
22
+
23
+ Wait for a few minutes, and then try the command again
24
+
25
+ # NoScratchOrgInfoError
26
+
27
+ No ScratchOrgInfo object found in the Dev Hub you specified. Check that the ID and the Dev Hub are correct.
28
+
29
+ # ScratchOrgDeletedError
30
+
31
+ That scratch org has been deleted, so you can't connect to it anymore.
32
+
17
33
  # INVALID_ID_FIELD
18
34
 
19
35
  Provide a valid template ID, in the format 0TTxxxxxxxxxxxx.
@@ -9,3 +9,12 @@ You cannot use 'settings' and `'orgPreferences' in your scratch definition file,
9
9
  # DeprecatedPrefFormat
10
10
 
11
11
  We've deprecated OrgPreferences. Update the scratch org definition file to replace OrgPreferences with their corresponding settings.
12
+
13
+ # SourceStatusResetFailureError
14
+
15
+ Successfully created org with ID: %s and name: %s. Unfortunately, source tracking isn’t working as expected. If you run force:source:status, the results may be incorrect. Try again by creating another scratch org.
16
+
17
+ # hubOrgIsNotDevHub
18
+
19
+ Make sure that the org with username %s and ID %s is enabled as a Dev Hub. To enable it, open the org in your browser, navigate to the Dev Hub page in Setup, and click Enable.
20
+ If you still see this error after enabling the Dev Hub feature, then re-authenticate to the org.
@@ -8,7 +8,11 @@ The ancestor versionNumber must be in the format major.minor.patch but the value
8
8
 
9
9
  # NoMatchingAncestorError
10
10
 
11
- The ancestorId for ancestorVersion %s can't be found. Package ID %s.",
11
+ The ancestor for ancestorVersion %s can't be found. Package ID %s.",
12
+
13
+ # NoMatchingAncestorIdError
14
+
15
+ The ancestor for ancestorId [%s] can't be found. Package ID %s."
12
16
 
13
17
  # AncestorNotReleasedError
14
18
 
@@ -17,3 +21,7 @@ The ancestor package version [%s] specified in the sfdx-project.json file may ex
17
21
  # AncestorIdVersionMismatchError
18
22
 
19
23
  The ancestorVersion in sfdx-project.json is not the version expected for the ancestorId you supplied. ancestorVersion %s. ancestorID %s."
24
+
25
+ # unsupportedSnapshotOrgCreateOptions
26
+
27
+ Org snapshots don’t support one or more options you specified: %s
package/package.json CHANGED
@@ -1,25 +1,28 @@
1
1
  {
2
2
  "name": "@salesforce/core",
3
- "version": "4.0.0",
3
+ "version": "4.0.1",
4
4
  "description": "Core libraries to interact with SFDX projects, orgs, and APIs.",
5
5
  "main": "lib/exported",
6
6
  "types": "lib/exported.d.ts",
7
7
  "license": "BSD-3-Clause",
8
+ "engines": {
9
+ "node": ">=16.0.0"
10
+ },
8
11
  "scripts": {
9
- "build": "sf-build",
12
+ "build": "wireit",
10
13
  "ci-docs": "yarn sf-ci-docs",
11
14
  "clean": "sf-clean",
12
15
  "clean-all": "sf-clean all",
13
- "compile": "sf-compile",
16
+ "compile": "wireit",
14
17
  "docs": "sf-docs",
15
- "format": "sf-format",
16
- "lint": "sf-lint",
18
+ "format": "wireit",
19
+ "lint": "wireit",
17
20
  "lint-fix": "yarn sf-lint --fix",
18
- "postcompile": "tsc -p test && tsc -p typedocExamples",
21
+ "postcompile": "tsc -p typedocExamples",
19
22
  "prepack": "sf-prepack",
20
23
  "prepare": "sf-install",
21
- "pretest": "sf-compile-test",
22
- "test": "sf-test"
24
+ "test": "wireit",
25
+ "test:only": "wireit"
23
26
  },
24
27
  "keywords": [
25
28
  "force",
@@ -31,62 +34,61 @@
31
34
  "docs",
32
35
  "lib",
33
36
  "messages",
34
- "!lib/**/*.map"
37
+ "!lib/**/*.map",
38
+ "messageTransformer/messageTransformer.ts"
35
39
  ],
36
40
  "dependencies": {
37
- "@oclif/core": "^1.3.1",
38
41
  "@salesforce/bunyan": "^2.0.0",
39
- "@salesforce/kit": "^1.5.28",
40
- "@salesforce/schemas": "^1.1.0",
41
- "@salesforce/ts-types": "^1.5.20",
42
- "@types/graceful-fs": "^4.1.5",
43
- "@types/mkdirp": "^1.0.2",
44
- "@types/semver": "^7.3.9",
42
+ "@salesforce/kit": "^3.0.0",
43
+ "@salesforce/schemas": "^1.5.1",
44
+ "@salesforce/ts-types": "^2.0.1",
45
+ "@types/semver": "^7.3.13",
46
+ "ajv": "^8.12.0",
45
47
  "archiver": "^5.3.0",
46
- "js2xmlparser": "^4.0.1",
47
48
  "change-case": "^4.1.2",
48
49
  "debug": "^3.2.7",
49
50
  "faye": "^1.4.0",
50
51
  "form-data": "^4.0.0",
51
- "graceful-fs": "^4.2.9",
52
- "jsen": "0.6.6",
53
- "jsforce": "2.0.0-beta.7",
54
- "jsonwebtoken": "8.5.1",
55
- "mkdirp": "1.0.4",
56
- "ts-retry-promise": "^0.6.0"
52
+ "js2xmlparser": "^4.0.1",
53
+ "jsforce": "^2.0.0-beta.23",
54
+ "jsonwebtoken": "9.0.0",
55
+ "ts-retry-promise": "^0.7.0"
57
56
  },
58
57
  "devDependencies": {
59
- "@salesforce/dev-config": "^3.0.0",
60
- "@salesforce/dev-scripts": "^2.0.0",
58
+ "@salesforce/dev-config": "^4.0.1",
59
+ "@salesforce/dev-scripts": "^5.0.1",
61
60
  "@salesforce/prettier-config": "^0.0.2",
62
- "@salesforce/ts-sinon": "^1.3.21",
63
- "@types/archiver": "^5.3.1",
61
+ "@salesforce/ts-sinon": "^1.4.6",
62
+ "@types/archiver": "^5.3.2",
63
+ "@types/chai-string": "^1.4.2",
64
64
  "@types/debug": "0.0.31",
65
- "@types/jsen": "0.0.21",
66
- "@types/jsonwebtoken": "8.5.7",
67
- "@types/shelljs": "0.8.11",
68
- "@typescript-eslint/eslint-plugin": "^4.33.0",
69
- "@typescript-eslint/parser": "4.33.0",
70
- "chai": "^4.3.4",
71
- "commitizen": "^3.1.2",
72
- "eslint": "^6.8.0",
73
- "eslint-config-prettier": "^6.15.0",
74
- "eslint-config-salesforce": "^0.1.6",
75
- "eslint-config-salesforce-license": "^0.1.6",
76
- "eslint-config-salesforce-typescript": "^0.2.8",
65
+ "@types/jsonwebtoken": "9.0.2",
66
+ "@types/lodash": "^4.14.194",
67
+ "@types/shelljs": "0.8.12",
68
+ "@typescript-eslint/eslint-plugin": "^5.59.7",
69
+ "@typescript-eslint/parser": "^5.59.7",
70
+ "chai": "^4.3.7",
71
+ "chai-string": "^1.5.0",
72
+ "eslint": "^8.41.0",
73
+ "eslint-config-prettier": "^8.8.0",
74
+ "eslint-config-salesforce": "^2.0.1",
75
+ "eslint-config-salesforce-license": "^0.2.0",
76
+ "eslint-config-salesforce-typescript": "^1.1.1",
77
77
  "eslint-plugin-header": "^3.1.1",
78
- "eslint-plugin-import": "^2.25.4",
79
- "eslint-plugin-jsdoc": "^27.1.2",
80
- "eslint-plugin-prettier": "^3.1.3",
78
+ "eslint-plugin-import": "^2.27.5",
79
+ "eslint-plugin-jsdoc": "^43.1.1",
81
80
  "husky": "^7.0.4",
81
+ "lodash": "^4.17.21",
82
82
  "mocha": "^9.1.3",
83
83
  "nyc": "^15.1.0",
84
- "prettier": "^2.5.1",
84
+ "prettier": "^2.8.7",
85
85
  "pretty-quick": "^3.1.3",
86
86
  "shelljs": "0.8.5",
87
- "sinon": "10.0.0",
87
+ "sinon": "^14.0.2",
88
88
  "ts-node": "^10.4.0",
89
- "typescript": "4.4.4"
89
+ "ttypescript": "^1.5.15",
90
+ "typescript": "^4.9.5",
91
+ "wireit": "^0.9.5"
90
92
  },
91
93
  "repository": {
92
94
  "type": "git",
@@ -94,5 +96,78 @@
94
96
  },
95
97
  "publishConfig": {
96
98
  "access": "public"
99
+ },
100
+ "wireit": {
101
+ "build": {
102
+ "dependencies": [
103
+ "compile",
104
+ "lint"
105
+ ]
106
+ },
107
+ "compile": {
108
+ "command": "ttsc -p . --pretty --incremental",
109
+ "files": [
110
+ "src/**/*.ts",
111
+ "tsconfig.json",
112
+ "messages",
113
+ "messageTransformer"
114
+ ],
115
+ "output": [
116
+ "lib/**",
117
+ "*.tsbuildinfo"
118
+ ],
119
+ "clean": "if-file-deleted"
120
+ },
121
+ "format": {
122
+ "command": "prettier --write \"+(src|test|schemas)/**/*.+(ts|js|json)|command-snapshot.json\"",
123
+ "files": [
124
+ "src/**/*.ts",
125
+ "test/**/*.ts",
126
+ "schemas/**/*.json",
127
+ "command-snapshot.json",
128
+ ".prettier*"
129
+ ],
130
+ "output": []
131
+ },
132
+ "lint": {
133
+ "command": "eslint src test --color --cache --cache-location .eslintcache",
134
+ "files": [
135
+ "src/**/*.ts",
136
+ "test/**/*.ts",
137
+ "messages/**",
138
+ "**/.eslint*",
139
+ "**/tsconfig.json"
140
+ ],
141
+ "output": []
142
+ },
143
+ "test:compile": {
144
+ "command": "tsc -p \"./test\" --pretty",
145
+ "files": [
146
+ "test/**/*.ts",
147
+ "**/tsconfig.json"
148
+ ],
149
+ "output": []
150
+ },
151
+ "test:only": {
152
+ "command": "nyc mocha \"test/**/*Test.ts\"",
153
+ "env": {
154
+ "FORCE_COLOR": "2"
155
+ },
156
+ "files": [
157
+ "test/**/*.ts",
158
+ "src/**/*.ts",
159
+ "**/tsconfig.json",
160
+ ".mocha*",
161
+ "!*.nut.ts",
162
+ ".nycrc"
163
+ ],
164
+ "output": []
165
+ },
166
+ "test": {
167
+ "dependencies": [
168
+ "test:only",
169
+ "test:compile"
170
+ ]
171
+ }
97
172
  }
98
- }
173
+ }