@salesforce/plugin-api 1.1.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.
@@ -0,0 +1,130 @@
1
+ {
2
+ "commands": {
3
+ "api:request:rest": {
4
+ "aliases": [],
5
+ "args": {
6
+ "endpoint": {
7
+ "description": "Salesforce API endpoint",
8
+ "name": "endpoint",
9
+ "required": true
10
+ }
11
+ },
12
+ "examples": [
13
+ "- List information about limits in the org with alias \"my-org\":\n\n <%= config.bin %> <%= command.id %> 'limits' --target-org my-org\n\n- List all endpoints\n\n <%= config.bin %> <%= command.id %> '/'\n\n- Get the response in XML format by specifying the \"Accept\" HTTP header:\n\n <%= config.bin %> <%= command.id %> 'limits' --target-org my-org --header 'Accept: application/xml'\n\n- POST to create an Account object\n\n <%= config.bin %> <%= command.id %> 'sobjects/account' --body \"{\\\"Name\\\" : \\\"Account from REST API\\\",\\\"ShippingCity\\\" : \\\"Boise\\\"}\" --method POST\n\n- or with a file 'info.json' containing\n\n```json\n{\n \"Name\": \"Demo\",\n \"ShippingCity\": \"Boise\"\n}\n```\n\n<%= config.bin %> <%= command.id %> 'sobjects/account' --body info.json --method POST\n\n- Update object\n\n <%= config.bin %> <%= command.id %> 'sobjects/account/<Account ID>' --body \"{\\\"BillingCity\\\": \\\"San Francisco\\\"}\" --method PATCH"
14
+ ],
15
+ "flags": {
16
+ "flags-dir": {
17
+ "helpGroup": "GLOBAL",
18
+ "name": "flags-dir",
19
+ "summary": "Import flag values from a directory.",
20
+ "hasDynamicHelp": false,
21
+ "multiple": false,
22
+ "type": "option"
23
+ },
24
+ "target-org": {
25
+ "char": "o",
26
+ "name": "target-org",
27
+ "noCacheDefault": true,
28
+ "required": true,
29
+ "summary": "Username or alias of the target org. Not required if the `target-org` configuration variable is already set.",
30
+ "hasDynamicHelp": true,
31
+ "multiple": false,
32
+ "type": "option"
33
+ },
34
+ "api-version": {
35
+ "description": "Override the api version used for api requests made by this command",
36
+ "name": "api-version",
37
+ "hasDynamicHelp": false,
38
+ "multiple": false,
39
+ "type": "option"
40
+ },
41
+ "include": {
42
+ "char": "i",
43
+ "exclusive": [
44
+ "stream-to-file"
45
+ ],
46
+ "name": "include",
47
+ "summary": "Include the HTTP response status and headers in the output.",
48
+ "allowNo": false,
49
+ "type": "boolean"
50
+ },
51
+ "method": {
52
+ "char": "X",
53
+ "name": "method",
54
+ "summary": "HTTP method for the request.",
55
+ "default": "GET",
56
+ "hasDynamicHelp": false,
57
+ "multiple": false,
58
+ "options": [
59
+ "GET",
60
+ "POST",
61
+ "PUT",
62
+ "PATCH",
63
+ "HEAD",
64
+ "DELETE",
65
+ "OPTIONS",
66
+ "TRACE"
67
+ ],
68
+ "type": "option"
69
+ },
70
+ "header": {
71
+ "char": "H",
72
+ "name": "header",
73
+ "summary": "HTTP header in \"key:value\" format.",
74
+ "hasDynamicHelp": false,
75
+ "helpValue": "key:value",
76
+ "multiple": true,
77
+ "type": "option"
78
+ },
79
+ "stream-to-file": {
80
+ "char": "S",
81
+ "exclusive": [
82
+ "include"
83
+ ],
84
+ "name": "stream-to-file",
85
+ "summary": "Stream responses to a file.",
86
+ "hasDynamicHelp": false,
87
+ "helpValue": "Example: report.xlsx",
88
+ "multiple": false,
89
+ "type": "option"
90
+ },
91
+ "body": {
92
+ "name": "body",
93
+ "summary": "File to use as the body for the request. Specify \"-\" to read from standard input; specify \"\" for an empty body.",
94
+ "hasDynamicHelp": false,
95
+ "helpValue": "file",
96
+ "multiple": false,
97
+ "type": "option"
98
+ }
99
+ },
100
+ "hasDynamicHelp": true,
101
+ "hiddenAliases": [],
102
+ "id": "api:request:rest",
103
+ "pluginAlias": "@salesforce/plugin-api",
104
+ "pluginName": "@salesforce/plugin-api",
105
+ "pluginType": "core",
106
+ "state": "beta",
107
+ "strict": true,
108
+ "summary": "Make an authenticated HTTP request to Salesforce REST API and print the response.",
109
+ "enableJsonFlag": false,
110
+ "isESM": true,
111
+ "relativePath": [
112
+ "lib",
113
+ "commands",
114
+ "api",
115
+ "request",
116
+ "rest.js"
117
+ ],
118
+ "aliasPermutations": [],
119
+ "permutations": [
120
+ "api:request:rest",
121
+ "request:api:rest",
122
+ "request:rest:api",
123
+ "api:rest:request",
124
+ "rest:api:request",
125
+ "rest:request:api"
126
+ ]
127
+ }
128
+ },
129
+ "version": "1.1.0"
130
+ }
package/package.json ADDED
@@ -0,0 +1,207 @@
1
+ {
2
+ "name": "@salesforce/plugin-api",
3
+ "description": "A plugin to call API endpoints via CLI commands",
4
+ "version": "1.1.0",
5
+ "author": "Salesforce",
6
+ "bugs": "https://github.com/forcedotcom/cli/issues",
7
+ "dependencies": {
8
+ "@oclif/core": "^4",
9
+ "@salesforce/core": "^8.4.0",
10
+ "@salesforce/kit": "^3.2.1",
11
+ "@salesforce/sf-plugins-core": "^11.3.2",
12
+ "ansis": "^3.3.2",
13
+ "got": "^13.0.0",
14
+ "proxy-agent": "^6.4.0"
15
+ },
16
+ "devDependencies": {
17
+ "@oclif/plugin-command-snapshot": "^5.2.12",
18
+ "@salesforce/cli-plugins-testkit": "^5.3.25",
19
+ "@salesforce/dev-scripts": "^10.2.9",
20
+ "@salesforce/plugin-command-reference": "^3.1.16",
21
+ "eslint-plugin-sf-plugin": "^1.20.4",
22
+ "nock": "^13.5.4",
23
+ "oclif": "^4.14.19",
24
+ "ts-node": "^10.9.2",
25
+ "typescript": "^5.5.4"
26
+ },
27
+ "engines": {
28
+ "node": ">=18.0.0"
29
+ },
30
+ "files": [
31
+ "/lib",
32
+ "/messages",
33
+ "/npm-shrinkwrap.json",
34
+ "/oclif.lock",
35
+ "/oclif.manifest.json",
36
+ "/schemas"
37
+ ],
38
+ "homepage": "https://github.com/salesforcecli/plugin-api",
39
+ "keywords": [
40
+ "force",
41
+ "salesforce",
42
+ "salesforcedx",
43
+ "sf",
44
+ "sf-plugin",
45
+ "sfdx",
46
+ "sfdx-plugin"
47
+ ],
48
+ "license": "BSD-3-Clause",
49
+ "oclif": {
50
+ "commands": "./lib/commands",
51
+ "bin": "sf",
52
+ "topicSeparator": " ",
53
+ "devPlugins": [
54
+ "@oclif/plugin-help",
55
+ "@oclif/plugin-command-snapshot",
56
+ "@salesforce/plugin-command-reference"
57
+ ],
58
+ "topics": {
59
+ "api": {
60
+ "description": "commands to send and interact with API calls"
61
+ }
62
+ },
63
+ "flexibleTaxonomy": true
64
+ },
65
+ "repository": "salesforcecli/plugin-api",
66
+ "scripts": {
67
+ "build": "wireit",
68
+ "clean": "sf-clean",
69
+ "clean-all": "sf-clean all",
70
+ "compile": "wireit",
71
+ "docs": "sf-docs",
72
+ "format": "wireit",
73
+ "link-check": "wireit",
74
+ "lint": "wireit",
75
+ "postpack": "sf-clean --ignore-signing-artifacts",
76
+ "prepack": "sf-prepack",
77
+ "prepare": "sf-install",
78
+ "test": "wireit",
79
+ "test:nuts": "nyc mocha \"**/*.nut.ts\" --slow 4500 --timeout 600000 --parallel",
80
+ "test:only": "wireit",
81
+ "version": "oclif readme"
82
+ },
83
+ "publishConfig": {
84
+ "access": "public"
85
+ },
86
+ "wireit": {
87
+ "build": {
88
+ "dependencies": [
89
+ "compile",
90
+ "lint"
91
+ ]
92
+ },
93
+ "compile": {
94
+ "command": "tsc -p . --pretty --incremental",
95
+ "files": [
96
+ "src/**/*.ts",
97
+ "**/tsconfig.json",
98
+ "messages/**"
99
+ ],
100
+ "output": [
101
+ "lib/**",
102
+ "*.tsbuildinfo"
103
+ ],
104
+ "clean": "if-file-deleted"
105
+ },
106
+ "format": {
107
+ "command": "prettier --write \"+(src|test|schemas)/**/*.+(ts|js|json)|command-snapshot.json\"",
108
+ "files": [
109
+ "src/**/*.ts",
110
+ "test/**/*.ts",
111
+ "schemas/**/*.json",
112
+ "command-snapshot.json",
113
+ ".prettier*"
114
+ ],
115
+ "output": []
116
+ },
117
+ "lint": {
118
+ "command": "eslint src test --color --cache --cache-location .eslintcache",
119
+ "files": [
120
+ "src/**/*.ts",
121
+ "test/**/*.ts",
122
+ "messages/**",
123
+ "**/.eslint*",
124
+ "**/tsconfig.json"
125
+ ],
126
+ "output": []
127
+ },
128
+ "test:compile": {
129
+ "command": "tsc -p \"./test\" --pretty",
130
+ "files": [
131
+ "test/**/*.ts",
132
+ "**/tsconfig.json"
133
+ ],
134
+ "output": []
135
+ },
136
+ "test": {
137
+ "dependencies": [
138
+ "test:compile",
139
+ "test:only",
140
+ "test:command-reference",
141
+ "test:deprecation-policy",
142
+ "lint",
143
+ "test:json-schema",
144
+ "link-check"
145
+ ]
146
+ },
147
+ "test:only": {
148
+ "command": "nyc mocha \"test/**/*.test.ts\"",
149
+ "env": {
150
+ "FORCE_COLOR": "2"
151
+ },
152
+ "files": [
153
+ "test/**/*.ts",
154
+ "src/**/*.ts",
155
+ "**/tsconfig.json",
156
+ ".mocha*",
157
+ "!*.nut.ts",
158
+ ".nycrc"
159
+ ],
160
+ "output": []
161
+ },
162
+ "test:command-reference": {
163
+ "command": "node --loader ts-node/esm --no-warnings=ExperimentalWarning \"./bin/dev.js\" commandreference:generate --erroronwarnings",
164
+ "files": [
165
+ "src/**/*.ts",
166
+ "messages/**",
167
+ "package.json"
168
+ ],
169
+ "output": [
170
+ "tmp/root"
171
+ ]
172
+ },
173
+ "test:deprecation-policy": {
174
+ "command": "node --loader ts-node/esm --no-warnings=ExperimentalWarning \"./bin/dev.js\" snapshot:compare",
175
+ "files": [
176
+ "src/**/*.ts"
177
+ ],
178
+ "output": [],
179
+ "dependencies": [
180
+ "compile"
181
+ ]
182
+ },
183
+ "test:json-schema": {
184
+ "command": "node --loader ts-node/esm --no-warnings=ExperimentalWarning \"./bin/dev.js\" schema:compare",
185
+ "files": [
186
+ "src/**/*.ts",
187
+ "schemas"
188
+ ],
189
+ "output": []
190
+ },
191
+ "link-check": {
192
+ "command": "node -e \"process.exit(process.env.CI ? 0 : 1)\" || linkinator \"**/*.md\" --skip \"CHANGELOG.md|node_modules|test/|confluence.internal.salesforce.com|my.salesforce.com|%s\" --markdown --retry --directory-listing --verbosity error",
193
+ "files": [
194
+ "./*.md",
195
+ "./!(CHANGELOG).md",
196
+ "messages/**/*.md"
197
+ ],
198
+ "output": []
199
+ }
200
+ },
201
+ "exports": "./lib/index.js",
202
+ "type": "module",
203
+ "sfdx": {
204
+ "publicKeyUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-api/1.1.0.crt",
205
+ "signatureUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-api/1.1.0.sig"
206
+ }
207
+ }