@balena/open-balena-api 26.2.2-build-renovate-grafana-loki-3-1-x-f1666e91f3fe046b2b261f8ed4413c3f6e71eaa7-1 → 26.2.3-build-joshbwlng-bump-pinejs-d0f7119d94daf787ecd23b400e8f27f190630edb-1
Sign up to get free protection for your applications and to get access to all the features.
package/dist/balena-model.js
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import { hooks, permissions } from '@balena/pinejs';
|
1
|
+
import { errors, hooks, permissions } from '@balena/pinejs';
|
2
2
|
import { getApplicationSlug } from '../index.js';
|
3
3
|
hooks.addPureHook('POST', 'resin', 'application', {
|
4
4
|
POSTPARSE: ({ request }) => {
|
@@ -16,7 +16,12 @@ hooks.addPureHook('POST', 'resin', 'application', {
|
|
16
16
|
},
|
17
17
|
});
|
18
18
|
if (organization != null) {
|
19
|
-
|
19
|
+
try {
|
20
|
+
request.values.slug = getApplicationSlug(organization.handle, request.values.app_name);
|
21
|
+
}
|
22
|
+
catch (e) {
|
23
|
+
throw new errors.NotFoundError(e.message);
|
24
|
+
}
|
20
25
|
}
|
21
26
|
}
|
22
27
|
},
|
@@ -50,11 +55,21 @@ hooks.addPureHook('PATCH', 'resin', 'application', {
|
|
50
55
|
},
|
51
56
|
},
|
52
57
|
});
|
58
|
+
// Attempt to get the slug for each app
|
59
|
+
const appSlugs = new Map();
|
60
|
+
try {
|
61
|
+
apps.forEach((app) => {
|
62
|
+
appSlugs.set(app.id, getApplicationSlug(app.organization[0].handle, app.app_name));
|
63
|
+
});
|
64
|
+
}
|
65
|
+
catch (e) {
|
66
|
+
throw new errors.NotFoundError(e.message);
|
67
|
+
}
|
53
68
|
await Promise.all(apps.map((app) => rootApi.patch({
|
54
69
|
resource: 'application',
|
55
70
|
id: app.id,
|
56
71
|
body: {
|
57
|
-
slug:
|
72
|
+
slug: appSlugs.get(app.id),
|
58
73
|
},
|
59
74
|
})));
|
60
75
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"slug.js","sourceRoot":"","sources":["../../../../src/features/applications/hooks/slug.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;
|
1
|
+
{"version":3,"file":"slug.js","sourceRoot":"","sources":["../../../../src/features/applications/hooks/slug.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC5D,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAEjD,KAAK,CAAC,WAAW,CAAC,MAAM,EAAE,OAAO,EAAE,aAAa,EAAE;IACjD,SAAS,EAAE,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE;QAC1B,0FAA0F;QAC1F,6DAA6D;QAC7D,OAAO,CAAC,MAAM,CAAC,IAAI,KAAK,EAAE,CAAC;IAC5B,CAAC;IACD,MAAM,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,GAAG,EAAE,EAAE,EAAE;QAClC,IAAI,OAAO,CAAC,MAAM,CAAC,YAAY,IAAI,IAAI,EAAE,CAAC;YACzC,MAAM,YAAY,GAAG,MAAM,GAAG,CAAC,GAAG,CAAC;gBAClC,QAAQ,EAAE,cAAc;gBACxB,EAAE,EAAE,OAAO,CAAC,MAAM,CAAC,YAAY;gBAC/B,OAAO,EAAE;oBACR,OAAO,EAAE,QAAQ;iBACjB;aACD,CAAC,CAAC;YACH,IAAI,YAAY,IAAI,IAAI,EAAE,CAAC;gBAC1B,IAAI,CAAC;oBACJ,OAAO,CAAC,MAAM,CAAC,IAAI,GAAG,kBAAkB,CACvC,YAAY,CAAC,MAAM,EACnB,OAAO,CAAC,MAAM,CAAC,QAAQ,CACvB,CAAC;gBACH,CAAC;gBAAC,OAAO,CAAC,EAAE,CAAC;oBACZ,MAAM,IAAI,MAAM,CAAC,aAAa,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;gBAC3C,CAAC;YACF,CAAC;QACF,CAAC;IACF,CAAC;CACD,CAAC,CAAC;A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AW,CAAC,IAAI;wBACrB,EAAE;qBACF;iBACD,CAAC,CAAC;gBAEH,MAAM,OAAO,CAAC,GAAG,CAChB,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,CAC7B,SAAS,CAAC,KAAK,CAAC;oBACf,QAAQ,EAAE,aAAa;oBACvB,EAAE;oBACF,IAAI,EAAE;wBACL,IAAI,EAAE,kBAAkB,CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC;qBACzD;iBACD,CAAC,CACF,CACD,CAAC;YACH,CAAC,CAAC,CACF,CAAC;QACH,CAAC;IACF,CAAC;CACD,CAAC,CAAC"}
|
@@ -2,52 +2,52 @@ import type { RequestHandler } from 'express';
|
|
2
2
|
import type { Device } from '../../balena-model.js';
|
3
3
|
import type { Request } from 'express-serve-static-core';
|
4
4
|
export declare const checkDeviceExistsIsFrozen: import("../../infra/cache/multi-level-memoizee.js").MemoizedFn<(uuid: string) => Promise<NoInfer<import("@balena/abstract-sql-to-typescript").PickDeferred<{
|
5
|
-
created_at: import("@balena/
|
6
|
-
modified_at: import("@balena/
|
7
|
-
id: import("@balena/
|
5
|
+
created_at: import("@balena/abstract-sql-to-typescript").Types["Date Time"]["Read"];
|
6
|
+
modified_at: import("@balena/abstract-sql-to-typescript").Types["Date Time"]["Read"];
|
7
|
+
id: import("@balena/abstract-sql-to-typescript").Types["Serial"]["Read"];
|
8
8
|
actor: {
|
9
9
|
__id: import("../../balena-model.js").Actor["Read"]["id"];
|
10
10
|
} | [import("../../balena-model.js").Actor["Read"]];
|
11
11
|
api_heartbeat_state: "online" | "offline" | "timeout" | "unknown";
|
12
|
-
uuid: import("@balena/
|
13
|
-
local_id: import("@balena/
|
14
|
-
device_name: import("@balena/
|
15
|
-
note: import("@balena/
|
12
|
+
uuid: import("@balena/abstract-sql-to-typescript").Types["Text"]["Read"];
|
13
|
+
local_id: import("@balena/abstract-sql-to-typescript").Types["Short Text"]["Read"] | null;
|
14
|
+
device_name: import("@balena/abstract-sql-to-typescript").Types["Short Text"]["Read"] | null;
|
15
|
+
note: import("@balena/abstract-sql-to-typescript").Types["Text"]["Read"] | null;
|
16
16
|
is_of__device_type: {
|
17
17
|
__id: import("../../balena-model.js").DeviceType["Read"]["id"];
|
18
18
|
} | [import("../../balena-model.js").DeviceType["Read"]];
|
19
19
|
belongs_to__application: {
|
20
20
|
__id: import("../../balena-model.js").Application["Read"]["id"];
|
21
21
|
} | [import("../../balena-model.js").Application["Read"]] | [] | null;
|
22
|
-
is_online: import("@balena/
|
23
|
-
last_connectivity_event: import("@balena/
|
24
|
-
is_connected_to_vpn: import("@balena/
|
25
|
-
last_vpn_event: import("@balena/
|
26
|
-
is_locked_until__date: import("@balena/
|
27
|
-
public_address: import("@balena/
|
28
|
-
ip_address: import("@balena/
|
29
|
-
mac_address: import("@balena/
|
30
|
-
memory_usage: import("@balena/
|
31
|
-
memory_total: import("@balena/
|
32
|
-
storage_block_device: import("@balena/
|
33
|
-
storage_usage: import("@balena/
|
34
|
-
storage_total: import("@balena/
|
35
|
-
cpu_usage: import("@balena/
|
36
|
-
cpu_temp: import("@balena/
|
37
|
-
is_undervolted: import("@balena/
|
38
|
-
cpu_id: import("@balena/
|
22
|
+
is_online: import("@balena/abstract-sql-to-typescript").Types["Boolean"]["Read"];
|
23
|
+
last_connectivity_event: import("@balena/abstract-sql-to-typescript").Types["Date Time"]["Read"] | null;
|
24
|
+
is_connected_to_vpn: import("@balena/abstract-sql-to-typescript").Types["Boolean"]["Read"];
|
25
|
+
last_vpn_event: import("@balena/abstract-sql-to-typescript").Types["Date Time"]["Read"] | null;
|
26
|
+
is_locked_until__date: import("@balena/abstract-sql-to-typescript").Types["Date Time"]["Read"] | null;
|
27
|
+
public_address: import("@balena/abstract-sql-to-typescript").Types["Short Text"]["Read"] | null;
|
28
|
+
ip_address: import("@balena/abstract-sql-to-typescript").Types["Short Text"]["Read"] | null;
|
29
|
+
mac_address: import("@balena/abstract-sql-to-typescript").Types["Short Text"]["Read"] | null;
|
30
|
+
memory_usage: import("@balena/abstract-sql-to-typescript").Types["Integer"]["Read"] | null;
|
31
|
+
memory_total: import("@balena/abstract-sql-to-typescript").Types["Integer"]["Read"] | null;
|
32
|
+
storage_block_device: import("@balena/abstract-sql-to-typescript").Types["Short Text"]["Read"] | null;
|
33
|
+
storage_usage: import("@balena/abstract-sql-to-typescript").Types["Integer"]["Read"] | null;
|
34
|
+
storage_total: import("@balena/abstract-sql-to-typescript").Types["Integer"]["Read"] | null;
|
35
|
+
cpu_usage: import("@balena/abstract-sql-to-typescript").Types["Integer"]["Read"] | null;
|
36
|
+
cpu_temp: import("@balena/abstract-sql-to-typescript").Types["Integer"]["Read"] | null;
|
37
|
+
is_undervolted: import("@balena/abstract-sql-to-typescript").Types["Boolean"]["Read"];
|
38
|
+
cpu_id: import("@balena/abstract-sql-to-typescript").Types["Short Text"]["Read"] | null;
|
39
39
|
is_running__release: {
|
40
40
|
__id: import("../../balena-model.js").Release["Read"]["id"];
|
41
41
|
} | [import("../../balena-model.js").Release["Read"]] | [] | null;
|
42
|
-
download_progress: import("@balena/
|
43
|
-
status: import("@balena/
|
44
|
-
os_version: import("@balena/
|
45
|
-
os_variant: import("@balena/
|
46
|
-
supervisor_version: import("@balena/
|
47
|
-
provisioning_progress: import("@balena/
|
48
|
-
provisioning_state: import("@balena/
|
49
|
-
api_port: import("@balena/
|
50
|
-
api_secret: import("@balena/
|
42
|
+
download_progress: import("@balena/abstract-sql-to-typescript").Types["Integer"]["Read"] | null;
|
43
|
+
status: import("@balena/abstract-sql-to-typescript").Types["Short Text"]["Read"] | null;
|
44
|
+
os_version: import("@balena/abstract-sql-to-typescript").Types["Short Text"]["Read"] | null;
|
45
|
+
os_variant: import("@balena/abstract-sql-to-typescript").Types["Short Text"]["Read"] | null;
|
46
|
+
supervisor_version: import("@balena/abstract-sql-to-typescript").Types["Short Text"]["Read"] | null;
|
47
|
+
provisioning_progress: import("@balena/abstract-sql-to-typescript").Types["Integer"]["Read"] | null;
|
48
|
+
provisioning_state: import("@balena/abstract-sql-to-typescript").Types["Short Text"]["Read"] | null;
|
49
|
+
api_port: import("@balena/abstract-sql-to-typescript").Types["Integer"]["Read"] | null;
|
50
|
+
api_secret: import("@balena/abstract-sql-to-typescript").Types["Short Text"]["Read"] | null;
|
51
51
|
is_managed_by__service_instance: {
|
52
52
|
__id: import("../../balena-model.js").ServiceInstance["Read"]["id"];
|
53
53
|
} | [import("../../balena-model.js").ServiceInstance["Read"]] | [] | null;
|
@@ -63,10 +63,10 @@ export declare const checkDeviceExistsIsFrozen: import("../../infra/cache/multi-
|
|
63
63
|
should_be_managed_by__release: {
|
64
64
|
__id: import("../../balena-model.js").Release["Read"]["id"];
|
65
65
|
} | [import("../../balena-model.js").Release["Read"]] | [] | null;
|
66
|
-
is_web_accessible: import("@balena/
|
67
|
-
is_frozen: import("@balena/
|
68
|
-
overall_status: import("@balena/
|
69
|
-
overall_progress: import("@balena/
|
66
|
+
is_web_accessible: import("@balena/abstract-sql-to-typescript").Types["Boolean"]["Read"] | null;
|
67
|
+
is_frozen: import("@balena/abstract-sql-to-typescript").Types["Boolean"]["Read"] | null;
|
68
|
+
overall_status: import("@balena/abstract-sql-to-typescript").Types["Short Text"]["Read"] | null;
|
69
|
+
overall_progress: import("@balena/abstract-sql-to-typescript").Types["Integer"]["Read"] | null;
|
70
70
|
device__has__env_var_name?: Array<import("../../balena-model.js").DeviceEnvironmentVariable["Read"]>;
|
71
71
|
device_environment_variable?: Array<import("../../balena-model.js").DeviceEnvironmentVariable["Read"]>;
|
72
72
|
device__has__config_var_name?: Array<import("../../balena-model.js").DeviceConfigVariable["Read"]>;
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "@balena/open-balena-api",
|
3
3
|
"description": "Internet of things, Made Simple",
|
4
|
-
"version": "26.2.
|
4
|
+
"version": "26.2.3-build-joshbwlng-bump-pinejs-d0f7119d94daf787ecd23b400e8f27f190630edb-1",
|
5
5
|
"license": "AGPL-3.0",
|
6
6
|
"repository": {
|
7
7
|
"type": "git",
|
@@ -48,7 +48,7 @@
|
|
48
48
|
"@balena/env-parsing": "^1.1.12",
|
49
49
|
"@balena/es-version": "^1.0.3",
|
50
50
|
"@balena/node-metrics-gatherer": "^6.0.3",
|
51
|
-
"@balena/pinejs": "^
|
51
|
+
"@balena/pinejs": "^18.0.0",
|
52
52
|
"@balena/pinejs-webresource-cloudfront": "^0.1.0",
|
53
53
|
"@sentry/node": "^8.18.0",
|
54
54
|
"@types/basic-auth": "^1.1.8",
|
@@ -167,6 +167,6 @@
|
|
167
167
|
"loader": "ts-node/esm/transpile-only"
|
168
168
|
},
|
169
169
|
"versionist": {
|
170
|
-
"publishedAt": "2024-08-
|
170
|
+
"publishedAt": "2024-08-09T00:20:19.645Z"
|
171
171
|
}
|
172
172
|
}
|