@crosspost/sdk 0.2.8 → 0.2.10

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.
package/dist/index.cjs CHANGED
@@ -369,29 +369,6 @@ async function makeRequest(method, path, options, data, query) {
369
369
  }
370
370
 
371
371
  // src/api/activity.ts
372
- function createFilterQuery(query) {
373
- if (!query) return {};
374
- const queryObj = query;
375
- const result = {};
376
- Object.keys(queryObj).forEach((key) => {
377
- if (key !== "filter") {
378
- result[key] = queryObj[key];
379
- }
380
- });
381
- if (queryObj.filter) {
382
- const filter = queryObj.filter;
383
- if (filter.platforms && Array.isArray(filter.platforms)) {
384
- result.platforms = filter.platforms.join(",");
385
- }
386
- if (filter.types && Array.isArray(filter.types)) {
387
- result.types = filter.types.join(",");
388
- }
389
- if (filter.timeframe) {
390
- result.timeframe = filter.timeframe;
391
- }
392
- }
393
- return result;
394
- }
395
372
  var ActivityApi = class {
396
373
  /**
397
374
  * Creates an instance of ActivityApi
@@ -411,7 +388,7 @@ var ActivityApi = class {
411
388
  "/api/activity",
412
389
  this.options,
413
390
  void 0,
414
- createFilterQuery(query)
391
+ query
415
392
  );
416
393
  }
417
394
  /**
@@ -426,7 +403,7 @@ var ActivityApi = class {
426
403
  `/api/activity/${signerId}`,
427
404
  this.options,
428
405
  void 0,
429
- createFilterQuery(query)
406
+ query
430
407
  );
431
408
  }
432
409
  /**
@@ -441,7 +418,7 @@ var ActivityApi = class {
441
418
  `/api/activity/${signerId}/posts`,
442
419
  this.options,
443
420
  void 0,
444
- createFilterQuery(query)
421
+ query
445
422
  );
446
423
  }
447
424
  };
package/dist/index.js CHANGED
@@ -326,29 +326,6 @@ async function makeRequest(method, path, options, data, query) {
326
326
  }
327
327
 
328
328
  // src/api/activity.ts
329
- function createFilterQuery(query) {
330
- if (!query) return {};
331
- const queryObj = query;
332
- const result = {};
333
- Object.keys(queryObj).forEach((key) => {
334
- if (key !== "filter") {
335
- result[key] = queryObj[key];
336
- }
337
- });
338
- if (queryObj.filter) {
339
- const filter = queryObj.filter;
340
- if (filter.platforms && Array.isArray(filter.platforms)) {
341
- result.platforms = filter.platforms.join(",");
342
- }
343
- if (filter.types && Array.isArray(filter.types)) {
344
- result.types = filter.types.join(",");
345
- }
346
- if (filter.timeframe) {
347
- result.timeframe = filter.timeframe;
348
- }
349
- }
350
- return result;
351
- }
352
329
  var ActivityApi = class {
353
330
  /**
354
331
  * Creates an instance of ActivityApi
@@ -368,7 +345,7 @@ var ActivityApi = class {
368
345
  "/api/activity",
369
346
  this.options,
370
347
  void 0,
371
- createFilterQuery(query)
348
+ query
372
349
  );
373
350
  }
374
351
  /**
@@ -383,7 +360,7 @@ var ActivityApi = class {
383
360
  `/api/activity/${signerId}`,
384
361
  this.options,
385
362
  void 0,
386
- createFilterQuery(query)
363
+ query
387
364
  );
388
365
  }
389
366
  /**
@@ -398,7 +375,7 @@ var ActivityApi = class {
398
375
  `/api/activity/${signerId}/posts`,
399
376
  this.options,
400
377
  void 0,
401
- createFilterQuery(query)
378
+ query
402
379
  );
403
380
  }
404
381
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crosspost/sdk",
3
- "version": "0.2.8",
3
+ "version": "0.2.10",
4
4
  "description": "SDK for interacting with the Crosspost API",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs",
@@ -9,44 +9,6 @@ import type {
9
9
  } from '@crosspost/types';
10
10
  import { makeRequest, type RequestOptions } from '../core/request.ts';
11
11
 
12
- /**
13
- * Creates a modified query object with filter properties flattened
14
- * @param query The original query object
15
- * @returns A new query object with filter properties flattened
16
- */
17
- function createFilterQuery<T>(query?: T): Record<string, unknown> {
18
- if (!query) return {};
19
-
20
- const queryObj = query as Record<string, any>;
21
- const result: Record<string, unknown> = {};
22
-
23
- // Copy non-filter properties
24
- Object.keys(queryObj).forEach((key) => {
25
- if (key !== 'filter') {
26
- result[key] = queryObj[key];
27
- }
28
- });
29
-
30
- // Extract and flatten filter properties if they exist
31
- if (queryObj.filter) {
32
- const filter = queryObj.filter;
33
-
34
- if (filter.platforms && Array.isArray(filter.platforms)) {
35
- result.platforms = filter.platforms.join(',');
36
- }
37
-
38
- if (filter.types && Array.isArray(filter.types)) {
39
- result.types = filter.types.join(',');
40
- }
41
-
42
- if (filter.timeframe) {
43
- result.timeframe = filter.timeframe;
44
- }
45
- }
46
-
47
- return result;
48
- }
49
-
50
12
  /**
51
13
  * Activity-related API operations
52
14
  */
@@ -74,7 +36,7 @@ export class ActivityApi {
74
36
  '/api/activity',
75
37
  this.options,
76
38
  undefined,
77
- createFilterQuery(query),
39
+ query,
78
40
  );
79
41
  }
80
42
 
@@ -93,7 +55,7 @@ export class ActivityApi {
93
55
  `/api/activity/${signerId}`,
94
56
  this.options,
95
57
  undefined,
96
- createFilterQuery(query),
58
+ query,
97
59
  );
98
60
  }
99
61
 
@@ -112,7 +74,7 @@ export class ActivityApi {
112
74
  `/api/activity/${signerId}/posts`,
113
75
  this.options,
114
76
  undefined,
115
- createFilterQuery(query),
77
+ query,
116
78
  );
117
79
  }
118
80
  }