Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/angry-lemons-relate.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@frontify/app-bridge-app": patch
---

feat: add closeApp command and refactor previous command
7 changes: 4 additions & 3 deletions packages/app-bridge-app/src/AppBridgePlatformApp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {

import { InitializationError } from './errors';
import { type ApiMethodRegistry } from './registries';
import { type UploadAssetFromUrlPayload } from './registries/command/uploadAssetFromUrl.ts';
import { type UploadAssetToChooserPayload } from './registries/command/uploadAssetToChooser.ts';
import { openConnection } from './registries/commands.ts';
import {
type PlatformAppApiHandlerParameter,
Expand Down Expand Up @@ -43,11 +43,12 @@ export type PlatformAppApiMethod = PlatformAppApiMethodNameValidator<

export type PlatformAppCommandRegistry = PlatformAppCommandNameValidator<{
openConnection: { payload: void };
uploadAssetFromUrl: { payload: UploadAssetFromUrlPayload };
closeApp: { payload: void };
uploadAssetToChooser: { payload: UploadAssetToChooserPayload };
}>;

export type PlatformAppCommand = PlatformAppCommandNameValidator<
Pick<PlatformAppCommandRegistry, 'openConnection' | 'uploadAssetFromUrl'>
Pick<PlatformAppCommandRegistry, 'openConnection' | 'uploadAssetToChooser' | 'closeApp'>
>;

export type PlatformAppState = {
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/* (c) Copyright Frontify Ltd., all rights reserved. */

/**
* Payload for the `uploadAssetToChooser` command.
*
* **Important:** This command only works when the user has the Asset Chooser open.
* It relies on the Asset Chooser's events to place the asset at the location
* where the Asset Chooser was opened.
*/
export type UploadAssetToChooserPayload = { data: File | Blob | string; filename: string };