@civitai/app-sdk 0.1.0 → 0.7.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 +46 -1
- package/dist/blocks/defineBlock.d.ts +32 -0
- package/dist/blocks/defineBlock.d.ts.map +1 -0
- package/dist/blocks/defineBlock.js +270 -0
- package/dist/blocks/defineBlock.js.map +1 -0
- package/dist/blocks/index.d.ts +16 -0
- package/dist/blocks/index.d.ts.map +1 -0
- package/dist/blocks/index.js +12 -0
- package/dist/blocks/index.js.map +1 -0
- package/dist/blocks/messages.d.ts +289 -0
- package/dist/blocks/messages.d.ts.map +1 -0
- package/dist/blocks/messages.js +31 -0
- package/dist/blocks/messages.js.map +1 -0
- package/dist/blocks/scopes.d.ts +35 -0
- package/dist/blocks/scopes.d.ts.map +1 -0
- package/dist/blocks/scopes.js +33 -0
- package/dist/blocks/scopes.js.map +1 -0
- package/dist/blocks/types.d.ts +371 -0
- package/dist/blocks/types.d.ts.map +1 -0
- package/dist/blocks/types.js +8 -0
- package/dist/blocks/types.js.map +1 -0
- package/dist/oauth/token.d.ts +28 -0
- package/dist/oauth/token.d.ts.map +1 -1
- package/dist/oauth/token.js +28 -0
- package/dist/oauth/token.js.map +1 -1
- package/dist/orchestrator/index.d.ts +224 -0
- package/dist/orchestrator/index.d.ts.map +1 -1
- package/dist/orchestrator/index.js +207 -0
- package/dist/orchestrator/index.js.map +1 -1
- package/package.json +11 -5
- package/schemas/app-block/v1.json +184 -0
- package/dist/client/index.d.ts +0 -23
- package/dist/client/index.d.ts.map +0 -1
- package/dist/client/index.js +0 -19
- package/dist/client/index.js.map +0 -1
- package/dist/workflows/index.d.ts +0 -52
- package/dist/workflows/index.d.ts.map +0 -1
- package/dist/workflows/index.js +0 -77
- package/dist/workflows/index.js.map +0 -1
|
@@ -0,0 +1,371 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Public type surface for the `@civitai/app-sdk/blocks` subpath.
|
|
3
|
+
*
|
|
4
|
+
* Framework-agnostic. Hooks and transport classes that consume these types
|
|
5
|
+
* live in a separate package so this module stays usable from any runtime.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Per-instance context the host page passes to the block at mount time.
|
|
9
|
+
*
|
|
10
|
+
* `slotId` is the only field guaranteed to be present; every other field
|
|
11
|
+
* depends on which slot the block is rendered into. Authors who target a
|
|
12
|
+
* specific slot should narrow to a slot-specific context type
|
|
13
|
+
* (e.g. {@link ModelSlotContext}) rather than reaching into the index
|
|
14
|
+
* signature.
|
|
15
|
+
*
|
|
16
|
+
* Mirrors `SlotContext` in civitai/civitai's `src/components/AppBlocks/types.ts`.
|
|
17
|
+
*/
|
|
18
|
+
export interface BlockContext {
|
|
19
|
+
slotId: string;
|
|
20
|
+
[key: string]: unknown;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Snapshot of the effective Checkpoint the block will generate against —
|
|
24
|
+
* already merged from publisher default + viewer override on the host.
|
|
25
|
+
* For Checkpoint-bound installs this is the model itself; for LoRA installs
|
|
26
|
+
* it's whichever Checkpoint the resolver picked.
|
|
27
|
+
*
|
|
28
|
+
* `null` (via `ModelSlotContext.checkpoint`) means no checkpoint is
|
|
29
|
+
* configured; blocks should render a "missing checkpoint" CTA pointing the
|
|
30
|
+
* user at the model owner.
|
|
31
|
+
*
|
|
32
|
+
* Mirrors `BlockCheckpointInfo` in civitai/civitai's
|
|
33
|
+
* `src/components/AppBlocks/types.ts`.
|
|
34
|
+
*/
|
|
35
|
+
export interface BlockCheckpointInfo {
|
|
36
|
+
versionId: number;
|
|
37
|
+
modelId: number;
|
|
38
|
+
modelName: string;
|
|
39
|
+
versionName: string;
|
|
40
|
+
baseModel: string;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* One of the model version's curated preview images, with the standard
|
|
44
|
+
* gen params extracted from its source meta. Block UIs use these to let
|
|
45
|
+
* the user "remix" a known-good prompt without typing it.
|
|
46
|
+
*
|
|
47
|
+
* `null` on a gen-param field means the source image's meta didn't have
|
|
48
|
+
* that value (or it was malformed). The block should treat null as "keep
|
|
49
|
+
* the current value" rather than clearing the field — that way a partial
|
|
50
|
+
* meta doesn't trash a prompt the user already typed.
|
|
51
|
+
*
|
|
52
|
+
* Mirrors `ShowcaseImage` in civitai/civitai's
|
|
53
|
+
* `src/components/AppBlocks/types.ts`. Keep in lockstep.
|
|
54
|
+
*/
|
|
55
|
+
export interface ShowcaseImage {
|
|
56
|
+
id: number;
|
|
57
|
+
url: string;
|
|
58
|
+
width: number;
|
|
59
|
+
height: number;
|
|
60
|
+
prompt: string | null;
|
|
61
|
+
negativePrompt: string | null;
|
|
62
|
+
cfgScale: number | null;
|
|
63
|
+
steps: number | null;
|
|
64
|
+
seed: number | null;
|
|
65
|
+
sampler: string | null;
|
|
66
|
+
/** Per-resource CLIP layer skip count (SD1/SDXL). Flux ignores it. */
|
|
67
|
+
clipSkip: number | null;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* The shape the host delivers for the three model-page slots
|
|
71
|
+
* (`model.sidebar_top`, `model.below_images`, `model.actions_extra`).
|
|
72
|
+
*
|
|
73
|
+
* Optional fields are present when the host has them: `viewerUserId` is
|
|
74
|
+
* `null` for anonymous viewers, and `viewerUsername`/`viewerStatus`/`theme`
|
|
75
|
+
* are only filled when a viewer is signed in or the host's theme is
|
|
76
|
+
* resolved.
|
|
77
|
+
*
|
|
78
|
+
* Block authors using these slots should narrow:
|
|
79
|
+
*
|
|
80
|
+
* const ctx = useBlockContext().context as ModelSlotContext;
|
|
81
|
+
*
|
|
82
|
+
* Mirrors `ModelSlotContext` in civitai/civitai. Keep in lockstep — adding
|
|
83
|
+
* a field on either side without the other will silently degrade.
|
|
84
|
+
*/
|
|
85
|
+
export interface ModelSlotContext extends BlockContext {
|
|
86
|
+
slotId: 'model.sidebar_top' | 'model.below_images' | 'model.actions_extra';
|
|
87
|
+
modelId: number;
|
|
88
|
+
modelVersionId: number;
|
|
89
|
+
modelName: string;
|
|
90
|
+
modelType: string;
|
|
91
|
+
modelNsfwLevel: number;
|
|
92
|
+
creatorUserId: number;
|
|
93
|
+
viewerUserId: number | null;
|
|
94
|
+
viewerNsfwEnabled: boolean;
|
|
95
|
+
viewerUsername?: string | null;
|
|
96
|
+
/** Coarse status surface; authoritative re-check is `/api/v1/blocks/me`. */
|
|
97
|
+
viewerStatus?: 'active' | 'banned' | 'muted';
|
|
98
|
+
/** Host-page color scheme; lets the iframe match without a flicker. */
|
|
99
|
+
theme?: 'light' | 'dark';
|
|
100
|
+
/**
|
|
101
|
+
* Effective Checkpoint after publisher-default ∪ viewer-override merge.
|
|
102
|
+
* `null` when no checkpoint is configured (publisher hasn't set one AND
|
|
103
|
+
* the bound model isn't a Checkpoint itself) — block should render a
|
|
104
|
+
* "missing checkpoint" state and prompt the user to ask the model owner.
|
|
105
|
+
*/
|
|
106
|
+
checkpoint?: BlockCheckpointInfo | null;
|
|
107
|
+
/**
|
|
108
|
+
* Top showcase images for the bound model version, ordered by all-time
|
|
109
|
+
* reactions. Capped at 6 by the host. Empty array means the version
|
|
110
|
+
* has no preview images yet. The block uses these to render a "click
|
|
111
|
+
* to remix" carousel that populates the form from the selected image's
|
|
112
|
+
* gen meta.
|
|
113
|
+
*/
|
|
114
|
+
showcaseImages?: ShowcaseImage[];
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Short-lived, block-scoped JWT minted by civitai.com for a single block
|
|
118
|
+
* instance. Carries the scopes the user consented to plus an optional
|
|
119
|
+
* Buzz spend budget the parent enforces on orchestrator calls.
|
|
120
|
+
*/
|
|
121
|
+
export interface BlockToken {
|
|
122
|
+
raw: string;
|
|
123
|
+
scopes: string[];
|
|
124
|
+
expiresAt: Date;
|
|
125
|
+
buzzBudget?: number;
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Settings the block sees: publisher-controlled (from manifest defaults +
|
|
129
|
+
* any per-deployment overrides) and user-controlled (per-instance prefs).
|
|
130
|
+
*/
|
|
131
|
+
export interface BlockSettings {
|
|
132
|
+
publisherSettings: Record<string, unknown>;
|
|
133
|
+
userSettings: Record<string, unknown>;
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* The signed-in viewer. `null` in `BlockInitPayload.viewer` means anonymous.
|
|
137
|
+
*
|
|
138
|
+
* `status` is a coarse surface for the iframe — `/api/v1/blocks/me` is the
|
|
139
|
+
* authoritative re-check if the block needs to gate on it.
|
|
140
|
+
*
|
|
141
|
+
* Mirrors the inline viewer shape in `BlockInitPayload` on the platform
|
|
142
|
+
* side (civitai/civitai `src/components/AppBlocks/types.ts`).
|
|
143
|
+
*/
|
|
144
|
+
export interface ViewerInfo {
|
|
145
|
+
id: number;
|
|
146
|
+
username: string | null;
|
|
147
|
+
status: 'active' | 'banned' | 'muted';
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* Host-page color scheme. v2 will add a sibling `themeCssVars` field on
|
|
151
|
+
* `BlockInitPayload` for design-token sharing; v1 ships the string only.
|
|
152
|
+
*/
|
|
153
|
+
export type Theme = 'light' | 'dark';
|
|
154
|
+
export type WorkflowStatus = 'idle' | 'estimating' | 'confirming' | 'submitting' | 'polling' | 'done' | 'error';
|
|
155
|
+
/**
|
|
156
|
+
* Generation parameters a block can override. All optional — the host fills
|
|
157
|
+
* sensible defaults (sampler='Euler', steps=25, dimensions from the
|
|
158
|
+
* base-model family) when omitted, so the simplest block can submit
|
|
159
|
+
* `{ kind: 'textToImage', modelId, modelVersionId, params: { prompt } }`.
|
|
160
|
+
*
|
|
161
|
+
* Bounds mirror civitai/civitai's `blockWorkflowBodySchema` zod gate; over-
|
|
162
|
+
* limit values are rejected server-side before reaching the orchestrator.
|
|
163
|
+
*/
|
|
164
|
+
export interface BlockTextToImageParams {
|
|
165
|
+
prompt: string;
|
|
166
|
+
negativePrompt?: string;
|
|
167
|
+
/** Range 1–30. */
|
|
168
|
+
cfgScale?: number;
|
|
169
|
+
/** Sampler name (e.g. 'Euler', 'DPM++ 2M Karras'). Defaults to 'Euler'. */
|
|
170
|
+
sampler?: string;
|
|
171
|
+
/** Range 1–50. */
|
|
172
|
+
steps?: number;
|
|
173
|
+
/** `null` lets the orchestrator pick. */
|
|
174
|
+
seed?: number | null;
|
|
175
|
+
/** Range 64–2048. Defaults to 1024 for SDXL/Flux, 512 for SD1/SD2. */
|
|
176
|
+
width?: number;
|
|
177
|
+
/** Range 64–2048. Same defaults as width. */
|
|
178
|
+
height?: number;
|
|
179
|
+
/** Per-resource CLIP layer skip count (SD1/SDXL). Range 0–12. Flux ignores it. */
|
|
180
|
+
clipSkip?: number;
|
|
181
|
+
/** Range 1–4. Defaults to 1. */
|
|
182
|
+
quantity?: number;
|
|
183
|
+
}
|
|
184
|
+
/**
|
|
185
|
+
* Body the block sends to `useBuzzWorkflow().{submit,estimate}`. A
|
|
186
|
+
* discriminated union keyed by `kind` — v1 ships text-to-image only;
|
|
187
|
+
* new kinds (e.g. img2img, video) extend this union as the host gains
|
|
188
|
+
* support for them.
|
|
189
|
+
*
|
|
190
|
+
* Both `modelId` and `modelVersionId` are required even though they're
|
|
191
|
+
* conceptually redundant — the host validates that `modelId` matches the
|
|
192
|
+
* JWT's `ctx.modelId` (context binding) AND that the version belongs to
|
|
193
|
+
* that model (DB lookup). The block always has both values from
|
|
194
|
+
* `useBlockContext().context as ModelSlotContext`.
|
|
195
|
+
*/
|
|
196
|
+
export type WorkflowBody = {
|
|
197
|
+
kind: 'textToImage';
|
|
198
|
+
modelId: number;
|
|
199
|
+
modelVersionId: number;
|
|
200
|
+
params: BlockTextToImageParams;
|
|
201
|
+
};
|
|
202
|
+
/**
|
|
203
|
+
* The host-mediated view of an orchestrator workflow that an iframe block
|
|
204
|
+
* receives over `postMessage`.
|
|
205
|
+
*
|
|
206
|
+
* This is intentionally a flattened **subset** of `WorkflowSnapshot` from
|
|
207
|
+
* `../orchestrator/` — the host (civitai.com) maps the full orchestrator
|
|
208
|
+
* payload down to this shape before forwarding. Notable differences:
|
|
209
|
+
* - `workflowId` here = orchestrator's `id`
|
|
210
|
+
* - `imageUrls` here = flattened from `steps[].output.images[].url`
|
|
211
|
+
* - `cost.total` is the host-attested total (not the raw orchestrator field)
|
|
212
|
+
* - the status union omits orchestrator-internal states like `unassigned`
|
|
213
|
+
*
|
|
214
|
+
* If the orchestrator gains a status the host doesn't recognize, the host
|
|
215
|
+
* is responsible for mapping it to one of the values here (typically
|
|
216
|
+
* `processing` or `failed`).
|
|
217
|
+
*/
|
|
218
|
+
export interface BlockWorkflowSnapshot {
|
|
219
|
+
workflowId: string;
|
|
220
|
+
status: 'pending' | 'processing' | 'succeeded' | 'failed' | 'expired' | 'canceled';
|
|
221
|
+
cost?: {
|
|
222
|
+
total: number;
|
|
223
|
+
};
|
|
224
|
+
imageUrls?: string[];
|
|
225
|
+
error?: string;
|
|
226
|
+
/**
|
|
227
|
+
* Set when the host opportunistically claimed a Buzz reward on the user's
|
|
228
|
+
* behalf during submit. Currently the host only fires this for the daily
|
|
229
|
+
* boost (25 blue Buzz, one per UTC day) when the user's balance would
|
|
230
|
+
* otherwise have been short by less than the boost amount.
|
|
231
|
+
*
|
|
232
|
+
* Informational only — the block has no obligation to reconcile state
|
|
233
|
+
* (the claim already settled in the orchestrator). A typical block UX
|
|
234
|
+
* surfaces a small "+25 daily boost claimed" notice next to the
|
|
235
|
+
* succeeded result.
|
|
236
|
+
*/
|
|
237
|
+
autoClaim?: {
|
|
238
|
+
type: 'dailyBoost';
|
|
239
|
+
amount: number;
|
|
240
|
+
accountType: 'yellow' | 'blue' | 'red' | 'green';
|
|
241
|
+
};
|
|
242
|
+
}
|
|
243
|
+
/**
|
|
244
|
+
* Which side of the settings split a field lives on.
|
|
245
|
+
* - `publisher`: stored on `model_block_installs.settings` (or a publisher
|
|
246
|
+
* subscription row). The model owner / app installer controls it.
|
|
247
|
+
* - `viewer`: stored on `block_user_settings.settings` (or a viewer
|
|
248
|
+
* subscription row). Each signed-in user controls their own value.
|
|
249
|
+
*/
|
|
250
|
+
export type SettingScope = 'publisher' | 'viewer';
|
|
251
|
+
/**
|
|
252
|
+
* Widget hints the platform's generic SettingsForm renderer consumes.
|
|
253
|
+
* `resource_picker` is the v0 escape hatch for the checkpoint case —
|
|
254
|
+
* delegates to `useCheckpointPicker` (or a future generic picker hook)
|
|
255
|
+
* via the host bridge.
|
|
256
|
+
*/
|
|
257
|
+
export type SettingWidget = 'number' | 'slider' | 'resource_picker' | 'text' | 'textarea' | 'select' | 'toggle';
|
|
258
|
+
interface ManifestSettingFieldBase {
|
|
259
|
+
scope: SettingScope;
|
|
260
|
+
label: string;
|
|
261
|
+
description: string;
|
|
262
|
+
/**
|
|
263
|
+
* Hide the field when this scope isn't in the app's declared scopes.
|
|
264
|
+
* Lets a manifest carry a "Max Buzz per generation" field that only
|
|
265
|
+
* renders for apps that requested `ai:write:budgeted`.
|
|
266
|
+
*/
|
|
267
|
+
requires_scope?: string;
|
|
268
|
+
}
|
|
269
|
+
export interface ManifestNumberField extends ManifestSettingFieldBase {
|
|
270
|
+
type: 'number';
|
|
271
|
+
widget?: 'number' | 'slider' | 'resource_picker';
|
|
272
|
+
default?: number | null;
|
|
273
|
+
min?: number;
|
|
274
|
+
max?: number;
|
|
275
|
+
step?: number;
|
|
276
|
+
/**
|
|
277
|
+
* Widget-specific config. For `resource_picker`:
|
|
278
|
+
* `{ resource_type: 'Checkpoint' | 'LORA' | ..., filter_by_ecosystem?: boolean }`.
|
|
279
|
+
*/
|
|
280
|
+
widget_options?: Record<string, unknown>;
|
|
281
|
+
}
|
|
282
|
+
export interface ManifestStringField extends ManifestSettingFieldBase {
|
|
283
|
+
type: 'string';
|
|
284
|
+
widget?: 'text' | 'textarea' | 'select';
|
|
285
|
+
default?: string | null;
|
|
286
|
+
max_length?: number;
|
|
287
|
+
/** RegExp source. Compiled at validate-time. */
|
|
288
|
+
pattern?: string;
|
|
289
|
+
/** Required when `widget === 'select'`. */
|
|
290
|
+
enum?: string[];
|
|
291
|
+
}
|
|
292
|
+
export interface ManifestBooleanField extends ManifestSettingFieldBase {
|
|
293
|
+
type: 'boolean';
|
|
294
|
+
widget?: 'toggle';
|
|
295
|
+
default?: boolean;
|
|
296
|
+
}
|
|
297
|
+
export type ManifestSettingField = ManifestNumberField | ManifestStringField | ManifestBooleanField;
|
|
298
|
+
/**
|
|
299
|
+
* W3 v0 manifest settings declaration. Keyed by snake_case field name.
|
|
300
|
+
* Mirrors `manifestSettingsSchema` in civitai/civitai's
|
|
301
|
+
* `src/server/schema/blocks/manifest-settings.meta.schema.ts`. Keep in
|
|
302
|
+
* lockstep — adding a field type or widget on one side without the other
|
|
303
|
+
* will silently degrade the form renderer or the platform validator.
|
|
304
|
+
*/
|
|
305
|
+
export type ManifestSettings = Record<string, ManifestSettingField>;
|
|
306
|
+
export type ContentRating = 'g' | 'pg' | 'pg13' | 'r' | 'x';
|
|
307
|
+
export interface ManifestTarget {
|
|
308
|
+
slotId: string;
|
|
309
|
+
priority: number;
|
|
310
|
+
requiredContext?: string[];
|
|
311
|
+
}
|
|
312
|
+
export interface ManifestIframe {
|
|
313
|
+
src: string;
|
|
314
|
+
minHeight: number;
|
|
315
|
+
/** Optional. Omit or set to `null` for no cap. */
|
|
316
|
+
maxHeight?: number | null;
|
|
317
|
+
resizable: boolean;
|
|
318
|
+
sandbox: string;
|
|
319
|
+
}
|
|
320
|
+
export interface ManifestAsset {
|
|
321
|
+
url: string;
|
|
322
|
+
integrity: string;
|
|
323
|
+
}
|
|
324
|
+
export interface ManifestPreview {
|
|
325
|
+
thumbnail: string;
|
|
326
|
+
description: string;
|
|
327
|
+
screenshots?: string[];
|
|
328
|
+
}
|
|
329
|
+
/**
|
|
330
|
+
* v1 manifest shape. Mirrors `schemas/app-block/v1.json` — keep them in sync.
|
|
331
|
+
*
|
|
332
|
+
* The trailing `renderMode` / `assetBundle` / `trustTier` fields are
|
|
333
|
+
* forward-compat hooks for v2 inline mode; they are accepted but unused
|
|
334
|
+
* by the v1 iframe runtime.
|
|
335
|
+
*/
|
|
336
|
+
export interface BlockManifestV1 {
|
|
337
|
+
$schema: 'https://civitai.com/schemas/app-block/v1.json';
|
|
338
|
+
appId: string;
|
|
339
|
+
blockId: string;
|
|
340
|
+
version: string;
|
|
341
|
+
name: string;
|
|
342
|
+
type: 'block' | 'embed';
|
|
343
|
+
targets: ManifestTarget[];
|
|
344
|
+
scopes: string[];
|
|
345
|
+
iframe: ManifestIframe;
|
|
346
|
+
assets?: ManifestAsset[];
|
|
347
|
+
/**
|
|
348
|
+
* Per-field settings declaration the platform validates user input
|
|
349
|
+
* against AND renders the publisher/viewer settings UI from. v0 shape;
|
|
350
|
+
* see {@link ManifestSettings}.
|
|
351
|
+
*/
|
|
352
|
+
settings?: ManifestSettings;
|
|
353
|
+
contentRating: ContentRating;
|
|
354
|
+
preview?: ManifestPreview;
|
|
355
|
+
promotionEligible?: boolean;
|
|
356
|
+
minApiVersion: string;
|
|
357
|
+
/**
|
|
358
|
+
* Author-declared mode preference. `hybrid` is a manifest-only hint that
|
|
359
|
+
* the host resolves to a concrete `iframe` | `inline` value before sending
|
|
360
|
+
* `BLOCK_INIT` — that's why `BlockInitPayload.renderMode` is narrower.
|
|
361
|
+
*/
|
|
362
|
+
renderMode?: 'iframe' | 'inline' | 'hybrid';
|
|
363
|
+
assetBundle?: {
|
|
364
|
+
url: string | null;
|
|
365
|
+
sha256: string | null;
|
|
366
|
+
};
|
|
367
|
+
trustTier?: 'unverified' | 'verified' | 'internal';
|
|
368
|
+
}
|
|
369
|
+
export type BlockManifest = BlockManifestV1;
|
|
370
|
+
export {};
|
|
371
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/blocks/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAMH;;;;;;;;;;GAUG;AACH,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,CAAC,GAAG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,MAAM,GAAG,IAAI,CAAA;KAAE,CAAC;IAC5D,SAAS,CAAC,EAAE,YAAY,GAAG,UAAU,GAAG,UAAU,CAAC;CACpD;AAED,MAAM,MAAM,aAAa,GAAG,eAAe,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Public type surface for the `@civitai/app-sdk/blocks` subpath.
|
|
3
|
+
*
|
|
4
|
+
* Framework-agnostic. Hooks and transport classes that consume these types
|
|
5
|
+
* live in a separate package so this module stays usable from any runtime.
|
|
6
|
+
*/
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/blocks/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG"}
|
package/dist/oauth/token.d.ts
CHANGED
|
@@ -33,5 +33,33 @@ export declare function fetchMe(opts: {
|
|
|
33
33
|
baseUrl?: string;
|
|
34
34
|
accessToken: string;
|
|
35
35
|
}): Promise<unknown>;
|
|
36
|
+
/** Buzz currency pools tracked per user account. */
|
|
37
|
+
export type BuzzAccountType = 'yellow' | 'blue' | 'red' | 'green' | 'purple';
|
|
38
|
+
export interface BuzzAccount {
|
|
39
|
+
/** The user's Civitai account id. */
|
|
40
|
+
id: number;
|
|
41
|
+
/** Current spendable balance in this pool. */
|
|
42
|
+
balance: number;
|
|
43
|
+
/** Lifetime credited buzz in this pool (null when unavailable). */
|
|
44
|
+
lifetimeBalance: number | null;
|
|
45
|
+
/** Which buzz pool this balance belongs to. */
|
|
46
|
+
accountType: BuzzAccountType;
|
|
47
|
+
}
|
|
48
|
+
export interface FetchBuzzAccountOpts {
|
|
49
|
+
baseUrl?: string;
|
|
50
|
+
accessToken: string;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Fetch the OAuth-authenticated user's Buzz account(s).
|
|
54
|
+
*
|
|
55
|
+
* Civitai's `/api/v1/me` does NOT include balance. Balance lives behind the
|
|
56
|
+
* `buzz.getUserAccount` tRPC procedure which requires the `BuzzRead` scope.
|
|
57
|
+
* Returns one entry per buzz pool — typically just `yellow` for end users.
|
|
58
|
+
*
|
|
59
|
+
* NOTE: this hits Civitai's tRPC surface directly because no REST endpoint
|
|
60
|
+
* exists yet. If/when Civitai exposes one, switch this helper over without
|
|
61
|
+
* breaking callers.
|
|
62
|
+
*/
|
|
63
|
+
export declare function fetchBuzzAccount(opts: FetchBuzzAccountOpts): Promise<BuzzAccount[]>;
|
|
36
64
|
export {};
|
|
37
65
|
//# sourceMappingURL=token.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"token.d.ts","sourceRoot":"","sources":["../../src/oauth/token.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAsB,WAAW,EAAE,MAAM,aAAa,CAAC;AAInE,UAAU,UAAU;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,wEAAwE;IACxE,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,gBAAiB,SAAQ,UAAU;IAClD,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,gBAAiB,SAAQ,UAAU;IAClD,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,eAAgB,SAAQ,UAAU;IACjD,KAAK,EAAE,MAAM,CAAC;CACf;AAED,qBAAa,UAAW,SAAQ,KAAK;IAIjC,QAAQ,CAAC,MAAM,EAAE,MAAM;IACvB,QAAQ,CAAC,IAAI,EAAE,OAAO;IAJxB,SAAkB,IAAI,gBAAgB;gBAEpC,OAAO,EAAE,MAAM,EACN,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,OAAO;CAIzB;AA0CD,6DAA6D;AAC7D,wBAAsB,YAAY,CAAC,IAAI,EAAE,gBAA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,GAAG,OAAO,CAAC,WAAW,CAAC,CAW/E;AAED,2DAA2D;AAC3D,wBAAsB,YAAY,CAAC,IAAI,EAAE,gBAAgB,GAAG,OAAO,CAAC,WAAW,CAAC,CAS/E;AAED,yCAAyC;AACzC,wBAAsB,WAAW,CAAC,IAAI,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,CAOtE;AAED,qEAAqE;AACrE,wBAAsB,OAAO,CAAC,IAAI,EAAE;IAAE,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC,OAAO,CAAC,CAS/F;AAED,oDAAoD;AACpD,MAAM,MAAM,eAAe,GAAG,QAAQ,GAAG,MAAM,GAAG,KAAK,GAAG,OAAO,GAAG,QAAQ,CAAC;AAE7E,MAAM,WAAW,WAAW;IAC1B,qCAAqC;IACrC,EAAE,EAAE,MAAM,CAAC;IACX,8CAA8C;IAC9C,OAAO,EAAE,MAAM,CAAC;IAChB,mEAAmE;IACnE,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,+CAA+C;IAC/C,WAAW,EAAE,eAAe,CAAC;CAC9B;AAED,MAAM,WAAW,oBAAoB;IACnC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,gBAAgB,CAAC,IAAI,EAAE,oBAAoB,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC,CAqBzF"}
|
package/dist/oauth/token.js
CHANGED
|
@@ -86,4 +86,32 @@ export async function fetchMe(opts) {
|
|
|
86
86
|
}
|
|
87
87
|
return res.json();
|
|
88
88
|
}
|
|
89
|
+
/**
|
|
90
|
+
* Fetch the OAuth-authenticated user's Buzz account(s).
|
|
91
|
+
*
|
|
92
|
+
* Civitai's `/api/v1/me` does NOT include balance. Balance lives behind the
|
|
93
|
+
* `buzz.getUserAccount` tRPC procedure which requires the `BuzzRead` scope.
|
|
94
|
+
* Returns one entry per buzz pool — typically just `yellow` for end users.
|
|
95
|
+
*
|
|
96
|
+
* NOTE: this hits Civitai's tRPC surface directly because no REST endpoint
|
|
97
|
+
* exists yet. If/when Civitai exposes one, switch this helper over without
|
|
98
|
+
* breaking callers.
|
|
99
|
+
*/
|
|
100
|
+
export async function fetchBuzzAccount(opts) {
|
|
101
|
+
const base = opts.baseUrl ?? DEFAULT_CIVITAI_BASE_URL;
|
|
102
|
+
const res = await fetch(`${base}/api/trpc/buzz.getUserAccount`, {
|
|
103
|
+
headers: { Authorization: `Bearer ${opts.accessToken}` },
|
|
104
|
+
});
|
|
105
|
+
if (!res.ok) {
|
|
106
|
+
throw new OAuthError(`buzz.getUserAccount failed: ${res.status}`, res.status, await res.text());
|
|
107
|
+
}
|
|
108
|
+
// Civitai's tRPC uses a superjson transformer, so the payload is
|
|
109
|
+
// `{ result: { data: { json: T } } }`. Older or transformer-less routes
|
|
110
|
+
// return `{ result: { data: T } }` directly — handle both defensively.
|
|
111
|
+
const json = (await res.json());
|
|
112
|
+
const data = json.result?.data;
|
|
113
|
+
if (Array.isArray(data))
|
|
114
|
+
return data;
|
|
115
|
+
return data?.json ?? [];
|
|
116
|
+
}
|
|
89
117
|
//# sourceMappingURL=token.js.map
|
package/dist/oauth/token.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"token.js","sourceRoot":"","sources":["../../src/oauth/token.ts"],"names":[],"mappings":"AAEA,MAAM,wBAAwB,GAAG,qBAAqB,CAAC;AAuBvD,MAAM,OAAO,UAAW,SAAQ,KAAK;IAIxB;IACA;IAJO,IAAI,GAAG,YAAY,CAAC;IACtC,YACE,OAAe,EACN,MAAc,EACd,IAAa;QAEtB,KAAK,CAAC,OAAO,CAAC,CAAC;QAHN,WAAM,GAAN,MAAM,CAAQ;QACd,SAAI,GAAJ,IAAI,CAAS;IAGxB,CAAC;CACF;AAED,KAAK,UAAU,QAAQ,CACrB,GAAW,EACX,IAA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