pacc 9.4.2 → 10.0.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/README.md +15 -0
- package/package.json +1 -1
- package/src/attributes.mjs +4 -4
- package/src/common-attributes.mjs +21 -0
- package/src/environment.mjs +1 -1
- package/types/attributes.d.mts +2 -2
- package/types/common-attributes.d.mts +9 -1
package/README.md
CHANGED
|
@@ -96,6 +96,7 @@ tokens "abc" "
|
|
|
96
96
|
* [version\_attribute\_writable](#version_attribute_writable)
|
|
97
97
|
* [description\_attribute](#description_attribute)
|
|
98
98
|
* [type\_attribute](#type_attribute)
|
|
99
|
+
* [type\_attribute\_writable](#type_attribute_writable)
|
|
99
100
|
* [state\_attribute\_writable](#state_attribute_writable)
|
|
100
101
|
* [boolean\_attribute](#boolean_attribute)
|
|
101
102
|
* [boolean\_attribute\_writable](#boolean_attribute_writable)
|
|
@@ -126,10 +127,12 @@ tokens "abc" "
|
|
|
126
127
|
* [url\_attribute\_writable](#url_attribute_writable)
|
|
127
128
|
* [hostname\_attribute](#hostname_attribute)
|
|
128
129
|
* [port\_attribute](#port_attribute)
|
|
130
|
+
* [port\_attribute\_writable](#port_attribute_writable)
|
|
129
131
|
* [id\_attribute](#id_attribute)
|
|
130
132
|
* [body\_attribute\_writable](#body_attribute_writable)
|
|
131
133
|
* [title\_attribute\_writable](#title_attribute_writable)
|
|
132
134
|
* [priority\_attribute](#priority_attribute)
|
|
135
|
+
* [priority\_attribute](#priority_attribute-1)
|
|
133
136
|
* [duration\_attribute](#duration_attribute)
|
|
134
137
|
* [duration\_attribute\_writable](#duration_attribute_writable)
|
|
135
138
|
* [duration\_ms\_attribute](#duration_ms_attribute)
|
|
@@ -365,6 +368,10 @@ Type: [AttributeDefinition](#attributedefinition)
|
|
|
365
368
|
|
|
366
369
|
Type: [AttributeDefinition](#attributedefinition)
|
|
367
370
|
|
|
371
|
+
## type\_attribute\_writable
|
|
372
|
+
|
|
373
|
+
Type: [AttributeDefinition](#attributedefinition)
|
|
374
|
+
|
|
368
375
|
## state\_attribute\_writable
|
|
369
376
|
|
|
370
377
|
Type: [AttributeDefinition](#attributedefinition)
|
|
@@ -485,6 +492,10 @@ Type: [AttributeDefinition](#attributedefinition)
|
|
|
485
492
|
|
|
486
493
|
Type: [AttributeDefinition](#attributedefinition)
|
|
487
494
|
|
|
495
|
+
## port\_attribute\_writable
|
|
496
|
+
|
|
497
|
+
Type: [AttributeDefinition](#attributedefinition)
|
|
498
|
+
|
|
488
499
|
## id\_attribute
|
|
489
500
|
|
|
490
501
|
Unique id within.
|
|
@@ -510,6 +521,10 @@ this defines the order.
|
|
|
510
521
|
|
|
511
522
|
Type: [AttributeDefinition](#attributedefinition)
|
|
512
523
|
|
|
524
|
+
## priority\_attribute
|
|
525
|
+
|
|
526
|
+
Type: [AttributeDefinition](#attributedefinition)
|
|
527
|
+
|
|
513
528
|
## duration\_attribute
|
|
514
529
|
|
|
515
530
|
Duration in seconds.
|
package/package.json
CHANGED
package/src/attributes.mjs
CHANGED
|
@@ -55,7 +55,7 @@ export function* attributeIterator(definition, filter, path = []) {
|
|
|
55
55
|
if (definition) {
|
|
56
56
|
for (const [name, def] of Object.entries(definition)) {
|
|
57
57
|
const path2 = [...path, name];
|
|
58
|
-
if (typeof filter !== "function" || filter(
|
|
58
|
+
if (typeof filter !== "function" || filter(def)) {
|
|
59
59
|
yield [path2, def];
|
|
60
60
|
}
|
|
61
61
|
|
|
@@ -78,8 +78,8 @@ export function* extendingAttributeIterator(type, filter, path) {
|
|
|
78
78
|
yield* attributeIterator(type.attributes, filter, path);
|
|
79
79
|
}
|
|
80
80
|
|
|
81
|
-
export const filterWritable =
|
|
82
|
-
export const filterPublic =
|
|
81
|
+
export const filterWritable = attribute => attribute.writable;
|
|
82
|
+
export const filterPublic = attribute => !attribute.private;
|
|
83
83
|
|
|
84
84
|
export function* writableAttributeIterator(definition) {
|
|
85
85
|
yield* attributeIterator(definition, filterWritable);
|
|
@@ -108,7 +108,7 @@ export function toExternal(value, attribute) {
|
|
|
108
108
|
export function mandatoryAttributesPresent(object, attributes) {
|
|
109
109
|
for (const [path, attribute] of attributeIterator(
|
|
110
110
|
attributes,
|
|
111
|
-
|
|
111
|
+
attribute => attribute.mandatory
|
|
112
112
|
)) {
|
|
113
113
|
const name = path.join(".");
|
|
114
114
|
if (getAttribute(object, name) === undefined) {
|
|
@@ -155,6 +155,14 @@ export { description_attribute as description_attribute_writable };
|
|
|
155
155
|
*/
|
|
156
156
|
export const type_attribute = { ...default_attribute, name: "type" };
|
|
157
157
|
|
|
158
|
+
/**
|
|
159
|
+
* @type {AttributeDefinition}
|
|
160
|
+
*/
|
|
161
|
+
export const type_attribute_writable = {
|
|
162
|
+
...type_attribute,
|
|
163
|
+
writable: true
|
|
164
|
+
};
|
|
165
|
+
|
|
158
166
|
/**
|
|
159
167
|
* @type {AttributeDefinition}
|
|
160
168
|
*/
|
|
@@ -378,6 +386,14 @@ export const port_attribute = {
|
|
|
378
386
|
description: "ip port"
|
|
379
387
|
};
|
|
380
388
|
|
|
389
|
+
/**
|
|
390
|
+
* @type {AttributeDefinition}
|
|
391
|
+
*/
|
|
392
|
+
export const port_attribute_writable = {
|
|
393
|
+
...port_attribute,
|
|
394
|
+
writable: true
|
|
395
|
+
};
|
|
396
|
+
|
|
381
397
|
/**
|
|
382
398
|
* Unique id within.
|
|
383
399
|
* @type {AttributeDefinition}
|
|
@@ -420,6 +436,11 @@ export const priority_attribute = {
|
|
|
420
436
|
default: 0
|
|
421
437
|
};
|
|
422
438
|
|
|
439
|
+
/**
|
|
440
|
+
* @type {AttributeDefinition}
|
|
441
|
+
*/
|
|
442
|
+
export { priority_attribute as priority_attribute_writable };
|
|
443
|
+
|
|
423
444
|
/**
|
|
424
445
|
* Duration in seconds.
|
|
425
446
|
* @type {AttributeDefinition}
|
package/src/environment.mjs
CHANGED
package/types/attributes.d.mts
CHANGED
|
@@ -25,5 +25,5 @@ export function writableAttributeIterator(definition: any): Generator<[string[],
|
|
|
25
25
|
export function toInternal(value: any, attribute: any): any;
|
|
26
26
|
export function toExternal(value: any, attribute: any): any;
|
|
27
27
|
export function mandatoryAttributesPresent(object: any, attributes: any): boolean;
|
|
28
|
-
export function filterWritable(
|
|
29
|
-
export function filterPublic(
|
|
28
|
+
export function filterWritable(attribute: any): any;
|
|
29
|
+
export function filterPublic(attribute: any): boolean;
|
|
@@ -79,6 +79,10 @@ export const description_attribute: AttributeDefinition;
|
|
|
79
79
|
* @type {AttributeDefinition}
|
|
80
80
|
*/
|
|
81
81
|
export const type_attribute: AttributeDefinition;
|
|
82
|
+
/**
|
|
83
|
+
* @type {AttributeDefinition}
|
|
84
|
+
*/
|
|
85
|
+
export const type_attribute_writable: AttributeDefinition;
|
|
82
86
|
/**
|
|
83
87
|
* @type {AttributeDefinition}
|
|
84
88
|
*/
|
|
@@ -218,6 +222,10 @@ export const hostname_attribute: AttributeDefinition;
|
|
|
218
222
|
* @type {AttributeDefinition}
|
|
219
223
|
*/
|
|
220
224
|
export const port_attribute: AttributeDefinition;
|
|
225
|
+
/**
|
|
226
|
+
* @type {AttributeDefinition}
|
|
227
|
+
*/
|
|
228
|
+
export const port_attribute_writable: AttributeDefinition;
|
|
221
229
|
/**
|
|
222
230
|
* Unique id within.
|
|
223
231
|
* @type {AttributeDefinition}
|
|
@@ -333,4 +341,4 @@ export type AttributeDefinition = {
|
|
|
333
341
|
*/
|
|
334
342
|
separator?: string | undefined;
|
|
335
343
|
};
|
|
336
|
-
export { default_attribute as string_attribute, default_attribute_writable as string_attribute_writable, description_attribute as description_attribute_writable, boolean_attribute_writable_true as active_attribute, secret_attribute as certificate_attribute, integer_attribute as count_attribute, integer_attribute_writable as count_attribute_writable, integer_attribute as size_attribute };
|
|
344
|
+
export { default_attribute as string_attribute, default_attribute_writable as string_attribute_writable, description_attribute as description_attribute_writable, boolean_attribute_writable_true as active_attribute, secret_attribute as certificate_attribute, integer_attribute as count_attribute, integer_attribute_writable as count_attribute_writable, integer_attribute as size_attribute, priority_attribute as priority_attribute_writable };
|