@layer-ai/sdk 2.2.0 → 2.4.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.
- package/dist/client.d.ts +21 -1
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +22 -0
- package/package.json +1 -1
package/dist/client.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { LayerConfig, RequestOptions } from './types/index.js';
|
|
2
|
-
import type { LayerRequestInput, LayerResponse, ChatRequest } from './types/index.js';
|
|
2
|
+
import type { LayerRequestInput, LayerResponse, ChatRequest, ImageGenerationRequest, VideoGenerationRequest } from './types/index.js';
|
|
3
3
|
export declare class Layer {
|
|
4
4
|
private apiKey;
|
|
5
5
|
private baseUrl;
|
|
@@ -16,5 +16,25 @@ export declare class Layer {
|
|
|
16
16
|
model?: string;
|
|
17
17
|
metadata?: Record<string, unknown>;
|
|
18
18
|
}): Promise<LayerResponse>;
|
|
19
|
+
/**
|
|
20
|
+
* v3 Image generation endpoint - Type-safe image requests
|
|
21
|
+
* @param request - Image request with gateId and ImageGenerationRequest data
|
|
22
|
+
*/
|
|
23
|
+
image(request: {
|
|
24
|
+
gateId: string;
|
|
25
|
+
data: ImageGenerationRequest;
|
|
26
|
+
model?: string;
|
|
27
|
+
metadata?: Record<string, unknown>;
|
|
28
|
+
}): Promise<LayerResponse>;
|
|
29
|
+
/**
|
|
30
|
+
* v3 Video generation endpoint - Type-safe video requests
|
|
31
|
+
* @param request - Video request with gateId and VideoGenerationRequest data
|
|
32
|
+
*/
|
|
33
|
+
video(request: {
|
|
34
|
+
gateId: string;
|
|
35
|
+
data: VideoGenerationRequest;
|
|
36
|
+
model?: string;
|
|
37
|
+
metadata?: Record<string, unknown>;
|
|
38
|
+
}): Promise<LayerResponse>;
|
|
19
39
|
}
|
|
20
40
|
//# sourceMappingURL=client.d.ts.map
|
package/dist/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACpE,OAAO,KAAK,EAAiB,iBAAiB,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACpE,OAAO,KAAK,EAAiB,iBAAiB,EAAE,aAAa,EAAE,WAAW,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAErJ,qBAAa,KAAK;IAChB,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,OAAO,CAAS;gBAEZ,MAAM,EAAE,WAAW;IAQlB,OAAO,CAAC,CAAC,EAAE,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,CAAC,CAAC;IA4BtD,QAAQ,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,aAAa,CAAC;IAQlE;;;OAGG;IACG,IAAI,CAAC,OAAO,EAAE;QAClB,MAAM,EAAE,MAAM,CAAC;QACf,IAAI,EAAE,WAAW,CAAC;QAClB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KACpC,GAAG,OAAO,CAAC,aAAa,CAAC;IAQ1B;;;OAGG;IACG,KAAK,CAAC,OAAO,EAAE;QACnB,MAAM,EAAE,MAAM,CAAC;QACf,IAAI,EAAE,sBAAsB,CAAC;QAC7B,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KACpC,GAAG,OAAO,CAAC,aAAa,CAAC;IAQ1B;;;OAGG;IACG,KAAK,CAAC,OAAO,EAAE;QACnB,MAAM,EAAE,MAAM,CAAC;QACf,IAAI,EAAE,sBAAsB,CAAC;QAC7B,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KACpC,GAAG,OAAO,CAAC,aAAa,CAAC;CAO3B"}
|
package/dist/client.js
CHANGED
|
@@ -46,4 +46,26 @@ export class Layer {
|
|
|
46
46
|
body: request,
|
|
47
47
|
});
|
|
48
48
|
}
|
|
49
|
+
/**
|
|
50
|
+
* v3 Image generation endpoint - Type-safe image requests
|
|
51
|
+
* @param request - Image request with gateId and ImageGenerationRequest data
|
|
52
|
+
*/
|
|
53
|
+
async image(request) {
|
|
54
|
+
return this.request({
|
|
55
|
+
method: 'POST',
|
|
56
|
+
path: '/v3/image',
|
|
57
|
+
body: request,
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* v3 Video generation endpoint - Type-safe video requests
|
|
62
|
+
* @param request - Video request with gateId and VideoGenerationRequest data
|
|
63
|
+
*/
|
|
64
|
+
async video(request) {
|
|
65
|
+
return this.request({
|
|
66
|
+
method: 'POST',
|
|
67
|
+
path: '/v3/video',
|
|
68
|
+
body: request,
|
|
69
|
+
});
|
|
70
|
+
}
|
|
49
71
|
}
|