pmcf 4.5.5 → 4.6.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/package.json +2 -2
- package/src/base.mjs +28 -1
- package/src/services/openldap.mjs +6 -40
- package/types/base.d.mts +1 -0
- package/types/services/openldap.d.mts +4 -9
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pmcf",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.6.0",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -53,7 +53,7 @@
|
|
|
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.
|
|
56
|
+
"content-entry-transform": "^1.6.0",
|
|
57
57
|
"ip-utilties": "^2.0.2",
|
|
58
58
|
"npm-pkgbuild": "^20.0.1",
|
|
59
59
|
"pacc": "^8.0.2",
|
package/src/base.mjs
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import { join } from "node:path";
|
|
2
2
|
import { allOutputs } from "npm-pkgbuild";
|
|
3
|
+
import {
|
|
4
|
+
createExpressionTransformer,
|
|
5
|
+
transform
|
|
6
|
+
} from "content-entry-transform";
|
|
7
|
+
import { FileContentProvider } from "npm-pkgbuild";
|
|
3
8
|
import {
|
|
4
9
|
getAttribute,
|
|
5
10
|
typeFactory,
|
|
@@ -19,7 +24,6 @@ import {
|
|
|
19
24
|
description_attribute_writable,
|
|
20
25
|
boolean_attribute_writable
|
|
21
26
|
} from "pacc";
|
|
22
|
-
|
|
23
27
|
import { asArray } from "./utils.mjs";
|
|
24
28
|
|
|
25
29
|
/**
|
|
@@ -560,6 +564,29 @@ export class Base {
|
|
|
560
564
|
|
|
561
565
|
async *preparePackages(stagingDir) {}
|
|
562
566
|
|
|
567
|
+
templateContent(entryProperties, directoryProperties) {
|
|
568
|
+
const transformers = [
|
|
569
|
+
createExpressionTransformer(
|
|
570
|
+
e => e.isBlob,
|
|
571
|
+
expression =>
|
|
572
|
+
parse(expression, {
|
|
573
|
+
root: this,
|
|
574
|
+
getGlobal: id => this.getGlobal(id)
|
|
575
|
+
})
|
|
576
|
+
)
|
|
577
|
+
];
|
|
578
|
+
|
|
579
|
+
return [...this.allExtends(), this].map(e => {
|
|
580
|
+
const dir = join(e.directory, "content") + "/";
|
|
581
|
+
console.log("DIR", dir);
|
|
582
|
+
|
|
583
|
+
return transform(
|
|
584
|
+
new FileContentProvider(dir, entryProperties, directoryProperties),
|
|
585
|
+
transformers
|
|
586
|
+
);
|
|
587
|
+
});
|
|
588
|
+
}
|
|
589
|
+
|
|
563
590
|
get tags() {
|
|
564
591
|
return this._tags;
|
|
565
592
|
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { join } from "node:path";
|
|
2
1
|
import { FileContentProvider } from "npm-pkgbuild";
|
|
3
2
|
import {
|
|
4
3
|
string_attribute_writable,
|
|
@@ -9,10 +8,6 @@ import {
|
|
|
9
8
|
import { addServiceType } from "pmcf";
|
|
10
9
|
import { ServiceTypeDefinition, Service } from "../service.mjs";
|
|
11
10
|
import { addHook } from "../hooks.mjs";
|
|
12
|
-
import {
|
|
13
|
-
createExpressionTransformer,
|
|
14
|
-
transform
|
|
15
|
-
} from "content-entry-transform";
|
|
16
11
|
|
|
17
12
|
const OpenLDAPServiceTypeDefinition = {
|
|
18
13
|
name: "openldap",
|
|
@@ -21,8 +16,7 @@ const OpenLDAPServiceTypeDefinition = {
|
|
|
21
16
|
owners: ServiceTypeDefinition.owners,
|
|
22
17
|
key: "name",
|
|
23
18
|
attributes: {
|
|
24
|
-
|
|
25
|
-
rootDN: string_attribute_writable,
|
|
19
|
+
base: string_attribute_writable,
|
|
26
20
|
uri: string_attribute_writable,
|
|
27
21
|
|
|
28
22
|
DB_CONFIG: {
|
|
@@ -67,27 +61,18 @@ export class OpenLDAPService extends Service {
|
|
|
67
61
|
return OpenLDAPServiceTypeDefinition;
|
|
68
62
|
}
|
|
69
63
|
|
|
70
|
-
|
|
71
|
-
_rootDN;
|
|
64
|
+
_base;
|
|
72
65
|
|
|
73
66
|
get type() {
|
|
74
67
|
return OpenLDAPServiceTypeDefinition.name;
|
|
75
68
|
}
|
|
76
69
|
|
|
77
|
-
get
|
|
78
|
-
return this.expand(this.
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
set baseDN(value) {
|
|
82
|
-
this._baseDN = value;
|
|
70
|
+
get base() {
|
|
71
|
+
return this.expand(this._base);
|
|
83
72
|
}
|
|
84
73
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
set rootDN(value) {
|
|
90
|
-
this._rootDN = value;
|
|
74
|
+
set base(value) {
|
|
75
|
+
this._base = value;
|
|
91
76
|
}
|
|
92
77
|
|
|
93
78
|
get uri() {
|
|
@@ -98,25 +83,6 @@ export class OpenLDAPService extends Service {
|
|
|
98
83
|
this._uri = value;
|
|
99
84
|
}
|
|
100
85
|
|
|
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
|
-
|
|
120
86
|
async *preparePackages(dir) {
|
|
121
87
|
const host = this.host;
|
|
122
88
|
const name = host.name;
|
package/types/base.d.mts
CHANGED
|
@@ -123,6 +123,7 @@ export class Base {
|
|
|
123
123
|
get derivedPackaging(): any;
|
|
124
124
|
get outputs(): Set<typeof import("npm-pkgbuild").OCI | typeof import("npm-pkgbuild").DOCKER>;
|
|
125
125
|
preparePackages(stagingDir: any): AsyncGenerator<never, void, unknown>;
|
|
126
|
+
templateContent(entryProperties: any, directoryProperties: any): any[];
|
|
126
127
|
set tags(value: Set<any>);
|
|
127
128
|
get tags(): Set<any>;
|
|
128
129
|
get isTemplate(): any;
|
|
@@ -743,8 +743,7 @@ export class OpenLDAPService extends Service {
|
|
|
743
743
|
})[];
|
|
744
744
|
key: string;
|
|
745
745
|
attributes: {
|
|
746
|
-
|
|
747
|
-
rootDN: import("pacc").AttributeDefinition;
|
|
746
|
+
base: import("pacc").AttributeDefinition;
|
|
748
747
|
uri: import("pacc").AttributeDefinition;
|
|
749
748
|
DB_CONFIG: {
|
|
750
749
|
attributes: {
|
|
@@ -864,17 +863,13 @@ export class OpenLDAPService extends Service {
|
|
|
864
863
|
services: {};
|
|
865
864
|
};
|
|
866
865
|
};
|
|
867
|
-
|
|
868
|
-
_rootDN: any;
|
|
866
|
+
_base: any;
|
|
869
867
|
get type(): string;
|
|
870
|
-
set
|
|
871
|
-
get
|
|
872
|
-
set rootDN(value: any);
|
|
873
|
-
get rootDN(): any;
|
|
868
|
+
set base(value: any);
|
|
869
|
+
get base(): any;
|
|
874
870
|
set uri(value: any);
|
|
875
871
|
get uri(): any;
|
|
876
872
|
_uri: any;
|
|
877
|
-
templateContent(entryProperties: any, directoryProperties: any): any[];
|
|
878
873
|
preparePackages(dir: any): AsyncGenerator<{
|
|
879
874
|
dir: any;
|
|
880
875
|
sources: any[];
|