@stack-spot/portal-network 0.27.2 → 0.28.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/dist/api/apiManagement.d.ts +289 -0
- package/dist/api/apiManagement.d.ts.map +1 -0
- package/dist/api/apiManagement.js +143 -0
- package/dist/api/apiManagement.js.map +1 -0
- package/dist/api/workspaceManager.d.ts +320 -218
- package/dist/api/workspaceManager.d.ts.map +1 -1
- package/dist/api/workspaceManager.js +68 -20
- package/dist/api/workspaceManager.js.map +1 -1
- package/dist/apis.json +8 -8
- package/dist/client/content.d.ts +43 -0
- package/dist/client/content.d.ts.map +1 -1
- package/dist/client/content.js +55 -1
- package/dist/client/content.js.map +1 -1
- package/dist/client/notification.d.ts +1 -1
- package/dist/client/types.d.ts +29 -0
- package/dist/client/types.d.ts.map +1 -1
- package/dist/client/workspace-manager.d.ts +121 -0
- package/dist/client/workspace-manager.d.ts.map +1 -0
- package/dist/client/workspace-manager.js +204 -0
- package/dist/client/workspace-manager.js.map +1 -0
- package/dist/client/workspace.d.ts +45 -0
- package/dist/client/workspace.d.ts.map +1 -1
- package/dist/client/workspace.js +46 -1
- package/dist/client/workspace.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/network/ManualOperation.js +1 -1
- package/package.json +1 -1
- package/src/api/apiManagement.ts +498 -0
- package/src/api/workspaceManager.ts +402 -234
- package/src/apis.json +8 -8
- package/src/client/content.ts +39 -2
- package/src/client/types.ts +38 -0
- package/src/client/workspace-manager.ts +171 -0
- package/src/client/workspace.ts +40 -15
- package/src/index.ts +1 -1
- package/src/network/ManualOperation.ts +1 -1
|
@@ -38,7 +38,7 @@ export class ManualOperation {
|
|
|
38
38
|
its arity is zero. We can use this information to determine what the type of `args` actually is at runtime. If variables are accepted,
|
|
39
39
|
than the 1st argument is the variables and the 2nd is the query options, otherwise, it has a single argument, which is the query
|
|
40
40
|
options. */
|
|
41
|
-
const [variables, options] = this.config.permission.length ===
|
|
41
|
+
const [variables, options] = this.config.permission.length === 1 ? args : [undefined, args[0]];
|
|
42
42
|
const result = useQuery({
|
|
43
43
|
...options,
|
|
44
44
|
queryKey: this.getPermissionKey(variables),
|
package/package.json
CHANGED
|
@@ -0,0 +1,498 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OpenAPI definition
|
|
3
|
+
* v0
|
|
4
|
+
* DO NOT MODIFY - This file has been generated using oazapfts.
|
|
5
|
+
* See https://www.npmjs.com/package/oazapfts
|
|
6
|
+
*/
|
|
7
|
+
import * as Oazapfts from "@oazapfts/runtime";
|
|
8
|
+
import * as QS from "@oazapfts/runtime/query";
|
|
9
|
+
export const defaults: Oazapfts.Defaults<Oazapfts.CustomHeaders> = {
|
|
10
|
+
headers: {},
|
|
11
|
+
baseUrl: "http://api-management-catalog-api.dev.stackspot.com",
|
|
12
|
+
};
|
|
13
|
+
const oazapfts = Oazapfts.runtime(defaults);
|
|
14
|
+
export const servers = {
|
|
15
|
+
generatedServerUrl: "http://api-management-catalog-api.dev.stackspot.com"
|
|
16
|
+
};
|
|
17
|
+
export type ApiQueryParams = {
|
|
18
|
+
catalogVisible?: boolean;
|
|
19
|
+
page: number;
|
|
20
|
+
size: number;
|
|
21
|
+
search?: string;
|
|
22
|
+
direction: "ASC" | "DESC";
|
|
23
|
+
orderBy: string;
|
|
24
|
+
similaritySearch?: boolean;
|
|
25
|
+
};
|
|
26
|
+
export type ContactResponse = {
|
|
27
|
+
name: string;
|
|
28
|
+
email: string;
|
|
29
|
+
};
|
|
30
|
+
export type VersionCatalogResponse = {
|
|
31
|
+
id: string;
|
|
32
|
+
version: string;
|
|
33
|
+
stableVersion: boolean;
|
|
34
|
+
actionDate: string;
|
|
35
|
+
state: "PENDING" | "CREATED" | "DEVELOPED" | "PRE_RELEASE" | "RELEASED" | "BLOCKED" | "DEPRECATED" | "RETIRED";
|
|
36
|
+
registryUrl: string;
|
|
37
|
+
};
|
|
38
|
+
export type ApiListDataResponse = {
|
|
39
|
+
id: string;
|
|
40
|
+
name: string;
|
|
41
|
+
description: string;
|
|
42
|
+
slug: string;
|
|
43
|
+
status: "PENDING" | "ERROR" | "CREATED";
|
|
44
|
+
catalogVisible: boolean;
|
|
45
|
+
createdBy: string;
|
|
46
|
+
createdAt: string;
|
|
47
|
+
executionId?: string;
|
|
48
|
+
contact: ContactResponse;
|
|
49
|
+
stableVersion?: VersionCatalogResponse;
|
|
50
|
+
};
|
|
51
|
+
export type Link = {
|
|
52
|
+
href?: string;
|
|
53
|
+
hreflang?: string;
|
|
54
|
+
title?: string;
|
|
55
|
+
"type"?: string;
|
|
56
|
+
deprecation?: string;
|
|
57
|
+
profile?: string;
|
|
58
|
+
name?: string;
|
|
59
|
+
templated?: boolean;
|
|
60
|
+
};
|
|
61
|
+
export type Links = {
|
|
62
|
+
[key: string]: Link;
|
|
63
|
+
};
|
|
64
|
+
export type PageMetadata = {
|
|
65
|
+
size?: number;
|
|
66
|
+
totalElements?: number;
|
|
67
|
+
totalPages?: number;
|
|
68
|
+
"number"?: number;
|
|
69
|
+
};
|
|
70
|
+
export type ApiListResponse = {
|
|
71
|
+
_embedded?: {
|
|
72
|
+
content?: ApiListDataResponse[];
|
|
73
|
+
};
|
|
74
|
+
_links?: Links;
|
|
75
|
+
page?: PageMetadata;
|
|
76
|
+
};
|
|
77
|
+
export type ApiContact = {
|
|
78
|
+
name: string;
|
|
79
|
+
email: string;
|
|
80
|
+
};
|
|
81
|
+
export type ApiParameterRequest = {
|
|
82
|
+
name: string;
|
|
83
|
+
value: string;
|
|
84
|
+
};
|
|
85
|
+
export type ApiCreateRequest = {
|
|
86
|
+
name: string;
|
|
87
|
+
slug?: string;
|
|
88
|
+
description: string;
|
|
89
|
+
status?: "PENDING" | "ERROR" | "CREATED";
|
|
90
|
+
catalogVisible: boolean;
|
|
91
|
+
category?: "PUBLIC" | "PRIVATE";
|
|
92
|
+
"type"?: "INTERNAL" | "EXTERNAL";
|
|
93
|
+
contact: ApiContact;
|
|
94
|
+
parameters?: ApiParameterRequest[];
|
|
95
|
+
};
|
|
96
|
+
export type ApiCreateResponse = {
|
|
97
|
+
accountId: string;
|
|
98
|
+
workspaceId: string;
|
|
99
|
+
id: string;
|
|
100
|
+
name: string;
|
|
101
|
+
slug: string;
|
|
102
|
+
description: string;
|
|
103
|
+
status: "PENDING" | "ERROR" | "CREATED";
|
|
104
|
+
catalogVisible: boolean;
|
|
105
|
+
createdBy: string;
|
|
106
|
+
createdAt: string;
|
|
107
|
+
contact: ApiContact;
|
|
108
|
+
};
|
|
109
|
+
export type VersionQueryParams = {
|
|
110
|
+
isStableVersion?: boolean;
|
|
111
|
+
status?: "PENDING" | "CREATED" | "DEVELOPED" | "PRE_RELEASE" | "RELEASED" | "BLOCKED" | "DEPRECATED" | "RETIRED";
|
|
112
|
+
version?: string;
|
|
113
|
+
page: number;
|
|
114
|
+
size: number;
|
|
115
|
+
};
|
|
116
|
+
export type VersionResponse = {
|
|
117
|
+
id: string;
|
|
118
|
+
environmentId: string;
|
|
119
|
+
version: string;
|
|
120
|
+
actionDate: string;
|
|
121
|
+
state: string;
|
|
122
|
+
apiGatewayId: string;
|
|
123
|
+
isStableVersion: boolean;
|
|
124
|
+
registryUrl: string;
|
|
125
|
+
registryProvider: string;
|
|
126
|
+
createdBy: string;
|
|
127
|
+
createdAt: string;
|
|
128
|
+
};
|
|
129
|
+
export type VersionListResponse = {
|
|
130
|
+
_embedded?: {
|
|
131
|
+
content?: VersionResponse[];
|
|
132
|
+
};
|
|
133
|
+
_links?: Links;
|
|
134
|
+
page?: PageMetadata;
|
|
135
|
+
};
|
|
136
|
+
export type VersionRequest = {
|
|
137
|
+
version: string;
|
|
138
|
+
environmentId: string;
|
|
139
|
+
state: "PENDING" | "CREATED" | "DEVELOPED" | "PRE_RELEASE" | "RELEASED" | "BLOCKED" | "DEPRECATED" | "RETIRED";
|
|
140
|
+
apiGatewayId: string;
|
|
141
|
+
isStableVersion: boolean;
|
|
142
|
+
registryUrl: string;
|
|
143
|
+
registryProvider: "GITHUB" | "GITLAB" | "BIT_BUCKET" | "AZURE_DEVOPS" | "CODE_COMMIT" | "STACKSPOT";
|
|
144
|
+
};
|
|
145
|
+
export type ApiDetailResponse = {
|
|
146
|
+
id: string;
|
|
147
|
+
name: string;
|
|
148
|
+
description: string;
|
|
149
|
+
slug: string;
|
|
150
|
+
status: "PENDING" | "ERROR" | "CREATED";
|
|
151
|
+
catalogVisible: boolean;
|
|
152
|
+
createdBy: string;
|
|
153
|
+
createdAt: string;
|
|
154
|
+
executionId?: string;
|
|
155
|
+
contact: ContactResponse;
|
|
156
|
+
stableVersion?: VersionCatalogResponse;
|
|
157
|
+
latestVersion?: VersionCatalogResponse;
|
|
158
|
+
};
|
|
159
|
+
export type ApiPatchRequest = {
|
|
160
|
+
name: string;
|
|
161
|
+
description: string;
|
|
162
|
+
status: "PENDING" | "ERROR" | "CREATED";
|
|
163
|
+
catalogVisible?: boolean;
|
|
164
|
+
category?: "PUBLIC" | "PRIVATE";
|
|
165
|
+
"type"?: "INTERNAL" | "EXTERNAL";
|
|
166
|
+
contact: ApiContact;
|
|
167
|
+
};
|
|
168
|
+
export type VersionRegistryRequest = {
|
|
169
|
+
url: string;
|
|
170
|
+
provider: "GITHUB" | "GITLAB" | "BIT_BUCKET" | "AZURE_DEVOPS" | "CODE_COMMIT" | "STACKSPOT";
|
|
171
|
+
};
|
|
172
|
+
export type VersionPatchRequest = {
|
|
173
|
+
stableVersion: boolean;
|
|
174
|
+
registry: VersionRegistryRequest;
|
|
175
|
+
};
|
|
176
|
+
export type CatalogListResponse = {
|
|
177
|
+
accountId: string;
|
|
178
|
+
workspaceId: string;
|
|
179
|
+
id: string;
|
|
180
|
+
name: string;
|
|
181
|
+
slug: string;
|
|
182
|
+
description: string;
|
|
183
|
+
status: "PENDING" | "ERROR" | "CREATED";
|
|
184
|
+
catalogVisible: boolean;
|
|
185
|
+
createdBy: string;
|
|
186
|
+
createdAt: string;
|
|
187
|
+
contact: ContactResponse;
|
|
188
|
+
stableVersion?: VersionCatalogResponse;
|
|
189
|
+
latestVersion?: VersionCatalogResponse;
|
|
190
|
+
};
|
|
191
|
+
export type CatalogResponse = {
|
|
192
|
+
_embedded?: {
|
|
193
|
+
content?: CatalogListResponse[];
|
|
194
|
+
};
|
|
195
|
+
_links?: Links;
|
|
196
|
+
page?: PageMetadata;
|
|
197
|
+
};
|
|
198
|
+
export type VersionCatalogQueryParams = {
|
|
199
|
+
page: number;
|
|
200
|
+
size: number;
|
|
201
|
+
};
|
|
202
|
+
/**
|
|
203
|
+
* Request to list all APIs
|
|
204
|
+
*/
|
|
205
|
+
export function list({ workspaceId, queryParams }: {
|
|
206
|
+
workspaceId: string;
|
|
207
|
+
queryParams: ApiQueryParams;
|
|
208
|
+
}, opts?: Oazapfts.RequestOpts) {
|
|
209
|
+
return oazapfts.ok(oazapfts.fetchJson<{
|
|
210
|
+
status: 200;
|
|
211
|
+
data: ApiListResponse;
|
|
212
|
+
} | {
|
|
213
|
+
status: 400;
|
|
214
|
+
} | {
|
|
215
|
+
status: 403;
|
|
216
|
+
} | {
|
|
217
|
+
status: 404;
|
|
218
|
+
} | {
|
|
219
|
+
status: 422;
|
|
220
|
+
} | {
|
|
221
|
+
status: 500;
|
|
222
|
+
}>(`/workspaces/${encodeURIComponent(workspaceId)}/v2/apis${QS.query(QS.explode({
|
|
223
|
+
queryParams
|
|
224
|
+
}))}`, {
|
|
225
|
+
...opts
|
|
226
|
+
}));
|
|
227
|
+
}
|
|
228
|
+
/**
|
|
229
|
+
* Request to create an Api
|
|
230
|
+
*/
|
|
231
|
+
export function createApi({ workspaceId, authorization, apiCreateRequest }: {
|
|
232
|
+
workspaceId: string;
|
|
233
|
+
authorization: string;
|
|
234
|
+
apiCreateRequest: ApiCreateRequest;
|
|
235
|
+
}, opts?: Oazapfts.RequestOpts) {
|
|
236
|
+
return oazapfts.ok(oazapfts.fetchJson<{
|
|
237
|
+
status: 200;
|
|
238
|
+
data: ApiCreateResponse;
|
|
239
|
+
} | {
|
|
240
|
+
status: 400;
|
|
241
|
+
} | {
|
|
242
|
+
status: 403;
|
|
243
|
+
} | {
|
|
244
|
+
status: 404;
|
|
245
|
+
} | {
|
|
246
|
+
status: 422;
|
|
247
|
+
} | {
|
|
248
|
+
status: 500;
|
|
249
|
+
}>(`/workspaces/${encodeURIComponent(workspaceId)}/v2/apis`, oazapfts.json({
|
|
250
|
+
...opts,
|
|
251
|
+
method: "POST",
|
|
252
|
+
body: apiCreateRequest,
|
|
253
|
+
headers: oazapfts.mergeHeaders(opts?.headers, {
|
|
254
|
+
Authorization: authorization
|
|
255
|
+
})
|
|
256
|
+
})));
|
|
257
|
+
}
|
|
258
|
+
/**
|
|
259
|
+
* Request to get all API version
|
|
260
|
+
*/
|
|
261
|
+
export function getAllApiVersion({ workspaceId, apiId, queryParams }: {
|
|
262
|
+
workspaceId: string;
|
|
263
|
+
apiId: string;
|
|
264
|
+
queryParams: VersionQueryParams;
|
|
265
|
+
}, opts?: Oazapfts.RequestOpts) {
|
|
266
|
+
return oazapfts.ok(oazapfts.fetchJson<{
|
|
267
|
+
status: 200;
|
|
268
|
+
data: VersionListResponse;
|
|
269
|
+
} | {
|
|
270
|
+
status: 400;
|
|
271
|
+
} | {
|
|
272
|
+
status: 403;
|
|
273
|
+
} | {
|
|
274
|
+
status: 404;
|
|
275
|
+
} | {
|
|
276
|
+
status: 422;
|
|
277
|
+
} | {
|
|
278
|
+
status: 500;
|
|
279
|
+
}>(`/workspaces/${encodeURIComponent(workspaceId)}/v2/apis/${encodeURIComponent(apiId)}/versions${QS.query(QS.explode({
|
|
280
|
+
queryParams
|
|
281
|
+
}))}`, {
|
|
282
|
+
...opts
|
|
283
|
+
}));
|
|
284
|
+
}
|
|
285
|
+
/**
|
|
286
|
+
* Request to create API version
|
|
287
|
+
*/
|
|
288
|
+
export function createApiVersion({ workspaceId, apiId, versionRequest }: {
|
|
289
|
+
workspaceId: string;
|
|
290
|
+
apiId: string;
|
|
291
|
+
versionRequest: VersionRequest;
|
|
292
|
+
}, opts?: Oazapfts.RequestOpts) {
|
|
293
|
+
return oazapfts.ok(oazapfts.fetchJson<{
|
|
294
|
+
status: 200;
|
|
295
|
+
data: VersionResponse;
|
|
296
|
+
} | {
|
|
297
|
+
status: 400;
|
|
298
|
+
} | {
|
|
299
|
+
status: 403;
|
|
300
|
+
} | {
|
|
301
|
+
status: 404;
|
|
302
|
+
} | {
|
|
303
|
+
status: 422;
|
|
304
|
+
} | {
|
|
305
|
+
status: 500;
|
|
306
|
+
}>(`/workspaces/${encodeURIComponent(workspaceId)}/v2/apis/${encodeURIComponent(apiId)}/versions`, oazapfts.json({
|
|
307
|
+
...opts,
|
|
308
|
+
method: "POST",
|
|
309
|
+
body: versionRequest
|
|
310
|
+
})));
|
|
311
|
+
}
|
|
312
|
+
/**
|
|
313
|
+
* Request to detail an API
|
|
314
|
+
*/
|
|
315
|
+
export function getApi({ workspaceId, apiId }: {
|
|
316
|
+
workspaceId: string;
|
|
317
|
+
apiId: string;
|
|
318
|
+
}, opts?: Oazapfts.RequestOpts) {
|
|
319
|
+
return oazapfts.ok(oazapfts.fetchJson<{
|
|
320
|
+
status: 200;
|
|
321
|
+
data: ApiDetailResponse;
|
|
322
|
+
} | {
|
|
323
|
+
status: 400;
|
|
324
|
+
} | {
|
|
325
|
+
status: 403;
|
|
326
|
+
} | {
|
|
327
|
+
status: 404;
|
|
328
|
+
} | {
|
|
329
|
+
status: 422;
|
|
330
|
+
} | {
|
|
331
|
+
status: 500;
|
|
332
|
+
}>(`/workspaces/${encodeURIComponent(workspaceId)}/v2/apis/${encodeURIComponent(apiId)}`, {
|
|
333
|
+
...opts
|
|
334
|
+
}));
|
|
335
|
+
}
|
|
336
|
+
/**
|
|
337
|
+
* Request to patch an API
|
|
338
|
+
*/
|
|
339
|
+
export function update({ workspaceId, apiId, apiPatchRequest }: {
|
|
340
|
+
workspaceId: string;
|
|
341
|
+
apiId: string;
|
|
342
|
+
apiPatchRequest: ApiPatchRequest;
|
|
343
|
+
}, opts?: Oazapfts.RequestOpts) {
|
|
344
|
+
return oazapfts.ok(oazapfts.fetchText(`/workspaces/${encodeURIComponent(workspaceId)}/v2/apis/${encodeURIComponent(apiId)}`, oazapfts.json({
|
|
345
|
+
...opts,
|
|
346
|
+
method: "PATCH",
|
|
347
|
+
body: apiPatchRequest
|
|
348
|
+
})));
|
|
349
|
+
}
|
|
350
|
+
/**
|
|
351
|
+
* Request to get API version
|
|
352
|
+
*/
|
|
353
|
+
export function getApiVersion({ workspaceId, apiId, versionId }: {
|
|
354
|
+
workspaceId: string;
|
|
355
|
+
apiId: string;
|
|
356
|
+
versionId: string;
|
|
357
|
+
}, opts?: Oazapfts.RequestOpts) {
|
|
358
|
+
return oazapfts.ok(oazapfts.fetchJson<{
|
|
359
|
+
status: 200;
|
|
360
|
+
data: VersionResponse;
|
|
361
|
+
} | {
|
|
362
|
+
status: 400;
|
|
363
|
+
} | {
|
|
364
|
+
status: 403;
|
|
365
|
+
} | {
|
|
366
|
+
status: 404;
|
|
367
|
+
} | {
|
|
368
|
+
status: 422;
|
|
369
|
+
} | {
|
|
370
|
+
status: 500;
|
|
371
|
+
}>(`/workspaces/${encodeURIComponent(workspaceId)}/v2/apis/${encodeURIComponent(apiId)}/versions/${encodeURIComponent(versionId)}`, {
|
|
372
|
+
...opts
|
|
373
|
+
}));
|
|
374
|
+
}
|
|
375
|
+
/**
|
|
376
|
+
* Request to update API version
|
|
377
|
+
*/
|
|
378
|
+
export function updateVersion({ workspaceId, apiId, versionId, versionPatchRequest }: {
|
|
379
|
+
workspaceId: string;
|
|
380
|
+
apiId: string;
|
|
381
|
+
versionId: string;
|
|
382
|
+
versionPatchRequest: VersionPatchRequest;
|
|
383
|
+
}, opts?: Oazapfts.RequestOpts) {
|
|
384
|
+
return oazapfts.ok(oazapfts.fetchText(`/workspaces/${encodeURIComponent(workspaceId)}/v2/apis/${encodeURIComponent(apiId)}/versions/${encodeURIComponent(versionId)}`, oazapfts.json({
|
|
385
|
+
...opts,
|
|
386
|
+
method: "PATCH",
|
|
387
|
+
body: versionPatchRequest
|
|
388
|
+
})));
|
|
389
|
+
}
|
|
390
|
+
export function list1(opts?: Oazapfts.RequestOpts) {
|
|
391
|
+
return oazapfts.ok(oazapfts.fetchJson<{
|
|
392
|
+
status: 200;
|
|
393
|
+
data: object;
|
|
394
|
+
}>("/siglas", {
|
|
395
|
+
...opts
|
|
396
|
+
}));
|
|
397
|
+
}
|
|
398
|
+
export function list2({ siglas }: {
|
|
399
|
+
siglas?: string;
|
|
400
|
+
}, opts?: Oazapfts.RequestOpts) {
|
|
401
|
+
return oazapfts.ok(oazapfts.fetchJson<{
|
|
402
|
+
status: 200;
|
|
403
|
+
data: object;
|
|
404
|
+
}>(`/offers${QS.query(QS.explode({
|
|
405
|
+
siglas
|
|
406
|
+
}))}`, {
|
|
407
|
+
...opts
|
|
408
|
+
}));
|
|
409
|
+
}
|
|
410
|
+
export function list3({ siglas }: {
|
|
411
|
+
siglas?: string;
|
|
412
|
+
}, opts?: Oazapfts.RequestOpts) {
|
|
413
|
+
return oazapfts.ok(oazapfts.fetchJson<{
|
|
414
|
+
status: 200;
|
|
415
|
+
data: object;
|
|
416
|
+
}>(`/businesses${QS.query(QS.explode({
|
|
417
|
+
siglas
|
|
418
|
+
}))}`, {
|
|
419
|
+
...opts
|
|
420
|
+
}));
|
|
421
|
+
}
|
|
422
|
+
/**
|
|
423
|
+
* Show APIs from catalog
|
|
424
|
+
*/
|
|
425
|
+
export function list4({ accountId, queryParams }: {
|
|
426
|
+
accountId: string;
|
|
427
|
+
queryParams: ApiQueryParams;
|
|
428
|
+
}, opts?: Oazapfts.RequestOpts) {
|
|
429
|
+
return oazapfts.ok(oazapfts.fetchJson<{
|
|
430
|
+
status: 200;
|
|
431
|
+
data: CatalogResponse;
|
|
432
|
+
} | {
|
|
433
|
+
status: 400;
|
|
434
|
+
} | {
|
|
435
|
+
status: 403;
|
|
436
|
+
} | {
|
|
437
|
+
status: 404;
|
|
438
|
+
} | {
|
|
439
|
+
status: 422;
|
|
440
|
+
} | {
|
|
441
|
+
status: 500;
|
|
442
|
+
}>(`/accounts/${encodeURIComponent(accountId)}/v2/apis${QS.query(QS.explode({
|
|
443
|
+
queryParams
|
|
444
|
+
}))}`, {
|
|
445
|
+
...opts
|
|
446
|
+
}));
|
|
447
|
+
}
|
|
448
|
+
/**
|
|
449
|
+
* Request to detail an API from Catalog
|
|
450
|
+
*/
|
|
451
|
+
export function detail({ accountId, apiId }: {
|
|
452
|
+
accountId: string;
|
|
453
|
+
apiId: string;
|
|
454
|
+
}, opts?: Oazapfts.RequestOpts) {
|
|
455
|
+
return oazapfts.ok(oazapfts.fetchJson<{
|
|
456
|
+
status: 200;
|
|
457
|
+
data: ApiDetailResponse;
|
|
458
|
+
} | {
|
|
459
|
+
status: 400;
|
|
460
|
+
} | {
|
|
461
|
+
status: 403;
|
|
462
|
+
} | {
|
|
463
|
+
status: 404;
|
|
464
|
+
} | {
|
|
465
|
+
status: 422;
|
|
466
|
+
} | {
|
|
467
|
+
status: 500;
|
|
468
|
+
}>(`/accounts/${encodeURIComponent(accountId)}/v2/apis/${encodeURIComponent(apiId)}`, {
|
|
469
|
+
...opts
|
|
470
|
+
}));
|
|
471
|
+
}
|
|
472
|
+
/**
|
|
473
|
+
* Show Versions from catalog
|
|
474
|
+
*/
|
|
475
|
+
export function listVersions({ accountId, apiId, queryParams }: {
|
|
476
|
+
accountId: string;
|
|
477
|
+
apiId: string;
|
|
478
|
+
queryParams: VersionCatalogQueryParams;
|
|
479
|
+
}, opts?: Oazapfts.RequestOpts) {
|
|
480
|
+
return oazapfts.ok(oazapfts.fetchJson<{
|
|
481
|
+
status: 200;
|
|
482
|
+
data: VersionResponse;
|
|
483
|
+
} | {
|
|
484
|
+
status: 400;
|
|
485
|
+
} | {
|
|
486
|
+
status: 403;
|
|
487
|
+
} | {
|
|
488
|
+
status: 404;
|
|
489
|
+
} | {
|
|
490
|
+
status: 422;
|
|
491
|
+
} | {
|
|
492
|
+
status: 500;
|
|
493
|
+
}>(`/accounts/${encodeURIComponent(accountId)}/v2/apis/${encodeURIComponent(apiId)}/versions${QS.query(QS.explode({
|
|
494
|
+
queryParams
|
|
495
|
+
}))}`, {
|
|
496
|
+
...opts
|
|
497
|
+
}));
|
|
498
|
+
}
|