@cstar.help/js 0.4.0 → 0.5.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
@@ -302,6 +302,65 @@ var WebhooksResource = class extends BaseResource {
302
302
  }
303
303
  };
304
304
 
305
+ // src/resources/automations.ts
306
+ var AutomationsResource = class extends BaseResource {
307
+ constructor(client) {
308
+ super(client, "/automations");
309
+ }
310
+ /** Toggle a rule's enabled state. */
311
+ async toggle(ruleId, enabled) {
312
+ return this.client.request(
313
+ "PATCH",
314
+ `/automations/${ruleId}/toggle`,
315
+ { body: enabled !== void 0 ? { enabled } : {} }
316
+ );
317
+ }
318
+ /** Reorder rules by providing an ordered array of IDs. */
319
+ async reorder(orderedIds) {
320
+ return this.client.request("PUT", "/automations/reorder", {
321
+ body: { orderedIds }
322
+ });
323
+ }
324
+ /** Dry-run a rule against a specific resource (no actions executed). */
325
+ async test(ruleId, params) {
326
+ return this.client.request(
327
+ "POST",
328
+ `/automations/${ruleId}/test`,
329
+ { body: params }
330
+ );
331
+ }
332
+ /** Get execution history for a specific rule. */
333
+ async executions(ruleId, params) {
334
+ const searchParams = new URLSearchParams();
335
+ if (params?.page) searchParams.set("page", String(params.page));
336
+ if (params?.pageSize) searchParams.set("pageSize", String(params.pageSize));
337
+ if (params?.triggerEvent) searchParams.set("triggerEvent", params.triggerEvent);
338
+ if (params?.resourceId) searchParams.set("resourceId", params.resourceId);
339
+ const qs = searchParams.toString();
340
+ return this.client.request(
341
+ "GET",
342
+ `/automations/${ruleId}/executions${qs ? `?${qs}` : ""}`
343
+ );
344
+ }
345
+ /** Get all execution history for the team. */
346
+ async allExecutions(params) {
347
+ const searchParams = new URLSearchParams();
348
+ if (params?.page) searchParams.set("page", String(params.page));
349
+ if (params?.pageSize) searchParams.set("pageSize", String(params.pageSize));
350
+ if (params?.triggerEvent) searchParams.set("triggerEvent", params.triggerEvent);
351
+ if (params?.resourceId) searchParams.set("resourceId", params.resourceId);
352
+ const qs = searchParams.toString();
353
+ return this.client.request(
354
+ "GET",
355
+ `/automations/executions${qs ? `?${qs}` : ""}`
356
+ );
357
+ }
358
+ /** Test conditions against sample data (without a rule). */
359
+ async evaluate(params) {
360
+ return this.client.request("POST", "/automations/evaluate", { body: params });
361
+ }
362
+ };
363
+
305
364
  // src/resources/categories.ts
