@lasuillard/raindrop-client 0.7.6 → 0.8.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 (76) hide show
  1. package/README.md +1 -1
  2. package/dist/index.cjs.js +1 -1
  3. package/dist/index.es.js +1901 -3098
  4. package/dist/src/client/auth.d.ts +18 -0
  5. package/dist/src/client/client.d.ts +25 -0
  6. package/dist/src/client/collection.d.ts +14 -0
  7. package/dist/src/client/index.d.ts +1 -0
  8. package/dist/src/client/raindrop.d.ts +23 -0
  9. package/dist/{index.d.ts → src/generated/api.d.ts} +5559 -6223
  10. package/dist/src/generated/base.d.ts +55 -0
  11. package/dist/src/generated/common.d.ts +54 -0
  12. package/dist/src/generated/configuration.d.ts +91 -0
  13. package/dist/src/generated/index.d.ts +13 -0
  14. package/dist/src/index.d.ts +6 -0
  15. package/dist/src/utils/index.d.ts +2 -0
  16. package/dist/src/utils/tree.d.ts +49 -0
  17. package/dist/tests/__typechecks__/checkURLsExist.test-d.d.ts +1 -0
  18. package/dist/tests/__typechecks__/createCollection.test-d.d.ts +1 -0
  19. package/dist/tests/__typechecks__/createRaindrop.test-d.d.ts +1 -0
  20. package/dist/tests/__typechecks__/createRaindrops.test-d.d.ts +1 -0
  21. package/dist/tests/__typechecks__/emptyTrash.test-d.d.ts +1 -0
  22. package/dist/tests/__typechecks__/getAllHighlights.test-d.d.ts +1 -0
  23. package/dist/tests/__typechecks__/getChildCollections.test-d.d.ts +1 -0
  24. package/dist/tests/__typechecks__/getCollection.test-d.d.ts +1 -0
  25. package/dist/tests/__typechecks__/getCurrentUser.test-d.d.ts +1 -0
  26. package/dist/tests/__typechecks__/getFeaturedCovers.test-d.d.ts +1 -0
  27. package/dist/tests/__typechecks__/getFilters.test-d.d.ts +1 -0
  28. package/dist/tests/__typechecks__/getHighlightsInCollection.test-d.d.ts +1 -0
  29. package/dist/tests/__typechecks__/getPublicUserByName.test-d.d.ts +1 -0
  30. package/dist/tests/__typechecks__/getRaindrop.test-d.d.ts +1 -0
  31. package/dist/tests/__typechecks__/getRaindrops.test-d.d.ts +1 -0
  32. package/dist/tests/__typechecks__/getRootCollections.test-d.d.ts +1 -0
  33. package/dist/tests/__typechecks__/getSystemCollectionStats.test-d.d.ts +1 -0
  34. package/dist/tests/__typechecks__/getTagsInCollection.test-d.d.ts +1 -0
  35. package/dist/tests/__typechecks__/importHTMLBookmarkFile.test-d.d.ts +1 -0
  36. package/dist/tests/__typechecks__/mergeCollections.test-d.d.ts +1 -0
  37. package/dist/tests/__typechecks__/parseURL.test-d.d.ts +1 -0
  38. package/dist/tests/__typechecks__/removeAllEmptyCollections.test-d.d.ts +1 -0
  39. package/dist/tests/__typechecks__/removeCollection.test-d.d.ts +1 -0
  40. package/dist/tests/__typechecks__/removeCollections.test-d.d.ts +1 -0
  41. package/dist/tests/__typechecks__/removeRaindrop.test-d.d.ts +1 -0
  42. package/dist/tests/__typechecks__/removeRaindrops.test-d.d.ts +1 -0
  43. package/dist/tests/__typechecks__/removeTagsFromCollection.test-d.d.ts +1 -0
  44. package/dist/tests/__typechecks__/renameOrMergeTags.test-d.d.ts +1 -0
  45. package/dist/tests/__typechecks__/reorderAllCollections.test-d.d.ts +1 -0
  46. package/dist/tests/__typechecks__/searchCovers.test-d.d.ts +1 -0
  47. package/dist/tests/__typechecks__/shareCollection.test-d.d.ts +1 -0
  48. package/dist/tests/__typechecks__/updateCollection.test-d.d.ts +1 -0
  49. package/dist/tests/__typechecks__/updateCurrentUser.test-d.d.ts +1 -0
  50. package/dist/tests/__typechecks__/updateRaindrop.test-d.d.ts +1 -0
  51. package/dist/tests/__typechecks__/updateRaindrops.test-d.d.ts +1 -0
  52. package/dist/tests/__typechecks__/uploadCollectionCover.test-d.d.ts +1 -0
  53. package/dist/tests/__typechecks__/uploadFile.test-d.d.ts +1 -0
  54. package/dist/tests/__typechecks__/uploadRaindropCover.test-d.d.ts +1 -0
  55. package/dist/tests/_helpers/axios.d.ts +11 -0
  56. package/dist/tests/_helpers/common.d.ts +2 -0
  57. package/dist/tests/_helpers/polly.d.ts +5 -0
  58. package/dist/tests/_helpers/raindrop.d.ts +17 -0
  59. package/dist/tests/_helpers/typechecks.d.ts +14 -0
  60. package/dist/tests/_helpers/utils.d.ts +1 -0
  61. package/dist/tests/_helpers/vitest.d.ts +29 -0
  62. package/dist/tests/client/auth.test.d.ts +1 -0
  63. package/dist/tests/client/client.test.d.ts +1 -0
  64. package/dist/tests/client/collection.test.d.ts +1 -0
  65. package/dist/tests/client/raindrop.test.d.ts +1 -0
  66. package/dist/tests/generated/auth.test.d.ts +1 -0
  67. package/dist/tests/generated/collection.test.d.ts +1 -0
  68. package/dist/tests/generated/filter.test.d.ts +1 -0
  69. package/dist/tests/generated/highlight.test.d.ts +1 -0
  70. package/dist/tests/generated/import.test.d.ts +1 -0
  71. package/dist/tests/generated/raindrop.test.d.ts +1 -0
  72. package/dist/tests/generated/tag.test.d.ts +1 -0
  73. package/dist/tests/generated/user.test.d.ts +1 -0
  74. package/dist/tests/setup.d.ts +1 -0
  75. package/dist/tests/utils/tree.test.d.ts +1 -0
  76. package/package.json +79 -71
