@dosgato/templating 0.0.25 → 0.0.28

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.
@@ -1,13 +1,13 @@
1
1
  import { PageRecord, ComponentData, PageData } from './component.js';
2
2
  import { LinkDefinition } from './links.js';
3
3
  export declare type APITemplateType = 'page' | 'component' | 'data';
4
- declare enum MessageType {
4
+ export declare enum ValidationMessageType {
5
5
  ERROR = "error",
6
6
  WARNING = "warning",
7
7
  SUCCESS = "success"
8
8
  }
9
- interface Feedback {
10
- type: `${MessageType}`;
9
+ export interface ValidationFeedback {
10
+ type?: `${ValidationMessageType}`;
11
11
  path?: string;
12
12
  message: string;
13
13
  }
@@ -66,7 +66,7 @@ export interface APITemplate {
66
66
  * available as parameters in case you need them. Keep in mind that the current editor MUST
67
67
  * have access to any data you attempt to query in GraphQL.
68
68
  */
69
- validate: (data: ComponentData, query: <T>(query: string, variables?: any) => Promise<T>, page: PageData, path: string) => Promise<Feedback[]>;
69
+ validate?: (data: ComponentData, query: <T>(query: string, variables?: any) => Promise<T>, page: PageData, path: string) => Promise<ValidationFeedback[]>;
70
70
  /**
71
71
  * Hard-coded properties that may be set on page templates to influence the rendering of
72
72
  * components on the page. For instance, a set of color choices that are customized for
@@ -117,4 +117,3 @@ export declare function extractLinksFromText(text: string): LinkDefinition[];
117
117
  export declare function getKeywords(text: string, options?: {
118
118
  stopwords?: boolean;
119
119
  }): string[];
120
- export {};
@@ -1,10 +1,10 @@
1
1
  import { stopwords } from './stopwords.js';
2
- var MessageType;
3
- (function (MessageType) {
4
- MessageType["ERROR"] = "error";
5
- MessageType["WARNING"] = "warning";
6
- MessageType["SUCCESS"] = "success";
7
- })(MessageType || (MessageType = {}));
2
+ export var ValidationMessageType;
3
+ (function (ValidationMessageType) {
4
+ ValidationMessageType["ERROR"] = "error";
5
+ ValidationMessageType["WARNING"] = "warning";
6
+ ValidationMessageType["SUCCESS"] = "success";
7
+ })(ValidationMessageType || (ValidationMessageType = {}));
8
8
  /**
9
9
  * This function is used by API template definitions to help them identify links inside large blocks
10
10
  * of text and return them for indexing.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dosgato/templating",
3
- "version": "0.0.25",
3
+ "version": "0.0.28",
4
4
  "description": "A library to support building templates for dosgato CMS.",
5
5
  "type": "module",
6
6
  "exports": {