@upstart.gg/sdk 0.0.104 → 0.0.106

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 (254) hide show
  1. package/dist/shared/ajv.d.ts +2 -0
  2. package/dist/shared/ajv.d.ts.map +1 -1
  3. package/dist/shared/ajv.js +1 -1
  4. package/dist/shared/attributes.js +1 -1
  5. package/dist/shared/brick-manifest.js +1 -1
  6. package/dist/shared/bricks/manifests/accordion.manifest.js +1 -1
  7. package/dist/shared/bricks/manifests/all-manifests.js +1 -1
  8. package/dist/shared/bricks/manifests/button.manifest.js +1 -1
  9. package/dist/shared/bricks/manifests/card.manifest.js +1 -1
  10. package/dist/shared/bricks/manifests/carousel.manifest.js +1 -1
  11. package/dist/shared/bricks/manifests/container.manifest.js +1 -1
  12. package/dist/shared/bricks/manifests/divider.manifest.js +1 -1
  13. package/dist/shared/bricks/manifests/footer.manifest.d.ts +1 -1
  14. package/dist/shared/bricks/manifests/footer.manifest.d.ts.map +1 -1
  15. package/dist/shared/bricks/manifests/footer.manifest.js +1 -1
  16. package/dist/shared/bricks/manifests/form.manifest.js +1 -1
  17. package/dist/shared/bricks/manifests/hero.manifest.js +1 -1
  18. package/dist/shared/bricks/manifests/icon.manifest.js +1 -1
  19. package/dist/shared/bricks/manifests/image.manifest.js +1 -1
  20. package/dist/shared/bricks/manifests/images-gallery.manifest.js +1 -1
  21. package/dist/shared/bricks/manifests/map.manifest.js +1 -1
  22. package/dist/shared/bricks/manifests/navbar.manifest.js +1 -1
  23. package/dist/shared/bricks/manifests/sidebar.manifest.js +1 -1
  24. package/dist/shared/bricks/manifests/social-links.manifest.js +1 -1
  25. package/dist/shared/bricks/manifests/testimonials.manifest.js +1 -1
  26. package/dist/shared/bricks/manifests/text.manifest.js +1 -1
  27. package/dist/shared/bricks/manifests/timeline.manifest.js +1 -1
  28. package/dist/shared/bricks/manifests/video.manifest.js +1 -1
  29. package/dist/shared/bricks/props/border.d.ts.map +1 -1
  30. package/dist/shared/bricks/props/border.js +1 -1
  31. package/dist/shared/bricks/props/container.js +1 -1
  32. package/dist/shared/bricks/props/effects.js +1 -1
  33. package/dist/shared/bricks.d.ts.map +1 -1
  34. package/dist/shared/bricks.js +1 -1
  35. package/dist/shared/{chunk-TCZBR3ZU.js → chunk-2DI5SIVV.js} +1 -1
  36. package/dist/shared/{chunk-O22VV7YR.js → chunk-33FU4KGU.js} +1 -1
  37. package/dist/shared/{chunk-WCNVFVDK.js → chunk-3ZGRY444.js} +1 -1
  38. package/dist/shared/{chunk-CUCUHPQ7.js → chunk-6OKXZL6R.js} +1 -1
  39. package/dist/shared/chunk-7E67XSKP.js +3 -0
  40. package/dist/shared/{chunk-LJQXN32B.js → chunk-AMGHA7QH.js} +1 -1
  41. package/dist/shared/{chunk-QALNFBY7.js → chunk-DC5DWF7B.js} +1 -1
  42. package/dist/shared/{chunk-I43NIQ2K.js → chunk-DY2YCYZ6.js} +1 -1
  43. package/dist/shared/{chunk-CEXHD4BO.js → chunk-E4UAVLKC.js} +2 -2
  44. package/dist/shared/{chunk-ZFTWLZ3G.js → chunk-EHH677K5.js} +1 -1
  45. package/dist/shared/{chunk-POYVTV5F.js → chunk-FD3KX2U7.js} +1 -1
  46. package/dist/shared/chunk-G3JO5DM5.js +3 -0
  47. package/dist/shared/{chunk-I5S2MPPR.js → chunk-H7OYUKBW.js} +1 -1
  48. package/dist/shared/{chunk-ATVHWZSA.js → chunk-HBM4DPIW.js} +1 -1
  49. package/dist/shared/chunk-HIBTEX2T.js +3 -0
  50. package/dist/shared/{chunk-E2EBTWJI.js → chunk-I3HSLGFA.js} +1 -1
  51. package/dist/shared/{chunk-UISES3HA.js → chunk-IXJX7EQ3.js} +1 -1
  52. package/dist/shared/{chunk-5IEGQ7YT.js → chunk-JAAPJQNK.js} +1 -1
  53. package/dist/shared/{chunk-UK6H3FDX.js → chunk-JDBVMPSI.js} +1 -1
  54. package/dist/shared/{chunk-F6MLW6DO.js → chunk-JH3NRO6M.js} +1 -1
  55. package/dist/shared/{chunk-ZNVRYEO7.js → chunk-L3TKLJKK.js} +1 -1
  56. package/dist/shared/{chunk-TEPFFY32.js → chunk-LOFXGDAK.js} +1 -1
  57. package/dist/shared/chunk-O3FJP65T.js +3 -0
  58. package/dist/shared/{chunk-7L3UOEMR.js → chunk-PX7QSNLO.js} +1 -1
  59. package/dist/shared/{chunk-22KRCQK5.js → chunk-U76JDFWJ.js} +1 -1
  60. package/dist/shared/{chunk-CW5FWW5W.js → chunk-UYZP24VV.js} +1 -1
  61. package/dist/shared/chunk-X42WBJTN.js +3 -0
  62. package/dist/shared/{chunk-OQIFFJ7I.js → chunk-XB3X4P3I.js} +1 -1
  63. package/dist/shared/chunk-XDCGA4WT.js +3 -0
  64. package/dist/shared/chunk-YGHBFXR6.js +3 -0
  65. package/dist/shared/{chunk-WEQRYCPD.js → chunk-ZWYLKIBI.js} +1 -1
  66. package/dist/shared/datasources/external/rss/fetcher.d.ts +1 -1
  67. package/dist/shared/datasources/external/rss/fetcher.d.ts.map +1 -1
  68. package/dist/shared/images.js +1 -1
  69. package/dist/shared/page.js +1 -1
  70. package/dist/shared/responsive.js +1 -1
  71. package/dist/shared/site.js +1 -1
  72. package/dist/shared/sitemap.js +1 -1
  73. package/dist/shared/theme.js +1 -1
  74. package/dist/shared/utils/schema.d.ts +6 -8
  75. package/dist/shared/utils/schema.d.ts.map +1 -1
  76. package/dist/shared/utils/schema.js +1 -1
  77. package/package.json +5 -9
  78. package/dist/shared/chunk-F63ANNAK.js +0 -3
  79. package/dist/shared/chunk-GPKRRX3D.js +0 -3
  80. package/dist/shared/chunk-HQQYIKTE.js +0 -3
  81. package/dist/shared/chunk-JFDOR3UH.js +0 -3
  82. package/dist/shared/chunk-OD2PRCLH.js +0 -3
  83. package/dist/shared/chunk-PK6UAFPW.js +0 -3
  84. package/dist/shared/chunk-VDHLON5R.js +0 -3
  85. package/src/node/cli/api.ts +0 -101
  86. package/src/node/cli/commands/cmd-build.ts +0 -64
  87. package/src/node/cli/commands/login/cmd-login.ts +0 -111
  88. package/src/node/cli/commands/logout/cmd-logout.ts +0 -11
  89. package/src/node/cli/commands/publish/cmd-publish.ts +0 -135
  90. package/src/node/cli/commands/publish/parse-gitignore.ts +0 -278
  91. package/src/node/cli/commands/publish/uploader.ts +0 -333
  92. package/src/node/cli/constants.ts +0 -14
  93. package/src/node/cli/is-logged-in.ts +0 -28
  94. package/src/node/cli/program.ts +0 -77
  95. package/src/node/cli/store.ts +0 -64
  96. package/src/node/cli/tests/api.test.ts +0 -161
  97. package/src/node/cli/types.ts +0 -34
  98. package/src/node/cli/utils.ts +0 -20
  99. package/src/node/shared/config.ts +0 -69
  100. package/src/node/shared/logger.ts +0 -44
  101. package/src/shared/ajv.ts +0 -103
  102. package/src/shared/analytics/init.ts +0 -14
  103. package/src/shared/analytics/track.ts +0 -21
  104. package/src/shared/analytics/types.ts +0 -13
  105. package/src/shared/attributes.ts +0 -211
  106. package/src/shared/brick-manifest.ts +0 -110
  107. package/src/shared/bricks/manifests/accordion.manifest.ts +0 -179
  108. package/src/shared/bricks/manifests/all-manifests.ts +0 -92
  109. package/src/shared/bricks/manifests/button.manifest.ts +0 -145
  110. package/src/shared/bricks/manifests/card.manifest.ts +0 -269
  111. package/src/shared/bricks/manifests/carousel.manifest.ts +0 -106
  112. package/src/shared/bricks/manifests/container.manifest.ts +0 -357
  113. package/src/shared/bricks/manifests/divider.manifest.ts +0 -121
  114. package/src/shared/bricks/manifests/footer.manifest.ts +0 -487
  115. package/src/shared/bricks/manifests/form.manifest.ts +0 -112
  116. package/src/shared/bricks/manifests/hero.manifest.ts +0 -132
  117. package/src/shared/bricks/manifests/icon.manifest.ts +0 -130
  118. package/src/shared/bricks/manifests/image.manifest.ts +0 -203
  119. package/src/shared/bricks/manifests/images-gallery.manifest.ts +0 -227
  120. package/src/shared/bricks/manifests/map.manifest.ts +0 -75
  121. package/src/shared/bricks/manifests/navbar.manifest.ts +0 -344
  122. package/src/shared/bricks/manifests/sidebar.manifest.ts +0 -90
  123. package/src/shared/bricks/manifests/social-links.manifest.ts +0 -370
  124. package/src/shared/bricks/manifests/testimonials.manifest.ts +0 -397
  125. package/src/shared/bricks/manifests/tests/header.manifest.test.ts +0 -10
  126. package/src/shared/bricks/manifests/text.manifest.ts +0 -164
  127. package/src/shared/bricks/manifests/timeline.manifest.ts +0 -456
  128. package/src/shared/bricks/manifests/video.manifest.ts +0 -59
  129. package/src/shared/bricks/props/_style-presets.ts +0 -352
  130. package/src/shared/bricks/props/align.ts +0 -59
  131. package/src/shared/bricks/props/background.ts +0 -118
  132. package/src/shared/bricks/props/boolean.ts +0 -11
  133. package/src/shared/bricks/props/border.ts +0 -84
  134. package/src/shared/bricks/props/color.ts +0 -24
  135. package/src/shared/bricks/props/common.ts +0 -37
  136. package/src/shared/bricks/props/container.ts +0 -356
  137. package/src/shared/bricks/props/css-length.ts +0 -25
  138. package/src/shared/bricks/props/datasource.ts +0 -60
  139. package/src/shared/bricks/props/date.ts +0 -24
  140. package/src/shared/bricks/props/effects.ts +0 -123
  141. package/src/shared/bricks/props/enum.ts +0 -42
  142. package/src/shared/bricks/props/file.ts +0 -12
  143. package/src/shared/bricks/props/geolocation.ts +0 -30
  144. package/src/shared/bricks/props/helpers.ts +0 -101
  145. package/src/shared/bricks/props/image.ts +0 -90
  146. package/src/shared/bricks/props/number.ts +0 -16
  147. package/src/shared/bricks/props/padding.ts +0 -21
  148. package/src/shared/bricks/props/position.ts +0 -27
  149. package/src/shared/bricks/props/preset.ts +0 -136
  150. package/src/shared/bricks/props/string.ts +0 -56
  151. package/src/shared/bricks/props/tests/align.test.ts +0 -37
  152. package/src/shared/bricks/props/tests/background.test.ts +0 -102
  153. package/src/shared/bricks/props/tests/border.test.ts +0 -38
  154. package/src/shared/bricks/props/tests/effects.test.ts +0 -37
  155. package/src/shared/bricks/props/tests/helpers.test.ts +0 -133
  156. package/src/shared/bricks/props/tests/image.test.ts +0 -71
  157. package/src/shared/bricks/props/tests/padding.ts +0 -12
  158. package/src/shared/bricks/props/tests/string.test.ts +0 -79
  159. package/src/shared/bricks/props/text.ts +0 -66
  160. package/src/shared/bricks/props/types.ts +0 -57
  161. package/src/shared/bricks.ts +0 -232
  162. package/src/shared/context.ts +0 -39
  163. package/src/shared/datarecords/external/airtable/handler.ts +0 -21
  164. package/src/shared/datarecords/external/airtable/options.ts +0 -22
  165. package/src/shared/datarecords/external/generic-webhook/handler.ts +0 -10
  166. package/src/shared/datarecords/external/generic-webhook/options.ts +0 -13
  167. package/src/shared/datarecords/external/google/oauth/config.ts +0 -30
  168. package/src/shared/datarecords/external/google/sheets/handler.ts +0 -26
  169. package/src/shared/datarecords/external/google/sheets/options.ts +0 -9
  170. package/src/shared/datarecords/types.ts +0 -120
  171. package/src/shared/datarecords.ts +0 -5
  172. package/src/shared/datasources/README.md +0 -3
  173. package/src/shared/datasources/external/facebook/posts/fetcher.ts +0 -52
  174. package/src/shared/datasources/external/facebook/posts/sample.ts +0 -35
  175. package/src/shared/datasources/external/facebook/posts/schema.ts +0 -33
  176. package/src/shared/datasources/external/facebook/posts/tests/fetcher.test.ts +0 -73
  177. package/src/shared/datasources/external/http-json/fetcher.ts +0 -28
  178. package/src/shared/datasources/external/http-json/options.ts +0 -12
  179. package/src/shared/datasources/external/http-json/schema.ts +0 -6
  180. package/src/shared/datasources/external/http-json/tests/fetcher.test.ts +0 -70
  181. package/src/shared/datasources/external/instagram/feed/fetcher.ts +0 -33
  182. package/src/shared/datasources/external/instagram/feed/sample.ts +0 -22
  183. package/src/shared/datasources/external/instagram/feed/schema.ts +0 -23
  184. package/src/shared/datasources/external/instagram/feed/tests/fetcher.test.ts +0 -64
  185. package/src/shared/datasources/external/mastodon/account/fetcher.ts +0 -24
  186. package/src/shared/datasources/external/mastodon/account/sample.ts +0 -33
  187. package/src/shared/datasources/external/mastodon/account/schema.ts +0 -45
  188. package/src/shared/datasources/external/mastodon/account/tests/fetcher.test.ts +0 -47
  189. package/src/shared/datasources/external/mastodon/options.ts +0 -11
  190. package/src/shared/datasources/external/mastodon/status/fetcher.ts +0 -35
  191. package/src/shared/datasources/external/mastodon/status/sample.array.ts +0 -59
  192. package/src/shared/datasources/external/mastodon/status/sample.single.ts +0 -55
  193. package/src/shared/datasources/external/mastodon/status/schema.ts +0 -130
  194. package/src/shared/datasources/external/mastodon/status/tests/fetcher.test.ts +0 -74
  195. package/src/shared/datasources/external/meta/oauth/config.ts +0 -16
  196. package/src/shared/datasources/external/meta/options.ts +0 -11
  197. package/src/shared/datasources/external/rss/fetcher.ts +0 -29
  198. package/src/shared/datasources/external/rss/options.ts +0 -11
  199. package/src/shared/datasources/external/rss/sample.ts +0 -22
  200. package/src/shared/datasources/external/rss/schema.ts +0 -42
  201. package/src/shared/datasources/external/threads/media/fetcher.ts +0 -53
  202. package/src/shared/datasources/external/threads/media/sample.ts +0 -44
  203. package/src/shared/datasources/external/threads/media/schema.ts +0 -37
  204. package/src/shared/datasources/external/tiktok/oauth/config.ts +0 -17
  205. package/src/shared/datasources/external/tiktok/video/fetcher.ts +0 -39
  206. package/src/shared/datasources/external/tiktok/video/options.ts +0 -12
  207. package/src/shared/datasources/external/tiktok/video/sample.ts +0 -26
  208. package/src/shared/datasources/external/tiktok/video/schema.ts +0 -27
  209. package/src/shared/datasources/external/youtube/list/fetcher.ts +0 -37
  210. package/src/shared/datasources/external/youtube/list/options.ts +0 -15
  211. package/src/shared/datasources/external/youtube/list/sample.ts +0 -33
  212. package/src/shared/datasources/external/youtube/list/schema.ts +0 -38
  213. package/src/shared/datasources/external/youtube/oauth/config.ts +0 -15
  214. package/src/shared/datasources/fetcher.ts +0 -17
  215. package/src/shared/datasources/internal/blog/schema.ts +0 -69
  216. package/src/shared/datasources/internal/changelog/schema.ts +0 -48
  217. package/src/shared/datasources/internal/contact-info/schema.ts +0 -20
  218. package/src/shared/datasources/internal/cv/schema.ts +0 -217
  219. package/src/shared/datasources/internal/faq/schema.ts +0 -27
  220. package/src/shared/datasources/internal/job-board/schema.ts +0 -228
  221. package/src/shared/datasources/internal/links/schema.ts +0 -15
  222. package/src/shared/datasources/internal/recipes/schema.ts +0 -42
  223. package/src/shared/datasources/internal/restaurant/schema.ts +0 -225
  224. package/src/shared/datasources/provider-options.ts +0 -7
  225. package/src/shared/datasources/samples.ts +0 -26
  226. package/src/shared/datasources/schemas.ts +0 -45
  227. package/src/shared/datasources/types.ts +0 -276
  228. package/src/shared/datasources/utils.ts +0 -16
  229. package/src/shared/datasources.ts +0 -42
  230. package/src/shared/env.ts +0 -23
  231. package/src/shared/errors.ts +0 -1
  232. package/src/shared/images.ts +0 -44
  233. package/src/shared/index.ts +0 -3
  234. package/src/shared/layout-constants.ts +0 -25
  235. package/src/shared/manifest.ts +0 -50
  236. package/src/shared/oauth.ts +0 -16
  237. package/src/shared/page.ts +0 -61
  238. package/src/shared/prompt.ts +0 -9
  239. package/src/shared/responsive.ts +0 -5
  240. package/src/shared/site.ts +0 -97
  241. package/src/shared/sitemap.ts +0 -66
  242. package/src/shared/social-icons.ts +0 -307
  243. package/src/shared/tests/attributes.test.ts +0 -37
  244. package/src/shared/theme.ts +0 -245
  245. package/src/shared/themes/README.md +0 -34
  246. package/src/shared/themes/color-system.ts +0 -127
  247. package/src/shared/utils/canvas-data-uri.ts +0 -2
  248. package/src/shared/utils/invariant.ts +0 -25
  249. package/src/shared/utils/json-date.ts +0 -8
  250. package/src/shared/utils/merge.ts +0 -12
  251. package/src/shared/utils/object-hash.ts +0 -7
  252. package/src/shared/utils/schema.ts +0 -35
  253. package/src/shared/utils/try-catch.ts +0 -12
  254. package/src/shared/utils/typed-ref.ts +0 -41
