@otterlabs/blocx 1.0.0 → 1.0.2

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
@@ -7,7 +7,7 @@ var jsonBodySerializer = {
7
7
  };
8
8
 
9
9
  // src/generated/core/serverSentEvents.gen.ts
10
- var createSseClient = ({
10
+ function createSseClient({
11
11
  onRequest,
12
12
  onSseError,
13
13
  onSseEvent,
@@ -19,7 +19,7 @@ var createSseClient = ({
19
19
  sseSleepFn,
20
20
  url,
21
21
  ...options
22
- }) => {
22
+ }) {
23
23
  let lastEventId;
24
24
  const sleep = sseSleepFn ?? ((ms) => new Promise((resolve) => setTimeout(resolve, ms)));
25
25
  const createStream = async function* () {
@@ -66,6 +66,7 @@ var createSseClient = ({
66
66
  const { done, value } = await reader.read();
67
67
  if (done) break;
68
68
  buffer += value;
69
+ buffer = buffer.replace(/\r\n?/g, "\n");
69
70
  const chunks = buffer.split("\n\n");
70
71
  buffer = chunks.pop() ?? "";
71
72
  for (const chunk of chunks) {
@@ -139,7 +140,7 @@ var createSseClient = ({
139
140
  };
140
141
  const stream = createStream();
141
142
  return { stream };
142
- };
143
+ }
143
144
 
144
145
  // src/generated/core/pathSerializer.gen.ts
145
146
  var separatorArrayExplode = (style) => {
@@ -386,9 +387,8 @@ var getAuthToken = async (auth, callback) => {
386
387
 
387
388
  // src/generated/client/utils.gen.ts
388
389
  var createQuerySerializer = ({
389
- allowReserved,
390
- array,
391
- object
390
+ parameters = {},
391
+ ...args
392
392
  } = {}) => {
393
393
  const querySerializer = (queryParams) => {
394
394
  const search = [];
@@ -398,29 +398,30 @@ var createQuerySerializer = ({
398
398
  if (value === void 0 || value === null) {
399
399
  continue;
400
400
  }
401
+ const options = parameters[name] || args;
401
402
  if (Array.isArray(value)) {
402
403
  const serializedArray = serializeArrayParam({
403
- allowReserved,
404
+ allowReserved: options.allowReserved,
404
405
  explode: true,
405
406
  name,
406
407
  style: "form",
407
408
  value,
408
- ...array
409
+ ...options.array
409
410
  });
410
411
  if (serializedArray) search.push(serializedArray);
411
412
  } else if (typeof value === "object") {
412
413
  const serializedObject = serializeObjectParam({
413
- allowReserved,
414
+ allowReserved: options.allowReserved,
414
415
  explode: true,
415
416
  name,
416
417
  style: "deepObject",
417
418
  value,
418
- ...object
419
+ ...options.object
419
420
  });
420
421
  if (serializedObject) search.push(serializedObject);
421
422
  } else {
422
423
  const serializedPrimitive = serializePrimitiveParam({
423
- allowReserved,
424
+ allowReserved: options.allowReserved,
424
425
  name,
425
426
  value
426
427
  });
@@ -634,108 +635,126 @@ var createClient = (config = {}) => {
634
635
  if (opts.body === void 0 || opts.serializedBody === "") {
635
636
  opts.headers.delete("Content-Type");
636
637
  }
637
- const url = buildUrl(opts);
638
- return { opts, url };
638
+ const resolvedOpts = opts;
639
+ const url = buildUrl(resolvedOpts);
640
+ return { opts: resolvedOpts, url };
639
641
  };
640
642
  const request = async (options) => {
641
- const { opts, url } = await beforeRequest(options);
642
- const requestInit = {
643
- redirect: "follow",
644
- ...opts,
645
- body: getValidRequestBody(opts)
646
- };
647
- let request2 = new Request(url, requestInit);
648
- for (const fn of interceptors.request.fns) {
649
- if (fn) {
650
- request2 = await fn(request2, opts);
643
+ const throwOnError = options.throwOnError ?? _config.throwOnError;
644
+ const responseStyle = options.responseStyle ?? _config.responseStyle;
645
+ let request2;
646
+ let response;
647
+ try {
648
+ const { opts, url } = await beforeRequest(options);
649
+ const requestInit = {
650
+ redirect: "follow",
651
+ ...opts,
652
+ body: getValidRequestBody(opts)
653
+ };
654
+ request2 = new Request(url, requestInit);
655
+ for (const fn of interceptors.request.fns) {
656
+ if (fn) {
657
+ request2 = await fn(request2, opts);
658
+ }
651
659
  }
652
- }
653
- const _fetch = opts.fetch;
654
- let response = await _fetch(request2);
655
- for (const fn of interceptors.response.fns) {
656
- if (fn) {
657
- response = await fn(response, request2, opts);
660
+ const _fetch = opts.fetch;
661
+ response = await _fetch(request2);
662
+ for (const fn of interceptors.response.fns) {
663
+ if (fn) {
664
+ response = await fn(response, request2, opts);
665
+ }
658
666
  }
659
- }
660
- const result = {
661
- request: request2,
662
- response
663
- };
664
- if (response.ok) {
665
- const parseAs = (opts.parseAs === "auto" ? getParseAs(response.headers.get("Content-Type")) : opts.parseAs) ?? "json";
666
- if (response.status === 204 || response.headers.get("Content-Length") === "0") {
667
- let emptyData;
667
+ const result = {
668
+ request: request2,
669
+ response
670
+ };
671
+ if (response.ok) {
672
+ const parseAs = (opts.parseAs === "auto" ? getParseAs(response.headers.get("Content-Type")) : opts.parseAs) ?? "json";
673
+ if (response.status === 204 || response.headers.get("Content-Length") === "0") {
674
+ let emptyData;
675
+ switch (parseAs) {
676
+ case "arrayBuffer":
677
+ case "blob":
678
+ case "text":
679
+ emptyData = await response[parseAs]();
680
+ break;
681
+ case "formData":
682
+ emptyData = new FormData();
683
+ break;
684
+ case "stream":
685
+ emptyData = response.body;
686
+ break;
687
+ case "json":
688
+ default:
689
+ emptyData = {};
690
+ break;
691
+ }
692
+ return opts.responseStyle === "data" ? emptyData : {
693
+ data: emptyData,
694
+ ...result
695
+ };
696
+ }
697
+ let data;
668
698
  switch (parseAs) {
669
699
  case "arrayBuffer":
670
700
  case "blob":
701
+ case "formData":
671
702
  case "text":
672
- emptyData = await response[parseAs]();
703
+ data = await response[parseAs]();
673
704
  break;
674
- case "formData":
675
- emptyData = new FormData();
705
+ case "json": {
706
+ const text = await response.text();
707
+ data = text ? JSON.parse(text) : {};
676
708
  break;
709
+ }
677
710
  case "stream":
678
- emptyData = response.body;
679
- break;
680
- case "json":
681
- default:
682
- emptyData = {};
683
- break;
711
+ return opts.responseStyle === "data" ? response.body : {
712
+ data: response.body,
713
+ ...result
714
+ };
715
+ }
716
+ if (parseAs === "json") {
717
+ if (opts.responseValidator) {
718
+ await opts.responseValidator(data);
719
+ }
720
+ if (opts.responseTransformer) {
721
+ data = await opts.responseTransformer(data);
722
+ }
684
723
  }
685
- return opts.responseStyle === "data" ? emptyData : {
686
- data: emptyData,
724
+ return opts.responseStyle === "data" ? data : {
725
+ data,
687
726
  ...result
688
727
  };
689
728
  }
690
- let data;
691
- switch (parseAs) {
692
- case "arrayBuffer":
693
- case "blob":
694
- case "formData":
695
- case "json":
696
- case "text":
697
- data = await response[parseAs]();
698
- break;
699
- case "stream":
700
- return opts.responseStyle === "data" ? response.body : {
701
- data: response.body,
702
- ...result
703
- };
729
+ const textError = await response.text();
730
+ let jsonError;
731
+ try {
732
+ jsonError = JSON.parse(textError);
733
+ } catch {
704
734
  }
705
- if (parseAs === "json") {
706
- if (opts.responseValidator) {
707
- await opts.responseValidator(data);
708
- }
709
- if (opts.responseTransformer) {
710
- data = await opts.responseTransformer(data);
735
+ throw jsonError ?? textError;
736
+ } catch (error) {
737
+ let finalError = error;
738
+ for (const fn of interceptors.error.fns) {
739
+ if (fn) {
740
+ finalError = await fn(
741
+ finalError,
742
+ response,
743
+ request2,
744
+ options
745
+ );
711
746
  }
712
747
  }
713
- return opts.responseStyle === "data" ? data : {
714
- data,
715
- ...result
716
- };
717
- }
718
- const textError = await response.text();
719
- let jsonError;
720
- try {
721
- jsonError = JSON.parse(textError);
722
- } catch {
723
- }
724
- const error = jsonError ?? textError;
725
- let finalError = error;
726
- for (const fn of interceptors.error.fns) {
727
- if (fn) {
728
- finalError = await fn(error, response, request2, opts);
748
+ finalError = finalError || {};
749
+ if (throwOnError) {
750
+ throw finalError;
729
751
  }
752
+ return responseStyle === "data" ? void 0 : {
753
+ error: finalError,
754
+ request: request2,
755
+ response
756
+ };
730
757
  }
731
- finalError = finalError || {};
732
- if (opts.throwOnError) {
733
- throw finalError;
734
- }
735
- return opts.responseStyle === "data" ? void 0 : {
736
- error: finalError,
737
- ...result
738
- };
739
758
  };
740
759
  const makeMethodFn = (method) => (options) => request({ ...options, method });
741
760
  const makeSseFn = (method) => async (options) => {
@@ -743,7 +762,6 @@ var createClient = (config = {}) => {
743
762
  return createSseClient({
744
763
  ...opts,
745
764
  body: opts.body,
746
- headers: opts.headers,
747
765
  method,
748
766
  onRequest: async (url2, init) => {
749
767
  let request2 = new Request(url2, init);
@@ -754,11 +772,13 @@ var createClient = (config = {}) => {
754
772
  }
755
773
  return request2;
756
774
  },
775
+ serializedBody: getValidRequestBody(opts),
757
776
  url
758
777
  });
759
778
  };
779
+ const _buildUrl = (options) => buildUrl({ ..._config, ...options });
760
780
  return {
761
- buildUrl,
781
+ buildUrl: _buildUrl,
762
782
  connect: makeMethodFn("CONNECT"),
763
783
  delete: makeMethodFn("DELETE"),
764
784
  get: makeMethodFn("GET"),
@@ -801,14 +821,8 @@ var Brands = class {
801
821
  static listBrands(options) {
802
822
  return (options?.client ?? client).get({
803
823
  security: [
804
- {
805
- name: "x-access-key-id",
806
- type: "apiKey"
807
- },
808
- {
809
- name: "x-secret-access-key",
810
- type: "apiKey"
811
- }
824
+ { name: "x-access-key-id", type: "apiKey" },
825
+ { name: "x-secret-access-key", type: "apiKey" }
812
826
  ],
813
827
  url: "/brands",
814
828
  ...options
@@ -824,14 +838,8 @@ var Brands = class {
824
838
  static createBrand(options) {
825
839
  return (options?.client ?? client).post({
826
840
  security: [
827
- {
828
- name: "x-access-key-id",
829
- type: "apiKey"
830
- },
831
- {
832
- name: "x-secret-access-key",
833
- type: "apiKey"
834
- }
841
+ { name: "x-access-key-id", type: "apiKey" },
842
+ { name: "x-secret-access-key", type: "apiKey" }
835
843
  ],
836
844
  url: "/brands",
837
845
  ...options,
@@ -851,14 +859,8 @@ var Brands = class {
851
859
  static getBrand(options) {
852
860
  return (options?.client ?? client).get({
853
861
  security: [
854
- {
855
- name: "x-access-key-id",
856
- type: "apiKey"
857
- },
858
- {
859
- name: "x-secret-access-key",
860
- type: "apiKey"
861
- }
862
+ { name: "x-access-key-id", type: "apiKey" },
863
+ { name: "x-secret-access-key", type: "apiKey" }
862
864
  ],
863
865
  url: "/brands/{id}",
864
866
  ...options
@@ -874,14 +876,8 @@ var Brands = class {
874
876
  static getBrandFeedback(options) {
875
877
  return (options?.client ?? client).get({
876
878
  security: [
877
- {
878
- name: "x-access-key-id",
879
- type: "apiKey"
880
- },
881
- {
882
- name: "x-secret-access-key",
883
- type: "apiKey"
884
- }
879
+ { name: "x-access-key-id", type: "apiKey" },
880
+ { name: "x-secret-access-key", type: "apiKey" }
885
881
  ],
886
882
  url: "/brands/{id}/feedback",
887
883
  ...options
@@ -899,14 +895,8 @@ var Campaigns = class {
899
895
  static listCampaigns(options) {
900
896
  return (options?.client ?? client).get({
901
897
  security: [
902
- {
903
- name: "x-access-key-id",
904
- type: "apiKey"
905
- },
906
- {
907
- name: "x-secret-access-key",
908
- type: "apiKey"
909
- }
898
+ { name: "x-access-key-id", type: "apiKey" },
899
+ { name: "x-secret-access-key", type: "apiKey" }
910
900
  ],
911
901
  url: "/campaigns",
912
902
  ...options
@@ -922,14 +912,8 @@ var Campaigns = class {
922
912
  static createCampaign(options) {
923
913
  return (options?.client ?? client).post({
924
914
  security: [
925
- {
926
- name: "x-access-key-id",
927
- type: "apiKey"
928
- },
929
- {
930
- name: "x-secret-access-key",
931
- type: "apiKey"
932
- }
915
+ { name: "x-access-key-id", type: "apiKey" },
916
+ { name: "x-secret-access-key", type: "apiKey" }
933
917
  ],
934
918
  url: "/campaigns",
935
919
  ...options,
@@ -949,14 +933,8 @@ var Campaigns = class {
949
933
  static getCampaign(options) {
950
934
  return (options?.client ?? client).get({
951
935
  security: [
952
- {
953
- name: "x-access-key-id",
954
- type: "apiKey"
955
- },
956
- {
957
- name: "x-secret-access-key",
958
- type: "apiKey"
959
- }
936
+ { name: "x-access-key-id", type: "apiKey" },
937
+ { name: "x-secret-access-key", type: "apiKey" }
960
938
  ],
961
939
  url: "/campaigns/{id}",
962
940
  ...options
@@ -972,14 +950,8 @@ var Campaigns = class {
972
950
  static getQualifiedUseCases(options) {
973
951
  return (options?.client ?? client).get({
974
952
  security: [
975
- {
976
- name: "x-access-key-id",
977
- type: "apiKey"
978
- },
979
- {
980
- name: "x-secret-access-key",
981
- type: "apiKey"
982
- }
953
+ { name: "x-access-key-id", type: "apiKey" },
954
+ { name: "x-secret-access-key", type: "apiKey" }
983
955
  ],
984
956
  url: "/campaigns/usecases/{brandId}",
985
957
  ...options
@@ -995,14 +967,8 @@ var Campaigns = class {
995
967
  static shareCampaign(options) {
996
968
  return (options?.client ?? client).post({
997
969
  security: [
998
- {
999
- name: "x-access-key-id",
1000
- type: "apiKey"
1001
- },
1002
- {
1003
- name: "x-secret-access-key",
1004
- type: "apiKey"
1005
- }
970
+ { name: "x-access-key-id", type: "apiKey" },
971
+ { name: "x-secret-access-key", type: "apiKey" }
1006
972
  ],
1007
973
  url: "/campaigns/{id}/share",
1008
974
  ...options,
@@ -1022,14 +988,8 @@ var Campaigns = class {
1022
988
  static getCampaignSharing(options) {
1023
989
  return (options?.client ?? client).get({
1024
990
  security: [
1025
- {
1026
- name: "x-access-key-id",
1027
- type: "apiKey"
1028
- },
1029
- {
1030
- name: "x-secret-access-key",
1031
- type: "apiKey"
1032
- }
991
+ { name: "x-access-key-id", type: "apiKey" },
992
+ { name: "x-secret-access-key", type: "apiKey" }
1033
993
  ],
1034
994
  url: "/campaigns/{id}/sharing",
1035
995
  ...options
@@ -1045,14 +1005,8 @@ var Campaigns = class {
1045
1005
  static getCampaignMnoStatus(options) {
1046
1006
  return (options?.client ?? client).get({
1047
1007
  security: [
1048
- {
1049
- name: "x-access-key-id",
1050
- type: "apiKey"
1051
- },
1052
- {
1053
- name: "x-secret-access-key",
1054
- type: "apiKey"
1055
- }
1008
+ { name: "x-access-key-id", type: "apiKey" },
1009
+ { name: "x-secret-access-key", type: "apiKey" }
1056
1010
  ],
1057
1011
  url: "/campaigns/{id}/operation-status",
1058
1012
  ...options
@@ -1070,14 +1024,8 @@ var Compliance = class {
1070
1024
  static listComplianceEvents(options) {
1071
1025
  return (options?.client ?? client).get({
1072
1026
  security: [
1073
- {
1074
- name: "x-access-key-id",
1075
- type: "apiKey"
1076
- },
1077
- {
1078
- name: "x-secret-access-key",
1079
- type: "apiKey"
1080
- }
1027
+ { name: "x-access-key-id", type: "apiKey" },
1028
+ { name: "x-secret-access-key", type: "apiKey" }
1081
1029
  ],
1082
1030
  url: "/compliance",
1083
1031
  ...options
@@ -1093,14 +1041,8 @@ var Compliance = class {
1093
1041
  static getComplianceEvent(options) {
1094
1042
  return (options?.client ?? client).get({
1095
1043
  security: [
1096
- {
1097
- name: "x-access-key-id",
1098
- type: "apiKey"
1099
- },
1100
- {
1101
- name: "x-secret-access-key",
1102
- type: "apiKey"
1103
- }
1044
+ { name: "x-access-key-id", type: "apiKey" },
1045
+ { name: "x-secret-access-key", type: "apiKey" }
1104
1046
  ],
1105
1047
  url: "/compliance/{id}",
1106
1048
  ...options
@@ -1116,14 +1058,8 @@ var Email = class {
1116
1058
  static getEmailStatus(options) {
1117
1059
  return (options?.client ?? client).get({
1118
1060
  security: [
1119
- {
1120
- name: "x-access-key-id",
1121
- type: "apiKey"
1122
- },
1123
- {
1124
- name: "x-secret-access-key",
1125
- type: "apiKey"
1126
- }
1061
+ { name: "x-access-key-id", type: "apiKey" },
1062
+ { name: "x-secret-access-key", type: "apiKey" }
1127
1063
  ],
1128
1064
  url: "/email/status",
1129
1065
  ...options
@@ -1137,14 +1073,8 @@ var Email = class {
1137
1073
  static enableEmail(options) {
1138
1074
  return (options?.client ?? client).post({
1139
1075
  security: [
1140
- {
1141
- name: "x-access-key-id",
1142
- type: "apiKey"
1143
- },
1144
- {
1145
- name: "x-secret-access-key",
1146
- type: "apiKey"
1147
- }
1076
+ { name: "x-access-key-id", type: "apiKey" },
1077
+ { name: "x-secret-access-key", type: "apiKey" }
1148
1078
  ],
1149
1079
  url: "/email/enable",
1150
1080
  ...options
@@ -1158,14 +1088,8 @@ var Email = class {
1158
1088
  static listEmailIdentities(options) {
1159
1089
  return (options?.client ?? client).get({
1160
1090
  security: [
1161
- {
1162
- name: "x-access-key-id",
1163
- type: "apiKey"
1164
- },
1165
- {
1166
- name: "x-secret-access-key",
1167
- type: "apiKey"
1168
- }
1091
+ { name: "x-access-key-id", type: "apiKey" },
1092
+ { name: "x-secret-access-key", type: "apiKey" }
1169
1093
  ],
1170
1094
  url: "/email/identities",
1171
1095
  ...options
@@ -1181,14 +1105,8 @@ var Email = class {
1181
1105
  static createEmailIdentity(options) {
1182
1106
  return (options?.client ?? client).post({
1183
1107
  security: [
1184
- {
1185
- name: "x-access-key-id",
1186
- type: "apiKey"
1187
- },
1188
- {
1189
- name: "x-secret-access-key",
1190
- type: "apiKey"
1191
- }
1108
+ { name: "x-access-key-id", type: "apiKey" },
1109
+ { name: "x-secret-access-key", type: "apiKey" }
1192
1110
  ],
1193
1111
  url: "/email/identities",
1194
1112
  ...options,
@@ -1206,14 +1124,8 @@ var Email = class {
1206
1124
  static deleteEmailIdentity(options) {
1207
1125
  return (options?.client ?? client).delete({
1208
1126
  security: [
1209
- {
1210
- name: "x-access-key-id",
1211
- type: "apiKey"
1212
- },
1213
- {
1214
- name: "x-secret-access-key",
1215
- type: "apiKey"
1216
- }
1127
+ { name: "x-access-key-id", type: "apiKey" },
1128
+ { name: "x-secret-access-key", type: "apiKey" }
1217
1129
  ],
1218
1130
  url: "/email/identities/{id}",
1219
1131
  ...options
@@ -1227,14 +1139,8 @@ var Email = class {
1227
1139
  static getEmailIdentity(options) {
1228
1140
  return (options?.client ?? client).get({
1229
1141
  security: [
1230
- {
1231
- name: "x-access-key-id",
1232
- type: "apiKey"
1233
- },
1234
- {
1235
- name: "x-secret-access-key",
1236
- type: "apiKey"
1237
- }
1142
+ { name: "x-access-key-id", type: "apiKey" },
1143
+ { name: "x-secret-access-key", type: "apiKey" }
1238
1144
  ],
1239
1145
  url: "/email/identities/{id}",
1240
1146
  ...options
@@ -1248,14 +1154,8 @@ var Email = class {
1248
1154
  static verifyEmailIdentityDns(options) {
1249
1155
  return (options?.client ?? client).post({
1250
1156
  security: [
1251
- {
1252
- name: "x-access-key-id",
1253
- type: "apiKey"
1254
- },
1255
- {
1256
- name: "x-secret-access-key",
1257
- type: "apiKey"
1258
- }
1157
+ { name: "x-access-key-id", type: "apiKey" },
1158
+ { name: "x-secret-access-key", type: "apiKey" }
1259
1159
  ],
1260
1160
  url: "/email/identities/{id}/check-dns",
1261
1161
  ...options
@@ -1269,14 +1169,8 @@ var Email = class {
1269
1169
  static sendEmailIdentityTest(options) {
1270
1170
  return (options?.client ?? client).post({
1271
1171
  security: [
1272
- {
1273
- name: "x-access-key-id",
1274
- type: "apiKey"
1275
- },
1276
- {
1277
- name: "x-secret-access-key",
1278
- type: "apiKey"
1279
- }
1172
+ { name: "x-access-key-id", type: "apiKey" },
1173
+ { name: "x-secret-access-key", type: "apiKey" }
1280
1174
  ],
1281
1175
  url: "/email/identities/{id}/send-test",
1282
1176
  ...options,
@@ -1294,14 +1188,8 @@ var Email = class {
1294
1188
  static getEmailHistory(options) {
1295
1189
  return (options?.client ?? client).get({
1296
1190
  security: [
1297
- {
1298
- name: "x-access-key-id",
1299
- type: "apiKey"
1300
- },
1301
- {
1302
- name: "x-secret-access-key",
1303
- type: "apiKey"
1304
- }
1191
+ { name: "x-access-key-id", type: "apiKey" },
1192
+ { name: "x-secret-access-key", type: "apiKey" }
1305
1193
  ],
1306
1194
  url: "/email/history",
1307
1195
  ...options
@@ -1315,14 +1203,8 @@ var Email = class {
1315
1203
  static sendEmail(options) {
1316
1204
  return (options?.client ?? client).post({
1317
1205
  security: [
1318
- {
1319
- name: "x-access-key-id",
1320
- type: "apiKey"
1321
- },
1322
- {
1323
- name: "x-secret-access-key",
1324
- type: "apiKey"
1325
- }
1206
+ { name: "x-access-key-id", type: "apiKey" },
1207
+ { name: "x-secret-access-key", type: "apiKey" }
1326
1208
  ],
1327
1209
  url: "/email/send",
1328
1210
  ...options,
@@ -1333,6 +1215,135 @@ var Email = class {
1333
1215
  });
1334
1216
  }
1335
1217
  };
1218
+ var Mailboxes = class {
1219
+ /**
1220
+ * List mailboxes
1221
+ *
1222
+ * List inbound mailboxes for the tenant. Each mailbox has a unique random local-part on the inbound domain.
1223
+ *
1224
+ * Requires permission: `mailboxes.read`.
1225
+ */
1226
+ static listMailboxes(options) {
1227
+ return (options?.client ?? client).get({
1228
+ security: [
1229
+ { name: "x-access-key-id", type: "apiKey" },
1230
+ { name: "x-secret-access-key", type: "apiKey" }
1231
+ ],
1232
+ url: "/mailboxes",
1233
+ ...options
1234
+ });
1235
+ }
1236
+ /**
1237
+ * Create mailbox
1238
+ *
1239
+ * Allocate a new inbound mailbox. The address is auto-generated. The first monthly fee is charged immediately; subsequent cycles are billed by the recurring-fees cron.
1240
+ *
1241
+ * Requires permission: `mailboxes.write`.
1242
+ */
1243
+ static createMailbox(options) {
1244
+ return (options?.client ?? client).post({
1245
+ security: [
1246
+ { name: "x-access-key-id", type: "apiKey" },
1247
+ { name: "x-secret-access-key", type: "apiKey" }
1248
+ ],
1249
+ url: "/mailboxes",
1250
+ ...options,
1251
+ headers: {
1252
+ "Content-Type": "application/json",
1253
+ ...options?.headers
1254
+ }
1255
+ });
1256
+ }
1257
+ /**
1258
+ * Delete mailbox
1259
+ *
1260
+ * Permanently delete a mailbox. Inbound messages already received are retained but can no longer receive new mail. Recurring fees stop on the next cycle.
1261
+ *
1262
+ * Requires permission: `mailboxes.write`.
1263
+ */
1264
+ static deleteMailbox(options) {
1265
+ return (options?.client ?? client).delete({
1266
+ security: [
1267
+ { name: "x-access-key-id", type: "apiKey" },
1268
+ { name: "x-secret-access-key", type: "apiKey" }
1269
+ ],
1270
+ url: "/mailboxes/{id}",
1271
+ ...options
1272
+ });
1273
+ }
1274
+ /**
1275
+ * Update mailbox
1276
+ *
1277
+ * Update the label of an existing mailbox. The address itself cannot be changed.
1278
+ *
1279
+ * Requires permission: `mailboxes.write`.
1280
+ */
1281
+ static updateMailbox(options) {
1282
+ return (options?.client ?? client).patch({
1283
+ security: [
1284
+ { name: "x-access-key-id", type: "apiKey" },
1285
+ { name: "x-secret-access-key", type: "apiKey" }
1286
+ ],
1287
+ url: "/mailboxes/{id}",
1288
+ ...options,
1289
+ headers: {
1290
+ "Content-Type": "application/json",
1291
+ ...options?.headers
1292
+ }
1293
+ });
1294
+ }
1295
+ /**
1296
+ * List messages
1297
+ *
1298
+ * List messages received in this mailbox, newest first. Cursor-paginated. Supports filtering by received-at window with `start` / `end` (ISO 8601). The summary excludes message bodies — fetch a specific message for the parsed body or download the raw `.eml`.
1299
+ *
1300
+ * Requires permission: `mailboxes.read`.
1301
+ */
1302
+ static listMailboxMessages(options) {
1303
+ return (options?.client ?? client).get({
1304
+ security: [
1305
+ { name: "x-access-key-id", type: "apiKey" },
1306
+ { name: "x-secret-access-key", type: "apiKey" }
1307
+ ],
1308
+ url: "/mailboxes/{id}/messages",
1309
+ ...options
1310
+ });
1311
+ }
1312
+ /**
1313
+ * Get message
1314
+ *
1315
+ * Fetch a single inbound message. The raw MIME is loaded from S3 and parsed server-side; the response includes addresses, headers, the text and HTML bodies, and attachment metadata. Attachment contents are not included — use the `/raw` endpoint to download the original `.eml` and extract attachments client-side.
1316
+ *
1317
+ * Requires permission: `mailboxes.read`.
1318
+ */
1319
+ static getMailboxMessage(options) {
1320
+ return (options.client ?? client).get({
1321
+ security: [
1322
+ { name: "x-access-key-id", type: "apiKey" },
1323
+ { name: "x-secret-access-key", type: "apiKey" }
1324
+ ],
1325
+ url: "/mailboxes/{id}/messages/{messageId}",
1326
+ ...options
1327
+ });
1328
+ }
1329
+ /**
1330
+ * Download raw .eml
1331
+ *
1332
+ * Download the original RFC 822 MIME for the message. The response is `Content-Type: message/rfc822` with `Content-Disposition: attachment; filename="<messageId>.eml"`. Use this when you need to access attachment payloads or feed the message into a MIME parser of your choice.
1333
+ *
1334
+ * Requires permission: `mailboxes.read`.
1335
+ */
1336
+ static getMailboxMessageRaw(options) {
1337
+ return (options.client ?? client).get({
1338
+ security: [
1339
+ { name: "x-access-key-id", type: "apiKey" },
1340
+ { name: "x-secret-access-key", type: "apiKey" }
1341
+ ],
1342
+ url: "/mailboxes/{id}/messages/{messageId}/raw",
1343
+ ...options
1344
+ });
1345
+ }
1346
+ };
1336
1347
  var Balance = class {
1337
1348
  /**
1338
1349
  * Get balance
@@ -1342,14 +1353,8 @@ var Balance = class {
1342
1353
  static getBalance(options) {
1343
1354
  return (options?.client ?? client).get({
1344
1355
  security: [
1345
- {
1346
- name: "x-access-key-id",
1347
- type: "apiKey"
1348
- },
1349
- {
1350
- name: "x-secret-access-key",
1351
- type: "apiKey"
1352
- }
1356
+ { name: "x-access-key-id", type: "apiKey" },
1357
+ { name: "x-secret-access-key", type: "apiKey" }
1353
1358
  ],
1354
1359
  url: "/balance",
1355
1360
  ...options
@@ -1363,14 +1368,8 @@ var Balance = class {
1363
1368
  static getBalanceHistory(options) {
1364
1369
  return (options?.client ?? client).get({
1365
1370
  security: [
1366
- {
1367
- name: "x-access-key-id",
1368
- type: "apiKey"
1369
- },
1370
- {
1371
- name: "x-secret-access-key",
1372
- type: "apiKey"
1373
- }
1371
+ { name: "x-access-key-id", type: "apiKey" },
1372
+ { name: "x-secret-access-key", type: "apiKey" }
1374
1373
  ],
1375
1374
  url: "/balance/history",
1376
1375
  ...options
@@ -1384,14 +1383,8 @@ var Balance = class {
1384
1383
  static getBalanceUsage(options) {
1385
1384
  return (options?.client ?? client).get({
1386
1385
  security: [
1387
- {
1388
- name: "x-access-key-id",
1389
- type: "apiKey"
1390
- },
1391
- {
1392
- name: "x-secret-access-key",
1393
- type: "apiKey"
1394
- }
1386
+ { name: "x-access-key-id", type: "apiKey" },
1387
+ { name: "x-secret-access-key", type: "apiKey" }
1395
1388
  ],
1396
1389
  url: "/balance/usage",
1397
1390
  ...options
@@ -1409,14 +1402,8 @@ var Messaging = class {
1409
1402
  static sendMessage(options) {
1410
1403
  return (options?.client ?? client).post({
1411
1404
  security: [
1412
- {
1413
- name: "x-access-key-id",
1414
- type: "apiKey"
1415
- },
1416
- {
1417
- name: "x-secret-access-key",
1418
- type: "apiKey"
1419
- }
1405
+ { name: "x-access-key-id", type: "apiKey" },
1406
+ { name: "x-secret-access-key", type: "apiKey" }
1420
1407
  ],
1421
1408
  url: "/messaging/send",
1422
1409
  ...options,
@@ -1427,7 +1414,7 @@ var Messaging = class {
1427
1414
  });
1428
1415
  }
1429
1416
  };
1430
- var FaVerifications = class {
1417
+ var _2FaVerifications = class {
1431
1418
  /**
1432
1419
  * Send verification code
1433
1420
  *
@@ -1444,14 +1431,8 @@ var FaVerifications = class {
1444
1431
  static createVerification(options) {
1445
1432
  return (options?.client ?? client).post({
1446
1433
  security: [
1447
- {
1448
- name: "x-access-key-id",
1449
- type: "apiKey"
1450
- },
1451
- {
1452
- name: "x-secret-access-key",
1453
- type: "apiKey"
1454
- }
1434
+ { name: "x-access-key-id", type: "apiKey" },
1435
+ { name: "x-secret-access-key", type: "apiKey" }
1455
1436
  ],
1456
1437
  url: "/twofa/verifications",
1457
1438
  ...options,
@@ -1477,14 +1458,8 @@ var FaVerifications = class {
1477
1458
  static checkVerification(options) {
1478
1459
  return (options.client ?? client).post({
1479
1460
  security: [
1480
- {
1481
- name: "x-access-key-id",
1482
- type: "apiKey"
1483
- },
1484
- {
1485
- name: "x-secret-access-key",
1486
- type: "apiKey"
1487
- }
1461
+ { name: "x-access-key-id", type: "apiKey" },
1462
+ { name: "x-secret-access-key", type: "apiKey" }
1488
1463
  ],
1489
1464
  url: "/twofa/verifications/{id}/check",
1490
1465
  ...options,
@@ -1495,7 +1470,7 @@ var FaVerifications = class {
1495
1470
  });
1496
1471
  }
1497
1472
  };
1498
- var FaTemplates = class {
1473
+ var _2FaTemplates = class {
1499
1474
  /**
1500
1475
  * List templates
1501
1476
  *
@@ -1508,14 +1483,8 @@ var FaTemplates = class {
1508
1483
  static listTwofaTemplates(options) {
1509
1484
  return (options?.client ?? client).get({
1510
1485
  security: [
1511
- {
1512
- name: "x-access-key-id",
1513
- type: "apiKey"
1514
- },
1515
- {
1516
- name: "x-secret-access-key",
1517
- type: "apiKey"
1518
- }
1486
+ { name: "x-access-key-id", type: "apiKey" },
1487
+ { name: "x-secret-access-key", type: "apiKey" }
1519
1488
  ],
1520
1489
  url: "/twofa/templates",
1521
1490
  ...options
@@ -1533,14 +1502,8 @@ var FaTemplates = class {
1533
1502
  static createTwofaTemplate(options) {
1534
1503
  return (options?.client ?? client).post({
1535
1504
  security: [
1536
- {
1537
- name: "x-access-key-id",
1538
- type: "apiKey"
1539
- },
1540
- {
1541
- name: "x-secret-access-key",
1542
- type: "apiKey"
1543
- }
1505
+ { name: "x-access-key-id", type: "apiKey" },
1506
+ { name: "x-secret-access-key", type: "apiKey" }
1544
1507
  ],
1545
1508
  url: "/twofa/templates",
1546
1509
  ...options,
@@ -1562,14 +1525,8 @@ var FaTemplates = class {
1562
1525
  static deleteTwofaTemplate(options) {
1563
1526
  return (options.client ?? client).delete({
1564
1527
  security: [
1565
- {
1566
- name: "x-access-key-id",
1567
- type: "apiKey"
1568
- },
1569
- {
1570
- name: "x-secret-access-key",
1571
- type: "apiKey"
1572
- }
1528
+ { name: "x-access-key-id", type: "apiKey" },
1529
+ { name: "x-secret-access-key", type: "apiKey" }
1573
1530
  ],
1574
1531
  url: "/twofa/templates/{id}",
1575
1532
  ...options
@@ -1587,14 +1544,8 @@ var FaTemplates = class {
1587
1544
  static getTwofaTemplate(options) {
1588
1545
  return (options.client ?? client).get({
1589
1546
  security: [
1590
- {
1591
- name: "x-access-key-id",
1592
- type: "apiKey"
1593
- },
1594
- {
1595
- name: "x-secret-access-key",
1596
- type: "apiKey"
1597
- }
1547
+ { name: "x-access-key-id", type: "apiKey" },
1548
+ { name: "x-secret-access-key", type: "apiKey" }
1598
1549
  ],
1599
1550
  url: "/twofa/templates/{id}",
1600
1551
  ...options
@@ -1612,14 +1563,8 @@ var FaTemplates = class {
1612
1563
  static updateTwofaTemplate(options) {
1613
1564
  return (options.client ?? client).patch({
1614
1565
  security: [
1615
- {
1616
- name: "x-access-key-id",
1617
- type: "apiKey"
1618
- },
1619
- {
1620
- name: "x-secret-access-key",
1621
- type: "apiKey"
1622
- }
1566
+ { name: "x-access-key-id", type: "apiKey" },
1567
+ { name: "x-secret-access-key", type: "apiKey" }
1623
1568
  ],
1624
1569
  url: "/twofa/templates/{id}",
1625
1570
  ...options,
@@ -1643,14 +1588,8 @@ var FaTemplates = class {
1643
1588
  static submitTwofaTemplate(options) {
1644
1589
  return (options.client ?? client).post({
1645
1590
  security: [
1646
- {
1647
- name: "x-access-key-id",
1648
- type: "apiKey"
1649
- },
1650
- {
1651
- name: "x-secret-access-key",
1652
- type: "apiKey"
1653
- }
1591
+ { name: "x-access-key-id", type: "apiKey" },
1592
+ { name: "x-secret-access-key", type: "apiKey" }
1654
1593
  ],
1655
1594
  url: "/twofa/templates/{id}/submit",
1656
1595
  ...options
@@ -1668,14 +1607,8 @@ var Quotas = class {
1668
1607
  static listQuotas(options) {
1669
1608
  return (options?.client ?? client).get({
1670
1609
  security: [
1671
- {
1672
- name: "x-access-key-id",
1673
- type: "apiKey"
1674
- },
1675
- {
1676
- name: "x-secret-access-key",
1677
- type: "apiKey"
1678
- }
1610
+ { name: "x-access-key-id", type: "apiKey" },
1611
+ { name: "x-secret-access-key", type: "apiKey" }
1679
1612
  ],
1680
1613
  url: "/quotas",
1681
1614
  ...options
@@ -1691,14 +1624,8 @@ var Quotas = class {
1691
1624
  static listQuotaIncreaseRequests(options) {
1692
1625
  return (options?.client ?? client).get({
1693
1626
  security: [
1694
- {
1695
- name: "x-access-key-id",
1696
- type: "apiKey"
1697
- },
1698
- {
1699
- name: "x-secret-access-key",
1700
- type: "apiKey"
1701
- }
1627
+ { name: "x-access-key-id", type: "apiKey" },
1628
+ { name: "x-secret-access-key", type: "apiKey" }
1702
1629
  ],
1703
1630
  url: "/quotas/increase-requests",
1704
1631
  ...options
@@ -1716,14 +1643,8 @@ var Quotas = class {
1716
1643
  static createQuotaIncreaseRequest(options) {
1717
1644
  return (options?.client ?? client).post({
1718
1645
  security: [
1719
- {
1720
- name: "x-access-key-id",
1721
- type: "apiKey"
1722
- },
1723
- {
1724
- name: "x-secret-access-key",
1725
- type: "apiKey"
1726
- }
1646
+ { name: "x-access-key-id", type: "apiKey" },
1647
+ { name: "x-secret-access-key", type: "apiKey" }
1727
1648
  ],
1728
1649
  url: "/quotas/increase-requests",
1729
1650
  ...options,
@@ -1743,14 +1664,8 @@ var Quotas = class {
1743
1664
  static getQuotaIncreaseRequest(options) {
1744
1665
  return (options?.client ?? client).get({
1745
1666
  security: [
1746
- {
1747
- name: "x-access-key-id",
1748
- type: "apiKey"
1749
- },
1750
- {
1751
- name: "x-secret-access-key",
1752
- type: "apiKey"
1753
- }
1667
+ { name: "x-access-key-id", type: "apiKey" },
1668
+ { name: "x-secret-access-key", type: "apiKey" }
1754
1669
  ],
1755
1670
  url: "/quotas/increase-requests/{id}",
1756
1671
  ...options
@@ -1770,14 +1685,8 @@ var MessagingProfiles = class {
1770
1685
  static listMessagingProfiles(options) {
1771
1686
  return (options?.client ?? client).get({
1772
1687
  security: [
1773
- {
1774
- name: "x-access-key-id",
1775
- type: "apiKey"
1776
- },
1777
- {
1778
- name: "x-secret-access-key",
1779
- type: "apiKey"
1780
- }
1688
+ { name: "x-access-key-id", type: "apiKey" },
1689
+ { name: "x-secret-access-key", type: "apiKey" }
1781
1690
  ],
1782
1691
  url: "/messaging-profiles",
1783
1692
  ...options
@@ -1795,14 +1704,8 @@ var MessagingProfiles = class {
1795
1704
  static createMessagingProfile(options) {
1796
1705
  return (options?.client ?? client).post({
1797
1706
  security: [
1798
- {
1799
- name: "x-access-key-id",
1800
- type: "apiKey"
1801
- },
1802
- {
1803
- name: "x-secret-access-key",
1804
- type: "apiKey"
1805
- }
1707
+ { name: "x-access-key-id", type: "apiKey" },
1708
+ { name: "x-secret-access-key", type: "apiKey" }
1806
1709
  ],
1807
1710
  url: "/messaging-profiles",
1808
1711
  ...options,
@@ -1824,14 +1727,8 @@ var MessagingProfiles = class {
1824
1727
  static deleteMessagingProfile(options) {
1825
1728
  return (options?.client ?? client).delete({
1826
1729
  security: [
1827
- {
1828
- name: "x-access-key-id",
1829
- type: "apiKey"
1830
- },
1831
- {
1832
- name: "x-secret-access-key",
1833
- type: "apiKey"
1834
- }
1730
+ { name: "x-access-key-id", type: "apiKey" },
1731
+ { name: "x-secret-access-key", type: "apiKey" }
1835
1732
  ],
1836
1733
  url: "/messaging-profiles/{id}",
1837
1734
  ...options
@@ -1849,14 +1746,8 @@ var MessagingProfiles = class {
1849
1746
  static getMessagingProfile(options) {
1850
1747
  return (options?.client ?? client).get({
1851
1748
  security: [
1852
- {
1853
- name: "x-access-key-id",
1854
- type: "apiKey"
1855
- },
1856
- {
1857
- name: "x-secret-access-key",
1858
- type: "apiKey"
1859
- }
1749
+ { name: "x-access-key-id", type: "apiKey" },
1750
+ { name: "x-secret-access-key", type: "apiKey" }
1860
1751
  ],
1861
1752
  url: "/messaging-profiles/{id}",
1862
1753
  ...options
@@ -1874,14 +1765,8 @@ var MessagingProfiles = class {
1874
1765
  static updateMessagingProfile(options) {
1875
1766
  return (options?.client ?? client).put({
1876
1767
  security: [
1877
- {
1878
- name: "x-access-key-id",
1879
- type: "apiKey"
1880
- },
1881
- {
1882
- name: "x-secret-access-key",
1883
- type: "apiKey"
1884
- }
1768
+ { name: "x-access-key-id", type: "apiKey" },
1769
+ { name: "x-secret-access-key", type: "apiKey" }
1885
1770
  ],
1886
1771
  url: "/messaging-profiles/{id}",
1887
1772
  ...options,
@@ -1903,14 +1788,8 @@ var MessagingProfiles = class {
1903
1788
  static assignMessagingProfileNumbers(options) {
1904
1789
  return (options?.client ?? client).post({
1905
1790
  security: [
1906
- {
1907
- name: "x-access-key-id",
1908
- type: "apiKey"
1909
- },
1910
- {
1911
- name: "x-secret-access-key",
1912
- type: "apiKey"
1913
- }
1791
+ { name: "x-access-key-id", type: "apiKey" },
1792
+ { name: "x-secret-access-key", type: "apiKey" }
1914
1793
  ],
1915
1794
  url: "/messaging-profiles/{id}/assign",
1916
1795
  ...options,
@@ -1932,14 +1811,8 @@ var MessagingProfiles = class {
1932
1811
  static unassignMessagingProfileNumbers(options) {
1933
1812
  return (options?.client ?? client).post({
1934
1813
  security: [
1935
- {
1936
- name: "x-access-key-id",
1937
- type: "apiKey"
1938
- },
1939
- {
1940
- name: "x-secret-access-key",
1941
- type: "apiKey"
1942
- }
1814
+ { name: "x-access-key-id", type: "apiKey" },
1815
+ { name: "x-secret-access-key", type: "apiKey" }
1943
1816
  ],
1944
1817
  url: "/messaging-profiles/{id}/unassign",
1945
1818
  ...options,
@@ -1965,14 +1838,8 @@ var PhoneNumbers = class {
1965
1838
  static searchPhoneNumbers(options) {
1966
1839
  return (options?.client ?? client).get({
1967
1840
  security: [
1968
- {
1969
- name: "x-access-key-id",
1970
- type: "apiKey"
1971
- },
1972
- {
1973
- name: "x-secret-access-key",
1974
- type: "apiKey"
1975
- }
1841
+ { name: "x-access-key-id", type: "apiKey" },
1842
+ { name: "x-secret-access-key", type: "apiKey" }
1976
1843
  ],
1977
1844
  url: "/phone-numbers/search",
1978
1845
  ...options
@@ -1990,14 +1857,8 @@ var PhoneNumbers = class {
1990
1857
  static listPhoneNumbers(options) {
1991
1858
  return (options?.client ?? client).get({
1992
1859
  security: [
1993
- {
1994
- name: "x-access-key-id",
1995
- type: "apiKey"
1996
- },
1997
- {
1998
- name: "x-secret-access-key",
1999
- type: "apiKey"
2000
- }
1860
+ { name: "x-access-key-id", type: "apiKey" },
1861
+ { name: "x-secret-access-key", type: "apiKey" }
2001
1862
  ],
2002
1863
  url: "/phone-numbers",
2003
1864
  ...options
@@ -2015,14 +1876,8 @@ var PhoneNumbers = class {
2015
1876
  static getPhoneNumber(options) {
2016
1877
  return (options?.client ?? client).get({
2017
1878
  security: [
2018
- {
2019
- name: "x-access-key-id",
2020
- type: "apiKey"
2021
- },
2022
- {
2023
- name: "x-secret-access-key",
2024
- type: "apiKey"
2025
- }
1879
+ { name: "x-access-key-id", type: "apiKey" },
1880
+ { name: "x-secret-access-key", type: "apiKey" }
2026
1881
  ],
2027
1882
  url: "/phone-numbers/{id}",
2028
1883
  ...options
@@ -2040,14 +1895,8 @@ var PhoneNumbers = class {
2040
1895
  static updatePhoneNumber(options) {
2041
1896
  return (options?.client ?? client).put({
2042
1897
  security: [
2043
- {
2044
- name: "x-access-key-id",
2045
- type: "apiKey"
2046
- },
2047
- {
2048
- name: "x-secret-access-key",
2049
- type: "apiKey"
2050
- }
1898
+ { name: "x-access-key-id", type: "apiKey" },
1899
+ { name: "x-secret-access-key", type: "apiKey" }
2051
1900
  ],
2052
1901
  url: "/phone-numbers/{id}",
2053
1902
  ...options,
@@ -2069,14 +1918,8 @@ var PhoneNumbers = class {
2069
1918
  static bulkAssignPhoneNumbers(options) {
2070
1919
  return (options?.client ?? client).post({
2071
1920
  security: [
2072
- {
2073
- name: "x-access-key-id",
2074
- type: "apiKey"
2075
- },
2076
- {
2077
- name: "x-secret-access-key",
2078
- type: "apiKey"
2079
- }
1921
+ { name: "x-access-key-id", type: "apiKey" },
1922
+ { name: "x-secret-access-key", type: "apiKey" }
2080
1923
  ],
2081
1924
  url: "/phone-numbers/bulk-assign",
2082
1925
  ...options,
@@ -2098,14 +1941,8 @@ var PhoneNumbers = class {
2098
1941
  static bulkUnassignPhoneNumbers(options) {
2099
1942
  return (options?.client ?? client).post({
2100
1943
  security: [
2101
- {
2102
- name: "x-access-key-id",
2103
- type: "apiKey"
2104
- },
2105
- {
2106
- name: "x-secret-access-key",
2107
- type: "apiKey"
2108
- }
1944
+ { name: "x-access-key-id", type: "apiKey" },
1945
+ { name: "x-secret-access-key", type: "apiKey" }
2109
1946
  ],
2110
1947
  url: "/phone-numbers/bulk-unassign",
2111
1948
  ...options,
@@ -2129,14 +1966,8 @@ var PhoneOrders = class {
2129
1966
  static listPhoneOrders(options) {
2130
1967
  return (options?.client ?? client).get({
2131
1968
  security: [
2132
- {
2133
- name: "x-access-key-id",
2134
- type: "apiKey"
2135
- },
2136
- {
2137
- name: "x-secret-access-key",
2138
- type: "apiKey"
2139
- }
1969
+ { name: "x-access-key-id", type: "apiKey" },
1970
+ { name: "x-secret-access-key", type: "apiKey" }
2140
1971
  ],
2141
1972
  url: "/phone-orders",
2142
1973
  ...options
@@ -2154,14 +1985,8 @@ var PhoneOrders = class {
2154
1985
  static createPhoneOrder(options) {
2155
1986
  return (options?.client ?? client).post({
2156
1987
  security: [
2157
- {
2158
- name: "x-access-key-id",
2159
- type: "apiKey"
2160
- },
2161
- {
2162
- name: "x-secret-access-key",
2163
- type: "apiKey"
2164
- }
1988
+ { name: "x-access-key-id", type: "apiKey" },
1989
+ { name: "x-secret-access-key", type: "apiKey" }
2165
1990
  ],
2166
1991
  url: "/phone-orders",
2167
1992
  ...options,
@@ -2183,20 +2008,96 @@ var PhoneOrders = class {
2183
2008
  static getPhoneOrder(options) {
2184
2009
  return (options?.client ?? client).get({
2185
2010
  security: [
2186
- {
2187
- name: "x-access-key-id",
2188
- type: "apiKey"
2189
- },
2190
- {
2191
- name: "x-secret-access-key",
2192
- type: "apiKey"
2193
- }
2011
+ { name: "x-access-key-id", type: "apiKey" },
2012
+ { name: "x-secret-access-key", type: "apiKey" }
2194
2013
  ],
2195
2014
  url: "/phone-orders/{id}",
2196
2015
  ...options
2197
2016
  });
2198
2017
  }
2199
2018
  };
2019
+ var Webhooks = class {
2020
+ /**
2021
+ * List webhook endpoints
2022
+ *
2023
+ * List all webhook endpoints registered for your account. Signing secrets are never returned by this endpoint.
2024
+ *
2025
+ * Requires permission: `webhooks.read`.
2026
+ */
2027
+ static listWebhooks(options) {
2028
+ return (options?.client ?? client).get({
2029
+ security: [
2030
+ { name: "x-access-key-id", type: "apiKey" },
2031
+ { name: "x-secret-access-key", type: "apiKey" }
2032
+ ],
2033
+ url: "/webhooks",
2034
+ ...options
2035
+ });
2036
+ }
2037
+ /**
2038
+ * Create webhook endpoint
2039
+ *
2040
+ * Register a webhook endpoint. We POST a signed JSON body to `url` whenever any event in `eventTypes` fires for your account.
2041
+ *
2042
+ * **The signing secret is shown ONCE in this response and never again.** Store it before continuing — see the `Webhooks` section in the spec description for verification details.
2043
+ *
2044
+ * URLs must be HTTPS (HTTP allowed in dev only) and resolve to a public IP. Hostnames or literal IPs that resolve to private/loopback ranges are rejected with `400 WEBHOOK_URL_BLOCKED`.
2045
+ *
2046
+ * Requires permission: `webhooks.write`.
2047
+ */
2048
+ static createWebhook(options) {
2049
+ return (options?.client ?? client).post({
2050
+ security: [
2051
+ { name: "x-access-key-id", type: "apiKey" },
2052
+ { name: "x-secret-access-key", type: "apiKey" }
2053
+ ],
2054
+ url: "/webhooks",
2055
+ ...options,
2056
+ headers: {
2057
+ "Content-Type": "application/json",
2058
+ ...options?.headers
2059
+ }
2060
+ });
2061
+ }
2062
+ /**
2063
+ * Delete webhook endpoint
2064
+ *
2065
+ * Permanently delete the endpoint. In-flight delivery attempts for already-enqueued events still run to completion.
2066
+ *
2067
+ * Requires permission: `webhooks.write`.
2068
+ */
2069
+ static deleteWebhook(options) {
2070
+ return (options.client ?? client).delete({
2071
+ security: [
2072
+ { name: "x-access-key-id", type: "apiKey" },
2073
+ { name: "x-secret-access-key", type: "apiKey" }
2074
+ ],
2075
+ url: "/webhooks/{publicId}",
2076
+ ...options
2077
+ });
2078
+ }
2079
+ /**
2080
+ * Update webhook endpoint
2081
+ *
2082
+ * Update one or more fields. The signing secret is not rotated by this endpoint.
2083
+ *
2084
+ * Requires permission: `webhooks.write`.
2085
+ */
2086
+ static updateWebhook(options) {
2087
+ return (options.client ?? client).patch({
2088
+ security: [
2089
+ { name: "x-access-key-id", type: "apiKey" },
2090
+ { name: "x-secret-access-key", type: "apiKey" }
2091
+ ],
2092
+ url: "/webhooks/{publicId}",
2093
+ ...options,
2094
+ headers: {
2095
+ "Content-Type": "application/json",
2096
+ ...options.headers
2097
+ }
2098
+ });
2099
+ }
2100
+ };
2200
2101
 
2201
2102
  // src/index.ts
2202
2103
  function buildConfig(options) {
@@ -2224,6 +2125,6 @@ function createBlocxClient(options) {
2224
2125
  };
2225
2126
  }
2226
2127
 
2227
- export { Balance, Brands, Campaigns, Compliance, Email, FaTemplates, FaVerifications, Messaging, MessagingProfiles, PhoneNumbers, PhoneOrders, Quotas, createBlocxClient };
2128
+ export { Balance, Brands, Campaigns, Compliance, Email, Mailboxes, Messaging, MessagingProfiles, PhoneNumbers, PhoneOrders, Quotas, Webhooks, _2FaTemplates, _2FaVerifications, createBlocxClient };
2228
2129
  //# sourceMappingURL=index.js.map
2229
2130
  //# sourceMappingURL=index.js.map