getaiapi 1.0.0-alpha.2 → 1.0.0-alpha.4

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-34X3VRM3.js";
7
+ } from "./chunk-DZVZ5HSO.js";
8
8
 
9
9
  // src/cli.ts
10
10
  import { parseArgs } from "util";
package/dist/index.d.ts CHANGED
@@ -69,6 +69,22 @@ interface OutputItem {
69
69
  content_type: string;
70
70
  size_bytes?: number;
71
71
  }
72
+ interface SubmitResponse {
73
+ id: string;
74
+ model: string;
75
+ provider: ProviderName;
76
+ endpoint: string;
77
+ status: 'pending' | 'processing' | 'completed';
78
+ }
79
+ interface PollResponse {
80
+ id: string;
81
+ model: string;
82
+ provider: ProviderName;
83
+ status: 'completed' | 'failed' | 'processing' | 'pending';
84
+ outputs?: OutputItem[];
85
+ metadata?: GenerateResponse['metadata'];
86
+ error?: string;
87
+ }
72
88
  interface ListModelsFilters {
73
89
  input?: InputType;
74
90
  output?: OutputType;
@@ -114,6 +130,9 @@ interface UploadOptions {
114
130
  maxBytes?: number;
115
131
  }
116
132
 
133
+ declare function submit(request: GenerateRequest): Promise<SubmitResponse>;
134
+ declare function poll(job: SubmitResponse): Promise<PollResponse>;
135
+ declare function submitAndPoll(request: GenerateRequest): Promise<GenerateResponse>;
117
136
  declare function generate(request: GenerateRequest): Promise<GenerateResponse>;
118
137
 
119
138
  declare function configure(options: ConfigureOptions): void;
@@ -220,4 +239,4 @@ declare class StorageError extends GetAIApiError {
220
239
  constructor(operation: StorageOperation, message: string, statusCode?: number);
221
240
  }
222
241
 
223
- export { AuthError, type ConfigureOptions, type GenerateRequest, type GenerateResponse, GetAIApiError, type InputType, type ListModelsFilters, type ModelEntry, ModelNotFoundError, NoProviderError, type OutputItem, type OutputMapping, type OutputType, type ProviderAdapter, type ProviderBinding, ProviderError, type ProviderName, type ProviderResponse, RateLimitError, type StorageConfig, StorageError, TimeoutError, type UploadOptions, type UploadResult, ValidationError, clearRegistryCache, configure, configureAuth, configureStorage, deleteAsset, deriveCategory, generate, listModels, loadRegistry, mapInput, mapOutput, presignAsset, resolveModel, uploadAsset };
242
+ export { AuthError, type ConfigureOptions, type GenerateRequest, type GenerateResponse, GetAIApiError, type InputType, type ListModelsFilters, type ModelEntry, ModelNotFoundError, NoProviderError, type OutputItem, type OutputMapping, type OutputType, type PollResponse, type ProviderAdapter, type ProviderBinding, ProviderError, type ProviderName, type ProviderResponse, RateLimitError, type StorageConfig, StorageError, type SubmitResponse, TimeoutError, type UploadOptions, type UploadResult, ValidationError, clearRegistryCache, configure, configureAuth, configureStorage, deleteAsset, deriveCategory, generate, listModels, loadRegistry, mapInput, mapOutput, poll, presignAsset, resolveModel, submit, submitAndPoll, uploadAsset };
package/dist/index.js CHANGED
@@ -18,10 +18,13 @@ import {
18
18
  loadRegistry,
19
19
  mapInput,
20
20
  mapOutput,
21
+ poll,
21
22
  presignAsset,
22
23
  resolveModel,
24
+ submit,
25
+ submitAndPoll,
23
26
  uploadAsset
24
- } from "./chunk-34X3VRM3.js";
27
+ } from "./chunk-DZVZ5HSO.js";
25
28
 
26
29
  // src/configure.ts
27
30
  function configure(options) {
@@ -53,8 +56,11 @@ export {
53
56
  loadRegistry,
54
57
  mapInput,
55
58
  mapOutput,
59
+ poll,
56
60
  presignAsset,
57
61
  resolveModel,
62
+ submit,
63
+ submitAndPoll,
58
64
  uploadAsset
59
65
  };
60
66
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/configure.ts"],"sourcesContent":["import type { ConfigureOptions } from \"./types.js\";\nimport { configureAuth } from \"./auth.js\";\nimport { configureStorage } from \"./storage.js\";\n\nexport function configure(options: ConfigureOptions): void {\n if (options.keys) {\n configureAuth(options.keys);\n }\n if (options.storage) {\n configureStorage(options.storage);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAIO,SAAS,UAAU,SAAiC;AACzD,MAAI,QAAQ,MAAM;AAChB,kBAAc,QAAQ,IAAI;AAAA,EAC5B;AACA,MAAI,QAAQ,SAAS;AACnB,qBAAiB,QAAQ,OAAO;AAAA,EAClC;AACF;","names":[]}
1
+ {"version":3,"sources":["../src/configure.ts"],"sourcesContent":["import type { ConfigureOptions } from \"./types.js\";\nimport { configureAuth } from \"./auth.js\";\nimport { configureStorage } from \"./storage.js\";\n\nexport function configure(options: ConfigureOptions): void {\n if (options.keys) {\n configureAuth(options.keys);\n }\n if (options.storage) {\n configureStorage(options.storage);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIO,SAAS,UAAU,SAAiC;AACzD,MAAI,QAAQ,MAAM;AAChB,kBAAc,QAAQ,IAAI;AAAA,EAC5B;AACA,MAAI,QAAQ,SAAS;AACnB,qBAAiB,QAAQ,OAAO;AAAA,EAClC;AACF;","names":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "getaiapi",
3
- "version": "1.0.0-alpha.2",
3
+ "version": "1.0.0-alpha.4",
4
4
  "type": "module",
5
5
  "description": "Unified AI API Gateway - one function to call any AI model",
6
6
  "main": "./dist/index.js",