@postman/postman-mcp-server 2.6.1 → 2.7.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.
- package/README.md +236 -80
- package/dist/package.json +11 -10
- package/dist/src/enabledResources.js +9 -3
- package/dist/src/index.js +11 -0
- package/dist/src/tools/createCollection.js +1 -1
- package/dist/src/tools/createCollectionComment.js +1 -1
- package/dist/src/tools/createCollectionFolder.js +1 -1
- package/dist/src/tools/createCollectionRequest.js +257 -93
- package/dist/src/tools/createCollectionResponse.js +415 -4
- package/dist/src/tools/createEnvironment.js +1 -1
- package/dist/src/tools/createFolderComment.js +1 -1
- package/dist/src/tools/createMock.js +1 -1
- package/dist/src/tools/createMonitor.js +1 -1
- package/dist/src/tools/createRequestComment.js +1 -1
- package/dist/src/tools/createResponseComment.js +1 -1
- package/dist/src/tools/createSpec.js +17 -5
- package/dist/src/tools/createSpecFile.js +1 -1
- package/dist/src/tools/createWorkspace.js +6 -2
- package/dist/src/tools/deleteApiCollectionComment.js +1 -1
- package/dist/src/tools/deleteCollectionComment.js +1 -1
- package/dist/src/tools/deleteFolderComment.js +1 -1
- package/dist/src/tools/deleteMock.js +1 -1
- package/dist/src/tools/deletePanElementOrFolder.js +1 -1
- package/dist/src/tools/deleteRequestComment.js +1 -1
- package/dist/src/tools/deleteResponseComment.js +1 -1
- package/dist/src/tools/deleteWorkspace.js +1 -1
- package/dist/src/tools/duplicateCollection.js +1 -1
- package/dist/src/tools/generateCollection.js +3 -3
- package/dist/src/tools/getAllElementsAndFolders.js +1 -1
- package/dist/src/tools/getAuthenticatedUser.js +1 -1
- package/dist/src/tools/getCodeGenerationInstructions.js +17 -11
- package/dist/src/tools/getCollection/getCollectionMap.js +2 -2
- package/dist/src/tools/getMock.js +1 -1
- package/dist/src/tools/getMocks.js +1 -1
- package/dist/src/tools/getSourceCollectionStatus.js +1 -1
- package/dist/src/tools/getTaggedEntities.js +1 -1
- package/dist/src/tools/getWorkspace.js +1 -1
- package/dist/src/tools/getWorkspaces.js +1 -1
- package/dist/src/tools/mergeCollectionFork.js +1 -1
- package/dist/src/tools/patchCollection.js +1 -1
- package/dist/src/tools/patchEnvironment.js +1 -1
- package/dist/src/tools/postPanElementOrFolder.js +1 -1
- package/dist/src/tools/publishDocumentation.js +1 -1
- package/dist/src/tools/pullCollectionChanges.js +4 -2
- package/dist/src/tools/putCollection.js +11 -1
- package/dist/src/tools/putEnvironment.js +1 -1
- package/dist/src/tools/resolveCommentThread.js +1 -1
- package/dist/src/tools/runMonitor.js +1 -1
- package/dist/src/tools/searchPostmanElementsInPrivateNetwork.js +127 -0
- package/dist/src/tools/searchPostmanElementsInPublicNetwork.js +101 -0
- package/dist/src/tools/syncCollectionWithSpec.js +1 -1
- package/dist/src/tools/syncSpecWithCollection.js +1 -1
- package/dist/src/tools/updateApiCollectionComment.js +1 -1
- package/dist/src/tools/updateCollectionComment.js +1 -1
- package/dist/src/tools/updateCollectionFolder.js +1 -1
- package/dist/src/tools/updateCollectionRequest.js +259 -96
- package/dist/src/tools/updateCollectionResponse.js +1 -1
- package/dist/src/tools/updateFolderComment.js +1 -1
- package/dist/src/tools/updateMock.js +1 -1
- package/dist/src/tools/updatePanElementOrFolder.js +1 -1
- package/dist/src/tools/updateRequestComment.js +1 -1
- package/dist/src/tools/updateResponseComment.js +1 -1
- package/dist/src/tools/updateSpecFile.js +1 -1
- package/dist/src/tools/updateWorkspace.js +1 -1
- package/dist/src/tools/utils/templateRenderer.js +23 -0
- package/dist/src/views/getCollections.njk +12 -0
- package/dist/src/views/getWorkspaces.njk +6 -0
- package/package.json +11 -10
- package/dist/src/tools/searchPostmanElements.js +0 -69
|
@@ -7,7 +7,7 @@ export const parameters = z.object({
|
|
|
7
7
|
collectionUid: z.string().describe("The collection's unique ID."),
|
|
8
8
|
});
|
|
9
9
|
export const annotations = {
|
|
10
|
-
title: 'Syncs an API specification linked to a collection. This is an asynchronous endpoint that returns an HTTP \\`202 Accepted\\` response
|
|
10
|
+
title: 'Syncs an API specification linked to a collection. This is an asynchronous endpoint that returns an HTTP \\`202 Accepted\\` response.',
|
|
11
11
|
readOnlyHint: false,
|
|
12
12
|
destructiveHint: false,
|
|
13
13
|
idempotentHint: true,
|
|
@@ -22,7 +22,7 @@ export const parameters = z.object({
|
|
|
22
22
|
.optional(),
|
|
23
23
|
});
|
|
24
24
|
export const annotations = {
|
|
25
|
-
title: "Updates a comment on an API's collection
|
|
25
|
+
title: "Updates a comment on an API's collection.",
|
|
26
26
|
readOnlyHint: false,
|
|
27
27
|
destructiveHint: false,
|
|
28
28
|
idempotentHint: true,
|
|
@@ -21,7 +21,7 @@ export const parameters = z.object({
|
|
|
21
21
|
.optional(),
|
|
22
22
|
});
|
|
23
23
|
export const annotations = {
|
|
24
|
-
title: 'Updates a comment on a collection
|
|
24
|
+
title: 'Updates a comment on a collection.',
|
|
25
25
|
readOnlyHint: false,
|
|
26
26
|
destructiveHint: false,
|
|
27
27
|
idempotentHint: true,
|
|
@@ -10,7 +10,7 @@ export const parameters = z.object({
|
|
|
10
10
|
description: z.string().describe("The folder's description.").optional(),
|
|
11
11
|
});
|
|
12
12
|
export const annotations = {
|
|
13
|
-
title: 'Updates a folder in a collection. For a complete list of properties, refer to the **Folder** entry in the [Postman Collection Format documentation](https://schema.postman.com/collection/json/v2.1.0/draft-07/docs/index.html)
|
|
13
|
+
title: 'Updates a folder in a collection. For a complete list of properties, refer to the **Folder** entry in the [Postman Collection Format documentation](https://schema.postman.com/collection/json/v2.1.0/draft-07/docs/index.html).',
|
|
14
14
|
readOnlyHint: false,
|
|
15
15
|
destructiveHint: false,
|
|
16
16
|
idempotentHint: true,
|
|
@@ -7,6 +7,7 @@ export const parameters = z.object({
|
|
|
7
7
|
requestId: z.string().describe("The request's ID."),
|
|
8
8
|
collectionId: z.string().describe("The collection's ID."),
|
|
9
9
|
name: z.string().describe('Name of the request. Only provided fields are updated.').optional(),
|
|
10
|
+
description: z.string().nullable().describe("The request's description.").optional(),
|
|
10
11
|
method: z
|
|
11
12
|
.enum([
|
|
12
13
|
'GET',
|
|
@@ -26,57 +27,87 @@ export const parameters = z.object({
|
|
|
26
27
|
'VIEW',
|
|
27
28
|
])
|
|
28
29
|
.nullable()
|
|
29
|
-
.describe("The request's method.")
|
|
30
|
+
.describe("The request's HTTP method.")
|
|
30
31
|
.optional(),
|
|
31
|
-
|
|
32
|
-
url: z.string().nullable().optional(),
|
|
32
|
+
url: z.string().nullable().describe("The request's URL.").optional(),
|
|
33
33
|
headerData: z
|
|
34
34
|
.array(z.object({
|
|
35
|
-
key: z.string().optional(),
|
|
36
|
-
value: z.string().optional(),
|
|
37
|
-
description: z.string().nullable().optional(),
|
|
35
|
+
key: z.string().describe("The header's key.").optional(),
|
|
36
|
+
value: z.string().describe("The header's value.").optional(),
|
|
37
|
+
description: z.string().nullable().describe("The header's description.").optional(),
|
|
38
38
|
}))
|
|
39
|
+
.describe("The request's headers.")
|
|
39
40
|
.optional(),
|
|
40
41
|
queryParams: z
|
|
41
42
|
.array(z.object({
|
|
42
|
-
key: z.string().optional(),
|
|
43
|
-
value: z.string().optional(),
|
|
44
|
-
description: z
|
|
45
|
-
|
|
43
|
+
key: z.string().describe("The query parameter's key.").optional(),
|
|
44
|
+
value: z.string().describe("The query parameter's value.").optional(),
|
|
45
|
+
description: z
|
|
46
|
+
.string()
|
|
47
|
+
.nullable()
|
|
48
|
+
.describe("The query parameter's description.")
|
|
49
|
+
.optional(),
|
|
50
|
+
enabled: z.boolean().describe('If true, the query parameter is enabled.').optional(),
|
|
46
51
|
}))
|
|
52
|
+
.describe("The request's query parameters.")
|
|
53
|
+
.optional(),
|
|
54
|
+
dataMode: z
|
|
55
|
+
.enum(['raw', 'urlencoded', 'formdata', 'binary', 'graphql'])
|
|
56
|
+
.nullable()
|
|
57
|
+
.describe("The request body's data mode.")
|
|
47
58
|
.optional(),
|
|
48
|
-
dataMode: z.enum(['raw', 'urlencoded', 'formdata', 'binary', 'graphql']).nullable().optional(),
|
|
49
59
|
data: z
|
|
50
60
|
.array(z.object({
|
|
51
|
-
key: z.string().optional(),
|
|
52
|
-
value: z.string().optional(),
|
|
53
|
-
description: z.string().nullable().optional(),
|
|
54
|
-
enabled: z.boolean().optional(),
|
|
55
|
-
type: z.enum(['text', 'file']).optional(),
|
|
56
|
-
uuid: z.string().optional(),
|
|
61
|
+
key: z.string().describe("The form data's key.").optional(),
|
|
62
|
+
value: z.string().describe("The form data's value.").optional(),
|
|
63
|
+
description: z.string().nullable().describe("The form data's description.").optional(),
|
|
64
|
+
enabled: z.boolean().describe('If true, the form data entry is enabled.').optional(),
|
|
65
|
+
type: z.enum(['text', 'file']).describe("The form data's type.").optional(),
|
|
66
|
+
uuid: z.string().describe("The form data entry's unique identifier.").optional(),
|
|
57
67
|
}))
|
|
58
68
|
.nullable()
|
|
69
|
+
.describe("The request body's form data.")
|
|
59
70
|
.optional(),
|
|
60
|
-
rawModeData: z.string().nullable().optional(),
|
|
71
|
+
rawModeData: z.string().nullable().describe("The request body's raw mode data.").optional(),
|
|
61
72
|
graphqlModeData: z
|
|
62
|
-
.object({
|
|
73
|
+
.object({
|
|
74
|
+
query: z.string().describe('The GraphQL query.').optional(),
|
|
75
|
+
variables: z.string().describe('The GraphQL query variables, in JSON format.').optional(),
|
|
76
|
+
})
|
|
63
77
|
.nullable()
|
|
78
|
+
.describe("The request body's GraphQL mode data.")
|
|
64
79
|
.optional(),
|
|
65
80
|
dataOptions: z
|
|
66
81
|
.object({
|
|
67
|
-
raw: z
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
82
|
+
raw: z
|
|
83
|
+
.object({ language: z.string().describe("The raw mode data's language type.").optional() })
|
|
84
|
+
.catchall(z.unknown())
|
|
85
|
+
.describe('Options for the `raw` data mode.')
|
|
86
|
+
.optional(),
|
|
87
|
+
urlencoded: z
|
|
88
|
+
.record(z.string(), z.unknown())
|
|
89
|
+
.describe('Options for the `urlencoded` data mode.')
|
|
90
|
+
.optional(),
|
|
91
|
+
params: z
|
|
92
|
+
.record(z.string(), z.unknown())
|
|
93
|
+
.describe('Options for the `params` data mode.')
|
|
94
|
+
.optional(),
|
|
95
|
+
binary: z
|
|
96
|
+
.record(z.string(), z.unknown())
|
|
97
|
+
.describe('Options for the `binary` data mode.')
|
|
98
|
+
.optional(),
|
|
99
|
+
graphql: z
|
|
100
|
+
.record(z.string(), z.unknown())
|
|
101
|
+
.describe('Options for the `graphql` data mode.')
|
|
102
|
+
.optional(),
|
|
72
103
|
})
|
|
73
104
|
.nullable()
|
|
105
|
+
.describe("Additional configurations and options set for the request body's various data modes.")
|
|
74
106
|
.optional(),
|
|
75
107
|
auth: z
|
|
76
108
|
.object({
|
|
77
109
|
type: z
|
|
78
110
|
.enum([
|
|
79
|
-
'noauth',
|
|
80
111
|
'basic',
|
|
81
112
|
'bearer',
|
|
82
113
|
'apikey',
|
|
@@ -89,98 +120,228 @@ export const parameters = z.object({
|
|
|
89
120
|
'edgegrid',
|
|
90
121
|
'jwt',
|
|
91
122
|
'asap',
|
|
123
|
+
'noauth',
|
|
92
124
|
])
|
|
93
|
-
.
|
|
125
|
+
.describe('The authorization type.'),
|
|
94
126
|
apikey: z
|
|
95
|
-
.array(z
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
127
|
+
.array(z
|
|
128
|
+
.object({
|
|
129
|
+
key: z.string().describe("The auth method's key value."),
|
|
130
|
+
value: z
|
|
131
|
+
.union([z.string(), z.array(z.record(z.string(), z.unknown()))])
|
|
132
|
+
.describe("The key's value.")
|
|
133
|
+
.optional(),
|
|
134
|
+
type: z
|
|
135
|
+
.enum(['string', 'boolean', 'number', 'array', 'object', 'any'])
|
|
136
|
+
.describe("The value's type.")
|
|
137
|
+
.optional(),
|
|
138
|
+
})
|
|
139
|
+
.describe('Information about the supported Postman [authorization type](https://learning.postman.com/docs/sending-requests/authorization/authorization-types/).'))
|
|
140
|
+
.describe("The API key's authentication information.")
|
|
100
141
|
.optional(),
|
|
101
|
-
|
|
102
|
-
.array(z
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
142
|
+
awsv4: z
|
|
143
|
+
.array(z
|
|
144
|
+
.object({
|
|
145
|
+
key: z.string().describe("The auth method's key value."),
|
|
146
|
+
value: z
|
|
147
|
+
.union([z.string(), z.array(z.record(z.string(), z.unknown()))])
|
|
148
|
+
.describe("The key's value.")
|
|
149
|
+
.optional(),
|
|
150
|
+
type: z
|
|
151
|
+
.enum(['string', 'boolean', 'number', 'array', 'object', 'any'])
|
|
152
|
+
.describe("The value's type.")
|
|
153
|
+
.optional(),
|
|
154
|
+
})
|
|
155
|
+
.describe('Information about the supported Postman [authorization type](https://learning.postman.com/docs/sending-requests/authorization/authorization-types/).'))
|
|
156
|
+
.describe('The attributes for AWS Signature authentication.')
|
|
107
157
|
.optional(),
|
|
108
158
|
basic: z
|
|
109
|
-
.array(z
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
159
|
+
.array(z
|
|
160
|
+
.object({
|
|
161
|
+
key: z.string().describe("The auth method's key value."),
|
|
162
|
+
value: z
|
|
163
|
+
.union([z.string(), z.array(z.record(z.string(), z.unknown()))])
|
|
164
|
+
.describe("The key's value.")
|
|
165
|
+
.optional(),
|
|
166
|
+
type: z
|
|
167
|
+
.enum(['string', 'boolean', 'number', 'array', 'object', 'any'])
|
|
168
|
+
.describe("The value's type.")
|
|
169
|
+
.optional(),
|
|
170
|
+
})
|
|
171
|
+
.describe('Information about the supported Postman [authorization type](https://learning.postman.com/docs/sending-requests/authorization/authorization-types/).'))
|
|
172
|
+
.describe('The attributes for Basic Auth.')
|
|
114
173
|
.optional(),
|
|
115
|
-
|
|
116
|
-
.array(z
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
174
|
+
bearer: z
|
|
175
|
+
.array(z
|
|
176
|
+
.object({
|
|
177
|
+
key: z.string().describe("The auth method's key value."),
|
|
178
|
+
value: z
|
|
179
|
+
.union([z.string(), z.array(z.record(z.string(), z.unknown()))])
|
|
180
|
+
.describe("The key's value.")
|
|
181
|
+
.optional(),
|
|
182
|
+
type: z
|
|
183
|
+
.enum(['string', 'boolean', 'number', 'array', 'object', 'any'])
|
|
184
|
+
.describe("The value's type.")
|
|
185
|
+
.optional(),
|
|
186
|
+
})
|
|
187
|
+
.describe('Information about the supported Postman [authorization type](https://learning.postman.com/docs/sending-requests/authorization/authorization-types/).'))
|
|
188
|
+
.describe('The attributes for Bearer Token authentication.')
|
|
121
189
|
.optional(),
|
|
122
|
-
|
|
123
|
-
.array(z
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
190
|
+
digest: z
|
|
191
|
+
.array(z
|
|
192
|
+
.object({
|
|
193
|
+
key: z.string().describe("The auth method's key value."),
|
|
194
|
+
value: z
|
|
195
|
+
.union([z.string(), z.array(z.record(z.string(), z.unknown()))])
|
|
196
|
+
.describe("The key's value.")
|
|
197
|
+
.optional(),
|
|
198
|
+
type: z
|
|
199
|
+
.enum(['string', 'boolean', 'number', 'array', 'object', 'any'])
|
|
200
|
+
.describe("The value's type.")
|
|
201
|
+
.optional(),
|
|
202
|
+
})
|
|
203
|
+
.describe('Information about the supported Postman [authorization type](https://learning.postman.com/docs/sending-requests/authorization/authorization-types/).'))
|
|
204
|
+
.describe('The attributes for Digest access authentication.')
|
|
128
205
|
.optional(),
|
|
129
|
-
|
|
130
|
-
.array(z
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
206
|
+
edgegrid: z
|
|
207
|
+
.array(z
|
|
208
|
+
.object({
|
|
209
|
+
key: z.string().describe("The auth method's key value."),
|
|
210
|
+
value: z
|
|
211
|
+
.union([z.string(), z.array(z.record(z.string(), z.unknown()))])
|
|
212
|
+
.describe("The key's value.")
|
|
213
|
+
.optional(),
|
|
214
|
+
type: z
|
|
215
|
+
.enum(['string', 'boolean', 'number', 'array', 'object', 'any'])
|
|
216
|
+
.describe("The value's type.")
|
|
217
|
+
.optional(),
|
|
218
|
+
})
|
|
219
|
+
.describe('Information about the supported Postman [authorization type](https://learning.postman.com/docs/sending-requests/authorization/authorization-types/).'))
|
|
220
|
+
.describe('The attributes for Akamai Edgegrid authentication.')
|
|
135
221
|
.optional(),
|
|
136
222
|
hawk: z
|
|
137
|
-
.array(z
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
})
|
|
223
|
+
.array(z
|
|
224
|
+
.object({
|
|
225
|
+
key: z.string().describe("The auth method's key value."),
|
|
226
|
+
value: z
|
|
227
|
+
.union([z.string(), z.array(z.record(z.string(), z.unknown()))])
|
|
228
|
+
.describe("The key's value.")
|
|
229
|
+
.optional(),
|
|
230
|
+
type: z
|
|
231
|
+
.enum(['string', 'boolean', 'number', 'array', 'object', 'any'])
|
|
232
|
+
.describe("The value's type.")
|
|
233
|
+
.optional(),
|
|
234
|
+
})
|
|
235
|
+
.describe('Information about the supported Postman [authorization type](https://learning.postman.com/docs/sending-requests/authorization/authorization-types/).'))
|
|
236
|
+
.describe('The attributes for Hawk authentication.')
|
|
149
237
|
.optional(),
|
|
150
238
|
ntlm: z
|
|
151
|
-
.array(z
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
239
|
+
.array(z
|
|
240
|
+
.object({
|
|
241
|
+
key: z.string().describe("The auth method's key value."),
|
|
242
|
+
value: z
|
|
243
|
+
.union([z.string(), z.array(z.record(z.string(), z.unknown()))])
|
|
244
|
+
.describe("The key's value.")
|
|
245
|
+
.optional(),
|
|
246
|
+
type: z
|
|
247
|
+
.enum(['string', 'boolean', 'number', 'array', 'object', 'any'])
|
|
248
|
+
.describe("The value's type.")
|
|
249
|
+
.optional(),
|
|
250
|
+
})
|
|
251
|
+
.describe('Information about the supported Postman [authorization type](https://learning.postman.com/docs/sending-requests/authorization/authorization-types/).'))
|
|
252
|
+
.describe('The attributes for NTLM authentication.')
|
|
156
253
|
.optional(),
|
|
157
|
-
|
|
158
|
-
.array(z
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
254
|
+
oauth1: z
|
|
255
|
+
.array(z
|
|
256
|
+
.object({
|
|
257
|
+
key: z.string().describe("The auth method's key value."),
|
|
258
|
+
value: z
|
|
259
|
+
.union([z.string(), z.array(z.record(z.string(), z.unknown()))])
|
|
260
|
+
.describe("The key's value.")
|
|
261
|
+
.optional(),
|
|
262
|
+
type: z
|
|
263
|
+
.enum(['string', 'boolean', 'number', 'array', 'object', 'any'])
|
|
264
|
+
.describe("The value's type.")
|
|
265
|
+
.optional(),
|
|
266
|
+
})
|
|
267
|
+
.describe('Information about the supported Postman [authorization type](https://learning.postman.com/docs/sending-requests/authorization/authorization-types/).'))
|
|
268
|
+
.describe('The attributes for OAuth1 authentication.')
|
|
269
|
+
.optional(),
|
|
270
|
+
oauth2: z
|
|
271
|
+
.array(z
|
|
272
|
+
.object({
|
|
273
|
+
key: z.string().describe("The auth method's key value."),
|
|
274
|
+
value: z
|
|
275
|
+
.union([z.string(), z.array(z.record(z.string(), z.unknown()))])
|
|
276
|
+
.describe("The key's value.")
|
|
277
|
+
.optional(),
|
|
278
|
+
type: z
|
|
279
|
+
.enum(['string', 'boolean', 'number', 'array', 'object', 'any'])
|
|
280
|
+
.describe("The value's type.")
|
|
281
|
+
.optional(),
|
|
282
|
+
})
|
|
283
|
+
.describe('Information about the supported Postman [authorization type](https://learning.postman.com/docs/sending-requests/authorization/authorization-types/).'))
|
|
284
|
+
.describe('The attributes for OAuth2 authentication.')
|
|
163
285
|
.optional(),
|
|
164
286
|
jwt: z
|
|
165
|
-
.array(z
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
287
|
+
.array(z
|
|
288
|
+
.object({
|
|
289
|
+
key: z.string().describe("The auth method's key value."),
|
|
290
|
+
value: z
|
|
291
|
+
.union([z.string(), z.array(z.record(z.string(), z.unknown()))])
|
|
292
|
+
.describe("The key's value.")
|
|
293
|
+
.optional(),
|
|
294
|
+
type: z
|
|
295
|
+
.enum(['string', 'boolean', 'number', 'array', 'object', 'any'])
|
|
296
|
+
.describe("The value's type.")
|
|
297
|
+
.optional(),
|
|
298
|
+
})
|
|
299
|
+
.describe('Information about the supported Postman [authorization type](https://learning.postman.com/docs/sending-requests/authorization/authorization-types/).'))
|
|
300
|
+
.describe('The attributes for JWT authentication.')
|
|
170
301
|
.optional(),
|
|
171
302
|
asap: z
|
|
172
|
-
.array(z
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
303
|
+
.array(z
|
|
304
|
+
.object({
|
|
305
|
+
key: z.string().describe("The auth method's key value."),
|
|
306
|
+
value: z
|
|
307
|
+
.union([z.string(), z.array(z.record(z.string(), z.unknown()))])
|
|
308
|
+
.describe("The key's value.")
|
|
309
|
+
.optional(),
|
|
310
|
+
type: z
|
|
311
|
+
.enum(['string', 'boolean', 'number', 'array', 'object', 'any'])
|
|
312
|
+
.describe("The value's type.")
|
|
313
|
+
.optional(),
|
|
314
|
+
})
|
|
315
|
+
.describe('Information about the supported Postman [authorization type](https://learning.postman.com/docs/sending-requests/authorization/authorization-types/).'))
|
|
316
|
+
.describe('The attributes for ASAP authentication.')
|
|
177
317
|
.optional(),
|
|
178
318
|
})
|
|
179
319
|
.nullable()
|
|
320
|
+
.describe("The request's authentication information.")
|
|
321
|
+
.optional(),
|
|
322
|
+
events: z
|
|
323
|
+
.array(z.object({
|
|
324
|
+
listen: z.enum(['test', 'prerequest']).describe('The event type.'),
|
|
325
|
+
script: z
|
|
326
|
+
.object({
|
|
327
|
+
id: z.string().describe("The script's ID.").optional(),
|
|
328
|
+
type: z
|
|
329
|
+
.string()
|
|
330
|
+
.describe('The type of script. For example, `text/javascript`.')
|
|
331
|
+
.optional(),
|
|
332
|
+
exec: z
|
|
333
|
+
.array(z.string().nullable())
|
|
334
|
+
.describe('A list of script strings, where each line represents a line of code. Separate lines makes it easy to track script changes.')
|
|
335
|
+
.optional(),
|
|
336
|
+
})
|
|
337
|
+
.describe('Information about the Javascript code that can be used to to perform setup or teardown operations in a response.')
|
|
338
|
+
.optional(),
|
|
339
|
+
}))
|
|
340
|
+
.describe('A list of scripts configured to run when specific events occur.')
|
|
180
341
|
.optional(),
|
|
181
342
|
});
|
|
182
343
|
export const annotations = {
|
|
183
|
-
title: 'Updates a request in a collection. For a complete list of properties, refer to the **Request** entry in the [Postman Collection Format documentation](https://schema.postman.com/collection/json/v2.1.0/draft-07/docs/index.html)
|
|
344
|
+
title: 'Updates a request in a collection. For a complete list of properties, refer to the **Request** entry in the [Postman Collection Format documentation](https://schema.postman.com/collection/json/v2.1.0/draft-07/docs/index.html).',
|
|
184
345
|
readOnlyHint: false,
|
|
185
346
|
destructiveHint: false,
|
|
186
347
|
idempotentHint: true,
|
|
@@ -193,10 +354,10 @@ export async function handler(args, extra) {
|
|
|
193
354
|
const bodyPayload = {};
|
|
194
355
|
if (args.name !== undefined)
|
|
195
356
|
bodyPayload.name = args.name;
|
|
196
|
-
if (args.method !== undefined)
|
|
197
|
-
bodyPayload.method = args.method;
|
|
198
357
|
if (args.description !== undefined)
|
|
199
358
|
bodyPayload.description = args.description;
|
|
359
|
+
if (args.method !== undefined)
|
|
360
|
+
bodyPayload.method = args.method;
|
|
200
361
|
if (args.url !== undefined)
|
|
201
362
|
bodyPayload.url = args.url;
|
|
202
363
|
if (args.headerData !== undefined)
|
|
@@ -215,6 +376,8 @@ export async function handler(args, extra) {
|
|
|
215
376
|
bodyPayload.dataOptions = args.dataOptions;
|
|
216
377
|
if (args.auth !== undefined)
|
|
217
378
|
bodyPayload.auth = args.auth;
|
|
379
|
+
if (args.events !== undefined)
|
|
380
|
+
bodyPayload.events = args.events;
|
|
218
381
|
const options = {
|
|
219
382
|
body: JSON.stringify(bodyPayload),
|
|
220
383
|
contentType: ContentType.Json,
|
|
@@ -16,7 +16,7 @@ export const parameters = z.object({
|
|
|
16
16
|
.optional(),
|
|
17
17
|
});
|
|
18
18
|
export const annotations = {
|
|
19
|
-
title: 'Updates a response in a collection. For a complete list of properties, see the [Postman Collection Format documentation](https://schema.postman.com/collection/json/v2.1.0/draft-07/docs/index.html)
|
|
19
|
+
title: 'Updates a response in a collection. For a complete list of properties, see the [Postman Collection Format documentation](https://schema.postman.com/collection/json/v2.1.0/draft-07/docs/index.html).',
|
|
20
20
|
readOnlyHint: false,
|
|
21
21
|
destructiveHint: false,
|
|
22
22
|
idempotentHint: true,
|
|
@@ -22,7 +22,7 @@ export const parameters = z.object({
|
|
|
22
22
|
.optional(),
|
|
23
23
|
});
|
|
24
24
|
export const annotations = {
|
|
25
|
-
title: 'Updates a comment on a folder
|
|
25
|
+
title: 'Updates a comment on a folder.',
|
|
26
26
|
readOnlyHint: false,
|
|
27
27
|
destructiveHint: false,
|
|
28
28
|
idempotentHint: true,
|
|
@@ -32,7 +32,7 @@ export const parameters = z.object({
|
|
|
32
32
|
.optional(),
|
|
33
33
|
});
|
|
34
34
|
export const annotations = {
|
|
35
|
-
title: 'Updates a mock server
|
|
35
|
+
title: 'Updates a mock server.',
|
|
36
36
|
readOnlyHint: false,
|
|
37
37
|
destructiveHint: false,
|
|
38
38
|
idempotentHint: true,
|
|
@@ -65,7 +65,7 @@ export const parameters = z.object({
|
|
|
65
65
|
]),
|
|
66
66
|
});
|
|
67
67
|
export const annotations = {
|
|
68
|
-
title: "Updates an element or folder in your team's [Private API Network](https://learning.postman.com/docs/collaborating-in-postman/adding-private-network/)
|
|
68
|
+
title: "Updates an element or folder in your team's [Private API Network](https://learning.postman.com/docs/collaborating-in-postman/adding-private-network/).",
|
|
69
69
|
readOnlyHint: false,
|
|
70
70
|
destructiveHint: false,
|
|
71
71
|
idempotentHint: true,
|
|
@@ -22,7 +22,7 @@ export const parameters = z.object({
|
|
|
22
22
|
.optional(),
|
|
23
23
|
});
|
|
24
24
|
export const annotations = {
|
|
25
|
-
title: 'Updates a comment on a request
|
|
25
|
+
title: 'Updates a comment on a request.',
|
|
26
26
|
readOnlyHint: false,
|
|
27
27
|
destructiveHint: false,
|
|
28
28
|
idempotentHint: true,
|
|
@@ -22,7 +22,7 @@ export const parameters = z.object({
|
|
|
22
22
|
.optional(),
|
|
23
23
|
});
|
|
24
24
|
export const annotations = {
|
|
25
|
-
title: 'Updates a comment on a response
|
|
25
|
+
title: 'Updates a comment on a response.',
|
|
26
26
|
readOnlyHint: false,
|
|
27
27
|
destructiveHint: false,
|
|
28
28
|
idempotentHint: true,
|
|
@@ -14,7 +14,7 @@ export const parameters = z.object({
|
|
|
14
14
|
content: z.string().describe("The specification's stringified contents.").optional(),
|
|
15
15
|
});
|
|
16
16
|
export const annotations = {
|
|
17
|
-
title: "Updates an API specification's file
|
|
17
|
+
title: "Updates an API specification's file.",
|
|
18
18
|
readOnlyHint: false,
|
|
19
19
|
destructiveHint: false,
|
|
20
20
|
idempotentHint: true,
|
|
@@ -18,7 +18,7 @@ export const parameters = z.object({
|
|
|
18
18
|
.optional(),
|
|
19
19
|
});
|
|
20
20
|
export const annotations = {
|
|
21
|
-
title: 'Updates a workspace
|
|
21
|
+
title: 'Updates a workspace.',
|
|
22
22
|
readOnlyHint: false,
|
|
23
23
|
destructiveHint: false,
|
|
24
24
|
idempotentHint: true,
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { existsSync } from 'node:fs';
|
|
2
|
+
import { join } from 'node:path';
|
|
3
|
+
import nunjucks from 'nunjucks';
|
|
4
|
+
export function createTemplateRenderer(viewsDir) {
|
|
5
|
+
const env = nunjucks.configure(viewsDir, {
|
|
6
|
+
autoescape: false,
|
|
7
|
+
noCache: false,
|
|
8
|
+
throwOnUndefined: false,
|
|
9
|
+
});
|
|
10
|
+
env.addFilter('default', (val, defaultVal = '') => val === undefined || val === null ? defaultVal : val);
|
|
11
|
+
return (toolName, rawText) => {
|
|
12
|
+
const templatePath = join(viewsDir, `${toolName}.njk`);
|
|
13
|
+
if (!existsSync(templatePath))
|
|
14
|
+
return null;
|
|
15
|
+
try {
|
|
16
|
+
const data = JSON.parse(rawText);
|
|
17
|
+
return env.render(`${toolName}.njk`, data);
|
|
18
|
+
}
|
|
19
|
+
catch {
|
|
20
|
+
return null;
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# Collections
|
|
2
|
+
|
|
3
|
+
## Meta
|
|
4
|
+
|
|
5
|
+
- **total**: {{ meta.total }}
|
|
6
|
+
- **offset**: {{ meta.offset }}
|
|
7
|
+
- **limit**: {{ meta.limit }}
|
|
8
|
+
|
|
9
|
+
| id | name | owner | createdAt | updatedAt | uid | fork | isPublic |
|
|
10
|
+
|---|---|---|---|---|---|---|---|
|
|
11
|
+
{% for item in collections %}| {{ item.id }} | {{ item.name }} | {{ item.owner }} | {{ item.createdAt }} | {{ item.updatedAt }} | {{ item.uid }} | {{ item.fork | dump }} | {{ item.isPublic }} |
|
|
12
|
+
{% endfor %}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
# Workspaces
|
|
2
|
+
|
|
3
|
+
| id | name | type | visibility | createdBy | about | createdAt | updatedAt | scim |
|
|
4
|
+
|---|---|---|---|---|---|---|---|---|
|
|
5
|
+
{% for item in workspaces %}| {{ item.id }} | {{ item.name }} | {{ item.type }} | {{ item.visibility }} | {{ item.createdBy }} | {{ item.about }} | {{ item.createdAt }} | {{ item.updatedAt }} | {{ item.scim | dump }} |
|
|
6
|
+
{% endfor %}
|