@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.
- package/dist/apitemplate.d.ts +4 -5
- package/dist/apitemplate.js +6 -6
- package/package.json +1 -1
package/dist/apitemplate.d.ts
CHANGED
|
@@ -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
|
|
4
|
+
export declare enum ValidationMessageType {
|
|
5
5
|
ERROR = "error",
|
|
6
6
|
WARNING = "warning",
|
|
7
7
|
SUCCESS = "success"
|
|
8
8
|
}
|
|
9
|
-
interface
|
|
10
|
-
type
|
|
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
|
|
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 {};
|
package/dist/apitemplate.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { stopwords } from './stopwords.js';
|
|
2
|
-
var
|
|
3
|
-
(function (
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
})(
|
|
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.
|