@milaboratories/pl-model-middle-layer 1.3.0 → 1.4.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/dist/block_meta/block_components.d.ts +13 -13
- package/dist/block_meta/block_description.d.ts +8 -8
- package/dist/block_meta/block_manifest.d.ts +40 -39
- package/dist/block_meta/block_manifest.d.ts.map +1 -1
- package/dist/block_meta/block_meta.d.ts +102 -2
- package/dist/block_meta/block_meta.d.ts.map +1 -1
- package/dist/block_registry/block_pack_spec.d.ts +201 -0
- package/dist/block_registry/block_pack_spec.d.ts.map +1 -0
- package/dist/block_registry/index.d.ts +4 -0
- package/dist/block_registry/index.d.ts.map +1 -0
- package/dist/block_registry/overview.d.ts +914 -0
- package/dist/block_registry/overview.d.ts.map +1 -0
- package/dist/block_registry/registry_spec.d.ts +184 -0
- package/dist/block_registry/registry_spec.d.ts.map +1 -0
- package/dist/index.d.ts +1 -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 +170 -103
- package/dist/index.mjs.map +1 -1
- package/dist/project_overview.d.ts +1 -1
- package/dist/project_overview.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/block_meta/block_components.ts +3 -0
- package/src/block_meta/block_manifest.ts +7 -5
- package/src/block_meta/block_meta.ts +10 -2
- package/src/block_registry/block_pack_spec.ts +51 -0
- package/src/block_registry/index.ts +3 -0
- package/src/block_registry/overview.ts +27 -0
- package/src/block_registry/registry_spec.ts +38 -0
- package/src/index.ts +1 -1
- package/src/project_overview.ts +1 -1
- package/dist/block_pack.d.ts +0 -24
- package/dist/block_pack.d.ts.map +0 -1
- package/src/block_pack.ts +0 -29
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { BlockPackId, BlockPackMetaEmbeddedBytes, SemVer } from '../block_meta';
|
|
3
|
+
import { BlockPackSpec } from './block_pack_spec';
|
|
4
|
+
import { RegistryEntry } from './registry_spec';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Latest information about specific block pack. Contain information about latest version of the package.
|
|
8
|
+
* */
|
|
9
|
+
export const BlockPackOverview = z.object({
|
|
10
|
+
registryId: z.string(),
|
|
11
|
+
id: BlockPackId,
|
|
12
|
+
meta: BlockPackMetaEmbeddedBytes,
|
|
13
|
+
spec: BlockPackSpec,
|
|
14
|
+
otherVersions: z.array(SemVer)
|
|
15
|
+
});
|
|
16
|
+
export type BlockPackOverview = z.infer<typeof BlockPackOverview>;
|
|
17
|
+
|
|
18
|
+
export const RegistryStatus = RegistryEntry.extend({
|
|
19
|
+
status: z.union([z.literal('online'), z.literal('offline')])
|
|
20
|
+
});
|
|
21
|
+
export type RegistryStatus = z.infer<typeof RegistryStatus>;
|
|
22
|
+
|
|
23
|
+
export const BlockPackListing = z.object({
|
|
24
|
+
registries: z.array(RegistryStatus),
|
|
25
|
+
blockPacks: z.array(BlockPackOverview)
|
|
26
|
+
});
|
|
27
|
+
export type BlockPackListing = z.infer<typeof BlockPackListing>;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
export const LocalDevFolder = z.object({
|
|
4
|
+
type: z.literal('local-dev'),
|
|
5
|
+
path: z.string()
|
|
6
|
+
});
|
|
7
|
+
export type LocalDevFolder = z.infer<typeof LocalDevFolder>;
|
|
8
|
+
|
|
9
|
+
/** @deprecated don't use */
|
|
10
|
+
export const RemoteRegistryV1Spec = z.object({
|
|
11
|
+
type: z.literal('remote-v1'),
|
|
12
|
+
url: z.string().url()
|
|
13
|
+
});
|
|
14
|
+
/** @deprecated don't use */
|
|
15
|
+
export type RemoteRegistryV1Spec = z.infer<typeof RemoteRegistryV1Spec>;
|
|
16
|
+
|
|
17
|
+
export const RemoteRegistryV2Spec = z.object({
|
|
18
|
+
type: z.literal('remote-v2'),
|
|
19
|
+
url: z.string().url()
|
|
20
|
+
});
|
|
21
|
+
export type RemoteRegistryV2Spec = z.infer<typeof RemoteRegistryV2Spec>;
|
|
22
|
+
|
|
23
|
+
export const RegistrySpec = z.discriminatedUnion('type', [
|
|
24
|
+
RemoteRegistryV1Spec,
|
|
25
|
+
RemoteRegistryV2Spec,
|
|
26
|
+
LocalDevFolder
|
|
27
|
+
]);
|
|
28
|
+
export type RegistrySpec = z.infer<typeof RegistrySpec>;
|
|
29
|
+
|
|
30
|
+
export const RegistryEntry = z.object({
|
|
31
|
+
id: z.string(),
|
|
32
|
+
title: z.string().optional(),
|
|
33
|
+
spec: RegistrySpec
|
|
34
|
+
});
|
|
35
|
+
export type RegistryEntry = z.infer<typeof RegistryEntry>;
|
|
36
|
+
|
|
37
|
+
export const RegistryList = z.array(RegistryEntry);
|
|
38
|
+
export type RegistryList = z.infer<typeof RegistryList>;
|
package/src/index.ts
CHANGED
package/src/project_overview.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ProjectMeta } from './project';
|
|
2
|
-
import { BlockPackSpec } from './
|
|
2
|
+
import { BlockPackSpec } from './block_registry/block_pack_spec';
|
|
3
3
|
import { BlockRenderingMode, BlockSection, NavigationState } from '@milaboratories/pl-model-common';
|
|
4
4
|
import { AuthorMarker } from './author_marker';
|
|
5
5
|
|
package/dist/block_pack.d.ts
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/** Block pack from local folder, to be used during block development. Legacy layout. */
|
|
2
|
-
export interface BlockPackDevV1 {
|
|
3
|
-
type: 'dev' | 'dev-v1';
|
|
4
|
-
folder: string;
|
|
5
|
-
mtime?: string;
|
|
6
|
-
}
|
|
7
|
-
/** Block pack from local folder, to be used during block development. New layout. */
|
|
8
|
-
export interface BlockPackDevV2 {
|
|
9
|
-
type: 'dev-v2';
|
|
10
|
-
folder: string;
|
|
11
|
-
mtime?: string;
|
|
12
|
-
}
|
|
13
|
-
/** Block pack from registry with version 1 layout, to be loaded directly
|
|
14
|
-
* from the client. */
|
|
15
|
-
export interface BlockPackFromRegistryV1 {
|
|
16
|
-
type: 'from-registry-v1';
|
|
17
|
-
registryUrl: string;
|
|
18
|
-
organization: string;
|
|
19
|
-
package: string;
|
|
20
|
-
version: string;
|
|
21
|
-
}
|
|
22
|
-
/** Information about block origin, can be used to instantiate new blocks */
|
|
23
|
-
export type BlockPackSpec = BlockPackDevV1 | BlockPackDevV2 | BlockPackFromRegistryV1;
|
|
24
|
-
//# sourceMappingURL=block_pack.d.ts.map
|
package/dist/block_pack.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"block_pack.d.ts","sourceRoot":"","sources":["../src/block_pack.ts"],"names":[],"mappings":"AAAA,wFAAwF;AACxF,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,KAAK,GAAG,QAAQ,CAAC;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,qFAAqF;AACrF,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,QAAQ,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;sBACsB;AACtB,MAAM,WAAW,uBAAuB;IACtC,IAAI,EAAE,kBAAkB,CAAC;IACzB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,4EAA4E;AAC5E,MAAM,MAAM,aAAa,GACrB,cAAc,GACd,cAAc,GACd,uBAAuB,CAAC"}
|
package/src/block_pack.ts
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
/** Block pack from local folder, to be used during block development. Legacy layout. */
|
|
2
|
-
export interface BlockPackDevV1 {
|
|
3
|
-
type: 'dev' | 'dev-v1';
|
|
4
|
-
folder: string;
|
|
5
|
-
mtime?: string;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
/** Block pack from local folder, to be used during block development. New layout. */
|
|
9
|
-
export interface BlockPackDevV2 {
|
|
10
|
-
type: 'dev-v2';
|
|
11
|
-
folder: string;
|
|
12
|
-
mtime?: string;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
/** Block pack from registry with version 1 layout, to be loaded directly
|
|
16
|
-
* from the client. */
|
|
17
|
-
export interface BlockPackFromRegistryV1 {
|
|
18
|
-
type: 'from-registry-v1';
|
|
19
|
-
registryUrl: string;
|
|
20
|
-
organization: string;
|
|
21
|
-
package: string;
|
|
22
|
-
version: string;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
/** Information about block origin, can be used to instantiate new blocks */
|
|
26
|
-
export type BlockPackSpec =
|
|
27
|
-
| BlockPackDevV1
|
|
28
|
-
| BlockPackDevV2
|
|
29
|
-
| BlockPackFromRegistryV1;
|