-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: expose cma in the sdk [EXT-3599] (#1536)
* feat(cma): expose cma in the sdk [EXT-3599] * fix api spec * change plainclient to cma client * add test * changes to correct typing * move contentful-management from peer to direct dependency * fix: use correct plain client type * fix: import correct type * chore: cleanup * revert: client types * chore: remove contentful-management from dev dependencies --------- Co-authored-by: Mitch Goudy <mgoudy91@gmail.com> Co-authored-by: Yuri Mazursky <colomolo@users.noreply.github.com>
- Loading branch information
1 parent
c378eaf
commit 942c5e0
Showing
7 changed files
with
77 additions
and
86 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { createClient } from 'contentful-management' | ||
import { createAdapter } from './cmaAdapter' | ||
import { CMAClient } from './types/cmaClient.types' | ||
import type { IdsAPI } from './types/api.types' | ||
import type { Channel } from './channel' | ||
|
||
export function createCMAClient(ids: IdsAPI, channel: Channel): CMAClient { | ||
return createClient( | ||
{ apiAdapter: createAdapter(channel) }, | ||
{ | ||
type: 'plain', | ||
defaults: { | ||
environmentId: ids.environmentAlias ?? ids.environment, | ||
spaceId: ids.space, | ||
organizationId: ids.organization, | ||
}, | ||
} | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.