@leavepulse/control-sdk 0.3.31 → 0.3.33

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/client.ts CHANGED
@@ -13,9 +13,12 @@ import { ControlCfAccount } from "./resources/ControlCfAccount";
13
13
  import { ControlDcimAcceptance } from "./resources/ControlDcimAcceptance";
14
14
  import { ControlDcimCable } from "./resources/ControlDcimCable";
15
15
  import { ControlDcimComponent } from "./resources/ControlDcimComponent";
16
+ import { ControlDcimComponentType } from "./resources/ControlDcimComponentType";
16
17
  import { ControlDcimDevice } from "./resources/ControlDcimDevice";
18
+ import { ControlDcimDeviceType } from "./resources/ControlDcimDeviceType";
17
19
  import { ControlDcimFeed } from "./resources/ControlDcimFeed";
18
20
  import { ControlDcimLocation } from "./resources/ControlDcimLocation";
21
+ import { ControlDcimManufacturer } from "./resources/ControlDcimManufacturer";
19
22
  import { ControlDcimOutlet } from "./resources/ControlDcimOutlet";
20
23
  import { ControlDcimPdu } from "./resources/ControlDcimPdu";
21
24
  import { ControlDcimPort } from "./resources/ControlDcimPort";
@@ -45,6 +48,7 @@ export class LeavePulse {
45
48
  private readonly ctx: ClientContext;
46
49
  private _controlagentrelease?: ControlAgentRelease;
47
50
  private _controlalert?: ControlAlert;
51
+ private _controldcimmanufacturer?: ControlDcimManufacturer;
48
52
  private _controlproject?: ControlProject;
49
53
  readonly auth: AuthNs;
50
54
  readonly control: ControlNs;
@@ -127,6 +131,14 @@ export class LeavePulse {
127
131
  ) as ControlDcimComponent;
128
132
  }
129
133
 