@@ -0,0 +1,18 @@
1
+ import { AxiosRequestConfig, AxiosResponse } from 'axios';
2
+ import { AuthenticationApi as _AuthenticationApi, ObtainToken, RefreshToken, TokenResponse } from '../generated';
3
+ export declare class AuthenticationApi extends _AuthenticationApi {
4
+ /**
5
+ * Wrapper function of {@link _AuthenticationApi.getOrRefreshToken} for token exchange.
6
+ * @param request {@link ObtainToken} but without `grant_type` field.
7
+ * @param options Axios request configuration.
8
+ * @returns API response.
9
+ */
10
+ exchangeToken(request: Omit<ObtainToken, "grant_type">, options?: AxiosRequestConfig<any>): Promise<AxiosResponse<TokenResponse, any>>;
11
+ /**
12
+ * Wrapper function of {@link _AuthenticationApi.getOrRefreshToken} for token refresh.
13
+ * @param request {@link RefreshToken} but without `grant_type` field.
14
+ * @param options Axios request configuration.
15
+ * @returns API response.
16
+ */
17
+ refreshToken(request: Omit<RefreshToken, "grant_type">, options?: AxiosRequestConfig<any>): Promise<AxiosResponse<TokenResponse, any>>;
18
+ }
@@ -0,0 +1,25 @@
1
+ import { AxiosInstance } from 'axios';
2
+ import { Configuration, FilterApi, HighlightApi, ImportApi, TagApi, UserApi } from '../generated';
3
+ import { AuthenticationApi } from './auth';
4
+ import { CollectionApi } from './collection';
5
+ import { RaindropApi } from './raindrop';
6
+ /**
7
+ * Raindrop API set.
8
+ *
9
+ * You can provide auth credentials via `new Configuration({accessToken: ...})` or headers in Axios instances.
10
+ */
11
+ export declare class Raindrop {
12
+ /** Axios client instance. If not set, will use default Axios instance. */
13
+ readonly client: AxiosInstance;
14
+ /** API global configurations. */
15
+ readonly configuration: Configuration;
16
+ readonly auth: AuthenticationApi;
17
+ readonly user: UserApi;
18
+ readonly collection: CollectionApi;
19
+ readonly filter: FilterApi;
20
+ readonly highlight: HighlightApi;
21
+ readonly import: ImportApi;
22
+ readonly raindrop: RaindropApi;
23
+ readonly tag: TagApi;
24
+ constructor(configuration?: Configuration, client?: AxiosInstance);
25
+ }
@@ -0,0 +1,14 @@
1
+ import { CollectionApi as _CollectionApi, GetChildCollectionsResponse, GetRootCollectionsResponse } from '../generated';
2
+ import { TreeNode } from '../utils/tree';
3
+ type GetRootCollectionsResponseItem = GetRootCollectionsResponse["items"][0];
4
+ type GetChildCollectionsResponseItem = GetChildCollectionsResponse["items"][0];
5
+ export type CollectionItem = GetRootCollectionsResponseItem | GetChildCollectionsResponseItem;
6
+ export declare class CollectionApi extends _CollectionApi {
7
+ /**
8
+ * Create structured tree of collections.
9
+ * @returns Root of tree.
10
+ * @deprecated This function is deprecated and will be removed in a future release.
11
+ */
12
+ getCollectionTree(): Promise<TreeNode<CollectionItem | null>>;
13
+ }
14
+ export {};
@@ -0,0 +1 @@
1
+ export { Raindrop } from './client';
@@ -0,0 +1,23 @@
1
+ import { AxiosRequestConfig } from 'axios';
2
+ import { RaindropApi as _RaindropApi, GetRaindropsResponse } from '../generated';
3
+ type RaindropItem = GetRaindropsResponse["items"][0];
4
+ export interface GetAllRaindropsParams {
5
+ /** Sort option. See https://developer.raindrop.io/v1/raindrops/multiple#common-parameters */
6
+ sort?: string;
7
+ /** Size of per page to fetch. Maximum 50 limited by Raindrop.io */
8
+ pageSize?: number;
9
+ /** Search query. See details at https://help.raindrop.io/using-search/ */
10
+ search?: string;
11
+ }
12
+ export declare class RaindropApi extends _RaindropApi {
13
+ /**
14
+ * Fetch all raindrops of a collection.
15
+ * @param collectionId ID of collection.
16
+ * @param params Request parameters.
17
+ * @param options Axios request config.
18
+ * @returns Array of raindrops.
19
+ * @deprecated This function is deprecated and will be removed in a future release.
20
+ */
21
+ getAllRaindrops(collectionId?: number, params?: GetAllRaindropsParams, options?: AxiosRequestConfig<any>): Promise<RaindropItem[]>;
22
+ }
23
+ export {};