@lasuillard/raindrop-client 0.7.7 → 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 (75) hide show
  1. package/README.md +1 -1
  2. package/dist/index.cjs.js +1 -1
  3. package/dist/src/client/auth.d.ts +18 -0
  4. package/dist/src/client/client.d.ts +25 -0
  5. package/dist/src/client/collection.d.ts +14 -0
  6. package/dist/src/client/index.d.ts +1 -0
  7. package/dist/src/client/raindrop.d.ts +23 -0
  8. package/dist/{index.d.ts → src/generated/api.d.ts} +5559 -6223
  9. package/dist/src/generated/base.d.ts +55 -0
  10. package/dist/src/generated/common.d.ts +54 -0
  11. package/dist/src/generated/configuration.d.ts +91 -0
  12. package/dist/src/generated/index.d.ts +13 -0
  13. package/dist/src/index.d.ts +6 -0
  14. package/dist/src/utils/index.d.ts +2 -0
  15. package/dist/src/utils/tree.d.ts +49 -0
  16. package/dist/tests/__typechecks__/checkURLsExist.test-d.d.ts +1 -0
  17. package/dist/tests/__typechecks__/createCollection.test-d.d.ts +1 -0
  18. package/dist/tests/__typechecks__/createRaindrop.test-d.d.ts +1 -0
  19. package/dist/tests/__typechecks__/createRaindrops.test-d.d.ts +1 -0
  20. package/dist/tests/__typechecks__/emptyTrash.test-d.d.ts +1 -0
  21. package/dist/tests/__typechecks__/getAllHighlights.test-d.d.ts +1 -0
  22. package/dist/tests/__typechecks__/getChildCollections.test-d.d.ts +1 -0
  23. package/dist/tests/__typechecks__/getCollection.test-d.d.ts +1 -0
  24. package/dist/tests/__typechecks__/getCurrentUser.test-d.d.ts +1 -0
  25. package/dist/tests/__typechecks__/getFeaturedCovers.test-d.d.ts +1 -0
  26. package/dist/tests/__typechecks__/getFilters.test-d.d.ts +1 -0
  27. package/dist/tests/__typechecks__/getHighlightsInCollection.test-d.d.ts +1 -0
  28. package/dist/tests/__typechecks__/getPublicUserByName.test-d.d.ts +1 -0
  29. package/dist/tests/__typechecks__/getRaindrop.test-d.d.ts +1 -0
  30. package/dist/tests/__typechecks__/getRaindrops.test-d.d.ts +1 -0
  31. package/dist/tests/__typechecks__/getRootCollections.test-d.d.ts +1 -0
  32. package/dist/tests/__typechecks__/getSystemCollectionStats.test-d.d.ts +1 -0
  33. package/dist/tests/__typechecks__/getTagsInCollection.test-d.d.ts +1 -0
  34. package/dist/tests/__typechecks__/importHTMLBookmarkFile.test-d.d.ts +1 -0
  35. package/dist/tests/__typechecks__/mergeCollections.test-d.d.ts +1 -0
  36. package/dist/tests/__typechecks__/parseURL.test-d.d.ts +1 -0
  37. package/dist/tests/__typechecks__/removeAllEmptyCollections.test-d.d.ts +1 -0
  38. package/dist/tests/__typechecks__/removeCollection.test-d.d.ts +1 -0
  39. package/dist/tests/__typechecks__/removeCollections.test-d.d.ts +1 -0
  40. package/dist/tests/__typechecks__/removeRaindrop.test-d.d.ts +1 -0
  41. package/dist/tests/__typechecks__/removeRaindrops.test-d.d.ts +1 -0
  42. package/dist/tests/__typechecks__/removeTagsFromCollection.test-d.d.ts +1 -0
  43. package/dist/tests/__typechecks__/renameOrMergeTags.test-d.d.ts +1 -0
  44. package/dist/tests/__typechecks__/reorderAllCollections.test-d.d.ts +1 -0
  45. package/dist/tests/__typechecks__/searchCovers.test-d.d.ts +1 -0
  46. package/dist/tests/__typechecks__/shareCollection.test-d.d.ts +1 -0
  47. package/dist/tests/__typechecks__/updateCollection.test-d.d.ts +1 -0
  48. package/dist/tests/__typechecks__/updateCurrentUser.test-d.d.ts +1 -0
  49. package/dist/tests/__typechecks__/updateRaindrop.test-d.d.ts +1 -0
  50. package/dist/tests/__typechecks__/updateRaindrops.test-d.d.ts +1 -0
  51. package/dist/tests/__typechecks__/uploadCollectionCover.test-d.d.ts +1 -0
  52. package/dist/tests/__typechecks__/uploadFile.test-d.d.ts +1 -0
  53. package/dist/tests/__typechecks__/uploadRaindropCover.test-d.d.ts +1 -0
  54. package/dist/tests/_helpers/axios.d.ts +11 -0
  55. package/dist/tests/_helpers/common.d.ts +2 -0
  56. package/dist/tests/_helpers/polly.d.ts +5 -0
  57. package/dist/tests/_helpers/raindrop.d.ts +17 -0
  58. package/dist/tests/_helpers/typechecks.d.ts +14 -0
  59. package/dist/tests/_helpers/utils.d.ts +1 -0
  60. package/dist/tests/_helpers/vitest.d.ts +29 -0
  61. package/dist/tests/client/auth.test.d.ts +1 -0
  62. package/dist/tests/client/client.test.d.ts +1 -0
  63. package/dist/tests/client/collection.test.d.ts +1 -0
  64. package/dist/tests/client/raindrop.test.d.ts +1 -0
  65. package/dist/tests/generated/auth.test.d.ts +1 -0
  66. package/dist/tests/generated/collection.test.d.ts +1 -0
  67. package/dist/tests/generated/filter.test.d.ts +1 -0
  68. package/dist/tests/generated/highlight.test.d.ts +1 -0
  69. package/dist/tests/generated/import.test.d.ts +1 -0
  70. package/dist/tests/generated/raindrop.test.d.ts +1 -0
  71. package/dist/tests/generated/tag.test.d.ts +1 -0
  72. package/dist/tests/generated/user.test.d.ts +1 -0
  73. package/dist/tests/setup.d.ts +1 -0
  74. package/dist/tests/utils/tree.test.d.ts +1 -0
  75. package/package.json +12 -12
