@voyantjs/types 0.1.0

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 (427) hide show
  1. package/LICENSE +109 -0
  2. package/README.md +28 -0
  3. package/dist/ai.d.ts +38 -0
  4. package/dist/ai.d.ts.map +1 -0
  5. package/dist/ai.js +2 -0
  6. package/dist/ai.js.map +1 -0
  7. package/dist/api-keys.d.ts +206 -0
  8. package/dist/api-keys.d.ts.map +1 -0
  9. package/dist/api-keys.js +258 -0
  10. package/dist/api-keys.js.map +1 -0
  11. package/dist/booking-forms.d.ts +156 -0
  12. package/dist/booking-forms.d.ts.map +1 -0
  13. package/dist/booking-forms.js +114 -0
  14. package/dist/booking-forms.js.map +1 -0
  15. package/dist/canonical/departure.d.ts +29 -0
  16. package/dist/canonical/departure.d.ts.map +1 -0
  17. package/dist/canonical/departure.js +23 -0
  18. package/dist/canonical/departure.js.map +1 -0
  19. package/dist/canonical/index.d.ts +9 -0
  20. package/dist/canonical/index.d.ts.map +1 -0
  21. package/dist/canonical/index.js +9 -0
  22. package/dist/canonical/index.js.map +1 -0
  23. package/dist/canonical/itinerary.d.ts +16 -0
  24. package/dist/canonical/itinerary.d.ts.map +1 -0
  25. package/dist/canonical/itinerary.js +12 -0
  26. package/dist/canonical/itinerary.js.map +1 -0
  27. package/dist/canonical/lodging.d.ts +21 -0
  28. package/dist/canonical/lodging.d.ts.map +1 -0
  29. package/dist/canonical/lodging.js +14 -0
  30. package/dist/canonical/lodging.js.map +1 -0
  31. package/dist/canonical/price-summary.d.ts +18 -0
  32. package/dist/canonical/price-summary.d.ts.map +1 -0
  33. package/dist/canonical/price-summary.js +15 -0
  34. package/dist/canonical/price-summary.js.map +1 -0
  35. package/dist/canonical/product.d.ts +58 -0
  36. package/dist/canonical/product.d.ts.map +1 -0
  37. package/dist/canonical/product.js +34 -0
  38. package/dist/canonical/product.js.map +1 -0
  39. package/dist/canonical/ship-cabin-category.d.ts +36 -0
  40. package/dist/canonical/ship-cabin-category.d.ts.map +1 -0
  41. package/dist/canonical/ship-cabin-category.js +21 -0
  42. package/dist/canonical/ship-cabin-category.js.map +1 -0
  43. package/dist/canonical/ship-cabin.d.ts +14 -0
  44. package/dist/canonical/ship-cabin.d.ts.map +1 -0
  45. package/dist/canonical/ship-cabin.js +13 -0
  46. package/dist/canonical/ship-cabin.js.map +1 -0
  47. package/dist/canonical/ship.d.ts +54 -0
  48. package/dist/canonical/ship.d.ts.map +1 -0
  49. package/dist/canonical/ship.js +33 -0
  50. package/dist/canonical/ship.js.map +1 -0
  51. package/dist/core/tenant.d.ts +13 -0
  52. package/dist/core/tenant.d.ts.map +1 -0
  53. package/dist/core/tenant.js +7 -0
  54. package/dist/core/tenant.js.map +1 -0
  55. package/dist/fixtures/booking.d.ts +4 -0
  56. package/dist/fixtures/booking.d.ts.map +1 -0
  57. package/dist/fixtures/booking.js +20 -0
  58. package/dist/fixtures/booking.js.map +1 -0
  59. package/dist/fixtures/payment-account.d.ts +4 -0
  60. package/dist/fixtures/payment-account.d.ts.map +1 -0
  61. package/dist/fixtures/payment-account.js +8 -0
  62. package/dist/fixtures/payment-account.js.map +1 -0
  63. package/dist/fixtures/product.d.ts +27 -0
  64. package/dist/fixtures/product.d.ts.map +1 -0
  65. package/dist/fixtures/product.js +19 -0
  66. package/dist/fixtures/product.js.map +1 -0
  67. package/dist/fixtures/user.d.ts +4 -0
  68. package/dist/fixtures/user.d.ts.map +1 -0
  69. package/dist/fixtures/user.js +4 -0
  70. package/dist/fixtures/user.js.map +1 -0
  71. package/dist/forms.d.ts +128 -0
  72. package/dist/forms.d.ts.map +1 -0
  73. package/dist/forms.js +66 -0
  74. package/dist/forms.js.map +1 -0
  75. package/dist/gallery.d.ts +2 -0
  76. package/dist/gallery.d.ts.map +1 -0
  77. package/dist/gallery.js +2 -0
  78. package/dist/gallery.js.map +1 -0
  79. package/dist/generated/api.d.ts +55 -0
  80. package/dist/generated/api.d.ts.map +1 -0
  81. package/dist/generated/api.js +6 -0
  82. package/dist/generated/api.js.map +1 -0
  83. package/dist/index.d.ts +4 -0
  84. package/dist/index.d.ts.map +1 -0
  85. package/dist/index.js +4 -0
  86. package/dist/index.js.map +1 -0
  87. package/dist/queues/booking-persistence.d.ts +85 -0
  88. package/dist/queues/booking-persistence.d.ts.map +1 -0
  89. package/dist/queues/booking-persistence.js +45 -0
  90. package/dist/queues/booking-persistence.js.map +1 -0
  91. package/dist/queues/cache-sync.d.ts +95 -0
  92. package/dist/queues/cache-sync.d.ts.map +1 -0
  93. package/dist/queues/cache-sync.js +49 -0
  94. package/dist/queues/cache-sync.js.map +1 -0
  95. package/dist/queues/form-submission.d.ts +10 -0
  96. package/dist/queues/form-submission.d.ts.map +1 -0
  97. package/dist/queues/form-submission.js +9 -0
  98. package/dist/queues/form-submission.js.map +1 -0
  99. package/dist/queues/index.d.ts +14 -0
  100. package/dist/queues/index.d.ts.map +1 -0
  101. package/dist/queues/index.js +14 -0
  102. package/dist/queues/index.js.map +1 -0
  103. package/dist/queues/inventory-events.d.ts +109 -0
  104. package/dist/queues/inventory-events.d.ts.map +1 -0
  105. package/dist/queues/inventory-events.js +92 -0
  106. package/dist/queues/inventory-events.js.map +1 -0
  107. package/dist/queues/notifications.d.ts +66 -0
  108. package/dist/queues/notifications.d.ts.map +1 -0
  109. package/dist/queues/notifications.js +44 -0
  110. package/dist/queues/notifications.js.map +1 -0
  111. package/dist/queues/webhook-events-inbound.d.ts +36 -0
  112. package/dist/queues/webhook-events-inbound.d.ts.map +1 -0
  113. package/dist/queues/webhook-events-inbound.js +39 -0
  114. package/dist/queues/webhook-events-inbound.js.map +1 -0
  115. package/dist/schema-factory.d.ts +13 -0
  116. package/dist/schema-factory.d.ts.map +1 -0
  117. package/dist/schema-factory.js +7 -0
  118. package/dist/schema-factory.js.map +1 -0
  119. package/dist/schemas/ai-action.d.ts +23 -0
  120. package/dist/schemas/ai-action.d.ts.map +1 -0
  121. package/dist/schemas/ai-action.js +9 -0
  122. package/dist/schemas/ai-action.js.map +1 -0
  123. package/dist/schemas/analytics.d.ts +56 -0
  124. package/dist/schemas/analytics.d.ts.map +1 -0
  125. package/dist/schemas/analytics.js +45 -0
  126. package/dist/schemas/analytics.js.map +1 -0
  127. package/dist/schemas/api-error.d.ts +9 -0
  128. package/dist/schemas/api-error.d.ts.map +1 -0
  129. package/dist/schemas/api-error.js +8 -0
  130. package/dist/schemas/api-error.js.map +1 -0
  131. package/dist/schemas/apps/analytics.d.ts +124 -0
  132. package/dist/schemas/apps/analytics.d.ts.map +1 -0
  133. package/dist/schemas/apps/analytics.js +84 -0
  134. package/dist/schemas/apps/analytics.js.map +1 -0
  135. package/dist/schemas/apps/calendar.d.ts +88 -0
  136. package/dist/schemas/apps/calendar.d.ts.map +1 -0
  137. package/dist/schemas/apps/calendar.js +38 -0
  138. package/dist/schemas/apps/calendar.js.map +1 -0
  139. package/dist/schemas/apps/marketplace/experiences.d.ts +103 -0
  140. package/dist/schemas/apps/marketplace/experiences.d.ts.map +1 -0
  141. package/dist/schemas/apps/marketplace/experiences.js +65 -0
  142. package/dist/schemas/apps/marketplace/experiences.js.map +1 -0
  143. package/dist/schemas/apps/marketplace/flights.d.ts +184 -0
  144. package/dist/schemas/apps/marketplace/flights.d.ts.map +1 -0
  145. package/dist/schemas/apps/marketplace/flights.js +87 -0
  146. package/dist/schemas/apps/marketplace/flights.js.map +1 -0
  147. package/dist/schemas/apps/marketplace/hotels.d.ts +195 -0
  148. package/dist/schemas/apps/marketplace/hotels.d.ts.map +1 -0
  149. package/dist/schemas/apps/marketplace/hotels.js +74 -0
  150. package/dist/schemas/apps/marketplace/hotels.js.map +1 -0
  151. package/dist/schemas/apps/marketplace/packages.d.ts +73 -0
  152. package/dist/schemas/apps/marketplace/packages.d.ts.map +1 -0
  153. package/dist/schemas/apps/marketplace/packages.js +60 -0
  154. package/dist/schemas/apps/marketplace/packages.js.map +1 -0
  155. package/dist/schemas/apps/reports.d.ts +72 -0
  156. package/dist/schemas/apps/reports.d.ts.map +1 -0
  157. package/dist/schemas/apps/reports.js +32 -0
  158. package/dist/schemas/apps/reports.js.map +1 -0
  159. package/dist/schemas/billing/providers/index.d.ts +10 -0
  160. package/dist/schemas/billing/providers/index.d.ts.map +1 -0
  161. package/dist/schemas/billing/providers/index.js +8 -0
  162. package/dist/schemas/billing/providers/index.js.map +1 -0
  163. package/dist/schemas/billing/providers/smartbill.d.ts +9 -0
  164. package/dist/schemas/billing/providers/smartbill.d.ts.map +1 -0
  165. package/dist/schemas/billing/providers/smartbill.js +8 -0
  166. package/dist/schemas/billing/providers/smartbill.js.map +1 -0
  167. package/dist/schemas/billing/tax-code.d.ts +36 -0
  168. package/dist/schemas/billing/tax-code.d.ts.map +1 -0
  169. package/dist/schemas/billing/tax-code.js +23 -0
  170. package/dist/schemas/billing/tax-code.js.map +1 -0
  171. package/dist/schemas/billing/tax-map.d.ts +12 -0
  172. package/dist/schemas/billing/tax-map.d.ts.map +1 -0
  173. package/dist/schemas/billing/tax-map.js +10 -0
  174. package/dist/schemas/billing/tax-map.js.map +1 -0
  175. package/dist/schemas/booking.d.ts +37 -0
  176. package/dist/schemas/booking.d.ts.map +1 -0
  177. package/dist/schemas/booking.js +19 -0
  178. package/dist/schemas/booking.js.map +1 -0
  179. package/dist/schemas/catalog/departures.d.ts +175 -0
  180. package/dist/schemas/catalog/departures.d.ts.map +1 -0
  181. package/dist/schemas/catalog/departures.js +89 -0
  182. package/dist/schemas/catalog/departures.js.map +1 -0
  183. package/dist/schemas/catalog.d.ts +296 -0
  184. package/dist/schemas/catalog.d.ts.map +1 -0
  185. package/dist/schemas/catalog.js +175 -0
  186. package/dist/schemas/catalog.js.map +1 -0
  187. package/dist/schemas/clickhouse.d.ts +55 -0
  188. package/dist/schemas/clickhouse.d.ts.map +1 -0
  189. package/dist/schemas/clickhouse.js +2 -0
  190. package/dist/schemas/clickhouse.js.map +1 -0
  191. package/dist/schemas/customer.d.ts +84 -0
  192. package/dist/schemas/customer.d.ts.map +1 -0
  193. package/dist/schemas/customer.js +115 -0
  194. package/dist/schemas/customer.js.map +1 -0
  195. package/dist/schemas/database-error.d.ts +29 -0
  196. package/dist/schemas/database-error.d.ts.map +1 -0
  197. package/dist/schemas/database-error.js +28 -0
  198. package/dist/schemas/database-error.js.map +1 -0
  199. package/dist/schemas/draft-core.d.ts +57 -0
  200. package/dist/schemas/draft-core.d.ts.map +1 -0
  201. package/dist/schemas/draft-core.js +41 -0
  202. package/dist/schemas/draft-core.js.map +1 -0
  203. package/dist/schemas/drizzle-helpers.d.ts +30 -0
  204. package/dist/schemas/drizzle-helpers.d.ts.map +1 -0
  205. package/dist/schemas/drizzle-helpers.js +19 -0
  206. package/dist/schemas/drizzle-helpers.js.map +1 -0
  207. package/dist/schemas/exchange-rates.d.ts +77 -0
  208. package/dist/schemas/exchange-rates.d.ts.map +1 -0
  209. package/dist/schemas/exchange-rates.js +71 -0
  210. package/dist/schemas/exchange-rates.js.map +1 -0
  211. package/dist/schemas/gallery.d.ts +84 -0
  212. package/dist/schemas/gallery.d.ts.map +1 -0
  213. package/dist/schemas/gallery.js +54 -0
  214. package/dist/schemas/gallery.js.map +1 -0
  215. package/dist/schemas/index.d.ts +3 -0
  216. package/dist/schemas/index.d.ts.map +1 -0
  217. package/dist/schemas/index.js +3 -0
  218. package/dist/schemas/index.js.map +1 -0
  219. package/dist/schemas/kms/codec.d.ts +6 -0
  220. package/dist/schemas/kms/codec.d.ts.map +1 -0
  221. package/dist/schemas/kms/codec.js +13 -0
  222. package/dist/schemas/kms/codec.js.map +1 -0
  223. package/dist/schemas/kms/envelope.d.ts +7 -0
  224. package/dist/schemas/kms/envelope.d.ts.map +1 -0
  225. package/dist/schemas/kms/envelope.js +8 -0
  226. package/dist/schemas/kms/envelope.js.map +1 -0
  227. package/dist/schemas/kms/index.d.ts +3 -0
  228. package/dist/schemas/kms/index.d.ts.map +1 -0
  229. package/dist/schemas/kms/index.js +3 -0
  230. package/dist/schemas/kms/index.js.map +1 -0
  231. package/dist/schemas/kms/smartbill.d.ts +22 -0
  232. package/dist/schemas/kms/smartbill.d.ts.map +1 -0
  233. package/dist/schemas/kms/smartbill.js +16 -0
  234. package/dist/schemas/kms/smartbill.js.map +1 -0
  235. package/dist/schemas/kv/organization-region.d.ts +11 -0
  236. package/dist/schemas/kv/organization-region.d.ts.map +1 -0
  237. package/dist/schemas/kv/organization-region.js +7 -0
  238. package/dist/schemas/kv/organization-region.js.map +1 -0
  239. package/dist/schemas/notifications.d.ts +161 -0
  240. package/dist/schemas/notifications.d.ts.map +1 -0
  241. package/dist/schemas/notifications.js +69 -0
  242. package/dist/schemas/notifications.js.map +1 -0
  243. package/dist/schemas/onboarding/profile.d.ts +15 -0
  244. package/dist/schemas/onboarding/profile.d.ts.map +1 -0
  245. package/dist/schemas/onboarding/profile.js +9 -0
  246. package/dist/schemas/onboarding/profile.js.map +1 -0
  247. package/dist/schemas/onboarding/selection.d.ts +8 -0
  248. package/dist/schemas/onboarding/selection.d.ts.map +1 -0
  249. package/dist/schemas/onboarding/selection.js +6 -0
  250. package/dist/schemas/onboarding/selection.js.map +1 -0
  251. package/dist/schemas/onboarding/step.d.ts +11 -0
  252. package/dist/schemas/onboarding/step.d.ts.map +1 -0
  253. package/dist/schemas/onboarding/step.js +9 -0
  254. package/dist/schemas/onboarding/step.js.map +1 -0
  255. package/dist/schemas/onboarding/tenant-organization.d.ts +24 -0
  256. package/dist/schemas/onboarding/tenant-organization.d.ts.map +1 -0
  257. package/dist/schemas/onboarding/tenant-organization.js +15 -0
  258. package/dist/schemas/onboarding/tenant-organization.js.map +1 -0
  259. package/dist/schemas/onboarding/tenant-slugs.d.ts +6 -0
  260. package/dist/schemas/onboarding/tenant-slugs.d.ts.map +1 -0
  261. package/dist/schemas/onboarding/tenant-slugs.js +5 -0
  262. package/dist/schemas/onboarding/tenant-slugs.js.map +1 -0
  263. package/dist/schemas/onboarding/wizard.d.ts +17 -0
  264. package/dist/schemas/onboarding/wizard.d.ts.map +1 -0
  265. package/dist/schemas/onboarding/wizard.js +17 -0
  266. package/dist/schemas/onboarding/wizard.js.map +1 -0
  267. package/dist/schemas/payments/payment-session.d.ts +17 -0
  268. package/dist/schemas/payments/payment-session.d.ts.map +1 -0
  269. package/dist/schemas/payments/payment-session.js +13 -0
  270. package/dist/schemas/payments/payment-session.js.map +1 -0
  271. package/dist/schemas/payments/providers/index.d.ts +13 -0
  272. package/dist/schemas/payments/providers/index.d.ts.map +1 -0
  273. package/dist/schemas/payments/providers/index.js +9 -0
  274. package/dist/schemas/payments/providers/index.js.map +1 -0
  275. package/dist/schemas/payments/providers/netopia.d.ts +7 -0
  276. package/dist/schemas/payments/providers/netopia.d.ts.map +1 -0
  277. package/dist/schemas/payments/providers/netopia.js +6 -0
  278. package/dist/schemas/payments/providers/netopia.js.map +1 -0
  279. package/dist/schemas/payments.d.ts +34 -0
  280. package/dist/schemas/payments.d.ts.map +1 -0
  281. package/dist/schemas/payments.js +33 -0
  282. package/dist/schemas/payments.js.map +1 -0
  283. package/dist/schemas/people.d.ts +70 -0
  284. package/dist/schemas/people.d.ts.map +1 -0
  285. package/dist/schemas/people.js +55 -0
  286. package/dist/schemas/people.js.map +1 -0
  287. package/dist/schemas/product-draft.d.ts +493 -0
  288. package/dist/schemas/product-draft.d.ts.map +1 -0
  289. package/dist/schemas/product-draft.js +433 -0
  290. package/dist/schemas/product-draft.js.map +1 -0
  291. package/dist/schemas/product.d.ts +164 -0
  292. package/dist/schemas/product.d.ts.map +1 -0
  293. package/dist/schemas/product.js +100 -0
  294. package/dist/schemas/product.js.map +1 -0
  295. package/dist/schemas/redis-booking-settings.d.ts +85 -0
  296. package/dist/schemas/redis-booking-settings.d.ts.map +1 -0
  297. package/dist/schemas/redis-booking-settings.js +19 -0
  298. package/dist/schemas/redis-booking-settings.js.map +1 -0
  299. package/dist/schemas/redis-booking.shared.d.ts +143 -0
  300. package/dist/schemas/redis-booking.shared.d.ts.map +1 -0
  301. package/dist/schemas/redis-booking.shared.js +57 -0
  302. package/dist/schemas/redis-booking.shared.js.map +1 -0
  303. package/dist/schemas/redis-claim.d.ts +8 -0
  304. package/dist/schemas/redis-claim.d.ts.map +1 -0
  305. package/dist/schemas/redis-claim.js +7 -0
  306. package/dist/schemas/redis-claim.js.map +1 -0
  307. package/dist/schemas/redis-product.d.ts +61 -0
  308. package/dist/schemas/redis-product.d.ts.map +1 -0
  309. package/dist/schemas/redis-product.js +40 -0
  310. package/dist/schemas/redis-product.js.map +1 -0
  311. package/dist/schemas/segments.d.ts +199 -0
  312. package/dist/schemas/segments.d.ts.map +1 -0
  313. package/dist/schemas/segments.js +204 -0
  314. package/dist/schemas/segments.js.map +1 -0
  315. package/dist/schemas/settings/localization.d.ts +15 -0
  316. package/dist/schemas/settings/localization.d.ts.map +1 -0
  317. package/dist/schemas/settings/localization.js +8 -0
  318. package/dist/schemas/settings/localization.js.map +1 -0
  319. package/dist/schemas/settings.d.ts +547 -0
  320. package/dist/schemas/settings.d.ts.map +1 -0
  321. package/dist/schemas/settings.js +328 -0
  322. package/dist/schemas/settings.js.map +1 -0
  323. package/dist/schemas/tenant.d.ts +46 -0
  324. package/dist/schemas/tenant.d.ts.map +1 -0
  325. package/dist/schemas/tenant.js +34 -0
  326. package/dist/schemas/tenant.js.map +1 -0
  327. package/dist/schemas/tenants/members.d.ts +26 -0
  328. package/dist/schemas/tenants/members.d.ts.map +1 -0
  329. package/dist/schemas/tenants/members.js +16 -0
  330. package/dist/schemas/tenants/members.js.map +1 -0
  331. package/dist/schemas/tenants/subscriptions.d.ts +34 -0
  332. package/dist/schemas/tenants/subscriptions.d.ts.map +1 -0
  333. package/dist/schemas/tenants/subscriptions.js +17 -0
  334. package/dist/schemas/tenants/subscriptions.js.map +1 -0
  335. package/dist/travel-products/accommodation.d.ts +406 -0
  336. package/dist/travel-products/accommodation.d.ts.map +1 -0
  337. package/dist/travel-products/accommodation.js +242 -0
  338. package/dist/travel-products/accommodation.js.map +1 -0
  339. package/dist/travel-products/departure.d.ts +671 -0
  340. package/dist/travel-products/departure.d.ts.map +1 -0
  341. package/dist/travel-products/departure.js +214 -0
  342. package/dist/travel-products/departure.js.map +1 -0
  343. package/dist/travel-products/index.d.ts +8 -0
  344. package/dist/travel-products/index.d.ts.map +1 -0
  345. package/dist/travel-products/index.js +15 -0
  346. package/dist/travel-products/index.js.map +1 -0
  347. package/dist/travel-products/inventory.d.ts +378 -0
  348. package/dist/travel-products/inventory.d.ts.map +1 -0
  349. package/dist/travel-products/inventory.js +185 -0
  350. package/dist/travel-products/inventory.js.map +1 -0
  351. package/dist/travel-products/itinerary.d.ts +1422 -0
  352. package/dist/travel-products/itinerary.d.ts.map +1 -0
  353. package/dist/travel-products/itinerary.js +174 -0
  354. package/dist/travel-products/itinerary.js.map +1 -0
  355. package/dist/travel-products/policy.d.ts +860 -0
  356. package/dist/travel-products/policy.d.ts.map +1 -0
  357. package/dist/travel-products/policy.js +361 -0
  358. package/dist/travel-products/policy.js.map +1 -0
  359. package/dist/travel-products/pricing.d.ts +270 -0
  360. package/dist/travel-products/pricing.d.ts.map +1 -0
  361. package/dist/travel-products/pricing.js +185 -0
  362. package/dist/travel-products/pricing.js.map +1 -0
  363. package/dist/travel-products/product.d.ts +1614 -0
  364. package/dist/travel-products/product.d.ts.map +1 -0
  365. package/dist/travel-products/product.js +210 -0
  366. package/dist/travel-products/product.js.map +1 -0
  367. package/dist/trigger/billing-create-invoice.d.ts +8 -0
  368. package/dist/trigger/billing-create-invoice.d.ts.map +1 -0
  369. package/dist/trigger/billing-create-invoice.js +8 -0
  370. package/dist/trigger/billing-create-invoice.js.map +1 -0
  371. package/dist/trigger/billing-create-proforma.d.ts +6 -0
  372. package/dist/trigger/billing-create-proforma.d.ts.map +1 -0
  373. package/dist/trigger/billing-create-proforma.js +5 -0
  374. package/dist/trigger/billing-create-proforma.js.map +1 -0
  375. package/dist/trigger/billing.d.ts +11 -0
  376. package/dist/trigger/billing.d.ts.map +1 -0
  377. package/dist/trigger/billing.js +12 -0
  378. package/dist/trigger/billing.js.map +1 -0
  379. package/dist/trigger/campaigns.d.ts +39 -0
  380. package/dist/trigger/campaigns.d.ts.map +1 -0
  381. package/dist/trigger/campaigns.js +36 -0
  382. package/dist/trigger/campaigns.js.map +1 -0
  383. package/dist/trigger/cms.d.ts +19 -0
  384. package/dist/trigger/cms.d.ts.map +1 -0
  385. package/dist/trigger/cms.js +13 -0
  386. package/dist/trigger/cms.js.map +1 -0
  387. package/dist/trigger/comms-resend-domain.d.ts +6 -0
  388. package/dist/trigger/comms-resend-domain.d.ts.map +1 -0
  389. package/dist/trigger/comms-resend-domain.js +5 -0
  390. package/dist/trigger/comms-resend-domain.js.map +1 -0
  391. package/dist/trigger/iam.d.ts +2 -0
  392. package/dist/trigger/iam.d.ts.map +1 -0
  393. package/dist/trigger/iam.js +2 -0
  394. package/dist/trigger/iam.js.map +1 -0
  395. package/dist/trigger/marketplace-access.d.ts +7 -0
  396. package/dist/trigger/marketplace-access.d.ts.map +1 -0
  397. package/dist/trigger/marketplace-access.js +6 -0
  398. package/dist/trigger/marketplace-access.js.map +1 -0
  399. package/dist/trigger/marketplace.d.ts +7 -0
  400. package/dist/trigger/marketplace.d.ts.map +1 -0
  401. package/dist/trigger/marketplace.js +6 -0
  402. package/dist/trigger/marketplace.js.map +1 -0
  403. package/dist/trigger/payment-success.d.ts +19 -0
  404. package/dist/trigger/payment-success.d.ts.map +1 -0
  405. package/dist/trigger/payment-success.js +19 -0
  406. package/dist/trigger/payment-success.js.map +1 -0
  407. package/dist/trigger/rag-delete.d.ts +14 -0
  408. package/dist/trigger/rag-delete.d.ts.map +1 -0
  409. package/dist/trigger/rag-delete.js +6 -0
  410. package/dist/trigger/rag-delete.js.map +1 -0
  411. package/dist/trigger/rag-upsert-contract.d.ts +6 -0
  412. package/dist/trigger/rag-upsert-contract.d.ts.map +1 -0
  413. package/dist/trigger/rag-upsert-contract.js +5 -0
  414. package/dist/trigger/rag-upsert-contract.js.map +1 -0
  415. package/dist/trigger/rag.d.ts +12 -0
  416. package/dist/trigger/rag.d.ts.map +1 -0
  417. package/dist/trigger/rag.js +12 -0
  418. package/dist/trigger/rag.js.map +1 -0
  419. package/dist/trigger/search-index-product.d.ts +69 -0
  420. package/dist/trigger/search-index-product.d.ts.map +1 -0
  421. package/dist/trigger/search-index-product.js +40 -0
  422. package/dist/trigger/search-index-product.js.map +1 -0
  423. package/dist/trigger/send-sms.d.ts +8 -0
  424. package/dist/trigger/send-sms.d.ts.map +1 -0
  425. package/dist/trigger/send-sms.js +7 -0
  426. package/dist/trigger/send-sms.js.map +1 -0
  427. package/package.json +50 -0
