@integration-app/react 0.1.1 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (262) hide show
  1. package/node_modules/@compwright/namecase/LICENSE +26 -0
  2. package/node_modules/@compwright/namecase/README.md +49 -0
  3. package/node_modules/@compwright/namecase/bin/namecase +28 -0
  4. package/node_modules/@compwright/namecase/dist/namecase.min.js +4 -0
  5. package/node_modules/@compwright/namecase/dist/namecase.min.js.map +1 -0
  6. package/node_modules/@compwright/namecase/package.json +46 -0
  7. package/node_modules/@compwright/namecase/src/index.js +146 -0
  8. package/node_modules/@integration-app/sdk/bundle.js +404 -262
  9. package/node_modules/@integration-app/sdk/bundle.js.map +1 -1
  10. package/node_modules/@integration-app/sdk/client.d.ts +3 -3
  11. package/node_modules/@integration-app/sdk/data-builder/formulas/case.d.ts +3 -7
  12. package/node_modules/@integration-app/sdk/data-builder/formulas/case.js +16 -32
  13. package/node_modules/@integration-app/sdk/data-builder/formulas/case.js.map +1 -1
  14. package/node_modules/@integration-app/sdk/integrations/accessors.d.ts +0 -6
  15. package/node_modules/@integration-app/sdk/integrations/accessors.js +1 -87
  16. package/node_modules/@integration-app/sdk/integrations/accessors.js.map +1 -1
  17. package/node_modules/@integration-app/sdk/json-schema/index.d.ts +1 -1
  18. package/node_modules/@integration-app/sdk/src/client.ts +3 -3
  19. package/node_modules/@integration-app/sdk/src/data-builder/formulas/case.test.ts +11 -113
  20. package/node_modules/@integration-app/sdk/src/data-builder/formulas/case.ts +22 -46
  21. package/node_modules/@integration-app/sdk/src/integrations/accessors.ts +2 -122
  22. package/node_modules/@sinclair/typebox/package.json +40 -0
  23. package/node_modules/@sinclair/typebox/readme.md +740 -0
  24. package/node_modules/@sinclair/typebox/typebox.d.ts +351 -0
  25. package/node_modules/@sinclair/typebox/typebox.js +345 -0
  26. package/node_modules/@types/node/README.md +16 -0
  27. package/node_modules/@types/node/assert.d.ts +128 -0
  28. package/node_modules/@types/node/async_hooks.d.ts +229 -0
  29. package/node_modules/@types/node/buffer.d.ts +89 -0
  30. package/node_modules/@types/node/child_process.d.ts +514 -0
  31. package/node_modules/@types/node/cluster.d.ts +265 -0
  32. package/node_modules/@types/node/console.d.ts +142 -0
  33. package/node_modules/@types/node/constants.d.ts +18 -0
  34. package/node_modules/@types/node/crypto.d.ts +1283 -0
  35. package/node_modules/@types/node/dgram.d.ts +144 -0
  36. package/node_modules/@types/node/dns.d.ts +387 -0
  37. package/node_modules/@types/node/domain.d.ts +27 -0
  38. package/node_modules/@types/node/events.d.ts +82 -0
  39. package/node_modules/@types/node/fs/promises.d.ts +572 -0
  40. package/node_modules/@types/node/fs.d.ts +2281 -0
  41. package/node_modules/@types/node/globals.d.ts +747 -0
  42. package/node_modules/@types/node/globals.global.d.ts +1 -0
  43. package/node_modules/@types/node/http.d.ts +580 -0
  44. package/node_modules/@types/node/http2.d.ts +962 -0
  45. package/node_modules/@types/node/https.d.ts +271 -0
  46. package/node_modules/@types/node/index.d.ts +98 -0
  47. package/node_modules/@types/node/inspector.d.ts +3051 -0
  48. package/node_modules/@types/node/module.d.ts +56 -0
  49. package/node_modules/@types/node/net.d.ts +308 -0
  50. package/node_modules/@types/node/os.d.ts +243 -0
  51. package/node_modules/@types/node/package.json +232 -0
  52. package/node_modules/@types/node/path.d.ts +168 -0
  53. package/node_modules/@types/node/perf_hooks.d.ts +274 -0
  54. package/node_modules/@types/node/process.d.ts +413 -0
  55. package/node_modules/@types/node/punycode.d.ts +78 -0
  56. package/node_modules/@types/node/querystring.d.ts +31 -0
  57. package/node_modules/@types/node/readline.d.ts +174 -0
  58. package/node_modules/@types/node/repl.d.ts +398 -0
  59. package/node_modules/@types/node/stream.d.ts +359 -0
  60. package/node_modules/@types/node/string_decoder.d.ts +10 -0
  61. package/node_modules/@types/node/timers.d.ts +19 -0
  62. package/node_modules/@types/node/tls.d.ts +784 -0
  63. package/node_modules/@types/node/trace_events.d.ts +64 -0
  64. package/node_modules/@types/node/ts4.8/assert.d.ts +128 -0
  65. package/node_modules/@types/node/ts4.8/async_hooks.d.ts +229 -0
  66. package/node_modules/@types/node/ts4.8/buffer.d.ts +89 -0
  67. package/node_modules/@types/node/ts4.8/child_process.d.ts +514 -0
  68. package/node_modules/@types/node/ts4.8/cluster.d.ts +265 -0
  69. package/node_modules/@types/node/ts4.8/console.d.ts +142 -0
  70. package/node_modules/@types/node/ts4.8/constants.d.ts +18 -0
  71. package/node_modules/@types/node/ts4.8/crypto.d.ts +1283 -0
  72. package/node_modules/@types/node/ts4.8/dgram.d.ts +144 -0
  73. package/node_modules/@types/node/ts4.8/dns.d.ts +387 -0
  74. package/node_modules/@types/node/ts4.8/domain.d.ts +27 -0
  75. package/node_modules/@types/node/ts4.8/events.d.ts +82 -0
  76. package/node_modules/@types/node/ts4.8/fs/promises.d.ts +572 -0
  77. package/node_modules/@types/node/ts4.8/fs.d.ts +2281 -0
  78. package/node_modules/@types/node/ts4.8/globals.d.ts +746 -0
  79. package/node_modules/@types/node/ts4.8/globals.global.d.ts +1 -0
  80. package/node_modules/@types/node/ts4.8/http.d.ts +580 -0
  81. package/node_modules/@types/node/ts4.8/http2.d.ts +962 -0
  82. package/node_modules/@types/node/ts4.8/https.d.ts +271 -0
  83. package/node_modules/@types/node/ts4.8/index.d.ts +53 -0
  84. package/node_modules/@types/node/ts4.8/inspector.d.ts +3051 -0
  85. package/node_modules/@types/node/ts4.8/module.d.ts +56 -0
  86. package/node_modules/@types/node/ts4.8/net.d.ts +308 -0
  87. package/node_modules/@types/node/ts4.8/os.d.ts +243 -0
  88. package/node_modules/@types/node/ts4.8/path.d.ts +168 -0
  89. package/node_modules/@types/node/ts4.8/perf_hooks.d.ts +274 -0
  90. package/node_modules/@types/node/ts4.8/process.d.ts +413 -0
  91. package/node_modules/@types/node/ts4.8/punycode.d.ts +78 -0
  92. package/node_modules/@types/node/ts4.8/querystring.d.ts +31 -0
  93. package/node_modules/@types/node/ts4.8/readline.d.ts +174 -0
  94. package/node_modules/@types/node/ts4.8/repl.d.ts +398 -0
  95. package/node_modules/@types/node/ts4.8/stream.d.ts +359 -0
  96. package/node_modules/@types/node/ts4.8/string_decoder.d.ts +10 -0
  97. package/node_modules/@types/node/ts4.8/timers.d.ts +19 -0
  98. package/node_modules/@types/node/ts4.8/tls.d.ts +784 -0
  99. package/node_modules/@types/node/ts4.8/trace_events.d.ts +64 -0
  100. package/node_modules/@types/node/ts4.8/tty.d.ts +69 -0
  101. package/node_modules/@types/node/ts4.8/url.d.ts +149 -0
  102. package/node_modules/@types/node/ts4.8/util.d.ts +216 -0
  103. package/node_modules/@types/node/ts4.8/v8.d.ts +190 -0
  104. package/node_modules/@types/node/ts4.8/vm.d.ts +155 -0
  105. package/node_modules/@types/node/ts4.8/wasi.d.ts +89 -0
  106. package/node_modules/@types/node/ts4.8/worker_threads.d.ts +241 -0
  107. package/node_modules/@types/node/ts4.8/zlib.d.ts +364 -0
  108. package/node_modules/@types/node/tty.d.ts +69 -0
  109. package/node_modules/@types/node/url.d.ts +149 -0
  110. package/node_modules/@types/node/util.d.ts +216 -0
  111. package/node_modules/@types/node/v8.d.ts +190 -0
  112. package/node_modules/@types/node/vm.d.ts +155 -0
  113. package/node_modules/@types/node/wasi.d.ts +89 -0
  114. package/node_modules/@types/node/worker_threads.d.ts +241 -0
  115. package/node_modules/@types/node/zlib.d.ts +364 -0
  116. package/package.json +2 -5
  117. package/node_modules/@integration-app/sdk/.DS_Store +0 -0
  118. package/node_modules/@integration-app/sdk/.gitignore +0 -11
  119. package/node_modules/@integration-app/sdk/.npmignore +0 -0
  120. package/node_modules/@integration-app/sdk/app-data-collections/app-data-collections.d.ts +0 -23
  121. package/node_modules/@integration-app/sdk/app-data-collections/app-data-collections.js.map +0 -1
  122. package/node_modules/@integration-app/sdk/app-data-schemas/app-data-schemas.d.ts +0 -20
  123. package/node_modules/@integration-app/sdk/app-data-schemas/app-data-schemas.js.map +0 -1
  124. package/node_modules/@integration-app/sdk/app-events/app-events.d.ts +0 -44
  125. package/node_modules/@integration-app/sdk/app-events/app-events.js.map +0 -1
  126. package/node_modules/@integration-app/sdk/connection-client.d.ts +0 -12
  127. package/node_modules/@integration-app/sdk/connection-client.js +0 -31
  128. package/node_modules/@integration-app/sdk/connection-client.js.map +0 -1
  129. package/node_modules/@integration-app/sdk/connections/connections.d.ts +0 -46
  130. package/node_modules/@integration-app/sdk/connections/connections.js.map +0 -1
  131. package/node_modules/@integration-app/sdk/connector-api/connector-api.d.ts +0 -157
  132. package/node_modules/@integration-app/sdk/connector-api/connector-api.js.map +0 -1
  133. package/node_modules/@integration-app/sdk/data-builder/findExternalRecordId.d.ts +0 -0
  134. package/node_modules/@integration-app/sdk/data-builder/findExternalRecordId.js.map +0 -1
  135. package/node_modules/@integration-app/sdk/data-builder/first-name.test.d.ts +0 -0
  136. package/node_modules/@integration-app/sdk/data-builder/first-name.test.js +0 -2
  137. package/node_modules/@integration-app/sdk/data-builder/first-name.test.js.map +0 -1
  138. package/node_modules/@integration-app/sdk/data-builder/formulas/anyOfOption.d.ts +0 -10
  139. package/node_modules/@integration-app/sdk/data-builder/formulas/anyOfOption.js.map +0 -1
  140. package/node_modules/@integration-app/sdk/data-builder/formulas/base.test.d.ts +0 -1
  141. package/node_modules/@integration-app/sdk/data-builder/formulas/base.test.js +0 -26
  142. package/node_modules/@integration-app/sdk/data-builder/formulas/base.test.js.map +0 -1
  143. package/node_modules/@integration-app/sdk/data-builder/formulas/case.test.d.ts +0 -1
  144. package/node_modules/@integration-app/sdk/data-builder/formulas/case.test.js +0 -246
  145. package/node_modules/@integration-app/sdk/data-builder/formulas/case.test.js.map +0 -1
  146. package/node_modules/@integration-app/sdk/data-builder/formulas/concat.test.d.ts +0 -1
  147. package/node_modules/@integration-app/sdk/data-builder/formulas/concat.test.js +0 -85
  148. package/node_modules/@integration-app/sdk/data-builder/formulas/concat.test.js.map +0 -1
  149. package/node_modules/@integration-app/sdk/data-builder/formulas/copy.test.d.ts +0 -1
  150. package/node_modules/@integration-app/sdk/data-builder/formulas/copy.test.js +0 -64
  151. package/node_modules/@integration-app/sdk/data-builder/formulas/copy.test.js.map +0 -1
  152. package/node_modules/@integration-app/sdk/data-builder/formulas/extractDate.test.d.ts +0 -1
  153. package/node_modules/@integration-app/sdk/data-builder/formulas/extractDate.test.js +0 -44
  154. package/node_modules/@integration-app/sdk/data-builder/formulas/extractDate.test.js.map +0 -1
  155. package/node_modules/@integration-app/sdk/data-builder/formulas/extractTime.test.d.ts +0 -1
  156. package/node_modules/@integration-app/sdk/data-builder/formulas/extractTime.test.js +0 -44
  157. package/node_modules/@integration-app/sdk/data-builder/formulas/extractTime.test.js.map +0 -1
  158. package/node_modules/@integration-app/sdk/data-builder/formulas/findAppRecordId.test.d.ts +0 -1
  159. package/node_modules/@integration-app/sdk/data-builder/formulas/findAppRecordId.test.js +0 -26
  160. package/node_modules/@integration-app/sdk/data-builder/formulas/findAppRecordId.test.js.map +0 -1
  161. package/node_modules/@integration-app/sdk/data-builder/formulas/findExternalRecordId.test.d.ts +0 -1
  162. package/node_modules/@integration-app/sdk/data-builder/formulas/findExternalRecordId.test.js +0 -26
  163. package/node_modules/@integration-app/sdk/data-builder/formulas/findExternalRecordId.test.js.map +0 -1
  164. package/node_modules/@integration-app/sdk/data-builder/formulas/first-name.test.d.ts +0 -1
  165. package/node_modules/@integration-app/sdk/data-builder/formulas/first-name.test.js +0 -14
  166. package/node_modules/@integration-app/sdk/data-builder/formulas/first-name.test.js.map +0 -1
  167. package/node_modules/@integration-app/sdk/data-builder/formulas/index.test.d.ts +0 -1
  168. package/node_modules/@integration-app/sdk/data-builder/formulas/index.test.js +0 -63
  169. package/node_modules/@integration-app/sdk/data-builder/formulas/index.test.js.map +0 -1
  170. package/node_modules/@integration-app/sdk/data-builder/formulas/iterate.test.d.ts +0 -1
  171. package/node_modules/@integration-app/sdk/data-builder/formulas/iterate.test.js +0 -112
  172. package/node_modules/@integration-app/sdk/data-builder/formulas/iterate.test.js.map +0 -1
  173. package/node_modules/@integration-app/sdk/data-builder/formulas/lookup.test.d.ts +0 -1
  174. package/node_modules/@integration-app/sdk/data-builder/formulas/lookup.test.js +0 -18
  175. package/node_modules/@integration-app/sdk/data-builder/formulas/lookup.test.js.map +0 -1
  176. package/node_modules/@integration-app/sdk/data-builder/formulas/map.test.d.ts +0 -1
  177. package/node_modules/@integration-app/sdk/data-builder/formulas/map.test.js +0 -114
  178. package/node_modules/@integration-app/sdk/data-builder/formulas/map.test.js.map +0 -1
  179. package/node_modules/@integration-app/sdk/data-builder/formulas/tpl.test.d.ts +0 -1
  180. package/node_modules/@integration-app/sdk/data-builder/formulas/tpl.test.js +0 -49
  181. package/node_modules/@integration-app/sdk/data-builder/formulas/tpl.test.js.map +0 -1
  182. package/node_modules/@integration-app/sdk/data-builder/formulas/types.d.ts +0 -0
  183. package/node_modules/@integration-app/sdk/data-builder/formulas/types.js.map +0 -1
  184. package/node_modules/@integration-app/sdk/data-builder/index.test.d.ts +0 -1
  185. package/node_modules/@integration-app/sdk/data-builder/index.test.js +0 -295
  186. package/node_modules/@integration-app/sdk/data-builder/index.test.js.map +0 -1
  187. package/node_modules/@integration-app/sdk/data-builder/locators.test.d.ts +0 -1
  188. package/node_modules/@integration-app/sdk/data-builder/locators.test.js +0 -775
  189. package/node_modules/@integration-app/sdk/data-builder/locators.test.js.map +0 -1
  190. package/node_modules/@integration-app/sdk/data-filter/conditions.d.ts +0 -0
  191. package/node_modules/@integration-app/sdk/data-filter/conditions.js.map +0 -1
  192. package/node_modules/@integration-app/sdk/data-filter/data-filter.test.d.ts +0 -1
  193. package/node_modules/@integration-app/sdk/data-filter/data-filter.test.js.map +0 -1
  194. package/node_modules/@integration-app/sdk/data-filter/index.test.d.ts +0 -1
  195. package/node_modules/@integration-app/sdk/data-filter/index.test.js +0 -43
  196. package/node_modules/@integration-app/sdk/data-filter/index.test.js.map +0 -1
  197. package/node_modules/@integration-app/sdk/data-filter/operators.test.d.ts +0 -1
  198. package/node_modules/@integration-app/sdk/data-filter/operators.test.js +0 -490
  199. package/node_modules/@integration-app/sdk/data-filter/operators.test.js.map +0 -1
  200. package/node_modules/@integration-app/sdk/data-links/data-links.d.ts +0 -58
  201. package/node_modules/@integration-app/sdk/data-links/data-links.js.map +0 -1
  202. package/node_modules/@integration-app/sdk/data-schema/index.test.d.ts +0 -1
  203. package/node_modules/@integration-app/sdk/data-schema/index.test.js +0 -86
  204. package/node_modules/@integration-app/sdk/data-schema/index.test.js.map +0 -1
  205. package/node_modules/@integration-app/sdk/data-sources/data-sources.d.ts +0 -41
  206. package/node_modules/@integration-app/sdk/data-sources/data-sources.js.map +0 -1
  207. package/node_modules/@integration-app/sdk/endpoints/endpoint-spec.d.ts +0 -30
  208. package/node_modules/@integration-app/sdk/endpoints/endpoint-spec.js.map +0 -1
  209. package/node_modules/@integration-app/sdk/field-mappings/field-mappings.d.ts +0 -29
  210. package/node_modules/@integration-app/sdk/field-mappings/field-mappings.js.map +0 -1
  211. package/node_modules/@integration-app/sdk/flow-runs/flow-runs.d.ts +0 -51
  212. package/node_modules/@integration-app/sdk/flow-runs/flow-runs.js.map +0 -1
  213. package/node_modules/@integration-app/sdk/flows/flows.d.ts +0 -156
  214. package/node_modules/@integration-app/sdk/flows/flows.js.map +0 -1
  215. package/node_modules/@integration-app/sdk/flows/nodes/data-record-delete-trigger.d.ts +0 -3
  216. package/node_modules/@integration-app/sdk/flows/nodes/data-record-delete-trigger.js.map +0 -1
  217. package/node_modules/@integration-app/sdk/flows/nodes/nodes.d.ts +0 -25
  218. package/node_modules/@integration-app/sdk/flows/nodes/nodes.js.map +0 -1
  219. package/node_modules/@integration-app/sdk/flows/utils.test.d.ts +0 -1
  220. package/node_modules/@integration-app/sdk/flows/utils.test.js +0 -62
  221. package/node_modules/@integration-app/sdk/flows/utils.test.js.map +0 -1
  222. package/node_modules/@integration-app/sdk/integration-elements/integration-elements.d.ts +0 -21
  223. package/node_modules/@integration-app/sdk/integration-elements/integration-elements.js.map +0 -1
  224. package/node_modules/@integration-app/sdk/integrations/integrations.d.ts +0 -48
  225. package/node_modules/@integration-app/sdk/integrations/integrations.js.map +0 -1
  226. package/node_modules/@integration-app/sdk/json-schema/json-schema.test.d.ts +0 -1
  227. package/node_modules/@integration-app/sdk/json-schema/json-schema.test.js +0 -194
  228. package/node_modules/@integration-app/sdk/json-schema/json-schema.test.js.map +0 -1
  229. package/node_modules/@integration-app/sdk/json-schema/schema-builder.test.d.ts +0 -1
  230. package/node_modules/@integration-app/sdk/json-schema/schema-builder.test.js +0 -352
  231. package/node_modules/@integration-app/sdk/json-schema/schema-builder.test.js.map +0 -1
  232. package/node_modules/@integration-app/sdk/jwt.test.d.ts +0 -1
  233. package/node_modules/@integration-app/sdk/jwt.test.js +0 -9
  234. package/node_modules/@integration-app/sdk/jwt.test.js.map +0 -1
  235. package/node_modules/@integration-app/sdk/package-lock.json +0 -3834
  236. package/node_modules/@integration-app/sdk/udm/activities.test.d.ts +0 -1
  237. package/node_modules/@integration-app/sdk/udm/activities.test.js +0 -40
  238. package/node_modules/@integration-app/sdk/udm/activities.test.js.map +0 -1
  239. package/node_modules/@integration-app/sdk/udm/campaign-members.d.ts +0 -45
  240. package/node_modules/@integration-app/sdk/udm/campaign-members.js +0 -99
  241. package/node_modules/@integration-app/sdk/udm/campaign-members.js.map +0 -1
  242. package/node_modules/@integration-app/sdk/udm/contacts.test.d.ts +0 -1
  243. package/node_modules/@integration-app/sdk/udm/contacts.test.js +0 -136
  244. package/node_modules/@integration-app/sdk/udm/contacts.test.js.map +0 -1
  245. package/node_modules/@integration-app/sdk/udm/crm-activities.d.ts +0 -17
  246. package/node_modules/@integration-app/sdk/udm/crm-activities.js.map +0 -1
  247. package/node_modules/@integration-app/sdk/udm/crm-activity.d.ts +0 -11
  248. package/node_modules/@integration-app/sdk/udm/crm-activity.js.map +0 -1
  249. package/node_modules/@integration-app/sdk/udm/crm-companies.d.ts +0 -14
  250. package/node_modules/@integration-app/sdk/udm/crm-companies.js.map +0 -1
  251. package/node_modules/@integration-app/sdk/udm/crm-contact.d.ts +0 -10
  252. package/node_modules/@integration-app/sdk/udm/crm-contact.js.map +0 -1
  253. package/node_modules/@integration-app/sdk/udm/crm-contacts.d.ts +0 -16
  254. package/node_modules/@integration-app/sdk/udm/crm-contacts.js.map +0 -1
  255. package/node_modules/@integration-app/sdk/udm/crm-deals.d.ts +0 -15
  256. package/node_modules/@integration-app/sdk/udm/crm-deals.js.map +0 -1
  257. package/node_modules/@integration-app/sdk/udm/crm-leads.d.ts +0 -16
  258. package/node_modules/@integration-app/sdk/udm/crm-leads.js.map +0 -1
  259. package/node_modules/@integration-app/sdk/udm/members.d.ts +0 -45
  260. package/node_modules/@integration-app/sdk/udm/members.js.map +0 -1
  261. package/node_modules/@integration-app/sdk/users/users.d.ts +0 -5
  262. package/node_modules/@integration-app/sdk/users/users.js.map +0 -1
