@corsair-dev/higgsfield 0.0.0-stage → 0.1.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/LICENSE +191 -0
- package/README.md +40 -2
- package/dist/api.test.d.ts +2 -0
- package/dist/api.test.d.ts.map +1 -0
- package/dist/client.d.ts +82 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.test.d.ts +2 -0
- package/dist/client.test.d.ts.map +1 -0
- package/dist/endpoints/files.d.ts +4 -0
- package/dist/endpoints/files.d.ts.map +1 -0
- package/dist/endpoints/generations.d.ts +11 -0
- package/dist/endpoints/generations.d.ts.map +1 -0
- package/dist/endpoints/index.d.ts +198 -0
- package/dist/endpoints/index.d.ts.map +1 -0
- package/dist/endpoints/models.d.ts +4 -0
- package/dist/endpoints/models.d.ts.map +1 -0
- package/dist/endpoints/requests.d.ts +6 -0
- package/dist/endpoints/requests.d.ts.map +1 -0
- package/dist/endpoints/types.d.ts +529 -0
- package/dist/endpoints/types.d.ts.map +1 -0
- package/dist/endpoints/usage.d.ts +3 -0
- package/dist/endpoints/usage.d.ts.map +1 -0
- package/dist/endpoints.test.d.ts +2 -0
- package/dist/endpoints.test.d.ts.map +1 -0
- package/dist/error-handlers.d.ts +45 -0
- package/dist/error-handlers.d.ts.map +1 -0
- package/dist/index.d.ts +363 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1 -0
- package/dist/integration.test.d.ts +2 -0
- package/dist/integration.test.d.ts.map +1 -0
- package/dist/jobs.test.d.ts +2 -0
- package/dist/jobs.test.d.ts.map +1 -0
- package/dist/schema/database.d.ts +2 -0
- package/dist/schema/database.d.ts.map +1 -0
- package/dist/schema/index.d.ts +5 -0
- package/dist/schema/index.d.ts.map +1 -0
- package/dist/schema.test.d.ts +2 -0
- package/dist/schema.test.d.ts.map +1 -0
- package/dist/test-fixtures.d.ts +41 -0
- package/dist/test-fixtures.d.ts.map +1 -0
- package/dist/tsup.config.d.ts +3 -0
- package/dist/tsup.config.d.ts.map +1 -0
- package/dist/webhooks/index.d.ts +67 -0
- package/dist/webhooks/index.d.ts.map +1 -0
- package/dist/webhooks/requests.d.ts +3 -0
- package/dist/webhooks/requests.d.ts.map +1 -0
- package/dist/webhooks/types.d.ts +92 -0
- package/dist/webhooks/types.d.ts.map +1 -0
- package/dist/webhooks.test.d.ts +2 -0
- package/dist/webhooks.test.d.ts.map +1 -0
- package/package.json +49 -3
package/LICENSE
ADDED
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(which shall not include Communications that are clearly marked or
|
|
39
|
+
otherwise designated in writing by the copyright owner as "Not a Work").
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution".
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
Copyright (c) 2026 Corsair
|
|
180
|
+
|
|
181
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
182
|
+
you may not use this file except in compliance with the License.
|
|
183
|
+
You may obtain a copy of the License at
|
|
184
|
+
|
|
185
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
186
|
+
|
|
187
|
+
Unless required by applicable law or agreed to in writing, software
|
|
188
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
189
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
190
|
+
See the License for the specific language governing permissions and
|
|
191
|
+
limitations under the License.
|
package/README.md
CHANGED
|
@@ -1,3 +1,41 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @corsair-dev/higgsfield
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Higgsfield plugin for Corsair.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
pnpm add @corsair-dev/higgsfield
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Endpoints
|
|
12
|
+
|
|
13
|
+
| Operation | Operation ID | Risk | Description |
|
|
14
|
+
|-----------|--------------|------|-------------|
|
|
15
|
+
| `files.createUploadUrl` | `higgsfield.api.files.createUploadUrl` | `write` | Get a presigned URL to PUT an input file to yourself, and the public URL it will have. For most uses files.upload does both steps. |
|
|
16
|
+
| `files.upload` | `higgsfield.api.files.upload` | `write` | Upload an image, audio or video file from base64 and get the public URL to pass as a model input. A file already at a public https URL needs no upload: pass that URL to the model. |
|
|
17
|
+
| `generations.estimate` | `higgsfield.api.generations.estimate` | `read` | What a generation with these inputs would cost, in US dollars and credits. Free; nothing runs. |
|
|
18
|
+
| `generations.run` | `higgsfield.api.generations.run` | `write` | Generate and wait up to waitSeconds (default 10, at most 15) for the output; spends account balance when it completes. Answers like requests.status: queued or in_progress is a job to follow with requests.status, and video usually takes longer than the wait. Outputs expire after 7 days by default. |
|
|
19
|
+
| `generations.submit` | `higgsfield.api.generations.submit` | `write` | Queue a generation (image, video…) and get a request id back at once; spends account balance when it completes. Follow it with requests.status until it is completed, failed, nsfw or canceled, or pass webhookUrl. Outputs expire after 7 days by default. Repeating with the returned idempotency_key is never charged twice. |
|
|
20
|
+
| `models.get` | `higgsfield.api.models.get` | `read` | One model by its path, with its input fields (input_schema). Read this before a generation: every model takes its own fields. |
|
|
21
|
+
| `models.list` | `higgsfield.api.models.list` | `read` | Find Higgsfield models by text, output type or operation; includeSchema adds their input fields |
|
|
22
|
+
| `requests.cancel` | `higgsfield.api.requests.cancel` | `write` | Cancel a request that is still queued and refund it. Once it has started it cannot be canceled, and this errors. |
|
|
23
|
+
| `requests.delete` | `higgsfield.api.requests.delete` | `destructive` | Delete a finished request's files, prompt and parameters now. Billing records stay. A request still running gets a 409. |
|
|
24
|
+
| `requests.status` | `higgsfield.api.requests.status` | `read` | Where a request stands, with its output URLs once completed. Output URLs stop working at expires_at, 7 days after it finished by default. |
|
|
25
|
+
| `usage.get` | `higgsfield.api.usage.get` | `read` | Completed generations and their estimated cost by model and time bucket. For monitoring: it can lag and is not a billing record. |
|
|
26
|
+
|
|
27
|
+
## Auth
|
|
28
|
+
|
|
29
|
+
Auth: API key. Corsair prompts your tenant for credentials on first use.
|
|
30
|
+
|
|
31
|
+
## Webhooks
|
|
32
|
+
|
|
33
|
+
Handles 1 webhook event. See the reference for payloads and `webhookHooks`.
|
|
34
|
+
|
|
35
|
+
## Reference
|
|
36
|
+
|
|
37
|
+
Full docs, types, and examples: https://docs.corsair.dev/plugins/higgsfield
|
|
38
|
+
|
|
39
|
+
## License
|
|
40
|
+
|
|
41
|
+
Apache-2.0
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api.test.d.ts","sourceRoot":"","sources":["../api.test.ts"],"names":[],"mappings":""}
|
package/dist/client.d.ts
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { ApiError } from 'corsair/http';
|
|
2
|
+
/** The one host the API key is ever sent to. */
|
|
3
|
+
export declare const HIGGSFIELD_API_BASE = "https://api.higgsfield.ai";
|
|
4
|
+
export type HiggsfieldErrorCode = 'invalid_key' | 'invalid_input' | 'network' | 'timeout' | 'bad_response' | 'not_found' | 'upload_failed';
|
|
5
|
+
/** A failure that isn't an HTTP answer from the API: bad input, the network, the upload. */
|
|
6
|
+
export declare class HiggsfieldError extends Error {
|
|
7
|
+
readonly code: HiggsfieldErrorCode;
|
|
8
|
+
/** Set on a failed submit: repeat with this key and no second charge is made. */
|
|
9
|
+
idempotencyKey?: string;
|
|
10
|
+
constructor(message: string, code: HiggsfieldErrorCode);
|
|
11
|
+
}
|
|
12
|
+
/** An HTTP error answer from the API, with the detail text and correlation id kept. */
|
|
13
|
+
export declare class HiggsfieldAPIError extends ApiError {
|
|
14
|
+
readonly correlationId?: string;
|
|
15
|
+
/** The `detail.code` of a structured error, for example account_queue_full. */
|
|
16
|
+
readonly detailCode?: string;
|
|
17
|
+
/** The `detail.retryable` of a structured error. */
|
|
18
|
+
readonly retryable?: boolean;
|
|
19
|
+
/** Set on a failed submit: repeat with this key and no second charge is made. */
|
|
20
|
+
idempotencyKey?: string;
|
|
21
|
+
constructor(init: {
|
|
22
|
+
method: 'GET' | 'POST' | 'DELETE';
|
|
23
|
+
path: string;
|
|
24
|
+
status: number;
|
|
25
|
+
statusText: string;
|
|
26
|
+
body: unknown;
|
|
27
|
+
message: string;
|
|
28
|
+
correlationId?: string;
|
|
29
|
+
retryAfterMs?: number;
|
|
30
|
+
detailCode?: string;
|
|
31
|
+
retryable?: boolean;
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* `Authorization: Key <id>:<secret>`. A key with no colon is refused here, on
|
|
36
|
+
* the way to every call, and the message never repeats any of it.
|
|
37
|
+
*/
|
|
38
|
+
export declare function authorizationHeader(apiKey: string): string;
|
|
39
|
+
/** Strips one surrounding slash; null when this cannot be a model path. */
|
|
40
|
+
export declare function normalizeModelPath(modelPath: string): string | null;
|
|
41
|
+
/** The path a generation is submitted to. */
|
|
42
|
+
export declare function submitPath(modelPath: string): string;
|
|
43
|
+
/** The path a generation is priced at. */
|
|
44
|
+
export declare function estimatePath(modelPath: string): string;
|
|
45
|
+
export declare function isValidRequestId(requestId: string): boolean;
|
|
46
|
+
/**
|
|
47
|
+
* Built from the request id, not from the status_url or cancel_url a response
|
|
48
|
+
* carries: those are the same paths today, and following a URL out of a
|
|
49
|
+
* response could send the key to another host.
|
|
50
|
+
*/
|
|
51
|
+
export declare function requestPath(requestId: string, action?: 'status' | 'cancel'): string;
|
|
52
|
+
export type HiggsfieldRequestInit = {
|
|
53
|
+
method?: 'GET' | 'POST' | 'DELETE';
|
|
54
|
+
query?: Record<string, string | number | boolean | readonly string[] | undefined>;
|
|
55
|
+
body?: unknown;
|
|
56
|
+
headers?: Record<string, string | undefined>;
|
|
57
|
+
timeoutMs?: number;
|
|
58
|
+
};
|
|
59
|
+
type ErrorDetail = {
|
|
60
|
+
text: string;
|
|
61
|
+
code?: string;
|
|
62
|
+
retryable?: boolean;
|
|
63
|
+
retryAfterSeconds?: number;
|
|
64
|
+
};
|
|
65
|
+
/** Reads the FastAPI `detail`, which is a string, a validation list or an object. */
|
|
66
|
+
export declare function readErrorDetail(body: unknown): ErrorDetail;
|
|
67
|
+
/**
|
|
68
|
+
* Calls the API. A plain fetch rather than `corsair/http`'s `request`, whose
|
|
69
|
+
* errors drop the response headers: support needs X-Correlation-ID, and its
|
|
70
|
+
* fixed status messages would replace Higgsfield's detail text. Redirects are
|
|
71
|
+
* refused so the key cannot follow one, and the transport makes one attempt:
|
|
72
|
+
* retries are error-handlers.ts's call.
|
|
73
|
+
*/
|
|
74
|
+
export declare function makeHiggsfieldRequest<T>(apiKey: string, path: string, init?: HiggsfieldRequestInit): Promise<T>;
|
|
75
|
+
/**
|
|
76
|
+
* PUTs bytes to the presigned URL files/generate-upload-url returned, with
|
|
77
|
+
* every header it asked for. The URL carries its own signature, so no
|
|
78
|
+
* Higgsfield credentials go with it, and the URL stays out of errors.
|
|
79
|
+
*/
|
|
80
|
+
export declare function putToPresignedUrl(uploadUrl: string, bytes: Uint8Array, headers: Record<string, string>): Promise<void>;
|
|
81
|
+
export {};
|
|
82
|
+
//# sourceMappingURL=client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../client.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.test.d.ts","sourceRoot":"","sources":["../client.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"files.d.ts","sourceRoot":"","sources":["../../endpoints/files.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AA6DpD,eAAO,MAAM,eAAe,EAAE,mBAAmB,CAAC,sBAAsB,CAYtE,CAAC;AAEH,eAAO,MAAM,MAAM,EAAE,mBAAmB,CAAC,aAAa,CA0BrD,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { HiggsfieldEndpoints } from '../index';
|
|
2
|
+
export declare const submit: HiggsfieldEndpoints['generationsSubmit'];
|
|
3
|
+
/**
|
|
4
|
+
* Submits and waits a little for the end. Nothing after the submit throws: an
|
|
5
|
+
* error here would read as a failed call, and a caller or retry handler would
|
|
6
|
+
* pay for the generation again. A request that hasn't ended, or whose status
|
|
7
|
+
* couldn't be read, comes back as the job it is.
|
|
8
|
+
*/
|
|
9
|
+
export declare const run: HiggsfieldEndpoints['generationsRun'];
|
|
10
|
+
export declare const estimate: HiggsfieldEndpoints['generationsEstimate'];
|
|
11
|
+
//# sourceMappingURL=generations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generations.d.ts","sourceRoot":"","sources":["../../endpoints/generations.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAqB,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAkJvE,eAAO,MAAM,MAAM,EAAE,mBAAmB,CAAC,mBAAmB,CAY3D,CAAC;AAwDF;;;;;GAKG;AACH,eAAO,MAAM,GAAG,EAAE,mBAAmB,CAAC,gBAAgB,CAoCrD,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,mBAAmB,CAAC,qBAAqB,CAmB/D,CAAC"}
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
export declare const Generations: {
|
|
2
|
+
submit: (ctx: import("..").HiggsfieldContext, args: {
|
|
3
|
+
modelPath: string;
|
|
4
|
+
input: Record<string, unknown>;
|
|
5
|
+
webhookUrl?: string | undefined;
|
|
6
|
+
idempotencyKey?: string | undefined;
|
|
7
|
+
expiresAfter?: number | undefined;
|
|
8
|
+
}) => Promise<{
|
|
9
|
+
[x: string]: unknown;
|
|
10
|
+
status: string;
|
|
11
|
+
request_id: string;
|
|
12
|
+
idempotency_key: string;
|
|
13
|
+
status_url?: string | null | undefined;
|
|
14
|
+
cancel_url?: string | null | undefined;
|
|
15
|
+
expires_after?: number | null | undefined;
|
|
16
|
+
}>;
|
|
17
|
+
run: (ctx: import("..").HiggsfieldContext, args: {
|
|
18
|
+
modelPath: string;
|
|
19
|
+
input: Record<string, unknown>;
|
|
20
|
+
webhookUrl?: string | undefined;
|
|
21
|
+
idempotencyKey?: string | undefined;
|
|
22
|
+
expiresAfter?: number | undefined;
|
|
23
|
+
waitSeconds?: number | undefined;
|
|
24
|
+
}) => Promise<{
|
|
25
|
+
[x: string]: unknown;
|
|
26
|
+
status: string;
|
|
27
|
+
request_id: string;
|
|
28
|
+
idempotency_key: string;
|
|
29
|
+
status_url?: string | null | undefined;
|
|
30
|
+
cancel_url?: string | null | undefined;
|
|
31
|
+
error?: string | Record<string, unknown> | null | undefined;
|
|
32
|
+
expires_at?: string | null | undefined;
|
|
33
|
+
images?: {
|
|
34
|
+
[x: string]: unknown;
|
|
35
|
+
url?: string | null | undefined;
|
|
36
|
+
content_type?: string | null | undefined;
|
|
37
|
+
}[] | null | undefined;
|
|
38
|
+
video?: {
|
|
39
|
+
[x: string]: unknown;
|
|
40
|
+
url?: string | null | undefined;
|
|
41
|
+
content_type?: string | null | undefined;
|
|
42
|
+
} | null | undefined;
|
|
43
|
+
audio?: {
|
|
44
|
+
[x: string]: unknown;
|
|
45
|
+
url?: string | null | undefined;
|
|
46
|
+
content_type?: string | null | undefined;
|
|
47
|
+
} | null | undefined;
|
|
48
|
+
audios?: {
|
|
49
|
+
[x: string]: unknown;
|
|
50
|
+
url?: string | null | undefined;
|
|
51
|
+
content_type?: string | null | undefined;
|
|
52
|
+
}[] | null | undefined;
|
|
53
|
+
expires_after?: number | null | undefined;
|
|
54
|
+
}>;
|
|
55
|
+
estimate: (ctx: import("..").HiggsfieldContext, args: {
|
|
56
|
+
modelPath: string;
|
|
57
|
+
input: Record<string, unknown>;
|
|
58
|
+
}) => Promise<{
|
|
59
|
+
[x: string]: unknown;
|
|
60
|
+
type?: string | null | undefined;
|
|
61
|
+
credits?: string | null | undefined;
|
|
62
|
+
usd?: string | null | undefined;
|
|
63
|
+
discount?: unknown;
|
|
64
|
+
}>;
|
|
65
|
+
};
|
|
66
|
+
export declare const Requests: {
|
|
67
|
+
status: (ctx: import("..").HiggsfieldContext, args: {
|
|
68
|
+
requestId: string;
|
|
69
|
+
}) => Promise<{
|
|
70
|
+
[x: string]: unknown;
|
|
71
|
+
status: string;
|
|
72
|
+
request_id: string;
|
|
73
|
+
status_url?: string | null | undefined;
|
|
74
|
+
cancel_url?: string | null | undefined;
|
|
75
|
+
error?: string | Record<string, unknown> | null | undefined;
|
|
76
|
+
expires_at?: string | null | undefined;
|
|
77
|
+
images?: {
|
|
78
|
+
[x: string]: unknown;
|
|
79
|
+
url?: string | null | undefined;
|
|
80
|
+
content_type?: string | null | undefined;
|
|
81
|
+
}[] | null | undefined;
|
|
82
|
+
video?: {
|
|
83
|
+
[x: string]: unknown;
|
|
84
|
+
url?: string | null | undefined;
|
|
85
|
+
content_type?: string | null | undefined;
|
|
86
|
+
} | null | undefined;
|
|
87
|
+
audio?: {
|
|
88
|
+
[x: string]: unknown;
|
|
89
|
+
url?: string | null | undefined;
|
|
90
|
+
content_type?: string | null | undefined;
|
|
91
|
+
} | null | undefined;
|
|
92
|
+
audios?: {
|
|
93
|
+
[x: string]: unknown;
|
|
94
|
+
url?: string | null | undefined;
|
|
95
|
+
content_type?: string | null | undefined;
|
|
96
|
+
}[] | null | undefined;
|
|
97
|
+
}>;
|
|
98
|
+
cancel: (ctx: import("..").HiggsfieldContext, args: {
|
|
99
|
+
requestId: string;
|
|
100
|
+
}) => Promise<{
|
|
101
|
+
request_id: string;
|
|
102
|
+
status: "canceled";
|
|
103
|
+
}>;
|
|
104
|
+
delete: (ctx: import("..").HiggsfieldContext, args: {
|
|
105
|
+
requestId: string;
|
|
106
|
+
}) => Promise<{
|
|
107
|
+
[x: string]: unknown;
|
|
108
|
+
request_id: string;
|
|
109
|
+
status: string;
|
|
110
|
+
}>;
|
|
111
|
+
};
|
|
112
|
+
export declare const Files: {
|
|
113
|
+
createUploadUrl: (ctx: import("..").HiggsfieldContext, args: {
|
|
114
|
+
contentType: "image/png" | "image/jpeg" | "image/jpg" | "image/gif" | "image/webp" | "audio/x-wav" | "audio/wav" | "audio/mpeg" | "audio/mp3" | "audio/mp4" | "audio/x-m4a" | "audio/aac" | "audio/ogg" | "audio/flac" | "audio/x-flac" | "audio/webm" | "video/mp4";
|
|
115
|
+
}) => Promise<{
|
|
116
|
+
[x: string]: unknown;
|
|
117
|
+
public_url: string;
|
|
118
|
+
upload_url: string;
|
|
119
|
+
content_type?: string | null | undefined;
|
|
120
|
+
upload_headers?: Record<string, string> | null | undefined;
|
|
121
|
+
}>;
|
|
122
|
+
upload: (ctx: import("..").HiggsfieldContext, args: {
|
|
123
|
+
contentBase64: string;
|
|
124
|
+
contentType: "image/png" | "image/jpeg" | "image/jpg" | "image/gif" | "image/webp" | "audio/x-wav" | "audio/wav" | "audio/mpeg" | "audio/mp3" | "audio/mp4" | "audio/x-m4a" | "audio/aac" | "audio/ogg" | "audio/flac" | "audio/x-flac" | "audio/webm" | "video/mp4";
|
|
125
|
+
}) => Promise<{
|
|
126
|
+
public_url: string;
|
|
127
|
+
content_type: string;
|
|
128
|
+
size: number;
|
|
129
|
+
}>;
|
|
130
|
+
};
|
|
131
|
+
export declare const Models: {
|
|
132
|
+
list: (ctx: import("..").HiggsfieldContext, args: {
|
|
133
|
+
search?: string | undefined;
|
|
134
|
+
outputType?: string | undefined;
|
|
135
|
+
operationType?: string | undefined;
|
|
136
|
+
includeSchema?: boolean | undefined;
|
|
137
|
+
}) => Promise<{
|
|
138
|
+
[x: string]: unknown;
|
|
139
|
+
items: {
|
|
140
|
+
[x: string]: unknown;
|
|
141
|
+
slug: string;
|
|
142
|
+
title?: string | null | undefined;
|
|
143
|
+
description?: string | null | undefined;
|
|
144
|
+
operation_type?: string[] | null | undefined;
|
|
145
|
+
output_type?: string | null | undefined;
|
|
146
|
+
base_credits?: string | null | undefined;
|
|
147
|
+
is_workflow?: boolean | null | undefined;
|
|
148
|
+
input_schema?: Record<string, unknown> | null | undefined;
|
|
149
|
+
}[];
|
|
150
|
+
total?: number | null | undefined;
|
|
151
|
+
}>;
|
|
152
|
+
get: (ctx: import("..").HiggsfieldContext, args: {
|
|
153
|
+
modelPath: string;
|
|
154
|
+
}) => Promise<{
|
|
155
|
+
[x: string]: unknown;
|
|
156
|
+
slug: string;
|
|
157
|
+
title?: string | null | undefined;
|
|
158
|
+
description?: string | null | undefined;
|
|
159
|
+
operation_type?: string[] | null | undefined;
|
|
160
|
+
output_type?: string | null | undefined;
|
|
161
|
+
base_credits?: string | null | undefined;
|
|
162
|
+
is_workflow?: boolean | null | undefined;
|
|
163
|
+
input_schema?: Record<string, unknown> | null | undefined;
|
|
164
|
+
}>;
|
|
165
|
+
};
|
|
166
|
+
export declare const Usage: {
|
|
167
|
+
get: (ctx: import("..").HiggsfieldContext, args: {
|
|
168
|
+
start?: string | undefined;
|
|
169
|
+
end?: string | undefined;
|
|
170
|
+
timeframe?: "hour" | "day" | "week" | "month" | undefined;
|
|
171
|
+
boundToTimeframe?: boolean | undefined;
|
|
172
|
+
models?: string[] | undefined;
|
|
173
|
+
byApiKey?: boolean | undefined;
|
|
174
|
+
page?: number | undefined;
|
|
175
|
+
limit?: number | undefined;
|
|
176
|
+
}) => Promise<{
|
|
177
|
+
[x: string]: unknown;
|
|
178
|
+
time_series?: {
|
|
179
|
+
[x: string]: unknown;
|
|
180
|
+
bucket: string;
|
|
181
|
+
results: {
|
|
182
|
+
[x: string]: unknown;
|
|
183
|
+
model?: string | null | undefined;
|
|
184
|
+
unit?: string | null | undefined;
|
|
185
|
+
quantity?: string | null | undefined;
|
|
186
|
+
unit_price?: string | null | undefined;
|
|
187
|
+
cost?: string | null | undefined;
|
|
188
|
+
currency?: string | null | undefined;
|
|
189
|
+
auth_method?: string | null | undefined;
|
|
190
|
+
}[];
|
|
191
|
+
}[] | null | undefined;
|
|
192
|
+
total?: number | null | undefined;
|
|
193
|
+
page?: number | null | undefined;
|
|
194
|
+
limit?: number | null | undefined;
|
|
195
|
+
}>;
|
|
196
|
+
};
|
|
197
|
+
export * from './types';
|
|
198
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../endpoints/index.ts"],"names":[],"mappings":"AAiBA,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAIvB,CAAC;AAEF,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAIpB,CAAC;AAEF,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;;;CAGjB,CAAC;AAEF,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAGlB,CAAC;AAEF,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAEjB,CAAC;AAEF,cAAc,SAAS,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../../endpoints/models.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAiDpD,eAAO,MAAM,IAAI,EAAE,mBAAmB,CAAC,YAAY,CAalD,CAAC;AAEF,eAAO,MAAM,GAAG,EAAE,mBAAmB,CAAC,WAAW,CAoBhD,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { HiggsfieldEndpoints } from '../index';
|
|
2
|
+
export declare const status: HiggsfieldEndpoints['requestsStatus'];
|
|
3
|
+
/** 202 with an empty body while queued. Higgsfield answers 400 from the moment it starts, and also once it has finished. */
|
|
4
|
+
export declare const cancel: HiggsfieldEndpoints['requestsCancel'];
|
|
5
|
+
export declare const deleteRequest: HiggsfieldEndpoints['requestsDelete'];
|
|
6
|
+
//# sourceMappingURL=requests.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"requests.d.ts","sourceRoot":"","sources":["../../endpoints/requests.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAMpD,eAAO,MAAM,MAAM,EAAE,mBAAmB,CAAC,gBAAgB,CAkBxD,CAAC;AAEF,4HAA4H;AAC5H,eAAO,MAAM,MAAM,EAAE,mBAAmB,CAAC,gBAAgB,CA6BxD,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,mBAAmB,CAAC,gBAAgB,CAiB/D,CAAC"}
|