Skip to main content

Class: PagesService

Defined in: tanqory-platform-packages/packages/api/sdk/src/services/pages.ts:25

Extends​

  • BaseService

Constructors​

Constructor​

new PagesService(client): PagesService

Defined in: tanqory-platform-packages/packages/api/sdk/src/services/base.ts:12

Parameters​

client​

TanqoryClient

Returns​

PagesService

Inherited from​

BaseService.constructor

Properties​

client​

protected client: TanqoryClient

Defined in: tanqory-platform-packages/packages/api/sdk/src/services/base.ts:10

Inherited from​

BaseService.client

Methods​

buildQuery()​

protected buildQuery(options?): Record<string, any>

Defined in: tanqory-platform-packages/packages/api/sdk/src/services/base.ts:26

Build query parameters

Parameters​

options?​

ListOptions

Returns​

Record<string, any>

Inherited from​

BaseService.buildQuery


bulkDelete()​

bulkDelete(storeId, data): Promise<{ deleted: number; failed: number; success: boolean; }>

Defined in: tanqory-platform-packages/packages/api/sdk/src/services/pages.ts:73

Bulk delete multiple pages

Parameters​

storeId​

string

data​
ids​

string[]

Returns​

Promise<{ deleted: number; failed: number; success: boolean; }>


bulkUpdate()​

bulkUpdate(storeId, data): Promise<{ failed: number; success: boolean; updated: number; }>

Defined in: tanqory-platform-packages/packages/api/sdk/src/services/pages.ts:82

Bulk update multiple pages (e.g., publish/unpublish)

Parameters​

storeId​

string

data​
ids​

string[]

updates​

{ isPublished?: boolean; }

updates.isPublished?​

boolean

Returns​

Promise<{ failed: number; success: boolean; updated: number; }>


create()​

create(storeId, data): Promise<{ authorId?: string; content?: string; createdAt: Date; handle: string; id: string; isPublished: boolean; publishedAt?: Date; seo?: { description?: string; keywords?: string[]; title?: string; }; storeId: string; templateSuffix?: string; title: string; updatedAt: Date; }>

Defined in: tanqory-platform-packages/packages/api/sdk/src/services/pages.ts:52

Create a new page

Parameters​

storeId​

string

data​
content?​

string

handle?​

string

isPublished​

boolean

seo?​

{ description?: string; keywords?: string[]; title?: string; }

seo.description?​

string

seo.keywords?​

string[]

seo.title?​

string

templateSuffix?​

string

title​

string

Returns​

Promise<{ authorId?: string; content?: string; createdAt: Date; handle: string; id: string; isPublished: boolean; publishedAt?: Date; seo?: { description?: string; keywords?: string[]; title?: string; }; storeId: string; templateSuffix?: string; title: string; updatedAt: Date; }>


delete()​

delete(storeId, id): Promise<DeletedResponse>

Defined in: tanqory-platform-packages/packages/api/sdk/src/services/pages.ts:66

Delete a page

Parameters​

storeId​

string

id​

string

Returns​

Promise<DeletedResponse>


duplicate()​

duplicate(storeId, id): Promise<{ authorId?: string; content?: string; createdAt: Date; handle: string; id: string; isPublished: boolean; publishedAt?: Date; seo?: { description?: string; keywords?: string[]; title?: string; }; storeId: string; templateSuffix?: string; title: string; updatedAt: Date; }>

Defined in: tanqory-platform-packages/packages/api/sdk/src/services/pages.ts:105

Duplicate a page (server-side)

Parameters​

storeId​

string

id​

string

Returns​

Promise<{ authorId?: string; content?: string; createdAt: Date; handle: string; id: string; isPublished: boolean; publishedAt?: Date; seo?: { description?: string; keywords?: string[]; title?: string; }; storeId: string; templateSuffix?: string; title: string; updatedAt: Date; }>


generateIdempotencyKey()​

protected generateIdempotencyKey(prefix): string

Defined in: tanqory-platform-packages/packages/api/sdk/src/services/base.ts:19

Generate idempotency key

Parameters​

prefix​

string

Returns​

string

Inherited from​

BaseService.generateIdempotencyKey


getExportMimeType()​

protected getExportMimeType(format): string

Defined in: tanqory-platform-packages/packages/api/sdk/src/services/base.ts:45

Get MIME type for export format

Parameters​

format​

string

Returns​

string

Inherited from​

BaseService.getExportMimeType


list()​

list(storeId, params?): Promise<ListPagesResponse>

Defined in: tanqory-platform-packages/packages/api/sdk/src/services/pages.ts:29

