@flexbe/sdk 0.2.0 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -13,6 +13,14 @@ export class Pages {
13
13
  }
14
14
  /**
15
15
  * Get list of pages for a site
16
+ * @param params - Query parameters including:
17
+ * - offset: Number of items to skip (default: 0)
18
+ * - limit: Maximum number of items to return (default: 100)
19
+ * - type: Filter by page type
20
+ * - status: Filter by page status
21
+ * - uri: Search by URI (exact match with '/' or partial match with '%word%')
22
+ * - title: Search by title
23
+ * - folderId: Filter by folder ID
16
24
  */
17
25
  getPages(params) {
18
26
  return __awaiter(this, void 0, void 0, function* () {
@@ -49,6 +57,10 @@ export class Pages {
49
57
  }
50
58
  /**
51
59
  * Update a folder's properties
60
+ * @param folderId - ID of the folder to update
61
+ * @param data - Update parameters:
62
+ * - title: New title for the folder
63
+ * - sortIndex: New position in the folder list
52
64
  */
53
65
  updateFolder(folderId, data) {
54
66
  return __awaiter(this, void 0, void 0, function* () {
@@ -58,6 +70,9 @@ export class Pages {
58
70
  }
59
71
  /**
60
72
  * Create a new folder
73
+ * @param data - Create parameters:
74
+ * - title: Title of the new folder (required)
75
+ * - sortIndex: Position in the folder list (optional)
61
76
  */
62
77
  createFolder(data) {
63
78
  return __awaiter(this, void 0, void 0, function* () {
@@ -75,4 +90,30 @@ export class Pages {
75
90
  yield this.api.delete(`/sites/:siteId:/pages-folders/${folderId}`);
76
91
  });
77
92
  }
93
+ /**
94
+ * Update a page's properties
95
+ * @param pageId - ID of the page to update
96
+ * @param data - Update parameters including:
97
+ * - status: New status for the page
98
+ * - name: New name for the page
99
+ * - uri: New URI for the page
100
+ * - language: New language for the page
101
+ * - folderId: New folder ID for the page
102
+ * - sortIndex: New position in the page list
103
+ * - meta: Meta information for the page:
104
+ * - title: Page title
105
+ * - description: Meta description for SEO
106
+ * - keywords: Meta keywords for SEO
107
+ * - ogImage: Open Graph image URL for social sharing
108
+ * - ogTitle: Open Graph title for social sharing
109
+ * - ogDescription: Open Graph description for social sharing
110
+ * - noindex: Whether to prevent search engine indexing
111
+ * - grid: Grid configuration for the page
112
+ */
113
+ updatePage(pageId, data) {
114
+ return __awaiter(this, void 0, void 0, function* () {
115
+ const response = yield this.api.put(`/sites/:siteId:/pages/${pageId}`, data);
116
+ return response.data;
117
+ });
118
+ }
78
119
  }
@@ -7,6 +7,14 @@ class Pages {
7
7
  }
8
8
  /**
9
9
  * Get list of pages for a site
10
+ * @param params - Query parameters including:
11
+ * - offset: Number of items to skip (default: 0)
12
+ * - limit: Maximum number of items to return (default: 100)
13
+ * - type: Filter by page type
14
+ * - status: Filter by page status
15
+ * - uri: Search by URI (exact match with '/' or partial match with '%word%')
16
+ * - title: Search by title
17
+ * - folderId: Filter by folder ID
10
18
  */
11
19
  async getPages(params) {
12
20
  const response = await this.api.get('/sites/:siteId:/pages', { params });
@@ -35,6 +43,10 @@ class Pages {
35
43
  }
36
44
  /**
37
45
  * Update a folder's properties
46
+ * @param folderId - ID of the folder to update
47
+ * @param data - Update parameters:
48
+ * - title: New title for the folder
49
+ * - sortIndex: New position in the folder list
38
50
  */
39
51
  async updateFolder(folderId, data) {
40
52
  const response = await this.api.patch(`/sites/:siteId:/pages-folders/${folderId}`, data);
@@ -42,6 +54,9 @@ class Pages {
42
54
  }
43
55
  /**
44
56
  * Create a new folder
57
+ * @param data - Create parameters:
58
+ * - title: Title of the new folder (required)
59
+ * - sortIndex: Position in the folder list (optional)
45
60
  */
46
61
  async createFolder(data) {
47
62
  const response = await this.api.post('/sites/:siteId:/pages-folders', data);
@@ -55,5 +70,29 @@ class Pages {
55
70
  async deleteFolder(folderId) {
56
71
  await this.api.delete(`/sites/:siteId:/pages-folders/${folderId}`);
57
72
  }
73
+ /**
74
+ * Update a page's properties
75
+ * @param pageId - ID of the page to update
76
+ * @param data - Update parameters including:
77
+ * - status: New status for the page
78
+ * - name: New name for the page
79
+ * - uri: New URI for the page
80
+ * - language: New language for the page
81
+ * - folderId: New folder ID for the page
82
+ * - sortIndex: New position in the page list
83
+ * - meta: Meta information for the page:
84
+ * - title: Page title
85
+ * - description: Meta description for SEO
86
+ * - keywords: Meta keywords for SEO
87
+ * - ogImage: Open Graph image URL for social sharing
88
+ * - ogTitle: Open Graph title for social sharing
89
+ * - ogDescription: Open Graph description for social sharing
90
+ * - noindex: Whether to prevent search engine indexing
91
+ * - grid: Grid configuration for the page
92
+ */
93
+ async updatePage(pageId, data) {
94
+ const response = await this.api.put(`/sites/:siteId:/pages/${pageId}`, data);
95
+ return response.data;
96
+ }
58
97
  }
59
98
  exports.Pages = Pages;
@@ -4,6 +4,14 @@ export class Pages {
4
4
  }
5
5
  /**
6
6
  * Get list of pages for a site
7
+ * @param params - Query parameters including:
8
+ * - offset: Number of items to skip (default: 0)
9
+ * - limit: Maximum number of items to return (default: 100)
10
+ * - type: Filter by page type
11
+ * - status: Filter by page status
12
+ * - uri: Search by URI (exact match with '/' or partial match with '%word%')
13
+ * - title: Search by title
14
+ * - folderId: Filter by folder ID
7
15
  */
8
16
  async getPages(params) {
9
17
  const response = await this.api.get('/sites/:siteId:/pages', { params });
@@ -32,6 +40,10 @@ export class Pages {
32
40
  }
33
41
  /**
34
42
  * Update a folder's properties
43
+ * @param folderId - ID of the folder to update
44
+ * @param data - Update parameters:
45
+ * - title: New title for the folder
46
+ * - sortIndex: New position in the folder list
35
47
  */
36
48
  async updateFolder(folderId, data) {
37
49
  const response = await this.api.patch(`/sites/:siteId:/pages-folders/${folderId}`, data);
@@ -39,6 +51,9 @@ export class Pages {
39
51
  }
40
52
  /**
41
53
  * Create a new folder
54
+ * @param data - Create parameters:
55
+ * - title: Title of the new folder (required)
56
+ * - sortIndex: Position in the folder list (optional)
42
57
  */
43
58
  async createFolder(data) {
44
59
  const response = await this.api.post('/sites/:siteId:/pages-folders', data);
@@ -52,4 +67,28 @@ export class Pages {
52
67
  async deleteFolder(folderId) {
53
68
  await this.api.delete(`/sites/:siteId:/pages-folders/${folderId}`);
54
69
  }
70
+ /**
71
+ * Update a page's properties
72
+ * @param pageId - ID of the page to update
73
+ * @param data - Update parameters including:
74
+ * - status: New status for the page
75
+ * - name: New name for the page
76
+ * - uri: New URI for the page
77
+ * - language: New language for the page
78
+ * - folderId: New folder ID for the page
79
+ * - sortIndex: New position in the page list
80
+ * - meta: Meta information for the page:
81
+ * - title: Page title
82
+ * - description: Meta description for SEO
83
+ * - keywords: Meta keywords for SEO
84
+ * - ogImage: Open Graph image URL for social sharing
85
+ * - ogTitle: Open Graph title for social sharing
86
+ * - ogDescription: Open Graph description for social sharing
87
+ * - noindex: Whether to prevent search engine indexing
88
+ * - grid: Grid configuration for the page
89
+ */
90
+ async updatePage(pageId, data) {
91
+ const response = await this.api.put(`/sites/:siteId:/pages/${pageId}`, data);
92
+ return response.data;
93
+ }
55
94
  }
@@ -1,10 +1,18 @@
1
- import { Page, GetPagesParams, PageListResponse, PageFolder, PageFolderListResponse, UpdateFolderParams, CreateFolderParams } from '../types/pages';
1
+ import { Page, GetPagesParams, PageListResponse, PageFolder, PageFolderListResponse, UpdateFolderParams, CreateFolderParams, UpdatePageParams } from '../types/pages';
2
2
  import { ApiClient } from './api-client';
3
3
  export declare class Pages {
4
4
  private readonly api;
5
5
  constructor(api: ApiClient);
6
6
  /**
7
7
  * Get list of pages for a site
8
+ * @param params - Query parameters including:
9
+ * - offset: Number of items to skip (default: 0)
10
+ * - limit: Maximum number of items to return (default: 100)
11
+ * - type: Filter by page type
12
+ * - status: Filter by page status
13
+ * - uri: Search by URI (exact match with '/' or partial match with '%word%')
14
+ * - title: Search by title
15
+ * - folderId: Filter by folder ID
8
16
  */
9
17
  getPages(params?: GetPagesParams): Promise<PageListResponse>;
10
18
  /**
@@ -21,10 +29,17 @@ export declare class Pages {
21
29
  getFolder(folderId: number): Promise<PageFolder>;
22
30
  /**
23
31
  * Update a folder's properties
32
+ * @param folderId - ID of the folder to update
33
+ * @param data - Update parameters:
34
+ * - title: New title for the folder
35
+ * - sortIndex: New position in the folder list
24
36
  */
25
37
  updateFolder(folderId: number, data: UpdateFolderParams): Promise<PageFolder>;
26
38
  /**
27
39
  * Create a new folder
40
+ * @param data - Create parameters:
41
+ * - title: Title of the new folder (required)
42
+ * - sortIndex: Position in the folder list (optional)
28
43
  */
29
44
  createFolder(data: CreateFolderParams): Promise<PageFolder>;
30
45
  /**
@@ -33,4 +48,25 @@ export declare class Pages {
33
48
  * @throws {ForbiddenException} When the folder does not belong to the site
34
49
  */
35
50
  deleteFolder(folderId: number): Promise<void>;
51
+ /**
52
+ * Update a page's properties
53
+ * @param pageId - ID of the page to update
54
+ * @param data - Update parameters including:
55
+ * - status: New status for the page
56
+ * - name: New name for the page
57
+ * - uri: New URI for the page
58
+ * - language: New language for the page
59
+ * - folderId: New folder ID for the page
60
+ * - sortIndex: New position in the page list
61
+ * - meta: Meta information for the page:
62
+ * - title: Page title
63
+ * - description: Meta description for SEO
64
+ * - keywords: Meta keywords for SEO
65
+ * - ogImage: Open Graph image URL for social sharing
66
+ * - ogTitle: Open Graph title for social sharing
67
+ * - ogDescription: Open Graph description for social sharing
68
+ * - noindex: Whether to prevent search engine indexing
69
+ * - grid: Grid configuration for the page
70
+ */
71
+ updatePage(pageId: number, data: UpdatePageParams): Promise<Page>;
36
72
  }
@@ -1,4 +1,33 @@
1
1
  import { Pagination } from './index';
2
+ export interface GridConfig {
3
+ color?: string;
4
+ desktop?: {
5
+ columns: number;
6
+ containerWidth: number;
7
+ columnWidth: number;
8
+ gap: number;
9
+ };
10
+ mobile?: {
11
+ columns: number;
12
+ containerWidth: number;
13
+ columnWidth: number;
14
+ gap: number;
15
+ };
16
+ }
17
+ export interface Screenshot {
18
+ id: number | null;
19
+ ext: string;
20
+ url: string | null;
21
+ }
22
+ export interface PageMeta {
23
+ title: string | null;
24
+ description: string | null;
25
+ keywords: string | null;
26
+ ogImage: string | null;
27
+ ogTitle: string | null;
28
+ ogDescription: string | null;
29
+ noindex: boolean;
30
+ }
2
31
  export declare enum PageType {
3
32
  PAGE = "page",
4
33
  FILE = "file",
@@ -16,24 +45,29 @@ export declare enum PageStatus {
16
45
  export interface Page {
17
46
  id: number;
18
47
  type: PageType;
19
- uri: string;
20
- title: string | null;
21
48
  status: PageStatus;
22
- updatedAt?: Date;
23
- imgId: number | null;
24
- folderId: number | null;
49
+ name: string;
50
+ uri: string | null;
51
+ language: string;
52
+ folderId: number;
25
53
  sortIndex: number;
54
+ updatedAt?: Date;
55
+ deletedAt: Date | null;
56
+ screenshot: Screenshot | null;
57
+ meta: PageMeta | null;
58
+ grid?: GridConfig;
26
59
  }
27
60
  export interface GetPagesParams {
28
61
  offset?: number;
29
62
  limit?: number;
30
63
  type?: PageType;
31
64
  status?: PageStatus;
32
- search?: string;
65
+ uri?: string;
66
+ title?: string;
33
67
  folderId?: number;
34
68
  }
35
69
  export interface PageListResponse {
36
- pages: Page[];
70
+ list: Page[];
37
71
  pagination: Pagination;
38
72
  }
39
73
  export interface PageFolder {
@@ -42,7 +76,7 @@ export interface PageFolder {
42
76
  sortIndex: number;
43
77
  }
44
78
  export interface PageFolderListResponse {
45
- folders: PageFolder[];
79
+ list: PageFolder[];
46
80
  }
47
81
  export interface UpdateFolderParams {
48
82
  title?: string;
@@ -52,3 +86,35 @@ export interface CreateFolderParams {
52
86
  title: string;
53
87
  sortIndex?: number;
54
88
  }
89
+ export interface UpdatePageParams {
90
+ status?: PageStatus;
91
+ name?: string;
92
+ uri?: string;
93
+ language?: string;
94
+ folderId?: number;
95
+ sortIndex?: number;
96
+ meta?: {
97
+ title?: string;
98
+ description?: string;
99
+ keywords?: string;
100
+ ogImage?: string;
101
+ ogTitle?: string;
102
+ ogDescription?: string;
103
+ noindex?: boolean;
104
+ };
105
+ grid?: {
106
+ color?: string;
107
+ desktop?: {
108
+ columns: number;
109
+ containerWidth: number;
110
+ columnWidth: number;
111
+ gap: number;
112
+ };
113
+ mobile?: {
114
+ columns: number;
115
+ containerWidth: number;
116
+ columnWidth: number;
117
+ gap: number;
118
+ };
119
+ };
120
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flexbe/sdk",
3
- "version": "0.2.0",
3
+ "version": "0.2.2",
4
4
  "description": "TypeScript SDK for Flexbe API",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",