@ehrenkind/shopify-lib 0.8.0 → 0.8.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 +251 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +25 -3
- package/dist/index.d.ts +25 -3
- package/dist/index.mjs +250 -0
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
package/dist/index.mjs
CHANGED
|
@@ -705,6 +705,173 @@ async function cancelOrderById(orderId, retries = 0) {
|
|
|
705
705
|
return true;
|
|
706
706
|
}
|
|
707
707
|
|
|
708
|
+
// src/generated-api-types/admin.types.ts
|
|
709
|
+
var CurrencyCode = /* @__PURE__ */ ((CurrencyCode2) => {
|
|
710
|
+
CurrencyCode2["Aed"] = "AED";
|
|
711
|
+
CurrencyCode2["Afn"] = "AFN";
|
|
712
|
+
CurrencyCode2["All"] = "ALL";
|
|
713
|
+
CurrencyCode2["Amd"] = "AMD";
|
|
714
|
+
CurrencyCode2["Ang"] = "ANG";
|
|
715
|
+
CurrencyCode2["Aoa"] = "AOA";
|
|
716
|
+
CurrencyCode2["Ars"] = "ARS";
|
|
717
|
+
CurrencyCode2["Aud"] = "AUD";
|
|
718
|
+
CurrencyCode2["Awg"] = "AWG";
|
|
719
|
+
CurrencyCode2["Azn"] = "AZN";
|
|
720
|
+
CurrencyCode2["Bam"] = "BAM";
|
|
721
|
+
CurrencyCode2["Bbd"] = "BBD";
|
|
722
|
+
CurrencyCode2["Bdt"] = "BDT";
|
|
723
|
+
CurrencyCode2["Bgn"] = "BGN";
|
|
724
|
+
CurrencyCode2["Bhd"] = "BHD";
|
|
725
|
+
CurrencyCode2["Bif"] = "BIF";
|
|
726
|
+
CurrencyCode2["Bmd"] = "BMD";
|
|
727
|
+
CurrencyCode2["Bnd"] = "BND";
|
|
728
|
+
CurrencyCode2["Bob"] = "BOB";
|
|
729
|
+
CurrencyCode2["Brl"] = "BRL";
|
|
730
|
+
CurrencyCode2["Bsd"] = "BSD";
|
|
731
|
+
CurrencyCode2["Btn"] = "BTN";
|
|
732
|
+
CurrencyCode2["Bwp"] = "BWP";
|
|
733
|
+
CurrencyCode2["Byn"] = "BYN";
|
|
734
|
+
CurrencyCode2["Byr"] = "BYR";
|
|
735
|
+
CurrencyCode2["Bzd"] = "BZD";
|
|
736
|
+
CurrencyCode2["Cad"] = "CAD";
|
|
737
|
+
CurrencyCode2["Cdf"] = "CDF";
|
|
738
|
+
CurrencyCode2["Chf"] = "CHF";
|
|
739
|
+
CurrencyCode2["Clp"] = "CLP";
|
|
740
|
+
CurrencyCode2["Cny"] = "CNY";
|
|
741
|
+
CurrencyCode2["Cop"] = "COP";
|
|
742
|
+
CurrencyCode2["Crc"] = "CRC";
|
|
743
|
+
CurrencyCode2["Cve"] = "CVE";
|
|
744
|
+
CurrencyCode2["Czk"] = "CZK";
|
|
745
|
+
CurrencyCode2["Djf"] = "DJF";
|
|
746
|
+
CurrencyCode2["Dkk"] = "DKK";
|
|
747
|
+
CurrencyCode2["Dop"] = "DOP";
|
|
748
|
+
CurrencyCode2["Dzd"] = "DZD";
|
|
749
|
+
CurrencyCode2["Egp"] = "EGP";
|
|
750
|
+
CurrencyCode2["Ern"] = "ERN";
|
|
751
|
+
CurrencyCode2["Etb"] = "ETB";
|
|
752
|
+
CurrencyCode2["Eur"] = "EUR";
|
|
753
|
+
CurrencyCode2["Fjd"] = "FJD";
|
|
754
|
+
CurrencyCode2["Fkp"] = "FKP";
|
|
755
|
+
CurrencyCode2["Gbp"] = "GBP";
|
|
756
|
+
CurrencyCode2["Gel"] = "GEL";
|
|
757
|
+
CurrencyCode2["Ghs"] = "GHS";
|
|
758
|
+
CurrencyCode2["Gip"] = "GIP";
|
|
759
|
+
CurrencyCode2["Gmd"] = "GMD";
|
|
760
|
+
CurrencyCode2["Gnf"] = "GNF";
|
|
761
|
+
CurrencyCode2["Gtq"] = "GTQ";
|
|
762
|
+
CurrencyCode2["Gyd"] = "GYD";
|
|
763
|
+
CurrencyCode2["Hkd"] = "HKD";
|
|
764
|
+
CurrencyCode2["Hnl"] = "HNL";
|
|
765
|
+
CurrencyCode2["Hrk"] = "HRK";
|
|
766
|
+
CurrencyCode2["Htg"] = "HTG";
|
|
767
|
+
CurrencyCode2["Huf"] = "HUF";
|
|
768
|
+
CurrencyCode2["Idr"] = "IDR";
|
|
769
|
+
CurrencyCode2["Ils"] = "ILS";
|
|
770
|
+
CurrencyCode2["Inr"] = "INR";
|
|
771
|
+
CurrencyCode2["Iqd"] = "IQD";
|
|
772
|
+
CurrencyCode2["Irr"] = "IRR";
|
|
773
|
+
CurrencyCode2["Isk"] = "ISK";
|
|
774
|
+
CurrencyCode2["Jep"] = "JEP";
|
|
775
|
+
CurrencyCode2["Jmd"] = "JMD";
|
|
776
|
+
CurrencyCode2["Jod"] = "JOD";
|
|
777
|
+
CurrencyCode2["Jpy"] = "JPY";
|
|
778
|
+
CurrencyCode2["Kes"] = "KES";
|
|
779
|
+
CurrencyCode2["Kgs"] = "KGS";
|
|
780
|
+
CurrencyCode2["Khr"] = "KHR";
|
|
781
|
+
CurrencyCode2["Kid"] = "KID";
|
|
782
|
+
CurrencyCode2["Kmf"] = "KMF";
|
|
783
|
+
CurrencyCode2["Krw"] = "KRW";
|
|
784
|
+
CurrencyCode2["Kwd"] = "KWD";
|
|
785
|
+
CurrencyCode2["Kyd"] = "KYD";
|
|
786
|
+
CurrencyCode2["Kzt"] = "KZT";
|
|
787
|
+
CurrencyCode2["Lak"] = "LAK";
|
|
788
|
+
CurrencyCode2["Lbp"] = "LBP";
|
|
789
|
+
CurrencyCode2["Lkr"] = "LKR";
|
|
790
|
+
CurrencyCode2["Lrd"] = "LRD";
|
|
791
|
+
CurrencyCode2["Lsl"] = "LSL";
|
|
792
|
+
CurrencyCode2["Ltl"] = "LTL";
|
|
793
|
+
CurrencyCode2["Lvl"] = "LVL";
|
|
794
|
+
CurrencyCode2["Lyd"] = "LYD";
|
|
795
|
+
CurrencyCode2["Mad"] = "MAD";
|
|
796
|
+
CurrencyCode2["Mdl"] = "MDL";
|
|
797
|
+
CurrencyCode2["Mga"] = "MGA";
|
|
798
|
+
CurrencyCode2["Mkd"] = "MKD";
|
|
799
|
+
CurrencyCode2["Mmk"] = "MMK";
|
|
800
|
+
CurrencyCode2["Mnt"] = "MNT";
|
|
801
|
+
CurrencyCode2["Mop"] = "MOP";
|
|
802
|
+
CurrencyCode2["Mru"] = "MRU";
|
|
803
|
+
CurrencyCode2["Mur"] = "MUR";
|
|
804
|
+
CurrencyCode2["Mvr"] = "MVR";
|
|
805
|
+
CurrencyCode2["Mwk"] = "MWK";
|
|
806
|
+
CurrencyCode2["Mxn"] = "MXN";
|
|
807
|
+
CurrencyCode2["Myr"] = "MYR";
|
|
808
|
+
CurrencyCode2["Mzn"] = "MZN";
|
|
809
|
+
CurrencyCode2["Nad"] = "NAD";
|
|
810
|
+
CurrencyCode2["Ngn"] = "NGN";
|
|
811
|
+
CurrencyCode2["Nio"] = "NIO";
|
|
812
|
+
CurrencyCode2["Nok"] = "NOK";
|
|
813
|
+
CurrencyCode2["Npr"] = "NPR";
|
|
814
|
+
CurrencyCode2["Nzd"] = "NZD";
|
|
815
|
+
CurrencyCode2["Omr"] = "OMR";
|
|
816
|
+
CurrencyCode2["Pab"] = "PAB";
|
|
817
|
+
CurrencyCode2["Pen"] = "PEN";
|
|
818
|
+
CurrencyCode2["Pgk"] = "PGK";
|
|
819
|
+
CurrencyCode2["Php"] = "PHP";
|
|
820
|
+
CurrencyCode2["Pkr"] = "PKR";
|
|
821
|
+
CurrencyCode2["Pln"] = "PLN";
|
|
822
|
+
CurrencyCode2["Pyg"] = "PYG";
|
|
823
|
+
CurrencyCode2["Qar"] = "QAR";
|
|
824
|
+
CurrencyCode2["Ron"] = "RON";
|
|
825
|
+
CurrencyCode2["Rsd"] = "RSD";
|
|
826
|
+
CurrencyCode2["Rub"] = "RUB";
|
|
827
|
+
CurrencyCode2["Rwf"] = "RWF";
|
|
828
|
+
CurrencyCode2["Sar"] = "SAR";
|
|
829
|
+
CurrencyCode2["Sbd"] = "SBD";
|
|
830
|
+
CurrencyCode2["Scr"] = "SCR";
|
|
831
|
+
CurrencyCode2["Sdg"] = "SDG";
|
|
832
|
+
CurrencyCode2["Sek"] = "SEK";
|
|
833
|
+
CurrencyCode2["Sgd"] = "SGD";
|
|
834
|
+
CurrencyCode2["Shp"] = "SHP";
|
|
835
|
+
CurrencyCode2["Sll"] = "SLL";
|
|
836
|
+
CurrencyCode2["Sos"] = "SOS";
|
|
837
|
+
CurrencyCode2["Srd"] = "SRD";
|
|
838
|
+
CurrencyCode2["Ssp"] = "SSP";
|
|
839
|
+
CurrencyCode2["Std"] = "STD";
|
|
840
|
+
CurrencyCode2["Stn"] = "STN";
|
|
841
|
+
CurrencyCode2["Syp"] = "SYP";
|
|
842
|
+
CurrencyCode2["Szl"] = "SZL";
|
|
843
|
+
CurrencyCode2["Thb"] = "THB";
|
|
844
|
+
CurrencyCode2["Tjs"] = "TJS";
|
|
845
|
+
CurrencyCode2["Tmt"] = "TMT";
|
|
846
|
+
CurrencyCode2["Tnd"] = "TND";
|
|
847
|
+
CurrencyCode2["Top"] = "TOP";
|
|
848
|
+
CurrencyCode2["Try"] = "TRY";
|
|
849
|
+
CurrencyCode2["Ttd"] = "TTD";
|
|
850
|
+
CurrencyCode2["Twd"] = "TWD";
|
|
851
|
+
CurrencyCode2["Tzs"] = "TZS";
|
|
852
|
+
CurrencyCode2["Uah"] = "UAH";
|
|
853
|
+
CurrencyCode2["Ugx"] = "UGX";
|
|
854
|
+
CurrencyCode2["Usd"] = "USD";
|
|
855
|
+
CurrencyCode2["Usdc"] = "USDC";
|
|
856
|
+
CurrencyCode2["Uyu"] = "UYU";
|
|
857
|
+
CurrencyCode2["Uzs"] = "UZS";
|
|
858
|
+
CurrencyCode2["Ved"] = "VED";
|
|
859
|
+
CurrencyCode2["Vef"] = "VEF";
|
|
860
|
+
CurrencyCode2["Ves"] = "VES";
|
|
861
|
+
CurrencyCode2["Vnd"] = "VND";
|
|
862
|
+
CurrencyCode2["Vuv"] = "VUV";
|
|
863
|
+
CurrencyCode2["Wst"] = "WST";
|
|
864
|
+
CurrencyCode2["Xaf"] = "XAF";
|
|
865
|
+
CurrencyCode2["Xcd"] = "XCD";
|
|
866
|
+
CurrencyCode2["Xof"] = "XOF";
|
|
867
|
+
CurrencyCode2["Xpf"] = "XPF";
|
|
868
|
+
CurrencyCode2["Xxx"] = "XXX";
|
|
869
|
+
CurrencyCode2["Yer"] = "YER";
|
|
870
|
+
CurrencyCode2["Zar"] = "ZAR";
|
|
871
|
+
CurrencyCode2["Zmw"] = "ZMW";
|
|
872
|
+
return CurrencyCode2;
|
|
873
|
+
})(CurrencyCode || {});
|
|
874
|
+
|
|
708
875
|
// src/mutations/refunds/createRefund.ts
|
|
709
876
|
var mutation6 = gql`#graphql
|
|
710
877
|
mutation createRefund($input: RefundInput!) {
|
|
@@ -955,36 +1122,60 @@ var querySuggestedRefund = gql`#graphql
|
|
|
955
1122
|
amount
|
|
956
1123
|
currencyCode
|
|
957
1124
|
}
|
|
1125
|
+
presentmentMoney {
|
|
1126
|
+
amount
|
|
1127
|
+
currencyCode
|
|
1128
|
+
}
|
|
958
1129
|
}
|
|
959
1130
|
maximumRefundableSet {
|
|
960
1131
|
shopMoney {
|
|
961
1132
|
amount
|
|
962
1133
|
currencyCode
|
|
963
1134
|
}
|
|
1135
|
+
presentmentMoney {
|
|
1136
|
+
amount
|
|
1137
|
+
currencyCode
|
|
1138
|
+
}
|
|
964
1139
|
}
|
|
965
1140
|
subtotalSet {
|
|
966
1141
|
shopMoney {
|
|
967
1142
|
amount
|
|
968
1143
|
currencyCode
|
|
969
1144
|
}
|
|
1145
|
+
presentmentMoney {
|
|
1146
|
+
amount
|
|
1147
|
+
currencyCode
|
|
1148
|
+
}
|
|
970
1149
|
}
|
|
971
1150
|
totalTaxSet {
|
|
972
1151
|
shopMoney {
|
|
973
1152
|
amount
|
|
974
1153
|
currencyCode
|
|
975
1154
|
}
|
|
1155
|
+
presentmentMoney {
|
|
1156
|
+
amount
|
|
1157
|
+
currencyCode
|
|
1158
|
+
}
|
|
976
1159
|
}
|
|
977
1160
|
discountedSubtotalSet {
|
|
978
1161
|
shopMoney {
|
|
979
1162
|
amount
|
|
980
1163
|
currencyCode
|
|
981
1164
|
}
|
|
1165
|
+
presentmentMoney {
|
|
1166
|
+
amount
|
|
1167
|
+
currencyCode
|
|
1168
|
+
}
|
|
982
1169
|
}
|
|
983
1170
|
totalCartDiscountAmountSet {
|
|
984
1171
|
shopMoney {
|
|
985
1172
|
amount
|
|
986
1173
|
currencyCode
|
|
987
1174
|
}
|
|
1175
|
+
presentmentMoney {
|
|
1176
|
+
amount
|
|
1177
|
+
currencyCode
|
|
1178
|
+
}
|
|
988
1179
|
}
|
|
989
1180
|
shipping {
|
|
990
1181
|
amountSet {
|
|
@@ -992,18 +1183,30 @@ var querySuggestedRefund = gql`#graphql
|
|
|
992
1183
|
amount
|
|
993
1184
|
currencyCode
|
|
994
1185
|
}
|
|
1186
|
+
presentmentMoney {
|
|
1187
|
+
amount
|
|
1188
|
+
currencyCode
|
|
1189
|
+
}
|
|
995
1190
|
}
|
|
996
1191
|
maximumRefundableSet {
|
|
997
1192
|
shopMoney {
|
|
998
1193
|
amount
|
|
999
1194
|
currencyCode
|
|
1000
1195
|
}
|
|
1196
|
+
presentmentMoney {
|
|
1197
|
+
amount
|
|
1198
|
+
currencyCode
|
|
1199
|
+
}
|
|
1001
1200
|
}
|
|
1002
1201
|
taxSet {
|
|
1003
1202
|
shopMoney {
|
|
1004
1203
|
amount
|
|
1005
1204
|
currencyCode
|
|
1006
1205
|
}
|
|
1206
|
+
presentmentMoney {
|
|
1207
|
+
amount
|
|
1208
|
+
currencyCode
|
|
1209
|
+
}
|
|
1007
1210
|
}
|
|
1008
1211
|
}
|
|
1009
1212
|
refundLineItems {
|
|
@@ -1017,12 +1220,20 @@ var querySuggestedRefund = gql`#graphql
|
|
|
1017
1220
|
amount
|
|
1018
1221
|
currencyCode
|
|
1019
1222
|
}
|
|
1223
|
+
presentmentMoney {
|
|
1224
|
+
amount
|
|
1225
|
+
currencyCode
|
|
1226
|
+
}
|
|
1020
1227
|
}
|
|
1021
1228
|
totalDiscountSet {
|
|
1022
1229
|
shopMoney {
|
|
1023
1230
|
amount
|
|
1024
1231
|
currencyCode
|
|
1025
1232
|
}
|
|
1233
|
+
presentmentMoney {
|
|
1234
|
+
amount
|
|
1235
|
+
currencyCode
|
|
1236
|
+
}
|
|
1026
1237
|
}
|
|
1027
1238
|
}
|
|
1028
1239
|
quantity
|
|
@@ -1031,18 +1242,30 @@ var querySuggestedRefund = gql`#graphql
|
|
|
1031
1242
|
amount
|
|
1032
1243
|
currencyCode
|
|
1033
1244
|
}
|
|
1245
|
+
presentmentMoney {
|
|
1246
|
+
amount
|
|
1247
|
+
currencyCode
|
|
1248
|
+
}
|
|
1034
1249
|
}
|
|
1035
1250
|
subtotalSet {
|
|
1036
1251
|
shopMoney {
|
|
1037
1252
|
amount
|
|
1038
1253
|
currencyCode
|
|
1039
1254
|
}
|
|
1255
|
+
presentmentMoney {
|
|
1256
|
+
amount
|
|
1257
|
+
currencyCode
|
|
1258
|
+
}
|
|
1040
1259
|
}
|
|
1041
1260
|
totalTaxSet {
|
|
1042
1261
|
shopMoney {
|
|
1043
1262
|
amount
|
|
1044
1263
|
currencyCode
|
|
1045
1264
|
}
|
|
1265
|
+
presentmentMoney {
|
|
1266
|
+
amount
|
|
1267
|
+
currencyCode
|
|
1268
|
+
}
|
|
1046
1269
|
}
|
|
1047
1270
|
restockType
|
|
1048
1271
|
}
|
|
@@ -1054,12 +1277,20 @@ var querySuggestedRefund = gql`#graphql
|
|
|
1054
1277
|
amount
|
|
1055
1278
|
currencyCode
|
|
1056
1279
|
}
|
|
1280
|
+
presentmentMoney {
|
|
1281
|
+
amount
|
|
1282
|
+
currencyCode
|
|
1283
|
+
}
|
|
1057
1284
|
}
|
|
1058
1285
|
maximumRefundableSet {
|
|
1059
1286
|
shopMoney {
|
|
1060
1287
|
amount
|
|
1061
1288
|
currencyCode
|
|
1062
1289
|
}
|
|
1290
|
+
presentmentMoney {
|
|
1291
|
+
amount
|
|
1292
|
+
currencyCode
|
|
1293
|
+
}
|
|
1063
1294
|
}
|
|
1064
1295
|
parentTransaction {
|
|
1065
1296
|
id
|
|
@@ -1538,6 +1769,20 @@ var queryOrderByIdFull = gql`#graphql
|
|
|
1538
1769
|
amount
|
|
1539
1770
|
currencyCode
|
|
1540
1771
|
}
|
|
1772
|
+
presentmentMoney {
|
|
1773
|
+
amount
|
|
1774
|
+
currencyCode
|
|
1775
|
+
}
|
|
1776
|
+
}
|
|
1777
|
+
currentTotalPriceSet {
|
|
1778
|
+
shopMoney {
|
|
1779
|
+
amount
|
|
1780
|
+
currencyCode
|
|
1781
|
+
}
|
|
1782
|
+
presentmentMoney {
|
|
1783
|
+
amount
|
|
1784
|
+
currencyCode
|
|
1785
|
+
}
|
|
1541
1786
|
}
|
|
1542
1787
|
customer {
|
|
1543
1788
|
id
|
|
@@ -1592,6 +1837,10 @@ var queryOrderByIdFull = gql`#graphql
|
|
|
1592
1837
|
amount
|
|
1593
1838
|
currencyCode
|
|
1594
1839
|
}
|
|
1840
|
+
presentmentMoney {
|
|
1841
|
+
amount
|
|
1842
|
+
currencyCode
|
|
1843
|
+
}
|
|
1595
1844
|
}
|
|
1596
1845
|
}
|
|
1597
1846
|
vendor
|
|
@@ -2950,6 +3199,7 @@ async function getMetaobjectByHandle(handle, retries = 3) {
|
|
|
2950
3199
|
return response.metaobjectByHandle;
|
|
2951
3200
|
}
|
|
2952
3201
|
export {
|
|
3202
|
+
CurrencyCode,
|
|
2953
3203
|
ShopifyUserError,
|
|
2954
3204
|
bulkUpdateProductVariants,
|
|
2955
3205
|
calculateRefund,
|