@shushed/helpers 0.0.202-bug-erp-770-20251203154925 → 0.0.202-v2-20251208085030

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.
Files changed (236) hide show
  1. package/dist/cjs/dist-dereferenced/asset.js +4 -0
  2. package/dist/cjs/dist-dereferenced/category.js +4 -0
  3. package/dist/cjs/dist-dereferenced/country.js +4 -0
  4. package/dist/cjs/dist-dereferenced/currency.js +4 -0
  5. package/dist/cjs/dist-dereferenced/customer-segment.js +4 -0
  6. package/dist/cjs/dist-dereferenced/development-colour.js +4 -0
  7. package/dist/cjs/dist-dereferenced/index.js +69 -0
  8. package/dist/cjs/dist-dereferenced/marketing-preferences.js +4 -0
  9. package/dist/cjs/dist-dereferenced/messages/ean-change.js +4 -0
  10. package/dist/cjs/dist-dereferenced/messages/index.js +50 -0
  11. package/dist/cjs/dist-dereferenced/messages/order/delivered.js +4 -0
  12. package/dist/cjs/dist-dereferenced/messages/order/index.js +18 -0
  13. package/dist/cjs/dist-dereferenced/messages/order/new.js +4 -0
  14. package/dist/cjs/dist-dereferenced/messages/order/processed.js +4 -0
  15. package/dist/cjs/dist-dereferenced/messages/order/return-initiated.js +4 -0
  16. package/dist/cjs/dist-dereferenced/messages/order/returned.js +4 -0
  17. package/dist/cjs/dist-dereferenced/messages/order/shipped.js +4 -0
  18. package/dist/cjs/dist-dereferenced/messages/price-change.js +4 -0
  19. package/dist/cjs/dist-dereferenced/messages/product-category.js +4 -0
  20. package/dist/cjs/dist-dereferenced/messages/product-draft.js +4 -0
  21. package/dist/cjs/dist-dereferenced/messages/product.js +4 -0
  22. package/dist/cjs/dist-dereferenced/money.js +4 -0
  23. package/dist/cjs/dist-dereferenced/order/address.js +4 -0
  24. package/dist/cjs/dist-dereferenced/order/customer.js +4 -0
  25. package/dist/cjs/dist-dereferenced/order/index.js +51 -0
  26. package/dist/cjs/dist-dereferenced/order/item.js +4 -0
  27. package/dist/cjs/dist-dereferenced/order/orderMain.js +4 -0
  28. package/dist/cjs/dist-dereferenced/order/payment.js +4 -0
  29. package/dist/cjs/dist-dereferenced/order/shipment/index.js +45 -0
  30. package/dist/cjs/dist-dereferenced/order/shipment/item/index.js +11 -0
  31. package/dist/cjs/dist-dereferenced/order/shipment/item/itemMain.js +4 -0
  32. package/dist/cjs/dist-dereferenced/order/shipment/item/returned.js +4 -0
  33. package/dist/cjs/dist-dereferenced/order/shipment/pos/index.js +13 -0
  34. package/dist/cjs/dist-dereferenced/order/shipment/pos/outbound.js +4 -0
  35. package/dist/cjs/dist-dereferenced/order/shipment/pos/posMain.js +4 -0
  36. package/dist/cjs/dist-dereferenced/order/shipment/pos/return.js +4 -0
  37. package/dist/cjs/dist-dereferenced/order/shipment/shipmentMain.js +4 -0
  38. package/dist/cjs/dist-dereferenced/order/shipment/shipped/index.js +13 -0
  39. package/dist/cjs/dist-dereferenced/order/shipment/shipped/outbound.js +4 -0
  40. package/dist/cjs/dist-dereferenced/order/shipment/shipped/return.js +4 -0
  41. package/dist/cjs/dist-dereferenced/order/shipment/shipped/shippedMain.js +4 -0
  42. package/dist/cjs/dist-dereferenced/price.js +4 -0
  43. package/dist/cjs/dist-dereferenced/product-category.js +4 -0
  44. package/dist/cjs/dist-dereferenced/product-draft.js +4 -0
  45. package/dist/cjs/dist-dereferenced/product.js +4 -0
  46. package/dist/cjs/dist-dereferenced/stock.js +4 -0
  47. package/dist/cjs/dist-dereferenced/total.js +4 -0
  48. package/dist/cjs/dist-types/asset.js +2 -0
  49. package/dist/cjs/dist-types/category.js +2 -0
  50. package/dist/cjs/dist-types/country.js +2 -0
  51. package/dist/cjs/dist-types/currency.js +2 -0
  52. package/dist/cjs/dist-types/customer-segment.js +2 -0
  53. package/dist/cjs/dist-types/development-colour.js +2 -0
  54. package/dist/cjs/dist-types/index.js +38 -0
  55. package/dist/cjs/dist-types/marketing-preferences.js +2 -0
  56. package/dist/cjs/dist-types/messages/ean-change.js +2 -0
  57. package/dist/cjs/dist-types/messages/index.js +37 -0
  58. package/dist/cjs/dist-types/messages/order/delivered.js +2 -0
  59. package/dist/cjs/dist-types/messages/order/index.js +2 -0
  60. package/dist/cjs/dist-types/messages/order/new.js +2 -0
  61. package/dist/cjs/dist-types/messages/order/processed.js +2 -0
  62. package/dist/cjs/dist-types/messages/order/return-initiated.js +2 -0
  63. package/dist/cjs/dist-types/messages/order/returned.js +2 -0
  64. package/dist/cjs/dist-types/messages/order/shipped.js +2 -0
  65. package/dist/cjs/dist-types/messages/price-change.js +2 -0
  66. package/dist/cjs/dist-types/messages/product-category.js +2 -0
  67. package/dist/cjs/dist-types/messages/product-draft.js +2 -0
  68. package/dist/cjs/dist-types/messages/product.js +2 -0
  69. package/dist/cjs/dist-types/money.js +2 -0
  70. package/dist/cjs/dist-types/order/address.js +2 -0
  71. package/dist/cjs/dist-types/order/customer.js +2 -0
  72. package/dist/cjs/dist-types/order/index.js +37 -0
  73. package/dist/cjs/dist-types/order/item.js +2 -0
  74. package/dist/cjs/dist-types/order/orderMain.js +2 -0
  75. package/dist/cjs/dist-types/order/payment.js +2 -0
  76. package/dist/cjs/dist-types/order/shipment/index.js +39 -0
  77. package/dist/cjs/dist-types/order/shipment/item/index.js +2 -0
  78. package/dist/cjs/dist-types/order/shipment/item/itemMain.js +2 -0
  79. package/dist/cjs/dist-types/order/shipment/item/returned.js +2 -0
  80. package/dist/cjs/dist-types/order/shipment/pos/index.js +2 -0
  81. package/dist/cjs/dist-types/order/shipment/pos/outbound.js +2 -0
  82. package/dist/cjs/dist-types/order/shipment/pos/posMain.js +2 -0
  83. package/dist/cjs/dist-types/order/shipment/pos/return.js +2 -0
  84. package/dist/cjs/dist-types/order/shipment/shipmentMain.js +2 -0
  85. package/dist/cjs/dist-types/order/shipment/shipped/index.js +2 -0
  86. package/dist/cjs/dist-types/order/shipment/shipped/outbound.js +2 -0
  87. package/dist/cjs/dist-types/order/shipment/shipped/return.js +2 -0
  88. package/dist/cjs/dist-types/order/shipment/shipped/shippedMain.js +2 -0
  89. package/dist/cjs/dist-types/price.js +2 -0
  90. package/dist/cjs/dist-types/product-category.js +2 -0
  91. package/dist/cjs/dist-types/product-draft.js +2 -0
  92. package/dist/cjs/dist-types/product.js +2 -0
  93. package/dist/cjs/dist-types/stock.js +2 -0
  94. package/dist/cjs/dist-types/total.js +2 -0
  95. package/dist/cjs/index.js +39 -0
  96. package/dist/cjs/src-public/airtable.js +625 -0
  97. package/dist/cjs/src-public/bigquery.js +59 -0
  98. package/dist/cjs/src-public/centra.js +1053 -0
  99. package/dist/cjs/src-public/cloudtasks.js +207 -0
  100. package/dist/cjs/src-public/dato.js +680 -0
  101. package/dist/cjs/src-public/env.js +900 -0
  102. package/dist/cjs/src-public/getEventTime.js +28 -0
  103. package/dist/cjs/src-public/index.js +52 -0
  104. package/dist/cjs/src-public/ipValidation.js +167 -0
  105. package/dist/cjs/src-public/jwks.js +108 -0
  106. package/dist/cjs/src-public/pubsub.js +423 -0
  107. package/dist/cjs/src-public/rateLimit.js +140 -0
  108. package/dist/cjs/src-public/redisClient.js +44 -0
  109. package/dist/cjs/src-public/runtime.js +145 -0
  110. package/dist/cjs/src-public/sanitize.js +25 -0
  111. package/dist/cjs/src-public/scheduler.js +247 -0
  112. package/dist/cjs/src-public/secret.js +16 -0
  113. package/dist/cjs/src-public/setHeaders.js +16 -0
  114. package/dist/cjs/src-public/types.js +2 -0
  115. package/dist/cjs/src-public/utils.js +457 -0
  116. package/dist/cjs/src-public/validate.js +40 -0
  117. package/dist/package.json +6 -3
  118. package/dist/types/dist-dereferenced/asset.d.ts +51 -0
  119. package/dist/types/dist-dereferenced/category.d.ts +58 -0
  120. package/dist/types/dist-dereferenced/country.d.ts +8 -0
  121. package/dist/types/dist-dereferenced/currency.d.ts +8 -0
  122. package/dist/types/dist-dereferenced/customer-segment.d.ts +26 -0
  123. package/dist/types/dist-dereferenced/development-colour.d.ts +114 -0
  124. package/dist/types/dist-dereferenced/index.d.ts +16 -0
  125. package/dist/types/dist-dereferenced/marketing-preferences.d.ts +31 -0
  126. package/dist/types/dist-dereferenced/messages/ean-change.d.ts +17 -0
  127. package/dist/types/dist-dereferenced/messages/index.d.ts +6 -0
  128. package/dist/types/dist-dereferenced/messages/order/delivered.d.ts +3414 -0
  129. package/dist/types/dist-dereferenced/messages/order/index.d.ts +6 -0
  130. package/dist/types/dist-dereferenced/messages/order/new.d.ts +3414 -0
  131. package/dist/types/dist-dereferenced/messages/order/processed.d.ts +3408 -0
  132. package/dist/types/dist-dereferenced/messages/order/return-initiated.d.ts +3414 -0
  133. package/dist/types/dist-dereferenced/messages/order/returned.d.ts +3413 -0
  134. package/dist/types/dist-dereferenced/messages/order/shipped.d.ts +3412 -0
  135. package/dist/types/dist-dereferenced/messages/price-change.d.ts +67 -0
  136. package/dist/types/dist-dereferenced/messages/product-category.d.ts +33 -0
  137. package/dist/types/dist-dereferenced/messages/product-draft.d.ts +589 -0
  138. package/dist/types/dist-dereferenced/messages/product.d.ts +628 -0
  139. package/dist/types/dist-dereferenced/money.d.ts +41 -0
  140. package/dist/types/dist-dereferenced/order/address.d.ts +98 -0
  141. package/dist/types/dist-dereferenced/order/customer.d.ts +309 -0
  142. package/dist/types/dist-dereferenced/order/index.d.ts +3404 -0
  143. package/dist/types/dist-dereferenced/order/item.d.ts +336 -0
  144. package/dist/types/dist-dereferenced/order/orderMain.d.ts +3399 -0
  145. package/dist/types/dist-dereferenced/order/payment.d.ts +94 -0
  146. package/dist/types/dist-dereferenced/order/shipment/index.d.ts +253 -0
  147. package/dist/types/dist-dereferenced/order/shipment/item/index.d.ts +19 -0
  148. package/dist/types/dist-dereferenced/order/shipment/item/itemMain.d.ts +18 -0
  149. package/dist/types/dist-dereferenced/order/shipment/item/returned.d.ts +34 -0
  150. package/dist/types/dist-dereferenced/order/shipment/pos/index.d.ts +282 -0
  151. package/dist/types/dist-dereferenced/order/shipment/pos/outbound.d.ts +320 -0
  152. package/dist/types/dist-dereferenced/order/shipment/pos/posMain.d.ts +280 -0
  153. package/dist/types/dist-dereferenced/order/shipment/pos/return.d.ts +331 -0
  154. package/dist/types/dist-dereferenced/order/shipment/shipmentMain.d.ts +250 -0
  155. package/dist/types/dist-dereferenced/order/shipment/shipped/index.d.ts +288 -0
  156. package/dist/types/dist-dereferenced/order/shipment/shipped/outbound.d.ts +286 -0
  157. package/dist/types/dist-dereferenced/order/shipment/shipped/return.d.ts +287 -0
  158. package/dist/types/dist-dereferenced/order/shipment/shipped/shippedMain.d.ts +286 -0
  159. package/dist/types/dist-dereferenced/price.d.ts +58 -0
  160. package/dist/types/dist-dereferenced/product-category.d.ts +24 -0
  161. package/dist/types/dist-dereferenced/product-draft.d.ts +580 -0
  162. package/dist/types/dist-dereferenced/product.d.ts +619 -0
  163. package/dist/types/dist-dereferenced/stock.d.ts +74 -0
  164. package/dist/types/dist-dereferenced/total.d.ts +172 -0
  165. package/dist/types/dist-types/asset.d.ts +16 -0
  166. package/dist/types/dist-types/category.d.ts +20 -0
  167. package/dist/types/dist-types/country.d.ts +2 -0
  168. package/dist/types/dist-types/currency.d.ts +2 -0
  169. package/dist/types/dist-types/customer-segment.d.ts +6 -0
  170. package/dist/types/dist-types/development-colour.d.ts +31 -0
  171. package/dist/types/dist-types/index.d.ts +16 -0
  172. package/dist/types/dist-types/marketing-preferences.d.ts +9 -0
  173. package/dist/types/dist-types/messages/ean-change.d.ts +5 -0
  174. package/dist/types/dist-types/messages/index.d.ts +6 -0
  175. package/dist/types/dist-types/messages/order/delivered.d.ts +292 -0
  176. package/dist/types/dist-types/messages/order/index.d.ts +6 -0
  177. package/dist/types/dist-types/messages/order/new.d.ts +292 -0
  178. package/dist/types/dist-types/messages/order/processed.d.ts +292 -0
  179. package/dist/types/dist-types/messages/order/return-initiated.d.ts +292 -0
  180. package/dist/types/dist-types/messages/order/returned.d.ts +293 -0
  181. package/dist/types/dist-types/messages/order/shipped.d.ts +293 -0
  182. package/dist/types/dist-types/messages/price-change.d.ts +16 -0
  183. package/dist/types/dist-types/messages/product-category.d.ts +7 -0
  184. package/dist/types/dist-types/messages/product-draft.d.ts +136 -0
  185. package/dist/types/dist-types/messages/product.d.ts +144 -0
  186. package/dist/types/dist-types/money.d.ts +11 -0
  187. package/dist/types/dist-types/order/address.d.ts +27 -0
  188. package/dist/types/dist-types/order/customer.d.ts +81 -0
  189. package/dist/types/dist-types/order/index.d.ts +8 -0
  190. package/dist/types/dist-types/order/item.d.ts +85 -0
  191. package/dist/types/dist-types/order/orderMain.d.ts +289 -0
  192. package/dist/types/dist-types/order/payment.d.ts +26 -0
  193. package/dist/types/dist-types/order/shipment/index.d.ts +6 -0
  194. package/dist/types/dist-types/order/shipment/item/index.d.ts +4 -0
  195. package/dist/types/dist-types/order/shipment/item/itemMain.d.ts +6 -0
  196. package/dist/types/dist-types/order/shipment/item/returned.d.ts +11 -0
  197. package/dist/types/dist-types/order/shipment/pos/index.d.ts +5 -0
  198. package/dist/types/dist-types/order/shipment/pos/outbound.d.ts +76 -0
  199. package/dist/types/dist-types/order/shipment/pos/posMain.d.ts +71 -0
  200. package/dist/types/dist-types/order/shipment/pos/return.d.ts +75 -0
  201. package/dist/types/dist-types/order/shipment/shipmentMain.d.ts +62 -0
  202. package/dist/types/dist-types/order/shipment/shipped/index.d.ts +5 -0
  203. package/dist/types/dist-types/order/shipment/shipped/outbound.d.ts +68 -0
  204. package/dist/types/dist-types/order/shipment/shipped/return.d.ts +68 -0
  205. package/dist/types/dist-types/order/shipment/shipped/shippedMain.d.ts +69 -0
  206. package/dist/types/dist-types/price.d.ts +15 -0
  207. package/dist/types/dist-types/product-category.d.ts +6 -0
  208. package/dist/types/dist-types/product-draft.d.ts +135 -0
  209. package/dist/types/dist-types/product.d.ts +143 -0
  210. package/dist/types/dist-types/stock.d.ts +19 -0
  211. package/dist/types/dist-types/total.d.ts +44 -0
  212. package/dist/types/index.d.ts +3 -0
  213. package/dist/types/src-public/airtable.d.ts +227 -0
  214. package/dist/types/src-public/bigquery.d.ts +17 -0
  215. package/dist/types/src-public/centra.d.ts +176 -0
  216. package/dist/types/src-public/cloudtasks.d.ts +74 -0
  217. package/dist/types/src-public/dato.d.ts +95 -0
  218. package/dist/types/src-public/env.d.ts +144 -0
  219. package/dist/types/src-public/getEventTime.d.ts +1 -0
  220. package/dist/types/src-public/index.d.ts +18 -0
  221. package/dist/types/src-public/ipValidation.d.ts +15 -0
  222. package/dist/types/src-public/jwks.d.ts +15 -0
  223. package/dist/types/src-public/pubsub.d.ts +95 -0
  224. package/dist/types/src-public/rateLimit.d.ts +21 -0
  225. package/dist/types/src-public/redisClient.d.ts +6 -0
  226. package/dist/types/src-public/runtime.d.ts +58 -0
  227. package/dist/types/src-public/sanitize.d.ts +4 -0
  228. package/dist/types/src-public/scheduler.d.ts +71 -0
  229. package/dist/types/src-public/secret.d.ts +6 -0
  230. package/dist/types/src-public/setHeaders.d.ts +13 -0
  231. package/dist/types/src-public/types.d.ts +264 -0
  232. package/dist/types/src-public/utils.d.ts +101 -0
  233. package/dist/types/src-public/validate.d.ts +9 -0
  234. package/package.json +7 -4
  235. package/dist/index.d.ts +0 -34970
  236. package/dist/index.js +0 -113296
