pacc 3.11.0 → 3.12.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 CHANGED
@@ -48,6 +48,8 @@ const result = getAttribute({ a: [0,{ b: 4 }]}, "a[1].b");
48
48
  * [uuid\_attribute](#uuid_attribute)
49
49
  * [empty\_attribute](#empty_attribute)
50
50
  * [secret\_attribute](#secret_attribute)
51
+ * [username\_attribute](#username_attribute)
52
+ * [password\_attribute](#password_attribute)
51
53
  * [token\_attribute](#token_attribute)
52
54
  * [certificate\_attribute](#certificate_attribute)
53
55
  * [private\_key\_attribute](#private_key_attribute)
@@ -55,6 +57,8 @@ const result = getAttribute({ a: [0,{ b: 4 }]}, "a[1].b");
55
57
  * [count\_attribute](#count_attribute)
56
58
  * [size\_attribute](#size_attribute)
57
59
  * [url\_attribute](#url_attribute)
60
+ * [hostname\_attribute](#hostname_attribute)
61
+ * [port\_attribute](#port_attribute)
58
62
  * [id\_attribute](#id_attribute)
59
63
  * [body\_attribute](#body_attribute)
60
64
  * [title\_attribute](#title_attribute)
@@ -212,6 +216,14 @@ Type: [AttributeDefinition](#attributedefinition)
212
216
 
213
217
  Type: [AttributeDefinition](#attributedefinition)
214
218
 
219
+ ## username\_attribute
220
+
221
+ Type: [AttributeDefinition](#attributedefinition)
222
+
223
+ ## password\_attribute
224
+
225
+ Type: [AttributeDefinition](#attributedefinition)
226
+
215
227
  ## token\_attribute
216
228
 
217
229
  Type: [AttributeDefinition](#attributedefinition)
@@ -240,6 +252,14 @@ Type: [AttributeDefinition](#attributedefinition)
240
252
 
241
253
  Type: [AttributeDefinition](#attributedefinition)
242
254
 
255
+ ## hostname\_attribute
256
+
257
+ Type: [AttributeDefinition](#attributedefinition)
258
+
259
+ ## port\_attribute
260
+
261
+ Type: [AttributeDefinition](#attributedefinition)
262
+
243
263
  ## id\_attribute
244
264
 
245
265
  Unique id within the provider.
@@ -294,8 +314,7 @@ Create attributes from its definition.
294
314
  ### Parameters
295
315
 
296
316
  * `newDefinitions` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** 
297
- * `presentDefinitions`  
298
- * `baseDefinitions` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)?** optional merg in attributes
317
+ * `presentDefinitions` **([Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object) | [undefined](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/undefined))** optional merg in attributes
299
318
 
300
319
  Returns **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** attributes
301
320
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pacc",
3
- "version": "3.11.0",
3
+ "version": "3.12.0",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "provenance": true
@@ -5,6 +5,7 @@
5
5
  * @property {boolean} isKey
6
6
  * @property {boolean} writable
7
7
  * @property {boolean} mandatory
8
+ * @property {boolean} collection
8
9
  * @property {boolean} [private] should the value be shown
9
10
  * @property {string} [depends] name of an attribute we depend on
10
11
  * @property {string[]} additionalAttributes extra attributes that are present in case our attribute is set
@@ -23,6 +24,7 @@ export const default_attribute = {
23
24
  type: "string",
24
25
  writable: false,
25
26
  mandatory: false,
27
+ collection: false,
26
28
  private: false,
27
29
  isKey: false,
28
30
  additionalAttributes: []
@@ -159,12 +161,17 @@ export const public_key_attribute = {
159
161
  /**
160
162
  * @type {AttributeDefinition}
161
163
  */
162
- export const count_attribute = { ...default_attribute, type: "integer" };
164
+ export const integer_attribute = { ...default_attribute, type: "integer" };
163
165
 
164
166
  /**
165
167
  * @type {AttributeDefinition}
166
168
  */
167
- export const size_attribute = { ...default_attribute, type: "integer" };
169
+ export const count_attribute = integer_attribute;
170
+
171
+ /**
172
+ * @type {AttributeDefinition}
173
+ */
174
+ export const size_attribute = integer_attribute;
168
175
 
169
176
  /**
170
177
  * @type {AttributeDefinition}
@@ -187,8 +194,7 @@ export const hostname_attribute = {
187
194
  * @type {AttributeDefinition}
188
195
  */
189
196
  export const port_attribute = {
190
- ...default_attribute,
191
- type: "integer",
197
+ ...integer_attribute,
192
198
  description: "port"
193
199
  };
194
200
 
@@ -248,8 +254,7 @@ export const timeout_attribute = {
248
254
  * @type {AttributeDefinition}
249
255
  */
250
256
  export const active_attribute = {
251
- ...default_attribute,
252
- type: "boolean",
257
+ ...boolean_attribute,
253
258
  default: true,
254
259
  writable: true
255
260
  };
package/src/multiple.mjs CHANGED
@@ -13,7 +13,7 @@ const types = {
13
13
  /**
14
14
  * Create attributes from its definition.
15
15
  * @param {Object} newDefinitions
16
- * @param {Object?} baseDefinitions optional merg in attributes
16
+ * @param {Object|undefined} presentDefinitions optional merg in attributes
17
17
  * @return {Object} attributes
18
18
  */
19
19
  export function prepareAttributesDefinitions(newDefinitions, presentDefinitions) {
@@ -35,7 +35,7 @@ export function prepareAttributesDefinitions(newDefinitions, presentDefinitions)
35
35
  * @param {Object?} atts attribute definitions to be used
36
36
  * @return {Object} merged definitions (dest)
37
37
  */
38
- export function mergeAttributeDefinitions(dest, atts) {
38
+ function mergeAttributeDefinitions(dest, atts) {
39
39
  if (atts) {
40
40
  for (const [name, ca] of Object.entries(atts)) {
41
41
  if (ca.attributes !== undefined) {
@@ -5,6 +5,7 @@
5
5
  * @property {boolean} isKey
6
6
  * @property {boolean} writable
7
7
  * @property {boolean} mandatory
8
+ * @property {boolean} collection
8
9
  * @property {boolean} [private] should the value be shown
9
10
  * @property {string} [depends] name of an attribute we depend on
10
11
  * @property {string[]} additionalAttributes extra attributes that are present in case our attribute is set
@@ -80,6 +81,10 @@ export const private_key_attribute: AttributeDefinition;
80
81
  * @type {AttributeDefinition}
81
82
  */
82
83
  export const public_key_attribute: AttributeDefinition;
84
+ /**
85
+ * @type {AttributeDefinition}
86
+ */
87
+ export const integer_attribute: AttributeDefinition;
83
88
  /**
84
89
  * @type {AttributeDefinition}
85
90
  */
@@ -138,6 +143,7 @@ export type AttributeDefinition = {
138
143
  isKey: boolean;
139
144
  writable: boolean;
140
145
  mandatory: boolean;
146
+ collection: boolean;
141
147
  /**
142
148
  * should the value be shown
143
149
  */
@@ -1,17 +1,10 @@
1
1
  /**
2
2
  * Create attributes from its definition.
3
3
  * @param {Object} newDefinitions
4
- * @param {Object?} baseDefinitions optional merg in attributes
4
+ * @param {Object|undefined} presentDefinitions optional merg in attributes
5
5
  * @return {Object} attributes
6
6
  */
7
- export function prepareAttributesDefinitions(newDefinitions: any, presentDefinitions: any): any;
8
- /**
9
- * Merge attribute definitions.
10
- * @param {Object} dest attribute definitions to be used also the merge target
11
- * @param {Object?} atts attribute definitions to be used
12
- * @return {Object} merged definitions (dest)
13
- */
14
- export function mergeAttributeDefinitions(dest: any, atts: any | null): any;
7
+ export function prepareAttributesDefinitions(newDefinitions: any, presentDefinitions: any | undefined): any;
15
8
  /**
16
9
  * Copies attribute values from a source object into a destination object.
17
10
  * @param {Object} object target object to be modified