@batterai/fields-pure 0.1.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/CHANGELOG.md +6 -0
- package/LICENSE +21 -0
- package/README.md +21 -0
- package/dist/component-keys.d.ts +2 -0
- package/dist/component-keys.d.ts.map +1 -0
- package/dist/component-keys.js +2 -0
- package/dist/component-keys.js.map +1 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +9 -0
- package/dist/index.js.map +1 -0
- package/dist/reference-provider.d.ts +23 -0
- package/dist/reference-provider.d.ts.map +1 -0
- package/dist/reference-provider.js +29 -0
- package/dist/reference-provider.js.map +1 -0
- package/dist/scope-stack-to-groups.d.ts +9 -0
- package/dist/scope-stack-to-groups.d.ts.map +1 -0
- package/dist/scope-stack-to-groups.js +66 -0
- package/dist/scope-stack-to-groups.js.map +1 -0
- package/dist/types.d.ts +24 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/package.json +35 -0
package/CHANGELOG.md
ADDED
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Batterai.eu
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# @batterai/fields-pure
|
|
2
|
+
|
|
3
|
+
React-free field helpers for server/runtime packages.
|
|
4
|
+
|
|
5
|
+
## What It Provides
|
|
6
|
+
|
|
7
|
+
- Shared field helper types.
|
|
8
|
+
- Scope-stack to inspector-group mapping.
|
|
9
|
+
- Reference-provider helpers without React or TipTap imports.
|
|
10
|
+
|
|
11
|
+
## Install
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
npm install @batterai/fields-pure
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Requires Node.js `>=20.11`.
|
|
18
|
+
|
|
19
|
+
## Boundary
|
|
20
|
+
|
|
21
|
+
Use this package from runtime, adapter, and server code that must not pull the React-based editor field package into production bundles.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"component-keys.d.ts","sourceRoot":"","sources":["../src/component-keys.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"component-keys.js","sourceRoot":"","sources":["../src/component-keys.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @batterai/fields-pure — React-free field helpers that server/runtime
|
|
3
|
+
* packages may import without pulling React or TipTap into their bundles.
|
|
4
|
+
*/
|
|
5
|
+
export * from "./types";
|
|
6
|
+
export * from "./component-keys";
|
|
7
|
+
export * from "./scope-stack-to-groups";
|
|
8
|
+
export * from "./reference-provider";
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,cAAc,SAAS,CAAC;AACxB,cAAc,kBAAkB,CAAC;AACjC,cAAc,yBAAyB,CAAC;AACxC,cAAc,sBAAsB,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @batterai/fields-pure — React-free field helpers that server/runtime
|
|
3
|
+
* packages may import without pulling React or TipTap into their bundles.
|
|
4
|
+
*/
|
|
5
|
+
export * from "./types.js";
|
|
6
|
+
export * from "./component-keys.js";
|
|
7
|
+
export * from "./scope-stack-to-groups.js";
|
|
8
|
+
export * from "./reference-provider.js";
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,cAAc,SAAS,CAAC;AACxB,cAAc,kBAAkB,CAAC;AACjC,cAAc,yBAAyB,CAAC;AACxC,cAAc,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ReferenceProvider seam (decision 003 §b). A provider resolves option lists
|
|
3
|
+
* and labels; vendor vocabularies become adapter-registered providers, never
|
|
4
|
+
* package-specific concepts.
|
|
5
|
+
*/
|
|
6
|
+
import type { FieldOption, FieldOptionsSource, Locale } from "@batterai/contract";
|
|
7
|
+
export interface ReferenceProvider {
|
|
8
|
+
readonly id: string;
|
|
9
|
+
resolveOptions(params: Readonly<Record<string, unknown>> | undefined, locale: Locale): Promise<readonly FieldOption[]> | readonly FieldOption[];
|
|
10
|
+
resolveLabel(value: string, params: Readonly<Record<string, unknown>> | undefined, locale: Locale): Promise<string> | string;
|
|
11
|
+
}
|
|
12
|
+
export interface ReferenceProviderRegistry {
|
|
13
|
+
register(provider: ReferenceProvider): void;
|
|
14
|
+
get(providerId: string): ReferenceProvider | undefined;
|
|
15
|
+
}
|
|
16
|
+
export declare function createReferenceProviderRegistry(): ReferenceProviderRegistry;
|
|
17
|
+
/**
|
|
18
|
+
* Resolve any options source to items. Static sources return as-is; provider
|
|
19
|
+
* sources resolve through the registry. Missing providers are visible errors,
|
|
20
|
+
* never empty option lists.
|
|
21
|
+
*/
|
|
22
|
+
export declare function resolveOptions(source: FieldOptionsSource, registry: ReferenceProviderRegistry, locale: Locale): Promise<readonly FieldOption[]>;
|
|
23
|
+
//# sourceMappingURL=reference-provider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reference-provider.d.ts","sourceRoot":"","sources":["../src/reference-provider.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAElF,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,cAAc,CACZ,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GAAG,SAAS,EACrD,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,SAAS,WAAW,EAAE,CAAC,GAAG,SAAS,WAAW,EAAE,CAAC;IAC5D,YAAY,CACV,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GAAG,SAAS,EACrD,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC;CAC7B;AAED,MAAM,WAAW,yBAAyB;IACxC,QAAQ,CAAC,QAAQ,EAAE,iBAAiB,GAAG,IAAI,CAAC;IAC5C,GAAG,CAAC,UAAU,EAAE,MAAM,GAAG,iBAAiB,GAAG,SAAS,CAAC;CACxD;AAED,wBAAgB,+BAA+B,IAAI,yBAAyB,CAa3E;AAED;;;;GAIG;AACH,wBAAsB,cAAc,CAClC,MAAM,EAAE,kBAAkB,EAC1B,QAAQ,EAAE,yBAAyB,EACnC,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,SAAS,WAAW,EAAE,CAAC,CAOjC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export function createReferenceProviderRegistry() {
|
|
2
|
+
const providers = new Map();
|
|
3
|
+
return {
|
|
4
|
+
register(provider) {
|
|
5
|
+
if (providers.has(provider.id)) {
|
|
6
|
+
throw new Error(`ReferenceProviderRegistry: duplicate provider id "${provider.id}"`);
|
|
7
|
+
}
|
|
8
|
+
providers.set(provider.id, provider);
|
|
9
|
+
},
|
|
10
|
+
get(providerId) {
|
|
11
|
+
return providers.get(providerId);
|
|
12
|
+
},
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Resolve any options source to items. Static sources return as-is; provider
|
|
17
|
+
* sources resolve through the registry. Missing providers are visible errors,
|
|
18
|
+
* never empty option lists.
|
|
19
|
+
*/
|
|
20
|
+
export async function resolveOptions(source, registry, locale) {
|
|
21
|
+
if (source.kind === "static")
|
|
22
|
+
return source.items;
|
|
23
|
+
const provider = registry.get(source.providerId);
|
|
24
|
+
if (!provider) {
|
|
25
|
+
throw new Error(`resolveOptions: no ReferenceProvider registered for "${source.providerId}"`);
|
|
26
|
+
}
|
|
27
|
+
return provider.resolveOptions(source.params, locale);
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=reference-provider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reference-provider.js","sourceRoot":"","sources":["../src/reference-provider.ts"],"names":[],"mappings":"AAyBA,MAAM,UAAU,+BAA+B;IAC7C,MAAM,SAAS,GAAG,IAAI,GAAG,EAA6B,CAAC;IACvD,OAAO;QACL,QAAQ,CAAC,QAAQ;YACf,IAAI,SAAS,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC,EAAE,CAAC;gBAC/B,MAAM,IAAI,KAAK,CAAC,qDAAqD,QAAQ,CAAC,EAAE,GAAG,CAAC,CAAC;YACvF,CAAC;YACD,SAAS,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,EAAE,QAAQ,CAAC,CAAC;QACvC,CAAC;QACD,GAAG,CAAC,UAAU;YACZ,OAAO,SAAS,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;QACnC,CAAC;KACF,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,cAAc,CAClC,MAA0B,EAC1B,QAAmC,EACnC,MAAc;IAEd,IAAI,MAAM,CAAC,IAAI,KAAK,QAAQ;QAAE,OAAO,MAAM,CAAC,KAAK,CAAC;IAClD,MAAM,QAAQ,GAAG,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;IACjD,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,MAAM,IAAI,KAAK,CAAC,wDAAwD,MAAM,CAAC,UAAU,GAAG,CAAC,CAAC;IAChG,CAAC;IACD,OAAO,QAAQ,CAAC,cAAc,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AACxD,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pure ScopeStack -> BuildTabGroup[] (decision 003 §e). The host supplies the
|
|
3
|
+
* viewer-filtered ContentType per instance frame; this function only shapes
|
|
4
|
+
* data and performs no I/O or authorization.
|
|
5
|
+
*/
|
|
6
|
+
import { type ScopeStack } from "@batterai/bind-core";
|
|
7
|
+
import type { BuildTabGroup } from "./types";
|
|
8
|
+
export declare function scopeStackToGroups(stack: ScopeStack): BuildTabGroup[];
|
|
9
|
+
//# sourceMappingURL=scope-stack-to-groups.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scope-stack-to-groups.d.ts","sourceRoot":"","sources":["../src/scope-stack-to-groups.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAIL,KAAK,UAAU,EAChB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAiB,aAAa,EAAE,MAAM,SAAS,CAAC;AAW5D,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,UAAU,GAAG,aAAa,EAAE,CAiCrE"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pure ScopeStack -> BuildTabGroup[] (decision 003 §e). The host supplies the
|
|
3
|
+
* viewer-filtered ContentType per instance frame; this function only shapes
|
|
4
|
+
* data and performs no I/O or authorization.
|
|
5
|
+
*/
|
|
6
|
+
import { CURRENT_SCHEMA_VERSION, fieldName, } from "@batterai/bind-core";
|
|
7
|
+
/** Synthetic structural fields for repeater/page frames. */
|
|
8
|
+
const REPEATER_FIELDS = [
|
|
9
|
+
{ name: fieldName("index"), valueType: "number", cardinality: "one", label: "Positie in lijst" },
|
|
10
|
+
];
|
|
11
|
+
const PAGE_FIELDS = [
|
|
12
|
+
{ name: fieldName("path"), valueType: "string", cardinality: "one", label: "Paginapad" },
|
|
13
|
+
{ name: fieldName("id"), valueType: "string", cardinality: "one", label: "Pagina-id" },
|
|
14
|
+
];
|
|
15
|
+
export function scopeStackToGroups(stack) {
|
|
16
|
+
const groups = [];
|
|
17
|
+
// Innermost first: the nearest scope is what an author usually binds.
|
|
18
|
+
for (let i = stack.length - 1; i >= 0; i--) {
|
|
19
|
+
const frame = stack[i];
|
|
20
|
+
if (frame.kind === "instance") {
|
|
21
|
+
const entries = [];
|
|
22
|
+
for (const f of frame.contentType.fields) {
|
|
23
|
+
entries.push(entry(frame.scopeId, "instance", f, [f.name]));
|
|
24
|
+
}
|
|
25
|
+
groups.push({
|
|
26
|
+
scopeId: frame.scopeId,
|
|
27
|
+
frameKind: "instance",
|
|
28
|
+
groupLabel: frame.contentType.name,
|
|
29
|
+
entries,
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
else if (frame.kind === "repeater") {
|
|
33
|
+
groups.push({
|
|
34
|
+
scopeId: frame.scopeId,
|
|
35
|
+
frameKind: "repeater",
|
|
36
|
+
groupLabel: "Lijstitem",
|
|
37
|
+
entries: REPEATER_FIELDS.map((f) => entry(frame.scopeId, "repeater", f, [f.name])),
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
groups.push({
|
|
42
|
+
scopeId: frame.scopeId,
|
|
43
|
+
frameKind: "page",
|
|
44
|
+
groupLabel: "Pagina",
|
|
45
|
+
entries: PAGE_FIELDS.map((f) => entry(frame.scopeId, "page", f, [f.name])),
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
return groups;
|
|
50
|
+
}
|
|
51
|
+
function entry(scopeId, scope, fieldSchema, path) {
|
|
52
|
+
return {
|
|
53
|
+
key: `${scopeId}:${path.join(".")}`,
|
|
54
|
+
label: fieldSchema.label,
|
|
55
|
+
fieldSchema,
|
|
56
|
+
expr: {
|
|
57
|
+
v: CURRENT_SCHEMA_VERSION,
|
|
58
|
+
k: "ref",
|
|
59
|
+
scope,
|
|
60
|
+
scopeId,
|
|
61
|
+
path,
|
|
62
|
+
...(fieldSchema.valueType === "date" ? { format: { kind: "date", style: "long" } } : {}),
|
|
63
|
+
},
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
//# sourceMappingURL=scope-stack-to-groups.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scope-stack-to-groups.js","sourceRoot":"","sources":["../src/scope-stack-to-groups.ts"],"names":[],"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,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAW,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SAClG;KACF,CAAC;AACJ,CAAC"}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Build-tab shapes (decision 003 §e). One entry = one bindable property with a
|
|
3
|
+
* ready-to-insert BindingExpr; controls render what they are given, and the
|
|
4
|
+
* host computes groups from viewer-filtered CMS schema plus the active scope.
|
|
5
|
+
*/
|
|
6
|
+
import type { BindingExpr, FieldSchema, ScopeId } from "@batterai/bind-core";
|
|
7
|
+
export interface BuildTabEntry {
|
|
8
|
+
readonly key: string;
|
|
9
|
+
readonly label: string;
|
|
10
|
+
readonly fieldSchema: FieldSchema;
|
|
11
|
+
/** Fully formed RefExpr — scope + scopeId + path resolved for this frame. */
|
|
12
|
+
readonly expr: BindingExpr;
|
|
13
|
+
}
|
|
14
|
+
export interface BuildTabGroup {
|
|
15
|
+
readonly scopeId: ScopeId;
|
|
16
|
+
readonly frameKind: "instance" | "repeater" | "page";
|
|
17
|
+
readonly groupLabel: string;
|
|
18
|
+
/**
|
|
19
|
+
* Invariant E: unreadable fields are omitted upstream, never shown disabled,
|
|
20
|
+
* because field existence must not leak.
|
|
21
|
+
*/
|
|
22
|
+
readonly entries: readonly BuildTabEntry[];
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAE7E,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,WAAW,EAAE,WAAW,CAAC;IAClC,6EAA6E;IAC7E,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC;CAC5B;AAED,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,SAAS,EAAE,UAAU,GAAG,UAAU,GAAG,MAAM,CAAC;IACrD,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B;;;OAGG;IACH,QAAQ,CAAC,OAAO,EAAE,SAAS,aAAa,EAAE,CAAC;CAC5C"}
|
package/dist/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}
|
package/package.json
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@batterai/fields-pure",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"license": "MIT",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"exports": {
|
|
7
|
+
".": {
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"import": "./dist/index.js"
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
"scripts": {
|
|
13
|
+
"check": "tsc --noEmit",
|
|
14
|
+
"build": "node ../../scripts/build-package.mjs",
|
|
15
|
+
"prepack": "bun run build"
|
|
16
|
+
},
|
|
17
|
+
"dependencies": {
|
|
18
|
+
"@batterai/bind-core": "^0.1.0",
|
|
19
|
+
"@batterai/contract": "^0.1.0"
|
|
20
|
+
},
|
|
21
|
+
"main": "./dist/index.js",
|
|
22
|
+
"types": "./dist/index.d.ts",
|
|
23
|
+
"files": [
|
|
24
|
+
"dist",
|
|
25
|
+
"LICENSE",
|
|
26
|
+
"README.md",
|
|
27
|
+
"CHANGELOG.md"
|
|
28
|
+
],
|
|
29
|
+
"engines": {
|
|
30
|
+
"node": ">=20.11"
|
|
31
|
+
},
|
|
32
|
+
"publishConfig": {
|
|
33
|
+
"access": "public"
|
|
34
|
+
}
|
|
35
|
+
}
|