@mynthio/sdk 0.0.40 → 0.0.42

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 (44) hide show
  1. package/README.md +20 -4
  2. package/dist/convex/index.d.ts +39 -100
  3. package/dist/convex/index.js +41 -2
  4. package/dist/handler.d.ts +28 -0
  5. package/dist/handler.js +121 -0
  6. package/dist/index.d.ts +701 -360
  7. package/dist/index.js +1514 -2
  8. package/dist/next/index.d.ts +14 -24
  9. package/dist/next/index.js +25 -2
  10. package/dist/tanstack-start/index.d.ts +18 -23
  11. package/dist/tanstack-start/index.js +11 -2
  12. package/dist/types.d.ts +609 -660
  13. package/package.json +16 -21
  14. package/dist/client.d.ts +0 -41
  15. package/dist/client.d.ts.map +0 -1
  16. package/dist/constants.d.ts +0 -95
  17. package/dist/constants.d.ts.map +0 -1
  18. package/dist/convex/index.d.ts.map +0 -1
  19. package/dist/convex/utils.d.ts +0 -2
  20. package/dist/convex/utils.d.ts.map +0 -1
  21. package/dist/image-alt-result.d.ts +0 -19
  22. package/dist/image-alt-result.d.ts.map +0 -1
  23. package/dist/image-generation-result.d.ts +0 -58
  24. package/dist/image-generation-result.d.ts.map +0 -1
  25. package/dist/image-rate-result.d.ts +0 -21
  26. package/dist/image-rate-result.d.ts.map +0 -1
  27. package/dist/image-remove-background-result.d.ts +0 -24
  28. package/dist/image-remove-background-result.d.ts.map +0 -1
  29. package/dist/image-review-result.d.ts +0 -28
  30. package/dist/image-review-result.d.ts.map +0 -1
  31. package/dist/index-apss16tr.js +0 -3
  32. package/dist/index-ty295921.js +0 -3
  33. package/dist/index.d.ts.map +0 -1
  34. package/dist/next/index.d.ts.map +0 -1
  35. package/dist/tanstack-start/index.d.ts.map +0 -1
  36. package/dist/task-async.d.ts +0 -95
  37. package/dist/task-async.d.ts.map +0 -1
  38. package/dist/types.d.ts.map +0 -1
  39. package/dist/uploads.d.ts +0 -31
  40. package/dist/uploads.d.ts.map +0 -1
  41. package/dist/video-generation-result.d.ts +0 -46
  42. package/dist/video-generation-result.d.ts.map +0 -1
  43. package/dist/webhooks/utils.d.ts +0 -5
  44. package/dist/webhooks/utils.d.ts.map +0 -1
