@upstart.gg/sdk 0.0.51

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 (126) hide show
  1. package/LICENSE +633 -0
  2. package/README.md +11 -0
  3. package/custom-attrs.d.ts +63 -0
  4. package/dist/node/cli/api.js +3 -0
  5. package/dist/node/cli/commands/build/cmd-build.js +3 -0
  6. package/dist/node/cli/commands/login/cmd-login.js +10 -0
  7. package/dist/node/cli/commands/logout/cmd-logout.js +3 -0
  8. package/dist/node/cli/commands/publish/cmd-publish.js +36 -0
  9. package/dist/node/cli/commands/publish/parse-gitignore.js +14 -0
  10. package/dist/node/cli/commands/publish/uploader.js +17 -0
  11. package/dist/node/cli/constants.js +2 -0
  12. package/dist/node/cli/program.js +48 -0
  13. package/dist/node/cli/store.js +3 -0
  14. package/dist/node/cli/types.js +1 -0
  15. package/dist/node/cli/utils.js +2 -0
  16. package/dist/node/metafile-esm.json +1 -0
  17. package/dist/node/shared/config.js +12 -0
  18. package/dist/node/shared/logger.js +3 -0
  19. package/dist/shared/ajv.d.ts +6 -0
  20. package/dist/shared/ajv.js +2 -0
  21. package/dist/shared/attributes.d.ts +102 -0
  22. package/dist/shared/attributes.js +2 -0
  23. package/dist/shared/bricks.d.ts +140 -0
  24. package/dist/shared/bricks.js +2 -0
  25. package/dist/shared/datasources/external/facebook/posts/fetcher.d.ts +16 -0
  26. package/dist/shared/datasources/external/facebook/posts/fetcher.js +2 -0
  27. package/dist/shared/datasources/external/facebook/posts/schema.d.ts +31 -0
  28. package/dist/shared/datasources/external/facebook/posts/schema.js +2 -0
  29. package/dist/shared/datasources/external/instagram/feed/fetcher.d.ts +16 -0
  30. package/dist/shared/datasources/external/instagram/feed/fetcher.js +2 -0
  31. package/dist/shared/datasources/external/instagram/feed/schema.d.ts +23 -0
  32. package/dist/shared/datasources/external/instagram/feed/schema.js +2 -0
  33. package/dist/shared/datasources/external/json/fetcher.d.ts +17 -0
  34. package/dist/shared/datasources/external/json/fetcher.js +2 -0
  35. package/dist/shared/datasources/external/json/options.d.ts +11 -0
  36. package/dist/shared/datasources/external/json/options.js +2 -0
  37. package/dist/shared/datasources/external/mastodon/account/fetcher.d.ts +15 -0
  38. package/dist/shared/datasources/external/mastodon/account/fetcher.js +2 -0
  39. package/dist/shared/datasources/external/mastodon/account/schema.d.ts +43 -0
  40. package/dist/shared/datasources/external/mastodon/account/schema.js +2 -0
  41. package/dist/shared/datasources/external/mastodon/options.d.ts +10 -0
  42. package/dist/shared/datasources/external/mastodon/options.js +2 -0
  43. package/dist/shared/datasources/external/mastodon/status/fetcher.d.ts +15 -0
  44. package/dist/shared/datasources/external/mastodon/status/fetcher.js +2 -0
  45. package/dist/shared/datasources/external/mastodon/status/sample.array.d.ts +53 -0
  46. package/dist/shared/datasources/external/mastodon/status/sample.array.js +2 -0
  47. package/dist/shared/datasources/external/mastodon/status/sample.single.d.ts +53 -0
  48. package/dist/shared/datasources/external/mastodon/status/sample.single.js +2 -0
  49. package/dist/shared/datasources/external/mastodon/status/schema.d.ts +261 -0
  50. package/dist/shared/datasources/external/mastodon/status/schema.js +2 -0
  51. package/dist/shared/datasources/external/meta/oauth/config.d.ts +21 -0
  52. package/dist/shared/datasources/external/meta/oauth/config.js +1 -0
  53. package/dist/shared/datasources/external/meta/options.d.ts +10 -0
  54. package/dist/shared/datasources/external/meta/options.js +2 -0
  55. package/dist/shared/datasources/external/rss/fetcher.d.ts +15 -0
  56. package/dist/shared/datasources/external/rss/fetcher.js +2 -0
  57. package/dist/shared/datasources/external/rss/options.d.ts +10 -0
  58. package/dist/shared/datasources/external/rss/options.js +2 -0
  59. package/dist/shared/datasources/external/rss/schema.d.ts +19 -0
  60. package/dist/shared/datasources/external/rss/schema.js +2 -0
  61. package/dist/shared/datasources/external/threads/media/fetcher.d.ts +19 -0
  62. package/dist/shared/datasources/external/threads/media/fetcher.js +2 -0
  63. package/dist/shared/datasources/external/threads/media/schema.d.ts +30 -0
  64. package/dist/shared/datasources/external/threads/media/schema.js +2 -0
  65. package/dist/shared/datasources/external/tiktok/oauth/config.d.ts +22 -0
  66. package/dist/shared/datasources/external/tiktok/oauth/config.js +1 -0
  67. package/dist/shared/datasources/external/tiktok/video/fetcher.d.ts +16 -0
  68. package/dist/shared/datasources/external/tiktok/video/fetcher.js +2 -0
  69. package/dist/shared/datasources/external/tiktok/video/options.d.ts +10 -0
  70. package/dist/shared/datasources/external/tiktok/video/options.js +2 -0
  71. package/dist/shared/datasources/external/tiktok/video/schema.d.ts +25 -0
  72. package/dist/shared/datasources/external/tiktok/video/schema.js +2 -0
  73. package/dist/shared/datasources/external/youtube/list/fetcher.d.ts +16 -0
  74. package/dist/shared/datasources/external/youtube/list/fetcher.js +2 -0
  75. package/dist/shared/datasources/external/youtube/list/options.d.ts +14 -0
  76. package/dist/shared/datasources/external/youtube/list/options.js +2 -0
  77. package/dist/shared/datasources/external/youtube/list/schema.d.ts +43 -0
  78. package/dist/shared/datasources/external/youtube/list/schema.js +2 -0
  79. package/dist/shared/datasources/external/youtube/oauth/config.d.ts +22 -0
  80. package/dist/shared/datasources/external/youtube/oauth/config.js +1 -0
  81. package/dist/shared/datasources/internal/contact-info/schema.d.ts +17 -0
  82. package/dist/shared/datasources/internal/contact-info/schema.js +2 -0
  83. package/dist/shared/datasources/internal/faq/schema.d.ts +12 -0
  84. package/dist/shared/datasources/internal/faq/schema.js +2 -0
  85. package/dist/shared/datasources/internal/links/schema.d.ts +12 -0
  86. package/dist/shared/datasources/internal/links/schema.js +2 -0
  87. package/dist/shared/datasources/samples.d.ts +13 -0
  88. package/dist/shared/datasources/samples.js +2 -0
  89. package/dist/shared/datasources/types.d.ts +9 -0
  90. package/dist/shared/datasources/types.js +2 -0
  91. package/dist/shared/datasources/utils.d.ts +3 -0
  92. package/dist/shared/datasources/utils.js +2 -0
  93. package/dist/shared/datasources-DAysbbXK.d.ts +201 -0
  94. package/dist/shared/datasources.d.ts +9 -0
  95. package/dist/shared/datasources.js +2 -0
  96. package/dist/shared/env.d.ts +27 -0
  97. package/dist/shared/env.js +1 -0
  98. package/dist/shared/errors.d.ts +1 -0
  99. package/dist/shared/errors.js +2 -0
  100. package/dist/shared/index.d.ts +5 -0
  101. package/dist/shared/index.js +2 -0
  102. package/dist/shared/layout-constants.d.ts +20 -0
  103. package/dist/shared/layout-constants.js +2 -0
  104. package/dist/shared/manifest.d.ts +34 -0
  105. package/dist/shared/manifest.js +2 -0
  106. package/dist/shared/metafile-esm.json +1 -0
  107. package/dist/shared/page.d.ts +9 -0
  108. package/dist/shared/page.js +2 -0
  109. package/dist/shared/responsive.d.ts +6 -0
  110. package/dist/shared/responsive.js +2 -0
  111. package/dist/shared/social-icons.d.ts +6 -0
  112. package/dist/shared/social-icons.js +2 -0
  113. package/dist/shared/template-config.d.ts +9 -0
  114. package/dist/shared/template-config.js +1 -0
  115. package/dist/shared/theme.d.ts +37 -0
  116. package/dist/shared/theme.js +2 -0
  117. package/dist/shared/themes/all-themes.d.ts +6 -0
  118. package/dist/shared/themes/all-themes.js +2 -0
  119. package/dist/shared/themes/color-system.d.ts +323 -0
  120. package/dist/shared/themes/color-system.js +2 -0
  121. package/dist/shared/utils/invariant.d.ts +8 -0
  122. package/dist/shared/utils/invariant.js +2 -0
  123. package/dist/shared/utils/layout-utils.d.ts +24 -0
  124. package/dist/shared/utils/layout-utils.js +2 -0
  125. package/env.d.ts +24 -0
  126. package/package.json +162 -0
