Skip to content

Commit af118d3

Browse files
Merge pull request #13181 from linode/staging
Release v1.156.0 - `staging` → `master`
2 parents 5d74bc6 + 7e98ba1 commit af118d3

File tree

455 files changed

+18773
-5133
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

455 files changed

+18773
-5133
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
"concurrently": "9.1.0",
99
"husky": "^9.1.6",
1010
"typescript": "^5.7.3",
11-
"vitest": "^3.2.4",
12-
"@vitest/ui": "^3.2.4",
11+
"vitest": "^4.0.10",
12+
"@vitest/ui": "^4.0.10",
1313
"lint-staged": "^15.4.3",
1414
"eslint": "^9.24.0",
1515
"eslint-config-prettier": "^10.1.1",

packages/api-v4/CHANGELOG.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,25 @@
1+
## [2025-12-09] - v0.154.0
2+
3+
4+
### Changed:
5+
6+
- Update database restoreWithBackup data to include region ([#13097](https://github.com/linode/manager/pull/13097))
7+
- Add private_network to `DatabaseBackupsPayload` ([#13174](https://github.com/linode/manager/pull/13174))
8+
9+
### Tech Stories:
10+
11+
- Add `@types/node` as a devDependency ([#13119](https://github.com/linode/manager/pull/13119))
12+
13+
### Upcoming Features:
14+
15+
- Add new API endpoints and types for Network Load Balancers ([#13078](https://github.com/linode/manager/pull/13078))
16+
- Update FirewallRuleType to support ruleset ([#13079](https://github.com/linode/manager/pull/13079))
17+
- Add additional status types `enabling`, `disabling`, `provisioning` in CloudPulse alerts ([#13127](https://github.com/linode/manager/pull/13127))
18+
- CloudPulse-Metrics: Update `entity_ids` type in `CloudPulseMetricsRequest` for metrics api in endpoints dahsboard ([#13133](https://github.com/linode/manager/pull/13133))
19+
- Add `deleted` property to `FirewallPrefixList` type after API update ([#13146](https://github.com/linode/manager/pull/13146))
20+
- Added Database Connection Pool types and endpoints ([#13148](https://github.com/linode/manager/pull/13148))
21+
- Add 'Cloud Firewall Rule Set' to AccountCapability type ([#13156](https://github.com/linode/manager/pull/13156))
22+
123
## [2025-11-18] - v0.153.0
224

325

packages/api-v4/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@linode/api-v4",
3-
"version": "0.153.0",
3+
"version": "0.154.0",
44
"homepage": "https://github.com/linode/manager/tree/develop/packages/api-v4",
55
"bugs": {
66
"url": "https://github.com/linode/manager/issues"
@@ -59,7 +59,8 @@
5959
"@linode/tsconfig": "workspace:*",
6060
"axios-mock-adapter": "^1.22.0",
6161
"concurrently": "^9.0.1",
62-
"tsup": "^8.4.0"
62+
"tsup": "^8.4.0",
63+
"@types/node": "^22.13.14"
6364
},
6465
"lint-staged": {
6566
"*.{ts,tsx,js}": [

packages/api-v4/src/account/types.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ export const accountCapabilities = [
6666
'Block Storage',
6767
'Block Storage Encryption',
6868
'Cloud Firewall',
69+
'Cloud Firewall Rule Set',
6970
'CloudPulse',
7071
'Disk Encryption',
7172
'Kubernetes',
@@ -80,6 +81,7 @@ export const accountCapabilities = [
8081
'Managed Databases',
8182
'Managed Databases Beta',
8283
'NETINT Quadra T1U',
84+
'Network LoadBalancer',
8385
'NodeBalancers',
8486
'Object Storage Access Key Regions',
8587
'Object Storage Endpoint Types',

packages/api-v4/src/cloudpulse/types.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,15 @@ export type DimensionFilterOperatorType =
1919
| 'neq'
2020
| 'startswith';
2121
export type AlertDefinitionType = 'system' | 'user';
22-
export type AlertStatusType = 'disabled' | 'enabled' | 'failed' | 'in progress';
2322
export type AlertDefinitionScope = 'account' | 'entity' | 'region';
23+
export type AlertStatusType =
24+
| 'disabled'
25+
| 'disabling'
26+
| 'enabled'
27+
| 'enabling'
28+
| 'failed'
29+
| 'in progress'
30+
| 'provisioning';
2431
export type CriteriaConditionType = 'ALL';
2532
export type MetricUnitType =
2633
| 'bit_per_second'
@@ -152,7 +159,7 @@ export interface Metric {
152159
export interface CloudPulseMetricsRequest {
153160
absolute_time_duration: DateTimeWithPreset | undefined;
154161
associated_entity_region?: string;
155-
entity_ids: number[] | string[];
162+
entity_ids: number[] | string[] | undefined;
156163
entity_region?: string;
157164
filters?: Filters[];
158165
group_by?: string[];

packages/api-v4/src/databases/databases.ts

Lines changed: 79 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import {
2+
createDatabaseConnectionPoolSchema,
23
createDatabaseSchema,
4+
updateDatabaseConnectionPoolSchema,
35
updateDatabaseSchema,
46
} from '@linode/validation/lib/databases.schema';
57

@@ -14,13 +16,14 @@ import Request, {
1416

1517
import type { Filter, ResourcePage as Page, Params } from '../types';
1618
import type {
19+
ConnectionPool,
1720
CreateDatabasePayload,
1821
Database,
1922
DatabaseBackup,
23+
DatabaseBackupsPayload,
2024
DatabaseCredentials,
2125
DatabaseEngine,
2226
DatabaseEngineConfig,
23-
DatabaseFork,
2427
DatabaseInstance,
2528
DatabaseType,
2629
Engine,
@@ -267,11 +270,14 @@ export const legacyRestoreWithBackup = (
267270
*
268271
* Fully restore a backup to the cluster
269272
*/
270-
export const restoreWithBackup = (engine: Engine, fork: DatabaseFork) =>
273+
export const restoreWithBackup = (
274+
engine: Engine,
275+
data: DatabaseBackupsPayload,
276+
) =>
271277
Request<Database>(
272278
setURL(`${API_ROOT}/databases/${encodeURIComponent(engine)}/instances`),
273279
setMethod('POST'),
274-
setData({ fork }),
280+
setData(data),
275281
);
276282

277283
/**
@@ -361,3 +367,73 @@ export const getDatabaseEngineConfig = (engine: Engine) =>
361367
setURL(`${API_ROOT}/databases/${encodeURIComponent(engine)}/config`),
362368
setMethod('GET'),
363369
);
370+
371+
/**
372+
* Get a paginated list of connection pools for a database
373+
*/
374+
export const getDatabaseConnectionPools = (databaseID: number) =>
375+
Request<Page<ConnectionPool>>(
376+
setURL(
377+
`${API_ROOT}/databases/postgresql/instances/${encodeURIComponent(databaseID)}/connection-pools`,
378+
),
379+
setMethod('GET'),
380+
);
381+
382+
/**
383+
* Get a connection pool for a database
384+
*/
385+
export const getDatabaseConnectionPool = (
386+
databaseID: number,
387+
poolName: string,
388+
) =>
389+
Request<ConnectionPool>(
390+
setURL(
391+
`${API_ROOT}/databases/postgresql/instances/${encodeURIComponent(databaseID)}/connection-pools/${encodeURIComponent(poolName)}`,
392+
),
393+
setMethod('GET'),
394+
);
395+
396+
/**
397+
* Create a new connection pool for a database. Connection pools can only be created on active clusters
398+
*/
399+
export const createDatabaseConnectionPool = (
400+
databaseID: number,
401+
data: ConnectionPool,
402+
) =>
403+
Request<ConnectionPool>(
404+
setURL(
405+
`${API_ROOT}/databases/postgresql/instances/${encodeURIComponent(databaseID)}/connection-pools`,
406+
),
407+
setMethod('POST'),
408+
setData(data, createDatabaseConnectionPoolSchema),
409+
);
410+
411+
/**
412+
* Update an existing connection pool. This may cause sudden closure of an in-use connection pool
413+
*/
414+
export const updateDatabaseConnectionPool = (
415+
databaseID: number,
416+
poolName: string,
417+
data: Omit<ConnectionPool, 'label'>,
418+
) =>
419+
Request<ConnectionPool>(
420+
setURL(
421+
`${API_ROOT}/databases/postgresql/instances/${encodeURIComponent(databaseID)}/connection-pools/${encodeURIComponent(poolName)}`,
422+
),
423+
setMethod('PUT'),
424+
setData(data, updateDatabaseConnectionPoolSchema),
425+
);
426+
427+
/**
428+
* Delete an existing connection pool. This may cause sudden closure of an in-use connection pool
429+
*/
430+
export const deleteDatabaseConnectionPool = (
431+
databaseID: number,
432+
poolName: string,
433+
) =>
434+
Request<{}>(
435+
setURL(
436+
`${API_ROOT}/databases/postgresql/instances/${encodeURIComponent(databaseID)}/connection-pools/${encodeURIComponent(poolName)}`,
437+
),
438+
setMethod('DELETE'),
439+
);

packages/api-v4/src/databases/types.ts

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,12 @@ export interface DatabaseFork {
7979
source: number;
8080
}
8181

82+
export interface DatabaseBackupsPayload {
83+
fork: DatabaseFork;
84+
private_network?: null | PrivateNetwork;
85+
region?: string;
86+
}
87+
8288
export interface DatabaseCredentials {
8389
password: string;
8490
username: string;
@@ -100,6 +106,7 @@ type MemberType = 'failover' | 'primary';
100106
export interface DatabaseInstance {
101107
allow_list: string[];
102108
cluster_size: ClusterSize;
109+
connection_pool_port: null | number;
103110
connection_strings: ConnectionStrings[];
104111
created: string;
105112
/** @Deprecated used by rdbms-legacy only, rdbms-default always encrypts */
@@ -163,12 +170,10 @@ interface ConnectionStrings {
163170
value: string;
164171
}
165172

166-
export type UpdatesFrequency = 'monthly' | 'weekly';
167-
168173
export interface UpdatesSchedule {
169174
day_of_week: number;
170175
duration: number;
171-
frequency: UpdatesFrequency;
176+
frequency: 'monthly' | 'weekly';
172177
hour_of_day: number;
173178
pending?: PendingUpdates[];
174179
week_of_month: null | number;
@@ -246,3 +251,13 @@ export interface UpdateDatabasePayload {
246251
updates?: UpdatesSchedule;
247252
version?: string;
248253
}
254+
255+
export type PoolMode = 'session' | 'statement' | 'transaction';
256+
257+
export interface ConnectionPool {
258+
database: string;
259+
label: string;
260+
mode: PoolMode;
261+
size: number;
262+
username: null | string;
263+
}

packages/api-v4/src/firewalls/types.ts

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,16 +36,26 @@ export type UpdateFirewallRules = Omit<
3636

3737
export type FirewallTemplateRules = UpdateFirewallRules;
3838

39+
/**
40+
* The API may return either a full firewall rule object or a ruleset reference
41+
* containing only the `ruleset` field. This interface supports both formats
42+
* to ensure backward compatibility with existing implementations and avoid
43+
* widespread refactoring.
44+
*/
3945
export interface FirewallRuleType {
40-
action: FirewallPolicyType;
46+
action?: FirewallPolicyType | null;
4147
addresses?: null | {
4248
ipv4?: null | string[];
4349
ipv6?: null | string[];
4450
};
4551
description?: null | string;
4652
label?: null | string;
47-
ports?: string;
48-
protocol: FirewallRuleProtocol;
53+
ports?: null | string;
54+
protocol?: FirewallRuleProtocol | null;
55+
/**
56+
* Present when the object represents a ruleset reference.
57+
*/
58+
ruleset?: null | number;
4959
}
5060

5161
export interface FirewallDeviceEntity {
@@ -124,6 +134,7 @@ export type FirewallPrefixListVisibility = 'private' | 'public' | 'restricted';
124134

125135
export interface FirewallPrefixList {
126136
created: string;
137+
deleted: null | string;
127138
description: string;
128139
id: number;
129140
ipv4?: null | string[];

packages/api-v4/src/iam/iam.ts

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
import { BETA_API_ROOT } from '../constants';
2-
import Request, { setData, setMethod, setURL } from '../request';
2+
import Request, {
3+
setData,
4+
setMethod,
5+
setParams,
6+
setURL,
7+
setXFilter,
8+
} from '../request';
39

10+
import type { Filter, Params, ResourcePage } from '../types';
411
import type {
512
AccessType,
613
EntityByPermission,
@@ -9,7 +16,6 @@ import type {
916
PermissionType,
1017
} from './types';
1118
import type { EntityType } from 'src/entities/types';
12-
1319
/**
1420
* getUserRoles
1521
*
@@ -93,6 +99,8 @@ export const getUserEntityPermissions = (
9399
username: string,
94100
entityType: AccessType,
95101
entityId: number | string,
102+
params?: Params,
103+
filter?: Filter,
96104
) =>
97105
Request<PermissionType[]>(
98106
setURL(
@@ -101,6 +109,8 @@ export const getUserEntityPermissions = (
101109
)}/permissions/${entityType}/${entityId}`,
102110
),
103111
setMethod('GET'),
112+
setParams(params),
113+
setXFilter(filter),
104114
);
105115

106116
/**
@@ -109,7 +119,10 @@ export const getUserEntityPermissions = (
109119
* Returns the available entities for a given permission.
110120
*/
111121
export interface GetEntitiesByPermissionParams {
122+
enabled?: boolean;
112123
entityType: EntityType;
124+
filter?: Filter;
125+
params?: Params;
113126
permission: PermissionType;
114127
username: string | undefined;
115128
}
@@ -118,10 +131,14 @@ export const getUserEntitiesByPermission = ({
118131
username,
119132
entityType,
120133
permission,
134+
params,
135+
filter,
121136
}: GetEntitiesByPermissionParams) =>
122-
Request<EntityByPermission[]>(
137+
Request<ResourcePage<EntityByPermission>>(
123138
setURL(
124139
`${BETA_API_ROOT}/iam/users/${username}/entities/${entityType}?permission=${permission}`,
125140
),
126141
setMethod('GET'),
142+
setParams(params),
143+
setXFilter(filter),
127144
);

packages/api-v4/src/iam/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,7 @@ export interface Roles {
457457
permissions: PermissionType[];
458458
}
459459
export interface EntityByPermission {
460-
id: number;
460+
id: number | string;
461461
label: string;
462462
type: EntityType;
463463
}

0 commit comments

Comments
 (0)