balena-sdk 23.2.9 → 23.2.10

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.
Files changed (36) hide show
  1. package/es2017/balena-browser.min.js +1 -1
  2. package/es2017/models/application.d.ts +15 -15
  3. package/es2017/models/balenaos-contract.d.ts +1 -2
  4. package/es2017/models/balenaos-contract.js +1 -1
  5. package/es2017/models/device.d.ts +13 -13
  6. package/es2017/models/index.d.ts +40 -40
  7. package/es2017/models/organization-membership.d.ts +3 -3
  8. package/es2017/models/organization.d.ts +3 -3
  9. package/es2017/models/os.d.ts +4 -5
  10. package/es2017/models/release.d.ts +2 -2
  11. package/es2017/models/service.d.ts +4 -4
  12. package/es2017/types/contract.d.ts +3 -2
  13. package/es2017/types/device-state.d.ts +12 -13
  14. package/es2017/types/device-type-json.d.ts +2 -3
  15. package/es2017/types/device-type-json.js +1 -0
  16. package/es2017/util/dependent-resource.d.ts +6 -6
  17. package/es2017/util/sdk-version.js +1 -1
  18. package/es2018/balena-browser.min.js +1 -1
  19. package/es2018/models/application.d.ts +15 -15
  20. package/es2018/models/balenaos-contract.d.ts +1 -2
  21. package/es2018/models/balenaos-contract.js +1 -1
  22. package/es2018/models/device.d.ts +13 -13
  23. package/es2018/models/index.d.ts +40 -40
  24. package/es2018/models/organization-membership.d.ts +3 -3
  25. package/es2018/models/organization.d.ts +3 -3
  26. package/es2018/models/os.d.ts +4 -5
  27. package/es2018/models/release.d.ts +2 -2
  28. package/es2018/models/service.d.ts +4 -4
  29. package/es2018/types/contract.d.ts +3 -2
  30. package/es2018/types/device-state.d.ts +12 -13
  31. package/es2018/types/device-type-json.d.ts +2 -3
  32. package/es2018/types/device-type-json.js +1 -0
  33. package/es2018/util/dependent-resource.d.ts +6 -6
  34. package/es2018/util/sdk-version.js +1 -1
  35. package/package.json +2 -2
  36. package/typings/utils.d.ts +1 -9
@@ -63,7 +63,7 @@ declare const getServiceModel: ({ pine, sdkInstance, }: InjectedDependenciesPara
63
63
  application__has__service_name: {
64
64
  __id: Service["Read"]["id"];
65
65
  } | [Service["Read"]];
66
- }>>(parentParam: string | number | import("../../typings/utils").Dictionary<unknown>, options?: O | undefined) => Promise<OptionsToResponse<{
66
+ }>>(parentParam: string | number | Record<string, unknown>, options?: O | undefined) => Promise<OptionsToResponse<{
67
67
  created_at: import("@balena/sbvr-types").Types["Date Time"]["Read"];
68
68
  service: {
69
69
  __id: Service["Read"]["id"];
@@ -120,7 +120,7 @@ declare const getServiceModel: ({ pine, sdkInstance, }: InjectedDependenciesPara
120
120
  * console.log(value);
121
121
  * });
122
122
  */
123
- get: (parentParam: string | number | import("../../typings/utils").Dictionary<unknown>, key: string) => Promise<string | undefined>;
123
+ get: (parentParam: string | number | Record<string, unknown>, key: string) => Promise<string | undefined>;
124
124
  /**
125
125
  * @summary Set the value of a specific service variable
126
126
  * @name set
@@ -143,7 +143,7 @@ declare const getServiceModel: ({ pine, sdkInstance, }: InjectedDependenciesPara
143
143
  * ...
144
144
  * });
145
145
  */
146
- set: (parentParam: string | number | import("../../typings/utils").Dictionary<unknown>, key: string, value: string) => Promise<void>;
146
+ set: (parentParam: string | number | Record<string, unknown>, key: string, value: string) => Promise<void>;
147
147
  /**
148
148
  * @summary Clear the value of a specific service variable
149
149
  * @name remove
@@ -165,7 +165,7 @@ declare const getServiceModel: ({ pine, sdkInstance, }: InjectedDependenciesPara
165
165
  * ...
166
166
  * });
167
167
  */
168
- remove: (parentParam: string | number | import("../../typings/utils").Dictionary<unknown>, key: string) => Promise<void>;
168
+ remove: (parentParam: string | number | Record<string, unknown>, key: string) => Promise<void>;
169
169
  };
