@liforma/publisher 0.1.2 → 0.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/README.md +11 -2
- package/dist/browser.d.ts +4 -0
- package/dist/browser.d.ts.map +1 -0
- package/dist/browser.js +5 -0
- package/dist/browser.js.map +1 -0
- package/dist/createPublisher.d.ts +170 -83
- package/dist/createPublisher.d.ts.map +1 -1
- package/dist/createPublisher.js +252 -103
- package/dist/createPublisher.js.map +1 -1
- package/dist/errors.d.ts +3 -2
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +0 -1
- package/dist/errors.js.map +1 -1
- package/dist/hash.d.ts +1 -1
- package/dist/hash.d.ts.map +1 -1
- package/dist/http.d.ts +3 -1
- package/dist/http.d.ts.map +1 -1
- package/dist/http.js +8 -23
- package/dist/http.js.map +1 -1
- package/dist/index.d.ts +5 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/jobs.d.ts +7 -5
- package/dist/jobs.d.ts.map +1 -1
- package/dist/jobs.js +49 -52
- package/dist/jobs.js.map +1 -1
- package/dist/retry.d.ts +16 -0
- package/dist/retry.d.ts.map +1 -0
- package/dist/retry.js +52 -0
- package/dist/retry.js.map +1 -0
- package/dist/schemas.d.ts +448 -89
- package/dist/schemas.d.ts.map +1 -1
- package/dist/schemas.js +122 -36
- package/dist/schemas.js.map +1 -1
- package/dist/upload.d.ts +1 -0
- package/dist/upload.d.ts.map +1 -1
- package/dist/upload.js +41 -18
- package/dist/upload.js.map +1 -1
- package/dist/version.d.ts +2 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +2 -0
- package/dist/version.js.map +1 -0
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @liforma/publisher
|
|
2
2
|
|
|
3
|
-
Server SDK for Liforma
|
|
3
|
+
Server SDK for the Liforma Publisher API — upload images, create locations, wrap places, create clothes/hair/characters, and publish experiences.
|
|
4
4
|
|
|
5
5
|
```bash
|
|
6
6
|
npm install @liforma/publisher
|
|
@@ -10,7 +10,8 @@ npm install @liforma/publisher
|
|
|
10
10
|
import { createPublisher } from '@liforma/publisher';
|
|
11
11
|
|
|
12
12
|
const publisher = createPublisher(process.env.LIFORMA_PROJECT_ID!, {
|
|
13
|
-
apiKey: process.env.LIFORMA_API_KEY
|
|
13
|
+
apiKey: process.env.LIFORMA_API_KEY!,
|
|
14
|
+
retryPolicy: { maxAttempts: 3 }
|
|
14
15
|
});
|
|
15
16
|
|
|
16
17
|
const background = await publisher.uploadImage(lobbyPng, { contentType: 'image/png' });
|
|
@@ -18,6 +19,14 @@ const location = await publisher.createLocation({ name: 'Hotel lobby', image: ba
|
|
|
18
19
|
const place = await publisher.createPlace({ name: 'Hotel lobby', locationId: location.id });
|
|
19
20
|
```
|
|
20
21
|
|
|
22
|
+
Reload with `getCharacter`, `getPlace`, `getExperience`, and `getLocation`. GET still works after archive and includes public `status`. Edit drafts with `update*` — `updateExperience` does not publish. Archive with `archive*`, undo with `restore*`, and permanently remove with `delete*` only after archive. Pass `forceNew: true` on plate creates to skip content-addressed reuse.
|
|
23
|
+
|
|
24
|
+
Long-running creates poll durable Publisher jobs. Use `start*` to keep the job handle, `jobs.wait(jobId)` to resume polling, `jobs.watch(jobId)` for progress, and `jobs.retry(jobId)` after a failed job. Polling a job may resume serverless processing.
|
|
25
|
+
|
|
26
|
+
`jobs.wait` and `jobs.watch` throw `LiformaPublisherError` for failed or incomplete jobs. `error.job` contains the typed last job. `JOB_WAIT_TIMEOUT` only stops local waiting and is not retryable; resume explicitly with `jobs.wait(jobId)`. HTTP retries are bounded, honor `Retry-After`, and apply only to GET/PATCH, retry-safe job/upload operations, and the presigned upload PUT—not resource creates.
|
|
27
|
+
|
|
28
|
+
Experience responses describe the current draft. Use `hasPublishedRevision` and `hasUnpublishedChanges`; `published` is a deprecated 0.x compatibility alias.
|
|
29
|
+
|
|
21
30
|
Use a **live** API key on the server only. Never ship this package or the key to a browser.
|
|
22
31
|
|
|
23
32
|
Docs (alpha): https://docs.liforma.ai/_alpha/publisher-sdk
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"browser.d.ts","sourceRoot":"","sources":["../src/browser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AACtE,mBAAmB,YAAY,CAAC;AAEhC,wBAAgB,eAAe,IAAI,KAAK,CAIvC"}
|
package/dist/browser.js
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { LiformaPublisherError, isRetryableError } from './errors.js';
|
|
2
|
+
export function createPublisher() {
|
|
3
|
+
throw new Error('@liforma/publisher is server-only and cannot be used in a browser bundle. Call it from server code.');
|
|
4
|
+
}
|
|
5
|
+
//# sourceMappingURL=browser.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"browser.js","sourceRoot":"","sources":["../src/browser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAGtE,MAAM,UAAU,eAAe;IAC9B,MAAM,IAAI,KAAK,CACd,qGAAqG,CACrG,CAAC;AACH,CAAC"}
|
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
import { type WaitOptions } from './jobs.js';
|
|
2
|
-
import { type
|
|
2
|
+
import { type Avatar, type PersonaEthnicity, type PersonaGender, type PublishJob, type CharacterResource, type ClothesResource, type CreateClothesPublishResponse, type CreateHairPublishResponse, type CreateLocationPublishResponse, type ExperienceResource, type HairResource, type LocationResource, type PlaceResource } from './schemas.js';
|
|
3
3
|
import type { ImageBytes } from './hash.js';
|
|
4
|
+
import { type RetryPolicy } from './retry.js';
|
|
4
5
|
import { type UploadedImage } from './upload.js';
|
|
5
6
|
export type CreatePublisherOptions = {
|
|
6
7
|
readonly apiKey?: string;
|
|
7
8
|
readonly baseUrl?: string;
|
|
8
9
|
readonly fetch?: typeof fetch;
|
|
10
|
+
readonly retryPolicy?: RetryPolicy;
|
|
9
11
|
};
|
|
10
12
|
export type BackgroundMode = 'remove' | 'transparent';
|
|
11
13
|
export type PollableCreateOptions = WaitOptions & {
|
|
12
14
|
readonly externalId?: string;
|
|
15
|
+
readonly forceNew?: boolean;
|
|
13
16
|
};
|
|
14
17
|
export type CreateClothesInput = PollableCreateOptions & {
|
|
15
18
|
readonly avatarId: string;
|
|
@@ -42,6 +45,9 @@ export type CreateCharacterInput = {
|
|
|
42
45
|
readonly hairId?: string;
|
|
43
46
|
readonly personality?: string;
|
|
44
47
|
readonly generalInstructions?: string;
|
|
48
|
+
readonly gender?: PersonaGender;
|
|
49
|
+
readonly age?: number;
|
|
50
|
+
readonly ethnicity?: PersonaEthnicity;
|
|
45
51
|
readonly externalId?: string;
|
|
46
52
|
readonly signal?: AbortSignal;
|
|
47
53
|
};
|
|
@@ -58,10 +64,42 @@ export type CreateExperienceInput = {
|
|
|
58
64
|
readonly externalId?: string;
|
|
59
65
|
readonly signal?: AbortSignal;
|
|
60
66
|
};
|
|
67
|
+
export type UpdateCharacterInput = {
|
|
68
|
+
readonly avatarId?: string;
|
|
69
|
+
readonly name?: string;
|
|
70
|
+
readonly voice?: string;
|
|
71
|
+
readonly sttLang?: string;
|
|
72
|
+
readonly clothesId?: string | null;
|
|
73
|
+
readonly hairId?: string | null;
|
|
74
|
+
readonly personality?: string | null;
|
|
75
|
+
readonly generalInstructions?: string | null;
|
|
76
|
+
readonly gender?: PersonaGender | null;
|
|
77
|
+
readonly age?: number | null;
|
|
78
|
+
readonly ethnicity?: PersonaEthnicity | null;
|
|
79
|
+
readonly signal?: AbortSignal;
|
|
80
|
+
};
|
|
81
|
+
export type UpdatePlaceInput = {
|
|
82
|
+
readonly name?: string;
|
|
83
|
+
readonly locationId?: string;
|
|
84
|
+
readonly signal?: AbortSignal;
|
|
85
|
+
};
|
|
86
|
+
export type UpdateHairInput = {
|
|
87
|
+
readonly name: string;
|
|
88
|
+
readonly signal?: AbortSignal;
|
|
89
|
+
};
|
|
90
|
+
export type UpdateClothesInput = {
|
|
91
|
+
readonly name: string;
|
|
92
|
+
readonly signal?: AbortSignal;
|
|
93
|
+
};
|
|
61
94
|
export type UpdateExperienceInput = {
|
|
62
95
|
readonly title?: string;
|
|
63
96
|
readonly slug?: string;
|
|
64
97
|
readonly attributes?: Record<string, string>;
|
|
98
|
+
readonly characterId?: string;
|
|
99
|
+
readonly placeId?: string;
|
|
100
|
+
readonly startingMessage?: string;
|
|
101
|
+
readonly systemInstructions?: string;
|
|
102
|
+
readonly introduction?: string;
|
|
65
103
|
readonly signal?: AbortSignal;
|
|
66
104
|
};
|
|
67
105
|
export declare function createPublisher(projectId: string, options?: CreatePublisherOptions): {
|
|
@@ -75,65 +113,128 @@ export declare function createPublisher(projectId: string, options?: CreatePubli
|
|
|
75
113
|
contentType: string;
|
|
76
114
|
signal?: AbortSignal;
|
|
77
115
|
}) => Promise<UploadedImage>;
|
|
78
|
-
listAvatars: (signal?: AbortSignal) => Promise<
|
|
79
|
-
startClothes: (input: CreateClothesInput) => Promise<
|
|
116
|
+
listAvatars: (signal?: AbortSignal) => Promise<Avatar[]>;
|
|
117
|
+
startClothes: (input: CreateClothesInput) => Promise<CreateClothesPublishResponse>;
|
|
80
118
|
createClothes: (input: CreateClothesInput) => Promise<ClothesResource>;
|
|
81
119
|
getClothes: (clothesId: string, signal?: AbortSignal) => Promise<{
|
|
82
120
|
kind: "clothes";
|
|
83
121
|
id: string;
|
|
84
122
|
avatarId: string;
|
|
85
123
|
name: string;
|
|
86
|
-
status:
|
|
124
|
+
status: "processing" | "ready" | "failed" | "archived";
|
|
87
125
|
source: string;
|
|
88
|
-
renderKind: string;
|
|
89
|
-
catalogueKey: string | null;
|
|
90
|
-
assetPath: string | null;
|
|
91
126
|
externalId: string | null;
|
|
92
127
|
createdAt: string;
|
|
93
128
|
updatedAt: string;
|
|
94
129
|
}>;
|
|
95
|
-
|
|
130
|
+
updateClothes: (clothesId: string, input: UpdateClothesInput) => Promise<ClothesResource>;
|
|
131
|
+
startHair: (input: CreateHairInput) => Promise<CreateHairPublishResponse>;
|
|
96
132
|
createHair: (input: CreateHairInput) => Promise<HairResource>;
|
|
97
133
|
getHair: (hairId: string, signal?: AbortSignal) => Promise<{
|
|
98
134
|
kind: "hair";
|
|
99
135
|
id: string;
|
|
100
136
|
avatarId: string;
|
|
101
137
|
name: string;
|
|
102
|
-
status:
|
|
138
|
+
status: "processing" | "ready" | "failed" | "archived";
|
|
103
139
|
source: string;
|
|
104
|
-
catalogueKey: string | null;
|
|
105
|
-
assetPath: string | null;
|
|
106
140
|
externalId: string | null;
|
|
107
141
|
createdAt: string;
|
|
108
142
|
updatedAt: string;
|
|
109
143
|
}>;
|
|
110
|
-
|
|
144
|
+
updateHair: (hairId: string, input: UpdateHairInput) => Promise<HairResource>;
|
|
145
|
+
startLocation: (input: CreateLocationInput) => Promise<CreateLocationPublishResponse>;
|
|
111
146
|
createLocation: (input: CreateLocationInput) => Promise<LocationResource>;
|
|
112
147
|
getLocation: (locationId: string, signal?: AbortSignal) => Promise<{
|
|
113
148
|
kind: "location";
|
|
114
149
|
id: string;
|
|
115
|
-
status:
|
|
150
|
+
status: "processing" | "ready" | "failed" | "archived";
|
|
116
151
|
name: string;
|
|
117
152
|
depthEncoding: string | null;
|
|
118
153
|
externalId: string | null;
|
|
154
|
+
style?: string | null | undefined;
|
|
155
|
+
}>;
|
|
156
|
+
getPlace: (placeId: string, signal?: AbortSignal) => Promise<{
|
|
157
|
+
id: string;
|
|
158
|
+
name: string;
|
|
159
|
+
locationId: string;
|
|
160
|
+
status: "archived" | "active";
|
|
161
|
+
externalId: string | null;
|
|
162
|
+
createdAt: string;
|
|
163
|
+
updatedAt: string;
|
|
164
|
+
style?: string | null | undefined;
|
|
119
165
|
}>;
|
|
120
166
|
createPlace: (input: CreatePlaceInput) => Promise<PlaceResource>;
|
|
167
|
+
getCharacter: (characterId: string, signal?: AbortSignal) => Promise<{
|
|
168
|
+
id: string;
|
|
169
|
+
projectId: string;
|
|
170
|
+
name: string;
|
|
171
|
+
avatarId: string;
|
|
172
|
+
voice: string;
|
|
173
|
+
sttLang: string;
|
|
174
|
+
clothesId: string | null;
|
|
175
|
+
hairId: string | null;
|
|
176
|
+
personality: string | null;
|
|
177
|
+
generalInstructions: string | null;
|
|
178
|
+
status: "archived" | "active";
|
|
179
|
+
externalId: string | null;
|
|
180
|
+
createdAt: string;
|
|
181
|
+
updatedAt: string;
|
|
182
|
+
gender?: "female" | "male" | "non-binary" | null | undefined;
|
|
183
|
+
age?: number | null | undefined;
|
|
184
|
+
ethnicity?: "african" | "east-asian" | "european" | "indigenous" | "mediterranean" | "middle-eastern" | "mixed" | "north-african" | "pacific-islander" | "south-asian" | "southeast-asian" | null | undefined;
|
|
185
|
+
style?: string | null | undefined;
|
|
186
|
+
}>;
|
|
121
187
|
createCharacter: (input: CreateCharacterInput) => Promise<CharacterResource>;
|
|
188
|
+
updateCharacter: (characterId: string, input: UpdateCharacterInput) => Promise<CharacterResource>;
|
|
189
|
+
updatePlace: (placeId: string, input: UpdatePlaceInput) => Promise<PlaceResource>;
|
|
122
190
|
createExperience: (input: CreateExperienceInput) => Promise<ExperienceResource>;
|
|
123
191
|
getExperience: (experienceId: string, signal?: AbortSignal) => Promise<ExperienceResource>;
|
|
124
192
|
updateExperience: (experienceId: string, input: UpdateExperienceInput) => Promise<ExperienceResource>;
|
|
125
193
|
publishExperience: (experienceId: string, signal?: AbortSignal) => Promise<ExperienceResource>;
|
|
194
|
+
archiveExperience: (experienceId: string, signal?: AbortSignal) => Promise<ExperienceResource>;
|
|
195
|
+
restoreExperience: (experienceId: string, signal?: AbortSignal) => Promise<ExperienceResource>;
|
|
196
|
+
deleteExperience: (experienceId: string, signal?: AbortSignal) => Promise<{
|
|
197
|
+
deleted: true;
|
|
198
|
+
id: string;
|
|
199
|
+
}>;
|
|
200
|
+
archiveCharacter: (characterId: string, signal?: AbortSignal) => Promise<CharacterResource>;
|
|
201
|
+
restoreCharacter: (characterId: string, signal?: AbortSignal) => Promise<CharacterResource>;
|
|
202
|
+
deleteCharacter: (characterId: string, signal?: AbortSignal) => Promise<{
|
|
203
|
+
deleted: true;
|
|
204
|
+
id: string;
|
|
205
|
+
}>;
|
|
206
|
+
archivePlace: (placeId: string, signal?: AbortSignal) => Promise<PlaceResource>;
|
|
207
|
+
restorePlace: (placeId: string, signal?: AbortSignal) => Promise<PlaceResource>;
|
|
208
|
+
deletePlace: (placeId: string, signal?: AbortSignal) => Promise<{
|
|
209
|
+
deleted: true;
|
|
210
|
+
id: string;
|
|
211
|
+
}>;
|
|
212
|
+
archiveLocation: (locationId: string, signal?: AbortSignal) => Promise<LocationResource>;
|
|
213
|
+
restoreLocation: (locationId: string, signal?: AbortSignal) => Promise<LocationResource>;
|
|
214
|
+
deleteLocation: (locationId: string, signal?: AbortSignal) => Promise<{
|
|
215
|
+
deleted: true;
|
|
216
|
+
id: string;
|
|
217
|
+
}>;
|
|
218
|
+
archiveClothes: (clothesId: string, signal?: AbortSignal) => Promise<ClothesResource>;
|
|
219
|
+
restoreClothes: (clothesId: string, signal?: AbortSignal) => Promise<ClothesResource>;
|
|
220
|
+
deleteClothes: (clothesId: string, signal?: AbortSignal) => Promise<{
|
|
221
|
+
deleted: true;
|
|
222
|
+
id: string;
|
|
223
|
+
}>;
|
|
224
|
+
archiveHair: (hairId: string, signal?: AbortSignal) => Promise<HairResource>;
|
|
225
|
+
restoreHair: (hairId: string, signal?: AbortSignal) => Promise<HairResource>;
|
|
226
|
+
deleteHair: (hairId: string, signal?: AbortSignal) => Promise<{
|
|
227
|
+
deleted: true;
|
|
228
|
+
id: string;
|
|
229
|
+
}>;
|
|
126
230
|
jobs: {
|
|
127
231
|
get: (jobId: string, signal?: AbortSignal) => Promise<{
|
|
128
232
|
id: string;
|
|
129
|
-
status: "
|
|
130
|
-
kind: "
|
|
233
|
+
status: "failed" | "queued" | "running" | "waiting_processor" | "succeeded";
|
|
234
|
+
kind: "clothes" | "hair" | "location";
|
|
131
235
|
pollUrl: string;
|
|
132
236
|
targetId: string;
|
|
133
237
|
requiredOk: boolean;
|
|
134
|
-
claimCount: number;
|
|
135
|
-
failureCount: number;
|
|
136
|
-
nextRunAt: string | null;
|
|
137
238
|
stage: string | null;
|
|
138
239
|
progress: {
|
|
139
240
|
requiredVerified: number;
|
|
@@ -143,26 +244,14 @@ export declare function createPublisher(projectId: string, options?: CreatePubli
|
|
|
143
244
|
code: string;
|
|
144
245
|
message: string;
|
|
145
246
|
} | null;
|
|
146
|
-
enrichment: {
|
|
147
|
-
status: "running" | "failed" | "pending" | "complete" | "not_applicable";
|
|
148
|
-
verified: number;
|
|
149
|
-
total: number;
|
|
150
|
-
error: {
|
|
151
|
-
code: string;
|
|
152
|
-
message: string;
|
|
153
|
-
} | null;
|
|
154
|
-
};
|
|
155
247
|
}>;
|
|
156
248
|
wait: (jobId: string, waitOptions?: WaitOptions) => Promise<{
|
|
157
249
|
id: string;
|
|
158
|
-
status: "
|
|
159
|
-
kind: "
|
|
250
|
+
status: "failed" | "queued" | "running" | "waiting_processor" | "succeeded";
|
|
251
|
+
kind: "clothes" | "hair" | "location";
|
|
160
252
|
pollUrl: string;
|
|
161
253
|
targetId: string;
|
|
162
254
|
requiredOk: boolean;
|
|
163
|
-
claimCount: number;
|
|
164
|
-
failureCount: number;
|
|
165
|
-
nextRunAt: string | null;
|
|
166
255
|
stage: string | null;
|
|
167
256
|
progress: {
|
|
168
257
|
requiredVerified: number;
|
|
@@ -172,26 +261,14 @@ export declare function createPublisher(projectId: string, options?: CreatePubli
|
|
|
172
261
|
code: string;
|
|
173
262
|
message: string;
|
|
174
263
|
} | null;
|
|
175
|
-
enrichment: {
|
|
176
|
-
status: "running" | "failed" | "pending" | "complete" | "not_applicable";
|
|
177
|
-
verified: number;
|
|
178
|
-
total: number;
|
|
179
|
-
error: {
|
|
180
|
-
code: string;
|
|
181
|
-
message: string;
|
|
182
|
-
} | null;
|
|
183
|
-
};
|
|
184
264
|
}>;
|
|
185
265
|
watch: (jobId: string, waitOptions?: WaitOptions) => AsyncGenerator<{
|
|
186
266
|
id: string;
|
|
187
|
-
status: "
|
|
188
|
-
kind: "
|
|
267
|
+
status: "failed" | "queued" | "running" | "waiting_processor" | "succeeded";
|
|
268
|
+
kind: "clothes" | "hair" | "location";
|
|
189
269
|
pollUrl: string;
|
|
190
270
|
targetId: string;
|
|
191
271
|
requiredOk: boolean;
|
|
192
|
-
claimCount: number;
|
|
193
|
-
failureCount: number;
|
|
194
|
-
nextRunAt: string | null;
|
|
195
272
|
stage: string | null;
|
|
196
273
|
progress: {
|
|
197
274
|
requiredVerified: number;
|
|
@@ -201,25 +278,13 @@ export declare function createPublisher(projectId: string, options?: CreatePubli
|
|
|
201
278
|
code: string;
|
|
202
279
|
message: string;
|
|
203
280
|
} | null;
|
|
204
|
-
enrichment: {
|
|
205
|
-
status: "running" | "failed" | "pending" | "complete" | "not_applicable";
|
|
206
|
-
verified: number;
|
|
207
|
-
total: number;
|
|
208
|
-
error: {
|
|
209
|
-
code: string;
|
|
210
|
-
message: string;
|
|
211
|
-
} | null;
|
|
212
|
-
};
|
|
213
281
|
}, {
|
|
214
282
|
id: string;
|
|
215
|
-
status: "
|
|
216
|
-
kind: "
|
|
283
|
+
status: "failed" | "queued" | "running" | "waiting_processor" | "succeeded";
|
|
284
|
+
kind: "clothes" | "hair" | "location";
|
|
217
285
|
pollUrl: string;
|
|
218
286
|
targetId: string;
|
|
219
287
|
requiredOk: boolean;
|
|
220
|
-
claimCount: number;
|
|
221
|
-
failureCount: number;
|
|
222
|
-
nextRunAt: string | null;
|
|
223
288
|
stage: string | null;
|
|
224
289
|
progress: {
|
|
225
290
|
requiredVerified: number;
|
|
@@ -229,27 +294,37 @@ export declare function createPublisher(projectId: string, options?: CreatePubli
|
|
|
229
294
|
code: string;
|
|
230
295
|
message: string;
|
|
231
296
|
} | null;
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
297
|
+
}, void>;
|
|
298
|
+
retry: (jobId: string, signal?: AbortSignal) => Promise<{
|
|
299
|
+
job: {
|
|
300
|
+
id: string;
|
|
301
|
+
status: "failed" | "queued" | "running" | "waiting_processor" | "succeeded";
|
|
302
|
+
kind: "clothes" | "hair" | "location";
|
|
303
|
+
pollUrl: string;
|
|
304
|
+
targetId: string;
|
|
305
|
+
requiredOk: boolean;
|
|
306
|
+
stage: string | null;
|
|
307
|
+
progress: {
|
|
308
|
+
requiredVerified: number;
|
|
309
|
+
requiredTotal: number;
|
|
310
|
+
};
|
|
236
311
|
error: {
|
|
237
312
|
code: string;
|
|
238
313
|
message: string;
|
|
239
314
|
} | null;
|
|
240
315
|
};
|
|
241
|
-
|
|
242
|
-
|
|
316
|
+
clothes: {
|
|
317
|
+
id: string;
|
|
318
|
+
status: "processing" | "ready" | "failed";
|
|
319
|
+
};
|
|
320
|
+
} | {
|
|
243
321
|
job: {
|
|
244
322
|
id: string;
|
|
245
|
-
status: "
|
|
246
|
-
kind: "
|
|
323
|
+
status: "failed" | "queued" | "running" | "waiting_processor" | "succeeded";
|
|
324
|
+
kind: "clothes" | "hair" | "location";
|
|
247
325
|
pollUrl: string;
|
|
248
326
|
targetId: string;
|
|
249
327
|
requiredOk: boolean;
|
|
250
|
-
claimCount: number;
|
|
251
|
-
failureCount: number;
|
|
252
|
-
nextRunAt: string | null;
|
|
253
328
|
stage: string | null;
|
|
254
329
|
progress: {
|
|
255
330
|
requiredVerified: number;
|
|
@@ -259,24 +334,36 @@ export declare function createPublisher(projectId: string, options?: CreatePubli
|
|
|
259
334
|
code: string;
|
|
260
335
|
message: string;
|
|
261
336
|
} | null;
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
337
|
+
};
|
|
338
|
+
hair: {
|
|
339
|
+
id: string;
|
|
340
|
+
status: "processing" | "ready" | "failed";
|
|
341
|
+
};
|
|
342
|
+
} | {
|
|
343
|
+
job: {
|
|
344
|
+
id: string;
|
|
345
|
+
status: "failed" | "queued" | "running" | "waiting_processor" | "succeeded";
|
|
346
|
+
kind: "clothes" | "hair" | "location";
|
|
347
|
+
pollUrl: string;
|
|
348
|
+
targetId: string;
|
|
349
|
+
requiredOk: boolean;
|
|
350
|
+
stage: string | null;
|
|
351
|
+
progress: {
|
|
352
|
+
requiredVerified: number;
|
|
353
|
+
requiredTotal: number;
|
|
270
354
|
};
|
|
355
|
+
error: {
|
|
356
|
+
code: string;
|
|
357
|
+
message: string;
|
|
358
|
+
} | null;
|
|
271
359
|
};
|
|
272
|
-
|
|
273
|
-
kind: "location" | "clothes" | "hair";
|
|
360
|
+
location: {
|
|
274
361
|
id: string;
|
|
275
|
-
status:
|
|
362
|
+
status: "processing" | "ready" | "failed";
|
|
276
363
|
};
|
|
277
364
|
}>;
|
|
278
365
|
};
|
|
279
366
|
};
|
|
280
367
|
export type Publisher = ReturnType<typeof createPublisher>;
|
|
281
|
-
export type {
|
|
368
|
+
export type { PublishJob, UploadedImage, WaitOptions };
|
|
282
369
|
//# sourceMappingURL=createPublisher.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createPublisher.d.ts","sourceRoot":"","sources":["../src/createPublisher.ts"],"names":[],"mappings":"AAEA,OAAO,
|
|
1
|
+
{"version":3,"file":"createPublisher.d.ts","sourceRoot":"","sources":["../src/createPublisher.ts"],"names":[],"mappings":"AAEA,OAAO,EAUN,KAAK,WAAW,EAChB,MAAM,WAAW,CAAC;AAEnB,OAAO,EAYN,KAAK,MAAM,EACX,KAAK,gBAAgB,EACrB,KAAK,aAAa,EAClB,KAAK,UAAU,EACf,KAAK,iBAAiB,EACtB,KAAK,eAAe,EACpB,KAAK,4BAA4B,EACjC,KAAK,yBAAyB,EAC9B,KAAK,6BAA6B,EAClC,KAAK,kBAAkB,EACvB,KAAK,YAAY,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