@kittl/sdk 0.0.4 → 0.0.5
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/kittl-sdk.esm.js +44 -11
- package/dist/kittl-sdk.js +44 -11
- package/dist/sdk.d.ts +150 -21
- package/package.json +1 -1
package/dist/kittl-sdk.esm.js
CHANGED
|
@@ -195,6 +195,13 @@ var createSDKCallMessage = {
|
|
|
195
195
|
args,
|
|
196
196
|
messageId,
|
|
197
197
|
apiType: "upload"
|
|
198
|
+
}),
|
|
199
|
+
data: (dots, args, messageId) => ({
|
|
200
|
+
command: "sdk-call",
|
|
201
|
+
dots,
|
|
202
|
+
args,
|
|
203
|
+
messageId,
|
|
204
|
+
apiType: "data"
|
|
198
205
|
})
|
|
199
206
|
};
|
|
200
207
|
function createApiProxy(apiType) {
|
|
@@ -213,6 +220,7 @@ function createApiProxy(apiType) {
|
|
|
213
220
|
|
|
214
221
|
// ../../packages/editor-core/sdk/sdk-bridge/dist/bridge/sandboxed/handlers/apiProxy/aiApiProxy.js
|
|
215
222
|
var generationHandlers = /* @__PURE__ */ new Map();
|
|
223
|
+
var generationSubscriptions = /* @__PURE__ */ new Map();
|
|
216
224
|
var dispatchAIGenerationUpdate = (subscriptionId, update) => {
|
|
217
225
|
const handler = generationHandlers.get(subscriptionId);
|
|
218
226
|
if (!handler) {
|
|
@@ -221,6 +229,20 @@ var dispatchAIGenerationUpdate = (subscriptionId, update) => {
|
|
|
221
229
|
void handler(update);
|
|
222
230
|
};
|
|
223
231
|
function createAIApiProxy() {
|
|
232
|
+
const unregisterGenerationHandler = (generatorId) => {
|
|
233
|
+
const subscriptionId = generationSubscriptions.get(generatorId);
|
|
234
|
+
if (!subscriptionId) {
|
|
235
|
+
return;
|
|
236
|
+
}
|
|
237
|
+
generationHandlers.delete(subscriptionId);
|
|
238
|
+
generationSubscriptions.delete(generatorId);
|
|
239
|
+
const unregisterMessage = {
|
|
240
|
+
command: "ai-unregister-handler",
|
|
241
|
+
generatorId,
|
|
242
|
+
subscriptionId
|
|
243
|
+
};
|
|
244
|
+
postMessageToParent(unregisterMessage);
|
|
245
|
+
};
|
|
224
246
|
return {
|
|
225
247
|
spendCredits: async (options) => {
|
|
226
248
|
const { onAccept, onDecline, ...serializable } = options;
|
|
@@ -250,16 +272,18 @@ function createAIApiProxy() {
|
|
|
250
272
|
return sendMessage(message);
|
|
251
273
|
},
|
|
252
274
|
registerHandler: async (generatorId, onStatusUpdate) => {
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
275
|
+
if (generationSubscriptions.has(generatorId)) {
|
|
276
|
+
return {
|
|
277
|
+
isOk: false,
|
|
278
|
+
error: {
|
|
279
|
+
message: `AI handler for generator "${generatorId}" is already registered`,
|
|
280
|
+
name: "SdkInternalError"
|
|
281
|
+
}
|
|
259
282
|
};
|
|
260
|
-
|
|
261
|
-
|
|
283
|
+
}
|
|
284
|
+
const subscriptionId = generateMessageId();
|
|
262
285
|
generationHandlers.set(subscriptionId, onStatusUpdate);
|
|
286
|
+
generationSubscriptions.set(generatorId, subscriptionId);
|
|
263
287
|
const registerMessage = {
|
|
264
288
|
command: "ai-register-handler",
|
|
265
289
|
messageId: generateMessageId(),
|
|
@@ -270,11 +294,16 @@ function createAIApiProxy() {
|
|
|
270
294
|
const response = await sendMessage(registerMessage);
|
|
271
295
|
if (!response.isOk) {
|
|
272
296
|
generationHandlers.delete(subscriptionId);
|
|
297
|
+
generationSubscriptions.delete(generatorId);
|
|
273
298
|
return response;
|
|
274
299
|
}
|
|
275
|
-
return {
|
|
300
|
+
return {
|
|
301
|
+
isOk: true,
|
|
302
|
+
result: () => unregisterGenerationHandler(generatorId)
|
|
303
|
+
};
|
|
276
304
|
} catch {
|
|
277
305
|
generationHandlers.delete(subscriptionId);
|
|
306
|
+
generationSubscriptions.delete(generatorId);
|
|
278
307
|
return {
|
|
279
308
|
isOk: false,
|
|
280
309
|
error: {
|
|
@@ -283,6 +312,10 @@ function createAIApiProxy() {
|
|
|
283
312
|
}
|
|
284
313
|
};
|
|
285
314
|
}
|
|
315
|
+
},
|
|
316
|
+
unregisterHandler: async (generatorId) => {
|
|
317
|
+
unregisterGenerationHandler(generatorId);
|
|
318
|
+
return { isOk: true, result: void 0 };
|
|
286
319
|
}
|
|
287
320
|
};
|
|
288
321
|
}
|
|
@@ -428,8 +461,7 @@ var createAuthBridgeApi = () => {
|
|
|
428
461
|
const message = {
|
|
429
462
|
command: "auth-refresh",
|
|
430
463
|
messageId: generateMessageId(),
|
|
431
|
-
provider: request.provider
|
|
432
|
-
refresh_token: request.refresh_token
|
|
464
|
+
provider: request.provider
|
|
433
465
|
};
|
|
434
466
|
return sendMessage(message);
|
|
435
467
|
},
|
|
@@ -699,6 +731,7 @@ var handleIncomingMessage = (event) => {
|
|
|
699
731
|
var bridgeHandlers = {
|
|
700
732
|
ai: createAIApiProxy(),
|
|
701
733
|
context: contextApi,
|
|
734
|
+
data: createApiProxy("data"),
|
|
702
735
|
design: createApiProxy("design"),
|
|
703
736
|
designStore: designStateApi,
|
|
704
737
|
appStore: appStateApi,
|
package/dist/kittl-sdk.js
CHANGED
|
@@ -196,6 +196,13 @@
|
|
|
196
196
|
args,
|
|
197
197
|
messageId,
|
|
198
198
|
apiType: "upload"
|
|
199
|
+
}),
|
|
200
|
+
data: (dots, args, messageId) => ({
|
|
201
|
+
command: "sdk-call",
|
|
202
|
+
dots,
|
|
203
|
+
args,
|
|
204
|
+
messageId,
|
|
205
|
+
apiType: "data"
|
|
199
206
|
})
|
|
200
207
|
};
|
|
201
208
|
function createApiProxy(apiType) {
|
|
@@ -214,6 +221,7 @@
|
|
|
214
221
|
|
|
215
222
|
// ../../packages/editor-core/sdk/sdk-bridge/dist/bridge/sandboxed/handlers/apiProxy/aiApiProxy.js
|
|
216
223
|
var generationHandlers = /* @__PURE__ */ new Map();
|
|
224
|
+
var generationSubscriptions = /* @__PURE__ */ new Map();
|
|
217
225
|
var dispatchAIGenerationUpdate = (subscriptionId, update) => {
|
|
218
226
|
const handler = generationHandlers.get(subscriptionId);
|
|
219
227
|
if (!handler) {
|
|
@@ -222,6 +230,20 @@
|
|
|
222
230
|
void handler(update);
|
|
223
231
|
};
|
|
224
232
|
function createAIApiProxy() {
|
|
233
|
+
const unregisterGenerationHandler = (generatorId) => {
|
|
234
|
+
const subscriptionId = generationSubscriptions.get(generatorId);
|
|
235
|
+
if (!subscriptionId) {
|
|
236
|
+
return;
|
|
237
|
+
}
|
|
238
|
+
generationHandlers.delete(subscriptionId);
|
|
239
|
+
generationSubscriptions.delete(generatorId);
|
|
240
|
+
const unregisterMessage = {
|
|
241
|
+
command: "ai-unregister-handler",
|
|
242
|
+
generatorId,
|
|
243
|
+
subscriptionId
|
|
244
|
+
};
|
|
245
|
+
postMessageToParent(unregisterMessage);
|
|
246
|
+
};
|
|
225
247
|
return {
|
|
226
248
|
spendCredits: async (options) => {
|
|
227
249
|
const { onAccept, onDecline, ...serializable } = options;
|
|
@@ -251,16 +273,18 @@
|
|
|
251
273
|
return sendMessage(message);
|
|
252
274
|
},
|
|
253
275
|
registerHandler: async (generatorId, onStatusUpdate) => {
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
276
|
+
if (generationSubscriptions.has(generatorId)) {
|
|
277
|
+
return {
|
|
278
|
+
isOk: false,
|
|
279
|
+
error: {
|
|
280
|
+
message: `AI handler for generator "${generatorId}" is already registered`,
|
|
281
|
+
name: "SdkInternalError"
|
|
282
|
+
}
|
|
260
283
|
};
|
|
261
|
-
|
|
262
|
-
|
|
284
|
+
}
|
|
285
|
+
const subscriptionId = generateMessageId();
|
|
263
286
|
generationHandlers.set(subscriptionId, onStatusUpdate);
|
|
287
|
+
generationSubscriptions.set(generatorId, subscriptionId);
|
|
264
288
|
const registerMessage = {
|
|
265
289
|
command: "ai-register-handler",
|
|
266
290
|
messageId: generateMessageId(),
|
|
@@ -271,11 +295,16 @@
|
|
|
271
295
|
const response = await sendMessage(registerMessage);
|
|
272
296
|
if (!response.isOk) {
|
|
273
297
|
generationHandlers.delete(subscriptionId);
|
|
298
|
+
generationSubscriptions.delete(generatorId);
|
|
274
299
|
return response;
|
|
275
300
|
}
|
|
276
|
-
return {
|
|
301
|
+
return {
|
|
302
|
+
isOk: true,
|
|
303
|
+
result: () => unregisterGenerationHandler(generatorId)
|
|
304
|
+
};
|
|
277
305
|
} catch {
|
|
278
306
|
generationHandlers.delete(subscriptionId);
|
|
307
|
+
generationSubscriptions.delete(generatorId);
|
|
279
308
|
return {
|
|
280
309
|
isOk: false,
|
|
281
310
|
error: {
|
|
@@ -284,6 +313,10 @@
|
|
|
284
313
|
}
|
|
285
314
|
};
|
|
286
315
|
}
|
|
316
|
+
},
|
|
317
|
+
unregisterHandler: async (generatorId) => {
|
|
318
|
+
unregisterGenerationHandler(generatorId);
|
|
319
|
+
return { isOk: true, result: void 0 };
|
|
287
320
|
}
|
|
288
321
|
};
|
|
289
322
|
}
|
|
@@ -429,8 +462,7 @@
|
|
|
429
462
|
const message = {
|
|
430
463
|
command: "auth-refresh",
|
|
431
464
|
messageId: generateMessageId(),
|
|
432
|
-
provider: request.provider
|
|
433
|
-
refresh_token: request.refresh_token
|
|
465
|
+
provider: request.provider
|
|
434
466
|
};
|
|
435
467
|
return sendMessage(message);
|
|
436
468
|
},
|
|
@@ -700,6 +732,7 @@
|
|
|
700
732
|
var bridgeHandlers = {
|
|
701
733
|
ai: createAIApiProxy(),
|
|
702
734
|
context: contextApi,
|
|
735
|
+
data: createApiProxy("data"),
|
|
703
736
|
design: createApiProxy("design"),
|
|
704
737
|
designStore: designStateApi,
|
|
705
738
|
appStore: appStateApi,
|
package/dist/sdk.d.ts
CHANGED
|
@@ -14,6 +14,16 @@ declare abstract class KittlStateStore<T extends Record<string, unknown>> {
|
|
|
14
14
|
abstract internalPatch(args: InternalPatchArgs<T>): void;
|
|
15
15
|
abstract resetWithState(state: T): void;
|
|
16
16
|
}
|
|
17
|
+
declare class SdkBadInputError extends Error {
|
|
18
|
+
readonly name: "SdkBadInputError";
|
|
19
|
+
readonly cause?: Error;
|
|
20
|
+
constructor(message: string, cause?: Error);
|
|
21
|
+
}
|
|
22
|
+
declare class SdkInternalError extends Error {
|
|
23
|
+
readonly name: "SdkInternalError";
|
|
24
|
+
readonly cause?: Error;
|
|
25
|
+
constructor(message: string, cause?: Error);
|
|
26
|
+
}
|
|
17
27
|
declare const BASIC_SHAPE_DEFAULT_VALUES: {
|
|
18
28
|
defaultIcon: LayerIconType | undefined;
|
|
19
29
|
shadowOptions?: {
|
|
@@ -193,6 +203,9 @@ declare const GUIDE_DEFAULT_VALUES: {
|
|
|
193
203
|
version: string;
|
|
194
204
|
type: ObjectType.Guide;
|
|
195
205
|
};
|
|
206
|
+
declare const GenerationOperation: {
|
|
207
|
+
readonly INPAINT: "inpaint";
|
|
208
|
+
};
|
|
196
209
|
declare const GenerationStatus: {
|
|
197
210
|
readonly CREATED: "CREATED";
|
|
198
211
|
readonly STARTED: "STARTED";
|
|
@@ -552,6 +565,11 @@ export interface AIGenerationOutputSettings {
|
|
|
552
565
|
height: number;
|
|
553
566
|
};
|
|
554
567
|
}
|
|
568
|
+
export interface AddFontStyleOptions {
|
|
569
|
+
fontFamilyId: string;
|
|
570
|
+
objectIds: string[];
|
|
571
|
+
styles: string[];
|
|
572
|
+
}
|
|
555
573
|
export interface AppStateAPI {
|
|
556
574
|
getSelectedObjectsIds(): string[];
|
|
557
575
|
setSelectedObjectsIds(ids: string[]): void;
|
|
@@ -577,6 +595,7 @@ export interface AsyncAIAPI {
|
|
|
577
595
|
spendCredits: (options: SpendCreditsOptions) => SdkResultAsync<SpendCreditsResult, Error>;
|
|
578
596
|
startGeneration: (generatorId: string, inputSettings: AIGenerationInputSettings, output: AIGenerationOutputSettings) => SdkResultAsync<StartGenerationResult, Error>;
|
|
579
597
|
registerHandler: (generatorId: string, onStatusUpdate: OnGenerationStatusUpdate) => SdkResultAsync<() => void, Error>;
|
|
598
|
+
unregisterHandler: (generatorId: string) => SdkResultAsync<void, Error>;
|
|
580
599
|
}
|
|
581
600
|
export interface AsyncAppStateAPI extends WithAsync<AppStateAPI> {
|
|
582
601
|
}
|
|
@@ -621,6 +640,8 @@ export interface AsyncBatchDesignAPI extends AsyncDesignAPI {
|
|
|
621
640
|
export interface AsyncContextAPI extends Omit<WithAsync<ContextAPI>, "subscribe"> {
|
|
622
641
|
subscribe(callback: ContextSubscriptionCallback): Promise<() => void>;
|
|
623
642
|
}
|
|
643
|
+
export interface AsyncDataAPI extends WithAsync<DataSDKApi> {
|
|
644
|
+
}
|
|
624
645
|
export interface AsyncDesignAPI extends WithAsync<WithOptsRemoved<DesignAPI>> {
|
|
625
646
|
}
|
|
626
647
|
export interface AsyncDesignStateAPI {
|
|
@@ -678,7 +699,6 @@ export interface AuthLogoutRequest {
|
|
|
678
699
|
}
|
|
679
700
|
export interface AuthRefreshRequest {
|
|
680
701
|
provider: string;
|
|
681
|
-
refresh_token: string;
|
|
682
702
|
}
|
|
683
703
|
export interface AuthStartRequest {
|
|
684
704
|
provider: string;
|
|
@@ -759,6 +779,11 @@ export interface CanvasAPI {
|
|
|
759
779
|
getPreviewImage: (id: string, options?: Partial<GetPreviewImageOptions>) => Promise<string | null>;
|
|
760
780
|
getExport: (options: GetExportOptions) => Promise<Blob | null>;
|
|
761
781
|
}
|
|
782
|
+
export interface CatalogItem {
|
|
783
|
+
id: string;
|
|
784
|
+
name: string;
|
|
785
|
+
previewImages: string[];
|
|
786
|
+
}
|
|
762
787
|
export interface ConfigAPI {
|
|
763
788
|
setConfig(config: Partial<DesignConfig>, opts?: DesignApiOptions): void;
|
|
764
789
|
}
|
|
@@ -769,6 +794,12 @@ export interface ContextAPI {
|
|
|
769
794
|
export interface ContextGetInput {
|
|
770
795
|
iframe?: Pick<HTMLIFrameElement, "getBoundingClientRect">;
|
|
771
796
|
}
|
|
797
|
+
export interface CreateFontOptions {
|
|
798
|
+
name: string;
|
|
799
|
+
files: Blob[];
|
|
800
|
+
styles: string[];
|
|
801
|
+
previewImage?: Blob;
|
|
802
|
+
}
|
|
772
803
|
export interface CreateLoadingCardInput extends CreateElementWithPositionAndSize {
|
|
773
804
|
imageGenerationId?: string;
|
|
774
805
|
startedAt?: number;
|
|
@@ -776,6 +807,10 @@ export interface CreateLoadingCardInput extends CreateElementWithPositionAndSize
|
|
|
776
807
|
generationAverageSpeed?: number;
|
|
777
808
|
name?: string;
|
|
778
809
|
}
|
|
810
|
+
export interface DataSDKApi {
|
|
811
|
+
mockups: MockupDataAPI;
|
|
812
|
+
fonts: FontDataAPI;
|
|
813
|
+
}
|
|
779
814
|
export interface DecorationOptions {
|
|
780
815
|
type: "horizontalLines" | "colorCut" | "obliqueLines" | "fadingColorCut";
|
|
781
816
|
color: string | null;
|
|
@@ -783,6 +818,10 @@ export interface DecorationOptions {
|
|
|
783
818
|
distance: number;
|
|
784
819
|
cutDistance: number;
|
|
785
820
|
}
|
|
821
|
+
export interface DeleteFontStyleOptions {
|
|
822
|
+
fontFamilyId: string;
|
|
823
|
+
id: string;
|
|
824
|
+
}
|
|
786
825
|
export interface DesignAPI {
|
|
787
826
|
shape: ShapeAPI;
|
|
788
827
|
board: BoardAPI;
|
|
@@ -840,17 +879,42 @@ export interface DragAndDropStartDragImageEventInput {
|
|
|
840
879
|
export interface ErrorGenerationResult {
|
|
841
880
|
type: typeof ResultType.ERROR;
|
|
842
881
|
message: string;
|
|
843
|
-
|
|
882
|
+
subtitle: string;
|
|
883
|
+
status: "warning" | "error";
|
|
844
884
|
}
|
|
845
885
|
export interface FontAPI {
|
|
846
886
|
createFont: (params: {
|
|
847
887
|
name: string;
|
|
848
888
|
files: Blob[];
|
|
849
889
|
styles: string[];
|
|
850
|
-
extensionId?: string;
|
|
851
890
|
previewImage?: Blob;
|
|
852
891
|
}) => SdkResultAsync<UploadedFontFamily, Error>;
|
|
853
892
|
}
|
|
893
|
+
export interface FontDataAPI {
|
|
894
|
+
listUserFonts(options?: PaginationOptions): SdkResultAsync<FontListDto>;
|
|
895
|
+
listExtensionFonts(options?: PaginationOptions): SdkResultAsync<FontListDto>;
|
|
896
|
+
get(fontFamilyId: string): SdkResultAsync<FontFamilyDto>;
|
|
897
|
+
find(ids: string[]): SdkResultAsync<FontFamilyDto[]>;
|
|
898
|
+
create(options: CreateFontOptions): SdkResultAsync<FontFamilyDto>;
|
|
899
|
+
update(options: UpdateFontFamilyOptions): SdkResultAsync<FontFamilyDto>;
|
|
900
|
+
delete(ids: string[]): SdkResultAsync<void>;
|
|
901
|
+
destroy(ids: string[]): SdkResultAsync<void>;
|
|
902
|
+
addStyle(options: AddFontStyleOptions): SdkResultAsync<FontFamilyDto>;
|
|
903
|
+
deleteStyle(options: DeleteFontStyleOptions): SdkResultAsync<void>;
|
|
904
|
+
updateStyle(options: UpdateFontStyleOptions): SdkResultAsync<void>;
|
|
905
|
+
}
|
|
906
|
+
export interface FontFamilyDto extends CatalogItem {
|
|
907
|
+
styles: FontStyleDto[];
|
|
908
|
+
extension: {
|
|
909
|
+
id: string;
|
|
910
|
+
name?: string;
|
|
911
|
+
} | null;
|
|
912
|
+
}
|
|
913
|
+
export interface FontStyleDto {
|
|
914
|
+
id: string;
|
|
915
|
+
name: string;
|
|
916
|
+
style: string | null;
|
|
917
|
+
}
|
|
854
918
|
export interface FontVariation {
|
|
855
919
|
name: string;
|
|
856
920
|
min: number;
|
|
@@ -879,6 +943,7 @@ export interface GenerationInputData {
|
|
|
879
943
|
export interface GenerationMeta {
|
|
880
944
|
generationEndsAt?: number;
|
|
881
945
|
pendingGenerationId: string;
|
|
946
|
+
operation?: GenerationOperation;
|
|
882
947
|
}
|
|
883
948
|
export interface GenerationStartedResultCommonProps {
|
|
884
949
|
generationEndsAt?: number;
|
|
@@ -900,7 +965,16 @@ export interface GetExportOptions {
|
|
|
900
965
|
height: number;
|
|
901
966
|
};
|
|
902
967
|
};
|
|
968
|
+
size?: {
|
|
969
|
+
width: number;
|
|
970
|
+
height: number;
|
|
971
|
+
unit: Unit;
|
|
972
|
+
};
|
|
973
|
+
dpi?: number;
|
|
974
|
+
colorModel?: "rgb" | "cmyk";
|
|
903
975
|
removeArtboardBackground?: boolean;
|
|
976
|
+
optimizedQuality?: boolean;
|
|
977
|
+
renderingIntent?: "download" | "pdf";
|
|
904
978
|
}
|
|
905
979
|
export interface GetObjectParams {
|
|
906
980
|
id: string;
|
|
@@ -961,6 +1035,9 @@ export interface IllustrationAPI {
|
|
|
961
1035
|
export interface ImageAPI {
|
|
962
1036
|
addImage(params: AddImageParams, opts?: DesignApiOptions): SdkResultAsync<NormalizedIllustrationImageObject, SdkError>;
|
|
963
1037
|
updateImage(params: UpdateImageParams, opts?: DesignApiOptions): NormalizedIllustrationImageObject;
|
|
1038
|
+
updateImageSource(params: UpdateImageSourceParams, opts?: DesignApiOptions): SdkResultAsync<NormalizedIllustrationImageObject, SdkError>;
|
|
1039
|
+
resetImageCrop(params: ResetImageCropParams, opts?: DesignApiOptions): SdkResultAsync<NormalizedIllustrationImageObject, SdkError>;
|
|
1040
|
+
resetImageBackgroundRemoval(params: ResetImageBackgroundRemovalParams, opts?: DesignApiOptions): SdkResultAsync<NormalizedIllustrationImageObject, SdkError>;
|
|
964
1041
|
}
|
|
965
1042
|
export interface ImageGenerationResult {
|
|
966
1043
|
type: typeof ResultType.IMAGE;
|
|
@@ -980,6 +1057,7 @@ export interface KittlSDK {
|
|
|
980
1057
|
onLoadedCallback: (() => void) | null;
|
|
981
1058
|
onReady: (cb: () => void) => void;
|
|
982
1059
|
ai: AsyncAIAPI;
|
|
1060
|
+
data: AsyncDataAPI;
|
|
983
1061
|
design: AsyncDesignAPI;
|
|
984
1062
|
designStore: AsyncDesignStateAPI;
|
|
985
1063
|
appStore: AsyncAppStateSubscriptionAPI;
|
|
@@ -1008,6 +1086,33 @@ export interface LoadingCardAPI {
|
|
|
1008
1086
|
createLoadingCard(input: CreateLoadingCardInput, opts?: DesignApiOptions): NormalizedLoadingCardObject;
|
|
1009
1087
|
updateLoadingCard(input: UpdateLoadingCardInput, opts?: DesignApiOptions): NormalizedLoadingCardObject;
|
|
1010
1088
|
}
|
|
1089
|
+
export interface MockupDataAPI {
|
|
1090
|
+
get(id: number): SdkResultAsync<CatalogItem>;
|
|
1091
|
+
getOverview(options?: Pick<PaginationOptions, "sort">): SdkResultAsync<MockupOverviewDto>;
|
|
1092
|
+
getGroup(groupId: string, options?: PaginationOptions): SdkResultAsync<MockupGroupDto>;
|
|
1093
|
+
search(query: string, options?: PaginationOptions): SdkResultAsync<PaginatedResult<CatalogItem>>;
|
|
1094
|
+
getSuggestions(): SdkResultAsync<MockupSuggestions>;
|
|
1095
|
+
}
|
|
1096
|
+
export interface MockupGroupDto {
|
|
1097
|
+
group: {
|
|
1098
|
+
id: string;
|
|
1099
|
+
name: string;
|
|
1100
|
+
};
|
|
1101
|
+
data: PaginatedResult<CatalogItem>;
|
|
1102
|
+
}
|
|
1103
|
+
export interface MockupOverviewDto {
|
|
1104
|
+
overview: MockupOverviewGroupDto[];
|
|
1105
|
+
}
|
|
1106
|
+
export interface MockupOverviewGroupDto {
|
|
1107
|
+
id: string;
|
|
1108
|
+
name: string;
|
|
1109
|
+
mockups: CatalogItem[];
|
|
1110
|
+
total: number;
|
|
1111
|
+
}
|
|
1112
|
+
export interface MockupSuggestions {
|
|
1113
|
+
tags: string[];
|
|
1114
|
+
groups: string[];
|
|
1115
|
+
}
|
|
1011
1116
|
export interface MockupboardAPI {
|
|
1012
1117
|
addMockupBoard(params: AddMockupBoardParams, opts?: DesignApiOptions): NormalizedStandardBoard<MockupBoardOptions>;
|
|
1013
1118
|
addMockupDesignObject(params: AddMockupDesignObjectParams, opts?: DesignApiOptions): NormalizedMockupDesignObject;
|
|
@@ -1027,6 +1132,17 @@ export interface ObjectAPI {
|
|
|
1027
1132
|
id: string;
|
|
1028
1133
|
};
|
|
1029
1134
|
}
|
|
1135
|
+
export interface PaginatedResult<T> {
|
|
1136
|
+
items: T[];
|
|
1137
|
+
total?: number;
|
|
1138
|
+
hasMore: boolean;
|
|
1139
|
+
}
|
|
1140
|
+
export interface PaginationOptions {
|
|
1141
|
+
take?: number;
|
|
1142
|
+
skip?: number;
|
|
1143
|
+
sort?: string;
|
|
1144
|
+
cursor?: string;
|
|
1145
|
+
}
|
|
1030
1146
|
export interface PhotoFilterOptions {
|
|
1031
1147
|
[ImageFilterType.Saturation]: {
|
|
1032
1148
|
saturation: number;
|
|
@@ -1096,16 +1212,6 @@ export interface RotateObjectParams {
|
|
|
1096
1212
|
y: OriginY;
|
|
1097
1213
|
};
|
|
1098
1214
|
}
|
|
1099
|
-
export interface SdkBadInputError extends Error {
|
|
1100
|
-
name: "SdkBadInputError";
|
|
1101
|
-
message: string;
|
|
1102
|
-
cause?: Error;
|
|
1103
|
-
}
|
|
1104
|
-
export interface SdkInternalError extends Error {
|
|
1105
|
-
name: "SdkInternalError";
|
|
1106
|
-
message: string;
|
|
1107
|
-
cause?: Error;
|
|
1108
|
-
}
|
|
1109
1215
|
export interface SetHiddenParams {
|
|
1110
1216
|
id: string;
|
|
1111
1217
|
hidden: boolean;
|
|
@@ -1186,6 +1292,15 @@ export interface TransformOptions {
|
|
|
1186
1292
|
curve?: number;
|
|
1187
1293
|
isChanging?: boolean;
|
|
1188
1294
|
}
|
|
1295
|
+
export interface UpdateFontFamilyOptions {
|
|
1296
|
+
id: string;
|
|
1297
|
+
name: string;
|
|
1298
|
+
}
|
|
1299
|
+
export interface UpdateFontStyleOptions {
|
|
1300
|
+
fontFamilyId: string;
|
|
1301
|
+
id: string;
|
|
1302
|
+
style: string;
|
|
1303
|
+
}
|
|
1189
1304
|
export interface UpdateGuideInput {
|
|
1190
1305
|
id: string;
|
|
1191
1306
|
top?: number;
|
|
@@ -1205,9 +1320,8 @@ export interface UploadAPI {
|
|
|
1205
1320
|
image: UploadImageAPI;
|
|
1206
1321
|
}
|
|
1207
1322
|
export interface UploadImageAPI {
|
|
1208
|
-
upload: ({ blob,
|
|
1323
|
+
upload: ({ blob, }: {
|
|
1209
1324
|
blob: Blob;
|
|
1210
|
-
extensionId?: string;
|
|
1211
1325
|
}) => SdkResultAsync<UserImageUpload[], Error>;
|
|
1212
1326
|
uploadTemp: ({ blob, }: {
|
|
1213
1327
|
blob: Blob;
|
|
@@ -1254,7 +1368,7 @@ export interface WithObjectLayout {
|
|
|
1254
1368
|
flipX: boolean;
|
|
1255
1369
|
flipY: boolean;
|
|
1256
1370
|
}
|
|
1257
|
-
export type AIGenerationActionOrigin = "COPILOT" | "RIGHT_PANEL" | "LEFT_PANEL" | "MICRO_APP" | "IMAGE_SETS" | "AI_CHAT" | "SMARTBOARD" | "AI_INPUT_GENERATE_IMAGE" | "AI_INPUT_REMIX_IMAGE" | "AI_INPUT_GENERATE_VIDEO" | "AI_HUB_GENERATE_IMAGE" | "AI_HUB_REMIX_IMAGE" | "AI_HUB_GENERATE_VIDEO" | "VIDEOBOARD";
|
|
1371
|
+
export type AIGenerationActionOrigin = "COPILOT" | "RIGHT_PANEL" | "LEFT_PANEL" | "MICRO_APP" | "IMAGE_SETS" | "AI_CHAT" | "SMARTBOARD" | "AI_INPUT_GENERATE_IMAGE" | "AI_INPUT_REMIX_IMAGE" | "AI_INPUT_GENERATE_VIDEO" | "AI_HUB_GENERATE_IMAGE" | "AI_HUB_REMIX_IMAGE" | "AI_HUB_GENERATE_VIDEO" | "VIDEOBOARD" | "AGENT" | "WORKFLOW";
|
|
1258
1372
|
export type AIGenerationContentType = "image" | "video";
|
|
1259
1373
|
export type AIGenerationModelTaskType = "IMAGE_TO_IMAGE" | "IMAGE_INPAINT" | "TEXT_TO_IMAGE" | "IMAGE_TO_VIDEO";
|
|
1260
1374
|
export type APIOptions<T extends Record<string, unknown>> = {
|
|
@@ -1494,8 +1608,8 @@ export type Expand<T> = T extends infer O ? {
|
|
|
1494
1608
|
} : never;
|
|
1495
1609
|
export type FillMetaTarget = "border" | "fill";
|
|
1496
1610
|
export type FlattenUnion<T> = UnionToIntersection<T extends unknown ? Partial<T> : never>;
|
|
1497
|
-
export type
|
|
1498
|
-
export type FontVariationSettings = Partial<Record<
|
|
1611
|
+
export type FontListDto = PaginatedResult<FontFamilyDto>;
|
|
1612
|
+
export type FontVariationSettings = Record<string, number> & Partial<Record<KnownFontVariationAxis, number>>;
|
|
1499
1613
|
export type FontWeight = OrAnyString<"Regular" | "Bold" | "Light" | "Medium" | "Black" | "SemiBold" | "Italic" | "ExtraLight" | "Thin" | "ExtraBold" | "LightItalic" | "MediumItalic" | "SemiBoldItalic" | "BlackItalic" | "ExtraBoldItalic" | "ThinItalic" | "ExtraLightItalic" | "BoldItalic">;
|
|
1500
1614
|
export type FullColor = {
|
|
1501
1615
|
key: "fill" | (Exclude<string, StringColorKeysType> & {});
|
|
@@ -1503,6 +1617,7 @@ export type FullColor = {
|
|
|
1503
1617
|
visible: boolean;
|
|
1504
1618
|
};
|
|
1505
1619
|
export type FunctionType = (...args: never) => unknown;
|
|
1620
|
+
export type GenerationOperation = (typeof GenerationOperation)[keyof typeof GenerationOperation];
|
|
1506
1621
|
export type GenerationStatus = (typeof GenerationStatus)[keyof typeof GenerationStatus];
|
|
1507
1622
|
export type GenerationStatusUpdate = {
|
|
1508
1623
|
generationId: string;
|
|
@@ -1551,6 +1666,7 @@ export type IllustrationProperties = {
|
|
|
1551
1666
|
strokeWidth?: IllustrationSerializedObject["strokeWidth"];
|
|
1552
1667
|
fill?: IllustrationSerializedObject["fill"];
|
|
1553
1668
|
gradients?: IllustrationSerializedObject["gradients"];
|
|
1669
|
+
generation?: IllustrationSerializedObject["generation"];
|
|
1554
1670
|
};
|
|
1555
1671
|
export type IllustrationSerializedObject = typeof ILLUSTRATION_DEFAULT_VALUES;
|
|
1556
1672
|
export type ImageProperties = {
|
|
@@ -1570,6 +1686,7 @@ export type InternalPatchArgs<T> = {
|
|
|
1570
1686
|
historyOrigin?: HistoryOrigins;
|
|
1571
1687
|
transactionMeta?: TransactionMeta;
|
|
1572
1688
|
};
|
|
1689
|
+
export type KnownFontVariationAxis = "wght" | "wdth" | "slnt" | "ital" | "opsz" | "GRAD";
|
|
1573
1690
|
export type LayerIconType = "drawIcon";
|
|
1574
1691
|
export type LayerType = Exclude<SerializableObjectType, ObjectType.Guide> | typeof structuralGroupType | typeof clippingMaskType | typeof backgroundType | typeof pathType;
|
|
1575
1692
|
export type LayersMovePosition = "before" | "after" | "into";
|
|
@@ -1780,6 +1897,12 @@ export type RenameParams = {
|
|
|
1780
1897
|
objectId: string;
|
|
1781
1898
|
newName: string;
|
|
1782
1899
|
};
|
|
1900
|
+
export type ResetImageBackgroundRemovalParams = {
|
|
1901
|
+
id: IllustrationImageSerializedObject["id"];
|
|
1902
|
+
};
|
|
1903
|
+
export type ResetImageCropParams = {
|
|
1904
|
+
id: IllustrationImageSerializedObject["id"];
|
|
1905
|
+
};
|
|
1783
1906
|
export type ResultType = (typeof ResultType)[keyof typeof ResultType];
|
|
1784
1907
|
export type RichTextBasePluginSerializedObject = {
|
|
1785
1908
|
id: string;
|
|
@@ -1994,8 +2117,9 @@ export type TextProperties = {
|
|
|
1994
2117
|
fontFamily?: string;
|
|
1995
2118
|
fontSize?: number;
|
|
1996
2119
|
fontWeight?: string;
|
|
2120
|
+
fontVariationSettings?: FontVariationSettings;
|
|
1997
2121
|
fill?: Color;
|
|
1998
|
-
textAlign?:
|
|
2122
|
+
textAlign?: TextAlign;
|
|
1999
2123
|
lineHeightValue?: LineHeight;
|
|
2000
2124
|
resizeBehavior?: "none" | "hug" | "hug-height";
|
|
2001
2125
|
charSpacing?: number;
|
|
@@ -2005,7 +2129,7 @@ export type TextProperties = {
|
|
|
2005
2129
|
angle?: number;
|
|
2006
2130
|
scaleX?: number;
|
|
2007
2131
|
scaleY?: number;
|
|
2008
|
-
stroke?: string;
|
|
2132
|
+
stroke?: string | null;
|
|
2009
2133
|
strokeWidth?: number;
|
|
2010
2134
|
};
|
|
2011
2135
|
export type TransactionMeta = {
|
|
@@ -2059,6 +2183,12 @@ export type UpdateImageParams = {
|
|
|
2059
2183
|
stroke?: IllustrationImageSerializedObject["stroke"];
|
|
2060
2184
|
strokeWidth?: IllustrationImageSerializedObject["strokeWidth"];
|
|
2061
2185
|
} & GeneratableObject;
|
|
2186
|
+
export type UpdateImageSourceParams = {
|
|
2187
|
+
id: IllustrationImageSerializedObject["id"];
|
|
2188
|
+
objectName: IllustrationImageSerializedObject["objectName"];
|
|
2189
|
+
keepObjectDimensions?: boolean;
|
|
2190
|
+
flatten?: boolean;
|
|
2191
|
+
};
|
|
2062
2192
|
export type UpdateMockupBoardParams = {
|
|
2063
2193
|
mockupBoardId: string;
|
|
2064
2194
|
size?: Dimensions;
|
|
@@ -2107,7 +2237,6 @@ export type UpdateVideoPlaylistItemParams = {
|
|
|
2107
2237
|
videoId: string;
|
|
2108
2238
|
playlistItemId: string;
|
|
2109
2239
|
playlistItem: Omit<VideoPlaylistItem, "id">;
|
|
2110
|
-
allowAspectRatioMismatch?: boolean;
|
|
2111
2240
|
};
|
|
2112
2241
|
export type UpdateVideoboardParams = {
|
|
2113
2242
|
videoBoardId: string;
|