package/LICENSE ADDED
@@ -0,0 +1,109 @@
1
+ # Functional Source License, Version 1.1, Apache 2.0 Future License
2
+
3
+ ## Abbreviation
4
+
5
+ FSL-1.1-Apache-2.0
6
+
7
+ ## Notice
8
+
9
+ Copyright 2026 PixelMakers Studio SRL
10
+
11
+ ## Terms and Conditions
12
+
13
+ ### Licensor ("We")
14
+
15
+ The party offering the Software under these Terms and Conditions.
16
+
17
+ ### The Software
18
+
19
+ The "Software" is each version of the software that we make available under
20
+ these Terms and Conditions, as indicated by our inclusion of these Terms and
21
+ Conditions with the Software.
22
+
23
+ ### License Grant
24
+
25
+ Subject to your compliance with this License Grant and the Patents,
26
+ Redistribution and Trademark clauses below, we hereby grant you the right to
27
+ use, copy, modify, create derivative works, publicly perform, publicly
28
+ display and redistribute the Software for any Permitted Purpose identified
29
+ below.
30
+
31
+ ### Permitted Purpose
32
+
33
+ A Permitted Purpose is any purpose other than a Competing Use. A Competing
34
+ Use means making the Software available to others in a commercial product or
35
+ service that:
36
+
37
+ 1. substitutes for the Software;
38
+
39
+ 2. substitutes for any other product or service we offer using the Software
40
+ that exists as of the date we make the Software available; or
41
+
42
+ 3. offers the same or substantially similar functionality as the Software.
43
+
44
+ Permitted Purposes specifically include using the Software:
45
+
46
+ 1. for your internal use and access;
47
+
48
+ 2. for non-commercial education;
49
+
50
+ 3. for non-commercial research; and
51
+
52
+ 4. in connection with professional services that you provide to a licensee
53
+ using the Software in accordance with these Terms and Conditions.
54
+
55
+ ### Patents
56
+
57
+ To the extent your use for a Permitted Purpose would necessarily infringe
58
+ our patents, the license grant above includes a license under our patents.
59
+ If you make a claim against any party that the Software infringes or
60
+ contributes to the infringement of any patent, then your patent license to
61
+ the Software ends immediately.
62
+
63
+ ### Redistribution
64
+
65
+ The Terms and Conditions apply to all copies, modifications and derivatives
66
+ of the Software.
67
+
68
+ If you redistribute any copies, modifications or derivatives of the
69
+ Software, you must include a copy of or a link to these Terms and Conditions
70
+ and not remove any copyright notices provided in or with the Software.
71
+
72
+ ### Disclaimer
73
+
74
+ THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTIES OF ANY KIND, EXPRESS
75
+ OR IMPLIED, INCLUDING WITHOUT LIMITATION WARRANTIES OF FITNESS FOR A
76
+ PARTICULAR PURPOSE, MERCHANTABILITY, TITLE OR NON-INFRINGEMENT.
77
+
78
+ IN NO EVENT WILL WE HAVE ANY LIABILITY TO YOU ARISING OUT OF OR RELATED TO
79
+ THE SOFTWARE, INCLUDING INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL
80
+ DAMAGES, EVEN IF WE HAVE BEEN INFORMED OF THEIR POSSIBILITY IN ADVANCE.
81
+
82
+ ### Trademarks
83
+
84
+ Except for displaying the License Details and identifying us as the origin
85
+ of the Software, you have no right under these Terms and Conditions to use
86
+ our trademarks, trade names, service marks or product names.
87
+
88
+ ---
89
+
90
+ ## Grant of Future License
91
+
92
+ We hereby irrevocably grant you an additional license to use the Software
93
+ under the Apache License, Version 2.0 that is effective on the second
94
+ anniversary of the date we make the Software available. On or after that
95
+ date, you may use the Software under the Apache License, Version 2.0, in
96
+ which case the following will apply:
97
+
98
+ Licensed under the Apache License, Version 2.0 (the "License"); you may not
99
+ use this file except in compliance with the License.
100
+
101
+ You may obtain a copy of the License at
102
+
103
+ http://www.apache.org/licenses/LICENSE-2.0
104
+
105
+ Unless required by applicable law or agreed to in writing, software
106
+ distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
107
+ WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
108
+ License for the specific language governing permissions and limitations
109
+ under the License.
package/README.md ADDED
@@ -0,0 +1,28 @@
1
+ # @voyantjs/types
2
+
3
+ Shared TypeScript types and Zod schemas for Voyant. Cross-package contracts that don't belong to any single domain module.
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ pnpm add @voyantjs/types
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ ```typescript
14
+ import type { ApiKey } from "@voyantjs/types/api-keys"
15
+ import { apiErrorSchema } from "@voyantjs/types/schemas/api-error"
16
+ ```
17
+
18
+ ## Exports
19
+
20
+ | Entry | Description |
21
+ | --- | --- |
22
+ | `.` | Barrel re-exports |
23
+ | `./api-keys` | API key types + envelope |
24
+ | `./schemas/*` | Individual Zod schemas (API error, KMS codec/envelope, etc.) |
25
+
26
+ ## License
27
+
28
+ FSL-1.1-Apache-2.0
package/dist/ai.d.ts ADDED
@@ -0,0 +1,38 @@
1
+ export type EntityType = "product" | "collection" | "tag" | "contract" | "booking" | "contact";
2
+ export type Channel = "in_app" | "website" | "whatsapp" | "messenger" | "instagram";
3
+ export interface ContextChunk<TMetadata extends Record<string, unknown> = Record<string, unknown>> {
4
+ id: string;
5
+ text: string;
6
+ score?: number;
7
+ metadata: TMetadata & {
8
+ type?: EntityType;
9
+ source?: string;
10
+ sourceId?: string | number;
11
+ locale?: string;
12
+ visibility?: string;
13
+ updatedAt?: string | number | Date;
14
+ };
15
+ }
16
+ export interface Citation {
17
+ id: string;
18
+ label: string;
19
+ sourceRef?: string;
20
+ preview?: string;
21
+ score?: number;
22
+ }
23
+ export interface RetrieverOptions {
24
+ query: string;
25
+ types?: Array<EntityType>;
26
+ topK?: number;
27
+ locale?: string;
28
+ }
29
+ export interface EmbedOptionsMany {
30
+ values: string[];
31
+ model?: string;
32
+ }
33
+ export interface EmbedOptionsOne {
34
+ value: string;
35
+ model?: string;
36
+ }
37
+ export type EmbedOptions = EmbedOptionsOne | EmbedOptionsMany;
38
+ //# sourceMappingURL=ai.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ai.d.ts","sourceRoot":"","sources":["../src/ai.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,YAAY,GAAG,KAAK,GAAG,UAAU,GAAG,SAAS,GAAG,SAAS,CAAA;AAE9F,MAAM,MAAM,OAAO,GAAG,QAAQ,GAAG,SAAS,GAAG,UAAU,GAAG,WAAW,GAAG,WAAW,CAAA;AAEnF,MAAM,WAAW,YAAY,CAAC,SAAS,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAC/F,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,QAAQ,EAAE,SAAS,GAAG;QACpB,IAAI,CAAC,EAAE,UAAU,CAAA;QACjB,MAAM,CAAC,EAAE,MAAM,CAAA;QACf,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;QAC1B,MAAM,CAAC,EAAE,MAAM,CAAA;QACf,UAAU,CAAC,EAAE,MAAM,CAAA;QACnB,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAA;KACnC,CAAA;CACF;AAED,MAAM,WAAW,QAAQ;IACvB,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,MAAM,CAAA;IACb,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,CAAA;IACzB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAED,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,MAAM,EAAE,CAAA;IAChB,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED,MAAM,MAAM,YAAY,GAAG,eAAe,GAAG,gBAAgB,CAAA"}
package/dist/ai.js ADDED
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=ai.js.map
package/dist/ai.js.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ai.js","sourceRoot":"","sources":["../src/ai.ts"],"names":[],"mappings":""}
@@ -0,0 +1,206 @@
1
+ import { z } from "zod";
2
+ /**
3
+ * API Key Scope Definitions
4
+ *
5
+ * Following resource:action pattern similar to Stripe/Shopify
6
+ * Format: "{resource}:{action}" or wildcards
7
+ */
8
+ export declare const API_KEY_RESOURCES: readonly ["operators", "connections", "oauth-clients", "products", "availability", "bookings", "suppliers", "grants", "audit-logs"];
9
+ export type ApiKeyResource = (typeof API_KEY_RESOURCES)[number];
10
+ export declare const API_KEY_ACTIONS: readonly ["read", "write", "delete"];
11
+ export type ApiKeyAction = (typeof API_KEY_ACTIONS)[number];
12
+ /**
13
+ * Valid scope patterns:
14
+ * - Specific: "operators:read", "connections:write"
15
+ * - Resource wildcard: "operators:*" (all actions on operators)
16
+ * - Action wildcard: "*:read" (read all resources)
17
+ * - Full wildcard: "*" (all resources, all actions)
18
+ */
19
+ export declare const VALID_SCOPES: readonly ["operators:read", "operators:write", "operators:delete", "operators:*", "connections:read", "connections:write", "connections:delete", "connections:*", "oauth-clients:read", "oauth-clients:write", "oauth-clients:delete", "oauth-clients:*", "products:read", "products:*", "availability:read", "availability:*", "bookings:read", "bookings:write", "bookings:delete", "bookings:*", "suppliers:read", "suppliers:*", "grants:read", "grants:write", "grants:delete", "grants:*", "audit-logs:read", "audit-logs:*", "*:read", "*:write", "*:delete", "*"];
20
+ export type ApiKeyScope = (typeof VALID_SCOPES)[number];
21
+ export declare const apiKeyScopeSchema: z.ZodEnum<{
22
+ "operators:read": "operators:read";
23
+ "operators:write": "operators:write";
24
+ "operators:delete": "operators:delete";
25
+ "operators:*": "operators:*";
26
+ "connections:read": "connections:read";
27
+ "connections:write": "connections:write";
28
+ "connections:delete": "connections:delete";
29
+ "connections:*": "connections:*";
30
+ "oauth-clients:read": "oauth-clients:read";
31
+ "oauth-clients:write": "oauth-clients:write";
32
+ "oauth-clients:delete": "oauth-clients:delete";
33
+ "oauth-clients:*": "oauth-clients:*";
34
+ "products:read": "products:read";
35
+ "products:*": "products:*";
36
+ "availability:read": "availability:read";
37
+ "availability:*": "availability:*";
38
+ "bookings:read": "bookings:read";
39
+ "bookings:write": "bookings:write";
40
+ "bookings:delete": "bookings:delete";
41
+ "bookings:*": "bookings:*";
42
+ "suppliers:read": "suppliers:read";
43
+ "suppliers:*": "suppliers:*";
44
+ "grants:read": "grants:read";
45
+ "grants:write": "grants:write";
46
+ "grants:delete": "grants:delete";
47
+ "grants:*": "grants:*";
48
+ "audit-logs:read": "audit-logs:read";
49
+ "audit-logs:*": "audit-logs:*";
50
+ "*:read": "*:read";
51
+ "*:write": "*:write";
52
+ "*:delete": "*:delete";
53
+ "*": "*";
54
+ }>;
55
+ export declare const apiKeyScopesSchema: z.ZodDefault<z.ZodArray<z.ZodEnum<{
56
+ "operators:read": "operators:read";
57
+ "operators:write": "operators:write";
58
+ "operators:delete": "operators:delete";
59
+ "operators:*": "operators:*";
60
+ "connections:read": "connections:read";
61
+ "connections:write": "connections:write";
62
+ "connections:delete": "connections:delete";
63
+ "connections:*": "connections:*";
64
+ "oauth-clients:read": "oauth-clients:read";
65
+ "oauth-clients:write": "oauth-clients:write";
66
+ "oauth-clients:delete": "oauth-clients:delete";
67
+ "oauth-clients:*": "oauth-clients:*";
68
+ "products:read": "products:read";
69
+ "products:*": "products:*";
70
+ "availability:read": "availability:read";
71
+ "availability:*": "availability:*";
72
+ "bookings:read": "bookings:read";
73
+ "bookings:write": "bookings:write";
74
+ "bookings:delete": "bookings:delete";
75
+ "bookings:*": "bookings:*";
76
+ "suppliers:read": "suppliers:read";
77
+ "suppliers:*": "suppliers:*";
78
+ "grants:read": "grants:read";
79
+ "grants:write": "grants:write";
80
+ "grants:delete": "grants:delete";
81
+ "grants:*": "grants:*";
82
+ "audit-logs:read": "audit-logs:read";
83
+ "audit-logs:*": "audit-logs:*";
84
+ "*:read": "*:read";
85
+ "*:write": "*:write";
86
+ "*:delete": "*:delete";
87
+ "*": "*";
88
+ }>>>;
89
+ /**
90
+ * Scope groups for UI display
91
+ * Grouped by resource for nested checkbox UX
92
+ */
93
+ export declare const SCOPE_GROUPS: {
94
+ readonly operators: {
95
+ readonly label: "Operators";
96
+ readonly description: "Manage operator registrations and configuration";
97
+ readonly scopes: readonly ["operators:read", "operators:write", "operators:delete"];
98
+ };
99
+ readonly connections: {
100
+ readonly label: "Connections";
101
+ readonly description: "Manage supplier connections and credentials";
102
+ readonly scopes: readonly ["connections:read", "connections:write", "connections:delete"];
103
+ };
104
+ readonly "oauth-clients": {
105
+ readonly label: "OAuth Clients";
106
+ readonly description: "Manage OAuth client credentials for M2M access";
107
+ readonly scopes: readonly ["oauth-clients:read", "oauth-clients:write", "oauth-clients:delete"];
108
+ };
109
+ readonly products: {
110
+ readonly label: "Products";
111
+ readonly description: "Query supplier product catalogs via OCTO";
112
+ readonly scopes: readonly ["products:read"];
113
+ };
114
+ readonly availability: {
115
+ readonly label: "Availability";
116
+ readonly description: "Query supplier availability via OCTO";
117
+ readonly scopes: readonly ["availability:read"];
118
+ };
119
+ readonly bookings: {
120
+ readonly label: "Bookings";
121
+ readonly description: "Create, confirm, and cancel bookings via OCTO";
122
+ readonly scopes: readonly ["bookings:read", "bookings:write", "bookings:delete"];
123
+ };
124
+ readonly suppliers: {
125
+ readonly label: "Suppliers";
126
+ readonly description: "Query supplier information via OCTO";
127
+ readonly scopes: readonly ["suppliers:read"];
128
+ };
129
+ readonly grants: {
130
+ readonly label: "Grants";
131
+ readonly description: "Manage cross-organization operator access grants";
132
+ readonly scopes: readonly ["grants:read", "grants:write", "grants:delete"];
133
+ };
134
+ readonly "audit-logs": {
135
+ readonly label: "Audit Logs";
136
+ readonly description: "Query API audit logs for your organization";
137
+ readonly scopes: readonly ["audit-logs:read"];
138
+ };
139
+ };
140
+ export type ScopeGroupKey = keyof typeof SCOPE_GROUPS;
141
+ /**
142
+ * Predefined scope templates for quick setup
143
+ */
144
+ interface ScopeTemplate {
145
+ name: string;
146
+ description: string;
147
+ scopes: ApiKeyScope[];
148
+ }
149
+ export declare const SCOPE_TEMPLATES: Record<string, ScopeTemplate>;
150
+ export type ScopeTemplateKey = "read-only" | "full-access" | "operator-admin" | "reseller";
151
+ /**
152
+ * Expiration presets for key creation
153
+ */
154
+ export declare const EXPIRATION_PRESETS: {
155
+ readonly never: {
156
+ readonly label: "Never";
157
+ readonly days: null;
158
+ };
159
+ readonly "7days": {
160
+ readonly label: "7 days";
161
+ readonly days: 7;
162
+ };
163
+ readonly "30days": {
164
+ readonly label: "30 days";
165
+ readonly days: 30;
166
+ };
167
+ readonly "90days": {
168
+ readonly label: "90 days";
169
+ readonly days: 90;
170
+ };
171
+ readonly "180days": {
172
+ readonly label: "6 months";
173
+ readonly days: 180;
174
+ };
175
+ readonly "365days": {
176
+ readonly label: "1 year";
177
+ readonly days: 365;
178
+ };
179
+ readonly custom: {
180
+ readonly label: "Custom date";
181
+ readonly days: null;
182
+ };
183
+ };
184
+ export type ExpirationPresetKey = keyof typeof EXPIRATION_PRESETS;
185
+ /**
186
+ * Helper functions for scope validation
187
+ */
188
+ /**
189
+ * Check if a scope pattern matches a required scope
190
+ * Handles wildcards: "operators:*", "*:read", "*"
191
+ */
192
+ export declare function scopeMatches(userScope: string, requiredScope: string): boolean;
193
+ /**
194
+ * Check if user has all required scopes
195
+ */
196
+ export declare function hasScopes(userScopes: string[], requiredScopes: string[]): boolean;
197
+ /**
198
+ * Get human-readable description of scopes
199
+ */
200
+ export declare function describescopes(scopes: string[]): string;
201
+ /**
202
+ * Calculate expiration date from preset
203
+ */
204
+ export declare function calculateExpirationDate(preset: ExpirationPresetKey, customDate?: Date): Date | null;
205
+ export {};
206
+ //# sourceMappingURL=api-keys.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api-keys.d.ts","sourceRoot":"","sources":["../src/api-keys.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB;;;;;GAKG;AAGH,eAAO,MAAM,iBAAiB,qIAUpB,CAAA;AAEV,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,iBAAiB,CAAC,CAAC,MAAM,CAAC,CAAA;AAG/D,eAAO,MAAM,eAAe,sCAAuC,CAAA;AAEnE,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,CAAC,CAAA;AAE3D;;;;;;GAMG;AACH,eAAO,MAAM,YAAY,2iBAoDf,CAAA;AAEV,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,CAAC,CAAA;AAGvD,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAuB,CAAA;AAErD,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAAyC,CAAA;AAExE;;;GAGG;AACH,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8Cf,CAAA;AAEV,MAAM,MAAM,aAAa,GAAG,MAAM,OAAO,YAAY,CAAA;AAErD;;GAEG;AACH,UAAU,aAAa;IACrB,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,EAAE,MAAM,CAAA;IACnB,MAAM,EAAE,WAAW,EAAE,CAAA;CACtB;AAED,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CA4BzD,CAAA;AAED,MAAM,MAAM,gBAAgB,GAAG,WAAW,GAAG,aAAa,GAAG,gBAAgB,GAAG,UAAU,CAAA;AAE1F;;GAEG;AACH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6BrB,CAAA;AAEV,MAAM,MAAM,mBAAmB,GAAG,MAAM,OAAO,kBAAkB,CAAA;AAEjE;;GAEG;AAEH;;;GAGG;AACH,wBAAgB,YAAY,CAAC,SAAS,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,GAAG,OAAO,CAiB9E;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,UAAU,EAAE,MAAM,EAAE,EAAE,cAAc,EAAE,MAAM,EAAE,GAAG,OAAO,CAIjF;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,CAuBvD;AAED;;GAEG;AACH,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,mBAAmB,EAC3B,UAAU,CAAC,EAAE,IAAI,GAChB,IAAI,GAAG,IAAI,CAUb"}
@@ -0,0 +1,258 @@
1
+ import { z } from "zod";
2
+ /**
3
+ * API Key Scope Definitions
4
+ *
5
+ * Following resource:action pattern similar to Stripe/Shopify
6
+ * Format: "{resource}:{action}" or wildcards
7
+ */
8
+ // Resource types
9
+ export const API_KEY_RESOURCES = [
10
+ "operators",
11
+ "connections",
12
+ "oauth-clients",
13
+ "products",
14
+ "availability",
15
+ "bookings",
16
+ "suppliers",
17
+ "grants",
18
+ "audit-logs",
19
+ ];
20
+ // Action types
21
+ export const API_KEY_ACTIONS = ["read", "write", "delete"];
22
+ /**
23
+ * Valid scope patterns:
24
+ * - Specific: "operators:read", "connections:write"
25
+ * - Resource wildcard: "operators:*" (all actions on operators)
26
+ * - Action wildcard: "*:read" (read all resources)
27
+ * - Full wildcard: "*" (all resources, all actions)
28
+ */
29
+ export const VALID_SCOPES = [
30
+ // Operators
31
+ "operators:read",
32
+ "operators:write",
33
+ "operators:delete",
34
+ "operators:*",
35
+ // Connections
36
+ "connections:read",
37
+ "connections:write",
38
+ "connections:delete",
39
+ "connections:*",
40
+ // OAuth Clients
41
+ "oauth-clients:read",
42
+ "oauth-clients:write",
43
+ "oauth-clients:delete",
44
+ "oauth-clients:*",
45
+ // Products
46
+ "products:read",
47
+ "products:*",
48
+ // Availability
49
+ "availability:read",
50
+ "availability:*",
51
+ // Bookings
52
+ "bookings:read",
53
+ "bookings:write",
54
+ "bookings:delete",
55
+ "bookings:*",
56
+ // Suppliers
57
+ "suppliers:read",
58
+ "suppliers:*",
59
+ // Grants
60
+ "grants:read",
61
+ "grants:write",
62
+ "grants:delete",
63
+ "grants:*",
64
+ // Audit Logs
65
+ "audit-logs:read",
66
+ "audit-logs:*",
67
+ // Wildcard patterns
68
+ "*:read", // Read-only access to all resources
69
+ "*:write", // Write access to all resources
70
+ "*:delete", // Delete access to all resources
71
+ "*", // Full access (God mode)
72
+ ];
73
+ // Zod schema for scope validation
74
+ export const apiKeyScopeSchema = z.enum(VALID_SCOPES);
75
+ export const apiKeyScopesSchema = z.array(apiKeyScopeSchema).default([]);
76
+ /**
77
+ * Scope groups for UI display
78
+ * Grouped by resource for nested checkbox UX
79
+ */
80
+ export const SCOPE_GROUPS = {
81
+ operators: {
82
+ label: "Operators",
83
+ description: "Manage operator registrations and configuration",
84
+ scopes: ["operators:read", "operators:write", "operators:delete"],
85
+ },
86
+ connections: {
87
+ label: "Connections",
88
+ description: "Manage supplier connections and credentials",
89
+ scopes: ["connections:read", "connections:write", "connections:delete"],
90
+ },
91
+ "oauth-clients": {
92
+ label: "OAuth Clients",
93
+ description: "Manage OAuth client credentials for M2M access",
94
+ scopes: ["oauth-clients:read", "oauth-clients:write", "oauth-clients:delete"],
95
+ },
96
+ products: {
97
+ label: "Products",
98
+ description: "Query supplier product catalogs via OCTO",
99
+ scopes: ["products:read"],
100
+ },
101
+ availability: {
102
+ label: "Availability",
103
+ description: "Query supplier availability via OCTO",
104
+ scopes: ["availability:read"],
105
+ },
106
+ bookings: {
107
+ label: "Bookings",
108
+ description: "Create, confirm, and cancel bookings via OCTO",
109
+ scopes: ["bookings:read", "bookings:write", "bookings:delete"],
110
+ },
111
+ suppliers: {
112
+ label: "Suppliers",
113
+ description: "Query supplier information via OCTO",
114
+ scopes: ["suppliers:read"],
115
+ },
116
+ grants: {
117
+ label: "Grants",
118
+ description: "Manage cross-organization operator access grants",
119
+ scopes: ["grants:read", "grants:write", "grants:delete"],
120
+ },
121
+ "audit-logs": {
122
+ label: "Audit Logs",
123
+ description: "Query API audit logs for your organization",
124
+ scopes: ["audit-logs:read"],
125
+ },
126
+ };
127
+ export const SCOPE_TEMPLATES = {
128
+ "read-only": {
129
+ name: "Read Only",
130
+ description: "Read-only access to all resources",
131
+ scopes: ["*:read"],
132
+ },
133
+ "full-access": {
134
+ name: "Full Access",
135
+ description: "Complete access to all resources and actions",
136
+ scopes: ["*"],
137
+ },
138
+ "operator-admin": {
139
+ name: "Operator Admin",
140
+ description: "Full operator and connection management",
141
+ scopes: ["operators:*", "connections:*", "oauth-clients:*"],
142
+ },
143
+ reseller: {
144
+ name: "OCTO Reseller",
145
+ description: "Full data-plane access for resellers",
146
+ scopes: [
147
+ "products:read",
148
+ "availability:read",
149
+ "bookings:read",
150
+ "bookings:write",
151
+ "bookings:delete",
152
+ "suppliers:read",
153
+ ],
154
+ },
155
+ };
156
+ /**
157
+ * Expiration presets for key creation
158
+ */
159
+ export const EXPIRATION_PRESETS = {
160
+ never: {
161
+ label: "Never",
162
+ days: null,
163
+ },
164
+ "7days": {
165
+ label: "7 days",
166
+ days: 7,
167
+ },
168
+ "30days": {
169
+ label: "30 days",
170
+ days: 30,
171
+ },
172
+ "90days": {
173
+ label: "90 days",
174
+ days: 90,
175
+ },
176
+ "180days": {
177
+ label: "6 months",
178
+ days: 180,
179
+ },
180
+ "365days": {
181
+ label: "1 year",
182
+ days: 365,
183
+ },
184
+ custom: {
185
+ label: "Custom date",
186
+ days: null,
187
+ },
188
+ };
189
+ /**
190
+ * Helper functions for scope validation
191
+ */
192
+ /**
193
+ * Check if a scope pattern matches a required scope
194
+ * Handles wildcards: "operators:*", "*:read", "*"
195
+ */
196
+ export function scopeMatches(userScope, requiredScope) {
197
+ // Full wildcard
198
+ if (userScope === "*")
199
+ return true;
200
+ // Exact match
201
+ if (userScope === requiredScope)
202
+ return true;
203
+ const [userResource, userAction] = userScope.split(":");
204
+ const [reqResource, reqAction] = requiredScope.split(":");
205
+ // Resource wildcard (e.g., "operators:*" matches "operators:read")
206
+ if (userResource === reqResource && userAction === "*")
207
+ return true;
208
+ // Action wildcard (e.g., "*:read" matches "operators:read")
209
+ if (userResource === "*" && userAction === reqAction)
210
+ return true;
211
+ return false;
212
+ }
213
+ /**
214
+ * Check if user has all required scopes
215
+ */
216
+ export function hasScopes(userScopes, requiredScopes) {
217
+ return requiredScopes.every((required) => userScopes.some((userScope) => scopeMatches(userScope, required)));
218
+ }
219
+ /**
220
+ * Get human-readable description of scopes
221
+ */
222
+ export function describescopes(scopes) {
223
+ if (scopes.includes("*")) {
224
+ return "Full access to all resources";
225
+ }
226
+ if (scopes.includes("*:read") && scopes.length === 1) {
227
+ return "Read-only access to all resources";
228
+ }
229
+ const resources = new Set();
230
+ const actions = new Set();
231
+ for (const scope of scopes) {
232
+ const [resource, action] = scope.split(":");
233
+ if (resource && resource !== "*")
234
+ resources.add(resource);
235
+ if (action && action !== "*")
236
+ actions.add(action);
237
+ }
238
+ if (resources.size === 0) {
239
+ return `${actions.size} permission${actions.size > 1 ? "s" : ""}`;
240
+ }
241
+ return `${resources.size} resource${resources.size > 1 ? "s" : ""}`;
242
+ }
243
+ /**
244
+ * Calculate expiration date from preset
245
+ */
246
+ export function calculateExpirationDate(preset, customDate) {
247
+ if (preset === "never")
248
+ return null;
249
+ if (preset === "custom")
250
+ return customDate || null;
251
+ const config = EXPIRATION_PRESETS[preset];
252
+ if (!config.days)
253
+ return null;
254
+ const expiresAt = new Date();
255
+ expiresAt.setDate(expiresAt.getDate() + config.days);
256
+ return expiresAt;
257
+ }
258
+ //# sourceMappingURL=api-keys.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api-keys.js","sourceRoot":"","sources":["../src/api-keys.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB;;;;;GAKG;AAEH,iBAAiB;AACjB,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,WAAW;IACX,aAAa;IACb,eAAe;IACf,UAAU;IACV,cAAc;IACd,UAAU;IACV,WAAW;IACX,QAAQ;IACR,YAAY;CACJ,CAAA;AAIV,eAAe;AACf,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,MAAM,EAAE,OAAO,EAAE,QAAQ,CAAU,CAAA;AAInE;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,YAAY;IACZ,gBAAgB;IAChB,iBAAiB;IACjB,kBAAkB;IAClB,aAAa;IAEb,cAAc;IACd,kBAAkB;IAClB,mBAAmB;IACnB,oBAAoB;IACpB,eAAe;IAEf,gBAAgB;IAChB,oBAAoB;IACpB,qBAAqB;IACrB,sBAAsB;IACtB,iBAAiB;IAEjB,WAAW;IACX,eAAe;IACf,YAAY;IAEZ,eAAe;IACf,mBAAmB;IACnB,gBAAgB;IAEhB,WAAW;IACX,eAAe;IACf,gBAAgB;IAChB,iBAAiB;IACjB,YAAY;IAEZ,YAAY;IACZ,gBAAgB;IAChB,aAAa;IAEb,SAAS;IACT,aAAa;IACb,cAAc;IACd,eAAe;IACf,UAAU;IAEV,aAAa;IACb,iBAAiB;IACjB,cAAc;IAEd,oBAAoB;IACpB,QAAQ,EAAE,oCAAoC;IAC9C,SAAS,EAAE,gCAAgC;IAC3C,UAAU,EAAE,iCAAiC;IAC7C,GAAG,EAAE,yBAAyB;CACtB,CAAA;AAIV,kCAAkC;AAClC,MAAM,CAA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