306
365
  var CategoriesResource = class extends BaseResource {
307
366
  constructor(client) {
@@ -352,6 +411,783 @@ var CommunityTopicsResource = class extends BaseResource {
352
411
  }
353
412
  };
354
413
 
414
+ // src/resources/members.ts
415
+ var InvitesResource = class {
416
+ constructor(client) {
417
+ this.client = client;
418
+ }
419
+ /** List pending invites. */
420
+ async list(params) {
421
+ return this.client.request("GET", "/invites", {
422
+ query: params
423
+ });
424
+ }
425
+ /** Create and send a new invite. */
426
+ async create(params, options) {
427
+ return this.client.request("POST", "/invites", {
428
+ body: params,
429
+ idempotencyKey: options?.idempotencyKey
430
+ });
431
+ }
432
+ /** Revoke a pending invite. */
433
+ async del(inviteId) {
434
+ return this.client.request("DELETE", `/invites/${inviteId}`);
435
+ }
436
+ };
437
+ var MembersResource = class {
438
+ constructor(client) {
439
+ this.client = client;
440
+ this.invites = new InvitesResource(client);
441
+ }
442
+ /** List all team members. */
443
+ async list(params) {
444
+ return this.client.request("GET", "/members", {
445
+ query: params
446
+ });
447
+ }
448
+ /** Get a single member by membership ID. */
449
+ async get(memberId) {
450
+ return this.client.request("GET", `/members/${memberId}`);
451
+ }
452
+ /** Update a member's role. */
453
+ async update(memberId, params) {
454
+ return this.client.request("PATCH", `/members/${memberId}`, {
455
+ body: params
456
+ });
457
+ }
458
+ /** Remove a member from the team. */
459
+ async del(memberId) {
460
+ return this.client.request("DELETE", `/members/${memberId}`);
461
+ }
462
+ };
463
+
464
+ // src/resources/settings.ts
465
+ var StatusesResource = class {
466
+ constructor(client) {
467
+ this.client = client;
468
+ }
469
+ /** List all statuses. */
470
+ async list() {
471
+ return this.client.request("GET", "/settings/statuses");
472
+ }
473
+ /** Create a new status. */
474
+ async create(params, options) {
475
+ return this.client.request("POST", "/settings/statuses", {
476
+ body: params,
477
+ idempotencyKey: options?.idempotencyKey
478
+ });
479
+ }
480
+ /** Update a status. */
481
+ async update(statusKey, params) {
482
+ return this.client.request(
483
+ "PATCH",
484
+ `/settings/statuses/${statusKey}`,
485
+ { body: params }
486
+ );
487
+ }
488
+ /** Delete a status. */
489
+ async del(statusKey) {
490
+ return this.client.request(
491
+ "DELETE",
492
+ `/settings/statuses/${statusKey}`
493
+ );
494
+ }
495
+ /** Reorder statuses. */
496
+ async reorder(orderedKeys) {
497
+ return this.client.request("PUT", "/settings/statuses/reorder", {
498
+ body: { orderedKeys }
499
+ });
500
+ }
501
+ };
502
+ var QuickRepliesResource = class {
503
+ constructor(client) {
504
+ this.client = client;
505
+ }
506
+ /** List all quick replies. */
507
+ async list() {
508
+ return this.client.request("GET", "/settings/quick-replies");
509
+ }
510
+ /** Create a new quick reply. */
511
+ async create(params, options) {
512
+ return this.client.request("POST", "/settings/quick-replies", {
513
+ body: params,
514
+ idempotencyKey: options?.idempotencyKey
515
+ });
516
+ }
517
+ /** Update a quick reply. */
518
+ async update(replyId, params) {
519
+ return this.client.request(
520
+ "PATCH",
521
+ `/settings/quick-replies/${replyId}`,
522
+ { body: params }
523
+ );
524
+ }
525
+ /** Delete a quick reply. */
526
+ async del(replyId) {
527
+ return this.client.request(
528
+ "DELETE",
529
+ `/settings/quick-replies/${replyId}`
530
+ );
531
+ }
532
+ /** Reorder quick replies. */
533
+ async reorder(orderedIds) {
534
+ return this.client.request(
535
+ "PUT",
536
+ "/settings/quick-replies/reorder",
537
+ { body: { orderedIds } }
538
+ );
539
+ }
540
+ };
541
+ var SettingsResource = class {
542
+ constructor(client) {
543
+ this.client = client;
544
+ this.statuses = new StatusesResource(client);
545
+ this.quickReplies = new QuickRepliesResource(client);
546
+ }
547
+ /** Get all team settings. */
548
+ async get() {
549
+ return this.client.request("GET", "/settings");
550
+ }
551
+ /** Update team settings (bulk). */
552
+ async update(params) {
553
+ return this.client.request("PATCH", "/settings", { body: params });
554
+ }
555
+ /** Get business hours configuration. */
556
+ async getBusinessHours() {
557
+ return this.client.request("GET", "/settings/business-hours");
558
+ }
559
+ /** Update business hours configuration. */
560
+ async updateBusinessHours(params) {
561
+ return this.client.request("PATCH", "/settings/business-hours", {
562
+ body: params
563
+ });
564
+ }
565
+ /** Get widget settings. */
566
+ async getWidget() {
567
+ return this.client.request("GET", "/settings/widget");
568
+ }
569
+ /** Update widget settings. */
570
+ async updateWidget(params) {
571
+ return this.client.request("PATCH", "/settings/widget", {
572
+ body: params
573
+ });
574
+ }
575
+ };
576
+
577
+ // src/resources/notifications.ts
578
+ var NotificationsResource = class {
579
+ constructor(client) {
580
+ this.client = client;
581
+ }
582
+ /** List notifications. */
583
+ async list(params) {
584
+ return this.client.request("GET", "/notifications", {
585
+ query: params
586
+ });
587
+ }
588
+ /** Get unread notification count. */
589
+ async unreadCount() {
590
+ return this.client.request("GET", "/notifications/unread-count");
591
+ }
592
+ /** Mark a single notification as read. */
593
+ async markRead(notificationId) {
594
+ return this.client.request(
595
+ "PATCH",
596
+ `/notifications/${notificationId}`,
597
+ { body: { read: true } }
598
+ );
599
+ }
600
+ /** Mark all notifications as read. */
601
+ async markAllRead() {
602
+ return this.client.request(
603
+ "POST",
604
+ "/notifications/mark-all-read"
605
+ );
606
+ }
607
+ };
608
+
609
+ // src/resources/attachments.ts
610
+ var AttachmentsResource = class {
611
+ constructor(client) {
612
+ this.client = client;
613
+ }
614
+ /** List attachments. */
615
+ async list(params) {
616
+ return this.client.request("GET", "/attachments", {
617
+ query: params
618
+ });
619
+ }
620
+ /** Get a single attachment. */
621
+ async get(attachmentId) {
622
+ return this.client.request("GET", `/attachments/${attachmentId}`);
623
+ }
624
+ /** Delete an attachment. */
625
+ async del(attachmentId) {
626
+ return this.client.request(
627
+ "DELETE",
628
+ `/attachments/${attachmentId}`
629
+ );
630
+ }
631
+ };
632
+
633
+ // src/resources/customFields.ts
634
+ var CustomFieldsResource = class {
635
+ constructor(client) {
636
+ this.client = client;
637
+ }
638
+ /** List custom fields. */
639
+ async list(params) {
640
+ return this.client.request("GET", "/custom-fields", {
641
+ query: params
642
+ });
643
+ }
644
+ /** Get a single custom field. */
645
+ async get(fieldId) {
646
+ return this.client.request("GET", `/custom-fields/${fieldId}`);
647
+ }
648
+ /** Create a custom field. */
649
+ async create(params, options) {
650
+ return this.client.request("POST", "/custom-fields", {
651
+ body: params,
652
+ idempotencyKey: options?.idempotencyKey
653
+ });
654
+ }
655
+ /** Update a custom field. */
656
+ async update(fieldId, params) {
657
+ return this.client.request("PATCH", `/custom-fields/${fieldId}`, {
658
+ body: params
659
+ });
660
+ }
661
+ /** Delete a custom field. */
662
+ async del(fieldId) {
663
+ return this.client.request("DELETE", `/custom-fields/${fieldId}`);
664
+ }
665
+ /** Reorder custom fields. */
666
+ async reorder(orderedIds) {
667
+ return this.client.request("PUT", "/custom-fields/reorder", {
668
+ body: { orderedIds }
669
+ });
670
+ }
671
+ };
672
+
673
+ // src/resources/sla.ts
674
+ var SlaResource = class {
675
+ constructor(client) {
676
+ this.client = client;
677
+ }
678
+ /** List SLA rules. */
679
+ async list(params) {
680
+ return this.client.request("GET", "/sla/rules", {
681
+ query: params
682
+ });
683
+ }
684
+ /** Get a single SLA rule. */
685
+ async get(ruleId) {
686
+ return this.client.request("GET", `/sla/rules/${ruleId}`);
687
+ }
688
+ /** Create an SLA rule. */
689
+ async create(params, options) {
690
+ return this.client.request("POST", "/sla/rules", {
691
+ body: params,
692
+ idempotencyKey: options?.idempotencyKey
693
+ });
694
+ }
695
+ /** Update an SLA rule. */
696
+ async update(ruleId, params) {
697
+ return this.client.request("PATCH", `/sla/rules/${ruleId}`, {
698
+ body: params
699
+ });
700
+ }
701
+ /** Delete an SLA rule. */
702
+ async del(ruleId) {
703
+ return this.client.request("DELETE", `/sla/rules/${ruleId}`);
704
+ }
705
+ };
706
+
707
+ // src/resources/analytics.ts
708
+ var AnalyticsResource = class {
709
+ constructor(client) {
710
+ this.client = client;
711
+ }
712
+ /** Get analytics overview. */
713
+ async overview(params) {
714
+ return this.client.request("GET", "/analytics/overview", {
715
+ query: params
716
+ });
717
+ }
718
+ /** Get per-agent performance stats. */
719
+ async agents(params) {
720
+ return this.client.request("GET", "/analytics/agents", {
721
+ query: params
722
+ });
723
+ }
724
+ /** Get CSAT statistics. */
725
+ async csatStats(params) {
726
+ return this.client.request("GET", "/csat/stats", {
727
+ query: params
728
+ });
729
+ }
730
+ /** List individual CSAT responses. */
731
+ async csatResponses(params) {
732
+ return this.client.request("GET", "/csat/responses", {
733
+ query: params
734
+ });
735
+ }
736
+ };
737
+
738
+ // src/resources/bulk.ts
739
+ var BulkResource = class {
740
+ constructor(client) {
741
+ this.client = client;
742
+ }
743
+ /** Bulk update resources. */
744
+ async update(params, options) {
745
+ return this.client.request("POST", "/bulk", {
746
+ body: { action: "update", ...params },
747
+ idempotencyKey: options?.idempotencyKey
748
+ });
749
+ }
750
+ /** Bulk delete resources. */
751
+ async del(params, options) {
752
+ return this.client.request("POST", "/bulk", {
753
+ body: { action: "delete", ...params },
754
+ idempotencyKey: options?.idempotencyKey
755
+ });
756
+ }
757
+ };
758
+
759
+ // src/resources/exportImport.ts
760
+ var ExportResource = class {
761
+ constructor(client) {
762
+ this.client = client;
763
+ }
764
+ /** Create an export. Returns exported data synchronously. */
765
+ async create(params, options) {
766
+ return this.client.request("POST", "/export", {
767
+ body: params,
768
+ idempotencyKey: options?.idempotencyKey
769
+ });
770
+ }
771
+ };
772
+ var ImportResource = class {
773
+ constructor(client) {
774
+ this.client = client;
775
+ }
776
+ /** Run an import. Processes records synchronously (max 500). */
777
+ async create(params, options) {
778
+ return this.client.request("POST", "/import", {
779
+ body: params,
780
+ idempotencyKey: options?.idempotencyKey
781
+ });
782
+ }
783
+ /** List import history logs. */
784
+ async logs(params) {
785
+ return this.client.request("GET", "/import", {
786
+ query: params
787
+ });
788
+ }
789
+ /** Get a single import log. */
790
+ async getLog(logId) {
791
+ return this.client.request("GET", `/import/logs/${logId}`);
792
+ }
793
+ };
794
+
795
+ // src/resources/auditLog.ts
796
+ var AuditLogResource = class {
797
+ constructor(client) {
798
+ this.client = client;
799
+ }
800
+ /** List audit log entries. */
801
+ async list(params) {
802
+ return this.client.request("GET", "/audit-log", {
803
+ query: params
804
+ });
805
+ }
806
+ };
807
+
808
+ // src/resources/search.ts
809
+ var SearchResource = class {
810
+ constructor(client) {
811
+ this.client = client;
812
+ }
813
+ /** Perform a cross-resource search. */
814
+ async query(params) {
815
+ const query = {
816
+ q: params.query,
817
+ limit: params.limit?.toString()
818
+ };
819
+ if (params.types?.length) {
820
+ query.types = params.types.join(",");
821
+ }
822
+ return this.client.request("GET", "/search", { query });
823
+ }
824
+ };
825
+
826
+ // src/resources/tags.ts
827
+ var TagsResource = class {
828
+ constructor(client) {
829
+ this.client = client;
830
+ }
831
+ /** List all tags with usage counts. */
832
+ async list(params) {
833
+ return this.client.request("GET", "/tags", {
834
+ query: params
835
+ });
836
+ }
837
+ /** Create a tag. */
838
+ async create(name, options) {
839
+ return this.client.request("POST", "/tags", {
840
+ body: { name },
841
+ idempotencyKey: options?.idempotencyKey
842
+ });
843
+ }
844
+ /** Delete a tag. */
845
+ async del(name) {
846
+ return this.client.request(
847
+ "DELETE",
848
+ `/tags/${encodeURIComponent(name)}`
849
+ );
850
+ }
851
+ };
852
+
853
+ // src/resources/activity.ts
854
+ var ActivityResource = class {
855
+ constructor(client) {
856
+ this.client = client;
857
+ }
858
+ /** List recent activity events. */
859
+ async list(params) {
860
+ return this.client.request("GET", "/activity", {
861
+ query: params
862
+ });
863
+ }
864
+ };
865
+
866
+ // src/resources/customerGroups.ts
867
+ var CustomerGroupsResource = class extends BaseResource {
868
+ constructor(client) {
869
+ super(client, "/customer-groups");
870
+ }
871
+ };
872
+
873
+ // src/resources/game.ts
874
+ var BossResource = class {
875
+ constructor(client) {
876
+ this.client = client;
877
+ }
878
+ /** Get current boss state. */
879
+ async current() {
880
+ return this.client.request("GET", "/game/boss");
881
+ }
882
+ /** Check if a boss is active (lightweight). */
883
+ async isActive() {
884
+ return this.client.request("GET", "/game/boss/active");
885
+ }
886
+ /** Spawn a new boss. */
887
+ async spawn(params, options) {
888
+ return this.client.request("POST", "/game/boss/spawn", {
889
+ body: params ?? {},
890
+ idempotencyKey: options?.idempotencyKey
891
+ });
892
+ }
893
+ /** Deal damage to the current boss. */
894
+ async damage(params, options) {
895
+ return this.client.request("POST", "/game/boss/damage", {
896
+ body: params,
897
+ idempotencyKey: options?.idempotencyKey
898
+ });
899
+ }
900
+ /** List boss defeat history. */
901
+ async defeats(params) {
902
+ return this.client.request("GET", "/game/boss/defeats", {
903
+ query: params
904
+ });
905
+ }
906
+ /** Get a single defeat record. */
907
+ async getDefeat(defeatId) {
908
+ return this.client.request("GET", `/game/boss/defeats/${defeatId}`);
909
+ }
910
+ };
911
+ var AchievementsResource = class {
912
+ constructor(client) {
913
+ this.client = client;
914
+ }
915
+ /** List all achievements with progress. */
916
+ async list(params) {
917
+ return this.client.request("GET", "/game/achievements", {
918
+ query: params
919
+ });
920
+ }
921
+ /** List unlocked achievements only. */
922
+ async unlocked(params) {
923
+ return this.client.request("GET", "/game/achievements/unlocked", {
924
+ query: params
925
+ });
926
+ }
927
+ /** Get a single achievement. */
928
+ async get(achievementId, params) {
929
+ return this.client.request("GET", `/game/achievements/${achievementId}`, {
930
+ query: params
931
+ });
932
+ }
933
+ };
934
+ var QuestsResource = class {
935
+ constructor(client) {
936
+ this.client = client;
937
+ }
938
+ /** Get today's quests. */
939
+ async today(params) {
940
+ return this.client.request("GET", "/game/quests/today", {
941
+ query: params
942
+ });
943
+ }
944
+ /** Get quest history. */
945
+ async history(params) {
946
+ return this.client.request("GET", "/game/quests/history", {
947
+ query: params
948
+ });
949
+ }
950
+ };
951
+ var PuzzlesResource = class {
952
+ constructor(client) {
953
+ this.client = client;
954
+ }
955
+ /** Get today's puzzle. */
956
+ async today(params) {
957
+ return this.client.request("GET", "/game/puzzles/today", {
958
+ query: params
959
+ });
960
+ }
961
+ /** Submit a puzzle answer. */
962
+ async complete(params, options) {
963
+ return this.client.request("POST", "/game/puzzles/complete", {
964
+ body: params,
965
+ idempotencyKey: options?.idempotencyKey
966
+ });
967
+ }
968
+ /** Get puzzle streak for a user. */
969
+ async streak(params) {
970
+ return this.client.request("GET", "/game/puzzles/streak", {
971
+ query: params
972
+ });
973
+ }
974
+ /** Get puzzle leaderboard. */
975
+ async leaderboard(params) {
976
+ return this.client.request("GET", "/game/puzzles/leaderboard", {
977
+ query: params
978
+ });
979
+ }
980
+ };
981
+ var OneUpsResource = class {
982
+ constructor(client) {
983
+ this.client = client;
984
+ }
985
+ /** List one-ups. */
986
+ async list(params) {
987
+ return this.client.request("GET", "/game/one-ups", {
988
+ query: params
989
+ });
990
+ }
991
+ /** Send a one-up. */
992
+ async send(params, options) {
993
+ return this.client.request("POST", "/game/one-ups", {
994
+ body: params,
995
+ idempotencyKey: options?.idempotencyKey
996
+ });
997
+ }
998
+ /** Check remaining free one-ups today. */
999
+ async remaining(params) {
1000
+ return this.client.request("GET", "/game/one-ups/remaining", {
1001
+ query: params
1002
+ });
1003
+ }
1004
+ };
1005
+ var HighFivesResource = class {
1006
+ constructor(client) {
1007
+ this.client = client;
1008
+ }
1009
+ /** List high fives. */
1010
+ async list(params) {
1011
+ return this.client.request("GET", "/game/high-fives", {
1012
+ query: params
1013
+ });
1014
+ }
1015
+ /** Send a high five. */
1016
+ async send(params, options) {
1017
+ return this.client.request("POST", "/game/high-fives", {
1018
+ body: params,
1019
+ idempotencyKey: options?.idempotencyKey
1020
+ });
1021
+ }
1022
+ /** Check if you can send a high five to a team. */
1023
+ async canSend(recipientTeamId, params) {
1024
+ return this.client.request("GET", `/game/high-fives/can-send/${recipientTeamId}`, {
1025
+ query: params
1026
+ });
1027
+ }
1028
+ };
1029
+ var CosmeticsResource = class {
1030
+ constructor(client) {
1031
+ this.client = client;
1032
+ }
1033
+ /** List unlocked cosmetics. */
1034
+ async list(params) {
1035
+ return this.client.request("GET", "/game/cosmetics", {
1036
+ query: params
1037
+ });
1038
+ }
1039
+ /** Get cosmetic preferences. */
1040
+ async getPreferences(params) {
1041
+ return this.client.request("GET", "/game/cosmetics/preferences", {
1042
+ query: params
1043
+ });
1044
+ }
1045
+ /** Update cosmetic preferences. */
1046
+ async updatePreferences(params) {
1047
+ return this.client.request("PATCH", "/game/cosmetics/preferences", { body: params });
1048
+ }
1049
+ };
1050
+ var SeasonsResource = class {
1051
+ constructor(client) {
1052
+ this.client = client;
1053
+ }
1054
+ /** List all seasons. */
1055
+ async list() {
1056
+ return this.client.request("GET", "/game/seasons");
1057
+ }
1058
+ /** Get the current active season. */
1059
+ async current() {
1060
+ return this.client.request("GET", "/game/seasons/current");
1061
+ }
1062
+ /** Get user stats for a season. */
1063
+ async stats(seasonId, params) {
1064
+ return this.client.request("GET", `/game/seasons/${seasonId}/stats`, {
1065
+ query: params
1066
+ });
1067
+ }
1068
+ };
1069
+ var SkillsResource = class {
1070
+ constructor(client) {
1071
+ this.client = client;
1072
+ }
1073
+ /** Get the skill tree with current allocations. */
1074
+ async get(params) {
1075
+ return this.client.request("GET", "/game/skills", {
1076
+ query: params
1077
+ });
1078
+ }
1079
+ /** Allocate a skill point. */
1080
+ async allocate(params, options) {
1081
+ return this.client.request("POST", "/game/skills/allocate", {
1082
+ body: params,
1083
+ idempotencyKey: options?.idempotencyKey
1084
+ });
1085
+ }
1086
+ /** Reset all skill allocations. */
1087
+ async reset(params, options) {
1088
+ return this.client.request("POST", "/game/skills/reset", {
1089
+ body: params,
1090
+ idempotencyKey: options?.idempotencyKey
1091
+ });
1092
+ }
1093
+ };
1094
+ var GameResource = class {
1095
+ constructor(client) {
1096
+ this.client = client;
1097
+ this.boss = new BossResource(client);
1098
+ this.achievements = new AchievementsResource(client);
1099
+ this.quests = new QuestsResource(client);
1100
+ this.puzzles = new PuzzlesResource(client);
1101
+ this.oneUps = new OneUpsResource(client);
1102
+ this.highFives = new HighFivesResource(client);
1103
+ this.cosmetics = new CosmeticsResource(client);
1104
+ this.seasons = new SeasonsResource(client);
1105
+ this.skills = new SkillsResource(client);
1106
+ }
1107
+ /** Get current player stats. */
1108
+ async player(params) {
1109
+ return this.client.request("GET", "/game/player", {
1110
+ query: params
1111
+ });
1112
+ }
1113
+ /** Get a specific player's stats by membership ID. */
1114
+ async getPlayer(memberId) {
1115
+ return this.client.request("GET", `/game/player/${memberId}`);
1116
+ }
1117
+ /** Get the team leaderboard. */
1118
+ async leaderboard(params) {
1119
+ return this.client.request("GET", "/game/leaderboard", {
1120
+ query: params
1121
+ });
1122
+ }
1123
+ /** Get the current user's leaderboard position. */
1124
+ async myRank(params) {
1125
+ return this.client.request("GET", "/game/leaderboard/me", {
1126
+ query: params
1127
+ });
1128
+ }
1129
+ };
1130
+
1131
+ // src/resources/ai.ts
1132
+ var AiResource = class {
1133
+ constructor(client) {
1134
+ this.client = client;
1135
+ }
1136
+ /** Run an AI action. */
1137
+ async run(params, options) {
1138
+ return this.client.request("POST", "/ai", {
1139
+ body: params,
1140
+ idempotencyKey: options?.idempotencyKey
1141
+ });
1142
+ }
1143
+ /** Auto-tag a ticket. */
1144
+ async autoTag(ticketId) {
1145
+ return this.run({ action: "auto-tag", ticketId });
1146
+ }
1147
+ /** Suggest a reply for a ticket. */
1148
+ async suggestReply(ticketId) {
1149
+ return this.run({ action: "suggest-reply", ticketId });
1150
+ }
1151
+ /** Summarize a ticket. */
1152
+ async summarize(ticketId) {
1153
+ return this.run({ action: "summarize", ticketId });
1154
+ }
1155
+ /** Improve text. */
1156
+ async improve(text) {
1157
+ return this.run({ action: "improve", text });
1158
+ }
1159
+ };
1160
+
1161
+ // src/resources/views.ts
1162
+ var ViewsResource = class extends BaseResource {
1163
+ constructor(client) {
1164
+ super(client, "/views");
1165
+ }
1166
+ /** Execute a view — returns the filtered results. */
1167
+ async execute(viewId, params) {
1168
+ return this.client.request("GET", `/views/${viewId}/tickets`, {
1169
+ query: params
1170
+ });
1171
+ }
1172
+ };
1173
+
1174
+ // src/resources/billing.ts
1175
+ var BillingResource = class {
1176
+ constructor(client) {
1177
+ this.client = client;
1178
+ }
1179
+ /** Get current subscription status. */
1180
+ async subscription() {
1181
+ return this.client.request("GET", "/billing/subscription");
1182
+ }
1183
+ /** Create a Stripe billing portal session. */
1184
+ async portal(params) {
1185
+ return this.client.request("POST", "/billing/portal", {
1186
+ body: params ?? {}
1187
+ });
1188
+ }
1189
+ };
1190
+
355
1191
  // src/index.ts
356
1192
  var CStarClient = class {
357
1193
  constructor(config) {
@@ -360,11 +1196,31 @@ var CStarClient = class {
360
1196
  this.customers = new CustomersResource(this.client);
361
1197
  this.articles = new ArticlesResource(this.client);
362
1198
  this.webhooks = new WebhooksResource(this.client);
1199
+ this.automations = new AutomationsResource(this.client);
363
1200
  this.categories = new CategoriesResource(this.client);
364
1201
  this.community = {
365
1202
  posts: new CommunityPostsResource(this.client),
366
1203
  topics: new CommunityTopicsResource(this.client)
367
1204
  };
1205
+ this.members = new MembersResource(this.client);
1206
+ this.settings = new SettingsResource(this.client);
1207
+ this.notifications = new NotificationsResource(this.client);
1208
+ this.attachments = new AttachmentsResource(this.client);
1209
+ this.customFields = new CustomFieldsResource(this.client);
1210
+ this.sla = new SlaResource(this.client);
1211
+ this.analytics = new AnalyticsResource(this.client);
1212
+ this.bulk = new BulkResource(this.client);
1213
+ this.export = new ExportResource(this.client);
1214
+ this.import = new ImportResource(this.client);
1215
+ this.auditLog = new AuditLogResource(this.client);
1216
+ this.search = new SearchResource(this.client);
1217
+ this.tags = new TagsResource(this.client);
1218
+ this.activity = new ActivityResource(this.client);
1219
+ this.customerGroups = new CustomerGroupsResource(this.client);
1220
+ this.game = new GameResource(this.client);
1221
+ this.ai = new AiResource(this.client);
1222
+ this.views = new ViewsResource(this.client);
1223
+ this.billing = new BillingResource(this.client);
368
1224
  }
369
1225
  /** Whether this client is using test mode keys (sk_test_* or pk_test_*). */
370
1226
  get isTestMode() {