@delopay/sdk 0.274.0 → 0.277.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/internal.cjs CHANGED
@@ -927,6 +927,23 @@ var Connectors = class {
927
927
  { body: params }
928
928
  );
929
929
  }
930
+ /**
931
+ * Fold copies of the same provider account into this connector (todos#395).
932
+ * `POST /account/{accountId}/connectors/{connectorId}/consolidate`
933
+ *
934
+ * The copies' shops move to the connector with their on/off state, routing,
935
+ * checkout layout, currencies, saved credentials, mandates and
936
+ * subscriptions. A copy keeps answering for the payments made on it and
937
+ * serves no shop. Send `dry_run: true` first, then confirm with the
938
+ * preview's `preview_token` and a choice for every conflict.
939
+ */
940
+ async consolidate(accountId, connectorId, params) {
941
+ return this.request(
942
+ "POST",
943
+ `/account/${encodeURIComponent(accountId)}/connectors/${encodeURIComponent(connectorId)}/consolidate`,
944
+ { body: params }
945
+ );
946
+ }
930
947
  /**
931
948
  * Switch a connector off, or back on, in one shop it serves.
932
949
  * `POST /account/{accountId}/connectors/{connectorId}/shops/{profileId}`
@@ -6070,6 +6087,55 @@ var BuyerConversations = class {
6070
6087
  body: params
6071
6088
  });
6072
6089
  }
6090
+ /**
6091
+ * A team member's internal note. Only the team reads it: the buyer never
6092
+ * sees a note, and a note does not move the conversation or mark it unread.
6093
+ * A closed conversation takes notes as well.
6094
+ * `POST /buyer-conversations/{id}/notes`
6095
+ */
6096
+ async addNote(id, params) {
6097
+ return this.request("POST", `/buyer-conversations/${encodeURIComponent(id)}/notes`, {
6098
+ body: params
6099
+ });
6100
+ }
6101
+ /**
6102
+ * Upload a file for the caller's next answer, under the shop's attachment
6103
+ * rules (`attachment_rules` on the conversation). It belongs to the caller
6104
+ * until an answer names it in `attachments`; one no answer took within a
6105
+ * day is cleared. Uploading again with the same `clientUploadId` returns
6106
+ * the file the first upload stored.
6107
+ * `POST /buyer-conversation-files/{conversation}`
6108
+ */
6109
+ async uploadFile(id, file, clientUploadId, fileName) {
6110
+ const form = new FormData();
6111
+ form.append("client_upload_id", clientUploadId);
6112
+ if (fileName === void 0) form.append("file", file);
6113
+ else form.append("file", file, fileName);
6114
+ return this.request("POST", `/buyer-conversation-files/${encodeURIComponent(id)}`, {
6115
+ body: form
6116
+ });
6117
+ }
6118
+ /**
6119
+ * Download a file a message of the conversation carries.
6120
+ * `GET /buyer-conversation-files/{conversation}/{file}`
6121
+ */
6122
+ async downloadFile(id, fileId) {
6123
+ return this.request(
6124
+ "GET",
6125
+ `/buyer-conversation-files/${encodeURIComponent(id)}/${encodeURIComponent(fileId)}`,
6126
+ { responseType: "blob" }
6127
+ );
6128
+ }
6129
+ /**
6130
+ * Remove a file the caller uploaded that no answer took.
6131
+ * `DELETE /buyer-conversation-files/{conversation}/{file}`
6132
+ */
6133
+ async removeFile(id, fileId) {
6134
+ return this.request(
6135
+ "DELETE",
6136
+ `/buyer-conversation-files/${encodeURIComponent(id)}/${encodeURIComponent(fileId)}`
6137
+ );
6138
+ }
6073
6139
  /**
6074
6140
  * The team has read the conversation up to its last accepted message.
6075
6141
  * `POST /buyer-conversations/{id}/read`
@@ -7886,6 +7952,53 @@ var BuyerAccount = class {
7886
7952
  }
7887
7953
  );
7888
7954
  }
7955
+ /**
7956
+ * Upload a file for the buyer's next message to one shop of a confirmed
7957
+ * record, under the shop's attachment rules (`attachment_rules` on the
7958
+ * message page). It belongs to the buyer until a message names it in
7959
+ * `attachments`; one no message took within a day is cleared. Uploading
7960
+ * again with the same `clientUploadId` returns the file the first upload
7961
+ * stored. `shop` is required here.
7962
+ */
7963
+ async uploadRecordMessageFile(record, file, clientUploadId, query, options) {
7964
+ const { fileName, ...extras } = options ?? {};
7965
+ const form = new FormData();
7966
+ form.append("client_upload_id", clientUploadId);
7967
+ if (fileName === void 0) form.append("file", file);
7968
+ else form.append("file", file, fileName);
7969
+ return this.request(
7970
+ "POST",
7971
+ `/buyer-account/records/${encodeURIComponent(record)}/messages/files`,
7972
+ {
7973
+ body: form,
7974
+ query,
7975
+ ...extras
7976
+ }
7977
+ );
7978
+ }
7979
+ /** Download a file a message of a record's conversation with one shop carries. */
7980
+ async downloadRecordMessageFile(record, fileId, query, options) {
7981
+ return this.request(
7982
+ "GET",
7983
+ `/buyer-account/records/${encodeURIComponent(record)}/messages/files/${encodeURIComponent(fileId)}`,
7984
+ {
7985
+ query,
7986
+ responseType: "blob",
7987
+ ...options
7988
+ }
7989
+ );
7990
+ }
7991
+ /** Remove a file the buyer uploaded for a record's conversation that no message took. */
7992
+ async removeRecordMessageFile(record, fileId, query, options) {
7993
+ return this.request(
7994
+ "DELETE",
7995
+ `/buyer-account/records/${encodeURIComponent(record)}/messages/files/${encodeURIComponent(fileId)}`,
7996
+ {
7997
+ query,
7998
+ ...options
7999
+ }
8000
+ );
8001
+ }
7889
8002
  /**
7890
8003
  * What the buyer spent in a period: paid purchases summed per currency,
7891
8004
  * never converted, for the whole period, per day, week or month, per shop
@@ -8108,6 +8221,40 @@ var BuyerPortal = class {
8108
8221
  ...options
8109
8222
  });
8110
8223
  }
8224
+ /**
8225
+ * Upload a file for the buyer's next message to one shop, under the shop's
8226
+ * attachment rules (`attachment_rules` on the message page). It belongs to
8227
+ * the buyer until a message names it in `attachments`; one no message took
8228
+ * within a day is cleared. Uploading again with the same `clientUploadId`
8229
+ * returns the file the first upload stored.
8230
+ */
8231
+ async uploadMessageFile(file, clientUploadId, query, options) {
8232
+ const { fileName, ...extras } = options ?? {};
8233
+ const form = new FormData();
8234
+ form.append("client_upload_id", clientUploadId);
8235
+ if (fileName === void 0) form.append("file", file);
8236
+ else form.append("file", file, fileName);
8237
+ return this.request("POST", "/buyer-portal/messages/files", {
8238
+ body: form,
8239
+ query,
8240
+ ...extras
8241
+ });
8242
+ }
8243
+ /** Download a file a message of the buyer's conversation with one shop carries. */
8244
+ async downloadMessageFile(fileId, query, options) {
8245
+ return this.request("GET", `/buyer-portal/messages/files/${encodeURIComponent(fileId)}`, {
8246
+ query,
8247
+ responseType: "blob",
8248
+ ...options
8249
+ });
8250
+ }
8251
+ /** Remove a file the buyer uploaded that no message took. */
8252
+ async removeMessageFile(fileId, query, options) {
8253
+ return this.request("DELETE", `/buyer-portal/messages/files/${encodeURIComponent(fileId)}`, {
8254
+ query,
8255
+ ...options
8256
+ });
8257
+ }
8111
8258
  /** The buyer's contact and billing details, and what they may change. */
8112
8259
  async getProfile(options) {
8113
8260
  return this.request("GET", "/buyer-portal/profile", { ...options });