pacc 5.0.0 → 5.2.0
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/src/common-attributes.mjs +7 -3
- package/src/expression.mjs +2 -0
- package/src/types.mjs +8 -1
- package/types/common-attributes.d.mts +6 -0
- package/types/expression.d.mts +4 -0
- package/types/types.d.mts +6 -0
package/package.json
CHANGED
|
@@ -9,6 +9,7 @@ import { types } from "./types.mjs";
|
|
|
9
9
|
* @property {boolean} mandatory
|
|
10
10
|
* @property {boolean} collection
|
|
11
11
|
* @property {boolean} [private] should the value be shown
|
|
12
|
+
* @property {boolean} [credential] any type of credential
|
|
12
13
|
* @property {string} [depends] name of an attribute we depend on
|
|
13
14
|
* @property {string} [description] human readable
|
|
14
15
|
* @property {any} [default] the default value
|
|
@@ -31,6 +32,7 @@ export const default_attribute = {
|
|
|
31
32
|
mandatory: false,
|
|
32
33
|
collection: false,
|
|
33
34
|
private: false,
|
|
35
|
+
credential: false,
|
|
34
36
|
isKey: false
|
|
35
37
|
};
|
|
36
38
|
|
|
@@ -185,7 +187,8 @@ export const uuid_attribute = {
|
|
|
185
187
|
*/
|
|
186
188
|
export const secret_attribute = {
|
|
187
189
|
...default_attribute_writable,
|
|
188
|
-
private: true
|
|
190
|
+
private: true,
|
|
191
|
+
credential: true
|
|
189
192
|
};
|
|
190
193
|
|
|
191
194
|
/**
|
|
@@ -214,7 +217,8 @@ export { secret_attribute as certificate_attribute };
|
|
|
214
217
|
export const private_key_attribute = {
|
|
215
218
|
...default_attribute_writable,
|
|
216
219
|
description: "private key",
|
|
217
|
-
private: true
|
|
220
|
+
private: true,
|
|
221
|
+
credential: true
|
|
218
222
|
};
|
|
219
223
|
|
|
220
224
|
/**
|
|
@@ -223,7 +227,7 @@ export const private_key_attribute = {
|
|
|
223
227
|
export const public_key_attribute = {
|
|
224
228
|
...default_attribute_writable,
|
|
225
229
|
description: "public key",
|
|
226
|
-
|
|
230
|
+
credential: true
|
|
227
231
|
};
|
|
228
232
|
|
|
229
233
|
/**
|
package/src/expression.mjs
CHANGED
|
@@ -314,6 +314,8 @@ export const globals = {
|
|
|
314
314
|
},
|
|
315
315
|
min: (a, b) => (a < b ? a : b),
|
|
316
316
|
max: (a, b) => (a > b ? a : b),
|
|
317
|
+
uppercase: (a) => a.toUpperCase(),
|
|
318
|
+
lowercase: (a) => a.toLowerCase(),
|
|
317
319
|
substring: (s, a, b) => s.substring(a, b),
|
|
318
320
|
length: s => s.length
|
|
319
321
|
};
|
package/src/types.mjs
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
import { attributeIterator } from "./attributes.mjs";
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* @typedef {Object} Type
|
|
5
|
+
* @property {string} name
|
|
6
|
+
* @property {boolean} [primitive]
|
|
7
|
+
* @property {Function} [prepareValue]
|
|
8
|
+
*/
|
|
9
|
+
|
|
3
10
|
const emptyStringIsUndefined = value =>
|
|
4
11
|
typeof value === "string" && value.length === 0 ? undefined : value;
|
|
5
12
|
|
|
@@ -40,7 +47,7 @@ export const types = {
|
|
|
40
47
|
prepareValue: emptyStringIsUndefined,
|
|
41
48
|
primitive: true
|
|
42
49
|
},
|
|
43
|
-
object: { name: "object" }
|
|
50
|
+
object: { name: "object", primitive: false }
|
|
44
51
|
};
|
|
45
52
|
|
|
46
53
|
function error(message) {
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
* @property {boolean} mandatory
|
|
8
8
|
* @property {boolean} collection
|
|
9
9
|
* @property {boolean} [private] should the value be shown
|
|
10
|
+
* @property {boolean} [credential] any type of credential
|
|
10
11
|
* @property {string} [depends] name of an attribute we depend on
|
|
11
12
|
* @property {string} [description] human readable
|
|
12
13
|
* @property {any} [default] the default value
|
|
@@ -35,6 +36,7 @@ export namespace string_collection_attribute {
|
|
|
35
36
|
export let mandatory: boolean;
|
|
36
37
|
let _private: boolean;
|
|
37
38
|
export { _private as private };
|
|
39
|
+
export let credential: boolean;
|
|
38
40
|
export let depends: string;
|
|
39
41
|
export let description: string;
|
|
40
42
|
let _default: any;
|
|
@@ -182,6 +184,10 @@ export type AttributeDefinition = {
|
|
|
182
184
|
* should the value be shown
|
|
183
185
|
*/
|
|
184
186
|
private?: boolean;
|
|
187
|
+
/**
|
|
188
|
+
* any type of credential
|
|
189
|
+
*/
|
|
190
|
+
credential?: boolean;
|
|
185
191
|
/**
|
|
186
192
|
* name of an attribute we depend on
|
|
187
193
|
*/
|
package/types/expression.d.mts
CHANGED
|
@@ -4,6 +4,8 @@ export function parse(input: any, context?: {
|
|
|
4
4
|
in: (a: any, b: any) => boolean;
|
|
5
5
|
min: (a: any, b: any) => any;
|
|
6
6
|
max: (a: any, b: any) => any;
|
|
7
|
+
uppercase: (a: any) => any;
|
|
8
|
+
lowercase: (a: any) => any;
|
|
7
9
|
substring: (s: any, a: any, b: any) => any;
|
|
8
10
|
length: (s: any) => any;
|
|
9
11
|
};
|
|
@@ -13,6 +15,8 @@ export namespace globals {
|
|
|
13
15
|
export { _in as in };
|
|
14
16
|
export function min(a: any, b: any): any;
|
|
15
17
|
export function max(a: any, b: any): any;
|
|
18
|
+
export function uppercase(a: any): any;
|
|
19
|
+
export function lowercase(a: any): any;
|
|
16
20
|
export function substring(s: any, a: any, b: any): any;
|
|
17
21
|
export function length(s: any): any;
|
|
18
22
|
}
|