@liase/core 1.0.0

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 (162) hide show
  1. package/LICENSE +9 -0
  2. package/README.md +62 -0
  3. package/dist/ActionContext.d.ts +603 -0
  4. package/dist/ActionContext.d.ts.map +1 -0
  5. package/dist/ActionContext.js +227 -0
  6. package/dist/DomSelection.d.ts +30 -0
  7. package/dist/DomSelection.d.ts.map +1 -0
  8. package/dist/DomSelection.js +60 -0
  9. package/dist/Liase.d.ts +40 -0
  10. package/dist/Liase.d.ts.map +1 -0
  11. package/dist/Liase.js +105 -0
  12. package/dist/LiaseQuery.d.ts +593 -0
  13. package/dist/LiaseQuery.d.ts.map +1 -0
  14. package/dist/LiaseQuery.js +145 -0
  15. package/dist/actionHelpers.d.ts +30 -0
  16. package/dist/actionHelpers.d.ts.map +1 -0
  17. package/dist/actionHelpers.js +73 -0
  18. package/dist/constructorExecution.d.ts +7 -0
  19. package/dist/constructorExecution.d.ts.map +1 -0
  20. package/dist/constructorExecution.js +149 -0
  21. package/dist/generateResponse.d.ts +14 -0
  22. package/dist/generateResponse.d.ts.map +1 -0
  23. package/dist/generateResponse.js +88 -0
  24. package/dist/index.d.ts +13 -0
  25. package/dist/index.d.ts.map +1 -0
  26. package/dist/index.js +6 -0
  27. package/dist/lib/fetch.d.ts +10 -0
  28. package/dist/lib/fetch.d.ts.map +1 -0
  29. package/dist/lib/fetch.js +68 -0
  30. package/dist/lib/hooks.d.ts +7 -0
  31. package/dist/lib/hooks.d.ts.map +1 -0
  32. package/dist/lib/hooks.js +13 -0
  33. package/dist/lib/networkRequestsCache.d.ts +23 -0
  34. package/dist/lib/networkRequestsCache.d.ts.map +1 -0
  35. package/dist/lib/networkRequestsCache.js +81 -0
  36. package/dist/lib/networkRequestsHistory.d.ts +21 -0
  37. package/dist/lib/networkRequestsHistory.d.ts.map +1 -0
  38. package/dist/lib/networkRequestsHistory.js +119 -0
  39. package/dist/lib/time.d.ts +2 -0
  40. package/dist/lib/time.d.ts.map +1 -0
  41. package/dist/lib/time.js +31 -0
  42. package/dist/lib/utils.d.ts +46 -0
  43. package/dist/lib/utils.d.ts.map +1 -0
  44. package/dist/lib/utils.js +208 -0
  45. package/dist/lib/zod.d.ts +35 -0
  46. package/dist/lib/zod.d.ts.map +1 -0
  47. package/dist/lib/zod.js +290 -0
  48. package/dist/loadUrl.d.ts +45 -0
  49. package/dist/loadUrl.d.ts.map +1 -0
  50. package/dist/loadUrl.js +111 -0
  51. package/dist/plugins/built-in-sources/bluesky/client.d.ts +11 -0
  52. package/dist/plugins/built-in-sources/bluesky/client.d.ts.map +1 -0
  53. package/dist/plugins/built-in-sources/bluesky/client.js +17 -0
  54. package/dist/plugins/built-in-sources/bluesky/index.d.ts +1115 -0
  55. package/dist/plugins/built-in-sources/bluesky/index.d.ts.map +1 -0
  56. package/dist/plugins/built-in-sources/bluesky/index.js +14 -0
  57. package/dist/plugins/built-in-sources/bluesky/requestHandlers/feed.d.ts +378 -0
  58. package/dist/plugins/built-in-sources/bluesky/requestHandlers/feed.d.ts.map +1 -0
  59. package/dist/plugins/built-in-sources/bluesky/requestHandlers/feed.js +77 -0
  60. package/dist/plugins/built-in-sources/bluesky/requestHandlers/mediaSearch.d.ts +390 -0
  61. package/dist/plugins/built-in-sources/bluesky/requestHandlers/mediaSearch.d.ts.map +1 -0
  62. package/dist/plugins/built-in-sources/bluesky/requestHandlers/mediaSearch.js +87 -0
  63. package/dist/plugins/built-in-sources/bluesky/requestHandlers/singleMedia.d.ts +351 -0
  64. package/dist/plugins/built-in-sources/bluesky/requestHandlers/singleMedia.d.ts.map +1 -0
  65. package/dist/plugins/built-in-sources/bluesky/requestHandlers/singleMedia.js +56 -0
  66. package/dist/plugins/built-in-sources/bluesky/shared.d.ts +53 -0
  67. package/dist/plugins/built-in-sources/bluesky/shared.d.ts.map +1 -0
  68. package/dist/plugins/built-in-sources/bluesky/shared.js +127 -0
  69. package/dist/plugins/built-in-sources/bluesky/types.d.ts +488 -0
  70. package/dist/plugins/built-in-sources/bluesky/types.d.ts.map +1 -0
  71. package/dist/plugins/built-in-sources/bluesky/types.js +48 -0
  72. package/dist/plugins/built-in-sources/giphy/index.d.ts +584 -0
  73. package/dist/plugins/built-in-sources/giphy/index.d.ts.map +1 -0
  74. package/dist/plugins/built-in-sources/giphy/index.js +9 -0
  75. package/dist/plugins/built-in-sources/giphy/requestHandlers/mediaSearch.d.ts +310 -0
  76. package/dist/plugins/built-in-sources/giphy/requestHandlers/mediaSearch.d.ts.map +1 -0
  77. package/dist/plugins/built-in-sources/giphy/requestHandlers/mediaSearch.js +71 -0
  78. package/dist/plugins/built-in-sources/giphy/requestHandlers/singleMedia.d.ts +274 -0
  79. package/dist/plugins/built-in-sources/giphy/requestHandlers/singleMedia.d.ts.map +1 -0
  80. package/dist/plugins/built-in-sources/giphy/requestHandlers/singleMedia.js +43 -0
  81. package/dist/plugins/built-in-sources/giphy/shared.d.ts +24 -0
  82. package/dist/plugins/built-in-sources/giphy/shared.d.ts.map +1 -0
  83. package/dist/plugins/built-in-sources/giphy/shared.js +30 -0
  84. package/dist/plugins/built-in-sources/giphy/types.d.ts +398 -0
  85. package/dist/plugins/built-in-sources/giphy/types.d.ts.map +1 -0
  86. package/dist/plugins/built-in-sources/giphy/types.js +46 -0
  87. package/dist/plugins/built-in-sources/index.d.ts +1698 -0
  88. package/dist/plugins/built-in-sources/index.d.ts.map +1 -0
  89. package/dist/plugins/built-in-sources/index.js +5 -0
  90. package/dist/schemas/constructor.d.ts +14 -0
  91. package/dist/schemas/constructor.d.ts.map +1 -0
  92. package/dist/schemas/constructor.js +33 -0
  93. package/dist/schemas/file.d.ts +124 -0
  94. package/dist/schemas/file.d.ts.map +1 -0
  95. package/dist/schemas/file.js +28 -0
  96. package/dist/schemas/finderOptions.d.ts +389 -0
  97. package/dist/schemas/finderOptions.d.ts.map +1 -0
  98. package/dist/schemas/finderOptions.js +7 -0
  99. package/dist/schemas/media.d.ts +433 -0
  100. package/dist/schemas/media.d.ts.map +1 -0
  101. package/dist/schemas/media.js +81 -0
  102. package/dist/schemas/plugin.d.ts +298 -0
  103. package/dist/schemas/plugin.d.ts.map +1 -0
  104. package/dist/schemas/plugin.js +19 -0
  105. package/dist/schemas/primitives.d.ts +4 -0
  106. package/dist/schemas/primitives.d.ts.map +1 -0
  107. package/dist/schemas/primitives.js +11 -0
  108. package/dist/schemas/queryOptions.d.ts +19 -0
  109. package/dist/schemas/queryOptions.d.ts.map +1 -0
  110. package/dist/schemas/queryOptions.js +9 -0
  111. package/dist/schemas/request.d.ts +77 -0
  112. package/dist/schemas/request.d.ts.map +1 -0
  113. package/dist/schemas/request.js +21 -0
  114. package/dist/schemas/requestHandler.d.ts +126 -0
  115. package/dist/schemas/requestHandler.d.ts.map +1 -0
  116. package/dist/schemas/requestHandler.js +26 -0
  117. package/dist/schemas/response.d.ts +4673 -0
  118. package/dist/schemas/response.d.ts.map +1 -0
  119. package/dist/schemas/response.js +51 -0
  120. package/dist/schemas/secrets.d.ts +4 -0
  121. package/dist/schemas/secrets.d.ts.map +1 -0
  122. package/dist/schemas/secrets.js +2 -0
  123. package/dist/schemas/source.d.ts +202 -0
  124. package/dist/schemas/source.d.ts.map +1 -0
  125. package/dist/schemas/source.js +10 -0
  126. package/dist/test/fixtures/currentTimeSource.d.ts +53 -0
  127. package/dist/test/fixtures/currentTimeSource.d.ts.map +1 -0
  128. package/dist/test/fixtures/currentTimeSource.js +76 -0
  129. package/dist/test/fixtures/examplePlugin.d.ts +266 -0
  130. package/dist/test/fixtures/examplePlugin.d.ts.map +1 -0
  131. package/dist/test/fixtures/examplePlugin.js +4 -0
  132. package/dist/test/fixtures/exampleSource.d.ts +265 -0
  133. package/dist/test/fixtures/exampleSource.d.ts.map +1 -0
  134. package/dist/test/fixtures/exampleSource.js +107 -0
  135. package/dist/test/testFiles/internal/caching.test.d.ts +2 -0
  136. package/dist/test/testFiles/internal/caching.test.d.ts.map +1 -0
  137. package/dist/test/testFiles/internal/caching.test.js +116 -0
  138. package/dist/test/testFiles/internal/mediaTypeGuessing.test.d.ts +2 -0
  139. package/dist/test/testFiles/internal/mediaTypeGuessing.test.d.ts.map +1 -0
  140. package/dist/test/testFiles/internal/mediaTypeGuessing.test.js +86 -0
  141. package/dist/test/testFiles/sources/bluesky.test.d.ts +2 -0
  142. package/dist/test/testFiles/sources/bluesky.test.d.ts.map +1 -0
  143. package/dist/test/testFiles/sources/bluesky.test.js +40 -0
  144. package/dist/test/testFiles/sources/exampleSource.test.d.ts +2 -0
  145. package/dist/test/testFiles/sources/exampleSource.test.d.ts.map +1 -0
  146. package/dist/test/testFiles/sources/exampleSource.test.js +27 -0
  147. package/dist/test/testFiles/sources/giphy.test.d.ts +2 -0
  148. package/dist/test/testFiles/sources/giphy.test.d.ts.map +1 -0
  149. package/dist/test/testFiles/sources/giphy.test.js +17 -0
  150. package/dist/test/utils/general.d.ts +3 -0
  151. package/dist/test/utils/general.d.ts.map +1 -0
  152. package/dist/test/utils/general.js +24 -0
  153. package/dist/test/utils/globalSetup.d.ts +3 -0
  154. package/dist/test/utils/globalSetup.d.ts.map +1 -0
  155. package/dist/test/utils/globalSetup.js +12 -0
  156. package/dist/test/utils/vitest.d.ts +551 -0
  157. package/dist/test/utils/vitest.d.ts.map +1 -0
  158. package/dist/test/utils/vitest.js +166 -0
  159. package/dist/types.d.ts +16 -0
  160. package/dist/types.d.ts.map +1 -0
  161. package/dist/types.js +1 -0
  162. package/package.json +67 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugins/built-in-sources/bluesky/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA,wBASmB"}
