Skip to content

Commit d64ca6f

Browse files
change: [DPS-41452] Switch Delivery endpoints from beta APIv4 to APIv4 (#13461)
1 parent 573ad61 commit d64ca6f

5 files changed

Lines changed: 40 additions & 30 deletions

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@linode/api-v4": Changed
3+
---
4+
5+
Switch delivery endpoints from Beta APIv4 to APIv4 ([#13461](https://github.com/linode/manager/pull/13461))

packages/api-v4/src/delivery/destinations.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import {
33
updateDestinationSchema,
44
} from '@linode/validation';
55

6-
import { BETA_API_ROOT } from '../constants';
6+
import { API_ROOT } from '../constants';
77
import Request, {
88
setData,
99
setMethod,
@@ -28,7 +28,7 @@ import type {
2828
export const getDestination = (destinationId: number) =>
2929
Request<Destination>(
3030
setURL(
31-
`${BETA_API_ROOT}/monitor/streams/destinations/${encodeURIComponent(destinationId)}`,
31+
`${API_ROOT}/monitor/streams/destinations/${encodeURIComponent(destinationId)}`,
3232
),
3333
setMethod('GET'),
3434
);
@@ -39,7 +39,7 @@ export const getDestination = (destinationId: number) =>
3939
*/
4040
export const getDestinations = (params?: Params, filter?: Filter) =>
4141
Request<Page<Destination>>(
42-
setURL(`${BETA_API_ROOT}/monitor/streams/destinations`),
42+
setURL(`${API_ROOT}/monitor/streams/destinations`),
4343
setMethod('GET'),
4444
setParams(params),
4545
setXFilter(filter),
@@ -53,7 +53,7 @@ export const getDestinations = (params?: Params, filter?: Filter) =>
5353
export const createDestination = (data: CreateDestinationPayload) =>
5454
Request<Destination>(
5555
setData(data, createDestinationSchema),
56-
setURL(`${BETA_API_ROOT}/monitor/streams/destinations`),
56+
setURL(`${API_ROOT}/monitor/streams/destinations`),
5757
setMethod('POST'),
5858
);
5959

@@ -70,7 +70,7 @@ export const updateDestination = (
7070
Request<Destination>(
7171
setData(data, updateDestinationSchema),
7272
setURL(
73-
`${BETA_API_ROOT}/monitor/streams/destinations/${encodeURIComponent(destinationId)}`,
73+
`${API_ROOT}/monitor/streams/destinations/${encodeURIComponent(destinationId)}`,
7474
),
7575
setMethod('PUT'),
7676
);
@@ -83,7 +83,7 @@ export const updateDestination = (
8383
export const deleteDestination = (destinationId: number) =>
8484
Request<{}>(
8585
setURL(
86-
`${BETA_API_ROOT}/monitor/streams/destinations/${encodeURIComponent(destinationId)}`,
86+
`${API_ROOT}/monitor/streams/destinations/${encodeURIComponent(destinationId)}`,
8787
),
8888
setMethod('DELETE'),
8989
);
@@ -96,6 +96,6 @@ export const deleteDestination = (destinationId: number) =>
9696
export const verifyDestination = (data: CreateDestinationPayload) =>
9797
Request<Destination>(
9898
setData(data, createDestinationSchema),
99-
setURL(`${BETA_API_ROOT}/monitor/streams/destinations/verify`),
99+
setURL(`${API_ROOT}/monitor/streams/destinations/verify`),
100100
setMethod('POST'),
101101
);

packages/api-v4/src/delivery/streams.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { createStreamSchema, updateStreamSchema } from '@linode/validation';
22

3-
import { BETA_API_ROOT } from '../constants';
3+
import { API_ROOT } from '../constants';
44
import Request, {
55
setData,
66
setMethod,
@@ -20,7 +20,7 @@ import type { CreateStreamPayload, Stream, UpdateStreamPayload } from './types';
2020
*/
2121
export const getStream = (streamId: number) =>
2222
Request<Stream>(
23-
setURL(`${BETA_API_ROOT}/monitor/streams/${encodeURIComponent(streamId)}`),
23+
setURL(`${API_ROOT}/monitor/streams/${encodeURIComponent(streamId)}`),
2424
setMethod('GET'),
2525
);
2626

@@ -30,7 +30,7 @@ export const getStream = (streamId: number) =>
3030
*/
3131
export const getStreams = (params?: Params, filter?: Filter) =>
3232
Request<Page<Stream>>(
33-
setURL(`${BETA_API_ROOT}/monitor/streams`),
33+
setURL(`${API_ROOT}/monitor/streams`),
3434
setMethod('GET'),
3535
setParams(params),
3636
setXFilter(filter),
@@ -44,7 +44,7 @@ export const getStreams = (params?: Params, filter?: Filter) =>
4444
export const createStream = (data: CreateStreamPayload) =>
4545
Request<Stream>(
4646
setData(data, createStreamSchema),
47-
setURL(`${BETA_API_ROOT}/monitor/streams`),
47+
setURL(`${API_ROOT}/monitor/streams`),
4848
setMethod('POST'),
4949
);
5050

@@ -57,7 +57,7 @@ export const createStream = (data: CreateStreamPayload) =>
5757
export const updateStream = (streamId: number, data: UpdateStreamPayload) =>
5858
Request<Stream>(
5959
setData(data, updateStreamSchema),
60-
setURL(`${BETA_API_ROOT}/monitor/streams/${encodeURIComponent(streamId)}`),
60+
setURL(`${API_ROOT}/monitor/streams/${encodeURIComponent(streamId)}`),
6161
setMethod('PUT'),
6262
);
6363

@@ -68,6 +68,6 @@ export const updateStream = (streamId: number, data: UpdateStreamPayload) =>
6868
*/
6969
export const deleteStream = (streamId: number) =>
7070
Request<{}>(
71-
setURL(`${BETA_API_ROOT}/monitor/streams/${encodeURIComponent(streamId)}`),
71+
setURL(`${API_ROOT}/monitor/streams/${encodeURIComponent(streamId)}`),
7272
setMethod('DELETE'),
7373
);
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@linode/manager": Changed
3+
---
4+
5+
Delivery CRUD mocks update from Beta APIv4 to APIv4 ([#13461](https://github.com/linode/manager/pull/13461))

packages/manager/src/mocks/presets/crud/handlers/delivery.ts

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ import type {
3434

3535
export const getStreams = () => [
3636
http.get(
37-
'*/v4beta/monitor/streams',
37+
'*/v4/monitor/streams',
3838
async ({
3939
request,
4040
}): Promise<
@@ -53,7 +53,7 @@ export const getStreams = () => [
5353
}
5454
),
5555
http.get(
56-
'*/v4beta/monitor/streams/:id',
56+
'*/v4/monitor/streams/:id',
5757
async ({ params }): Promise<StrictResponse<APIErrorResponse | Stream>> => {
5858
const id = Number(params.id);
5959
const stream = await mswDB.get('streams', id);
@@ -69,7 +69,7 @@ export const getStreams = () => [
6969

7070
export const createStreams = (mockState: MockState) => [
7171
http.post(
72-
'*/v4beta/monitor/streams',
72+
'*/v4/monitor/streams',
7373
async ({ request }): Promise<StrictResponse<APIErrorResponse | Stream>> => {
7474
const payload = await request.clone().json();
7575
const destinations = await mswDB.getAll('destinations');
@@ -94,7 +94,7 @@ export const createStreams = (mockState: MockState) => [
9494
id: stream.id,
9595
label: stream.label,
9696
type: 'stream',
97-
url: `/v4beta/delivery/streams`,
97+
url: `/v4/delivery/streams`,
9898
},
9999
},
100100
mockState,
@@ -108,7 +108,7 @@ export const createStreams = (mockState: MockState) => [
108108

109109
export const updateStream = (mockState: MockState) => [
110110
http.put(
111-
'*/v4beta/monitor/streams/:id',
111+
'*/v4/monitor/streams/:id',
112112
async ({
113113
params,
114114
request,
@@ -140,7 +140,7 @@ export const updateStream = (mockState: MockState) => [
140140
id: stream.id,
141141
label: stream.label,
142142
type: 'stream',
143-
url: `/v4beta/monitor/streams/${stream.id}`,
143+
url: `/v4/monitor/streams/${stream.id}`,
144144
},
145145
},
146146
mockState,
@@ -154,7 +154,7 @@ export const updateStream = (mockState: MockState) => [
154154

155155
export const deleteStream = (mockState: MockState) => [
156156
http.delete(
157-
'*/v4beta/monitor/streams/:id',
157+
'*/v4/monitor/streams/:id',
158158
async ({ params }): Promise<StrictResponse<APIErrorResponse | {}>> => {
159159
const id = Number(params.id);
160160
const stream = await mswDB.get('streams', id);
@@ -172,7 +172,7 @@ export const deleteStream = (mockState: MockState) => [
172172
id: stream.id,
173173
label: stream.label,
174174
type: 'domain',
175-
url: `/v4beta/monitor/streams/${stream.id}`,
175+
url: `/v4/monitor/streams/${stream.id}`,
176176
},
177177
},
178178
mockState,
@@ -186,7 +186,7 @@ export const deleteStream = (mockState: MockState) => [
186186

187187
export const getDestinations = () => [
188188
http.get(
189-
'*/v4beta/monitor/streams/destinations',
189+
'*/v4/monitor/streams/destinations',
190190
async ({
191191
request,
192192
}): Promise<
@@ -205,7 +205,7 @@ export const getDestinations = () => [
205205
}
206206
),
207207
http.get(
208-
'*/v4beta/monitor/streams/destinations/:id',
208+
'*/v4/monitor/streams/destinations/:id',
209209
async ({
210210
params,
211211
}): Promise<StrictResponse<APIErrorResponse | Destination>> => {
@@ -223,7 +223,7 @@ export const getDestinations = () => [
223223

224224
export const createDestinations = (mockState: MockState) => [
225225
http.post(
226-
'*/v4beta/monitor/streams/destinations',
226+
'*/v4/monitor/streams/destinations',
227227
async ({
228228
request,
229229
}): Promise<StrictResponse<APIErrorResponse | Destination>> => {
@@ -278,7 +278,7 @@ export const createDestinations = (mockState: MockState) => [
278278
id: destination.id,
279279
label: destination.label,
280280
type: 'destination',
281-
url: `/v4beta/delivery/streams/destinations`,
281+
url: `/v4/delivery/streams/destinations`,
282282
},
283283
},
284284
mockState,
@@ -292,7 +292,7 @@ export const createDestinations = (mockState: MockState) => [
292292

293293
export const updateDestination = (mockState: MockState) => [
294294
http.put(
295-
'*/v4beta/monitor/streams/destinations/:id',
295+
'*/v4/monitor/streams/destinations/:id',
296296
async ({
297297
params,
298298
request,
@@ -322,7 +322,7 @@ export const updateDestination = (mockState: MockState) => [
322322
id: destination.id,
323323
label: destination.label,
324324
type: 'stream',
325-
url: `/v4beta/monitor/streams/${destination.id}`,
325+
url: `/v4/monitor/streams/${destination.id}`,
326326
},
327327
},
328328
mockState,
@@ -336,7 +336,7 @@ export const updateDestination = (mockState: MockState) => [
336336

337337
export const deleteDestination = (mockState: MockState) => [
338338
http.delete(
339-
'*/v4beta/monitor/streams/destinations/:id',
339+
'*/v4/monitor/streams/destinations/:id',
340340
async ({ params }): Promise<StrictResponse<APIErrorResponse | {}>> => {
341341
const id = Number(params.id);
342342
const destination = await mswDB.get('destinations', id);
@@ -367,7 +367,7 @@ export const deleteDestination = (mockState: MockState) => [
367367
id: destination.id,
368368
label: destination.label,
369369
type: 'domain',
370-
url: `/v4beta/monitor/streams/${destination.id}`,
370+
url: `/v4/monitor/streams/${destination.id}`,
371371
},
372372
},
373373
mockState,
@@ -381,7 +381,7 @@ export const deleteDestination = (mockState: MockState) => [
381381

382382
export const verifyDestination = () => [
383383
http.post(
384-
'*/v4beta/monitor/streams/destinations/verify',
384+
'*/v4/monitor/streams/destinations/verify',
385385
async (): Promise<StrictResponse<APIErrorResponse | {}>> => {
386386
return makeResponse({}, 200);
387387
}

0 commit comments

Comments
 (0)