@anuma/sdk 9.1.6 → 9.1.7

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.
@@ -5461,7 +5461,7 @@ var mergeHeaders = (...headers) => {
5461
5461
  if (!header || typeof header !== "object") {
5462
5462
  continue;
5463
5463
  }
5464
- const iterator = header instanceof Headers ? headersEntries(header) : Object.entries(header);
5464
+ const iterator = Array.isArray(header) || header instanceof Headers ? headersEntries(new Headers(header)) : Object.entries(header);
5465
5465
  for (const [key, value] of iterator) {
5466
5466
  if (value === null) {
5467
5467
  mergedHeaders.delete(key);
@@ -5737,6 +5737,18 @@ var createClient = (config = {}) => {
5737
5737
  init_clientConfig();
5738
5738
  var client = createClient(createClientConfig(createConfig()));
5739
5739
 
5740
+ // src/clientHeaders.ts
5741
+ function normalizeHeaders(headers) {
5742
+ if (headers instanceof Headers || Array.isArray(headers)) {
5743
+ const normalized = /* @__PURE__ */ Object.create(null);
5744
+ new Headers(headers).forEach((value, name) => {
5745
+ normalized[name] = value;
5746
+ });
5747
+ return normalized;
5748
+ }
5749
+ return headers;
5750
+ }
5751
+
5740
5752
  // src/client/sdk.gen.ts
5741
5753
  var getApiV1CreditsBalance = (options) => (options?.client ?? client).get({ url: "/api/v1/credits/balance", ...options });
5742
5754
  var getApiV1CreditsPacks = (options) => (options?.client ?? client).get({ url: "/api/v1/credits/packs", ...options });
@@ -5745,7 +5757,7 @@ var postApiV1CreditsPurchase = (options) => (options.client ?? client).post({
5745
5757
  ...options,
5746
5758
  headers: {
5747
5759
  "Content-Type": "application/json",
5748
- ...options.headers
5760
+ ...normalizeHeaders(options.headers)
5749
5761
  }
5750
5762
  });
5751
5763
  var postApiV1Embeddings = (options) => (options.client ?? client).post({
@@ -5753,7 +5765,7 @@ var postApiV1Embeddings = (options) => (options.client ?? client).post({
5753
5765
  ...options,
5754
5766
  headers: {
5755
5767
  "Content-Type": "application/json",
5756
- ...options.headers
5768
+ ...normalizeHeaders(options.headers)
5757
5769
  }
5758
5770
  });
5759
5771
  var getApiV1Models = (options) => (options?.client ?? client).get({ url: "/api/v1/models", ...options });
@@ -3830,7 +3830,7 @@ var mergeHeaders = (...headers) => {
3830
3830
  if (!header || typeof header !== "object") {
3831
3831
  continue;
3832
3832
  }
3833
- const iterator = header instanceof Headers ? headersEntries(header) : Object.entries(header);
3833
+ const iterator = Array.isArray(header) || header instanceof Headers ? headersEntries(new Headers(header)) : Object.entries(header);
3834
3834
  for (const [key, value] of iterator) {
3835
3835
  if (value === null) {
3836
3836
  mergedHeaders.delete(key);
@@ -4105,6 +4105,18 @@ var createClient = (config = {}) => {
4105
4105
  // src/client/client.gen.ts
4106
4106
  var client = createClient(createClientConfig(createConfig()));
4107
4107
 
4108
+ // src/clientHeaders.ts
4109
+ function normalizeHeaders(headers) {
4110
+ if (headers instanceof Headers || Array.isArray(headers)) {
4111
+ const normalized = /* @__PURE__ */ Object.create(null);
4112
+ new Headers(headers).forEach((value, name) => {
4113
+ normalized[name] = value;
4114
+ });
4115
+ return normalized;
4116
+ }
4117
+ return headers;
4118
+ }
4119
+
4108
4120
  // src/client/sdk.gen.ts
4109
4121
  var getApiV1CreditsBalance = (options) => (options?.client ?? client).get({ url: "/api/v1/credits/balance", ...options });
4110
4122
  var getApiV1CreditsPacks = (options) => (options?.client ?? client).get({ url: "/api/v1/credits/packs", ...options });
@@ -4113,7 +4125,7 @@ var postApiV1CreditsPurchase = (options) => (options.client ?? client).post({
4113
4125
  ...options,
4114
4126
  headers: {
4115
4127
  "Content-Type": "application/json",
4116
- ...options.headers
4128
+ ...normalizeHeaders(options.headers)
4117
4129
  }
4118
4130
  });
4119
4131
  var postApiV1Embeddings = (options) => (options.client ?? client).post({
@@ -4121,7 +4133,7 @@ var postApiV1Embeddings = (options) => (options.client ?? client).post({
4121
4133
  ...options,
4122
4134
  headers: {
4123
4135
  "Content-Type": "application/json",
4124
- ...options.headers
4136
+ ...normalizeHeaders(options.headers)
4125
4137
  }
4126
4138
  });
4127
4139
  var getApiV1Models = (options) => (options?.client ?? client).get({ url: "/api/v1/models", ...options });
package/dist/index.cjs CHANGED
@@ -713,7 +713,7 @@ var mergeHeaders = (...headers) => {
713
713
  if (!header || typeof header !== "object") {
714
714
  continue;
715
715
  }
716
- const iterator = header instanceof Headers ? headersEntries(header) : Object.entries(header);
716
+ const iterator = Array.isArray(header) || header instanceof Headers ? headersEntries(new Headers(header)) : Object.entries(header);
717
717
  for (const [key, value] of iterator) {
718
718
  if (value === null) {
719
719
  mergedHeaders.delete(key);
@@ -989,6 +989,18 @@ var createClient = (config = {}) => {
989
989
  init_clientConfig();
990
990
  var client = createClient(createClientConfig(createConfig()));
991
991
 
992
+ // src/clientHeaders.ts
993
+ function normalizeHeaders(headers) {
994
+ if (headers instanceof Headers || Array.isArray(headers)) {
995
+ const normalized = /* @__PURE__ */ Object.create(null);
996
+ new Headers(headers).forEach((value, name) => {
997
+ normalized[name] = value;
998
+ });
999
+ return normalized;
1000
+ }
1001
+ return headers;
1002
+ }
1003
+
992
1004
  // src/client/sdk.gen.ts
993
1005
  var deleteApiV1Account = (options) => (options?.client ?? client).delete({ url: "/api/v1/account", ...options });
994
1006
  var postApiV1AdminAddCredits = (options) => (options.client ?? client).post({
@@ -996,7 +1008,7 @@ var postApiV1AdminAddCredits = (options) => (options.client ?? client).post({
996
1008
  ...options,
997
1009
  headers: {
998
1010
  "Content-Type": "application/json",
999
- ...options.headers
1011
+ ...normalizeHeaders(options.headers)
1000
1012
  }
1001
1013
  });
1002
1014
  var postApiV1AdminAgents = (options) => (options.client ?? client).post({
@@ -1004,7 +1016,7 @@ var postApiV1AdminAgents = (options) => (options.client ?? client).post({
1004
1016
  ...options,
1005
1017
  headers: {
1006
1018
  "Content-Type": "application/json",
1007
- ...options.headers
1019
+ ...normalizeHeaders(options.headers)
1008
1020
  }
1009
1021
  });
1010
1022
  var deleteApiV1AdminAgentsById = (options) => (options.client ?? client).delete({ url: "/api/v1/admin/agents/{id}", ...options });
@@ -1013,7 +1025,7 @@ var putApiV1AdminAgentsById = (options) => (options.client ?? client).put({
1013
1025
  ...options,
1014
1026
  headers: {
1015
1027
  "Content-Type": "application/json",
1016
- ...options.headers
1028
+ ...normalizeHeaders(options.headers)
1017
1029
  }
1018
1030
  });
1019
1031
  var getApiV1AdminApps = (options) => (options.client ?? client).get({ url: "/api/v1/admin/apps", ...options });
@@ -1022,7 +1034,7 @@ var postApiV1AdminApps = (options) => (options.client ?? client).post({
1022
1034
  ...options,
1023
1035
  headers: {
1024
1036
  "Content-Type": "application/json",
1025
- ...options.headers
1037
+ ...normalizeHeaders(options.headers)
1026
1038
  }
1027
1039
  });
1028
1040
  var getApiV1AdminAppsByAppIdApiKeys = (options) => (options.client ?? client).get({ url: "/api/v1/admin/apps/{app_id}/api-keys", ...options });
@@ -1031,7 +1043,7 @@ var postApiV1AdminAppsByAppIdApiKeys = (options) => (options.client ?? client).p
1031
1043
  ...options,
1032
1044
  headers: {
1033
1045
  "Content-Type": "application/json",
1034
- ...options.headers
1046
+ ...normalizeHeaders(options.headers)
1035
1047
  }
1036
1048
  });
1037
1049
  var deleteApiV1AdminAppsByAppIdApiKeysById = (options) => (options.client ?? client).delete({ url: "/api/v1/admin/apps/{app_id}/api-keys/{id}", ...options });
@@ -1041,7 +1053,7 @@ var putApiV1AdminAppsByAppIdApiKeysById = (options) => (options.client ?? client
1041
1053
  ...options,
1042
1054
  headers: {
1043
1055
  "Content-Type": "application/json",
1044
- ...options.headers
1056
+ ...normalizeHeaders(options.headers)
1045
1057
  }
1046
1058
  });
1047
1059
  var deleteApiV1AdminAppsById = (options) => (options.client ?? client).delete({ url: "/api/v1/admin/apps/{id}", ...options });
@@ -1051,7 +1063,7 @@ var putApiV1AdminAppsById = (options) => (options.client ?? client).put({
1051
1063
  ...options,
1052
1064
  headers: {
1053
1065
  "Content-Type": "application/json",
1054
- ...options.headers
1066
+ ...normalizeHeaders(options.headers)
1055
1067
  }
1056
1068
  });
1057
1069
  var postApiV1AdminPersonas = (options) => (options.client ?? client).post({
@@ -1059,7 +1071,7 @@ var postApiV1AdminPersonas = (options) => (options.client ?? client).post({
1059
1071
  ...options,
1060
1072
  headers: {
1061
1073
  "Content-Type": "application/json",
1062
- ...options.headers
1074
+ ...normalizeHeaders(options.headers)
1063
1075
  }
1064
1076
  });
1065
1077
  var deleteApiV1AdminPersonasById = (options) => (options.client ?? client).delete({ url: "/api/v1/admin/personas/{id}", ...options });
@@ -1068,7 +1080,7 @@ var putApiV1AdminPersonasById = (options) => (options.client ?? client).put({
1068
1080
  ...options,
1069
1081
  headers: {
1070
1082
  "Content-Type": "application/json",
1071
- ...options.headers
1083
+ ...normalizeHeaders(options.headers)
1072
1084
  }
1073
1085
  });
1074
1086
  var postApiV1AdminSeedApps = (options) => (options.client ?? client).post({
@@ -1076,7 +1088,7 @@ var postApiV1AdminSeedApps = (options) => (options.client ?? client).post({
1076
1088
  ...options,
1077
1089
  headers: {
1078
1090
  "Content-Type": "application/json",
1079
- ...options.headers
1091
+ ...normalizeHeaders(options.headers)
1080
1092
  }
1081
1093
  });
1082
1094
  var postApiV1AdminSubscriptionTier = (options) => (options.client ?? client).post({
@@ -1084,7 +1096,7 @@ var postApiV1AdminSubscriptionTier = (options) => (options.client ?? client).pos
1084
1096
  ...options,
1085
1097
  headers: {
1086
1098
  "Content-Type": "application/json",
1087
- ...options.headers
1099
+ ...normalizeHeaders(options.headers)
1088
1100
  }
1089
1101
  });
1090
1102
  var deleteApiV1AdminTextReset = (options) => (options.client ?? client).delete({ url: "/api/v1/admin/text/reset", ...options });
@@ -1097,7 +1109,7 @@ var putApiV1AgentsByIdPreference = (options) => (options.client ?? client).put({
1097
1109
  ...options,
1098
1110
  headers: {
1099
1111
  "Content-Type": "application/json",
1100
- ...options.headers
1112
+ ...normalizeHeaders(options.headers)
1101
1113
  }
1102
1114
  });
1103
1115
  var postApiV1ChatCompletions = (options) => (options.client ?? client).post({
@@ -1105,7 +1117,7 @@ var postApiV1ChatCompletions = (options) => (options.client ?? client).post({
1105
1117
  ...options,
1106
1118
  headers: {
1107
1119
  "Content-Type": "application/json",
1108
- ...options.headers
1120
+ ...normalizeHeaders(options.headers)
1109
1121
  }
1110
1122
  });
1111
1123
  var getApiV1Config = (options) => (options?.client ?? client).get({ url: "/api/v1/config", ...options });
@@ -1116,7 +1128,7 @@ var postApiV1CreditsPurchase = (options) => (options.client ?? client).post({
1116
1128
  ...options,
1117
1129
  headers: {
1118
1130
  "Content-Type": "application/json",
1119
- ...options.headers
1131
+ ...normalizeHeaders(options.headers)
1120
1132
  }
1121
1133
  });
1122
1134
  var postApiV1CreditsRedeemTokens = (options) => (options.client ?? client).post({
@@ -1124,7 +1136,7 @@ var postApiV1CreditsRedeemTokens = (options) => (options.client ?? client).post(
1124
1136
  ...options,
1125
1137
  headers: {
1126
1138
  "Content-Type": "application/json",
1127
- ...options.headers
1139
+ ...normalizeHeaders(options.headers)
1128
1140
  }
1129
1141
  });
1130
1142
  var getApiV1DeveloperApps = (options) => (options?.client ?? client).get({ url: "/api/v1/developer/apps", ...options });
@@ -1133,7 +1145,7 @@ var postApiV1DeveloperApps = (options) => (options.client ?? client).post({
1133
1145
  ...options,
1134
1146
  headers: {
1135
1147
  "Content-Type": "application/json",
1136
- ...options.headers
1148
+ ...normalizeHeaders(options.headers)
1137
1149
  }
1138
1150
  });
1139
1151
  var deleteApiV1DeveloperAppsByAppUuid = (options) => (options.client ?? client).delete({ url: "/api/v1/developer/apps/{app_uuid}", ...options });
@@ -1143,7 +1155,7 @@ var patchApiV1DeveloperAppsByAppUuid = (options) => (options.client ?? client).p
1143
1155
  ...options,
1144
1156
  headers: {
1145
1157
  "Content-Type": "application/json",
1146
- ...options.headers
1158
+ ...normalizeHeaders(options.headers)
1147
1159
  }
1148
1160
  });
1149
1161
  var getApiV1DeveloperAppsByAppUuidApiKeys = (options) => (options.client ?? client).get({ url: "/api/v1/developer/apps/{app_uuid}/api-keys", ...options });
@@ -1152,7 +1164,7 @@ var postApiV1DeveloperAppsByAppUuidApiKeys = (options) => (options.client ?? cli
1152
1164
  ...options,
1153
1165
  headers: {
1154
1166
  "Content-Type": "application/json",
1155
- ...options.headers
1167
+ ...normalizeHeaders(options.headers)
1156
1168
  }
1157
1169
  });
1158
1170
  var deleteApiV1DeveloperAppsByAppUuidApiKeysByKeyId = (options) => (options.client ?? client).delete({ url: "/api/v1/developer/apps/{app_uuid}/api-keys/{key_id}", ...options });
@@ -1161,7 +1173,7 @@ var postApiV1DeveloperAppsByAppUuidFund = (options) => (options.client ?? client
1161
1173
  ...options,
1162
1174
  headers: {
1163
1175
  "Content-Type": "application/json",
1164
- ...options.headers
1176
+ ...normalizeHeaders(options.headers)
1165
1177
  }
1166
1178
  });
1167
1179
  var deleteApiV1DeveloperAppsByAppUuidPrivy = (options) => (options.client ?? client).delete({ url: "/api/v1/developer/apps/{app_uuid}/privy", ...options });
@@ -1170,7 +1182,7 @@ var postApiV1DeveloperAppsByAppUuidPrivy = (options) => (options.client ?? clien
1170
1182
  ...options,
1171
1183
  headers: {
1172
1184
  "Content-Type": "application/json",
1173
- ...options.headers
1185
+ ...normalizeHeaders(options.headers)
1174
1186
  }
1175
1187
  });
1176
1188
  var getApiV1DeveloperAppsByAppUuidUsage = (options) => (options.client ?? client).get({ url: "/api/v1/developer/apps/{app_uuid}/usage", ...options });
@@ -1182,7 +1194,7 @@ var patchApiV1DeveloperAppsByAppUuidUsersByAddress = (options) => (options.clien
1182
1194
  ...options,
1183
1195
  headers: {
1184
1196
  "Content-Type": "application/json",
1185
- ...options.headers
1197
+ ...normalizeHeaders(options.headers)
1186
1198
  }
1187
1199
  });
1188
1200
  var postApiV1DeveloperAppsByAppUuidUsersByAddressTopUp = (options) => (options.client ?? client).post({
@@ -1190,7 +1202,7 @@ var postApiV1DeveloperAppsByAppUuidUsersByAddressTopUp = (options) => (options.c
1190
1202
  ...options,
1191
1203
  headers: {
1192
1204
  "Content-Type": "application/json",
1193
- ...options.headers
1205
+ ...normalizeHeaders(options.headers)
1194
1206
  }
1195
1207
  });
1196
1208
  var getApiV1DeveloperBilling = (options) => (options?.client ?? client).get({ url: "/api/v1/developer/billing", ...options });
@@ -1200,7 +1212,7 @@ var postApiV1Embeddings = (options) => (options.client ?? client).post({
1200
1212
  ...options,
1201
1213
  headers: {
1202
1214
  "Content-Type": "application/json",
1203
- ...options.headers
1215
+ ...normalizeHeaders(options.headers)
1204
1216
  }
1205
1217
  });
1206
1218
  var getApiV1Models = (options) => (options?.client ?? client).get({ url: "/api/v1/models", ...options });
@@ -1211,7 +1223,7 @@ var postApiV1PhoneCalls = (options) => (options.client ?? client).post({
1211
1223
  ...options,
1212
1224
  headers: {
1213
1225
  "Content-Type": "application/json",
1214
- ...options.headers
1226
+ ...normalizeHeaders(options.headers)
1215
1227
  }
1216
1228
  });
1217
1229
  var getApiV1PhoneCallsByCallId = (options) => (options.client ?? client).get({ url: "/api/v1/phone-calls/{call_id}", ...options });
@@ -1220,7 +1232,7 @@ var postApiV1Responses = (options) => (options.client ?? client).post({
1220
1232
  ...options,
1221
1233
  headers: {
1222
1234
  "Content-Type": "application/json",
1223
- ...options.headers
1235
+ ...normalizeHeaders(options.headers)
1224
1236
  }
1225
1237
  });
1226
1238
  var postApiV1SubscriptionsCancel = (options) => (options?.client ?? client).post({
@@ -1228,7 +1240,7 @@ var postApiV1SubscriptionsCancel = (options) => (options?.client ?? client).post
1228
1240
  ...options,
1229
1241
  headers: {
1230
1242
  "Content-Type": "application/json",
1231
- ...options?.headers
1243
+ ...normalizeHeaders(options?.headers)
1232
1244
  }
1233
1245
  });
1234
1246
  var postApiV1SubscriptionsCancelScheduledDowngrade = (options) => (options?.client ?? client).post({ url: "/api/v1/subscriptions/cancel-scheduled-downgrade", ...options });
@@ -1237,7 +1249,7 @@ var postApiV1SubscriptionsCreateCheckoutSession = (options) => (options.client ?
1237
1249
  ...options,
1238
1250
  headers: {
1239
1251
  "Content-Type": "application/json",
1240
- ...options.headers
1252
+ ...normalizeHeaders(options.headers)
1241
1253
  }
1242
1254
  });
1243
1255
  var postApiV1SubscriptionsCustomerPortal = (options) => (options.client ?? client).post({
@@ -1245,7 +1257,7 @@ var postApiV1SubscriptionsCustomerPortal = (options) => (options.client ?? clien
1245
1257
  ...options,
1246
1258
  headers: {
1247
1259
  "Content-Type": "application/json",
1248
- ...options.headers
1260
+ ...normalizeHeaders(options.headers)
1249
1261
  }
1250
1262
  });
1251
1263
  var getApiV1SubscriptionsPlans = (options) => (options?.client ?? client).get({ url: "/api/v1/subscriptions/plans", ...options });
@@ -1255,7 +1267,7 @@ var postApiV1SubscriptionsScheduleDowngrade = (options) => (options.client ?? cl
1255
1267
  ...options,
1256
1268
  headers: {
1257
1269
  "Content-Type": "application/json",
1258
- ...options.headers
1270
+ ...normalizeHeaders(options.headers)
1259
1271
  }
1260
1272
  });
1261
1273
  var getApiV1SubscriptionsStatus = (options) => (options?.client ?? client).get({ url: "/api/v1/subscriptions/status", ...options });
@@ -1264,7 +1276,7 @@ var postApiV1SubscriptionsUpgrade = (options) => (options.client ?? client).post
1264
1276
  ...options,
1265
1277
  headers: {
1266
1278
  "Content-Type": "application/json",
1267
- ...options.headers
1279
+ ...normalizeHeaders(options.headers)
1268
1280
  }
1269
1281
  });
1270
1282
  var postApiV1SubscriptionsWebhook = (options) => (options.client ?? client).post({
@@ -1272,7 +1284,7 @@ var postApiV1SubscriptionsWebhook = (options) => (options.client ?? client).post
1272
1284
  ...options,
1273
1285
  headers: {
1274
1286
  "Content-Type": "application/json",
1275
- ...options.headers
1287
+ ...normalizeHeaders(options.headers)
1276
1288
  }
1277
1289
  });
1278
1290
  var getApiV1Tools = (options) => (options?.client ?? client).get({ url: "/api/v1/tools", ...options });
@@ -1284,7 +1296,7 @@ var postApiV1UserApiKeys = (options) => (options.client ?? client).post({
1284
1296
  ...options,
1285
1297
  headers: {
1286
1298
  "Content-Type": "application/json",
1287
- ...options.headers
1299
+ ...normalizeHeaders(options.headers)
1288
1300
  }
1289
1301
  });
1290
1302
  var deleteApiV1UserApiKeysByKeyId = (options) => (options.client ?? client).delete({ url: "/api/v1/user/api-keys/{key_id}", ...options });
@@ -1294,7 +1306,7 @@ var postApiV1WalletsBinding = (options) => (options.client ?? client).post({
1294
1306
  ...options,
1295
1307
  headers: {
1296
1308
  "Content-Type": "application/json",
1297
- ...options.headers
1309
+ ...normalizeHeaders(options.headers)
1298
1310
  }
1299
1311
  });
1300
1312
  var postApiV1WalletsBindingNonce = (options) => (options?.client ?? client).post({ url: "/api/v1/wallets/binding/nonce", ...options });
@@ -1304,7 +1316,7 @@ var postApiV1WebhooksRevenuecat = (options) => (options?.client ?? client).post(
1304
1316
  ...options,
1305
1317
  headers: {
1306
1318
  "Content-Type": "application/json",
1307
- ...options?.headers
1319
+ ...normalizeHeaders(options?.headers)
1308
1320
  }
1309
1321
  });
1310
1322
  var getApiV1ZetaCreditRate = (options) => (options?.client ?? client).get({ url: "/api/v1/zeta/credit-rate", ...options });