@delopay/sdk 0.255.0 → 0.261.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.cjs CHANGED
@@ -43,6 +43,7 @@ __export(index_exports, {
43
43
  BRANDING_EXPORT_VERSION: () => BRANDING_EXPORT_VERSION,
44
44
  BUILTIN_PAYMENT_ICON_KEYS: () => BUILTIN_PAYMENT_ICON_KEYS,
45
45
  BuyerBlocklist: () => BuyerBlocklist,
46
+ BuyerConversations: () => BuyerConversations,
46
47
  CARD_FIELD_CHROMES: () => CARD_FIELD_CHROMES,
47
48
  CARD_FIELD_FONT_SIZES: () => CARD_FIELD_FONT_SIZES,
48
49
  CARD_FIELD_WEIGHTS: () => CARD_FIELD_WEIGHTS,
@@ -5827,6 +5828,73 @@ var BuyerBlocklist = class {
5827
5828
  }
5828
5829
  };
5829
5830
 
5831
+ // src/resources/buyerConversations.ts
5832
+ var BuyerConversations = class {
5833
+ constructor(request) {
5834
+ this.request = request;
5835
+ }
5836
+ /**
5837
+ * One page of the inbox, the latest message first, filtered by shop,
5838
+ * status, assignee, mode or buyer. `GET /buyer-conversations`
5839
+ */
5840
+ async list(params) {
5841
+ return this.request("GET", "/buyer-conversations", {
5842
+ query: params
5843
+ });
5844
+ }
5845
+ /**
5846
+ * Starts the conversation with a buyer at one shop, or adds to the one that
5847
+ * exists, with a first message. `POST /buyer-conversations`
5848
+ */
5849
+ async start(params) {
5850
+ return this.request("POST", "/buyer-conversations", { body: params });
5851
+ }
5852
+ /**
5853
+ * One conversation and its newest messages, oldest first; `before` pages
5854
+ * back. `GET /buyer-conversations/{id}`
5855
+ */
5856
+ async retrieve(id, params) {
5857
+ return this.request("GET", `/buyer-conversations/${encodeURIComponent(id)}`, {
5858
+ query: params
5859
+ });
5860
+ }
5861
+ /**
5862
+ * A team member's answer. A closed conversation refuses it.
5863
+ * `POST /buyer-conversations/{id}/messages`
5864
+ */
5865
+ async reply(id, params) {
5866
+ return this.request("POST", `/buyer-conversations/${encodeURIComponent(id)}/messages`, {
5867
+ body: params
5868
+ });
5869
+ }
5870
+ /**
5871
+ * The team has read the conversation up to its last accepted message.
5872
+ * `POST /buyer-conversations/{id}/read`
5873
+ */
5874
+ async markRead(id) {
5875
+ return this.request("POST", `/buyer-conversations/${encodeURIComponent(id)}/read`);
5876
+ }
5877
+ /**
5878
+ * Hands the conversation to a team member, to the caller with `me`, or to
5879
+ * nobody with `null`. `POST /buyer-conversations/{id}/assign`
5880
+ */
5881
+ async assign(id, params) {
5882
+ return this.request("POST", `/buyer-conversations/${encodeURIComponent(id)}/assign`, {
5883
+ body: params
5884
+ });
5885
+ }
5886
+ /**
5887
+ * Closes or reopens the conversation. Closing moves no money and decides
5888
+ * no case; it stops new messages until reopened.
5889
+ * `POST /buyer-conversations/{id}/status`
5890
+ */
5891
+ async setStatus(id, params) {
5892
+ return this.request("POST", `/buyer-conversations/${encodeURIComponent(id)}/status`, {
5893
+ body: params
5894
+ });
5895
+ }
5896
+ };
5897
+
5830
5898
  // src/resources/checkoutRecovery.ts
5831
5899
  var CheckoutRecovery = class {
5832
5900
  constructor(request) {
@@ -7412,6 +7480,108 @@ var BuyerAccount = class {
7412
7480
  ...options
7413
7481
  });
7414
7482
  }
7483
+ /**
7484
+ * The shops the buyer has purchases at, once each and by name. Pass a
7485
+ * shop's `shop` to `listPurchases` to list only that shop's purchases.
7486
+ */
7487
+ async listShops(options) {
7488
+ return this.request("GET", "/buyer-account/shops", { ...options });
7489
+ }
7490
+ /**
7491
+ * The buyer's subscriptions across shops, newest first. A record the buyer
7492
+ * has not confirmed shows what a receipt carries, without its period or
7493
+ * cancellation.
7494
+ */
7495
+ async listSubscriptions(query, options) {
7496
+ return this.request("GET", "/buyer-account/subscriptions", {
7497
+ query,
7498
+ ...options
7499
+ });
7500
+ }
7501
+ /**
7502
+ * The issued invoices of the records the buyer has confirmed through a
7503
+ * shop's own link, newest first. `unconfirmed_records` says when records
7504
+ * were left out.
7505
+ */
7506
+ async listInvoices(query, options) {
7507
+ return this.request("GET", "/buyer-account/invoices", {
7508
+ query,
7509
+ ...options
7510
+ });
7511
+ }
7512
+ /** The refund requests of the records the buyer has confirmed, newest first, with the shop's decision. */
7513
+ async listRefundRequests(query, options) {
7514
+ return this.request("GET", "/buyer-account/refund-requests", {
7515
+ query,
7516
+ ...options
7517
+ });
7518
+ }
7519
+ /**
7520
+ * The cases of the records the buyer has confirmed: the refund requests
7521
+ * they sent and the disputes about their purchases, newest first, with
7522
+ * where each stands, who acts next, the outcome and the recorded steps.
7523
+ */
7524
+ async listCases(query, options) {
7525
+ return this.request("GET", "/buyer-account/cases", {
7526
+ query,
7527
+ ...options
7528
+ });
7529
+ }
7530
+ /**
7531
+ * The conversations of the records the buyer has confirmed, the latest
7532
+ * message first. `unconfirmed_records` says when other records were left out.
7533
+ */
7534
+ async listConversations(query, options) {
7535
+ return this.request("GET", "/buyer-account/conversations", {
7536
+ query,
7537
+ ...options
7538
+ });
7539
+ }
7540
+ /**
7541
+ * The conversation of a confirmed record with one shop, and its newest
7542
+ * messages, oldest first; `before` pages back. `shop` is required here.
7543
+ */
7544
+ async listRecordMessages(record, query, options) {
7545
+ return this.request("GET", `/buyer-account/records/${encodeURIComponent(record)}/messages`, {
7546
+ query,
7547
+ ...options
7548
+ });
7549
+ }
7550
+ /**
7551
+ * A message from a confirmed record to one of its shops. Sending again with
7552
+ * the same `client_message_id` returns the message the first send stored.
7553
+ */
7554
+ async sendRecordMessage(record, message, options) {
7555
+ return this.request("POST", `/buyer-account/records/${encodeURIComponent(record)}/messages`, {
7556
+ body: message,
7557
+ ...options
7558
+ });
7559
+ }
7560
+ /**
7561
+ * The buyer has read a record's conversation with one shop up to its last
7562
+ * accepted message. Answers with the buyer's conversations as they now stand.
7563
+ */
7564
+ async markRecordMessagesRead(record, query, options) {
7565
+ return this.request(
7566
+ "POST",
7567
+ `/buyer-account/records/${encodeURIComponent(record)}/messages/read`,
7568
+ {
7569
+ query,
7570
+ ...options
7571
+ }
7572
+ );
7573
+ }
7574
+ /**
7575
+ * What the buyer spent in a period: paid purchases summed per currency,
7576
+ * never converted, for the whole period, per day, week or month, per shop
7577
+ * and per kind of purchase.
7578
+ */
7579
+ async analytics(query, options) {
7580
+ return this.request("GET", "/buyer-account/analytics", {
7581
+ query,
7582
+ ...options
7583
+ });
7584
+ }
7415
7585
  /**
7416
7586
  * Confirm the record of a shop's customer portal link for the signed-in
7417
7587
  * buyer. The link's customer must carry the address the buyer signed in
@@ -7440,6 +7610,48 @@ var BuyerPortal = class {
7440
7610
  async getSession(options) {
7441
7611
  return this.request("GET", "/buyer-portal/session", { ...options });
7442
7612
  }
7613
+ /**
7614
+ * The buyer's cases at the shop: the refund requests they sent and the
7615
+ * disputes about their purchases, newest first, with where each stands, who
7616
+ * acts next, the outcome and the recorded steps.
7617
+ */
7618
+ async listCases(options) {
7619
+ return this.request("GET", "/buyer-portal/cases", { ...options });
7620
+ }
7621
+ /**
7622
+ * The buyer's conversations with the shop, the latest message first. A
7623
+ * portal link for the whole merchant lists one per shop and mode.
7624
+ */
7625
+ async listConversations(options) {
7626
+ return this.request("GET", "/buyer-portal/conversations", { ...options });
7627
+ }
7628
+ /**
7629
+ * The conversation with one shop and its newest messages, oldest first;
7630
+ * `before` pages back. A link issued for one shop may leave `shop` out.
7631
+ */
7632
+ async listMessages(query, options) {
7633
+ return this.request("GET", "/buyer-portal/messages", {
7634
+ query,
7635
+ ...options
7636
+ });
7637
+ }
7638
+ /**
7639
+ * A message to the shop. Sending again with the same `client_message_id`
7640
+ * returns the message the first send stored; a closed conversation refuses it.
7641
+ */
7642
+ async sendMessage(message, options) {
7643
+ return this.request("POST", "/buyer-portal/messages", { body: message, ...options });
7644
+ }
7645
+ /**
7646
+ * The buyer has read the conversation with the shop up to its last accepted
7647
+ * message. Answers with the buyer's conversations as they now stand.
7648
+ */
7649
+ async markMessagesRead(query, options) {
7650
+ return this.request("POST", "/buyer-portal/messages/read", {
7651
+ query,
7652
+ ...options
7653
+ });
7654
+ }
7443
7655
  /** The buyer's contact and billing details, and what they may change. */
7444
7656
  async getProfile(options) {
7445
7657
  return this.request("GET", "/buyer-portal/profile", { ...options });
@@ -8567,6 +8779,7 @@ var Delopay = class {
8567
8779
  this.availabilityOverrides = new AvailabilityOverrides(request);
8568
8780
  this.sellToRestrictions = new SellToRestrictions(request);
8569
8781
  this.buyerBlocklist = new BuyerBlocklist(request);
8782
+ this.buyerConversations = new BuyerConversations(request);
8570
8783
  this.checkoutRecovery = new CheckoutRecovery(request);
8571
8784
  this.costRules = new CostRules(request);
8572
8785
  this.externalRecords = new ExternalRecords(request);
@@ -13383,6 +13596,7 @@ var encodeNativePanes = encodePanes;
13383
13596
  BRANDING_EXPORT_VERSION,
13384
13597
  BUILTIN_PAYMENT_ICON_KEYS,
13385
13598
  BuyerBlocklist,
13599
+ BuyerConversations,
13386
13600
  CARD_FIELD_CHROMES,
13387
13601
  CARD_FIELD_FONT_SIZES,
13388
13602
  CARD_FIELD_WEIGHTS,