@prismicio/types-internal 1.2.0-alpha.0 → 1.2.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/lib/content/fields/GroupContent.d.ts +810 -0
- package/lib/content/fields/GroupContent.js +17 -0
- package/lib/content/fields/index.d.ts +3 -0
- package/lib/content/fields/index.js +6 -0
- package/lib/content/fields/nestable/BooleanContent.d.ts +7 -0
- package/lib/content/fields/nestable/BooleanContent.js +11 -0
- package/lib/content/fields/nestable/EmbedContent.d.ts +70 -0
- package/lib/content/fields/nestable/EmbedContent.js +13 -0
- package/lib/content/fields/nestable/FieldContent.d.ts +26 -0
- package/lib/content/fields/nestable/FieldContent.js +22 -0
- package/lib/content/fields/nestable/GeoPointContent.d.ts +18 -0
- package/lib/content/fields/nestable/GeoPointContent.js +13 -0
- package/lib/content/fields/nestable/Image.d.ts +103 -0
- package/lib/content/fields/nestable/Image.js +13 -0
- package/lib/content/fields/nestable/ImageContent.d.ts +104 -0
- package/lib/content/fields/nestable/ImageContent.js +13 -0
- package/lib/content/fields/nestable/IntegrationFieldContent.d.ts +7 -0
- package/lib/content/fields/nestable/IntegrationFieldContent.js +11 -0
- package/lib/content/fields/nestable/LinkContent.d.ts +159 -0
- package/lib/content/fields/nestable/LinkContent.js +48 -0
- package/lib/content/fields/nestable/NestableContent.d.ts +400 -0
- package/lib/content/fields/nestable/NestableContent.js +25 -0
- package/lib/content/fields/nestable/RichTextContent.d.ts +127 -0
- package/lib/content/fields/nestable/RichTextContent.js +11 -0
- package/lib/content/fields/nestable/SeparatorContent.d.ts +6 -0
- package/lib/content/fields/nestable/SeparatorContent.js +10 -0
- package/lib/content/fields/nestable/index.d.ts +10 -0
- package/lib/content/fields/nestable/index.js +13 -0
- package/lib/content/fields/slices/SharedSliceContent.d.ts +806 -0
- package/lib/content/fields/slices/SharedSliceContent.js +15 -0
- package/lib/content/fields/slices/index.d.ts +1 -0
- package/lib/content/fields/slices/index.js +4 -0
- package/lib/content/index.d.ts +1 -0
- package/lib/content/index.js +4 -0
- package/lib/customtypes/Comparators/SharedSlice.d.ts +260 -260
- package/lib/customtypes/Comparators/Variation.d.ts +258 -258
- package/lib/customtypes/CustomType.d.ts +932 -932
- package/lib/customtypes/Section.d.ts +932 -932
- package/lib/customtypes/widgets/Widget.d.ts +664 -664
- package/lib/customtypes/widgets/slices/Slices.d.ts +792 -792
- package/lib/documents/widgets/nestable/EmbedContent.d.ts +5 -6
- package/lib/documents/widgets/nestable/EmbedContent.js +5 -5
- package/lib/documents/widgets/nestable/ImageContent.d.ts +14 -14
- package/lib/documents/widgets/nestable/Link/ExternalLink.d.ts +4 -4
- package/lib/documents/widgets/nestable/Link/FileLink.d.ts +1 -1
- package/lib/documents/widgets/nestable/Link/FileLink.js +2 -1
- package/lib/documents/widgets/nestable/Link/LinkContent.d.ts +3 -3
- package/lib/documents/widgets/nestable/Link/index.d.ts +5 -5
- package/lib/documents/widgets/nestable/SeparatorContent.d.ts +4 -0
- package/lib/documents/widgets/nestable/SeparatorContent.js +5 -0
- package/lib/documents/widgets/nestable/StructuredTextContent/Block.d.ts +10 -10
- package/lib/utils/Objects.d.ts +3 -3
- package/lib/validators/TrimmedString.d.ts +5 -0
- package/lib/validators/TrimmedString.js +23 -0
- package/package.json +1 -1
- package/src/content/fields/GroupContent.ts +21 -0
- package/src/content/fields/index.ts +3 -0
- package/src/content/fields/nestable/BooleanContent.ts +11 -0
- package/src/content/fields/nestable/EmbedContent.ts +16 -0
- package/src/content/fields/nestable/FieldContent.ts +25 -0
- package/src/content/fields/nestable/GeoPointContent.ts +16 -0
- package/src/content/fields/nestable/ImageContent.ts +16 -0
- package/src/content/fields/nestable/IntegrationFieldContent.ts +11 -0
- package/src/content/fields/nestable/LinkContent.ts +68 -0
- package/src/content/fields/nestable/NestableContent.ts +25 -0
- package/src/content/fields/nestable/RichTextContent.ts +14 -0
- package/src/content/fields/nestable/SeparatorContent.ts +10 -0
- package/src/content/fields/nestable/index.ts +10 -0
- package/src/content/fields/slices/SharedSliceContent.ts +14 -0
- package/src/content/fields/slices/index.ts +1 -0
- package/src/content/index.ts +1 -0
- package/src/documents/widgets/nestable/EmbedContent.ts +1 -1
- package/src/documents/widgets/nestable/Link/FileLink.ts +2 -1
- package/src/documents/widgets/nestable/SeparatorContent.ts +5 -0
- package/src/utils/Objects.ts +13 -14
- package/src/validators/TrimmedString.ts +33 -0
|
@@ -7,17 +7,17 @@ export declare type EmbedContentO = t.OutputOf<typeof EmbedContentC> & {
|
|
|
7
7
|
all: unknown;
|
|
8
8
|
};
|
|
9
9
|
export declare const EmbedContent: t.Type<EmbedContentO, unknown, unknown>;
|
|
10
|
-
declare const EmbedContentC: t.Type<{
|
|
10
|
+
export declare const EmbedContentC: t.Type<{
|
|
11
11
|
embed_url: string;
|
|
12
12
|
type: string;
|
|
13
13
|
} & {
|
|
14
|
-
version?: string | number | null
|
|
14
|
+
version?: string | number | null;
|
|
15
15
|
title?: string | null | undefined;
|
|
16
16
|
author_name?: string | null | undefined;
|
|
17
17
|
author_url?: string | null | undefined;
|
|
18
18
|
provider_name?: string | null | undefined;
|
|
19
19
|
provider_url?: string | null | undefined;
|
|
20
|
-
cache_age?: string | number | null
|
|
20
|
+
cache_age?: string | number | null;
|
|
21
21
|
thumbnail_url?: string | null | undefined;
|
|
22
22
|
thumbnail_width?: number | null | undefined;
|
|
23
23
|
thumbnail_height?: number | null | undefined;
|
|
@@ -26,13 +26,13 @@ declare const EmbedContentC: t.Type<{
|
|
|
26
26
|
embed_url: string;
|
|
27
27
|
type: string;
|
|
28
28
|
} & {
|
|
29
|
-
version?: string | number | null
|
|
29
|
+
version?: string | number | null;
|
|
30
30
|
title?: string | null | undefined;
|
|
31
31
|
author_name?: string | null | undefined;
|
|
32
32
|
author_url?: string | null | undefined;
|
|
33
33
|
provider_name?: string | null | undefined;
|
|
34
34
|
provider_url?: string | null | undefined;
|
|
35
|
-
cache_age?: string | number | null
|
|
35
|
+
cache_age?: string | number | null;
|
|
36
36
|
thumbnail_url?: string | null | undefined;
|
|
37
37
|
thumbnail_width?: number | null | undefined;
|
|
38
38
|
thumbnail_height?: number | null | undefined;
|
|
@@ -40,4 +40,3 @@ declare const EmbedContentC: t.Type<{
|
|
|
40
40
|
} & {
|
|
41
41
|
__TYPE__: "EmbedContent";
|
|
42
42
|
}, unknown>;
|
|
43
|
-
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.EmbedContent = exports.EmbedContentType = void 0;
|
|
3
|
+
exports.EmbedContentC = exports.EmbedContent = exports.EmbedContentType = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const fp_ts_1 = require("fp-ts");
|
|
6
6
|
const function_1 = require("fp-ts/function");
|
|
@@ -9,12 +9,12 @@ const validators_1 = require("../../../validators");
|
|
|
9
9
|
const function_2 = require("../../../validators/function");
|
|
10
10
|
exports.EmbedContentType = "EmbedContent";
|
|
11
11
|
exports.EmbedContent = new t.Type("EmbedContent", (u) => u.__TYPE__ === exports.EmbedContentType, (u) => {
|
|
12
|
-
return (0, function_1.pipe)(EmbedContentC.decode(u), fp_ts_1.either.map((s) => ({
|
|
13
|
-
...EmbedContentC.encode(s),
|
|
12
|
+
return (0, function_1.pipe)(exports.EmbedContentC.decode(u), fp_ts_1.either.map((s) => ({
|
|
13
|
+
...exports.EmbedContentC.encode(s),
|
|
14
14
|
all: u,
|
|
15
15
|
})));
|
|
16
|
-
}, (ec) => EmbedContentC.encode(ec));
|
|
17
|
-
|
|
16
|
+
}, (ec) => exports.EmbedContentC.encode(ec));
|
|
17
|
+
exports.EmbedContentC = (0, function_2.addType)(t.exact(t.intersection([
|
|
18
18
|
t.type({
|
|
19
19
|
embed_url: t.string,
|
|
20
20
|
type: t.string,
|
|
@@ -42,9 +42,9 @@ export declare const ImageContent: t.Type<{
|
|
|
42
42
|
background: string;
|
|
43
43
|
};
|
|
44
44
|
} & {
|
|
45
|
-
url?: string
|
|
46
|
-
credits?: string | null
|
|
47
|
-
alt?: string | null
|
|
45
|
+
url?: string;
|
|
46
|
+
credits?: string | null;
|
|
47
|
+
alt?: string | null;
|
|
48
48
|
provider?: string | null | undefined;
|
|
49
49
|
} & {
|
|
50
50
|
thumbnails?: {
|
|
@@ -66,12 +66,12 @@ export declare const ImageContent: t.Type<{
|
|
|
66
66
|
background: string;
|
|
67
67
|
};
|
|
68
68
|
} & {
|
|
69
|
-
url?: string
|
|
70
|
-
credits?: string | null
|
|
71
|
-
alt?: string | null
|
|
69
|
+
url?: string;
|
|
70
|
+
credits?: string | null;
|
|
71
|
+
alt?: string | null;
|
|
72
72
|
provider?: string | null | undefined;
|
|
73
73
|
};
|
|
74
|
-
}
|
|
74
|
+
};
|
|
75
75
|
}, {
|
|
76
76
|
origin: {
|
|
77
77
|
id: string;
|
|
@@ -90,9 +90,9 @@ export declare const ImageContent: t.Type<{
|
|
|
90
90
|
background: string;
|
|
91
91
|
};
|
|
92
92
|
} & {
|
|
93
|
-
url?: string
|
|
94
|
-
credits?: string | null
|
|
95
|
-
alt?: string | null
|
|
93
|
+
url?: string;
|
|
94
|
+
credits?: string | null;
|
|
95
|
+
alt?: string | null;
|
|
96
96
|
provider?: string | null | undefined;
|
|
97
97
|
} & {
|
|
98
98
|
thumbnails?: {
|
|
@@ -114,12 +114,12 @@ export declare const ImageContent: t.Type<{
|
|
|
114
114
|
background: string;
|
|
115
115
|
};
|
|
116
116
|
} & {
|
|
117
|
-
url?: string
|
|
118
|
-
credits?: string | null
|
|
119
|
-
alt?: string | null
|
|
117
|
+
url?: string;
|
|
118
|
+
credits?: string | null;
|
|
119
|
+
alt?: string | null;
|
|
120
120
|
provider?: string | null | undefined;
|
|
121
121
|
};
|
|
122
|
-
}
|
|
122
|
+
};
|
|
123
123
|
} & {
|
|
124
124
|
__TYPE__: "ImageContent";
|
|
125
125
|
}, unknown>;
|
|
@@ -3,18 +3,18 @@ export declare const ExternalLinkType = "ExternalLink";
|
|
|
3
3
|
export declare const ExternalLink: t.Type<{
|
|
4
4
|
url: string;
|
|
5
5
|
} & {
|
|
6
|
-
kind?: "web"
|
|
6
|
+
kind?: "web";
|
|
7
7
|
target?: string | null | undefined;
|
|
8
8
|
preview?: {
|
|
9
|
-
title?: string
|
|
9
|
+
title?: string;
|
|
10
10
|
} | null | undefined;
|
|
11
11
|
}, {
|
|
12
12
|
url: string;
|
|
13
13
|
} & {
|
|
14
|
-
kind?: "web"
|
|
14
|
+
kind?: "web";
|
|
15
15
|
target?: string | null | undefined;
|
|
16
16
|
preview?: {
|
|
17
|
-
title?: string
|
|
17
|
+
title?: string;
|
|
18
18
|
} | null | undefined;
|
|
19
19
|
} & {
|
|
20
20
|
__TYPE__: "ExternalLink";
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.isFileLink = exports.FileLink = exports.FileLinkType = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const t = (0, tslib_1.__importStar)(require("io-ts"));
|
|
6
|
+
const io_ts_types_1 = require("io-ts-types");
|
|
6
7
|
const mapOutput_1 = require("io-ts-types/lib/mapOutput");
|
|
7
8
|
const function_1 = require("../../../../validators/function");
|
|
8
9
|
exports.FileLinkType = "FileLink";
|
|
@@ -15,7 +16,7 @@ exports.FileLink = (0, mapOutput_1.mapOutput)(t.exact(t.intersection([
|
|
|
15
16
|
}),
|
|
16
17
|
t.partial({
|
|
17
18
|
date: (0, function_1.nullable)(t.string),
|
|
18
|
-
size: (0,
|
|
19
|
+
size: (0, io_ts_types_1.withFallback)(t.string, "0"),
|
|
19
20
|
}),
|
|
20
21
|
])), (o) => ({ ...o, size: o.size || "0", __TYPE__: exports.FileLinkType }));
|
|
21
22
|
function isFileLink(u) {
|
|
@@ -10,10 +10,10 @@ export declare const LinkContent: t.Type<LinkContent, {
|
|
|
10
10
|
} | ({
|
|
11
11
|
url: string;
|
|
12
12
|
} & {
|
|
13
|
-
kind?: "web"
|
|
13
|
+
kind?: "web";
|
|
14
14
|
target?: string | null | undefined;
|
|
15
15
|
preview?: {
|
|
16
|
-
title?: string
|
|
16
|
+
title?: string;
|
|
17
17
|
} | null | undefined;
|
|
18
18
|
}) | ({
|
|
19
19
|
id: string;
|
|
@@ -22,7 +22,7 @@ export declare const LinkContent: t.Type<LinkContent, {
|
|
|
22
22
|
kind: string;
|
|
23
23
|
} & {
|
|
24
24
|
date?: string | null | undefined;
|
|
25
|
-
size?: string
|
|
25
|
+
size?: string;
|
|
26
26
|
}) | ({
|
|
27
27
|
id: string;
|
|
28
28
|
url: string;
|
|
@@ -32,7 +32,7 @@ export declare const Link: t.UnionC<[t.Type<{
|
|
|
32
32
|
kind: string;
|
|
33
33
|
} & {
|
|
34
34
|
date?: string | null | undefined;
|
|
35
|
-
size?: string
|
|
35
|
+
size?: string;
|
|
36
36
|
}, {
|
|
37
37
|
readonly size: string;
|
|
38
38
|
readonly __TYPE__: "FileLink";
|
|
@@ -50,18 +50,18 @@ export declare const Link: t.UnionC<[t.Type<{
|
|
|
50
50
|
}, unknown>, t.Type<{
|
|
51
51
|
url: string;
|
|
52
52
|
} & {
|
|
53
|
-
kind?: "web"
|
|
53
|
+
kind?: "web";
|
|
54
54
|
target?: string | null | undefined;
|
|
55
55
|
preview?: {
|
|
56
|
-
title?: string
|
|
56
|
+
title?: string;
|
|
57
57
|
} | null | undefined;
|
|
58
58
|
}, {
|
|
59
59
|
url: string;
|
|
60
60
|
} & {
|
|
61
|
-
kind?: "web"
|
|
61
|
+
kind?: "web";
|
|
62
62
|
target?: string | null | undefined;
|
|
63
63
|
preview?: {
|
|
64
|
-
title?: string
|
|
64
|
+
title?: string;
|
|
65
65
|
} | null | undefined;
|
|
66
66
|
} & {
|
|
67
67
|
__TYPE__: "ExternalLink";
|
|
@@ -1,7 +1,11 @@
|
|
|
1
|
+
import * as t from "io-ts";
|
|
1
2
|
export declare const SeparatorContentType = "SeparatorContent";
|
|
2
3
|
export declare type SeparatorContent = {
|
|
3
4
|
__TYPE__: typeof SeparatorContentType;
|
|
4
5
|
};
|
|
5
6
|
export declare const SeparatorContent: {
|
|
7
|
+
codec: t.ExactC<t.TypeC<{
|
|
8
|
+
__TYPE__: t.LiteralC<"SeparatorContent">;
|
|
9
|
+
}>>;
|
|
6
10
|
is(value: unknown): value is SeparatorContent;
|
|
7
11
|
};
|
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.SeparatorContent = exports.SeparatorContentType = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const t = (0, tslib_1.__importStar)(require("io-ts"));
|
|
4
6
|
exports.SeparatorContentType = "SeparatorContent";
|
|
5
7
|
exports.SeparatorContent = {
|
|
8
|
+
codec: t.strict({
|
|
9
|
+
__TYPE__: t.literal(exports.SeparatorContentType),
|
|
10
|
+
}),
|
|
6
11
|
is(value) {
|
|
7
12
|
const asFieldContent = value;
|
|
8
13
|
return asFieldContent.__TYPE__ === "SeparatorContent";
|
|
@@ -92,10 +92,10 @@ export declare const ImageBlock: t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
|
92
92
|
} | ({
|
|
93
93
|
url: string;
|
|
94
94
|
} & {
|
|
95
|
-
kind?: "web"
|
|
95
|
+
kind?: "web";
|
|
96
96
|
target?: string | null | undefined;
|
|
97
97
|
preview?: {
|
|
98
|
-
title?: string
|
|
98
|
+
title?: string;
|
|
99
99
|
} | null | undefined;
|
|
100
100
|
}) | ({
|
|
101
101
|
id: string;
|
|
@@ -104,7 +104,7 @@ export declare const ImageBlock: t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
|
104
104
|
kind: string;
|
|
105
105
|
} & {
|
|
106
106
|
date?: string | null | undefined;
|
|
107
|
-
size?: string
|
|
107
|
+
size?: string;
|
|
108
108
|
}) | ({
|
|
109
109
|
id: string;
|
|
110
110
|
url: string;
|
|
@@ -122,10 +122,10 @@ export declare const ImageBlock: t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
|
122
122
|
}) | ({
|
|
123
123
|
url: string;
|
|
124
124
|
} & {
|
|
125
|
-
kind?: "web"
|
|
125
|
+
kind?: "web";
|
|
126
126
|
target?: string | null | undefined;
|
|
127
127
|
preview?: {
|
|
128
|
-
title?: string
|
|
128
|
+
title?: string;
|
|
129
129
|
} | null | undefined;
|
|
130
130
|
} & {
|
|
131
131
|
__TYPE__: "ExternalLink";
|
|
@@ -220,10 +220,10 @@ export declare const Block: t.UnionC<[t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
|
220
220
|
} | ({
|
|
221
221
|
url: string;
|
|
222
222
|
} & {
|
|
223
|
-
kind?: "web"
|
|
223
|
+
kind?: "web";
|
|
224
224
|
target?: string | null | undefined;
|
|
225
225
|
preview?: {
|
|
226
|
-
title?: string
|
|
226
|
+
title?: string;
|
|
227
227
|
} | null | undefined;
|
|
228
228
|
}) | ({
|
|
229
229
|
id: string;
|
|
@@ -232,7 +232,7 @@ export declare const Block: t.UnionC<[t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
|
232
232
|
kind: string;
|
|
233
233
|
} & {
|
|
234
234
|
date?: string | null | undefined;
|
|
235
|
-
size?: string
|
|
235
|
+
size?: string;
|
|
236
236
|
}) | ({
|
|
237
237
|
id: string;
|
|
238
238
|
url: string;
|
|
@@ -250,10 +250,10 @@ export declare const Block: t.UnionC<[t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
|
250
250
|
}) | ({
|
|
251
251
|
url: string;
|
|
252
252
|
} & {
|
|
253
|
-
kind?: "web"
|
|
253
|
+
kind?: "web";
|
|
254
254
|
target?: string | null | undefined;
|
|
255
255
|
preview?: {
|
|
256
|
-
title?: string
|
|
256
|
+
title?: string;
|
|
257
257
|
} | null | undefined;
|
|
258
258
|
} & {
|
|
259
259
|
__TYPE__: "ExternalLink";
|
package/lib/utils/Objects.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export declare function zipObjects<A, B = A>(objLeft?: Partial<Record<string, A
|
|
2
|
-
left?: A;
|
|
3
|
-
right?: B;
|
|
1
|
+
export declare function zipObjects<A, B = A>(objLeft?: Partial<Record<string, A>> | undefined, objRight?: Partial<Record<string, B>> | undefined): Partial<Record<string, {
|
|
2
|
+
left?: A | undefined;
|
|
3
|
+
right?: B | undefined;
|
|
4
4
|
}>>;
|
|
5
5
|
export declare function isNotEmpty<A extends object>(obj: A): boolean;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const Either_1 = require("fp-ts/Either");
|
|
5
|
+
const function_1 = require("fp-ts/function");
|
|
6
|
+
const t = (0, tslib_1.__importStar)(require("io-ts"));
|
|
7
|
+
function trimScalaStyle(s) {
|
|
8
|
+
let startAt = 0;
|
|
9
|
+
/* eslint-disable @typescript-eslint/no-non-null-assertion */
|
|
10
|
+
while (startAt < s.length && s[startAt] <= " ") {
|
|
11
|
+
startAt++;
|
|
12
|
+
}
|
|
13
|
+
let endAt = s.length;
|
|
14
|
+
/* eslint-disable @typescript-eslint/no-non-null-assertion */
|
|
15
|
+
while (startAt < endAt && s[endAt - 1] <= " ") {
|
|
16
|
+
endAt--;
|
|
17
|
+
}
|
|
18
|
+
return s.substring(startAt, endAt);
|
|
19
|
+
}
|
|
20
|
+
/** A codec that validates a Boolean and convert it as a string */
|
|
21
|
+
exports.default = new t.Type("TrimmedString", t.string.is, (u, c) => (0, function_1.pipe)(t.string.validate(u, c), (0, Either_1.chain)((s) => {
|
|
22
|
+
return t.success(trimScalaStyle(s));
|
|
23
|
+
})), (i) => i);
|
package/package.json
CHANGED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import * as t from "io-ts"
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
GroupContentType as groupType,
|
|
5
|
+
GroupItemContentType as groupItemType,
|
|
6
|
+
} from "../../documents/widgets/GroupContent"
|
|
7
|
+
import { NestableContent } from "./nestable"
|
|
8
|
+
|
|
9
|
+
export const GroupItemContent = t.strict({
|
|
10
|
+
__TYPE__: t.literal(groupItemType),
|
|
11
|
+
value: t.array(t.tuple([t.string, NestableContent])),
|
|
12
|
+
})
|
|
13
|
+
export type GroupItemContent = t.TypeOf<typeof GroupItemContent>
|
|
14
|
+
export const GroupItemContentType = groupItemType
|
|
15
|
+
|
|
16
|
+
export const GroupContent = t.strict({
|
|
17
|
+
__TYPE__: t.literal(groupType),
|
|
18
|
+
value: t.array(GroupItemContent),
|
|
19
|
+
})
|
|
20
|
+
export type GroupContent = t.TypeOf<typeof GroupContent>
|
|
21
|
+
export const GroupContentType = groupType
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as t from "io-ts"
|
|
2
|
+
|
|
3
|
+
import { BooleanContentType as type } from "../../../documents/widgets/nestable/BooleanContent"
|
|
4
|
+
|
|
5
|
+
export const BooleanContent = t.strict({
|
|
6
|
+
__TYPE__: t.literal(type),
|
|
7
|
+
value: t.boolean,
|
|
8
|
+
})
|
|
9
|
+
|
|
10
|
+
export type BooleanContent = t.TypeOf<typeof BooleanContent>
|
|
11
|
+
export const BooleanContentType = type
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as t from "io-ts"
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
EmbedContentC as EmbedNoType,
|
|
5
|
+
EmbedContentType,
|
|
6
|
+
} from "../../../documents/widgets/nestable/EmbedContent"
|
|
7
|
+
|
|
8
|
+
export const EmbedContent = t.intersection([
|
|
9
|
+
EmbedNoType,
|
|
10
|
+
t.strict({
|
|
11
|
+
__TYPE__: t.literal(EmbedContentType),
|
|
12
|
+
all: EmbedNoType,
|
|
13
|
+
}),
|
|
14
|
+
])
|
|
15
|
+
|
|
16
|
+
export type EmbedContent = t.TypeOf<typeof EmbedContent>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import * as t from "io-ts"
|
|
2
|
+
|
|
3
|
+
import { FieldContentType as type } from "../../../documents/widgets/nestable/FieldContent"
|
|
4
|
+
import TrimmedString from "../../../validators/TrimmedString"
|
|
5
|
+
|
|
6
|
+
export const FieldType = t.keyof({
|
|
7
|
+
Text: null,
|
|
8
|
+
Date: null,
|
|
9
|
+
Timestamp: null,
|
|
10
|
+
Color: null,
|
|
11
|
+
Number: null,
|
|
12
|
+
Range: null,
|
|
13
|
+
Select: null,
|
|
14
|
+
})
|
|
15
|
+
|
|
16
|
+
export type FieldType = t.TypeOf<typeof FieldType>
|
|
17
|
+
|
|
18
|
+
export const FieldContent = t.strict({
|
|
19
|
+
type: FieldType,
|
|
20
|
+
value: TrimmedString,
|
|
21
|
+
__TYPE__: t.literal(type),
|
|
22
|
+
})
|
|
23
|
+
|
|
24
|
+
export type FieldContent = t.TypeOf<typeof FieldContent>
|
|
25
|
+
export const FieldContentType = type
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as t from "io-ts"
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
GeoPointContent as GeoPointNoType,
|
|
5
|
+
GeoPointContentType as type,
|
|
6
|
+
} from "../../../documents/widgets/nestable/GeoPointContent"
|
|
7
|
+
|
|
8
|
+
export const GeoPointContent = t.intersection([
|
|
9
|
+
GeoPointNoType,
|
|
10
|
+
t.strict({
|
|
11
|
+
__TYPE__: t.literal(type),
|
|
12
|
+
}),
|
|
13
|
+
])
|
|
14
|
+
|
|
15
|
+
export type GeoPointContent = t.TypeOf<typeof GeoPointContent>
|
|
16
|
+
export const GeoPointContentType = type
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as t from "io-ts"
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
ImageContent as ImageNoType,
|
|
5
|
+
ImageContentType as type,
|
|
6
|
+
} from "../../../documents/widgets/nestable/ImageContent"
|
|
7
|
+
|
|
8
|
+
export const ImageContent = t.intersection([
|
|
9
|
+
ImageNoType,
|
|
10
|
+
t.strict({
|
|
11
|
+
__TYPE__: t.literal(type),
|
|
12
|
+
}),
|
|
13
|
+
])
|
|
14
|
+
|
|
15
|
+
export type ImageContent = t.TypeOf<typeof ImageContent>
|
|
16
|
+
export const ImageContentType = type
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as t from "io-ts"
|
|
2
|
+
|
|
3
|
+
import { IntegrationFieldsContentType as type } from "../../../documents/widgets/nestable/IntegrationFieldsContent"
|
|
4
|
+
|
|
5
|
+
export const IntegrationFieldContent = t.strict({
|
|
6
|
+
__TYPE__: t.literal(type),
|
|
7
|
+
value: t.string,
|
|
8
|
+
})
|
|
9
|
+
|
|
10
|
+
export type IntegrationFieldContent = t.TypeOf<typeof IntegrationFieldContent>
|
|
11
|
+
export const IntegrationFieldsContentType = type
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import * as t from "io-ts"
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
DocumentLink,
|
|
5
|
+
DocumentLinkType as dlType,
|
|
6
|
+
} from "../../../documents/widgets/nestable/Link/DocumentLink"
|
|
7
|
+
import {
|
|
8
|
+
ExternalLink,
|
|
9
|
+
ExternalLinkType as elType,
|
|
10
|
+
} from "../../../documents/widgets/nestable/Link/ExternalLink"
|
|
11
|
+
import {
|
|
12
|
+
FileLink,
|
|
13
|
+
FileLinkType as flType,
|
|
14
|
+
} from "../../../documents/widgets/nestable/Link/FileLink"
|
|
15
|
+
import {
|
|
16
|
+
ImageLink,
|
|
17
|
+
ImageLinkType as ilType,
|
|
18
|
+
} from "../../../documents/widgets/nestable/Link/ImageLink"
|
|
19
|
+
import { LinkContentType as lcType } from "../../../documents/widgets/nestable/Link/LinkContent"
|
|
20
|
+
|
|
21
|
+
export const ImageLinkContent = t.intersection([
|
|
22
|
+
t.strict({
|
|
23
|
+
__TYPE__: t.literal(ilType),
|
|
24
|
+
}),
|
|
25
|
+
ImageLink,
|
|
26
|
+
])
|
|
27
|
+
export type ImageLinkContent = t.TypeOf<typeof ImageLinkContent>
|
|
28
|
+
export const ImageLinkType = ilType
|
|
29
|
+
|
|
30
|
+
export const FileLinkContent = t.intersection([
|
|
31
|
+
t.strict({
|
|
32
|
+
__TYPE__: t.literal(flType),
|
|
33
|
+
}),
|
|
34
|
+
FileLink,
|
|
35
|
+
])
|
|
36
|
+
export type FileLinkContent = t.TypeOf<typeof FileLinkContent>
|
|
37
|
+
export const FileLinkType = flType
|
|
38
|
+
|
|
39
|
+
export const DocumentLinkContent = t.intersection([
|
|
40
|
+
t.strict({
|
|
41
|
+
__TYPE__: t.literal(dlType),
|
|
42
|
+
}),
|
|
43
|
+
DocumentLink,
|
|
44
|
+
])
|
|
45
|
+
export type DocumentLinkContent = t.TypeOf<typeof DocumentLinkContent>
|
|
46
|
+
export const DocumentLinkType = dlType
|
|
47
|
+
|
|
48
|
+
export const ExternalLinkContent = t.intersection([
|
|
49
|
+
t.strict({
|
|
50
|
+
__TYPE__: t.literal(elType),
|
|
51
|
+
}),
|
|
52
|
+
ExternalLink,
|
|
53
|
+
])
|
|
54
|
+
export type ExternalLinkContent = t.TypeOf<typeof ExternalLinkContent>
|
|
55
|
+
export const ExternalLinkType = elType
|
|
56
|
+
|
|
57
|
+
export const LinkContent = t.strict({
|
|
58
|
+
__TYPE__: t.literal(lcType),
|
|
59
|
+
value: t.union([
|
|
60
|
+
ImageLinkContent,
|
|
61
|
+
FileLinkContent,
|
|
62
|
+
DocumentLinkContent,
|
|
63
|
+
ExternalLinkContent,
|
|
64
|
+
]),
|
|
65
|
+
})
|
|
66
|
+
|
|
67
|
+
export type LinkContent = t.TypeOf<typeof LinkContent>
|
|
68
|
+
export const LinkContentType = lcType
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import * as t from "io-ts"
|
|
2
|
+
|
|
3
|
+
import { BooleanContent } from "./BooleanContent"
|
|
4
|
+
import { EmbedContent } from "./EmbedContent"
|
|
5
|
+
import { FieldContent } from "./FieldContent"
|
|
6
|
+
import { GeoPointContent } from "./GeoPointContent"
|
|
7
|
+
import { ImageContent } from "./ImageContent"
|
|
8
|
+
import { IntegrationFieldContent } from "./IntegrationFieldContent"
|
|
9
|
+
import { LinkContent } from "./LinkContent"
|
|
10
|
+
import { RichTextContent } from "./RichTextContent"
|
|
11
|
+
import { SeparatorContent } from "./SeparatorContent"
|
|
12
|
+
|
|
13
|
+
export const NestableContent = t.union([
|
|
14
|
+
BooleanContent,
|
|
15
|
+
EmbedContent,
|
|
16
|
+
FieldContent,
|
|
17
|
+
GeoPointContent,
|
|
18
|
+
ImageContent,
|
|
19
|
+
IntegrationFieldContent,
|
|
20
|
+
LinkContent,
|
|
21
|
+
RichTextContent,
|
|
22
|
+
SeparatorContent,
|
|
23
|
+
])
|
|
24
|
+
|
|
25
|
+
export type NestableContent = t.TypeOf<typeof NestableContent>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as t from "io-ts"
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
Blocks,
|
|
5
|
+
StructuredTextContentType as type,
|
|
6
|
+
} from "../../../documents/widgets/nestable/StructuredTextContent"
|
|
7
|
+
|
|
8
|
+
export const RichTextContent = t.strict({
|
|
9
|
+
__TYPE__: t.literal(type),
|
|
10
|
+
value: t.array(Blocks.Block),
|
|
11
|
+
})
|
|
12
|
+
|
|
13
|
+
export type RichTextContent = t.TypeOf<typeof RichTextContent>
|
|
14
|
+
export const RichTextContentType = type
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as t from "io-ts"
|
|
2
|
+
|
|
3
|
+
import { SeparatorContentType as type } from "../../../documents/widgets/nestable/SeparatorContent"
|
|
4
|
+
|
|
5
|
+
export const SeparatorContent = t.strict({
|
|
6
|
+
__TYPE__: t.literal(type),
|
|
7
|
+
})
|
|
8
|
+
|
|
9
|
+
export type SeparatorContent = t.TypeOf<typeof SeparatorContent>
|
|
10
|
+
export const SeparatorContentType = type
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export * from "./BooleanContent"
|
|
2
|
+
export * from "./EmbedContent"
|
|
3
|
+
export * from "./FieldContent"
|
|
4
|
+
export * from "./GeoPointContent"
|
|
5
|
+
export * from "./ImageContent"
|
|
6
|
+
export * from "./IntegrationFieldContent"
|
|
7
|
+
export * from "./LinkContent"
|
|
8
|
+
export * from "./NestableContent"
|
|
9
|
+
export * from "./RichTextContent"
|
|
10
|
+
export * from "./SeparatorContent"
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as t from "io-ts"
|
|
2
|
+
|
|
3
|
+
import { SharedSliceContentType as type } from "../../../documents/widgets/slices"
|
|
4
|
+
import { GroupItemContent } from "../GroupContent"
|
|
5
|
+
import { NestableContent } from "../nestable"
|
|
6
|
+
|
|
7
|
+
export const SharedSliceContent = t.strict({
|
|
8
|
+
__TYPE__: t.literal(type),
|
|
9
|
+
variation: t.string,
|
|
10
|
+
primary: t.record(t.string, NestableContent),
|
|
11
|
+
items: t.array(GroupItemContent),
|
|
12
|
+
})
|
|
13
|
+
export type SharedSliceContent = t.TypeOf<typeof SharedSliceContent>
|
|
14
|
+
export const SharedSliceContentType = type
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./SharedSliceContent"
|