@@ -0,0 +1,55 @@
1
+ import { Configuration } from './configuration';
2
+ import { AxiosInstance, RawAxiosRequestConfig } from 'axios';
3
+ export declare const BASE_PATH: string;
4
+ /**
5
+ *
6
+ * @export
7
+ */
8
+ export declare const COLLECTION_FORMATS: {
9
+ csv: string;
10
+ ssv: string;
11
+ tsv: string;
12
+ pipes: string;
13
+ };
14
+ /**
15
+ *
16
+ * @export
17
+ * @interface RequestArgs
18
+ */
19
+ export interface RequestArgs {
20
+ url: string;
21
+ options: RawAxiosRequestConfig;
22
+ }
23
+ /**
24
+ *
25
+ * @export
26
+ * @class BaseAPI
27
+ */
28
+ export declare class BaseAPI {
29
+ protected basePath: string;
30
+ protected axios: AxiosInstance;
31
+ protected configuration: Configuration | undefined;
32
+ constructor(configuration?: Configuration, basePath?: string, axios?: AxiosInstance);
33
+ }
34
+ /**
35
+ *
36
+ * @export
37
+ * @class RequiredError
38
+ * @extends {Error}
39
+ */
40
+ export declare class RequiredError extends Error {
41
+ field: string;
42
+ constructor(field: string, msg?: string);
43
+ }
44
+ interface ServerMap {
45
+ [key: string]: {
46
+ url: string;
47
+ description: string;
48
+ }[];
49
+ }
50
+ /**
51
+ *
52
+ * @export
53
+ */
54
+ export declare const operationServerMap: ServerMap;
55
+ export {};
@@ -0,0 +1,54 @@
1
+ import { Configuration } from './configuration';
2
+ import { RequestArgs } from './base';
3
+ import { AxiosInstance, AxiosResponse } from 'axios';
4
+ /**
5
+ *
6
+ * @export
7
+ */
8
+ export declare const DUMMY_BASE_URL = "https://example.com";
9
+ /**
10
+ *
11
+ * @throws {RequiredError}
12
+ * @export
13
+ */
14
+ export declare const assertParamExists: (functionName: string, paramName: string, paramValue: unknown) => void;
15
+ /**
16
+ *
17
+ * @export
18
+ */
19
+ export declare const setApiKeyToObject: (object: any, keyParamName: string, configuration?: Configuration) => Promise<void>;
20
+ /**
21
+ *
22
+ * @export
23
+ */
24
+ export declare const setBasicAuthToObject: (object: any, configuration?: Configuration) => void;
25
+ /**
26
+ *
27
+ * @export
28
+ */
29
+ export declare const setBearerAuthToObject: (object: any, configuration?: Configuration) => Promise<void>;
30
+ /**
31
+ *
32
+ * @export
33
+ */
34
+ export declare const setOAuthToObject: (object: any, name: string, scopes: string[], configuration?: Configuration) => Promise<void>;
35
+ /**
36
+ *
37
+ * @export
38
+ */
39
+ export declare const setSearchParams: (url: URL, ...objects: any[]) => void;
40
+ /**
41
+ *
42
+ * @export
43
+ */
44
+ export declare const serializeDataIfNeeded: (value: any, requestOptions: any, configuration?: Configuration) => any;
45
+ /**
46
+ *
47
+ * @export
48
+ */
49
+ export declare const toPathString: (url: URL) => string;
50
+ /**
51
+ *
52
+ * @export
53
+ */
54
+ export declare const createRequestFunction: (axiosArgs: RequestArgs, globalAxios: AxiosInstance, BASE_PATH: string, configuration?: Configuration) => <T = unknown, R = AxiosResponse<T>>(axios?: AxiosInstance, basePath?: string) => Promise<R>;
@@ -0,0 +1,91 @@
1
+ /**
2
+ * Raindrop API (Unofficial)
3
+ * **UNOFFICIAL** OpenAPI specification of Raindrop API. This OpenAPI spec has been made by hand with reference to official documentation because it is not provided by Raindrop.io. Because official documentation not maintained well, there are very (highly) likely to have mismatch in schemas. As we can\'t inspect and address all issues, schema being updated as we find issues. Any contributions are welcome. Bug report, schema update, adding descriptions or functions, please don\'t hesitate to create an issue.
4
+ *
5
+ * The version of the OpenAPI document: 0.1.0
6
+ *
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+ export interface ConfigurationParameters {
13
+ apiKey?: string | Promise<string> | ((name: string) => string) | ((name: string) => Promise<string>);
14
+ username?: string;
15
+ password?: string;
16
+ accessToken?: string | Promise<string> | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise<string>);
17
+ basePath?: string;
18
+ serverIndex?: number;
19
+ baseOptions?: any;
20
+ formDataCtor?: new () => any;
21
+ }
22
+ export declare class Configuration {
23
+ /**
24
+ * parameter for apiKey security
25
+ * @param name security name
26
+ * @memberof Configuration
27
+ */
28
+ apiKey?: string | Promise<string> | ((name: string) => string) | ((name: string) => Promise<string>);
29
+ /**
30
+ * parameter for basic security
31
+ *
32
+ * @type {string}
33
+ * @memberof Configuration
34
+ */
35
+ username?: string;
36
+ /**
37
+ * parameter for basic security
38
+ *
39
+ * @type {string}
40
+ * @memberof Configuration
41
+ */
42
+ password?: string;
43
+ /**
44
+ * parameter for oauth2 security
45
+ * @param name security name
46
+ * @param scopes oauth2 scope
47
+ * @memberof Configuration
48
+ */
49
+ accessToken?: string | Promise<string> | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise<string>);
50
+ /**
51
+ * override base path
52
+ *
53
+ * @type {string}
54
+ * @memberof Configuration
55
+ */
56
+ basePath?: string;
57
+ /**
58
+ * override server index
59
+ *
60
+ * @type {number}
61
+ * @memberof Configuration
62
+ */
63
+ serverIndex?: number;
64
+ /**
65
+ * base options for axios calls
66
+ *
67
+ * @type {any}
68
+ * @memberof Configuration
69
+ */
70
+ baseOptions?: any;
71
+ /**
72
+ * The FormData constructor that will be used to create multipart form data
73
+ * requests. You can inject this here so that execution environments that
74
+ * do not support the FormData class can still run the generated client.
75
+ *
76
+ * @type {new () => FormData}
77
+ */
78
+ formDataCtor?: new () => any;
79
+ constructor(param?: ConfigurationParameters);
80
+ /**
81
+ * Check if the given MIME is a JSON MIME.
82
+ * JSON MIME examples:
83
+ * application/json
84
+ * application/json; charset=UTF8
85
+ * APPLICATION/JSON
86
+ * application/vnd.company+json
87
+ * @param mime - MIME (Multipurpose Internet Mail Extensions)
88
+ * @return True if the given MIME is JSON, false otherwise.
89
+ */
90
+ isJsonMime(mime: string): boolean;
91
+ }
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Raindrop API (Unofficial)
3
+ * **UNOFFICIAL** OpenAPI specification of Raindrop API. This OpenAPI spec has been made by hand with reference to official documentation because it is not provided by Raindrop.io. Because official documentation not maintained well, there are very (highly) likely to have mismatch in schemas. As we can\'t inspect and address all issues, schema being updated as we find issues. Any contributions are welcome. Bug report, schema update, adding descriptions or functions, please don\'t hesitate to create an issue.
4
+ *
5
+ * The version of the OpenAPI document: 0.1.0
6
+ *
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+ export * from './api';
13
+ export * from './configuration';
@@ -0,0 +1,6 @@
1
+ import * as client from "./client";
2
+ import * as generated from "./generated";
3
+ import * as utils from "./utils";
4
+ export { client, generated, utils };
5
+ declare const _default: typeof client.Raindrop;
6
+ export default _default;
@@ -0,0 +1,2 @@
1
+ import * as tree from "./tree";
2
+ export { tree };
@@ -0,0 +1,49 @@
1
+ /**
2
+ * Generic tree class.
3
+ */
4
+ export declare class TreeNode<T> {
5
+ private _data;
6
+ private _parent;
7
+ private _children;
8
+ /**
9
+ * Create tree node.
10
+ * @param data Node data.
11
+ * @param children Initial tree children.
12
+ */
13
+ constructor(data: T | null, children?: TreeNode<T>[]);
14
+ get data(): T | null;
15
+ get parent(): TreeNode<T> | null;
16
+ set parent(parent: TreeNode<T>);
17
+ isRoot(): boolean;
18
+ get children(): TreeNode<T>[];
19
+ /**
20
+ * Add children to current node.
21
+ * @param children Children nodes to append.
22
+ */
23
+ addChildren(...children: TreeNode<T>[]): void;
24
+ /**
25
+ * Pre-order traverse this tree.
26
+ * @param callbackFn Function to be called with traversing nodes.
27
+ */
28
+ traverse(callbackFn: (node: TreeNode<T>) => void): void;
29
+ }
30
+ /**
31
+ * Interface for building tree, {@link TreeNode}.
32
+ */
33
+ export interface TreeSource<D, T = D> {
34
+ /** Raw data for referencing. */
35
+ data: D;
36
+ /** Get ID of source. */
37
+ get id(): string;
38
+ /** Return source' parent ID. Should return `null` if parent is root. */
39
+ get parent(): string | null;
40
+ /** Create {@link TreeNode} from current source. */
41
+ toNode(): TreeNode<T>;
42
+ }
43
+ /**
44
+ * Create the tree from sources.
45
+ * @param data Data of root node.
46
+ * @param source Array of sources.
47
+ * @returns Root node of built tree.
48
+ */
49
+ export declare function makeTree<_, T>(data: T, source: TreeSource<_, T>[]): TreeNode<T>;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,11 @@
1
+ import { Use } from '@vitest/runner';
2
+ import { AxiosInstance } from 'axios';
3
+ import { default as MockAdapter } from 'axios-mock-adapter';
4
+ import { Raindrop } from '../../src/client';
5
+ export declare function axiosInstance({}: {}, use: Use<AxiosInstance>): Promise<void>;
6
+ export declare function mockAxios({ axiosInstance }: {
7
+ axiosInstance: AxiosInstance;
8
+ }, use: Use<MockAdapter>): Promise<void>;
9
+ export declare function client({ axiosInstance }: {
10
+ axiosInstance: AxiosInstance;
11
+ }, use: Use<Raindrop>): Promise<void>;
@@ -0,0 +1,2 @@
1
+ import { Task } from '@vitest/runner';
2
+ export declare function taskId(task: Task): string;
@@ -0,0 +1,5 @@
1
+ import { Polly } from '@pollyjs/core';
2
+ import { Task, Use } from '@vitest/runner';
3
+ export declare function polly({ task }: {
4
+ task: Task;
5
+ }, use: Use<Polly>): Promise<void>;
@@ -0,0 +1,17 @@
1
+ import { Task, Use } from '@vitest/runner';
2
+ import { Raindrop } from '../../src/client';
3
+ import { CreateCollectionRequest, CreateCollectionResponse, CreateRaindropRequest, CreateRaindropResponse } from '../../src/generated';
4
+ export declare function resetData({ client }: {
5
+ client: Raindrop;
6
+ }, use: Use<void>): Promise<void>;
7
+ export declare function setupTools({ task, client }: {
8
+ task: Task;
9
+ client: Raindrop;
10
+ }, use: Use<SetupTools>): Promise<void>;
11
+ export declare class SetupTools {
12
+ task: Task;
13
+ client: Raindrop;
14
+ constructor(task: Task, client: Raindrop);
15
+ createCollection(args?: Partial<CreateCollectionRequest>): Promise<CreateCollectionResponse>;
16
+ createRaindrop(args?: Partial<CreateRaindropRequest>): Promise<CreateRaindropResponse>;
17
+ }
@@ -0,0 +1,14 @@
1
+ import { Task, Use } from '@vitest/runner';
2
+ export interface CreateTest {
3
+ testId: string;
4
+ type: string;
5
+ value: string;
6
+ }
7
+ export interface RegisterHookArgs {
8
+ type: string;
9
+ }
10
+ export type RegisterHook = (args: RegisterHookArgs) => void;
11
+ export declare function generateTypeTest({ task }: {
12
+ task: Task;
13
+ }, use: Use<RegisterHook>): Promise<void>;
14
+ export declare function generateAllTests(): Promise<void>;
@@ -0,0 +1 @@
1
+ export declare function sleep(ms: number): Promise<unknown>;
@@ -0,0 +1,29 @@
1
+ import { Polly } from '@pollyjs/core';
2
+ import { AxiosInstance } from 'axios';
3
+ import { default as MockAdapter } from 'axios-mock-adapter';
4
+ import { Raindrop } from '../../src/client';
5
+ import { polly } from './polly';
6
+ import { SetupTools } from './raindrop';
7
+ import { RegisterHook } from './typechecks';
8
+ export declare const it: import('vitest').TestAPI<{
9
+ axiosInstance: AxiosInstance;
10
+ client: Raindrop;
11
+ mockAxios: MockAdapter;
12
+ polly: Polly | [typeof polly, {
13
+ auto: true;
14
+ }];
15
+ generateTypeTest: RegisterHook;
16
+ setupTools: SetupTools;
17
+ resetData: void;
18
+ }>;
19
+ declare module "vitest" {
20
+ interface TestContext {
21
+ axiosInstance: AxiosInstance;
22
+ mockAxios: MockAdapter;
23
+ client: Raindrop;
24
+ polly: Polly;
25
+ generateTypeTest: RegisterHook;
26
+ resetData: undefined;
27
+ setupTools: SetupTools;
28
+ }
29
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lasuillard/raindrop-client",
3
- "version": "0.7.7",
3
+ "version": "0.8.0",
4
4
  "description": "Axios client built with OpenAPI generator for Raindrop.io.",
5
5
  "keywords": [
6
6
  "raindrop.io",
@@ -22,9 +22,9 @@
22
22
  "url": "https://github.com/lasuillard-s/raindrop-client/issues"
23
23
  },
24
24
  "engines": {
25
- "node": ">=20"
25
+ "node": ">=22"
26
26
  },
27
- "packageManager": "npm@11.14.1",
27
+ "packageManager": "npm@11.16.0",
28
28
  "main": "./dist/index.cjs.js",
29
29
  "module": "./dist/index.es.js",
30
30
  "types": "./dist/index.d.ts",
@@ -50,15 +50,15 @@
50
50
  "make-docs": "typedoc --plugin typedoc-plugin-missing-exports src"
51
51
  },