134
+ controldcimcomponenttype(id: string): ControlDcimComponentType {
135
+ return this.ctx.cache.ensure(
136
+ "ControlDcimComponentType",
137
+ id,
138
+ () => new ControlDcimComponentType({ id } as never, this.ctx),
139
+ ) as ControlDcimComponentType;
140
+ }
141
+
130
142
  controldcimdevice(id: string): ControlDcimDevice {
131
143
  return this.ctx.cache.ensure(
132
144
  "ControlDcimDevice",
@@ -135,6 +147,14 @@ export class LeavePulse {
135
147
  ) as ControlDcimDevice;
136
148
  }
137
149
 
150
+ controldcimdevicetype(id: string): ControlDcimDeviceType {
151
+ return this.ctx.cache.ensure(
152
+ "ControlDcimDeviceType",
153
+ id,
154
+ () => new ControlDcimDeviceType({ id } as never, this.ctx),
155
+ ) as ControlDcimDeviceType;
156
+ }
157
+
138
158
  controldcimfeed(id: string): ControlDcimFeed {
139
159
  return this.ctx.cache.ensure(
140
160
  "ControlDcimFeed",
@@ -151,6 +171,14 @@ export class LeavePulse {
151
171
  ) as ControlDcimLocation;
152
172
  }
153
173
 
174
+ get controldcimmanufacturer(): ControlDcimManufacturer {
175
+ this._controldcimmanufacturer ??= new ControlDcimManufacturer(
176
+ {} as never,
177
+ this.ctx,
178
+ );
179
+ return this._controldcimmanufacturer;
180
+ }
181
+
154
182
  controldcimoutlet(id: string): ControlDcimOutlet {
155
183
  return this.ctx.cache.ensure(
156
184
  "ControlDcimOutlet",
@@ -277,9 +305,15 @@ export class LeavePulse {
277
305
  ControlDcimCable: (d) => new ControlDcimCable(d as never, this.ctx),
278
306
  ControlDcimComponent: (d) =>
279
307
  new ControlDcimComponent(d as never, this.ctx),
308
+ ControlDcimComponentType: (d) =>
309
+ new ControlDcimComponentType(d as never, this.ctx),
280
310
  ControlDcimDevice: (d) => new ControlDcimDevice(d as never, this.ctx),
311
+ ControlDcimDeviceType: (d) =>
312
+ new ControlDcimDeviceType(d as never, this.ctx),
281
313
  ControlDcimFeed: (d) => new ControlDcimFeed(d as never, this.ctx),
282
314
  ControlDcimLocation: (d) => new ControlDcimLocation(d as never, this.ctx),
315
+ ControlDcimManufacturer: (d) =>
316
+ new ControlDcimManufacturer(d as never, this.ctx),
283
317
  ControlDcimOutlet: (d) => new ControlDcimOutlet(d as never, this.ctx),
284
318
  ControlDcimPdu: (d) => new ControlDcimPdu(d as never, this.ctx),
285
319
  ControlDcimPort: (d) => new ControlDcimPort(d as never, this.ctx),
package/index.ts CHANGED
@@ -9,9 +9,12 @@ export { ControlCfAccount } from "./resources/ControlCfAccount";
9
9
  export { ControlDcimAcceptance } from "./resources/ControlDcimAcceptance";
10
10
  export { ControlDcimCable } from "./resources/ControlDcimCable";
11
11
  export { ControlDcimComponent } from "./resources/ControlDcimComponent";
12
+ export { ControlDcimComponentType } from "./resources/ControlDcimComponentType";
12
13
  export { ControlDcimDevice } from "./resources/ControlDcimDevice";
14
+ export { ControlDcimDeviceType } from "./resources/ControlDcimDeviceType";
13
15
  export { ControlDcimFeed } from "./resources/ControlDcimFeed";
14
16
  export { ControlDcimLocation } from "./resources/ControlDcimLocation";
17
+ export { ControlDcimManufacturer } from "./resources/ControlDcimManufacturer";
15
18
  export { ControlDcimOutlet } from "./resources/ControlDcimOutlet";
16
19
  export { ControlDcimPdu } from "./resources/ControlDcimPdu";
17
20
  export { ControlDcimPort } from "./resources/ControlDcimPort";
package/models.ts CHANGED
@@ -13,6 +13,10 @@ export type AffectedDeviceDTO = components["schemas"]["AffectedDeviceDTO"];
13
13
  export type AgentReleaseDTO = components["schemas"]["AgentReleaseDTO"];
14
14
  export type AlertDTO = components["schemas"]["AlertDTO"];
15
15
  export type AlertListResponse = components["schemas"]["AlertListResponse"];
16
+ export type ApplyDeviceTypeRequest =
17
+ components["schemas"]["ApplyDeviceTypeRequest"];
18
+ export type ApplyDeviceTypeResultDTO =
19
+ components["schemas"]["ApplyDeviceTypeResultDTO"];
16
20
  export type CableDTO = components["schemas"]["CableDTO"];
17
21
  export type CableListResponse = components["schemas"]["CableListResponse"];
18
22
  export type CableTerminalDTO = components["schemas"]["CableTerminalDTO"];
@@ -24,6 +28,9 @@ export type CfAccountListResponse =
24
28
  export type ComponentDTO = components["schemas"]["ComponentDTO"];
25
29
  export type ComponentListResponse =
26
30
  components["schemas"]["ComponentListResponse"];
31
+ export type ComponentTypeDTO = components["schemas"]["ComponentTypeDTO"];
32
+ export type ComponentTypeListResponse =
33
+ components["schemas"]["ComponentTypeListResponse"];
27
34
  export type ComposePreviewDTO = components["schemas"]["ComposePreviewDTO"];
28
35
  export type ConfigFileDTO = components["schemas"]["ConfigFileDTO"];
29
36
  export type ConnectPowerRequest = components["schemas"]["ConnectPowerRequest"];
@@ -65,6 +72,11 @@ export type DeploymentListResponse =
65
72
  export type DetectedExporterDTO = components["schemas"]["DetectedExporterDTO"];
66
73
  export type DeviceDTO = components["schemas"]["DeviceDTO"];
67
74
  export type DeviceListResponse = components["schemas"]["DeviceListResponse"];
75
+ export type DeviceTypeDTO = components["schemas"]["DeviceTypeDTO"];
76
+ export type DeviceTypeListResponse =
77
+ components["schemas"]["DeviceTypeListResponse"];
78
+ export type DeviceTypePortDTO = components["schemas"]["DeviceTypePortDTO"];
79
+ export type DeviceTypePortInput = components["schemas"]["DeviceTypePortInput"];
68
80
  export type DiskCategory = components["schemas"]["DiskCategory"];
69
81
  export type DiskUsageDTO = components["schemas"]["DiskUsageDTO"];
70
82
  export type DisputeAcceptanceRequest =
@@ -94,6 +106,11 @@ export type FirewallRulesResponse =
94
106
  export type HostCapabilitiesDTO = components["schemas"]["HostCapabilitiesDTO"];
95
107
  export type HostDTO = components["schemas"]["HostDTO"];
96
108
  export type HostListResponse = components["schemas"]["HostListResponse"];
109
+ export type ImportDeviceTypesRequest =
110
+ components["schemas"]["ImportDeviceTypesRequest"];
111
+ export type ImportDeviceTypesResponse =
112
+ components["schemas"]["ImportDeviceTypesResponse"];
113
+ export type ImportDocumentInput = components["schemas"]["ImportDocumentInput"];
97
114
  export type InspectResponse = components["schemas"]["InspectResponse"];
98
115
  export type InstallExporterRequest =
99
116
  components["schemas"]["InstallExporterRequest"];
@@ -102,6 +119,9 @@ export type InstallExporterResponse =
102
119
  export type LocationDTO = components["schemas"]["LocationDTO"];
103
120
  export type LocationListResponse =
104
121
  components["schemas"]["LocationListResponse"];
122
+ export type ManufacturerDTO = components["schemas"]["ManufacturerDTO"];
123
+ export type ManufacturerListResponse =
124
+ components["schemas"]["ManufacturerListResponse"];
105
125
  export type NodeDTO = components["schemas"]["NodeDTO"];
106
126
  export type OutletDTO = components["schemas"]["OutletDTO"];
107
127
  export type OutletListResponse = components["schemas"]["OutletListResponse"];
@@ -146,6 +166,8 @@ export type SetAcceptanceItemsRequest =
146
166
  components["schemas"]["SetAcceptanceItemsRequest"];
147
167
  export type SetCanvasViewRequest =
148
168
  components["schemas"]["SetCanvasViewRequest"];
169
+ export type SetDeviceTypePortsRequest =
170
+ components["schemas"]["SetDeviceTypePortsRequest"];
149
171
  export type SetPositionRequest = components["schemas"]["SetPositionRequest"];
150
172
  export type SetRoleRequest = components["schemas"]["SetRoleRequest"];
151
173
  export type SignAcceptanceRequest =
@@ -173,11 +195,17 @@ export type UpdateOutletRequest = components["schemas"]["UpdateOutletRequest"];
173
195
  export type UpdatePduRequest = components["schemas"]["UpdatePduRequest"];
174
196
  export type UpdatePortRequest = components["schemas"]["UpdatePortRequest"];
175
197
  export type UpdateRackRequest = components["schemas"]["UpdateRackRequest"];
198
+ export type UpsertComponentTypeRequest =
199
+ components["schemas"]["UpsertComponentTypeRequest"];
200
+ export type UpsertDeviceTypeRequest =
201
+ components["schemas"]["UpsertDeviceTypeRequest"];
176
202
  export type UpsertDnsRecordRequest =
177
203
  components["schemas"]["UpsertDnsRecordRequest"];
178
204
  export type UpsertEdgeRequest = components["schemas"]["UpsertEdgeRequest"];
179
205
  export type UpsertEnvGroupRequest =
180
206
  components["schemas"]["UpsertEnvGroupRequest"];
207
+ export type UpsertManufacturerRequest =
208
+ components["schemas"]["UpsertManufacturerRequest"];
181
209
  export type UpsertNodeRequest = components["schemas"]["UpsertNodeRequest"];
182
210
  export type UpsertProjectRequest =
183
211
  components["schemas"]["UpsertProjectRequest"];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leavepulse/control-sdk",
3
- "version": "0.3.31",
3
+ "version": "0.3.33",
4
4
  "description": "Generated resource SDK (@leavepulse/control-sdk).",
5
5
  "type": "module",
6
6
  "module": "index.ts",
@@ -10,8 +10,7 @@
10
10
  "url": "git+https://github.com/LeavePulse/leavepulse-sdk-control-ts.git"
11
11
  },
12
12
  "publishConfig": {
13
- "registry": "https://registry.npmjs.org",
14
- "access": "public"
13
+ "registry": "https://npm.pkg.github.com"
15
14
  },
16
15
  "exports": {
17
16
  ".": "./index.ts",
@@ -0,0 +1,56 @@
1
+ // Generated from the LeavePulse contract. Do not edit.
2
+ import { Resource } from "../runtime/resource";
3
+ import { fetchCachedOrThrow } from "../runtime/etag-store";
4
+ import type * as models from "../models";
5
+ import type { ClientContext } from "../client";
6
+
7
+ type Data = { id: string | number } & Record<string, unknown>;
8
+
9
+ export class ControlDcimComponentType extends Resource<Data> {
10
+ constructor(
11
+ data: Data,
12
+ private readonly ctx: ClientContext,
13
+ ) {
14
+ super(data);
15
+ }
16
+
17
+ /** control.dcim.catalog.component_types.list */
18
+ async controlDcimCatalogComponentTypesList(params?: {
19
+ manufacturer?: string;
20
+ kind?: string;
21
+ search?: string;
22
+ }): Promise<models.ComponentTypeListResponse> {
23
+ return fetchCachedOrThrow<models.ComponentTypeListResponse>(
24
+ this.ctx.transport,
25
+ this.ctx.etagStore,
26
+ {
27
+ method: "GET",
28
+ path: `/v1/control/dcim/catalog/component-types`,
29
+ query: {
30
+ manufacturer: params?.manufacturer,
31
+ kind: params?.kind,
32
+ search: params?.search,
33
+ },
34
+ },
35
+ );
36
+ }
37
+
38
+ /** control.dcim.catalog.component_types.upsert */
39
+ async dcimCatalogComponentTypesUpsert(
40
+ body: models.UpsertComponentTypeRequest,
41
+ ): Promise<models.ComponentTypeDTO> {
42
+ return this.ctx.transport.request<models.ComponentTypeDTO>({
43
+ method: "POST",
44
+ path: `/v1/control/dcim/catalog/component-types`,
45
+ body,
46
+ });
47
+ }
48
+
49
+ /** control.dcim.catalog.component_types.delete */
50
+ async dcimCatalogComponentTypesDelete(): Promise<models.DeleteResultDTO> {
51
+ return this.ctx.transport.request<models.DeleteResultDTO>({
52
+ method: "DELETE",
53
+ path: `/v1/control/dcim/catalog/component-types/${this.id}`,
54
+ });
55
+ }
56
+ }
@@ -68,4 +68,15 @@ export class ControlDcimDevice extends Resource<Data> {
68
68
  body,
69
69
  });
70
70
  }
71
+
72
+ /** control.dcim.devices.apply_type */
73
+ async dcimDevicesApplyType(
74
+ body: models.ApplyDeviceTypeRequest,
75
+ ): Promise<models.ApplyDeviceTypeResultDTO> {
76
+ return this.ctx.transport.request<models.ApplyDeviceTypeResultDTO>({
77
+ method: "POST",
78
+ path: `/v1/control/dcim/devices/${this.id}/device-type`,
79
+ body,
80
+ });
81
+ }
71
82
  }
@@ -0,0 +1,92 @@
1
+ // Generated from the LeavePulse contract. Do not edit.
2
+ import { Resource } from "../runtime/resource";
3
+ import { fetchCachedOrThrow } from "../runtime/etag-store";
4
+ import type * as models from "../models";
5
+ import type { ClientContext } from "../client";
6
+
7
+ type Data = { id: string | number } & Record<string, unknown>;
8
+
9
+ export class ControlDcimDeviceType extends Resource<Data> {
10
+ constructor(
11
+ data: Data,
12
+ private readonly ctx: ClientContext,
13
+ ) {
14
+ super(data);
15
+ }
16
+
17
+ /** control.dcim.catalog.device_types.list */
18
+ async controlDcimCatalogDeviceTypesList(params?: {
19
+ manufacturer?: string;
20
+ kind?: string;
21
+ search?: string;
22
+ completeOnly?: boolean;
23
+ }): Promise<models.DeviceTypeListResponse> {
24
+ return fetchCachedOrThrow<models.DeviceTypeListResponse>(
25
+ this.ctx.transport,
26
+ this.ctx.etagStore,
27
+ {
28
+ method: "GET",
29
+ path: `/v1/control/dcim/catalog/device-types`,
30
+ query: {
31
+ manufacturer: params?.manufacturer,
32
+ kind: params?.kind,
33
+ search: params?.search,
34
+ complete_only: params?.completeOnly,
35
+ },
36
+ },
37
+ );
38
+ }
39
+
40
+ /** control.dcim.catalog.device_types.get */
41
+ async controlDcimCatalogDeviceTypesGet(): Promise<models.DeviceTypeDTO> {
42
+ return fetchCachedOrThrow<models.DeviceTypeDTO>(
43
+ this.ctx.transport,
44
+ this.ctx.etagStore,
45
+ {
46
+ method: "GET",
47
+ path: `/v1/control/dcim/catalog/device-types/${this.id}`,
48
+ },
49
+ );
50
+ }
51
+
52
+ /** control.dcim.catalog.device_types.upsert */
53
+ async dcimCatalogDeviceTypesUpsert(
54
+ body: models.UpsertDeviceTypeRequest,
55
+ ): Promise<models.DeviceTypeDTO> {
56
+ return this.ctx.transport.request<models.DeviceTypeDTO>({
57
+ method: "POST",
58
+ path: `/v1/control/dcim/catalog/device-types`,
59
+ body,
60
+ });
61
+ }
62
+
63
+ /** control.dcim.catalog.device_types.delete */
64
+ async dcimCatalogDeviceTypesDelete(): Promise<models.DeleteResultDTO> {
65
+ return this.ctx.transport.request<models.DeleteResultDTO>({
66
+ method: "DELETE",
67
+ path: `/v1/control/dcim/catalog/device-types/${this.id}`,
68
+ });
69
+ }
70
+
71
+ /** control.dcim.catalog.device_types.set_ports */
72
+ async dcimCatalogDeviceTypesSetPorts(
73
+ body: models.SetDeviceTypePortsRequest,
74
+ ): Promise<models.DeviceTypeDTO> {
75
+ return this.ctx.transport.request<models.DeviceTypeDTO>({
76
+ method: "POST",
77
+ path: `/v1/control/dcim/catalog/device-types/${this.id}/ports`,
78
+ body,
79
+ });
80
+ }
81
+
82
+ /** control.dcim.catalog.import */
83
+ async dcimCatalogImport(
84
+ body: models.ImportDeviceTypesRequest,
85
+ ): Promise<models.ImportDeviceTypesResponse> {
86
+ return this.ctx.transport.request<models.ImportDeviceTypesResponse>({
87
+ method: "POST",
88
+ path: `/v1/control/dcim/catalog/import`,
89
+ body,
90
+ });
91
+ }
92
+ }
@@ -0,0 +1,36 @@
1
+ // Generated from the LeavePulse contract. Do not edit.
2
+ import { Resource } from "../runtime/resource";
3
+ import { fetchCachedOrThrow } from "../runtime/etag-store";
4
+ import type * as models from "../models";
5
+ import type { ClientContext } from "../client";
6
+
7
+ type Data = { id: string | number } & Record<string, unknown>;
8
+
9
+ export class ControlDcimManufacturer extends Resource<Data> {
10
+ constructor(
11
+ data: Data,
12
+ private readonly ctx: ClientContext,
13
+ ) {
14
+ super(data);
15
+ }
16
+
17
+ /** control.dcim.catalog.manufacturers.list */
18
+ async controlDcimCatalogManufacturersList(): Promise<models.ManufacturerListResponse> {
19
+ return fetchCachedOrThrow<models.ManufacturerListResponse>(
20
+ this.ctx.transport,
21
+ this.ctx.etagStore,
22
+ { method: "GET", path: `/v1/control/dcim/catalog/manufacturers` },
23
+ );
24
+ }
25
+
26
+ /** control.dcim.catalog.manufacturers.upsert */
27
+ async dcimCatalogManufacturersUpsert(
28
+ body: models.UpsertManufacturerRequest,
29
+ ): Promise<models.ManufacturerDTO> {
30
+ return this.ctx.transport.request<models.ManufacturerDTO>({
31
+ method: "POST",
32
+ path: `/v1/control/dcim/catalog/manufacturers`,
33
+ body,
34
+ });
35
+ }
36
+ }