List all pages with filtering and pagination

Parameters​

storeId​

string

params?​
isPublished?​

unknown

limit?​

number

page?​

number

string

sortBy?​

"createdAt" | "updatedAt" | "title" | "handle" | "publishedAt"

sortOrder?​

"asc" | "desc"

Returns​

Promise<ListPagesResponse>


publish()​

publish(storeId, id): Promise<{ authorId?: string; content?: string; createdAt: Date; handle: string; id: string; isPublished: boolean; publishedAt?: Date; seo?: { description?: string; keywords?: string[]; title?: string; }; storeId: string; templateSuffix?: string; title: string; updatedAt: Date; }>

Defined in: tanqory-platform-packages/packages/api/sdk/src/services/pages.ts:91

Publish a page

Parameters​

storeId​

string

id​

string

Returns​

Promise<{ authorId?: string; content?: string; createdAt: Date; handle: string; id: string; isPublished: boolean; publishedAt?: Date; seo?: { description?: string; keywords?: string[]; title?: string; }; storeId: string; templateSuffix?: string; title: string; updatedAt: Date; }>


retrieve()​

retrieve(storeId, id): Promise<{ authorId?: string; content?: string; createdAt: Date; handle: string; id: string; isPublished: boolean; publishedAt?: Date; seo?: { description?: string; keywords?: string[]; title?: string; }; storeId: string; templateSuffix?: string; title: string; updatedAt: Date; }>

Defined in: tanqory-platform-packages/packages/api/sdk/src/services/pages.ts:38

Get page by ID

Parameters​

storeId​

string

id​

string

Returns​

Promise<{ authorId?: string; content?: string; createdAt: Date; handle: string; id: string; isPublished: boolean; publishedAt?: Date; seo?: { description?: string; keywords?: string[]; title?: string; }; storeId: string; templateSuffix?: string; title: string; updatedAt: Date; }>


retrieveByHandle()​

retrieveByHandle(storeId, handle): Promise<{ authorId?: string; content?: string; createdAt: Date; handle: string; id: string; isPublished: boolean; publishedAt?: Date; seo?: { description?: string; keywords?: string[]; title?: string; }; storeId: string; templateSuffix?: string; title: string; updatedAt: Date; }>

Defined in: tanqory-platform-packages/packages/api/sdk/src/services/pages.ts:45

Get page by handle (URL slug)

Parameters​

storeId​

string

handle​

string

Returns​

Promise<{ authorId?: string; content?: string; createdAt: Date; handle: string; id: string; isPublished: boolean; publishedAt?: Date; seo?: { description?: string; keywords?: string[]; title?: string; }; storeId: string; templateSuffix?: string; title: string; updatedAt: Date; }>


unpublish()​

unpublish(storeId, id): Promise<{ authorId?: string; content?: string; createdAt: Date; handle: string; id: string; isPublished: boolean; publishedAt?: Date; seo?: { description?: string; keywords?: string[]; title?: string; }; storeId: string; templateSuffix?: string; title: string; updatedAt: Date; }>

Defined in: tanqory-platform-packages/packages/api/sdk/src/services/pages.ts:98

Unpublish a page (hide from storefront)

Parameters​

storeId​

string

id​

string

Returns​

Promise<{ authorId?: string; content?: string; createdAt: Date; handle: string; id: string; isPublished: boolean; publishedAt?: Date; seo?: { description?: string; keywords?: string[]; title?: string; }; storeId: string; templateSuffix?: string; title: string; updatedAt: Date; }>


update()​

update(storeId, id, data): Promise<{ authorId?: string; content?: string; createdAt: Date; handle: string; id: string; isPublished: boolean; publishedAt?: Date; seo?: { description?: string; keywords?: string[]; title?: string; }; storeId: string; templateSuffix?: string; title: string; updatedAt: Date; }>

Defined in: tanqory-platform-packages/packages/api/sdk/src/services/pages.ts:59

Update an existing page (partial update)

Parameters​

storeId​

string

id​

string

data​
content?​

string

handle?​

string

isPublished?​

boolean

seo?​

{ description?: string; keywords?: string[]; title?: string; }

seo.description?​

string

seo.keywords?​

string[]

seo.title?​

string

templateSuffix?​

string

title?​

string

Returns​

Promise<{ authorId?: string; content?: string; createdAt: Date; handle: string; id: string; isPublished: boolean; publishedAt?: Date; seo?: { description?: string; keywords?: string[]; title?: string; }; storeId: string; templateSuffix?: string; title: string; updatedAt: Date; }>