@salesforce/plugin-deploy-retrieve 1.8.5-beta.5 → 1.8.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commands/{project/deploy → deploy/metadata}/cancel.d.ts +0 -2
- package/lib/commands/{project/deploy → deploy/metadata}/cancel.js +6 -17
- package/lib/commands/deploy/metadata/cancel.js.map +1 -0
- package/lib/commands/{project/deploy → deploy/metadata}/preview.d.ts +0 -2
- package/lib/commands/{project/deploy → deploy/metadata}/preview.js +1 -3
- package/lib/commands/deploy/metadata/preview.js.map +1 -0
- package/lib/commands/{project/deploy → deploy/metadata}/quick.d.ts +0 -3
- package/lib/commands/{project/deploy → deploy/metadata}/quick.js +6 -14
- package/lib/commands/deploy/metadata/quick.js.map +1 -0
- package/lib/commands/deploy/metadata/report.d.ts +14 -0
- package/lib/commands/{project/deploy → deploy/metadata}/report.js +5 -26
- package/lib/commands/deploy/metadata/report.js.map +1 -0
- package/lib/commands/{project/deploy → deploy/metadata}/resume.d.ts +0 -5
- package/lib/commands/{project/deploy → deploy/metadata}/resume.js +3 -19
- package/lib/commands/deploy/metadata/resume.js.map +1 -0
- package/lib/commands/{project/deploy → deploy/metadata}/validate.d.ts +0 -2
- package/lib/commands/{project/deploy → deploy/metadata}/validate.js +6 -8
- package/lib/commands/deploy/metadata/validate.js.map +1 -0
- package/lib/commands/{project/deploy/start.d.ts → deploy/metadata.d.ts} +2 -10
- package/lib/commands/{project/deploy/start.js → deploy/metadata.js} +13 -44
- package/lib/commands/deploy/metadata.js.map +1 -0
- package/lib/commands/deploy.d.ts +0 -5
- package/lib/commands/deploy.js +0 -5
- package/lib/commands/deploy.js.map +1 -1
- package/lib/commands/{project/retrieve → retrieve/metadata}/preview.d.ts +0 -2
- package/lib/commands/{project/retrieve → retrieve/metadata}/preview.js +0 -2
- package/lib/commands/retrieve/metadata/preview.js.map +1 -0
- package/lib/commands/{project/retrieve/start.d.ts → retrieve/metadata.d.ts} +1 -3
- package/lib/commands/{project/retrieve/start.js → retrieve/metadata.js} +8 -11
- package/lib/commands/retrieve/metadata.js.map +1 -0
- package/lib/utils/conflicts.js +1 -1
- package/lib/utils/conflicts.js.map +1 -1
- package/lib/utils/deploy.d.ts +5 -9
- package/lib/utils/deploy.js +24 -21
- package/lib/utils/deploy.js.map +1 -1
- package/lib/utils/deployCache.d.ts +2 -8
- package/lib/utils/deployCache.js +2 -11
- package/lib/utils/deployCache.js.map +1 -1
- package/lib/utils/errorCodes.d.ts +1 -3
- package/lib/utils/errorCodes.js +4 -4
- package/lib/utils/errorCodes.js.map +1 -1
- package/lib/utils/flags.js +8 -3
- package/lib/utils/flags.js.map +1 -1
- package/lib/utils/metadataDeployer.js +2 -3
- package/lib/utils/metadataDeployer.js.map +1 -1
- package/lib/utils/output.d.ts +83 -6
- package/lib/utils/output.js +385 -3
- package/lib/utils/output.js.map +1 -1
- package/lib/utils/previewOutput.d.ts +0 -1
- package/lib/utils/previewOutput.js +14 -4
- package/lib/utils/previewOutput.js.map +1 -1
- package/lib/utils/types.d.ts +0 -39
- package/lib/utils/types.js +1 -3
- package/lib/utils/types.js.map +1 -1
- package/messages/deploy.async.md +3 -3
- package/messages/deploy.md +1 -5
- package/messages/deploy.metadata.cancel.md +6 -10
- package/messages/deploy.metadata.md +5 -33
- package/messages/deploy.metadata.preview.md +3 -7
- package/messages/deploy.metadata.quick.md +3 -11
- package/messages/deploy.metadata.report.md +4 -24
- package/messages/deploy.metadata.resume.md +5 -17
- package/messages/deploy.metadata.validate.md +5 -9
- package/messages/retrieve.metadata.md +1 -1
- package/messages/retrieve.metadata.preview.md +3 -3
- package/oclif.manifest.json +446 -1486
- package/package.json +39 -54
- package/lib/commands/project/convert/mdapi.d.ts +0 -32
- package/lib/commands/project/convert/mdapi.js +0 -170
- package/lib/commands/project/convert/mdapi.js.map +0 -1
- package/lib/commands/project/convert/source.d.ts +0 -29
- package/lib/commands/project/convert/source.js +0 -141
- package/lib/commands/project/convert/source.js.map +0 -1
- package/lib/commands/project/delete/source.d.ts +0 -69
- package/lib/commands/project/delete/source.js +0 -424
- package/lib/commands/project/delete/source.js.map +0 -1
- package/lib/commands/project/delete/tracking.d.ts +0 -19
- package/lib/commands/project/delete/tracking.js +0 -49
- package/lib/commands/project/delete/tracking.js.map +0 -1
- package/lib/commands/project/deploy/cancel.js.map +0 -1
- package/lib/commands/project/deploy/preview.js.map +0 -1
- package/lib/commands/project/deploy/quick.js.map +0 -1
- package/lib/commands/project/deploy/report.d.ts +0 -22
- package/lib/commands/project/deploy/report.js.map +0 -1
- package/lib/commands/project/deploy/resume.js.map +0 -1
- package/lib/commands/project/deploy/start.js.map +0 -1
- package/lib/commands/project/deploy/validate.js.map +0 -1
- package/lib/commands/project/list/ignored.d.ts +0 -24
- package/lib/commands/project/list/ignored.js +0 -85
- package/lib/commands/project/list/ignored.js.map +0 -1
- package/lib/commands/project/manifest/create.d.ts +0 -26
- package/lib/commands/project/manifest/create.js +0 -133
- package/lib/commands/project/manifest/create.js.map +0 -1
- package/lib/commands/project/reset/tracking.d.ts +0 -21
- package/lib/commands/project/reset/tracking.js +0 -64
- package/lib/commands/project/reset/tracking.js.map +0 -1
- package/lib/commands/project/retrieve/preview.js.map +0 -1
- package/lib/commands/project/retrieve/start.js.map +0 -1
- package/lib/formatters/asyncDeployCancelResultFormatter.d.ts +0 -9
- package/lib/formatters/asyncDeployCancelResultFormatter.js +0 -28
- package/lib/formatters/asyncDeployCancelResultFormatter.js.map +0 -1
- package/lib/formatters/asyncDeployResultFormatter.d.ts +0 -9
- package/lib/formatters/asyncDeployResultFormatter.js +0 -30
- package/lib/formatters/asyncDeployResultFormatter.js.map +0 -1
- package/lib/formatters/deleteResultFormatter.d.ts +0 -13
- package/lib/formatters/deleteResultFormatter.js +0 -72
- package/lib/formatters/deleteResultFormatter.js.map +0 -1
- package/lib/formatters/deployCancelResultFormatter.d.ts +0 -8
- package/lib/formatters/deployCancelResultFormatter.js +0 -29
- package/lib/formatters/deployCancelResultFormatter.js.map +0 -1
- package/lib/formatters/deployReportResultFormatter.d.ts +0 -4
- package/lib/formatters/deployReportResultFormatter.js +0 -52
- package/lib/formatters/deployReportResultFormatter.js.map +0 -1
- package/lib/formatters/deployResultFormatter.d.ts +0 -46
- package/lib/formatters/deployResultFormatter.js +0 -296
- package/lib/formatters/deployResultFormatter.js.map +0 -1
- package/lib/formatters/metadataConvertResultFormatter.d.ts +0 -9
- package/lib/formatters/metadataConvertResultFormatter.js +0 -59
- package/lib/formatters/metadataConvertResultFormatter.js.map +0 -1
- package/lib/formatters/metadataRetrieveResultFormatter.d.ts +0 -17
- package/lib/formatters/metadataRetrieveResultFormatter.js +0 -38
- package/lib/formatters/metadataRetrieveResultFormatter.js.map +0 -1
- package/lib/formatters/retrieveResultFormatter.d.ts +0 -13
- package/lib/formatters/retrieveResultFormatter.js +0 -66
- package/lib/formatters/retrieveResultFormatter.js.map +0 -1
- package/lib/formatters/sourceConvertResultFormatter.d.ts +0 -10
- package/lib/formatters/sourceConvertResultFormatter.js +0 -37
- package/lib/formatters/sourceConvertResultFormatter.js.map +0 -1
- package/lib/utils/coverage.d.ts +0 -9
- package/lib/utils/coverage.js +0 -109
- package/lib/utils/coverage.js.map +0 -1
- package/lib/utils/manifestCache.d.ts +0 -5
- package/lib/utils/manifestCache.js +0 -38
- package/lib/utils/manifestCache.js.map +0 -1
- package/messages/convert.mdapi.md +0 -66
- package/messages/convert.source.md +0 -63
- package/messages/delete.source.md +0 -134
- package/messages/delete.tracking.md +0 -39
- package/messages/list.ignored.md +0 -17
- package/messages/manifest.create.md +0 -72
- package/schemas/project-convert-mdapi.json +0 -29
- package/schemas/project-delete-source.json +0 -609
- package/schemas/project-delete-tracking.json +0 -19
- package/schemas/project-list-ignored.json +0 -19
- package/schemas/project-manifest-create.json +0 -19
- package/schemas/project-reset-tracking.json +0 -19
- /package/schemas/{project-deploy-cancel.json → deploy-metadata-cancel.json} +0 -0
- /package/schemas/{project-deploy-preview.json → deploy-metadata-preview.json} +0 -0
- /package/schemas/{project-deploy-quick.json → deploy-metadata-quick.json} +0 -0
- /package/schemas/{project-deploy-report.json → deploy-metadata-report.json} +0 -0
- /package/schemas/{project-deploy-resume.json → deploy-metadata-resume.json} +0 -0
- /package/schemas/{project-deploy-start.json → deploy-metadata-validate.json} +0 -0
- /package/schemas/{project-deploy-validate.json → deploy-metadata.json} +0 -0
- /package/schemas/{project-retrieve-preview.json → retrieve-metadata-preview.json} +0 -0
- /package/schemas/{project-retrieve-start.json → retrieve-metadata.json} +0 -0
package/package.json
CHANGED
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salesforce/plugin-deploy-retrieve",
|
|
3
3
|
"description": "deploy and retrieve commands for sf",
|
|
4
|
-
"version": "1.8.
|
|
4
|
+
"version": "1.8.6",
|
|
5
5
|
"author": "Salesforce",
|
|
6
6
|
"bugs": "https://github.com/forcedotcom/cli/issues",
|
|
7
7
|
"dependencies": {
|
|
8
8
|
"@oclif/core": "^2.6.4",
|
|
9
|
-
"@salesforce/
|
|
10
|
-
"@salesforce/
|
|
11
|
-
"@salesforce/
|
|
12
|
-
"@salesforce/sf-plugins-core": "^2.2.5",
|
|
9
|
+
"@salesforce/core": "^3.33.6",
|
|
10
|
+
"@salesforce/kit": "^1.9.0",
|
|
11
|
+
"@salesforce/sf-plugins-core": "^2.2.3",
|
|
13
12
|
"@salesforce/source-deploy-retrieve": "^7.13.0",
|
|
14
13
|
"@salesforce/source-tracking": "^2.2.22",
|
|
15
14
|
"chalk": "^4.1.2",
|
|
@@ -18,25 +17,27 @@
|
|
|
18
17
|
"tslib": "^2"
|
|
19
18
|
},
|
|
20
19
|
"devDependencies": {
|
|
21
|
-
"@oclif/plugin-command-snapshot": "^3.
|
|
22
|
-
"@salesforce/cli-plugins-testkit": "^3.
|
|
20
|
+
"@oclif/plugin-command-snapshot": "^3.2.16",
|
|
21
|
+
"@salesforce/cli-plugins-testkit": "^3.3.0",
|
|
23
22
|
"@salesforce/dev-config": "^3.1.0",
|
|
24
|
-
"@salesforce/dev-scripts": "^4.1.
|
|
23
|
+
"@salesforce/dev-scripts": "^4.1.2",
|
|
25
24
|
"@salesforce/plugin-command-reference": "^2.4.1",
|
|
26
|
-
"@salesforce/plugin-
|
|
27
|
-
"@salesforce/plugin-
|
|
28
|
-
"@salesforce/plugin-source": "^2.
|
|
25
|
+
"@salesforce/plugin-config": "^2.3.3",
|
|
26
|
+
"@salesforce/plugin-functions": "^1.21.6",
|
|
27
|
+
"@salesforce/plugin-source": "^2.6.0",
|
|
29
28
|
"@salesforce/plugin-templates": "^55.4.4",
|
|
30
29
|
"@salesforce/plugin-user": "^2.3.3",
|
|
31
30
|
"@salesforce/prettier-config": "^0.0.2",
|
|
32
|
-
"@salesforce/source-testkit": "^2.0.
|
|
31
|
+
"@salesforce/source-testkit": "^2.0.42",
|
|
33
32
|
"@salesforce/ts-sinon": "1.4.4",
|
|
34
33
|
"@salesforce/ts-types": "^1.5.20",
|
|
35
34
|
"@swc/core": "^1.3.37",
|
|
35
|
+
"@types/archiver": "^5.3.1",
|
|
36
36
|
"@types/fs-extra": "^9.0.13",
|
|
37
37
|
"@types/shelljs": "^0.8.11",
|
|
38
|
-
"@typescript-eslint/eslint-plugin": "^5.
|
|
39
|
-
"@typescript-eslint/parser": "^5.
|
|
38
|
+
"@typescript-eslint/eslint-plugin": "^5.56.0",
|
|
39
|
+
"@typescript-eslint/parser": "^5.54.0",
|
|
40
|
+
"archiver": "^5.3.1",
|
|
40
41
|
"chai": "^4.3.7",
|
|
41
42
|
"cross-env": "^7.0.3",
|
|
42
43
|
"eslint": "^8.35.0",
|
|
@@ -45,11 +46,10 @@
|
|
|
45
46
|
"eslint-config-salesforce-license": "^0.1.6",
|
|
46
47
|
"eslint-config-salesforce-typescript": "^1.1.1",
|
|
47
48
|
"eslint-plugin-header": "^3.1.1",
|
|
48
|
-
"eslint-plugin-import": "^2.
|
|
49
|
-
"eslint-plugin-jsdoc": "^39.
|
|
50
|
-
"eslint-plugin-sf-plugin": "^1.
|
|
49
|
+
"eslint-plugin-import": "^2.26.0",
|
|
50
|
+
"eslint-plugin-jsdoc": "^39.9.1",
|
|
51
|
+
"eslint-plugin-sf-plugin": "^1.9.2",
|
|
51
52
|
"husky": "^7.0.4",
|
|
52
|
-
"jsforce": "^2.0.0-beta.20",
|
|
53
53
|
"mocha": "^10.1.0",
|
|
54
54
|
"nyc": "^15.1.0",
|
|
55
55
|
"oclif": "^3.7.0",
|
|
@@ -93,36 +93,26 @@
|
|
|
93
93
|
"@oclif/plugin-command-snapshot",
|
|
94
94
|
"@oclif/plugin-help",
|
|
95
95
|
"@salesforce/plugin-command-reference",
|
|
96
|
-
"@salesforce/plugin-
|
|
96
|
+
"@salesforce/plugin-config",
|
|
97
97
|
"@salesforce/plugin-functions",
|
|
98
98
|
"@salesforce/plugin-source",
|
|
99
99
|
"@salesforce/plugin-user",
|
|
100
100
|
"@salesforce/plugin-templates"
|
|
101
101
|
],
|
|
102
102
|
"topics": {
|
|
103
|
-
"
|
|
104
|
-
"description": "Commands to deploy
|
|
103
|
+
"deploy": {
|
|
104
|
+
"description": "Commands to deploy artifacts to an environment.",
|
|
105
105
|
"subtopics": {
|
|
106
|
-
"
|
|
106
|
+
"metadata": {
|
|
107
107
|
"description": "Commands to deploy metadata to a Salesforce org."
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
"description": "Commands to convert metadata from one format to another."
|
|
117
|
-
},
|
|
118
|
-
"delete": {
|
|
119
|
-
"description": "Commands to delete metadata from a Salesforce org."
|
|
120
|
-
},
|
|
121
|
-
"manifest": {
|
|
122
|
-
"description": "Commands to create a manifest file."
|
|
123
|
-
},
|
|
124
|
-
"reset": {
|
|
125
|
-
"description": "Commands to reset the source tracking state."
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
},
|
|
111
|
+
"retrieve": {
|
|
112
|
+
"description": "Commands to retrieve artifacts from an environment.",
|
|
113
|
+
"subtopics": {
|
|
114
|
+
"metadata": {
|
|
115
|
+
"description": "Commands to retrieve metadata from a Salesforce org."
|
|
126
116
|
}
|
|
127
117
|
}
|
|
128
118
|
}
|
|
@@ -143,18 +133,12 @@
|
|
|
143
133
|
"prepare": "sf-install",
|
|
144
134
|
"test": "wireit",
|
|
145
135
|
"test:nuts": "ts-node ./test/nuts/generateNuts.ts && nyc mocha \"**/*.nut.ts\" --slow 4500 --timeout 1200000 --parallel --retries 0 --jobs 10",
|
|
146
|
-
"test:nuts:convert": "nyc mocha \"test/nuts/convert/*.nut.ts\" --slow 4500 --timeout 1200000 --parallel --retries 0 --jobs 20",
|
|
147
|
-
"test:nuts:delete": "nyc mocha \"test/nuts/delete/*.nut.ts\" --slow 4500 --timeout 1200000 --parallel --retries 0 --jobs 20",
|
|
148
136
|
"test:nuts:deploy:metadata:manifest": "cross-env PLUGIN_DEPLOY_RETRIEVE_SEED_FILTER=deploy.metadata.manifest ts-node ./test/nuts/generateNuts.ts && mocha \"test/nuts/generated/*.nut.ts\" --slow 4500 --timeout 1200000 --parallel --retries 0 --jobs 20",
|
|
149
137
|
"test:nuts:deploy:metadata:metadata": "cross-env PLUGIN_DEPLOY_RETRIEVE_SEED_FILTER=deploy.metadata.metadata ts-node ./test/nuts/generateNuts.ts && mocha \"test/nuts/generated/*.nut.ts\" --slow 4500 --timeout 1200000 --parallel --retries 0 --jobs 20",
|
|
150
138
|
"test:nuts:deploy:metadata:metadata-dir": "cross-env PLUGIN_DEPLOY_RETRIEVE_SEED_FILTER=deploy.metadata.metadata-dir ts-node ./test/nuts/generateNuts.ts && mocha \"test/nuts/generated/*.nut.ts\" --slow 4500 --timeout 1200000 --parallel --retries 0 --jobs 20",
|
|
151
139
|
"test:nuts:deploy:metadata:source-dir": "cross-env PLUGIN_DEPLOY_RETRIEVE_SEED_FILTER=deploy.metadata.source-dir ts-node ./test/nuts/generateNuts.ts && mocha \"test/nuts/generated/*.nut.ts\" --slow 4500 --timeout 1200000 --parallel --retries 0 --jobs 20",
|
|
152
140
|
"test:nuts:deploy:metadata:test-level": "cross-env PLUGIN_DEPLOY_RETRIEVE_SEED_FILTER=deploy.metadata.test-level ts-node ./test/nuts/generateNuts.ts && mocha \"test/nuts/generated/*.nut.ts\" --slow 4500 --timeout 1200000 --parallel --retries 0 --jobs 20",
|
|
153
|
-
"test:nuts:
|
|
154
|
-
"test:nuts:manifest": "nyc mocha \"test/nuts/manifest/*.nut.ts\" --slow 4500 --timeout 1200000 --parallel --retries 0 --jobs 20",
|
|
155
|
-
"test:nuts:retrieve": "nyc mocha \"test/nuts/retrieve/*.nut.ts\" --slow 4500 --timeout 1200000 --parallel --retries 0 --jobs 20",
|
|
156
|
-
"test:nuts:specialTypes": "nyc mocha \"test/nuts/specialTypes/*.nut.ts\" --slow 4500 --timeout 1200000 --parallel --retries 0 --jobs 20",
|
|
157
|
-
"test:nuts:static": "nyc mocha \"test/commands/**/*.nut.ts\" \"test/nuts/*.nut.ts\" --slow 4500 --timeout 1200000 --parallel --retries 0 --jobs 20",
|
|
141
|
+
"test:nuts:static": "nyc mocha \"test/commands/**/*.nut.ts\" --slow 4500 --timeout 1200000 --parallel --retries 0 --jobs 20",
|
|
158
142
|
"test:nuts:tracking": "nyc mocha \"test/nuts/tracking/*.nut.ts\" --slow 4500 --timeout 1200000 --parallel --retries 0 --jobs 20",
|
|
159
143
|
"test:only": "wireit",
|
|
160
144
|
"version": "oclif readme"
|
|
@@ -174,7 +158,7 @@
|
|
|
174
158
|
"command": "tsc -p . --pretty --incremental",
|
|
175
159
|
"files": [
|
|
176
160
|
"src/**/*.ts",
|
|
177
|
-
"
|
|
161
|
+
"tsconfig.json",
|
|
178
162
|
"messages/**"
|
|
179
163
|
],
|
|
180
164
|
"output": [
|
|
@@ -200,8 +184,7 @@
|
|
|
200
184
|
"src/**/*.ts",
|
|
201
185
|
"test/**/*.ts",
|
|
202
186
|
"messages/**",
|
|
203
|
-
"
|
|
204
|
-
"**/tsconfig.json"
|
|
187
|
+
".eslint*"
|
|
205
188
|
],
|
|
206
189
|
"output": []
|
|
207
190
|
},
|
|
@@ -209,7 +192,8 @@
|
|
|
209
192
|
"command": "tsc -p \"./test\" --pretty",
|
|
210
193
|
"files": [
|
|
211
194
|
"test/**/*.ts",
|
|
212
|
-
"
|
|
195
|
+
"tsconfig.json",
|
|
196
|
+
"test/tsconfig.json"
|
|
213
197
|
],
|
|
214
198
|
"output": []
|
|
215
199
|
},
|
|
@@ -231,8 +215,9 @@
|
|
|
231
215
|
"files": [
|
|
232
216
|
"test/**/*.ts",
|
|
233
217
|
"src/**/*.ts",
|
|
234
|
-
"
|
|
218
|
+
"tsconfig.json",
|
|
235
219
|
".mocha*",
|
|
220
|
+
"test/tsconfig.json",
|
|
236
221
|
"!*.nut.ts",
|
|
237
222
|
".nycrc"
|
|
238
223
|
],
|
|
@@ -269,7 +254,7 @@
|
|
|
269
254
|
}
|
|
270
255
|
},
|
|
271
256
|
"sfdx": {
|
|
272
|
-
"publicKeyUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-deploy-retrieve/1.8.
|
|
273
|
-
"signatureUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-deploy-retrieve/1.8.
|
|
257
|
+
"publicKeyUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-deploy-retrieve/1.8.6.crt",
|
|
258
|
+
"signatureUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-deploy-retrieve/1.8.6.sig"
|
|
274
259
|
}
|
|
275
260
|
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { SfCommand } from '@salesforce/sf-plugins-core';
|
|
2
|
-
import { Interfaces } from '@oclif/core';
|
|
3
|
-
import { ConvertMdapiJson } from '../../../utils/types';
|
|
4
|
-
export interface EnsureFsFlagOptions {
|
|
5
|
-
flagName: string;
|
|
6
|
-
path: string;
|
|
7
|
-
type: 'dir' | 'file' | 'any';
|
|
8
|
-
throwOnENOENT?: boolean;
|
|
9
|
-
}
|
|
10
|
-
export declare class Mdapi extends SfCommand<ConvertMdapiJson> {
|
|
11
|
-
static readonly aliases: string[];
|
|
12
|
-
static readonly deprecateAliases = true;
|
|
13
|
-
static readonly summary: string;
|
|
14
|
-
static readonly description: string;
|
|
15
|
-
static readonly examples: string[];
|
|
16
|
-
static readonly requiresProject = true;
|
|
17
|
-
static readonly flags: {
|
|
18
|
-
'api-version': Interfaces.OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
19
|
-
loglevel: Interfaces.OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
20
|
-
'root-dir': Interfaces.OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
21
|
-
'output-dir': Interfaces.OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
22
|
-
manifest: Interfaces.OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
23
|
-
'metadata-dir': Interfaces.OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
24
|
-
metadata: Interfaces.OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
25
|
-
};
|
|
26
|
-
private flags;
|
|
27
|
-
private componentSet?;
|
|
28
|
-
private convertResult?;
|
|
29
|
-
run(): Promise<ConvertMdapiJson>;
|
|
30
|
-
protected convert(): Promise<void>;
|
|
31
|
-
protected formatResult(): ConvertMdapiJson;
|
|
32
|
-
}
|
|
@@ -1,170 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*
|
|
3
|
-
* Copyright (c) 2020, salesforce.com, inc.
|
|
4
|
-
* All rights reserved.
|
|
5
|
-
* Licensed under the BSD 3-Clause license.
|
|
6
|
-
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
|
7
|
-
*/
|
|
8
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.Mdapi = void 0;
|
|
10
|
-
const path_1 = require("path");
|
|
11
|
-
const fs = require("fs");
|
|
12
|
-
const core_1 = require("@salesforce/core");
|
|
13
|
-
const source_deploy_retrieve_1 = require("@salesforce/source-deploy-retrieve");
|
|
14
|
-
const sf_plugins_core_1 = require("@salesforce/sf-plugins-core");
|
|
15
|
-
const metadataConvertResultFormatter_1 = require("../../../formatters/metadataConvertResultFormatter");
|
|
16
|
-
core_1.Messages.importMessagesDirectory(__dirname);
|
|
17
|
-
const messages = core_1.Messages.loadMessages('@salesforce/plugin-deploy-retrieve', 'convert.mdapi');
|
|
18
|
-
class Mdapi extends sf_plugins_core_1.SfCommand {
|
|
19
|
-
async run() {
|
|
20
|
-
this.flags = (await this.parse(Mdapi)).flags;
|
|
21
|
-
await this.convert();
|
|
22
|
-
return this.formatResult();
|
|
23
|
-
}
|
|
24
|
-
async convert() {
|
|
25
|
-
const [outputDir] = await Promise.all([
|
|
26
|
-
resolveOutputDir(this.flags['output-dir'] ?? this.project.getDefaultPackage().path),
|
|
27
|
-
resolveMetadataPaths(this.flags['metadata-dir'] ?? []),
|
|
28
|
-
]);
|
|
29
|
-
let paths = [];
|
|
30
|
-
if (this.flags['metadata-dir']) {
|
|
31
|
-
paths = this.flags['metadata-dir'];
|
|
32
|
-
}
|
|
33
|
-
else if (!this.flags.manifest && !this.flags.metadata) {
|
|
34
|
-
paths = [this.flags['root-dir']];
|
|
35
|
-
}
|
|
36
|
-
this.componentSet = await source_deploy_retrieve_1.ComponentSetBuilder.build({
|
|
37
|
-
sourcepath: paths,
|
|
38
|
-
manifest: this.flags.manifest
|
|
39
|
-
? {
|
|
40
|
-
manifestPath: this.flags.manifest,
|
|
41
|
-
directoryPaths: [this.flags['root-dir']],
|
|
42
|
-
}
|
|
43
|
-
: undefined,
|
|
44
|
-
metadata: this.flags.metadata
|
|
45
|
-
? {
|
|
46
|
-
metadataEntries: this.flags.metadata,
|
|
47
|
-
directoryPaths: [this.flags['root-dir']],
|
|
48
|
-
}
|
|
49
|
-
: undefined,
|
|
50
|
-
});
|
|
51
|
-
const numOfComponents = this.componentSet.getSourceComponents().toArray().length;
|
|
52
|
-
if (numOfComponents > 0) {
|
|
53
|
-
this.spinner.start(`Converting ${numOfComponents} metadata components`);
|
|
54
|
-
const converter = new source_deploy_retrieve_1.MetadataConverter();
|
|
55
|
-
this.convertResult = await converter.convert(this.componentSet, 'source', {
|
|
56
|
-
type: 'directory',
|
|
57
|
-
outputDirectory: outputDir,
|
|
58
|
-
genUniqueDir: false,
|
|
59
|
-
});
|
|
60
|
-
this.spinner.stop();
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
formatResult() {
|
|
64
|
-
if (!this.convertResult) {
|
|
65
|
-
throw new core_1.SfError('No results to format');
|
|
66
|
-
}
|
|
67
|
-
const formatter = new metadataConvertResultFormatter_1.MetadataConvertResultFormatter(this.convertResult);
|
|
68
|
-
if (!this.jsonEnabled()) {
|
|
69
|
-
formatter.display();
|
|
70
|
-
}
|
|
71
|
-
return formatter.getJson();
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
exports.Mdapi = Mdapi;
|
|
75
|
-
Mdapi.aliases = ['force:mdapi:beta:convert', 'force:mdapi:convert'];
|
|
76
|
-
Mdapi.deprecateAliases = true;
|
|
77
|
-
Mdapi.summary = messages.getMessage('summary');
|
|
78
|
-
Mdapi.description = messages.getMessage('description');
|
|
79
|
-
Mdapi.examples = messages.getMessages('examples');
|
|
80
|
-
Mdapi.requiresProject = true;
|
|
81
|
-
Mdapi.flags = {
|
|
82
|
-
'api-version': sf_plugins_core_1.orgApiVersionFlagWithDeprecations,
|
|
83
|
-
loglevel: sf_plugins_core_1.loglevel,
|
|
84
|
-
'root-dir': sf_plugins_core_1.Flags.directory({
|
|
85
|
-
aliases: ['rootdir'],
|
|
86
|
-
deprecateAliases: true,
|
|
87
|
-
char: 'r',
|
|
88
|
-
summary: messages.getMessage('flags.root-dir.summary'),
|
|
89
|
-
required: true,
|
|
90
|
-
exists: true,
|
|
91
|
-
}),
|
|
92
|
-
'output-dir': sf_plugins_core_1.Flags.directory({
|
|
93
|
-
aliases: ['outputdir'],
|
|
94
|
-
deprecateAliases: true,
|
|
95
|
-
char: 'd',
|
|
96
|
-
summary: messages.getMessage('flags.output-dir.summary'),
|
|
97
|
-
}),
|
|
98
|
-
manifest: sf_plugins_core_1.Flags.file({
|
|
99
|
-
char: 'x',
|
|
100
|
-
description: messages.getMessage('flags.manifest.description'),
|
|
101
|
-
summary: messages.getMessage('flags.manifest.summary'),
|
|
102
|
-
exists: true,
|
|
103
|
-
}),
|
|
104
|
-
'metadata-dir': (0, sf_plugins_core_1.arrayWithDeprecation)({
|
|
105
|
-
char: 'p',
|
|
106
|
-
aliases: ['metadatapath'],
|
|
107
|
-
deprecateAliases: true,
|
|
108
|
-
description: messages.getMessage('flags.metadata-dir.description'),
|
|
109
|
-
summary: messages.getMessage('flags.metadata-dir.summary'),
|
|
110
|
-
exclusive: ['manifest', 'metadata'],
|
|
111
|
-
}),
|
|
112
|
-
metadata: (0, sf_plugins_core_1.arrayWithDeprecation)({
|
|
113
|
-
char: 'm',
|
|
114
|
-
summary: messages.getMessage('flags.metadata.summary'),
|
|
115
|
-
exclusive: ['manifest', 'metadatapath'],
|
|
116
|
-
}),
|
|
117
|
-
};
|
|
118
|
-
const resolveOutputDir = async (outputDir) => ensureFlagPath({
|
|
119
|
-
flagName: 'outputdir',
|
|
120
|
-
path: outputDir,
|
|
121
|
-
type: 'dir',
|
|
122
|
-
});
|
|
123
|
-
const resolveMetadataPaths = async (metadataPaths) => Promise.all(metadataPaths
|
|
124
|
-
.filter((mdPath) => mdPath?.length)
|
|
125
|
-
.map((mdPath) => ensureFlagPath({
|
|
126
|
-
flagName: 'metadatapath',
|
|
127
|
-
path: mdPath,
|
|
128
|
-
type: 'any',
|
|
129
|
-
throwOnENOENT: true,
|
|
130
|
-
})));
|
|
131
|
-
/**
|
|
132
|
-
* Ensures command flags that are file system paths are set properly before
|
|
133
|
-
* continuing command execution. Can also create directories that don't yet
|
|
134
|
-
* exist in the path.
|
|
135
|
-
*
|
|
136
|
-
* @param options defines the path to resolve and the expectations
|
|
137
|
-
* @returns the resolved flag path
|
|
138
|
-
*/
|
|
139
|
-
const ensureFlagPath = async (options) => {
|
|
140
|
-
const { flagName, path, type, throwOnENOENT } = options;
|
|
141
|
-
const resolvedPath = (0, path_1.resolve)(path?.trim());
|
|
142
|
-
try {
|
|
143
|
-
const stats = await fs.promises.stat(resolvedPath);
|
|
144
|
-
if (type !== 'any') {
|
|
145
|
-
const isDir = stats.isDirectory();
|
|
146
|
-
if (type === 'dir' && !isDir) {
|
|
147
|
-
throw messages.createError('InvalidFlagPath', [flagName, path, messages.getMessage('expectedDirectory')]);
|
|
148
|
-
}
|
|
149
|
-
else if (type === 'file' && isDir) {
|
|
150
|
-
throw messages.createError(messages.getMessage('InvalidFlagPath', [flagName, path, messages.getMessage('expectedFile')]));
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
return resolvedPath;
|
|
154
|
-
}
|
|
155
|
-
catch (error) {
|
|
156
|
-
if (error instanceof Error && 'code' in error && error.code !== 'ENOENT') {
|
|
157
|
-
throw error;
|
|
158
|
-
}
|
|
159
|
-
else {
|
|
160
|
-
if (throwOnENOENT) {
|
|
161
|
-
const enoent = messages.getMessage('notFound');
|
|
162
|
-
throw new core_1.SfError(messages.getMessage('InvalidFlagPath', [flagName, path, enoent]), 'InvalidFlagPath');
|
|
163
|
-
}
|
|
164
|
-
const dir = type === 'dir' ? resolvedPath : (0, path_1.dirname)(resolvedPath);
|
|
165
|
-
// using as because fs promises always returns a string when recursive is true
|
|
166
|
-
return fs.promises.mkdir(dir, { recursive: true });
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
};
|
|
170
|
-
//# sourceMappingURL=m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AO,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAoB,CAAC;SACvE;KACF;AACH,CAAC,CAAC"}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { ConvertResult } from '@salesforce/source-deploy-retrieve';
|
|
2
|
-
import { SfCommand } from '@salesforce/sf-plugins-core';
|
|
3
|
-
import { Interfaces } from '@oclif/core';
|
|
4
|
-
import { ConvertResultJson } from '../../../utils/types';
|
|
5
|
-
export declare class Source extends SfCommand<ConvertResultJson> {
|
|
6
|
-
static readonly summary: string;
|
|
7
|
-
static readonly description: string;
|
|
8
|
-
static readonly examples: string[];
|
|
9
|
-
static readonly requiresProject = true;
|
|
10
|
-
static readonly aliases: string[];
|
|
11
|
-
static readonly deprecateAliases = true;
|
|
12
|
-
static readonly flags: {
|
|
13
|
-
'api-version': Interfaces.OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
14
|
-
loglevel: Interfaces.OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
15
|
-
'root-dir': Interfaces.OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
16
|
-
'output-dir': Interfaces.OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
17
|
-
'package-name': Interfaces.OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
18
|
-
manifest: Interfaces.OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
19
|
-
'source-dir': Interfaces.OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
20
|
-
metadata: Interfaces.OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
21
|
-
};
|
|
22
|
-
protected convertResult: ConvertResult;
|
|
23
|
-
private flags;
|
|
24
|
-
private componentSet;
|
|
25
|
-
run(): Promise<ConvertResultJson>;
|
|
26
|
-
protected convert(): Promise<void>;
|
|
27
|
-
protected resolveSuccess(): void;
|
|
28
|
-
protected formatResult(): ConvertResultJson;
|
|
29
|
-
}
|
|
@@ -1,141 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*
|
|
3
|
-
* Copyright (c) 2020, salesforce.com, inc.
|
|
4
|
-
* All rights reserved.
|
|
5
|
-
* Licensed under the BSD 3-Clause license.
|
|
6
|
-
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
|
7
|
-
*/
|
|
8
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.Source = void 0;
|
|
10
|
-
const path_1 = require("path");
|
|
11
|
-
const fs = require("fs");
|
|
12
|
-
const core_1 = require("@salesforce/core");
|
|
13
|
-
const source_deploy_retrieve_1 = require("@salesforce/source-deploy-retrieve");
|
|
14
|
-
const ts_types_1 = require("@salesforce/ts-types");
|
|
15
|
-
const sf_plugins_core_1 = require("@salesforce/sf-plugins-core");
|
|
16
|
-
const project_1 = require("../../../utils/project");
|
|
17
|
-
const sourceConvertResultFormatter_1 = require("../../../formatters/sourceConvertResultFormatter");
|
|
18
|
-
core_1.Messages.importMessagesDirectory(__dirname);
|
|
19
|
-
const messages = core_1.Messages.loadMessages('@salesforce/plugin-deploy-retrieve', 'convert.source');
|
|
20
|
-
class Source extends sf_plugins_core_1.SfCommand {
|
|
21
|
-
async run() {
|
|
22
|
-
this.flags = (await this.parse(Source)).flags;
|
|
23
|
-
await this.convert();
|
|
24
|
-
this.resolveSuccess();
|
|
25
|
-
return this.formatResult();
|
|
26
|
-
}
|
|
27
|
-
async convert() {
|
|
28
|
-
const paths = [];
|
|
29
|
-
const { metadata, manifest } = this.flags;
|
|
30
|
-
const sourcepath = this.flags['source-dir'];
|
|
31
|
-
const rootdir = this.flags['root-dir'];
|
|
32
|
-
if (sourcepath) {
|
|
33
|
-
paths.push(...sourcepath);
|
|
34
|
-
}
|
|
35
|
-
// rootdir behaves exclusively to sourcepath, metadata, and manifest... to maintain backwards compatibility
|
|
36
|
-
// we will check here, instead of adding the exclusive option to the flag definition so we don't break scripts
|
|
37
|
-
if (rootdir && !sourcepath && !metadata && !manifest && typeof rootdir === 'string') {
|
|
38
|
-
// only rootdir option passed
|
|
39
|
-
paths.push(rootdir);
|
|
40
|
-
}
|
|
41
|
-
// no options passed, convert the default package (usually force-app)
|
|
42
|
-
if (!sourcepath && !metadata && !manifest && !rootdir) {
|
|
43
|
-
paths.push(this.project.getDefaultPackage().path);
|
|
44
|
-
}
|
|
45
|
-
this.componentSet = await source_deploy_retrieve_1.ComponentSetBuilder.build({
|
|
46
|
-
sourceapiversion: await (0, project_1.getSourceApiVersion)(),
|
|
47
|
-
sourcepath: paths,
|
|
48
|
-
manifest: manifest
|
|
49
|
-
? {
|
|
50
|
-
manifestPath: manifest,
|
|
51
|
-
directoryPaths: await (0, project_1.getPackageDirs)(),
|
|
52
|
-
}
|
|
53
|
-
: undefined,
|
|
54
|
-
metadata: metadata
|
|
55
|
-
? {
|
|
56
|
-
metadataEntries: metadata,
|
|
57
|
-
directoryPaths: await (0, project_1.getPackageDirs)(),
|
|
58
|
-
}
|
|
59
|
-
: undefined,
|
|
60
|
-
});
|
|
61
|
-
const packageName = this.flags['package-name'];
|
|
62
|
-
const outputDirectory = (0, path_1.resolve)(this.flags['output-dir']);
|
|
63
|
-
const converter = new source_deploy_retrieve_1.MetadataConverter();
|
|
64
|
-
this.convertResult = await converter.convert(this.componentSet, 'metadata', {
|
|
65
|
-
type: 'directory',
|
|
66
|
-
outputDirectory,
|
|
67
|
-
packageName,
|
|
68
|
-
genUniqueDir: false,
|
|
69
|
-
});
|
|
70
|
-
if (packageName && this.convertResult.packagePath) {
|
|
71
|
-
// SDR will build an output path like /output/directory/packageName/package.xml
|
|
72
|
-
// this was breaking from toolbelt, so to revert it we copy the directory up a level and delete the original
|
|
73
|
-
fs.cpSync(this.convertResult.packagePath, outputDirectory);
|
|
74
|
-
fs.rmSync(this.convertResult.packagePath, { recursive: true });
|
|
75
|
-
this.convertResult.packagePath = outputDirectory;
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
resolveSuccess() {
|
|
79
|
-
if (!(0, ts_types_1.getString)(this.convertResult, 'packagePath')) {
|
|
80
|
-
process.exitCode = 1;
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
formatResult() {
|
|
84
|
-
const formatter = new sourceConvertResultFormatter_1.SourceConvertResultFormatter(this.convertResult);
|
|
85
|
-
if (!this.jsonEnabled()) {
|
|
86
|
-
formatter.display();
|
|
87
|
-
}
|
|
88
|
-
return formatter.getJson();
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
exports.Source = Source;
|
|
92
|
-
Source.summary = messages.getMessage('summary');
|
|
93
|
-
Source.description = messages.getMessage('description');
|
|
94
|
-
Source.examples = messages.getMessages('examples');
|
|
95
|
-
Source.requiresProject = true;
|
|
96
|
-
Source.aliases = ['force:source:convert'];
|
|
97
|
-
Source.deprecateAliases = true;
|
|
98
|
-
Source.flags = {
|
|
99
|
-
'api-version': sf_plugins_core_1.orgApiVersionFlagWithDeprecations,
|
|
100
|
-
loglevel: sf_plugins_core_1.loglevel,
|
|
101
|
-
'root-dir': sf_plugins_core_1.Flags.directory({
|
|
102
|
-
aliases: ['rootdir'],
|
|
103
|
-
deprecateAliases: true,
|
|
104
|
-
char: 'r',
|
|
105
|
-
summary: messages.getMessage('flags.root-dir.summary'),
|
|
106
|
-
exists: true,
|
|
107
|
-
}),
|
|
108
|
-
'output-dir': sf_plugins_core_1.Flags.directory({
|
|
109
|
-
aliases: ['outputdir'],
|
|
110
|
-
deprecateAliases: true,
|
|
111
|
-
default: `metadataPackage_${Date.now()}`,
|
|
112
|
-
char: 'd',
|
|
113
|
-
summary: messages.getMessage('flags.output-dir.summary'),
|
|
114
|
-
}),
|
|
115
|
-
'package-name': sf_plugins_core_1.Flags.string({
|
|
116
|
-
char: 'n',
|
|
117
|
-
aliases: ['packagename'],
|
|
118
|
-
deprecateAliases: true,
|
|
119
|
-
summary: messages.getMessage('flags.package-name.summary'),
|
|
120
|
-
}),
|
|
121
|
-
manifest: sf_plugins_core_1.Flags.file({
|
|
122
|
-
char: 'x',
|
|
123
|
-
summary: messages.getMessage('flags.manifest.summary'),
|
|
124
|
-
description: messages.getMessage('flags.manifest.description'),
|
|
125
|
-
exists: true,
|
|
126
|
-
}),
|
|
127
|
-
'source-dir': (0, sf_plugins_core_1.arrayWithDeprecation)({
|
|
128
|
-
char: 'p',
|
|
129
|
-
aliases: ['sourcepath'],
|
|
130
|
-
deprecateAliases: true,
|
|
131
|
-
description: messages.getMessage('flags.source-dir.description'),
|
|
132
|
-
summary: messages.getMessage('flags.source-dir.summary'),
|
|
133
|
-
exclusive: ['manifest', 'metadata'],
|
|
134
|
-
}),
|
|
135
|
-
metadata: (0, sf_plugins_core_1.arrayWithDeprecation)({
|
|
136
|
-
char: 'm',
|
|
137
|
-
summary: messages.getMessage('flags.metadata.summary'),
|
|
138
|
-
exclusive: ['manifest', 'sourcepath'],
|
|
139
|
-
}),
|
|
140
|
-
};
|
|
141
|
-
//# sourceMappingURL=source.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"source.js","sourceRoot":"","sources":["../../../../src/commands/project/convert/source.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,+BAA+B;AAC/B,yBAAyB;AAEzB,2CAA4C;AAC5C,+EAK4C;AAC5C,mDAAiD;AACjD,iEAMqC;AAErC,oDAA6E;AAC7E,mGAAgG;AAGhG,eAAQ,CAAC,uBAAuB,CAAC,SAAS,CAAC,CAAC;AAC5C,MAAM,QAAQ,GAAG,eAAQ,CAAC,YAAY,CAAC,oCAAoC,EAAE,gBAAgB,CAAC,CAAC;AAE/F,MAAa,MAAO,SAAQ,2BAA4B;IAuD/C,KAAK,CAAC,GAAG;QACd,IAAI,CAAC,KAAK,GA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