@prismicio/types-internal 2.2.0 → 2.2.1-remove-import.alpha-1
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/common/UUID.d.ts +1 -2
- package/package.json +1 -1
- package/src/common/UUID.ts +1 -1
- package/lib/import/converters/Document.d.ts +0 -4
- package/lib/import/converters/Document.js +0 -21
- package/lib/import/converters/fields/Group.d.ts +0 -4
- package/lib/import/converters/fields/Group.js +0 -14
- package/lib/import/converters/fields/RepeatableZone.d.ts +0 -317
- package/lib/import/converters/fields/RepeatableZone.js +0 -15
- package/lib/import/converters/fields/RepeatableZoneItem.d.ts +0 -11
- package/lib/import/converters/fields/RepeatableZoneItem.js +0 -19
- package/lib/import/converters/fields/Slices/SharedSlice.d.ts +0 -4
- package/lib/import/converters/fields/Slices/SharedSlice.js +0 -19
- package/lib/import/converters/fields/Slices/SharedSliceContent.d.ts +0 -10
- package/lib/import/converters/fields/Slices/SharedSliceContent.js +0 -23
- package/lib/import/converters/fields/Slices/Slices.d.ts +0 -4
- package/lib/import/converters/fields/Slices/Slices.js +0 -16
- package/lib/import/converters/fields/Slices/index.d.ts +0 -1
- package/lib/import/converters/fields/Slices/index.js +0 -4
- package/lib/import/converters/fields/UID.d.ts +0 -3
- package/lib/import/converters/fields/UID.js +0 -10
- package/lib/import/converters/fields/index.d.ts +0 -4
- package/lib/import/converters/fields/index.js +0 -7
- package/lib/import/converters/fields/nestable/Boolean.d.ts +0 -3
- package/lib/import/converters/fields/nestable/Boolean.js +0 -12
- package/lib/import/converters/fields/nestable/Color.d.ts +0 -3
- package/lib/import/converters/fields/nestable/Color.js +0 -13
- package/lib/import/converters/fields/nestable/Date.d.ts +0 -3
- package/lib/import/converters/fields/nestable/Date.js +0 -15
- package/lib/import/converters/fields/nestable/Embed.d.ts +0 -4
- package/lib/import/converters/fields/nestable/Embed.js +0 -32
- package/lib/import/converters/fields/nestable/GeoPoint.d.ts +0 -3
- package/lib/import/converters/fields/nestable/GeoPoint.js +0 -15
- package/lib/import/converters/fields/nestable/Image.d.ts +0 -28
- package/lib/import/converters/fields/nestable/Image.js +0 -67
- package/lib/import/converters/fields/nestable/Link.d.ts +0 -4
- package/lib/import/converters/fields/nestable/Link.js +0 -70
- package/lib/import/converters/fields/nestable/Nestable.d.ts +0 -5
- package/lib/import/converters/fields/nestable/Nestable.js +0 -35
- package/lib/import/converters/fields/nestable/Number.d.ts +0 -3
- package/lib/import/converters/fields/nestable/Number.js +0 -13
- package/lib/import/converters/fields/nestable/RichText/embedBlock.d.ts +0 -4
- package/lib/import/converters/fields/nestable/RichText/embedBlock.js +0 -14
- package/lib/import/converters/fields/nestable/RichText/imageBlock.d.ts +0 -4
- package/lib/import/converters/fields/nestable/RichText/imageBlock.js +0 -12
- package/lib/import/converters/fields/nestable/RichText/index.d.ts +0 -4
- package/lib/import/converters/fields/nestable/RichText/index.js +0 -22
- package/lib/import/converters/fields/nestable/RichText/textBlock.d.ts +0 -4
- package/lib/import/converters/fields/nestable/RichText/textBlock.js +0 -54
- package/lib/import/converters/fields/nestable/Select.d.ts +0 -3
- package/lib/import/converters/fields/nestable/Select.js +0 -13
- package/lib/import/converters/fields/nestable/Text.d.ts +0 -3
- package/lib/import/converters/fields/nestable/Text.js +0 -13
- package/lib/import/converters/fields/nestable/Timestamp.d.ts +0 -3
- package/lib/import/converters/fields/nestable/Timestamp.js +0 -13
- package/lib/import/converters/fields/nestable/index.d.ts +0 -13
- package/lib/import/converters/fields/nestable/index.js +0 -16
- package/lib/import/converters/index.d.ts +0 -2
- package/lib/import/converters/index.js +0 -5
- package/lib/import/index.d.ts +0 -2
- package/lib/import/index.js +0 -5
- package/lib/import/validators/Document.d.ts +0 -6
- package/lib/import/validators/Document.js +0 -64
- package/lib/import/validators/fields/ImportContent.d.ts +0 -5
- package/lib/import/validators/fields/ImportContent.js +0 -21
- package/lib/import/validators/fields/ImportField.d.ts +0 -141
- package/lib/import/validators/fields/ImportField.js +0 -33
- package/lib/import/validators/fields/ImportGroup.d.ts +0 -345
- package/lib/import/validators/fields/ImportGroup.js +0 -27
- package/lib/import/validators/fields/ImportSlices/ImportSlices.d.ts +0 -8
- package/lib/import/validators/fields/ImportSlices/ImportSlices.js +0 -30
- package/lib/import/validators/fields/ImportSlices/SharedSlice/SharedSlice.d.ts +0 -16
- package/lib/import/validators/fields/ImportSlices/SharedSlice/SharedSlice.js +0 -61
- package/lib/import/validators/fields/ImportSlices/SharedSlice/errors.d.ts +0 -4
- package/lib/import/validators/fields/ImportSlices/SharedSlice/errors.js +0 -7
- package/lib/import/validators/fields/ImportSlices/SharedSlice/fields/OptionalSharedSliceId.d.ts +0 -2
- package/lib/import/validators/fields/ImportSlices/SharedSlice/fields/OptionalSharedSliceId.js +0 -15
- package/lib/import/validators/fields/ImportSlices/SharedSlice/fields/SharedSliceContent/SharedSliceContent.d.ts +0 -17
- package/lib/import/validators/fields/ImportSlices/SharedSlice/fields/SharedSliceContent/SharedSliceContent.js +0 -30
- package/lib/import/validators/fields/ImportSlices/SharedSlice/fields/SharedSliceContent/SharedSliceContentEntry.d.ts +0 -43
- package/lib/import/validators/fields/ImportSlices/SharedSlice/fields/SharedSliceContent/SharedSliceContentEntry.js +0 -69
- package/lib/import/validators/fields/ImportSlices/SharedSlice/fields/SharedSliceContent/errors.d.ts +0 -4
- package/lib/import/validators/fields/ImportSlices/SharedSlice/fields/SharedSliceContent/errors.js +0 -6
- package/lib/import/validators/fields/ImportSlices/SharedSlice/fields/SharedSliceContent/index.d.ts +0 -2
- package/lib/import/validators/fields/ImportSlices/SharedSlice/fields/SharedSliceContent/index.js +0 -5
- package/lib/import/validators/fields/ImportSlices/SharedSlice/fields/SharedSliceContent/types.d.ts +0 -1
- package/lib/import/validators/fields/ImportSlices/SharedSlice/fields/SharedSliceContent/types.js +0 -2
- package/lib/import/validators/fields/ImportSlices/SharedSlice/fields/SharedSliceId.d.ts +0 -9
- package/lib/import/validators/fields/ImportSlices/SharedSlice/fields/SharedSliceId.js +0 -39
- package/lib/import/validators/fields/ImportSlices/SharedSlice/fields/SharedSliceType.d.ts +0 -11
- package/lib/import/validators/fields/ImportSlices/SharedSlice/fields/SharedSliceType.js +0 -24
- package/lib/import/validators/fields/ImportSlices/SharedSlice/fields/SharedSliceVariation.d.ts +0 -11
- package/lib/import/validators/fields/ImportSlices/SharedSlice/fields/SharedSliceVariation.js +0 -24
- package/lib/import/validators/fields/ImportSlices/SharedSlice/fields/index.d.ts +0 -4
- package/lib/import/validators/fields/ImportSlices/SharedSlice/fields/index.js +0 -7
- package/lib/import/validators/fields/ImportSlices/SharedSlice/index.d.ts +0 -3
- package/lib/import/validators/fields/ImportSlices/SharedSlice/index.js +0 -6
- package/lib/import/validators/fields/ImportSlices/SharedSlice/utils.d.ts +0 -342
- package/lib/import/validators/fields/ImportSlices/SharedSlice/utils.js +0 -11
- package/lib/import/validators/fields/ImportSlices/index.d.ts +0 -1
- package/lib/import/validators/fields/ImportSlices/index.js +0 -4
- package/lib/import/validators/fields/ImportSlices/utils.d.ts +0 -4
- package/lib/import/validators/fields/ImportSlices/utils.js +0 -35
- package/lib/import/validators/fields/RepeatableZone.d.ts +0 -11
- package/lib/import/validators/fields/RepeatableZone.js +0 -14
- package/lib/import/validators/fields/RepeatableZoneItem.d.ts +0 -11
- package/lib/import/validators/fields/RepeatableZoneItem.js +0 -39
- package/lib/import/validators/fields/UID.d.ts +0 -6
- package/lib/import/validators/fields/UID.js +0 -15
- package/lib/import/validators/fields/index.d.ts +0 -4
- package/lib/import/validators/fields/index.js +0 -7
- package/lib/import/validators/fields/nestable/Boolean.d.ts +0 -6
- package/lib/import/validators/fields/nestable/Boolean.js +0 -6
- package/lib/import/validators/fields/nestable/Color.d.ts +0 -6
- package/lib/import/validators/fields/nestable/Color.js +0 -15
- package/lib/import/validators/fields/nestable/Date.d.ts +0 -6
- package/lib/import/validators/fields/nestable/Date.js +0 -19
- package/lib/import/validators/fields/nestable/Embed.d.ts +0 -13
- package/lib/import/validators/fields/nestable/Embed.js +0 -31
- package/lib/import/validators/fields/nestable/GeoPoint.d.ts +0 -13
- package/lib/import/validators/fields/nestable/GeoPoint.js +0 -13
- package/lib/import/validators/fields/nestable/Image/default.d.ts +0 -22
- package/lib/import/validators/fields/nestable/Image/default.js +0 -19
- package/lib/import/validators/fields/nestable/Image/index.d.ts +0 -45
- package/lib/import/validators/fields/nestable/Image/index.js +0 -41
- package/lib/import/validators/fields/nestable/Image/merge.d.ts +0 -23
- package/lib/import/validators/fields/nestable/Image/merge.js +0 -44
- package/lib/import/validators/fields/nestable/Image/model.d.ts +0 -18
- package/lib/import/validators/fields/nestable/Image/model.js +0 -2
- package/lib/import/validators/fields/nestable/Image/validators.d.ts +0 -35
- package/lib/import/validators/fields/nestable/Image/validators.js +0 -31
- package/lib/import/validators/fields/nestable/ImportRichText/ImportBlock.d.ts +0 -6
- package/lib/import/validators/fields/nestable/ImportRichText/ImportBlock.js +0 -25
- package/lib/import/validators/fields/nestable/ImportRichText/ImportRichText.d.ts +0 -24
- package/lib/import/validators/fields/nestable/ImportRichText/ImportRichText.js +0 -32
- package/lib/import/validators/fields/nestable/ImportRichText/blocks/ImportBlockType.d.ts +0 -6
- package/lib/import/validators/fields/nestable/ImportRichText/blocks/ImportBlockType.js +0 -18
- package/lib/import/validators/fields/nestable/ImportRichText/blocks/ImportEmbedBlock.d.ts +0 -10
- package/lib/import/validators/fields/nestable/ImportRichText/blocks/ImportEmbedBlock.js +0 -11
- package/lib/import/validators/fields/nestable/ImportRichText/blocks/ImportImageBlock.d.ts +0 -22
- package/lib/import/validators/fields/nestable/ImportRichText/blocks/ImportImageBlock.js +0 -13
- package/lib/import/validators/fields/nestable/ImportRichText/blocks/ImportTextBlock.d.ts +0 -78
- package/lib/import/validators/fields/nestable/ImportRichText/blocks/ImportTextBlock.js +0 -43
- package/lib/import/validators/fields/nestable/ImportRichText/blocks/Span.d.ts +0 -79
- package/lib/import/validators/fields/nestable/ImportRichText/blocks/Span.js +0 -27
- package/lib/import/validators/fields/nestable/ImportRichText/blocks/index.d.ts +0 -4
- package/lib/import/validators/fields/nestable/ImportRichText/blocks/index.js +0 -7
- package/lib/import/validators/fields/nestable/ImportRichText/blocks/spans/HyperlinkSpan.d.ts +0 -24
- package/lib/import/validators/fields/nestable/ImportRichText/blocks/spans/HyperlinkSpan.js +0 -18
- package/lib/import/validators/fields/nestable/ImportRichText/blocks/spans/LabelSpan.d.ts +0 -12
- package/lib/import/validators/fields/nestable/ImportRichText/blocks/spans/LabelSpan.js +0 -16
- package/lib/import/validators/fields/nestable/ImportRichText/blocks/spans/SpanLocation.d.ts +0 -5
- package/lib/import/validators/fields/nestable/ImportRichText/blocks/spans/SpanLocation.js +0 -10
- package/lib/import/validators/fields/nestable/ImportRichText/blocks/spans/TextSpan.d.ts +0 -15
- package/lib/import/validators/fields/nestable/ImportRichText/blocks/spans/TextSpan.js +0 -20
- package/lib/import/validators/fields/nestable/ImportRichText/blocks/spans/index.d.ts +0 -2
- package/lib/import/validators/fields/nestable/ImportRichText/blocks/spans/index.js +0 -5
- package/lib/import/validators/fields/nestable/ImportRichText/index.d.ts +0 -2
- package/lib/import/validators/fields/nestable/ImportRichText/index.js +0 -7
- package/lib/import/validators/fields/nestable/Link.d.ts +0 -53
- package/lib/import/validators/fields/nestable/Link.js +0 -35
- package/lib/import/validators/fields/nestable/Nestable.d.ts +0 -192
- package/lib/import/validators/fields/nestable/Nestable.js +0 -71
- package/lib/import/validators/fields/nestable/Number.d.ts +0 -17
- package/lib/import/validators/fields/nestable/Number.js +0 -17
- package/lib/import/validators/fields/nestable/Select.d.ts +0 -16
- package/lib/import/validators/fields/nestable/Select.js +0 -19
- package/lib/import/validators/fields/nestable/Text.d.ts +0 -6
- package/lib/import/validators/fields/nestable/Text.js +0 -6
- package/lib/import/validators/fields/nestable/Timestamp.d.ts +0 -7
- package/lib/import/validators/fields/nestable/Timestamp.js +0 -19
- package/lib/import/validators/fields/nestable/index.d.ts +0 -14
- package/lib/import/validators/fields/nestable/index.js +0 -19
- package/lib/import/validators/index.d.ts +0 -2
- package/lib/import/validators/index.js +0 -5
- package/lib/utils/io-ts.d.ts +0 -2
- package/lib/utils/io-ts.js +0 -22
- package/src/import/converters/Document.ts +0 -38
- package/src/import/converters/fields/Group.ts +0 -18
- package/src/import/converters/fields/RepeatableZone.ts +0 -19
- package/src/import/converters/fields/RepeatableZoneItem.ts +0 -32
- package/src/import/converters/fields/Slices/SharedSlice.ts +0 -24
- package/src/import/converters/fields/Slices/SharedSliceContent.ts +0 -27
- package/src/import/converters/fields/Slices/Slices.ts +0 -20
- package/src/import/converters/fields/Slices/index.ts +0 -1
- package/src/import/converters/fields/UID.ts +0 -9
- package/src/import/converters/fields/index.ts +0 -4
- package/src/import/converters/fields/nestable/Boolean.ts +0 -13
- package/src/import/converters/fields/nestable/Color.ts +0 -14
- package/src/import/converters/fields/nestable/Date.ts +0 -17
- package/src/import/converters/fields/nestable/Embed.ts +0 -37
- package/src/import/converters/fields/nestable/GeoPoint.ts +0 -16
- package/src/import/converters/fields/nestable/Image.ts +0 -91
- package/src/import/converters/fields/nestable/Link.ts +0 -77
- package/src/import/converters/fields/nestable/Nestable.ts +0 -55
- package/src/import/converters/fields/nestable/Number.ts +0 -14
- package/src/import/converters/fields/nestable/RichText/embedBlock.ts +0 -17
- package/src/import/converters/fields/nestable/RichText/imageBlock.ts +0 -17
- package/src/import/converters/fields/nestable/RichText/index.ts +0 -23
- package/src/import/converters/fields/nestable/RichText/textBlock.ts +0 -62
- package/src/import/converters/fields/nestable/Select.ts +0 -14
- package/src/import/converters/fields/nestable/Text.ts +0 -14
- package/src/import/converters/fields/nestable/Timestamp.ts +0 -14
- package/src/import/converters/fields/nestable/index.ts +0 -13
- package/src/import/converters/index.ts +0 -2
- package/src/import/index.ts +0 -2
- package/src/import/validators/Document.ts +0 -103
- package/src/import/validators/fields/ImportContent.ts +0 -30
- package/src/import/validators/fields/ImportField.ts +0 -36
- package/src/import/validators/fields/ImportGroup.ts +0 -45
- package/src/import/validators/fields/ImportSlices/ImportSlices.ts +0 -56
- package/src/import/validators/fields/ImportSlices/SharedSlice/SharedSlice.ts +0 -104
- package/src/import/validators/fields/ImportSlices/SharedSlice/errors.ts +0 -6
- package/src/import/validators/fields/ImportSlices/SharedSlice/fields/OptionalSharedSliceId.ts +0 -20
- package/src/import/validators/fields/ImportSlices/SharedSlice/fields/SharedSliceId.ts +0 -65
- package/src/import/validators/fields/ImportSlices/SharedSlice/fields/SharedSliceType.ts +0 -45
- package/src/import/validators/fields/ImportSlices/SharedSlice/fields/SharedSliceVariation.ts +0 -45
- package/src/import/validators/fields/ImportSlices/SharedSlice/fields/index.ts +0 -4
- package/src/import/validators/fields/ImportSlices/SharedSlice/index.ts +0 -3
- package/src/import/validators/fields/ImportSlices/SharedSlice/utils.ts +0 -21
- package/src/import/validators/fields/ImportSlices/index.ts +0 -1
- package/src/import/validators/fields/ImportSlices/utils.ts +0 -43
- package/src/import/validators/fields/RepeatableZone.ts +0 -21
- package/src/import/validators/fields/RepeatableZoneItem.ts +0 -64
- package/src/import/validators/fields/UID.ts +0 -27
- package/src/import/validators/fields/index.ts +0 -4
- package/src/import/validators/fields/nestable/Boolean.ts +0 -7
- package/src/import/validators/fields/nestable/Color.ts +0 -28
- package/src/import/validators/fields/nestable/Date.ts +0 -34
- package/src/import/validators/fields/nestable/Embed.ts +0 -41
- package/src/import/validators/fields/nestable/GeoPoint.ts +0 -21
- package/src/import/validators/fields/nestable/Image/default.ts +0 -25
- package/src/import/validators/fields/nestable/Image/index.ts +0 -73
- package/src/import/validators/fields/nestable/Image/merge.ts +0 -64
- package/src/import/validators/fields/nestable/Image/model.ts +0 -18
- package/src/import/validators/fields/nestable/Image/validators.ts +0 -45
- package/src/import/validators/fields/nestable/ImportRichText/ImportBlock.ts +0 -39
- package/src/import/validators/fields/nestable/ImportRichText/ImportRichText.ts +0 -54
- package/src/import/validators/fields/nestable/ImportRichText/blocks/ImportBlockType.ts +0 -44
- package/src/import/validators/fields/nestable/ImportRichText/blocks/ImportEmbedBlock.ts +0 -13
- package/src/import/validators/fields/nestable/ImportRichText/blocks/ImportImageBlock.ts +0 -17
- package/src/import/validators/fields/nestable/ImportRichText/blocks/ImportTextBlock.ts +0 -56
- package/src/import/validators/fields/nestable/ImportRichText/blocks/Span.ts +0 -48
- package/src/import/validators/fields/nestable/ImportRichText/blocks/index.ts +0 -4
- package/src/import/validators/fields/nestable/ImportRichText/blocks/spans/HyperlinkSpan.ts +0 -24
- package/src/import/validators/fields/nestable/ImportRichText/blocks/spans/LabelSpan.ts +0 -19
- package/src/import/validators/fields/nestable/ImportRichText/blocks/spans/SpanLocation.ts +0 -8
- package/src/import/validators/fields/nestable/ImportRichText/blocks/spans/TextSpan.ts +0 -24
- package/src/import/validators/fields/nestable/ImportRichText/blocks/spans/index.ts +0 -2
- package/src/import/validators/fields/nestable/ImportRichText/index.ts +0 -2
- package/src/import/validators/fields/nestable/Link.ts +0 -59
- package/src/import/validators/fields/nestable/Nestable.ts +0 -88
- package/src/import/validators/fields/nestable/Number.ts +0 -38
- package/src/import/validators/fields/nestable/Select.ts +0 -38
- package/src/import/validators/fields/nestable/Text.ts +0 -7
- package/src/import/validators/fields/nestable/Timestamp.ts +0 -39
- package/src/import/validators/fields/nestable/index.ts +0 -14
- package/src/import/validators/index.ts +0 -2
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
import * as t from "io-ts";
|
|
2
|
-
declare const SpanType: t.UnionC<[t.LiteralC<"hyperlink">, t.KeyofC<{
|
|
3
|
-
strong: null;
|
|
4
|
-
em: null;
|
|
5
|
-
}>, t.LiteralC<"label">]>;
|
|
6
|
-
export declare type SpanType = t.TypeOf<typeof SpanType>;
|
|
7
|
-
declare const SpanShape: t.UnionC<[t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
8
|
-
type: t.LiteralC<"hyperlink">;
|
|
9
|
-
}>, t.TypeC<{
|
|
10
|
-
start: t.NumberC;
|
|
11
|
-
end: t.NumberC;
|
|
12
|
-
}>, t.TypeC<{
|
|
13
|
-
data: t.Type<({
|
|
14
|
-
link_type: "Web";
|
|
15
|
-
url: string;
|
|
16
|
-
} & {
|
|
17
|
-
target?: string;
|
|
18
|
-
}) | {
|
|
19
|
-
link_type: "Document";
|
|
20
|
-
id: string;
|
|
21
|
-
} | {
|
|
22
|
-
link_type: "Media";
|
|
23
|
-
id: string;
|
|
24
|
-
}, {
|
|
25
|
-
link_type: "Document" | "Web" | "Media";
|
|
26
|
-
}, unknown>;
|
|
27
|
-
}>]>>, t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
28
|
-
type: t.KeyofC<{
|
|
29
|
-
strong: null;
|
|
30
|
-
em: null;
|
|
31
|
-
}>;
|
|
32
|
-
}>, t.TypeC<{
|
|
33
|
-
start: t.NumberC;
|
|
34
|
-
end: t.NumberC;
|
|
35
|
-
}>]>>, t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
36
|
-
type: t.LiteralC<"label">;
|
|
37
|
-
data: t.ExactC<t.TypeC<{
|
|
38
|
-
label: t.StringC;
|
|
39
|
-
}>>;
|
|
40
|
-
}>, t.TypeC<{
|
|
41
|
-
start: t.NumberC;
|
|
42
|
-
end: t.NumberC;
|
|
43
|
-
}>]>>]>;
|
|
44
|
-
export declare type Span = t.TypeOf<typeof SpanShape>;
|
|
45
|
-
export declare const Span: t.Type<({
|
|
46
|
-
type: "hyperlink";
|
|
47
|
-
} & {
|
|
48
|
-
start: number;
|
|
49
|
-
end: number;
|
|
50
|
-
} & {
|
|
51
|
-
data: ({
|
|
52
|
-
link_type: "Web";
|
|
53
|
-
url: string;
|
|
54
|
-
} & {
|
|
55
|
-
target?: string;
|
|
56
|
-
}) | {
|
|
57
|
-
link_type: "Document";
|
|
58
|
-
id: string;
|
|
59
|
-
} | {
|
|
60
|
-
link_type: "Media";
|
|
61
|
-
id: string;
|
|
62
|
-
};
|
|
63
|
-
}) | ({
|
|
64
|
-
type: "strong" | "em";
|
|
65
|
-
} & {
|
|
66
|
-
start: number;
|
|
67
|
-
end: number;
|
|
68
|
-
}) | ({
|
|
69
|
-
type: "label";
|
|
70
|
-
data: {
|
|
71
|
-
label: string;
|
|
72
|
-
};
|
|
73
|
-
} & {
|
|
74
|
-
start: number;
|
|
75
|
-
end: number;
|
|
76
|
-
}), {
|
|
77
|
-
type: "label" | "strong" | "em" | "hyperlink";
|
|
78
|
-
}, unknown>;
|
|
79
|
-
export {};
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Span = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const t = (0, tslib_1.__importStar)(require("io-ts"));
|
|
6
|
-
const function_1 = require("../../../../../../validators/function");
|
|
7
|
-
const spans_1 = require("./spans");
|
|
8
|
-
const LabelSpan_1 = require("./spans/LabelSpan");
|
|
9
|
-
const SpanType = (0, function_1.withCustomError)(t.union([spans_1.HyperlinkSpanType, spans_1.TextSpanType, LabelSpan_1.LabelSpanType]), () => `Span 'type' field must be specified and have one of the following values: ${[
|
|
10
|
-
...Object.keys(spans_1.TextSpanType.keys),
|
|
11
|
-
LabelSpan_1.LabelSpanType.value,
|
|
12
|
-
].join(", ")} or ${spans_1.HyperlinkSpanType.value}`);
|
|
13
|
-
const SpanTypeValidator = (0, function_1.withCustomError)(t.type({
|
|
14
|
-
type: SpanType,
|
|
15
|
-
}), () => "Span must be an object");
|
|
16
|
-
const SpanShape = t.union([spans_1.HyperlinkSpan, spans_1.TextSpan, LabelSpan_1.LabelSpan]);
|
|
17
|
-
exports.Span = SpanTypeValidator.pipe(new t.Type("Span", (u) => SpanShape.is(u), (u, c) => {
|
|
18
|
-
if (spans_1.HyperlinkSpanType.is(u.type)) {
|
|
19
|
-
return spans_1.HyperlinkSpan.validate(u, c);
|
|
20
|
-
}
|
|
21
|
-
else if (LabelSpan_1.LabelSpanType.is(u.type)) {
|
|
22
|
-
return LabelSpan_1.LabelSpan.validate(u, c);
|
|
23
|
-
}
|
|
24
|
-
else {
|
|
25
|
-
return spans_1.TextSpan.validate(u, c);
|
|
26
|
-
}
|
|
27
|
-
}, t.identity));
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const tslib_1 = require("tslib");
|
|
4
|
-
(0, tslib_1.__exportStar)(require("./ImportBlockType"), exports);
|
|
5
|
-
(0, tslib_1.__exportStar)(require("./ImportEmbedBlock"), exports);
|
|
6
|
-
(0, tslib_1.__exportStar)(require("./ImportImageBlock"), exports);
|
|
7
|
-
(0, tslib_1.__exportStar)(require("./ImportTextBlock"), exports);
|
package/lib/import/validators/fields/nestable/ImportRichText/blocks/spans/HyperlinkSpan.d.ts
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import * as t from "io-ts";
|
|
2
|
-
export declare const HyperlinkSpanType: t.LiteralC<"hyperlink">;
|
|
3
|
-
export declare type HyperlinkSpanType = t.TypeOf<typeof HyperlinkSpanType>;
|
|
4
|
-
export declare const HyperlinkSpan: t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
5
|
-
type: t.LiteralC<"hyperlink">;
|
|
6
|
-
}>, t.TypeC<{
|
|
7
|
-
start: t.NumberC;
|
|
8
|
-
end: t.NumberC;
|
|
9
|
-
}>, t.TypeC<{
|
|
10
|
-
data: t.Type<({
|
|
11
|
-
link_type: "Web";
|
|
12
|
-
url: string;
|
|
13
|
-
} & {
|
|
14
|
-
target?: string;
|
|
15
|
-
}) | {
|
|
16
|
-
link_type: "Document";
|
|
17
|
-
id: string;
|
|
18
|
-
} | {
|
|
19
|
-
link_type: "Media";
|
|
20
|
-
id: string;
|
|
21
|
-
}, {
|
|
22
|
-
link_type: "Document" | "Web" | "Media";
|
|
23
|
-
}, unknown>;
|
|
24
|
-
}>]>>;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.HyperlinkSpan = exports.HyperlinkSpanType = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const t = (0, tslib_1.__importStar)(require("io-ts"));
|
|
6
|
-
const function_1 = require("../../../../../../../validators/function");
|
|
7
|
-
const Link_1 = require("../../../Link");
|
|
8
|
-
const SpanLocation_1 = require("./SpanLocation");
|
|
9
|
-
exports.HyperlinkSpanType = t.literal("hyperlink");
|
|
10
|
-
exports.HyperlinkSpan = t.exact(t.intersection([
|
|
11
|
-
t.type({
|
|
12
|
-
type: exports.HyperlinkSpanType,
|
|
13
|
-
}),
|
|
14
|
-
SpanLocation_1.SpanLocation,
|
|
15
|
-
(0, function_1.withCustomError)(t.type({
|
|
16
|
-
data: Link_1.Link,
|
|
17
|
-
}), () => "Hyperlink span must contain a 'data' field with link data"),
|
|
18
|
-
]));
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import * as t from "io-ts";
|
|
2
|
-
export declare const LabelSpanType: t.LiteralC<"label">;
|
|
3
|
-
export declare const LabelSpan: t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
4
|
-
type: t.LiteralC<"label">;
|
|
5
|
-
data: t.ExactC<t.TypeC<{
|
|
6
|
-
label: t.StringC;
|
|
7
|
-
}>>;
|
|
8
|
-
}>, t.TypeC<{
|
|
9
|
-
start: t.NumberC;
|
|
10
|
-
end: t.NumberC;
|
|
11
|
-
}>]>>;
|
|
12
|
-
export declare type LabelSpan = t.TypeOf<typeof LabelSpan>;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.LabelSpan = exports.LabelSpanType = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const t = (0, tslib_1.__importStar)(require("io-ts"));
|
|
6
|
-
const SpanLocation_1 = require("./SpanLocation");
|
|
7
|
-
exports.LabelSpanType = t.literal("label");
|
|
8
|
-
exports.LabelSpan = t.exact(t.intersection([
|
|
9
|
-
t.type({
|
|
10
|
-
type: exports.LabelSpanType,
|
|
11
|
-
data: t.strict({
|
|
12
|
-
label: t.string,
|
|
13
|
-
}),
|
|
14
|
-
}),
|
|
15
|
-
SpanLocation_1.SpanLocation,
|
|
16
|
-
]));
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SpanLocation = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const t = (0, tslib_1.__importStar)(require("io-ts"));
|
|
6
|
-
const validators_1 = require("../../../../../../../validators");
|
|
7
|
-
exports.SpanLocation = t.type({
|
|
8
|
-
start: validators_1.Number,
|
|
9
|
-
end: validators_1.Number,
|
|
10
|
-
});
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import * as t from "io-ts";
|
|
2
|
-
export declare const TextSpanType: t.KeyofC<{
|
|
3
|
-
strong: null;
|
|
4
|
-
em: null;
|
|
5
|
-
}>;
|
|
6
|
-
export declare const TextSpan: t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
7
|
-
type: t.KeyofC<{
|
|
8
|
-
strong: null;
|
|
9
|
-
em: null;
|
|
10
|
-
}>;
|
|
11
|
-
}>, t.TypeC<{
|
|
12
|
-
start: t.NumberC;
|
|
13
|
-
end: t.NumberC;
|
|
14
|
-
}>]>>;
|
|
15
|
-
export declare type TextSpan = t.TypeOf<typeof TextSpan>;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TextSpan = exports.TextSpanType = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const t = (0, tslib_1.__importStar)(require("io-ts"));
|
|
6
|
-
const SpanLocation_1 = require("./SpanLocation");
|
|
7
|
-
const TextSpanTypes = {
|
|
8
|
-
Strong: "strong",
|
|
9
|
-
Em: "em",
|
|
10
|
-
};
|
|
11
|
-
exports.TextSpanType = t.keyof({
|
|
12
|
-
[TextSpanTypes.Strong]: null,
|
|
13
|
-
[TextSpanTypes.Em]: null,
|
|
14
|
-
});
|
|
15
|
-
exports.TextSpan = t.exact(t.intersection([
|
|
16
|
-
t.type({
|
|
17
|
-
type: exports.TextSpanType,
|
|
18
|
-
}),
|
|
19
|
-
SpanLocation_1.SpanLocation,
|
|
20
|
-
]));
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ImportRichText = exports.ImportBlock = void 0;
|
|
4
|
-
var ImportBlock_1 = require("./ImportBlock");
|
|
5
|
-
Object.defineProperty(exports, "ImportBlock", { enumerable: true, get: function () { return ImportBlock_1.ImportBlock; } });
|
|
6
|
-
var ImportRichText_1 = require("./ImportRichText");
|
|
7
|
-
Object.defineProperty(exports, "ImportRichText", { enumerable: true, get: function () { return ImportRichText_1.ImportRichText; } });
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import type { TypeOf } from "io-ts";
|
|
2
|
-
import * as t from "io-ts";
|
|
3
|
-
declare const WebLink: t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
4
|
-
link_type: t.LiteralC<"Web">;
|
|
5
|
-
url: t.StringC;
|
|
6
|
-
}>, t.PartialC<{
|
|
7
|
-
target: t.StringC;
|
|
8
|
-
}>]>>;
|
|
9
|
-
export declare type WebLink = t.TypeOf<typeof WebLink>;
|
|
10
|
-
declare const DocumentLink: t.ExactC<t.TypeC<{
|
|
11
|
-
link_type: t.LiteralC<"Document">;
|
|
12
|
-
id: t.Type<string, string, unknown>;
|
|
13
|
-
}>>;
|
|
14
|
-
export declare type DocumentLink = t.TypeOf<typeof DocumentLink>;
|
|
15
|
-
declare const MediaLink: t.ExactC<t.TypeC<{
|
|
16
|
-
link_type: t.LiteralC<"Media">;
|
|
17
|
-
id: t.StringC;
|
|
18
|
-
}>>;
|
|
19
|
-
export declare type MediaLink = t.TypeOf<typeof MediaLink>;
|
|
20
|
-
export declare const Link: t.Type<({
|
|
21
|
-
link_type: "Web";
|
|
22
|
-
url: string;
|
|
23
|
-
} & {
|
|
24
|
-
target?: string;
|
|
25
|
-
}) | {
|
|
26
|
-
link_type: "Document";
|
|
27
|
-
id: string;
|
|
28
|
-
} | {
|
|
29
|
-
link_type: "Media";
|
|
30
|
-
id: string;
|
|
31
|
-
}, {
|
|
32
|
-
link_type: "Document" | "Web" | "Media";
|
|
33
|
-
}, unknown>;
|
|
34
|
-
export declare type Link = TypeOf<typeof Link>;
|
|
35
|
-
export declare const ImportLink: t.Type<{
|
|
36
|
-
type: "Link";
|
|
37
|
-
value: ({
|
|
38
|
-
link_type: "Web";
|
|
39
|
-
url: string;
|
|
40
|
-
} & {
|
|
41
|
-
target?: string;
|
|
42
|
-
}) | {
|
|
43
|
-
link_type: "Document";
|
|
44
|
-
id: string;
|
|
45
|
-
} | {
|
|
46
|
-
link_type: "Media";
|
|
47
|
-
id: string;
|
|
48
|
-
} | null;
|
|
49
|
-
}, {
|
|
50
|
-
link_type: "Document" | "Web" | "Media";
|
|
51
|
-
} | undefined, unknown>;
|
|
52
|
-
export declare type ImportLink = TypeOf<typeof ImportLink>;
|
|
53
|
-
export {};
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ImportLink = exports.Link = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const t = (0, tslib_1.__importStar)(require("io-ts"));
|
|
6
|
-
const DocumentId_1 = require("../../../../utils/DocumentId");
|
|
7
|
-
const validators_1 = require("../../../../validators");
|
|
8
|
-
const function_1 = require("../../../../validators/function");
|
|
9
|
-
const ImportContent_1 = require("../ImportContent");
|
|
10
|
-
const LinkTypeValidator = t.type({
|
|
11
|
-
link_type: (0, function_1.withCustomError)(t.union([t.literal("Web"), t.literal("Document"), t.literal("Media")]), () => "The value must be `Web`, `Document` or `Media`"),
|
|
12
|
-
});
|
|
13
|
-
const WebLink = t.exact(t.intersection([
|
|
14
|
-
t.type({
|
|
15
|
-
link_type: t.literal("Web"),
|
|
16
|
-
url: validators_1.String,
|
|
17
|
-
}),
|
|
18
|
-
t.partial({
|
|
19
|
-
target: validators_1.String,
|
|
20
|
-
}),
|
|
21
|
-
]));
|
|
22
|
-
const DocumentLink = t.strict({
|
|
23
|
-
link_type: t.literal("Document"),
|
|
24
|
-
id: DocumentId_1.DocumentId,
|
|
25
|
-
});
|
|
26
|
-
const MediaLink = t.strict({
|
|
27
|
-
link_type: t.literal("Media"),
|
|
28
|
-
id: validators_1.String,
|
|
29
|
-
});
|
|
30
|
-
exports.Link = LinkTypeValidator.pipe(t.union([WebLink, DocumentLink, MediaLink]));
|
|
31
|
-
// This is the default value for the link
|
|
32
|
-
const AnyLink = t.strict({
|
|
33
|
-
link_type: t.literal("Any"),
|
|
34
|
-
});
|
|
35
|
-
exports.ImportLink = (0, ImportContent_1.ImportContent)("Link", (0, validators_1.DefaultOrElse)(AnyLink)(exports.Link));
|
|
@@ -1,192 +0,0 @@
|
|
|
1
|
-
import type { NestableWidget } from "../../../../customtypes";
|
|
2
|
-
import { ImportBoolean } from "./Boolean";
|
|
3
|
-
import { ImportColor } from "./Color";
|
|
4
|
-
import { ImportDate } from "./Date";
|
|
5
|
-
import { ImportEmbed } from "./Embed";
|
|
6
|
-
import { ImportGeoPoint } from "./GeoPoint";
|
|
7
|
-
import { ImportImage } from "./Image";
|
|
8
|
-
import { ImportRichText } from "./ImportRichText";
|
|
9
|
-
import { ImportLink } from "./Link";
|
|
10
|
-
import { ImportNumber } from "./Number";
|
|
11
|
-
import { ImportSelect } from "./Select";
|
|
12
|
-
import { ImportText } from "./Text";
|
|
13
|
-
import { ImportTimestamp } from "./Timestamp";
|
|
14
|
-
export declare type ImportNestable = ImportBoolean | ImportColor | ImportNumber | ImportSelect | ImportText | ImportDate | ImportTimestamp | ImportEmbed | ImportLink | ImportGeoPoint | ImportImage | ImportRichText;
|
|
15
|
-
export declare const ImportNestable: {
|
|
16
|
-
is(u: unknown): u is ImportNestable;
|
|
17
|
-
decode: (field: NestableWidget) => (content: unknown) => {
|
|
18
|
-
codec: import("io-ts").Type<{
|
|
19
|
-
type: "Boolean";
|
|
20
|
-
value: boolean | null;
|
|
21
|
-
}, boolean | undefined, unknown> | import("io-ts").Type<{
|
|
22
|
-
type: "Color";
|
|
23
|
-
value: `#${string}` | null;
|
|
24
|
-
}, string | undefined, unknown> | import("io-ts").Type<{
|
|
25
|
-
type: "Date";
|
|
26
|
-
value: Date | null;
|
|
27
|
-
}, Date | undefined, unknown> | import("io-ts").Type<{
|
|
28
|
-
type: "Embed";
|
|
29
|
-
value: {
|
|
30
|
-
embed_url: string;
|
|
31
|
-
} | null;
|
|
32
|
-
}, {
|
|
33
|
-
embed_url: string;
|
|
34
|
-
} | undefined, unknown> | import("io-ts").Type<{
|
|
35
|
-
type: "GeoPoint";
|
|
36
|
-
value: {
|
|
37
|
-
latitude: number;
|
|
38
|
-
longitude: number;
|
|
39
|
-
} | null;
|
|
40
|
-
}, {
|
|
41
|
-
latitude: number;
|
|
42
|
-
longitude: number;
|
|
43
|
-
} | undefined, unknown> | import("io-ts").Type<{
|
|
44
|
-
type: "Image";
|
|
45
|
-
value: import("./Image").ImageFieldWithThumbnails | null;
|
|
46
|
-
}, import("./Image").ImageFieldWithThumbnails | undefined, unknown> | import("io-ts").Type<{
|
|
47
|
-
type: "Link";
|
|
48
|
-
value: ({
|
|
49
|
-
link_type: "Web";
|
|
50
|
-
url: string;
|
|
51
|
-
} & {
|
|
52
|
-
target?: string;
|
|
53
|
-
}) | {
|
|
54
|
-
link_type: "Document";
|
|
55
|
-
id: string;
|
|
56
|
-
} | {
|
|
57
|
-
link_type: "Media";
|
|
58
|
-
id: string;
|
|
59
|
-
} | null;
|
|
60
|
-
}, {
|
|
61
|
-
link_type: "Document" | "Web" | "Media";
|
|
62
|
-
} | undefined, unknown> | import("io-ts").Type<{
|
|
63
|
-
type: "StructuredText";
|
|
64
|
-
value: import("./ImportRichText").ImportBlock[] | null;
|
|
65
|
-
}, import("./ImportRichText").ImportBlock[] | undefined, unknown> | import("io-ts").Type<{
|
|
66
|
-
type: "Number";
|
|
67
|
-
value: number | null;
|
|
68
|
-
}, number | undefined, unknown> | import("io-ts").Type<{
|
|
69
|
-
type: "Select";
|
|
70
|
-
value: string | null;
|
|
71
|
-
}, string | undefined, unknown> | import("io-ts").Type<{
|
|
72
|
-
type: "Text";
|
|
73
|
-
value: string | null;
|
|
74
|
-
}, string | undefined, unknown> | import("io-ts").Type<{
|
|
75
|
-
type: "Timestamp";
|
|
76
|
-
value: Date | null;
|
|
77
|
-
}, Date | undefined, unknown>;
|
|
78
|
-
result: import("fp-ts/lib/Either").Left<import("io-ts").Errors> | import("fp-ts/lib/Either").Right<{
|
|
79
|
-
type: "Timestamp";
|
|
80
|
-
value: Date | null;
|
|
81
|
-
}> | import("fp-ts/lib/Either").Right<{
|
|
82
|
-
type: "Text";
|
|
83
|
-
value: string | null;
|
|
84
|
-
}> | import("fp-ts/lib/Either").Right<{
|
|
85
|
-
type: "Select";
|
|
86
|
-
value: string | null;
|
|
87
|
-
}> | import("fp-ts/lib/Either").Right<{
|
|
88
|
-
type: "Number";
|
|
89
|
-
value: number | null;
|
|
90
|
-
}> | import("fp-ts/lib/Either").Right<{
|
|
91
|
-
type: "StructuredText";
|
|
92
|
-
value: import("./ImportRichText").ImportBlock[] | null;
|
|
93
|
-
}> | import("fp-ts/lib/Either").Right<{
|
|
94
|
-
type: "Link";
|
|
95
|
-
value: ({
|
|
96
|
-
link_type: "Web";
|
|
97
|
-
url: string;
|
|
98
|
-
} & {
|
|
99
|
-
target?: string;
|
|
100
|
-
}) | {
|
|
101
|
-
link_type: "Document";
|
|
102
|
-
id: string;
|
|
103
|
-
} | {
|
|
104
|
-
link_type: "Media";
|
|
105
|
-
id: string;
|
|
106
|
-
} | null;
|
|
107
|
-
}> | import("fp-ts/lib/Either").Right<{
|
|
108
|
-
type: "Image";
|
|
109
|
-
value: import("./Image").ImageFieldWithThumbnails | null;
|
|
110
|
-
}> | import("fp-ts/lib/Either").Right<{
|
|
111
|
-
type: "GeoPoint";
|
|
112
|
-
value: {
|
|
113
|
-
latitude: number;
|
|
114
|
-
longitude: number;
|
|
115
|
-
} | null;
|
|
116
|
-
}> | import("fp-ts/lib/Either").Right<{
|
|
117
|
-
type: "Embed";
|
|
118
|
-
value: {
|
|
119
|
-
embed_url: string;
|
|
120
|
-
} | null;
|
|
121
|
-
}> | import("fp-ts/lib/Either").Right<{
|
|
122
|
-
type: "Date";
|
|
123
|
-
value: Date | null;
|
|
124
|
-
}> | import("fp-ts/lib/Either").Right<{
|
|
125
|
-
type: "Color";
|
|
126
|
-
value: `#${string}` | null;
|
|
127
|
-
}> | import("fp-ts/lib/Either").Right<{
|
|
128
|
-
type: "Boolean";
|
|
129
|
-
value: boolean | null;
|
|
130
|
-
}>;
|
|
131
|
-
};
|
|
132
|
-
getCodec: (field: NestableWidget) => import("io-ts").Type<{
|
|
133
|
-
type: "Boolean";
|
|
134
|
-
value: boolean | null;
|
|
135
|
-
}, boolean | undefined, unknown> | import("io-ts").Type<{
|
|
136
|
-
type: "Color";
|
|
137
|
-
value: `#${string}` | null;
|
|
138
|
-
}, string | undefined, unknown> | import("io-ts").Type<{
|
|
139
|
-
type: "Date";
|
|
140
|
-
value: Date | null;
|
|
141
|
-
}, Date | undefined, unknown> | import("io-ts").Type<{
|
|
142
|
-
type: "Embed";
|
|
143
|
-
value: {
|
|
144
|
-
embed_url: string;
|
|
145
|
-
} | null;
|
|
146
|
-
}, {
|
|
147
|
-
embed_url: string;
|
|
148
|
-
} | undefined, unknown> | import("io-ts").Type<{
|
|
149
|
-
type: "GeoPoint";
|
|
150
|
-
value: {
|
|
151
|
-
latitude: number;
|
|
152
|
-
longitude: number;
|
|
153
|
-
} | null;
|
|
154
|
-
}, {
|
|
155
|
-
latitude: number;
|
|
156
|
-
longitude: number;
|
|
157
|
-
} | undefined, unknown> | import("io-ts").Type<{
|
|
158
|
-
type: "Image";
|
|
159
|
-
value: import("./Image").ImageFieldWithThumbnails | null;
|
|
160
|
-
}, import("./Image").ImageFieldWithThumbnails | undefined, unknown> | import("io-ts").Type<{
|
|
161
|
-
type: "Link";
|
|
162
|
-
value: ({
|
|
163
|
-
link_type: "Web";
|
|
164
|
-
url: string;
|
|
165
|
-
} & {
|
|
166
|
-
target?: string;
|
|
167
|
-
}) | {
|
|
168
|
-
link_type: "Document";
|
|
169
|
-
id: string;
|
|
170
|
-
} | {
|
|
171
|
-
link_type: "Media";
|
|
172
|
-
id: string;
|
|
173
|
-
} | null;
|
|
174
|
-
}, {
|
|
175
|
-
link_type: "Document" | "Web" | "Media";
|
|
176
|
-
} | undefined, unknown> | import("io-ts").Type<{
|
|
177
|
-
type: "StructuredText";
|
|
178
|
-
value: import("./ImportRichText").ImportBlock[] | null;
|
|
179
|
-
}, import("./ImportRichText").ImportBlock[] | undefined, unknown> | import("io-ts").Type<{
|
|
180
|
-
type: "Number";
|
|
181
|
-
value: number | null;
|
|
182
|
-
}, number | undefined, unknown> | import("io-ts").Type<{
|
|
183
|
-
type: "Select";
|
|
184
|
-
value: string | null;
|
|
185
|
-
}, string | undefined, unknown> | import("io-ts").Type<{
|
|
186
|
-
type: "Text";
|
|
187
|
-
value: string | null;
|
|
188
|
-
}, string | undefined, unknown> | import("io-ts").Type<{
|
|
189
|
-
type: "Timestamp";
|
|
190
|
-
value: Date | null;
|
|
191
|
-
}, Date | undefined, unknown>;
|
|
192
|
-
};
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ImportNestable = void 0;
|
|
4
|
-
const Boolean_1 = require("./Boolean");
|
|
5
|
-
const Color_1 = require("./Color");
|
|
6
|
-
const Date_1 = require("./Date");
|
|
7
|
-
const Embed_1 = require("./Embed");
|
|
8
|
-
const GeoPoint_1 = require("./GeoPoint");
|
|
9
|
-
const Image_1 = require("./Image");
|
|
10
|
-
const ImportRichText_1 = require("./ImportRichText");
|
|
11
|
-
const Link_1 = require("./Link");
|
|
12
|
-
const Number_1 = require("./Number");
|
|
13
|
-
const Select_1 = require("./Select");
|
|
14
|
-
const Text_1 = require("./Text");
|
|
15
|
-
const Timestamp_1 = require("./Timestamp");
|
|
16
|
-
const getCodecOrThrow = (field) => {
|
|
17
|
-
switch (field.type) {
|
|
18
|
-
case "Boolean":
|
|
19
|
-
return Boolean_1.ImportBoolean;
|
|
20
|
-
case "Color":
|
|
21
|
-
return Color_1.ImportColor;
|
|
22
|
-
case "Number":
|
|
23
|
-
return (0, Number_1.ImportNumber)(field);
|
|
24
|
-
case "Select":
|
|
25
|
-
return (0, Select_1.ImportSelect)(field);
|
|
26
|
-
case "Text":
|
|
27
|
-
return Text_1.ImportText;
|
|
28
|
-
case "Date":
|
|
29
|
-
return Date_1.ImportDate;
|
|
30
|
-
case "Timestamp":
|
|
31
|
-
return Timestamp_1.ImportTimestamp;
|
|
32
|
-
case "Embed":
|
|
33
|
-
return Embed_1.ImportEmbed;
|
|
34
|
-
case "Link":
|
|
35
|
-
return Link_1.ImportLink;
|
|
36
|
-
case "Image":
|
|
37
|
-
return (0, Image_1.ImportImage)(field);
|
|
38
|
-
case "GeoPoint":
|
|
39
|
-
return GeoPoint_1.ImportGeoPoint;
|
|
40
|
-
case "StructuredText":
|
|
41
|
-
return (0, ImportRichText_1.ImportRichText)(field);
|
|
42
|
-
default:
|
|
43
|
-
throw new Error(`Unsupported type of nestable field ${field.type}`);
|
|
44
|
-
}
|
|
45
|
-
};
|
|
46
|
-
exports.ImportNestable = {
|
|
47
|
-
is(u) {
|
|
48
|
-
return (Boolean_1.ImportBoolean.is(u) ||
|
|
49
|
-
Color_1.ImportColor.is(u) ||
|
|
50
|
-
(0, Number_1.ImportNumber)().is(u) ||
|
|
51
|
-
(0, Select_1.ImportSelect)().is(u) ||
|
|
52
|
-
Text_1.ImportText.is(u) ||
|
|
53
|
-
Date_1.ImportDate.is(u) ||
|
|
54
|
-
Timestamp_1.ImportTimestamp.is(u) ||
|
|
55
|
-
Embed_1.ImportEmbed.is(u) ||
|
|
56
|
-
Link_1.ImportLink.is(u) ||
|
|
57
|
-
GeoPoint_1.ImportGeoPoint.is(u) ||
|
|
58
|
-
(0, Image_1.ImportImage)().is(u) ||
|
|
59
|
-
(0, ImportRichText_1.ImportRichText)().is(u));
|
|
60
|
-
},
|
|
61
|
-
decode: (field) => {
|
|
62
|
-
return (content) => {
|
|
63
|
-
const codec = getCodecOrThrow(field);
|
|
64
|
-
return {
|
|
65
|
-
codec,
|
|
66
|
-
result: codec.decode(content),
|
|
67
|
-
};
|
|
68
|
-
};
|
|
69
|
-
},
|
|
70
|
-
getCodec: getCodecOrThrow,
|
|
71
|
-
};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import * as t from "io-ts";
|
|
2
|
-
export declare const ImportNumber: (field?: ({
|
|
3
|
-
type: "Number";
|
|
4
|
-
} & {
|
|
5
|
-
fieldset?: string | null | undefined;
|
|
6
|
-
config?: {
|
|
7
|
-
label?: string | null | undefined;
|
|
8
|
-
placeholder?: string;
|
|
9
|
-
min?: number;
|
|
10
|
-
max?: number;
|
|
11
|
-
step?: number;
|
|
12
|
-
};
|
|
13
|
-
}) | undefined) => t.Type<{
|
|
14
|
-
type: "Number";
|
|
15
|
-
value: number | null;
|
|
16
|
-
}, number | undefined, unknown>;
|
|
17
|
-
export declare type ImportNumber = t.TypeOf<ReturnType<typeof ImportNumber>>;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ImportNumber = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const t = (0, tslib_1.__importStar)(require("io-ts"));
|
|
6
|
-
const validators_1 = require("../../../../validators");
|
|
7
|
-
const ImportContent_1 = require("../ImportContent");
|
|
8
|
-
const numberValue = (config) => validators_1.Number.pipe(new t.Type("ImportNumberValue", (u) => validators_1.Number.is(u), (n, c) => {
|
|
9
|
-
const min = config === null || config === void 0 ? void 0 : config.min;
|
|
10
|
-
const max = config === null || config === void 0 ? void 0 : config.max;
|
|
11
|
-
if ((min !== undefined && n < min) || (max !== undefined && n > max)) {
|
|
12
|
-
return t.failure(n, c, `The value must be between [${min !== undefined ? min : ""}, ${max !== undefined ? max : ""}]`);
|
|
13
|
-
}
|
|
14
|
-
return t.success(n);
|
|
15
|
-
}, t.identity));
|
|
16
|
-
const ImportNumber = (field) => (0, ImportContent_1.ImportContent)("Number", (0, validators_1.NullOrElse)(numberValue(field === null || field === void 0 ? void 0 : field.config)));
|
|
17
|
-
exports.ImportNumber = ImportNumber;
|