@ffflorian/icanhazdadjoke 2.4.5 → 2.4.7

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.
@@ -1,5 +1,5 @@
1
- import { ICanHazDadJokeAPI } from './ICanHazDadJokeAPI';
2
1
  import type { ClientOptions } from './Interfaces';
2
+ import { ICanHazDadJokeAPI } from './ICanHazDadJokeAPI';
3
3
  export declare class ICanHazDadJoke {
4
4
  readonly api: ICanHazDadJokeAPI;
5
5
  private readonly apiClient;
@@ -9,5 +9,5 @@ export declare class ICanHazDadJoke {
9
9
  * Set a new API URL.
10
10
  * @param url The new API URL.
11
11
  */
12
- setApiUrl(newURL: string): void;
12
+ setApiUrl(url: string): void;
13
13
  }
@@ -18,8 +18,8 @@ class ICanHazDadJoke {
18
18
  * Set a new API URL.
19
19
  * @param url The new API URL.
20
20
  */
21
- setApiUrl(newURL) {
22
- this.apiClient.setBaseURL(newURL);
21
+ setApiUrl(url) {
22
+ this.apiClient.setBaseURL(url);
23
23
  }
24
24
  }
25
25
  exports.ICanHazDadJoke = ICanHazDadJoke;
@@ -30,7 +30,7 @@ export declare class ICanHazDadJokeAPI {
30
30
  getRandom(options?: RequestOptions): Promise<JokeResult>;
31
31
  /**
32
32
  * Search for dad jokes.
33
- * @param term search term to use (default: list all jokes)
33
+ * @param options Search options (default: list all jokes)
34
34
  * @see https://icanhazdadjoke.com/api#search-for-dad-jokes
35
35
  */
36
36
  search(options: SearchOptions): Promise<JokeSearchResult>;
@@ -1,6 +1,3 @@
1
- export interface RequestOptions {
2
- withImage?: boolean;
3
- }
4
1
  export interface ClientOptions {
5
2
  apiUrl?: string;
6
3
  }
@@ -9,6 +6,9 @@ export interface JokeResult {
9
6
  joke: string;
10
7
  status: number;
11
8
  }
9
+ export interface JokeResultWithImage extends JokeResult {
10
+ image: Buffer;
11
+ }
12
12
  export interface JokeSearchResult {
13
13
  current_page: number;
14
14
  limit: number;
@@ -20,8 +20,8 @@ export interface JokeSearchResult {
20
20
  total_jokes: number;
21
21
  total_pages: number;
22
22
  }
23
- export interface JokeResultWithImage extends JokeResult {
24
- image: Buffer;
23
+ export interface RequestOptions {
24
+ withImage?: boolean;
25
25
  }
26
26
  export interface SearchOptions {
27
27
  /** number of results to return per page (default: 20) (max: 30) */
package/dist/cli.js CHANGED
@@ -43,9 +43,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
43
43
  });
44
44
  };
45
45
  Object.defineProperty(exports, "__esModule", { value: true });
46
- const path = __importStar(require("node:path"));
47
- const node_fs_1 = require("node:fs");
48
46
  const commander_1 = require("commander");
47
+ const node_fs_1 = require("node:fs");
48
+ const path = __importStar(require("node:path"));
49
49
  const package_json_1 = require("../package.json");
50
50
  const _1 = require("./");
51
51
  function init() {
package/dist/index.d.ts CHANGED
@@ -1,2 +1,3 @@
1
1
  export * from './ICanHazDadJoke';
2
+ export * from './ICanHazDadJokeAPI';
2
3
  export * from './Interfaces';
package/dist/index.js CHANGED
@@ -15,4 +15,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./ICanHazDadJoke"), exports);
18
+ __exportStar(require("./ICanHazDadJokeAPI"), exports);
18
19
  __exportStar(require("./Interfaces"), exports);
package/package.json CHANGED
@@ -2,16 +2,16 @@
2
2
  "author": "Florian Imdahl <git@ffflorian.de>",
3
3
  "bin": "dist/cli.js",
4
4
  "dependencies": {
5
- "@ffflorian/api-client": "2.2.0",
6
- "commander": "14.0.2"
5
+ "@ffflorian/api-client": "2.5.1",
6
+ "commander": "14.0.3"
7
7
  },
8
8
  "description": "An icanhazdadjoke.com API client with a CLI.",
9
9
  "devDependencies": {
10
10
  "@types/node": "~24",
11
- "rimraf": "6.1.2",
11
+ "rimraf": "6.1.3",
12
12
  "tsx": "4.21.0",
13
- "typedoc": "0.28.15",
14
- "typescript": "5.9.3"
13
+ "typedoc": "0.28.18",
14
+ "typescript": "6.0.2"
15
15
  },
16
16
  "engines": {
17
17
  "node": ">= 21"
@@ -31,13 +31,13 @@
31
31
  "readme": "https://github.com/ffflorian/api-clients#readme",
32
32
  "repository": "https://github.com/ffflorian/api-clients.git",
33
33
  "scripts": {
34
+ "build": "yarn build:ts",
34
35
  "build:ts": "tsc -p tsconfig.build.json",
35
36
  "build:docs": "typedoc --tsconfig tsconfig.build.json --options ../../typedoc.json --out ../../docs/packages/icanhazdadjoke src/index.ts",
36
37
  "clean": "rimraf dist",
37
- "dist": "yarn clean && yarn build:ts",
38
+ "dist": "yarn clean && yarn build",
38
39
  "start": "tsx src/cli.ts",
39
40
  "test": "exit 0"
40
41
  },
41
- "version": "2.4.5",
42
- "gitHead": "8d7471cbe490305b3e441c27acbc81e36a4bd9df"
42
+ "version": "2.4.7"
43
43
  }