@garchicms/garchi-node-sdk 0.0.9 → 0.0.10
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.
- package/README.md +36 -0
- package/dist/index.cjs +28 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +57 -1
- package/dist/index.d.ts +57 -1
- package/dist/index.js +28 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -97,6 +97,8 @@ Each module corresponds to a specific API group:
|
|
|
97
97
|
- garchi.dataItem.filter() corresponds to [Filter data items API](https://garchi.co.uk/docs/v2#item-POSTapi-v2-items-filter)
|
|
98
98
|
- garchi.dataItem.filterByMeta() corresponds to [Filter data items by meta information API](https://garchi.co.uk/docs/v2#item-POSTapi-v2-items-filter-bymeta)
|
|
99
99
|
- garchi.dataItem.getByIds() corresponds to [Get data items by IDs API](https://garchi.co.uk/docs/v2#item-POSTapi-v2-items-byids)
|
|
100
|
+
- garchi.dataItem.query() corresponds to [Query items API](https://garchi.co.uk/docs/v2#item-POSTapi-v2-space--uid--items-query)
|
|
101
|
+
- garchi.dataItem.getChildren() corresponds to [List the items inside an item API](https://garchi.co.uk/docs/v2#item-GETapi-v2-space--uid--items--item--children)
|
|
100
102
|
|
|
101
103
|
|
|
102
104
|
- garchi.category → Category API
|
|
@@ -160,6 +162,40 @@ const newItem = await garchi.dataItem.create({
|
|
|
160
162
|
const items = await client.dataItem.getAll({ size: 10 });
|
|
161
163
|
```
|
|
162
164
|
|
|
165
|
+
#### Query items by their fields and metadata
|
|
166
|
+
|
|
167
|
+
```typescript
|
|
168
|
+
const items = await garchi.dataItem.query({
|
|
169
|
+
uid: 'your_space_uid',
|
|
170
|
+
where: {
|
|
171
|
+
all: [
|
|
172
|
+
{ field: 'meta.color', op: 'in', value: ['red', 'blue'] },
|
|
173
|
+
{ field: 'price', op: 'lte', value: 50 },
|
|
174
|
+
],
|
|
175
|
+
},
|
|
176
|
+
sort: [{ field: 'price', direction: 'asc' }],
|
|
177
|
+
size: 20,
|
|
178
|
+
});
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
#### Items inside items (variants, lessons)
|
|
182
|
+
|
|
183
|
+
A data item can sit inside another one, such as a variant inside its product or a lesson inside its course. Every item has `parent_id` and `children_count`; pass `children: 'include'` to get the items inside as well.
|
|
184
|
+
|
|
185
|
+
```typescript
|
|
186
|
+
// The published items inside a product, in their order
|
|
187
|
+
const variants = await garchi.dataItem.getChildren({ uid: 'your_space_uid', item: 'oak-table' });
|
|
188
|
+
|
|
189
|
+
// A product with its variants in one call
|
|
190
|
+
const product = await garchi.dataItem.get({ item: 'oak-table', children: 'include' });
|
|
191
|
+
|
|
192
|
+
// Create a variant inside a product
|
|
193
|
+
await garchi.dataItem.create({ space_uid: 'your_space_uid', name: 'Oak table - large', categories: [1], parent_id: 48 });
|
|
194
|
+
|
|
195
|
+
// Top-level items only
|
|
196
|
+
const topLevel = await garchi.dataItem.query({ uid: 'your_space_uid', where: { field: 'parent_id', op: 'not_exists' } });
|
|
197
|
+
```
|
|
198
|
+
|
|
163
199
|
### Category API
|
|
164
200
|
|
|
165
201
|
#### Create a Category
|
package/dist/index.cjs
CHANGED
|
@@ -255,6 +255,34 @@ var DataItem = class extends APIClient_default {
|
|
|
255
255
|
throw error.response?.data || new Error("Network Error");
|
|
256
256
|
}
|
|
257
257
|
}
|
|
258
|
+
/**
|
|
259
|
+
* Query the published items of a space with conditions on their fields and
|
|
260
|
+
* metadata, including nested JSON values. See the API docs for the operators.
|
|
261
|
+
*/
|
|
262
|
+
async query(params) {
|
|
263
|
+
try {
|
|
264
|
+
const { uid, ...body } = params;
|
|
265
|
+
const response = await this.client.post(`/space/${uid}/items/query`, body);
|
|
266
|
+
return response.data;
|
|
267
|
+
} catch (error) {
|
|
268
|
+
throw error.response?.data || new Error("Network Error");
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
/**
|
|
272
|
+
* The published items inside an item (variants of a product, lessons of a
|
|
273
|
+
* course), in their order. The parent itself must be published.
|
|
274
|
+
*/
|
|
275
|
+
async getChildren(params) {
|
|
276
|
+
try {
|
|
277
|
+
const { uid, item, ...query } = params;
|
|
278
|
+
const response = await this.client.get(`/space/${uid}/items/${encodeURIComponent(String(item))}/children`, {
|
|
279
|
+
params: query
|
|
280
|
+
});
|
|
281
|
+
return response.data;
|
|
282
|
+
} catch (error) {
|
|
283
|
+
throw error.response?.data || new Error("Network Error");
|
|
284
|
+
}
|
|
285
|
+
}
|
|
258
286
|
};
|
|
259
287
|
var DataItem_default = DataItem;
|
|
260
288
|
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts","../src/services/APIClient.ts","../src/services/api-wrappers/Category.ts","../src/services/api-wrappers/CompoundQuery.ts","../src/services/api-wrappers/DataItem.ts","../src/services/api-wrappers/Headless.ts","../src/services/api-wrappers/Reaction.ts","../src/services/api-wrappers/Review.ts","../src/services/api-wrappers/Space.ts","../src/services/GarchiCMS.ts"],"sourcesContent":["import GarchiCMS from \"./services/GarchiCMS\";\n\n\n\nexport default GarchiCMS;\n\n\nexport * from \"./types/index\";\n\n","import axios, { AxiosInstance } from \"axios\";\nimport { GarchiCMSInitOptions } from \"../types\";\n\nclass APIClient {\n\n client: AxiosInstance\n\n\n constructor(options: GarchiCMSInitOptions | null) {\n \n this.client = axios.create({\n baseURL: \"https://garchi.co.uk/api/v2\",\n headers: {\n \"Content-Type\": \"application/json\",\n \"Accept\": \"application/json\",\n \"Authorization\": `Bearer ${options?.api_key || process.env.GARCHI_API_KEY}`,\n ...options?.headers\n }\n })\n\n }\n}\n\nexport default APIClient;","import { CreateCategoryParams, DeleteCategoryParams, GarchiCategory, UpdateCategoryParams } from \"../../types\";\nimport APIClient from \"../APIClient\";\n\nclass Category extends APIClient {\n\n async create(params: CreateCategoryParams) : Promise<GarchiCategory> {\n try {\n const response = await this.client.post(\"/category\", params);\n let data = response.data as {\n data: GarchiCategory\n }\n return data.data;\n } catch (error: any) {\n throw error.response?.data || new Error(\"Network Error\");\n }\n }\n\n async delete(params: DeleteCategoryParams) : Promise<string> {\n try {\n const response = await this.client.post(`/delete/category/${params.space_uid}/${params.category_id}`);\n const data = response.data as {\n data: string\n }\n return data.data;\n }\n catch (error: any) {\n throw error.response?.data || new Error(\"Network Error\");\n }\n }\n\n async update(params: UpdateCategoryParams) : Promise<string> {\n try {\n const response = await this.client.post(`/update/category/${params.category_id}`, {\n space_uid: params.space_uid,\n category: params.category\n });\n const data = response.data as {\n data: string\n }\n return data.data;\n }\n catch (error: any) {\n throw error.response?.data || new Error(\"Network Error\");\n }\n }\n\n async getAll() : Promise<GarchiCategory[]> {\n try {\n const response = await this.client.get(\"/categories\");\n const data = response.data as {\n data: GarchiCategory[]\n }\n return data.data;\n }\n catch (error: any) {\n throw error.response?.data || new Error(\"Network Error\");\n }\n }\n}\n\nexport default Category;","import { CompoundQueryBody, GarchiCategoryAPIResponse, GarchiItemAPIResponse, GarchiReview, ItemsQueryParams, PaginatedResponse } from \"../../types\";\nimport APIClient from \"../APIClient\";\n\nclass CompoundQuery extends APIClient {\n async query(body: CompoundQueryBody, params: ItemsQueryParams) : Promise<GarchiItemAPIResponse | GarchiCategoryAPIResponse | \n PaginatedResponse<GarchiReview>>\n {\n try {\n const response = await this.client.post(`/compound_query`, body, {\n params\n });\n return response.data as GarchiItemAPIResponse | GarchiCategoryAPIResponse | PaginatedResponse<GarchiReview>;\n } catch (error: any) {\n throw error.response?.data || new Error(\"Network Error\");\n }\n }\n} \n\nexport default CompoundQuery;","\n\nimport { CreateDataItemParams, CreateMetaInfoParams, DeleteDataItemParams, DeleteMetaInfoParams, FilterItemsByMetaParams, FilterItemsParams, GarchiItem, GarchiItemAPIResponse, GarchiItemMeta, GetAllItemsParams, GetFeaturedItemsParams, GetItemParams, GetItemsByIdsParams, GetItemsBySpaceParams, SemanticSearchParams, UpdateDataItemParams, UpdateMetaInfoParams } from \"../../types\";\nimport APIClient from \"../APIClient\";\n\nclass DataItem extends APIClient {\n\n\n async create(params: CreateDataItemParams): Promise<GarchiItem> {\n try {\n const response = await this.client.post(\"/item\", params);\n let data = response.data as {\n data: GarchiItem\n }\n return data.data;\n } catch (error: any) {\n throw error.response?.data || new Error(\"Network Error\");\n }\n }\n\n async delete(params: DeleteDataItemParams): Promise<string> {\n try {\n const response = await this.client.post(`/delete/item`, params);\n const data = response.data as {\n data: string\n }\n return data.data;\n } catch (error: any) {\n throw error.response?.data || new Error(\"Network Error\");\n }\n }\n\n\n async update(params: UpdateDataItemParams): Promise<string> {\n try {\n const response = await this.client.post(`/update/item`, params);\n const data = response.data as {\n data: string\n }\n return data.data;\n } catch (error: any) {\n throw error.response?.data || new Error(\"Network Error\");\n }\n }\n\n async createMetaInfo(params: CreateMetaInfoParams): Promise<GarchiItemMeta[]> {\n try {\n const response = await this.client.post(`/item_meta`, params);\n const data = response.data as {\n data: GarchiItemMeta[]\n }\n return data.data;\n }\n catch (error: any) {\n throw error.response?.data || new Error(\"Network Error\");\n }\n }\n\n async deleteMetaInfo(params: DeleteMetaInfoParams): Promise<string> {\n try {\n const response = await this.client.post(`/delete/item_meta`, params);\n const data = response.data as {\n data: string\n }\n return data.data;\n } catch (error: any) {\n throw error.response?.data || new Error(\"Network Error\");\n }\n }\n\n async updateMetaInfo(params: UpdateMetaInfoParams): Promise<string> {\n try {\n const response = await this.client.post(`/update/item_meta`, params);\n const data = response.data as {\n data: string\n }\n return data.data;\n } catch (error: any) {\n throw error.response?.data || new Error(\"Network Error\");\n }\n }\n\n async getBySpace(params: GetItemsBySpaceParams): Promise<GarchiItemAPIResponse> {\n try {\n const response = await this.client.get(`/space/${params.uid}/items`, {\n params: params\n });\n const data = response.data as GarchiItemAPIResponse;\n return data;\n }\n catch (error: any) {\n throw error.response?.data || new Error(\"Network Error\");\n }\n }\n\n async semanticSearch(params: SemanticSearchParams): Promise<GarchiItem[]> {\n try {\n const response = await this.client.get(`/items/semantic-search`, {\n params: params\n });\n const data = response.data as GarchiItemAPIResponse;\n return data.data;\n }\n catch (error: any) {\n throw error.response?.data || new Error(\"Network Error\");\n }\n }\n\n async featured(params: GetFeaturedItemsParams) : Promise<GarchiItemAPIResponse> {\n try {\n const response = await this.client.get(`/items/featured`, {\n params: params\n });\n const data = response.data as GarchiItemAPIResponse;\n return data;\n }\n catch (error: any) {\n throw error.response?.data || new Error(\"Network Error\");\n }\n }\n\n async get(params: GetItemParams): Promise<GarchiItem> {\n try {\n const response = await this.client.get(`/item/${params.item}`, {\n params: params,\n });\n const data = response.data as GarchiItemAPIResponse\n return data.data[0] as GarchiItem;\n }\n catch (error: any) {\n throw error.response?.data || new Error(\"Network Error\");\n }\n }\n\n\n async getAll(params: GetAllItemsParams): Promise<GarchiItemAPIResponse> {\n try {\n const response = await this.client.get(`/items`, {\n params: params\n });\n const data = response.data as GarchiItemAPIResponse;\n return data;\n }\n catch (error: any) {\n throw error.response?.data || new Error(\"Network Error\");\n\n }\n }\n\n async filter(params: FilterItemsParams) : Promise<GarchiItem[]> {\n try {\n const response = await this.client.post(`/items/filter`, params.body, {\n params: params.query\n });\n const data = response.data as GarchiItemAPIResponse;\n return data.data;\n }\n catch (error: any) {\n throw error.response?.data || new Error(\"Network Error\");\n }\n\n }\n\n async filterByMeta(params: FilterItemsByMetaParams) : Promise<GarchiItem[]> {\n try {\n const response = await this.client.post(`/items/filter/bymeta`, params.body, {\n params: params.query\n });\n const data = response.data as GarchiItemAPIResponse;\n return data.data;\n }\n catch (error: any) {\n throw error.response?.data || new Error(\"Network Error\");\n }\n }\n\n async getByIds(params: GetItemsByIdsParams) : Promise<GarchiItemAPIResponse> {\n try {\n const response = await this.client.post(`/items/byids`, params.body, {\n params: params.query\n });\n const data = response.data as GarchiItemAPIResponse;\n return data;\n }\n catch (error: any) {\n throw error.response?.data || new Error(\"Network Error\");\n }\n }\n}\n\n\nexport default DataItem;","import { BlankSectionRequest, BlankSectionResponse, CreateOrUpdateSectionTemplateParams, CreatePageRequest, CreatePageResponse, GarchiAsset, GarchiPage, GetPageParams } from \"../../types\";\nimport APIClient from \"../APIClient\";\n\nclass Headless extends APIClient {\n\n async getAsset(file_name: string, space_uid: string) : Promise<GarchiAsset> {\n try {\n const response = await this.client.get(`/space/assets/${file_name}`, {\n params: {\n space_uid\n }\n });\n return response.data as GarchiAsset;\n } catch (error: any) {\n throw error.response?.data || new Error(\"Network Error\");\n }\n }\n\n async getPage(params: GetPageParams) : Promise<GarchiPage> {\n try {\n const response = await this.client.post(`/page`, params);\n return response.data as GarchiPage;\n }\n catch (error: any) {\n throw error.response?.data || new Error(\"Network Error\");\n }\n }\n\n async createOrUpdateSectionTemplates(params: CreateOrUpdateSectionTemplateParams) : Promise<string> {\n try {\n const response = await this.client.post(`/section_template`, params);\n return response.data as string;\n }\n catch (error: any) {\n throw error.response?.data || new Error(\"Network Error\");\n }\n }\n\n async addPage(params: CreatePageRequest) : Promise<CreatePageResponse>\n {\n try {\n const response = await this.client.post(`/space/${params.space_uid}/create_page`, {\n title: params.title,\n path: params.path,\n description: params.description,\n })\n return response.data as CreatePageResponse;\n }\n catch (error: any) {\n throw error.response?.data || new Error(\"Network Error\");\n }\n }\n\n async addBlankSectionToPage(params: BlankSectionRequest) : Promise<BlankSectionResponse>\n {\n try {\n const response = await this.client.post('/page/add_blank_section', {\n section_template_id: params.section_template_id,\n parent_id: params.parent_id,\n page_id: params.page_id,\n })\n return response.data as BlankSectionResponse;\n }\n catch (error: any) {\n throw error.response?.data || new Error(\"Network Error\");\n }\n }\n \n \n}\n\nexport default Headless;","import { GarchiReaction, GarchiReactionCreate } from \"../../types\";\nimport APIClient from \"../APIClient\";\n\nclass Reaction extends APIClient {\n async manage(params: GarchiReactionCreate) : Promise<GarchiReaction> {\n try {\n const response = await this.client.post(\"/manage-reaction\", params);\n let data = response.data as {\n data: GarchiReaction\n }\n return data.data;\n } catch (error: any) {\n throw error.response?.data || new Error(\"Network Error\");\n }\n }\n}\n\nexport default Reaction;","import { GarchiReview, GarchiReviewCreate, PaginateQueryParams, GarchiReviewUpdate, PaginatedResponse } from \"../../types\";\nimport APIClient from \"../APIClient\";\n\nclass Review extends APIClient{\n async create(params: GarchiReviewCreate): Promise<GarchiReview> {\n try {\n const response = await this.client.post('/reviews/item', params);\n const data = response.data as {\n data: GarchiReview\n }\n return data.data;\n }\n catch (error: any) {\n throw error.response?.data || new Error(\"Network Error\");\n }\n }\n\n async update(params: GarchiReviewUpdate): Promise<string> {\n try {\n const response = await this.client.post('/reviews/edit', params);\n const data = response.data as {\n message: string\n }\n return data.message;\n }\n catch (error: any) {\n throw error.response?.data || new Error(\"Network Error\");\n }\n }\n\n async delete(review_id: number): Promise<string> {\n try {\n const response = await this.client.post(`/reviews/delete`, {\n review_id\n });\n const data = response.data as {\n message: string\n }\n return data.message;\n }\n catch (error: any) {\n throw error.response?.data || new Error(\"Network Error\");\n }\n }\n\n async getByItem(item_id: number | string, queryParams: PaginateQueryParams) : Promise<PaginatedResponse<GarchiReview>> {\n try {\n const response = await this.client.get(`/reviews/item/${item_id}`, {\n params: queryParams\n });\n const data = response.data as PaginatedResponse<GarchiReview>;\n return data;\n }\n catch (error: any) {\n throw error.response?.data || new Error(\"Network Error\");\n }\n }\n}\n\nexport default Review;","import { CreatePageResponse, GarchiCategory, GarchiSpace, GarchiSpaceAPIResponse, GarchiSpaceCreate, PaginatedResponse, PaginateQueryParams, SectionTemplate } from \"../../types\";\nimport APIClient from \"../APIClient\";\n\nclass Space extends APIClient {\n \n\n async categories(space_uid: string) : Promise<GarchiCategory[]> {\n try {\n const response = await this.client.get(`/space/${space_uid}/categories`);\n const data = response.data as {\n data: GarchiCategory[]\n }\n return data.data;\n }\n catch (error: any) {\n throw error.response?.data || new Error(\"Network Error\");\n }\n }\n\n async getAll(params: PaginateQueryParams) : Promise<GarchiSpaceAPIResponse> {\n try {\n const response = await this.client.get('/spaces', {\n params\n });\n const data = response.data as GarchiSpaceAPIResponse;\n return data;\n }\n catch (error: any) {\n throw error.response?.data || new Error(\"Network Error\");\n }\n } \n \n async get(space_uid: string) : Promise<GarchiSpace> {\n try {\n const response = await this.client.get(`/space/${space_uid}`);\n const data = response.data as {\n data: GarchiSpace\n }\n return data.data;\n }\n catch (error: any) {\n throw error.response?.data || new Error(\"Network Error\");\n }\n }\n\n async create(params: GarchiSpaceCreate): Promise<GarchiSpace> {\n try {\n const formData = new FormData()\n formData.append('name', params.name)\n if(params.logo) {\n formData.append('logo', params.logo)\n }\n const response = await this.client.post('/space', formData);\n const data = response.data as {\n data: GarchiSpace\n }\n return data.data;\n }\n catch (error: any) {\n throw error.response?.data || new Error(\"Network Error\");\n }\n }\n\n async update(space_uid: string, params: {\n name?: string,\n logo?: File\n }) : Promise<string> {\n try {\n const formData = new FormData();\n if(params.name) {\n formData.append('name', params.name)\n }\n if(params.logo) {\n formData.append('logo', params.logo)\n }\n const response = await this.client.post(`/update/space/${space_uid}`, formData);\n const data = response.data as {\n data: string\n }\n return data.data;\n }\n catch (error: any) {\n throw error.response?.data || new Error(\"Network Error\");\n }\n }\n\n async delete(space_uid: string) : Promise<string> {\n try {\n const response = await this.client.delete(`/delete/space/${space_uid}`);\n const data = response.data as {\n data: string\n }\n return data.data;\n }\n catch (error: any) {\n throw error.response?.data || new Error(\"Network Error\");\n }\n }\n\n async listPages(space_uid: string) : Promise<CreatePageResponse[]> {\n try {\n const response = await this.client.get(`/space/${space_uid}/pages`);\n const data = response.data\n return data as CreatePageResponse[];\n }\n catch (error: any) {\n throw error.response?.data || new Error(\"Network Error\");\n }\n }\n\n async listSectionTemplates(space_uid: string) : Promise<SectionTemplate[]> {\n try {\n const response = await this.client.get(`/space/${space_uid}/section_templates`);\n const data = response.data\n return data as SectionTemplate[];\n }\n catch (error: any) {\n throw error.response?.data || new Error(\"Network Error\");\n }\n }\n\n}\nexport default Space;","import { GarchiCMSInitOptions } from \"../types\";\nimport Category from \"./api-wrappers/Category\";\nimport CompoundQuery from \"./api-wrappers/CompoundQuery\";\nimport DataItem from \"./api-wrappers/DataItem\";\nimport Headless from \"./api-wrappers/Headless\";\nimport Reaction from \"./api-wrappers/Reaction\";\nimport Review from \"./api-wrappers/Review\";\nimport Space from \"./api-wrappers/Space\";\n\n\nclass GarchiCMS {\n\n dataItem: DataItem\n category: Category\n space: Space\n review: Review\n headless: Headless\n reaction: Reaction\n compoundQuery: CompoundQuery\n \n constructor(options: GarchiCMSInitOptions) {\n this.dataItem = new DataItem(options)\n this.category = new Category(options)\n this.space = new Space(options)\n this.review = new Review(options) \n this.headless = new Headless(options)\n this.reaction = new Reaction(options)\n this.compoundQuery = new CompoundQuery(options)\n }\n\n \n\n \n}\n\nexport default GarchiCMS"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,mBAAqC;AAGrC,IAAM,YAAN,MAAgB;AAAA,EAEZ;AAAA,EAGA,YAAY,SAAsC;AAE9C,SAAK,SAAS,aAAAA,QAAM,OAAO;AAAA,MACvB,SAAS;AAAA,MACT,SAAS;AAAA,QACL,gBAAgB;AAAA,QAChB,UAAU;AAAA,QACV,iBAAiB,UAAU,SAAS,WAAW,QAAQ,IAAI,cAAc;AAAA,QACzE,GAAG,SAAS;AAAA,MAChB;AAAA,IACJ,CAAC;AAAA,EAEL;AACJ;AAEA,IAAO,oBAAQ;;;ACpBf,IAAM,WAAN,cAAuB,kBAAU;AAAA,EAE7B,MAAM,OAAO,QAAwD;AACjE,QAAI;AACA,YAAM,WAAW,MAAM,KAAK,OAAO,KAAK,aAAa,MAAM;AAC3D,UAAI,OAAO,SAAS;AAGpB,aAAO,KAAK;AAAA,IAChB,SAAS,OAAY;AACjB,YAAM,MAAM,UAAU,QAAQ,IAAI,MAAM,eAAe;AAAA,IAC3D;AAAA,EACJ;AAAA,EAEA,MAAM,OAAO,QAAgD;AACzD,QAAI;AACA,YAAM,WAAW,MAAM,KAAK,OAAO,KAAK,oBAAoB,OAAO,SAAS,IAAI,OAAO,W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,MAAgB;AAAA,EAEZ;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAEA,YAAY,SAA+B;AACvC,SAAK,WAAW,IAAI,iBAAS,OAAO;AACpC,SAAK,WAAW,IAAI,iBAAS,OAAO;AACpC,SAAK,QAAQ,IAAI,cAAM,OAAO;AAC9B,SAAK,SAAS,IAAI,eAAO,OAAO;AAChC,SAAK,WAAW,IAAI,iBAAS,OAAO;AACpC,SAAK,WAAW,IAAI,iBAAS,OAAO;AACpC,SAAK,gBAAgB,IAAI,sBAAc,OAAO;AAAA,EAClD;AAKJ;AAEA,IAAO,oBAAQ;;;AT/Bf,IAAO,gBAAQ;","names":["axios"]}
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/services/APIClient.ts","../src/services/api-wrappers/Category.ts","../src/services/api-wrappers/CompoundQuery.ts","../src/services/api-wrappers/DataItem.ts","../src/services/api-wrappers/Headless.ts","../src/services/api-wrappers/Reaction.ts","../src/services/api-wrappers/Review.ts","../src/services/api-wrappers/Space.ts","../src/services/GarchiCMS.ts"],"sourcesContent":["import GarchiCMS from \"./services/GarchiCMS\";\n\n\n\nexport default GarchiCMS;\n\n\nexport * from \"./types/index\";\n\n","import axios, { AxiosInstance } from \"axios\";\nimport { GarchiCMSInitOptions } from \"../types\";\n\nclass APIClient {\n\n client: AxiosInstance\n\n\n constructor(options: GarchiCMSInitOptions | null) {\n \n this.client = axios.create({\n baseURL: \"https://garchi.co.uk/api/v2\",\n headers: {\n \"Content-Type\": \"application/json\",\n \"Accept\": \"application/json\",\n \"Authorization\": `Bearer ${options?.api_key || process.env.GARCHI_API_KEY}`,\n ...options?.headers\n }\n })\n\n }\n}\n\nexport default APIClient;","import { CreateCategoryParams, DeleteCategoryParams, GarchiCategory, UpdateCategoryParams } from \"../../types\";\nimport APIClient from \"../APIClient\";\n\nclass Category extends APIClient {\n\n async create(params: CreateCategoryParams) : Promise<GarchiCategory> {\n try {\n const response = await this.client.post(\"/category\", params);\n let data = response.data as {\n data: GarchiCategory\n }\n return data.data;\n } catch (error: any) {\n throw error.response?.data || new Error(\"Network Error\");\n }\n }\n\n async delete(params: DeleteCategoryParams) : Promise<string> {\n try {\n const response = await this.client.post(`/delete/category/${params.space_uid}/${params.category_id}`);\n const data = response.data as {\n data: string\n }\n return data.data;\n }\n catch (error: any) {\n throw error.response?.data || new Error(\"Network Error\");\n }\n }\n\n async update(params: UpdateCategoryParams) : Promise<string> {\n try {\n const response = await this.client.post(`/update/category/${params.category_id}`, {\n space_uid: params.space_uid,\n category: params.category\n });\n const data = response.data as {\n data: string\n }\n return data.data;\n }\n catch (error: any) {\n throw error.response?.data || new Error(\"Network Error\");\n }\n }\n\n async getAll() : Promise<GarchiCategory[]> {\n try {\n const response = await this.client.get(\"/categories\");\n const data = response.data as {\n data: GarchiCategory[]\n }\n return data.data;\n }\n catch (error: any) {\n throw error.response?.data || new Error(\"Network Error\");\n }\n }\n}\n\nexport default Category;","import { CompoundQueryBody, GarchiCategoryAPIResponse, GarchiItemAPIResponse, GarchiReview, ItemsQueryParams, PaginatedResponse } from \"../../types\";\nimport APIClient from \"../APIClient\";\n\nclass CompoundQuery extends APIClient {\n async query(body: CompoundQueryBody, params: ItemsQueryParams) : Promise<GarchiItemAPIResponse | GarchiCategoryAPIResponse | \n PaginatedResponse<GarchiReview>>\n {\n try {\n const response = await this.client.post(`/compound_query`, body, {\n params\n });\n return response.data as GarchiItemAPIResponse | GarchiCategoryAPIResponse | PaginatedResponse<GarchiReview>;\n } catch (error: any) {\n throw error.response?.data || new Error(\"Network Error\");\n }\n }\n} \n\nexport default CompoundQuery;","\n\nimport { CreateDataItemParams, CreateMetaInfoParams, DeleteDataItemParams, DeleteMetaInfoParams, FilterItemsByMetaParams, FilterItemsParams, GarchiItem, GarchiItemAPIResponse, GarchiItemMeta, GetAllItemsParams, GetFeaturedItemsParams, GetItemChildrenParams, GetItemParams, GetItemsByIdsParams, GetItemsBySpaceParams, QueryItemsParams, SemanticSearchParams, UpdateDataItemParams, UpdateMetaInfoParams } from \"../../types\";\nimport APIClient from \"../APIClient\";\n\nclass DataItem extends APIClient {\n\n\n async create(params: CreateDataItemParams): Promise<GarchiItem> {\n try {\n const response = await this.client.post(\"/item\", params);\n let data = response.data as {\n data: GarchiItem\n }\n return data.data;\n } catch (error: any) {\n throw error.response?.data || new Error(\"Network Error\");\n }\n }\n\n async delete(params: DeleteDataItemParams): Promise<string> {\n try {\n const response = await this.client.post(`/delete/item`, params);\n const data = response.data as {\n data: string\n }\n return data.data;\n } catch (error: any) {\n throw error.response?.data || new Error(\"Network Error\");\n }\n }\n\n\n async update(params: UpdateDataItemParams): Promise<string> {\n try {\n const response = await this.client.post(`/update/item`, params);\n const data = response.data as {\n data: string\n }\n return data.data;\n } catch (error: any) {\n throw error.response?.data || new Error(\"Network Error\");\n }\n }\n\n async createMetaInfo(params: CreateMetaInfoParams): Promise<GarchiItemMeta[]> {\n try {\n const response = await this.client.post(`/item_meta`, params);\n const data = response.data as {\n data: GarchiItemMeta[]\n }\n return data.data;\n }\n catch (error: any) {\n throw error.response?.data || new Error(\"Network Error\");\n }\n }\n\n async deleteMetaInfo(params: DeleteMetaInfoParams): Promise<string> {\n try {\n const response = await this.client.post(`/delete/item_meta`, params);\n const data = response.data as {\n data: string\n }\n return data.data;\n } catch (error: any) {\n throw error.response?.data || new Error(\"Network Error\");\n }\n }\n\n async updateMetaInfo(params: UpdateMetaInfoParams): Promise<string> {\n try {\n const response = await this.client.post(`/update/item_meta`, params);\n const data = response.data as {\n data: string\n }\n return data.data;\n } catch (error: any) {\n throw error.response?.data || new Error(\"Network Error\");\n }\n }\n\n async getBySpace(params: GetItemsBySpaceParams): Promise<GarchiItemAPIResponse> {\n try {\n const response = await this.client.get(`/space/${params.uid}/items`, {\n params: params\n });\n const data = response.data as GarchiItemAPIResponse;\n return data;\n }\n catch (error: any) {\n throw error.response?.data || new Error(\"Network Error\");\n }\n }\n\n async semanticSearch(params: SemanticSearchParams): Promise<GarchiItem[]> {\n try {\n const response = await this.client.get(`/items/semantic-search`, {\n params: params\n });\n const data = response.data as GarchiItemAPIResponse;\n return data.data;\n }\n catch (error: any) {\n throw error.response?.data || new Error(\"Network Error\");\n }\n }\n\n async featured(params: GetFeaturedItemsParams) : Promise<GarchiItemAPIResponse> {\n try {\n const response = await this.client.get(`/items/featured`, {\n params: params\n });\n const data = response.data as GarchiItemAPIResponse;\n return data;\n }\n catch (error: any) {\n throw error.response?.data || new Error(\"Network Error\");\n }\n }\n\n async get(params: GetItemParams): Promise<GarchiItem> {\n try {\n const response = await this.client.get(`/item/${params.item}`, {\n params: params,\n });\n const data = response.data as GarchiItemAPIResponse\n return data.data[0] as GarchiItem;\n }\n catch (error: any) {\n throw error.response?.data || new Error(\"Network Error\");\n }\n }\n\n\n async getAll(params: GetAllItemsParams): Promise<GarchiItemAPIResponse> {\n try {\n const response = await this.client.get(`/items`, {\n params: params\n });\n const data = response.data as GarchiItemAPIResponse;\n return data;\n }\n catch (error: any) {\n throw error.response?.data || new Error(\"Network Error\");\n\n }\n }\n\n async filter(params: FilterItemsParams) : Promise<GarchiItem[]> {\n try {\n const response = await this.client.post(`/items/filter`, params.body, {\n params: params.query\n });\n const data = response.data as GarchiItemAPIResponse;\n return data.data;\n }\n catch (error: any) {\n throw error.response?.data || new Error(\"Network Error\");\n }\n\n }\n\n async filterByMeta(params: FilterItemsByMetaParams) : Promise<GarchiItem[]> {\n try {\n const response = await this.client.post(`/items/filter/bymeta`, params.body, {\n params: params.query\n });\n const data = response.data as GarchiItemAPIResponse;\n return data.data;\n }\n catch (error: any) {\n throw error.response?.data || new Error(\"Network Error\");\n }\n }\n\n async getByIds(params: GetItemsByIdsParams) : Promise<GarchiItemAPIResponse> {\n try {\n const response = await this.client.post(`/items/byids`, params.body, {\n params: params.query\n });\n const data = response.data as GarchiItemAPIResponse;\n return data;\n }\n catch (error: any) {\n throw error.response?.data || new Error(\"Network Error\");\n }\n }\n\n /**\n * Query the published items of a space with conditions on their fields and\n * metadata, including nested JSON values. See the API docs for the operators.\n */\n async query(params: QueryItemsParams): Promise<GarchiItemAPIResponse> {\n try {\n const { uid, ...body } = params;\n const response = await this.client.post(`/space/${uid}/items/query`, body);\n return response.data as GarchiItemAPIResponse;\n }\n catch (error: any) {\n throw error.response?.data || new Error(\"Network Error\");\n }\n }\n\n /**\n * The published items inside an item (variants of a product, lessons of a\n * course), in their order. The parent itself must be published.\n */\n async getChildren(params: GetItemChildrenParams): Promise<GarchiItemAPIResponse> {\n try {\n const { uid, item, ...query } = params;\n const response = await this.client.get(`/space/${uid}/items/${encodeURIComponent(String(item))}/children`, {\n params: query\n });\n return response.data as GarchiItemAPIResponse;\n }\n catch (error: any) {\n throw error.response?.data || new Error(\"Network Error\");\n }\n }\n}\n\n\nexport default DataItem;","import { BlankSectionRequest, BlankSectionResponse, CreateOrUpdateSectionTemplateParams, CreatePageRequest, CreatePageResponse, GarchiAsset, GarchiPage, GetPageParams } from \"../../types\";\nimport APIClient from \"../APIClient\";\n\nclass Headless extends APIClient {\n\n async getAsset(file_name: string, space_uid: string) : Promise<GarchiAsset> {\n try {\n const response = await this.client.get(`/space/assets/${file_name}`, {\n params: {\n space_uid\n }\n });\n return response.data as GarchiAsset;\n } catch (error: any) {\n throw error.response?.data || new Error(\"Network Error\");\n }\n }\n\n async getPage(params: GetPageParams) : Promise<GarchiPage> {\n try {\n const response = await this.client.post(`/page`, params);\n return response.data as GarchiPage;\n }\n catch (error: any) {\n throw error.response?.data || new Error(\"Network Error\");\n }\n }\n\n async createOrUpdateSectionTemplates(params: CreateOrUpdateSectionTemplateParams) : Promise<string> {\n try {\n const response = await this.client.post(`/section_template`, params);\n return response.data as string;\n }\n catch (error: any) {\n throw error.response?.data || new Error(\"Network Error\");\n }\n }\n\n async addPage(params: CreatePageRequest) : Promise<CreatePageResponse>\n {\n try {\n const response = await this.client.post(`/space/${params.space_uid}/create_page`, {\n title: params.title,\n path: params.path,\n description: params.description,\n })\n return response.data as CreatePageResponse;\n }\n catch (error: any) {\n throw error.response?.data || new Error(\"Network Error\");\n }\n }\n\n async addBlankSectionToPage(params: BlankSectionRequest) : Promise<BlankSectionResponse>\n {\n try {\n const response = await this.client.post('/page/add_blank_section', {\n section_template_id: params.section_template_id,\n parent_id: params.parent_id,\n page_id: params.page_id,\n })\n return response.data as BlankSectionResponse;\n }\n catch (error: any) {\n throw error.response?.data || new Error(\"Network Error\");\n }\n }\n \n \n}\n\nexport default Headless;","import { GarchiReaction, GarchiReactionCreate } from \"../../types\";\nimport APIClient from \"../APIClient\";\n\nclass Reaction extends APIClient {\n async manage(params: GarchiReactionCreate) : Promise<GarchiReaction> {\n try {\n const response = await this.client.post(\"/manage-reaction\", params);\n let data = response.data as {\n data: GarchiReaction\n }\n return data.data;\n } catch (error: any) {\n throw error.response?.data || new Error(\"Network Error\");\n }\n }\n}\n\nexport default Reaction;","import { GarchiReview, GarchiReviewCreate, PaginateQueryParams, GarchiReviewUpdate, PaginatedResponse } from \"../../types\";\nimport APIClient from \"../APIClient\";\n\nclass Review extends APIClient{\n async create(params: GarchiReviewCreate): Promise<GarchiReview> {\n try {\n const response = await this.client.post('/reviews/item', params);\n const data = response.data as {\n data: GarchiReview\n }\n return data.data;\n }\n catch (error: any) {\n throw error.response?.data || new Error(\"Network Error\");\n }\n }\n\n async update(params: GarchiReviewUpdate): Promise<string> {\n try {\n const response = await this.client.post('/reviews/edit', params);\n const data = response.data as {\n message: string\n }\n return data.message;\n }\n catch (error: any) {\n throw error.response?.data || new Error(\"Network Error\");\n }\n }\n\n async delete(review_id: number): Promise<string> {\n try {\n const response = await this.client.post(`/reviews/delete`, {\n review_id\n });\n const data = response.data as {\n message: string\n }\n return data.message;\n }\n catch (error: any) {\n throw error.response?.data || new Error(\"Network Error\");\n }\n }\n\n async getByItem(item_id: number | string, queryParams: PaginateQueryParams) : Promise<PaginatedResponse<GarchiReview>> {\n try {\n const response = await this.client.get(`/reviews/item/${item_id}`, {\n params: queryParams\n });\n const data = response.data as PaginatedResponse<GarchiReview>;\n return data;\n }\n catch (error: any) {\n throw error.response?.data || new Error(\"Network Error\");\n }\n }\n}\n\nexport default Review;","import { CreatePageResponse, GarchiCategory, GarchiSpace, GarchiSpaceAPIResponse, GarchiSpaceCreate, PaginatedResponse, PaginateQueryParams, SectionTemplate } from \"../../types\";\nimport APIClient from \"../APIClient\";\n\nclass Space extends APIClient {\n \n\n async categories(space_uid: string) : Promise<GarchiCategory[]> {\n try {\n const response = await this.client.get(`/space/${space_uid}/categories`);\n const data = response.data as {\n data: GarchiCategory[]\n }\n return data.data;\n }\n catch (error: any) {\n throw error.response?.data || new Error(\"Network Error\");\n }\n }\n\n async getAll(params: PaginateQueryParams) : Promise<GarchiSpaceAPIResponse> {\n try {\n const response = await this.client.get('/spaces', {\n params\n });\n const data = response.data as GarchiSpaceAPIResponse;\n return data;\n }\n catch (error: any) {\n throw error.response?.data || new Error(\"Network Error\");\n }\n } \n \n async get(space_uid: string) : Promise<GarchiSpace> {\n try {\n const response = await this.client.get(`/space/${space_uid}`);\n const data = response.data as {\n data: GarchiSpace\n }\n return data.data;\n }\n catch (error: any) {\n throw error.response?.data || new Error(\"Network Error\");\n }\n }\n\n async create(params: GarchiSpaceCreate): Promise<GarchiSpace> {\n try {\n const formData = new FormData()\n formData.append('name', params.name)\n if(params.logo) {\n formData.append('logo', params.logo)\n }\n const response = await this.client.post('/space', formData);\n const data = response.data as {\n data: GarchiSpace\n }\n return data.data;\n }\n catch (error: any) {\n throw error.response?.data || new Error(\"Network Error\");\n }\n }\n\n async update(space_uid: string, params: {\n name?: string,\n logo?: File\n }) : Promise<string> {\n try {\n const formData = new FormData();\n if(params.name) {\n formData.append('name', params.name)\n }\n if(params.logo) {\n formData.append('logo', params.logo)\n }\n const response = await this.client.post(`/update/space/${space_uid}`, formData);\n const data = response.data as {\n data: string\n }\n return data.data;\n }\n catch (error: any) {\n throw error.response?.data || new Error(\"Network Error\");\n }\n }\n\n async delete(space_uid: string) : Promise<string> {\n try {\n const response = await this.client.delete(`/delete/space/${space_uid}`);\n const data = response.data as {\n data: string\n }\n return data.data;\n }\n catch (error: any) {\n throw error.response?.data || new Error(\"Network Error\");\n }\n }\n\n async listPages(space_uid: string) : Promise<CreatePageResponse[]> {\n try {\n const response = await this.client.get(`/space/${space_uid}/pages`);\n const data = response.data\n return data as CreatePageResponse[];\n }\n catch (error: any) {\n throw error.response?.data || new Error(\"Network Error\");\n }\n }\n\n async listSectionTemplates(space_uid: string) : Promise<SectionTemplate[]> {\n try {\n const response = await this.client.get(`/space/${space_uid}/section_templates`);\n const data = response.data\n return data as SectionTemplate[];\n }\n catch (error: any) {\n throw error.response?.data || new Error(\"Network Error\");\n }\n }\n\n}\nexport default Space;","import { GarchiCMSInitOptions } from \"../types\";\nimport Category from \"./api-wrappers/Category\";\nimport CompoundQuery from \"./api-wrappers/CompoundQuery\";\nimport DataItem from \"./api-wrappers/DataItem\";\nimport Headless from \"./api-wrappers/Headless\";\nimport Reaction from \"./api-wrappers/Reaction\";\nimport Review from \"./api-wrappers/Review\";\nimport Space from \"./api-wrappers/Space\";\n\n\nclass GarchiCMS {\n\n dataItem: DataItem\n category: Category\n space: Space\n review: Review\n headless: Headless\n reaction: Reaction\n compoundQuery: CompoundQuery\n \n constructor(options: GarchiCMSInitOptions) {\n this.dataItem = new DataItem(options)\n this.category = new Category(options)\n this.space = new Space(options)\n this.review = new Review(options) \n this.headless = new Headless(options)\n this.reaction = new Reaction(options)\n this.compoundQuery = new CompoundQuery(options)\n }\n\n \n\n \n}\n\nexport default GarchiCMS"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,mBAAqC;AAGrC,IAAM,YAAN,MAAgB;AAAA,EAEZ;AAAA,EAGA,YAAY,SAAsC;AAE9C,SAAK,SAAS,aAAAA,QAAM,OAAO;AAAA,MACvB,SAAS;AAAA,MACT,SAAS;AAAA,QACL,gBAAgB;AAAA,Q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AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAEA,YAAY,SAA+B;AACvC,SAAK,WAAW,IAAI,iBAAS,OAAO;AACpC,SAAK,WAAW,IAAI,iBAAS,OAAO;AACpC,SAAK,QAAQ,IAAI,cAAM,OAAO;AAC9B,SAAK,SAAS,IAAI,eAAO,OAAO;AAChC,SAAK,WAAW,IAAI,iBAAS,OAAO;AACpC,SAAK,WAAW,IAAI,iBAAS,OAAO;AACpC,SAAK,gBAAgB,IAAI,sBAAc,OAAO;AAAA,EAClD;AAKJ;AAEA,IAAO,oBAAQ;;;AT/Bf,IAAO,gBAAQ;","names":["axios"]}
|
package/dist/index.d.cts
CHANGED
|
@@ -182,6 +182,9 @@ type GarchiItemMeta = {
|
|
|
182
182
|
type GarchiItem = {
|
|
183
183
|
item_id: number;
|
|
184
184
|
slug: string;
|
|
185
|
+
parent_id?: number | null;
|
|
186
|
+
children_count?: number;
|
|
187
|
+
children?: GarchiItem[];
|
|
185
188
|
sku?: string;
|
|
186
189
|
agent_description?: string;
|
|
187
190
|
name: string;
|
|
@@ -229,6 +232,7 @@ interface CreateDataItemParams {
|
|
|
229
232
|
external_url?: string;
|
|
230
233
|
slug?: string;
|
|
231
234
|
agent_description?: string;
|
|
235
|
+
parent_id?: number;
|
|
232
236
|
}
|
|
233
237
|
interface DeleteDataItemParams {
|
|
234
238
|
item_id: number;
|
|
@@ -248,6 +252,7 @@ interface UpdateDataItemParams {
|
|
|
248
252
|
make_public?: boolean;
|
|
249
253
|
slug?: string;
|
|
250
254
|
agent_description?: string;
|
|
255
|
+
parent_id?: number | null;
|
|
251
256
|
}
|
|
252
257
|
type MetaType = "string" | "array" | "url" | "object" | "numeric" | "email" | "date" | "color" | "icon_hero" | "icon_lucid";
|
|
253
258
|
interface MetaInfo {
|
|
@@ -281,6 +286,7 @@ interface ItemsQueryParams extends PaginateQueryParams {
|
|
|
281
286
|
order_by?: "asc" | "desc";
|
|
282
287
|
reactions?: "include" | "exclude";
|
|
283
288
|
description?: "include" | "exclude";
|
|
289
|
+
children?: "include" | "exclude";
|
|
284
290
|
}
|
|
285
291
|
interface GetItemsBySpaceParams extends ItemsQueryParams {
|
|
286
292
|
uid: string;
|
|
@@ -290,14 +296,54 @@ interface SemanticSearchParams {
|
|
|
290
296
|
threshold?: number;
|
|
291
297
|
reactions?: "include" | "exclude";
|
|
292
298
|
description?: "include" | "exclude";
|
|
299
|
+
children?: "include" | "exclude";
|
|
293
300
|
}
|
|
294
301
|
interface GetFeaturedItemsParams {
|
|
295
302
|
reactions?: "include" | "exclude";
|
|
296
303
|
description?: "include" | "exclude";
|
|
304
|
+
children?: "include" | "exclude";
|
|
297
305
|
}
|
|
298
306
|
interface GetItemParams {
|
|
299
307
|
item: string | number;
|
|
300
308
|
reactions?: "include" | "exclude";
|
|
309
|
+
children?: "include" | "exclude";
|
|
310
|
+
}
|
|
311
|
+
interface GetItemChildrenParams extends PaginateQueryParams {
|
|
312
|
+
uid: string;
|
|
313
|
+
item: string | number;
|
|
314
|
+
reactions?: "include" | "exclude";
|
|
315
|
+
description?: "include" | "exclude";
|
|
316
|
+
children?: "include" | "exclude";
|
|
317
|
+
}
|
|
318
|
+
/** Operators of the item query endpoint. */
|
|
319
|
+
type ItemQueryOperator = "eq" | "ne" | "gt" | "gte" | "lt" | "lte" | "between" | "in" | "not_in" | "contains" | "starts_with" | "exists" | "not_exists" | "has_all";
|
|
320
|
+
/**
|
|
321
|
+
* Item fields, or `meta.<key>` with dots into JSON objects (e.g. `meta.specs.weight`).
|
|
322
|
+
* `parent_id` finds the items inside an item; `not_exists` on it finds items on their own.
|
|
323
|
+
*/
|
|
324
|
+
type ItemQueryField = "item_id" | "name" | "slug" | "sku" | "price" | "scratched_price" | "stock" | "created" | "updated" | "category" | "type" | "parent_id" | "position" | `meta.${string}`;
|
|
325
|
+
interface ItemQueryCondition {
|
|
326
|
+
field: ItemQueryField;
|
|
327
|
+
op: ItemQueryOperator;
|
|
328
|
+
value?: string | number | boolean | Array<string | number | boolean>;
|
|
329
|
+
}
|
|
330
|
+
/** A condition, a group where every entry must match, or a group where at least one must. */
|
|
331
|
+
type ItemQueryWhere = ItemQueryCondition | {
|
|
332
|
+
all: ItemQueryWhere[];
|
|
333
|
+
} | {
|
|
334
|
+
any: ItemQueryWhere[];
|
|
335
|
+
} | ItemQueryWhere[];
|
|
336
|
+
interface ItemQuerySort {
|
|
337
|
+
field: Exclude<ItemQueryField, "category" | "type">;
|
|
338
|
+
direction?: "asc" | "desc";
|
|
339
|
+
}
|
|
340
|
+
interface QueryItemsParams extends PaginateQueryParams {
|
|
341
|
+
uid: string;
|
|
342
|
+
where?: ItemQueryWhere;
|
|
343
|
+
sort?: ItemQuerySort[];
|
|
344
|
+
reactions?: "include" | "exclude";
|
|
345
|
+
description?: "include" | "exclude";
|
|
346
|
+
children?: "include" | "exclude";
|
|
301
347
|
}
|
|
302
348
|
interface GetAllItemsParams extends ItemsQueryParams {
|
|
303
349
|
search_keyword?: string;
|
|
@@ -388,6 +434,16 @@ declare class DataItem extends APIClient {
|
|
|
388
434
|
filter(params: FilterItemsParams): Promise<GarchiItem[]>;
|
|
389
435
|
filterByMeta(params: FilterItemsByMetaParams): Promise<GarchiItem[]>;
|
|
390
436
|
getByIds(params: GetItemsByIdsParams): Promise<GarchiItemAPIResponse>;
|
|
437
|
+
/**
|
|
438
|
+
* Query the published items of a space with conditions on their fields and
|
|
439
|
+
* metadata, including nested JSON values. See the API docs for the operators.
|
|
440
|
+
*/
|
|
441
|
+
query(params: QueryItemsParams): Promise<GarchiItemAPIResponse>;
|
|
442
|
+
/**
|
|
443
|
+
* The published items inside an item (variants of a product, lessons of a
|
|
444
|
+
* course), in their order. The parent itself must be published.
|
|
445
|
+
*/
|
|
446
|
+
getChildren(params: GetItemChildrenParams): Promise<GarchiItemAPIResponse>;
|
|
391
447
|
}
|
|
392
448
|
|
|
393
449
|
declare class Headless extends APIClient {
|
|
@@ -434,4 +490,4 @@ declare class GarchiCMS {
|
|
|
434
490
|
constructor(options: GarchiCMSInitOptions);
|
|
435
491
|
}
|
|
436
492
|
|
|
437
|
-
export { type BlankSectionRequest, type BlankSectionResponse, type CategoryFields, type CompoundQueryBody, type ConditionType, type CreateCategoryParams, type CreateDataItemParams, type CreateMetaInfoParams, type CreateOrUpdateSectionTemplateParams, type CreatePageRequest, type CreatePageResponse, type DatasetType, type DeleteCategoryParams, type DeleteDataItemParams, type DeleteMetaInfoParams, type FilterItemsBodyParams, type FilterItemsByMetaBodyParams, type FilterItemsByMetaParams, type FilterItemsParams, type GarchiAsset, type GarchiAttribute, type GarchiAttributeOption, type GarchiCMSInitOptions, type GarchiCategory, type GarchiCategoryAPIResponse, type GarchiItem, type GarchiItemAPIResponse, type GarchiItemMeta, type GarchiPage, type GarchiReaction, type GarchiReactionCreate, type GarchiReview, type GarchiReviewCreate, type GarchiReviewUpdate, type GarchiSection, type GarchiSpace, type GarchiSpaceAPIResponse, type GarchiSpaceCreate, type GetAllItemsParams, type GetFeaturedItemsParams, type GetItemParams, type GetItemsByIdsBodyParams, type GetItemsByIdsParams, type GetItemsBySpaceParams, type GetPageParams, type ItemFields, type ItemsQueryParams, type LogicType, type MetaFilter, type MetaFilterOperator, type MetaInfo, type MetaType, type PaginateQueryParams, type PaginatedResponse, type PaginationLinks, type PaginationMeta, type ReviewFields, type SectionPropType, type SectionTemplate, type SectionTemplateProp, type SemanticSearchParams, type UpdateCategoryParams, type UpdateDataItemParams, type UpdateMetaInfoParams, GarchiCMS as default };
|
|
493
|
+
export { type BlankSectionRequest, type BlankSectionResponse, type CategoryFields, type CompoundQueryBody, type ConditionType, type CreateCategoryParams, type CreateDataItemParams, type CreateMetaInfoParams, type CreateOrUpdateSectionTemplateParams, type CreatePageRequest, type CreatePageResponse, type DatasetType, type DeleteCategoryParams, type DeleteDataItemParams, type DeleteMetaInfoParams, type FilterItemsBodyParams, type FilterItemsByMetaBodyParams, type FilterItemsByMetaParams, type FilterItemsParams, type GarchiAsset, type GarchiAttribute, type GarchiAttributeOption, type GarchiCMSInitOptions, type GarchiCategory, type GarchiCategoryAPIResponse, type GarchiItem, type GarchiItemAPIResponse, type GarchiItemMeta, type GarchiPage, type GarchiReaction, type GarchiReactionCreate, type GarchiReview, type GarchiReviewCreate, type GarchiReviewUpdate, type GarchiSection, type GarchiSpace, type GarchiSpaceAPIResponse, type GarchiSpaceCreate, type GetAllItemsParams, type GetFeaturedItemsParams, type GetItemChildrenParams, type GetItemParams, type GetItemsByIdsBodyParams, type GetItemsByIdsParams, type GetItemsBySpaceParams, type GetPageParams, type ItemFields, type ItemQueryCondition, type ItemQueryField, type ItemQueryOperator, type ItemQuerySort, type ItemQueryWhere, type ItemsQueryParams, type LogicType, type MetaFilter, type MetaFilterOperator, type MetaInfo, type MetaType, type PaginateQueryParams, type PaginatedResponse, type PaginationLinks, type PaginationMeta, type QueryItemsParams, type ReviewFields, type SectionPropType, type SectionTemplate, type SectionTemplateProp, type SemanticSearchParams, type UpdateCategoryParams, type UpdateDataItemParams, type UpdateMetaInfoParams, GarchiCMS as default };
|
package/dist/index.d.ts
CHANGED
|
@@ -182,6 +182,9 @@ type GarchiItemMeta = {
|
|
|
182
182
|
type GarchiItem = {
|
|
183
183
|
item_id: number;
|
|
184
184
|
slug: string;
|
|
185
|
+
parent_id?: number | null;
|
|
186
|
+
children_count?: number;
|
|
187
|
+
children?: GarchiItem[];
|
|
185
188
|
sku?: string;
|
|
186
189
|
agent_description?: string;
|
|
187
190
|
name: string;
|
|
@@ -229,6 +232,7 @@ interface CreateDataItemParams {
|
|
|
229
232
|
external_url?: string;
|
|
230
233
|
slug?: string;
|
|
231
234
|
agent_description?: string;
|
|
235
|
+
parent_id?: number;
|
|
232
236
|
}
|
|
233
237
|
interface DeleteDataItemParams {
|
|
234
238
|
item_id: number;
|
|
@@ -248,6 +252,7 @@ interface UpdateDataItemParams {
|
|
|
248
252
|
make_public?: boolean;
|
|
249
253
|
slug?: string;
|
|
250
254
|
agent_description?: string;
|
|
255
|
+
parent_id?: number | null;
|
|
251
256
|
}
|
|
252
257
|
type MetaType = "string" | "array" | "url" | "object" | "numeric" | "email" | "date" | "color" | "icon_hero" | "icon_lucid";
|
|
253
258
|
interface MetaInfo {
|
|
@@ -281,6 +286,7 @@ interface ItemsQueryParams extends PaginateQueryParams {
|
|
|
281
286
|
order_by?: "asc" | "desc";
|
|
282
287
|
reactions?: "include" | "exclude";
|
|
283
288
|
description?: "include" | "exclude";
|
|
289
|
+
children?: "include" | "exclude";
|
|
284
290
|
}
|
|
285
291
|
interface GetItemsBySpaceParams extends ItemsQueryParams {
|
|
286
292
|
uid: string;
|
|
@@ -290,14 +296,54 @@ interface SemanticSearchParams {
|
|
|
290
296
|
threshold?: number;
|
|
291
297
|
reactions?: "include" | "exclude";
|
|
292
298
|
description?: "include" | "exclude";
|
|
299
|
+
children?: "include" | "exclude";
|
|
293
300
|
}
|
|
294
301
|
interface GetFeaturedItemsParams {
|
|
295
302
|
reactions?: "include" | "exclude";
|
|
296
303
|
description?: "include" | "exclude";
|
|
304
|
+
children?: "include" | "exclude";
|
|
297
305
|
}
|
|
298
306
|
interface GetItemParams {
|
|
299
307
|
item: string | number;
|
|
300
308
|
reactions?: "include" | "exclude";
|
|
309
|
+
children?: "include" | "exclude";
|
|
310
|
+
}
|
|
311
|
+
interface GetItemChildrenParams extends PaginateQueryParams {
|
|
312
|
+
uid: string;
|
|
313
|
+
item: string | number;
|
|
314
|
+
reactions?: "include" | "exclude";
|
|
315
|
+
description?: "include" | "exclude";
|
|
316
|
+
children?: "include" | "exclude";
|
|
317
|
+
}
|
|
318
|
+
/** Operators of the item query endpoint. */
|
|
319
|
+
type ItemQueryOperator = "eq" | "ne" | "gt" | "gte" | "lt" | "lte" | "between" | "in" | "not_in" | "contains" | "starts_with" | "exists" | "not_exists" | "has_all";
|
|
320
|
+
/**
|
|
321
|
+
* Item fields, or `meta.<key>` with dots into JSON objects (e.g. `meta.specs.weight`).
|
|
322
|
+
* `parent_id` finds the items inside an item; `not_exists` on it finds items on their own.
|
|
323
|
+
*/
|
|
324
|
+
type ItemQueryField = "item_id" | "name" | "slug" | "sku" | "price" | "scratched_price" | "stock" | "created" | "updated" | "category" | "type" | "parent_id" | "position" | `meta.${string}`;
|
|
325
|
+
interface ItemQueryCondition {
|
|
326
|
+
field: ItemQueryField;
|
|
327
|
+
op: ItemQueryOperator;
|
|
328
|
+
value?: string | number | boolean | Array<string | number | boolean>;
|
|
329
|
+
}
|
|
330
|
+
/** A condition, a group where every entry must match, or a group where at least one must. */
|
|
331
|
+
type ItemQueryWhere = ItemQueryCondition | {
|
|
332
|
+
all: ItemQueryWhere[];
|
|
333
|
+
} | {
|
|
334
|
+
any: ItemQueryWhere[];
|
|
335
|
+
} | ItemQueryWhere[];
|
|
336
|
+
interface ItemQuerySort {
|
|
337
|
+
field: Exclude<ItemQueryField, "category" | "type">;
|
|
338
|
+
direction?: "asc" | "desc";
|
|
339
|
+
}
|
|
340
|
+
interface QueryItemsParams extends PaginateQueryParams {
|
|
341
|
+
uid: string;
|
|
342
|
+
where?: ItemQueryWhere;
|
|
343
|
+
sort?: ItemQuerySort[];
|
|
344
|
+
reactions?: "include" | "exclude";
|
|
345
|
+
description?: "include" | "exclude";
|
|
346
|
+
children?: "include" | "exclude";
|
|
301
347
|
}
|
|
302
348
|
interface GetAllItemsParams extends ItemsQueryParams {
|
|
303
349
|
search_keyword?: string;
|
|
@@ -388,6 +434,16 @@ declare class DataItem extends APIClient {
|
|
|
388
434
|
filter(params: FilterItemsParams): Promise<GarchiItem[]>;
|
|
389
435
|
filterByMeta(params: FilterItemsByMetaParams): Promise<GarchiItem[]>;
|
|
390
436
|
getByIds(params: GetItemsByIdsParams): Promise<GarchiItemAPIResponse>;
|
|
437
|
+
/**
|
|
438
|
+
* Query the published items of a space with conditions on their fields and
|
|
439
|
+
* metadata, including nested JSON values. See the API docs for the operators.
|
|
440
|
+
*/
|
|
441
|
+
query(params: QueryItemsParams): Promise<GarchiItemAPIResponse>;
|
|
442
|
+
/**
|
|
443
|
+
* The published items inside an item (variants of a product, lessons of a
|
|
444
|
+
* course), in their order. The parent itself must be published.
|
|
445
|
+
*/
|
|
446
|
+
getChildren(params: GetItemChildrenParams): Promise<GarchiItemAPIResponse>;
|
|
391
447
|
}
|
|
392
448
|
|
|
393
449
|
declare class Headless extends APIClient {
|
|
@@ -434,4 +490,4 @@ declare class GarchiCMS {
|
|
|
434
490
|
constructor(options: GarchiCMSInitOptions);
|
|
435
491
|
}
|
|
436
492
|
|
|
437
|
-
export { type BlankSectionRequest, type BlankSectionResponse, type CategoryFields, type CompoundQueryBody, type ConditionType, type CreateCategoryParams, type CreateDataItemParams, type CreateMetaInfoParams, type CreateOrUpdateSectionTemplateParams, type CreatePageRequest, type CreatePageResponse, type DatasetType, type DeleteCategoryParams, type DeleteDataItemParams, type DeleteMetaInfoParams, type FilterItemsBodyParams, type FilterItemsByMetaBodyParams, type FilterItemsByMetaParams, type FilterItemsParams, type GarchiAsset, type GarchiAttribute, type GarchiAttributeOption, type GarchiCMSInitOptions, type GarchiCategory, type GarchiCategoryAPIResponse, type GarchiItem, type GarchiItemAPIResponse, type GarchiItemMeta, type GarchiPage, type GarchiReaction, type GarchiReactionCreate, type GarchiReview, type GarchiReviewCreate, type GarchiReviewUpdate, type GarchiSection, type GarchiSpace, type GarchiSpaceAPIResponse, type GarchiSpaceCreate, type GetAllItemsParams, type GetFeaturedItemsParams, type GetItemParams, type GetItemsByIdsBodyParams, type GetItemsByIdsParams, type GetItemsBySpaceParams, type GetPageParams, type ItemFields, type ItemsQueryParams, type LogicType, type MetaFilter, type MetaFilterOperator, type MetaInfo, type MetaType, type PaginateQueryParams, type PaginatedResponse, type PaginationLinks, type PaginationMeta, type ReviewFields, type SectionPropType, type SectionTemplate, type SectionTemplateProp, type SemanticSearchParams, type UpdateCategoryParams, type UpdateDataItemParams, type UpdateMetaInfoParams, GarchiCMS as default };
|
|
493
|
+
export { type BlankSectionRequest, type BlankSectionResponse, type CategoryFields, type CompoundQueryBody, type ConditionType, type CreateCategoryParams, type CreateDataItemParams, type CreateMetaInfoParams, type CreateOrUpdateSectionTemplateParams, type CreatePageRequest, type CreatePageResponse, type DatasetType, type DeleteCategoryParams, type DeleteDataItemParams, type DeleteMetaInfoParams, type FilterItemsBodyParams, type FilterItemsByMetaBodyParams, type FilterItemsByMetaParams, type FilterItemsParams, type GarchiAsset, type GarchiAttribute, type GarchiAttributeOption, type GarchiCMSInitOptions, type GarchiCategory, type GarchiCategoryAPIResponse, type GarchiItem, type GarchiItemAPIResponse, type GarchiItemMeta, type GarchiPage, type GarchiReaction, type GarchiReactionCreate, type GarchiReview, type GarchiReviewCreate, type GarchiReviewUpdate, type GarchiSection, type GarchiSpace, type GarchiSpaceAPIResponse, type GarchiSpaceCreate, type GetAllItemsParams, type GetFeaturedItemsParams, type GetItemChildrenParams, type GetItemParams, type GetItemsByIdsBodyParams, type GetItemsByIdsParams, type GetItemsBySpaceParams, type GetPageParams, type ItemFields, type ItemQueryCondition, type ItemQueryField, type ItemQueryOperator, type ItemQuerySort, type ItemQueryWhere, type ItemsQueryParams, type LogicType, type MetaFilter, type MetaFilterOperator, type MetaInfo, type MetaType, type PaginateQueryParams, type PaginatedResponse, type PaginationLinks, type PaginationMeta, type QueryItemsParams, type ReviewFields, type SectionPropType, type SectionTemplate, type SectionTemplateProp, type SemanticSearchParams, type UpdateCategoryParams, type UpdateDataItemParams, type UpdateMetaInfoParams, GarchiCMS as default };
|
package/dist/index.js
CHANGED
|
@@ -219,6 +219,34 @@ var DataItem = class extends APIClient_default {
|
|
|
219
219
|
throw error.response?.data || new Error("Network Error");
|
|
220
220
|
}
|
|
221
221
|
}
|
|
222
|
+
/**
|
|
223
|
+
* Query the published items of a space with conditions on their fields and
|
|
224
|
+
* metadata, including nested JSON values. See the API docs for the operators.
|
|
225
|
+
*/
|
|
226
|
+
async query(params) {
|
|
227
|
+
try {
|
|
228
|
+
const { uid, ...body } = params;
|
|
229
|
+
const response = await this.client.post(`/space/${uid}/items/query`, body);
|
|
230
|
+
return response.data;
|
|
231
|
+
} catch (error) {
|
|
232
|
+
throw error.response?.data || new Error("Network Error");
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
/**
|
|
236
|
+
* The published items inside an item (variants of a product, lessons of a
|
|
237
|
+
* course), in their order. The parent itself must be published.
|
|
238
|
+
*/
|
|
239
|
+
async getChildren(params) {
|
|
240
|
+
try {
|
|
241
|
+
const { uid, item, ...query } = params;
|
|
242
|
+
const response = await this.client.get(`/space/${uid}/items/${encodeURIComponent(String(item))}/children`, {
|
|
243
|
+
params: query
|
|
244
|
+
});
|
|
245
|
+
return response.data;
|
|
246
|
+
} catch (error) {
|
|
247
|
+
throw error.response?.data || new Error("Network Error");
|
|
248
|
+
}
|
|
249
|
+
}
|
|
222
250
|
};
|
|
223
251
|
var DataItem_default = DataItem;
|
|
224
252
|
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/services/APIClient.ts","../src/services/api-wrappers/Category.ts","../src/services/api-wrappers/CompoundQuery.ts","../src/services/api-wrappers/DataItem.ts","../src/services/api-wrappers/Headless.ts","../src/services/api-wrappers/Reaction.ts","../src/services/api-wrappers/Review.ts","../src/services/api-wrappers/Space.ts","../src/services/GarchiCMS.ts","../src/index.ts"],"sourcesContent":["import axios, { AxiosInstance } from \"axios\";\nimport { GarchiCMSInitOptions } from \"../types\";\n\nclass APIClient {\n\n client: AxiosInstance\n\n\n constructor(options: GarchiCMSInitOptions | null) {\n \n this.client = axios.create({\n baseURL: \"https://garchi.co.uk/api/v2\",\n headers: {\n \"Content-Type\": \"application/json\",\n \"Accept\": \"application/json\",\n \"Authorization\": `Bearer ${options?.api_key || process.env.GARCHI_API_KEY}`,\n ...options?.headers\n }\n })\n\n }\n}\n\nexport default APIClient;","import { CreateCategoryParams, DeleteCategoryParams, GarchiCategory, UpdateCategoryParams } from \"../../types\";\nimport APIClient from \"../APIClient\";\n\nclass Category extends APIClient {\n\n async create(params: CreateCategoryParams) : Promise<GarchiCategory> {\n try {\n const response = await this.client.post(\"/category\", params);\n let data = response.data as {\n data: GarchiCategory\n }\n return data.data;\n } catch (error: any) {\n throw error.response?.data || new Error(\"Network Error\");\n }\n }\n\n async delete(params: DeleteCategoryParams) : Promise<string> {\n try {\n const response = await this.client.post(`/delete/category/${params.space_uid}/${params.category_id}`);\n const data = response.data as {\n data: string\n }\n return data.data;\n }\n catch (error: any) {\n throw error.response?.data || new Error(\"Network Error\");\n }\n }\n\n async update(params: UpdateCategoryParams) : Promise<string> {\n try {\n const response = await this.client.post(`/update/category/${params.category_id}`, {\n space_uid: params.space_uid,\n category: params.category\n });\n const data = response.data as {\n data: string\n }\n return data.data;\n }\n catch (error: any) {\n throw error.response?.data || new Error(\"Network Error\");\n }\n }\n\n async getAll() : Promise<GarchiCategory[]> {\n try {\n const response = await this.client.get(\"/categories\");\n const data = response.data as {\n data: GarchiCategory[]\n }\n return data.data;\n }\n catch (error: any) {\n throw error.response?.data || new Error(\"Network Error\");\n }\n }\n}\n\nexport default Category;","import { CompoundQueryBody, GarchiCategoryAPIResponse, GarchiItemAPIResponse, GarchiReview, ItemsQueryParams, PaginatedResponse } from \"../../types\";\nimport APIClient from \"../APIClient\";\n\nclass CompoundQuery extends APIClient {\n async query(body: CompoundQueryBody, params: ItemsQueryParams) : Promise<GarchiItemAPIResponse | GarchiCategoryAPIResponse | \n PaginatedResponse<GarchiReview>>\n {\n try {\n const response = await this.client.post(`/compound_query`, body, {\n params\n });\n return response.data as GarchiItemAPIResponse | GarchiCategoryAPIResponse | PaginatedResponse<GarchiReview>;\n } catch (error: any) {\n throw error.response?.data || new Error(\"Network Error\");\n }\n }\n} \n\nexport default CompoundQuery;","\n\nimport { CreateDataItemParams, CreateMetaInfoParams, DeleteDataItemParams, DeleteMetaInfoParams, FilterItemsByMetaParams, FilterItemsParams, GarchiItem, GarchiItemAPIResponse, GarchiItemMeta, GetAllItemsParams, GetFeaturedItemsParams, GetItemParams, GetItemsByIdsParams, GetItemsBySpaceParams, SemanticSearchParams, UpdateDataItemParams, UpdateMetaInfoParams } from \"../../types\";\nimport APIClient from \"../APIClient\";\n\nclass DataItem extends APIClient {\n\n\n async create(params: CreateDataItemParams): Promise<GarchiItem> {\n try {\n const response = await this.client.post(\"/item\", params);\n let data = response.data as {\n data: GarchiItem\n }\n return data.data;\n } catch (error: any) {\n throw error.response?.data || new Error(\"Network Error\");\n }\n }\n\n async delete(params: DeleteDataItemParams): Promise<string> {\n try {\n const response = await this.client.post(`/delete/item`, params);\n const data = response.data as {\n data: string\n }\n return data.data;\n } catch (error: any) {\n throw error.response?.data || new Error(\"Network Error\");\n }\n }\n\n\n async update(params: UpdateDataItemParams): Promise<string> {\n try {\n const response = await this.client.post(`/update/item`, params);\n const data = response.data as {\n data: string\n }\n return data.data;\n } catch (error: any) {\n throw error.response?.data || new Error(\"Network Error\");\n }\n }\n\n async createMetaInfo(params: CreateMetaInfoParams): Promise<GarchiItemMeta[]> {\n try {\n const response = await this.client.post(`/item_meta`, params);\n const data = response.data as {\n data: GarchiItemMeta[]\n }\n return data.data;\n }\n catch (error: any) {\n throw error.response?.data || new Error(\"Network Error\");\n }\n }\n\n async deleteMetaInfo(params: DeleteMetaInfoParams): Promise<string> {\n try {\n const response = await this.client.post(`/delete/item_meta`, params);\n const data = response.data as {\n data: string\n }\n return data.data;\n } catch (error: any) {\n throw error.response?.data || new Error(\"Network Error\");\n }\n }\n\n async updateMetaInfo(params: UpdateMetaInfoParams): Promise<string> {\n try {\n const response = await this.client.post(`/update/item_meta`, params);\n const data = response.data as {\n data: string\n }\n return data.data;\n } catch (error: any) {\n throw error.response?.data || new Error(\"Network Error\");\n }\n }\n\n async getBySpace(params: GetItemsBySpaceParams): Promise<GarchiItemAPIResponse> {\n try {\n const response = await this.client.get(`/space/${params.uid}/items`, {\n params: params\n });\n const data = response.data as GarchiItemAPIResponse;\n return data;\n }\n catch (error: any) {\n throw error.response?.data || new Error(\"Network Error\");\n }\n }\n\n async semanticSearch(params: SemanticSearchParams): Promise<GarchiItem[]> {\n try {\n const response = await this.client.get(`/items/semantic-search`, {\n params: params\n });\n const data = response.data as GarchiItemAPIResponse;\n return data.data;\n }\n catch (error: any) {\n throw error.response?.data || new Error(\"Network Error\");\n }\n }\n\n async featured(params: GetFeaturedItemsParams) : Promise<GarchiItemAPIResponse> {\n try {\n const response = await this.client.get(`/items/featured`, {\n params: params\n });\n const data = response.data as GarchiItemAPIResponse;\n return data;\n }\n catch (error: any) {\n throw error.response?.data || new Error(\"Network Error\");\n }\n }\n\n async get(params: GetItemParams): Promise<GarchiItem> {\n try {\n const response = await this.client.get(`/item/${params.item}`, {\n params: params,\n });\n const data = response.data as GarchiItemAPIResponse\n return data.data[0] as GarchiItem;\n }\n catch (error: any) {\n throw error.response?.data || new Error(\"Network Error\");\n }\n }\n\n\n async getAll(params: GetAllItemsParams): Promise<GarchiItemAPIResponse> {\n try {\n const response = await this.client.get(`/items`, {\n params: params\n });\n const data = response.data as GarchiItemAPIResponse;\n return data;\n }\n catch (error: any) {\n throw error.response?.data || new Error(\"Network Error\");\n\n }\n }\n\n async filter(params: FilterItemsParams) : Promise<GarchiItem[]> {\n try {\n const response = await this.client.post(`/items/filter`, params.body, {\n params: params.query\n });\n const data = response.data as GarchiItemAPIResponse;\n return data.data;\n }\n catch (error: any) {\n throw error.response?.data || new Error(\"Network Error\");\n }\n\n }\n\n async filterByMeta(params: FilterItemsByMetaParams) : Promise<GarchiItem[]> {\n try {\n const response = await this.client.post(`/items/filter/bymeta`, params.body, {\n params: params.query\n });\n const data = response.data as GarchiItemAPIResponse;\n return data.data;\n }\n catch (error: any) {\n throw error.response?.data || new Error(\"Network Error\");\n }\n }\n\n async getByIds(params: GetItemsByIdsParams) : Promise<GarchiItemAPIResponse> {\n try {\n const response = await this.client.post(`/items/byids`, params.body, {\n params: params.query\n });\n const data = response.data as GarchiItemAPIResponse;\n return data;\n }\n catch (error: any) {\n throw error.response?.data || new Error(\"Network Error\");\n }\n }\n}\n\n\nexport default DataItem;","import { BlankSectionRequest, BlankSectionResponse, CreateOrUpdateSectionTemplateParams, CreatePageRequest, CreatePageResponse, GarchiAsset, GarchiPage, GetPageParams } from \"../../types\";\nimport APIClient from \"../APIClient\";\n\nclass Headless extends APIClient {\n\n async getAsset(file_name: string, space_uid: string) : Promise<GarchiAsset> {\n try {\n const response = await this.client.get(`/space/assets/${file_name}`, {\n params: {\n space_uid\n }\n });\n return response.data as GarchiAsset;\n } catch (error: any) {\n throw error.response?.data || new Error(\"Network Error\");\n }\n }\n\n async getPage(params: GetPageParams) : Promise<GarchiPage> {\n try {\n const response = await this.client.post(`/page`, params);\n return response.data as GarchiPage;\n }\n catch (error: any) {\n throw error.response?.data || new Error(\"Network Error\");\n }\n }\n\n async createOrUpdateSectionTemplates(params: CreateOrUpdateSectionTemplateParams) : Promise<string> {\n try {\n const response = await this.client.post(`/section_template`, params);\n return response.data as string;\n }\n catch (error: any) {\n throw error.response?.data || new Error(\"Network Error\");\n }\n }\n\n async addPage(params: CreatePageRequest) : Promise<CreatePageResponse>\n {\n try {\n const response = await this.client.post(`/space/${params.space_uid}/create_page`, {\n title: params.title,\n path: params.path,\n description: params.description,\n })\n return response.data as CreatePageResponse;\n }\n catch (error: any) {\n throw error.response?.data || new Error(\"Network Error\");\n }\n }\n\n async addBlankSectionToPage(params: BlankSectionRequest) : Promise<BlankSectionResponse>\n {\n try {\n const response = await this.client.post('/page/add_blank_section', {\n section_template_id: params.section_template_id,\n parent_id: params.parent_id,\n page_id: params.page_id,\n })\n return response.data as BlankSectionResponse;\n }\n catch (error: any) {\n throw error.response?.data || new Error(\"Network Error\");\n }\n }\n \n \n}\n\nexport default Headless;","import { GarchiReaction, GarchiReactionCreate } from \"../../types\";\nimport APIClient from \"../APIClient\";\n\nclass Reaction extends APIClient {\n async manage(params: GarchiReactionCreate) : Promise<GarchiReaction> {\n try {\n const response = await this.client.post(\"/manage-reaction\", params);\n let data = response.data as {\n data: GarchiReaction\n }\n return data.data;\n } catch (error: any) {\n throw error.response?.data || new Error(\"Network Error\");\n }\n }\n}\n\nexport default Reaction;","import { GarchiReview, GarchiReviewCreate, PaginateQueryParams, GarchiReviewUpdate, PaginatedResponse } from \"../../types\";\nimport APIClient from \"../APIClient\";\n\nclass Review extends APIClient{\n async create(params: GarchiReviewCreate): Promise<GarchiReview> {\n try {\n const response = await this.client.post('/reviews/item', params);\n const data = response.data as {\n data: GarchiReview\n }\n return data.data;\n }\n catch (error: any) {\n throw error.response?.data || new Error(\"Network Error\");\n }\n }\n\n async update(params: GarchiReviewUpdate): Promise<string> {\n try {\n const response = await this.client.post('/reviews/edit', params);\n const data = response.data as {\n message: string\n }\n return data.message;\n }\n catch (error: any) {\n throw error.response?.data || new Error(\"Network Error\");\n }\n }\n\n async delete(review_id: number): Promise<string> {\n try {\n const response = await this.client.post(`/reviews/delete`, {\n review_id\n });\n const data = response.data as {\n message: string\n }\n return data.message;\n }\n catch (error: any) {\n throw error.response?.data || new Error(\"Network Error\");\n }\n }\n\n async getByItem(item_id: number | string, queryParams: PaginateQueryParams) : Promise<PaginatedResponse<GarchiReview>> {\n try {\n const response = await this.client.get(`/reviews/item/${item_id}`, {\n params: queryParams\n });\n const data = response.data as PaginatedResponse<GarchiReview>;\n return data;\n }\n catch (error: any) {\n throw error.response?.data || new Error(\"Network Error\");\n }\n }\n}\n\nexport default Review;","import { CreatePageResponse, GarchiCategory, GarchiSpace, GarchiSpaceAPIResponse, GarchiSpaceCreate, PaginatedResponse, PaginateQueryParams, SectionTemplate } from \"../../types\";\nimport APIClient from \"../APIClient\";\n\nclass Space extends APIClient {\n \n\n async categories(space_uid: string) : Promise<GarchiCategory[]> {\n try {\n const response = await this.client.get(`/space/${space_uid}/categories`);\n const data = response.data as {\n data: GarchiCategory[]\n }\n return data.data;\n }\n catch (error: any) {\n throw error.response?.data || new Error(\"Network Error\");\n }\n }\n\n async getAll(params: PaginateQueryParams) : Promise<GarchiSpaceAPIResponse> {\n try {\n const response = await this.client.get('/spaces', {\n params\n });\n const data = response.data as GarchiSpaceAPIResponse;\n return data;\n }\n catch (error: any) {\n throw error.response?.data || new Error(\"Network Error\");\n }\n } \n \n async get(space_uid: string) : Promise<GarchiSpace> {\n try {\n const response = await this.client.get(`/space/${space_uid}`);\n const data = response.data as {\n data: GarchiSpace\n }\n return data.data;\n }\n catch (error: any) {\n throw error.response?.data || new Error(\"Network Error\");\n }\n }\n\n async create(params: GarchiSpaceCreate): Promise<GarchiSpace> {\n try {\n const formData = new FormData()\n formData.append('name', params.name)\n if(params.logo) {\n formData.append('logo', params.logo)\n }\n const response = await this.client.post('/space', formData);\n const data = response.data as {\n data: GarchiSpace\n }\n return data.data;\n }\n catch (error: any) {\n throw error.response?.data || new Error(\"Network Error\");\n }\n }\n\n async update(space_uid: string, params: {\n name?: string,\n logo?: File\n }) : Promise<string> {\n try {\n const formData = new FormData();\n if(params.name) {\n formData.append('name', params.name)\n }\n if(params.logo) {\n formData.append('logo', params.logo)\n }\n const response = await this.client.post(`/update/space/${space_uid}`, formData);\n const data = response.data as {\n data: string\n }\n return data.data;\n }\n catch (error: any) {\n throw error.response?.data || new Error(\"Network Error\");\n }\n }\n\n async delete(space_uid: string) : Promise<string> {\n try {\n const response = await this.client.delete(`/delete/space/${space_uid}`);\n const data = response.data as {\n data: string\n }\n return data.data;\n }\n catch (error: any) {\n throw error.response?.data || new Error(\"Network Error\");\n }\n }\n\n async listPages(space_uid: string) : Promise<CreatePageResponse[]> {\n try {\n const response = await this.client.get(`/space/${space_uid}/pages`);\n const data = response.data\n return data as CreatePageResponse[];\n }\n catch (error: any) {\n throw error.response?.data || new Error(\"Network Error\");\n }\n }\n\n async listSectionTemplates(space_uid: string) : Promise<SectionTemplate[]> {\n try {\n const response = await this.client.get(`/space/${space_uid}/section_templates`);\n const data = response.data\n return data as SectionTemplate[];\n }\n catch (error: any) {\n throw error.response?.data || new Error(\"Network Error\");\n }\n }\n\n}\nexport default Space;","import { GarchiCMSInitOptions } from \"../types\";\nimport Category from \"./api-wrappers/Category\";\nimport CompoundQuery from \"./api-wrappers/CompoundQuery\";\nimport DataItem from \"./api-wrappers/DataItem\";\nimport Headless from \"./api-wrappers/Headless\";\nimport Reaction from \"./api-wrappers/Reaction\";\nimport Review from \"./api-wrappers/Review\";\nimport Space from \"./api-wrappers/Space\";\n\n\nclass GarchiCMS {\n\n dataItem: DataItem\n category: Category\n space: Space\n review: Review\n headless: Headless\n reaction: Reaction\n compoundQuery: CompoundQuery\n \n constructor(options: GarchiCMSInitOptions) {\n this.dataItem = new DataItem(options)\n this.category = new Category(options)\n this.space = new Space(options)\n this.review = new Review(options) \n this.headless = new Headless(options)\n this.reaction = new Reaction(options)\n this.compoundQuery = new CompoundQuery(options)\n }\n\n \n\n \n}\n\nexport default GarchiCMS","import GarchiCMS from \"./services/GarchiCMS\";\n\n\n\nexport default GarchiCMS;\n\n\nexport * from \"./types/index\";\n\n"],"mappings":";AAAA,OAAO,WAA8B;AAGrC,IAAM,YAAN,MAAgB;AAAA,EAEZ;AAAA,EAGA,YAAY,SAAsC;AAE9C,SAAK,SAAS,MAAM,OAAO;AAAA,MACvB,SAAS;AAAA,MACT,SAAS;AAAA,QACL,gBAAgB;AAAA,QAChB,UAAU;AAAA,QACV,iBAAiB,UAAU,SAAS,WAAW,QAAQ,IAAI,cAAc;AAAA,QACzE,GAAG,SAAS;AAAA,MAChB;AAAA,IACJ,CAAC;AAAA,EAEL;AACJ;AAEA,IAAO,oBAAQ;;;ACpBf,IAAM,WAAN,cAAuB,kBAAU;AAAA,EAE7B,MAAM,OAAO,QAAwD;AACjE,QAAI;AACA,YAAM,WAAW,MAAM,KAAK,OAAO,KAAK,aAAa,MAAM;AAC3D,UAAI,OAAO,SAAS;AAGpB,aAAO,KAAK;AAAA,IAChB,SAAS,OAAY;AACjB,YAAM,MAAM,UAAU,QAAQ,IAAI,MAAM,eAAe;AAAA,IAC3D;AAAA,EACJ;AAA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YAAM,MAAM,UAAU,QAAQ,IAAI,MAAM,eAAe;AAAA,IAC3D;AAAA,EACJ;AAEJ;AACA,IAAO,gBAAQ;;;AChHf,IAAM,YAAN,MAAgB;AAAA,EAEZ;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAEA,YAAY,SAA+B;AACvC,SAAK,WAAW,IAAI,iBAAS,OAAO;AACpC,SAAK,WAAW,IAAI,iBAAS,OAAO;AACpC,SAAK,QAAQ,IAAI,cAAM,OAAO;AAC9B,SAAK,SAAS,IAAI,eAAO,OAAO;AAChC,SAAK,WAAW,IAAI,iBAAS,OAAO;AACpC,SAAK,WAAW,IAAI,iBAAS,OAAO;AACpC,SAAK,gBAAgB,IAAI,sBAAc,OAAO;AAAA,EAClD;AAKJ;AAEA,IAAO,oBAAQ;;;AC/Bf,IAAO,gBAAQ;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../src/services/APIClient.ts","../src/services/api-wrappers/Category.ts","../src/services/api-wrappers/CompoundQuery.ts","../src/services/api-wrappers/DataItem.ts","../src/services/api-wrappers/Headless.ts","../src/services/api-wrappers/Reaction.ts","../src/services/api-wrappers/Review.ts","../src/services/api-wrappers/Space.ts","../src/services/GarchiCMS.ts","../src/index.ts"],"sourcesContent":["import axios, { AxiosInstance } from \"axios\";\nimport { GarchiCMSInitOptions } from \"../types\";\n\nclass APIClient {\n\n client: AxiosInstance\n\n\n constructor(options: GarchiCMSInitOptions | null) {\n \n this.client = axios.create({\n baseURL: \"https://garchi.co.uk/api/v2\",\n headers: {\n \"Content-Type\": \"application/json\",\n \"Accept\": \"application/json\",\n \"Authorization\": `Bearer ${options?.api_key || process.env.GARCHI_API_KEY}`,\n ...options?.headers\n }\n })\n\n }\n}\n\nexport default APIClient;","import { CreateCategoryParams, DeleteCategoryParams, GarchiCategory, UpdateCategoryParams } from \"../../types\";\nimport APIClient from \"../APIClient\";\n\nclass Category extends APIClient {\n\n async create(params: CreateCategoryParams) : Promise<GarchiCategory> {\n try {\n const response = await this.client.post(\"/category\", params);\n let data = response.data as {\n data: GarchiCategory\n }\n return data.data;\n } catch (error: any) {\n throw error.response?.data || new Error(\"Network Error\");\n }\n }\n\n async delete(params: DeleteCategoryParams) : Promise<string> {\n try {\n const response = await this.client.post(`/delete/category/${params.space_uid}/${params.category_id}`);\n const data = response.data as {\n data: string\n }\n return data.data;\n }\n catch (error: any) {\n throw error.response?.data || new Error(\"Network Error\");\n }\n }\n\n async update(params: UpdateCategoryParams) : Promise<string> {\n try {\n const response = await this.client.post(`/update/category/${params.category_id}`, {\n space_uid: params.space_uid,\n category: params.category\n });\n const data = response.data as {\n data: string\n }\n return data.data;\n }\n catch (error: any) {\n throw error.response?.data || new Error(\"Network Error\");\n }\n }\n\n async getAll() : Promise<GarchiCategory[]> {\n try {\n const response = await this.client.get(\"/categories\");\n const data = response.data as {\n data: GarchiCategory[]\n }\n return data.data;\n }\n catch (error: any) {\n throw error.response?.data || new Error(\"Network Error\");\n }\n }\n}\n\nexport default Category;","import { CompoundQueryBody, GarchiCategoryAPIResponse, GarchiItemAPIResponse, GarchiReview, ItemsQueryParams, PaginatedResponse } from \"../../types\";\nimport APIClient from \"../APIClient\";\n\nclass CompoundQuery extends APIClient {\n async query(body: CompoundQueryBody, params: ItemsQueryParams) : Promise<GarchiItemAPIResponse | GarchiCategoryAPIResponse | \n PaginatedResponse<GarchiReview>>\n {\n try {\n const response = await this.client.post(`/compound_query`, body, {\n params\n });\n return response.data as GarchiItemAPIResponse | GarchiCategoryAPIResponse | PaginatedResponse<GarchiReview>;\n } catch (error: any) {\n throw error.response?.data || new Error(\"Network Error\");\n }\n }\n} \n\nexport default CompoundQuery;","\n\nimport { CreateDataItemParams, CreateMetaInfoParams, DeleteDataItemParams, DeleteMetaInfoParams, FilterItemsByMetaParams, FilterItemsParams, GarchiItem, GarchiItemAPIResponse, GarchiItemMeta, GetAllItemsParams, GetFeaturedItemsParams, GetItemChildrenParams, GetItemParams, GetItemsByIdsParams, GetItemsBySpaceParams, QueryItemsParams, SemanticSearchParams, UpdateDataItemParams, UpdateMetaInfoParams } from \"../../types\";\nimport APIClient from \"../APIClient\";\n\nclass DataItem extends APIClient {\n\n\n async create(params: CreateDataItemParams): Promise<GarchiItem> {\n try {\n const response = await this.client.post(\"/item\", params);\n let data = response.data as {\n data: GarchiItem\n }\n return data.data;\n } catch (error: any) {\n throw error.response?.data || new Error(\"Network Error\");\n }\n }\n\n async delete(params: DeleteDataItemParams): Promise<string> {\n try {\n const response = await this.client.post(`/delete/item`, params);\n const data = response.data as {\n data: string\n }\n return data.data;\n } catch (error: any) {\n throw error.response?.data || new Error(\"Network Error\");\n }\n }\n\n\n async update(params: UpdateDataItemParams): Promise<string> {\n try {\n const response = await this.client.post(`/update/item`, params);\n const data = response.data as {\n data: string\n }\n return data.data;\n } catch (error: any) {\n throw error.response?.data || new Error(\"Network Error\");\n }\n }\n\n async createMetaInfo(params: CreateMetaInfoParams): Promise<GarchiItemMeta[]> {\n try {\n const response = await this.client.post(`/item_meta`, params);\n const data = response.data as {\n data: GarchiItemMeta[]\n }\n return data.data;\n }\n catch (error: any) {\n throw error.response?.data || new Error(\"Network Error\");\n }\n }\n\n async deleteMetaInfo(params: DeleteMetaInfoParams): Promise<string> {\n try {\n const response = await this.client.post(`/delete/item_meta`, params);\n const data = response.data as {\n data: string\n }\n return data.data;\n } catch (error: any) {\n throw error.response?.data || new Error(\"Network Error\");\n }\n }\n\n async updateMetaInfo(params: UpdateMetaInfoParams): Promise<string> {\n try {\n const response = await this.client.post(`/update/item_meta`, params);\n const data = response.data as {\n data: string\n }\n return data.data;\n } catch (error: any) {\n throw error.response?.data || new Error(\"Network Error\");\n }\n }\n\n async getBySpace(params: GetItemsBySpaceParams): Promise<GarchiItemAPIResponse> {\n try {\n const response = await this.client.get(`/space/${params.uid}/items`, {\n params: params\n });\n const data = response.data as GarchiItemAPIResponse;\n return data;\n }\n catch (error: any) {\n throw error.response?.data || new Error(\"Network Error\");\n }\n }\n\n async semanticSearch(params: SemanticSearchParams): Promise<GarchiItem[]> {\n try {\n const response = await this.client.get(`/items/semantic-search`, {\n params: params\n });\n const data = response.data as GarchiItemAPIResponse;\n return data.data;\n }\n catch (error: any) {\n throw error.response?.data || new Error(\"Network Error\");\n }\n }\n\n async featured(params: GetFeaturedItemsParams) : Promise<GarchiItemAPIResponse> {\n try {\n const response = await this.client.get(`/items/featured`, {\n params: params\n });\n const data = response.data as GarchiItemAPIResponse;\n return data;\n }\n catch (error: any) {\n throw error.response?.data || new Error(\"Network Error\");\n }\n }\n\n async get(params: GetItemParams): Promise<GarchiItem> {\n try {\n const response = await this.client.get(`/item/${params.item}`, {\n params: params,\n });\n const data = response.data as GarchiItemAPIResponse\n return data.data[0] as GarchiItem;\n }\n catch (error: any) {\n throw error.response?.data || new Error(\"Network Error\");\n }\n }\n\n\n async getAll(params: GetAllItemsParams): Promise<GarchiItemAPIResponse> {\n try {\n const response = await this.client.get(`/items`, {\n params: params\n });\n const data = response.data as GarchiItemAPIResponse;\n return data;\n }\n catch (error: any) {\n throw error.response?.data || new Error(\"Network Error\");\n\n }\n }\n\n async filter(params: FilterItemsParams) : Promise<GarchiItem[]> {\n try {\n const response = await this.client.post(`/items/filter`, params.body, {\n params: params.query\n });\n const data = response.data as GarchiItemAPIResponse;\n return data.data;\n }\n catch (error: any) {\n throw error.response?.data || new Error(\"Network Error\");\n }\n\n }\n\n async filterByMeta(params: FilterItemsByMetaParams) : Promise<GarchiItem[]> {\n try {\n const response = await this.client.post(`/items/filter/bymeta`, params.body, {\n params: params.query\n });\n const data = response.data as GarchiItemAPIResponse;\n return data.data;\n }\n catch (error: any) {\n throw error.response?.data || new Error(\"Network Error\");\n }\n }\n\n async getByIds(params: GetItemsByIdsParams) : Promise<GarchiItemAPIResponse> {\n try {\n const response = await this.client.post(`/items/byids`, params.body, {\n params: params.query\n });\n const data = response.data as GarchiItemAPIResponse;\n return data;\n }\n catch (error: any) {\n throw error.response?.data || new Error(\"Network Error\");\n }\n }\n\n /**\n * Query the published items of a space with conditions on their fields and\n * metadata, including nested JSON values. See the API docs for the operators.\n */\n async query(params: QueryItemsParams): Promise<GarchiItemAPIResponse> {\n try {\n const { uid, ...body } = params;\n const response = await this.client.post(`/space/${uid}/items/query`, body);\n return response.data as GarchiItemAPIResponse;\n }\n catch (error: any) {\n throw error.response?.data || new Error(\"Network Error\");\n }\n }\n\n /**\n * The published items inside an item (variants of a product, lessons of a\n * course), in their order. The parent itself must be published.\n */\n async getChildren(params: GetItemChildrenParams): Promise<GarchiItemAPIResponse> {\n try {\n const { uid, item, ...query } = params;\n const response = await this.client.get(`/space/${uid}/items/${encodeURIComponent(String(item))}/children`, {\n params: query\n });\n return response.data as GarchiItemAPIResponse;\n }\n catch (error: any) {\n throw error.response?.data || new Error(\"Network Error\");\n }\n }\n}\n\n\nexport default DataItem;","import { BlankSectionRequest, BlankSectionResponse, CreateOrUpdateSectionTemplateParams, CreatePageRequest, CreatePageResponse, GarchiAsset, GarchiPage, GetPageParams } from \"../../types\";\nimport APIClient from \"../APIClient\";\n\nclass Headless extends APIClient {\n\n async getAsset(file_name: string, space_uid: string) : Promise<GarchiAsset> {\n try {\n const response = await this.client.get(`/space/assets/${file_name}`, {\n params: {\n space_uid\n }\n });\n return response.data as GarchiAsset;\n } catch (error: any) {\n throw error.response?.data || new Error(\"Network Error\");\n }\n }\n\n async getPage(params: GetPageParams) : Promise<GarchiPage> {\n try {\n const response = await this.client.post(`/page`, params);\n return response.data as GarchiPage;\n }\n catch (error: any) {\n throw error.response?.data || new Error(\"Network Error\");\n }\n }\n\n async createOrUpdateSectionTemplates(params: CreateOrUpdateSectionTemplateParams) : Promise<string> {\n try {\n const response = await this.client.post(`/section_template`, params);\n return response.data as string;\n }\n catch (error: any) {\n throw error.response?.data || new Error(\"Network Error\");\n }\n }\n\n async addPage(params: CreatePageRequest) : Promise<CreatePageResponse>\n {\n try {\n const response = await this.client.post(`/space/${params.space_uid}/create_page`, {\n title: params.title,\n path: params.path,\n description: params.description,\n })\n return response.data as CreatePageResponse;\n }\n catch (error: any) {\n throw error.response?.data || new Error(\"Network Error\");\n }\n }\n\n async addBlankSectionToPage(params: BlankSectionRequest) : Promise<BlankSectionResponse>\n {\n try {\n const response = await this.client.post('/page/add_blank_section', {\n section_template_id: params.section_template_id,\n parent_id: params.parent_id,\n page_id: params.page_id,\n })\n return response.data as BlankSectionResponse;\n }\n catch (error: any) {\n throw error.response?.data || new Error(\"Network Error\");\n }\n }\n \n \n}\n\nexport default Headless;","import { GarchiReaction, GarchiReactionCreate } from \"../../types\";\nimport APIClient from \"../APIClient\";\n\nclass Reaction extends APIClient {\n async manage(params: GarchiReactionCreate) : Promise<GarchiReaction> {\n try {\n const response = await this.client.post(\"/manage-reaction\", params);\n let data = response.data as {\n data: GarchiReaction\n }\n return data.data;\n } catch (error: any) {\n throw error.response?.data || new Error(\"Network Error\");\n }\n }\n}\n\nexport default Reaction;","import { GarchiReview, GarchiReviewCreate, PaginateQueryParams, GarchiReviewUpdate, PaginatedResponse } from \"../../types\";\nimport APIClient from \"../APIClient\";\n\nclass Review extends APIClient{\n async create(params: GarchiReviewCreate): Promise<GarchiReview> {\n try {\n const response = await this.client.post('/reviews/item', params);\n const data = response.data as {\n data: GarchiReview\n }\n return data.data;\n }\n catch (error: any) {\n throw error.response?.data || new Error(\"Network Error\");\n }\n }\n\n async update(params: GarchiReviewUpdate): Promise<string> {\n try {\n const response = await this.client.post('/reviews/edit', params);\n const data = response.data as {\n message: string\n }\n return data.message;\n }\n catch (error: any) {\n throw error.response?.data || new Error(\"Network Error\");\n }\n }\n\n async delete(review_id: number): Promise<string> {\n try {\n const response = await this.client.post(`/reviews/delete`, {\n review_id\n });\n const data = response.data as {\n message: string\n }\n return data.message;\n }\n catch (error: any) {\n throw error.response?.data || new Error(\"Network Error\");\n }\n }\n\n async getByItem(item_id: number | string, queryParams: PaginateQueryParams) : Promise<PaginatedResponse<GarchiReview>> {\n try {\n const response = await this.client.get(`/reviews/item/${item_id}`, {\n params: queryParams\n });\n const data = response.data as PaginatedResponse<GarchiReview>;\n return data;\n }\n catch (error: any) {\n throw error.response?.data || new Error(\"Network Error\");\n }\n }\n}\n\nexport default Review;","import { CreatePageResponse, GarchiCategory, GarchiSpace, GarchiSpaceAPIResponse, GarchiSpaceCreate, PaginatedResponse, PaginateQueryParams, SectionTemplate } from \"../../types\";\nimport APIClient from \"../APIClient\";\n\nclass Space extends APIClient {\n \n\n async categories(space_uid: string) : Promise<GarchiCategory[]> {\n try {\n const response = await this.client.get(`/space/${space_uid}/categories`);\n const data = response.data as {\n data: GarchiCategory[]\n }\n return data.data;\n }\n catch (error: any) {\n throw error.response?.data || new Error(\"Network Error\");\n }\n }\n\n async getAll(params: PaginateQueryParams) : Promise<GarchiSpaceAPIResponse> {\n try {\n const response = await this.client.get('/spaces', {\n params\n });\n const data = response.data as GarchiSpaceAPIResponse;\n return data;\n }\n catch (error: any) {\n throw error.response?.data || new Error(\"Network Error\");\n }\n } \n \n async get(space_uid: string) : Promise<GarchiSpace> {\n try {\n const response = await this.client.get(`/space/${space_uid}`);\n const data = response.data as {\n data: GarchiSpace\n }\n return data.data;\n }\n catch (error: any) {\n throw error.response?.data || new Error(\"Network Error\");\n }\n }\n\n async create(params: GarchiSpaceCreate): Promise<GarchiSpace> {\n try {\n const formData = new FormData()\n formData.append('name', params.name)\n if(params.logo) {\n formData.append('logo', params.logo)\n }\n const response = await this.client.post('/space', formData);\n const data = response.data as {\n data: GarchiSpace\n }\n return data.data;\n }\n catch (error: any) {\n throw error.response?.data || new Error(\"Network Error\");\n }\n }\n\n async update(space_uid: string, params: {\n name?: string,\n logo?: File\n }) : Promise<string> {\n try {\n const formData = new FormData();\n if(params.name) {\n formData.append('name', params.name)\n }\n if(params.logo) {\n formData.append('logo', params.logo)\n }\n const response = await this.client.post(`/update/space/${space_uid}`, formData);\n const data = response.data as {\n data: string\n }\n return data.data;\n }\n catch (error: any) {\n throw error.response?.data || new Error(\"Network Error\");\n }\n }\n\n async delete(space_uid: string) : Promise<string> {\n try {\n const response = await this.client.delete(`/delete/space/${space_uid}`);\n const data = response.data as {\n data: string\n }\n return data.data;\n }\n catch (error: any) {\n throw error.response?.data || new Error(\"Network Error\");\n }\n }\n\n async listPages(space_uid: string) : Promise<CreatePageResponse[]> {\n try {\n const response = await this.client.get(`/space/${space_uid}/pages`);\n const data = response.data\n return data as CreatePageResponse[];\n }\n catch (error: any) {\n throw error.response?.data || new Error(\"Network Error\");\n }\n }\n\n async listSectionTemplates(space_uid: string) : Promise<SectionTemplate[]> {\n try {\n const response = await this.client.get(`/space/${space_uid}/section_templates`);\n const data = response.data\n return data as SectionTemplate[];\n }\n catch (error: any) {\n throw error.response?.data || new Error(\"Network Error\");\n }\n }\n\n}\nexport default Space;","import { GarchiCMSInitOptions } from \"../types\";\nimport Category from \"./api-wrappers/Category\";\nimport CompoundQuery from \"./api-wrappers/CompoundQuery\";\nimport DataItem from \"./api-wrappers/DataItem\";\nimport Headless from \"./api-wrappers/Headless\";\nimport Reaction from \"./api-wrappers/Reaction\";\nimport Review from \"./api-wrappers/Review\";\nimport Space from \"./api-wrappers/Space\";\n\n\nclass GarchiCMS {\n\n dataItem: DataItem\n category: Category\n space: Space\n review: Review\n headless: Headless\n reaction: Reaction\n compoundQuery: CompoundQuery\n \n constructor(options: GarchiCMSInitOptions) {\n this.dataItem = new DataItem(options)\n this.category = new Category(options)\n this.space = new Space(options)\n this.review = new Review(options) \n this.headless = new Headless(options)\n this.reaction = new Reaction(options)\n this.compoundQuery = new CompoundQuery(options)\n }\n\n \n\n \n}\n\nexport default GarchiCMS","import GarchiCMS from \"./services/GarchiCMS\";\n\n\n\nexport default GarchiCMS;\n\n\nexport * from \"./types/index\";\n\n"],"mappings":";AAAA,OAAO,WAA8B;AAGrC,IAAM,YAAN,MAAgB;AAAA,EAEZ;AAAA,EAGA,YAAY,SAAsC;AAE9C,SAAK,SAAS,MAAM,OAAO;AAAA,MACvB,SAAS;AA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