Skip to content

Commit

Permalink
fix(dialogIds): ignore entity scoped ids from baseSDK (#863)
Browse files Browse the repository at this point in the history
  • Loading branch information
kdamball authored Jul 19, 2021
1 parent 0e9b80c commit 5f2850b
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions lib/types/api.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,8 @@ export interface AccessAPI {
canEditAppConfig: () => Promise<boolean>
}

type EntryScopedIds = 'field' | 'entry' | 'contentType'

export interface BaseExtensionSDK {
/** Exposes methods that allow the extension to read and manipulate a wide range of objects in the space. */
space: SpaceAPI
Expand All @@ -163,7 +165,7 @@ export interface BaseExtensionSDK {
/** Exposes methods for checking user's access level */
access: AccessAPI
/** Exposes relevant ids, keys may be ommited based on location */
ids: IdsAPI
ids: Omit<IdsAPI, EntryScopedIds>
/** Adapter to be injected in contentful-management client */
cmaAdapter?: Adapter
}
Expand Down Expand Up @@ -192,7 +194,7 @@ export type FieldExtensionSDK = BaseExtensionSDK &

export type DialogExtensionSDK = Omit<BaseExtensionSDK, 'ids'> & {
/** A set of IDs actual for the extension */
ids: Omit<IdsAPI, 'field' | 'entry' | 'contentType'>
ids: Omit<IdsAPI, EntryScopedIds>
/** Closes the dialog and resolves openExtension promise with data */
close: (data?: any) => void
/** Methods to update the size of the iframe the extension is contained within. */
Expand All @@ -201,12 +203,12 @@ export type DialogExtensionSDK = Omit<BaseExtensionSDK, 'ids'> & {

export type PageExtensionSDK = Omit<BaseExtensionSDK, 'ids'> & {
/** A set of IDs actual for the extension */
ids: Omit<IdsAPI, 'field' | 'entry' | 'contentType'>
ids: Omit<IdsAPI, EntryScopedIds>
}

export type AppExtensionSDK = Omit<BaseExtensionSDK, 'ids'> & {
/** A set of IDs actual for the app */
ids: Omit<IdsAPI, 'extension' | 'field' | 'entry' | 'contentType' | 'app'> & { app: string }
ids: Omit<IdsAPI, EntryScopedIds | 'extension' | 'app'> & { app: string }
app: AppConfigAPI
}

Expand Down

0 comments on commit 5f2850b

Please sign in to comment.