@prismicio/types-internal 0.1.1 → 0.2.3

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.
Files changed (292) hide show
  1. package/README.md +13 -13
  2. package/{dist → lib}/customtypes/CustomType.d.ts +697 -715
  3. package/{dist → lib}/customtypes/CustomType.js +42 -52
  4. package/{dist → lib}/customtypes/Format.d.ts +0 -0
  5. package/{dist → lib}/customtypes/Format.js +0 -0
  6. package/{dist → lib}/customtypes/Section.d.ts +1035 -1062
  7. package/lib/customtypes/Section.js +21 -0
  8. package/lib/customtypes/index.d.ts +4 -0
  9. package/lib/customtypes/index.js +9 -0
  10. package/{dist → lib}/customtypes/widgets/Group.d.ts +45 -45
  11. package/lib/customtypes/widgets/Group.js +24 -0
  12. package/{dist → lib}/customtypes/widgets/UID.d.ts +4 -4
  13. package/lib/customtypes/widgets/UID.js +21 -0
  14. package/{dist → lib}/customtypes/widgets/Widget.d.ts +1036 -1063
  15. package/lib/customtypes/widgets/Widget.js +27 -0
  16. package/{dist → lib}/customtypes/widgets/WidgetTypes.d.ts +0 -0
  17. package/{dist → lib}/customtypes/widgets/WidgetTypes.js +0 -0
  18. package/lib/customtypes/widgets/index.d.ts +7 -0
  19. package/lib/customtypes/widgets/index.js +14 -0
  20. package/{dist → lib}/customtypes/widgets/nestable/BooleanField.d.ts +3 -3
  21. package/lib/customtypes/widgets/nestable/BooleanField.js +21 -0
  22. package/{dist → lib}/customtypes/widgets/nestable/Color.d.ts +4 -4
  23. package/lib/customtypes/widgets/nestable/Color.js +20 -0
  24. package/{dist → lib}/customtypes/widgets/nestable/Date.d.ts +4 -4
  25. package/lib/customtypes/widgets/nestable/Date.js +21 -0
  26. package/{dist → lib}/customtypes/widgets/nestable/Embed.d.ts +4 -4
  27. package/lib/customtypes/widgets/nestable/Embed.js +21 -0
  28. package/{dist → lib}/customtypes/widgets/nestable/GeoPoint.d.ts +4 -4
  29. package/lib/customtypes/widgets/nestable/GeoPoint.js +19 -0
  30. package/lib/customtypes/widgets/nestable/Image.d.ts +23 -0
  31. package/lib/customtypes/widgets/nestable/Image.js +29 -0
  32. package/{dist → lib}/customtypes/widgets/nestable/IntegrationField.d.ts +4 -4
  33. package/lib/customtypes/widgets/nestable/IntegrationField.js +21 -0
  34. package/{dist → lib}/customtypes/widgets/nestable/Link.d.ts +4 -4
  35. package/lib/customtypes/widgets/nestable/Link.js +54 -0
  36. package/{dist → lib}/customtypes/widgets/nestable/NestableWidget.d.ts +42 -42
  37. package/lib/customtypes/widgets/nestable/NestableWidget.js +37 -0
  38. package/{dist → lib}/customtypes/widgets/nestable/Number.d.ts +4 -4
  39. package/lib/customtypes/widgets/nestable/Number.js +24 -0
  40. package/{dist → lib}/customtypes/widgets/nestable/Range.d.ts +4 -4
  41. package/lib/customtypes/widgets/nestable/Range.js +24 -0
  42. package/{dist → lib}/customtypes/widgets/nestable/RichText.d.ts +6 -6
  43. package/lib/customtypes/widgets/nestable/RichText.js +111 -0
  44. package/lib/customtypes/widgets/nestable/Select.d.ts +15 -0
  45. package/lib/customtypes/widgets/nestable/Select.js +22 -0
  46. package/{dist → lib}/customtypes/widgets/nestable/Separator.d.ts +3 -3
  47. package/lib/customtypes/widgets/nestable/Separator.js +18 -0
  48. package/{dist → lib}/customtypes/widgets/nestable/Text.d.ts +4 -4
  49. package/lib/customtypes/widgets/nestable/Text.js +21 -0
  50. package/{dist → lib}/customtypes/widgets/nestable/Timestamp.d.ts +4 -4
  51. package/lib/customtypes/widgets/nestable/Timestamp.js +21 -0
  52. package/lib/customtypes/widgets/nestable/index.d.ts +15 -0
  53. package/{dist → lib}/customtypes/widgets/nestable/index.js +0 -0
  54. package/{dist → lib}/customtypes/widgets/shared/ImageConstraint.d.ts +3 -3
  55. package/lib/customtypes/widgets/shared/ImageConstraint.js +31 -0
  56. package/lib/customtypes/widgets/shared/index.d.ts +1 -0
  57. package/{dist → lib}/customtypes/widgets/shared/index.js +0 -0
  58. package/{dist → lib}/customtypes/widgets/slices/CompositeSlice.d.ts +87 -87
  59. package/lib/customtypes/widgets/slices/CompositeSlice.js +25 -0
  60. package/{dist → lib}/customtypes/widgets/slices/LegacySlice.d.ts +86 -95
  61. package/lib/customtypes/widgets/slices/LegacySlice.js +8 -0
  62. package/{dist → lib}/customtypes/widgets/slices/SharedSlice.d.ts +84 -84
  63. package/lib/customtypes/widgets/slices/SharedSlice.js +35 -0
  64. package/{dist → lib}/customtypes/widgets/slices/SharedSliceRef.d.ts +2 -2
  65. package/lib/customtypes/widgets/slices/SharedSliceRef.js +9 -0
  66. package/lib/customtypes/widgets/slices/Slice.d.ts +6 -0
  67. package/{dist → lib}/customtypes/widgets/slices/Slice.js +0 -0
  68. package/{dist → lib}/customtypes/widgets/slices/Slices.d.ts +1550 -1604
  69. package/lib/customtypes/widgets/slices/Slices.js +93 -0
  70. package/{dist → lib}/customtypes/widgets/slices/SlicesTypes.d.ts +0 -0
  71. package/{dist → lib}/customtypes/widgets/slices/SlicesTypes.js +0 -0
  72. package/lib/customtypes/widgets/slices/index.d.ts +7 -0
  73. package/lib/customtypes/widgets/slices/index.js +16 -0
  74. package/lib/documents/DocumentData.d.ts +8 -0
  75. package/lib/documents/DocumentData.js +28 -0
  76. package/lib/documents/index.d.ts +2 -0
  77. package/lib/documents/index.js +7 -0
  78. package/lib/documents/widgets/EmptyContent.d.ts +8 -0
  79. package/lib/documents/widgets/EmptyContent.js +9 -0
  80. package/lib/documents/widgets/GroupContent.d.ts +16 -0
  81. package/lib/documents/widgets/GroupContent.js +59 -0
  82. package/lib/documents/widgets/SimpleWidgetContent.d.ts +20 -0
  83. package/lib/documents/widgets/SimpleWidgetContent.js +75 -0
  84. package/lib/documents/widgets/StaticWidgetContent.d.ts +10 -0
  85. package/lib/documents/widgets/StaticWidgetContent.js +26 -0
  86. package/lib/documents/widgets/UIDContent.d.ts +7 -0
  87. package/lib/documents/widgets/UIDContent.js +10 -0
  88. package/lib/documents/widgets/index.d.ts +35 -0
  89. package/lib/documents/widgets/index.js +36 -0
  90. package/lib/documents/widgets/nestable/BooleanContent.d.ts +8 -0
  91. package/lib/documents/widgets/nestable/BooleanContent.js +11 -0
  92. package/lib/documents/widgets/nestable/EmbedContent.d.ts +40 -0
  93. package/lib/documents/widgets/nestable/EmbedContent.js +36 -0
  94. package/lib/documents/widgets/nestable/FieldContent.d.ts +12 -0
  95. package/lib/documents/widgets/nestable/FieldContent.js +37 -0
  96. package/lib/documents/widgets/nestable/GeoPointContent.d.ts +17 -0
  97. package/lib/documents/widgets/nestable/GeoPointContent.js +13 -0
  98. package/lib/documents/widgets/nestable/ImageContent.d.ts +127 -0
  99. package/lib/documents/widgets/nestable/ImageContent.js +41 -0
  100. package/lib/documents/widgets/nestable/IntegrationFieldsContent.d.ts +8 -0
  101. package/lib/documents/widgets/nestable/IntegrationFieldsContent.js +16 -0
  102. package/lib/documents/widgets/nestable/Link/DocumentLink.d.ts +12 -0
  103. package/lib/documents/widgets/nestable/Link/DocumentLink.js +13 -0
  104. package/lib/documents/widgets/nestable/Link/ExternalLink.d.ts +24 -0
  105. package/lib/documents/widgets/nestable/Link/ExternalLink.js +24 -0
  106. package/lib/documents/widgets/nestable/Link/FileLink.d.ts +22 -0
  107. package/lib/documents/widgets/nestable/Link/FileLink.js +24 -0
  108. package/lib/documents/widgets/nestable/Link/ImageLink.d.ts +28 -0
  109. package/lib/documents/widgets/nestable/Link/ImageLink.js +26 -0
  110. package/lib/documents/widgets/nestable/Link/LinkContent.d.ts +36 -0
  111. package/lib/documents/widgets/nestable/Link/LinkContent.js +13 -0
  112. package/lib/documents/widgets/nestable/Link/index.d.ts +89 -0
  113. package/lib/documents/widgets/nestable/Link/index.js +35 -0
  114. package/lib/documents/widgets/nestable/SeparatorContent.d.ts +7 -0
  115. package/lib/documents/widgets/nestable/SeparatorContent.js +10 -0
  116. package/lib/documents/widgets/nestable/StructuredTextContent/Block.d.ts +274 -0
  117. package/lib/documents/widgets/nestable/StructuredTextContent/Block.js +97 -0
  118. package/lib/documents/widgets/nestable/StructuredTextContent/index.d.ts +9 -0
  119. package/lib/documents/widgets/nestable/StructuredTextContent/index.js +14 -0
  120. package/lib/documents/widgets/nestable/index.d.ts +26 -0
  121. package/lib/documents/widgets/nestable/index.js +40 -0
  122. package/lib/documents/widgets/slices/CompositeSliceContent.d.ts +14 -0
  123. package/lib/documents/widgets/slices/CompositeSliceContent.js +50 -0
  124. package/lib/documents/widgets/slices/SharedSliceContent.d.ts +15 -0
  125. package/lib/documents/widgets/slices/SharedSliceContent.js +62 -0
  126. package/lib/documents/widgets/slices/SimpleSliceContent.d.ts +6 -0
  127. package/lib/documents/widgets/slices/SimpleSliceContent.js +6 -0
  128. package/lib/documents/widgets/slices/SliceWidgetContent.d.ts +8 -0
  129. package/lib/documents/widgets/slices/SliceWidgetContent.js +26 -0
  130. package/lib/documents/widgets/slices/SlicesContent.d.ts +17 -0
  131. package/lib/documents/widgets/slices/SlicesContent.js +51 -0
  132. package/lib/documents/widgets/slices/index.d.ts +5 -0
  133. package/lib/documents/widgets/slices/index.js +8 -0
  134. package/lib/index.d.ts +3 -0
  135. package/lib/index.js +7 -0
  136. package/lib/validators/DateFromString.d.ts +3 -0
  137. package/lib/validators/DateFromString.js +10 -0
  138. package/lib/validators/DateFromStringOrNumber.d.ts +3 -0
  139. package/lib/validators/DateFromStringOrNumber.js +10 -0
  140. package/lib/validators/DateFromTsMs.d.ts +3 -0
  141. package/lib/validators/DateFromTsMs.js +10 -0
  142. package/lib/validators/IntFromNumber.d.ts +5 -0
  143. package/lib/validators/IntFromNumber.js +14 -0
  144. package/lib/validators/IntFromPixels.d.ts +8 -0
  145. package/lib/validators/IntFromPixels.js +24 -0
  146. package/lib/validators/NonEmptyString.d.ts +3 -0
  147. package/lib/validators/NonEmptyString.js +6 -0
  148. package/lib/validators/NonEmptyStringOrNull.d.ts +3 -0
  149. package/lib/validators/NonEmptyStringOrNull.js +15 -0
  150. package/lib/validators/NumberOrNull.d.ts +3 -0
  151. package/lib/validators/NumberOrNull.js +6 -0
  152. package/lib/validators/StringFromBoolean.d.ts +5 -0
  153. package/lib/validators/StringFromBoolean.js +10 -0
  154. package/lib/validators/StringFromNumber.d.ts +5 -0
  155. package/lib/validators/StringFromNumber.js +10 -0
  156. package/lib/validators/StringOrNull.d.ts +3 -0
  157. package/lib/validators/StringOrNull.js +6 -0
  158. package/lib/validators/function.d.ts +14 -0
  159. package/lib/validators/function.js +60 -0
  160. package/lib/validators/index.d.ts +12 -0
  161. package/lib/validators/index.js +27 -0
  162. package/package.json +30 -18
  163. package/src/customtypes/CustomType.ts +173 -116
  164. package/src/customtypes/Format.ts +3 -3
  165. package/src/customtypes/Section.ts +26 -13
  166. package/src/customtypes/index.ts +4 -4
  167. package/src/customtypes/widgets/Group.ts +21 -20
  168. package/src/customtypes/widgets/UID.ts +18 -17
  169. package/src/customtypes/widgets/Widget.ts +22 -23
  170. package/src/customtypes/widgets/WidgetTypes.ts +21 -21
  171. package/src/customtypes/widgets/index.ts +7 -7
  172. package/src/customtypes/widgets/nestable/BooleanField.ts +19 -19
  173. package/src/customtypes/widgets/nestable/Color.ts +17 -16
  174. package/src/customtypes/widgets/nestable/Date.ts +19 -18
  175. package/src/customtypes/widgets/nestable/Embed.ts +19 -18
  176. package/src/customtypes/widgets/nestable/GeoPoint.ts +17 -16
  177. package/src/customtypes/widgets/nestable/Image.ts +26 -26
  178. package/src/customtypes/widgets/nestable/IntegrationField.ts +18 -17
  179. package/src/customtypes/widgets/nestable/Link.ts +80 -68
  180. package/src/customtypes/widgets/nestable/NestableWidget.ts +32 -32
  181. package/src/customtypes/widgets/nestable/Number.ts +22 -21
  182. package/src/customtypes/widgets/nestable/Range.ts +22 -21
  183. package/src/customtypes/widgets/nestable/RichText.ts +164 -134
  184. package/src/customtypes/widgets/nestable/Select.ts +22 -21
  185. package/src/customtypes/widgets/nestable/Separator.ts +15 -14
  186. package/src/customtypes/widgets/nestable/Text.ts +18 -17
  187. package/src/customtypes/widgets/nestable/Timestamp.ts +19 -18
  188. package/src/customtypes/widgets/nestable/index.ts +15 -15
  189. package/src/customtypes/widgets/shared/ImageConstraint.ts +31 -29
  190. package/src/customtypes/widgets/shared/index.ts +1 -1
  191. package/src/customtypes/widgets/slices/CompositeSlice.ts +21 -21
  192. package/src/customtypes/widgets/slices/LegacySlice.ts +5 -10
  193. package/src/customtypes/widgets/slices/SharedSlice.ts +33 -31
  194. package/src/customtypes/widgets/slices/SharedSliceRef.ts +6 -6
  195. package/src/customtypes/widgets/slices/Slice.ts +4 -4
  196. package/src/customtypes/widgets/slices/Slices.ts +95 -73
  197. package/src/customtypes/widgets/slices/SlicesTypes.ts +3 -3
  198. package/src/customtypes/widgets/slices/index.ts +7 -7
  199. package/src/documents/DocumentData.ts +54 -0
  200. package/src/documents/index.ts +2 -0
  201. package/src/documents/widgets/EmptyContent.ts +8 -0
  202. package/src/documents/widgets/GroupContent.ts +91 -0
  203. package/src/documents/widgets/SimpleWidgetContent.ts +96 -0
  204. package/src/documents/widgets/StaticWidgetContent.ts +46 -0
  205. package/src/documents/widgets/UIDContent.ts +18 -0
  206. package/src/documents/widgets/index.ts +56 -0
  207. package/src/documents/widgets/nestable/BooleanContent.ts +21 -0
  208. package/src/documents/widgets/nestable/EmbedContent.ts +54 -0
  209. package/src/documents/widgets/nestable/FieldContent.ts +45 -0
  210. package/src/documents/widgets/nestable/GeoPointContent.ts +18 -0
  211. package/src/documents/widgets/nestable/ImageContent.ts +51 -0
  212. package/src/documents/widgets/nestable/IntegrationFieldsContent.ts +26 -0
  213. package/src/documents/widgets/nestable/Link/DocumentLink.ts +18 -0
  214. package/src/documents/widgets/nestable/Link/ExternalLink.ts +31 -0
  215. package/src/documents/widgets/nestable/Link/FileLink.ts +29 -0
  216. package/src/documents/widgets/nestable/Link/ImageLink.ts +31 -0
  217. package/src/documents/widgets/nestable/Link/LinkContent.ts +22 -0
  218. package/src/documents/widgets/nestable/Link/index.ts +33 -0
  219. package/src/documents/widgets/nestable/SeparatorContent.ts +8 -0
  220. package/src/documents/widgets/nestable/StructuredTextContent/Block.ts +122 -0
  221. package/src/documents/widgets/nestable/StructuredTextContent/index.ts +25 -0
  222. package/src/documents/widgets/nestable/index.ts +35 -0
  223. package/src/documents/widgets/slices/CompositeSliceContent.ts +77 -0
  224. package/src/documents/widgets/slices/SharedSliceContent.ts +94 -0
  225. package/src/documents/widgets/slices/SimpleSliceContent.ts +4 -0
  226. package/src/documents/widgets/slices/SliceWidgetContent.ts +51 -0
  227. package/src/documents/widgets/slices/SlicesContent.ts +91 -0
  228. package/src/documents/widgets/slices/index.ts +5 -0
  229. package/src/index.ts +3 -1
  230. package/src/validators/DateFromString.ts +17 -0
  231. package/src/validators/DateFromStringOrNumber.ts +17 -0
  232. package/src/validators/DateFromTsMs.ts +17 -0
  233. package/src/validators/IntFromNumber.ts +22 -24
  234. package/src/validators/IntFromPixels.ts +27 -26
  235. package/src/validators/NonEmptyString.ts +9 -0
  236. package/src/validators/NonEmptyStringOrNull.ts +22 -0
  237. package/src/validators/NumberOrNull.ts +5 -0
  238. package/src/validators/StringFromBoolean.ts +17 -19
  239. package/src/validators/StringFromNumber.ts +17 -19
  240. package/src/validators/StringOrNull.ts +4 -2
  241. package/src/validators/function.ts +71 -0
  242. package/src/validators/index.ts +12 -0
  243. package/dist/customtypes/Section.js +0 -40
  244. package/dist/customtypes/index.d.ts +0 -4
  245. package/dist/customtypes/index.js +0 -30
  246. package/dist/customtypes/widgets/Group.js +0 -45
  247. package/dist/customtypes/widgets/UID.js +0 -42
  248. package/dist/customtypes/widgets/Widget.js +0 -51
  249. package/dist/customtypes/widgets/index.d.ts +0 -7
  250. package/dist/customtypes/widgets/index.js +0 -35
  251. package/dist/customtypes/widgets/nestable/BooleanField.js +0 -42
  252. package/dist/customtypes/widgets/nestable/Color.js +0 -41
  253. package/dist/customtypes/widgets/nestable/Date.js +0 -42
  254. package/dist/customtypes/widgets/nestable/Embed.js +0 -42
  255. package/dist/customtypes/widgets/nestable/GeoPoint.js +0 -40
  256. package/dist/customtypes/widgets/nestable/Image.d.ts +0 -23
  257. package/dist/customtypes/widgets/nestable/Image.js +0 -50
  258. package/dist/customtypes/widgets/nestable/IntegrationField.js +0 -42
  259. package/dist/customtypes/widgets/nestable/Link.js +0 -78
  260. package/dist/customtypes/widgets/nestable/NestableWidget.js +0 -58
  261. package/dist/customtypes/widgets/nestable/Number.js +0 -45
  262. package/dist/customtypes/widgets/nestable/Range.js +0 -45
  263. package/dist/customtypes/widgets/nestable/RichText.js +0 -134
  264. package/dist/customtypes/widgets/nestable/Select.d.ts +0 -15
  265. package/dist/customtypes/widgets/nestable/Select.js +0 -45
  266. package/dist/customtypes/widgets/nestable/Separator.js +0 -39
  267. package/dist/customtypes/widgets/nestable/Text.js +0 -42
  268. package/dist/customtypes/widgets/nestable/Timestamp.js +0 -42
  269. package/dist/customtypes/widgets/nestable/index.d.ts +0 -15
  270. package/dist/customtypes/widgets/shared/ImageConstraint.js +0 -48
  271. package/dist/customtypes/widgets/shared/index.d.ts +0 -1
  272. package/dist/customtypes/widgets/slices/CompositeSlice.js +0 -46
  273. package/dist/customtypes/widgets/slices/LegacySlice.js +0 -34
  274. package/dist/customtypes/widgets/slices/SharedSlice.js +0 -56
  275. package/dist/customtypes/widgets/slices/SharedSliceRef.js +0 -30
  276. package/dist/customtypes/widgets/slices/Slice.d.ts +0 -6
  277. package/dist/customtypes/widgets/slices/Slices.js +0 -106
  278. package/dist/customtypes/widgets/slices/index.d.ts +0 -7
  279. package/dist/customtypes/widgets/slices/index.js +0 -37
  280. package/dist/index.d.ts +0 -1
  281. package/dist/index.js +0 -23
  282. package/dist/index.js.map +0 -1
  283. package/dist/validators/IntFromNumber.d.ts +0 -7
  284. package/dist/validators/IntFromNumber.js +0 -35
  285. package/dist/validators/IntFromPixels.d.ts +0 -7
  286. package/dist/validators/IntFromPixels.js +0 -43
  287. package/dist/validators/StringFromBoolean.d.ts +0 -7
  288. package/dist/validators/StringFromBoolean.js +0 -31
  289. package/dist/validators/StringFromNumber.d.ts +0 -7
  290. package/dist/validators/StringFromNumber.js +0 -31
  291. package/dist/validators/StringOrNull.d.ts +0 -2
  292. package/dist/validators/StringOrNull.js +0 -24
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FieldContentType = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const function_1 = require("fp-ts/function");
6
+ const O = (0, tslib_1.__importStar)(require("fp-ts/Option"));
7
+ const t = (0, tslib_1.__importStar)(require("io-ts"));
8
+ exports.FieldContentType = "FieldContent";
9
+ //we do that instead of idiomatic .trim()
10
+ //because we need to have the exact same behaviour than scala/java .trim()
11
+ //in other world only trim space and not non-breaking space or tab
12
+ function trimScalaStyle(s) {
13
+ let startAt = 0;
14
+ /* eslint-disable @typescript-eslint/no-non-null-assertion */
15
+ while (startAt < s.length && s[startAt] <= " ") {
16
+ startAt++;
17
+ }
18
+ let endAt = s.length;
19
+ /* eslint-disable @typescript-eslint/no-non-null-assertion */
20
+ while (startAt < endAt && s[endAt - 1] <= " ") {
21
+ endAt--;
22
+ }
23
+ return s.substring(startAt, endAt);
24
+ }
25
+ const FieldContent = {
26
+ types: ["Text", "Date", "Timestamp", "Color", "Number", "Range", "Select"],
27
+ forType: (type, value) => {
28
+ return (0, function_1.pipe)(O.fromEither(t.string.decode(value)), O.map((r) => {
29
+ return {
30
+ value: trimScalaStyle(r),
31
+ type,
32
+ __TYPE__: "FieldContent",
33
+ };
34
+ }));
35
+ },
36
+ };
37
+ exports.default = FieldContent;
@@ -0,0 +1,17 @@
1
+ import * as t from "io-ts";
2
+ export declare const GeoPointContentType = "GeoPointContent";
3
+ export declare const GeoPointContent: t.Type<{
4
+ position: {
5
+ lat: number;
6
+ lng: number;
7
+ };
8
+ }, {
9
+ position: {
10
+ lat: number;
11
+ lng: number;
12
+ };
13
+ } & {
14
+ __TYPE__: "GeoPointContent";
15
+ }, unknown>;
16
+ export declare type GeoPointContent = t.TypeOf<typeof GeoPointContent>;
17
+ export declare type GeoPointContentO = t.OutputOf<typeof GeoPointContent>;
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GeoPointContent = exports.GeoPointContentType = 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
+ exports.GeoPointContentType = "GeoPointContent";
8
+ exports.GeoPointContent = (0, function_1.addType)(t.strict({
9
+ position: t.strict({
10
+ lat: t.number,
11
+ lng: t.number,
12
+ }),
13
+ }), exports.GeoPointContentType);
@@ -0,0 +1,127 @@
1
+ import * as t from "io-ts";
2
+ export declare const ImageContentView: t.ExactC<t.IntersectionC<[t.TypeC<{
3
+ origin: t.ExactC<t.TypeC<{
4
+ id: t.StringC;
5
+ url: t.StringC;
6
+ width: t.NumberC;
7
+ height: t.NumberC;
8
+ }>>;
9
+ width: t.NumberC;
10
+ height: t.NumberC;
11
+ edit: t.TypeC<{
12
+ zoom: t.NumberC;
13
+ crop: t.TypeC<{
14
+ x: t.NumberC;
15
+ y: t.NumberC;
16
+ }>;
17
+ background: t.StringC;
18
+ }>;
19
+ }>, t.PartialC<{
20
+ url: t.StringC;
21
+ credits: t.Type<string | null, string | null, unknown>;
22
+ alt: t.Type<string | null, string | null, unknown>;
23
+ provider: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
24
+ }>]>>;
25
+ export declare type ImageContentView = t.TypeOf<typeof ImageContentView>;
26
+ export declare const ImageContentType = "ImageContent";
27
+ export declare const ImageContent: t.Type<{
28
+ origin: {
29
+ id: string;
30
+ url: string;
31
+ width: number;
32
+ height: number;
33
+ };
34
+ width: number;
35
+ height: number;
36
+ edit: {
37
+ zoom: number;
38
+ crop: {
39
+ x: number;
40
+ y: number;
41
+ };
42
+ background: string;
43
+ };
44
+ } & {
45
+ url?: string;
46
+ credits?: string | null;
47
+ alt?: string | null;
48
+ provider?: string | null | undefined;
49
+ } & {
50
+ thumbnails?: {
51
+ [x: string]: {
52
+ origin: {
53
+ id: string;
54
+ url: string;
55
+ width: number;
56
+ height: number;
57
+ };
58
+ width: number;
59
+ height: number;
60
+ edit: {
61
+ zoom: number;
62
+ crop: {
63
+ x: number;
64
+ y: number;
65
+ };
66
+ background: string;
67
+ };
68
+ } & {
69
+ url?: string;
70
+ credits?: string | null;
71
+ alt?: string | null;
72
+ provider?: string | null | undefined;
73
+ };
74
+ };
75
+ }, {
76
+ origin: {
77
+ id: string;
78
+ url: string;
79
+ width: number;
80
+ height: number;
81
+ };
82
+ width: number;
83
+ height: number;
84
+ edit: {
85
+ zoom: number;
86
+ crop: {
87
+ x: number;
88
+ y: number;
89
+ };
90
+ background: string;
91
+ };
92
+ } & {
93
+ url?: string;
94
+ credits?: string | null;
95
+ alt?: string | null;
96
+ provider?: string | null | undefined;
97
+ } & {
98
+ thumbnails?: {
99
+ [x: string]: {
100
+ origin: {
101
+ id: string;
102
+ url: string;
103
+ width: number;
104
+ height: number;
105
+ };
106
+ width: number;
107
+ height: number;
108
+ edit: {
109
+ zoom: number;
110
+ crop: {
111
+ x: number;
112
+ y: number;
113
+ };
114
+ background: string;
115
+ };
116
+ } & {
117
+ url?: string;
118
+ credits?: string | null;
119
+ alt?: string | null;
120
+ provider?: string | null | undefined;
121
+ };
122
+ };
123
+ } & {
124
+ __TYPE__: "ImageContent";
125
+ }, unknown>;
126
+ export declare type ImageContent = t.TypeOf<typeof ImageContent>;
127
+ export declare type ImageContentO = t.OutputOf<typeof ImageContent>;
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ImageContent = exports.ImageContentType = exports.ImageContentView = 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 function_1 = require("../../../validators/function");
8
+ const Origin = t.exact(t.type({
9
+ id: t.string,
10
+ url: t.string,
11
+ width: t.number,
12
+ height: t.number,
13
+ }));
14
+ exports.ImageContentView = t.exact(t.intersection([
15
+ t.type({
16
+ origin: Origin,
17
+ width: t.number,
18
+ height: t.number,
19
+ edit: t.type({
20
+ zoom: t.number,
21
+ crop: t.type({
22
+ x: t.number,
23
+ y: t.number,
24
+ }),
25
+ background: t.string,
26
+ }),
27
+ }),
28
+ t.partial({
29
+ url: t.string,
30
+ credits: validators_1.NonEmptyStringOrNull,
31
+ alt: validators_1.NonEmptyStringOrNull,
32
+ provider: validators_1.StringOrNull,
33
+ }),
34
+ ]));
35
+ exports.ImageContentType = "ImageContent";
36
+ exports.ImageContent = (0, function_1.addType)(t.intersection([
37
+ exports.ImageContentView,
38
+ t.partial({
39
+ thumbnails: t.record(t.string, exports.ImageContentView),
40
+ }),
41
+ ]), exports.ImageContentType);
@@ -0,0 +1,8 @@
1
+ import * as t from "io-ts";
2
+ declare type IntegrationFieldsContent = {
3
+ __TYPE__: "IntegrationFieldsContent";
4
+ value: string;
5
+ };
6
+ export declare const IntegrationFieldsContentType = "IntegrationFieldsContent";
7
+ declare const IntegrationFieldsContent: t.Type<IntegrationFieldsContent, IntegrationFieldsContent, unknown>;
8
+ export default IntegrationFieldsContent;
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.IntegrationFieldsContentType = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const Either_1 = require("fp-ts/Either");
6
+ const t = (0, tslib_1.__importStar)(require("io-ts"));
7
+ exports.IntegrationFieldsContentType = "IntegrationFieldsContent";
8
+ const IntegrationFieldsContent = new t.Type("IntegrationFieldsContent", (u) => u?.__TYPE__ === exports.IntegrationFieldsContentType, (u, c) => Either_1.Chain.chain(t.string.validate(u, c), (u) => {
9
+ return t.success({
10
+ value: u,
11
+ __TYPE__: exports.IntegrationFieldsContentType,
12
+ });
13
+ }), () => {
14
+ throw new Error("Not implemented - Not used - Not relevant");
15
+ });
16
+ exports.default = IntegrationFieldsContent;
@@ -0,0 +1,12 @@
1
+ import * as t from "io-ts";
2
+ export declare const DocumentLinkType = "DocumentLink";
3
+ export declare const DocumentLink: t.Type<{
4
+ id: string;
5
+ }, {
6
+ id: string;
7
+ } & {
8
+ __TYPE__: "DocumentLink";
9
+ }, unknown>;
10
+ export declare type DocumentLink = t.TypeOf<typeof DocumentLink>;
11
+ export declare type DocumentLinkO = t.OutputOf<typeof DocumentLink>;
12
+ export declare function isDocumentLink(u: unknown): u is DocumentLinkO;
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isDocumentLink = exports.DocumentLink = exports.DocumentLinkType = 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 function_1 = require("../../../../validators/function");
8
+ exports.DocumentLinkType = "DocumentLink";
9
+ exports.DocumentLink = (0, function_1.addType)(t.strict({ id: validators_1.NonEmptyString }), exports.DocumentLinkType);
10
+ function isDocumentLink(u) {
11
+ return u.__TYPE__ === exports.DocumentLinkType;
12
+ }
13
+ exports.isDocumentLink = isDocumentLink;
@@ -0,0 +1,24 @@
1
+ import * as t from "io-ts";
2
+ export declare const ExternalLinkType = "ExternalLink";
3
+ export declare const ExternalLink: t.Type<{
4
+ url: string;
5
+ } & {
6
+ kind?: "web";
7
+ target?: string | null | undefined;
8
+ preview?: {
9
+ title?: string;
10
+ } | null | undefined;
11
+ }, {
12
+ url: string;
13
+ } & {
14
+ kind?: "web";
15
+ target?: string | null | undefined;
16
+ preview?: {
17
+ title?: string;
18
+ } | null | undefined;
19
+ } & {
20
+ __TYPE__: "ExternalLink";
21
+ }, unknown>;
22
+ export declare type ExternalLink = t.TypeOf<typeof ExternalLink>;
23
+ export declare type ExternalLinkO = t.OutputOf<typeof ExternalLink>;
24
+ export declare function isExternalLink(u: unknown): u is ExternalLinkO;
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isExternalLink = exports.ExternalLink = exports.ExternalLinkType = 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 function_1 = require("../../../../validators/function");
8
+ exports.ExternalLinkType = "ExternalLink";
9
+ exports.ExternalLink = (0, function_1.addType)(t.exact(t.intersection([
10
+ t.type({
11
+ url: t.string,
12
+ }),
13
+ t.partial({
14
+ kind: t.literal("web"),
15
+ target: validators_1.StringOrNull,
16
+ preview: (0, function_1.nullable)(t.partial({
17
+ title: t.string,
18
+ })),
19
+ }),
20
+ ])), exports.ExternalLinkType);
21
+ function isExternalLink(u) {
22
+ return u.__TYPE__ === exports.ExternalLinkType;
23
+ }
24
+ exports.isExternalLink = isExternalLink;
@@ -0,0 +1,22 @@
1
+ import * as t from "io-ts";
2
+ export declare const FileLinkType = "FileLink";
3
+ export declare const FileLink: t.Type<{
4
+ id: string;
5
+ url: string;
6
+ name: string;
7
+ kind: string;
8
+ } & {
9
+ date?: string | null | undefined;
10
+ size?: string | null | undefined;
11
+ }, {
12
+ readonly size: string;
13
+ readonly __TYPE__: "FileLink";
14
+ readonly id: string;
15
+ readonly url: string;
16
+ readonly name: string;
17
+ readonly kind: string;
18
+ readonly date?: string | null | undefined;
19
+ }, unknown>;
20
+ export declare type FileLink = t.TypeOf<typeof FileLink>;
21
+ export declare type FileLinkO = t.OutputOf<typeof FileLink>;
22
+ export declare function isFileLink(u: unknown): u is FileLinkO;
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isFileLink = exports.FileLink = exports.FileLinkType = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const t = (0, tslib_1.__importStar)(require("io-ts"));
6
+ const mapOutput_1 = require("io-ts-types/lib/mapOutput");
7
+ const function_1 = require("../../../../validators/function");
8
+ exports.FileLinkType = "FileLink";
9
+ exports.FileLink = (0, mapOutput_1.mapOutput)(t.exact(t.intersection([
10
+ t.type({
11
+ id: t.string,
12
+ url: t.string,
13
+ name: t.string,
14
+ kind: t.string,
15
+ }),
16
+ t.partial({
17
+ date: (0, function_1.nullable)(t.string),
18
+ size: (0, function_1.nullable)(t.string),
19
+ }),
20
+ ])), (o) => ({ ...o, size: o.size || "0", __TYPE__: exports.FileLinkType }));
21
+ function isFileLink(u) {
22
+ return u.__TYPE__ === exports.FileLinkType;
23
+ }
24
+ exports.isFileLink = isFileLink;
@@ -0,0 +1,28 @@
1
+ import * as t from "io-ts";
2
+ export declare const ImageLinkType = "ImageLink";
3
+ export declare const ImageLink: t.Type<{
4
+ id: string;
5
+ url: string;
6
+ height: string;
7
+ width: string;
8
+ size: string;
9
+ name: string;
10
+ kind: string;
11
+ } & {
12
+ date?: string | null | undefined;
13
+ }, {
14
+ id: string;
15
+ url: string;
16
+ height: string;
17
+ width: string;
18
+ size: string;
19
+ name: string;
20
+ kind: string;
21
+ } & {
22
+ date?: string | null | undefined;
23
+ } & {
24
+ __TYPE__: "ImageLink";
25
+ }, unknown>;
26
+ export declare type ImageLink = t.TypeOf<typeof ImageLink>;
27
+ export declare type ImageLinkO = t.OutputOf<typeof ImageLink>;
28
+ export declare function isImageLink(u: unknown): u is ImageLinkO;
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isImageLink = exports.ImageLink = exports.ImageLinkType = 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 function_1 = require("../../../../validators/function");
8
+ exports.ImageLinkType = "ImageLink";
9
+ exports.ImageLink = (0, function_1.addType)(t.exact(t.intersection([
10
+ t.type({
11
+ id: t.string,
12
+ url: t.string,
13
+ height: t.string,
14
+ width: t.string,
15
+ size: t.string,
16
+ name: t.string,
17
+ kind: t.string,
18
+ }),
19
+ t.partial({
20
+ date: validators_1.StringOrNull,
21
+ }),
22
+ ])), exports.ImageLinkType);
23
+ function isImageLink(u) {
24
+ return u.__TYPE__ === exports.ImageLinkType;
25
+ }
26
+ exports.isImageLink = isImageLink;
@@ -0,0 +1,36 @@
1
+ import * as t from "io-ts";
2
+ import { Link } from "./index";
3
+ export declare type LinkContent = {
4
+ __TYPE__: "LinkContent";
5
+ value: Link;
6
+ };
7
+ export declare const LinkContentType = "LinkContent";
8
+ export declare const LinkContent: t.Type<LinkContent, {
9
+ id: string;
10
+ } | ({
11
+ url: string;
12
+ } & {
13
+ kind?: "web";
14
+ target?: string | null | undefined;
15
+ preview?: {
16
+ title?: string;
17
+ } | null | undefined;
18
+ }) | ({
19
+ id: string;
20
+ url: string;
21
+ name: string;
22
+ kind: string;
23
+ } & {
24
+ date?: string | null | undefined;
25
+ size?: string | null | undefined;
26
+ }) | ({
27
+ id: string;
28
+ url: string;
29
+ height: string;
30
+ width: string;
31
+ size: string;
32
+ name: string;
33
+ kind: string;
34
+ } & {
35
+ date?: string | null | undefined;
36
+ }), unknown>;
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.LinkContent = exports.LinkContentType = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const Either_1 = require("fp-ts/Either");
6
+ const t = (0, tslib_1.__importStar)(require("io-ts"));
7
+ const index_1 = require("./index");
8
+ exports.LinkContentType = "LinkContent";
9
+ exports.LinkContent = new t.Type("LinkContent", (u) => {
10
+ return index_1.Link.is(u?.value);
11
+ }, (u, c) => Either_1.Chain.chain(index_1.Link.validate(u, c), (u) => {
12
+ return t.success({ value: u, __TYPE__: exports.LinkContentType });
13
+ }), (linkContent) => index_1.Link.encode(linkContent.value));
@@ -0,0 +1,89 @@
1
+ import * as t from "io-ts";
2
+ import { isDocumentLink } from "./DocumentLink";
3
+ import { isExternalLink } from "./ExternalLink";
4
+ import { isFileLink } from "./FileLink";
5
+ import { isImageLink } from "./ImageLink";
6
+ export declare const Link: t.UnionC<[t.Type<{
7
+ id: string;
8
+ url: string;
9
+ height: string;
10
+ width: string;
11
+ size: string;
12
+ name: string;
13
+ kind: string;
14
+ } & {
15
+ date?: string | null | undefined;
16
+ }, {
17
+ id: string;
18
+ url: string;
19
+ height: string;
20
+ width: string;
21
+ size: string;
22
+ name: string;
23
+ kind: string;
24
+ } & {
25
+ date?: string | null | undefined;
26
+ } & {
27
+ __TYPE__: "ImageLink";
28
+ }, unknown>, t.Type<{
29
+ id: string;
30
+ url: string;
31
+ name: string;
32
+ kind: string;
33
+ } & {
34
+ date?: string | null | undefined;
35
+ size?: string | null | undefined;
36
+ }, {
37
+ readonly size: string;
38
+ readonly __TYPE__: "FileLink";
39
+ readonly id: string;
40
+ readonly url: string;
41
+ readonly name: string;
42
+ readonly kind: string;
43
+ readonly date?: string | null | undefined;
44
+ }, unknown>, t.Type<{
45
+ id: string;
46
+ }, {
47
+ id: string;
48
+ } & {
49
+ __TYPE__: "DocumentLink";
50
+ }, unknown>, t.Type<{
51
+ url: string;
52
+ } & {
53
+ kind?: "web";
54
+ target?: string | null | undefined;
55
+ preview?: {
56
+ title?: string;
57
+ } | null | undefined;
58
+ }, {
59
+ url: string;
60
+ } & {
61
+ kind?: "web";
62
+ target?: string | null | undefined;
63
+ preview?: {
64
+ title?: string;
65
+ } | null | undefined;
66
+ } & {
67
+ __TYPE__: "ExternalLink";
68
+ }, unknown>]>;
69
+ export declare type Link = t.TypeOf<typeof Link>;
70
+ export declare type LinkO = t.OutputOf<typeof Link>;
71
+ export { type DocumentLinkO, DocumentLink } from "./DocumentLink";
72
+ export { type ExternalLinkO, ExternalLink } from "./ExternalLink";
73
+ export { type FileLinkO, FileLink } from "./FileLink";
74
+ export { type ImageLinkO, ImageLink } from "./ImageLink";
75
+ export { LinkContent } from "./LinkContent";
76
+ export declare const BROKEN_CUSTOM_TYPE = "broken_type";
77
+ export declare const is: {
78
+ documentLink: typeof isDocumentLink;
79
+ fileLink: typeof isFileLink;
80
+ externalLink: typeof isExternalLink;
81
+ imageLink: typeof isImageLink;
82
+ };
83
+ export declare const LinksTypes: {
84
+ DocumentLink: string;
85
+ FileLink: string;
86
+ ExternalLink: string;
87
+ ImageLink: string;
88
+ LinkContent: string;
89
+ };
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.LinksTypes = exports.is = exports.BROKEN_CUSTOM_TYPE = exports.LinkContent = exports.ImageLink = exports.FileLink = exports.ExternalLink = exports.DocumentLink = exports.Link = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const t = (0, tslib_1.__importStar)(require("io-ts"));
6
+ const DocumentLink_1 = require("./DocumentLink");
7
+ const ExternalLink_1 = require("./ExternalLink");
8
+ const FileLink_1 = require("./FileLink");
9
+ const ImageLink_1 = require("./ImageLink");
10
+ const LinkContent_1 = require("./LinkContent");
11
+ exports.Link = t.union([ImageLink_1.ImageLink, FileLink_1.FileLink, DocumentLink_1.DocumentLink, ExternalLink_1.ExternalLink]);
12
+ var DocumentLink_2 = require("./DocumentLink");
13
+ Object.defineProperty(exports, "DocumentLink", { enumerable: true, get: function () { return DocumentLink_2.DocumentLink; } });
14
+ var ExternalLink_2 = require("./ExternalLink");
15
+ Object.defineProperty(exports, "ExternalLink", { enumerable: true, get: function () { return ExternalLink_2.ExternalLink; } });
16
+ var FileLink_2 = require("./FileLink");
17
+ Object.defineProperty(exports, "FileLink", { enumerable: true, get: function () { return FileLink_2.FileLink; } });
18
+ var ImageLink_2 = require("./ImageLink");
19
+ Object.defineProperty(exports, "ImageLink", { enumerable: true, get: function () { return ImageLink_2.ImageLink; } });
20
+ var LinkContent_2 = require("./LinkContent");
21
+ Object.defineProperty(exports, "LinkContent", { enumerable: true, get: function () { return LinkContent_2.LinkContent; } });
22
+ exports.BROKEN_CUSTOM_TYPE = "broken_type";
23
+ exports.is = {
24
+ documentLink: DocumentLink_1.isDocumentLink,
25
+ fileLink: FileLink_1.isFileLink,
26
+ externalLink: ExternalLink_1.isExternalLink,
27
+ imageLink: ImageLink_1.isImageLink,
28
+ };
29
+ exports.LinksTypes = {
30
+ DocumentLink: DocumentLink_1.DocumentLinkType,
31
+ FileLink: FileLink_1.FileLinkType,
32
+ ExternalLink: ExternalLink_1.ExternalLinkType,
33
+ ImageLink: ImageLink_1.ImageLinkType,
34
+ LinkContent: LinkContent_1.LinkContentType,
35
+ };
@@ -0,0 +1,7 @@
1
+ export declare const SeparatorContentType = "SeparatorContent";
2
+ export declare type SeparatorContent = {
3
+ __TYPE__: typeof SeparatorContentType;
4
+ };
5
+ export declare const SeparatorContent: {
6
+ is(value: unknown): value is SeparatorContent;
7
+ };
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SeparatorContent = exports.SeparatorContentType = void 0;
4
+ exports.SeparatorContentType = "SeparatorContent";
5
+ exports.SeparatorContent = {
6
+ is(value) {
7
+ const asFieldContent = value;
8
+ return asFieldContent.__TYPE__ === "SeparatorContent";
9
+ },
10
+ };