pmcf 3.10.2 → 3.10.4

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pmcf",
3
- "version": "3.10.2",
3
+ "version": "3.10.4",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -53,7 +53,7 @@
53
53
  "dependencies": {
54
54
  "ip-utilties": "^1.4.9",
55
55
  "npm-pkgbuild": "^18.2.30",
56
- "pacc": "^4.16.1",
56
+ "pacc": "^4.17.0",
57
57
  "package-directory": "^8.1.0"
58
58
  },
59
59
  "devDependencies": {
package/src/base.mjs CHANGED
@@ -3,6 +3,7 @@ import { allOutputs } from "npm-pkgbuild";
3
3
  import {
4
4
  getAttribute,
5
5
  baseTypes,
6
+ attributeIterator,
6
7
  name_attribute_writable,
7
8
  string_attribute,
8
9
  string_attribute_writable,
@@ -228,8 +229,9 @@ export class Base {
228
229
  this._properties = data.properties;
229
230
  }
230
231
 
231
- for (const [name, attribute] of Object.entries(type.attributes)) {
232
+ for (const [path, attribute] of attributeIterator(type.attributes)) {
232
233
  if (attribute.writable) {
234
+ const name = path.join(".");
233
235
  const value = this.expand(data[name]);
234
236
 
235
237
  if (attribute.collection) {
package/src/owner.mjs CHANGED
@@ -1,7 +1,6 @@
1
1
  import { normalizeCIDR, familyIP } from "ip-utilties";
2
2
  import {
3
3
  string_collection_attribute_writable,
4
- string_attribute,
5
4
  string_attribute_writable,
6
5
  email_attribute
7
6
  } from "pacc";
package/src/root.mjs CHANGED
@@ -80,10 +80,12 @@ export class Root extends Location {
80
80
  for (const type of Object.values(types).sort(
81
81
  (a, b) => b.priority - a.priority
82
82
  )) {
83
- for await (const name of glob(type.clazz.fileNameGlob, {
84
- cwd: this.directory
85
- })) {
86
- await this.load(name, { type });
83
+ if (type.clazz) {
84
+ for await (const name of glob(type.clazz.fileNameGlob, {
85
+ cwd: this.directory
86
+ })) {
87
+ await this.load(name, { type });
88
+ }
87
89
  }
88
90
  }
89
91
 
package/src/types.mjs CHANGED
@@ -1,9 +1,7 @@
1
- import { baseTypes } from "pacc";
1
+ import { baseTypes, attributeIterator, types } from "pacc";
2
2
  import { asArray } from "./utils.mjs";
3
3
  import { addServiceTypes } from "./service-types.mjs";
4
-
5
- export const types = {};
6
-
4
+ export { types };
7
5
  export function addType(clazz) {
8
6
  const type = clazz.typeDefinition;
9
7
 
@@ -22,12 +20,16 @@ export function addType(clazz) {
22
20
 
23
21
  export function resolveTypeLinks() {
24
22
  for (const type of Object.values(types)) {
25
- type.owners = type.owners.map(owner =>
26
- typeof owner === "string" ? types[owner] : owner
27
- );
28
-
29
- for (const [name, attribute] of Object.entries(type.attributes)) {
30
- attribute.name = name;
23
+ if (type.owners) {
24
+ type.owners = type.owners.map(owner =>
25
+ typeof owner === "string" ? types[owner] : owner
26
+ );
27
+ }
28
+ else {
29
+ type.owners = [];
30
+ }
31
+ for (const [path, attribute] of attributeIterator(type.attributes)) {
32
+ attribute.name = path.join(".");
31
33
  if (attribute.isKey) {
32
34
  type.identifier = attribute;
33
35
  }
@@ -43,12 +45,7 @@ export function resolveTypeLinks() {
43
45
  if (t) {
44
46
  ts.push(t);
45
47
  } else {
46
- console.error(
47
- "Unknown type",
48
- attribute.type,
49
- type.name,
50
- name
51
- );
48
+ console.error("Unknown type", attribute.type, type.name, name);
52
49
  }
53
50
  }
54
51
  } else {
package/types/types.d.mts CHANGED
@@ -1,4 +1,5 @@
1
1
  export function addType(clazz: any): void;
2
2
  export function resolveTypeLinks(): void;
3
3
  export function typeFactory(type: any, owner: any, data: any): any;
4
- export const types: {};
4
+ export { types };
5
+ import { types } from "pacc";