@croct/sdk 0.17.7 → 0.17.8

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 (409) hide show
  1. package/activeRecord.cjs.map +1 -0
  2. package/activeRecord.d.ts +8 -4
  3. package/activeRecord.js +115 -106
  4. package/activeRecord.js.map +1 -1
  5. package/apiKey.cjs.map +1 -0
  6. package/apiKey.d.ts +4 -2
  7. package/apiKey.js +152 -141
  8. package/apiKey.js.map +1 -1
  9. package/base64Url.cjs.map +1 -0
  10. package/base64Url.d.ts +4 -2
  11. package/base64Url.js +8 -15
  12. package/base64Url.js.map +1 -1
  13. package/cache/cache.cjs.map +1 -0
  14. package/cache/cache.d.ts +6 -4
  15. package/cache/cache.js +9 -10
  16. package/cache/cache.js.map +1 -1
  17. package/cache/cookieCache.cjs.map +1 -0
  18. package/cache/cookieCache.d.ts +6 -3
  19. package/cache/cookieCache.js +52 -54
  20. package/cache/cookieCache.js.map +1 -1
  21. package/cache/fallbackCache.cjs.map +1 -0
  22. package/cache/fallbackCache.d.ts +5 -2
  23. package/cache/fallbackCache.js +20 -21
  24. package/cache/fallbackCache.js.map +1 -1
  25. package/cache/inMemoryCache.cjs.map +1 -0
  26. package/cache/inMemoryCache.d.ts +5 -2
  27. package/cache/inMemoryCache.js +15 -17
  28. package/cache/inMemoryCache.js.map +1 -1
  29. package/cache/index.cjs.map +1 -0
  30. package/cache/index.d.ts +4 -4
  31. package/cache/index.js +9 -11
  32. package/cache/index.js.map +1 -1
  33. package/cache/localStorageCache.cjs.map +1 -0
  34. package/cache/localStorageCache.d.ts +5 -2
  35. package/cache/localStorageCache.js +55 -63
  36. package/cache/localStorageCache.js.map +1 -1
  37. package/channel/channel.cjs.map +1 -0
  38. package/channel/channel.d.ts +8 -6
  39. package/channel/channel.js +21 -22
  40. package/channel/channel.js.map +1 -1
  41. package/channel/encodedChannel.cjs.map +1 -0
  42. package/channel/encodedChannel.d.ts +6 -3
  43. package/channel/encodedChannel.js +13 -14
  44. package/channel/encodedChannel.js.map +1 -1
  45. package/channel/guaranteedChannel.cjs.map +1 -0
  46. package/channel/guaranteedChannel.d.ts +9 -7
  47. package/channel/guaranteedChannel.js +74 -73
  48. package/channel/guaranteedChannel.js.map +1 -1
  49. package/channel/httpBeaconChannel.cjs.map +1 -0
  50. package/channel/httpBeaconChannel.d.ts +9 -6
  51. package/channel/httpBeaconChannel.js +82 -83
  52. package/channel/httpBeaconChannel.js.map +1 -1
  53. package/channel/index.cjs.map +1 -0
  54. package/channel/index.d.ts +12 -7
  55. package/channel/index.js +15 -17
  56. package/channel/index.js.map +1 -1
  57. package/channel/queuedChannel.cjs.map +1 -0
  58. package/channel/queuedChannel.d.ts +7 -4
  59. package/channel/queuedChannel.js +87 -97
  60. package/channel/queuedChannel.js.map +1 -1
  61. package/channel/retryChannel.cjs.map +1 -0
  62. package/channel/retryChannel.d.ts +7 -5
  63. package/channel/retryChannel.js +58 -57
  64. package/channel/retryChannel.js.map +1 -1
  65. package/channel/sandboxChannel.cjs.map +1 -0
  66. package/channel/sandboxChannel.d.ts +5 -2
  67. package/channel/sandboxChannel.js +34 -35
  68. package/channel/sandboxChannel.js.map +1 -1
  69. package/cid/assigner.cjs.map +1 -0
  70. package/cid/assigner.d.ts +3 -1
  71. package/cid/assigner.js +0 -2
  72. package/cid/assigner.js.map +1 -1
  73. package/cid/cachedAssigner.cjs.map +1 -0
  74. package/cid/cachedAssigner.d.ts +7 -5
  75. package/cid/cachedAssigner.js +37 -43
  76. package/cid/cachedAssigner.js.map +1 -1
  77. package/cid/fixedAssigner.cjs.map +1 -0
  78. package/cid/fixedAssigner.d.ts +5 -2
  79. package/cid/fixedAssigner.js +9 -10
  80. package/cid/fixedAssigner.js.map +1 -1
  81. package/cid/index.cjs.map +1 -0
  82. package/cid/index.d.ts +6 -4
  83. package/cid/index.js +9 -11
  84. package/cid/index.js.map +1 -1
  85. package/cid/remoteAssigner.cjs.map +1 -0
  86. package/cid/remoteAssigner.d.ts +6 -3
  87. package/cid/remoteAssigner.js +36 -37
  88. package/cid/remoteAssigner.js.map +1 -1
  89. package/constants.cjs.map +1 -0
  90. package/constants.d.ts +6 -4
  91. package/constants.js +10 -7
  92. package/constants.js.map +1 -1
  93. package/container.cjs.map +1 -0
  94. package/container.d.ts +28 -15
  95. package/container.js +269 -252
  96. package/container.js.map +1 -1
  97. package/contentFetcher.cjs.map +1 -0
  98. package/contentFetcher.d.ts +17 -14
  99. package/contentFetcher.js +156 -163
  100. package/contentFetcher.js.map +1 -1
  101. package/context.cjs.map +1 -0
  102. package/context.d.ts +13 -9
  103. package/context.js +80 -81
  104. package/context.js.map +1 -1
  105. package/error.cjs.map +1 -0
  106. package/error.d.ts +4 -2
  107. package/error.js +21 -21
  108. package/error.js.map +1 -1
  109. package/evaluator.cjs.map +1 -0
  110. package/evaluator.d.ts +18 -16
  111. package/evaluator.js +179 -179
  112. package/evaluator.js.map +1 -1
  113. package/eventManager.cjs.map +1 -0
  114. package/eventManager.d.ts +8 -6
  115. package/eventManager.js +24 -26
  116. package/eventManager.js.map +1 -1
  117. package/eventSubjectProcessor.cjs.map +1 -0
  118. package/eventSubjectProcessor.d.ts +16 -3
  119. package/eventSubjectProcessor.js +53 -59
  120. package/eventSubjectProcessor.js.map +1 -1
  121. package/facade/contentFetcherFacade.cjs.map +1 -0
  122. package/facade/contentFetcherFacade.d.ts +16 -7
  123. package/facade/contentFetcherFacade.js +32 -35
  124. package/facade/contentFetcherFacade.js.map +1 -1
  125. package/facade/evaluatorFacade.cjs.map +1 -0
  126. package/facade/evaluatorFacade.d.ts +17 -10
  127. package/facade/evaluatorFacade.js +56 -60
  128. package/facade/evaluatorFacade.js.map +1 -1
  129. package/facade/index.cjs.map +1 -0
  130. package/facade/index.d.ts +29 -7
  131. package/facade/index.js +19 -19
  132. package/facade/index.js.map +1 -1
  133. package/facade/sdkFacade.cjs.map +1 -0
  134. package/facade/sdkFacade.d.ts +33 -15
  135. package/facade/sdkFacade.js +201 -214
  136. package/facade/sdkFacade.js.map +1 -1
  137. package/facade/sessionFacade.cjs.map +1 -0
  138. package/facade/sessionFacade.d.ts +18 -3
  139. package/facade/sessionFacade.js +10 -11
  140. package/facade/sessionFacade.js.map +1 -1
  141. package/facade/sessionPatch.cjs.map +1 -0
  142. package/facade/sessionPatch.d.ts +17 -4
  143. package/facade/sessionPatch.js +22 -24
  144. package/facade/sessionPatch.js.map +1 -1
  145. package/facade/trackerFacade.cjs.map +1 -0
  146. package/facade/trackerFacade.d.ts +17 -4
  147. package/facade/trackerFacade.js +67 -57
  148. package/facade/trackerFacade.js.map +1 -1
  149. package/facade/userFacade.cjs.map +1 -0
  150. package/facade/userFacade.d.ts +21 -4
  151. package/facade/userFacade.js +17 -18
  152. package/facade/userFacade.js.map +1 -1
  153. package/facade/userPatch.cjs.map +1 -0
  154. package/facade/userPatch.d.ts +17 -4
  155. package/facade/userPatch.js +22 -24
  156. package/facade/userPatch.js.map +1 -1
  157. package/help.cjs.map +1 -0
  158. package/help.d.ts +3 -1
  159. package/help.js +19 -23
  160. package/help.js.map +1 -1
  161. package/index.cjs.map +1 -0
  162. package/index.d.ts +25 -3
  163. package/index.js +7 -7
  164. package/index.js.map +1 -1
  165. package/logging/consoleLogger.cjs.map +1 -0
  166. package/logging/consoleLogger.d.ts +5 -2
  167. package/logging/consoleLogger.js +23 -24
  168. package/logging/consoleLogger.js.map +1 -1
  169. package/logging/filteredLogger.cjs.map +1 -0
  170. package/logging/filteredLogger.d.ts +8 -5
  171. package/logging/filteredLogger.js +36 -37
  172. package/logging/filteredLogger.js.map +1 -1
  173. package/logging/index.cjs.map +1 -0
  174. package/logging/index.d.ts +5 -5
  175. package/logging/index.js +11 -13
  176. package/logging/index.js.map +1 -1
  177. package/logging/logger.cjs.map +1 -0
  178. package/logging/logger.d.ts +4 -2
  179. package/logging/logger.js +0 -2
  180. package/logging/logger.js.map +1 -1
  181. package/logging/namespacedLogger.cjs.map +1 -0
  182. package/logging/namespacedLogger.d.ts +5 -2
  183. package/logging/namespacedLogger.js +22 -23
  184. package/logging/namespacedLogger.js.map +1 -1
  185. package/logging/nullLogger.cjs.map +1 -0
  186. package/logging/nullLogger.d.ts +5 -2
  187. package/logging/nullLogger.js +11 -16
  188. package/logging/nullLogger.js.map +1 -1
  189. package/namespacedStorage.cjs.map +1 -0
  190. package/namespacedStorage.d.ts +3 -1
  191. package/namespacedStorage.js +51 -52
  192. package/namespacedStorage.js.map +1 -1
  193. package/package.json +60 -6
  194. package/patch.cjs.map +1 -0
  195. package/patch.d.ts +6 -4
  196. package/patch.js +0 -2
  197. package/patch.js.map +1 -1
  198. package/queue/capacityRestrictedQueue.cjs.map +1 -0
  199. package/queue/capacityRestrictedQueue.d.ts +5 -2
  200. package/queue/capacityRestrictedQueue.js +31 -32
  201. package/queue/capacityRestrictedQueue.js.map +1 -1
  202. package/queue/inMemoryQueue.cjs.map +1 -0
  203. package/queue/inMemoryQueue.d.ts +5 -2
  204. package/queue/inMemoryQueue.js +32 -34
  205. package/queue/inMemoryQueue.js.map +1 -1
  206. package/queue/index.cjs.map +1 -0
  207. package/queue/index.d.ts +6 -5
  208. package/queue/index.js +11 -13
  209. package/queue/index.js.map +1 -1
  210. package/queue/monitoredQueue.cjs.map +1 -0
  211. package/queue/monitoredQueue.d.ts +8 -5
  212. package/queue/monitoredQueue.js +104 -110
  213. package/queue/monitoredQueue.js.map +1 -1
  214. package/queue/persistentQueue.cjs.map +1 -0
  215. package/queue/persistentQueue.d.ts +5 -2
  216. package/queue/persistentQueue.js +52 -54
  217. package/queue/persistentQueue.js.map +1 -1
  218. package/queue/queue.cjs.map +1 -0
  219. package/queue/queue.d.ts +3 -1
  220. package/queue/queue.js +0 -2
  221. package/queue/queue.js.map +1 -1
  222. package/retry/arbitraryPolicy.cjs.map +1 -0
  223. package/retry/arbitraryPolicy.d.ts +5 -2
  224. package/retry/arbitraryPolicy.js +14 -15
  225. package/retry/arbitraryPolicy.js.map +1 -1
  226. package/retry/backoffPolicy.cjs.map +1 -0
  227. package/retry/backoffPolicy.d.ts +5 -3
  228. package/retry/backoffPolicy.js +52 -50
  229. package/retry/backoffPolicy.js.map +1 -1
  230. package/retry/index.cjs.map +1 -0
  231. package/retry/index.d.ts +5 -5
  232. package/retry/index.js +11 -13
  233. package/retry/index.js.map +1 -1
  234. package/retry/maxAttemptsPolicy.cjs.map +1 -0
  235. package/retry/maxAttemptsPolicy.d.ts +5 -2
  236. package/retry/maxAttemptsPolicy.js +17 -18
  237. package/retry/maxAttemptsPolicy.js.map +1 -1
  238. package/retry/neverPolicy.cjs.map +1 -0
  239. package/retry/neverPolicy.d.ts +5 -2
  240. package/retry/neverPolicy.js +9 -10
  241. package/retry/neverPolicy.js.map +1 -1
  242. package/retry/policy.cjs.map +1 -0
  243. package/retry/policy.d.ts +3 -1
  244. package/retry/policy.js +0 -2
  245. package/retry/policy.js.map +1 -1
  246. package/schema/attributeSchema.cjs.map +1 -0
  247. package/schema/attributeSchema.d.ts +6 -2
  248. package/schema/attributeSchema.js +7 -7
  249. package/schema/attributeSchema.js.map +1 -1
  250. package/schema/contentFetcherSchemas.cjs.map +1 -0
  251. package/schema/contentFetcherSchemas.d.ts +6 -2
  252. package/schema/contentFetcherSchemas.js +24 -21
  253. package/schema/contentFetcherSchemas.js.map +1 -1
  254. package/schema/contentSchemas.cjs.map +1 -0
  255. package/schema/contentSchemas.d.ts +6 -2
  256. package/schema/contentSchemas.js +45 -45
  257. package/schema/contentSchemas.js.map +1 -1
  258. package/schema/contextSchemas.cjs.map +1 -0
  259. package/schema/contextSchemas.d.ts +6 -2
  260. package/schema/contextSchemas.js +6 -6
  261. package/schema/contextSchemas.js.map +1 -1
  262. package/schema/ecommerceSchemas.cjs.map +1 -0
  263. package/schema/ecommerceSchemas.d.ts +10 -6
  264. package/schema/ecommerceSchemas.js +176 -172
  265. package/schema/ecommerceSchemas.js.map +1 -1
  266. package/schema/evaluatorSchemas.cjs.map +1 -0
  267. package/schema/evaluatorSchemas.d.ts +6 -2
  268. package/schema/evaluatorSchemas.js +46 -30
  269. package/schema/evaluatorSchemas.js.map +1 -1
  270. package/schema/eventSchemas.cjs.map +1 -0
  271. package/schema/eventSchemas.d.ts +16 -12
  272. package/schema/eventSchemas.js +125 -102
  273. package/schema/eventSchemas.js.map +1 -1
  274. package/schema/index.cjs.map +1 -0
  275. package/schema/index.d.ts +14 -11
  276. package/schema/index.js +11 -14
  277. package/schema/index.js.map +1 -1
  278. package/schema/loggerSchema.cjs.map +1 -0
  279. package/schema/loggerSchema.d.ts +6 -2
  280. package/schema/loggerSchema.js +13 -13
  281. package/schema/loggerSchema.js.map +1 -1
  282. package/schema/operationSchemas.cjs.map +1 -0
  283. package/schema/operationSchemas.d.ts +14 -10
  284. package/schema/operationSchemas.js +85 -69
  285. package/schema/operationSchemas.js.map +1 -1
  286. package/schema/sdkFacadeSchemas.cjs.map +1 -0
  287. package/schema/sdkFacadeSchemas.d.ts +6 -2
  288. package/schema/sdkFacadeSchemas.js +65 -51
  289. package/schema/sdkFacadeSchemas.js.map +1 -1
  290. package/schema/sdkSchemas.cjs.map +1 -0
  291. package/schema/sdkSchemas.d.ts +8 -4
  292. package/schema/sdkSchemas.js +80 -78
  293. package/schema/sdkSchemas.js.map +1 -1
  294. package/schema/tokenSchema.cjs.map +1 -0
  295. package/schema/tokenSchema.d.ts +6 -2
  296. package/schema/tokenSchema.js +41 -38
  297. package/schema/tokenSchema.js.map +1 -1
  298. package/schema/userSchema.cjs.map +1 -0
  299. package/schema/userSchema.d.ts +6 -2
  300. package/schema/userSchema.js +183 -134
  301. package/schema/userSchema.js.map +1 -1
  302. package/sdk.cjs.map +1 -0
  303. package/sdk.d.ts +28 -14
  304. package/sdk.js +106 -108
  305. package/sdk.js.map +1 -1
  306. package/sdkEvents.cjs.map +1 -0
  307. package/sdkEvents.d.ts +10 -5
  308. package/sdkEvents.js +0 -2
  309. package/sdkEvents.js.map +1 -1
  310. package/sourceLocation.cjs.map +1 -0
  311. package/sourceLocation.d.ts +7 -5
  312. package/sourceLocation.js +56 -57
  313. package/sourceLocation.js.map +1 -1
  314. package/tab.cjs.map +1 -0
  315. package/tab.d.ts +9 -7
  316. package/tab.js +93 -90
  317. package/tab.js.map +1 -1
  318. package/token/cachedTokenStore.cjs.map +1 -0
  319. package/token/cachedTokenStore.d.ts +8 -3
  320. package/token/cachedTokenStore.js +22 -24
  321. package/token/cachedTokenStore.js.map +1 -1
  322. package/token/inMemoryTokenStore.cjs.map +1 -0
  323. package/token/inMemoryTokenStore.d.ts +7 -2
  324. package/token/inMemoryTokenStore.js +12 -13
  325. package/token/inMemoryTokenStore.js.map +1 -1
  326. package/token/index.cjs.map +1 -0
  327. package/token/index.d.ts +7 -4
  328. package/token/index.js +9 -11
  329. package/token/index.js.map +1 -1
  330. package/token/replicatedTokenStore.cjs.map +1 -0
  331. package/token/replicatedTokenStore.d.ts +7 -2
  332. package/token/replicatedTokenStore.js +14 -15
  333. package/token/replicatedTokenStore.js.map +1 -1
  334. package/token/token.cjs.map +1 -0
  335. package/token/token.d.ts +11 -8
  336. package/token/token.js +212 -195
  337. package/token/token.js.map +1 -1
  338. package/tracker.cjs.map +1 -0
  339. package/tracker.d.ts +20 -13
  340. package/tracker.js +307 -307
  341. package/tracker.js.map +1 -1
  342. package/trackingEvents.cjs.map +1 -0
  343. package/trackingEvents.d.ts +65 -62
  344. package/trackingEvents.js +57 -56
  345. package/trackingEvents.js.map +1 -1
  346. package/transformer.cjs.map +1 -0
  347. package/transformer.d.ts +4 -2
  348. package/transformer.js +5 -6
  349. package/transformer.js.map +1 -1
  350. package/utilityTypes.cjs.map +1 -0
  351. package/utilityTypes.d.ts +4 -2
  352. package/utilityTypes.js +0 -2
  353. package/utilityTypes.js.map +1 -1
  354. package/uuid.cjs.map +1 -0
  355. package/uuid.d.ts +3 -1
  356. package/uuid.js +27 -32
  357. package/uuid.js.map +1 -1
  358. package/validation/arrayType.cjs.map +1 -0
  359. package/validation/arrayType.d.ts +5 -3
  360. package/validation/arrayType.js +45 -41
  361. package/validation/arrayType.js.map +1 -1
  362. package/validation/booleanType.cjs.map +1 -0
  363. package/validation/booleanType.d.ts +5 -2
  364. package/validation/booleanType.js +19 -16
  365. package/validation/booleanType.js.map +1 -1
  366. package/validation/functionType.cjs.map +1 -0
  367. package/validation/functionType.d.ts +5 -2
  368. package/validation/functionType.js +19 -16
  369. package/validation/functionType.js.map +1 -1
  370. package/validation/index.cjs.map +1 -0
  371. package/validation/index.d.ts +12 -12
  372. package/validation/index.js +27 -29
  373. package/validation/index.js.map +1 -1
  374. package/validation/jsonType.cjs.map +1 -0
  375. package/validation/jsonType.d.ts +8 -6
  376. package/validation/jsonType.js +89 -82
  377. package/validation/jsonType.js.map +1 -1
  378. package/validation/mixedSchema.cjs.map +1 -0
  379. package/validation/mixedSchema.d.ts +5 -2
  380. package/validation/mixedSchema.js +5 -7
  381. package/validation/mixedSchema.js.map +1 -1
  382. package/validation/nullType.cjs.map +1 -0
  383. package/validation/nullType.d.ts +5 -2
  384. package/validation/nullType.js +19 -16
  385. package/validation/nullType.js.map +1 -1
  386. package/validation/numberType.cjs.map +1 -0
  387. package/validation/numberType.d.ts +5 -3
  388. package/validation/numberType.js +40 -32
  389. package/validation/numberType.js.map +1 -1
  390. package/validation/objectType.cjs.map +1 -0
  391. package/validation/objectType.d.ts +5 -3
  392. package/validation/objectType.js +84 -85
  393. package/validation/objectType.js.map +1 -1
  394. package/validation/schema.cjs.map +1 -0
  395. package/validation/schema.d.ts +5 -3
  396. package/validation/schema.js +8 -9
  397. package/validation/schema.js.map +1 -1
  398. package/validation/stringType.cjs.map +1 -0
  399. package/validation/stringType.d.ts +5 -3
  400. package/validation/stringType.js +74 -70
  401. package/validation/stringType.js.map +1 -1
  402. package/validation/unionType.cjs.map +1 -0
  403. package/validation/unionType.d.ts +5 -2
  404. package/validation/unionType.js +37 -35
  405. package/validation/unionType.js.map +1 -1
  406. package/validation/violation.cjs.map +1 -0
  407. package/validation/violation.d.ts +4 -2
  408. package/validation/violation.js +18 -18
  409. package/validation/violation.js.map +1 -1
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/schema/ecommerceSchemas.ts"],"sourcesContent":["import {ObjectType, StringType, NumberType, ArrayType} from '../validation';\n\nexport const productDetails = new ObjectType({\n required: ['productId', 'name', 'displayPrice'],\n properties: {\n productId: new StringType({\n minLength: 1,\n maxLength: 50,\n }),\n sku: new StringType({\n minLength: 1,\n maxLength: 50,\n }),\n name: new StringType({\n minLength: 1,\n maxLength: 200,\n }),\n category: new StringType({\n minLength: 1,\n maxLength: 100,\n }),\n brand: new StringType({\n minLength: 1,\n maxLength: 100,\n }),\n variant: new StringType({\n minLength: 1,\n maxLength: 50,\n }),\n displayPrice: new NumberType({\n minimum: 0,\n }),\n originalPrice: new NumberType({\n minimum: 0,\n }),\n url: new StringType({\n format: 'url',\n }),\n imageUrl: new StringType({\n format: 'url',\n }),\n },\n});\n\nexport const cartItem = new ObjectType({\n required: ['index', 'product', 'quantity', 'total'],\n properties: {\n index: new NumberType({\n minimum: 0,\n }),\n product: productDetails,\n quantity: new NumberType({\n minimum: 1,\n }),\n total: new NumberType({\n minimum: 0,\n }),\n discount: new NumberType({\n minimum: 0,\n }),\n coupon: new StringType({\n minLength: 1,\n maxLength: 50,\n }),\n },\n});\n\nexport const cart = new ObjectType({\n required: ['currency', 'items', 'total'],\n properties: {\n currency: new StringType({\n maxLength: 10,\n minLength: 1,\n }),\n items: new ArrayType({\n items: cartItem,\n }),\n subtotal: new NumberType({\n minimum: 0,\n }),\n shippingPrice: new NumberType({\n minimum: 0,\n }),\n taxes: new ObjectType({\n additionalProperties: new NumberType(),\n minProperties: 1,\n }),\n costs: new ObjectType({\n additionalProperties: new NumberType(),\n minProperties: 1,\n }),\n discount: new NumberType({\n minimum: 0,\n }),\n total: new NumberType({\n minimum: 0,\n }),\n coupon: new StringType({\n minLength: 1,\n maxLength: 50,\n }),\n lastUpdateTime: new NumberType(),\n },\n});\n\nexport const orderItem = new ObjectType({\n required: ['index', 'product', 'quantity', 'total'],\n properties: {\n index: new NumberType({\n minimum: 0,\n }),\n product: productDetails,\n quantity: new NumberType({\n minimum: 1,\n }),\n total: new NumberType({\n minimum: 0,\n }),\n discount: new NumberType({\n minimum: 0,\n }),\n coupon: new StringType({\n minLength: 1,\n maxLength: 50,\n }),\n },\n});\n\nexport const order = new ObjectType({\n required: ['orderId', 'currency', 'items', 'total'],\n properties: {\n orderId: new StringType({\n minLength: 1,\n maxLength: 50,\n }),\n currency: new StringType({\n maxLength: 10,\n minLength: 1,\n }),\n items: new ArrayType({\n items: orderItem,\n minItems: 1,\n }),\n subtotal: new NumberType({\n minimum: 0,\n }),\n shippingPrice: new NumberType({\n minimum: 0,\n }),\n taxes: new ObjectType({\n additionalProperties: new NumberType(),\n minProperties: 1,\n }),\n costs: new ObjectType({\n additionalProperties: new NumberType(),\n minProperties: 1,\n }),\n discount: new NumberType({\n minimum: 0,\n }),\n total: new NumberType({\n minimum: 0,\n }),\n coupon: new StringType({\n minLength: 1,\n maxLength: 50,\n }),\n paymentMethod: new StringType({\n minLength: 1,\n maxLength: 50,\n }),\n installments: new NumberType({\n minimum: 1,\n }),\n status: new StringType({\n enumeration: ['placed', 'paid', 'complete'],\n }),\n },\n});\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wBAA4D;AAErD,MAAM,iBAAiB,IAAI,6BAAW;AAAA,EACzC,UAAU,CAAC,aAAa,QAAQ,cAAc;AAAA,EAC9C,YAAY;AAAA,IACR,WAAW,IAAI,6BAAW;AAAA,MACtB,WAAW;AAAA,MACX,WAAW;AAAA,IACf,CAAC;AAAA,IACD,KAAK,IAAI,6BAAW;AAAA,MAChB,WAAW;AAAA,MACX,WAAW;AAAA,IACf,CAAC;AAAA,IACD,MAAM,IAAI,6BAAW;AAAA,MACjB,WAAW;AAAA,MACX,WAAW;AAAA,IACf,CAAC;AAAA,IACD,UAAU,IAAI,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MACX,WAAW;AAAA,IACf,CAAC;AAAA,IACD,UAAU,IAAI,6BAAW;AAAA,MACrB,WAAW;AAAA,MACX,WAAW;AAAA,IACf,CAAC;AAAA,IACD,OAAO,IAAI,4BAAU;AAAA,MACjB,OAAO;AAAA,MACP,UAAU;AAAA,IACd,CAAC;AAAA,IACD,UAAU,IAAI,6BAAW;AAAA,MACrB,SAAS;AAAA,IACb,CAAC;AAAA,IACD,eAAe,IAAI,6BAAW;AAAA,MAC1B,SAAS;AAAA,IACb,CAAC;AAAA,IACD,OAAO,IAAI,6BAAW;AAAA,MAClB,sBAAsB,IAAI,6BAAW;AAAA,MACrC,eAAe;AAAA,IACnB,CAAC;AAAA,IACD,OAAO,IAAI,6BAAW;AAAA,MAClB,sBAAsB,IAAI,6BAAW;AAAA,MACrC,eAAe;AAAA,IACnB,CAAC;AAAA,IACD,UAAU,IAAI,6BAAW;AAAA,MACrB,SAAS;AAAA,IACb,CAAC;AAAA,IACD,OAAO,IAAI,6BAAW;AAAA,MAClB,SAAS;AAAA,IACb,CAAC;AAAA,IACD,QAAQ,IAAI,6BAAW;AAAA,MACnB,WAAW;AAAA,MACX,WAAW;AAAA,IACf,CAAC;AAAA,IACD,eAAe,IAAI,6BAAW;AAAA,MAC1B,WAAW;AAAA,MACX,WAAW;AAAA,IACf,CAAC;AAAA,IACD,cAAc,IAAI,6BAAW;AAAA,MACzB,SAAS;AAAA,IACb,CAAC;AAAA,IACD,QAAQ,IAAI,6BAAW;AAAA,MACnB,aAAa,CAAC,UAAU,QAAQ,UAAU;AAAA,IAC9C,CAAC;AAAA,EACL;AACJ,CAAC;","names":[]}
@@ -1,6 +1,10 @@
1
- import { ObjectType } from '../validation';
2
- export declare const productDetails: ObjectType;
3
- export declare const cartItem: ObjectType;
4
- export declare const cart: ObjectType;
5
- export declare const orderItem: ObjectType;
6
- export declare const order: ObjectType;
1
+ import { ObjectType } from '../validation/objectType.js';
2
+ import '../validation/schema.js';
3
+
4
+ declare const productDetails: ObjectType;
5
+ declare const cartItem: ObjectType;
6
+ declare const cart: ObjectType;
7
+ declare const orderItem: ObjectType;
8
+ declare const order: ObjectType;
9
+
10
+ export { cart, cartItem, order, orderItem, productDetails };
@@ -1,178 +1,182 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.order = exports.orderItem = exports.cart = exports.cartItem = exports.productDetails = void 0;
4
- const validation_1 = require("../validation");
5
- exports.productDetails = new validation_1.ObjectType({
6
- required: ['productId', 'name', 'displayPrice'],
7
- properties: {
8
- productId: new validation_1.StringType({
9
- minLength: 1,
10
- maxLength: 50,
11
- }),
12
- sku: new validation_1.StringType({
13
- minLength: 1,
14
- maxLength: 50,
15
- }),
16
- name: new validation_1.StringType({
17
- minLength: 1,
18
- maxLength: 200,
19
- }),
20
- category: new validation_1.StringType({
21
- minLength: 1,
22
- maxLength: 100,
23
- }),
24
- brand: new validation_1.StringType({
25
- minLength: 1,
26
- maxLength: 100,
27
- }),
28
- variant: new validation_1.StringType({
29
- minLength: 1,
30
- maxLength: 50,
31
- }),
32
- displayPrice: new validation_1.NumberType({
33
- minimum: 0,
34
- }),
35
- originalPrice: new validation_1.NumberType({
36
- minimum: 0,
37
- }),
38
- url: new validation_1.StringType({
39
- format: 'url',
40
- }),
41
- imageUrl: new validation_1.StringType({
42
- format: 'url',
43
- }),
44
- },
1
+ import { ObjectType, StringType, NumberType, ArrayType } from "../validation";
2
+ const productDetails = new ObjectType({
3
+ required: ["productId", "name", "displayPrice"],
4
+ properties: {
5
+ productId: new StringType({
6
+ minLength: 1,
7
+ maxLength: 50
8
+ }),
9
+ sku: new StringType({
10
+ minLength: 1,
11
+ maxLength: 50
12
+ }),
13
+ name: new StringType({
14
+ minLength: 1,
15
+ maxLength: 200
16
+ }),
17
+ category: new StringType({
18
+ minLength: 1,
19
+ maxLength: 100
20
+ }),
21
+ brand: new StringType({
22
+ minLength: 1,
23
+ maxLength: 100
24
+ }),
25
+ variant: new StringType({
26
+ minLength: 1,
27
+ maxLength: 50
28
+ }),
29
+ displayPrice: new NumberType({
30
+ minimum: 0
31
+ }),
32
+ originalPrice: new NumberType({
33
+ minimum: 0
34
+ }),
35
+ url: new StringType({
36
+ format: "url"
37
+ }),
38
+ imageUrl: new StringType({
39
+ format: "url"
40
+ })
41
+ }
45
42
  });
46
- exports.cartItem = new validation_1.ObjectType({
47
- required: ['index', 'product', 'quantity', 'total'],
48
- properties: {
49
- index: new validation_1.NumberType({
50
- minimum: 0,
51
- }),
52
- product: exports.productDetails,
53
- quantity: new validation_1.NumberType({
54
- minimum: 1,
55
- }),
56
- total: new validation_1.NumberType({
57
- minimum: 0,
58
- }),
59
- discount: new validation_1.NumberType({
60
- minimum: 0,
61
- }),
62
- coupon: new validation_1.StringType({
63
- minLength: 1,
64
- maxLength: 50,
65
- }),
66
- },
43
+ const cartItem = new ObjectType({
44
+ required: ["index", "product", "quantity", "total"],
45
+ properties: {
46
+ index: new NumberType({
47
+ minimum: 0
48
+ }),
49
+ product: productDetails,
50
+ quantity: new NumberType({
51
+ minimum: 1
52
+ }),
53
+ total: new NumberType({
54
+ minimum: 0
55
+ }),
56
+ discount: new NumberType({
57
+ minimum: 0
58
+ }),
59
+ coupon: new StringType({
60
+ minLength: 1,
61
+ maxLength: 50
62
+ })
63
+ }
67
64
  });
68
- exports.cart = new validation_1.ObjectType({
69
- required: ['currency', 'items', 'total'],
70
- properties: {
71
- currency: new validation_1.StringType({
72
- maxLength: 10,
73
- minLength: 1,
74
- }),
75
- items: new validation_1.ArrayType({
76
- items: exports.cartItem,
77
- }),
78
- subtotal: new validation_1.NumberType({
79
- minimum: 0,
80
- }),
81
- shippingPrice: new validation_1.NumberType({
82
- minimum: 0,
83
- }),
84
- taxes: new validation_1.ObjectType({
85
- additionalProperties: new validation_1.NumberType(),
86
- minProperties: 1,
87
- }),
88
- costs: new validation_1.ObjectType({
89
- additionalProperties: new validation_1.NumberType(),
90
- minProperties: 1,
91
- }),
92
- discount: new validation_1.NumberType({
93
- minimum: 0,
94
- }),
95
- total: new validation_1.NumberType({
96
- minimum: 0,
97
- }),
98
- coupon: new validation_1.StringType({
99
- minLength: 1,
100
- maxLength: 50,
101
- }),
102
- lastUpdateTime: new validation_1.NumberType(),
103
- },
65
+ const cart = new ObjectType({
66
+ required: ["currency", "items", "total"],
67
+ properties: {
68
+ currency: new StringType({
69
+ maxLength: 10,
70
+ minLength: 1
71
+ }),
72
+ items: new ArrayType({
73
+ items: cartItem
74
+ }),
75
+ subtotal: new NumberType({
76
+ minimum: 0
77
+ }),
78
+ shippingPrice: new NumberType({
79
+ minimum: 0
80
+ }),
81
+ taxes: new ObjectType({
82
+ additionalProperties: new NumberType(),
83
+ minProperties: 1
84
+ }),
85
+ costs: new ObjectType({
86
+ additionalProperties: new NumberType(),
87
+ minProperties: 1
88
+ }),
89
+ discount: new NumberType({
90
+ minimum: 0
91
+ }),
92
+ total: new NumberType({
93
+ minimum: 0
94
+ }),
95
+ coupon: new StringType({
96
+ minLength: 1,
97
+ maxLength: 50
98
+ }),
99
+ lastUpdateTime: new NumberType()
100
+ }
104
101
  });
105
- exports.orderItem = new validation_1.ObjectType({
106
- required: ['index', 'product', 'quantity', 'total'],
107
- properties: {
108
- index: new validation_1.NumberType({
109
- minimum: 0,
110
- }),
111
- product: exports.productDetails,
112
- quantity: new validation_1.NumberType({
113
- minimum: 1,
114
- }),
115
- total: new validation_1.NumberType({
116
- minimum: 0,
117
- }),
118
- discount: new validation_1.NumberType({
119
- minimum: 0,
120
- }),
121
- coupon: new validation_1.StringType({
122
- minLength: 1,
123
- maxLength: 50,
124
- }),
125
- },
102
+ const orderItem = new ObjectType({
103
+ required: ["index", "product", "quantity", "total"],
104
+ properties: {
105
+ index: new NumberType({
106
+ minimum: 0
107
+ }),
108
+ product: productDetails,
109
+ quantity: new NumberType({
110
+ minimum: 1
111
+ }),
112
+ total: new NumberType({
113
+ minimum: 0
114
+ }),
115
+ discount: new NumberType({
116
+ minimum: 0
117
+ }),
118
+ coupon: new StringType({
119
+ minLength: 1,
120
+ maxLength: 50
121
+ })
122
+ }
126
123
  });
127
- exports.order = new validation_1.ObjectType({
128
- required: ['orderId', 'currency', 'items', 'total'],
129
- properties: {
130
- orderId: new validation_1.StringType({
131
- minLength: 1,
132
- maxLength: 50,
133
- }),
134
- currency: new validation_1.StringType({
135
- maxLength: 10,
136
- minLength: 1,
137
- }),
138
- items: new validation_1.ArrayType({
139
- items: exports.orderItem,
140
- minItems: 1,
141
- }),
142
- subtotal: new validation_1.NumberType({
143
- minimum: 0,
144
- }),
145
- shippingPrice: new validation_1.NumberType({
146
- minimum: 0,
147
- }),
148
- taxes: new validation_1.ObjectType({
149
- additionalProperties: new validation_1.NumberType(),
150
- minProperties: 1,
151
- }),
152
- costs: new validation_1.ObjectType({
153
- additionalProperties: new validation_1.NumberType(),
154
- minProperties: 1,
155
- }),
156
- discount: new validation_1.NumberType({
157
- minimum: 0,
158
- }),
159
- total: new validation_1.NumberType({
160
- minimum: 0,
161
- }),
162
- coupon: new validation_1.StringType({
163
- minLength: 1,
164
- maxLength: 50,
165
- }),
166
- paymentMethod: new validation_1.StringType({
167
- minLength: 1,
168
- maxLength: 50,
169
- }),
170
- installments: new validation_1.NumberType({
171
- minimum: 1,
172
- }),
173
- status: new validation_1.StringType({
174
- enumeration: ['placed', 'paid', 'complete'],
175
- }),
176
- },
124
+ const order = new ObjectType({
125
+ required: ["orderId", "currency", "items", "total"],
126
+ properties: {
127
+ orderId: new StringType({
128
+ minLength: 1,
129
+ maxLength: 50
130
+ }),
131
+ currency: new StringType({
132
+ maxLength: 10,
133
+ minLength: 1
134
+ }),
135
+ items: new ArrayType({
136
+ items: orderItem,
137
+ minItems: 1
138
+ }),
139
+ subtotal: new NumberType({
140
+ minimum: 0
141
+ }),
142
+ shippingPrice: new NumberType({
143
+ minimum: 0
144
+ }),
145
+ taxes: new ObjectType({
146
+ additionalProperties: new NumberType(),
147
+ minProperties: 1
148
+ }),
149
+ costs: new ObjectType({
150
+ additionalProperties: new NumberType(),
151
+ minProperties: 1
152
+ }),
153
+ discount: new NumberType({
154
+ minimum: 0
155
+ }),
156
+ total: new NumberType({
157
+ minimum: 0
158
+ }),
159
+ coupon: new StringType({
160
+ minLength: 1,
161
+ maxLength: 50
162
+ }),
163
+ paymentMethod: new StringType({
164
+ minLength: 1,
165
+ maxLength: 50
166
+ }),
167
+ installments: new NumberType({
168
+ minimum: 1
169
+ }),
170
+ status: new StringType({
171
+ enumeration: ["placed", "paid", "complete"]
172
+ })
173
+ }
177
174
  });
175
+ export {
176
+ cart,
177
+ cartItem,
178
+ order,
179
+ orderItem,
180
+ productDetails
181
+ };
178
182
  //# sourceMappingURL=ecommerceSchemas.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ecommerceSchemas.js","sourceRoot":"","sources":["../src/schema/ecommerceSchemas.ts"],"names":[],"mappings":";;;AAAA,8CAA4E;AAE/D,QAAA,cAAc,GAAG,IAAI,uBAAU,CAAC;IACzC,QAAQ,EAAE,CAAC,WAAW,EAAE,MAAM,EAAE,cAAc,CAAC;IAC/C,UAAU,EAAE;QACR,SAAS,EAAE,IAAI,uBAAU,CAAC;YACtB,SAAS,EAAE,CAAC;YACZ,SAAS,EAAE,EAAE;SAChB,CAAC;QACF,GAAG,EAAE,IAAI,uBAAU,CAAC;YAChB,SAAS,EAAE,CAAC;YACZ,SAAS,EAAE,EAAE;SAChB,CAAC;QACF,IAAI,EAAE,IAAI,uBAAU,CAAC;YACjB,SAAS,EAAE,CAAC;YACZ,SAAS,EAAE,GAAG;SACjB,CAAC;QACF,QAAQ,EAAE,IAAI,uBAAU,CAAC;YACrB,SAAS,EAAE,CAAC;YACZ,SAAS,EAAE,GAAG;SACjB,CAAC;QACF,KAAK,EAAE,IAAI,uBAAU,CAAC;YAClB,SAAS,EAAE,CAAC;YACZ,SAAS,EAAE,GAAG;SACjB,CAAC;QACF,OAAO,EAAE,IAAI,uBAAU,CAAC;YACpB,SAAS,EAAE,CAAC;YACZ,SAAS,EAAE,EAAE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,EAAE,UAAU,CAAC;SAC9C,CAAC;KACL;CACJ,CAAC,CAAC"}
1
+ {"version":3,"sources":["../src/schema/ecommerceSchemas.ts"],"sourcesContent":["import {ObjectType, StringType, NumberType, ArrayType} from '../validation';\n\nexport const productDetails = new ObjectType({\n required: ['productId', 'name', 'displayPrice'],\n properties: {\n productId: new StringType({\n minLength: 1,\n maxLength: 50,\n }),\n sku: new StringType({\n minLength: 1,\n maxLength: 50,\n }),\n name: new StringType({\n minLength: 1,\n maxLength: 200,\n }),\n category: new StringType({\n minLength: 1,\n maxLength: 100,\n }),\n brand: new StringType({\n minLength: 1,\n maxLength: 100,\n }),\n variant: new StringType({\n minLength: 1,\n maxLength: 50,\n }),\n displayPrice: new NumberType({\n minimum: 0,\n }),\n originalPrice: new NumberType({\n minimum: 0,\n }),\n url: new StringType({\n format: 'url',\n }),\n imageUrl: new StringType({\n format: 'url',\n }),\n },\n});\n\nexport const cartItem = new ObjectType({\n required: ['index', 'product', 'quantity', 'total'],\n properties: {\n index: new NumberType({\n minimum: 0,\n }),\n product: productDetails,\n quantity: new NumberType({\n minimum: 1,\n }),\n total: new NumberType({\n minimum: 0,\n }),\n discount: new NumberType({\n minimum: 0,\n }),\n coupon: new StringType({\n minLength: 1,\n maxLength: 50,\n }),\n },\n});\n\nexport const cart = new ObjectType({\n required: ['currency', 'items', 'total'],\n properties: {\n currency: new StringType({\n maxLength: 10,\n minLength: 1,\n }),\n items: new ArrayType({\n items: cartItem,\n }),\n subtotal: new NumberType({\n minimum: 0,\n }),\n shippingPrice: new NumberType({\n minimum: 0,\n }),\n taxes: new ObjectType({\n additionalProperties: new NumberType(),\n minProperties: 1,\n }),\n costs: new ObjectType({\n additionalProperties: new NumberType(),\n minProperties: 1,\n }),\n discount: new NumberType({\n minimum: 0,\n }),\n total: new NumberType({\n minimum: 0,\n }),\n coupon: new StringType({\n minLength: 1,\n maxLength: 50,\n }),\n lastUpdateTime: new NumberType(),\n },\n});\n\nexport const orderItem = new ObjectType({\n required: ['index', 'product', 'quantity', 'total'],\n properties: {\n index: new NumberType({\n minimum: 0,\n }),\n product: productDetails,\n quantity: new NumberType({\n minimum: 1,\n }),\n total: new NumberType({\n minimum: 0,\n }),\n discount: new NumberType({\n minimum: 0,\n }),\n coupon: new StringType({\n minLength: 1,\n maxLength: 50,\n }),\n },\n});\n\nexport const order = new ObjectType({\n required: ['orderId', 'currency', 'items', 'total'],\n properties: {\n orderId: new StringType({\n minLength: 1,\n maxLength: 50,\n }),\n currency: new StringType({\n maxLength: 10,\n minLength: 1,\n }),\n items: new ArrayType({\n items: orderItem,\n minItems: 1,\n }),\n subtotal: new NumberType({\n minimum: 0,\n }),\n shippingPrice: new NumberType({\n minimum: 0,\n }),\n taxes: new ObjectType({\n additionalProperties: new NumberType(),\n minProperties: 1,\n }),\n costs: new ObjectType({\n additionalProperties: new NumberType(),\n minProperties: 1,\n }),\n discount: new NumberType({\n minimum: 0,\n }),\n total: new NumberType({\n minimum: 0,\n }),\n coupon: new StringType({\n minLength: 1,\n maxLength: 50,\n }),\n paymentMethod: new StringType({\n minLength: 1,\n maxLength: 50,\n }),\n installments: new NumberType({\n minimum: 1,\n }),\n status: new StringType({\n enumeration: ['placed', 'paid', 'complete'],\n }),\n },\n});\n"],"mappings":"AAAA,SAAQ,YAAY,YAAY,YAAY,iBAAgB;AAErD,MAAM,iBAAiB,IAAI,WAAW;AAAA,EACzC,UAAU,CAAC,aAAa,QAAQ,cAAc;AAAA,EAC9C,YAAY;AAAA,IACR,WAAW,IAAI,WAAW;AAAA,MACtB,WAAW;AAAA,MACX,WAAW;AAAA,IACf,CAAC;AAAA,IACD,KAAK,IAAI,WAAW;AAAA,MAChB,WAAW;AAAA,MACX,WAAW;AAAA,IACf,CAAC;AAAA,IACD,MAAM,IAAI,WAAW;AAAA,MACjB,WAAW;AAAA,MACX,WAAW;AAAA,IACf,CAAC;AAAA,IACD,UAAU,IAAI,WAAW;AAAA,MACrB,WAAW;AAAA,MACX,WAAW;AAAA,IAC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;AAAA,IACf,CAAC;AAAA,IACD,OAAO,IAAI,UAAU;AAAA,MACjB,OAAO;AAAA,MACP,UAAU;AAAA,IACd,CAAC;AAAA,IACD,UAAU,IAAI,WAAW;AAAA,MACrB,SAAS;AAAA,IACb,CAAC;AAAA,IACD,eAAe,IAAI,WAAW;AAAA,MAC1B,SAAS;AAAA,IACb,CAAC;AAAA,IACD,OAAO,IAAI,WAAW;AAAA,MAClB,sBAAsB,IAAI,WAAW;AAAA,MACrC,eAAe;AAAA,IACnB,CAAC;AAAA,IACD,OAAO,IAAI,WAAW;AAAA,MAClB,sBAAsB,IAAI,WAAW;AAAA,MACrC,eAAe;AAAA,IACnB,CAAC;AAAA,IACD,UAAU,IAAI,WAAW;AAAA,MACrB,SAAS;AAAA,IACb,CAAC;AAAA,IACD,OAAO,IAAI,WAAW;AAAA,MAClB,SAAS;AAAA,IACb,CAAC;AAAA,IACD,QAAQ,IAAI,WAAW;AAAA,MACnB,WAAW;AAAA,MACX,WAAW;AAAA,IACf,CAAC;AAAA,IACD,eAAe,IAAI,WAAW;AAAA,MAC1B,WAAW;AAAA,MACX,WAAW;AAAA,IACf,CAAC;AAAA,IACD,cAAc,IAAI,WAAW;AAAA,MACzB,SAAS;AAAA,IACb,CAAC;AAAA,IACD,QAAQ,IAAI,WAAW;AAAA,MACnB,aAAa,CAAC,UAAU,QAAQ,UAAU;AAAA,IAC9C,CAAC;AAAA,EACL;AACJ,CAAC;","names":[]}
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/schema/evaluatorSchemas.ts"],"sourcesContent":["import {\n ObjectType,\n NumberType,\n JsonObjectType,\n UnionType,\n StringType,\n NullType,\n BooleanType,\n TypeSchema,\n ArrayType,\n} from '../validation';\n\nfunction createJsonSchema(maximumDepth: number): TypeSchema {\n return new UnionType(\n new NullType(),\n new NumberType(),\n new BooleanType(),\n new StringType({maxLength: 255}),\n ...(maximumDepth > 1\n ? [\n new JsonObjectType({\n propertyNames: new UnionType(\n new NumberType(),\n new StringType({\n minLength: 1,\n maxLength: 50,\n }),\n ),\n properties: createJsonSchema(maximumDepth - 1),\n }),\n new ArrayType({items: createJsonSchema(maximumDepth - 1)}),\n ]\n : []\n ),\n );\n}\n\nexport const evaluationOptionsSchema = new ObjectType({\n properties: {\n timeout: new NumberType({\n integer: true,\n minimum: 0,\n }),\n attributes: new JsonObjectType({\n propertyNames: new StringType({\n minLength: 1,\n maxLength: 50,\n }),\n properties: createJsonSchema(5),\n }),\n },\n});\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wBAUO;AAEP,SAAS,iBAAiB,cAAkC;AACxD,SAAO,IAAI;AAAA,IACP,IAAI,2BAAS;AAAA,IACb,IAAI,6BAAW;AAAA,IACf,IAAI,8BAAY;AAAA,IAChB,IAAI,6BAAW,EAAC,WAAW,IAAG,CAAC;AAAA,IAC/B,GAAI,eAAe,IACb;AAAA,MACE,IAAI,iCAAe;AAAA,QACf,eAAe,IAAI;AAAA,UACf,IAAI,6BAAW;AAAA,UACf,IAAI,6BAAW;AAAA,YACX,WAAW;AAAA,YACX,WAAW;AAAA,UACf,CAAC;AAAA,QACL;AAAA,QACA,YAAY,iBAAiB,eAAe,CAAC;AAAA,MACjD,CAAC;AAAA,MACD,IAAI,4BAAU,EAAC,OAAO,iBAAiB,eAAe,CAAC,EAAC,CAAC;AAAA,IAC7D,IACE,CAAC;AAAA,EAEX;AACJ;AAEO,MAAM,0BAA0B,IAAI,6BAAW;AAAA,EAClD,YAAY;AAAA,IACR,SAAS,IAAI,6BAAW;AAAA,MACpB,SAAS;AAAA,MACT,SAAS;AAAA,IACb,CAAC;AAAA,IACD,YAAY,IAAI,iCAAe;AAAA,MAC3B,eAAe,IAAI,6BAAW;AAAA,QAC1B,WAAW;AAAA,QACX,WAAW;AAAA,MACf,CAAC;AAAA,MACD,YAAY,iBAAiB,CAAC;AAAA,IAClC,CAAC;AAAA,EACL;AACJ,CAAC;","names":[]}
@@ -1,2 +1,6 @@
1
- import { ObjectType } from '../validation';
2
- export declare const evaluationOptionsSchema: ObjectType;
1
+ import { ObjectType } from '../validation/objectType.js';
2
+ import '../validation/schema.js';
3
+
4
+ declare const evaluationOptionsSchema: ObjectType;
5
+
6
+ export { evaluationOptionsSchema };
@@ -1,34 +1,50 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.evaluationOptionsSchema = void 0;
4
- const validation_1 = require("../validation");
1
+ import {
2
+ ObjectType,
3
+ NumberType,
4
+ JsonObjectType,
5
+ UnionType,
6
+ StringType,
7
+ NullType,
8
+ BooleanType,
9
+ ArrayType
10
+ } from "../validation";
5
11
  function createJsonSchema(maximumDepth) {
6
- return new validation_1.UnionType(new validation_1.NullType(), new validation_1.NumberType(), new validation_1.BooleanType(), new validation_1.StringType({ maxLength: 255 }), ...(maximumDepth > 1
7
- ? [
8
- new validation_1.JsonObjectType({
9
- propertyNames: new validation_1.UnionType(new validation_1.NumberType(), new validation_1.StringType({
10
- minLength: 1,
11
- maxLength: 50,
12
- })),
13
- properties: createJsonSchema(maximumDepth - 1),
14
- }),
15
- new validation_1.ArrayType({ items: createJsonSchema(maximumDepth - 1) }),
16
- ]
17
- : []));
12
+ return new UnionType(
13
+ new NullType(),
14
+ new NumberType(),
15
+ new BooleanType(),
16
+ new StringType({ maxLength: 255 }),
17
+ ...maximumDepth > 1 ? [
18
+ new JsonObjectType({
19
+ propertyNames: new UnionType(
20
+ new NumberType(),
21
+ new StringType({
22
+ minLength: 1,
23
+ maxLength: 50
24
+ })
25
+ ),
26
+ properties: createJsonSchema(maximumDepth - 1)
27
+ }),
28
+ new ArrayType({ items: createJsonSchema(maximumDepth - 1) })
29
+ ] : []
30
+ );
18
31
  }
19
- exports.evaluationOptionsSchema = new validation_1.ObjectType({
20
- properties: {
21
- timeout: new validation_1.NumberType({
22
- integer: true,
23
- minimum: 0,
24
- }),
25
- attributes: new validation_1.JsonObjectType({
26
- propertyNames: new validation_1.StringType({
27
- minLength: 1,
28
- maxLength: 50,
29
- }),
30
- properties: createJsonSchema(5),
31
- }),
32
- },
32
+ const evaluationOptionsSchema = new ObjectType({
33
+ properties: {
34
+ timeout: new NumberType({
35
+ integer: true,
36
+ minimum: 0
37
+ }),
38
+ attributes: new JsonObjectType({
39
+ propertyNames: new StringType({
40
+ minLength: 1,
41
+ maxLength: 50
42
+ }),
43
+ properties: createJsonSchema(5)
44
+ })
45
+ }
33
46
  });
47
+ export {
48
+ evaluationOptionsSchema
49
+ };
34
50
  //# sourceMappingURL=evaluatorSchemas.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"evaluatorSchemas.js","sourceRoot":"","sources":["../src/schema/evaluatorSchemas.ts"],"names":[],"mappings":";;;AAAA,8CAUuB;AAEvB,SAAS,gBAAgB,CAAC,YAAoB;IAC1C,OAAO,IAAI,sBAAS,CAChB,IAAI,qBAAQ,EAAE,EACd,IAAI,uBAAU,EAAE,EAChB,IAAI,wBAAW,EAAE,EACjB,IAAI,uBAAU,CAAC,EAAC,SAAS,EAAE,GAAG,EAAC,CAAC,EAChC,GAAG,CAAC,YAAY,GAAG,CAAC;QAChB,CAAC,CAAC;YACE,IAAI,2BAAc,CAAC;gBACf,aAAa,EAAE,IAAI,sBAAS,CACxB,IAAI,uBAAU,EAAE,EAChB,IAAI,uBAAU,CAAC;oBACX,SAAS,EAAE,CAAC;oBACZ,SAAS,EAAE,EAAE;iBAChB,CAAC,CACL;gBACD,UAAU,EAAE,gBAAgB,CAAC,YAAY,GAAG,CAAC,CAAC;aACjD,CAAC;YACF,IAAI,sBAAS,CAAC,EAAC,KAAK,EAAE,gBAAgB,CAAC,YAAY,GAAG,CAAC,CAAC,EAAC,CAAC;SAC7D;QACD,CAAC,CAAC,EAAE,CACP,CACJ,CAAC;AACN,CAAC;AAEY,QAAA,uBAAuB,GAAG,IAAI,uBAAU,CAAC;IAClD,UAAU,EAAE;QACR,OAAO,EAAE,IAAI,uBAAU,CAAC;YACpB,OAAO,EAAE,IAAI;YACb,OAAO,EAAE,CAAC;SACb,CAAC;QACF,UAAU,EAAE,IAAI,2BAAc,CAAC;YAC3B,aAAa,EAAE,IAAI,uBAAU,CAAC;gBAC1B,SAAS,EAAE,CAAC;gBACZ,SAAS,EAAE,EAAE;aAChB,CAAC;YACF,UAAU,EAAE,gBAAgB,CAAC,CAAC,CAAC;SAClC,CAAC;KACL;CACJ,CAAC,CAAC"}
1
+ {"version":3,"sources":["../src/schema/evaluatorSchemas.ts"],"sourcesContent":["import {\n ObjectType,\n NumberType,\n JsonObjectType,\n UnionType,\n StringType,\n NullType,\n BooleanType,\n TypeSchema,\n ArrayType,\n} from '../validation';\n\nfunction createJsonSchema(maximumDepth: number): TypeSchema {\n return new UnionType(\n new NullType(),\n new NumberType(),\n new BooleanType(),\n new StringType({maxLength: 255}),\n ...(maximumDepth > 1\n ? [\n new JsonObjectType({\n propertyNames: new UnionType(\n new NumberType(),\n new StringType({\n minLength: 1,\n maxLength: 50,\n }),\n ),\n properties: createJsonSchema(maximumDepth - 1),\n }),\n new ArrayType({items: createJsonSchema(maximumDepth - 1)}),\n ]\n : []\n ),\n );\n}\n\nexport const evaluationOptionsSchema = new ObjectType({\n properties: {\n timeout: new NumberType({\n integer: true,\n minimum: 0,\n }),\n attributes: new JsonObjectType({\n propertyNames: new StringType({\n minLength: 1,\n maxLength: 50,\n }),\n properties: createJsonSchema(5),\n }),\n },\n});\n"],"mappings":"AAAA;AAAA,EACI;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAEA;AAAA,OACG;AAEP,SAAS,iBAAiB,cAAkC;AACxD,SAAO,IAAI;AAAA,IACP,IAAI,SAAS;AAAA,IACb,IAAI,WAAW;AAAA,IACf,IAAI,YAAY;AAAA,IAChB,IAAI,WAAW,EAAC,WAAW,IAAG,CAAC;AAAA,IAC/B,GAAI,eAAe,IACb;AAAA,MACE,IAAI,eAAe;AAAA,QACf,eAAe,IAAI;AAAA,UACf,IAAI,WAAW;AAAA,UACf,IAAI,WAAW;AAAA,YACX,WAAW;AAAA,YACX,WAAW;AAAA,UACf,CAAC;AAAA,QACL;AAAA,QACA,YAAY,iBAAiB,eAAe,CAAC;AAAA,MACjD,CAAC;AAAA,MACD,IAAI,UAAU,EAAC,OAAO,iBAAiB,eAAe,CAAC,EAAC,CAAC;AAAA,IAC7D,IACE,CAAC;AAAA,EAEX;AACJ;AAEO,MAAM,0BAA0B,IAAI,WAAW;AAAA,EAClD,YAAY;AAAA,IACR,SAAS,IAAI,WAAW;AAAA,MACpB,SAAS;AAAA,MACT,SAAS;AAAA,IACb,CAAC;AAAA,IACD,YAAY,IAAI,eAAe;AAAA,MAC3B,eAAe,IAAI,WAAW;AAAA,QAC1B,WAAW;AAAA,QACX,WAAW;AAAA,MACf,CAAC;AAAA,MACD,YAAY,iBAAiB,CAAC;AAAA,IAClC,CAAC;AAAA,EACL;AACJ,CAAC;","names":[]}
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/schema/eventSchemas.ts"],"sourcesContent":["import {\n ObjectType,\n StringType,\n NumberType,\n UnionType,\n NullType,\n BooleanType,\n ArrayType,\n} from '../validation';\nimport {cart, order, productDetails} from './ecommerceSchemas';\nimport {userProfileSchema} from './userSchema';\nimport {postDetails} from './contentSchemas';\n\nexport const cartModified = new ObjectType({\n required: ['cart'],\n properties: {\n cart: cart,\n },\n});\n\nexport const cartViewed = new ObjectType({\n required: ['cart'],\n properties: {\n cart: cart,\n },\n});\n\nexport const checkoutStarted = new ObjectType({\n required: ['cart'],\n properties: {\n cart: cart,\n orderId: new StringType({\n minLength: 1,\n maxLength: 50,\n }),\n },\n});\n\nexport const orderPlaced = new ObjectType({\n required: ['order'],\n properties: {\n order: order,\n },\n});\n\nexport const productViewed = new ObjectType({\n required: ['product'],\n properties: {\n product: productDetails,\n },\n});\n\nexport const userSignedUp = new ObjectType({\n required: ['userId'],\n properties: {\n userId: new StringType({\n minLength: 1,\n maxLength: 254,\n }),\n profile: userProfileSchema,\n },\n});\n\nexport const goalCompleted = new ObjectType({\n required: ['goalId'],\n properties: {\n goalId: new StringType({\n minLength: 3,\n maxLength: 100,\n pattern: /^[a-z0-9][a-z0-9:_-]+[a-z0-9]$/i,\n }),\n value: new NumberType({\n minimum: 0,\n }),\n currency: new StringType({\n minLength: 1,\n maxLength: 10,\n }),\n },\n});\n\nexport const interestShown = new ObjectType({\n required: ['interests'],\n properties: {\n interests: new ArrayType({\n items: new StringType({\n minLength: 1,\n maxLength: 50,\n }),\n minItems: 1,\n maxItems: 10,\n }),\n },\n});\n\nexport const postViewed = new ObjectType({\n required: ['post'],\n properties: {\n post: postDetails,\n },\n});\n\nexport const linkOpened = new ObjectType({\n required: ['link'],\n properties: {\n link: new StringType(),\n },\n});\n\nexport const eventOccurred = new ObjectType({\n required: ['name'],\n properties: {\n name: new StringType({\n minLength: 1,\n maxLength: 50,\n }),\n details: new ObjectType({\n additionalProperties: new UnionType(\n new NullType(),\n new BooleanType(),\n new NumberType(),\n new StringType({\n maxLength: 300,\n }),\n ),\n propertyNames: new StringType({\n minLength: 1,\n maxLength: 20,\n format: 'identifier',\n }),\n maxProperties: 10,\n }),\n },\n});\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wBAQO;AACP,8BAA0C;AAC1C,wBAAgC;AAChC,4BAA0B;AAEnB,MAAM,eAAe,IAAI,6BAAW;AAAA,EACvC,UAAU,CAAC,MAAM;AAAA,EACjB,YAAY;AAAA,IACR,MAAM;AAAA,EACV;AACJ,CAAC;AAEM,MAAM,aAAa,IAAI,6BAAW;AAAA,EACrC,UAAU,CAAC,MAAM;AAAA,EACjB,YAAY;AAAA,IACR,MAAM;AAAA,EACV;AACJ,CAAC;AAEM,MAAM,kBAAkB,IAAI,6BAAW;AAAA,EAC1C,UAAU,CAAC,MAAM;AAAA,EAC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,EACrC,UAAU,CAAC,MAAM;AAAA,EACjB,YAAY;AAAA,IACR,MAAM;AAAA,EACV;AACJ,CAAC;AAEM,MAAM,aAAa,IAAI,6BAAW;AAAA,EACrC,UAAU,CAAC,MAAM;AAAA,EACjB,YAAY;AAAA,IACR,MAAM,IAAI,6BAAW;AAAA,EACzB;AACJ,CAAC;AAEM,MAAM,gBAAgB,IAAI,6BAAW;AAAA,EACxC,UAAU,CAAC,MAAM;AAAA,EACjB,YAAY;AAAA,IACR,MAAM,IAAI,6BAAW;AAAA,MACjB,WAAW;AAAA,MACX,WAAW;AAAA,IACf,CAAC;AAAA,IACD,SAAS,IAAI,6BAAW;AAAA,MACpB,sBAAsB,IAAI;AAAA,QACtB,IAAI,2BAAS;AAAA,QACb,IAAI,8BAAY;AAAA,QAChB,IAAI,6BAAW;AAAA,QACf,IAAI,6BAAW;AAAA,UACX,WAAW;AAAA,QACf,CAAC;AAAA,MACL;AAAA,MACA,eAAe,IAAI,6BAAW;AAAA,QAC1B,WAAW;AAAA,QACX,WAAW;AAAA,QACX,QAAQ;AAAA,MACZ,CAAC;AAAA,MACD,eAAe;AAAA,IACnB,CAAC;AAAA,EACL;AACJ,CAAC;","names":[]}
@@ -1,12 +1,16 @@
1
- import { ObjectType } from '../validation';
2
- export declare const cartModified: ObjectType;
3
- export declare const cartViewed: ObjectType;
4
- export declare const checkoutStarted: ObjectType;
5
- export declare const orderPlaced: ObjectType;
6
- export declare const productViewed: ObjectType;
7
- export declare const userSignedUp: ObjectType;
8
- export declare const goalCompleted: ObjectType;
9
- export declare const interestShown: ObjectType;
10
- export declare const postViewed: ObjectType;
11
- export declare const linkOpened: ObjectType;
12
- export declare const eventOccurred: ObjectType;
1
+ import { ObjectType } from '../validation/objectType.js';
2
+ import '../validation/schema.js';
3
+
4
+ declare const cartModified: ObjectType;
5
+ declare const cartViewed: ObjectType;
6
+ declare const checkoutStarted: ObjectType;
7
+ declare const orderPlaced: ObjectType;
8
+ declare const productViewed: ObjectType;
9
+ declare const userSignedUp: ObjectType;
10
+ declare const goalCompleted: ObjectType;
11
+ declare const interestShown: ObjectType;
12
+ declare const postViewed: ObjectType;
13
+ declare const linkOpened: ObjectType;
14
+ declare const eventOccurred: ObjectType;
15
+
16
+ export { cartModified, cartViewed, checkoutStarted, eventOccurred, goalCompleted, interestShown, linkOpened, orderPlaced, postViewed, productViewed, userSignedUp };