@leavepulse/control-sdk 0.3.49 → 0.3.50
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/package.json +1 -1
- package/resources/ControlDcimComponentType.ts +12 -0
- package/runtime/realtime-client.ts +6 -3
- package/types.ts +42 -1
package/package.json
CHANGED
|
@@ -35,6 +35,18 @@ export class ControlDcimComponentType extends Resource<Data> {
|
|
|
35
35
|
);
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
+
/** control.dcim.catalog.component_types.get */
|
|
39
|
+
async controlDcimCatalogComponentTypesGet(): Promise<models.ComponentTypeDTO> {
|
|
40
|
+
return fetchCachedOrThrow<models.ComponentTypeDTO>(
|
|
41
|
+
this.ctx.transport,
|
|
42
|
+
this.ctx.etagStore,
|
|
43
|
+
{
|
|
44
|
+
method: "GET",
|
|
45
|
+
path: `/v1/control/dcim/catalog/component-types/${this.id}`,
|
|
46
|
+
},
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
|
|
38
50
|
/** control.dcim.catalog.component_types.upsert */
|
|
39
51
|
async dcimCatalogComponentTypesUpsert(
|
|
40
52
|
body: models.UpsertComponentTypeRequest,
|
|
@@ -87,10 +87,13 @@ const AUTH_REFRESH_MIN_MS = 5_000;
|
|
|
87
87
|
* reconnect behaviour rather than a tight loop.
|
|
88
88
|
*/
|
|
89
89
|
function millisUntilExpiry(token: string): number | null {
|
|
90
|
-
|
|
91
|
-
|
|
90
|
+
// Destructured rather than indexed: consumers compile this file under their
|
|
91
|
+
// own tsconfig, and one with noUncheckedIndexedAccess types parts[1] as
|
|
92
|
+
// possibly undefined however the length was checked.
|
|
93
|
+
const [header, payload, signature] = token.split(".");
|
|
94
|
+
if (!header || !payload || !signature) return null;
|
|
92
95
|
try {
|
|
93
|
-
const base64 =
|
|
96
|
+
const base64 = payload.replace(/-/g, "+").replace(/_/g, "/");
|
|
94
97
|
const padded = base64.padEnd(
|
|
95
98
|
base64.length + ((4 - (base64.length % 4)) % 4),
|
|
96
99
|
"=",
|
package/types.ts
CHANGED
|
@@ -498,7 +498,8 @@ export interface paths {
|
|
|
498
498
|
path?: never;
|
|
499
499
|
cookie?: never;
|
|
500
500
|
};
|
|
501
|
-
|
|
501
|
+
/** GetComponentType */
|
|
502
|
+
get: operations["control.dcim.catalog.component_types.get"];
|
|
502
503
|
put?: never;
|
|
503
504
|
post?: never;
|
|
504
505
|
/** DeleteComponentType */
|
|
@@ -5167,6 +5168,46 @@ export interface operations {
|
|
|
5167
5168
|
};
|
|
5168
5169
|
};
|
|
5169
5170
|
};
|
|
5171
|
+
"control.dcim.catalog.component_types.get": {
|
|
5172
|
+
parameters: {
|
|
5173
|
+
query?: never;
|
|
5174
|
+
header?: never;
|
|
5175
|
+
path: {
|
|
5176
|
+
component_type_id: string;
|
|
5177
|
+
};
|
|
5178
|
+
cookie?: never;
|
|
5179
|
+
};
|
|
5180
|
+
requestBody?: never;
|
|
5181
|
+
responses: {
|
|
5182
|
+
/** @description Request fulfilled, document follows */
|
|
5183
|
+
200: {
|
|
5184
|
+
headers: {
|
|
5185
|
+
[name: string]: unknown;
|
|
5186
|
+
};
|
|
5187
|
+
content: {
|
|
5188
|
+
"application/json": components["schemas"]["ComponentTypeDTO"];
|
|
5189
|
+
};
|
|
5190
|
+
};
|
|
5191
|
+
/** @description Bad request syntax or unsupported method */
|
|
5192
|
+
400: {
|
|
5193
|
+
headers: {
|
|
5194
|
+
[name: string]: unknown;
|
|
5195
|
+
};
|
|
5196
|
+
content: {
|
|
5197
|
+
"application/json": {
|
|
5198
|
+
detail: string;
|
|
5199
|
+
extra?:
|
|
5200
|
+
| null
|
|
5201
|
+
| {
|
|
5202
|
+
[key: string]: unknown;
|
|
5203
|
+
}
|
|
5204
|
+
| unknown[];
|
|
5205
|
+
status_code: number;
|
|
5206
|
+
};
|
|
5207
|
+
};
|
|
5208
|
+
};
|
|
5209
|
+
};
|
|
5210
|
+
};
|
|
5170
5211
|
"control.dcim.catalog.component_types.delete": {
|
|
5171
5212
|
parameters: {
|
|
5172
5213
|
query?: never;
|