@back23/promptly-sdk 2.0.0 → 2.1.0
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 +56 -9
- package/dist/index.js +34 -34
- package/dist/index.mjs +34 -34
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -15,10 +15,40 @@ import { Promptly } from '@back23/promptly-sdk';
|
|
|
15
15
|
|
|
16
16
|
const client = new Promptly({
|
|
17
17
|
tenantId: 'demo',
|
|
18
|
-
|
|
18
|
+
apiKey: 'pky_your_api_key_here', // Required - Get from Dashboard > Settings > API Tokens
|
|
19
|
+
baseUrl: 'https://promptly.webbyon.com', // Optional
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
// All API calls require API key
|
|
23
|
+
const { data: posts } = await client.blog.list();
|
|
24
|
+
const products = await client.shop.listProducts();
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## v2.0.0 Breaking Changes
|
|
28
|
+
|
|
29
|
+
### API Key Required
|
|
30
|
+
|
|
31
|
+
**All API requests now require an API key.** There are no public APIs - this ensures security and proper tenant isolation.
|
|
32
|
+
|
|
33
|
+
```typescript
|
|
34
|
+
// ❌ v1.x - apiKey was optional
|
|
35
|
+
const client = new Promptly({
|
|
36
|
+
tenantId: 'demo',
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
// ✅ v2.0 - apiKey is REQUIRED
|
|
40
|
+
const client = new Promptly({
|
|
41
|
+
tenantId: 'demo',
|
|
42
|
+
apiKey: 'pky_xxxxxxxxxxxxxxxxxxxxxxxx',
|
|
19
43
|
});
|
|
20
44
|
```
|
|
21
45
|
|
|
46
|
+
Get your API key from: **Dashboard > Settings > API Tokens**
|
|
47
|
+
|
|
48
|
+
The SDK automatically includes the `X-API-Key` header in all requests.
|
|
49
|
+
|
|
50
|
+
---
|
|
51
|
+
|
|
22
52
|
## v1.3.0 Changes
|
|
23
53
|
|
|
24
54
|
### Unified Response Structure
|
|
@@ -53,10 +83,11 @@ data.map(post => ...); // data is always an array
|
|
|
53
83
|
|
|
54
84
|
## API Overview
|
|
55
85
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
|
59
|
-
|
|
86
|
+
> **Note:** All APIs require API key (v2.0+). "Auth Required" means additional member login token is needed.
|
|
87
|
+
|
|
88
|
+
| Resource | Read Operations | Write Operations (Auth Required) |
|
|
89
|
+
|----------|-----------------|----------------------------------|
|
|
90
|
+
| **Boards** | list, get, listPosts, getPost, listComments | createPost, updatePost, deletePost |
|
|
60
91
|
| **Comments** | listComments | createComment, updateComment, deleteComment |
|
|
61
92
|
| **Blog** | list, get, featured, byCategory, byTag | - |
|
|
62
93
|
| **Shop** | listProducts, getProduct, listCategories | getCart, addToCart, listOrders, createOrder |
|
|
@@ -68,7 +99,7 @@ data.map(post => ...); // data is always an array
|
|
|
68
99
|
|
|
69
100
|
## API Reference
|
|
70
101
|
|
|
71
|
-
### Boards (게시판)
|
|
102
|
+
### Boards (게시판)
|
|
72
103
|
|
|
73
104
|
```typescript
|
|
74
105
|
// 게시판 목록
|
|
@@ -134,7 +165,7 @@ await client.boards.updateComment(commentId, {
|
|
|
134
165
|
await client.boards.deleteComment(commentId);
|
|
135
166
|
```
|
|
136
167
|
|
|
137
|
-
### Blog (블로그)
|
|
168
|
+
### Blog (블로그)
|
|
138
169
|
|
|
139
170
|
```typescript
|
|
140
171
|
// 블로그 글 목록
|
|
@@ -400,7 +431,7 @@ const response = await client.auth.socialCallback('google', code);
|
|
|
400
431
|
// Returns: { member: Member, token: string }
|
|
401
432
|
```
|
|
402
433
|
|
|
403
|
-
### Forms (폼)
|
|
434
|
+
### Forms (폼)
|
|
404
435
|
|
|
405
436
|
```typescript
|
|
406
437
|
// 폼 목록
|
|
@@ -529,7 +560,7 @@ await customers.create({
|
|
|
529
560
|
});
|
|
530
561
|
```
|
|
531
562
|
|
|
532
|
-
### Site Settings
|
|
563
|
+
### Site Settings
|
|
533
564
|
|
|
534
565
|
```typescript
|
|
535
566
|
// 테마 설정
|
|
@@ -543,6 +574,21 @@ const settings = await client.getSettings();
|
|
|
543
574
|
|
|
544
575
|
## Types
|
|
545
576
|
|
|
577
|
+
### Configuration
|
|
578
|
+
|
|
579
|
+
```typescript
|
|
580
|
+
interface PromptlyConfig {
|
|
581
|
+
/** Tenant ID (subdomain) */
|
|
582
|
+
tenantId: string;
|
|
583
|
+
/** API key (required) - Get from Dashboard > Settings > API Tokens */
|
|
584
|
+
apiKey: string;
|
|
585
|
+
/** Base URL of Promptly API (optional) */
|
|
586
|
+
baseUrl?: string;
|
|
587
|
+
/** Request timeout in milliseconds (optional) */
|
|
588
|
+
timeout?: number;
|
|
589
|
+
}
|
|
590
|
+
```
|
|
591
|
+
|
|
546
592
|
### Common Types
|
|
547
593
|
|
|
548
594
|
```typescript
|
|
@@ -720,6 +766,7 @@ import { Promptly } from '@back23/promptly-sdk';
|
|
|
720
766
|
|
|
721
767
|
const client = new Promptly({
|
|
722
768
|
tenantId: 'demo',
|
|
769
|
+
apiKey: process.env.NEXT_PUBLIC_PROMPTLY_API_KEY!, // Required
|
|
723
770
|
baseUrl: 'https://promptly.webbyon.com',
|
|
724
771
|
});
|
|
725
772
|
|
package/dist/index.js
CHANGED
|
@@ -379,29 +379,29 @@ var BoardsResource = class {
|
|
|
379
379
|
* @returns ListResponse with data array (always defined) and pagination meta
|
|
380
380
|
*/
|
|
381
381
|
async list(params) {
|
|
382
|
-
return this.http.getList("/
|
|
382
|
+
return this.http.getList("/boards", params);
|
|
383
383
|
}
|
|
384
384
|
/**
|
|
385
385
|
* Get board by ID or slug
|
|
386
386
|
*/
|
|
387
387
|
async get(idOrSlug) {
|
|
388
|
-
return this.http.get(`/
|
|
388
|
+
return this.http.get(`/boards/${idOrSlug}`);
|
|
389
389
|
}
|
|
390
390
|
// ============================================
|
|
391
|
-
// Posts
|
|
391
|
+
// Posts
|
|
392
392
|
// ============================================
|
|
393
393
|
/**
|
|
394
394
|
* List posts in a board
|
|
395
395
|
* @returns ListResponse with data array and pagination meta
|
|
396
396
|
*/
|
|
397
397
|
async listPosts(boardIdOrSlug, params) {
|
|
398
|
-
return this.http.getList(`/
|
|
398
|
+
return this.http.getList(`/boards/${boardIdOrSlug}/posts`, params);
|
|
399
399
|
}
|
|
400
400
|
/**
|
|
401
401
|
* Get post by ID
|
|
402
402
|
*/
|
|
403
403
|
async getPost(postId) {
|
|
404
|
-
return this.http.get(`/
|
|
404
|
+
return this.http.get(`/posts/${postId}`);
|
|
405
405
|
}
|
|
406
406
|
// ============================================
|
|
407
407
|
// Posts (Protected - requires auth)
|
|
@@ -432,7 +432,7 @@ var BoardsResource = class {
|
|
|
432
432
|
* @returns Array of comments (always an array, never null/undefined)
|
|
433
433
|
*/
|
|
434
434
|
async listComments(postId) {
|
|
435
|
-
const response = await this.http.getList(`/
|
|
435
|
+
const response = await this.http.getList(`/posts/${postId}/comments`);
|
|
436
436
|
return response.data;
|
|
437
437
|
}
|
|
438
438
|
/**
|
|
@@ -465,26 +465,26 @@ var BlogResource = class {
|
|
|
465
465
|
* @returns ListResponse with data array (always defined) and pagination meta
|
|
466
466
|
*/
|
|
467
467
|
async list(params) {
|
|
468
|
-
return this.http.getList("/
|
|
468
|
+
return this.http.getList("/blog", params);
|
|
469
469
|
}
|
|
470
470
|
/**
|
|
471
471
|
* Get blog post by slug
|
|
472
472
|
*/
|
|
473
473
|
async get(slug) {
|
|
474
|
-
return this.http.get(`/
|
|
474
|
+
return this.http.get(`/blog/${slug}`);
|
|
475
475
|
}
|
|
476
476
|
/**
|
|
477
477
|
* Get blog post by ID
|
|
478
478
|
*/
|
|
479
479
|
async getById(id) {
|
|
480
|
-
return this.http.get(`/
|
|
480
|
+
return this.http.get(`/blog/id/${id}`);
|
|
481
481
|
}
|
|
482
482
|
/**
|
|
483
483
|
* Get featured blog posts
|
|
484
484
|
* @returns Array of featured posts (always an array, never null/undefined)
|
|
485
485
|
*/
|
|
486
486
|
async featured(limit = 5) {
|
|
487
|
-
const response = await this.http.getList("/
|
|
487
|
+
const response = await this.http.getList("/blog", {
|
|
488
488
|
per_page: limit,
|
|
489
489
|
featured: true
|
|
490
490
|
});
|
|
@@ -495,7 +495,7 @@ var BlogResource = class {
|
|
|
495
495
|
* @returns ListResponse with data array and pagination meta
|
|
496
496
|
*/
|
|
497
497
|
async byCategory(category, params) {
|
|
498
|
-
return this.http.getList("/
|
|
498
|
+
return this.http.getList("/blog", {
|
|
499
499
|
...params,
|
|
500
500
|
category
|
|
501
501
|
});
|
|
@@ -505,7 +505,7 @@ var BlogResource = class {
|
|
|
505
505
|
* @returns ListResponse with data array and pagination meta
|
|
506
506
|
*/
|
|
507
507
|
async byTag(tag, params) {
|
|
508
|
-
return this.http.getList("/
|
|
508
|
+
return this.http.getList("/blog", {
|
|
509
509
|
...params,
|
|
510
510
|
tag
|
|
511
511
|
});
|
|
@@ -515,7 +515,7 @@ var BlogResource = class {
|
|
|
515
515
|
* @returns ListResponse with data array and pagination meta
|
|
516
516
|
*/
|
|
517
517
|
async search(query, params) {
|
|
518
|
-
return this.http.getList("/
|
|
518
|
+
return this.http.getList("/blog", {
|
|
519
519
|
...params,
|
|
520
520
|
search: query
|
|
521
521
|
});
|
|
@@ -525,7 +525,7 @@ var BlogResource = class {
|
|
|
525
525
|
* @returns Array of category names (always an array)
|
|
526
526
|
*/
|
|
527
527
|
async categories() {
|
|
528
|
-
const response = await this.http.get("/
|
|
528
|
+
const response = await this.http.get("/blog/categories");
|
|
529
529
|
return Array.isArray(response) ? response : response?.data ?? [];
|
|
530
530
|
}
|
|
531
531
|
/**
|
|
@@ -533,7 +533,7 @@ var BlogResource = class {
|
|
|
533
533
|
* @returns Array of tag names (always an array)
|
|
534
534
|
*/
|
|
535
535
|
async tags() {
|
|
536
|
-
const response = await this.http.get("/
|
|
536
|
+
const response = await this.http.get("/blog/tags");
|
|
537
537
|
return Array.isArray(response) ? response : response?.data ?? [];
|
|
538
538
|
}
|
|
539
539
|
};
|
|
@@ -548,19 +548,19 @@ var FormsResource = class {
|
|
|
548
548
|
* @returns ListResponse with data array and pagination meta
|
|
549
549
|
*/
|
|
550
550
|
async list(params) {
|
|
551
|
-
return this.http.getList("/
|
|
551
|
+
return this.http.getList("/forms", params);
|
|
552
552
|
}
|
|
553
553
|
/**
|
|
554
554
|
* Get form by ID or slug
|
|
555
555
|
*/
|
|
556
556
|
async get(idOrSlug) {
|
|
557
|
-
return this.http.get(`/
|
|
557
|
+
return this.http.get(`/forms/${idOrSlug}`);
|
|
558
558
|
}
|
|
559
559
|
/**
|
|
560
560
|
* Submit form data
|
|
561
561
|
*/
|
|
562
562
|
async submit(formIdOrSlug, data) {
|
|
563
|
-
return this.http.post(`/
|
|
563
|
+
return this.http.post(`/forms/${formIdOrSlug}/submit`, data);
|
|
564
564
|
}
|
|
565
565
|
// ============================================
|
|
566
566
|
// Protected endpoints (requires auth)
|
|
@@ -593,20 +593,20 @@ var ShopResource = class {
|
|
|
593
593
|
* @returns ListResponse with data array and pagination meta
|
|
594
594
|
*/
|
|
595
595
|
async listProducts(params) {
|
|
596
|
-
return this.http.getList("/
|
|
596
|
+
return this.http.getList("/products", params);
|
|
597
597
|
}
|
|
598
598
|
/**
|
|
599
599
|
* Get product by ID or slug
|
|
600
600
|
*/
|
|
601
601
|
async getProduct(idOrSlug) {
|
|
602
|
-
return this.http.get(`/
|
|
602
|
+
return this.http.get(`/products/${idOrSlug}`);
|
|
603
603
|
}
|
|
604
604
|
/**
|
|
605
605
|
* Get featured products
|
|
606
606
|
* @returns Array of featured products (always an array)
|
|
607
607
|
*/
|
|
608
608
|
async featuredProducts(limit = 8) {
|
|
609
|
-
const response = await this.http.getList("/
|
|
609
|
+
const response = await this.http.getList("/products", {
|
|
610
610
|
per_page: limit,
|
|
611
611
|
is_featured: true
|
|
612
612
|
});
|
|
@@ -617,7 +617,7 @@ var ShopResource = class {
|
|
|
617
617
|
* @returns ListResponse with data array and pagination meta
|
|
618
618
|
*/
|
|
619
619
|
async searchProducts(query, params) {
|
|
620
|
-
return this.http.getList("/
|
|
620
|
+
return this.http.getList("/products", {
|
|
621
621
|
...params,
|
|
622
622
|
search: query
|
|
623
623
|
});
|
|
@@ -630,21 +630,21 @@ var ShopResource = class {
|
|
|
630
630
|
* @returns Array of categories (always an array)
|
|
631
631
|
*/
|
|
632
632
|
async listCategories() {
|
|
633
|
-
const response = await this.http.getList("/
|
|
633
|
+
const response = await this.http.getList("/categories");
|
|
634
634
|
return response.data;
|
|
635
635
|
}
|
|
636
636
|
/**
|
|
637
637
|
* Get category by ID or slug
|
|
638
638
|
*/
|
|
639
639
|
async getCategory(idOrSlug) {
|
|
640
|
-
return this.http.get(`/
|
|
640
|
+
return this.http.get(`/categories/${idOrSlug}`);
|
|
641
641
|
}
|
|
642
642
|
/**
|
|
643
643
|
* Get products in category
|
|
644
644
|
* @returns ListResponse with data array and pagination meta
|
|
645
645
|
*/
|
|
646
646
|
async categoryProducts(categoryIdOrSlug, params) {
|
|
647
|
-
return this.http.getList(`/
|
|
647
|
+
return this.http.getList(`/categories/${categoryIdOrSlug}/products`, params);
|
|
648
648
|
}
|
|
649
649
|
// ============================================
|
|
650
650
|
// Cart
|
|
@@ -817,7 +817,7 @@ var EntitiesResource = class {
|
|
|
817
817
|
* ```
|
|
818
818
|
*/
|
|
819
819
|
async list() {
|
|
820
|
-
const response = await this.http.getList("/
|
|
820
|
+
const response = await this.http.getList("/entities");
|
|
821
821
|
return response.data;
|
|
822
822
|
}
|
|
823
823
|
/**
|
|
@@ -830,7 +830,7 @@ var EntitiesResource = class {
|
|
|
830
830
|
* ```
|
|
831
831
|
*/
|
|
832
832
|
async getSchema(slug) {
|
|
833
|
-
return this.http.get(`/
|
|
833
|
+
return this.http.get(`/entities/${slug}/schema`);
|
|
834
834
|
}
|
|
835
835
|
// ============================================
|
|
836
836
|
// Records (Public Read)
|
|
@@ -858,7 +858,7 @@ var EntitiesResource = class {
|
|
|
858
858
|
* ```
|
|
859
859
|
*/
|
|
860
860
|
async listRecords(slug, params) {
|
|
861
|
-
return this.http.getList(`/
|
|
861
|
+
return this.http.getList(`/entities/${slug}`, params);
|
|
862
862
|
}
|
|
863
863
|
/**
|
|
864
864
|
* Get a single record by ID
|
|
@@ -870,7 +870,7 @@ var EntitiesResource = class {
|
|
|
870
870
|
* ```
|
|
871
871
|
*/
|
|
872
872
|
async getRecord(slug, id) {
|
|
873
|
-
return this.http.get(`/
|
|
873
|
+
return this.http.get(`/entities/${slug}/${id}`);
|
|
874
874
|
}
|
|
875
875
|
// ============================================
|
|
876
876
|
// Records (Protected - requires auth)
|
|
@@ -990,14 +990,14 @@ var ReservationResource = class {
|
|
|
990
990
|
* @returns Reservation settings for the tenant
|
|
991
991
|
*/
|
|
992
992
|
async getSettings() {
|
|
993
|
-
return this.http.get("/
|
|
993
|
+
return this.http.get("/reservation/settings");
|
|
994
994
|
}
|
|
995
995
|
/**
|
|
996
996
|
* List available services
|
|
997
997
|
* @returns Array of services (always an array)
|
|
998
998
|
*/
|
|
999
999
|
async listServices() {
|
|
1000
|
-
const response = await this.http.getList("/
|
|
1000
|
+
const response = await this.http.getList("/reservation/services");
|
|
1001
1001
|
return response.data;
|
|
1002
1002
|
}
|
|
1003
1003
|
/**
|
|
@@ -1007,7 +1007,7 @@ var ReservationResource = class {
|
|
|
1007
1007
|
*/
|
|
1008
1008
|
async listStaff(serviceId) {
|
|
1009
1009
|
const params = serviceId ? { service_id: serviceId } : void 0;
|
|
1010
|
-
const response = await this.http.getList("/
|
|
1010
|
+
const response = await this.http.getList("/reservation/staffs", params);
|
|
1011
1011
|
return response.data;
|
|
1012
1012
|
}
|
|
1013
1013
|
/**
|
|
@@ -1015,7 +1015,7 @@ var ReservationResource = class {
|
|
|
1015
1015
|
* @returns Array of available date strings (YYYY-MM-DD)
|
|
1016
1016
|
*/
|
|
1017
1017
|
async getAvailableDates(params) {
|
|
1018
|
-
const response = await this.http.get("/
|
|
1018
|
+
const response = await this.http.get("/reservation/available-dates", params);
|
|
1019
1019
|
return Array.isArray(response) ? response : response?.data ?? [];
|
|
1020
1020
|
}
|
|
1021
1021
|
/**
|
|
@@ -1023,7 +1023,7 @@ var ReservationResource = class {
|
|
|
1023
1023
|
* @returns Array of available slots (always an array)
|
|
1024
1024
|
*/
|
|
1025
1025
|
async getAvailableSlots(params) {
|
|
1026
|
-
const response = await this.http.get("/
|
|
1026
|
+
const response = await this.http.get("/reservation/available-slots", params);
|
|
1027
1027
|
return Array.isArray(response) ? response : response?.data ?? [];
|
|
1028
1028
|
}
|
|
1029
1029
|
// ============================================
|
package/dist/index.mjs
CHANGED
|
@@ -351,29 +351,29 @@ var BoardsResource = class {
|
|
|
351
351
|
* @returns ListResponse with data array (always defined) and pagination meta
|
|
352
352
|
*/
|
|
353
353
|
async list(params) {
|
|
354
|
-
return this.http.getList("/
|
|
354
|
+
return this.http.getList("/boards", params);
|
|
355
355
|
}
|
|
356
356
|
/**
|
|
357
357
|
* Get board by ID or slug
|
|
358
358
|
*/
|
|
359
359
|
async get(idOrSlug) {
|
|
360
|
-
return this.http.get(`/
|
|
360
|
+
return this.http.get(`/boards/${idOrSlug}`);
|
|
361
361
|
}
|
|
362
362
|
// ============================================
|
|
363
|
-
// Posts
|
|
363
|
+
// Posts
|
|
364
364
|
// ============================================
|
|
365
365
|
/**
|
|
366
366
|
* List posts in a board
|
|
367
367
|
* @returns ListResponse with data array and pagination meta
|
|
368
368
|
*/
|
|
369
369
|
async listPosts(boardIdOrSlug, params) {
|
|
370
|
-
return this.http.getList(`/
|
|
370
|
+
return this.http.getList(`/boards/${boardIdOrSlug}/posts`, params);
|
|
371
371
|
}
|
|
372
372
|
/**
|
|
373
373
|
* Get post by ID
|
|
374
374
|
*/
|
|
375
375
|
async getPost(postId) {
|
|
376
|
-
return this.http.get(`/
|
|
376
|
+
return this.http.get(`/posts/${postId}`);
|
|
377
377
|
}
|
|
378
378
|
// ============================================
|
|
379
379
|
// Posts (Protected - requires auth)
|
|
@@ -404,7 +404,7 @@ var BoardsResource = class {
|
|
|
404
404
|
* @returns Array of comments (always an array, never null/undefined)
|
|
405
405
|
*/
|
|
406
406
|
async listComments(postId) {
|
|
407
|
-
const response = await this.http.getList(`/
|
|
407
|
+
const response = await this.http.getList(`/posts/${postId}/comments`);
|
|
408
408
|
return response.data;
|
|
409
409
|
}
|
|
410
410
|
/**
|
|
@@ -437,26 +437,26 @@ var BlogResource = class {
|
|
|
437
437
|
* @returns ListResponse with data array (always defined) and pagination meta
|
|
438
438
|
*/
|
|
439
439
|
async list(params) {
|
|
440
|
-
return this.http.getList("/
|
|
440
|
+
return this.http.getList("/blog", params);
|
|
441
441
|
}
|
|
442
442
|
/**
|
|
443
443
|
* Get blog post by slug
|
|
444
444
|
*/
|
|
445
445
|
async get(slug) {
|
|
446
|
-
return this.http.get(`/
|
|
446
|
+
return this.http.get(`/blog/${slug}`);
|
|
447
447
|
}
|
|
448
448
|
/**
|
|
449
449
|
* Get blog post by ID
|
|
450
450
|
*/
|
|
451
451
|
async getById(id) {
|
|
452
|
-
return this.http.get(`/
|
|
452
|
+
return this.http.get(`/blog/id/${id}`);
|
|
453
453
|
}
|
|
454
454
|
/**
|
|
455
455
|
* Get featured blog posts
|
|
456
456
|
* @returns Array of featured posts (always an array, never null/undefined)
|
|
457
457
|
*/
|
|
458
458
|
async featured(limit = 5) {
|
|
459
|
-
const response = await this.http.getList("/
|
|
459
|
+
const response = await this.http.getList("/blog", {
|
|
460
460
|
per_page: limit,
|
|
461
461
|
featured: true
|
|
462
462
|
});
|
|
@@ -467,7 +467,7 @@ var BlogResource = class {
|
|
|
467
467
|
* @returns ListResponse with data array and pagination meta
|
|
468
468
|
*/
|
|
469
469
|
async byCategory(category, params) {
|
|
470
|
-
return this.http.getList("/
|
|
470
|
+
return this.http.getList("/blog", {
|
|
471
471
|
...params,
|
|
472
472
|
category
|
|
473
473
|
});
|
|
@@ -477,7 +477,7 @@ var BlogResource = class {
|
|
|
477
477
|
* @returns ListResponse with data array and pagination meta
|
|
478
478
|
*/
|
|
479
479
|
async byTag(tag, params) {
|
|
480
|
-
return this.http.getList("/
|
|
480
|
+
return this.http.getList("/blog", {
|
|
481
481
|
...params,
|
|
482
482
|
tag
|
|
483
483
|
});
|
|
@@ -487,7 +487,7 @@ var BlogResource = class {
|
|
|
487
487
|
* @returns ListResponse with data array and pagination meta
|
|
488
488
|
*/
|
|
489
489
|
async search(query, params) {
|
|
490
|
-
return this.http.getList("/
|
|
490
|
+
return this.http.getList("/blog", {
|
|
491
491
|
...params,
|
|
492
492
|
search: query
|
|
493
493
|
});
|
|
@@ -497,7 +497,7 @@ var BlogResource = class {
|
|
|
497
497
|
* @returns Array of category names (always an array)
|
|
498
498
|
*/
|
|
499
499
|
async categories() {
|
|
500
|
-
const response = await this.http.get("/
|
|
500
|
+
const response = await this.http.get("/blog/categories");
|
|
501
501
|
return Array.isArray(response) ? response : response?.data ?? [];
|
|
502
502
|
}
|
|
503
503
|
/**
|
|
@@ -505,7 +505,7 @@ var BlogResource = class {
|
|
|
505
505
|
* @returns Array of tag names (always an array)
|
|
506
506
|
*/
|
|
507
507
|
async tags() {
|
|
508
|
-
const response = await this.http.get("/
|
|
508
|
+
const response = await this.http.get("/blog/tags");
|
|
509
509
|
return Array.isArray(response) ? response : response?.data ?? [];
|
|
510
510
|
}
|
|
511
511
|
};
|
|
@@ -520,19 +520,19 @@ var FormsResource = class {
|
|
|
520
520
|
* @returns ListResponse with data array and pagination meta
|
|
521
521
|
*/
|
|
522
522
|
async list(params) {
|
|
523
|
-
return this.http.getList("/
|
|
523
|
+
return this.http.getList("/forms", params);
|
|
524
524
|
}
|
|
525
525
|
/**
|
|
526
526
|
* Get form by ID or slug
|
|
527
527
|
*/
|
|
528
528
|
async get(idOrSlug) {
|
|
529
|
-
return this.http.get(`/
|
|
529
|
+
return this.http.get(`/forms/${idOrSlug}`);
|
|
530
530
|
}
|
|
531
531
|
/**
|
|
532
532
|
* Submit form data
|
|
533
533
|
*/
|
|
534
534
|
async submit(formIdOrSlug, data) {
|
|
535
|
-
return this.http.post(`/
|
|
535
|
+
return this.http.post(`/forms/${formIdOrSlug}/submit`, data);
|
|
536
536
|
}
|
|
537
537
|
// ============================================
|
|
538
538
|
// Protected endpoints (requires auth)
|
|
@@ -565,20 +565,20 @@ var ShopResource = class {
|
|
|
565
565
|
* @returns ListResponse with data array and pagination meta
|
|
566
566
|
*/
|
|
567
567
|
async listProducts(params) {
|
|
568
|
-
return this.http.getList("/
|
|
568
|
+
return this.http.getList("/products", params);
|
|
569
569
|
}
|
|
570
570
|
/**
|
|
571
571
|
* Get product by ID or slug
|
|
572
572
|
*/
|
|
573
573
|
async getProduct(idOrSlug) {
|
|
574
|
-
return this.http.get(`/
|
|
574
|
+
return this.http.get(`/products/${idOrSlug}`);
|
|
575
575
|
}
|
|
576
576
|
/**
|
|
577
577
|
* Get featured products
|
|
578
578
|
* @returns Array of featured products (always an array)
|
|
579
579
|
*/
|
|
580
580
|
async featuredProducts(limit = 8) {
|
|
581
|
-
const response = await this.http.getList("/
|
|
581
|
+
const response = await this.http.getList("/products", {
|
|
582
582
|
per_page: limit,
|
|
583
583
|
is_featured: true
|
|
584
584
|
});
|
|
@@ -589,7 +589,7 @@ var ShopResource = class {
|
|
|
589
589
|
* @returns ListResponse with data array and pagination meta
|
|
590
590
|
*/
|
|
591
591
|
async searchProducts(query, params) {
|
|
592
|
-
return this.http.getList("/
|
|
592
|
+
return this.http.getList("/products", {
|
|
593
593
|
...params,
|
|
594
594
|
search: query
|
|
595
595
|
});
|
|
@@ -602,21 +602,21 @@ var ShopResource = class {
|
|
|
602
602
|
* @returns Array of categories (always an array)
|
|
603
603
|
*/
|
|
604
604
|
async listCategories() {
|
|
605
|
-
const response = await this.http.getList("/
|
|
605
|
+
const response = await this.http.getList("/categories");
|
|
606
606
|
return response.data;
|
|
607
607
|
}
|
|
608
608
|
/**
|
|
609
609
|
* Get category by ID or slug
|
|
610
610
|
*/
|
|
611
611
|
async getCategory(idOrSlug) {
|
|
612
|
-
return this.http.get(`/
|
|
612
|
+
return this.http.get(`/categories/${idOrSlug}`);
|
|
613
613
|
}
|
|
614
614
|
/**
|
|
615
615
|
* Get products in category
|
|
616
616
|
* @returns ListResponse with data array and pagination meta
|
|
617
617
|
*/
|
|
618
618
|
async categoryProducts(categoryIdOrSlug, params) {
|
|
619
|
-
return this.http.getList(`/
|
|
619
|
+
return this.http.getList(`/categories/${categoryIdOrSlug}/products`, params);
|
|
620
620
|
}
|
|
621
621
|
// ============================================
|
|
622
622
|
// Cart
|
|
@@ -789,7 +789,7 @@ var EntitiesResource = class {
|
|
|
789
789
|
* ```
|
|
790
790
|
*/
|
|
791
791
|
async list() {
|
|
792
|
-
const response = await this.http.getList("/
|
|
792
|
+
const response = await this.http.getList("/entities");
|
|
793
793
|
return response.data;
|
|
794
794
|
}
|
|
795
795
|
/**
|
|
@@ -802,7 +802,7 @@ var EntitiesResource = class {
|
|
|
802
802
|
* ```
|
|
803
803
|
*/
|
|
804
804
|
async getSchema(slug) {
|
|
805
|
-
return this.http.get(`/
|
|
805
|
+
return this.http.get(`/entities/${slug}/schema`);
|
|
806
806
|
}
|
|
807
807
|
// ============================================
|
|
808
808
|
// Records (Public Read)
|
|
@@ -830,7 +830,7 @@ var EntitiesResource = class {
|
|
|
830
830
|
* ```
|
|
831
831
|
*/
|
|
832
832
|
async listRecords(slug, params) {
|
|
833
|
-
return this.http.getList(`/
|
|
833
|
+
return this.http.getList(`/entities/${slug}`, params);
|
|
834
834
|
}
|
|
835
835
|
/**
|
|
836
836
|
* Get a single record by ID
|
|
@@ -842,7 +842,7 @@ var EntitiesResource = class {
|
|
|
842
842
|
* ```
|
|
843
843
|
*/
|
|
844
844
|
async getRecord(slug, id) {
|
|
845
|
-
return this.http.get(`/
|
|
845
|
+
return this.http.get(`/entities/${slug}/${id}`);
|
|
846
846
|
}
|
|
847
847
|
// ============================================
|
|
848
848
|
// Records (Protected - requires auth)
|
|
@@ -962,14 +962,14 @@ var ReservationResource = class {
|
|
|
962
962
|
* @returns Reservation settings for the tenant
|
|
963
963
|
*/
|
|
964
964
|
async getSettings() {
|
|
965
|
-
return this.http.get("/
|
|
965
|
+
return this.http.get("/reservation/settings");
|
|
966
966
|
}
|
|
967
967
|
/**
|
|
968
968
|
* List available services
|
|
969
969
|
* @returns Array of services (always an array)
|
|
970
970
|
*/
|
|
971
971
|
async listServices() {
|
|
972
|
-
const response = await this.http.getList("/
|
|
972
|
+
const response = await this.http.getList("/reservation/services");
|
|
973
973
|
return response.data;
|
|
974
974
|
}
|
|
975
975
|
/**
|
|
@@ -979,7 +979,7 @@ var ReservationResource = class {
|
|
|
979
979
|
*/
|
|
980
980
|
async listStaff(serviceId) {
|
|
981
981
|
const params = serviceId ? { service_id: serviceId } : void 0;
|
|
982
|
-
const response = await this.http.getList("/
|
|
982
|
+
const response = await this.http.getList("/reservation/staffs", params);
|
|
983
983
|
return response.data;
|
|
984
984
|
}
|
|
985
985
|
/**
|
|
@@ -987,7 +987,7 @@ var ReservationResource = class {
|
|
|
987
987
|
* @returns Array of available date strings (YYYY-MM-DD)
|
|
988
988
|
*/
|
|
989
989
|
async getAvailableDates(params) {
|
|
990
|
-
const response = await this.http.get("/
|
|
990
|
+
const response = await this.http.get("/reservation/available-dates", params);
|
|
991
991
|
return Array.isArray(response) ? response : response?.data ?? [];
|
|
992
992
|
}
|
|
993
993
|
/**
|
|
@@ -995,7 +995,7 @@ var ReservationResource = class {
|
|
|
995
995
|
* @returns Array of available slots (always an array)
|
|
996
996
|
*/
|
|
997
997
|
async getAvailableSlots(params) {
|
|
998
|
-
const response = await this.http.get("/
|
|
998
|
+
const response = await this.http.get("/reservation/available-slots", params);
|
|
999
999
|
return Array.isArray(response) ? response : response?.data ?? [];
|
|
1000
1000
|
}
|
|
1001
1001
|
// ============================================
|