@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.
- package/dist/client/index.cjs +106 -94
- package/dist/client/index.mjs +106 -94
- package/dist/expo/index.cjs +15 -3
- package/dist/expo/index.mjs +15 -3
- package/dist/index.cjs +47 -35
- package/dist/index.mjs +47 -35
- package/dist/react/index.cjs +29 -8
- package/dist/react/index.mjs +29 -8
- package/dist/server/index.cjs +23 -2
- package/dist/server/index.mjs +23 -2
- package/dist/tools/selection/index.cjs +14 -2
- package/dist/tools/selection/index.mjs +14 -2
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -511,7 +511,7 @@ var mergeHeaders = (...headers) => {
|
|
|
511
511
|
if (!header || typeof header !== "object") {
|
|
512
512
|
continue;
|
|
513
513
|
}
|
|
514
|
-
const iterator = header instanceof Headers ? headersEntries(header) : Object.entries(header);
|
|
514
|
+
const iterator = Array.isArray(header) || header instanceof Headers ? headersEntries(new Headers(header)) : Object.entries(header);
|
|
515
515
|
for (const [key, value] of iterator) {
|
|
516
516
|
if (value === null) {
|
|
517
517
|
mergedHeaders.delete(key);
|
|
@@ -786,6 +786,18 @@ var createClient = (config = {}) => {
|
|
|
786
786
|
// src/client/client.gen.ts
|
|
787
787
|
var client = createClient(createClientConfig(createConfig()));
|
|
788
788
|
|
|
789
|
+
// src/clientHeaders.ts
|
|
790
|
+
function normalizeHeaders(headers) {
|
|
791
|
+
if (headers instanceof Headers || Array.isArray(headers)) {
|
|
792
|
+
const normalized = /* @__PURE__ */ Object.create(null);
|
|
793
|
+
new Headers(headers).forEach((value, name) => {
|
|
794
|
+
normalized[name] = value;
|
|
795
|
+
});
|
|
796
|
+
return normalized;
|
|
797
|
+
}
|
|
798
|
+
return headers;
|
|
799
|
+
}
|
|
800
|
+
|
|
789
801
|
// src/client/sdk.gen.ts
|
|
790
802
|
var deleteApiV1Account = (options) => (options?.client ?? client).delete({ url: "/api/v1/account", ...options });
|
|
791
803
|
var postApiV1AdminAddCredits = (options) => (options.client ?? client).post({
|
|
@@ -793,7 +805,7 @@ var postApiV1AdminAddCredits = (options) => (options.client ?? client).post({
|
|
|
793
805
|
...options,
|
|
794
806
|
headers: {
|
|
795
807
|
"Content-Type": "application/json",
|
|
796
|
-
...options.headers
|
|
808
|
+
...normalizeHeaders(options.headers)
|
|
797
809
|
}
|
|
798
810
|
});
|
|
799
811
|
var postApiV1AdminAgents = (options) => (options.client ?? client).post({
|
|
@@ -801,7 +813,7 @@ var postApiV1AdminAgents = (options) => (options.client ?? client).post({
|
|
|
801
813
|
...options,
|
|
802
814
|
headers: {
|
|
803
815
|
"Content-Type": "application/json",
|
|
804
|
-
...options.headers
|
|
816
|
+
...normalizeHeaders(options.headers)
|
|
805
817
|
}
|
|
806
818
|
});
|
|
807
819
|
var deleteApiV1AdminAgentsById = (options) => (options.client ?? client).delete({ url: "/api/v1/admin/agents/{id}", ...options });
|
|
@@ -810,7 +822,7 @@ var putApiV1AdminAgentsById = (options) => (options.client ?? client).put({
|
|
|
810
822
|
...options,
|
|
811
823
|
headers: {
|
|
812
824
|
"Content-Type": "application/json",
|
|
813
|
-
...options.headers
|
|
825
|
+
...normalizeHeaders(options.headers)
|
|
814
826
|
}
|
|
815
827
|
});
|
|
816
828
|
var getApiV1AdminApps = (options) => (options.client ?? client).get({ url: "/api/v1/admin/apps", ...options });
|
|
@@ -819,7 +831,7 @@ var postApiV1AdminApps = (options) => (options.client ?? client).post({
|
|
|
819
831
|
...options,
|
|
820
832
|
headers: {
|
|
821
833
|
"Content-Type": "application/json",
|
|
822
|
-
...options.headers
|
|
834
|
+
...normalizeHeaders(options.headers)
|
|
823
835
|
}
|
|
824
836
|
});
|
|
825
837
|
var getApiV1AdminAppsByAppIdApiKeys = (options) => (options.client ?? client).get({ url: "/api/v1/admin/apps/{app_id}/api-keys", ...options });
|
|
@@ -828,7 +840,7 @@ var postApiV1AdminAppsByAppIdApiKeys = (options) => (options.client ?? client).p
|
|
|
828
840
|
...options,
|
|
829
841
|
headers: {
|
|
830
842
|
"Content-Type": "application/json",
|
|
831
|
-
...options.headers
|
|
843
|
+
...normalizeHeaders(options.headers)
|
|
832
844
|
}
|
|
833
845
|
});
|
|
834
846
|
var deleteApiV1AdminAppsByAppIdApiKeysById = (options) => (options.client ?? client).delete({ url: "/api/v1/admin/apps/{app_id}/api-keys/{id}", ...options });
|
|
@@ -838,7 +850,7 @@ var putApiV1AdminAppsByAppIdApiKeysById = (options) => (options.client ?? client
|
|
|
838
850
|
...options,
|
|
839
851
|
headers: {
|
|
840
852
|
"Content-Type": "application/json",
|
|
841
|
-
...options.headers
|
|
853
|
+
...normalizeHeaders(options.headers)
|
|
842
854
|
}
|
|
843
855
|
});
|
|
844
856
|
var deleteApiV1AdminAppsById = (options) => (options.client ?? client).delete({ url: "/api/v1/admin/apps/{id}", ...options });
|
|
@@ -848,7 +860,7 @@ var putApiV1AdminAppsById = (options) => (options.client ?? client).put({
|
|
|
848
860
|
...options,
|
|
849
861
|
headers: {
|
|
850
862
|
"Content-Type": "application/json",
|
|
851
|
-
...options.headers
|
|
863
|
+
...normalizeHeaders(options.headers)
|
|
852
864
|
}
|
|
853
865
|
});
|
|
854
866
|
var postApiV1AdminPersonas = (options) => (options.client ?? client).post({
|
|
@@ -856,7 +868,7 @@ var postApiV1AdminPersonas = (options) => (options.client ?? client).post({
|
|
|
856
868
|
...options,
|
|
857
869
|
headers: {
|
|
858
870
|
"Content-Type": "application/json",
|
|
859
|
-
...options.headers
|
|
871
|
+
...normalizeHeaders(options.headers)
|
|
860
872
|
}
|
|
861
873
|
});
|
|
862
874
|
var deleteApiV1AdminPersonasById = (options) => (options.client ?? client).delete({ url: "/api/v1/admin/personas/{id}", ...options });
|
|
@@ -865,7 +877,7 @@ var putApiV1AdminPersonasById = (options) => (options.client ?? client).put({
|
|
|
865
877
|
...options,
|
|
866
878
|
headers: {
|
|
867
879
|
"Content-Type": "application/json",
|
|
868
|
-
...options.headers
|
|
880
|
+
...normalizeHeaders(options.headers)
|
|
869
881
|
}
|
|
870
882
|
});
|
|
871
883
|
var postApiV1AdminSeedApps = (options) => (options.client ?? client).post({
|
|
@@ -873,7 +885,7 @@ var postApiV1AdminSeedApps = (options) => (options.client ?? client).post({
|
|
|
873
885
|
...options,
|
|
874
886
|
headers: {
|
|
875
887
|
"Content-Type": "application/json",
|
|
876
|
-
...options.headers
|
|
888
|
+
...normalizeHeaders(options.headers)
|
|
877
889
|
}
|
|
878
890
|
});
|
|
879
891
|
var postApiV1AdminSubscriptionTier = (options) => (options.client ?? client).post({
|
|
@@ -881,7 +893,7 @@ var postApiV1AdminSubscriptionTier = (options) => (options.client ?? client).pos
|
|
|
881
893
|
...options,
|
|
882
894
|
headers: {
|
|
883
895
|
"Content-Type": "application/json",
|
|
884
|
-
...options.headers
|
|
896
|
+
...normalizeHeaders(options.headers)
|
|
885
897
|
}
|
|
886
898
|
});
|
|
887
899
|
var deleteApiV1AdminTextReset = (options) => (options.client ?? client).delete({ url: "/api/v1/admin/text/reset", ...options });
|
|
@@ -894,7 +906,7 @@ var putApiV1AgentsByIdPreference = (options) => (options.client ?? client).put({
|
|
|
894
906
|
...options,
|
|
895
907
|
headers: {
|
|
896
908
|
"Content-Type": "application/json",
|
|
897
|
-
...options.headers
|
|
909
|
+
...normalizeHeaders(options.headers)
|
|
898
910
|
}
|
|
899
911
|
});
|
|
900
912
|
var postApiV1ChatCompletions = (options) => (options.client ?? client).post({
|
|
@@ -902,7 +914,7 @@ var postApiV1ChatCompletions = (options) => (options.client ?? client).post({
|
|
|
902
914
|
...options,
|
|
903
915
|
headers: {
|
|
904
916
|
"Content-Type": "application/json",
|
|
905
|
-
...options.headers
|
|
917
|
+
...normalizeHeaders(options.headers)
|
|
906
918
|
}
|
|
907
919
|
});
|
|
908
920
|
var getApiV1Config = (options) => (options?.client ?? client).get({ url: "/api/v1/config", ...options });
|
|
@@ -913,7 +925,7 @@ var postApiV1CreditsPurchase = (options) => (options.client ?? client).post({
|
|
|
913
925
|
...options,
|
|
914
926
|
headers: {
|
|
915
927
|
"Content-Type": "application/json",
|
|
916
|
-
...options.headers
|
|
928
|
+
...normalizeHeaders(options.headers)
|
|
917
929
|
}
|
|
918
930
|
});
|
|
919
931
|
var postApiV1CreditsRedeemTokens = (options) => (options.client ?? client).post({
|
|
@@ -921,7 +933,7 @@ var postApiV1CreditsRedeemTokens = (options) => (options.client ?? client).post(
|
|
|
921
933
|
...options,
|
|
922
934
|
headers: {
|
|
923
935
|
"Content-Type": "application/json",
|
|
924
|
-
...options.headers
|
|
936
|
+
...normalizeHeaders(options.headers)
|
|
925
937
|
}
|
|
926
938
|
});
|
|
927
939
|
var getApiV1DeveloperApps = (options) => (options?.client ?? client).get({ url: "/api/v1/developer/apps", ...options });
|
|
@@ -930,7 +942,7 @@ var postApiV1DeveloperApps = (options) => (options.client ?? client).post({
|
|
|
930
942
|
...options,
|
|
931
943
|
headers: {
|
|
932
944
|
"Content-Type": "application/json",
|
|
933
|
-
...options.headers
|
|
945
|
+
...normalizeHeaders(options.headers)
|
|
934
946
|
}
|
|
935
947
|
});
|
|
936
948
|
var deleteApiV1DeveloperAppsByAppUuid = (options) => (options.client ?? client).delete({ url: "/api/v1/developer/apps/{app_uuid}", ...options });
|
|
@@ -940,7 +952,7 @@ var patchApiV1DeveloperAppsByAppUuid = (options) => (options.client ?? client).p
|
|
|
940
952
|
...options,
|
|
941
953
|
headers: {
|
|
942
954
|
"Content-Type": "application/json",
|
|
943
|
-
...options.headers
|
|
955
|
+
...normalizeHeaders(options.headers)
|
|
944
956
|
}
|
|
945
957
|
});
|
|
946
958
|
var getApiV1DeveloperAppsByAppUuidApiKeys = (options) => (options.client ?? client).get({ url: "/api/v1/developer/apps/{app_uuid}/api-keys", ...options });
|
|
@@ -949,7 +961,7 @@ var postApiV1DeveloperAppsByAppUuidApiKeys = (options) => (options.client ?? cli
|
|
|
949
961
|
...options,
|
|
950
962
|
headers: {
|
|
951
963
|
"Content-Type": "application/json",
|
|
952
|
-
...options.headers
|
|
964
|
+
...normalizeHeaders(options.headers)
|
|
953
965
|
}
|
|
954
966
|
});
|
|
955
967
|
var deleteApiV1DeveloperAppsByAppUuidApiKeysByKeyId = (options) => (options.client ?? client).delete({ url: "/api/v1/developer/apps/{app_uuid}/api-keys/{key_id}", ...options });
|
|
@@ -958,7 +970,7 @@ var postApiV1DeveloperAppsByAppUuidFund = (options) => (options.client ?? client
|
|
|
958
970
|
...options,
|
|
959
971
|
headers: {
|
|
960
972
|
"Content-Type": "application/json",
|
|
961
|
-
...options.headers
|
|
973
|
+
...normalizeHeaders(options.headers)
|
|
962
974
|
}
|
|
963
975
|
});
|
|
964
976
|
var deleteApiV1DeveloperAppsByAppUuidPrivy = (options) => (options.client ?? client).delete({ url: "/api/v1/developer/apps/{app_uuid}/privy", ...options });
|
|
@@ -967,7 +979,7 @@ var postApiV1DeveloperAppsByAppUuidPrivy = (options) => (options.client ?? clien
|
|
|
967
979
|
...options,
|
|
968
980
|
headers: {
|
|
969
981
|
"Content-Type": "application/json",
|
|
970
|
-
...options.headers
|
|
982
|
+
...normalizeHeaders(options.headers)
|
|
971
983
|
}
|
|
972
984
|
});
|
|
973
985
|
var getApiV1DeveloperAppsByAppUuidUsage = (options) => (options.client ?? client).get({ url: "/api/v1/developer/apps/{app_uuid}/usage", ...options });
|
|
@@ -979,7 +991,7 @@ var patchApiV1DeveloperAppsByAppUuidUsersByAddress = (options) => (options.clien
|
|
|
979
991
|
...options,
|
|
980
992
|
headers: {
|
|
981
993
|
"Content-Type": "application/json",
|
|
982
|
-
...options.headers
|
|
994
|
+
...normalizeHeaders(options.headers)
|
|
983
995
|
}
|
|
984
996
|
});
|
|
985
997
|
var postApiV1DeveloperAppsByAppUuidUsersByAddressTopUp = (options) => (options.client ?? client).post({
|
|
@@ -987,7 +999,7 @@ var postApiV1DeveloperAppsByAppUuidUsersByAddressTopUp = (options) => (options.c
|
|
|
987
999
|
...options,
|
|
988
1000
|
headers: {
|
|
989
1001
|
"Content-Type": "application/json",
|
|
990
|
-
...options.headers
|
|
1002
|
+
...normalizeHeaders(options.headers)
|
|
991
1003
|
}
|
|
992
1004
|
});
|
|
993
1005
|
var getApiV1DeveloperBilling = (options) => (options?.client ?? client).get({ url: "/api/v1/developer/billing", ...options });
|
|
@@ -997,7 +1009,7 @@ var postApiV1Embeddings = (options) => (options.client ?? client).post({
|
|
|
997
1009
|
...options,
|
|
998
1010
|
headers: {
|
|
999
1011
|
"Content-Type": "application/json",
|
|
1000
|
-
...options.headers
|
|
1012
|
+
...normalizeHeaders(options.headers)
|
|
1001
1013
|
}
|
|
1002
1014
|
});
|
|
1003
1015
|
var getApiV1Models = (options) => (options?.client ?? client).get({ url: "/api/v1/models", ...options });
|
|
@@ -1008,7 +1020,7 @@ var postApiV1PhoneCalls = (options) => (options.client ?? client).post({
|
|
|
1008
1020
|
...options,
|
|
1009
1021
|
headers: {
|
|
1010
1022
|
"Content-Type": "application/json",
|
|
1011
|
-
...options.headers
|
|
1023
|
+
...normalizeHeaders(options.headers)
|
|
1012
1024
|
}
|
|
1013
1025
|
});
|
|
1014
1026
|
var getApiV1PhoneCallsByCallId = (options) => (options.client ?? client).get({ url: "/api/v1/phone-calls/{call_id}", ...options });
|
|
@@ -1017,7 +1029,7 @@ var postApiV1Responses = (options) => (options.client ?? client).post({
|
|
|
1017
1029
|
...options,
|
|
1018
1030
|
headers: {
|
|
1019
1031
|
"Content-Type": "application/json",
|
|
1020
|
-
...options.headers
|
|
1032
|
+
...normalizeHeaders(options.headers)
|
|
1021
1033
|
}
|
|
1022
1034
|
});
|
|
1023
1035
|
var postApiV1SubscriptionsCancel = (options) => (options?.client ?? client).post({
|
|
@@ -1025,7 +1037,7 @@ var postApiV1SubscriptionsCancel = (options) => (options?.client ?? client).post
|
|
|
1025
1037
|
...options,
|
|
1026
1038
|
headers: {
|
|
1027
1039
|
"Content-Type": "application/json",
|
|
1028
|
-
...options?.headers
|
|
1040
|
+
...normalizeHeaders(options?.headers)
|
|
1029
1041
|
}
|
|
1030
1042
|
});
|
|
1031
1043
|
var postApiV1SubscriptionsCancelScheduledDowngrade = (options) => (options?.client ?? client).post({ url: "/api/v1/subscriptions/cancel-scheduled-downgrade", ...options });
|
|
@@ -1034,7 +1046,7 @@ var postApiV1SubscriptionsCreateCheckoutSession = (options) => (options.client ?
|
|
|
1034
1046
|
...options,
|
|
1035
1047
|
headers: {
|
|
1036
1048
|
"Content-Type": "application/json",
|
|
1037
|
-
...options.headers
|
|
1049
|
+
...normalizeHeaders(options.headers)
|
|
1038
1050
|
}
|
|
1039
1051
|
});
|
|
1040
1052
|
var postApiV1SubscriptionsCustomerPortal = (options) => (options.client ?? client).post({
|
|
@@ -1042,7 +1054,7 @@ var postApiV1SubscriptionsCustomerPortal = (options) => (options.client ?? clien
|
|
|
1042
1054
|
...options,
|
|
1043
1055
|
headers: {
|
|
1044
1056
|
"Content-Type": "application/json",
|
|
1045
|
-
...options.headers
|
|
1057
|
+
...normalizeHeaders(options.headers)
|
|
1046
1058
|
}
|
|
1047
1059
|
});
|
|
1048
1060
|
var getApiV1SubscriptionsPlans = (options) => (options?.client ?? client).get({ url: "/api/v1/subscriptions/plans", ...options });
|
|
@@ -1052,7 +1064,7 @@ var postApiV1SubscriptionsScheduleDowngrade = (options) => (options.client ?? cl
|
|
|
1052
1064
|
...options,
|
|
1053
1065
|
headers: {
|
|
1054
1066
|
"Content-Type": "application/json",
|
|
1055
|
-
...options.headers
|
|
1067
|
+
...normalizeHeaders(options.headers)
|
|
1056
1068
|
}
|
|
1057
1069
|
});
|
|
1058
1070
|
var getApiV1SubscriptionsStatus = (options) => (options?.client ?? client).get({ url: "/api/v1/subscriptions/status", ...options });
|
|
@@ -1061,7 +1073,7 @@ var postApiV1SubscriptionsUpgrade = (options) => (options.client ?? client).post
|
|
|
1061
1073
|
...options,
|
|
1062
1074
|
headers: {
|
|
1063
1075
|
"Content-Type": "application/json",
|
|
1064
|
-
...options.headers
|
|
1076
|
+
...normalizeHeaders(options.headers)
|
|
1065
1077
|
}
|
|
1066
1078
|
});
|
|
1067
1079
|
var postApiV1SubscriptionsWebhook = (options) => (options.client ?? client).post({
|
|
@@ -1069,7 +1081,7 @@ var postApiV1SubscriptionsWebhook = (options) => (options.client ?? client).post
|
|
|
1069
1081
|
...options,
|
|
1070
1082
|
headers: {
|
|
1071
1083
|
"Content-Type": "application/json",
|
|
1072
|
-
...options.headers
|
|
1084
|
+
...normalizeHeaders(options.headers)
|
|
1073
1085
|
}
|
|
1074
1086
|
});
|
|
1075
1087
|
var getApiV1Tools = (options) => (options?.client ?? client).get({ url: "/api/v1/tools", ...options });
|
|
@@ -1081,7 +1093,7 @@ var postApiV1UserApiKeys = (options) => (options.client ?? client).post({
|
|
|
1081
1093
|
...options,
|
|
1082
1094
|
headers: {
|
|
1083
1095
|
"Content-Type": "application/json",
|
|
1084
|
-
...options.headers
|
|
1096
|
+
...normalizeHeaders(options.headers)
|
|
1085
1097
|
}
|
|
1086
1098
|
});
|
|
1087
1099
|
var deleteApiV1UserApiKeysByKeyId = (options) => (options.client ?? client).delete({ url: "/api/v1/user/api-keys/{key_id}", ...options });
|
|
@@ -1091,7 +1103,7 @@ var postApiV1WalletsBinding = (options) => (options.client ?? client).post({
|
|
|
1091
1103
|
...options,
|
|
1092
1104
|
headers: {
|
|
1093
1105
|
"Content-Type": "application/json",
|
|
1094
|
-
...options.headers
|
|
1106
|
+
...normalizeHeaders(options.headers)
|
|
1095
1107
|
}
|
|
1096
1108
|
});
|
|
1097
1109
|
var postApiV1WalletsBindingNonce = (options) => (options?.client ?? client).post({ url: "/api/v1/wallets/binding/nonce", ...options });
|
|
@@ -1101,7 +1113,7 @@ var postApiV1WebhooksRevenuecat = (options) => (options?.client ?? client).post(
|
|
|
1101
1113
|
...options,
|
|
1102
1114
|
headers: {
|
|
1103
1115
|
"Content-Type": "application/json",
|
|
1104
|
-
...options?.headers
|
|
1116
|
+
...normalizeHeaders(options?.headers)
|
|
1105
1117
|
}
|
|
1106
1118
|
});
|
|
1107
1119
|
var getApiV1ZetaCreditRate = (options) => (options?.client ?? client).get({ url: "/api/v1/zeta/credit-rate", ...options });
|
package/dist/react/index.cjs
CHANGED
|
@@ -3575,7 +3575,14 @@ function cosineSimilarity(a, b) {
|
|
|
3575
3575
|
|
|
3576
3576
|
// src/lib/processors/encoding.ts
|
|
3577
3577
|
var B64_ENCODE_CHUNK = 32768 * 3;
|
|
3578
|
+
function assertFileUrlAllowed(dataUrl) {
|
|
3579
|
+
const isNode = typeof process !== "undefined" && Boolean(process.versions?.node);
|
|
3580
|
+
if (isNode && !dataUrl.startsWith("data:") && !dataUrl.startsWith("blob:")) {
|
|
3581
|
+
throw new Error("Server file preprocessing requires a data URL or blob URL.");
|
|
3582
|
+
}
|
|
3583
|
+
}
|
|
3578
3584
|
async function dataUrlToArrayBuffer(dataUrl) {
|
|
3585
|
+
assertFileUrlAllowed(dataUrl);
|
|
3579
3586
|
if (dataUrl.startsWith("blob:") || dataUrl.startsWith("http://") || dataUrl.startsWith("https://")) {
|
|
3580
3587
|
const response = await fetch(dataUrl);
|
|
3581
3588
|
return response.arrayBuffer();
|
|
@@ -6237,7 +6244,7 @@ var mergeHeaders = (...headers) => {
|
|
|
6237
6244
|
if (!header || typeof header !== "object") {
|
|
6238
6245
|
continue;
|
|
6239
6246
|
}
|
|
6240
|
-
const iterator = header instanceof Headers ? headersEntries(header) : Object.entries(header);
|
|
6247
|
+
const iterator = Array.isArray(header) || header instanceof Headers ? headersEntries(new Headers(header)) : Object.entries(header);
|
|
6241
6248
|
for (const [key, value] of iterator) {
|
|
6242
6249
|
if (value === null) {
|
|
6243
6250
|
mergedHeaders.delete(key);
|
|
@@ -6513,6 +6520,18 @@ var createClient = (config = {}) => {
|
|
|
6513
6520
|
init_clientConfig();
|
|
6514
6521
|
var client = createClient(createClientConfig(createConfig()));
|
|
6515
6522
|
|
|
6523
|
+
// src/clientHeaders.ts
|
|
6524
|
+
function normalizeHeaders(headers) {
|
|
6525
|
+
if (headers instanceof Headers || Array.isArray(headers)) {
|
|
6526
|
+
const normalized = /* @__PURE__ */ Object.create(null);
|
|
6527
|
+
new Headers(headers).forEach((value, name) => {
|
|
6528
|
+
normalized[name] = value;
|
|
6529
|
+
});
|
|
6530
|
+
return normalized;
|
|
6531
|
+
}
|
|
6532
|
+
return headers;
|
|
6533
|
+
}
|
|
6534
|
+
|
|
6516
6535
|
// src/client/sdk.gen.ts
|
|
6517
6536
|
var getApiV1Config = (options) => (options?.client ?? client).get({ url: "/api/v1/config", ...options });
|
|
6518
6537
|
var getApiV1CreditsBalance = (options) => (options?.client ?? client).get({ url: "/api/v1/credits/balance", ...options });
|
|
@@ -6522,7 +6541,7 @@ var postApiV1CreditsPurchase = (options) => (options.client ?? client).post({
|
|
|
6522
6541
|
...options,
|
|
6523
6542
|
headers: {
|
|
6524
6543
|
"Content-Type": "application/json",
|
|
6525
|
-
...options.headers
|
|
6544
|
+
...normalizeHeaders(options.headers)
|
|
6526
6545
|
}
|
|
6527
6546
|
});
|
|
6528
6547
|
var postApiV1Embeddings = (options) => (options.client ?? client).post({
|
|
@@ -6530,7 +6549,7 @@ var postApiV1Embeddings = (options) => (options.client ?? client).post({
|
|
|
6530
6549
|
...options,
|
|
6531
6550
|
headers: {
|
|
6532
6551
|
"Content-Type": "application/json",
|
|
6533
|
-
...options.headers
|
|
6552
|
+
...normalizeHeaders(options.headers)
|
|
6534
6553
|
}
|
|
6535
6554
|
});
|
|
6536
6555
|
var getApiV1Models = (options) => (options?.client ?? client).get({ url: "/api/v1/models", ...options });
|
|
@@ -6539,7 +6558,7 @@ var postApiV1PhoneCalls = (options) => (options.client ?? client).post({
|
|
|
6539
6558
|
...options,
|
|
6540
6559
|
headers: {
|
|
6541
6560
|
"Content-Type": "application/json",
|
|
6542
|
-
...options.headers
|
|
6561
|
+
...normalizeHeaders(options.headers)
|
|
6543
6562
|
}
|
|
6544
6563
|
});
|
|
6545
6564
|
var getApiV1PhoneCallsByCallId = (options) => (options.client ?? client).get({ url: "/api/v1/phone-calls/{call_id}", ...options });
|
|
@@ -6548,7 +6567,7 @@ var postApiV1SubscriptionsCancel = (options) => (options?.client ?? client).post
|
|
|
6548
6567
|
...options,
|
|
6549
6568
|
headers: {
|
|
6550
6569
|
"Content-Type": "application/json",
|
|
6551
|
-
...options?.headers
|
|
6570
|
+
...normalizeHeaders(options?.headers)
|
|
6552
6571
|
}
|
|
6553
6572
|
});
|
|
6554
6573
|
var postApiV1SubscriptionsCreateCheckoutSession = (options) => (options.client ?? client).post({
|
|
@@ -6556,7 +6575,7 @@ var postApiV1SubscriptionsCreateCheckoutSession = (options) => (options.client ?
|
|
|
6556
6575
|
...options,
|
|
6557
6576
|
headers: {
|
|
6558
6577
|
"Content-Type": "application/json",
|
|
6559
|
-
...options.headers
|
|
6578
|
+
...normalizeHeaders(options.headers)
|
|
6560
6579
|
}
|
|
6561
6580
|
});
|
|
6562
6581
|
var postApiV1SubscriptionsCustomerPortal = (options) => (options.client ?? client).post({
|
|
@@ -6564,7 +6583,7 @@ var postApiV1SubscriptionsCustomerPortal = (options) => (options.client ?? clien
|
|
|
6564
6583
|
...options,
|
|
6565
6584
|
headers: {
|
|
6566
6585
|
"Content-Type": "application/json",
|
|
6567
|
-
...options.headers
|
|
6586
|
+
...normalizeHeaders(options.headers)
|
|
6568
6587
|
}
|
|
6569
6588
|
});
|
|
6570
6589
|
var postApiV1SubscriptionsRenew = (options) => (options?.client ?? client).post({ url: "/api/v1/subscriptions/renew", ...options });
|
|
@@ -6575,7 +6594,7 @@ var postApiV1WalletsBinding = (options) => (options.client ?? client).post({
|
|
|
6575
6594
|
...options,
|
|
6576
6595
|
headers: {
|
|
6577
6596
|
"Content-Type": "application/json",
|
|
6578
|
-
...options.headers
|
|
6597
|
+
...normalizeHeaders(options.headers)
|
|
6579
6598
|
}
|
|
6580
6599
|
});
|
|
6581
6600
|
var postApiV1WalletsBindingNonce = (options) => (options?.client ?? client).post({ url: "/api/v1/wallets/binding/nonce", ...options });
|
|
@@ -29619,6 +29638,7 @@ async function getPdfjs() {
|
|
|
29619
29638
|
return pdfjsModule;
|
|
29620
29639
|
}
|
|
29621
29640
|
async function withPdfDocument(pdfDataUrl, fn) {
|
|
29641
|
+
assertFileUrlAllowed(pdfDataUrl);
|
|
29622
29642
|
const pdfjs = await getPdfjs();
|
|
29623
29643
|
const loadingTask = pdfjs.getDocument(pdfDataUrl);
|
|
29624
29644
|
let pdf;
|
|
@@ -30421,6 +30441,7 @@ async function preprocessFiles(files, options = {}) {
|
|
|
30421
30441
|
skip("no_data");
|
|
30422
30442
|
continue;
|
|
30423
30443
|
}
|
|
30444
|
+
assertFileUrlAllowed(file.url);
|
|
30424
30445
|
const fileWithData = {
|
|
30425
30446
|
...file,
|
|
30426
30447
|
dataUrl: file.url
|
package/dist/react/index.mjs
CHANGED
|
@@ -1748,7 +1748,14 @@ function cosineSimilarity(a, b) {
|
|
|
1748
1748
|
|
|
1749
1749
|
// src/lib/processors/encoding.ts
|
|
1750
1750
|
var B64_ENCODE_CHUNK = 32768 * 3;
|
|
1751
|
+
function assertFileUrlAllowed(dataUrl) {
|
|
1752
|
+
const isNode = typeof process !== "undefined" && Boolean(process.versions?.node);
|
|
1753
|
+
if (isNode && !dataUrl.startsWith("data:") && !dataUrl.startsWith("blob:")) {
|
|
1754
|
+
throw new Error("Server file preprocessing requires a data URL or blob URL.");
|
|
1755
|
+
}
|
|
1756
|
+
}
|
|
1751
1757
|
async function dataUrlToArrayBuffer(dataUrl) {
|
|
1758
|
+
assertFileUrlAllowed(dataUrl);
|
|
1752
1759
|
if (dataUrl.startsWith("blob:") || dataUrl.startsWith("http://") || dataUrl.startsWith("https://")) {
|
|
1753
1760
|
const response = await fetch(dataUrl);
|
|
1754
1761
|
return response.arrayBuffer();
|
|
@@ -4404,7 +4411,7 @@ var mergeHeaders = (...headers) => {
|
|
|
4404
4411
|
if (!header || typeof header !== "object") {
|
|
4405
4412
|
continue;
|
|
4406
4413
|
}
|
|
4407
|
-
const iterator = header instanceof Headers ? headersEntries(header) : Object.entries(header);
|
|
4414
|
+
const iterator = Array.isArray(header) || header instanceof Headers ? headersEntries(new Headers(header)) : Object.entries(header);
|
|
4408
4415
|
for (const [key, value] of iterator) {
|
|
4409
4416
|
if (value === null) {
|
|
4410
4417
|
mergedHeaders.delete(key);
|
|
@@ -4679,6 +4686,18 @@ var createClient = (config = {}) => {
|
|
|
4679
4686
|
// src/client/client.gen.ts
|
|
4680
4687
|
var client = createClient(createClientConfig(createConfig()));
|
|
4681
4688
|
|
|
4689
|
+
// src/clientHeaders.ts
|
|
4690
|
+
function normalizeHeaders(headers) {
|
|
4691
|
+
if (headers instanceof Headers || Array.isArray(headers)) {
|
|
4692
|
+
const normalized = /* @__PURE__ */ Object.create(null);
|
|
4693
|
+
new Headers(headers).forEach((value, name) => {
|
|
4694
|
+
normalized[name] = value;
|
|
4695
|
+
});
|
|
4696
|
+
return normalized;
|
|
4697
|
+
}
|
|
4698
|
+
return headers;
|
|
4699
|
+
}
|
|
4700
|
+
|
|
4682
4701
|
// src/client/sdk.gen.ts
|
|
4683
4702
|
var getApiV1Config = (options) => (options?.client ?? client).get({ url: "/api/v1/config", ...options });
|
|
4684
4703
|
var getApiV1CreditsBalance = (options) => (options?.client ?? client).get({ url: "/api/v1/credits/balance", ...options });
|
|
@@ -4688,7 +4707,7 @@ var postApiV1CreditsPurchase = (options) => (options.client ?? client).post({
|
|
|
4688
4707
|
...options,
|
|
4689
4708
|
headers: {
|
|
4690
4709
|
"Content-Type": "application/json",
|
|
4691
|
-
...options.headers
|
|
4710
|
+
...normalizeHeaders(options.headers)
|
|
4692
4711
|
}
|
|
4693
4712
|
});
|
|
4694
4713
|
var postApiV1Embeddings = (options) => (options.client ?? client).post({
|
|
@@ -4696,7 +4715,7 @@ var postApiV1Embeddings = (options) => (options.client ?? client).post({
|
|
|
4696
4715
|
...options,
|
|
4697
4716
|
headers: {
|
|
4698
4717
|
"Content-Type": "application/json",
|
|
4699
|
-
...options.headers
|
|
4718
|
+
...normalizeHeaders(options.headers)
|
|
4700
4719
|
}
|
|
4701
4720
|
});
|
|
4702
4721
|
var getApiV1Models = (options) => (options?.client ?? client).get({ url: "/api/v1/models", ...options });
|
|
@@ -4705,7 +4724,7 @@ var postApiV1PhoneCalls = (options) => (options.client ?? client).post({
|
|
|
4705
4724
|
...options,
|
|
4706
4725
|
headers: {
|
|
4707
4726
|
"Content-Type": "application/json",
|
|
4708
|
-
...options.headers
|
|
4727
|
+
...normalizeHeaders(options.headers)
|
|
4709
4728
|
}
|
|
4710
4729
|
});
|
|
4711
4730
|
var getApiV1PhoneCallsByCallId = (options) => (options.client ?? client).get({ url: "/api/v1/phone-calls/{call_id}", ...options });
|
|
@@ -4714,7 +4733,7 @@ var postApiV1SubscriptionsCancel = (options) => (options?.client ?? client).post
|
|
|
4714
4733
|
...options,
|
|
4715
4734
|
headers: {
|
|
4716
4735
|
"Content-Type": "application/json",
|
|
4717
|
-
...options?.headers
|
|
4736
|
+
...normalizeHeaders(options?.headers)
|
|
4718
4737
|
}
|
|
4719
4738
|
});
|
|
4720
4739
|
var postApiV1SubscriptionsCreateCheckoutSession = (options) => (options.client ?? client).post({
|
|
@@ -4722,7 +4741,7 @@ var postApiV1SubscriptionsCreateCheckoutSession = (options) => (options.client ?
|
|
|
4722
4741
|
...options,
|
|
4723
4742
|
headers: {
|
|
4724
4743
|
"Content-Type": "application/json",
|
|
4725
|
-
...options.headers
|
|
4744
|
+
...normalizeHeaders(options.headers)
|
|
4726
4745
|
}
|
|
4727
4746
|
});
|
|
4728
4747
|
var postApiV1SubscriptionsCustomerPortal = (options) => (options.client ?? client).post({
|
|
@@ -4730,7 +4749,7 @@ var postApiV1SubscriptionsCustomerPortal = (options) => (options.client ?? clien
|
|
|
4730
4749
|
...options,
|
|
4731
4750
|
headers: {
|
|
4732
4751
|
"Content-Type": "application/json",
|
|
4733
|
-
...options.headers
|
|
4752
|
+
...normalizeHeaders(options.headers)
|
|
4734
4753
|
}
|
|
4735
4754
|
});
|
|
4736
4755
|
var postApiV1SubscriptionsRenew = (options) => (options?.client ?? client).post({ url: "/api/v1/subscriptions/renew", ...options });
|
|
@@ -4741,7 +4760,7 @@ var postApiV1WalletsBinding = (options) => (options.client ?? client).post({
|
|
|
4741
4760
|
...options,
|
|
4742
4761
|
headers: {
|
|
4743
4762
|
"Content-Type": "application/json",
|
|
4744
|
-
...options.headers
|
|
4763
|
+
...normalizeHeaders(options.headers)
|
|
4745
4764
|
}
|
|
4746
4765
|
});
|
|
4747
4766
|
var postApiV1WalletsBindingNonce = (options) => (options?.client ?? client).post({ url: "/api/v1/wallets/binding/nonce", ...options });
|
|
@@ -27701,6 +27720,7 @@ async function getPdfjs() {
|
|
|
27701
27720
|
return pdfjsModule;
|
|
27702
27721
|
}
|
|
27703
27722
|
async function withPdfDocument(pdfDataUrl, fn) {
|
|
27723
|
+
assertFileUrlAllowed(pdfDataUrl);
|
|
27704
27724
|
const pdfjs = await getPdfjs();
|
|
27705
27725
|
const loadingTask = pdfjs.getDocument(pdfDataUrl);
|
|
27706
27726
|
let pdf;
|
|
@@ -28497,6 +28517,7 @@ async function preprocessFiles(files, options = {}) {
|
|
|
28497
28517
|
skip("no_data");
|
|
28498
28518
|
continue;
|
|
28499
28519
|
}
|
|
28520
|
+
assertFileUrlAllowed(file.url);
|
|
28500
28521
|
const fileWithData = {
|
|
28501
28522
|
...file,
|
|
28502
28523
|
dataUrl: file.url
|
package/dist/server/index.cjs
CHANGED
|
@@ -17686,7 +17686,14 @@ function cosineSimilarity(a, b) {
|
|
|
17686
17686
|
|
|
17687
17687
|
// src/lib/processors/encoding.ts
|
|
17688
17688
|
var B64_ENCODE_CHUNK = 32768 * 3;
|
|
17689
|
+
function assertFileUrlAllowed(dataUrl) {
|
|
17690
|
+
const isNode = typeof process !== "undefined" && Boolean(process.versions?.node);
|
|
17691
|
+
if (isNode && !dataUrl.startsWith("data:") && !dataUrl.startsWith("blob:")) {
|
|
17692
|
+
throw new Error("Server file preprocessing requires a data URL or blob URL.");
|
|
17693
|
+
}
|
|
17694
|
+
}
|
|
17689
17695
|
async function dataUrlToArrayBuffer(dataUrl) {
|
|
17696
|
+
assertFileUrlAllowed(dataUrl);
|
|
17690
17697
|
if (dataUrl.startsWith("blob:") || dataUrl.startsWith("http://") || dataUrl.startsWith("https://")) {
|
|
17691
17698
|
const response = await fetch(dataUrl);
|
|
17692
17699
|
return response.arrayBuffer();
|
|
@@ -20016,7 +20023,7 @@ var mergeHeaders = (...headers) => {
|
|
|
20016
20023
|
if (!header || typeof header !== "object") {
|
|
20017
20024
|
continue;
|
|
20018
20025
|
}
|
|
20019
|
-
const iterator = header instanceof Headers ? headersEntries(header) : Object.entries(header);
|
|
20026
|
+
const iterator = Array.isArray(header) || header instanceof Headers ? headersEntries(new Headers(header)) : Object.entries(header);
|
|
20020
20027
|
for (const [key, value] of iterator) {
|
|
20021
20028
|
if (value === null) {
|
|
20022
20029
|
mergedHeaders.delete(key);
|
|
@@ -20292,13 +20299,25 @@ var createClient = (config = {}) => {
|
|
|
20292
20299
|
init_clientConfig();
|
|
20293
20300
|
var client = createClient(createClientConfig(createConfig()));
|
|
20294
20301
|
|
|
20302
|
+
// src/clientHeaders.ts
|
|
20303
|
+
function normalizeHeaders(headers) {
|
|
20304
|
+
if (headers instanceof Headers || Array.isArray(headers)) {
|
|
20305
|
+
const normalized = /* @__PURE__ */ Object.create(null);
|
|
20306
|
+
new Headers(headers).forEach((value, name) => {
|
|
20307
|
+
normalized[name] = value;
|
|
20308
|
+
});
|
|
20309
|
+
return normalized;
|
|
20310
|
+
}
|
|
20311
|
+
return headers;
|
|
20312
|
+
}
|
|
20313
|
+
|
|
20295
20314
|
// src/client/sdk.gen.ts
|
|
20296
20315
|
var postApiV1Embeddings = (options) => (options.client ?? client).post({
|
|
20297
20316
|
url: "/api/v1/embeddings",
|
|
20298
20317
|
...options,
|
|
20299
20318
|
headers: {
|
|
20300
20319
|
"Content-Type": "application/json",
|
|
20301
|
-
...options.headers
|
|
20320
|
+
...normalizeHeaders(options.headers)
|
|
20302
20321
|
}
|
|
20303
20322
|
});
|
|
20304
20323
|
|
|
@@ -39071,6 +39090,7 @@ async function getPdfjs() {
|
|
|
39071
39090
|
return pdfjsModule;
|
|
39072
39091
|
}
|
|
39073
39092
|
async function withPdfDocument(pdfDataUrl, fn) {
|
|
39093
|
+
assertFileUrlAllowed(pdfDataUrl);
|
|
39074
39094
|
const pdfjs = await getPdfjs();
|
|
39075
39095
|
const loadingTask = pdfjs.getDocument(pdfDataUrl);
|
|
39076
39096
|
let pdf;
|
|
@@ -39865,6 +39885,7 @@ async function preprocessFiles(files, options = {}) {
|
|
|
39865
39885
|
skip("no_data");
|
|
39866
39886
|
continue;
|
|
39867
39887
|
}
|
|
39888
|
+
assertFileUrlAllowed(file.url);
|
|
39868
39889
|
const fileWithData = {
|
|
39869
39890
|
...file,
|
|
39870
39891
|
dataUrl: file.url
|