@cmssy/types 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/README.md +55 -0
- package/dist/block-fields.d.ts +140 -0
- package/dist/block-fields.d.ts.map +1 -0
- package/dist/block-fields.js +58 -0
- package/dist/block-fields.js.map +1 -0
- package/dist/block.d.ts +51 -0
- package/dist/block.d.ts.map +1 -0
- package/dist/block.js +21 -0
- package/dist/block.js.map +1 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +17 -0
- package/dist/index.js.map +1 -0
- package/dist/layout.d.ts +37 -0
- package/dist/layout.d.ts.map +1 -0
- package/dist/layout.js +40 -0
- package/dist/layout.js.map +1 -0
- package/dist/modules.d.ts +52 -0
- package/dist/modules.d.ts.map +1 -0
- package/dist/modules.js +52 -0
- package/dist/modules.js.map +1 -0
- package/dist/template.d.ts +90 -0
- package/dist/template.d.ts.map +1 -0
- package/dist/template.js +10 -0
- package/dist/template.js.map +1 -0
- package/package.json +44 -0
package/README.md
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# @cmssy/types
|
|
2
|
+
|
|
3
|
+
Shared TypeScript type definitions for the Cmssy platform.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @cmssy/types
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
```typescript
|
|
14
|
+
import {
|
|
15
|
+
FieldType,
|
|
16
|
+
LayoutPosition,
|
|
17
|
+
BlockConfig,
|
|
18
|
+
TemplateConfig
|
|
19
|
+
} from "@cmssy/types";
|
|
20
|
+
|
|
21
|
+
// Use in block.config.ts
|
|
22
|
+
const config: BlockConfig = {
|
|
23
|
+
name: "My Block",
|
|
24
|
+
category: "content",
|
|
25
|
+
schema: {
|
|
26
|
+
title: {
|
|
27
|
+
type: FieldType.SINGLE_LINE,
|
|
28
|
+
label: "Title",
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
};
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Exports
|
|
35
|
+
|
|
36
|
+
- **Field Types**: `FieldType`, `FieldConfig`, `FieldValidation`, `ShowWhenCondition`
|
|
37
|
+
- **Layout**: `LayoutPosition`, `LayoutOverride`
|
|
38
|
+
- **Modules**: `WorkspaceModule`, `FeatureFlag`, `BlockRequires`
|
|
39
|
+
- **Block Config**: `BlockConfig`, `BlockSource`, `PackageType`
|
|
40
|
+
- **Template Config**: `TemplateConfig`, `TemplatePageBlueprint`, `TemplateLayoutSlot`
|
|
41
|
+
|
|
42
|
+
## Development
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
npm install
|
|
46
|
+
npm run build
|
|
47
|
+
npm run typecheck
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## Publishing
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
npm version patch|minor|major
|
|
54
|
+
npm publish
|
|
55
|
+
```
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Block field type definitions.
|
|
3
|
+
* Single source of truth for all field types available in the block schema system.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* All available field types for block schemas.
|
|
7
|
+
*/
|
|
8
|
+
export declare const FieldType: {
|
|
9
|
+
readonly SINGLE_LINE: "singleLine";
|
|
10
|
+
readonly MULTI_LINE: "multiLine";
|
|
11
|
+
readonly RICH_TEXT: "richText";
|
|
12
|
+
readonly NUMERIC: "numeric";
|
|
13
|
+
readonly DATE: "date";
|
|
14
|
+
readonly BOOLEAN: "boolean";
|
|
15
|
+
readonly COLOR: "color";
|
|
16
|
+
readonly SLIDER: "slider";
|
|
17
|
+
readonly MEDIA: "media";
|
|
18
|
+
readonly LINK: "link";
|
|
19
|
+
readonly SELECT: "select";
|
|
20
|
+
readonly MULTISELECT: "multiselect";
|
|
21
|
+
readonly REPEATER: "repeater";
|
|
22
|
+
readonly FORM: "form";
|
|
23
|
+
readonly EMAIL_TEMPLATE: "emailTemplate";
|
|
24
|
+
readonly EMAIL_CONFIGURATION: "emailConfiguration";
|
|
25
|
+
readonly PAGE_SELECTOR: "pageSelector";
|
|
26
|
+
};
|
|
27
|
+
export type FieldType = (typeof FieldType)[keyof typeof FieldType];
|
|
28
|
+
/**
|
|
29
|
+
* Array of all field type values for Zod schemas.
|
|
30
|
+
*/
|
|
31
|
+
export declare const fieldTypeValues: readonly ["singleLine", "multiLine", "richText", "numeric", "date", "boolean", "color", "slider", "media", "link", "select", "multiselect", "repeater", "form", "emailTemplate", "emailConfiguration", "pageSelector"];
|
|
32
|
+
/**
|
|
33
|
+
* Built-in validation patterns for common use cases.
|
|
34
|
+
*/
|
|
35
|
+
export type ValidationPattern = "email" | "url" | "phone" | "slug";
|
|
36
|
+
/**
|
|
37
|
+
* Extended validation configuration for fields.
|
|
38
|
+
*/
|
|
39
|
+
export interface FieldValidation {
|
|
40
|
+
/** Minimum length for string fields */
|
|
41
|
+
minLength?: number;
|
|
42
|
+
/** Maximum length for string fields */
|
|
43
|
+
maxLength?: number;
|
|
44
|
+
/** Minimum value for numeric fields */
|
|
45
|
+
min?: number;
|
|
46
|
+
/** Maximum value for numeric fields */
|
|
47
|
+
max?: number;
|
|
48
|
+
/** Validation pattern - built-in name or custom regex string */
|
|
49
|
+
pattern?: ValidationPattern | string;
|
|
50
|
+
/** Custom error message shown when validation fails */
|
|
51
|
+
message?: string;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Condition for showing/hiding a field based on another field's value.
|
|
55
|
+
*/
|
|
56
|
+
export interface ShowWhenCondition {
|
|
57
|
+
/** Field key to check */
|
|
58
|
+
field: string;
|
|
59
|
+
/** Show when field equals this value */
|
|
60
|
+
equals?: unknown;
|
|
61
|
+
/** Show when field does not equal this value */
|
|
62
|
+
notEquals?: unknown;
|
|
63
|
+
/** Show when field value is not empty */
|
|
64
|
+
notEmpty?: boolean;
|
|
65
|
+
/** Show when field value is empty */
|
|
66
|
+
isEmpty?: boolean;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Base field configuration shared by all field types.
|
|
70
|
+
*/
|
|
71
|
+
export interface BaseFieldConfig {
|
|
72
|
+
type: FieldType;
|
|
73
|
+
label: string;
|
|
74
|
+
required?: boolean;
|
|
75
|
+
placeholder?: string;
|
|
76
|
+
defaultValue?: unknown;
|
|
77
|
+
helpText?: string;
|
|
78
|
+
group?: string;
|
|
79
|
+
showWhen?: ShowWhenCondition;
|
|
80
|
+
validation?: FieldValidation;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Select field with predefined options.
|
|
84
|
+
*/
|
|
85
|
+
export interface SelectFieldConfig extends BaseFieldConfig {
|
|
86
|
+
type: "select";
|
|
87
|
+
options: Array<{
|
|
88
|
+
label: string;
|
|
89
|
+
value: string;
|
|
90
|
+
}>;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Multi-select field with predefined options.
|
|
94
|
+
*/
|
|
95
|
+
export interface MultiselectFieldConfig extends BaseFieldConfig {
|
|
96
|
+
type: "multiselect";
|
|
97
|
+
options: Array<{
|
|
98
|
+
label: string;
|
|
99
|
+
value: string;
|
|
100
|
+
}>;
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Repeater field for arrays of items.
|
|
104
|
+
*/
|
|
105
|
+
export interface RepeaterFieldConfig extends BaseFieldConfig {
|
|
106
|
+
type: "repeater";
|
|
107
|
+
minItems?: number;
|
|
108
|
+
maxItems?: number;
|
|
109
|
+
schema: Record<string, FieldConfig>;
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Media field for images, videos, etc.
|
|
113
|
+
*/
|
|
114
|
+
export interface MediaFieldConfig extends Omit<BaseFieldConfig, "defaultValue"> {
|
|
115
|
+
type: "media";
|
|
116
|
+
defaultValue?: string;
|
|
117
|
+
accept?: string;
|
|
118
|
+
maxSize?: number;
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Slider field for numeric ranges.
|
|
122
|
+
*/
|
|
123
|
+
export interface SliderFieldConfig extends BaseFieldConfig {
|
|
124
|
+
type: "slider";
|
|
125
|
+
min?: number;
|
|
126
|
+
max?: number;
|
|
127
|
+
step?: number;
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Page selector field for selecting pages.
|
|
131
|
+
*/
|
|
132
|
+
export interface PageSelectorFieldConfig extends BaseFieldConfig {
|
|
133
|
+
type: "pageSelector";
|
|
134
|
+
multiple?: boolean;
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* Union of all field configurations.
|
|
138
|
+
*/
|
|
139
|
+
export type FieldConfig = BaseFieldConfig | SelectFieldConfig | MultiselectFieldConfig | RepeaterFieldConfig | MediaFieldConfig | SliderFieldConfig | PageSelectorFieldConfig;
|
|
140
|
+
//# sourceMappingURL=block-fields.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"block-fields.d.ts","sourceRoot":"","sources":["../src/block-fields.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Block field type definitions.
|
|
3
|
+
* Single source of truth for all field types available in the block schema system.
|
|
4
|
+
*/
|
|
5
|
+
// =============================================================================
|
|
6
|
+
// FIELD TYPES
|
|
7
|
+
// =============================================================================
|
|
8
|
+
/**
|
|
9
|
+
* All available field types for block schemas.
|
|
10
|
+
*/
|
|
11
|
+
export const FieldType = {
|
|
12
|
+
// Text fields
|
|
13
|
+
SINGLE_LINE: "singleLine",
|
|
14
|
+
MULTI_LINE: "multiLine",
|
|
15
|
+
RICH_TEXT: "richText",
|
|
16
|
+
// Data fields
|
|
17
|
+
NUMERIC: "numeric",
|
|
18
|
+
DATE: "date",
|
|
19
|
+
BOOLEAN: "boolean",
|
|
20
|
+
COLOR: "color",
|
|
21
|
+
SLIDER: "slider",
|
|
22
|
+
// Media & links
|
|
23
|
+
MEDIA: "media",
|
|
24
|
+
LINK: "link",
|
|
25
|
+
// Selection
|
|
26
|
+
SELECT: "select",
|
|
27
|
+
MULTISELECT: "multiselect",
|
|
28
|
+
// Complex
|
|
29
|
+
REPEATER: "repeater",
|
|
30
|
+
// Platform integrations
|
|
31
|
+
FORM: "form",
|
|
32
|
+
EMAIL_TEMPLATE: "emailTemplate",
|
|
33
|
+
EMAIL_CONFIGURATION: "emailConfiguration",
|
|
34
|
+
PAGE_SELECTOR: "pageSelector",
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* Array of all field type values for Zod schemas.
|
|
38
|
+
*/
|
|
39
|
+
export const fieldTypeValues = [
|
|
40
|
+
"singleLine",
|
|
41
|
+
"multiLine",
|
|
42
|
+
"richText",
|
|
43
|
+
"numeric",
|
|
44
|
+
"date",
|
|
45
|
+
"boolean",
|
|
46
|
+
"color",
|
|
47
|
+
"slider",
|
|
48
|
+
"media",
|
|
49
|
+
"link",
|
|
50
|
+
"select",
|
|
51
|
+
"multiselect",
|
|
52
|
+
"repeater",
|
|
53
|
+
"form",
|
|
54
|
+
"emailTemplate",
|
|
55
|
+
"emailConfiguration",
|
|
56
|
+
"pageSelector",
|
|
57
|
+
];
|
|
58
|
+
//# sourceMappingURL=block-fields.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"block-fields.js","sourceRoot":"","sources":["../src/block-fields.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,gFAAgF;AAChF,cAAc;AACd,gFAAgF;AAEhF;;GAEG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,cAAc;IACd,WAAW,EAAE,YAAY;IACzB,UAAU,EAAE,WAAW;IACvB,SAAS,EAAE,UAAU;IAErB,cAAc;IACd,OAAO,EAAE,SAAS;IAClB,IAAI,EAAE,MAAM;IACZ,OAAO,EAAE,SAAS;IAClB,KAAK,EAAE,OAAO;IACd,MAAM,EAAE,QAAQ;IAEhB,gBAAgB;IAChB,KAAK,EAAE,OAAO;IACd,IAAI,EAAE,MAAM;IAEZ,YAAY;IACZ,MAAM,EAAE,QAAQ;IAChB,WAAW,EAAE,aAAa;IAE1B,UAAU;IACV,QAAQ,EAAE,UAAU;IAEpB,wBAAwB;IACxB,IAAI,EAAE,MAAM;IACZ,cAAc,EAAE,eAAe;IAC/B,mBAAmB,EAAE,oBAAoB;IACzC,aAAa,EAAE,cAAc;CACrB,CAAC;AAIX;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,YAAY;IACZ,WAAW;IACX,UAAU;IACV,SAAS;IACT,MAAM;IACN,SAAS;IACT,OAAO;IACP,QAAQ;IACR,OAAO;IACP,MAAM;IACN,QAAQ;IACR,aAAa;IACb,UAAU;IACV,MAAM;IACN,eAAe;IACf,oBAAoB;IACpB,cAAc;CACN,CAAC"}
|
package/dist/block.d.ts
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Block configuration types.
|
|
3
|
+
*/
|
|
4
|
+
import type { FieldConfig } from "./block-fields.js";
|
|
5
|
+
import type { LayoutPosition } from "./layout.js";
|
|
6
|
+
import type { BlockRequires } from "./modules.js";
|
|
7
|
+
/**
|
|
8
|
+
* Block configuration - defines a single block's schema and metadata.
|
|
9
|
+
*/
|
|
10
|
+
export interface BlockConfig {
|
|
11
|
+
/** Block display name */
|
|
12
|
+
name: string;
|
|
13
|
+
/** Short description */
|
|
14
|
+
description?: string;
|
|
15
|
+
/** Long description for marketplace */
|
|
16
|
+
longDescription?: string;
|
|
17
|
+
/** Category for organization */
|
|
18
|
+
category: string;
|
|
19
|
+
/** Tags for search */
|
|
20
|
+
tags?: string[];
|
|
21
|
+
/** Schema defining the block's editable fields */
|
|
22
|
+
schema: Record<string, FieldConfig>;
|
|
23
|
+
/** Whether block requires client-side rendering (default: false = SSR) */
|
|
24
|
+
interactive?: boolean;
|
|
25
|
+
/** If set, this block is a layout block for the specified position */
|
|
26
|
+
layoutPosition?: LayoutPosition;
|
|
27
|
+
/** Platform features this block needs */
|
|
28
|
+
requires?: BlockRequires;
|
|
29
|
+
/** Pricing configuration */
|
|
30
|
+
pricing?: {
|
|
31
|
+
licenseType: "free" | "paid";
|
|
32
|
+
priceCents?: number;
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Block source types.
|
|
37
|
+
*/
|
|
38
|
+
export declare const BlockSource: {
|
|
39
|
+
readonly MARKETPLACE: "marketplace";
|
|
40
|
+
readonly CUSTOM: "custom";
|
|
41
|
+
};
|
|
42
|
+
export type BlockSource = (typeof BlockSource)[keyof typeof BlockSource];
|
|
43
|
+
/**
|
|
44
|
+
* Package types.
|
|
45
|
+
*/
|
|
46
|
+
export declare const PackageType: {
|
|
47
|
+
readonly BLOCK: "block";
|
|
48
|
+
readonly TEMPLATE: "template";
|
|
49
|
+
};
|
|
50
|
+
export type PackageType = (typeof PackageType)[keyof typeof PackageType];
|
|
51
|
+
//# sourceMappingURL=block.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"block.d.ts","sourceRoot":"","sources":["../src/block.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAMlD;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,yBAAyB;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,wBAAwB;IACxB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,uCAAuC;IACvC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,gCAAgC;IAChC,QAAQ,EAAE,MAAM,CAAC;IACjB,sBAAsB;IACtB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAEhB,kDAAkD;IAClD,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;IAEpC,0EAA0E;IAC1E,WAAW,CAAC,EAAE,OAAO,CAAC;IAEtB,sEAAsE;IACtE,cAAc,CAAC,EAAE,cAAc,CAAC;IAEhC,yCAAyC;IACzC,QAAQ,CAAC,EAAE,aAAa,CAAC;IAEzB,4BAA4B;IAC5B,OAAO,CAAC,EAAE;QACR,WAAW,EAAE,MAAM,GAAG,MAAM,CAAC;QAC7B,UAAU,CAAC,EAAE,MAAM,CAAC;KACrB,CAAC;CACH;AAMD;;GAEG;AACH,eAAO,MAAM,WAAW;;;CAGd,CAAC;AAEX,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,WAAW,CAAC,CAAC,MAAM,OAAO,WAAW,CAAC,CAAC;AAEzE;;GAEG;AACH,eAAO,MAAM,WAAW;;;CAGd,CAAC;AAEX,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,WAAW,CAAC,CAAC,MAAM,OAAO,WAAW,CAAC,CAAC"}
|
package/dist/block.js
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Block configuration types.
|
|
3
|
+
*/
|
|
4
|
+
// =============================================================================
|
|
5
|
+
// BLOCK SOURCE
|
|
6
|
+
// =============================================================================
|
|
7
|
+
/**
|
|
8
|
+
* Block source types.
|
|
9
|
+
*/
|
|
10
|
+
export const BlockSource = {
|
|
11
|
+
MARKETPLACE: "marketplace",
|
|
12
|
+
CUSTOM: "custom",
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Package types.
|
|
16
|
+
*/
|
|
17
|
+
export const PackageType = {
|
|
18
|
+
BLOCK: "block",
|
|
19
|
+
TEMPLATE: "template",
|
|
20
|
+
};
|
|
21
|
+
//# sourceMappingURL=block.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"block.js","sourceRoot":"","sources":["../src/block.ts"],"names":[],"mappings":"AAAA;;GAEG;AA4CH,gFAAgF;AAChF,eAAe;AACf,gFAAgF;AAEhF;;GAEG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,WAAW,EAAE,aAAa;IAC1B,MAAM,EAAE,QAAQ;CACR,CAAC;AAIX;;GAEG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,KAAK,EAAE,OAAO;IACd,QAAQ,EAAE,UAAU;CACZ,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @cmssy/types
|
|
3
|
+
*
|
|
4
|
+
* Shared type definitions for Cmssy platform.
|
|
5
|
+
* Single source of truth for types used by server, frontend, and CLI.
|
|
6
|
+
*/
|
|
7
|
+
export { FieldType, fieldTypeValues, type FieldValidation, type ValidationPattern, type ShowWhenCondition, type BaseFieldConfig, type SelectFieldConfig, type MultiselectFieldConfig, type RepeaterFieldConfig, type MediaFieldConfig, type SliderFieldConfig, type PageSelectorFieldConfig, type FieldConfig, } from "./block-fields.js";
|
|
8
|
+
export { LayoutPosition, layoutPositionValues, LayoutOverrideAction, type LayoutOverride, } from "./layout.js";
|
|
9
|
+
export { WorkspaceModule, workspaceModuleValues, FeatureFlag, featureFlagValues, type BlockRequires, } from "./modules.js";
|
|
10
|
+
export { type BlockConfig, BlockSource, PackageType, } from "./block.js";
|
|
11
|
+
export { type TemplateBlockInstance, type TemplatePageBlueprint, type TemplateLayoutSlot, type TemplateTheme, type TemplateConfig, type ResourceConfig, isTemplateConfig, } from "./template.js";
|
|
12
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EACL,SAAS,EACT,eAAe,EACf,KAAK,eAAe,EACpB,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,EACtB,KAAK,eAAe,EACpB,KAAK,iBAAiB,EACtB,KAAK,sBAAsB,EAC3B,KAAK,mBAAmB,EACxB,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EACtB,KAAK,uBAAuB,EAC5B,KAAK,WAAW,GACjB,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EACL,cAAc,EACd,oBAAoB,EACpB,oBAAoB,EACpB,KAAK,cAAc,GACpB,MAAM,aAAa,CAAC;AAGrB,OAAO,EACL,eAAe,EACf,qBAAqB,EACrB,WAAW,EACX,iBAAiB,EACjB,KAAK,aAAa,GACnB,MAAM,cAAc,CAAC;AAGtB,OAAO,EACL,KAAK,WAAW,EAChB,WAAW,EACX,WAAW,GACZ,MAAM,YAAY,CAAC;AAGpB,OAAO,EACL,KAAK,qBAAqB,EAC1B,KAAK,qBAAqB,EAC1B,KAAK,kBAAkB,EACvB,KAAK,aAAa,EAClB,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,gBAAgB,GACjB,MAAM,eAAe,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @cmssy/types
|
|
3
|
+
*
|
|
4
|
+
* Shared type definitions for Cmssy platform.
|
|
5
|
+
* Single source of truth for types used by server, frontend, and CLI.
|
|
6
|
+
*/
|
|
7
|
+
// Block fields
|
|
8
|
+
export { FieldType, fieldTypeValues, } from "./block-fields.js";
|
|
9
|
+
// Layout
|
|
10
|
+
export { LayoutPosition, layoutPositionValues, LayoutOverrideAction, } from "./layout.js";
|
|
11
|
+
// Modules & features
|
|
12
|
+
export { WorkspaceModule, workspaceModuleValues, FeatureFlag, featureFlagValues, } from "./modules.js";
|
|
13
|
+
// Block config
|
|
14
|
+
export { BlockSource, PackageType, } from "./block.js";
|
|
15
|
+
// Template config
|
|
16
|
+
export { isTemplateConfig, } from "./template.js";
|
|
17
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,eAAe;AACf,OAAO,EACL,SAAS,EACT,eAAe,GAYhB,MAAM,mBAAmB,CAAC;AAE3B,SAAS;AACT,OAAO,EACL,cAAc,EACd,oBAAoB,EACpB,oBAAoB,GAErB,MAAM,aAAa,CAAC;AAErB,qBAAqB;AACrB,OAAO,EACL,eAAe,EACf,qBAAqB,EACrB,WAAW,EACX,iBAAiB,GAElB,MAAM,cAAc,CAAC;AAEtB,eAAe;AACf,OAAO,EAEL,WAAW,EACX,WAAW,GACZ,MAAM,YAAY,CAAC;AAEpB,kBAAkB;AAClB,OAAO,EAOL,gBAAgB,GACjB,MAAM,eAAe,CAAC"}
|
package/dist/layout.d.ts
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Layout position definitions for hierarchical layout system.
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Layout positions for blocks that should be rendered as site-wide layout elements.
|
|
6
|
+
* These positions support hierarchical inheritance from parent pages.
|
|
7
|
+
*/
|
|
8
|
+
export declare const LayoutPosition: {
|
|
9
|
+
readonly HEADER: "header";
|
|
10
|
+
readonly FOOTER: "footer";
|
|
11
|
+
readonly SIDEBAR_LEFT: "sidebar_left";
|
|
12
|
+
readonly SIDEBAR_RIGHT: "sidebar_right";
|
|
13
|
+
readonly TOP: "top";
|
|
14
|
+
readonly BOTTOM: "bottom";
|
|
15
|
+
};
|
|
16
|
+
export type LayoutPosition = (typeof LayoutPosition)[keyof typeof LayoutPosition];
|
|
17
|
+
/**
|
|
18
|
+
* Array of all layout position values for Zod schemas.
|
|
19
|
+
*/
|
|
20
|
+
export declare const layoutPositionValues: readonly ["header", "footer", "sidebar_left", "sidebar_right", "top", "bottom"];
|
|
21
|
+
/**
|
|
22
|
+
* Actions for overriding inherited layouts.
|
|
23
|
+
*/
|
|
24
|
+
export declare const LayoutOverrideAction: {
|
|
25
|
+
readonly DISABLE: "disable";
|
|
26
|
+
readonly REPLACE: "replace";
|
|
27
|
+
};
|
|
28
|
+
export type LayoutOverrideAction = (typeof LayoutOverrideAction)[keyof typeof LayoutOverrideAction];
|
|
29
|
+
/**
|
|
30
|
+
* Override configuration for inherited layouts.
|
|
31
|
+
*/
|
|
32
|
+
export interface LayoutOverride {
|
|
33
|
+
position: LayoutPosition;
|
|
34
|
+
action: LayoutOverrideAction;
|
|
35
|
+
blockId?: string;
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=layout.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"layout.d.ts","sourceRoot":"","sources":["../src/layout.ts"],"names":[],"mappings":"AAAA;;GAEG;AAMH;;;GAGG;AACH,eAAO,MAAM,cAAc;;;;;;;CAOjB,CAAC;AAEX,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,OAAO,cAAc,CAAC,CAAC;AAElF;;GAEG;AACH,eAAO,MAAM,oBAAoB,iFAOvB,CAAC;AAMX;;GAEG;AACH,eAAO,MAAM,oBAAoB;;;CAGvB,CAAC;AAEX,MAAM,MAAM,oBAAoB,GAAG,CAAC,OAAO,oBAAoB,CAAC,CAAC,MAAM,OAAO,oBAAoB,CAAC,CAAC;AAEpG;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,QAAQ,EAAE,cAAc,CAAC;IACzB,MAAM,EAAE,oBAAoB,CAAC;IAC7B,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB"}
|
package/dist/layout.js
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Layout position definitions for hierarchical layout system.
|
|
3
|
+
*/
|
|
4
|
+
// =============================================================================
|
|
5
|
+
// LAYOUT POSITIONS
|
|
6
|
+
// =============================================================================
|
|
7
|
+
/**
|
|
8
|
+
* Layout positions for blocks that should be rendered as site-wide layout elements.
|
|
9
|
+
* These positions support hierarchical inheritance from parent pages.
|
|
10
|
+
*/
|
|
11
|
+
export const LayoutPosition = {
|
|
12
|
+
HEADER: "header",
|
|
13
|
+
FOOTER: "footer",
|
|
14
|
+
SIDEBAR_LEFT: "sidebar_left",
|
|
15
|
+
SIDEBAR_RIGHT: "sidebar_right",
|
|
16
|
+
TOP: "top",
|
|
17
|
+
BOTTOM: "bottom",
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Array of all layout position values for Zod schemas.
|
|
21
|
+
*/
|
|
22
|
+
export const layoutPositionValues = [
|
|
23
|
+
"header",
|
|
24
|
+
"footer",
|
|
25
|
+
"sidebar_left",
|
|
26
|
+
"sidebar_right",
|
|
27
|
+
"top",
|
|
28
|
+
"bottom",
|
|
29
|
+
];
|
|
30
|
+
// =============================================================================
|
|
31
|
+
// LAYOUT OVERRIDE
|
|
32
|
+
// =============================================================================
|
|
33
|
+
/**
|
|
34
|
+
* Actions for overriding inherited layouts.
|
|
35
|
+
*/
|
|
36
|
+
export const LayoutOverrideAction = {
|
|
37
|
+
DISABLE: "disable",
|
|
38
|
+
REPLACE: "replace",
|
|
39
|
+
};
|
|
40
|
+
//# sourceMappingURL=layout.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"layout.js","sourceRoot":"","sources":["../src/layout.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,gFAAgF;AAChF,mBAAmB;AACnB,gFAAgF;AAEhF;;;GAGG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,MAAM,EAAE,QAAQ;IAChB,MAAM,EAAE,QAAQ;IAChB,YAAY,EAAE,cAAc;IAC5B,aAAa,EAAE,eAAe;IAC9B,GAAG,EAAE,KAAK;IACV,MAAM,EAAE,QAAQ;CACR,CAAC;AAIX;;GAEG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,QAAQ;IACR,QAAQ;IACR,cAAc;IACd,eAAe;IACf,KAAK;IACL,QAAQ;CACA,CAAC;AAEX,gFAAgF;AAChF,kBAAkB;AAClB,gFAAgF;AAEhF;;GAEG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,OAAO,EAAE,SAAS;IAClB,OAAO,EAAE,SAAS;CACV,CAAC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Workspace modules and feature flags.
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Available workspace modules that blocks can require.
|
|
6
|
+
*/
|
|
7
|
+
export declare const WorkspaceModule: {
|
|
8
|
+
readonly PIM: "pim";
|
|
9
|
+
readonly CRM: "crm";
|
|
10
|
+
readonly FORMS: "forms";
|
|
11
|
+
readonly ANALYTICS: "analytics";
|
|
12
|
+
readonly NEWSLETTER: "newsletter";
|
|
13
|
+
readonly ECOMMERCE: "ecommerce";
|
|
14
|
+
};
|
|
15
|
+
export type WorkspaceModule = (typeof WorkspaceModule)[keyof typeof WorkspaceModule];
|
|
16
|
+
/**
|
|
17
|
+
* Array of all workspace module values for Zod schemas.
|
|
18
|
+
*/
|
|
19
|
+
export declare const workspaceModuleValues: readonly ["pim", "crm", "forms", "analytics", "newsletter", "ecommerce"];
|
|
20
|
+
/**
|
|
21
|
+
* Available feature flags that blocks can require.
|
|
22
|
+
*/
|
|
23
|
+
export declare const FeatureFlag: {
|
|
24
|
+
readonly AI_GENERATION: "ai-generation";
|
|
25
|
+
readonly AI_TRANSLATION: "ai-translation";
|
|
26
|
+
readonly ADVANCED_SEO: "advanced-seo";
|
|
27
|
+
readonly AB_TESTING: "a-b-testing";
|
|
28
|
+
readonly PERSONALIZATION: "personalization";
|
|
29
|
+
};
|
|
30
|
+
export type FeatureFlag = (typeof FeatureFlag)[keyof typeof FeatureFlag];
|
|
31
|
+
/**
|
|
32
|
+
* Array of all feature flag values for Zod schemas.
|
|
33
|
+
*/
|
|
34
|
+
export declare const featureFlagValues: readonly ["ai-generation", "ai-translation", "advanced-seo", "a-b-testing", "personalization"];
|
|
35
|
+
/**
|
|
36
|
+
* Platform features and requirements that a block needs.
|
|
37
|
+
*/
|
|
38
|
+
export interface BlockRequires {
|
|
39
|
+
/** Request auth context */
|
|
40
|
+
auth?: boolean;
|
|
41
|
+
/** Request current language */
|
|
42
|
+
language?: boolean;
|
|
43
|
+
/** Request workspace info */
|
|
44
|
+
workspace?: boolean;
|
|
45
|
+
/** Required workspace modules */
|
|
46
|
+
modules?: WorkspaceModule[];
|
|
47
|
+
/** Required user permissions */
|
|
48
|
+
permissions?: string[];
|
|
49
|
+
/** Required feature flags */
|
|
50
|
+
features?: FeatureFlag[];
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=modules.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"modules.d.ts","sourceRoot":"","sources":["../src/modules.ts"],"names":[],"mappings":"AAAA;;GAEG;AAMH;;GAEG;AACH,eAAO,MAAM,eAAe;;;;;;;CAOlB,CAAC;AAEX,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,OAAO,eAAe,CAAC,CAAC;AAErF;;GAEG;AACH,eAAO,MAAM,qBAAqB,0EAOxB,CAAC;AAMX;;GAEG;AACH,eAAO,MAAM,WAAW;;;;;;CAMd,CAAC;AAEX,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,WAAW,CAAC,CAAC,MAAM,OAAO,WAAW,CAAC,CAAC;AAEzE;;GAEG;AACH,eAAO,MAAM,iBAAiB,gGAMpB,CAAC;AAMX;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,2BAA2B;IAC3B,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,+BAA+B;IAC/B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,6BAA6B;IAC7B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,iCAAiC;IACjC,OAAO,CAAC,EAAE,eAAe,EAAE,CAAC;IAC5B,gCAAgC;IAChC,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB,6BAA6B;IAC7B,QAAQ,CAAC,EAAE,WAAW,EAAE,CAAC;CAC1B"}
|
package/dist/modules.js
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Workspace modules and feature flags.
|
|
3
|
+
*/
|
|
4
|
+
// =============================================================================
|
|
5
|
+
// WORKSPACE MODULES
|
|
6
|
+
// =============================================================================
|
|
7
|
+
/**
|
|
8
|
+
* Available workspace modules that blocks can require.
|
|
9
|
+
*/
|
|
10
|
+
export const WorkspaceModule = {
|
|
11
|
+
PIM: "pim",
|
|
12
|
+
CRM: "crm",
|
|
13
|
+
FORMS: "forms",
|
|
14
|
+
ANALYTICS: "analytics",
|
|
15
|
+
NEWSLETTER: "newsletter",
|
|
16
|
+
ECOMMERCE: "ecommerce",
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* Array of all workspace module values for Zod schemas.
|
|
20
|
+
*/
|
|
21
|
+
export const workspaceModuleValues = [
|
|
22
|
+
"pim",
|
|
23
|
+
"crm",
|
|
24
|
+
"forms",
|
|
25
|
+
"analytics",
|
|
26
|
+
"newsletter",
|
|
27
|
+
"ecommerce",
|
|
28
|
+
];
|
|
29
|
+
// =============================================================================
|
|
30
|
+
// FEATURE FLAGS
|
|
31
|
+
// =============================================================================
|
|
32
|
+
/**
|
|
33
|
+
* Available feature flags that blocks can require.
|
|
34
|
+
*/
|
|
35
|
+
export const FeatureFlag = {
|
|
36
|
+
AI_GENERATION: "ai-generation",
|
|
37
|
+
AI_TRANSLATION: "ai-translation",
|
|
38
|
+
ADVANCED_SEO: "advanced-seo",
|
|
39
|
+
AB_TESTING: "a-b-testing",
|
|
40
|
+
PERSONALIZATION: "personalization",
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* Array of all feature flag values for Zod schemas.
|
|
44
|
+
*/
|
|
45
|
+
export const featureFlagValues = [
|
|
46
|
+
"ai-generation",
|
|
47
|
+
"ai-translation",
|
|
48
|
+
"advanced-seo",
|
|
49
|
+
"a-b-testing",
|
|
50
|
+
"personalization",
|
|
51
|
+
];
|
|
52
|
+
//# sourceMappingURL=modules.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"modules.js","sourceRoot":"","sources":["../src/modules.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,gFAAgF;AAChF,oBAAoB;AACpB,gFAAgF;AAEhF;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,GAAG,EAAE,KAAK;IACV,GAAG,EAAE,KAAK;IACV,KAAK,EAAE,OAAO;IACd,SAAS,EAAE,WAAW;IACtB,UAAU,EAAE,YAAY;IACxB,SAAS,EAAE,WAAW;CACd,CAAC;AAIX;;GAEG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,KAAK;IACL,KAAK;IACL,OAAO;IACP,WAAW;IACX,YAAY;IACZ,WAAW;CACH,CAAC;AAEX,gFAAgF;AAChF,gBAAgB;AAChB,gFAAgF;AAEhF;;GAEG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,aAAa,EAAE,eAAe;IAC9B,cAAc,EAAE,gBAAgB;IAChC,YAAY,EAAE,cAAc;IAC5B,UAAU,EAAE,aAAa;IACzB,eAAe,EAAE,iBAAiB;CAC1B,CAAC;AAIX;;GAEG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,eAAe;IACf,gBAAgB;IAChB,cAAc;IACd,aAAa;IACb,iBAAiB;CACT,CAAC"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Template configuration types.
|
|
3
|
+
*/
|
|
4
|
+
import type { FieldConfig } from "./block-fields.js";
|
|
5
|
+
import type { LayoutPosition } from "./layout.js";
|
|
6
|
+
/**
|
|
7
|
+
* A block instance within a template page.
|
|
8
|
+
*/
|
|
9
|
+
export interface TemplateBlockInstance {
|
|
10
|
+
/** Block type reference */
|
|
11
|
+
type: string;
|
|
12
|
+
/** Block content/props */
|
|
13
|
+
content?: Record<string, unknown>;
|
|
14
|
+
/** Block settings */
|
|
15
|
+
settings?: Record<string, unknown>;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* A page blueprint within a template.
|
|
19
|
+
*/
|
|
20
|
+
export interface TemplatePageBlueprint {
|
|
21
|
+
/** Page display name */
|
|
22
|
+
name: string;
|
|
23
|
+
/** URL-friendly slug */
|
|
24
|
+
slug: string;
|
|
25
|
+
/** Page type */
|
|
26
|
+
pageType?: string;
|
|
27
|
+
/** Blocks on this page */
|
|
28
|
+
blocks: TemplateBlockInstance[];
|
|
29
|
+
/** Page metadata */
|
|
30
|
+
metadata?: Record<string, unknown>;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Layout slot for site-wide elements.
|
|
34
|
+
*/
|
|
35
|
+
export interface TemplateLayoutSlot {
|
|
36
|
+
/** Layout position */
|
|
37
|
+
slot: LayoutPosition;
|
|
38
|
+
/** Block type to use */
|
|
39
|
+
type: string;
|
|
40
|
+
/** Block content/props */
|
|
41
|
+
content?: Record<string, unknown>;
|
|
42
|
+
/** Block order within the position */
|
|
43
|
+
order?: number;
|
|
44
|
+
/** Whether this block is active */
|
|
45
|
+
isActive?: boolean;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Theme configuration for template.
|
|
49
|
+
*/
|
|
50
|
+
export interface TemplateTheme {
|
|
51
|
+
colors?: Record<string, string>;
|
|
52
|
+
fonts?: Record<string, string>;
|
|
53
|
+
spacing?: Record<string, string>;
|
|
54
|
+
borderRadius?: Record<string, string>;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Template configuration - defines a complete website structure.
|
|
58
|
+
*/
|
|
59
|
+
export interface TemplateConfig {
|
|
60
|
+
/** Template display name */
|
|
61
|
+
name: string;
|
|
62
|
+
/** Template description */
|
|
63
|
+
description?: string;
|
|
64
|
+
/** Long description for marketplace */
|
|
65
|
+
longDescription?: string;
|
|
66
|
+
/** Category */
|
|
67
|
+
category?: string;
|
|
68
|
+
/** Tags for search */
|
|
69
|
+
tags?: string[];
|
|
70
|
+
/** Pages in this template */
|
|
71
|
+
pages: TemplatePageBlueprint[];
|
|
72
|
+
/** Layout slots shared across all pages */
|
|
73
|
+
layoutSlots?: TemplateLayoutSlot[];
|
|
74
|
+
/** Theme configuration */
|
|
75
|
+
theme?: TemplateTheme;
|
|
76
|
+
/** Optional schema for template-level settings */
|
|
77
|
+
schema?: Record<string, FieldConfig>;
|
|
78
|
+
/** Pricing configuration */
|
|
79
|
+
pricing?: {
|
|
80
|
+
licenseType: "free" | "paid";
|
|
81
|
+
priceCents?: number;
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
import type { BlockConfig } from "./block.js";
|
|
85
|
+
export type ResourceConfig = BlockConfig | TemplateConfig;
|
|
86
|
+
/**
|
|
87
|
+
* Type guard to check if config is a TemplateConfig.
|
|
88
|
+
*/
|
|
89
|
+
export declare function isTemplateConfig(config: ResourceConfig): config is TemplateConfig;
|
|
90
|
+
//# sourceMappingURL=template.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"template.d.ts","sourceRoot":"","sources":["../src/template.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAMlD;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,2BAA2B;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,0BAA0B;IAC1B,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClC,qBAAqB;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACpC;AAED;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,wBAAwB;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,wBAAwB;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,gBAAgB;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,0BAA0B;IAC1B,MAAM,EAAE,qBAAqB,EAAE,CAAC;IAChC,oBAAoB;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACpC;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,sBAAsB;IACtB,IAAI,EAAE,cAAc,CAAC;IACrB,wBAAwB;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,0BAA0B;IAC1B,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClC,sCAAsC;IACtC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,mCAAmC;IACnC,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAMD;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC/B,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACvC;AAMD;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,4BAA4B;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,2BAA2B;IAC3B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,uCAAuC;IACvC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,eAAe;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,sBAAsB;IACtB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAEhB,6BAA6B;IAC7B,KAAK,EAAE,qBAAqB,EAAE,CAAC;IAE/B,2CAA2C;IAC3C,WAAW,CAAC,EAAE,kBAAkB,EAAE,CAAC;IAEnC,0BAA0B;IAC1B,KAAK,CAAC,EAAE,aAAa,CAAC;IAEtB,kDAAkD;IAClD,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;IAErC,4BAA4B;IAC5B,OAAO,CAAC,EAAE;QACR,WAAW,EAAE,MAAM,GAAG,MAAM,CAAC;QAC7B,UAAU,CAAC,EAAE,MAAM,CAAC;KACrB,CAAC;CACH;AAMD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE9C,MAAM,MAAM,cAAc,GAAG,WAAW,GAAG,cAAc,CAAC;AAE1D;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,cAAc,GAAG,MAAM,IAAI,cAAc,CAEjF"}
|
package/dist/template.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"template.js","sourceRoot":"","sources":["../src/template.ts"],"names":[],"mappings":"AAAA;;GAEG;AAiHH;;GAEG;AACH,MAAM,UAAU,gBAAgB,CAAC,MAAsB;IACrD,OAAO,OAAO,IAAI,MAAM,IAAI,KAAK,CAAC,OAAO,CAAE,MAAyB,CAAC,KAAK,CAAC,CAAC;AAC9E,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@cmssy/types",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Shared type definitions for Cmssy platform",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"import": "./dist/index.js"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"files": [
|
|
15
|
+
"dist"
|
|
16
|
+
],
|
|
17
|
+
"scripts": {
|
|
18
|
+
"build": "tsc",
|
|
19
|
+
"dev": "tsc --watch",
|
|
20
|
+
"typecheck": "tsc --noEmit",
|
|
21
|
+
"prepublishOnly": "npm run build"
|
|
22
|
+
},
|
|
23
|
+
"repository": {
|
|
24
|
+
"type": "git",
|
|
25
|
+
"url": "git+https://github.com/cmssy-io/cmssy-types.git"
|
|
26
|
+
},
|
|
27
|
+
"keywords": [
|
|
28
|
+
"cmssy",
|
|
29
|
+
"types",
|
|
30
|
+
"typescript"
|
|
31
|
+
],
|
|
32
|
+
"author": "Cmssy Team",
|
|
33
|
+
"license": "MIT",
|
|
34
|
+
"bugs": {
|
|
35
|
+
"url": "https://github.com/cmssy-io/cmssy-types/issues"
|
|
36
|
+
},
|
|
37
|
+
"homepage": "https://github.com/cmssy-io/cmssy-types#readme",
|
|
38
|
+
"devDependencies": {
|
|
39
|
+
"typescript": "^5.7.2"
|
|
40
|
+
},
|
|
41
|
+
"publishConfig": {
|
|
42
|
+
"access": "public"
|
|
43
|
+
}
|
|
44
|
+
}
|