getaiapi 1.3.0 → 1.3.1

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/cli.js CHANGED
@@ -4,7 +4,7 @@ import {
4
4
  generate,
5
5
  listModels,
6
6
  resolveModel
7
- } from "./chunk-7MV7SODR.js";
7
+ } from "./chunk-CN4FJ4FW.js";
8
8
 
9
9
  // src/cli.ts
10
10
  import { parseArgs } from "util";
package/dist/index.d.ts CHANGED
@@ -24,9 +24,19 @@ interface OutputMapping {
24
24
  extract_path: string;
25
25
  content_type?: string;
26
26
  }
27
- interface GenerateRequest {
27
+ /**
28
+ * Resolves the options type based on provider.
29
+ * When provider is specified, narrows options to provider-specific type.
30
+ */
31
+ type ProviderOptionsFor<P extends ProviderName = ProviderName> = P extends 'kling' ? KlingOptions : Record<string, unknown>;
32
+ /**
33
+ * Universal input for generate/submit.
34
+ * Generic P narrows options by provider for type safety.
35
+ * Without a generic, options accepts any Record<string, unknown>.
36
+ */
37
+ interface GenerateRequest<P extends ProviderName = ProviderName> {
28
38
  model: string;
29
- provider?: ProviderName;
39
+ provider?: P;
30
40
  prompt?: string;
31
41
  image?: string | File;
32
42
  images?: (string | File)[];
@@ -46,7 +56,7 @@ interface GenerateRequest {
46
56
  quality?: number;
47
57
  safety?: boolean;
48
58
  duration?: string;
49
- options?: Record<string, unknown> | KlingOptions;
59
+ options?: ProviderOptionsFor<P>;
50
60
  }
51
61
  type KlingVideoModel = 'kling-v1' | 'kling-v1-5' | 'kling-v1-6' | 'kling-v2-master' | 'kling-v2-1' | 'kling-v2-1-master' | 'kling-v2-5-turbo' | 'kling-v2-6' | 'kling-v3' | 'kling-v3-omni' | 'kling-video-o1';
52
62
  type KlingImageModel = 'kling-v1' | 'kling-v1-5' | 'kling-v2' | 'kling-v2-1' | 'kling-v3' | 'kling-v3-omni' | 'kling-v3-remaster' | 'kling-image-o1' | 'kling-image-o3';
package/dist/index.js CHANGED
@@ -26,7 +26,7 @@ import {
26
26
  submit,
27
27
  submitAndPoll,
28
28
  uploadAsset
29
- } from "./chunk-7MV7SODR.js";
29
+ } from "./chunk-CN4FJ4FW.js";
30
30
 
31
31
  // src/configure.ts
32
32
  function configure(options) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "getaiapi",
3
- "version": "1.3.0",
3
+ "version": "1.3.1",
4
4
  "type": "module",
5
5
  "description": "Unified AI API Gateway - one function to call any AI model",
6
6
  "main": "./dist/index.js",