@compassdigital/sdk.typescript 3.21.0 → 3.22.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/src/index.ts CHANGED
@@ -529,6 +529,43 @@ import {
529
529
  DeletePermissionRoleUserResponse,
530
530
  } from "./interface/permission";
531
531
 
532
+ import {
533
+ PostLoyaltyEnrollQuery,
534
+ PostLoyaltyEnrollResponse,
535
+ GetLoyaltyPointsQuery,
536
+ GetLoyaltyPointsResponse,
537
+ GetLoyaltyOffersResponse,
538
+ GetLoyaltyEnrollmentstatusResponse,
539
+ GetLoyaltyBalanceResponse,
540
+ GetLoyaltyOpportunitiesQuery,
541
+ GetLoyaltyOpportunitiesResponse,
542
+ PostLoyaltyOpportunitiesQuery,
543
+ PostLoyaltyOpportunitiesResponse,
544
+ GetLoyaltyRewardsResponse,
545
+ GetLoyaltyCouponsResponse,
546
+ GetLoyaltyOrderpointsQuery,
547
+ GetLoyaltyOrderpointsResponse,
548
+ PostLoyaltyOrderpointsBody,
549
+ PostLoyaltyOrderpointsResponse,
550
+ PostLoyaltyPurchaseQuery,
551
+ PostLoyaltyPurchaseBody,
552
+ PostLoyaltyPurchaseResponse,
553
+ PostLoyaltyBuyrewardQuery,
554
+ PostLoyaltyBuyrewardBody,
555
+ PostLoyaltyBuyrewardResponse,
556
+ GetLoyaltyHistoryQuery,
557
+ GetLoyaltyHistoryResponse,
558
+ GetLoyaltyCouponResponse,
559
+ PatchLoyaltyCouponBody,
560
+ PatchLoyaltyCouponResponse,
561
+ GetLoyaltySearchQuery,
562
+ GetLoyaltySearchResponse,
563
+ GetLoyaltyUsersQuery,
564
+ GetLoyaltyUsersResponse,
565
+ GetLoyaltyEventsQuery,
566
+ GetLoyaltyEventsResponse,
567
+ } from "./interface/loyalty";
568
+
532
569
  import { BaseServiceClient, RequestOptions, ResponsePromise } from "./base";
533
570
  export * from "./base";
534
571
 
@@ -5387,4 +5424,448 @@ export class ServiceClient extends BaseServiceClient {
5387
5424
  options
5388
5425
  );
5389
5426
  }
