@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.
@@ -5553,6 +5553,73 @@ var BuyerBlocklist = class {
5553
5553
  }
5554
5554
  };
5555
5555
 
5556
+ // src/resources/buyerConversations.ts
5557
+ var BuyerConversations = class {
5558
+ constructor(request) {
5559
+ this.request = request;
5560
+ }
5561
+ /**
5562
+ * One page of the inbox, the latest message first, filtered by shop,
5563
+ * status, assignee, mode or buyer. `GET /buyer-conversations`
5564
+ */
5565
+ async list(params) {
5566
+ return this.request("GET", "/buyer-conversations", {
5567
+ query: params
5568
+ });
5569
+ }
5570
+ /**
5571
+ * Starts the conversation with a buyer at one shop, or adds to the one that
5572
+ * exists, with a first message. `POST /buyer-conversations`
5573
+ */
5574
+ async start(params) {
5575
+ return this.request("POST", "/buyer-conversations", { body: params });
5576
+ }
5577
+ /**
5578
+ * One conversation and its newest messages, oldest first; `before` pages
5579
+ * back. `GET /buyer-conversations/{id}`
5580
+ */
5581
+ async retrieve(id, params) {
5582
+ return this.request("GET", `/buyer-conversations/${encodeURIComponent(id)}`, {
5583
+ query: params
5584
+ });
5585
+ }
5586
+ /**
5587
+ * A team member's answer. A closed conversation refuses it.
5588
+ * `POST /buyer-conversations/{id}/messages`
5589
+ */
5590
+ async reply(id, params) {
5591
+ return this.request("POST", `/buyer-conversations/${encodeURIComponent(id)}/messages`, {
5592
+ body: params
5593
+ });
5594
+ }
5595
+ /**
5596
+ * The team has read the conversation up to its last accepted message.
5597
+ * `POST /buyer-conversations/{id}/read`
5598
+ */
5599
+ async markRead(id) {
5600
+ return this.request("POST", `/buyer-conversations/${encodeURIComponent(id)}/read`);
5601
+ }
5602
+ /**
5603
+ * Hands the conversation to a team member, to the caller with `me`, or to
5604
+ * nobody with `null`. `POST /buyer-conversations/{id}/assign`
5605
+ */
5606
+ async assign(id, params) {
5607
+ return this.request("POST", `/buyer-conversations/${encodeURIComponent(id)}/assign`, {
5608
+ body: params
5609
+ });
5610
+ }
5611
+ /**
5612
+ * Closes or reopens the conversation. Closing moves no money and decides
5613
+ * no case; it stops new messages until reopened.
5614
+ * `POST /buyer-conversations/{id}/status`
5615
+ */
5616
+ async setStatus(id, params) {
5617
+ return this.request("POST", `/buyer-conversations/${encodeURIComponent(id)}/status`, {
5618
+ body: params
5619
+ });
5620
+ }
5621
+ };
5622
+
5556
5623
  // src/resources/checkoutRecovery.ts
5557
5624
  var CheckoutRecovery = class {
5558
5625
  constructor(request) {
@@ -7138,6 +7205,108 @@ var BuyerAccount = class {
7138
7205
  ...options
7139
7206
  });
7140
7207
  }
