@nxtedition/types 23.1.5 → 23.1.7
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/common/index.d.ts +2 -0
- package/dist/common/index.js +2 -0
- package/dist/common/panel-property.d.ts +35 -2
- package/dist/common/render-scene.d.ts +5 -0
- package/dist/common/report.d.ts +85 -0
- package/dist/common/report.js +8 -0
- package/dist/common/rss.d.ts +70 -0
- package/dist/common/rss.js +11 -0
- package/dist/common/schema-property.d.ts +31 -27
- package/dist/nxtpression.d.ts +296 -41
- package/dist/records/domains/connection/index.d.ts +3 -1
- package/dist/records/domains/connection/index.js +1 -0
- package/dist/records/domains/connection/report.d.ts +7 -0
- package/dist/records/domains/connection/report.js +1 -0
- package/dist/records/domains/panel.d.ts +26 -3
- package/dist/records/domains/publish/index.d.ts +3 -1
- package/dist/records/domains/publish/index.js +1 -0
- package/dist/records/domains/publish/report.d.ts +70 -0
- package/dist/records/domains/publish/report.js +1294 -0
- package/dist/records/domains/schema.d.ts +2 -2
- package/dist/records/validate/assert-guard.js +3415 -1802
- package/dist/records/validate/assert.js +3415 -1802
- package/dist/records/validate/is.js +156 -54
- package/dist/records/validate/schemas.js +1813 -628
- package/dist/records/validate/stringify.js +595 -134
- package/dist/records/validate/validate-equals.js +3128 -1056
- package/dist/records/validate/validate.js +2204 -874
- package/dist/rpc.d.ts +1 -1
- package/package.json +1 -1
package/dist/common/index.d.ts
CHANGED
|
@@ -16,7 +16,9 @@ export * from './render-preset.ts';
|
|
|
16
16
|
export * from './render-profile.ts';
|
|
17
17
|
export * from './render-query.ts';
|
|
18
18
|
export * from './render-scene.ts';
|
|
19
|
+
export * from './report.ts';
|
|
19
20
|
export * from './rule.ts';
|
|
21
|
+
export * from './rss.ts';
|
|
20
22
|
export * from './schema-property.ts';
|
|
21
23
|
export * from './search.ts';
|
|
22
24
|
export * from './settings.ts';
|
package/dist/common/index.js
CHANGED
|
@@ -16,7 +16,9 @@ export * from "./render-preset.js";
|
|
|
16
16
|
export * from "./render-profile.js";
|
|
17
17
|
export * from "./render-query.js";
|
|
18
18
|
export * from "./render-scene.js";
|
|
19
|
+
export * from "./report.js";
|
|
19
20
|
export * from "./rule.js";
|
|
21
|
+
export * from "./rss.js";
|
|
20
22
|
export * from "./schema-property.js";
|
|
21
23
|
export * from "./search.js";
|
|
22
24
|
export * from "./settings.js";
|
|
@@ -1,2 +1,35 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
1
|
+
import type { Nxtpression } from './nxtpression.ts';
|
|
2
|
+
import type { WidgetOptions, WidgetType } from './widget.ts';
|
|
3
|
+
export interface PanelRootProperty<Value = unknown> extends Omit<PanelProperty<Value>, "const"> {
|
|
4
|
+
domain?: string;
|
|
5
|
+
path?: string;
|
|
6
|
+
computed?: Nxtpression<Value>;
|
|
7
|
+
/** An object specifying where to index the data. Adding this will effectively make the data searchable. */
|
|
8
|
+
index?: {
|
|
9
|
+
/** A string specifying the user-friendly title of the search property. This is what users will see when creating search filters and bookmarks. */
|
|
10
|
+
label: string;
|
|
11
|
+
/** A string specifying where to store the data in the search index. Note that this should be a globally unique value in the system. Typically you'd use `{domain}.{path}` and you should prefer English in camel case */
|
|
12
|
+
path: string;
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
export interface PanelProperty<Value = unknown> {
|
|
16
|
+
type?: "array" | "asset" | "boolean" | "datetime" | "number" | "string" | "object" | "rpc" | undefined;
|
|
17
|
+
/** User-friendly title of the property. This will be used as the field's label in the UI. */
|
|
18
|
+
title?: string;
|
|
19
|
+
description?: string;
|
|
20
|
+
/** If present, indicates that the user must specify a value for the asset to be treated as valid. */
|
|
21
|
+
required?: boolean;
|
|
22
|
+
oneOf?: Array<PanelProperty>;
|
|
23
|
+
anyOf?: Array<PanelProperty>;
|
|
24
|
+
enum?: ReadonlyArray<Value>;
|
|
25
|
+
minItems?: number;
|
|
26
|
+
maxItems?: number;
|
|
27
|
+
items?: PanelProperty<Value>;
|
|
28
|
+
const?: Value;
|
|
29
|
+
properties?: Record<string, PanelProperty<unknown>>;
|
|
30
|
+
widget?: WidgetType | WidgetOptions;
|
|
31
|
+
placeholder?: string;
|
|
32
|
+
helpText?: string;
|
|
33
|
+
invalid?: boolean;
|
|
34
|
+
emptyValue?: Value;
|
|
35
|
+
}
|
|
@@ -22,6 +22,7 @@ export interface RenderSceneObject {
|
|
|
22
22
|
video?: {
|
|
23
23
|
filters?: RenderSceneFilters;
|
|
24
24
|
crop?: RenderSceneCrop;
|
|
25
|
+
focus?: RenderSceneFocus;
|
|
25
26
|
orientation?: number;
|
|
26
27
|
/** @deprecated Use input.video.interlaced */
|
|
27
28
|
interlaced?: RenderSceneInterlaced | null;
|
|
@@ -57,6 +58,10 @@ export interface RenderSceneCrop {
|
|
|
57
58
|
width?: number;
|
|
58
59
|
height?: number;
|
|
59
60
|
}
|
|
61
|
+
export interface RenderSceneFocus {
|
|
62
|
+
x?: number;
|
|
63
|
+
y?: number;
|
|
64
|
+
}
|
|
60
65
|
export type RenderSceneInterlaced = false | "tff" | "bff";
|
|
61
66
|
/** true = premultiplied alpha, 'straight' = straight alpha, null/undefined = auto */
|
|
62
67
|
export type RenderSceneAlpha = boolean | "straight";
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import type { Nxtpression } from './nxtpression.ts';
|
|
2
|
+
import type { RssOptions } from './rss.ts';
|
|
3
|
+
export interface ReportXmlOptions {
|
|
4
|
+
options?: XMLBuilderOptions;
|
|
5
|
+
formatterOptions?: XMLWriterOptions;
|
|
6
|
+
/**
|
|
7
|
+
* Should resolve to a JS object representing the root XML schema, as readable by xmlbuilder2.
|
|
8
|
+
*/
|
|
9
|
+
rootSchema?: Nxtpression<ExpandObject, {
|
|
10
|
+
publishId: string;
|
|
11
|
+
items: unknown[];
|
|
12
|
+
}>;
|
|
13
|
+
/**
|
|
14
|
+
* Should resolve to a JS object representing the XML schema for each item, as readable by xmlbuilder2.
|
|
15
|
+
* Required for output to be generated.
|
|
16
|
+
*/
|
|
17
|
+
itemSchema?: Nxtpression<ExpandObject>;
|
|
18
|
+
}
|
|
19
|
+
export interface ReportRssOptions extends Partial<RssOptions> {
|
|
20
|
+
namespaces?: Record<string, string>;
|
|
21
|
+
}
|
|
22
|
+
export declare const isXmlExpandable: (input: unknown) => input is ExpandObject;
|
|
23
|
+
export type ExpandObject = {
|
|
24
|
+
[key: string]: any;
|
|
25
|
+
} | any[];
|
|
26
|
+
/**
|
|
27
|
+
* @link https://oozcitak.github.io/xmlbuilder2/builder-functions.html#builder-options
|
|
28
|
+
*/
|
|
29
|
+
export interface XMLBuilderOptions {
|
|
30
|
+
[key: string]: unknown;
|
|
31
|
+
version?: "1.0";
|
|
32
|
+
encoding?: string | undefined;
|
|
33
|
+
standalone?: boolean | undefined;
|
|
34
|
+
keepNullNodes?: boolean;
|
|
35
|
+
keepNullAttributes?: boolean;
|
|
36
|
+
ignoreConverters?: boolean;
|
|
37
|
+
skipWhitespaceOnlyText?: boolean;
|
|
38
|
+
convert?: ConvertOptions;
|
|
39
|
+
defaultNamespace?: {
|
|
40
|
+
ele?: undefined | null | string;
|
|
41
|
+
att?: undefined | null | string;
|
|
42
|
+
};
|
|
43
|
+
namespaceAlias?: {
|
|
44
|
+
[key: string]: string | null | undefined;
|
|
45
|
+
};
|
|
46
|
+
invalidCharReplacement?: string | ((char: string, offset: number, str: string) => string) | undefined;
|
|
47
|
+
parser?: any;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* @link https://oozcitak.github.io/xmlbuilder2/builder-functions.html#settings-related-to-value-conversions
|
|
51
|
+
*/
|
|
52
|
+
interface ConvertOptions {
|
|
53
|
+
att?: string;
|
|
54
|
+
ins?: string;
|
|
55
|
+
text?: string;
|
|
56
|
+
cdata?: string;
|
|
57
|
+
comment?: string;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* @link https://oozcitak.github.io/xmlbuilder2/serialization.html#serialization-settings
|
|
61
|
+
*/
|
|
62
|
+
interface XMLWriterOptions {
|
|
63
|
+
wellFormed?: boolean;
|
|
64
|
+
format?: "xml";
|
|
65
|
+
headless?: boolean;
|
|
66
|
+
prettyPrint?: boolean;
|
|
67
|
+
indent?: string;
|
|
68
|
+
newline?: string;
|
|
69
|
+
offset?: number;
|
|
70
|
+
width?: number;
|
|
71
|
+
allowEmptyTags?: boolean;
|
|
72
|
+
indentTextOnlyNodes?: boolean;
|
|
73
|
+
spaceBeforeSlash?: boolean;
|
|
74
|
+
}
|
|
75
|
+
export interface ReportProgress {
|
|
76
|
+
token: string;
|
|
77
|
+
count?: number;
|
|
78
|
+
progress?: number;
|
|
79
|
+
complete?: boolean;
|
|
80
|
+
hits?: number;
|
|
81
|
+
total?: number;
|
|
82
|
+
error?: string | null;
|
|
83
|
+
}
|
|
84
|
+
export declare const isReportProgress: (input: unknown) => input is ReportProgress;
|
|
85
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import typia from 'typia';
|
|
2
|
+
export const isXmlExpandable = (() => { const _io0 = input => Object.keys(input).every(key => {
|
|
3
|
+
const value = input[key];
|
|
4
|
+
if (undefined === value)
|
|
5
|
+
return true;
|
|
6
|
+
return true;
|
|
7
|
+
}); return input => null !== input && undefined !== input && (Array.isArray(input) || "object" === typeof input && null !== input && false === Array.isArray(input) && _io0(input)); })();
|
|
8
|
+
export const isReportProgress = (() => { const _io0 = input => "string" === typeof input.token && (undefined === input.count || "number" === typeof input.count) && (undefined === input.progress || "number" === typeof input.progress) && (undefined === input.complete || "boolean" === typeof input.complete) && (undefined === input.hits || "number" === typeof input.hits) && (undefined === input.total || "number" === typeof input.total) && (null === input.error || undefined === input.error || "string" === typeof input.error); return input => "object" === typeof input && null !== input && _io0(input); })();
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
export interface RssOptions {
|
|
2
|
+
id?: string;
|
|
3
|
+
title: string;
|
|
4
|
+
updated?: string | number;
|
|
5
|
+
generator?: string;
|
|
6
|
+
language?: string;
|
|
7
|
+
ttl?: number;
|
|
8
|
+
stylesheet?: string;
|
|
9
|
+
feed?: string;
|
|
10
|
+
feedLinks?: {
|
|
11
|
+
rss?: string;
|
|
12
|
+
atom?: string;
|
|
13
|
+
json?: string;
|
|
14
|
+
[key: string]: string | undefined;
|
|
15
|
+
};
|
|
16
|
+
hub?: string;
|
|
17
|
+
docs?: string;
|
|
18
|
+
podcast?: boolean;
|
|
19
|
+
category?: string;
|
|
20
|
+
author?: RssAuthor;
|
|
21
|
+
link?: string;
|
|
22
|
+
description?: string;
|
|
23
|
+
image?: string;
|
|
24
|
+
favicon?: string;
|
|
25
|
+
copyright?: string;
|
|
26
|
+
}
|
|
27
|
+
export declare const isRssOptions: (input: unknown) => input is RssOptions;
|
|
28
|
+
export interface RssItem {
|
|
29
|
+
title?: string;
|
|
30
|
+
id?: string;
|
|
31
|
+
link?: string;
|
|
32
|
+
date?: string | number;
|
|
33
|
+
description?: string;
|
|
34
|
+
content?: string;
|
|
35
|
+
category?: RssCategory[];
|
|
36
|
+
guid?: string;
|
|
37
|
+
image?: string | RssEnclosure;
|
|
38
|
+
audio?: string | RssEnclosure;
|
|
39
|
+
video?: string | RssEnclosure;
|
|
40
|
+
enclosure?: RssEnclosure;
|
|
41
|
+
author?: RssAuthor[];
|
|
42
|
+
contributor?: RssAuthor[];
|
|
43
|
+
published?: string | number;
|
|
44
|
+
copyright?: string;
|
|
45
|
+
extensions?: RssExtension[];
|
|
46
|
+
}
|
|
47
|
+
export declare const isRssItem: (input: unknown) => input is RssItem;
|
|
48
|
+
export interface RssEnclosure {
|
|
49
|
+
url: string;
|
|
50
|
+
type?: string;
|
|
51
|
+
length?: number;
|
|
52
|
+
title?: string;
|
|
53
|
+
duration?: number;
|
|
54
|
+
}
|
|
55
|
+
export interface RssAuthor {
|
|
56
|
+
name?: string;
|
|
57
|
+
email?: string;
|
|
58
|
+
link?: string;
|
|
59
|
+
avatar?: string;
|
|
60
|
+
}
|
|
61
|
+
export interface RssCategory {
|
|
62
|
+
name?: string;
|
|
63
|
+
domain?: string;
|
|
64
|
+
scheme?: string;
|
|
65
|
+
term?: string;
|
|
66
|
+
}
|
|
67
|
+
export interface RssExtension {
|
|
68
|
+
name: string;
|
|
69
|
+
objects: any;
|
|
70
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// mostly compat with 'feed' package
|
|
2
|
+
import typia from 'typia';
|
|
3
|
+
export const isRssOptions = (() => { const _io0 = input => (undefined === input.id || "string" === typeof input.id) && "string" === typeof input.title && (undefined === input.updated || "string" === typeof input.updated || "number" === typeof input.updated) && (undefined === input.generator || "string" === typeof input.generator) && (undefined === input.language || "string" === typeof input.language) && (undefined === input.ttl || "number" === typeof input.ttl) && (undefined === input.stylesheet || "string" === typeof input.stylesheet) && (undefined === input.feed || "string" === typeof input.feed) && (undefined === input.feedLinks || "object" === typeof input.feedLinks && null !== input.feedLinks && false === Array.isArray(input.feedLinks) && _io1(input.feedLinks)) && (undefined === input.hub || "string" === typeof input.hub) && (undefined === input.docs || "string" === typeof input.docs) && (undefined === input.podcast || "boolean" === typeof input.podcast) && (undefined === input.category || "string" === typeof input.category) && (undefined === input.author || "object" === typeof input.author && null !== input.author && false === Array.isArray(input.author) && _io2(input.author)) && (undefined === input.link || "string" === typeof input.link) && (undefined === input.description || "string" === typeof input.description) && (undefined === input.image || "string" === typeof input.image) && (undefined === input.favicon || "string" === typeof input.favicon) && (undefined === input.copyright || "string" === typeof input.copyright); const _io1 = input => (undefined === input.rss || "string" === typeof input.rss) && (undefined === input.atom || "string" === typeof input.atom) && (undefined === input.json || "string" === typeof input.json) && Object.keys(input).every(key => {
|
|
4
|
+
if (["rss", "atom", "json"].some(prop => key === prop))
|
|
5
|
+
return true;
|
|
6
|
+
const value = input[key];
|
|
7
|
+
if (undefined === value)
|
|
8
|
+
return true;
|
|
9
|
+
return undefined === value || "string" === typeof value;
|
|
10
|
+
}); const _io2 = input => (undefined === input.name || "string" === typeof input.name) && (undefined === input.email || "string" === typeof input.email) && (undefined === input.link || "string" === typeof input.link) && (undefined === input.avatar || "string" === typeof input.avatar); return input => "object" === typeof input && null !== input && _io0(input); })();
|
|
11
|
+
export const isRssItem = (() => { const _io0 = input => (undefined === input.title || "string" === typeof input.title) && (undefined === input.id || "string" === typeof input.id) && (undefined === input.link || "string" === typeof input.link) && (undefined === input.date || "string" === typeof input.date || "number" === typeof input.date) && (undefined === input.description || "string" === typeof input.description) && (undefined === input.content || "string" === typeof input.content) && (undefined === input.category || Array.isArray(input.category) && input.category.every(elem => "object" === typeof elem && null !== elem && false === Array.isArray(elem) && _io1(elem))) && (undefined === input.guid || "string" === typeof input.guid) && (null !== input.image && (undefined === input.image || "string" === typeof input.image || "object" === typeof input.image && null !== input.image && _io2(input.image))) && (null !== input.audio && (undefined === input.audio || "string" === typeof input.audio || "object" === typeof input.audio && null !== input.audio && _io2(input.audio))) && (null !== input.video && (undefined === input.video || "string" === typeof input.video || "object" === typeof input.video && null !== input.video && _io2(input.video))) && (undefined === input.enclosure || "object" === typeof input.enclosure && null !== input.enclosure && _io2(input.enclosure)) && (undefined === input.author || Array.isArray(input.author) && input.author.every(elem => "object" === typeof elem && null !== elem && false === Array.isArray(elem) && _io3(elem))) && (undefined === input.contributor || Array.isArray(input.contributor) && input.contributor.every(elem => "object" === typeof elem && null !== elem && false === Array.isArray(elem) && _io3(elem))) && (undefined === input.published || "string" === typeof input.published || "number" === typeof input.published) && (undefined === input.copyright || "string" === typeof input.copyright) && (undefined === input.extensions || Array.isArray(input.extensions) && input.extensions.every(elem => "object" === typeof elem && null !== elem && _io4(elem))); const _io1 = input => (undefined === input.name || "string" === typeof input.name) && (undefined === input.domain || "string" === typeof input.domain) && (undefined === input.scheme || "string" === typeof input.scheme) && (undefined === input.term || "string" === typeof input.term); const _io2 = input => "string" === typeof input.url && (undefined === input.type || "string" === typeof input.type) && (undefined === input.length || "number" === typeof input.length) && (undefined === input.title || "string" === typeof input.title) && (undefined === input.duration || "number" === typeof input.duration); const _io3 = input => (undefined === input.name || "string" === typeof input.name) && (undefined === input.email || "string" === typeof input.email) && (undefined === input.link || "string" === typeof input.link) && (undefined === input.avatar || "string" === typeof input.avatar); const _io4 = input => "string" === typeof input.name && true; return input => "object" === typeof input && null !== input && false === Array.isArray(input) && _io0(input); })();
|
|
@@ -1,28 +1,15 @@
|
|
|
1
1
|
import type { Nxtpression } from './nxtpression.ts';
|
|
2
2
|
import type { WidgetOptions, WidgetType } from './widget.ts';
|
|
3
|
-
export interface
|
|
3
|
+
export interface SchemaRootProperty<Value = unknown> extends NxtpressionSchemaProperty<Value> {
|
|
4
4
|
domain?: string;
|
|
5
5
|
path?: string;
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
oneOf?: Array<BaseSchemaProperty>;
|
|
14
|
-
anyOf?: Array<BaseSchemaProperty>;
|
|
15
|
-
enum?: ReadonlyArray<Value>;
|
|
16
|
-
widget?: WidgetType | WidgetOptions;
|
|
17
|
-
placeholder?: string;
|
|
18
|
-
helpText?: string;
|
|
19
|
-
invalid?: boolean;
|
|
20
|
-
emptyValue?: Value;
|
|
21
|
-
minItems?: number;
|
|
22
|
-
maxItems?: number;
|
|
23
|
-
items?: BaseSchemaProperty<Value>;
|
|
24
|
-
properties?: Record<string, BaseSchemaProperty<unknown>>;
|
|
25
|
-
computed?: Nxtpression<Value>;
|
|
6
|
+
recordName?: Nxtpression<string, {
|
|
7
|
+
id: string;
|
|
8
|
+
}>;
|
|
9
|
+
setter?: Nxtpression<(value: unknown) => void, {
|
|
10
|
+
id: string;
|
|
11
|
+
value: unknown;
|
|
12
|
+
}>;
|
|
26
13
|
/** An object specifying where to index the data. Adding this will effectively make the data searchable. */
|
|
27
14
|
index?: {
|
|
28
15
|
/** A string specifying the user-friendly title of the search property. This is what users will see when creating search filters and bookmarks. */
|
|
@@ -31,14 +18,31 @@ export interface BaseSchemaProperty<Value = unknown> {
|
|
|
31
18
|
path: string;
|
|
32
19
|
};
|
|
33
20
|
}
|
|
34
|
-
export
|
|
35
|
-
|
|
36
|
-
id: string;
|
|
37
|
-
}>;
|
|
38
|
-
setter?: Nxtpression<(value: unknown) => void, {
|
|
21
|
+
export type NxtpressionSchemaProperty<Value = unknown> = {
|
|
22
|
+
[K in keyof SchemaProperty<Value>]: Nxtpression<SchemaProperty<Value>[K], {
|
|
39
23
|
id: string;
|
|
40
|
-
value: unknown;
|
|
41
24
|
}>;
|
|
25
|
+
};
|
|
26
|
+
export interface SchemaProperty<Value = unknown> {
|
|
27
|
+
/** Specifying what type of data will be entered into the field. */
|
|
28
|
+
type?: "array" | "asset" | "boolean" | "datetime" | "number" | "string" | "object" | "rpc";
|
|
29
|
+
/** User-friendly title of the property. This will be used as the field's label in the UI. */
|
|
30
|
+
title?: string;
|
|
31
|
+
description?: string;
|
|
32
|
+
/** If present, indicates that the user must specify a value for the asset to be treated as valid. */
|
|
33
|
+
required?: boolean;
|
|
34
|
+
oneOf?: Array<SchemaProperty>;
|
|
35
|
+
anyOf?: Array<SchemaProperty>;
|
|
36
|
+
enum?: ReadonlyArray<Value>;
|
|
37
|
+
minItems?: number;
|
|
38
|
+
maxItems?: number;
|
|
39
|
+
items?: SchemaProperty<Value>;
|
|
40
|
+
properties?: Record<string, SchemaProperty<unknown>>;
|
|
42
41
|
default?: Value;
|
|
43
42
|
const?: Value;
|
|
43
|
+
widget?: WidgetType | WidgetOptions;
|
|
44
|
+
placeholder?: string;
|
|
45
|
+
helpText?: string;
|
|
46
|
+
invalid?: boolean;
|
|
47
|
+
emptyValue?: Value;
|
|
44
48
|
}
|