@@ -0,0 +1,14 @@
1
+ import feedReqHandler from "./requestHandlers/feed.js";
2
+ import mediaSearchReqHandler from "./requestHandlers/mediaSearch.js";
3
+ import singleMediaReqHandler from "./requestHandlers/singleMedia.js";
4
+ import { sourceId } from "./shared.js";
5
+ export default {
6
+ id: sourceId,
7
+ displayName: "Bluesky",
8
+ description: "A decentralised twitter-like social network",
9
+ requestHandlers: [
10
+ singleMediaReqHandler,
11
+ mediaSearchReqHandler,
12
+ feedReqHandler,
13
+ ],
14
+ };
@@ -0,0 +1,378 @@
1
+ import { z } from "zod";
2
+ declare const _default: {
3
+ readonly id: "feed";
4
+ readonly displayName: "Feed";
5
+ readonly description: "Get all media in a feed";
6
+ readonly requestSchema: z.ZodObject<{
7
+ source: z.ZodString;
8
+ queryType: z.ZodString;
9
+ feedId: z.ZodString;
10
+ cursor: z.ZodOptional<z.ZodString>;
11
+ maxPostCount: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
12
+ }, "strict", z.ZodTypeAny, {
13
+ source: string;
14
+ queryType: string;
15
+ feedId: string;
16
+ maxPostCount: number;
17
+ cursor?: string | undefined;
18
+ }, {
19
+ source: string;
20
+ queryType: string;
21
+ feedId: string;
22
+ cursor?: string | undefined;
23
+ maxPostCount?: number | undefined;
24
+ }>;
25
+ readonly secretsSchema: z.ZodObject<{
26
+ handle: z.ZodOptional<z.ZodString>;
27
+ password: z.ZodOptional<z.ZodString>;
28
+ serviceUrl: z.ZodOptional<z.ZodString>;
29
+ }, "strict", z.ZodTypeAny, {
30
+ password?: string | undefined;
31
+ handle?: string | undefined;
32
+ serviceUrl?: string | undefined;
33
+ }, {
34
+ password?: string | undefined;
35
+ handle?: string | undefined;
36
+ serviceUrl?: string | undefined;
37
+ }>;
38
+ readonly paginationType: "cursor";
39
+ readonly responses: [{
40
+ readonly schema: z.ZodObject<{
41
+ page: z.ZodObject<{
42
+ paginationType: z.ZodLiteral<"cursor">;
43
+ cursor: z.ZodOptional<z.ZodString>;
44
+ nextCursor: z.ZodNullable<z.ZodString>;
45
+ isLastPage: z.ZodBoolean;
46
+ pageFetchLimitReached: z.ZodBoolean;
47
+ }, "strict", z.ZodTypeAny, {
48
+ paginationType: "cursor";
49
+ isLastPage: boolean;
50
+ pageFetchLimitReached: boolean;
51
+ nextCursor: string | null;
52
+ cursor?: string | undefined;
53
+ }, {
54
+ paginationType: "cursor";
55
+ isLastPage: boolean;
56
+ pageFetchLimitReached: boolean;
57
+ nextCursor: string | null;
58
+ cursor?: string | undefined;
59
+ }>;
60
+ media: z.ZodArray<z.ZodObject<{
61
+ mediaFinderSource: z.ZodLiteral<"bluesky">;
62
+ id: z.ZodString;
63
+ title: z.ZodString;
64
+ url: z.ZodString;
65
+ dateUploaded: z.ZodDate;
66
+ usernameOfUploader: z.ZodString;
67
+ nameOfUploader: z.ZodString;
68
+ files: z.ZodTuple<[z.ZodObject<{
69
+ url: z.ZodString;
70
+ ext: z.ZodString;
71
+ mimeType: z.ZodString;
72
+ image: z.ZodBoolean;
73
+ video: z.ZodBoolean;
74
+ fileSize: z.ZodOptional<z.ZodNumber>;
75
+ aspectRatio: z.ZodOptional<z.ZodObject<{
76
+ height: z.ZodNumber;
77
+ width: z.ZodNumber;
78
+ }, "strict", z.ZodTypeAny, {
79
+ width: number;
80
+ height: number;
81
+ }, {
82
+ width: number;
83
+ height: number;
84
+ }>>;
85
+ } & {
86
+ type: z.ZodLiteral<"full">;
87
+ }, "strict", z.ZodTypeAny, {
88
+ mimeType: string;
89
+ ext: string;
90
+ video: boolean;
91
+ image: boolean;
92
+ url: string;
93
+ type: "full";
94
+ fileSize?: number | undefined;
95
+ aspectRatio?: {
96
+ width: number;
97
+ height: number;
98
+ } | undefined;
99
+ }, {
100
+ mimeType: string;
101
+ ext: string;
102
+ video: boolean;
103
+ image: boolean;
104
+ url: string;
105
+ type: "full";
106
+ fileSize?: number | undefined;
107
+ aspectRatio?: {
108
+ width: number;
109
+ height: number;
110
+ } | undefined;
111
+ }>, z.ZodObject<{
112
+ url: z.ZodString;
113
+ ext: z.ZodString;
114
+ mimeType: z.ZodString;
115
+ image: z.ZodBoolean;
116
+ video: z.ZodBoolean;
117
+ fileSize: z.ZodOptional<z.ZodNumber>;
118
+ aspectRatio: z.ZodOptional<z.ZodObject<{
119
+ height: z.ZodNumber;
120
+ width: z.ZodNumber;
121
+ }, "strict", z.ZodTypeAny, {
122
+ width: number;
123
+ height: number;
124
+ }, {
125
+ width: number;
126
+ height: number;
127
+ }>>;
128
+ } & {
129
+ type: z.ZodLiteral<"thumbnail">;
130
+ }, "strict", z.ZodTypeAny, {
131
+ mimeType: string;
132
+ ext: string;
133
+ video: boolean;
134
+ image: boolean;
135
+ url: string;
136
+ type: "thumbnail";
137
+ fileSize?: number | undefined;
138
+ aspectRatio?: {
139
+ width: number;
140
+ height: number;
141
+ } | undefined;
142
+ }, {
143
+ mimeType: string;
144
+ ext: string;
145
+ video: boolean;
146
+ image: boolean;
147
+ url: string;
148
+ type: "thumbnail";
149
+ fileSize?: number | undefined;
150
+ aspectRatio?: {
151
+ width: number;
152
+ height: number;
153
+ } | undefined;
154
+ }>], null>;
155
+ contentHash: z.ZodString;
156
+ }, "strict", z.ZodTypeAny, {
157
+ url: string;
158
+ id: string;
159
+ contentHash: string;
160
+ mediaFinderSource: "bluesky";
161
+ files: [{
162
+ mimeType: string;
163
+ ext: string;
164
+ video: boolean;
165
+ image: boolean;
166
+ url: string;
167
+ type: "full";
168
+ fileSize?: number | undefined;
169
+ aspectRatio?: {
170
+ width: number;
171
+ height: number;
172
+ } | undefined;
173
+ }, {
174
+ mimeType: string;
175
+ ext: string;
176
+ video: boolean;
177
+ image: boolean;
178
+ url: string;
179
+ type: "thumbnail";
180
+ fileSize?: number | undefined;
181
+ aspectRatio?: {
182
+ width: number;
183
+ height: number;
184
+ } | undefined;
185
+ }];
186
+ nameOfUploader: string;
187
+ usernameOfUploader: string;
188
+ title: string;
189
+ dateUploaded: Date;
190
+ }, {
191
+ url: string;
192
+ id: string;
193
+ contentHash: string;
194
+ mediaFinderSource: "bluesky";
195
+ files: [{
196
+ mimeType: string;
197
+ ext: string;
198
+ video: boolean;
199
+ image: boolean;
200
+ url: string;
201
+ type: "full";
202
+ fileSize?: number | undefined;
203
+ aspectRatio?: {
204
+ width: number;
205
+ height: number;
206
+ } | undefined;
207
+ }, {
208
+ mimeType: string;
209
+ ext: string;
210
+ video: boolean;
211
+ image: boolean;
212
+ url: string;
213
+ type: "thumbnail";
214
+ fileSize?: number | undefined;
215
+ aspectRatio?: {
216
+ width: number;
217
+ height: number;
218
+ } | undefined;
219
+ }];
220
+ nameOfUploader: string;
221
+ usernameOfUploader: string;
222
+ title: string;
223
+ dateUploaded: Date;
224
+ }>, "many">;
225
+ request: z.ZodRecord<z.ZodString, z.ZodUnknown>;
226
+ }, "strict", z.ZodTypeAny, {
227
+ page: {
228
+ paginationType: "cursor";
229
+ isLastPage: boolean;
230
+ pageFetchLimitReached: boolean;
231
+ nextCursor: string | null;
232
+ cursor?: string | undefined;
233
+ };
234
+ media: {
235
+ url: string;
236
+ id: string;
237
+ contentHash: string;
238
+ mediaFinderSource: "bluesky";
239
+ files: [{
240
+ mimeType: string;
241
+ ext: string;
242
+ video: boolean;
243
+ image: boolean;
244
+ url: string;
245
+ type: "full";
246
+ fileSize?: number | undefined;
247
+ aspectRatio?: {
248
+ width: number;
249
+ height: number;
250
+ } | undefined;
251
+ }, {
252
+ mimeType: string;
253
+ ext: string;
254
+ video: boolean;
255
+ image: boolean;
256
+ url: string;
257
+ type: "thumbnail";
258
+ fileSize?: number | undefined;
259
+ aspectRatio?: {
260
+ width: number;
261
+ height: number;
262
+ } | undefined;
263
+ }];
264
+ nameOfUploader: string;
265
+ usernameOfUploader: string;
266
+ title: string;
267
+ dateUploaded: Date;
268
+ }[];
269
+ request: Record<string, unknown>;
270
+ }, {
271
+ page: {
272
+ paginationType: "cursor";
273
+ isLastPage: boolean;
274
+ pageFetchLimitReached: boolean;
275
+ nextCursor: string | null;
276
+ cursor?: string | undefined;
277
+ };
278
+ media: {
279
+ url: string;
280
+ id: string;
281
+ contentHash: string;
282
+ mediaFinderSource: "bluesky";
283
+ files: [{
284
+ mimeType: string;
285
+ ext: string;
286
+ video: boolean;
287
+ image: boolean;
288
+ url: string;
289
+ type: "full";
290
+ fileSize?: number | undefined;
291
+ aspectRatio?: {
292
+ width: number;
293
+ height: number;
294
+ } | undefined;
295
+ }, {
296
+ mimeType: string;
297
+ ext: string;
298
+ video: boolean;
299
+ image: boolean;
300
+ url: string;
301
+ type: "thumbnail";
302
+ fileSize?: number | undefined;
303
+ aspectRatio?: {
304
+ width: number;
305
+ height: number;
306
+ } | undefined;
307
+ }];
308
+ nameOfUploader: string;
309
+ usernameOfUploader: string;
310
+ title: string;
311
+ dateUploaded: Date;
312
+ }[];
313
+ request: Record<string, unknown>;
314
+ }>;
315
+ readonly constructor: {
316
+ readonly _setup: ($: import("../../../../ActionContext.js").ActionContext) => Promise<import("@atproto/api/dist/client/types/app/bsky/feed/getFeed.js").OutputSchema>;
317
+ readonly page: {
318
+ readonly paginationType: () => string;
319
+ readonly cursor: ($: import("../../../../ActionContext.js").ActionContext) => any;
320
+ readonly nextCursor: ($: import("../../../../ActionContext.js").ActionContext) => any;
321
+ readonly isLastPage: ($: import("../../../../ActionContext.js").ActionContext) => boolean;
322
+ readonly pageFetchLimitReached: ($: import("../../../../ActionContext.js").ActionContext) => boolean | undefined;
323
+ };
324
+ readonly media: {
325
+ _arrayMap: ($: import("../../../../ActionContext.js").ActionContext) => {
326
+ id: string;
327
+ postCid: string;
328
+ postUri: string;
329
+ postUrl: string;
330
+ postTextContents: string;
331
+ fileCid: string;
332
+ altText: string;
333
+ mimeType: string;
334
+ filesize: number;
335
+ playlistUrl?: string;
336
+ thumbnailUrl: string;
337
+ fullsizeUrl?: string;
338
+ aspectRatio: {
339
+ width: number;
340
+ height: number;
341
+ };
342
+ author: {
343
+ did: string;
344
+ handle: string;
345
+ displayName: string;
346
+ avatarUrl: string;
347
+ createdAt: string;
348
+ };
349
+ languages: string[];
350
+ createdAt: string;
351
+ }[];
352
+ mediaFinderSource: string;
353
+ id: ($: import("../../../../ActionContext.js").ActionContext) => any;
354
+ contentHash: ($: import("../../../../ActionContext.js").ActionContext) => any;
355
+ title: ($: import("../../../../ActionContext.js").ActionContext) => any;
356
+ url: ($: import("../../../../ActionContext.js").ActionContext) => any;
357
+ dateUploaded: ($: import("../../../../ActionContext.js").ActionContext) => Date;
358
+ usernameOfUploader: ($: import("../../../../ActionContext.js").ActionContext) => any;
359
+ nameOfUploader: ($: import("../../../../ActionContext.js").ActionContext) => any;
360
+ files: {
361
+ _arrayMap: ($: import("../../../../ActionContext.js").ActionContext) => any[];
362
+ _setup: ($: import("../../../../ActionContext.js").ActionContext) => import("../../../../ActionContext.js").ActionContext;
363
+ type: ($: import("../../../../ActionContext.js").ActionContext) => any;
364
+ url: ($: import("../../../../ActionContext.js").ActionContext) => any;
365
+ ext: ($: import("../../../../ActionContext.js").ActionContext) => any;
366
+ mimeType: ($: import("../../../../ActionContext.js").ActionContext) => any;
367
+ image: ($: import("../../../../ActionContext.js").ActionContext) => any;
368
+ video: ($: import("../../../../ActionContext.js").ActionContext) => any;
369
+ fileSize: ($: import("../../../../ActionContext.js").ActionContext) => any;
370
+ aspectRatio: ($: import("../../../../ActionContext.js").ActionContext) => any;
371
+ }[];
372
+ }[];
373
+ readonly request: ($: import("../../../../ActionContext.js").ActionContext) => Record<string, any>;
374
+ };
375
+ }];
376
+ };
377
+ export default _default;
378
+ //# sourceMappingURL=feed.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"feed.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/built-in-sources/bluesky/requestHandlers/feed.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOxB,wBAuEoC"}
@@ -0,0 +1,77 @@
1
+ import { z } from "zod";
2
+ import { getAgent } from "../client.js";
3
+ import { postsToMediaResponseConstructor } from "../shared.js";
4
+ import { responseSchema } from "../types.js";
5
+ export default {
6
+ id: "feed",
7
+ displayName: "Feed",
8
+ description: "Get all media in a feed",
9
+ requestSchema: z
10
+ .object({
11
+ source: z.string(),
12
+ queryType: z.string(),
13
+ feedId: z.string(),
14
+ cursor: z.string().optional().describe("The page cursor"),
15
+ maxPostCount: z
16
+ .number()
17
+ .min(1)
18
+ .max(100)
19
+ .optional()
20
+ .default(25)
21
+ .describe("The max number of posts from which to extract media from"),
22
+ })
23
+ .strict(),
24
+ secretsSchema: z
25
+ .object({
26
+ handle: z.string().optional(),
27
+ password: z.string().optional(),
28
+ serviceUrl: z.string().optional(),
29
+ })
30
+ .strict(),
31
+ paginationType: "cursor",
32
+ responses: [
33
+ {
34
+ schema: responseSchema,
35
+ constructor: {
36
+ _setup: async ($) => {
37
+ const params = {
38
+ feed: $.request.feedId,
39
+ ...($.request.maxPostCount
40
+ ? { limit: $.request.maxPostCount }
41
+ : {}),
42
+ ...($.request.cursor ? { cursor: $.request.cursor } : {}),
43
+ };
44
+ let res;
45
+ try {
46
+ const agent = await getAgent({
47
+ $,
48
+ handle: $.secrets.handle,
49
+ password: $.secrets.password,
50
+ serviceUrl: $.secrets.serviceUrl,
51
+ });
52
+ const apiRes = await agent.app.bsky.feed.getFeed(params);
53
+ res = apiRes;
54
+ if (!apiRes.success) {
55
+ throw Error("Unsuccessful request to Bluesky");
56
+ }
57
+ return apiRes.data;
58
+ }
59
+ catch (error) {
60
+ console.info("Request sent to Bluesky:", params);
61
+ console.info("Response:", res);
62
+ throw error;
63
+ }
64
+ },
65
+ page: {
66
+ paginationType: () => "cursor",
67
+ cursor: ($) => $.request.cursor || "",
68
+ nextCursor: ($) => $().cursor ?? null,
69
+ isLastPage: ($) => typeof $().cursor === "undefined",
70
+ pageFetchLimitReached: ($) => $.pageFetchLimitReached,
71
+ },
72
+ media: postsToMediaResponseConstructor,
73
+ request: ($) => $.request,
74
+ },
75
+ },
76
+ ],
77
+ };