@@ -1,20 +0,0 @@
1
- import { ErrorData } from './errors';
2
- import { HttpRequestSpec } from './http-requests';
3
- import { User } from './users';
4
- export interface AppDataSchema {
5
- id: string;
6
- key: string;
7
- name: string;
8
- schema: any;
9
- request?: HttpRequestSpec;
10
- }
11
- export interface AppDataSchemaInstance {
12
- id: string;
13
- appId: string;
14
- userId: string;
15
- user?: User;
16
- appDataSchemaId: string;
17
- appDataSchema?: AppDataSchema;
18
- schema?: any;
19
- error?: ErrorData;
20
- }
@@ -1 +0,0 @@
1
- {"version":3,"file":"app-data-schemas.js","sourceRoot":"","sources":["../src/app-data-schemas/app-data-schemas.ts"],"names":[],"mappings":""}
@@ -1,44 +0,0 @@
1
- import { PaginationQuery, PaginationResponse } from './entity-repository';
2
- import { HttpRequestSpec } from './http-requests';
3
- import { User } from './users';
4
- export interface AppEventType {
5
- id: string;
6
- key: string;
7
- name: string;
8
- subscribeRequest?: HttpRequestSpec;
9
- example?: any;
10
- schema?: any;
11
- globalWebhookUri: string;
12
- userIdFormula?: any;
13
- }
14
- export interface AppEventSubscription {
15
- id: string;
16
- appEventTypeId: string;
17
- appEventType?: AppEventType;
18
- userId: string;
19
- user?: User;
20
- isSubscribed: boolean;
21
- webhookUri: string;
22
- subscriptionRequest: HttpRequestSpec;
23
- subscriptionResponse?: any;
24
- }
25
- export interface AppEvent {
26
- id: string;
27
- userId: string;
28
- user?: User;
29
- appEventTypeId: string;
30
- appEventType?: AppEventType;
31
- appEventSubscriptionId: string;
32
- appEventSubscription?: AppEventSubscription;
33
- event: any;
34
- datetime: string;
35
- }
36
- export interface FindAppEventsQuery extends PaginationQuery {
37
- userId?: string;
38
- appEventId?: string;
39
- appEventInstanceId?: string;
40
- startDatetime?: string;
41
- endDatetime?: string;
42
- }
43
- export interface FindAppEventsResponse extends PaginationResponse<AppEvent> {
44
- }
@@ -1 +0,0 @@
1
- {"version":3,"file":"app-events.js","sourceRoot":"","sources":["../src/app-events/app-events.ts"],"names":[],"mappings":""}
@@ -1,12 +0,0 @@
1
- import { IntegrationAppClient } from './client';
2
- import { DataCollection } from './connector-api';
3
- export declare class ConnectionClient {
4
- private connectionId;
5
- private engineClient;
6
- constructor(connectionId: string, engineClient: IntegrationAppClient);
7
- request(uri: string, payload?: any): Promise<any>;
8
- private cachedCollections;
9
- getDataCollection(uri: string): Promise<DataCollection>;
10
- executeOperation(uri: any, operation: any, payload?: any): Promise<any>;
11
- private makeOperationUri;
12
- }
@@ -1,31 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ConnectionClient = void 0;
4
- const tslib_1 = require("tslib");
5
- const url_join_1 = (0, tslib_1.__importDefault)(require("url-join"));
6
- class ConnectionClient {
7
- constructor(connectionId, engineClient) {
8
- this.connectionId = connectionId;
9
- this.engineClient = engineClient;
10
- this.cachedCollections = {};
11
- }
12
- async request(uri, payload) {
13
- const uriWithSlash = (uri === null || uri === void 0 ? void 0 : uri.startsWith('/')) ? uri : `/${uri !== null && uri !== void 0 ? uri : ''}`;
14
- return this.engineClient.post(`/connections/${this.connectionId}/api${uriWithSlash}`, payload);
15
- }
16
- async getDataCollection(uri) {
17
- if (!this.cachedCollections[uri]) {
18
- this.cachedCollections[uri] = this.request(uri);
19
- }
20
- return this.cachedCollections[uri];
21
- }
22
- async executeOperation(uri, operation, payload) {
23
- return this.request(this.makeOperationUri(uri, operation), payload);
24
- }
25
- makeOperationUri(resourceUri, operation) {
26
- const [uri, query] = resourceUri.split('?');
27
- return (0, url_join_1.default)(uri, operation, query ? `?${query}` : '');
28
- }
29
- }
30
- exports.ConnectionClient = ConnectionClient;
31
- //# sourceMappingURL=connection-client.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"connection-client.js","sourceRoot":"","sources":["src/connection-client.ts"],"names":[],"mappings":";;;;AAEA,qEAA8B;AAE9B,MAAa,gBAAgB;IAC3B,YACU,YAAoB,EACpB,YAAkC;QADlC,iBAAY,GAAZ,YAAY,CAAQ;QACpB,iBAAY,GAAZ,YAAY,CAAsB;QAWpC,sBAAiB,GAA4C,EAAE,CAAA;IAVpE,CAAC;IAEG,KAAK,CAAC,OAAO,CAAC,GAAW,EAAE,OAAa;QAC7C,MAAM,YAAY,GAAG,CAAA,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,UAAU,CAAC,GAAG,CAAC,EAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,GAAG,aAAH,GAAG,cAAH,GAAG,GAAI,EAAE,EAAE,CAAA;QACjE,OAAO,IAAI,CAAC,YAAY,CAAC,IAAI,CAC3B,gBAAgB,IAAI,CAAC,YAAY,OAAO,YAAY,EAAE,EACtD,OAAO,CACR,CAAA;IACH,CAAC;IAIM,KAAK,CAAC,iBAAiB,CAAC,GAAW;QACxC,IAAI,CAAC,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAC,EAAE;YAChC,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAA;SAChD;QACD,OAAO,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAC,CAAA;IACpC,CAAC;IAEM,KAAK,CAAC,gBAAgB,CAAC,GAAG,EAAE,SAAS,EAAE,OAAa;QACzD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,gBAAgB,CAAC,GAAG,EAAE,SAAS,CAAC,EAAE,OAAO,CAAC,CAAA;IACrE,CAAC;IAEO,gBAAgB,CAAC,WAAmB,EAAE,SAAiB;QAC7D,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,GAAG,WAAW,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;QAC3C,OAAO,IAAA,kBAAO,EAAC,GAAG,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC,CAAC,IAAI,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAA;IAC1D,CAAC;CACF;AA/BD,4CA+BC"}
@@ -1,46 +0,0 @@
1
- import { PaginationQuery, PaginationResponse } from './entity-repository';
2
- import { IntegrationAppClient } from './client';
3
- import { ConnectionFlowInstanceAccessor } from './flows';
4
- import { User } from './users';
5
- import { ConnectionDataLinkTableInstancesAccessor } from './data-links/accessors';
6
- export declare class Connection {
7
- id: string;
8
- name: string;
9
- userId: string;
10
- user?: User;
11
- isDefunct?: boolean;
12
- integrationId: string;
13
- createdAt: string;
14
- updatedAt: string;
15
- archiveddAt?: string;
16
- }
17
- export declare class FindConnectionsQuery extends PaginationQuery {
18
- integrationKey?: string;
19
- includeArchived?: boolean;
20
- connectorKey?: string;
21
- }
22
- export declare class FindConnectionsResponse extends PaginationResponse<Connection> {
23
- }
24
- export declare class ConnectionsAccessor {
25
- private client;
26
- constructor(client: IntegrationAppClient);
27
- find(query: FindConnectionsQuery): Promise<FindConnectionsResponse>;
28
- create(connection: Connection): Promise<Connection>;
29
- update(connection: Connection): Promise<Connection>;
30
- archive(connectionId: string): Promise<Connection>;
31
- }
32
- export declare class BaseConnectionAccessor {
33
- protected client: IntegrationAppClient;
34
- baseUri: string;
35
- constructor(client: IntegrationAppClient, baseUri: string);
36
- connect(): Promise<Connection>;
37
- refresh(): Promise<void>;
38
- delete(): Promise<void>;
39
- }
40
- export declare class ConnectionAccessor extends BaseConnectionAccessor {
41
- protected client: IntegrationAppClient;
42
- id: string;
43
- constructor(client: IntegrationAppClient, id: string);
44
- flow(identifier: string): ConnectionFlowInstanceAccessor;
45
- get dataLinkTables(): ConnectionDataLinkTableInstancesAccessor;
46
- }
@@ -1 +0,0 @@
1
- {"version":3,"file":"connections.js","sourceRoot":"","sources":["../src/connections/connections.ts"],"names":[],"mappings":";;;AAAA,2DAAyE;AAEzE,mCAAwD;AACxD,qCAAqC;AAErC,sDAAiF;AAEjF,MAAa,UAAU;CA2BtB;AA3BD,gCA2BC;AAED,MAAa,oBAAqB,SAAQ,mCAAe;CAOxD;AAPD,oDAOC;AAED,MAAa,uBAAwB,SAAQ,sCAA8B;CAAG;AAA9E,0DAA8E;AAE9E,MAAa,mBAAmB;IAC9B,YAAoB,MAA4B;QAA5B,WAAM,GAAN,MAAM,CAAsB;IAAG,CAAC;IAEpD,KAAK,CAAC,IAAI,CAAC,KAA2B;QACpC,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,cAAc,EAAE,KAAK,CAAC,CAAA;IAC/C,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,UAAsB;QACjC,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,cAAc,EAAE,UAAU,CAAC,CAAA;IACrD,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,UAAsB;QACjC,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,gBAAgB,UAAU,CAAC,EAAE,EAAE,EAAE,UAAU,CAAC,CAAA;IACrE,CAAC;IAED,KAAK,CAAC,OAAO,CAAC,YAAoB;QAChC,OAAO,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,gBAAgB,YAAY,EAAE,CAAC,CAAA;IAC3D,CAAC;CACF;AAlBD,kDAkBC;AAED,MAAa,sBAAsB;IACjC,YAAsB,MAA4B,EAAS,OAAe;QAApD,WAAM,GAAN,MAAM,CAAsB;QAAS,YAAO,GAAP,OAAO,CAAQ;IAAG,CAA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AC,CAAA;IAC1E,CAAC;IAED,IAAI,cAAc;QAChB,OAAO,IAAI,oDAAwC,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,EAAE,CAAC,CAAA;IAC3E,CAAC;CACF;AAZD,gDAYC"}
@@ -1,157 +0,0 @@
1
- import { ConnectionMode } from './integrations';
2
- import { DataCollectionEvent, DataRecord } from './data-collections';
3
- export interface ConnectorSpec {
4
- name: string;
5
- logoUri: string;
6
- auth: {
7
- authorizeUri: string;
8
- tokenUri: string;
9
- };
10
- ui?: {
11
- description: string;
12
- schema: any;
13
- helpUri?: string;
14
- test: boolean;
15
- };
16
- parametersSchema?: any;
17
- connectionMode?: ConnectionMode;
18
- data?: ConnectorDataSpec;
19
- }
20
- export declare class ConnectorSpec {
21
- constructor(opts: ConnectorSpec);
22
- }
23
- export declare enum DataLocationType {
24
- directory = "directory",
25
- collection = "collection"
26
- }
27
- export interface DataLocationSpec {
28
- path?: string;
29
- name?: string;
30
- type?: DataLocationType;
31
- read?: boolean;
32
- write?: boolean;
33
- uri?: string;
34
- }
35
- export declare type DataLocation = DataLocationSpec;
36
- export interface ConnectorDataSpec {
37
- root: DataLocationSpec;
38
- [key: string]: DataLocationSpec;
39
- }
40
- export interface DataCollectionSpec {
41
- type: DataLocationType.collection;
42
- name: string;
43
- fieldsSchema?: any;
44
- find?: DataCollectionFindSpec;
45
- findById?: DataCollectionFindByIdSpec;
46
- create?: DataCollectionCreateSpec;
47
- update?: DataCollectionUpdateSpec;
48
- delete?: DataCollectionDeleteSpec;
49
- }
50
- export declare type DataCollection = DataCollectionSpec;
51
- export interface DataDirectorySpec {
52
- type: DataLocationType.directory;
53
- name?: string;
54
- }
55
- interface DataCollectionOperationResponse {
56
- logs?: any[];
57
- }
58
- export interface DataCollectionFindSpec {
59
- queryFields?: string[];
60
- }
61
- export interface DataCollectionFindByIdSpec {
62
- }
63
- export interface DataCollectionCreateSpec {
64
- fields?: string[];
65
- requiredFields?: string[];
66
- excludeFields?: string[];
67
- }
68
- export interface DataCollectionUpdateSpec {
69
- fields?: string[];
70
- excludeFields?: string[];
71
- }
72
- export interface DataCollectionDeleteSpec {
73
- }
74
- export interface DataCollectionFindRequest {
75
- query?: any;
76
- cursor?: string;
77
- udm?: string;
78
- }
79
- export interface DataCollectionFindResponse extends DataCollectionOperationResponse {
80
- records: DataRecord[];
81
- cursor?: string;
82
- }
83
- export interface DataCollectionFindByIdRequest {
84
- id: string;
85
- udm?: string;
86
- }
87
- export interface DataCollectionFindByIdResponse extends DataCollectionOperationResponse {
88
- record: DataRecord;
89
- }
90
- export interface DataCollectionCreateRequest {
91
- fields: Record<string, any>;
92
- }
93
- export interface DataCollectionCreateResponse extends DataCollectionOperationResponse, DataRecord {
94
- }
95
- export interface DataCollectionUpdateRequest {
96
- id: string;
97
- fields: Record<string, any>;
98
- }
99
- export interface DataCollectionUpdateResponse extends DataCollectionOperationResponse, DataRecord {
100
- }
101
- export interface DataCollectionDeleteRequest {
102
- id: string;
103
- }
104
- export interface DataCollectionDeleteResponse extends DataCollectionOperationResponse {
105
- }
106
- export interface DataCollectionSubscribeRequest {
107
- events?: {
108
- created?: boolean;
109
- updated?: boolean;
110
- deleted?: boolean;
111
- };
112
- udm?: string;
113
- webhookUri: string;
114
- }
115
- export interface DataCollectionSubscribeResponse {
116
- subscriptionId: string;
117
- pullIntervalSeconds?: number;
118
- cursor?: string;
119
- }
120
- export interface DataCollectionUpdateSubscriptionRequest extends DataCollectionSubscribeRequest {
121
- subscriptionId: string;
122
- cursor?: string;
123
- }
124
- export interface DataCollectionUpdateSubscriptionResponse extends Omit<DataCollectionSubscribeResponse, 'subscriptionId'> {
125
- }
126
- export interface DataCollectionUnsubscribeRequest {
127
- subscriptionId: string;
128
- }
129
- export interface DataCollectionUnsubscribeResponse {
130
- }
131
- export interface DataCollectionEventsRequest {
132
- subscriptionId: string;
133
- cursor: string;
134
- }
135
- export interface DataCollectionEventsResponse {
136
- events: DataCollectionEvent[];
137
- cursor: string;
138
- }
139
- export interface DataEventWebhookPayload {
140
- subscriptionId: string;
141
- events: DataCollectionEvent[];
142
- }
143
- export interface DataCollectionParseUnifiedFieldsRequest {
144
- udm: string;
145
- unifiedFields: Record<string, any>;
146
- }
147
- export interface DataCollectionParseUnifiedFieldsResponse {
148
- fields: any;
149
- }
150
- export interface DataDirectoryListRequest {
151
- cursor?: string;
152
- }
153
- export interface DataDirectoryListResponse {
154
- locations: DataLocationSpec[];
155
- cursor?: string;
156
- }
157
- export {};
@@ -1 +0,0 @@
1
- {"version":3,"file":"connector-api.js","sourceRoot":"","sources":["../src/connector-api/connector-api.ts"],"names":[],"mappings":";;;AA2BA,MAAa,aAAa;IACxB,YAAY,IAAmB;QAC7B,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,CAAA;IAC3B,CAAC;CACF;AAJD,sCAIC;AAED,IAAY,gBAGX;AAHD,WAAY,gBAAgB;IAC1B,2CAAuB,CAAA;IACvB,6CAAyB,CAAA;AAC3B,CAAC,EAHW,gBAAgB,GAAhB,wBAAgB,KAAhB,wBAAgB,QAG3B"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"findExternalRecordId.js","sourceRoot":"","sources":["../src/data-builder/findExternalRecordId.ts"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- "use strict";
2
- //# sourceMappingURL=first-name.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"first-name.test.js","sourceRoot":"","sources":["../src/data-builder/first-name.test.ts"],"names":[],"mappings":""}
@@ -1,10 +0,0 @@
1
- import { DataBuilderFormulaBase } from './base';
2
- export declare class DataBuilderFormulaAnyOfOption extends DataBuilderFormulaBase {
3
- index: any;
4
- value: any;
5
- constructor(index: any, value: any);
6
- getValue({ context }: {
7
- context: any;
8
- }): Promise<any>;
9
- getSchema(variablesSchema: any): any;
10
- }
@@ -1 +0,0 @@
1
- {"version":3,"file":"anyOfOption.js","sourceRoot":"","sources":["../../src/data-builder/formulas/anyOfOption.ts"],"names":[],"mappings":";;;AAAA,wBAA4E;AAC5E,iCAA+C;AAE/C,MAAa,6BAA8B,SAAQ,6BAAsB;IACvE,YAAmB,KAAK,EAAS,KAAU;QACzC,KAAK,EAAE,CAAA;QADU,UAAK,GAAL,KAAK,CAAA;QAAS,UAAK,GAAL,KAAK,CAAK;QAEzC,IAAI,CAAC,IAAI,GAAG,yBAAsB,CAAC,aAAa,CAAA;IAClD,CAAC;IAED,KAAK,CAAC,QAAQ,CAAC,EAAE,OAAO,EAAE;QACxB,OAAO,IAAA,eAAY,EAAC,IAAI,CAAC,KAAK,EAAE,OAAO,CAAC,CAAA;IAC1C,CAAC;IAED,SAAS,CAAC,eAAe;QACvB,OAAO,IAAA,qBAAkB,EAAC,IAAI,CAAC,KAAK,EAAE,eAAe,CAAC,CAAA;IACxD,CAAC;CACF;AAbD,sEAaC"}
@@ -1,26 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- require(".");
4
- const context_1 = require("../context");
5
- const base_1 = require("./base");
6
- describe('getValueByLocator', () => {
7
- it('should return value at object property locator', () => {
8
- const context = new context_1.DataBuilderContext({
9
- a: {
10
- b: {
11
- c: 'd',
12
- },
13
- },
14
- });
15
- expect((0, base_1.getValueByLocator)(context, '$.a.b.c')).toEqual('d');
16
- });
17
- it('should return value at array locator', () => {
18
- const context = new context_1.DataBuilderContext(['a', 'b', 'c']);
19
- expect((0, base_1.getValueByLocator)(context, '$[1]')).toEqual('b');
20
- });
21
- it('should return false value', () => {
22
- const context = new context_1.DataBuilderContext({ b: false });
23
- expect((0, base_1.getValueByLocator)(context, '$.b')).toEqual(false);
24
- });
25
- });
26
- //# sourceMappingURL=base.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"base.test.js","sourceRoot":"","sources":["../../src/data-builder/formulas/base.test.ts"],"names":[],"mappings":";;AAAA,aAAU;AACV,wCAA+C;AAC/C,iCAA0C;AAE1C,QAAQ,CAAC,mBAAmB,EAAE,GAAG,EAAE;IACjC,EAAE,CAAC,gDAAgD,EAAE,GAAG,EAAE;QACxD,MAAM,OAAO,GAAG,IAAI,4BAAkB,CAAC;YACrC,CAAC,EAAE;gBACD,CAAC,EAAE;oBACD,CAAC,EAAE,GAAG;iBACP;aACF;SACF,CAAC,CAAA;QACF,MAAM,CAAC,IAAA,wBAAiB,EAAC,OAAO,EAAE,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAA;IAC5D,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,sCAAsC,EAAE,GAAG,EAAE;QAC9C,MAAM,OAAO,GAAG,IAAI,4BAAkB,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,CAAA;QACvD,MAAM,CAAC,IAAA,wBAAiB,EAAC,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAA;IACzD,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,2BAA2B,EAAE,GAAG,EAAE;QACnC,MAAM,OAAO,GAAG,IAAI,4BAAkB,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,CAAA;QACpD,MAAM,CAAC,IAAA,wBAAiB,EAAC,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAA;IAC1D,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
@@ -1,246 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const _1 = require(".");
4
- const context_1 = require("../context");
5
- const case_1 = require("./case");
6
- describe('data-builder/formulas/case', () => {
7
- const context = new context_1.DataBuilderContext({
8
- key: 'value',
9
- obj: {
10
- objKey: 'objValue',
11
- },
12
- });
13
- it('should find case formula in value', () => {
14
- const formula = (0, _1.getFormula)({
15
- $case: {
16
- cases: [
17
- {
18
- filter: null,
19
- value: 'foo',
20
- },
21
- ],
22
- default: 'bar',
23
- },
24
- });
25
- expect(formula).toBeDefined();
26
- expect(formula).not.toBeNull();
27
- expect(formula.type).toEqual(_1.DataBuilderFormulaType.CASE);
28
- expect(formula.value).toEqual({
29
- cases: [
30
- {
31
- filter: null,
32
- value: 'foo',
33
- },
34
- ],
35
- default: 'bar',
36
- });
37
- const formula2 = (0, _1.getFormula)({
38
- $case: [
39
- {
40
- filter: null,
41
- value: 'foo',
42
- },
43
- ],
44
- });
45
- expect(formula2).toBeDefined();
46
- expect(formula2).not.toBeNull();
47
- expect(formula2.type).toEqual(_1.DataBuilderFormulaType.CASE);
48
- expect(formula2.value).toEqual({
49
- cases: [
50
- {
51
- filter: null,
52
- value: 'foo',
53
- },
54
- ],
55
- default: undefined,
56
- });
57
- });
58
- it('should work with undefined value', () => {
59
- const formula = new case_1.DataBuilderFormulaCase(undefined);
60
- expect(formula.getValue(context)).toBeUndefined();
61
- });
62
- it('should work with empty value', () => {
63
- const formula = new case_1.DataBuilderFormulaCase([]);
64
- expect(formula.getValue(context)).toBeUndefined();
65
- });
66
- it('should work without filter', () => {
67
- const formula = new case_1.DataBuilderFormulaCase([
68
- {
69
- value: 'foo',
70
- },
71
- ]);
72
- expect(formula.getValue(context)).toEqual('foo');
73
- });
74
- it('should work with formula value', () => {
75
- const formula = new case_1.DataBuilderFormulaCase([
76
- {
77
- value: {
78
- $var: '$.obj.objKey',
79
- },
80
- },
81
- ]);
82
- expect(formula.getValue(context)).toEqual('objValue');
83
- const formula2 = new case_1.DataBuilderFormulaCase({
84
- cases: [],
85
- default: {
86
- $var: '$.obj.objKey',
87
- },
88
- });
89
- expect(formula2.getValue(context)).toEqual('objValue');
90
- });
91
- it('should take filter in account', () => {
92
- const formula = new case_1.DataBuilderFormulaCase([
93
- {
94
- filter: [
95
- {
96
- field: 'key',
97
- operator: 'is',
98
- value: 'notValue',
99
- },
100
- ],
101
- value: 'incorrectValue',
102
- },
103
- {
104
- filter: [
105
- {
106
- field: 'key',
107
- operator: 'is',
108
- value: 'value',
109
- },
110
- ],
111
- value: 'correctValue',
112
- },
113
- ]);
114
- expect(formula.getValue(context)).toEqual('correctValue');
115
- });
116
- it('should use "else" value correctly', () => {
117
- const formula = new case_1.DataBuilderFormulaCase([
118
- {
119
- filter: [
120
- {
121
- field: 'key',
122
- operator: 'is',
123
- value: 'notValue',
124
- },
125
- ],
126
- value: 'incorrectValue',
127
- },
128
- {
129
- filter: [
130
- {
131
- field: 'key',
132
- operator: 'is',
133
- value: 'anotherNotValue',
134
- },
135
- ],
136
- value: 'anotherIncorrectValue',
137
- },
138
- {
139
- value: 'elseValue',
140
- },
141
- ]);
142
- expect(formula.getValue(context)).toEqual('elseValue');
143
- });
144
- it('should use default value correctly', () => {
145
- const formula = new case_1.DataBuilderFormulaCase({
146
- default: 'defaultValue',
147
- cases: [
148
- {
149
- filter: [
150
- {
151
- field: 'key',
152
- operator: 'is',
153
- value: 'notValue',
154
- },
155
- ],
156
- value: 'incorrectValue',
157
- },
158
- {
159
- filter: [
160
- {
161
- field: 'key',
162
- operator: 'is',
163
- value: 'anotherNotValue',
164
- },
165
- ],
166
- value: 'anotherIncorrectValue',
167
- },
168
- ],
169
- });
170
- expect(formula.getValue(context)).toEqual('defaultValue');
171
- });
172
- it('should combine schemas of all option', () => {
173
- const variablesSchema = {
174
- type: 'object',
175
- properties: {
176
- obj: {
177
- type: 'object',
178
- properties: {
179
- objKey: { type: 'string' },
180
- },
181
- },
182
- obj2: {
183
- type: 'object',
184
- properties: {
185
- obj2Key: { type: 'string' },
186
- },
187
- },
188
- obj3: {
189
- type: 'object',
190
- properties: {
191
- obj3Key: { type: 'string' },
192
- },
193
- },
194
- },
195
- };
196
- const formula = new case_1.DataBuilderFormulaCase({
197
- cases: [
198
- {
199
- value: {
200
- $var: '$.obj',
201
- },
202
- filter: [],
203
- },
204
- {
205
- value: {
206
- $var: '$.obj2',
207
- },
208
- filter: [],
209
- },
210
- ],
211
- default: {
212
- $var: '$.obj3',
213
- },
214
- });
215
- expect(formula.getSchema(variablesSchema)).toEqual({
216
- type: 'object',
217
- properties: {
218
- objKey: { type: 'string' },
219
- obj2Key: { type: 'string' },
220
- obj3Key: { type: 'string' },
221
- },
222
- });
223
- const formula2 = new case_1.DataBuilderFormulaCase([
224
- {
225
- value: {
226
- $var: '$.obj',
227
- },
228
- filter: [],
229
- },
230
- {
231
- value: {
232
- $var: '$.obj2',
233
- },
234
- filter: [],
235
- },
236
- ]);
237
- expect(formula2.getSchema(variablesSchema)).toEqual({
238
- type: 'object',
239
- properties: {
240
- objKey: { type: 'string' },
241
- obj2Key: { type: 'string' },
242
- },
243
- });
244
- });
245
- });
246
- //# sourceMappingURL=case.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"case.test.js","sourceRoot":"","sources":["../../src/data-builder/formulas/case.test.ts"],"names":[],"mappings":";;AAAA,wBAAsD;AACtD,wCAA+C;AAC/C,iCAA+C;AAE/C,QAAQ,CAAC,4BAA4B,EAAE,GAAG,EAAE;IAC1C,MAAM,OAAO,GAAG,IAAI,4BAAkB,CAAC;QACrC,GAAG,EAAE,OAAO;QACZ,GAAG,EAAE;YACH,MAAM,EAAE,UAAU;SACnB;KACF,CAAC,CAAA;IAEF,EAAE,CAAC,mCAAmC,EAAE,GAAG,EAAE;QAE3C,MAAM,OAAO,GAAG,IAAA,aAAU,EAAC;YACzB,KAAK,EAAE;gBACL,KAAK,EAAE;oBACL;wBACE,MAAM,EAAE,IAAI;wBACZ,KAAK,EAAE,KAAK;qBACb;iBACF;gBACD,OAAO,EAAE,KAAK;aACf;SACF,CAAC,CAAA;QACF,MAAM,CAAC,OAAO,CAAC,CAAC,WAAW,EAAE,CAAA;QAC7B,MAAM,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAA;QAC9B,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,yBAAsB,CAAC,IAAI,CAAC,CAAA;QACzD,MAAM,CAAE,OAAkC,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC;YACxD,KAAK,EAAE;gBAC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