52
52
  "devDependencies": {
53
- "@biomejs/biome": "2.4.15",
53
+ "@biomejs/biome": "2.4.16",
54
54
  "@codecov/vite-plugin": "2.0.1",
55
- "@openapitools/openapi-generator-cli": "2.32.0",
55
+ "@openapitools/openapi-generator-cli": "2.34.0",
56
56
  "@pollyjs/adapter-node-http": "6.0.6",
57
57
  "@pollyjs/core": "6.0.6",
58
58
  "@pollyjs/persister-fs": "6.0.6",
59
- "@types/node": "25.7.0",
60
- "@vitest/coverage-v8": "4.1.6",
61
- "@vitest/ui": "4.1.6",
59
+ "@types/node": "25.9.1",
60
+ "@vitest/coverage-v8": "4.1.7",
61
+ "@vitest/ui": "4.1.7",
62
62
  "axios-mock-adapter": "2.1.0",
63
63
  "axios-rate-limit": "1.9.0",
64
64
  "dotenv": "17.4.2",
@@ -67,15 +67,15 @@
67
67
  "typedoc": "0.28.19",
68
68
  "typedoc-plugin-missing-exports": "4.1.3",
69
69
  "typescript": "6.0.3",
70
- "vite": "8.0.12",
71
- "vite-plugin-dts": "4.5.4",
70
+ "vite": "8.0.14",
71
+ "vite-plugin-dts": "5.0.1",
72
72
  "vite-tsconfig-paths": "6.1.1",
73
- "vitest": "4.1.6"
73
+ "vitest": "4.1.7"
74
74
  },
75
75
  "dependencies": {
76
76
  "axios": "^1.6.8"
77
77
  },
78
78
  "overrides": {
79
- "vite": "8.0.12"
79
+ "vite": "$vite"
80
80
  }
81
81
  }