diff --git a/lib/space.ts b/lib/space.ts index 2cce9fc2e7..e126a009e3 100644 --- a/lib/space.ts +++ b/lib/space.ts @@ -47,6 +47,11 @@ const spaceMethods: Array = [ 'getEntityScheduledActions', 'signRequest', + + 'createTag', + 'readTags', + 'updateTag', + 'deleteTag', ] export default function createSpace( diff --git a/lib/types.ts b/lib/types.ts index 68c0ba942b..8ff8bbc7f6 100644 --- a/lib/types.ts +++ b/lib/types.ts @@ -1,4 +1,5 @@ export type EntityType = 'Entry' | 'Asset' +export type TagVisibility = 'private' | 'public' export interface SpaceMembership { sys: { @@ -30,11 +31,27 @@ export interface Items { export interface Link { sys: { id: string - type: string + type: 'Link' linkType: string } } +export interface Tag { + sys: { + type: 'Tag' + id: string + space: Link + environment: Link + createdBy: Link + updatedBy: Link + createdAt: string + updatedAt: string + version: number + visibility: 'private' | 'public' + } + name: string +} + export type CollectionResponse = { items: T[] total: number @@ -375,6 +392,11 @@ export interface SpaceAPI { getAllScheduledActions: () => Promise signRequest: (request: CanonicalRequest) => Promise> + + createTag: (id: string, name: string, visibility?: TagVisibility) => Promise + readTags: (skip: number, limit: number) => Promise> + updateTag: (id: string, name: string, version: number) => Promise + deleteTag: (id: string, version: number) => Promise } /* Locales API */ diff --git a/test/unit/space.spec.ts b/test/unit/space.spec.ts index a7501915a1..636e4a9b09 100644 --- a/test/unit/space.spec.ts +++ b/test/unit/space.spec.ts @@ -45,6 +45,11 @@ const spaceMethods = [ 'getUsers', 'signRequest', + + 'createTag', + 'readTags', + 'updateTag', + 'deleteTag', ] describe('createSpace()', () => {