@neta-art/cohub 7.0.0 → 8.0.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/chunks/http.d.ts +328 -226
- package/dist/chunks/http.js +227 -194
- package/dist/chunks/websocket.d.ts +92 -73
- package/dist/http.d.ts +3 -3
- package/dist/index.d.ts +165 -119
- package/dist/index.js +409 -286
- package/dist/protocol/dist/index.d.ts +1 -1
- package/dist/protocol/dist/realtime/types.d.ts +1 -1
- package/package.json +1 -1
- /package/dist/protocol/dist/{work.d.ts → app.d.ts} +0 -0
package/dist/chunks/http.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as CreateInvitationInput, $i as
|
|
1
|
+
import { $ as CreateInvitationInput, $i as DesktopCommand, $n as SpaceFsMoveInput, $t as ReferralDashboard, Ar as SpaceSessionsResponse, At as MeResponse, Bn as SpaceCreateResponse, Bt as PublicUserPageResponse, Ca as BoardSummary, Ct as LabelItemsResponse, Di as RealtimePatchOperation, Dn as SpaceCheckpointDetailResponse, Dt as LabelResourceType, Er as SpaceRole, Fr as SpaceUsageResponse, G as CheckpointDiffFileResponse, Gt as ReferenceAggregateGroupBy, H as Channel, Hn as SpaceEnvInput, Hr as UserActivityResponse, Ii as BoardAwarenessUpdate, Jr as ChannelConfig, Jt as ReferenceKind, Kn as SpaceFsCreateUploadInput, Kt as ReferenceAggregateResponse, Li as AppArtifactDescriptor, Ln as SpaceConfigInput, Lr as TaskRunDetailResponse, Lt as PromptTemplateCatalogResponse, Mi as SessionTurnPatchEvent, Mn as SpaceCommerceOrder, Mt as PatchResourceLabelsInput, Na as BoardSemanticMutation, Nn as SpaceCommerceProduct, Nt as PatchResourceLabelsResponse, Oa as BoardAuthoringReadInput, On as SpaceCommerceBenefit, Pn as SpaceCommerceProductBenefitBinding, Pt as Permission, Q as ClaimReferralResponse, Qn as SpaceFsFileResponse, Rn as SpaceConfigResponse, Rr as TaskRunRecord, Rt as PublicReferral, Si as BoardPlaybackChangedEvent$1, Sr as SpacePresenceSnapshot, St as LabelAssignmentRecord, Tr as SpaceRecord, Tt as LabelListItem, Ui as AppContentKind, Un as SpaceFsCompleteUploadInput, Ur as UserProfile, Vn as SpaceDefaultResponse, Wn as SpaceFsCompleteUploadResponse, Wr as UserRulesResponse, X as CheckpointDiffSummary, Xt as ReferenceQueryableType, Yr as ChannelHealth, Yt as ReferenceQueryResponse, Z as CheckpointRecord, _a as BoardMutationReceipt, _o as SpaceCompletionStreamEvent, _r as SpaceMember, a as WebsocketClientOptions, at as CreateSpaceSessionInput, bi as BoardAwarenessUpdatedEvent$1, bo as ContentBlock, br as SpacePendingDiffFileResponse, cn as SessionMessagesPaginatedResponse, co as SpaceTurnsResponse, ct as CronJobUpdatePatch, d as BatchUserProfilesResponse, dn as SessionTurnIndexResponse, dr as SpaceFsUploadResponse, er as SpaceFsPreparingFile, et as CreateInvitationResponse, fi as GenerationContentBlock, fn as SessionTurnResponse, fr as SpaceFsWriteFileInput, gn as SessionTurnsPaginatedResponse, go as SpaceCompletionResult, gt as InvitationDetail, hn as SessionTurnWindowResponse, ht as GlobalSearchType, io as SessionForkRecord, ir as SpaceFsTreeResponse, it as CreateSpacePromptResponse, jr as SpaceTurnAuthorFilter, jt as ModelCatalogEntry, ka as BoardAuthoringSnapshot, kn as SpaceCommerceBuyerProfile, l as AcceptInvitationResponse, ln as SessionMessagesResponse, lt as CursorPageInfo, ma as BoardCreateInput, mn as SessionTurnStreamSnapshotResponse, mo as CreateSpaceCompletionInput, mr as SpaceInvitationListResponse, na as DesktopCommandRecord, no as SpacePublicEndpoints, pa as BoardCapabilities, pi as GenerationModelDeclaration, pn as SessionTurnSignedUrlsResponse, pt as GlobalSearchResponse, qn as SpaceFsCreateUploadResponse, qr as UserSessionsResponse, qt as ReferenceDirection, r as WebsocketClient, ra as DesktopCommandStatus, ro as MessageRecord, rr as SpaceFsReadFilesResponse, rt as CreateSpacePromptInput, s as WebsocketEventPayload, sn as SessionMessageResponse, so as SessionTurnRecord, st as CronJobRecord, ta as DesktopCommandError, tt as CreateSpaceInput, un as SessionRecord, va as BoardPlaybackCommand, vn as SkillCatalogResponse, vo as Usage, wo as RequestSource, wr as SpacePublicProfile, xa as BoardPlaybackSnapshot, xi as BoardChangedEvent$1, xn as SpaceAccessPolicy, xr as SpacePendingDiffSummary, yo as BillingPayload, yr as SpaceModListItem, zn as SpaceConfigUpdateResponse, zr as UserActivityQuery } from "./websocket.js";
|
|
2
2
|
import { n as CohubEnvironment } from "./environment.js";
|
|
3
3
|
import { a as VoiceInputCreateOptions } from "./voice-input.js";
|
|
4
4
|
//#region ../protocol/dist/model/status.d.ts
|
|
@@ -104,9 +104,9 @@ type ListGenerationModelsResponse = {
|
|
|
104
104
|
};
|
|
105
105
|
//#endregion
|
|
106
106
|
//#region ../protocol/dist/space-config.d.ts
|
|
107
|
-
type
|
|
108
|
-
type
|
|
109
|
-
kind:
|
|
107
|
+
type WindowKind = "file" | "board" | "port";
|
|
108
|
+
type WindowRef = {
|
|
109
|
+
kind: WindowKind;
|
|
110
110
|
key: string;
|
|
111
111
|
};
|
|
112
112
|
type WorkspaceLayoutPresentation = "split" | "focus" | "fullscreen";
|
|
@@ -114,7 +114,7 @@ type WorkspaceDefaultLayout = {
|
|
|
114
114
|
leftSidebar?: "expanded" | "collapsed";
|
|
115
115
|
filesColumn?: "visible" | "hidden";
|
|
116
116
|
fileTree?: "expanded" | "collapsed";
|
|
117
|
-
|
|
117
|
+
window?: WindowRef;
|
|
118
118
|
presentation?: WorkspaceLayoutPresentation;
|
|
119
119
|
};
|
|
120
120
|
type NewChatBackgroundBase = {
|
|
@@ -201,21 +201,21 @@ type PublicFileUrlResponse = {
|
|
|
201
201
|
url: string;
|
|
202
202
|
};
|
|
203
203
|
//#endregion
|
|
204
|
-
//#region ../protocol/dist/
|
|
205
|
-
declare const
|
|
206
|
-
type
|
|
204
|
+
//#region ../protocol/dist/app-promotion-stats.d.ts
|
|
205
|
+
declare const APP_PROMOTION_EVENT_KEYS: readonly ["landing", "ready", "registration_completed", "paywall_viewed", "checkout_started"];
|
|
206
|
+
type AppPromotionEventKey = typeof APP_PROMOTION_EVENT_KEYS[number];
|
|
207
207
|
//#endregion
|
|
208
|
-
//#region src/
|
|
209
|
-
type
|
|
210
|
-
surface: "page" | "
|
|
211
|
-
source?: "
|
|
208
|
+
//#region src/app-runtime.d.ts
|
|
209
|
+
type AppRuntimeInvocationContext = {
|
|
210
|
+
surface: "page" | "app" | "background" | "broker";
|
|
211
|
+
source?: "desktop_command" | "user" | "route";
|
|
212
212
|
spaceId?: string;
|
|
213
213
|
sessionId?: string;
|
|
214
214
|
turnId?: string;
|
|
215
215
|
toolCallId?: string;
|
|
216
216
|
};
|
|
217
|
-
type
|
|
218
|
-
|
|
217
|
+
type AppRuntimeContext = {
|
|
218
|
+
app: {
|
|
219
219
|
id: string;
|
|
220
220
|
slug: string;
|
|
221
221
|
url?: string | null;
|
|
@@ -227,98 +227,104 @@ type WorkRuntimeContext = {
|
|
|
227
227
|
viewer?: {
|
|
228
228
|
userUuid: string;
|
|
229
229
|
} | null;
|
|
230
|
-
invocation?:
|
|
230
|
+
invocation?: AppRuntimeInvocationContext;
|
|
231
231
|
permissions?: {
|
|
232
232
|
scopes: Permission[];
|
|
233
|
-
|
|
233
|
+
appScopes: Permission[];
|
|
234
234
|
viewerScopes: Permission[];
|
|
235
235
|
};
|
|
236
236
|
};
|
|
237
|
-
type
|
|
238
|
-
type
|
|
239
|
-
status:
|
|
237
|
+
type AppRuntimeCheckoutStatus = "success" | "failed" | "cancel" | null;
|
|
238
|
+
type AppRuntimeCheckoutState = {
|
|
239
|
+
status: AppRuntimeCheckoutStatus;
|
|
240
240
|
orderId: string | null;
|
|
241
241
|
};
|
|
242
242
|
/**
|
|
243
|
-
* Options for a single
|
|
243
|
+
* Options for a single app runtime transport request.
|
|
244
244
|
*/
|
|
245
|
-
type
|
|
245
|
+
type AppRuntimeRequestOptions = {
|
|
246
246
|
/** How long to wait for a matching response before resolving with null. */
|
|
247
247
|
timeoutMs?: number;
|
|
248
248
|
/** When set, re-posts the request on this interval until a response arrives. */
|
|
249
249
|
retryIntervalMs?: number;
|
|
250
250
|
};
|
|
251
251
|
/**
|
|
252
|
-
* Transport layer for {@link
|
|
252
|
+
* Transport layer for {@link AppRuntimeApi}. Decoupled so the same API can run
|
|
253
253
|
* over either the iframe parent bridge (bridge mode) or a popup broker window
|
|
254
254
|
* (broker mode). The transport is responsible for posting the request and
|
|
255
255
|
* resolving with the first matching response (or null on timeout).
|
|
256
256
|
*/
|
|
257
|
-
|
|
258
|
-
|
|
257
|
+
type AppContextChangedListener = (context: AppRuntimeContext) => void;
|
|
258
|
+
interface AppRuntimeTransport {
|
|
259
|
+
request<T>(message: Record<string, unknown>, options?: AppRuntimeRequestOptions): Promise<T | null>;
|
|
260
|
+
subscribeContextChanged?: (listener: AppContextChangedListener) => () => void;
|
|
259
261
|
}
|
|
260
262
|
/**
|
|
261
263
|
* Bridge-mode transport: posts messages to `window.parent` (the Cohub host
|
|
262
|
-
* embedding the
|
|
264
|
+
* embedding the app in an iframe) and listens for the matching reply.
|
|
263
265
|
* Behaviorally identical to the previous module-level `request()` helper.
|
|
264
266
|
*/
|
|
265
|
-
declare class ParentBridgeTransport implements
|
|
267
|
+
declare class ParentBridgeTransport implements AppRuntimeTransport {
|
|
266
268
|
private trustedParentOrigin;
|
|
267
|
-
|
|
269
|
+
private contextListeners;
|
|
270
|
+
private contextListener;
|
|
271
|
+
subscribeContextChanged(listener: AppContextChangedListener): () => void;
|
|
272
|
+
request<T>(message: Record<string, unknown>, options?: AppRuntimeRequestOptions): Promise<T | null>;
|
|
268
273
|
}
|
|
269
274
|
/**
|
|
270
|
-
* Broker-mode transport for standalone-deployed
|
|
275
|
+
* Broker-mode transport for standalone-deployed apps. Opens a popup window to
|
|
271
276
|
* the Cohub auth broker page, performs a ready-handshake, sends the request via
|
|
272
277
|
* postMessage, and resolves with the broker's response. The popup is closed
|
|
273
278
|
* after a single request is fulfilled (one-shot, per §7.2 of the plan).
|
|
274
279
|
*
|
|
275
280
|
* Non-interactive messages (`context`, `checkout-state`) are answered locally
|
|
276
|
-
* without opening a popup — the
|
|
277
|
-
* checkout state is not available on the
|
|
281
|
+
* without opening a popup — the app already knows its own appId, and
|
|
282
|
+
* checkout state is not available on the app's own origin in broker mode.
|
|
278
283
|
*/
|
|
279
|
-
declare class PopupBrokerTransport implements
|
|
284
|
+
declare class PopupBrokerTransport implements AppRuntimeTransport {
|
|
280
285
|
private readonly brokerOrigin;
|
|
281
|
-
private readonly
|
|
282
|
-
private readonly
|
|
286
|
+
private readonly appId?;
|
|
287
|
+
private readonly getAppId?;
|
|
283
288
|
constructor(config: {
|
|
284
289
|
brokerOrigin: string;
|
|
285
|
-
/** Explicit
|
|
286
|
-
|
|
290
|
+
/** Explicit app id. When absent, {@link getAppId} is used to resolve it. */
|
|
291
|
+
appId?: string;
|
|
287
292
|
/**
|
|
288
|
-
* Lazily resolves the
|
|
289
|
-
* `
|
|
290
|
-
* the
|
|
293
|
+
* Lazily resolves the app id at runtime (e.g. via the public
|
|
294
|
+
* `apps.getBySlug` reverse lookup). Used in standalone deployments where
|
|
295
|
+
* the appId is not known at code-authoring time. The resolver is expected
|
|
291
296
|
* to cache its own result.
|
|
292
297
|
*/
|
|
293
|
-
|
|
298
|
+
getAppId?: () => Promise<string | null>;
|
|
294
299
|
});
|
|
295
|
-
private
|
|
296
|
-
request<T>(message: Record<string, unknown>, options?:
|
|
300
|
+
private resolveAppId;
|
|
301
|
+
request<T>(message: Record<string, unknown>, options?: AppRuntimeRequestOptions): Promise<T | null>;
|
|
297
302
|
}
|
|
298
|
-
declare class
|
|
303
|
+
declare class AppRuntimeApi {
|
|
299
304
|
private token;
|
|
300
305
|
private readonly transport;
|
|
301
306
|
private tokenStorageKey;
|
|
302
307
|
private scopesStorageKey;
|
|
303
|
-
private readonly
|
|
308
|
+
private readonly appIdResolver?;
|
|
304
309
|
/** Ensures storage keys are resolved (via slug lookup) at most once. */
|
|
305
310
|
private storageKeysReady;
|
|
306
311
|
/** Scopes previously granted via requestAuthorization, retained so token
|
|
307
312
|
* refreshes can re-authorize (preserving viewerScopes) instead of falling
|
|
308
|
-
* back to a base session token that only carries
|
|
313
|
+
* back to a base session token that only carries appScopes. */
|
|
309
314
|
private authorizedScopes;
|
|
310
|
-
constructor(transport?:
|
|
315
|
+
constructor(transport?: AppRuntimeTransport, appId?: string, appIdResolver?: AppIdResolver);
|
|
311
316
|
/**
|
|
312
|
-
* Resolves the localStorage keys once the
|
|
317
|
+
* Resolves the localStorage keys once the appId is known. When the appId is
|
|
313
318
|
* only available via slug reverse lookup, this performs the lookup on first
|
|
314
|
-
* use and then restores any cached token/scopes for that
|
|
319
|
+
* use and then restores any cached token/scopes for that appId.
|
|
315
320
|
*/
|
|
316
321
|
private ensureStorageKeys;
|
|
317
322
|
private readStoredToken;
|
|
318
323
|
private writeStoredToken;
|
|
319
324
|
private readStoredScopes;
|
|
320
325
|
private writeStoredScopes;
|
|
321
|
-
context(): Promise<
|
|
326
|
+
context(): Promise<AppRuntimeContext | null>;
|
|
327
|
+
onContextChanged(listener: AppContextChangedListener): () => void;
|
|
322
328
|
getAccessToken(options?: {
|
|
323
329
|
forceRefresh?: boolean;
|
|
324
330
|
}): Promise<string | null>;
|
|
@@ -338,51 +344,53 @@ declare class WorkRuntimeApi {
|
|
|
338
344
|
orderId: string;
|
|
339
345
|
productKey: string;
|
|
340
346
|
} | null>;
|
|
341
|
-
checkoutState(): Promise<
|
|
347
|
+
checkoutState(): Promise<AppRuntimeCheckoutState | null>;
|
|
342
348
|
}
|
|
343
349
|
/**
|
|
344
|
-
* Configuration for the
|
|
350
|
+
* Configuration for the app runtime mode.
|
|
345
351
|
*/
|
|
346
|
-
type
|
|
352
|
+
type AppRuntimeModeConfig = {
|
|
347
353
|
/** Explicit mode selection. When omitted, auto-detection is used. */
|
|
348
354
|
mode?: "bridge" | "broker";
|
|
349
355
|
/** Cohub origin for the broker page (e.g. "https://cohub.live"). */
|
|
350
356
|
brokerOrigin?: string;
|
|
351
357
|
/**
|
|
352
|
-
* The
|
|
358
|
+
* The app's public id. Required for broker mode unless the slug triple
|
|
353
359
|
* below is supplied, in which case the id is resolved at runtime.
|
|
354
360
|
*/
|
|
355
|
-
|
|
356
|
-
/** Space owner's username. Used with {@link spaceSlug} + {@link
|
|
357
|
-
* resolve the
|
|
361
|
+
appId?: string;
|
|
362
|
+
/** Space owner's username. Used with {@link spaceSlug} + {@link appSlug} to
|
|
363
|
+
* resolve the appId at runtime via the public `apps.getBySlug` API. */
|
|
358
364
|
ownerUsername?: string;
|
|
359
|
-
/** Space slug. Part of the slug triple used for runtime
|
|
365
|
+
/** Space slug. Part of the slug triple used for runtime appId resolution. */
|
|
360
366
|
spaceSlug?: string;
|
|
361
|
-
/**
|
|
362
|
-
|
|
367
|
+
/** App slug. Part of the slug triple used for runtime appId resolution. */
|
|
368
|
+
appSlug?: string;
|
|
363
369
|
};
|
|
364
|
-
/** Lazily resolves
|
|
365
|
-
type
|
|
370
|
+
/** Lazily resolves an app's public id, e.g. via slug reverse lookup. */
|
|
371
|
+
type AppIdResolver = () => Promise<string | null>;
|
|
366
372
|
/**
|
|
367
|
-
* Builds a memoized
|
|
368
|
-
* public slug triple via `GET /api/
|
|
369
|
-
*
|
|
370
|
-
*
|
|
373
|
+
* Builds a memoized appId resolver that reverse-looks-up the appId from the
|
|
374
|
+
* public slug triple via `GET /api/apps/by-slug/:username/:spaceSlug/:appSlug`
|
|
375
|
+
* (the works REST routes are dual-mounted; `/api/works` keeps serving older
|
|
376
|
+
* consumers with identical payloads). The endpoint is
|
|
377
|
+
* anonymous (no auth) for public apps, so no token is needed. The result is
|
|
378
|
+
* cached; a failed lookup is not cached so it can be retried.
|
|
371
379
|
*/
|
|
372
|
-
declare function
|
|
380
|
+
declare function createSlugAppIdResolver(deps: {
|
|
373
381
|
apiBaseUrl: string;
|
|
374
382
|
fetch?: typeof globalThis.fetch;
|
|
375
383
|
ownerUsername: string;
|
|
376
384
|
spaceSlug: string;
|
|
377
|
-
|
|
378
|
-
}):
|
|
385
|
+
appSlug: string;
|
|
386
|
+
}): AppIdResolver;
|
|
379
387
|
/**
|
|
380
|
-
* Resolves the appropriate transport based on the
|
|
388
|
+
* Resolves the appropriate transport based on the app mode configuration.
|
|
381
389
|
* Auto-detection: inside an iframe → bridge; standalone with broker config →
|
|
382
|
-
* broker; otherwise → bridge (returns null for non-
|
|
390
|
+
* broker; otherwise → bridge (returns null for non-app contexts).
|
|
383
391
|
*/
|
|
384
|
-
declare function
|
|
385
|
-
declare const
|
|
392
|
+
declare function resolveAppTransport(config?: AppRuntimeModeConfig, appIdResolver?: AppIdResolver): AppRuntimeTransport;
|
|
393
|
+
declare const createAppRuntime: (transport?: AppRuntimeTransport, appId?: string, appIdResolver?: AppIdResolver) => AppRuntimeApi;
|
|
386
394
|
//#endregion
|
|
387
395
|
//#region src/transport.d.ts
|
|
388
396
|
type Fetch = typeof globalThis.fetch;
|
|
@@ -429,8 +437,10 @@ type CohubClientOptions = {
|
|
|
429
437
|
fetch?: Fetch;
|
|
430
438
|
websocket?: WebsocketClientOptions;
|
|
431
439
|
voice?: VoiceInputCreateOptions;
|
|
432
|
-
/**
|
|
433
|
-
|
|
440
|
+
/** App runtime mode configuration (bridge vs broker). */
|
|
441
|
+
app?: AppRuntimeModeConfig;
|
|
442
|
+
/** @deprecated Use `app`. Kept so existing runtimes keep configuring broker mode. */
|
|
443
|
+
work?: AppRuntimeModeConfig;
|
|
434
444
|
/** Optional X-Cohub-Source-* headers (static or per-request getter). */
|
|
435
445
|
requestSource?: RequestSource | null | (() => RequestSource | null | undefined);
|
|
436
446
|
};
|
|
@@ -986,7 +996,7 @@ type SessionSubscriptionHandlers = {
|
|
|
986
996
|
event?: (event: WebsocketEventPayload) => void;
|
|
987
997
|
};
|
|
988
998
|
type SessionEventName = "created" | "updated" | "turn.created" | "turn.patch" | "turn.lifecycle" | "turn.updated" | "turn.finalized" | "turn.error" | "message.persisted";
|
|
989
|
-
type SpaceEventName = SessionEventName | "fs.changed" | "ports.changed" | "presence.updated" | "board.changed" | "board.playback.changed" | "
|
|
999
|
+
type SpaceEventName = SessionEventName | "fs.changed" | "ports.changed" | "presence.updated" | "board.changed" | "board.playback.changed" | "app.version.published" | "task.created" | "task.updated" | "event";
|
|
990
1000
|
declare class SpacesApi {
|
|
991
1001
|
private readonly transport;
|
|
992
1002
|
constructor(transport: HttpTransport);
|
|
@@ -1702,37 +1712,6 @@ declare class TasksApi {
|
|
|
1702
1712
|
}>;
|
|
1703
1713
|
}
|
|
1704
1714
|
//#endregion
|
|
1705
|
-
//#region src/apis/ui-commands.d.ts
|
|
1706
|
-
type CreateUiCommandInput = {
|
|
1707
|
-
command: UiCommand;
|
|
1708
|
-
commandId?: string;
|
|
1709
|
-
targetClientId?: string;
|
|
1710
|
-
};
|
|
1711
|
-
type WaitForUiCommandOptions = {
|
|
1712
|
-
timeoutMs?: number;
|
|
1713
|
-
pollIntervalMs?: number;
|
|
1714
|
-
signal?: AbortSignal;
|
|
1715
|
-
};
|
|
1716
|
-
declare class UiCommandsApi {
|
|
1717
|
-
private readonly transport;
|
|
1718
|
-
constructor(transport: HttpTransport);
|
|
1719
|
-
create(input: CreateUiCommandInput): Promise<{
|
|
1720
|
-
command: UiCommandRecord;
|
|
1721
|
-
}>;
|
|
1722
|
-
get(commandId: string): Promise<{
|
|
1723
|
-
command: UiCommandRecord;
|
|
1724
|
-
}>;
|
|
1725
|
-
reportResult(commandId: string, input: {
|
|
1726
|
-
status: UiCommandStatus;
|
|
1727
|
-
result?: unknown;
|
|
1728
|
-
error?: UiCommandError | null;
|
|
1729
|
-
}): Promise<{
|
|
1730
|
-
command: UiCommandRecord;
|
|
1731
|
-
}>;
|
|
1732
|
-
run(input: CreateUiCommandInput, options?: WaitForUiCommandOptions): Promise<UiCommandRecord>;
|
|
1733
|
-
wait(commandId: string, options?: WaitForUiCommandOptions): Promise<UiCommandRecord>;
|
|
1734
|
-
}
|
|
1735
|
-
//#endregion
|
|
1736
1715
|
//#region src/apis/user.d.ts
|
|
1737
1716
|
declare class UserApi {
|
|
1738
1717
|
private readonly transport;
|
|
@@ -1802,15 +1781,15 @@ declare class ReferralsApi {
|
|
|
1802
1781
|
}>;
|
|
1803
1782
|
}
|
|
1804
1783
|
//#endregion
|
|
1805
|
-
//#region src/apis/
|
|
1806
|
-
type
|
|
1807
|
-
type
|
|
1808
|
-
type
|
|
1809
|
-
type
|
|
1784
|
+
//#region src/apis/apps.d.ts
|
|
1785
|
+
type AppTargetType = "file" | "directory" | "port";
|
|
1786
|
+
type AppStatus = "published" | "disabled";
|
|
1787
|
+
type AppVisibility = "public" | "space";
|
|
1788
|
+
type AppPresentationMeta = {
|
|
1810
1789
|
hideCohubBar?: boolean;
|
|
1811
1790
|
};
|
|
1812
1791
|
/** Snapshot of fields extracted from the published page head. */
|
|
1813
|
-
type
|
|
1792
|
+
type AppExtractedPageMeta = {
|
|
1814
1793
|
title?: string | null;
|
|
1815
1794
|
description?: string | null;
|
|
1816
1795
|
icon?: string | null;
|
|
@@ -1821,11 +1800,11 @@ type WorkExtractedPageMeta = {
|
|
|
1821
1800
|
extractedAt?: string | null;
|
|
1822
1801
|
};
|
|
1823
1802
|
/**
|
|
1824
|
-
*
|
|
1803
|
+
* App presentation metadata.
|
|
1825
1804
|
* `title` / `description` / `icon` / `image` / `lang` / `themeColor`
|
|
1826
1805
|
* power public page head, share cards, and lists.
|
|
1827
1806
|
*/
|
|
1828
|
-
type
|
|
1807
|
+
type AppMeta = Record<string, unknown> & {
|
|
1829
1808
|
title?: string;
|
|
1830
1809
|
/** @deprecated Prefer `title`. Kept for older clients. */
|
|
1831
1810
|
name?: string;
|
|
@@ -1836,68 +1815,68 @@ type WorkMeta = Record<string, unknown> & {
|
|
|
1836
1815
|
lang?: string;
|
|
1837
1816
|
/** CSS color from meta theme-color. */
|
|
1838
1817
|
themeColor?: string;
|
|
1839
|
-
presentation?:
|
|
1840
|
-
extracted?:
|
|
1818
|
+
presentation?: AppPresentationMeta;
|
|
1819
|
+
extracted?: AppExtractedPageMeta;
|
|
1841
1820
|
source?: RequestSource;
|
|
1842
1821
|
};
|
|
1843
|
-
type
|
|
1822
|
+
type AppRecord = {
|
|
1844
1823
|
id: string;
|
|
1845
1824
|
spaceId: string;
|
|
1846
1825
|
userUuid: string;
|
|
1847
1826
|
slug: string;
|
|
1848
|
-
status:
|
|
1849
|
-
visibility:
|
|
1850
|
-
targetType:
|
|
1827
|
+
status: AppStatus;
|
|
1828
|
+
visibility: AppVisibility;
|
|
1829
|
+
targetType: AppTargetType;
|
|
1851
1830
|
targetRef: string;
|
|
1852
1831
|
assetKey: string | null;
|
|
1853
1832
|
currentVersionId: string | null;
|
|
1854
1833
|
latestVersion: number;
|
|
1855
1834
|
publishedAt: string | null;
|
|
1856
|
-
|
|
1835
|
+
appScopes: Permission[];
|
|
1857
1836
|
allowedViewerScopes: Permission[];
|
|
1858
|
-
meta:
|
|
1837
|
+
meta: AppMeta | null;
|
|
1859
1838
|
createdAt: string | null;
|
|
1860
1839
|
updatedAt: string | null;
|
|
1861
1840
|
};
|
|
1862
|
-
type
|
|
1841
|
+
type AppCreateInput = {
|
|
1863
1842
|
spaceId: string;
|
|
1864
1843
|
slug: string;
|
|
1865
|
-
status?:
|
|
1866
|
-
visibility?:
|
|
1867
|
-
targetType:
|
|
1844
|
+
status?: AppStatus;
|
|
1845
|
+
visibility?: AppVisibility;
|
|
1846
|
+
targetType: AppTargetType;
|
|
1868
1847
|
targetRef: string;
|
|
1869
1848
|
assetKey?: string | null;
|
|
1870
|
-
|
|
1849
|
+
appScopes?: Permission[];
|
|
1871
1850
|
allowedViewerScopes?: Permission[];
|
|
1872
|
-
meta?:
|
|
1851
|
+
meta?: AppMeta | null;
|
|
1873
1852
|
};
|
|
1874
|
-
type
|
|
1853
|
+
type AppUpdateInput = Partial<{
|
|
1875
1854
|
slug: string;
|
|
1876
|
-
status:
|
|
1877
|
-
visibility:
|
|
1878
|
-
targetType:
|
|
1855
|
+
status: AppStatus;
|
|
1856
|
+
visibility: AppVisibility;
|
|
1857
|
+
targetType: AppTargetType;
|
|
1879
1858
|
targetRef: string;
|
|
1880
|
-
|
|
1859
|
+
appScopes: Permission[];
|
|
1881
1860
|
allowedViewerScopes: Permission[];
|
|
1882
|
-
meta:
|
|
1861
|
+
meta: AppMeta | null;
|
|
1883
1862
|
}>;
|
|
1884
|
-
type
|
|
1863
|
+
type AppVersionRecord = {
|
|
1885
1864
|
id: string;
|
|
1886
|
-
|
|
1865
|
+
appId: string;
|
|
1887
1866
|
version: number;
|
|
1888
|
-
targetType:
|
|
1867
|
+
targetType: AppTargetType;
|
|
1889
1868
|
targetRef: string;
|
|
1890
1869
|
assetKey: string | null;
|
|
1891
|
-
contentKind:
|
|
1892
|
-
artifact:
|
|
1893
|
-
meta:
|
|
1870
|
+
contentKind: AppContentKind;
|
|
1871
|
+
artifact: AppArtifactDescriptor | null;
|
|
1872
|
+
meta: AppMeta | null;
|
|
1894
1873
|
createdAt: string | null;
|
|
1895
1874
|
};
|
|
1896
|
-
type
|
|
1875
|
+
type AppContentDownload = {
|
|
1897
1876
|
manifestUrl: string;
|
|
1898
1877
|
manifestSha256: string;
|
|
1899
1878
|
};
|
|
1900
|
-
type
|
|
1879
|
+
type AppContent = {
|
|
1901
1880
|
kind: "port";
|
|
1902
1881
|
url: string;
|
|
1903
1882
|
targetType: "port";
|
|
@@ -1917,7 +1896,7 @@ type WorkContent = {
|
|
|
1917
1896
|
sizeBytes: number;
|
|
1918
1897
|
sha256: string;
|
|
1919
1898
|
}) & {
|
|
1920
|
-
download?:
|
|
1899
|
+
download?: AppContentDownload;
|
|
1921
1900
|
}) | {
|
|
1922
1901
|
kind: "board";
|
|
1923
1902
|
url: string;
|
|
@@ -1926,30 +1905,30 @@ type WorkContent = {
|
|
|
1926
1905
|
boardId: string;
|
|
1927
1906
|
boardVersion: number;
|
|
1928
1907
|
};
|
|
1929
|
-
type
|
|
1908
|
+
type AppPublicSpaceRecord = {
|
|
1930
1909
|
id: string;
|
|
1931
1910
|
slug: string;
|
|
1932
1911
|
name: string | null;
|
|
1933
1912
|
userUuid: string;
|
|
1934
1913
|
publicProfile?: SpacePublicProfile | null;
|
|
1935
1914
|
};
|
|
1936
|
-
type
|
|
1915
|
+
type AppPublicOwnerRecord = {
|
|
1937
1916
|
userUuid: string;
|
|
1938
1917
|
username: string;
|
|
1939
1918
|
displayName: string;
|
|
1940
1919
|
avatarUrl?: string | null;
|
|
1941
1920
|
};
|
|
1942
|
-
type
|
|
1943
|
-
|
|
1944
|
-
space:
|
|
1945
|
-
owner:
|
|
1921
|
+
type AppDetailResponse = {
|
|
1922
|
+
app: AppRecord;
|
|
1923
|
+
space: AppPublicSpaceRecord;
|
|
1924
|
+
owner: AppPublicOwnerRecord;
|
|
1946
1925
|
publicUrl: string | null;
|
|
1947
|
-
content:
|
|
1926
|
+
content: AppContent | null;
|
|
1948
1927
|
};
|
|
1949
|
-
type
|
|
1950
|
-
type
|
|
1951
|
-
type
|
|
1952
|
-
type
|
|
1928
|
+
type AppGetResponse = AppDetailResponse;
|
|
1929
|
+
type AppResolveResponse = AppDetailResponse;
|
|
1930
|
+
type AppViewSource = "web" | "cli" | "api";
|
|
1931
|
+
type AppViewStatsResponse = {
|
|
1953
1932
|
summary: {
|
|
1954
1933
|
totalViews: number;
|
|
1955
1934
|
views24h: number;
|
|
@@ -1961,31 +1940,31 @@ type WorkViewStatsResponse = {
|
|
|
1961
1940
|
views: number;
|
|
1962
1941
|
}>;
|
|
1963
1942
|
sources: Array<{
|
|
1964
|
-
source:
|
|
1943
|
+
source: AppViewSource;
|
|
1965
1944
|
views: number;
|
|
1966
1945
|
}>;
|
|
1967
1946
|
};
|
|
1968
|
-
type
|
|
1969
|
-
type
|
|
1947
|
+
type AppPromotionProvider = "generic" | "meta";
|
|
1948
|
+
type AppPromotionRecord = {
|
|
1970
1949
|
id: string;
|
|
1971
|
-
|
|
1950
|
+
appId: string;
|
|
1972
1951
|
name: string;
|
|
1973
|
-
provider:
|
|
1952
|
+
provider: AppPromotionProvider | string;
|
|
1974
1953
|
parameters: Record<string, string>;
|
|
1975
1954
|
createdBy: string;
|
|
1976
1955
|
createdAt: string;
|
|
1977
1956
|
};
|
|
1978
|
-
type
|
|
1979
|
-
key:
|
|
1957
|
+
type AppPromotionProviderStatus = {
|
|
1958
|
+
key: AppPromotionProvider | string;
|
|
1980
1959
|
configured: boolean;
|
|
1981
1960
|
};
|
|
1982
|
-
type
|
|
1961
|
+
type AppPromotionCreateInput = {
|
|
1983
1962
|
name: string;
|
|
1984
|
-
provider:
|
|
1963
|
+
provider: AppPromotionProvider | string;
|
|
1985
1964
|
parameters: Record<string, string>;
|
|
1986
1965
|
};
|
|
1987
|
-
type
|
|
1988
|
-
promotion:
|
|
1966
|
+
type AppPromotionStatsResponse = {
|
|
1967
|
+
promotion: AppPromotionRecord;
|
|
1989
1968
|
summary: {
|
|
1990
1969
|
landing: number;
|
|
1991
1970
|
ready: number;
|
|
@@ -2003,7 +1982,7 @@ type WorkPromotionStatsResponse = {
|
|
|
2003
1982
|
checkoutStarted: number;
|
|
2004
1983
|
}>;
|
|
2005
1984
|
};
|
|
2006
|
-
type
|
|
1985
|
+
type AppPromotionEventResponse = {
|
|
2007
1986
|
ok: true;
|
|
2008
1987
|
eventId: string;
|
|
2009
1988
|
browser: {
|
|
@@ -2013,12 +1992,12 @@ type WorkPromotionEventResponse = {
|
|
|
2013
1992
|
pixelId: string;
|
|
2014
1993
|
} | null;
|
|
2015
1994
|
};
|
|
2016
|
-
type
|
|
1995
|
+
type AppSessionResponse = {
|
|
2017
1996
|
token: string;
|
|
2018
1997
|
expiresIn: number;
|
|
2019
|
-
|
|
1998
|
+
app: AppRecord;
|
|
2020
1999
|
};
|
|
2021
|
-
type
|
|
2000
|
+
type AppAuthorizeResponse = {
|
|
2022
2001
|
token: string;
|
|
2023
2002
|
expiresIn: number;
|
|
2024
2003
|
grant: {
|
|
@@ -2027,99 +2006,198 @@ type WorkAuthorizeResponse = {
|
|
|
2027
2006
|
expiresAt: string;
|
|
2028
2007
|
};
|
|
2029
2008
|
};
|
|
2030
|
-
declare class
|
|
2009
|
+
declare class AppsApi {
|
|
2031
2010
|
private readonly transport;
|
|
2032
2011
|
constructor(transport: HttpTransport);
|
|
2033
2012
|
listBySpace(spaceId: string): Promise<{
|
|
2034
|
-
|
|
2013
|
+
apps: AppRecord[];
|
|
2035
2014
|
}>;
|
|
2036
|
-
get(id: string): Promise<
|
|
2015
|
+
get(id: string): Promise<AppDetailResponse>;
|
|
2037
2016
|
/**
|
|
2038
|
-
* Loads a published
|
|
2039
|
-
* Used by the standalone
|
|
2017
|
+
* Loads a published app's metadata + owner info by id (public access model).
|
|
2018
|
+
* Used by the standalone app auth broker page.
|
|
2040
2019
|
*/
|
|
2041
|
-
getPublicById(id: string): Promise<
|
|
2042
|
-
getBySlug(username: string, spaceSlug: string,
|
|
2020
|
+
getPublicById(id: string): Promise<AppDetailResponse>;
|
|
2021
|
+
getBySlug(username: string, spaceSlug: string, appSlug: string, options?: {
|
|
2043
2022
|
signal?: AbortSignal;
|
|
2044
|
-
}): Promise<
|
|
2045
|
-
create(input:
|
|
2046
|
-
|
|
2023
|
+
}): Promise<AppDetailResponse>;
|
|
2024
|
+
create(input: AppCreateInput): Promise<{
|
|
2025
|
+
app: AppRecord;
|
|
2047
2026
|
}>;
|
|
2048
|
-
update(id: string, input:
|
|
2049
|
-
|
|
2027
|
+
update(id: string, input: AppUpdateInput): Promise<{
|
|
2028
|
+
app: AppRecord;
|
|
2050
2029
|
}>;
|
|
2051
2030
|
delete(id: string): Promise<{
|
|
2052
2031
|
ok: true;
|
|
2053
2032
|
}>;
|
|
2054
|
-
getStats(
|
|
2055
|
-
listPromotions(
|
|
2056
|
-
promotions:
|
|
2057
|
-
providers:
|
|
2033
|
+
getStats(appId: string): Promise<AppViewStatsResponse>;
|
|
2034
|
+
listPromotions(appId: string): Promise<{
|
|
2035
|
+
promotions: AppPromotionRecord[];
|
|
2036
|
+
providers: AppPromotionProviderStatus[];
|
|
2058
2037
|
}>;
|
|
2059
|
-
createPromotion(
|
|
2060
|
-
promotion:
|
|
2038
|
+
createPromotion(appId: string, input: AppPromotionCreateInput): Promise<{
|
|
2039
|
+
promotion: AppPromotionRecord;
|
|
2061
2040
|
}>;
|
|
2062
|
-
getPromotionStats(
|
|
2063
|
-
recordPromotionEvent(
|
|
2064
|
-
eventKey:
|
|
2041
|
+
getPromotionStats(appId: string, promotionId: string): Promise<AppPromotionStatsResponse>;
|
|
2042
|
+
recordPromotionEvent(appId: string, promotionId: string, input: {
|
|
2043
|
+
eventKey: AppPromotionEventKey;
|
|
2065
2044
|
eventId?: string;
|
|
2066
2045
|
sourceUrl?: string;
|
|
2067
2046
|
fbp?: string;
|
|
2068
2047
|
fbc?: string;
|
|
2069
2048
|
productKey?: string;
|
|
2070
|
-
}): Promise<
|
|
2071
|
-
recordPromotionRegistration(
|
|
2049
|
+
}): Promise<AppPromotionEventResponse>;
|
|
2050
|
+
recordPromotionRegistration(appId: string, promotionId: string, input?: {
|
|
2072
2051
|
sourceUrl?: string;
|
|
2073
2052
|
fbp?: string;
|
|
2074
2053
|
fbc?: string;
|
|
2075
2054
|
}): Promise<{
|
|
2076
2055
|
reported: boolean;
|
|
2077
2056
|
eventId: string | null;
|
|
2078
|
-
browser:
|
|
2057
|
+
browser: AppPromotionEventResponse["browser"];
|
|
2079
2058
|
}>;
|
|
2080
|
-
listVersions(
|
|
2081
|
-
versions:
|
|
2059
|
+
listVersions(appId: string): Promise<{
|
|
2060
|
+
versions: AppVersionRecord[];
|
|
2082
2061
|
}>;
|
|
2083
|
-
publishVersion(
|
|
2084
|
-
meta?:
|
|
2062
|
+
publishVersion(appId: string, input?: {
|
|
2063
|
+
meta?: AppMeta | null;
|
|
2085
2064
|
}): Promise<{
|
|
2086
|
-
|
|
2087
|
-
version:
|
|
2065
|
+
app: AppRecord;
|
|
2066
|
+
version: AppVersionRecord;
|
|
2088
2067
|
}>;
|
|
2089
|
-
createSession(
|
|
2090
|
-
authorize(
|
|
2068
|
+
createSession(appId: string): Promise<AppSessionResponse>;
|
|
2069
|
+
authorize(appId: string, input: {
|
|
2091
2070
|
scopes: Permission[];
|
|
2092
2071
|
reason?: string;
|
|
2093
|
-
}): Promise<
|
|
2072
|
+
}): Promise<AppAuthorizeResponse>;
|
|
2073
|
+
}
|
|
2074
|
+
/** @deprecated Use `AppTargetType`. */
|
|
2075
|
+
type WorkTargetType = AppTargetType;
|
|
2076
|
+
/** @deprecated Use `AppStatus`. */
|
|
2077
|
+
type WorkStatus = AppStatus;
|
|
2078
|
+
/** @deprecated Use `AppVisibility`. */
|
|
2079
|
+
type WorkVisibility = AppVisibility;
|
|
2080
|
+
/** @deprecated Use `AppPresentationMeta`. */
|
|
2081
|
+
type WorkPresentationMeta = AppPresentationMeta;
|
|
2082
|
+
/** @deprecated Use `AppExtractedPageMeta`. */
|
|
2083
|
+
type WorkExtractedPageMeta = AppExtractedPageMeta;
|
|
2084
|
+
/** @deprecated Use `AppMeta`. */
|
|
2085
|
+
type WorkMeta = AppMeta;
|
|
2086
|
+
/** @deprecated Use `AppRecord`. */
|
|
2087
|
+
type WorkRecord = AppRecord;
|
|
2088
|
+
/** @deprecated Use `AppCreateInput`. */
|
|
2089
|
+
type WorkCreateInput = AppCreateInput;
|
|
2090
|
+
/** @deprecated Use `AppUpdateInput`. */
|
|
2091
|
+
type WorkUpdateInput = AppUpdateInput;
|
|
2092
|
+
/** @deprecated Use `AppVersionRecord`. */
|
|
2093
|
+
type WorkVersionRecord = AppVersionRecord;
|
|
2094
|
+
/** @deprecated Use `AppContentDownload`. */
|
|
2095
|
+
type WorkContentDownload = AppContentDownload;
|
|
2096
|
+
/** @deprecated Use `AppContent`. */
|
|
2097
|
+
type WorkContent = AppContent;
|
|
2098
|
+
/** @deprecated Use `AppPublicSpaceRecord`. */
|
|
2099
|
+
type WorkPublicSpaceRecord = AppPublicSpaceRecord;
|
|
2100
|
+
/** @deprecated Use `AppPublicOwnerRecord`. */
|
|
2101
|
+
type WorkPublicOwnerRecord = AppPublicOwnerRecord;
|
|
2102
|
+
/** @deprecated Use `AppDetailResponse`. */
|
|
2103
|
+
type WorkDetailResponse = AppDetailResponse;
|
|
2104
|
+
/** @deprecated Use `AppGetResponse`. */
|
|
2105
|
+
type WorkGetResponse = AppGetResponse;
|
|
2106
|
+
/** @deprecated Use `AppResolveResponse`. */
|
|
2107
|
+
type WorkResolveResponse = AppResolveResponse;
|
|
2108
|
+
/** @deprecated Use `AppViewSource`. */
|
|
2109
|
+
type WorkViewSource = AppViewSource;
|
|
2110
|
+
/** @deprecated Use `AppViewStatsResponse`. */
|
|
2111
|
+
type WorkViewStatsResponse = AppViewStatsResponse;
|
|
2112
|
+
/** @deprecated Use `AppPromotionProvider`. */
|
|
2113
|
+
type WorkPromotionProvider = AppPromotionProvider;
|
|
2114
|
+
/** @deprecated Use `AppPromotionRecord`. */
|
|
2115
|
+
type WorkPromotionRecord = AppPromotionRecord;
|
|
2116
|
+
/** @deprecated Use `AppPromotionProviderStatus`. */
|
|
2117
|
+
type WorkPromotionProviderStatus = AppPromotionProviderStatus;
|
|
2118
|
+
/** @deprecated Use `AppPromotionCreateInput`. */
|
|
2119
|
+
type WorkPromotionCreateInput = AppPromotionCreateInput;
|
|
2120
|
+
/** @deprecated Use `AppPromotionStatsResponse`. */
|
|
2121
|
+
type WorkPromotionStatsResponse = AppPromotionStatsResponse;
|
|
2122
|
+
/** @deprecated Use `AppPromotionEventResponse`. */
|
|
2123
|
+
type WorkPromotionEventResponse = AppPromotionEventResponse;
|
|
2124
|
+
/** @deprecated Use `AppSessionResponse`. */
|
|
2125
|
+
type WorkSessionResponse = AppSessionResponse;
|
|
2126
|
+
/** @deprecated Use `AppAuthorizeResponse`. */
|
|
2127
|
+
type WorkAuthorizeResponse = AppAuthorizeResponse;
|
|
2128
|
+
//#endregion
|
|
2129
|
+
//#region src/apis/desktop-commands.d.ts
|
|
2130
|
+
/** @deprecated Use `DesktopCommand`. */
|
|
2131
|
+
type UiCommand = DesktopCommand;
|
|
2132
|
+
/** @deprecated Use `DesktopCommandError`. */
|
|
2133
|
+
type UiCommandError = DesktopCommandError;
|
|
2134
|
+
/** @deprecated Use `DesktopCommandRecord`. */
|
|
2135
|
+
type UiCommandRecord = DesktopCommandRecord;
|
|
2136
|
+
/** @deprecated Use `DesktopCommandStatus`. */
|
|
2137
|
+
type UiCommandStatus = DesktopCommandStatus;
|
|
2138
|
+
type CreateDesktopCommandInput = {
|
|
2139
|
+
command: DesktopCommand;
|
|
2140
|
+
commandId?: string;
|
|
2141
|
+
targetClientId?: string;
|
|
2142
|
+
};
|
|
2143
|
+
type WaitForDesktopCommandOptions = {
|
|
2144
|
+
timeoutMs?: number;
|
|
2145
|
+
pollIntervalMs?: number;
|
|
2146
|
+
signal?: AbortSignal;
|
|
2147
|
+
};
|
|
2148
|
+
/** @deprecated Use `CreateDesktopCommandInput`. */
|
|
2149
|
+
type CreateUiCommandInput = CreateDesktopCommandInput;
|
|
2150
|
+
/** @deprecated Use `WaitForDesktopCommandOptions`. */
|
|
2151
|
+
type WaitForUiCommandOptions = WaitForDesktopCommandOptions;
|
|
2152
|
+
declare class DesktopCommandsApi {
|
|
2153
|
+
private readonly transport;
|
|
2154
|
+
constructor(transport: HttpTransport);
|
|
2155
|
+
create(input: CreateDesktopCommandInput): Promise<{
|
|
2156
|
+
command: DesktopCommandRecord;
|
|
2157
|
+
}>;
|
|
2158
|
+
get(commandId: string): Promise<{
|
|
2159
|
+
command: DesktopCommandRecord;
|
|
2160
|
+
}>;
|
|
2161
|
+
reportResult(commandId: string, input: {
|
|
2162
|
+
status: DesktopCommandStatus;
|
|
2163
|
+
result?: unknown;
|
|
2164
|
+
error?: DesktopCommandError | null;
|
|
2165
|
+
}): Promise<{
|
|
2166
|
+
command: DesktopCommandRecord;
|
|
2167
|
+
}>;
|
|
2168
|
+
run(input: CreateDesktopCommandInput, options?: WaitForDesktopCommandOptions): Promise<DesktopCommandRecord>;
|
|
2169
|
+
wait(commandId: string, options?: WaitForDesktopCommandOptions): Promise<DesktopCommandRecord>;
|
|
2094
2170
|
}
|
|
2171
|
+
/** @deprecated Use `DesktopCommandsApi`. */
|
|
2172
|
+
declare class UiCommandsApi extends DesktopCommandsApi {}
|
|
2095
2173
|
//#endregion
|
|
2096
|
-
//#region src/apis/
|
|
2097
|
-
type
|
|
2174
|
+
//#region src/apis/app-commerce.d.ts
|
|
2175
|
+
type AppCommerceEntitlement = {
|
|
2098
2176
|
benefitKey: string;
|
|
2099
2177
|
enabled: boolean;
|
|
2100
2178
|
metadata: Record<string, string | number | boolean>;
|
|
2101
2179
|
};
|
|
2102
|
-
type
|
|
2103
|
-
entitlements:
|
|
2180
|
+
type AppCommerceEntitlementsResponse = {
|
|
2181
|
+
entitlements: AppCommerceEntitlement[];
|
|
2104
2182
|
credits: {
|
|
2105
2183
|
available: number;
|
|
2106
2184
|
net: number;
|
|
2107
2185
|
};
|
|
2108
2186
|
businessKey: string;
|
|
2109
2187
|
};
|
|
2110
|
-
type
|
|
2111
|
-
type
|
|
2188
|
+
type AppCommerceCheckoutStatus = "success" | "failed" | "cancel" | null;
|
|
2189
|
+
type AppCommerceProductResolveResponse = {
|
|
2112
2190
|
products: SpaceCommerceProduct[];
|
|
2113
2191
|
};
|
|
2114
|
-
type
|
|
2115
|
-
type
|
|
2116
|
-
status:
|
|
2192
|
+
type AppCommerceCreditConsumeStatus = "consumed" | "insufficient" | "disabled";
|
|
2193
|
+
type AppCommerceCreditConsumeResponse = {
|
|
2194
|
+
status: AppCommerceCreditConsumeStatus;
|
|
2117
2195
|
amount: number;
|
|
2118
2196
|
remaining: number;
|
|
2119
2197
|
shortfall: number | null;
|
|
2120
2198
|
businessKey: string;
|
|
2121
2199
|
};
|
|
2122
|
-
type
|
|
2200
|
+
type AppCommercePurchaseResponse = {
|
|
2123
2201
|
checkout: {
|
|
2124
2202
|
providerKey: string | null;
|
|
2125
2203
|
checkoutUrl: string | null;
|
|
@@ -2132,7 +2210,7 @@ type WorkCommercePurchaseResponse = {
|
|
|
2132
2210
|
currency: string | null;
|
|
2133
2211
|
};
|
|
2134
2212
|
};
|
|
2135
|
-
type
|
|
2213
|
+
type AppCommerceOrder = {
|
|
2136
2214
|
id: string;
|
|
2137
2215
|
productKeySnapshot: string;
|
|
2138
2216
|
productNameSnapshot: string;
|
|
@@ -2143,25 +2221,43 @@ type WorkCommerceOrder = {
|
|
|
2143
2221
|
paidAt: string | null;
|
|
2144
2222
|
buyerProfile: SpaceCommerceBuyerProfile | null;
|
|
2145
2223
|
};
|
|
2146
|
-
declare class
|
|
2224
|
+
declare class AppCommerceApi {
|
|
2147
2225
|
private readonly transport;
|
|
2148
2226
|
constructor(transport: HttpTransport);
|
|
2149
|
-
resolveProducts(
|
|
2227
|
+
resolveProducts(appId: string, input: {
|
|
2150
2228
|
productKeys: string[];
|
|
2151
|
-
}): Promise<
|
|
2152
|
-
getEntitlements(
|
|
2153
|
-
consumeCredits(
|
|
2229
|
+
}): Promise<AppCommerceProductResolveResponse>;
|
|
2230
|
+
getEntitlements(appId: string): Promise<AppCommerceEntitlementsResponse>;
|
|
2231
|
+
consumeCredits(appId: string, input: {
|
|
2154
2232
|
amount: number;
|
|
2155
2233
|
operationId: string;
|
|
2156
2234
|
reason?: string;
|
|
2157
|
-
}): Promise<
|
|
2158
|
-
purchase(
|
|
2235
|
+
}): Promise<AppCommerceCreditConsumeResponse>;
|
|
2236
|
+
purchase(appId: string, input: {
|
|
2159
2237
|
productKey: string;
|
|
2160
|
-
}): Promise<
|
|
2161
|
-
getOrder(
|
|
2162
|
-
order:
|
|
2238
|
+
}): Promise<AppCommercePurchaseResponse>;
|
|
2239
|
+
getOrder(appId: string, orderId: string): Promise<{
|
|
2240
|
+
order: AppCommerceOrder;
|
|
2163
2241
|
}>;
|
|
2164
2242
|
}
|
|
2243
|
+
/** @deprecated Use `AppCommerceEntitlement`. */
|
|
2244
|
+
type WorkCommerceEntitlement = AppCommerceEntitlement;
|
|
2245
|
+
/** @deprecated Use `AppCommerceEntitlementsResponse`. */
|
|
2246
|
+
type WorkCommerceEntitlementsResponse = AppCommerceEntitlementsResponse;
|
|
2247
|
+
/** @deprecated Use `AppCommerceCheckoutStatus`. */
|
|
2248
|
+
type WorkCommerceCheckoutStatus = AppCommerceCheckoutStatus;
|
|
2249
|
+
/** @deprecated Use `AppCommerceProductResolveResponse`. */
|
|
2250
|
+
type WorkCommerceProductResolveResponse = AppCommerceProductResolveResponse;
|
|
2251
|
+
/** @deprecated Use `AppCommerceCreditConsumeStatus`. */
|
|
2252
|
+
type WorkCommerceCreditConsumeStatus = AppCommerceCreditConsumeStatus;
|
|
2253
|
+
/** @deprecated Use `AppCommerceCreditConsumeResponse`. */
|
|
2254
|
+
type WorkCommerceCreditConsumeResponse = AppCommerceCreditConsumeResponse;
|
|
2255
|
+
/** @deprecated Use `AppCommercePurchaseResponse`. */
|
|
2256
|
+
type WorkCommercePurchaseResponse = AppCommercePurchaseResponse;
|
|
2257
|
+
/** @deprecated Use `AppCommerceApi`. */
|
|
2258
|
+
declare class WorkCommerceApi extends AppCommerceApi {}
|
|
2259
|
+
/** @deprecated Use `AppCommerceOrder`. */
|
|
2260
|
+
type WorkCommerceOrder = AppCommerceOrder;
|
|
2165
2261
|
//#endregion
|
|
2166
2262
|
//#region src/http.d.ts
|
|
2167
2263
|
declare class CohubHttpClient {
|
|
@@ -2181,13 +2277,19 @@ declare class CohubHttpClient {
|
|
|
2181
2277
|
readonly cronJobs: CronJobsApi;
|
|
2182
2278
|
readonly invite: PublicInviteApi;
|
|
2183
2279
|
readonly referrals: ReferralsApi;
|
|
2184
|
-
readonly
|
|
2185
|
-
readonly
|
|
2186
|
-
|
|
2280
|
+
readonly apps: AppsApi;
|
|
2281
|
+
readonly appCommerce: AppCommerceApi;
|
|
2282
|
+
/** @deprecated Use `apps`. */
|
|
2283
|
+
get works(): AppsApi;
|
|
2284
|
+
/** @deprecated Use `appCommerce`. */
|
|
2285
|
+
get workCommerce(): AppCommerceApi;
|
|
2286
|
+
readonly desktop: DesktopCommandsApi;
|
|
2287
|
+
/** @deprecated Use `desktop`. */
|
|
2288
|
+
get ui(): DesktopCommandsApi;
|
|
2187
2289
|
private readonly transport;
|
|
2188
2290
|
constructor(options?: CohubClientOptions);
|
|
2189
2291
|
space(spaceId: string): SpaceClient;
|
|
2190
2292
|
}
|
|
2191
2293
|
declare const createHttpClient: (options?: CohubClientOptions) => CohubHttpClient;
|
|
2192
2294
|
//#endregion
|
|
2193
|
-
export {
|
|
2295
|
+
export { AppUpdateInput as $, AppContextChangedListener as $n, PublicInviteApi as $t, WaitForUiCommandOptions as A, PublicAssetPurpose as An, WorkViewStatsResponse as At, AppPromotionCreateInput as B, GenerationsApi as Bn, BoardPlaybackChangedEvent as Bt, DesktopCommandsApi as C, SessionAccessApi as Cn, CreateGenerationTaskResponse as Cr, WorkResolveResponse as Ct, UiCommandStatus as D, CreatePublicAssetUploadInput as Dn, PublicGenerationDeclaration as Dr, WorkUpdateInput as Dt, UiCommandRecord as E, SearchApi as En, ListGenerationModelsResponse as Er, WorkTargetType as Et, AppDetailResponse as F, UploadChatImageAttachmentInput as Fn, TasksApi as Ft, AppPromotionStatsResponse as G, HttpError as Gn, SpaceClient as Gt, AppPromotionProvider as H, ChannelsApi as Hn, SessionEventName as Ht, AppExtractedPageMeta as I, UploadPublicAssetInput as In, BoardAwarenessUpdatedEvent as It, AppRecord as J, RawHttpResponse as Jn, SpaceTurnListOptions as Jt, AppPublicOwnerRecord as K, HttpTraceContext as Kn, SpaceEventName as Kt, AppGetResponse as L, SkillsApi as Ln, BoardChangedEvent as Lt, AppContent as M, PublicAssetUploadProtocol as Mn, ReferralsApi as Mt, AppContentDownload as N, PublicAssetsApi as Nn, UsersApi as Nt, UiCommandsApi as O, CreatePublicAssetUploadResponse as On, ModelStatusEntry as Or, WorkVersionRecord as Ot, AppCreateInput as P, UploadChatAttachmentInput as Pn, UserApi as Pt, AppTargetType as Q, sanitizeAccessToken as Qn, BuildSpacePathInput as Qt, AppMeta as R, PromptsApi as Rn, BoardClient as Rt, CreateUiCommandInput as S, createSessionPatchReducer as Sn, CreateGenerationTaskRequest as Sr, WorkRecord as St, UiCommandError as T, ReferencesApi as Tn, GenerationUsageBilling as Tr, WorkStatus as Tt, AppPromotionProviderStatus as U, CohubClientOptions as Un, SessionSubscriptionHandlers as Ut, AppPromotionEventResponse as V, CronJobsApi as Vn, BoardSubscriptionHandlers as Vt, AppPromotionRecord as W, Fetch as Wn, SpaceChannelBindingRecord as Wt, AppSessionResponse as X, joinApiUrl as Xn, WebSocketConnectionState as Xt, AppResolveResponse as Y, UnauthorizedContext as Yn, SpacesApi as Yt, AppStatus as Z, matchesUnauthorizedErrorToken as Zn, BuildSpaceInvitePathInput as Zt, WorkCommerceEntitlementsResponse as _, SessionPatchApplyInput as _n, PublicFileListResponse as _r, WorkPromotionProviderStatus as _t, AppCommerceCreditConsumeResponse as a, GenerationStreamEvent as an, AppRuntimeInvocationContext as ar, WorkAuthorizeResponse as at, WorkCommercePurchaseResponse as b, SessionPatchState as bn, PublicFileUrlResponse as br, WorkPublicOwnerRecord as bt, AppCommerceEntitlementsResponse as c, GenerationStreamLifecycleEvent as cn, AppRuntimeTransport as cr, WorkCreateInput as ct, AppCommercePurchaseResponse as d, GenerationStreamSubscribeOptions as dn, createAppRuntime as dr, WorkGetResponse as dt, buildSpaceInvitePath as en, AppIdResolver as er, AppVersionRecord as et, WorkCommerceApi as f, GenerationStreamSubscriptionHandlers as fn, createSlugAppIdResolver as fr, WorkMeta as ft, WorkCommerceEntitlement as g, parseAssistantMessageCommit as gn, PublicFileListEntry as gr, WorkPromotionProvider as gt, WorkCommerceCreditConsumeStatus as h, createSessionGenerationStreamClient as hn, PublicFileCreateUploadResponse as hr, WorkPromotionEventResponse as ht, AppCommerceCheckoutStatus as i, GenerationStreamErrorEvent as in, AppRuntimeContext as ir, AppsApi as it, AppAuthorizeResponse as j, PublicAssetUploadProgress as jn, WorkVisibility as jt, WaitForDesktopCommandOptions as k, PublicAssetMimeType as kn, ModelStatusResponse as kr, WorkViewSource as kt, AppCommerceOrder as l, GenerationStreamOutOfSyncEvent as ln, ParentBridgeTransport as lr, WorkDetailResponse as lt, WorkCommerceCreditConsumeResponse as m, SessionGenerationStreamClient as mn, PublicFileCreateUploadInput as mr, WorkPromotionCreateInput as mt, createHttpClient as n, AssistantMessageCommit as nn, AppRuntimeCheckoutState as nr, AppViewStatsResponse as nt, AppCommerceCreditConsumeStatus as o, GenerationStreamFinalizedEvent as on, AppRuntimeModeConfig as or, WorkContent as ot, WorkCommerceCheckoutStatus as p, GenerationStreamTurnUpdatedEvent as pn, resolveAppTransport as pr, WorkPresentationMeta as pt, AppPublicSpaceRecord as q, HttpTransport as qn, SpacePublicFilesApi as qt, AppCommerceApi as r, GenerationStreamCommitEvent as rn, AppRuntimeCheckoutStatus as rr, AppVisibility as rt, AppCommerceEntitlement as s, GenerationStreamIntermediateMessage as sn, AppRuntimeRequestOptions as sr, WorkContentDownload as st, CohubHttpClient as t, buildSpacePath as tn, AppRuntimeApi as tr, AppViewSource as tt, AppCommerceProductResolveResponse as u, GenerationStreamStateEvent as un, PopupBrokerTransport as ur, WorkExtractedPageMeta as ut, WorkCommerceOrder as v, SessionPatchApplyResult as vn, PublicFileUploadEntryInput as vr, WorkPromotionRecord as vt, UiCommand as w, ReferenceResourceSelector as wn, GenerationTaskResult as wr, WorkSessionResponse as wt, CreateDesktopCommandInput as x, SessionPatchStatus as xn, SpaceStartupResponse as xr, WorkPublicSpaceRecord as xt, WorkCommerceProductResolveResponse as y, SessionPatchReducer as yn, PublicFileUploadPlanEntry as yr, WorkPromotionStatsResponse as yt, AppPresentationMeta as z, ModelsApi as zn, BoardEventName as zt };
|