pacc 10.0.0 → 10.0.2
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 +1 -1
- package/package.json +2 -2
- package/src/common-attributes.mjs +30 -24
- package/src/types.mjs +0 -8
- package/types/common-attributes.d.mts +16 -4
- package/types/types.d.mts +0 -1
package/README.md
CHANGED
|
@@ -282,7 +282,7 @@ Type: [Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Globa
|
|
|
282
282
|
|
|
283
283
|
* `name` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** 
|
|
284
284
|
* `type` **[object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** 
|
|
285
|
-
* `
|
|
285
|
+
* `key` **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** 
|
|
286
286
|
* `writable` **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** 
|
|
287
287
|
* `mandatory` **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** 
|
|
288
288
|
* `collection` **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** are we a collection (set, map, array, object)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pacc",
|
|
3
|
-
"version": "10.0.
|
|
3
|
+
"version": "10.0.2",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public",
|
|
6
6
|
"provenance": true
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@mitata/counters": "^0.0.8",
|
|
46
|
-
"aggregated-map": "^1.0.
|
|
46
|
+
"aggregated-map": "^1.0.5",
|
|
47
47
|
"ava": "^8.0.1",
|
|
48
48
|
"browser-ava": "^2.3.62",
|
|
49
49
|
"c8": "^11.0.0",
|
|
@@ -5,7 +5,7 @@ import { types } from "./types.mjs";
|
|
|
5
5
|
*
|
|
6
6
|
* @property {string} name
|
|
7
7
|
* @property {object} type
|
|
8
|
-
* @property {boolean}
|
|
8
|
+
* @property {boolean} key
|
|
9
9
|
* @property {boolean} writable
|
|
10
10
|
* @property {boolean} mandatory
|
|
11
11
|
* @property {boolean} collection are we a collection (set, map, array, object)
|
|
@@ -41,7 +41,7 @@ export const default_attribute = {
|
|
|
41
41
|
persistent: false,
|
|
42
42
|
private: false,
|
|
43
43
|
credential: false,
|
|
44
|
-
|
|
44
|
+
key: false
|
|
45
45
|
};
|
|
46
46
|
|
|
47
47
|
/**
|
|
@@ -55,18 +55,21 @@ export const default_attribute_writable = {
|
|
|
55
55
|
/**
|
|
56
56
|
* @type {AttributeDefinition}
|
|
57
57
|
*/
|
|
58
|
-
export { default_attribute
|
|
58
|
+
export const string_attribute = { ...default_attribute, name: "string" };
|
|
59
59
|
|
|
60
60
|
/**
|
|
61
61
|
* @type {AttributeDefinition}
|
|
62
62
|
*/
|
|
63
|
-
export
|
|
63
|
+
export const string_attribute_writable = {
|
|
64
|
+
...string_attribute,
|
|
65
|
+
writable: true
|
|
66
|
+
};
|
|
64
67
|
|
|
65
68
|
/**
|
|
66
69
|
* @type {AttributeDefinition}
|
|
67
70
|
*/
|
|
68
71
|
export const string_collection_attribute = {
|
|
69
|
-
...
|
|
72
|
+
...string_attribute,
|
|
70
73
|
separator: " ",
|
|
71
74
|
collection: true
|
|
72
75
|
};
|
|
@@ -99,9 +102,9 @@ export const string_set_attribute_writable = {
|
|
|
99
102
|
* @type {AttributeDefinition}
|
|
100
103
|
*/
|
|
101
104
|
export const name_attribute = {
|
|
102
|
-
...
|
|
105
|
+
...string_attribute,
|
|
103
106
|
name: "name",
|
|
104
|
-
|
|
107
|
+
key: true
|
|
105
108
|
};
|
|
106
109
|
|
|
107
110
|
/**
|
|
@@ -116,7 +119,7 @@ export const name_attribute_writable = {
|
|
|
116
119
|
* @type {AttributeDefinition}
|
|
117
120
|
*/
|
|
118
121
|
export const email_attribute = {
|
|
119
|
-
...
|
|
122
|
+
...string_attribute,
|
|
120
123
|
name: "email",
|
|
121
124
|
description: "email address"
|
|
122
125
|
};
|
|
@@ -125,7 +128,7 @@ export const email_attribute = {
|
|
|
125
128
|
* @type {AttributeDefinition}
|
|
126
129
|
*/
|
|
127
130
|
export const version_attribute = {
|
|
128
|
-
...
|
|
131
|
+
...string_attribute,
|
|
129
132
|
name: "version",
|
|
130
133
|
description: "version"
|
|
131
134
|
};
|
|
@@ -143,7 +146,7 @@ export const version_attribute_writable = {
|
|
|
143
146
|
* @type {AttributeDefinition}
|
|
144
147
|
*/
|
|
145
148
|
export const description_attribute = {
|
|
146
|
-
...
|
|
149
|
+
...string_attribute_writable,
|
|
147
150
|
name: "description",
|
|
148
151
|
description: "human readable description"
|
|
149
152
|
};
|
|
@@ -153,7 +156,7 @@ export { description_attribute as description_attribute_writable };
|
|
|
153
156
|
/**
|
|
154
157
|
* @type {AttributeDefinition}
|
|
155
158
|
*/
|
|
156
|
-
export const type_attribute = { ...
|
|
159
|
+
export const type_attribute = { ...string_attribute, name: "type" };
|
|
157
160
|
|
|
158
161
|
/**
|
|
159
162
|
* @type {AttributeDefinition}
|
|
@@ -238,16 +241,16 @@ export const empty_attribute = { ...boolean_attribute, name: "empty" };
|
|
|
238
241
|
* @type {AttributeDefinition}
|
|
239
242
|
*/
|
|
240
243
|
export const uuid_attribute = {
|
|
241
|
-
...
|
|
244
|
+
...string_attribute,
|
|
242
245
|
name: "uuid",
|
|
243
|
-
|
|
246
|
+
key: true
|
|
244
247
|
};
|
|
245
248
|
|
|
246
249
|
/**
|
|
247
250
|
* @type {AttributeDefinition}
|
|
248
251
|
*/
|
|
249
252
|
export const secret_attribute = {
|
|
250
|
-
...
|
|
253
|
+
...string_attribute_writable,
|
|
251
254
|
private: true,
|
|
252
255
|
credential: true
|
|
253
256
|
};
|
|
@@ -337,7 +340,7 @@ export { integer_attribute_writable as count_attribute_writable };
|
|
|
337
340
|
/**
|
|
338
341
|
* @type {AttributeDefinition}
|
|
339
342
|
*/
|
|
340
|
-
export { integer_attribute
|
|
343
|
+
export const size_attribute = { ...integer_attribute, name: "size" };
|
|
341
344
|
|
|
342
345
|
export const bytes_size_attribute = {
|
|
343
346
|
...default_attribute,
|
|
@@ -348,7 +351,11 @@ export const bytes_size_attribute = {
|
|
|
348
351
|
/**
|
|
349
352
|
* @type {AttributeDefinition}
|
|
350
353
|
*/
|
|
351
|
-
export const object_attribute = {
|
|
354
|
+
export const object_attribute = {
|
|
355
|
+
...default_attribute,
|
|
356
|
+
name: "object",
|
|
357
|
+
type: types.object
|
|
358
|
+
};
|
|
352
359
|
|
|
353
360
|
/**
|
|
354
361
|
* @type {AttributeDefinition}
|
|
@@ -372,7 +379,7 @@ export const url_attribute_writable = {
|
|
|
372
379
|
* @type {AttributeDefinition}
|
|
373
380
|
*/
|
|
374
381
|
export const hostname_attribute = {
|
|
375
|
-
...
|
|
382
|
+
...string_attribute,
|
|
376
383
|
name: "hostname",
|
|
377
384
|
description: "hostname"
|
|
378
385
|
};
|
|
@@ -399,8 +406,8 @@ export const port_attribute_writable = {
|
|
|
399
406
|
* @type {AttributeDefinition}
|
|
400
407
|
*/
|
|
401
408
|
export const id_attribute = {
|
|
402
|
-
...
|
|
403
|
-
|
|
409
|
+
...string_attribute,
|
|
410
|
+
key: true,
|
|
404
411
|
name: "id",
|
|
405
412
|
description: "identifier"
|
|
406
413
|
};
|
|
@@ -410,7 +417,7 @@ export const id_attribute = {
|
|
|
410
417
|
* @type {AttributeDefinition}
|
|
411
418
|
*/
|
|
412
419
|
export const body_attribute_writable = {
|
|
413
|
-
...
|
|
420
|
+
...string_attribute_writable,
|
|
414
421
|
name: "body"
|
|
415
422
|
};
|
|
416
423
|
|
|
@@ -419,10 +426,9 @@ export const body_attribute_writable = {
|
|
|
419
426
|
* @type {AttributeDefinition}
|
|
420
427
|
*/
|
|
421
428
|
export const title_attribute_writable = {
|
|
422
|
-
...
|
|
429
|
+
...string_attribute_writable,
|
|
423
430
|
name: "title",
|
|
424
|
-
description: "human readable title"
|
|
425
|
-
writable: true
|
|
431
|
+
description: "human readable title"
|
|
426
432
|
};
|
|
427
433
|
|
|
428
434
|
/**
|
|
@@ -480,7 +486,7 @@ export const timeout_attribute = {
|
|
|
480
486
|
* @type {AttributeDefinition}
|
|
481
487
|
*/
|
|
482
488
|
export const language_attribute = {
|
|
483
|
-
...
|
|
489
|
+
...string_attribute,
|
|
484
490
|
name: "language",
|
|
485
491
|
description: "human spoken language"
|
|
486
492
|
};
|
package/src/types.mjs
CHANGED
|
@@ -201,11 +201,3 @@ export function resolveTypeLinks() {
|
|
|
201
201
|
}
|
|
202
202
|
}
|
|
203
203
|
|
|
204
|
-
export function typeFactory(type, owner, data) {
|
|
205
|
-
const factory = type.factoryFor?.(owner, data) || type.clazz || type;
|
|
206
|
-
const object = new factory(owner);
|
|
207
|
-
|
|
208
|
-
object.read(data);
|
|
209
|
-
owner.addObject(object);
|
|
210
|
-
return object;
|
|
211
|
-
}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @property {string} name
|
|
5
5
|
* @property {object} type
|
|
6
|
-
* @property {boolean}
|
|
6
|
+
* @property {boolean} key
|
|
7
7
|
* @property {boolean} writable
|
|
8
8
|
* @property {boolean} mandatory
|
|
9
9
|
* @property {boolean} collection are we a collection (set, map, array, object)
|
|
@@ -34,6 +34,14 @@ export const default_attribute: AttributeDefinition;
|
|
|
34
34
|
* @type {AttributeDefinition}
|
|
35
35
|
*/
|
|
36
36
|
export const default_attribute_writable: AttributeDefinition;
|
|
37
|
+
/**
|
|
38
|
+
* @type {AttributeDefinition}
|
|
39
|
+
*/
|
|
40
|
+
export const string_attribute: AttributeDefinition;
|
|
41
|
+
/**
|
|
42
|
+
* @type {AttributeDefinition}
|
|
43
|
+
*/
|
|
44
|
+
export const string_attribute_writable: AttributeDefinition;
|
|
37
45
|
/**
|
|
38
46
|
* @type {AttributeDefinition}
|
|
39
47
|
*/
|
|
@@ -115,7 +123,7 @@ export namespace yesno_attribute_writable {
|
|
|
115
123
|
export let writable: boolean;
|
|
116
124
|
export let name: string;
|
|
117
125
|
export let type: object;
|
|
118
|
-
export let
|
|
126
|
+
export let key: boolean;
|
|
119
127
|
export let mandatory: boolean;
|
|
120
128
|
export let collection: boolean;
|
|
121
129
|
export let owner: boolean;
|
|
@@ -190,6 +198,10 @@ export const integer_attribute: AttributeDefinition;
|
|
|
190
198
|
* @type {AttributeDefinition}
|
|
191
199
|
*/
|
|
192
200
|
export const integer_attribute_writable: AttributeDefinition;
|
|
201
|
+
/**
|
|
202
|
+
* @type {AttributeDefinition}
|
|
203
|
+
*/
|
|
204
|
+
export const size_attribute: AttributeDefinition;
|
|
193
205
|
export namespace bytes_size_attribute {
|
|
194
206
|
let type_1: {
|
|
195
207
|
name: string;
|
|
@@ -271,7 +283,7 @@ export const language_attribute: AttributeDefinition;
|
|
|
271
283
|
export type AttributeDefinition = {
|
|
272
284
|
name: string;
|
|
273
285
|
type: object;
|
|
274
|
-
|
|
286
|
+
key: boolean;
|
|
275
287
|
writable: boolean;
|
|
276
288
|
mandatory: boolean;
|
|
277
289
|
/**
|
|
@@ -341,4 +353,4 @@ export type AttributeDefinition = {
|
|
|
341
353
|
*/
|
|
342
354
|
separator?: string | undefined;
|
|
343
355
|
};
|
|
344
|
-
export {
|
|
356
|
+
export { 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, priority_attribute as priority_attribute_writable };
|
package/types/types.d.mts
CHANGED