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