pmcf 4.17.2 → 4.17.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 +1 -1
- package/src/base.mjs +13 -4
- package/src/host.mjs +24 -28
- package/src/services/alpm.mjs +5 -5
- package/src/services/bind.mjs +5 -11
- package/types/base.d.mts +1 -0
- package/types/host.d.mts +3 -6
- package/types/service.d.mts +1 -0
- package/types/services/alpm.d.mts +1 -2
- package/types/services/bind.d.mts +1 -3
package/package.json
CHANGED
package/src/base.mjs
CHANGED
|
@@ -142,11 +142,19 @@ export class Base {
|
|
|
142
142
|
}
|
|
143
143
|
} else {
|
|
144
144
|
if (current instanceof Set) {
|
|
145
|
-
|
|
146
|
-
|
|
145
|
+
if (value instanceof Set) {
|
|
146
|
+
this[name] = current.union(value);
|
|
147
|
+
} else {
|
|
148
|
+
this[name].add(value);
|
|
149
|
+
}
|
|
147
150
|
} else if (current instanceof Map) {
|
|
148
|
-
|
|
149
|
-
|
|
151
|
+
const keyName = attribute.type.key;
|
|
152
|
+
if (keyName) {
|
|
153
|
+
current.set(value[keyName], value);
|
|
154
|
+
} else {
|
|
155
|
+
// TODO
|
|
156
|
+
this[name] = value;
|
|
157
|
+
}
|
|
150
158
|
} else {
|
|
151
159
|
this.error("Unknown collection type", name, current);
|
|
152
160
|
}
|
|
@@ -563,6 +571,7 @@ export class Base {
|
|
|
563
571
|
sources: [],
|
|
564
572
|
outputs: this.outputs,
|
|
565
573
|
properties: {
|
|
574
|
+
name: `${this.typeName}-${this.owner.name}-${this.name}`,
|
|
566
575
|
access: "private",
|
|
567
576
|
dependencies: this.depends,
|
|
568
577
|
groups: [this.type]
|
package/src/host.mjs
CHANGED
|
@@ -409,34 +409,30 @@ export class Host extends ServiceOwner {
|
|
|
409
409
|
}
|
|
410
410
|
|
|
411
411
|
async *preparePackages(dir) {
|
|
412
|
-
const
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
412
|
+
const packageData = this.packageData;
|
|
413
|
+
packageData.sources.push(
|
|
414
|
+
await Array.fromAsync(this.templateContent()),
|
|
415
|
+
new FileContentProvider(
|
|
416
|
+
{ dir: this.directory, pattern: "*.pub" },
|
|
417
|
+
{ destination: "/etc/ssh/", mode: 0o644 }
|
|
418
|
+
),
|
|
419
|
+
new FileContentProvider(
|
|
420
|
+
{ dir: this.directory, pattern: "*_key" },
|
|
421
|
+
{ destination: "/etc/ssh/", mode: 0o600 }
|
|
422
|
+
),
|
|
423
|
+
new FileContentProvider({ dir, pattern: ["**/*", "**/.ssh/*"] })
|
|
424
|
+
);
|
|
425
|
+
|
|
426
|
+
Object.assign(packageData.properties, {
|
|
427
|
+
description: `${this.typeName} definitions for ${this.fullName}`,
|
|
428
|
+
dependencies: [
|
|
429
|
+
`${this.location.typeName}-${this.location.name}`,
|
|
430
|
+
...this.depends
|
|
425
431
|
],
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
access: "private",
|
|
431
|
-
dependencies: [
|
|
432
|
-
`${this.location.typeName}-${this.location.name}`,
|
|
433
|
-
...this.depends
|
|
434
|
-
],
|
|
435
|
-
provides: [...this.provides],
|
|
436
|
-
replaces: [...this.replaces],
|
|
437
|
-
backup: "root/.ssh/known_hosts"
|
|
438
|
-
}
|
|
439
|
-
};
|
|
432
|
+
provides: [...this.provides],
|
|
433
|
+
replaces: [...this.replaces],
|
|
434
|
+
backup: "root/.ssh/known_hosts"
|
|
435
|
+
});
|
|
440
436
|
|
|
441
437
|
await loadHooks(
|
|
442
438
|
packageData,
|
|
@@ -484,7 +480,7 @@ export class Host extends ServiceOwner {
|
|
|
484
480
|
name: `${this.typeName}-extra-${this.owner.name}-${this.name}`,
|
|
485
481
|
description: `additional files for ${this.fullName}`,
|
|
486
482
|
access: "private",
|
|
487
|
-
dependencies: [
|
|
483
|
+
dependencies: [packageData.properties.name]
|
|
488
484
|
}
|
|
489
485
|
};
|
|
490
486
|
}
|
package/src/services/alpm.mjs
CHANGED
|
@@ -11,6 +11,7 @@ import { ServiceTypeDefinition, Service } from "../service.mjs";
|
|
|
11
11
|
const ALPMRepositoryTypeDefinition = {
|
|
12
12
|
name: "alpm_repository",
|
|
13
13
|
extends: Base.typeDefinition,
|
|
14
|
+
key: "name",
|
|
14
15
|
attributes: {
|
|
15
16
|
name: name_attribute_writable,
|
|
16
17
|
base: string_attribute_writable,
|
|
@@ -26,6 +27,9 @@ class ALPMRepository extends Base {
|
|
|
26
27
|
static get typeDefinition() {
|
|
27
28
|
return ALPMRepositoryTypeDefinition;
|
|
28
29
|
}
|
|
30
|
+
|
|
31
|
+
architectures = new Set();
|
|
32
|
+
|
|
29
33
|
}
|
|
30
34
|
|
|
31
35
|
const ALPMServiceTypeDefinition = {
|
|
@@ -56,9 +60,5 @@ export class ALPMService extends Service {
|
|
|
56
60
|
return ALPMServiceTypeDefinition;
|
|
57
61
|
}
|
|
58
62
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
set repositories(repository) {
|
|
62
|
-
this._repositories.set(repository.name, repository);
|
|
63
|
-
}
|
|
63
|
+
repositories = new Map();
|
|
64
64
|
}
|
package/src/services/bind.mjs
CHANGED
|
@@ -6,10 +6,11 @@ import {
|
|
|
6
6
|
addType,
|
|
7
7
|
default_attribute_writable,
|
|
8
8
|
string_attribute_writable,
|
|
9
|
+
string_collection_attribute_writable,
|
|
10
|
+
string_set_attribute_writable,
|
|
9
11
|
boolean_attribute_writable_true,
|
|
10
12
|
boolean_attribute_writable_false,
|
|
11
13
|
number_attribute_writable,
|
|
12
|
-
string_collection_attribute_writable,
|
|
13
14
|
name_attribute_writable
|
|
14
15
|
} from "pacc";
|
|
15
16
|
import {
|
|
@@ -79,7 +80,7 @@ const BindServiceTypeDefinition = {
|
|
|
79
80
|
hasCatalog: boolean_attribute_writable_true,
|
|
80
81
|
hasLinkLocalAdresses: boolean_attribute_writable_false,
|
|
81
82
|
hasLocationRecord: boolean_attribute_writable_true,
|
|
82
|
-
excludeInterfaceKinds:
|
|
83
|
+
excludeInterfaceKinds: string_set_attribute_writable,
|
|
83
84
|
exclude: {
|
|
84
85
|
...default_attribute_writable,
|
|
85
86
|
type: networkAddressType,
|
|
@@ -160,7 +161,8 @@ export class BindService extends ExtraSourceService {
|
|
|
160
161
|
_zones = [];
|
|
161
162
|
_trusted = [];
|
|
162
163
|
_exclude = new Set([]);
|
|
163
|
-
|
|
164
|
+
|
|
165
|
+
excludeInterfaceKinds = new Set();
|
|
164
166
|
|
|
165
167
|
serial = Math.ceil(Date.now() / 1000);
|
|
166
168
|
refresh = 36000;
|
|
@@ -245,14 +247,6 @@ export class BindService extends ExtraSourceService {
|
|
|
245
247
|
return this._exclude;
|
|
246
248
|
}
|
|
247
249
|
|
|
248
|
-
set excludeInterfaceKinds(value) {
|
|
249
|
-
this._excludeInterfaceKinds.add(value);
|
|
250
|
-
}
|
|
251
|
-
|
|
252
|
-
get excludeInterfaceKinds() {
|
|
253
|
-
return this._excludeInterfaceKinds;
|
|
254
|
-
}
|
|
255
|
-
|
|
256
250
|
async *preparePackages(dir) {
|
|
257
251
|
const sources = this.zones.length ? this.zones : [this.owner];
|
|
258
252
|
const names = sources.map(a => a.fullName).join(" ");
|
package/types/base.d.mts
CHANGED
|
@@ -135,6 +135,7 @@ export class Base {
|
|
|
135
135
|
sources: any[];
|
|
136
136
|
outputs: Set<typeof import("npm-pkgbuild").DEBIAN | typeof import("npm-pkgbuild").ARCH | typeof import("npm-pkgbuild").OCI | typeof import("npm-pkgbuild").DOCKER>;
|
|
137
137
|
properties: {
|
|
138
|
+
name: string;
|
|
138
139
|
access: string;
|
|
139
140
|
dependencies: any;
|
|
140
141
|
groups: any[];
|
package/types/host.d.mts
CHANGED
|
@@ -261,16 +261,13 @@ export class Host extends ServiceOwner {
|
|
|
261
261
|
get subnets(): Set<any>;
|
|
262
262
|
publicKey(type?: string): Promise<string>;
|
|
263
263
|
preparePackages(dir: any): AsyncGenerator<{
|
|
264
|
-
sources:
|
|
264
|
+
sources: any[];
|
|
265
265
|
outputs: Set<typeof import("npm-pkgbuild").DEBIAN | typeof import("npm-pkgbuild").ARCH | typeof import("npm-pkgbuild").OCI | typeof import("npm-pkgbuild").DOCKER>;
|
|
266
266
|
properties: {
|
|
267
267
|
name: string;
|
|
268
|
-
description: string;
|
|
269
268
|
access: string;
|
|
270
|
-
dependencies: any
|
|
271
|
-
|
|
272
|
-
replaces: any[];
|
|
273
|
-
backup: string;
|
|
269
|
+
dependencies: any;
|
|
270
|
+
groups: any[];
|
|
274
271
|
};
|
|
275
272
|
} | {
|
|
276
273
|
sources: FileContentProvider[];
|
package/types/service.d.mts
CHANGED
|
@@ -662,6 +662,7 @@ export class Service extends Base {
|
|
|
662
662
|
sources: any[];
|
|
663
663
|
outputs: Set<typeof import("npm-pkgbuild").DEBIAN | typeof import("npm-pkgbuild").ARCH | typeof import("npm-pkgbuild").OCI | typeof import("npm-pkgbuild").DOCKER>;
|
|
664
664
|
properties: {
|
|
665
|
+
name: string;
|
|
665
666
|
access: string;
|
|
666
667
|
dependencies: any;
|
|
667
668
|
groups: any[];
|
|
@@ -799,8 +799,7 @@ export class ALPMService extends Service {
|
|
|
799
799
|
extends: string[];
|
|
800
800
|
};
|
|
801
801
|
};
|
|
802
|
-
|
|
803
|
-
set repositories(repository: any);
|
|
802
|
+
repositories: Map<any, any>;
|
|
804
803
|
}
|
|
805
804
|
import { Service } from "../service.mjs";
|
|
806
805
|
import { Base } from "pmcf";
|
|
@@ -1539,7 +1539,7 @@ export class BindService extends ExtraSourceService {
|
|
|
1539
1539
|
_zones: any[];
|
|
1540
1540
|
_trusted: any[];
|
|
1541
1541
|
_exclude: Set<any>;
|
|
1542
|
-
|
|
1542
|
+
excludeInterfaceKinds: Set<any>;
|
|
1543
1543
|
serial: number;
|
|
1544
1544
|
refresh: number;
|
|
1545
1545
|
retry: number;
|
|
@@ -1558,8 +1558,6 @@ export class BindService extends ExtraSourceService {
|
|
|
1558
1558
|
get trusted(): any[];
|
|
1559
1559
|
set exclude(value: Set<any>);
|
|
1560
1560
|
get exclude(): Set<any>;
|
|
1561
|
-
set excludeInterfaceKinds(value: Set<any>);
|
|
1562
|
-
get excludeInterfaceKinds(): Set<any>;
|
|
1563
1561
|
preparePackages(dir: any): AsyncGenerator<any, void, unknown>;
|
|
1564
1562
|
generateOutfacingDefs(outputControl: any, sources: any): AsyncGenerator<any, void, unknown>;
|
|
1565
1563
|
generateZoneDefs(outputControl: any, sources: any): Promise<any>;
|