pacc 9.3.3 → 9.4.1
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 +33 -9
- package/types/attributes.d.mts +0 -1
- package/types/common-attributes.d.mts +35 -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.1",
|
|
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}
|
|
@@ -216,13 +224,14 @@ export const yesno_attribute_writable = {
|
|
|
216
224
|
/**
|
|
217
225
|
* @type {AttributeDefinition}
|
|
218
226
|
*/
|
|
219
|
-
export { boolean_attribute
|
|
227
|
+
export const empty_attribute = { ...boolean_attribute, name: "empty" };
|
|
220
228
|
|
|
221
229
|
/**
|
|
222
230
|
* @type {AttributeDefinition}
|
|
223
231
|
*/
|
|
224
232
|
export const uuid_attribute = {
|
|
225
233
|
...default_attribute,
|
|
234
|
+
name: "uuid",
|
|
226
235
|
isKey: true
|
|
227
236
|
};
|
|
228
237
|
|
|
@@ -246,17 +255,17 @@ 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}
|
|
258
267
|
*/
|
|
259
|
-
export { secret_attribute
|
|
268
|
+
export const token_attribute = { ...secret_attribute, name: "token" };
|
|
260
269
|
|
|
261
270
|
/**
|
|
262
271
|
* @type {AttributeDefinition}
|
|
@@ -268,6 +277,7 @@ export { secret_attribute as certificate_attribute };
|
|
|
268
277
|
*/
|
|
269
278
|
export const private_key_attribute = {
|
|
270
279
|
...secret_attribute_writable,
|
|
280
|
+
name: "private_key",
|
|
271
281
|
description: "private key"
|
|
272
282
|
};
|
|
273
283
|
|
|
@@ -276,6 +286,7 @@ export const private_key_attribute = {
|
|
|
276
286
|
*/
|
|
277
287
|
export const public_key_attribute = {
|
|
278
288
|
...secret_attribute_writable,
|
|
289
|
+
name: "public_key",
|
|
279
290
|
description: "public key"
|
|
280
291
|
};
|
|
281
292
|
|
|
@@ -322,7 +333,8 @@ export { integer_attribute as size_attribute };
|
|
|
322
333
|
|
|
323
334
|
export const bytes_size_attribute = {
|
|
324
335
|
...default_attribute,
|
|
325
|
-
type: types.byte_size
|
|
336
|
+
type: types.byte_size,
|
|
337
|
+
name: "bytes"
|
|
326
338
|
};
|
|
327
339
|
|
|
328
340
|
/**
|
|
@@ -336,6 +348,7 @@ export const object_attribute = { ...default_attribute, type: types.object };
|
|
|
336
348
|
export const url_attribute = {
|
|
337
349
|
...default_attribute,
|
|
338
350
|
type: types.url,
|
|
351
|
+
name: "url",
|
|
339
352
|
description: "home of the object"
|
|
340
353
|
};
|
|
341
354
|
|
|
@@ -352,6 +365,7 @@ export const url_attribute_writable = {
|
|
|
352
365
|
*/
|
|
353
366
|
export const hostname_attribute = {
|
|
354
367
|
...default_attribute,
|
|
368
|
+
name: "hostname",
|
|
355
369
|
description: "hostname"
|
|
356
370
|
};
|
|
357
371
|
|
|
@@ -360,6 +374,7 @@ export const hostname_attribute = {
|
|
|
360
374
|
*/
|
|
361
375
|
export const port_attribute = {
|
|
362
376
|
...integer_attribute,
|
|
377
|
+
name: "port",
|
|
363
378
|
description: "ip port"
|
|
364
379
|
};
|
|
365
380
|
|
|
@@ -370,6 +385,7 @@ export const port_attribute = {
|
|
|
370
385
|
export const id_attribute = {
|
|
371
386
|
...default_attribute,
|
|
372
387
|
isKey: true,
|
|
388
|
+
name: "id",
|
|
373
389
|
description: "identifier"
|
|
374
390
|
};
|
|
375
391
|
|
|
@@ -377,7 +393,10 @@ export const id_attribute = {
|
|
|
377
393
|
* The body text.
|
|
378
394
|
* @type {AttributeDefinition}
|
|
379
395
|
*/
|
|
380
|
-
export
|
|
396
|
+
export const body_attribute_writable = {
|
|
397
|
+
...default_attribute_writable,
|
|
398
|
+
name: "body"
|
|
399
|
+
};
|
|
381
400
|
|
|
382
401
|
/**
|
|
383
402
|
* The one line description.
|
|
@@ -385,6 +404,7 @@ export { default_attribute_writable as body_attribute_writable };
|
|
|
385
404
|
*/
|
|
386
405
|
export const title_attribute_writable = {
|
|
387
406
|
...default_attribute,
|
|
407
|
+
name: "title",
|
|
388
408
|
description: "human readable title",
|
|
389
409
|
writable: true
|
|
390
410
|
};
|
|
@@ -396,6 +416,7 @@ export const title_attribute_writable = {
|
|
|
396
416
|
*/
|
|
397
417
|
export const priority_attribute = {
|
|
398
418
|
...number_attribute_writable,
|
|
419
|
+
name: "priority",
|
|
399
420
|
default: 0
|
|
400
421
|
};
|
|
401
422
|
|
|
@@ -405,7 +426,8 @@ export const priority_attribute = {
|
|
|
405
426
|
*/
|
|
406
427
|
export const duration_attribute = {
|
|
407
428
|
...default_attribute,
|
|
408
|
-
type: types.duration
|
|
429
|
+
type: types.duration,
|
|
430
|
+
name: "duration"
|
|
409
431
|
};
|
|
410
432
|
|
|
411
433
|
/**
|
|
@@ -429,6 +451,7 @@ export const duration_ms_attribute = {
|
|
|
429
451
|
*/
|
|
430
452
|
export const timeout_attribute = {
|
|
431
453
|
...number_attribute_writable,
|
|
454
|
+
name: "timeout",
|
|
432
455
|
description: "timeout"
|
|
433
456
|
};
|
|
434
457
|
|
|
@@ -437,5 +460,6 @@ export const timeout_attribute = {
|
|
|
437
460
|
*/
|
|
438
461
|
export const language_attribute = {
|
|
439
462
|
...default_attribute,
|
|
463
|
+
name: "language",
|
|
440
464
|
description: "human spoken language"
|
|
441
465
|
};
|
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;
|
|
@@ -124,6 +134,10 @@ export namespace yesno_attribute_writable {
|
|
|
124
134
|
export let additionalValues: object | undefined;
|
|
125
135
|
export let separator: string | undefined;
|
|
126
136
|
}
|
|
137
|
+
/**
|
|
138
|
+
* @type {AttributeDefinition}
|
|
139
|
+
*/
|
|
140
|
+
export const empty_attribute: AttributeDefinition;
|
|
127
141
|
/**
|
|
128
142
|
* @type {AttributeDefinition}
|
|
129
143
|
*/
|
|
@@ -136,6 +150,18 @@ export const secret_attribute: AttributeDefinition;
|
|
|
136
150
|
* @type {AttributeDefinition}
|
|
137
151
|
*/
|
|
138
152
|
export const secret_attribute_writable: AttributeDefinition;
|
|
153
|
+
/**
|
|
154
|
+
* @type {AttributeDefinition}
|
|
155
|
+
*/
|
|
156
|
+
export const username_attribute: AttributeDefinition;
|
|
157
|
+
/**
|
|
158
|
+
* @type {AttributeDefinition}
|
|
159
|
+
*/
|
|
160
|
+
export const password_attribute: AttributeDefinition;
|
|
161
|
+
/**
|
|
162
|
+
* @type {AttributeDefinition}
|
|
163
|
+
*/
|
|
164
|
+
export const token_attribute: AttributeDefinition;
|
|
139
165
|
/**
|
|
140
166
|
* @type {AttributeDefinition}
|
|
141
167
|
*/
|
|
@@ -167,6 +193,8 @@ export namespace bytes_size_attribute {
|
|
|
167
193
|
toInternal: typeof import("./bytes.mjs").parseBytes;
|
|
168
194
|
};
|
|
169
195
|
export { type_1 as type };
|
|
196
|
+
let name_1: string;
|
|
197
|
+
export { name_1 as name };
|
|
170
198
|
let writable_1: boolean;
|
|
171
199
|
export { writable_1 as writable };
|
|
172
200
|
}
|
|
@@ -195,6 +223,11 @@ export const port_attribute: AttributeDefinition;
|
|
|
195
223
|
* @type {AttributeDefinition}
|
|
196
224
|
*/
|
|
197
225
|
export const id_attribute: AttributeDefinition;
|
|
226
|
+
/**
|
|
227
|
+
* The body text.
|
|
228
|
+
* @type {AttributeDefinition}
|
|
229
|
+
*/
|
|
230
|
+
export const body_attribute_writable: AttributeDefinition;
|
|
198
231
|
/**
|
|
199
232
|
* The one line description.
|
|
200
233
|
* @type {AttributeDefinition}
|
|
@@ -228,6 +261,7 @@ export const timeout_attribute: AttributeDefinition;
|
|
|
228
261
|
*/
|
|
229
262
|
export const language_attribute: AttributeDefinition;
|
|
230
263
|
export type AttributeDefinition = {
|
|
264
|
+
name: string;
|
|
231
265
|
type: object;
|
|
232
266
|
isKey: boolean;
|
|
233
267
|
writable: boolean;
|
|
@@ -299,4 +333,4 @@ export type AttributeDefinition = {
|
|
|
299
333
|
*/
|
|
300
334
|
separator?: string | undefined;
|
|
301
335
|
};
|
|
302
|
-
export { default_attribute as string_attribute, default_attribute_writable as string_attribute_writable, description_attribute as description_attribute_writable,
|
|
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 };
|