@back23/promptly-sdk 2.0.1 → 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/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("/public/boards", params);
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(`/public/boards/${idOrSlug}`);
388
+ return this.http.get(`/boards/${idOrSlug}`);
389
389
  }
390
390
  // ============================================
391
- // Posts (Public)
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(`/public/boards/${boardIdOrSlug}/posts`, params);
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(`/public/posts/${postId}`);
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(`/public/posts/${postId}/comments`);
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("/public/blog", params);
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(`/public/blog/${slug}`);
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(`/public/blog/id/${id}`);
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("/public/blog", {
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("/public/blog", {
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("/public/blog", {
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("/public/blog", {
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("/public/blog/categories");
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("/public/blog/tags");
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("/public/forms", params);
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(`/public/forms/${idOrSlug}`);
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(`/public/forms/${formIdOrSlug}/submit`, data);
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("/public/products", params);
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(`/public/products/${idOrSlug}`);
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("/public/products", {
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("/public/products", {
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("/public/categories");
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(`/public/categories/${idOrSlug}`);
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(`/public/categories/${categoryIdOrSlug}/products`, params);
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("/public/entities");
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(`/public/entities/${slug}/schema`);
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(`/public/entities/${slug}`, params);
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(`/public/entities/${slug}/${id}`);
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("/public/reservation/settings");
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("/public/reservation/services");
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("/public/reservation/staffs", params);
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("/public/reservation/available-dates", params);
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("/public/reservation/available-slots", params);
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("/public/boards", params);
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(`/public/boards/${idOrSlug}`);
360
+ return this.http.get(`/boards/${idOrSlug}`);
361
361
  }
362
362
  // ============================================
363
- // Posts (Public)
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(`/public/boards/${boardIdOrSlug}/posts`, params);
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(`/public/posts/${postId}`);
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(`/public/posts/${postId}/comments`);
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("/public/blog", params);
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(`/public/blog/${slug}`);
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(`/public/blog/id/${id}`);
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("/public/blog", {
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("/public/blog", {
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("/public/blog", {
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("/public/blog", {
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("/public/blog/categories");
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("/public/blog/tags");
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("/public/forms", params);
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(`/public/forms/${idOrSlug}`);
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(`/public/forms/${formIdOrSlug}/submit`, data);
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("/public/products", params);
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(`/public/products/${idOrSlug}`);
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("/public/products", {
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("/public/products", {
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("/public/categories");
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(`/public/categories/${idOrSlug}`);
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(`/public/categories/${categoryIdOrSlug}/products`, params);
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("/public/entities");
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(`/public/entities/${slug}/schema`);
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(`/public/entities/${slug}`, params);
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(`/public/entities/${slug}/${id}`);
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("/public/reservation/settings");
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("/public/reservation/services");
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("/public/reservation/staffs", params);
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("/public/reservation/available-dates", params);
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("/public/reservation/available-slots", params);
998
+ const response = await this.http.get("/reservation/available-slots", params);
999
999
  return Array.isArray(response) ? response : response?.data ?? [];
1000
1000
  }
1001
1001
  // ============================================
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@back23/promptly-sdk",
3
- "version": "2.0.1",
3
+ "version": "2.1.0",
4
4
  "description": "Promptly AI CMS SDK for JavaScript/TypeScript",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",