@@ -1,225 +0,0 @@
1
- import { Type, type Static } from "@sinclair/typebox";
2
-
3
- export const restaurantSchema = Type.Object(
4
- {
5
- basicInfo: Type.Object({
6
- name: Type.String({
7
- title: "Restaurant Name",
8
- }),
9
- legalName: Type.Optional(
10
- Type.String({
11
- title: "Legal Business Name",
12
- }),
13
- ),
14
- taxId: Type.Optional(
15
- Type.String({
16
- title: "Tax ID/VAT Number",
17
- }),
18
- ),
19
- establishedDate: Type.String({
20
- title: "Establishment Date",
21
- format: "date",
22
- }),
23
- cuisine: Type.Array(
24
- Type.String({
25
- title: "Cuisine Type",
26
- description: "Types of cuisine served",
27
- }),
28
- ),
29
- }),
30
-
31
- contact: Type.Object({
32
- email: Type.String({
33
- title: "Email",
34
- pattern: "^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$",
35
- }),
36
- phone: Type.String({
37
- title: "Phone Number",
38
- pattern: "^\\+?[1-9]\\d{1,14}$",
39
- }),
40
- socialMedia: Type.Optional(
41
- Type.Object({
42
- facebook: Type.Optional(Type.String()),
43
- instagram: Type.Optional(Type.String()),
44
- twitter: Type.Optional(Type.String()),
45
- }),
46
- ),
47
- }),
48
-
49
- location: Type.Object({
50
- address: Type.String({
51
- title: "Street Address",
52
- }),
53
- city: Type.String({
54
- title: "City",
55
- }),
56
- state: Type.Optional(
57
- Type.String({
58
- title: "State/Province",
59
- }),
60
- ),
61
- postalCode: Type.String({
62
- title: "Postal Code",
63
- }),
64
- country: Type.String({
65
- title: "Country",
66
- }),
67
- coordinates: Type.Optional(
68
- Type.Object({
69
- latitude: Type.Number(),
70
- longitude: Type.Number(),
71
- }),
72
- ),
73
- }),
74
-
75
- hours: Type.Object({
76
- regularHours: Type.Array(
77
- Type.Object({
78
- day: Type.String({
79
- enum: ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"],
80
- }),
81
- open: Type.String({
82
- title: "Opening Time",
83
- pattern: "^([0-1]?[0-9]|2[0-3]):[0-5][0-9]$",
84
- }),
85
- close: Type.String({
86
- title: "Closing Time",
87
- pattern: "^([0-1]?[0-9]|2[0-3]):[0-5][0-9]$",
88
- }),
89
- closed: Type.Optional(
90
- Type.Boolean({
91
- title: "Closed on this day",
92
- default: false,
93
- }),
94
- ),
95
- }),
96
- ),
97
- specialHours: Type.Optional(
98
- Type.Array(
99
- Type.Object({
100
- date: Type.String({
101
- title: "Special Date",
102
- format: "date",
103
- }),
104
- description: Type.String({
105
- title: "Description",
106
- }),
107
- open: Type.Optional(Type.String()),
108
- close: Type.Optional(Type.String()),
109
- closed: Type.Boolean({
110
- default: false,
111
- }),
112
- }),
113
- ),
114
- ),
115
- }),
116
-
117
- menu: Type.Object({
118
- categories: Type.Array(
119
- Type.Object({
120
- name: Type.String({
121
- title: "Category Name",
122
- description: "E.g., Starters, Main Course, Desserts",
123
- }),
124
- description: Type.Optional(Type.String()),
125
- items: Type.Array(
126
- Type.Object({
127
- id: Type.String({
128
- title: "Item ID",
129
- }),
130
- name: Type.String({
131
- title: "Item Name",
132
- }),
133
- description: Type.String({
134
- title: "Item Description",
135
- }),
136
- price: Type.Number({
137
- title: "Price",
138
- minimum: 0,
139
- }),
140
- currency: Type.String({
141
- default: "USD",
142
- }),
143
- spicyLevel: Type.Optional(
144
- Type.Number({
145
- minimum: 0,
146
- maximum: 5,
147
- }),
148
- ),
149
- allergens: Type.Optional(
150
- Type.Array(
151
- Type.String({
152
- enum: ["Gluten", "Dairy", "Nuts", "Eggs", "Soy", "Shellfish", "Fish", "Other"],
153
- }),
154
- ),
155
- ),
156
- dietary: Type.Optional(
157
- Type.Array(
158
- Type.String({
159
- enum: ["Vegetarian", "Vegan", "Halal", "Kosher", "Gluten-Free", "Dairy-Free"],
160
- }),
161
- ),
162
- ),
163
- available: Type.Boolean({
164
- title: "Currently Available",
165
- default: true,
166
- }),
167
- image: Type.Optional(
168
- Type.String({
169
- title: "Image URL",
170
- pattern: "^https?://.*",
171
- }),
172
- ),
173
- customizations: Type.Optional(
174
- Type.Array(
175
- Type.Object({
176
- name: Type.String({
177
- title: "Customization Name",
178
- }),
179
- options: Type.Array(
180
- Type.Object({
181
- name: Type.String(),
182
- price: Type.Optional(Type.Number()),
183
- }),
184
- ),
185
- required: Type.Boolean({
186
- default: false,
187
- }),
188
- multiSelect: Type.Boolean({
189
- default: false,
190
- }),
191
- }),
192
- ),
193
- ),
194
- }),
195
- ),
196
- }),
197
- ),
198
- specials: Type.Optional(
199
- Type.Array(
200
- Type.Object({
201
- name: Type.String(),
202
- description: Type.String(),
203
- price: Type.Number(),
204
- startDate: Type.String({
205
- format: "date",
206
- }),
207
- endDate: Type.String({
208
- format: "date",
209
- }),
210
- daysAvailable: Type.Optional(
211
- Type.Array(
212
- Type.String({
213
- enum: ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"],
214
- }),
215
- ),
216
- ),
217
- }),
218
- ),
219
- ),
220
- }),
221
- },
222
- {
223
- description: "Schema representing a restaurant with its menu and details",
224
- },
225
- );
@@ -1,7 +0,0 @@
1
- import { Type, type Static } from "@sinclair/typebox";
2
-
3
- export const providerOptions = Type.Object({
4
- refreshInterval: Type.Optional(Type.Number()),
5
- });
6
-
7
- export type ProviderOptions = Static<typeof providerOptions>;
@@ -1,26 +0,0 @@
1
- import type { TSchema, Static } from "@sinclair/typebox";
2
- import { sample as rssSample } from "./external/rss/sample";
3
- import { sample as youtubeListSample } from "./external/youtube/list/sample";
4
- import type { DatasourceProvider } from "./types";
5
-
6
- export const samples: Record<
7
- Extract<
8
- DatasourceProvider,
9
- // | "facebook-posts"
10
- // | "instagram-feed"
11
- | "rss"
12
- // | "threads-media"
13
- // | "tiktok-video"
14
- | "youtube-list"
15
- // | "mastodon-status"
16
- >,
17
- Static<TSchema>
18
- > = {
19
- // "facebook-posts": facebookListSample,
20
- // "instagram-feed": instagramFeedSample,
21
- // "mastodon-status": mastodonStatusSample,
22
- rss: rssSample,
23
- // "threads-media": threadsMediaSample,
24
- // "tiktok-video": tiktokVideoSample,
25
- "youtube-list": youtubeListSample,
26
- } as const;
@@ -1,45 +0,0 @@
1
- import type { TArray, TObject } from "@sinclair/typebox";
2
- import type { DatasourceProvider } from "./types";
3
-
4
- import { facebookPostSchema } from "./external/facebook/posts/schema";
5
- import { instagramFeedSchema } from "./external/instagram/feed/schema";
6
- import { mastodonStatusArraySchema, mastodonStatusSchema } from "./external/mastodon/status/schema";
7
- import { mastodonAccountSchema } from "./external/mastodon/account/schema";
8
- import { rssSchema } from "./external/rss/schema";
9
- import { threadsMediaSchema } from "./external/threads/media/schema";
10
- import { tiktokVideoListSchema } from "./external/tiktok/video/schema";
11
- import { youtubeListSchema } from "./external/youtube/list/schema";
12
- import { jsonArraySchema, jsonObjectSchema } from "./external/http-json/schema";
13
-
14
- // internal
15
- import { blogSchema } from "./internal/blog/schema";
16
- import { changelogSchema } from "./internal/changelog/schema";
17
- import { contactInfoSchema } from "./internal/contact-info/schema";
18
- import { cvSchema } from "./internal/cv/schema";
19
- import { faqSchema } from "./internal/faq/schema";
20
- import { linksSchema } from "./internal/links/schema";
21
- import { recipesSchema } from "./internal/recipes/schema";
22
- import { restaurantSchema } from "./internal/restaurant/schema";
23
-
24
- export const schemasMap = {
25
- // "facebook-posts": facebookPostSchema,
26
- // "instagram-feed": instagramFeedSchema,
27
- // "mastodon-account": mastodonAccountSchema,
28
- // "mastodon-status": mastodonStatusSchema,
29
- // "mastodon-status-list": mastodonStatusArraySchema,
30
- rss: rssSchema,
31
- // "threads-media": threadsMediaSchema,
32
- // "tiktok-video": tiktokVideoListSchema,
33
- "youtube-list": youtubeListSchema,
34
- "internal-blog": blogSchema,
35
- "internal-changelog": changelogSchema,
36
- // "internal-contact-info": contactInfoSchema,
37
- "internal-faq": faqSchema,
38
- "internal-links": linksSchema,
39
- "internal-recipes": recipesSchema,
40
- // "internal-restaurant": restaurantSchema,
41
- // "internal-cv": cvSchema,
42
- "http-json": {
43
- description: "JSON array retrieved from an HTTP endpoint",
44
- },
45
- } as const satisfies Record<DatasourceProvider, TArray | TArray[] | { description: string }>;
@@ -1,276 +0,0 @@
1
- import { Type, type Static, type TObject, type TArray } from "@sinclair/typebox";
2
- import { youtubeListOptions } from "./external/youtube/list/options";
3
- import { metaOptions } from "./external/meta/options";
4
- import { mastodonCommonOptions } from "./external/mastodon/options";
5
- import { httpJsonOptions } from "./external/http-json/options";
6
- import { rssOptions } from "./external/rss/options";
7
- import { tiktokVideoOptions } from "./external/tiktok/video/options";
8
- import { jsonArraySchema, jsonObjectSchema } from "./external/http-json/schema";
9
- import { schemasMap } from "./schemas";
10
-
11
- export const providersSchema = Type.Union([
12
- // Type.Literal("facebook-posts"),
13
- // Type.Literal("instagram-feed"),
14
- // Type.Literal("mastodon-account"),
15
- // Type.Literal("mastodon-status"),
16
- // Type.Literal("mastodon-status-list"),
17
- Type.Literal("rss"),
18
- // Type.Literal("threads-media"),
19
- // Type.Literal("tiktok-video"),
20
- Type.Literal("youtube-list"),
21
- Type.Literal("http-json"),
22
- Type.Literal("internal-blog"),
23
- Type.Literal("internal-changelog"),
24
- // Type.Literal("internal-contact-info"),
25
- Type.Literal("internal-faq"),
26
- Type.Literal("internal-links"),
27
- Type.Literal("internal-recipes"),
28
- // Type.Literal("internal-restaurant"),
29
- // Type.Literal("internal-cv"),
30
- ]);
31
-
32
- export type DatasourceProvider = Static<typeof providersSchema>;
33
-
34
- const providersChoices = Type.Union([
35
- Type.Object({
36
- provider: Type.Literal("youtube-list"),
37
- options: youtubeListOptions,
38
- // schema: Type.Optional(schemasMap["youtube-list"]),
39
- }),
40
- // Type.Object({
41
- // provider: Type.Literal("facebook-posts"),
42
- // options: metaOptions,
43
- // schema: Type.Optional(schemasMap["facebook-posts"]),
44
- // }),
45
- // Type.Object({
46
- // provider: Type.Literal("instagram-feed"),
47
- // options: metaOptions,
48
- // schema: Type.Optional(schemasMap["instagram-feed"]),
49
- // }),
50
- // Type.Object({
51
- // provider: Type.Literal("threads-media"),
52
- // options: metaOptions,
53
- // schema: Type.Optional(schemasMap["threads-media"]),
54
- // }),
55
- // Type.Object({
56
- // provider: Type.Literal("mastodon-account"),
57
- // options: mastodonCommonOptions,
58
- // schema: Type.Optional(schemasMap["mastodon-account"]),
59
- // }),
60
- // Type.Object({
61
- // provider: Type.Literal("mastodon-status"),
62
- // options: mastodonCommonOptions,
63
- // schema: Type.Optional(schemasMap["mastodon-status"]),
64
- // }),
65
- // Type.Object({
66
- // provider: Type.Literal("mastodon-status-list"),
67
- // options: mastodonCommonOptions,
68
- // schema: Type.Optional(schemasMap["mastodon-status-list"]),
69
- // }),
70
- Type.Object({
71
- provider: Type.Literal("rss"),
72
- options: rssOptions,
73
- // schema: Type.Optional(schemasMap.rss),
74
- }),
75
- // Type.Object({
76
- // provider: Type.Literal("tiktok-video"),
77
- // options: tiktokVideoOptions,
78
- // schema: Type.Optional(schemasMap["tiktok-video"]),
79
- // }),
80
- Type.Object({
81
- provider: Type.Literal("internal-blog"),
82
- options: Type.Optional(Type.Object({}, { additionalProperties: true })),
83
- // schema: Type.Optional(schemasMap["internal-blog"]),
84
- }),
85
- Type.Object({
86
- provider: Type.Literal("internal-changelog"),
87
- options: Type.Optional(Type.Object({}, { additionalProperties: true })),
88
- // schema: Type.Optional(schemasMap["internal-changelog"]),
89
- }),
90
- // Type.Object({
91
- // provider: Type.Literal("internal-contact-info"),
92
- // options: Type.Optional(Type.Object({}, { additionalProperties: true })),
93
- // schema: Type.Optional(schemasMap["internal-contact-info"]),
94
- // }),
95
- Type.Object({
96
- provider: Type.Literal("internal-faq"),
97
- options: Type.Optional(Type.Object({}, { additionalProperties: true })),
98
- // schema: Type.Optional(schemasMap["internal-faq"]),
99
- }),
100
- Type.Object({
101
- provider: Type.Literal("internal-links"),
102
- options: Type.Optional(Type.Object({}, { additionalProperties: true })),
103
- // schema: Type.Optional(schemasMap["internal-links"]),
104
- }),
105
- Type.Object({
106
- provider: Type.Literal("internal-recipes"),
107
- options: Type.Optional(Type.Object({}, { additionalProperties: true })),
108
-
109
- // schema: Type.Optional(schemasMap["internal-recipes"]),
110
- }),
111
- // Type.Object({
112
- // provider: Type.Literal("internal-restaurant"),
113
- // options: Type.Optional(Type.Object({}, { additionalProperties: true })),
114
- // schema: Type.Optional(schemasMap["internal-restaurant"]),
115
- // }),
116
- // Type.Object({
117
- // provider: Type.Literal("internal-cv"),
118
- // options: Type.Optional(Type.Object({}, { additionalProperties: true })),
119
- // schema: Type.Optional(schemasMap["internal-cv"]),
120
- // }),
121
- ]);
122
-
123
- const datasourceProviderManifest = Type.Composite([
124
- providersChoices,
125
- Type.Object({
126
- id: Type.String({
127
- title: "ID",
128
- description:
129
- "Unique identifier of the datasource. Used to reference the datasource in the system. Use a url-safe string like a slug.",
130
- }),
131
- name: Type.String({ title: "Name of the datasource", comment: "For example, 'My data'" }),
132
- description: Type.Optional(Type.String({ title: "Description of the datasource" })),
133
- schema: Type.Null({
134
- description: "Always null for provider datasources. The schema is defined by the provider.",
135
- }),
136
- sampleData: Type.Optional(Type.Any()),
137
- ttlMinutes: Type.Optional(
138
- Type.Number({
139
- title: "Time to live",
140
- description:
141
- "Time to live in minutes. If set to -1, it never expires and has to be manually refreshed. If set to 0, the datasource is always fetched live. If > 0, then the datasource is feteched every N minutes.",
142
- }),
143
- ),
144
- refresh: Type.Optional(
145
- Type.Object(
146
- {
147
- method: Type.Union([Type.Literal("interval"), Type.Literal("manual"), Type.Literal("live")]),
148
- interval: Type.Optional(Type.Number()),
149
- },
150
- {
151
- title: "Refresh options",
152
- description: "Options to refresh the datasource",
153
- },
154
- ),
155
- ),
156
- }),
157
- ]);
158
-
159
- export type DatasourceProviderManifest = Static<typeof datasourceProviderManifest>;
160
-
161
- const datasourceCustomManifest = Type.Object(
162
- {
163
- id: Type.String({
164
- title: "ID",
165
- description:
166
- "Unique identifier of the datasource. Used to reference the datasource in the system. Use a url-safe string like a slug.",
167
- }),
168
- provider: Type.Literal("custom", {
169
- title: "Custom",
170
- description: "Custom datasource saved locally in Upstart.",
171
- }),
172
- options: Type.Optional(Type.Object({}, { additionalProperties: true })),
173
- schema: Type.Any({
174
- title: "Schema",
175
- description: "JSON Schema of datasource. Always an array of objects.",
176
- }),
177
- name: Type.String({ title: "Name of the datasource", comment: "For example, 'My data'" }),
178
- description: Type.Optional(Type.String({ title: "Description of the datasource" })),
179
- indexes: Type.Optional(
180
- Type.Array(
181
- Type.Object({
182
- name: Type.String({ title: "Index name" }),
183
- fields: Type.Array(Type.String(), { title: "Fields to index" }),
184
- unique: Type.Optional(Type.Boolean({ title: "Unique index", default: false })),
185
- }),
186
- {
187
- title: "Indexes",
188
- description:
189
- "IMPORTANT: Indexes to create on the datasource. use it to enforce uniqueness or improve query performance.",
190
- },
191
- ),
192
- ),
193
- sampleData: Type.Array(Type.Ref("datasource:custom"), {
194
- title: "Sample data",
195
- description: "Sample data (examples) for the datasource. Should match the declared schema.",
196
- }),
197
- },
198
- { $id: "datasource:custom" },
199
- );
200
-
201
- export type DatasourceCustomManifest = Static<typeof datasourceCustomManifest>;
202
-
203
- const datasourceJsonManifest = Type.Object({
204
- id: Type.String({
205
- title: "ID",
206
- description:
207
- "Unique identifier of the datasource. Used to reference the datasource in the system. Use a url-safe string like a slug.",
208
- }),
209
- provider: Type.Literal("http-json", {
210
- title: "JSON Array",
211
- description: "JSON array datasource.",
212
- }),
213
- options: httpJsonOptions,
214
- schema: Type.Any({
215
- title: "Schema",
216
- description: "JSON Schema of datasource. Always an array of objects.",
217
- examples: [
218
- {
219
- type: "array",
220
- items: {
221
- type: "object",
222
- properties: {
223
- id: { type: "string", title: "ID" },
224
- title: { type: "string", title: "Title" },
225
- firstname: { type: "string", title: "Firstname" },
226
- lastname: { type: "string", title: "Lastname" },
227
- createdAt: { type: "string", format: "date-time", title: "Created at" },
228
- email: { type: "string", format: "email", title: "Email" },
229
- },
230
- required: ["id", "title", "firstname", "lastname", "email", "createdAt"],
231
- title: "Employee",
232
- },
233
- title: "Employees",
234
- description: "Employees list",
235
- },
236
- ],
237
- }),
238
- name: Type.String({ title: "Name of the datasource", comment: "For example, 'My data'" }),
239
- description: Type.Optional(Type.String({ title: "Description of the datasource" })),
240
- sampleData: Type.Optional(
241
- Type.Any({
242
- title: "Sample data",
243
- description: "Sample data for the datasource. Should match the declared schema.",
244
- }),
245
- ),
246
- });
247
-
248
- export type DatasourceJsonArrayManifest = Static<typeof datasourceJsonManifest>;
249
-
250
- export const datasourceManifest = Type.Union([
251
- datasourceCustomManifest,
252
- datasourceJsonManifest,
253
- datasourceProviderManifest,
254
- ]);
255
-
256
- export const datasourcesMap = Type.Record(Type.String(), datasourceManifest, {
257
- title: "Datasources map",
258
- description: "The map of datasources available in the system",
259
- });
260
-
261
- export type DatasourcesMap = Record<
262
- string,
263
- | (Omit<Static<typeof datasourceCustomManifest>, "schema"> & {
264
- schema: (typeof datasourceCustomManifest)["schema"];
265
- })
266
- | (Omit<Static<typeof datasourceJsonManifest>, "schema"> & {
267
- schema: (typeof datasourceJsonManifest)["schema"];
268
- })
269
- | (Omit<Static<typeof datasourceProviderManifest>, "schema"> & {
270
- schema?: (typeof datasourceProviderManifest)["schema"];
271
- })
272
- >;
273
-
274
- export type DatasourcesResolved<T extends DatasourcesMap = DatasourcesMap> = {
275
- [K in keyof T]: unknown;
276
- };
@@ -1,16 +0,0 @@
1
- import { get } from "lodash-es";
2
-
3
- export function stringifyObjectValues(
4
- obj: Record<string, string | number | Date | boolean>,
5
- ): Record<string, string> {
6
- return Object.fromEntries(Object.entries(obj).map(([key, value]) => [key, value.toString()]));
7
- }
8
-
9
- export function createPlaceholderReplacer(attr: Record<string, unknown>) {
10
- return function replacePlaceholders(_: unknown, p1: string) {
11
- const varName = (p1 as string).trim();
12
- return String(get(attr, varName)) ?? "";
13
- };
14
- }
15
-
16
- export const placeholderRx = /{{(.+?)}}/g;
@@ -1,42 +0,0 @@
1
- import type { DatasourcesMap, DatasourceProvider } from "./datasources/types";
2
- import { schemasMap } from "./datasources/schemas";
3
- import { type TArray, Type } from "@sinclair/typebox";
4
-
5
- export function defineDataSources(datasources: DatasourcesMap) {
6
- const datasourcesMapped: DatasourcesMap = {};
7
- for (const [key, value] of Object.entries(datasources)) {
8
- datasourcesMapped[key] = {
9
- ...value,
10
- // @ts-ignore Seems like TS can't infer properly here
11
- schema: "schema" in value ? value.schema : getSchemaByProvider(value.provider),
12
- };
13
- }
14
- return datasourcesMapped;
15
- }
16
-
17
- function getSchemaByProvider(provider: DatasourceProvider) {
18
- return schemasMap[provider];
19
- }
20
-
21
- /**
22
- * Map a datasource schema to include $id, $createdAt, and $updatedAt properties.
23
- */
24
- export function mapDatasourceSchema(schema: TArray) {
25
- const { items, title, description } = schema;
26
- // Add $id, $createdAt, $updatedAt to the schema
27
- return {
28
- type: "array",
29
- items: {
30
- type: "object",
31
- properties: {
32
- $id: { type: "string", title: "ID" },
33
- $createdAt: { type: "string", format: "date-time", title: "Created At" },
34
- $updatedAt: { type: "string", format: "date-time", title: "Updated At" },
35
- ...items.properties,
36
- },
37
- required: ["$id", "$createdAt", "$updatedAt", ...items.required],
38
- },
39
- title,
40
- description,
41
- };
42
- }
package/src/shared/env.ts DELETED
@@ -1,23 +0,0 @@
1
- import type { D1Database, R2Bucket, KVNamespace } from "@cloudflare/workers-types";
2
-
3
- export type UpstartEnv = {
4
- PUBLIC_UPSTART_SITE_ID: string;
5
- PUBLIC_UPSTART_API_BASE_URL: string;
6
- PUBLIC_UPSTART_SITE_HOST: string;
7
- PUBLIC_UPSTART_ASSETS_BASE_URL?: string;
8
- UPSTART_API_TOKEN: string;
9
- SITES_DB: D1Database;
10
- SITES_CACHE: KVNamespace;
11
- R2_SITES_BUCKET: R2Bucket;
12
- R2_SITES_BUCKET_NAME: string;
13
- R2_ACCESS_KEY_ID: string;
14
- R2_SECRET_ACCESS_KEY: string;
15
- NODE_ENV: "development" | "production" | "preview" | "local-preview";
16
- DATASOURCE_REFRESH_DELAY_IN_MINUTE: string;
17
- FACEBOOK_APP_SECRET?: string;
18
- INSTAGRAM_APP_SECRET?: string;
19
- THREADS_APP_SECRET?: string;
20
- TIKTOK_CLIENT_KEY?: string;
21
- TIKTOK_CLIENT_SECRET?: string;
22
- YOUTUBE_API_KEY?: string;
23
- };
@@ -1 +0,0 @@
1
- export { UnauthorizedError } from "http-errors-enhanced";