pacc 9.3.3 → 9.4.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 +3 -1
- package/package.json +2 -2
- package/src/attributes.mjs +0 -2
- package/src/common-attributes.mjs +27 -6
- package/types/attributes.d.mts +0 -1
- package/types/common-attributes.d.mts +25 -1
package/README.md
CHANGED
|
@@ -855,9 +855,11 @@ Type: [Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Globa
|
|
|
855
855
|
|
|
856
856
|
## raiseOnUnknownType
|
|
857
857
|
|
|
858
|
+
Throw if type is not known.
|
|
859
|
+
|
|
858
860
|
### Parameters
|
|
859
861
|
|
|
860
|
-
* `type` **([string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String) | [undefined](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/undefined))** 
|
|
862
|
+
* `type` **([Type](#type) | [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String) | [undefined](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/undefined))** 
|
|
861
863
|
* `origin` **any** 
|
|
862
864
|
|
|
863
865
|
Returns **[Type](#type)** 
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pacc",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.4.0",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public",
|
|
6
6
|
"provenance": true
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"@mitata/counters": "^0.0.8",
|
|
46
46
|
"aggregated-map": "^1.0.4",
|
|
47
47
|
"ava": "^8.0.1",
|
|
48
|
-
"browser-ava": "^2.3.
|
|
48
|
+
"browser-ava": "^2.3.62",
|
|
49
49
|
"c8": "^11.0.0",
|
|
50
50
|
"documentation": "^14.0.3",
|
|
51
51
|
"mitata": "^1.0.34",
|
package/src/attributes.mjs
CHANGED
|
@@ -95,8 +95,6 @@ export function toInternal(value, attribute) {
|
|
|
95
95
|
return value;
|
|
96
96
|
}
|
|
97
97
|
|
|
98
|
-
export { toInternal as prepareValue }; // DEPRECATED
|
|
99
|
-
|
|
100
98
|
export function toExternal(value, attribute) {
|
|
101
99
|
if (attribute) {
|
|
102
100
|
const toExternal = attribute.toExternal ?? attribute.type?.toExternal;
|
|
@@ -3,6 +3,7 @@ import { types } from "./types.mjs";
|
|
|
3
3
|
/**
|
|
4
4
|
* @typedef {Object} AttributeDefinition
|
|
5
5
|
*
|
|
6
|
+
* @property {string} name
|
|
6
7
|
* @property {object} type
|
|
7
8
|
* @property {boolean} isKey
|
|
8
9
|
* @property {boolean} writable
|
|
@@ -99,6 +100,7 @@ export const string_set_attribute_writable = {
|
|
|
99
100
|
*/
|
|
100
101
|
export const name_attribute = {
|
|
101
102
|
...default_attribute,
|
|
103
|
+
name: "name",
|
|
102
104
|
isKey: true
|
|
103
105
|
};
|
|
104
106
|
|
|
@@ -115,6 +117,7 @@ export const name_attribute_writable = {
|
|
|
115
117
|
*/
|
|
116
118
|
export const email_attribute = {
|
|
117
119
|
...default_attribute,
|
|
120
|
+
name: "email",
|
|
118
121
|
description: "email address"
|
|
119
122
|
};
|
|
120
123
|
|
|
@@ -123,6 +126,7 @@ export const email_attribute = {
|
|
|
123
126
|
*/
|
|
124
127
|
export const version_attribute = {
|
|
125
128
|
...default_attribute,
|
|
129
|
+
name: "version",
|
|
126
130
|
description: "version"
|
|
127
131
|
};
|
|
128
132
|
|
|
@@ -140,6 +144,7 @@ export const version_attribute_writable = {
|
|
|
140
144
|
*/
|
|
141
145
|
export const description_attribute = {
|
|
142
146
|
...default_attribute_writable,
|
|
147
|
+
name: "description",
|
|
143
148
|
description: "human readable description"
|
|
144
149
|
};
|
|
145
150
|
|
|
@@ -148,12 +153,15 @@ export { description_attribute as description_attribute_writable };
|
|
|
148
153
|
/**
|
|
149
154
|
* @type {AttributeDefinition}
|
|
150
155
|
*/
|
|
151
|
-
export { default_attribute
|
|
156
|
+
export const type_attribute = { ...default_attribute, name: "type" };
|
|
152
157
|
|
|
153
158
|
/**
|
|
154
159
|
* @type {AttributeDefinition}
|
|
155
160
|
*/
|
|
156
|
-
export
|
|
161
|
+
export const state_attribute_writable = {
|
|
162
|
+
...default_attribute_writable,
|
|
163
|
+
name: "state"
|
|
164
|
+
};
|
|
157
165
|
|
|
158
166
|
/**
|
|
159
167
|
* @type {AttributeDefinition}
|
|
@@ -223,6 +231,7 @@ export { boolean_attribute as empty_attribute };
|
|
|
223
231
|
*/
|
|
224
232
|
export const uuid_attribute = {
|
|
225
233
|
...default_attribute,
|
|
234
|
+
name: "uuid",
|
|
226
235
|
isKey: true
|
|
227
236
|
};
|
|
228
237
|
|
|
@@ -246,12 +255,12 @@ export const secret_attribute_writable = {
|
|
|
246
255
|
/**
|
|
247
256
|
* @type {AttributeDefinition}
|
|
248
257
|
*/
|
|
249
|
-
export { secret_attribute
|
|
258
|
+
export const username_attribute = { ...secret_attribute, name: "username" };
|
|
250
259
|
|
|
251
260
|
/**
|
|
252
261
|
* @type {AttributeDefinition}
|
|
253
262
|
*/
|
|
254
|
-
export { secret_attribute
|
|
263
|
+
export const password_attribute = { ...secret_attribute, name: "password" };
|
|
255
264
|
|
|
256
265
|
/**
|
|
257
266
|
* @type {AttributeDefinition}
|
|
@@ -336,6 +345,7 @@ export const object_attribute = { ...default_attribute, type: types.object };
|
|
|
336
345
|
export const url_attribute = {
|
|
337
346
|
...default_attribute,
|
|
338
347
|
type: types.url,
|
|
348
|
+
name: "url",
|
|
339
349
|
description: "home of the object"
|
|
340
350
|
};
|
|
341
351
|
|
|
@@ -352,6 +362,7 @@ export const url_attribute_writable = {
|
|
|
352
362
|
*/
|
|
353
363
|
export const hostname_attribute = {
|
|
354
364
|
...default_attribute,
|
|
365
|
+
name: "hostname",
|
|
355
366
|
description: "hostname"
|
|
356
367
|
};
|
|
357
368
|
|
|
@@ -360,6 +371,7 @@ export const hostname_attribute = {
|
|
|
360
371
|
*/
|
|
361
372
|
export const port_attribute = {
|
|
362
373
|
...integer_attribute,
|
|
374
|
+
name: "port",
|
|
363
375
|
description: "ip port"
|
|
364
376
|
};
|
|
365
377
|
|
|
@@ -370,6 +382,7 @@ export const port_attribute = {
|
|
|
370
382
|
export const id_attribute = {
|
|
371
383
|
...default_attribute,
|
|
372
384
|
isKey: true,
|
|
385
|
+
name: "id",
|
|
373
386
|
description: "identifier"
|
|
374
387
|
};
|
|
375
388
|
|
|
@@ -377,7 +390,10 @@ export const id_attribute = {
|
|
|
377
390
|
* The body text.
|
|
378
391
|
* @type {AttributeDefinition}
|
|
379
392
|
*/
|
|
380
|
-
export
|
|
393
|
+
export const body_attribute_writable = {
|
|
394
|
+
...default_attribute_writable,
|
|
395
|
+
name: "body"
|
|
396
|
+
};
|
|
381
397
|
|
|
382
398
|
/**
|
|
383
399
|
* The one line description.
|
|
@@ -385,6 +401,7 @@ export { default_attribute_writable as body_attribute_writable };
|
|
|
385
401
|
*/
|
|
386
402
|
export const title_attribute_writable = {
|
|
387
403
|
...default_attribute,
|
|
404
|
+
name: "title",
|
|
388
405
|
description: "human readable title",
|
|
389
406
|
writable: true
|
|
390
407
|
};
|
|
@@ -396,6 +413,7 @@ export const title_attribute_writable = {
|
|
|
396
413
|
*/
|
|
397
414
|
export const priority_attribute = {
|
|
398
415
|
...number_attribute_writable,
|
|
416
|
+
name: "priority",
|
|
399
417
|
default: 0
|
|
400
418
|
};
|
|
401
419
|
|
|
@@ -405,7 +423,8 @@ export const priority_attribute = {
|
|
|
405
423
|
*/
|
|
406
424
|
export const duration_attribute = {
|
|
407
425
|
...default_attribute,
|
|
408
|
-
type: types.duration
|
|
426
|
+
type: types.duration,
|
|
427
|
+
name: "duration"
|
|
409
428
|
};
|
|
410
429
|
|
|
411
430
|
/**
|
|
@@ -429,6 +448,7 @@ export const duration_ms_attribute = {
|
|
|
429
448
|
*/
|
|
430
449
|
export const timeout_attribute = {
|
|
431
450
|
...number_attribute_writable,
|
|
451
|
+
name: "timeout",
|
|
432
452
|
description: "timeout"
|
|
433
453
|
};
|
|
434
454
|
|
|
@@ -437,5 +457,6 @@ export const timeout_attribute = {
|
|
|
437
457
|
*/
|
|
438
458
|
export const language_attribute = {
|
|
439
459
|
...default_attribute,
|
|
460
|
+
name: "language",
|
|
440
461
|
description: "human spoken language"
|
|
441
462
|
};
|
package/types/attributes.d.mts
CHANGED
|
@@ -27,4 +27,3 @@ export function toExternal(value: any, attribute: any): any;
|
|
|
27
27
|
export function mandatoryAttributesPresent(object: any, attributes: any): boolean;
|
|
28
28
|
export function filterWritable(name: any, attribute: any): any;
|
|
29
29
|
export function filterPublic(name: any, attribute: any): boolean;
|
|
30
|
-
export { toInternal as prepareValue };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @typedef {Object} AttributeDefinition
|
|
3
3
|
*
|
|
4
|
+
* @property {string} name
|
|
4
5
|
* @property {object} type
|
|
5
6
|
* @property {boolean} isKey
|
|
6
7
|
* @property {boolean} writable
|
|
@@ -74,6 +75,14 @@ export const version_attribute_writable: AttributeDefinition;
|
|
|
74
75
|
* @type {AttributeDefinition}
|
|
75
76
|
*/
|
|
76
77
|
export const description_attribute: AttributeDefinition;
|
|
78
|
+
/**
|
|
79
|
+
* @type {AttributeDefinition}
|
|
80
|
+
*/
|
|
81
|
+
export const type_attribute: AttributeDefinition;
|
|
82
|
+
/**
|
|
83
|
+
* @type {AttributeDefinition}
|
|
84
|
+
*/
|
|
85
|
+
export const state_attribute_writable: AttributeDefinition;
|
|
77
86
|
/**
|
|
78
87
|
* @type {AttributeDefinition}
|
|
79
88
|
*/
|
|
@@ -100,6 +109,7 @@ export const boolean_attribute_false: AttributeDefinition;
|
|
|
100
109
|
export const yesno_attribute: AttributeDefinition;
|
|
101
110
|
export namespace yesno_attribute_writable {
|
|
102
111
|
export let writable: boolean;
|
|
112
|
+
export let name: string;
|
|
103
113
|
export let type: object;
|
|
104
114
|
export let isKey: boolean;
|
|
105
115
|
export let mandatory: boolean;
|
|
@@ -136,6 +146,14 @@ export const secret_attribute: AttributeDefinition;
|
|
|
136
146
|
* @type {AttributeDefinition}
|
|
137
147
|
*/
|
|
138
148
|
export const secret_attribute_writable: AttributeDefinition;
|
|
149
|
+
/**
|
|
150
|
+
* @type {AttributeDefinition}
|
|
151
|
+
*/
|
|
152
|
+
export const username_attribute: AttributeDefinition;
|
|
153
|
+
/**
|
|
154
|
+
* @type {AttributeDefinition}
|
|
155
|
+
*/
|
|
156
|
+
export const password_attribute: AttributeDefinition;
|
|
139
157
|
/**
|
|
140
158
|
* @type {AttributeDefinition}
|
|
141
159
|
*/
|
|
@@ -195,6 +213,11 @@ export const port_attribute: AttributeDefinition;
|
|
|
195
213
|
* @type {AttributeDefinition}
|
|
196
214
|
*/
|
|
197
215
|
export const id_attribute: AttributeDefinition;
|
|
216
|
+
/**
|
|
217
|
+
* The body text.
|
|
218
|
+
* @type {AttributeDefinition}
|
|
219
|
+
*/
|
|
220
|
+
export const body_attribute_writable: AttributeDefinition;
|
|
198
221
|
/**
|
|
199
222
|
* The one line description.
|
|
200
223
|
* @type {AttributeDefinition}
|
|
@@ -228,6 +251,7 @@ export const timeout_attribute: AttributeDefinition;
|
|
|
228
251
|
*/
|
|
229
252
|
export const language_attribute: AttributeDefinition;
|
|
230
253
|
export type AttributeDefinition = {
|
|
254
|
+
name: string;
|
|
231
255
|
type: object;
|
|
232
256
|
isKey: boolean;
|
|
233
257
|
writable: boolean;
|
|
@@ -299,4 +323,4 @@ export type AttributeDefinition = {
|
|
|
299
323
|
*/
|
|
300
324
|
separator?: string | undefined;
|
|
301
325
|
};
|
|
302
|
-
export { default_attribute as string_attribute, default_attribute_writable as string_attribute_writable, description_attribute as description_attribute_writable,
|
|
326
|
+
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, boolean_attribute as empty_attribute, secret_attribute as token_attribute, secret_attribute as certificate_attribute, integer_attribute as count_attribute, integer_attribute_writable as count_attribute_writable, integer_attribute as size_attribute };
|