@@ -0,0 +1,19 @@
1
+ export type Currency = ("AFN" | "ALL" | "DZD" | "USD" | "EUR" | "AOA" | "XCD" | "ARS" | "AMD" | "AWG" | "AUD" | "AZN" | "BSD" | "BHD" | "BDT" | "BBD" | "BYN" | "BZD" | "XOF" | "BMD" | "BTN" | "INR" | "BOB" | "BOV" | "BAM" | "BWP" | "NOK" | "BRL" | "BND" | "BGN" | "BIF" | "CVE" | "KHR" | "XAF" | "CAD" | "KYD" | "CLF" | "CLP" | "CNY" | "COP" | "COU" | "KMF" | "CDF" | "NZD" | "CRC" | "CUC" | "CUP" | "ANG" | "CZK" | "DKK" | "DJF" | "DOP" | "EGP" | "SVC" | "ERN" | "ETB" | "FKP" | "FJD" | "XPF" | "GMD" | "GEL" | "GHS" | "GIP" | "GTQ" | "GBP" | "GNF" | "GYD" | "HTG" | "HNL" | "HKD" | "HUF" | "ISK" | "IDR" | "XDR" | "IRR" | "IQD" | "ILS" | "JMD" | "JPY" | "JOD" | "KZT" | "KES" | "KPW" | "KRW" | "KWD" | "KGS" | "LAK" | "LBP" | "LSL" | "ZAR" | "LRD" | "LYD" | "CHF" | "MOP" | "MGA" | "MWK" | "MYR" | "MVR" | "MRU" | "MUR" | "XUA" | "MXN" | "MXV" | "MDL" | "MNT" | "MAD" | "MZN" | "MMK" | "NAD" | "NPR" | "NIO" | "NGN" | "OMR" | "PKR" | "PAB" | "PGK" | "PYG" | "PEN" | "PHP" | "PLN" | "QAR" | "MKD" | "RON" | "RUB" | "RWF" | "SHP" | "WST" | "STN" | "SAR" | "RSD" | "SCR" | "SLE" | "SGD" | "XSU" | "SBD" | "SOS" | "SSP" | "LKR" | "SDG" | "SRD" | "SZL" | "SEK" | "CHE" | "CHW" | "SYP" | "TWD" | "TJS" | "TZS" | "THB" | "TOP" | "TTD" | "TND" | "TRY" | "TMT" | "UGX" | "UAH" | "AED" | "USN" | "UYI" | "UYU" | "UZS" | "VUV" | "VEF" | "VED" | "VND" | "YER" | "ZMW" | "ZWL");
2
+ export type LCYCurrency = ("AFN" | "ALL" | "DZD" | "USD" | "EUR" | "AOA" | "XCD" | "ARS" | "AMD" | "AWG" | "AUD" | "AZN" | "BSD" | "BHD" | "BDT" | "BBD" | "BYN" | "BZD" | "XOF" | "BMD" | "BTN" | "INR" | "BOB" | "BOV" | "BAM" | "BWP" | "NOK" | "BRL" | "BND" | "BGN" | "BIF" | "CVE" | "KHR" | "XAF" | "CAD" | "KYD" | "CLF" | "CLP" | "CNY" | "COP" | "COU" | "KMF" | "CDF" | "NZD" | "CRC" | "CUC" | "CUP" | "ANG" | "CZK" | "DKK" | "DJF" | "DOP" | "EGP" | "SVC" | "ERN" | "ETB" | "FKP" | "FJD" | "XPF" | "GMD" | "GEL" | "GHS" | "GIP" | "GTQ" | "GBP" | "GNF" | "GYD" | "HTG" | "HNL" | "HKD" | "HUF" | "ISK" | "IDR" | "XDR" | "IRR" | "IQD" | "ILS" | "JMD" | "JPY" | "JOD" | "KZT" | "KES" | "KPW" | "KRW" | "KWD" | "KGS" | "LAK" | "LBP" | "LSL" | "ZAR" | "LRD" | "LYD" | "CHF" | "MOP" | "MGA" | "MWK" | "MYR" | "MVR" | "MRU" | "MUR" | "XUA" | "MXN" | "MXV" | "MDL" | "MNT" | "MAD" | "MZN" | "MMK" | "NAD" | "NPR" | "NIO" | "NGN" | "OMR" | "PKR" | "PAB" | "PGK" | "PYG" | "PEN" | "PHP" | "PLN" | "QAR" | "MKD" | "RON" | "RUB" | "RWF" | "SHP" | "WST" | "STN" | "SAR" | "RSD" | "SCR" | "SLE" | "SGD" | "XSU" | "SBD" | "SOS" | "SSP" | "LKR" | "SDG" | "SRD" | "SZL" | "SEK" | "CHE" | "CHW" | "SYP" | "TWD" | "TJS" | "TZS" | "THB" | "TOP" | "TTD" | "TND" | "TRY" | "TMT" | "UGX" | "UAH" | "AED" | "USN" | "UYI" | "UYU" | "UZS" | "VUV" | "VEF" | "VED" | "VND" | "YER" | "ZMW" | "ZWL");
3
+ export interface __MainSchema {
4
+ style_id: string;
5
+ colour_id: string;
6
+ size_code: string;
7
+ quantity: number;
8
+ location_code: string;
9
+ unit_cost: (Money | null);
10
+ }
11
+ export interface Money {
12
+ value: number;
13
+ decimal_places: number;
14
+ currency: Currency;
15
+ lcy_value: number;
16
+ lcy_currency: LCYCurrency;
17
+ lcy_decimal_places: number;
18
+ }
19
+ export default __MainSchema;
@@ -0,0 +1,44 @@
1
+ export type Currency = ("AFN" | "ALL" | "DZD" | "USD" | "EUR" | "AOA" | "XCD" | "ARS" | "AMD" | "AWG" | "AUD" | "AZN" | "BSD" | "BHD" | "BDT" | "BBD" | "BYN" | "BZD" | "XOF" | "BMD" | "BTN" | "INR" | "BOB" | "BOV" | "BAM" | "BWP" | "NOK" | "BRL" | "BND" | "BGN" | "BIF" | "CVE" | "KHR" | "XAF" | "CAD" | "KYD" | "CLF" | "CLP" | "CNY" | "COP" | "COU" | "KMF" | "CDF" | "NZD" | "CRC" | "CUC" | "CUP" | "ANG" | "CZK" | "DKK" | "DJF" | "DOP" | "EGP" | "SVC" | "ERN" | "ETB" | "FKP" | "FJD" | "XPF" | "GMD" | "GEL" | "GHS" | "GIP" | "GTQ" | "GBP" | "GNF" | "GYD" | "HTG" | "HNL" | "HKD" | "HUF" | "ISK" | "IDR" | "XDR" | "IRR" | "IQD" | "ILS" | "JMD" | "JPY" | "JOD" | "KZT" | "KES" | "KPW" | "KRW" | "KWD" | "KGS" | "LAK" | "LBP" | "LSL" | "ZAR" | "LRD" | "LYD" | "CHF" | "MOP" | "MGA" | "MWK" | "MYR" | "MVR" | "MRU" | "MUR" | "XUA" | "MXN" | "MXV" | "MDL" | "MNT" | "MAD" | "MZN" | "MMK" | "NAD" | "NPR" | "NIO" | "NGN" | "OMR" | "PKR" | "PAB" | "PGK" | "PYG" | "PEN" | "PHP" | "PLN" | "QAR" | "MKD" | "RON" | "RUB" | "RWF" | "SHP" | "WST" | "STN" | "SAR" | "RSD" | "SCR" | "SLE" | "SGD" | "XSU" | "SBD" | "SOS" | "SSP" | "LKR" | "SDG" | "SRD" | "SZL" | "SEK" | "CHE" | "CHW" | "SYP" | "TWD" | "TJS" | "TZS" | "THB" | "TOP" | "TTD" | "TND" | "TRY" | "TMT" | "UGX" | "UAH" | "AED" | "USN" | "UYI" | "UYU" | "UZS" | "VUV" | "VEF" | "VED" | "VND" | "YER" | "ZMW" | "ZWL");
2
+ export type LCYCurrency = ("AFN" | "ALL" | "DZD" | "USD" | "EUR" | "AOA" | "XCD" | "ARS" | "AMD" | "AWG" | "AUD" | "AZN" | "BSD" | "BHD" | "BDT" | "BBD" | "BYN" | "BZD" | "XOF" | "BMD" | "BTN" | "INR" | "BOB" | "BOV" | "BAM" | "BWP" | "NOK" | "BRL" | "BND" | "BGN" | "BIF" | "CVE" | "KHR" | "XAF" | "CAD" | "KYD" | "CLF" | "CLP" | "CNY" | "COP" | "COU" | "KMF" | "CDF" | "NZD" | "CRC" | "CUC" | "CUP" | "ANG" | "CZK" | "DKK" | "DJF" | "DOP" | "EGP" | "SVC" | "ERN" | "ETB" | "FKP" | "FJD" | "XPF" | "GMD" | "GEL" | "GHS" | "GIP" | "GTQ" | "GBP" | "GNF" | "GYD" | "HTG" | "HNL" | "HKD" | "HUF" | "ISK" | "IDR" | "XDR" | "IRR" | "IQD" | "ILS" | "JMD" | "JPY" | "JOD" | "KZT" | "KES" | "KPW" | "KRW" | "KWD" | "KGS" | "LAK" | "LBP" | "LSL" | "ZAR" | "LRD" | "LYD" | "CHF" | "MOP" | "MGA" | "MWK" | "MYR" | "MVR" | "MRU" | "MUR" | "XUA" | "MXN" | "MXV" | "MDL" | "MNT" | "MAD" | "MZN" | "MMK" | "NAD" | "NPR" | "NIO" | "NGN" | "OMR" | "PKR" | "PAB" | "PGK" | "PYG" | "PEN" | "PHP" | "PLN" | "QAR" | "MKD" | "RON" | "RUB" | "RWF" | "SHP" | "WST" | "STN" | "SAR" | "RSD" | "SCR" | "SLE" | "SGD" | "XSU" | "SBD" | "SOS" | "SSP" | "LKR" | "SDG" | "SRD" | "SZL" | "SEK" | "CHE" | "CHW" | "SYP" | "TWD" | "TJS" | "TZS" | "THB" | "TOP" | "TTD" | "TND" | "TRY" | "TMT" | "UGX" | "UAH" | "AED" | "USN" | "UYI" | "UYU" | "UZS" | "VUV" | "VEF" | "VED" | "VND" | "YER" | "ZMW" | "ZWL");
3
+ export type DiscountAmountPercent = number;
4
+ export interface __MainSchema {
5
+ amount_net: AmountNet;
6
+ amount_gross: AmountGross;
7
+ discount_amount_net: DiscountAmountNet;
8
+ discount_amount_gross: DiscountAmountGross;
9
+ discount_amount_percent: DiscountAmountPercent;
10
+ [k: string]: unknown;
11
+ }
12
+ export interface AmountNet {
13
+ value: number;
14
+ decimal_places: number;
15
+ currency: Currency;
16
+ lcy_value: number;
17
+ lcy_currency: LCYCurrency;
18
+ lcy_decimal_places: number;
19
+ }
20
+ export interface AmountGross {
21
+ value: number;
22
+ decimal_places: number;
23
+ currency: Currency;
24
+ lcy_value: number;
25
+ lcy_currency: LCYCurrency;
26
+ lcy_decimal_places: number;
27
+ }
28
+ export interface DiscountAmountNet {
29
+ value: number;
30
+ decimal_places: number;
31
+ currency: Currency;
32
+ lcy_value: number;
33
+ lcy_currency: LCYCurrency;
34
+ lcy_decimal_places: number;
35
+ }
36
+ export interface DiscountAmountGross {
37
+ value: number;
38
+ decimal_places: number;
39
+ currency: Currency;
40
+ lcy_value: number;
41
+ lcy_currency: LCYCurrency;
42
+ lcy_decimal_places: number;
43
+ }
44
+ export default __MainSchema;
@@ -0,0 +1,3 @@
1
+ export * as schema from './dist-dereferenced';
2
+ export * as types from './dist-types';
3
+ export * as lib from './src-public';
@@ -0,0 +1,227 @@
1
+ import Runtime, { Opts as RuntimeOpts } from './runtime';
2
+ interface ReplaceFormulaResult {
3
+ replacedFormula: string;
4
+ usedFields: string[];
5
+ replacedFields: string[];
6
+ missingFields: string[];
7
+ }
8
+ declare class AirtableHelper<T extends Record<string, string>, K extends keyof T> extends Runtime {
9
+ baseId: string;
10
+ tableId: string;
11
+ apiKey: string;
12
+ dictionary: T;
13
+ primaryKeyFieldName: K;
14
+ primaryKeyWritable: boolean;
15
+ constructor(opts: RuntimeOpts, airtableOpts: {
16
+ baseId: string;
17
+ tableId: string;
18
+ apiKey: string;
19
+ dictionary: T;
20
+ primaryKeyFieldName: K;
21
+ primaryKeyWritable?: boolean;
22
+ });
23
+ static translateFields<T extends Record<string, string>, S extends {
24
+ fields: {
25
+ [key in T[keyof T]]: any;
26
+ };
27
+ }>(dictionary: T, y: S): S & {
28
+ fields: {
29
+ [key in keyof T]: any;
30
+ };
31
+ };
32
+ createIfNotExist(payload: Partial<{
33
+ [key in keyof T]: any;
34
+ }> & {
35
+ [prumaryKeyFieldName in K]: string;
36
+ }): Promise<{
37
+ id: string;
38
+ fields: { [key in keyof T]: any; };
39
+ }>;
40
+ updateMultiple(payload: Array<Partial<{
41
+ [key in keyof T]: any;
42
+ }> & {
43
+ [prumaryKeyFieldName in K]: string;
44
+ }>, options?: {
45
+ fieldsToMergeOn?: Array<keyof T>;
46
+ primaryKeyWritable?: boolean;
47
+ }, callIdx?: number, collectedResult?: {
48
+ updatedRecords: Array<string>;
49
+ createdRecords: Array<string>;
50
+ records: Array<{
51
+ id: string;
52
+ fields: {
53
+ [key in T[keyof T]]: any;
54
+ };
55
+ } | Error>;
56
+ }): Promise<{
57
+ updatedRecords: Array<string>;
58
+ createdRecords: Array<string>;
59
+ records: Array<{
60
+ id: string;
61
+ fields: {
62
+ [key in T[keyof T]]: any;
63
+ };
64
+ } | Error>;
65
+ }>;
66
+ upsert(payload: Partial<{
67
+ [key in keyof T]: any;
68
+ }> & {
69
+ [prumaryKeyFieldName in K]: string;
70
+ }): Promise<{
71
+ id: string;
72
+ fields: { [key in keyof T]: any; };
73
+ }>;
74
+ static removePrimaryKey(x: any, primaryKeyFieldId: string): any;
75
+ static convertToDictionary<T extends Record<string, string>>(dictionary: T, x: Partial<{
76
+ [key in keyof T]: any;
77
+ }>): Partial<Record<T[keyof T], any>>;
78
+ createRecord(payload: Partial<{
79
+ [key in keyof T]: any;
80
+ }>): Promise<{
81
+ id: string;
82
+ fields: {
83
+ [key in keyof T]: any;
84
+ };
85
+ }>;
86
+ updateRecord(recordId: string, payload: Partial<{
87
+ [key in keyof T]: any;
88
+ }> & {
89
+ [prumaryKeyFieldName in K]: string;
90
+ }): Promise<{
91
+ id: string;
92
+ fields: {
93
+ [key in keyof T]: any;
94
+ };
95
+ }>;
96
+ getExistingRecord(payload: Partial<{
97
+ [key in keyof T]: any;
98
+ }> & {
99
+ [x in K]: string;
100
+ }): Promise<null | {
101
+ id: string;
102
+ fields: {
103
+ [key in keyof T]: any;
104
+ };
105
+ }>;
106
+ getExistingRecordById(id: string): Promise<{
107
+ id: string;
108
+ fields: {
109
+ [key in keyof T]: any;
110
+ };
111
+ }>;
112
+ getExistingRecords(formula?: string): Promise<Array<{
113
+ id: string;
114
+ fields: {
115
+ [key in keyof T]: any;
116
+ };
117
+ }>>;
118
+ getExistingRecordsByKeys(keys: Array<string>): Promise<Map<string, {
119
+ id: string;
120
+ fields: {
121
+ [key in keyof T]: any;
122
+ };
123
+ }>>;
124
+ pingWebhook(webhook: {
125
+ webhook: {
126
+ id: string;
127
+ };
128
+ }): Promise<void>;
129
+ getPayloads(opts: {
130
+ url: string;
131
+ }): Promise<{
132
+ result: any[];
133
+ unprocessed: {
134
+ url: string;
135
+ $$error?: any;
136
+ } | null;
137
+ nextToProcess: {
138
+ url: string;
139
+ } | null;
140
+ }>;
141
+ listPayloads(input: {
142
+ webhook: {
143
+ id: string;
144
+ };
145
+ }, startingCursor: number): Promise<{
146
+ result: any[];
147
+ cursor: number;
148
+ unprocessed: {
149
+ webhook: {
150
+ id: string;
151
+ };
152
+ } | null;
153
+ nextToProcess: {
154
+ webhook: {
155
+ id: string;
156
+ };
157
+ } | null;
158
+ }>;
159
+ getWebhooks(): Promise<AirtableWebhook[]>;
160
+ enableOrPauseWebhook({ webhookId, pause }: {
161
+ webhookId: string;
162
+ pause: boolean;
163
+ }): Promise<AirtableWebhook>;
164
+ pause(): Promise<{
165
+ webhookId: string;
166
+ } | {
167
+ webhookId: null;
168
+ }>;
169
+ resume(): Promise<{
170
+ webhookId: string;
171
+ } | {
172
+ webhookId: null;
173
+ }>;
174
+ getWebhook(): Promise<AirtableWebhook | null>;
175
+ private createNotificationUrl;
176
+ isValidSignature(secret: string, payload: string, signature: string): Promise<boolean>;
177
+ deleteWebhook(x?: string): Promise<boolean>;
178
+ webhookHasChanged(): Promise<boolean>;
179
+ updateOrCreateWebhook(): Promise<AirtableWebhook | {
180
+ areNotificationsEnabled: true;
181
+ id: string;
182
+ macSecretBase64: string;
183
+ expirationTime: string;
184
+ }>;
185
+ replaceAirtableFields(formula: string): ReplaceFormulaResult;
186
+ }
187
+ export default AirtableHelper;
188
+ type AirtableWebhook = {
189
+ areNotificationsEnabled: boolean;
190
+ cursorForNextPayload: number;
191
+ expirationTime: string;
192
+ id: string;
193
+ isHookEnabled: true;
194
+ lastNotificationResult: {
195
+ completionTimestamp: string;
196
+ durationMs: number;
197
+ retryNumber: number;
198
+ success: true;
199
+ };
200
+ lastSuccessfulNotificationTime: string;
201
+ notificationUrl: string;
202
+ specification: {
203
+ options: {
204
+ filters: {
205
+ dataTypes: Array<"tableData" | "tableFields" | "tableMetadata">;
206
+ recordChangeScope?: string;
207
+ changeTypes?: Array<"add" | "remove" | "update">;
208
+ fromSources?: Array<"client" | "publicApi" | "formSubmission" | "formPageSubmission" | "automation" | "system" | "sync" | "anonymousUser" | "unknown">;
209
+ sourceOptions?: {
210
+ formPageSubmission?: {
211
+ pageId?: string;
212
+ };
213
+ formSubmission?: {
214
+ viewId?: string;
215
+ };
216
+ };
217
+ watchDataInFieldIds?: Array<string>;
218
+ watchSchemasOfFieldIds?: Array<string>;
219
+ };
220
+ includes?: {
221
+ includeCellValuesInFieldIds: Array<string> | "all";
222
+ includePreviousCellValues?: boolean;
223
+ includePreviousFieldDefinitions?: boolean;
224
+ };
225
+ };
226
+ };
227
+ };
@@ -0,0 +1,17 @@
1
+ import { type BigQuery } from '@google-cloud/bigquery';
2
+ import Runtime, { Opts as RuntimeOpts } from './runtime';
3
+ interface ColumnSchema {
4
+ name: string;
5
+ type: string;
6
+ mode?: string;
7
+ }
8
+ declare class BigQueryHelper extends Runtime {
9
+ private bigQuery;
10
+ constructor(opts: RuntimeOpts, bigQuery: BigQuery);
11
+ createOrUpdate(opts: {
12
+ datasetId: string;
13
+ tableName: string;
14
+ incomingSchema: ColumnSchema[];
15
+ }): Promise<string>;
16
+ }
17
+ export default BigQueryHelper;
@@ -0,0 +1,176 @@
1
+ import EnvEngine from './env';
2
+ import Runtime from './runtime';
3
+ export type BasicCentraProduct = {
4
+ id: number;
5
+ name: string;
6
+ externalId: string;
7
+ productNumber: string;
8
+ status: string;
9
+ prices: {
10
+ price: {
11
+ value: number;
12
+ };
13
+ pricelist: {
14
+ id: number;
15
+ name: string;
16
+ };
17
+ }[];
18
+ };
19
+ export type BasicCentraDisplay = {
20
+ id: number;
21
+ name: string;
22
+ externalId: string;
23
+ status: string;
24
+ url: string;
25
+ metaTitle: string;
26
+ metaDescription: string;
27
+ categories: {
28
+ id: number;
29
+ name: string;
30
+ url: string;
31
+ isTopCategory: boolean;
32
+ }[];
33
+ markets: BasicCentraMarket[];
34
+ productVariant: Array<{
35
+ id: number;
36
+ externalId: string;
37
+ status: string;
38
+ variantNumber: string;
39
+ }>;
40
+ product: {
41
+ id: number;
42
+ externalId: string;
43
+ status: string;
44
+ };
45
+ };
46
+ export type BasicPricelist = {
47
+ id: number;
48
+ name: string;
49
+ externalId: string;
50
+ campaigns: {
51
+ id: number;
52
+ name: string;
53
+ status: string;
54
+ }[];
55
+ currency: {
56
+ id: number;
57
+ name: string;
58
+ code: string;
59
+ };
60
+ };
61
+ export type BasicCentraCampaign = {
62
+ id: number;
63
+ name: string;
64
+ };
65
+ export type CentraError = {
66
+ message: string;
67
+ path?: string;
68
+ };
69
+ export type CentraErrors = {
70
+ errors: CentraError[];
71
+ };
72
+ export type BasicCentraCountry = {
73
+ id: number;
74
+ name: string;
75
+ code: string;
76
+ };
77
+ export type BasicCentraMarket = {
78
+ id: number;
79
+ name: string;
80
+ externalId: string;
81
+ };
82
+ export type BasicCentraVariant = {
83
+ id: number;
84
+ externalId: string;
85
+ variantNumber: string;
86
+ status: string;
87
+ name: string;
88
+ product: BasicCentraProduct;
89
+ sizeChart: {
90
+ externalId: string;
91
+ id: string;
92
+ };
93
+ productSizes: {
94
+ id: string;
95
+ EAN: string;
96
+ SKU: string;
97
+ sizeNumber: string;
98
+ size: {
99
+ id: string;
100
+ name: string;
101
+ };
102
+ }[];
103
+ };
104
+ export type BasicCentraSizeChart = {
105
+ id: number;
106
+ name: string;
107
+ externalId: string;
108
+ sizes: {
109
+ id: number;
110
+ name: string;
111
+ externalId: string;
112
+ localizedName: string | undefined;
113
+ }[];
114
+ };
115
+ export type BasicCentraWarehouse = {
116
+ id: number;
117
+ name: string;
118
+ status: string;
119
+ externalId: string;
120
+ };
121
+ export default class CentraHelper extends EnvEngine {
122
+ protected opts: {
123
+ accessToken: string;
124
+ centraApiBase: string;
125
+ };
126
+ shaToken: string;
127
+ graphqlUrl: string;
128
+ constructor(options: ConstructorParameters<typeof Runtime>[0], opts: {
129
+ accessToken: string;
130
+ centraApiBase: string;
131
+ });
132
+ static isCentraErrors(data: unknown): data is CentraErrors;
133
+ fetch(arg1: Parameters<typeof fetch>[0], arg2?: Parameters<typeof fetch>[1]): Promise<{
134
+ errors?: {
135
+ message: string;
136
+ path?: string;
137
+ }[];
138
+ data?: unknown;
139
+ limitExceeded?: boolean;
140
+ }>;
141
+ getCacheKeyForStyleId(styleId: string): string;
142
+ getCacheKeyForCountryCode(countryCode: string): string;
143
+ getCacheKeyForMarkets(): string;
144
+ getCacheKeyForMarket(marketExternalId: string): string;
145
+ getCacheKeyForSizeCharts(): string;
146
+ getCacheKeyForCountries(): string;
147
+ getCacheKeyForCountry(countryIso2Code: string): string;
148
+ getCacheKeyForSizeChart(sizeChartExternalId: string): string;
149
+ getCacheKeyForCentraProduct(productExternalId: string): string;
150
+ getCacheKeyForCentraVariant(variantExternalId: string): string;
151
+ getCacheKeyForCentraDisplayByVariantId(centraVariantId: number): string;
152
+ getCacheKeyForCentraDisplayByProductId(centraProductId: number): string;
153
+ getCacheKeyForCentraWarehouses(): string;
154
+ getCacheKeyForCentraWarehouse(warehouseExternalId: string): string;
155
+ getCacheKeyForCentraPricelists(): string;
156
+ getCacheKeyForCentraPricelist(pricelistExternalId: string): string;
157
+ fetchCountries(iso2Codes?: string[] | undefined | null): Promise<CentraErrors | Array<BasicCentraCountry>>;
158
+ fetchCentraWarehouses(externalIds?: string[] | undefined | null): Promise<CentraErrors | Array<BasicCentraWarehouse>>;
159
+ fetchCentraCampaigns(names?: string[] | undefined | null): Promise<CentraErrors | Record<string, BasicCentraCampaign | Error>>;
160
+ fetchPricelists(names?: string[] | undefined | null): Promise<CentraErrors | Array<BasicPricelist>>;
161
+ fetchCentraMarkets(externalIds?: string[] | undefined | null): Promise<CentraErrors | Array<BasicCentraMarket>>;
162
+ fetchCentraSizeCharts(externalIds?: string[] | undefined | null): Promise<CentraErrors | Array<BasicCentraSizeChart>>;
163
+ private fetchCentraProducts;
164
+ private fetchCentraDisplays;
165
+ private fetchCentraVariants;
166
+ getCentraWarehouses(externalIds?: string[] | null | undefined, alwaysFetch?: boolean): Promise<Error | Record<string, Error | BasicCentraWarehouse>>;
167
+ getCentraPricelists(names?: string[] | null | undefined, alwaysFetch?: boolean): Promise<Error | Record<string, Error | BasicPricelist>>;
168
+ getCentraMarkets(externalIds?: string[] | null | undefined, alwaysFetch?: boolean): Promise<Error | Record<string, Error | BasicCentraMarket>>;
169
+ getCentraCountries(iso2Codes?: string[] | null | undefined, alwaysFetch?: boolean): Promise<Error | Record<string, Error | BasicCentraCountry>>;
170
+ getCentraSizeCharts(externalIds?: string[] | null | undefined, alwaysFetch?: boolean): Promise<Error | Record<string, Error | BasicCentraSizeChart>>;
171
+ getCentraProducts(styleIds: string[]): Promise<Error | Record<string, Error | BasicCentraProduct>>;
172
+ getCentraDisplaysByVariantIds(centraVariantIds: number[]): Promise<Record<number, BasicCentraDisplay[] | Error>>;
173
+ getCentraDisplaysByProductIds(centraProductIds: number[]): Promise<Record<string, BasicCentraDisplay[] | Error>>;
174
+ getCentraVariants(productIds: string[]): Promise<Record<string, BasicCentraVariant | Error>>;
175
+ static centraSizeNameToSize(centraSizeName: string): string;
176
+ }
@@ -0,0 +1,74 @@
1
+ import Runtime from './runtime';
2
+ export interface CloudTasksHelperOpts {
3
+ projectId: string;
4
+ serviceAccount: string;
5
+ accessToken: string;
6
+ envName: string;
7
+ workflowId: string;
8
+ triggerId: string;
9
+ url: string;
10
+ }
11
+ export interface CreateTaskOpts {
12
+ topicName: string;
13
+ httpTarget: {
14
+ uri?: string;
15
+ httpMethod?: 'POST' | 'GET' | 'PUT' | 'DELETE';
16
+ headers?: Record<string, string>;
17
+ body?: any;
18
+ };
19
+ extraQuery?: Record<string, string>;
20
+ scheduleSeconds?: number;
21
+ doNotCreateIfExists?: string;
22
+ deleteExistingTasks?: boolean;
23
+ repeatCount?: number;
24
+ }
25
+ export interface GcpQueue {
26
+ name: string;
27
+ retryConfig?: {
28
+ maxAttempts?: number;
29
+ maxRetryDuration?: string;
30
+ minBackoff?: string;
31
+ maxBackoff?: string;
32
+ maxDoublings?: number;
33
+ };
34
+ rateLimits?: {
35
+ maxDispatchesPerSecond?: number;
36
+ maxConcurrentDispatches?: number;
37
+ };
38
+ }
39
+ export interface GcpTask {
40
+ name: string;
41
+ scheduleTime?: string;
42
+ httpRequest?: {
43
+ httpMethod?: string;
44
+ url?: string;
45
+ headers?: Record<string, string>;
46
+ body?: string;
47
+ oidcToken?: {
48
+ serviceAccountEmail: string;
49
+ };
50
+ };
51
+ }
52
+ export interface GcpListTasksResponse {
53
+ tasks?: GcpTask[];
54
+ }
55
+ export default class CloudTasksHelper extends Runtime {
56
+ private projectId;
57
+ private serviceAccount;
58
+ private accessToken;
59
+ envName: string;
60
+ workflowId: string;
61
+ triggerId: string;
62
+ private location;
63
+ constructor(opts: CloudTasksHelperOpts);
64
+ private getQueueName;
65
+ private getQueuePath;
66
+ private getQueueApiUrl;
67
+ private getLocationApiUrl;
68
+ getQueue(topicName: string): Promise<GcpQueue | null>;
69
+ createOrUpdateQueue(topicName: string, retryConfig?: Required<GcpQueue['retryConfig']>, rateLimits?: Required<GcpQueue['rateLimits']>): Promise<void>;
70
+ private listTasks;
71
+ private deleteTask;
72
+ create(opts: CreateTaskOpts): Promise<false | string[]>;
73
+ delete(topicName: string): Promise<boolean>;
74
+ }
@@ -0,0 +1,95 @@
1
+ import Runtime, { Opts as RuntimeOpts } from './runtime';
2
+ interface DatoHelperOptions {
3
+ apiToken: string;
4
+ baseUrl?: string;
5
+ environment?: string;
6
+ root?: {
7
+ state: Record<string, any>;
8
+ inputs: any;
9
+ };
10
+ }
11
+ interface UploadResult {
12
+ success: boolean;
13
+ upload: string;
14
+ assetId?: string;
15
+ skipped?: boolean;
16
+ }
17
+ interface UploadReturn {
18
+ id: string;
19
+ type: string;
20
+ attributes: {
21
+ url: string;
22
+ filename: string;
23
+ [key: string]: any;
24
+ };
25
+ }
26
+ export default class DatoHelper extends Runtime {
27
+ private apiToken;
28
+ private baseUrl;
29
+ private environment;
30
+ private root?;
31
+ constructor(opts: RuntimeOpts, datoOpts: DatoHelperOptions);
32
+ private handle429;
33
+ private requestUploadParameters;
34
+ private uploadToStorageBucket;
35
+ private createAssetFromUpload;
36
+ private checkJobResult;
37
+ private waitForJobCompletion;
38
+ updateUpload: (options: {
39
+ id: string;
40
+ filename?: string;
41
+ tags: string[];
42
+ notes?: string;
43
+ title: string;
44
+ alt: string;
45
+ author: string;
46
+ copyright: string;
47
+ uploadCollectionId?: string;
48
+ }) => Promise<{
49
+ success: boolean;
50
+ assetId: string;
51
+ upload: string;
52
+ }>;
53
+ uploadFromUrl(options: {
54
+ url: string;
55
+ copyright: string;
56
+ author: string;
57
+ notes?: string;
58
+ tags: string[];
59
+ title: string;
60
+ alt: string;
61
+ filename?: string;
62
+ skipCreationIfAlreadyExists?: boolean;
63
+ uploadCollectionId?: string;
64
+ }): Promise<UploadResult>;
65
+ uploadFromFile(options: {
66
+ filePath: string;
67
+ copyright: string;
68
+ author: string;
69
+ notes?: string;
70
+ tags: string[];
71
+ title: string;
72
+ alt: string;
73
+ filename?: string;
74
+ skipCreationIfAlreadyExists?: boolean;
75
+ uploadCollectionId?: string;
76
+ }): Promise<UploadResult>;
77
+ getUploadCollections(): Promise<any>;
78
+ findUploadCollectionByLabel(label: string): Promise<any>;
79
+ static buildUrl(asset: string, opts: {
80
+ overrideExisting: boolean;
81
+ width?: number;
82
+ height?: number;
83
+ crop?: 'top' | 'bottom' | 'left' | 'right' | 'faces' | 'entropy' | 'edges' | 'focalpoint' | (string & {});
84
+ quality?: number;
85
+ format?: 'jpg' | 'pjpg' | 'png' | 'webp' | 'avif' | 'gif' | 'jxl' | 'jp2' | 'jxr' | 'json' | 'blurhash' | (string & {});
86
+ }): string;
87
+ findUploadByFilename(filename: string): Promise<UploadReturn | null>;
88
+ getItemTypeId(apiKey: string): Promise<string>;
89
+ getProductBySku(sku: string): Promise<any>;
90
+ createProduct(sku: string, productTypeId: string): Promise<any>;
91
+ updateProductGallery(productId: string, gallery: any[]): Promise<any>;
92
+ updateProductSwatch(productId: string, uploadId: string): Promise<any>;
93
+ publishProduct(productId: string): Promise<any>;
94
+ }
95
+ export {};