@balena/ui-shared-components 13.0.0-build-rename-and-require-widget-extracontext-62d6585ba8e1eaae767e67c4d2f880afcd80d6fd-1 → 13.0.0-build-rename-and-require-widget-extracontext-78dd3d5eba302d57a47d7ebb0fbdd8793e82d77d-1
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.
|
@@ -34,29 +34,6 @@ export interface DeviceTypeDownloadAlert {
|
|
|
34
34
|
type: string;
|
|
35
35
|
message: string;
|
|
36
36
|
}
|
|
37
|
-
/** @deprecated */
|
|
38
|
-
export interface DeviceTypeOptions {
|
|
39
|
-
options: DeviceTypeOptionsGroup[];
|
|
40
|
-
collapsed: boolean;
|
|
41
|
-
isCollapsible: boolean;
|
|
42
|
-
isGroup: boolean;
|
|
43
|
-
message: string;
|
|
44
|
-
name: string;
|
|
45
|
-
}
|
|
46
|
-
/** @deprecated */
|
|
47
|
-
export interface DeviceTypeOptionsGroup {
|
|
48
|
-
default: number | string;
|
|
49
|
-
message: string;
|
|
50
|
-
name: string;
|
|
51
|
-
type: string;
|
|
52
|
-
min?: number;
|
|
53
|
-
max?: number;
|
|
54
|
-
docs?: string;
|
|
55
|
-
hidden?: boolean;
|
|
56
|
-
when?: Dictionary<number | string | boolean>;
|
|
57
|
-
choices?: string[] | number[];
|
|
58
|
-
choicesLabels?: Dictionary<string>;
|
|
59
|
-
}
|
|
60
37
|
export interface DeviceType {
|
|
61
38
|
slug: string;
|
|
62
39
|
name: string;
|
|
@@ -65,6 +42,4 @@ export interface DeviceType {
|
|
|
65
42
|
/** @deprecated */
|
|
66
43
|
imageDownloadAlerts?: DeviceTypeDownloadAlert[];
|
|
67
44
|
instructions?: string[] | OsSpecificContractInstructions;
|
|
68
|
-
/** @deprecated */
|
|
69
|
-
options?: DeviceTypeOptions[];
|
|
70
45
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { RJSTModel, RJSTRawModel } from '../schemaOps';
|
|
1
|
+
import type { Permissions, RJSTModel, RJSTRawModel } from '../schemaOps';
|
|
2
2
|
type Transformers<T extends Dictionary<any>, TTransformer extends Dictionary<any>, TContext> = {
|
|
3
3
|
[field in keyof TTransformer]: (entry: T, context?: TContext) => TTransformer[field];
|
|
4
4
|
};
|
|
@@ -9,7 +9,5 @@ export declare const rjstDefaultPermissions: {
|
|
|
9
9
|
delete: boolean;
|
|
10
10
|
};
|
|
11
11
|
export declare const rjstRunTransformers: <T extends Dictionary<any>, TResult extends T, TContext = null>(data: T | undefined, transformers: Transformers<T, Omit<TResult, keyof T>, TContext>, context?: TContext) => TResult | undefined;
|
|
12
|
-
export declare const rjstGetModelForCollection: <T>(model: RJSTRawModel<T>,
|
|
13
|
-
accessRole?: string | null;
|
|
14
|
-
}) => RJSTModel<T>;
|
|
12
|
+
export declare const rjstGetModelForCollection: <T>(model: RJSTRawModel<T>, permissions: Permissions<T>) => RJSTModel<T>;
|
|
15
13
|
export {};
|
|
@@ -29,8 +29,7 @@ export const rjstRunTransformers = (data, transformers, context) => {
|
|
|
29
29
|
return mutatedData;
|
|
30
30
|
};
|
|
31
31
|
// This transformation would happen elsewhere, and it wouldn't be part of RJST
|
|
32
|
-
export const rjstGetModelForCollection = (model,
|
|
33
|
-
const accessRole = context === null || context === void 0 ? void 0 : context.accessRole;
|
|
32
|
+
export const rjstGetModelForCollection = (model, permissions) => {
|
|
34
33
|
const schema = model.priorities
|
|
35
34
|
? rjstJsonSchemaPick(model.schema, [
|
|
36
35
|
...model.priorities.primary,
|
|
@@ -38,6 +37,6 @@ export const rjstGetModelForCollection = (model, context) => {
|
|
|
38
37
|
...model.priorities.tertiary,
|
|
39
38
|
])
|
|
40
39
|
: model.schema;
|
|
41
|
-
return Object.assign(Object.assign({}, model), { permissions
|
|
42
|
-
|
|
40
|
+
return Object.assign(Object.assign({}, model), { permissions,
|
|
41
|
+
schema });
|
|
43
42
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@balena/ui-shared-components",
|
|
3
|
-
"version": "13.0.0-build-rename-and-require-widget-extracontext-
|
|
3
|
+
"version": "13.0.0-build-rename-and-require-widget-extracontext-78dd3d5eba302d57a47d7ebb0fbdd8793e82d77d-1",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"files": [
|
|
@@ -138,6 +138,6 @@
|
|
|
138
138
|
},
|
|
139
139
|
"homepage": "https://github.com/balena-io/ui-shared-components#readme",
|
|
140
140
|
"versionist": {
|
|
141
|
-
"publishedAt": "2025-05-
|
|
141
|
+
"publishedAt": "2025-05-27T11:50:14.169Z"
|
|
142
142
|
}
|
|
143
143
|
}
|