pmcf 4.5.2 → 4.5.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 +3 -3
- package/src/base.mjs +10 -3
- package/src/services/openldap.mjs +24 -17
- package/types/base.d.mts +1 -0
- package/types/services/openldap.d.mts +1 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pmcf",
|
|
3
|
-
"version": "4.5.
|
|
3
|
+
"version": "4.5.4",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -53,9 +53,9 @@
|
|
|
53
53
|
"lint:typescript": "tsc --allowJs --checkJs --noEmit --resolveJsonModule --target esnext -m esnext --module nodenext --moduleResolution nodenext ./src**/*.mjs"
|
|
54
54
|
},
|
|
55
55
|
"dependencies": {
|
|
56
|
-
"content-entry-transform": "^1.5.
|
|
56
|
+
"content-entry-transform": "^1.5.18",
|
|
57
57
|
"ip-utilties": "^2.0.2",
|
|
58
|
-
"npm-pkgbuild": "^
|
|
58
|
+
"npm-pkgbuild": "^20.0.1",
|
|
59
59
|
"pacc": "^8.0.2",
|
|
60
60
|
"package-directory": "^8.1.0"
|
|
61
61
|
},
|
package/src/base.mjs
CHANGED
|
@@ -306,13 +306,20 @@ export class Base {
|
|
|
306
306
|
return this.owner.addObject(object);
|
|
307
307
|
}
|
|
308
308
|
|
|
309
|
-
*
|
|
309
|
+
*_allExtends(all) {
|
|
310
310
|
for (const e of this.extends) {
|
|
311
|
-
|
|
312
|
-
|
|
311
|
+
if (!all.has(e)) {
|
|
312
|
+
all.add(e);
|
|
313
|
+
yield e;
|
|
314
|
+
yield* e._allExtends(all);
|
|
315
|
+
}
|
|
313
316
|
}
|
|
314
317
|
}
|
|
315
318
|
|
|
319
|
+
*allExtends() {
|
|
320
|
+
yield* this._allExtends(new Set());
|
|
321
|
+
}
|
|
322
|
+
|
|
316
323
|
*owners() {
|
|
317
324
|
if (this.owner) {
|
|
318
325
|
yield* this.owner.thisAndOwners();
|
|
@@ -9,7 +9,10 @@ import {
|
|
|
9
9
|
import { addServiceType } from "pmcf";
|
|
10
10
|
import { ServiceTypeDefinition, Service } from "../service.mjs";
|
|
11
11
|
import { addHook } from "../hooks.mjs";
|
|
12
|
-
import {
|
|
12
|
+
import {
|
|
13
|
+
createExpressionTransformer,
|
|
14
|
+
transform
|
|
15
|
+
} from "content-entry-transform";
|
|
13
16
|
|
|
14
17
|
const OpenLDAPServiceTypeDefinition = {
|
|
15
18
|
name: "openldap",
|
|
@@ -95,6 +98,25 @@ export class OpenLDAPService extends Service {
|
|
|
95
98
|
this._uri = value;
|
|
96
99
|
}
|
|
97
100
|
|
|
101
|
+
templateContent(entryProperties, directoryProperties) {
|
|
102
|
+
const transformers = [
|
|
103
|
+
createExpressionTransformer(e => true, {
|
|
104
|
+
base: this.baseDN,
|
|
105
|
+
uri: this.uri
|
|
106
|
+
})
|
|
107
|
+
];
|
|
108
|
+
|
|
109
|
+
return [...this.allExtends(), this].map(e => {
|
|
110
|
+
const dir = join(e.directory, "content") + "/";
|
|
111
|
+
console.log("DIR", dir);
|
|
112
|
+
|
|
113
|
+
return transform(
|
|
114
|
+
new FileContentProvider(dir, entryProperties, directoryProperties),
|
|
115
|
+
transformers
|
|
116
|
+
);
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
|
|
98
120
|
async *preparePackages(dir) {
|
|
99
121
|
const host = this.host;
|
|
100
122
|
const name = host.name;
|
|
@@ -111,26 +133,11 @@ export class OpenLDAPService extends Service {
|
|
|
111
133
|
owner,
|
|
112
134
|
group
|
|
113
135
|
};
|
|
114
|
-
const transformers = [
|
|
115
|
-
createExpressionTransformer(e => true, { base: this.baseDN, uri: this.uri })
|
|
116
|
-
];
|
|
117
|
-
|
|
118
|
-
const templateDirs = [];
|
|
119
|
-
for (const e of [...this.allExtends(), this]) {
|
|
120
|
-
const base = join(e.directory, "content") + "/";
|
|
121
|
-
templateDirs.push(
|
|
122
|
-
transform(new FileContentProvider(
|
|
123
|
-
{ transformers, base },
|
|
124
|
-
entryProperties,
|
|
125
|
-
directoryProperties
|
|
126
|
-
), transformers)
|
|
127
|
-
);
|
|
128
|
-
}
|
|
129
136
|
|
|
130
137
|
const packageData = {
|
|
131
138
|
dir,
|
|
132
139
|
sources: [
|
|
133
|
-
...
|
|
140
|
+
...this.templateContent(entryProperties, directoryProperties),
|
|
134
141
|
new FileContentProvider(dir + "/", entryProperties, directoryProperties)
|
|
135
142
|
],
|
|
136
143
|
outputs: this.outputs,
|
package/types/base.d.mts
CHANGED
|
@@ -60,6 +60,7 @@ export class Base {
|
|
|
60
60
|
named(name: any): void;
|
|
61
61
|
typeNamed(typeName: any, name: any): any;
|
|
62
62
|
addObject(object: any): any;
|
|
63
|
+
_allExtends(all: any): Generator<any, void, any>;
|
|
63
64
|
allExtends(): Generator<any, void, any>;
|
|
64
65
|
owners(): any;
|
|
65
66
|
thisAndOwners(): any;
|
|
@@ -874,6 +874,7 @@ export class OpenLDAPService extends Service {
|
|
|
874
874
|
set uri(value: any);
|
|
875
875
|
get uri(): any;
|
|
876
876
|
_uri: any;
|
|
877
|
+
templateContent(entryProperties: any, directoryProperties: any): any[];
|
|
877
878
|
preparePackages(dir: any): AsyncGenerator<{
|
|
878
879
|
dir: any;
|
|
879
880
|
sources: any[];
|