5427
+
5428
+ /**
5429
+ * POST /loyalty/{id}/enroll/{user_id} - Enroll logged in user in Loyalty program
5430
+ *
5431
+ * @param id - Loyalty Provider id
5432
+ * @param user_id - CompassDigital User id
5433
+ * @param options - additional request options
5434
+ */
5435
+ post_loyalty_enroll(
5436
+ id: string,
5437
+ user_id: string,
5438
+ options?: {
5439
+ query?: PostLoyaltyEnrollQuery;
5440
+ } & RequestOptions
5441
+ ): ResponsePromise<PostLoyaltyEnrollResponse> {
5442
+ return this.request(
5443
+ "loyalty",
5444
+ "post_loyalty_enroll",
5445
+ "post",
5446
+ `/loyalty/${id}/enroll/${user_id}`,
5447
+ null,
5448
+ options
5449
+ );
5450
+ }
5451
+
5452
+ /**
5453
+ * GET /loyalty/{id}/points - Get potential points user could earn from certain event in Loyalty program
5454
+ *
5455
+ * @param id - Loyalty Provider id
5456
+ * @param options - additional request options
5457
+ */
5458
+ get_loyalty_points(
5459
+ id: string,
5460
+ options: {
5461
+ query: GetLoyaltyPointsQuery;
5462
+ } & RequestOptions
5463
+ ): ResponsePromise<GetLoyaltyPointsResponse> {
5464
+ return this.request(
5465
+ "loyalty",
5466
+ "get_loyalty_points",
5467
+ "get",
5468
+ `/loyalty/${id}/points`,
5469
+ null,
5470
+ options
5471
+ );
5472
+ }
5473
+
5474
+ /**
5475
+ * GET /loyalty/{id}/offers/{user_id} - Get offers for the logged in user
5476
+ *
5477
+ * @param id - Loyalty Provider id
5478
+ * @param user_id - CompassDigital User id
5479
+ * @param options - additional request options
5480
+ */
5481
+ get_loyalty_offers(
5482
+ id: string,
5483
+ user_id: string,
5484
+ options?: RequestOptions
5485
+ ): ResponsePromise<GetLoyaltyOffersResponse> {
5486
+ return this.request(
5487
+ "loyalty",
5488
+ "get_loyalty_offers",
5489
+ "get",
5490
+ `/loyalty/${id}/offers/${user_id}`,
5491
+ null,
5492
+ options
5493
+ );
5494
+ }
5495
+
5496
+ /**
5497
+ * GET /loyalty/{id}/enrollmentstatus/{user_id} - Get enrollment status for logged in user
5498
+ *
5499
+ * @param id - Loyalty Provider id
5500
+ * @param user_id - CompassDigital User id
5501
+ * @param options - additional request options
5502
+ */
5503
+ get_loyalty_enrollmentstatus(
5504
+ id: string,
5505
+ user_id: string,
5506
+ options?: RequestOptions
5507
+ ): ResponsePromise<GetLoyaltyEnrollmentstatusResponse> {
5508
+ return this.request(
5509
+ "loyalty",
5510
+ "get_loyalty_enrollmentstatus",
5511
+ "get",
5512
+ `/loyalty/${id}/enrollmentstatus/${user_id}`,
5513
+ null,
5514
+ options
5515
+ );
5516
+ }
5517
+
5518
+ /**
5519
+ * GET /loyalty/{id}/balance/{user_id} - Get loyalty point balance for logged in user
5520
+ *
5521
+ * @param id - Loyalty Provider id
5522
+ * @param user_id - CompassDigital User id
5523
+ * @param options - additional request options
5524
+ */
5525
+ get_loyalty_balance(
5526
+ id: string,
5527
+ user_id: string,
5528
+ options?: RequestOptions
5529
+ ): ResponsePromise<GetLoyaltyBalanceResponse> {
5530
+ return this.request(
5531
+ "loyalty",
5532
+ "get_loyalty_balance",
5533
+ "get",
5534
+ `/loyalty/${id}/balance/${user_id}`,
5535
+ null,
5536
+ options
5537
+ );
5538
+ }
5539
+
5540
+ /**
5541
+ * GET /loyalty/{id}/opportunities/{user_id} - Get earning opportunities for the logged in user
5542
+ *
5543
+ * @param id - Loyalty Provider id
5544
+ * @param user_id - CompassDigital User id
5545
+ * @param options - additional request options
5546
+ */
5547
+ get_loyalty_opportunities(
5548
+ id: string,
5549
+ user_id: string,
5550
+ options?: {
5551
+ query?: GetLoyaltyOpportunitiesQuery;
5552
+ } & RequestOptions
5553
+ ): ResponsePromise<GetLoyaltyOpportunitiesResponse> {
5554
+ return this.request(
5555
+ "loyalty",
5556
+ "get_loyalty_opportunities",
5557
+ "get",
5558
+ `/loyalty/${id}/opportunities/${user_id}`,
5559
+ null,
5560
+ options
5561
+ );
5562
+ }
5563
+
5564
+ /**
5565
+ * POST /loyalty/{id}/opportunities/{user_id} - Record an event for the logged in user
5566
+ *
5567
+ * @param id - Loyalty Provider id
5568
+ * @param user_id - CompassDigital User id
5569
+ * @param options - additional request options
5570
+ */
5571
+ post_loyalty_opportunities(
5572
+ id: string,
5573
+ user_id: string,
5574
+ options: {
5575
+ query: PostLoyaltyOpportunitiesQuery;
5576
+ } & RequestOptions
5577
+ ): ResponsePromise<PostLoyaltyOpportunitiesResponse> {
5578
+ return this.request(
5579
+ "loyalty",
5580
+ "post_loyalty_opportunities",
5581
+ "post",
5582
+ `/loyalty/${id}/opportunities/${user_id}`,
5583
+ null,
5584
+ options
5585
+ );
5586
+ }
5587
+
5588
+ /**
5589
+ * GET /loyalty/{id}/rewards/{user_id} - Get rewards available for the logged in user
5590
+ *
5591
+ * @param id - Loyalty Provider id
5592
+ * @param user_id - CompassDigital User id
5593
+ * @param options - additional request options
5594
+ */
5595
+ get_loyalty_rewards(
5596
+ id: string,
5597
+ user_id: string,
5598
+ options?: RequestOptions
5599
+ ): ResponsePromise<GetLoyaltyRewardsResponse> {
5600
+ return this.request(
5601
+ "loyalty",
5602
+ "get_loyalty_rewards",
5603
+ "get",
5604
+ `/loyalty/${id}/rewards/${user_id}`,
5605
+ null,
5606
+ options
5607
+ );
5608
+ }
5609
+
5610
+ /**
5611
+ * GET /loyalty/{id}/coupons/{user_id} - Get coupons available for the logged in user
5612
+ *
5613
+ * @param id - Loyalty Provider id
5614
+ * @param user_id - CompassDigital User id
5615
+ * @param options - additional request options
5616
+ */
5617
+ get_loyalty_coupons(
5618
+ id: string,
5619
+ user_id: string,
5620
+ options?: RequestOptions
5621
+ ): ResponsePromise<GetLoyaltyCouponsResponse> {
5622
+ return this.request(
5623
+ "loyalty",
5624
+ "get_loyalty_coupons",
5625
+ "get",
5626
+ `/loyalty/${id}/coupons/${user_id}`,
5627
+ null,
5628
+ options
5629
+ );
5630
+ }
5631
+
5632
+ /**
5633
+ * GET /loyalty/{id}/orderpoints/{user_id} - Get potential loyalty point points for an order based on amount.
5634
+ *
5635
+ * @param id - Loyalty Provider id
5636
+ * @param user_id - CompassDigital User id
5637
+ * @param options - additional request options
5638
+ */
5639
+ get_loyalty_orderpoints(
5640
+ id: string,
5641
+ user_id: string,
5642
+ options: {
5643
+ query: GetLoyaltyOrderpointsQuery;
5644
+ } & RequestOptions
5645
+ ): ResponsePromise<GetLoyaltyOrderpointsResponse> {
5646
+ return this.request(
5647
+ "loyalty",
5648
+ "get_loyalty_orderpoints",
5649
+ "get",
5650
+ `/loyalty/${id}/orderpoints/${user_id}`,
5651
+ null,
5652
+ options
5653
+ );
5654
+ }
5655
+
5656
+ /**
5657
+ * POST /loyalty/{id}/orderpoints/{user_id} - Get potential loyalty point points for a order based on amount and items
5658
+ *
5659
+ * @param id - Loyalty Provider id
5660
+ * @param user_id - CompassDigital User id
5661
+ * @param body
5662
+ * @param options - additional request options
5663
+ */
5664
+ post_loyalty_orderpoints(
5665
+ id: string,
5666
+ user_id: string,
5667
+ body: PostLoyaltyOrderpointsBody,
5668
+ options?: RequestOptions
5669
+ ): ResponsePromise<PostLoyaltyOrderpointsResponse> {
5670
+ return this.request(
5671
+ "loyalty",
5672
+ "post_loyalty_orderpoints",
5673
+ "post",
5674
+ `/loyalty/${id}/orderpoints/${user_id}`,
5675
+ body,
5676
+ options
5677
+ );
5678
+ }
5679
+
5680
+ /**
5681
+ * POST /loyalty/{id}/purchase/{user_id} - Record purchase event
5682
+ *
5683
+ * @param id - Loyalty Provider id
5684
+ * @param user_id - CompassDigital User id
5685
+ * @param body
5686
+ * @param options - additional request options
5687
+ */
5688
+ post_loyalty_purchase(
5689
+ id: string,
5690
+ user_id: string,
5691
+ body: PostLoyaltyPurchaseBody,
5692
+ options?: {
5693
+ query?: PostLoyaltyPurchaseQuery;
5694
+ } & RequestOptions
5695
+ ): ResponsePromise<PostLoyaltyPurchaseResponse> {
5696
+ return this.request(
5697
+ "loyalty",
5698
+ "post_loyalty_purchase",
5699
+ "post",
5700
+ `/loyalty/${id}/purchase/${user_id}`,
5701
+ body,
5702
+ options
5703
+ );
5704
+ }
5705
+
5706
+ /**
5707
+ * POST /loyalty/{id}/buyreward/{user_id} - Redeem rewards to coupons
5708
+ *
5709
+ * @param id - Loyalty Provider id
5710
+ * @param user_id - CompassDigital User id
5711
+ * @param body
5712
+ * @param options - additional request options
5713
+ */
5714
+ post_loyalty_buyreward(
5715
+ id: string,
5716
+ user_id: string,
5717
+ body: PostLoyaltyBuyrewardBody,
5718
+ options?: {
5719
+ query?: PostLoyaltyBuyrewardQuery;
5720
+ } & RequestOptions
5721
+ ): ResponsePromise<PostLoyaltyBuyrewardResponse> {
5722
+ return this.request(
5723
+ "loyalty",
5724
+ "post_loyalty_buyreward",
5725
+ "post",
5726
+ `/loyalty/${id}/buyreward/${user_id}`,
5727
+ body,
5728
+ options
5729
+ );
5730
+ }
5731
+
5732
+ /**
5733
+ * GET /loyalty/{id}/history/{user_id} - Get history of loyalty transactions for user
5734
+ *
5735
+ * @param id - Loyalty Provider id
5736
+ * @param user_id - CompassDigital User id
5737
+ * @param options - additional request options
5738
+ */
5739
+ get_loyalty_history(
5740
+ id: string,
5741
+ user_id: string,
5742
+ options?: {
5743
+ query?: GetLoyaltyHistoryQuery;
5744
+ } & RequestOptions
5745
+ ): ResponsePromise<GetLoyaltyHistoryResponse> {
5746
+ return this.request(
5747
+ "loyalty",
5748
+ "get_loyalty_history",
5749
+ "get",
5750
+ `/loyalty/${id}/history/${user_id}`,
5751
+ null,
5752
+ options
5753
+ );
5754
+ }
5755
+
5756
+ /**
5757
+ * GET /loyalty/{id}/coupon/{user_id}/{coupon_id} - get coupon's information
5758
+ *
5759
+ * @param id - Loyalty Provider id
5760
+ * @param user_id - CompassDigital User id
5761
+ * @param coupon_id - Coupon code to get coupon information
5762
+ * @param options - additional request options
5763
+ */
5764
+ get_loyalty_coupon(
5765
+ id: string,
5766
+ user_id: string,
5767
+ coupon_id: string,
5768
+ options?: RequestOptions
5769
+ ): ResponsePromise<GetLoyaltyCouponResponse> {
5770
+ return this.request(
5771
+ "loyalty",
5772
+ "get_loyalty_coupon",
5773
+ "get",
5774
+ `/loyalty/${id}/coupon/${user_id}/${coupon_id}`,
5775
+ null,
5776
+ options
5777
+ );
5778
+ }
5779
+
5780
+ /**
5781
+ * PATCH /loyalty/{id}/coupon/{user_id}/{coupon_id} - Update coupon's status
5782
+ *
5783
+ * @param id - Loyalty Provider id
5784
+ * @param user_id - CompassDigital User id
5785
+ * @param coupon_id - Coupon code to update
5786
+ * @param body
5787
+ * @param options - additional request options
5788
+ */
5789
+ patch_loyalty_coupon(
5790
+ id: string,
5791
+ user_id: string,
5792
+ coupon_id: string,
5793
+ body: PatchLoyaltyCouponBody,
5794
+ options?: RequestOptions
5795
+ ): ResponsePromise<PatchLoyaltyCouponResponse> {
5796
+ return this.request(
5797
+ "loyalty",
5798
+ "patch_loyalty_coupon",
5799
+ "patch",
5800
+ `/loyalty/${id}/coupon/${user_id}/${coupon_id}`,
5801
+ body,
5802
+ options
5803
+ );
5804
+ }
5805
+
5806
+ /**
5807
+ * GET /loyalty/{id}/search - Search CDL user id by internal 500friends id
5808
+ *
5809
+ * @param id - Loyalty Provider id
5810
+ * @param options - additional request options
5811
+ */
5812
+ get_loyalty_search(
5813
+ id: string,
5814
+ options: {
5815
+ query: GetLoyaltySearchQuery;
5816
+ } & RequestOptions
5817
+ ): ResponsePromise<GetLoyaltySearchResponse> {
5818
+ return this.request(
5819
+ "loyalty",
5820
+ "get_loyalty_search",
5821
+ "get",
5822
+ `/loyalty/${id}/search`,
5823
+ null,
5824
+ options
5825
+ );
5826
+ }
5827
+
5828
+ /**
5829
+ * GET /loyalty/{id}/users - Get all loyalty users updated after specific date
5830
+ *
5831
+ * @param id - Loyalty Provider id
5832
+ * @param options - additional request options
5833
+ */
5834
+ get_loyalty_users(
5835
+ id: string,
5836
+ options: {
5837
+ query: GetLoyaltyUsersQuery;
5838
+ } & RequestOptions
5839
+ ): ResponsePromise<GetLoyaltyUsersResponse> {
5840
+ return this.request(
5841
+ "loyalty",
5842
+ "get_loyalty_users",
5843
+ "get",
5844
+ `/loyalty/${id}/users`,
5845
+ null,
5846
+ options
5847
+ );
5848
+ }
5849
+
5850
+ /**
5851
+ * GET /loyalty/{id}/events - Get all loyalty events updated after specific date
5852
+ *
5853
+ * @param id - Loyalty Provider id
5854
+ * @param options - additional request options
5855
+ */
5856
+ get_loyalty_events(
5857
+ id: string,
5858
+ options: {
5859
+ query: GetLoyaltyEventsQuery;
5860
+ } & RequestOptions
5861
+ ): ResponsePromise<GetLoyaltyEventsResponse> {
5862
+ return this.request(
5863
+ "loyalty",
5864
+ "get_loyalty_events",
5865
+ "get",
5866
+ `/loyalty/${id}/events`,
5867
+ null,
5868
+ options
5869
+ );
5870
+ }
5390
5871
  }