@flexbe/sdk 0.2.1 → 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.
@@ -90,4 +90,30 @@ export class Pages {
90
90
  yield this.api.delete(`/sites/:siteId:/pages-folders/${folderId}`);
91
91
  });
92
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
+ }
93
119
  }
@@ -70,5 +70,29 @@ class Pages {
70
70
  async deleteFolder(folderId) {
71
71
  await this.api.delete(`/sites/:siteId:/pages-folders/${folderId}`);
72
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
+ }
73
97
  }
74
98
  exports.Pages = Pages;
@@ -67,4 +67,28 @@ export class Pages {
67
67
  async deleteFolder(folderId) {
68
68
  await this.api.delete(`/sites/:siteId:/pages-folders/${folderId}`);
69
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
+ }
70
94
  }
@@ -1,4 +1,4 @@
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;
@@ -48,4 +48,25 @@ export declare class Pages {
48
48
  * @throws {ForbiddenException} When the folder does not belong to the site
49
49
  */
50
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>;
51
72
  }
@@ -67,7 +67,7 @@ export interface GetPagesParams {
67
67
  folderId?: number;
68
68
  }
69
69
  export interface PageListResponse {
70
- pages: Page[];
70
+ list: Page[];
71
71
  pagination: Pagination;
72
72
  }
73
73
  export interface PageFolder {
@@ -76,7 +76,7 @@ export interface PageFolder {
76
76
  sortIndex: number;
77
77
  }
78
78
  export interface PageFolderListResponse {
79
- folders: PageFolder[];
79
+ list: PageFolder[];
80
80
  }
81
81
  export interface UpdateFolderParams {
82
82
  title?: string;
@@ -86,3 +86,35 @@ export interface CreateFolderParams {
86
86
  title: string;
87
87
  sortIndex?: number;
88
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.1",
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",