package/dist/uploads.d.ts DELETED
@@ -1,31 +0,0 @@
1
- import type { MynthClient } from "./client";
2
- import type { MynthSDKTypes } from "./types";
3
- /** Structured input accepted from callers, before local files are uploaded. */
4
- type ClientInput<AsT extends string> = string | MynthSDKTypes.ImageUploadInput | {
5
- type: "image";
6
- as?: AsT;
7
- source: MynthSDKTypes.ImageGenerationRequestInputSource | {
8
- type: "file";
9
- file: MynthSDKTypes.ImageUploadInput;
10
- };
11
- };
12
- /** The same input in API wire format: every source is a URL. */
13
- type WireInput<AsT extends string> = string | {
14
- type: "image";
15
- as?: AsT;
16
- source: MynthSDKTypes.ImageGenerationRequestInputSource;
17
- };
18
- export declare function isUploadInput(value: unknown): value is MynthSDKTypes.ImageUploadInput;
19
- /**
20
- * Upload images to Mynth temporary input storage.
21
- * Image and video generation share this endpoint: video inputs are images.
22
- */
23
- export declare function uploadImages(client: MynthClient, input: MynthSDKTypes.ImageUploadInput | readonly MynthSDKTypes.ImageUploadInput[]): Promise<MynthSDKTypes.ImageUploadResponse>;
24
- /**
25
- * Turn caller inputs into wire inputs, uploading any local files first.
26
- * All files go up in a single request, and the returned URLs are slotted back
27
- * into their original positions so input order (and role) is preserved.
28
- */
29
- export declare function resolveInputs<AsT extends string>(client: MynthClient, inputs: readonly ClientInput<AsT>[] | undefined): Promise<WireInput<AsT>[] | undefined>;
30
- export {};
31
- //# sourceMappingURL=uploads.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"uploads.d.ts","sourceRoot":"","sources":["../src/uploads.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAE5C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAK7C,+EAA+E;AAC/E,KAAK,WAAW,CAAC,GAAG,SAAS,MAAM,IAC/B,MAAM,GACN,aAAa,CAAC,gBAAgB,GAC9B;IACE,IAAI,EAAE,OAAO,CAAC;IACd,EAAE,CAAC,EAAE,GAAG,CAAC;IACT,MAAM,EACF,aAAa,CAAC,iCAAiC,GAC/C;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,aAAa,CAAC,gBAAgB,CAAA;KAAE,CAAC;CAC5D,CAAC;AAEN,gEAAgE;AAChE,KAAK,SAAS,CAAC,GAAG,SAAS,MAAM,IAC7B,MAAM,GACN;IACE,IAAI,EAAE,OAAO,CAAC;IACd,EAAE,CAAC,EAAE,GAAG,CAAC;IACT,MAAM,EAAE,aAAa,CAAC,iCAAiC,CAAC;CACzD,CAAC;AAEN,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,aAAa,CAAC,gBAAgB,CAErF;AAED;;;GAGG;AACH,wBAAsB,YAAY,CAChC,MAAM,EAAE,WAAW,EACnB,KAAK,EAAE,aAAa,CAAC,gBAAgB,GAAG,SAAS,aAAa,CAAC,gBAAgB,EAAE,GAChF,OAAO,CAAC,aAAa,CAAC,mBAAmB,CAAC,CAkB5C;AAED;;;;GAIG;AACH,wBAAsB,aAAa,CAAC,GAAG,SAAS,MAAM,EACpD,MAAM,EAAE,WAAW,EACnB,MAAM,EAAE,SAAS,WAAW,CAAC,GAAG,CAAC,EAAE,GAAG,SAAS,GAC9C,OAAO,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE,GAAG,SAAS,CAAC,CAyBvC"}
@@ -1,46 +0,0 @@
1
- import type { MynthSDKTypes } from "./types";
2
- /**
3
- * Represents a completed video generation task.
4
- *
5
- * @template MetadataT - Type of the metadata attached to the request
6
- */
7
- export declare class VideoGenerationResult<MetadataT = Record<string, unknown> | undefined> {
8
- /** Raw task data from the API */
9
- readonly data: MynthSDKTypes.VideoGenerationTaskData;
10
- constructor(data: MynthSDKTypes.VideoGenerationTaskData);
11
- /** Unique identifier for this task */
12
- get id(): string;
13
- /** Current status of the task */
14
- get status(): MynthSDKTypes.TaskStatus;
15
- /**
16
- * The generation result containing videos and model info.
17
- * Returns `null` if the task hasn't completed yet.
18
- */
19
- get result(): MynthSDKTypes.VideoResult | null;
20
- /** Whether the task completed successfully */
21
- get isCompleted(): boolean;
22
- /** Whether the task failed */
23
- get isFailed(): boolean;
24
- /**
25
- * Get all successfully generated video URLs.
26
- * Convenience method that extracts just the URLs from successful videos.
27
- */
28
- get urls(): string[];
29
- /**
30
- * Get generated videos from the task result.
31
- *
32
- * @param options.includeFailed - If true, includes failed video results
33
- * @returns Array of video results
34
- */
35
- getVideos(options: {
36
- includeFailed: true;
37
- }): MynthSDKTypes.VideoResultVideo[];
38
- getVideos(options?: {
39
- includeFailed?: false;
40
- }): MynthSDKTypes.VideoResultVideoSuccess[];
41
- /**
42
- * Get the metadata that was attached to the generation request.
43
- */
44
- getMetadata(): MetadataT;
45
- }
46
- //# sourceMappingURL=video-generation-result.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"video-generation-result.d.ts","sourceRoot":"","sources":["../src/video-generation-result.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAE7C;;;;GAIG;AACH,qBAAa,qBAAqB,CAAC,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS;IAChF,iCAAiC;IACjC,SAAgB,IAAI,EAAE,aAAa,CAAC,uBAAuB,CAAC;gBAEhD,IAAI,EAAE,aAAa,CAAC,uBAAuB;IAIvD,sCAAsC;IACtC,IAAI,EAAE,IAAI,MAAM,CAEf;IAED,iCAAiC;IACjC,IAAI,MAAM,IAAI,aAAa,CAAC,UAAU,CAErC;IAED;;;OAGG;IACH,IAAI,MAAM,IAAI,aAAa,CAAC,WAAW,GAAG,IAAI,CAE7C;IAED,8CAA8C;IAC9C,IAAI,WAAW,IAAI,OAAO,CAEzB;IAED,8BAA8B;IAC9B,IAAI,QAAQ,IAAI,OAAO,CAEtB;IAED;;;OAGG;IACH,IAAI,IAAI,IAAI,MAAM,EAAE,CAEnB;IAED;;;;;OAKG;IACH,SAAS,CAAC,OAAO,EAAE;QAAE,aAAa,EAAE,IAAI,CAAA;KAAE,GAAG,aAAa,CAAC,gBAAgB,EAAE;IAC7E,SAAS,CAAC,OAAO,CAAC,EAAE;QAAE,aAAa,CAAC,EAAE,KAAK,CAAA;KAAE,GAAG,aAAa,CAAC,uBAAuB,EAAE;IAUvF;;OAEG;IACH,WAAW,IAAI,SAAS;CAGzB"}
@@ -1,5 +0,0 @@
1
- /** Read the webhook secret without assuming a Node.js runtime. */
2
- export declare function getWebhookSecretFromEnv(): string | undefined;
3
- /** Verify a Mynth HMAC-SHA256 signature against the unmodified request body. */
4
- export declare function verifySignature(body: string, signatureHeader: string, secret: string, toleranceSeconds?: number): Promise<boolean>;
5
- //# sourceMappingURL=utils.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/webhooks/utils.ts"],"names":[],"mappings":"AAGA,kEAAkE;AAClE,wBAAgB,uBAAuB,IAAI,MAAM,GAAG,SAAS,CAM5D;AAyBD,gFAAgF;AAChF,wBAAsB,eAAe,CACnC,IAAI,EAAE,MAAM,EACZ,eAAe,EAAE,MAAM,EACvB,MAAM,EAAE,MAAM,EACd,gBAAgB,CAAC,EAAE,MAAM,GACxB,OAAO,CAAC,OAAO,CAAC,CA2BlB"}