@upstart.gg/sdk 0.0.104 → 0.0.105

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 (225) hide show
  1. package/dist/shared/ajv.js +1 -1
  2. package/dist/shared/attributes.js +1 -1
  3. package/dist/shared/bricks/manifests/accordion.manifest.js +1 -1
  4. package/dist/shared/bricks/manifests/all-manifests.js +1 -1
  5. package/dist/shared/bricks/manifests/button.manifest.js +1 -1
  6. package/dist/shared/bricks/manifests/card.manifest.js +1 -1
  7. package/dist/shared/bricks/manifests/carousel.manifest.js +1 -1
  8. package/dist/shared/bricks/manifests/container.manifest.js +1 -1
  9. package/dist/shared/bricks/manifests/divider.manifest.js +1 -1
  10. package/dist/shared/bricks/manifests/footer.manifest.js +1 -1
  11. package/dist/shared/bricks/manifests/form.manifest.js +1 -1
  12. package/dist/shared/bricks/manifests/hero.manifest.js +1 -1
  13. package/dist/shared/bricks/manifests/icon.manifest.js +1 -1
  14. package/dist/shared/bricks/manifests/image.manifest.js +1 -1
  15. package/dist/shared/bricks/manifests/images-gallery.manifest.js +1 -1
  16. package/dist/shared/bricks/manifests/map.manifest.js +1 -1
  17. package/dist/shared/bricks/manifests/navbar.manifest.js +1 -1
  18. package/dist/shared/bricks/manifests/sidebar.manifest.js +1 -1
  19. package/dist/shared/bricks/manifests/social-links.manifest.js +1 -1
  20. package/dist/shared/bricks/manifests/testimonials.manifest.js +1 -1
  21. package/dist/shared/bricks/manifests/text.manifest.js +1 -1
  22. package/dist/shared/bricks/manifests/timeline.manifest.js +1 -1
  23. package/dist/shared/bricks/manifests/video.manifest.js +1 -1
  24. package/dist/shared/bricks.js +1 -1
  25. package/dist/shared/chunk-245ZLDVB.js +3 -0
  26. package/dist/shared/{chunk-QALNFBY7.js → chunk-2D6ZEIDX.js} +1 -1
  27. package/dist/shared/{chunk-CW5FWW5W.js → chunk-4BLCQRF5.js} +1 -1
  28. package/dist/shared/{chunk-TEPFFY32.js → chunk-5MGYT6FI.js} +1 -1
  29. package/dist/shared/{chunk-HQQYIKTE.js → chunk-CS5N4UQU.js} +1 -1
  30. package/dist/shared/{chunk-5IEGQ7YT.js → chunk-FRWB3BF3.js} +1 -1
  31. package/dist/shared/{chunk-I5S2MPPR.js → chunk-HYXCHFS5.js} +1 -1
  32. package/dist/shared/{chunk-TCZBR3ZU.js → chunk-IKSRCRZZ.js} +1 -1
  33. package/dist/shared/{chunk-LJQXN32B.js → chunk-ISF6EBPX.js} +1 -1
  34. package/dist/shared/{chunk-UK6H3FDX.js → chunk-JDBVMPSI.js} +1 -1
  35. package/dist/shared/{chunk-UISES3HA.js → chunk-M3Z3XDUC.js} +1 -1
  36. package/dist/shared/{chunk-22KRCQK5.js → chunk-MWP5IU33.js} +1 -1
  37. package/dist/shared/{chunk-7L3UOEMR.js → chunk-NCSLTHKN.js} +1 -1
  38. package/dist/shared/{chunk-O22VV7YR.js → chunk-OWON727Q.js} +1 -1
  39. package/dist/shared/{chunk-CEXHD4BO.js → chunk-P5RC56CL.js} +2 -2
  40. package/dist/shared/{chunk-ZFTWLZ3G.js → chunk-QI3BZDXL.js} +1 -1
  41. package/dist/shared/{chunk-F6MLW6DO.js → chunk-RDSK2G6V.js} +1 -1
  42. package/dist/shared/{chunk-I43NIQ2K.js → chunk-RXRPFXDF.js} +1 -1
  43. package/dist/shared/{chunk-POYVTV5F.js → chunk-VFGMOA4M.js} +1 -1
  44. package/dist/shared/{chunk-VDHLON5R.js → chunk-VPD626ML.js} +1 -1
  45. package/dist/shared/{chunk-WCNVFVDK.js → chunk-VROOAFFW.js} +1 -1
  46. package/dist/shared/{chunk-E2EBTWJI.js → chunk-WB4PGCZQ.js} +1 -1
  47. package/dist/shared/chunk-X2RJL33B.js +3 -0
  48. package/dist/shared/{chunk-OQIFFJ7I.js → chunk-X4ZBUWUL.js} +1 -1
  49. package/dist/shared/datasources/external/rss/fetcher.d.ts +1 -1
  50. package/dist/shared/datasources/external/rss/fetcher.d.ts.map +1 -1
  51. package/dist/shared/page.js +1 -1
  52. package/dist/shared/site.js +1 -1
  53. package/package.json +5 -9
  54. package/dist/shared/chunk-GPKRRX3D.js +0 -3
  55. package/dist/shared/chunk-JFDOR3UH.js +0 -3
  56. package/src/node/cli/api.ts +0 -101
  57. package/src/node/cli/commands/cmd-build.ts +0 -64
  58. package/src/node/cli/commands/login/cmd-login.ts +0 -111
  59. package/src/node/cli/commands/logout/cmd-logout.ts +0 -11
  60. package/src/node/cli/commands/publish/cmd-publish.ts +0 -135
  61. package/src/node/cli/commands/publish/parse-gitignore.ts +0 -278
  62. package/src/node/cli/commands/publish/uploader.ts +0 -333
  63. package/src/node/cli/constants.ts +0 -14
  64. package/src/node/cli/is-logged-in.ts +0 -28
  65. package/src/node/cli/program.ts +0 -77
  66. package/src/node/cli/store.ts +0 -64
  67. package/src/node/cli/tests/api.test.ts +0 -161
  68. package/src/node/cli/types.ts +0 -34
  69. package/src/node/cli/utils.ts +0 -20
  70. package/src/node/shared/config.ts +0 -69
  71. package/src/node/shared/logger.ts +0 -44
  72. package/src/shared/ajv.ts +0 -103
  73. package/src/shared/analytics/init.ts +0 -14
  74. package/src/shared/analytics/track.ts +0 -21
  75. package/src/shared/analytics/types.ts +0 -13
  76. package/src/shared/attributes.ts +0 -211
  77. package/src/shared/brick-manifest.ts +0 -110
  78. package/src/shared/bricks/manifests/accordion.manifest.ts +0 -179
  79. package/src/shared/bricks/manifests/all-manifests.ts +0 -92
  80. package/src/shared/bricks/manifests/button.manifest.ts +0 -145
  81. package/src/shared/bricks/manifests/card.manifest.ts +0 -269
  82. package/src/shared/bricks/manifests/carousel.manifest.ts +0 -106
  83. package/src/shared/bricks/manifests/container.manifest.ts +0 -357
  84. package/src/shared/bricks/manifests/divider.manifest.ts +0 -121
  85. package/src/shared/bricks/manifests/footer.manifest.ts +0 -487
  86. package/src/shared/bricks/manifests/form.manifest.ts +0 -112
  87. package/src/shared/bricks/manifests/hero.manifest.ts +0 -132
  88. package/src/shared/bricks/manifests/icon.manifest.ts +0 -130
  89. package/src/shared/bricks/manifests/image.manifest.ts +0 -203
  90. package/src/shared/bricks/manifests/images-gallery.manifest.ts +0 -227
  91. package/src/shared/bricks/manifests/map.manifest.ts +0 -75
  92. package/src/shared/bricks/manifests/navbar.manifest.ts +0 -344
  93. package/src/shared/bricks/manifests/sidebar.manifest.ts +0 -90
  94. package/src/shared/bricks/manifests/social-links.manifest.ts +0 -370
  95. package/src/shared/bricks/manifests/testimonials.manifest.ts +0 -397
  96. package/src/shared/bricks/manifests/tests/header.manifest.test.ts +0 -10
  97. package/src/shared/bricks/manifests/text.manifest.ts +0 -164
  98. package/src/shared/bricks/manifests/timeline.manifest.ts +0 -456
  99. package/src/shared/bricks/manifests/video.manifest.ts +0 -59
  100. package/src/shared/bricks/props/_style-presets.ts +0 -352
  101. package/src/shared/bricks/props/align.ts +0 -59
  102. package/src/shared/bricks/props/background.ts +0 -118
  103. package/src/shared/bricks/props/boolean.ts +0 -11
  104. package/src/shared/bricks/props/border.ts +0 -84
  105. package/src/shared/bricks/props/color.ts +0 -24
  106. package/src/shared/bricks/props/common.ts +0 -37
  107. package/src/shared/bricks/props/container.ts +0 -356
  108. package/src/shared/bricks/props/css-length.ts +0 -25
  109. package/src/shared/bricks/props/datasource.ts +0 -60
  110. package/src/shared/bricks/props/date.ts +0 -24
  111. package/src/shared/bricks/props/effects.ts +0 -123
  112. package/src/shared/bricks/props/enum.ts +0 -42
  113. package/src/shared/bricks/props/file.ts +0 -12
  114. package/src/shared/bricks/props/geolocation.ts +0 -30
  115. package/src/shared/bricks/props/helpers.ts +0 -101
  116. package/src/shared/bricks/props/image.ts +0 -90
  117. package/src/shared/bricks/props/number.ts +0 -16
  118. package/src/shared/bricks/props/padding.ts +0 -21
  119. package/src/shared/bricks/props/position.ts +0 -27
  120. package/src/shared/bricks/props/preset.ts +0 -136
  121. package/src/shared/bricks/props/string.ts +0 -56
  122. package/src/shared/bricks/props/tests/align.test.ts +0 -37
  123. package/src/shared/bricks/props/tests/background.test.ts +0 -102
  124. package/src/shared/bricks/props/tests/border.test.ts +0 -38
  125. package/src/shared/bricks/props/tests/effects.test.ts +0 -37
  126. package/src/shared/bricks/props/tests/helpers.test.ts +0 -133
  127. package/src/shared/bricks/props/tests/image.test.ts +0 -71
  128. package/src/shared/bricks/props/tests/padding.ts +0 -12
  129. package/src/shared/bricks/props/tests/string.test.ts +0 -79
  130. package/src/shared/bricks/props/text.ts +0 -66
  131. package/src/shared/bricks/props/types.ts +0 -57
  132. package/src/shared/bricks.ts +0 -232
  133. package/src/shared/context.ts +0 -39
  134. package/src/shared/datarecords/external/airtable/handler.ts +0 -21
  135. package/src/shared/datarecords/external/airtable/options.ts +0 -22
  136. package/src/shared/datarecords/external/generic-webhook/handler.ts +0 -10
  137. package/src/shared/datarecords/external/generic-webhook/options.ts +0 -13
  138. package/src/shared/datarecords/external/google/oauth/config.ts +0 -30
  139. package/src/shared/datarecords/external/google/sheets/handler.ts +0 -26
  140. package/src/shared/datarecords/external/google/sheets/options.ts +0 -9
  141. package/src/shared/datarecords/types.ts +0 -120
  142. package/src/shared/datarecords.ts +0 -5
  143. package/src/shared/datasources/README.md +0 -3
  144. package/src/shared/datasources/external/facebook/posts/fetcher.ts +0 -52
  145. package/src/shared/datasources/external/facebook/posts/sample.ts +0 -35
  146. package/src/shared/datasources/external/facebook/posts/schema.ts +0 -33
  147. package/src/shared/datasources/external/facebook/posts/tests/fetcher.test.ts +0 -73
  148. package/src/shared/datasources/external/http-json/fetcher.ts +0 -28
  149. package/src/shared/datasources/external/http-json/options.ts +0 -12
  150. package/src/shared/datasources/external/http-json/schema.ts +0 -6
  151. package/src/shared/datasources/external/http-json/tests/fetcher.test.ts +0 -70
  152. package/src/shared/datasources/external/instagram/feed/fetcher.ts +0 -33
  153. package/src/shared/datasources/external/instagram/feed/sample.ts +0 -22
  154. package/src/shared/datasources/external/instagram/feed/schema.ts +0 -23
  155. package/src/shared/datasources/external/instagram/feed/tests/fetcher.test.ts +0 -64
  156. package/src/shared/datasources/external/mastodon/account/fetcher.ts +0 -24
  157. package/src/shared/datasources/external/mastodon/account/sample.ts +0 -33
  158. package/src/shared/datasources/external/mastodon/account/schema.ts +0 -45
  159. package/src/shared/datasources/external/mastodon/account/tests/fetcher.test.ts +0 -47
  160. package/src/shared/datasources/external/mastodon/options.ts +0 -11
  161. package/src/shared/datasources/external/mastodon/status/fetcher.ts +0 -35
  162. package/src/shared/datasources/external/mastodon/status/sample.array.ts +0 -59
  163. package/src/shared/datasources/external/mastodon/status/sample.single.ts +0 -55
  164. package/src/shared/datasources/external/mastodon/status/schema.ts +0 -130
  165. package/src/shared/datasources/external/mastodon/status/tests/fetcher.test.ts +0 -74
  166. package/src/shared/datasources/external/meta/oauth/config.ts +0 -16
  167. package/src/shared/datasources/external/meta/options.ts +0 -11
  168. package/src/shared/datasources/external/rss/fetcher.ts +0 -29
  169. package/src/shared/datasources/external/rss/options.ts +0 -11
  170. package/src/shared/datasources/external/rss/sample.ts +0 -22
  171. package/src/shared/datasources/external/rss/schema.ts +0 -42
  172. package/src/shared/datasources/external/threads/media/fetcher.ts +0 -53
  173. package/src/shared/datasources/external/threads/media/sample.ts +0 -44
  174. package/src/shared/datasources/external/threads/media/schema.ts +0 -37
  175. package/src/shared/datasources/external/tiktok/oauth/config.ts +0 -17
  176. package/src/shared/datasources/external/tiktok/video/fetcher.ts +0 -39
  177. package/src/shared/datasources/external/tiktok/video/options.ts +0 -12
  178. package/src/shared/datasources/external/tiktok/video/sample.ts +0 -26
  179. package/src/shared/datasources/external/tiktok/video/schema.ts +0 -27
  180. package/src/shared/datasources/external/youtube/list/fetcher.ts +0 -37
  181. package/src/shared/datasources/external/youtube/list/options.ts +0 -15
  182. package/src/shared/datasources/external/youtube/list/sample.ts +0 -33
  183. package/src/shared/datasources/external/youtube/list/schema.ts +0 -38
  184. package/src/shared/datasources/external/youtube/oauth/config.ts +0 -15
  185. package/src/shared/datasources/fetcher.ts +0 -17
  186. package/src/shared/datasources/internal/blog/schema.ts +0 -69
  187. package/src/shared/datasources/internal/changelog/schema.ts +0 -48
  188. package/src/shared/datasources/internal/contact-info/schema.ts +0 -20
  189. package/src/shared/datasources/internal/cv/schema.ts +0 -217
  190. package/src/shared/datasources/internal/faq/schema.ts +0 -27
  191. package/src/shared/datasources/internal/job-board/schema.ts +0 -228
  192. package/src/shared/datasources/internal/links/schema.ts +0 -15
  193. package/src/shared/datasources/internal/recipes/schema.ts +0 -42
  194. package/src/shared/datasources/internal/restaurant/schema.ts +0 -225
  195. package/src/shared/datasources/provider-options.ts +0 -7
  196. package/src/shared/datasources/samples.ts +0 -26
  197. package/src/shared/datasources/schemas.ts +0 -45
  198. package/src/shared/datasources/types.ts +0 -276
  199. package/src/shared/datasources/utils.ts +0 -16
  200. package/src/shared/datasources.ts +0 -42
  201. package/src/shared/env.ts +0 -23
  202. package/src/shared/errors.ts +0 -1
  203. package/src/shared/images.ts +0 -44
  204. package/src/shared/index.ts +0 -3
  205. package/src/shared/layout-constants.ts +0 -25
  206. package/src/shared/manifest.ts +0 -50
  207. package/src/shared/oauth.ts +0 -16
  208. package/src/shared/page.ts +0 -61
  209. package/src/shared/prompt.ts +0 -9
  210. package/src/shared/responsive.ts +0 -5
  211. package/src/shared/site.ts +0 -97
  212. package/src/shared/sitemap.ts +0 -66
  213. package/src/shared/social-icons.ts +0 -307
  214. package/src/shared/tests/attributes.test.ts +0 -37
  215. package/src/shared/theme.ts +0 -245
  216. package/src/shared/themes/README.md +0 -34
  217. package/src/shared/themes/color-system.ts +0 -127
  218. package/src/shared/utils/canvas-data-uri.ts +0 -2
  219. package/src/shared/utils/invariant.ts +0 -25
  220. package/src/shared/utils/json-date.ts +0 -8
  221. package/src/shared/utils/merge.ts +0 -12
  222. package/src/shared/utils/object-hash.ts +0 -7
  223. package/src/shared/utils/schema.ts +0 -35
  224. package/src/shared/utils/try-catch.ts +0 -12
  225. 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";