7208
+ /**
7209
+ * The shops the buyer has purchases at, once each and by name. Pass a
7210
+ * shop's `shop` to `listPurchases` to list only that shop's purchases.
7211
+ */
7212
+ async listShops(options) {
7213
+ return this.request("GET", "/buyer-account/shops", { ...options });
7214
+ }
7215
+ /**
7216
+ * The buyer's subscriptions across shops, newest first. A record the buyer
7217
+ * has not confirmed shows what a receipt carries, without its period or
7218
+ * cancellation.
7219
+ */
7220
+ async listSubscriptions(query, options) {
7221
+ return this.request("GET", "/buyer-account/subscriptions", {
7222
+ query,
7223
+ ...options
7224
+ });
7225
+ }
7226
+ /**
7227
+ * The issued invoices of the records the buyer has confirmed through a
7228
+ * shop's own link, newest first. `unconfirmed_records` says when records
7229
+ * were left out.
7230
+ */
7231
+ async listInvoices(query, options) {
7232
+ return this.request("GET", "/buyer-account/invoices", {
7233
+ query,
7234
+ ...options
7235
+ });
7236
+ }
7237
+ /** The refund requests of the records the buyer has confirmed, newest first, with the shop's decision. */
7238
+ async listRefundRequests(query, options) {
7239
+ return this.request("GET", "/buyer-account/refund-requests", {
7240
+ query,
7241
+ ...options
7242
+ });
7243
+ }
7244
+ /**
7245
+ * The cases of the records the buyer has confirmed: the refund requests
7246
+ * they sent and the disputes about their purchases, newest first, with
7247
+ * where each stands, who acts next, the outcome and the recorded steps.
7248
+ */
7249
+ async listCases(query, options) {
7250
+ return this.request("GET", "/buyer-account/cases", {
7251
+ query,
7252
+ ...options
7253
+ });
7254
+ }
7255
+ /**
7256
+ * The conversations of the records the buyer has confirmed, the latest
7257
+ * message first. `unconfirmed_records` says when other records were left out.
7258
+ */
7259
+ async listConversations(query, options) {
7260
+ return this.request("GET", "/buyer-account/conversations", {
7261
+ query,
7262
+ ...options
7263
+ });
7264
+ }
7265
+ /**
7266
+ * The conversation of a confirmed record with one shop, and its newest
7267
+ * messages, oldest first; `before` pages back. `shop` is required here.
7268
+ */
7269
+ async listRecordMessages(record, query, options) {
7270
+ return this.request("GET", `/buyer-account/records/${encodeURIComponent(record)}/messages`, {
7271
+ query,
7272
+ ...options
7273
+ });
7274
+ }
7275
+ /**
7276
+ * A message from a confirmed record to one of its shops. Sending again with
7277
+ * the same `client_message_id` returns the message the first send stored.
7278
+ */
7279
+ async sendRecordMessage(record, message, options) {
7280
+ return this.request("POST", `/buyer-account/records/${encodeURIComponent(record)}/messages`, {
7281
+ body: message,
7282
+ ...options
7283
+ });
7284
+ }
7285
+ /**
7286
+ * The buyer has read a record's conversation with one shop up to its last
7287
+ * accepted message. Answers with the buyer's conversations as they now stand.
7288
+ */
7289
+ async markRecordMessagesRead(record, query, options) {
7290
+ return this.request(
7291
+ "POST",
7292
+ `/buyer-account/records/${encodeURIComponent(record)}/messages/read`,
7293
+ {
7294
+ query,
7295
+ ...options
7296
+ }
7297
+ );
7298
+ }
7299
+ /**
7300
+ * What the buyer spent in a period: paid purchases summed per currency,
7301
+ * never converted, for the whole period, per day, week or month, per shop
7302
+ * and per kind of purchase.
7303
+ */
7304
+ async analytics(query, options) {
7305
+ return this.request("GET", "/buyer-account/analytics", {
7306
+ query,
7307
+ ...options
7308
+ });
7309
+ }
7141
7310
  /**
7142
7311
  * Confirm the record of a shop's customer portal link for the signed-in
7143
7312
  * buyer. The link's customer must carry the address the buyer signed in
@@ -7166,6 +7335,48 @@ var BuyerPortal = class {
7166
7335
  async getSession(options) {
7167
7336
  return this.request("GET", "/buyer-portal/session", { ...options });
7168
7337
  }
7338
+ /**
7339
+ * The buyer's cases at the shop: the refund requests they sent and the
7340
+ * disputes about their purchases, newest first, with where each stands, who
7341
+ * acts next, the outcome and the recorded steps.
7342
+ */
7343
+ async listCases(options) {
7344
+ return this.request("GET", "/buyer-portal/cases", { ...options });
7345
+ }
7346
+ /**
7347
+ * The buyer's conversations with the shop, the latest message first. A
7348
+ * portal link for the whole merchant lists one per shop and mode.
7349
+ */
7350
+ async listConversations(options) {
7351
+ return this.request("GET", "/buyer-portal/conversations", { ...options });
7352
+ }
7353
+ /**
7354
+ * The conversation with one shop and its newest messages, oldest first;
7355
+ * `before` pages back. A link issued for one shop may leave `shop` out.
7356
+ */
7357
+ async listMessages(query, options) {
7358
+ return this.request("GET", "/buyer-portal/messages", {
7359
+ query,
7360
+ ...options
7361
+ });
7362
+ }
7363
+ /**
7364
+ * A message to the shop. Sending again with the same `client_message_id`
7365
+ * returns the message the first send stored; a closed conversation refuses it.
7366
+ */
7367
+ async sendMessage(message, options) {
7368
+ return this.request("POST", "/buyer-portal/messages", { body: message, ...options });
7369
+ }
7370
+ /**
7371
+ * The buyer has read the conversation with the shop up to its last accepted
7372
+ * message. Answers with the buyer's conversations as they now stand.
7373
+ */
7374
+ async markMessagesRead(query, options) {
7375
+ return this.request("POST", "/buyer-portal/messages/read", {
7376
+ query,
7377
+ ...options
7378
+ });
7379
+ }
7169
7380
  /** The buyer's contact and billing details, and what they may change. */
7170
7381
  async getProfile(options) {
7171
7382
  return this.request("GET", "/buyer-portal/profile", { ...options });
@@ -8293,6 +8504,7 @@ var Delopay = class {
8293
8504
  this.availabilityOverrides = new AvailabilityOverrides(request);
8294
8505
  this.sellToRestrictions = new SellToRestrictions(request);
8295
8506
  this.buyerBlocklist = new BuyerBlocklist(request);
8507
+ this.buyerConversations = new BuyerConversations(request);
8296
8508
  this.checkoutRecovery = new CheckoutRecovery(request);
8297
8509
  this.costRules = new CostRules(request);
8298
8510
  this.externalRecords = new ExternalRecords(request);
@@ -13106,6 +13318,7 @@ export {
13106
13318
  AvailabilityOverrides,
13107
13319
  SellToRestrictions,
13108
13320
  BuyerBlocklist,
13321
+ BuyerConversations,
13109
13322
  CheckoutRecovery,
13110
13323
  CostRules,
13111
13324
  ExternalRecords,
@@ -13337,4 +13550,4 @@ export {
13337
13550
  decodeNativePanes,
13338
13551
  encodeNativePanes
13339
13552
  };
13340
- //# sourceMappingURL=chunk-U3KDAIWB.js.map
13553
+ //# sourceMappingURL=chunk-BPDN5AIB.js.map