@@ -0,0 +1,53 @@
1
+ declare const sample: {
2
+ account: {
3
+ acct: string;
4
+ avatar: string;
5
+ avatar_static: string;
6
+ bot: false;
7
+ created_at: string;
8
+ display_name: string;
9
+ emojis: {
10
+ category: string;
11
+ shortcode: string;
12
+ static_url: string;
13
+ url: string;
14
+ visible_in_picker: true;
15
+ }[];
16
+ id: string;
17
+ url: string;
18
+ username: string;
19
+ discoverable: true;
20
+ fields: never[];
21
+ followers_count: number;
22
+ following_count: number;
23
+ group: false;
24
+ header: string;
25
+ header_static: string;
26
+ last_status_at: string;
27
+ locked: false;
28
+ note: string;
29
+ noindex: false;
30
+ statuses_count: number;
31
+ suspended: false;
32
+ };
33
+ content: string;
34
+ created_at: string;
35
+ id: string;
36
+ media_attachments: never[];
37
+ reblogs_count: number;
38
+ replies_count: number;
39
+ favourites_count: number;
40
+ tags: never[];
41
+ uri: string;
42
+ visibility: "public";
43
+ sensitive: false;
44
+ application: {
45
+ name: string;
46
+ website: string;
47
+ };
48
+ mentions: never[];
49
+ emojis: never[];
50
+ url: string;
51
+ };
52
+
53
+ export { sample };
@@ -0,0 +1,2 @@
1
+ /*! Enpage - Copyright (C) 2024 Flippable - https://github.com/enpage/enpage/blob/main/LICENSE */
2
+ var a={account:{acct:"Gargron",avatar:"https://files.mastodon.social/accounts/avatars/000/000/001/original/7b7e3c3e3e7e3e3e.png",avatar_static:"https://files.mastodon.social/accounts/avatars/000/000/001/original/7b7e3c3e3e7e3e3e.png",bot:!1,created_at:"2016-04-04T17:41:54.000Z",display_name:"Eugen",emojis:[{category:"custom",shortcode:"blobawave",static_url:"https://files.mastodon.social/custom_emojis/images/000/000/001/static/1f4a9.png",url:"https://files.mastodon.social/custom_emojis/images/000/000/001/original/1f4a9.png",visible_in_picker:!0}],id:"1",url:"https://mastodon.social/@Gargron",username:"Gargron",discoverable:!0,fields:[],followers_count:100,following_count:100,group:!1,header:"https://files.mastodon.social/accounts/headers/000/000/001/original/7b7e3c3e3e7e3e3e.png",header_static:"https://files.mastodon.social/accounts/headers/000/000/001/original/7b7e3c3e3e7e3e3e.png",last_status_at:"2021-06-26T18:00:00",locked:!1,note:"Admin of mastodon.social",noindex:!1,statuses_count:100,suspended:!1},content:"Hello, world!",created_at:"2021-06-26T18:00:00",id:"1",media_attachments:[],reblogs_count:0,replies_count:0,favourites_count:0,tags:[],uri:"https://mastodon.social/@Gargron/1",visibility:"public",sensitive:!1,application:{name:"Mastodon",website:"https://joinmastodon.org"},mentions:[],emojis:[],url:"https://mastodon.social/@Gargron/1"};export{a as sample};
@@ -0,0 +1,261 @@
1
+ import * as _sinclair_typebox from '@sinclair/typebox';
2
+ import { Static } from '@sinclair/typebox';
3
+
4
+ declare const mastodonStatusSchema: _sinclair_typebox.TObject<{
5
+ id: _sinclair_typebox.TString;
6
+ uri: _sinclair_typebox.TString;
7
+ created_at: _sinclair_typebox.TString;
8
+ account: _sinclair_typebox.TObject<{
9
+ id: _sinclair_typebox.TString;
10
+ username: _sinclair_typebox.TString;
11
+ acct: _sinclair_typebox.TString;
12
+ url: _sinclair_typebox.TString;
13
+ display_name: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
14
+ note: _sinclair_typebox.TString;
15
+ avatar: _sinclair_typebox.TString;
16
+ avatar_static: _sinclair_typebox.TString;
17
+ header: _sinclair_typebox.TString;
18
+ header_static: _sinclair_typebox.TString;
19
+ locked: _sinclair_typebox.TBoolean;
20
+ fields: _sinclair_typebox.TArray<_sinclair_typebox.TObject<{
21
+ name: _sinclair_typebox.TString;
22
+ value: _sinclair_typebox.TString;
23
+ verified_at: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
24
+ }>>;
25
+ emojis: _sinclair_typebox.TArray<_sinclair_typebox.TObject<{
26
+ shortcode: _sinclair_typebox.TString;
27
+ url: _sinclair_typebox.TString;
28
+ static_url: _sinclair_typebox.TString;
29
+ visible_in_picker: _sinclair_typebox.TBoolean;
30
+ category: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
31
+ }>>;
32
+ bot: _sinclair_typebox.TBoolean;
33
+ group: _sinclair_typebox.TBoolean;
34
+ discoverable: _sinclair_typebox.TUnion<[_sinclair_typebox.TBoolean, _sinclair_typebox.TNull]>;
35
+ noindex: _sinclair_typebox.TOptional<_sinclair_typebox.TBoolean>;
36
+ moved: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
37
+ suspended: _sinclair_typebox.TOptional<_sinclair_typebox.TBoolean>;
38
+ limited: _sinclair_typebox.TOptional<_sinclair_typebox.TBoolean>;
39
+ created_at: _sinclair_typebox.TString;
40
+ last_status_at: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
41
+ statuses_count: _sinclair_typebox.TNumber;
42
+ followers_count: _sinclair_typebox.TNumber;
43
+ following_count: _sinclair_typebox.TNumber;
44
+ }>;
45
+ content: _sinclair_typebox.TString;
46
+ visibility: _sinclair_typebox.TUnion<[_sinclair_typebox.TLiteral<"public">, _sinclair_typebox.TLiteral<"unlisted">, _sinclair_typebox.TLiteral<"private">, _sinclair_typebox.TLiteral<"direct">]>;
47
+ sensitive: _sinclair_typebox.TBoolean;
48
+ media_attachments: _sinclair_typebox.TArray<_sinclair_typebox.TObject<{
49
+ id: _sinclair_typebox.TString;
50
+ type: _sinclair_typebox.TUnion<[_sinclair_typebox.TLiteral<"audio">, _sinclair_typebox.TLiteral<"image">, _sinclair_typebox.TLiteral<"video">, _sinclair_typebox.TLiteral<"gifv">, _sinclair_typebox.TLiteral<"unknown">]>;
51
+ url: _sinclair_typebox.TString;
52
+ preview_url: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
53
+ remote_url: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
54
+ meta: _sinclair_typebox.TRecord<_sinclair_typebox.TString, _sinclair_typebox.TAny>;
55
+ description: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
56
+ blurhash: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
57
+ }>>;
58
+ application: _sinclair_typebox.TOptional<_sinclair_typebox.TObject<{
59
+ name: _sinclair_typebox.TString;
60
+ website: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
61
+ }>>;
62
+ mentions: _sinclair_typebox.TArray<_sinclair_typebox.TObject<{
63
+ id: _sinclair_typebox.TString;
64
+ username: _sinclair_typebox.TString;
65
+ acct: _sinclair_typebox.TString;
66
+ url: _sinclair_typebox.TString;
67
+ }>>;
68
+ tags: _sinclair_typebox.TArray<_sinclair_typebox.TObject<{
69
+ name: _sinclair_typebox.TString;
70
+ url: _sinclair_typebox.TString;
71
+ }>>;
72
+ emojis: _sinclair_typebox.TArray<_sinclair_typebox.TObject<{
73
+ shortcode: _sinclair_typebox.TString;
74
+ url: _sinclair_typebox.TString;
75
+ static_url: _sinclair_typebox.TString;
76
+ visible_in_picker: _sinclair_typebox.TBoolean;
77
+ category: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
78
+ }>>;
79
+ reblogs_count: _sinclair_typebox.TNumber;
80
+ favourites_count: _sinclair_typebox.TNumber;
81
+ replies_count: _sinclair_typebox.TNumber;
82
+ url: _sinclair_typebox.TString;
83
+ in_reply_to_id: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
84
+ in_reply_to_account_id: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
85
+ reblog: _sinclair_typebox.TOptional<_sinclair_typebox.TRef<"mastodonStatus">>;
86
+ poll: _sinclair_typebox.TOptional<_sinclair_typebox.TObject<{
87
+ id: _sinclair_typebox.TString;
88
+ expires_at: _sinclair_typebox.TString;
89
+ expired: _sinclair_typebox.TBoolean;
90
+ multiple: _sinclair_typebox.TBoolean;
91
+ votes_count: _sinclair_typebox.TNumber;
92
+ options: _sinclair_typebox.TArray<_sinclair_typebox.TObject<{
93
+ title: _sinclair_typebox.TString;
94
+ votes_count: _sinclair_typebox.TNumber;
95
+ }>>;
96
+ voted: _sinclair_typebox.TOptional<_sinclair_typebox.TBoolean>;
97
+ own_votes: _sinclair_typebox.TOptional<_sinclair_typebox.TArray<_sinclair_typebox.TNumber>>;
98
+ emojis: _sinclair_typebox.TArray<_sinclair_typebox.TObject<{
99
+ shortcode: _sinclair_typebox.TString;
100
+ url: _sinclair_typebox.TString;
101
+ static_url: _sinclair_typebox.TString;
102
+ visible_in_picker: _sinclair_typebox.TBoolean;
103
+ category: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
104
+ }>>;
105
+ }>>;
106
+ card: _sinclair_typebox.TOptional<_sinclair_typebox.TObject<{
107
+ url: _sinclair_typebox.TString;
108
+ title: _sinclair_typebox.TString;
109
+ description: _sinclair_typebox.TString;
110
+ type: _sinclair_typebox.TUnion<[_sinclair_typebox.TLiteral<"link">, _sinclair_typebox.TLiteral<"photo">, _sinclair_typebox.TLiteral<"video">, _sinclair_typebox.TLiteral<"rich">]>;
111
+ author_name: _sinclair_typebox.TString;
112
+ author_url: _sinclair_typebox.TString;
113
+ provider_name: _sinclair_typebox.TString;
114
+ provider_url: _sinclair_typebox.TString;
115
+ html: _sinclair_typebox.TString;
116
+ width: _sinclair_typebox.TNumber;
117
+ height: _sinclair_typebox.TNumber;
118
+ image: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
119
+ embed_url: _sinclair_typebox.TString;
120
+ blurhash: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
121
+ }>>;
122
+ language: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
123
+ text: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
124
+ edited_at: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
125
+ favourited: _sinclair_typebox.TOptional<_sinclair_typebox.TBoolean>;
126
+ reblogged: _sinclair_typebox.TOptional<_sinclair_typebox.TBoolean>;
127
+ muted: _sinclair_typebox.TOptional<_sinclair_typebox.TBoolean>;
128
+ bookmarked: _sinclair_typebox.TOptional<_sinclair_typebox.TBoolean>;
129
+ pinned: _sinclair_typebox.TOptional<_sinclair_typebox.TBoolean>;
130
+ }>;
131
+ type MastodonStatusSchema = Static<typeof mastodonStatusSchema>;
132
+ declare const mastodonStatusArraySchema: _sinclair_typebox.TArray<_sinclair_typebox.TObject<{
133
+ id: _sinclair_typebox.TString;
134
+ uri: _sinclair_typebox.TString;
135
+ created_at: _sinclair_typebox.TString;
136
+ account: _sinclair_typebox.TObject<{
137
+ id: _sinclair_typebox.TString;
138
+ username: _sinclair_typebox.TString;
139
+ acct: _sinclair_typebox.TString;
140
+ url: _sinclair_typebox.TString;
141
+ display_name: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
142
+ note: _sinclair_typebox.TString;
143
+ avatar: _sinclair_typebox.TString;
144
+ avatar_static: _sinclair_typebox.TString;
145
+ header: _sinclair_typebox.TString;
146
+ header_static: _sinclair_typebox.TString;
147
+ locked: _sinclair_typebox.TBoolean;
148
+ fields: _sinclair_typebox.TArray<_sinclair_typebox.TObject<{
149
+ name: _sinclair_typebox.TString;
150
+ value: _sinclair_typebox.TString;
151
+ verified_at: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
152
+ }>>;
153
+ emojis: _sinclair_typebox.TArray<_sinclair_typebox.TObject<{
154
+ shortcode: _sinclair_typebox.TString;
155
+ url: _sinclair_typebox.TString;
156
+ static_url: _sinclair_typebox.TString;
157
+ visible_in_picker: _sinclair_typebox.TBoolean;
158
+ category: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
159
+ }>>;
160
+ bot: _sinclair_typebox.TBoolean;
161
+ group: _sinclair_typebox.TBoolean;
162
+ discoverable: _sinclair_typebox.TUnion<[_sinclair_typebox.TBoolean, _sinclair_typebox.TNull]>;
163
+ noindex: _sinclair_typebox.TOptional<_sinclair_typebox.TBoolean>;
164
+ moved: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
165
+ suspended: _sinclair_typebox.TOptional<_sinclair_typebox.TBoolean>;
166
+ limited: _sinclair_typebox.TOptional<_sinclair_typebox.TBoolean>;
167
+ created_at: _sinclair_typebox.TString;
168
+ last_status_at: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
169
+ statuses_count: _sinclair_typebox.TNumber;
170
+ followers_count: _sinclair_typebox.TNumber;
171
+ following_count: _sinclair_typebox.TNumber;
172
+ }>;
173
+ content: _sinclair_typebox.TString;
174
+ visibility: _sinclair_typebox.TUnion<[_sinclair_typebox.TLiteral<"public">, _sinclair_typebox.TLiteral<"unlisted">, _sinclair_typebox.TLiteral<"private">, _sinclair_typebox.TLiteral<"direct">]>;
175
+ sensitive: _sinclair_typebox.TBoolean;
176
+ media_attachments: _sinclair_typebox.TArray<_sinclair_typebox.TObject<{
177
+ id: _sinclair_typebox.TString;
178
+ type: _sinclair_typebox.TUnion<[_sinclair_typebox.TLiteral<"audio">, _sinclair_typebox.TLiteral<"image">, _sinclair_typebox.TLiteral<"video">, _sinclair_typebox.TLiteral<"gifv">, _sinclair_typebox.TLiteral<"unknown">]>;
179
+ url: _sinclair_typebox.TString;
180
+ preview_url: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
181
+ remote_url: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
182
+ meta: _sinclair_typebox.TRecord<_sinclair_typebox.TString, _sinclair_typebox.TAny>;
183
+ description: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
184
+ blurhash: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
185
+ }>>;
186
+ application: _sinclair_typebox.TOptional<_sinclair_typebox.TObject<{
187
+ name: _sinclair_typebox.TString;
188
+ website: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
189
+ }>>;
190
+ mentions: _sinclair_typebox.TArray<_sinclair_typebox.TObject<{
191
+ id: _sinclair_typebox.TString;
192
+ username: _sinclair_typebox.TString;
193
+ acct: _sinclair_typebox.TString;
194
+ url: _sinclair_typebox.TString;
195
+ }>>;
196
+ tags: _sinclair_typebox.TArray<_sinclair_typebox.TObject<{
197
+ name: _sinclair_typebox.TString;
198
+ url: _sinclair_typebox.TString;
199
+ }>>;
200
+ emojis: _sinclair_typebox.TArray<_sinclair_typebox.TObject<{
201
+ shortcode: _sinclair_typebox.TString;
202
+ url: _sinclair_typebox.TString;
203
+ static_url: _sinclair_typebox.TString;
204
+ visible_in_picker: _sinclair_typebox.TBoolean;
205
+ category: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
206
+ }>>;
207
+ reblogs_count: _sinclair_typebox.TNumber;
208
+ favourites_count: _sinclair_typebox.TNumber;
209
+ replies_count: _sinclair_typebox.TNumber;
210
+ url: _sinclair_typebox.TString;
211
+ in_reply_to_id: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
212
+ in_reply_to_account_id: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
213
+ reblog: _sinclair_typebox.TOptional<_sinclair_typebox.TRef<"mastodonStatus">>;
214
+ poll: _sinclair_typebox.TOptional<_sinclair_typebox.TObject<{
215
+ id: _sinclair_typebox.TString;
216
+ expires_at: _sinclair_typebox.TString;
217
+ expired: _sinclair_typebox.TBoolean;
218
+ multiple: _sinclair_typebox.TBoolean;
219
+ votes_count: _sinclair_typebox.TNumber;
220
+ options: _sinclair_typebox.TArray<_sinclair_typebox.TObject<{
221
+ title: _sinclair_typebox.TString;
222
+ votes_count: _sinclair_typebox.TNumber;
223
+ }>>;
224
+ voted: _sinclair_typebox.TOptional<_sinclair_typebox.TBoolean>;
225
+ own_votes: _sinclair_typebox.TOptional<_sinclair_typebox.TArray<_sinclair_typebox.TNumber>>;
226
+ emojis: _sinclair_typebox.TArray<_sinclair_typebox.TObject<{
227
+ shortcode: _sinclair_typebox.TString;
228
+ url: _sinclair_typebox.TString;
229
+ static_url: _sinclair_typebox.TString;
230
+ visible_in_picker: _sinclair_typebox.TBoolean;
231
+ category: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
232
+ }>>;
233
+ }>>;
234
+ card: _sinclair_typebox.TOptional<_sinclair_typebox.TObject<{
235
+ url: _sinclair_typebox.TString;
236
+ title: _sinclair_typebox.TString;
237
+ description: _sinclair_typebox.TString;
238
+ type: _sinclair_typebox.TUnion<[_sinclair_typebox.TLiteral<"link">, _sinclair_typebox.TLiteral<"photo">, _sinclair_typebox.TLiteral<"video">, _sinclair_typebox.TLiteral<"rich">]>;
239
+ author_name: _sinclair_typebox.TString;
240
+ author_url: _sinclair_typebox.TString;
241
+ provider_name: _sinclair_typebox.TString;
242
+ provider_url: _sinclair_typebox.TString;
243
+ html: _sinclair_typebox.TString;
244
+ width: _sinclair_typebox.TNumber;
245
+ height: _sinclair_typebox.TNumber;
246
+ image: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
247
+ embed_url: _sinclair_typebox.TString;
248
+ blurhash: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
249
+ }>>;
250
+ language: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
251
+ text: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
252
+ edited_at: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
253
+ favourited: _sinclair_typebox.TOptional<_sinclair_typebox.TBoolean>;
254
+ reblogged: _sinclair_typebox.TOptional<_sinclair_typebox.TBoolean>;
255
+ muted: _sinclair_typebox.TOptional<_sinclair_typebox.TBoolean>;
256
+ bookmarked: _sinclair_typebox.TOptional<_sinclair_typebox.TBoolean>;
257
+ pinned: _sinclair_typebox.TOptional<_sinclair_typebox.TBoolean>;
258
+ }>>;
259
+ type MastodonStatusArraySchema = Static<typeof mastodonStatusArraySchema>;
260
+
261
+ export { type MastodonStatusArraySchema, type MastodonStatusSchema, mastodonStatusArraySchema };
@@ -0,0 +1,2 @@
1
+ /*! Enpage - Copyright (C) 2024 Flippable - https://github.com/enpage/enpage/blob/main/LICENSE */
2
+ import{Type as t}from"@sinclair/typebox";import{Type as i}from"@sinclair/typebox";var n=i.Object({id:i.String(),username:i.String(),acct:i.String(),url:i.String(),display_name:i.Optional(i.String()),note:i.String(),avatar:i.String(),avatar_static:i.String(),header:i.String(),header_static:i.String(),locked:i.Boolean(),fields:i.Array(i.Object({name:i.String(),value:i.String(),verified_at:i.Optional(i.String())})),emojis:i.Array(i.Object({shortcode:i.String(),url:i.String(),static_url:i.String(),visible_in_picker:i.Boolean(),category:i.Optional(i.String())})),bot:i.Boolean(),group:i.Boolean(),discoverable:i.Union([i.Boolean(),i.Null()]),noindex:i.Optional(i.Boolean()),moved:i.Optional(i.String()),suspended:i.Optional(i.Boolean()),limited:i.Optional(i.Boolean()),created_at:i.String(),last_status_at:i.Optional(i.String()),statuses_count:i.Number(),followers_count:i.Number(),following_count:i.Number()});var e=t.Object({id:t.String(),type:t.Union([t.Literal("audio"),t.Literal("image"),t.Literal("video"),t.Literal("gifv"),t.Literal("unknown")]),url:t.String(),preview_url:t.Optional(t.String()),remote_url:t.Optional(t.String()),meta:t.Record(t.String(),t.Any()),description:t.Optional(t.String()),blurhash:t.Optional(t.String())}),o=t.Object({shortcode:t.String(),url:t.String(),static_url:t.String(),visible_in_picker:t.Boolean(),category:t.Optional(t.String())}),r=t.Object({url:t.String(),title:t.String(),description:t.String(),type:t.Union([t.Literal("link"),t.Literal("photo"),t.Literal("video"),t.Literal("rich")]),author_name:t.String(),author_url:t.String(),provider_name:t.String(),provider_url:t.String(),html:t.String(),width:t.Number(),height:t.Number(),image:t.Optional(t.String()),embed_url:t.String(),blurhash:t.Optional(t.String())}),a=t.Object({id:t.String(),expires_at:t.String(),expired:t.Boolean(),multiple:t.Boolean(),votes_count:t.Number(),options:t.Array(t.Object({title:t.String(),votes_count:t.Number()})),voted:t.Optional(t.Boolean()),own_votes:t.Optional(t.Array(t.Number())),emojis:t.Array(o)}),l=t.Object({id:t.String(),uri:t.String(),created_at:t.String(),account:n,content:t.String(),visibility:t.Union([t.Literal("public"),t.Literal("unlisted"),t.Literal("private"),t.Literal("direct")]),sensitive:t.Boolean(),media_attachments:t.Array(e),application:t.Optional(t.Object({name:t.String(),website:t.Optional(t.String())})),mentions:t.Array(t.Object({id:t.String(),username:t.String(),acct:t.String(),url:t.String()})),tags:t.Array(t.Object({name:t.String(),url:t.String()})),emojis:t.Array(o),reblogs_count:t.Number(),favourites_count:t.Number(),replies_count:t.Number(),url:t.String(),in_reply_to_id:t.Optional(t.String()),in_reply_to_account_id:t.Optional(t.String()),reblog:t.Optional(t.Ref("mastodonStatus")),poll:t.Optional(a),card:t.Optional(r),language:t.Optional(t.String()),text:t.Optional(t.String()),edited_at:t.Optional(t.String()),favourited:t.Optional(t.Boolean()),reblogged:t.Optional(t.Boolean()),muted:t.Optional(t.Boolean()),bookmarked:t.Optional(t.Boolean()),pinned:t.Optional(t.Boolean())},{$id:"mastodonStatus"}),s=t.Array(l);export{s as mastodonStatusArraySchema};
@@ -0,0 +1,21 @@
1
+ import { O as OAuthConfig } from '../../../../datasources-DAysbbXK.js';
2
+ import '@sinclair/typebox';
3
+ import 'zod';
4
+ import '../../../../attributes.js';
5
+ import '../../../../themes/color-system.js';
6
+ import '../../../../theme.js';
7
+ import 'chroma-js';
8
+ import '../../../../bricks.js';
9
+ import '../../../../manifest.js';
10
+
11
+ interface MetaOAuthConfig {
12
+ type: "short-lived" | "long-lived";
13
+ accessToken: string;
14
+ userId: string;
15
+ permissions: string[];
16
+ expiresIn: number;
17
+ tokenType: string;
18
+ }
19
+ type MetaFullOAuthConfig = OAuthConfig<MetaOAuthConfig>;
20
+
21
+ export type { MetaFullOAuthConfig, MetaOAuthConfig };
@@ -0,0 +1 @@
1
+ /*! Enpage - Copyright (C) 2024 Flippable - https://github.com/enpage/enpage/blob/main/LICENSE */
@@ -0,0 +1,10 @@
1
+ import * as _sinclair_typebox from '@sinclair/typebox';
2
+ import { Static } from '@sinclair/typebox';
3
+
4
+ declare const metaOptions: _sinclair_typebox.TObject<{
5
+ nextRefreshDelay: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
6
+ limit: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
7
+ }>;
8
+ type MetaOptions = Static<typeof metaOptions>;
9
+
10
+ export { type MetaOptions, metaOptions };
@@ -0,0 +1,2 @@
1
+ /*! Enpage - Copyright (C) 2024 Flippable - https://github.com/enpage/enpage/blob/main/LICENSE */
2
+ import{Type as t}from"@sinclair/typebox";import{Type as e}from"@sinclair/typebox";import r from"zod";var o=e.Object({nextRefreshDelay:e.Optional(e.Number())}),p=["facebook-posts","instagram-feed","mastodon-status","rss","threads-media","tiktok-video","youtube-list","json"],n=r.enum(p);var c=t.Composite([o,t.Object({limit:t.Optional(t.Number())})]);export{c as metaOptions};
@@ -0,0 +1,15 @@
1
+ import { RssOptions } from './options.js';
2
+ import { a as DatasourceFetcher } from '../../../datasources-DAysbbXK.js';
3
+ import { RssSchema } from './schema.js';
4
+ import '@sinclair/typebox';
5
+ import 'zod';
6
+ import '../../../attributes.js';
7
+ import '../../../themes/color-system.js';
8
+ import '../../../theme.js';
9
+ import 'chroma-js';
10
+ import '../../../bricks.js';
11
+ import '../../../manifest.js';
12
+
13
+ declare const fetchRss: DatasourceFetcher<RssSchema, null, RssOptions>;
14
+
15
+ export { fetchRss as default };
@@ -0,0 +1,2 @@
1
+ /*! Enpage - Copyright (C) 2024 Flippable - https://github.com/enpage/enpage/blob/main/LICENSE */
2
+ import{parseFeed as h}from"htmlparser2";import{Type as t}from"@sinclair/typebox";var d=t.Object({title:t.String({title:"Title",description:"The title of the RSS feed"}),link:t.String({title:"Link",description:"The link to the RSS feed"}),description:t.Optional(t.String({title:"Description",description:"The description of the RSS feed"})),updated:t.Optional(t.String({title:"Updated",description:"The last updated date of the RSS feed"})),items:t.Array(t.Object({title:t.Optional(t.String({title:"Title",description:"The title of the RSS feed item"})),link:t.Optional(t.String({title:"Link",description:"The link to the RSS feed item"})),creator:t.Optional(t.String({title:"Creator",description:"The creator of the RSS feed item"})),content:t.Optional(t.String({title:"Content",description:"The content of the RSS feed item"})),pubDate:t.Optional(t.String({title:"Pub Date",description:"The publication date of the RSS feed item"}))}))});import S from"ajv";import f from"ajv-formats";var s=new S({useDefaults:!0});f(s,["date-time","time","date","email","hostname","ipv4","ipv6","uri","uri-reference","uuid","uri-template","json-pointer","relative-json-pointer","regex"]);s.addFormat("date-object",{validate:e=>e instanceof Date&&!Number.isNaN(e.getTime()),async:!1});function l(e){return!e||e.length===0?"Unknown validation error":e.map(o=>{let{instancePath:p,message:i,params:n}=o,a=p||"root",c=Object.entries(n||{}).map(([r,m])=>`${r}: ${m}`).join(", ");return`${a} ${i} (${c})`}).join("; ")}var u=async({options:e})=>{let{url:o}=e,p=await(await fetch(o)).text(),i=h(p),n={...i,link:i?.link??"",title:i?.title??"",updated:i?.updated?i.updated.toISOString():void 0,items:i?.items.map(r=>({...r,pubDate:r.pubDate?r.pubDate.toISOString():new Date().toISOString()}))??[]},a=s.compile(d);if(!a(n))throw new Error(`fetchRss Error: Invalid Feed data (${o}): ${l(a.errors)}`);return n},D=u;export{D as default};
@@ -0,0 +1,10 @@
1
+ import * as _sinclair_typebox from '@sinclair/typebox';
2
+ import { Static } from '@sinclair/typebox';
3
+
4
+ declare const rssOptions: _sinclair_typebox.TObject<{
5
+ nextRefreshDelay: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
6
+ url: _sinclair_typebox.TString;
7
+ }>;
8
+ type RssOptions = Static<typeof rssOptions>;
9
+
10
+ export { type RssOptions, rssOptions };
@@ -0,0 +1,2 @@
1
+ /*! Enpage - Copyright (C) 2024 Flippable - https://github.com/enpage/enpage/blob/main/LICENSE */
2
+ import{Type as e}from"@sinclair/typebox";import{Type as t}from"@sinclair/typebox";import r from"zod";var o=t.Object({nextRefreshDelay:t.Optional(t.Number())}),s=["facebook-posts","instagram-feed","mastodon-status","rss","threads-media","tiktok-video","youtube-list","json"],n=r.enum(s);var c=e.Composite([o,e.Object({url:e.String({format:"uri"})})]);export{c as rssOptions};
@@ -0,0 +1,19 @@
1
+ import * as _sinclair_typebox from '@sinclair/typebox';
2
+ import { Static } from '@sinclair/typebox';
3
+
4
+ declare const rssSchema: _sinclair_typebox.TObject<{
5
+ title: _sinclair_typebox.TString;
6
+ link: _sinclair_typebox.TString;
7
+ description: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
8
+ updated: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
9
+ items: _sinclair_typebox.TArray<_sinclair_typebox.TObject<{
10
+ title: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
11
+ link: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
12
+ creator: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
13
+ content: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
14
+ pubDate: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
15
+ }>>;
16
+ }>;
17
+ type RssSchema = Static<typeof rssSchema>;
18
+
19
+ export { type RssSchema, rssSchema };
@@ -0,0 +1,2 @@
1
+ /*! Enpage - Copyright (C) 2024 Flippable - https://github.com/enpage/enpage/blob/main/LICENSE */
2
+ import{Type as t}from"@sinclair/typebox";var i=t.Object({title:t.String({title:"Title",description:"The title of the RSS feed"}),link:t.String({title:"Link",description:"The link to the RSS feed"}),description:t.Optional(t.String({title:"Description",description:"The description of the RSS feed"})),updated:t.Optional(t.String({title:"Updated",description:"The last updated date of the RSS feed"})),items:t.Array(t.Object({title:t.Optional(t.String({title:"Title",description:"The title of the RSS feed item"})),link:t.Optional(t.String({title:"Link",description:"The link to the RSS feed item"})),creator:t.Optional(t.String({title:"Creator",description:"The creator of the RSS feed item"})),content:t.Optional(t.String({title:"Content",description:"The content of the RSS feed item"})),pubDate:t.Optional(t.String({title:"Pub Date",description:"The publication date of the RSS feed item"}))}))});export{i as rssSchema};
@@ -0,0 +1,19 @@
1
+ import { ThreadsMediaSchema } from './schema.js';
2
+ import { MetaOAuthConfig } from '../../meta/oauth/config.js';
3
+ import { a as DatasourceFetcher } from '../../../../datasources-DAysbbXK.js';
4
+ import { MetaOptions } from '../../meta/options.js';
5
+ import '@sinclair/typebox';
6
+ import 'zod';
7
+ import '../../../../attributes.js';
8
+ import '../../../../themes/color-system.js';
9
+ import '../../../../theme.js';
10
+ import 'chroma-js';
11
+ import '../../../../bricks.js';
12
+ import '../../../../manifest.js';
13
+
14
+ /**
15
+ * todo: add a way to retrieve media/posts from Threads for a given user other than "me"
16
+ */
17
+ declare const fetchThreadsMediaDatasource: DatasourceFetcher<ThreadsMediaSchema, MetaOAuthConfig, MetaOptions>;
18
+
19
+ export { fetchThreadsMediaDatasource as default };
@@ -0,0 +1,2 @@
1
+ /*! Enpage - Copyright (C) 2024 Flippable - https://github.com/enpage/enpage/blob/main/LICENSE */
2
+ import{Type as e}from"@sinclair/typebox";var m=e.Object({data:e.Array(e.Object({id:e.String(),media_product_type:e.Literal("THREADS"),media_type:e.Union([e.Literal("TEXT_POST"),e.Literal("IMAGE"),e.Literal("VIDEO"),e.Literal("CAROUSEL_ALBUM"),e.Literal("AUDIO"),e.Literal("REPOST_FACADE")]),media_url:e.String(),permalink:e.String(),owner:e.Object({id:e.String()}),username:e.String(),text:e.String(),timestamp:e.String(),thumbnail_url:e.String(),shortcode:e.String(),is_quote_post:e.Boolean()})),paging:e.Object({cursors:e.Object({before:e.String(),after:e.String()})})});var p="Invariant failed";function c(t,r){if(t)return;let a=typeof r=="function"?r():r,i=a?`${p}: ${a}`:p;throw new Error(i)}import{UnauthorizedError as u}from"http-errors-enhanced";function h(t){return Object.fromEntries(Object.entries(t).map(([r,a])=>[r,a.toString()]))}import S from"ajv";import j from"ajv-formats";var s=new S({useDefaults:!0});j(s,["date-time","time","date","email","hostname","ipv4","ipv6","uri","uri-reference","uuid","uri-template","json-pointer","relative-json-pointer","regex"]);s.addFormat("date-object",{validate:t=>t instanceof Date&&!Number.isNaN(t.getTime()),async:!1});function f(t){return!t||t.length===0?"Unknown validation error":t.map(r=>{let{instancePath:a,message:i,params:o}=r,n=a||"root",d=Object.entries(o||{}).map(([l,g])=>`${l}: ${g}`).join(", ");return`${n} ${i} (${d})`}).join("; ")}var y=async({options:t,oauth:r})=>{c(r?.config,"fetchThreadsMediaDatasource Error: OAuth config is required");let a=new URLSearchParams({...h(t),access_token:r.config.accessToken,fields:["id","media_product_type","media_type","media_url","permalink","owner","username","text","timestamp","shortcode","thumbnail_url","children","is_quote_post"].join(",")}),i=await fetch(`https://graph.threads.net/v1.0/me/threads?${a.toString()}`);if(!i.ok)throw i.status===401?new u("fetchThreadsMediaDatasource Error: Unauthorized."):new Error(`fetchThreadsMediaDatasource Error: Response status: ${i.status}`);let o=await i.json(),n=s.compile(m);if(!n(o))throw new Error(`fetchThreadsMediaDatasource Error: Invalid Threads response data: ${f(n.errors)}`);return o},R=y;export{R as default};
@@ -0,0 +1,30 @@
1
+ import * as _sinclair_typebox from '@sinclair/typebox';
2
+ import { Static } from '@sinclair/typebox';
3
+
4
+ declare const threadsMediaSchema: _sinclair_typebox.TObject<{
5
+ data: _sinclair_typebox.TArray<_sinclair_typebox.TObject<{
6
+ id: _sinclair_typebox.TString;
7
+ media_product_type: _sinclair_typebox.TLiteral<"THREADS">;
8
+ media_type: _sinclair_typebox.TUnion<[_sinclair_typebox.TLiteral<"TEXT_POST">, _sinclair_typebox.TLiteral<"IMAGE">, _sinclair_typebox.TLiteral<"VIDEO">, _sinclair_typebox.TLiteral<"CAROUSEL_ALBUM">, _sinclair_typebox.TLiteral<"AUDIO">, _sinclair_typebox.TLiteral<"REPOST_FACADE">]>;
9
+ media_url: _sinclair_typebox.TString;
10
+ permalink: _sinclair_typebox.TString;
11
+ owner: _sinclair_typebox.TObject<{
12
+ id: _sinclair_typebox.TString;
13
+ }>;
14
+ username: _sinclair_typebox.TString;
15
+ text: _sinclair_typebox.TString;
16
+ timestamp: _sinclair_typebox.TString;
17
+ thumbnail_url: _sinclair_typebox.TString;
18
+ shortcode: _sinclair_typebox.TString;
19
+ is_quote_post: _sinclair_typebox.TBoolean;
20
+ }>>;
21
+ paging: _sinclair_typebox.TObject<{
22
+ cursors: _sinclair_typebox.TObject<{
23
+ before: _sinclair_typebox.TString;
24
+ after: _sinclair_typebox.TString;
25
+ }>;
26
+ }>;
27
+ }>;
28
+ type ThreadsMediaSchema = Static<typeof threadsMediaSchema>;
29
+
30
+ export { type ThreadsMediaSchema, threadsMediaSchema };
@@ -0,0 +1,2 @@
1
+ /*! Enpage - Copyright (C) 2024 Flippable - https://github.com/enpage/enpage/blob/main/LICENSE */
2
+ import{Type as t}from"@sinclair/typebox";var r=t.Object({data:t.Array(t.Object({id:t.String(),media_product_type:t.Literal("THREADS"),media_type:t.Union([t.Literal("TEXT_POST"),t.Literal("IMAGE"),t.Literal("VIDEO"),t.Literal("CAROUSEL_ALBUM"),t.Literal("AUDIO"),t.Literal("REPOST_FACADE")]),media_url:t.String(),permalink:t.String(),owner:t.Object({id:t.String()}),username:t.String(),text:t.String(),timestamp:t.String(),thumbnail_url:t.String(),shortcode:t.String(),is_quote_post:t.Boolean()})),paging:t.Object({cursors:t.Object({before:t.String(),after:t.String()})})});export{r as threadsMediaSchema};
@@ -0,0 +1,22 @@
1
+ import { O as OAuthConfig } from '../../../../datasources-DAysbbXK.js';
2
+ import '@sinclair/typebox';
3
+ import 'zod';
4
+ import '../../../../attributes.js';
5
+ import '../../../../themes/color-system.js';
6
+ import '../../../../theme.js';
7
+ import 'chroma-js';
8
+ import '../../../../bricks.js';
9
+ import '../../../../manifest.js';
10
+
11
+ interface TiktokOAuthConfig {
12
+ accessToken: string;
13
+ expiresIn: number;
14
+ openId: string;
15
+ refreshExpiresIn: number;
16
+ refreshToken: string;
17
+ scope: string;
18
+ tokenType: string;
19
+ }
20
+ type TiktokFullOAuthConfig = OAuthConfig<TiktokOAuthConfig>;
21
+
22
+ export type { TiktokFullOAuthConfig, TiktokOAuthConfig };
@@ -0,0 +1 @@
1
+ /*! Enpage - Copyright (C) 2024 Flippable - https://github.com/enpage/enpage/blob/main/LICENSE */
@@ -0,0 +1,16 @@
1
+ import { TiktokVideoOptions } from './options.js';
2
+ import { TiktokVideoResponseSchema } from './schema.js';
3
+ import { TiktokOAuthConfig } from '../oauth/config.js';
4
+ import { a as DatasourceFetcher } from '../../../../datasources-DAysbbXK.js';
5
+ import '@sinclair/typebox';
6
+ import 'zod';
7
+ import '../../../../attributes.js';
8
+ import '../../../../themes/color-system.js';
9
+ import '../../../../theme.js';
10
+ import 'chroma-js';
11
+ import '../../../../bricks.js';
12
+ import '../../../../manifest.js';
13
+
14
+ declare const fetchTiktokVideoDatasource: DatasourceFetcher<TiktokVideoResponseSchema, TiktokOAuthConfig, TiktokVideoOptions>;
15
+
16
+ export { fetchTiktokVideoDatasource as default };
@@ -0,0 +1,2 @@
1
+ /*! Enpage - Copyright (C) 2024 Flippable - https://github.com/enpage/enpage/blob/main/LICENSE */
2
+ import{Type as e}from"@sinclair/typebox";var m=e.Object({data:e.Object({has_more:e.Boolean(),cursor:e.Number(),videos:e.Array(e.Object({title:e.String(),video_description:e.String(),cover_image_url:e.String(),duration:e.Number(),embed_link:e.String(),id:e.String()}))}),error:e.Optional(e.Object({code:e.String(),message:e.String(),log_id:e.String()}))});import{UnauthorizedError as k}from"http-errors-enhanced";import f from"ajv";import h from"ajv-formats";var n=new f({useDefaults:!0});h(n,["date-time","time","date","email","hostname","ipv4","ipv6","uri","uri-reference","uuid","uri-template","json-pointer","relative-json-pointer","regex"]);n.addFormat("date-object",{validate:t=>t instanceof Date&&!Number.isNaN(t.getTime()),async:!1});function u(t){return!t||t.length===0?"Unknown validation error":t.map(r=>{let{instancePath:p,message:s,params:d}=r,c=p||"root",o=Object.entries(d||{}).map(([i,a])=>`${i}: ${a}`).join(", ");return`${c} ${s} (${o})`}).join("; ")}var l=async({options:t,oauth:r})=>{let s=`https://open.tiktokapis.com/v2/video/list/?${new URLSearchParams({access_token:r.config.accessToken,fields:["id","title","video_description","duration","cover_image_url","embed_link"].join(",")}).toString()}`,{nextRefreshDelay:d,...c}=t,o=await fetch(s,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${r.config.accessToken}`},body:JSON.stringify(c)});if(!o.ok)throw o.status===401?new k("fetchTiktokVideoDatasource Error: Unauthorized."):new Error(`Response status: ${o.status}`);let i=await o.json(),a=n.compile(m);if(!a(i))throw new Error(`fetchTiktokVideoDatasource Error: Invalid TikTok response data: ${u(a.errors)}`);return i},_=l;export{_ as default};
@@ -0,0 +1,10 @@
1
+ import * as _sinclair_typebox from '@sinclair/typebox';
2
+ import { Static } from '@sinclair/typebox';
3
+
4
+ declare const tiktokVideoOptions: _sinclair_typebox.TObject<{
5
+ nextRefreshDelay: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
6
+ maxCount: _sinclair_typebox.TNumber;
7
+ }>;
8
+ type TiktokVideoOptions = Static<typeof tiktokVideoOptions>;
9
+
10
+ export { type TiktokVideoOptions, tiktokVideoOptions };
@@ -0,0 +1,2 @@
1
+ /*! Enpage - Copyright (C) 2024 Flippable - https://github.com/enpage/enpage/blob/main/LICENSE */
2
+ import{Type as e}from"@sinclair/typebox";import{Type as t}from"@sinclair/typebox";import r from"zod";var o=t.Object({nextRefreshDelay:t.Optional(t.Number())}),i=["facebook-posts","instagram-feed","mastodon-status","rss","threads-media","tiktok-video","youtube-list","json"],n=r.enum(i);var d=e.Composite([o,e.Object({maxCount:e.Number()})]);export{d as tiktokVideoOptions};
@@ -0,0 +1,25 @@
1
+ import * as _sinclair_typebox from '@sinclair/typebox';
2
+ import { Static } from '@sinclair/typebox';
3
+
4
+ declare const tiktokVideoResponseSchema: _sinclair_typebox.TObject<{
5
+ data: _sinclair_typebox.TObject<{
6
+ has_more: _sinclair_typebox.TBoolean;
7
+ cursor: _sinclair_typebox.TNumber;
8
+ videos: _sinclair_typebox.TArray<_sinclair_typebox.TObject<{
9
+ title: _sinclair_typebox.TString;
10
+ video_description: _sinclair_typebox.TString;
11
+ cover_image_url: _sinclair_typebox.TString;
12
+ duration: _sinclair_typebox.TNumber;
13
+ embed_link: _sinclair_typebox.TString;
14
+ id: _sinclair_typebox.TString;
15
+ }>>;
16
+ }>;
17
+ error: _sinclair_typebox.TOptional<_sinclair_typebox.TObject<{
18
+ code: _sinclair_typebox.TString;
19
+ message: _sinclair_typebox.TString;
20
+ log_id: _sinclair_typebox.TString;
21
+ }>>;
22
+ }>;
23
+ type TiktokVideoResponseSchema = Static<typeof tiktokVideoResponseSchema>;
24
+
25
+ export { type TiktokVideoResponseSchema, tiktokVideoResponseSchema };
@@ -0,0 +1,2 @@
1
+ /*! Enpage - Copyright (C) 2024 Flippable - https://github.com/enpage/enpage/blob/main/LICENSE */
2
+ import{Type as e}from"@sinclair/typebox";var i=e.Object({data:e.Object({has_more:e.Boolean(),cursor:e.Number(),videos:e.Array(e.Object({title:e.String(),video_description:e.String(),cover_image_url:e.String(),duration:e.Number(),embed_link:e.String(),id:e.String()}))}),error:e.Optional(e.Object({code:e.String(),message:e.String(),log_id:e.String()}))});export{i as tiktokVideoResponseSchema};
@@ -0,0 +1,16 @@
1
+ import { YoutubeListOptions } from './options.js';
2
+ import { YoutubeListSchema } from './schema.js';
3
+ import { a as DatasourceFetcher } from '../../../../datasources-DAysbbXK.js';
4
+ import { YoutubeOAuthConfig } from '../oauth/config.js';
5
+ import '@sinclair/typebox';
6
+ import 'zod';
7
+ import '../../../../attributes.js';
8
+ import '../../../../themes/color-system.js';
9
+ import '../../../../theme.js';
10
+ import 'chroma-js';
11
+ import '../../../../bricks.js';
12
+ import '../../../../manifest.js';
13
+
14
+ declare const fetchYoutubeList: DatasourceFetcher<YoutubeListSchema, YoutubeOAuthConfig, YoutubeListOptions>;
15
+
16
+ export { fetchYoutubeList as default };
@@ -0,0 +1,2 @@
1
+ /*! Enpage - Copyright (C) 2024 Flippable - https://github.com/enpage/enpage/blob/main/LICENSE */
2
+ import{Type as t}from"@sinclair/typebox";var m=t.Object({etag:t.String(),nextPageToken:t.String(),regionCode:t.String(),pageInfo:t.Object({totalResults:t.Number(),resultsPerPage:t.Number()}),items:t.Array(t.Object({etag:t.String(),id:t.Object({videoId:t.String(),channelId:t.String(),playlistId:t.String()}),snippet:t.Object({publishedAt:t.String(),channelId:t.String(),title:t.String(),description:t.String(),thumbnails:t.Object({default:t.Object({url:t.String(),width:t.Number(),height:t.Number()}),standard:t.Object({url:t.String(),width:t.Number(),height:t.Number()})}),channelTitle:t.String(),liveBroadcastContent:t.String()})}))});import{UnauthorizedError as p}from"http-errors-enhanced";function b(e){return Object.fromEntries(Object.entries(e).map(([o,i])=>[o,i.toString()]))}import g from"ajv";import l from"ajv-formats";var s=new g({useDefaults:!0});l(s,["date-time","time","date","email","hostname","ipv4","ipv6","uri","uri-reference","uuid","uri-template","json-pointer","relative-json-pointer","regex"]);s.addFormat("date-object",{validate:e=>e instanceof Date&&!Number.isNaN(e.getTime()),async:!1});function d(e){return!e||e.length===0?"Unknown validation error":e.map(o=>{let{instancePath:i,message:u,params:r}=o,n=i||"root",a=Object.entries(r||{}).map(([c,h])=>`${c}: ${h}`).join(", ");return`${n} ${u} (${a})`}).join("; ")}var f=async({options:e,oauth:o})=>{let u=`https://www.googleapis.com/youtube/v3/search?${new URLSearchParams({...b(e),part:"snippet,id",type:"video",videoEmbeddable:"true",access_token:o.config.accessToken})}`,r=await fetch(u);if(!r.ok)throw r.status===401?new p("fetchYoutubeList Error: Unauthorized."):new Error(`fetchYoutubeList Error: Response status: ${r.status}`);let n=await r.json(),a=s.compile(m);if(!a(n))throw new Error(`fetchYoutubeList Error: Invalid Youtube response data: ${d(a.errors)}`);return n},A=f;export{A as default};