@milaboratories/pl-middle-layer 1.10.21 → 1.10.23
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/dist/block_registry/index.d.ts +0 -1
- package/dist/block_registry/index.d.ts.map +1 -1
- package/dist/block_registry/registry-v2-provider.d.ts +9 -0
- package/dist/block_registry/registry-v2-provider.d.ts.map +1 -0
- package/dist/block_registry/registry.d.ts +6 -28
- package/dist/block_registry/registry.d.ts.map +1 -1
- package/dist/block_registry/watcher.d.ts.map +1 -1
- package/dist/block_registry/well_known_registries.d.ts +4 -3
- package/dist/block_registry/well_known_registries.d.ts.map +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +360 -340
- package/dist/index.mjs.map +1 -1
- package/dist/mutator/block-pack/block_pack.d.ts.map +1 -1
- package/dist/test/block_packs.d.ts.map +1 -1
- package/package.json +10 -9
- package/src/block_registry/index.ts +0 -1
- package/src/block_registry/registry-v2-provider.ts +16 -0
- package/src/block_registry/registry.test.ts +9 -30
- package/src/block_registry/registry.ts +84 -72
- package/src/block_registry/watcher.ts +6 -3
- package/src/block_registry/well_known_registries.ts +10 -7
- package/src/index.ts +0 -3
- package/src/middle_layer/middle_layer.test.ts +50 -38
- package/src/middle_layer/render.test.ts +5 -10
- package/src/mutator/block-pack/block_pack.test.ts +7 -10
- package/src/mutator/block-pack/block_pack.ts +13 -5
- package/src/test/block_packs.ts +10 -6
- package/dist/block_registry/registry_spec.d.ts +0 -12
- package/dist/block_registry/registry_spec.d.ts.map +0 -1
- package/src/block_registry/registry_spec.ts +0 -13
|
@@ -32,7 +32,6 @@ export class BlockPackPreparer {
|
|
|
32
32
|
case 'explicit':
|
|
33
33
|
return spec.config;
|
|
34
34
|
|
|
35
|
-
case 'dev':
|
|
36
35
|
case 'dev-v1': {
|
|
37
36
|
const devPaths = await resolveDevPacket(spec.folder, false);
|
|
38
37
|
const configContent = await fs.promises.readFile(devPaths.config, { encoding: 'utf-8' });
|
|
@@ -50,13 +49,17 @@ export class BlockPackPreparer {
|
|
|
50
49
|
case 'from-registry-v1': {
|
|
51
50
|
const httpOptions = this.http !== undefined ? { dispatcher: this.http } : {};
|
|
52
51
|
|
|
53
|
-
const urlPrefix = `${tSlash(spec.registryUrl)}${RegistryV1.packageContentPrefix(spec)}`;
|
|
52
|
+
const urlPrefix = `${tSlash(spec.registryUrl)}${RegistryV1.packageContentPrefix({ organization: spec.id.organization, package: spec.id.name, version: spec.id.version })}`;
|
|
54
53
|
|
|
55
54
|
const configResponse = await request(`${urlPrefix}/config.json`, httpOptions);
|
|
56
55
|
|
|
57
56
|
return (await configResponse.body.json()) as BlockConfig;
|
|
58
57
|
}
|
|
59
58
|
|
|
59
|
+
case 'from-registry-v2': {
|
|
60
|
+
throw new Error('NOT YET SUPPORTED!');
|
|
61
|
+
}
|
|
62
|
+
|
|
60
63
|
default:
|
|
61
64
|
return assertNever(spec);
|
|
62
65
|
}
|
|
@@ -67,7 +70,6 @@ export class BlockPackPreparer {
|
|
|
67
70
|
case 'explicit':
|
|
68
71
|
return spec;
|
|
69
72
|
|
|
70
|
-
case 'dev':
|
|
71
73
|
case 'dev-v1': {
|
|
72
74
|
const devPaths = await resolveDevPacket(spec.folder, false);
|
|
73
75
|
|
|
@@ -105,7 +107,9 @@ export class BlockPackPreparer {
|
|
|
105
107
|
encoding: 'utf-8'
|
|
106
108
|
})
|
|
107
109
|
) as BlockConfig;
|
|
108
|
-
const workflowContent = await fs.promises.readFile(
|
|
110
|
+
const workflowContent = await fs.promises.readFile(
|
|
111
|
+
description.components.workflow.main.file
|
|
112
|
+
);
|
|
109
113
|
const frontendPath = description.components.ui.folder;
|
|
110
114
|
const source = { ...spec };
|
|
111
115
|
if (spec.mtime === undefined)
|
|
@@ -130,7 +134,7 @@ export class BlockPackPreparer {
|
|
|
130
134
|
case 'from-registry-v1': {
|
|
131
135
|
const httpOptions = this.http !== undefined ? { dispatcher: this.http } : {};
|
|
132
136
|
|
|
133
|
-
const urlPrefix = `${tSlash(spec.registryUrl)}${RegistryV1.packageContentPrefix(spec)}`;
|
|
137
|
+
const urlPrefix = `${tSlash(spec.registryUrl)}${RegistryV1.packageContentPrefix({ organization: spec.id.organization, package: spec.id.name, version: spec.id.version })}`;
|
|
134
138
|
|
|
135
139
|
const templateUrl = `${urlPrefix}/template.plj.gz`;
|
|
136
140
|
// template
|
|
@@ -161,6 +165,10 @@ export class BlockPackPreparer {
|
|
|
161
165
|
};
|
|
162
166
|
}
|
|
163
167
|
|
|
168
|
+
case 'from-registry-v2': {
|
|
169
|
+
throw new Error('NOT YET SUPPORTED!');
|
|
170
|
+
}
|
|
171
|
+
|
|
164
172
|
default:
|
|
165
173
|
return assertNever(spec);
|
|
166
174
|
}
|
package/src/test/block_packs.ts
CHANGED
|
@@ -9,15 +9,19 @@ export const TestBPPreparer = new BlockPackPreparer(
|
|
|
9
9
|
export const BPSpecEnterV041NotPrepared: BlockPackSpec = {
|
|
10
10
|
type: 'from-registry-v1',
|
|
11
11
|
registryUrl: 'https://block.registry.platforma.bio/releases',
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
id: {
|
|
13
|
+
organization: 'milaboratory',
|
|
14
|
+
name: 'enter-numbers',
|
|
15
|
+
version: '0.5.0'
|
|
16
|
+
}
|
|
15
17
|
};
|
|
16
18
|
|
|
17
19
|
export const BPSpecSumV042NotPrepared: BlockPackSpec = {
|
|
18
20
|
type: 'from-registry-v1',
|
|
19
21
|
registryUrl: 'https://block.registry.platforma.bio/releases',
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
22
|
+
id: {
|
|
23
|
+
organization: 'milaboratory',
|
|
24
|
+
name: 'sum-numbers',
|
|
25
|
+
version: '0.5.0'
|
|
26
|
+
}
|
|
23
27
|
};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export type RemoteRegistryV1Spec = {
|
|
2
|
-
type: 'remote_v1';
|
|
3
|
-
label: string;
|
|
4
|
-
url: string;
|
|
5
|
-
};
|
|
6
|
-
export type FolderWithDevPackagesRegistrySpec = {
|
|
7
|
-
type: 'folder_with_dev_packages';
|
|
8
|
-
label: string;
|
|
9
|
-
path: string;
|
|
10
|
-
};
|
|
11
|
-
export type RegistrySpec = RemoteRegistryV1Spec | FolderWithDevPackagesRegistrySpec;
|
|
12
|
-
//# sourceMappingURL=registry_spec.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"registry_spec.d.ts","sourceRoot":"","sources":["../../src/block_registry/registry_spec.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,oBAAoB,GAAG;IACjC,IAAI,EAAE,WAAW,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;CACb,CAAC;AAEF,MAAM,MAAM,iCAAiC,GAAG;IAC9C,IAAI,EAAE,0BAA0B,CAAC;IACjC,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG,oBAAoB,GAAG,iCAAiC,CAAC"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export type RemoteRegistryV1Spec = {
|
|
2
|
-
type: 'remote_v1';
|
|
3
|
-
label: string;
|
|
4
|
-
url: string;
|
|
5
|
-
};
|
|
6
|
-
|
|
7
|
-
export type FolderWithDevPackagesRegistrySpec = {
|
|
8
|
-
type: 'folder_with_dev_packages';
|
|
9
|
-
label: string;
|
|
10
|
-
path: string;
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
export type RegistrySpec = RemoteRegistryV1Spec | FolderWithDevPackagesRegistrySpec;
|