170
170
  };
171
171
  export default getServiceModel;
@@ -1,5 +1,6 @@
1
- import type { AnyObject, Dictionary } from '../../typings/utils';
2
- export type Partials = Dictionary<string[] | Partials>;
1
+ import type { AnyObject } from '../../typings/utils';
2
+ export interface Partials extends Record<string, string[] | Partials> {
3
+ }
3
4
  export interface Contract {
4
5
  slug: string;
5
6
  type: string;
@@ -1,24 +1,23 @@
1
- import type { Dictionary } from '../../typings/utils';
2
1
  export interface ServiceInfo {
3
2
  imageId: number;
4
3
  serviceName: string;
5
4
  image: string;
6
5
  running: boolean;
7
- environment: Dictionary<string>;
8
- labels: Dictionary<string>;
6
+ environment: Record<string, string>;
7
+ labels: Record<string, string>;
9
8
  }
10
9
  export interface AppInfo {
11
10
  name: string;
12
11
  commit?: string;
13
12
  releaseId?: number;
14
- services: Dictionary<ServiceInfo>;
13
+ services: Record<string, ServiceInfo>;
15
14
  volumes: any;
16
15
  networks: any;
17
16
  }
18
17
  export interface DependentAppInfo {
19
18
  name: string;
20
19
  parentApp: number;
21
- config: Dictionary<string>;
20
+ config: Record<string, string>;
22
21
  commit?: string;
23
22
  releaseId?: number;
24
23
  imageId?: number;
@@ -27,16 +26,16 @@ export interface DependentAppInfo {
27
26
  export interface DeviceState {
28
27
  local: {
29
28
  name: string;
30
- config: Dictionary<string>;
31
- apps: Dictionary<AppInfo>;
29
+ config: Record<string, string>;
30
+ apps: Record<string, AppInfo>;
32
31
  };
33
32
  dependent: {
34
- apps: Dictionary<DependentAppInfo>;
35
- devices: Dictionary<{
33
+ apps: Record<string, DependentAppInfo>;
34
+ devices: Record<string, {
36
35
  name: string;
37
- apps: Dictionary<{
38
- config: Dictionary<string>;
39
- environment: Dictionary<string>;
36
+ apps: Record<string, {
37
+ config: Record<string, string>;
38
+ environment: Record<string, string>;
40
39
  }>;
41
40
  }>;
42
41
  };
@@ -44,7 +43,7 @@ export interface DeviceState {
44
43
  export interface DeviceStateV3 {
45
44
  [deviceUuid: string]: {
46
45
  name?: string;
47
- config: Dictionary<string>;
46
+ config: Record<string, string>;
48
47
  apps: {
49
48
  [appUuid: string]: {
50
49
  release_uuid?: string;
@@ -1,4 +1,3 @@
1
- import type { Dictionary } from '../../typings/utils';
2
1
  export interface DeviceType {
3
2
  slug: string;
4
3
  name: string;
@@ -70,7 +69,7 @@ export interface DeviceTypeOptionsGroup {
70
69
  min?: number;
71
70
  max?: number;
72
71
  hidden?: boolean;
73
- when?: Dictionary<number | string | boolean>;
72
+ when?: Record<string, number | string | boolean>;
74
73
  choices?: string[] | number[];
75
- choicesLabels?: Dictionary<string>;
74
+ choicesLabels?: Record<string, string>;
76
75
  }
@@ -1,2 +1,3 @@
1
1
  "use strict";
2
+ /* types for the /device-types/v1 endppoints */
2
3
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,5 +1,5 @@
1
1
  import type { BalenaModel, PineClient } from '..';
2
- import type { Dictionary, StringKeyof } from '../../typings/utils';
2
+ import type { StringKeyof } from '../../typings/utils';
3
3
  import type { ExpandableStringKeyOf, ODataOptionsWithoutCount, OptionsToResponse } from 'pinejs-client-core';
4
4
  type DependentResourceName = {
5
5
  [K in StringKeyof<BalenaModel>]: BalenaModel[K] extends {
@@ -18,12 +18,12 @@ export declare function buildDependentResource<T extends DependentResourceName>(
18
18
  resourceName: T;
19
19
  resourceKeyField: StringKeyof<BalenaModel[T]['Read']>;
20
20
  parentResourceName: ExpandableStringKeyOf<BalenaModel[T]['Read']>;
21
- getResourceId: (uuidOrIdOrDict: string | number | Dictionary<unknown>) => Promise<number>;
21
+ getResourceId: (uuidOrIdOrDict: string | number | Record<string, unknown>) => Promise<number>;
22
22
  }): {
23
23
  getAll<O extends ODataOptionsWithoutCount<BalenaModel[T]["Read"]>>(options?: O): Promise<OptionsToResponse<BalenaModel[T]["Read"], O, undefined>>;
24
- getAllByParent<O extends ODataOptionsWithoutCount<BalenaModel[T]["Read"]>>(parentParam: string | number | Dictionary<unknown>, options?: O): Promise<OptionsToResponse<BalenaModel[T]["Read"], O, undefined>>;
25
- get(parentParam: string | number | Dictionary<unknown>, key: string): Promise<string | undefined>;
26
- set(parentParam: string | number | Dictionary<unknown>, key: string, value: string): Promise<void>;
27
- remove(parentParam: string | number | Dictionary<unknown>, key: string): Promise<void>;
24
+ getAllByParent<O extends ODataOptionsWithoutCount<BalenaModel[T]["Read"]>>(parentParam: string | number | Record<string, unknown>, options?: O): Promise<OptionsToResponse<BalenaModel[T]["Read"], O, undefined>>;
25
+ get(parentParam: string | number | Record<string, unknown>, key: string): Promise<string | undefined>;
26
+ set(parentParam: string | number | Record<string, unknown>, key: string, value: string): Promise<void>;
27
+ remove(parentParam: string | number | Record<string, unknown>, key: string): Promise<void>;
28
28
  };
29
29
  export {};
@@ -6,5 +6,5 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  // being embedded in the dist of the consumer project
7
7
  // which we want to avoid, both b/c of the dist size increase &
8
8
  // the security concerns of including the versions of the dependencies
9
- const sdkVersion = '23.2.9';
9
+ const sdkVersion = '23.2.10';
10
10
  exports.default = sdkVersion;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "balena-sdk",
3
- "version": "23.2.9",
3
+ "version": "23.2.10",
4
4
  "description": "The Balena JavaScript SDK",
5
5
  "type": "commonjs",
6
6
  "main": "index.js",
@@ -137,6 +137,6 @@
137
137
  "tslib": "^2.1.0"
138
138
  },
139
139
  "versionist": {
140
- "publishedAt": "2026-06-15T02:23:40.004Z"
140
+ "publishedAt": "2026-06-16T15:41:39.142Z"
141
141
  }
142
142
  }
@@ -13,15 +13,7 @@ export type PropsAssignableWithType<T, P> = {
13
13
  // backwards compatible alternative for: Extract<keyof T, string>
14
14
  export type StringKeyof<T> = keyof T & string;
15
15
 
16
- export interface Dictionary<T> {
17
- [key: string]: T;
18
- }
19
-
20
- export type TypeOrDictionary<T> =
21
- | T
22
- | {
23
- [key: string]: T;
24
- };
16
+ export type TypeOrRecord<K extends keyof any, T> = T | Record<K, T>;
25
17
 
26
18
  export type IfDefined<T, P> = undefined extends T ? object : P;
27
19