@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
@@ -20,9 +20,9 @@ import { SelfAccessor } from './auth/accessors';
20
20
  import { DataLocationSelector } from './data-locations/api';
21
21
  import { DataLocationAccessor } from './data-locations/accessors';
22
22
  export declare class IntegrationAppClient {
23
- apiUri?: string;
24
- uiUri?: string;
25
- token: string;
23
+ private apiUri?;
24
+ private uiUri?;
25
+ private token;
26
26
  private pusher;
27
27
  private pusherChannels;
28
28
  constructor(options: IntegrationAppClientOptions);
@@ -3,16 +3,12 @@ import { DataBuilderContext } from '../context';
3
3
  import { DataBuilderFormulaBase } from './base';
4
4
  export interface CaseFormulaValueItem {
5
5
  filter?: DataFilter;
6
- value?: any;
6
+ value: any;
7
7
  }
8
- export declare type CaseFormulaValue = {
9
- cases: CaseFormulaValueItem[];
10
- default?: any;
11
- };
8
+ export declare type CaseFormulaValue = CaseFormulaValueItem[];
12
9
  export declare class DataBuilderFormulaCase extends DataBuilderFormulaBase {
13
10
  value: CaseFormulaValue;
14
- constructor(value: CaseFormulaValueItem[] | CaseFormulaValue);
11
+ constructor(value: CaseFormulaValue);
15
12
  getValue(context: DataBuilderContext): any;
16
13
  getSchema(variablesSchema: any): any;
17
- isValueValid(): boolean;
18
14
  }
@@ -9,52 +9,36 @@ const schema_builder_1 = require("../../json-schema/schema-builder");
9
9
  class DataBuilderFormulaCase extends base_1.DataBuilderFormulaBase {
10
10
  constructor(value) {
11
11
  super();
12
+ this.value = value;
12
13
  this.type = _1.DataBuilderFormulaType.CASE;
13
- if (!value && !Array.isArray(value) && typeof value !== 'object') {
14
- this.value = {
15
- cases: [],
16
- default: undefined,
17
- };
18
- }
19
- else if (Array.isArray(value)) {
20
- this.value = {
21
- cases: value,
22
- default: undefined,
23
- };
24
- }
25
- else if (typeof value === 'object' && Array.isArray(value.cases)) {
26
- this.value = value;
14
+ if (!Array.isArray(value)) {
15
+ this.value = [];
27
16
  }
28
17
  }
29
18
  getValue(context) {
30
- var _a;
31
- if (!this.isValueValid())
19
+ if (!Array.isArray(this.value)) {
32
20
  return undefined;
33
- for (const item of this.value.cases) {
34
- if (!item || typeof item !== 'object')
21
+ }
22
+ for (const item of this.value) {
23
+ if (!item || typeof item !== 'object') {
35
24
  continue;
25
+ }
36
26
  if ((0, data_filter_1.doesMatchFilter)(context.variables, item.filter)) {
37
27
  return (0, _1.processValue)(item.value, context);
38
28
  }
39
29
  }
40
- return (_a = (0, _1.processValue)(this.value.default, context)) !== null && _a !== void 0 ? _a : undefined;
41
30
  }
42
31
  getSchema(variablesSchema) {
43
- if (!this.isValueValid())
32
+ if (Array.isArray(this.value)) {
33
+ const values = this.value
34
+ .map((item) => item.value)
35
+ .filter((value) => value !== undefined);
36
+ const schemas = values.map((value) => (0, __1.buildDataSchema)(value, variablesSchema));
37
+ return (0, schema_builder_1.mergeSchemas)(schemas);
38
+ }
39
+ else {
44
40
  return undefined;
45
- const schemas = this.value.cases
46
- .map((item) => item.value)
47
- .filter((value) => value !== undefined)
48
- .map((value) => (0, __1.buildDataSchema)(value, variablesSchema));
49
- if (this.value.default) {
50
- schemas.push((0, __1.buildDataSchema)(this.value.default, variablesSchema));
51
41
  }
52
- return (0, schema_builder_1.mergeSchemas)(schemas);
53
- }
54
- isValueValid() {
55
- return (this.value &&
56
- typeof this.value === 'object' &&
57
- Array.isArray(this.value.cases));
58
42
  }
59
43
  }
60
44
  exports.DataBuilderFormulaCase = DataBuilderFormulaCase;
@@ -1 +1 @@
1
- {"version":3,"file":"case.js","sourceRoot":"","sources":["../../src/data-builder/formulas/case.ts"],"names":[],"mappings":";;;AAAA,mDAA+D;AAC/D,wBAAwD;AACxD,0BAAoC;AAEpC,iCAA+C;AAC/C,qEAA+D;AAY/D,MAAa,sBAAuB,SAAQ,6BAAsB;IAGhE,YAAY,KAAgD;QAC1D,KAAK,EAAE,CAAA;QAEP,IAAI,CAAC,IAAI,GAAG,yBAAsB,CAAC,IAAI,CAAA;QAEvC,IAAI,CAAC,KAAK,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;YAChE,IAAI,CAAC,KAAK,GAAG;gBACX,KAAK,EAAE,EAAE;gBACT,OAAO,EAAE,SAAS;aACnB,CAAA;SACF;aAAM,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;YAC/B,IAAI,CAAC,KAAK,GAAG;gBACX,KAAK,EAAE,KAAK;gBACZ,OAAO,EAAE,SAAS;aACnB,CAAA;SACF;aAAM,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE;YAClE,IAAI,CAAC,KAAK,GAAG,KAAK,CAAA;SACnB;IACH,CAAC;IAED,QAAQ,CAAC,OAA2B;;QAClC,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE;YAAE,OAAO,SAAS,CAAA;QAE1C,KAAK,MAAM,IAAI,IAAI,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE;YACnC,IAAI,CAAC,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ;gBAAE,SAAQ;YAE/C,IAAI,IAAA,6BAAe,EAAC,OAAO,CAAC,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,EAAE;gBACnD,OAAO,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Query, FindIntegrationsResponse, Integration } from '.'
3
3
  import { IntegrationAppClient } from '..';
4
4
  import { ElementAccessor } from '../accessors';
5
5
  import { CreateIntegrationRequest, UpdateIntegrationRequest } from './api';
6
- import { ConnectorSpec } from '../connector-api';
7
6
  export declare class IntegrationsAccessor {
8
7
  private client;
9
8
  constructor(client: IntegrationAppClient);
@@ -14,10 +13,5 @@ export declare class IntegrationAccessor extends ElementAccessor<Integration, Cr
14
13
  private idOrKey;
15
14
  baseUri: string;
16
15
  constructor(client: IntegrationAppClient, idOrKey: string);
17
- getConnectorSpec(): Promise<ConnectorSpec>;
18
- createConnection({ parameters }: {
19
- parameters: any;
20
- }): Promise<Connection>;
21
- openNewConnection(): Promise<Connection>;
22
16
  connect(): Promise<Connection>;
23
17
  }
@@ -1,11 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.IntegrationAccessor = exports.IntegrationsAccessor = void 0;
4
- const tslib_1 = require("tslib");
5
- const _1 = require(".");
6
4
  const iframe_1 = require("../iframe");
7
5
  const accessors_1 = require("../accessors");
8
- const url_join_1 = (0, tslib_1.__importDefault)(require("url-join"));
9
6
  class IntegrationsAccessor {
10
7
  constructor(client) {
11
8
  this.client = client;
@@ -25,75 +22,7 @@ class IntegrationAccessor extends accessors_1.ElementAccessor {
25
22
  this.client = client;
26
23
  this.idOrKey = idOrKey;
27
24
  }
28
- async getConnectorSpec() {
29
- return this.client.get(`/integrations/${this.idOrKey}/connector-spec`);
30
- }
31
- async createConnection({ parameters }) {
32
- const spec = await this.getConnectorSpec();
33
- let iframeElement;
34
- if (spec.connectionMode === _1.ConnectionMode.IFRAME) {
35
- iframeElement = createIframeElement();
36
- }
37
- return new Promise((resolve, reject) => {
38
- const connectionUrl = (0, url_join_1.default)(this.client.apiUri, `oauth/new/${this.idOrKey}`, `?token=${this.client.token}&connectionParameters=${JSON.stringify(parameters)}`);
39
- const urlObj = new URL(connectionUrl);
40
- const requestId = (Math.random() + 1).toString(36).substring(0, 12);
41
- const listenerFunc = async (event) => {
42
- const message = event.data || {};
43
- if (message.source == 'integration.app' &&
44
- message.requestId == requestId) {
45
- cleanup();
46
- if (message.type == 'newConnectionCreated') {
47
- resolve(message.connection);
48
- }
49
- else if (message.type == 'newConnectionCancel') {
50
- resolve(null);
51
- }
52
- else if (message.type == 'newConnectionFailure') {
53
- reject(new Error(message.error));
54
- }
55
- }
56
- };
57
- let cancelCheckInterval;
58
- function cleanup() {
59
- clearInterval(cancelCheckInterval);
60
- window.removeEventListener('message', listenerFunc);
61
- }
62
- try {
63
- window.addEventListener('message', listenerFunc);
64
- urlObj.searchParams.append('requestId', requestId);
65
- if (iframeElement) {
66
- urlObj.searchParams.append('iframe', '1');
67
- iframeElement.src = urlObj.toString();
68
- }
69
- else {
70
- const height = Math.round(screen.height * 0.6);
71
- const width = Math.round(screen.width * 0.7);
72
- const top = Math.round(screen.height * 0.2);
73
- const left = Math.round(screen.height * 0.15);
74
- const popup = window.open(urlObj.toString(), null, `popup,width=${width},height=${height},left=${left},top=${top}`);
75
- setTimeout(() => {
76
- if (!popup) {
77
- cleanup();
78
- reject({
79
- message: 'Popup has been blocked',
80
- });
81
- }
82
- }, 1000);
83
- cancelCheckInterval = setInterval(() => {
84
- if (popup === null || popup === void 0 ? void 0 : popup.closed) {
85
- cleanup();
86
- resolve(null);
87
- }
88
- }, 1000);
89
- }
90
- }
91
- catch (e) {
92
- reject(e);
93
- }
94
- });
95
- }
96
- async openNewConnection() {
25
+ async connect() {
97
26
  const uri = this.client.getEmbedUri(`/integrations/${this.idOrKey}/connection/connect`);
98
27
  return new Promise((resolve) => {
99
28
  (0, iframe_1.openIframe)(uri, {
@@ -102,21 +31,6 @@ class IntegrationAccessor extends accessors_1.ElementAccessor {
102
31
  });
103
32
  });
104
33
  }
105
- async connect() {
106
- return this.openNewConnection();
107
- }
108
34
  }
109
35
  exports.IntegrationAccessor = IntegrationAccessor;
110
- function createIframeElement() {
111
- const iframeElement = document.createElement('iframe');
112
- iframeElement.style.position = 'absolute';
113
- iframeElement.style.top = '-100';
114
- iframeElement.style.left = '-100';
115
- iframeElement.style.width = '1';
116
- iframeElement.style.height = '1';
117
- iframeElement.style.border = 'none';
118
- iframeElement.style.backgroundColor = 'transparent';
119
- document.body.appendChild(iframeElement);
120
- return iframeElement;
121
- }
122
36
  //# sourceMappingURL=accessors.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"accessors.js","sourceRoot":"","sources":["../src/integrations/accessors.ts"],"names":[],"mappings":";;;;AACA,wBAKU;AAEV,sCAAsC;AACtC,4CAA8C;AAG9C,qEAA8B;AAE9B,MAAa,oBAAoB;IAC/B,YAAoB,MAA4B;QAA5B,WAAM,GAAN,MAAM,CAAsB;IAAG,CAAC;IAEpD,KAAK,CAAC,IAAI,CAAC,KAA4B;QACrC,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,eAAe,EAAE,KAAK,CAAC,CAAA;IAChD,CAAC;CACF;AAND,oDAMC;AAED,MAAa,mBAAoB,SAAQ,2BAIxC;IAGC,YAAoB,MAA4B,EAAU,OAAe;QACvE,KAAK,CAAC;YACJ,MAAM;YACN,IAAI,EAAE,cAAc;YACpB,OAAO;SACR,CAAC,CAAA;QALgB,WAAM,GAAN,MAAM,CAAsB;QAAU,YAAO,GAAP,OAAO,CAAQ;IAMzE,CAAC;IAED,KAAK,CAAC,gBAAgB;QACpB,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,iBAAiB,IAAI,CAAC,OAAO,iBAAiB,CAAC,CAAA;IACxE,CAAC;IAED,KAAK,CAAC,gBAAgB,CAAC,EAAE,UAAU,EAAE;QACnC,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,gBAAgB,EAAE,CAAA;QAE1C,IAAI,aAAa,CAAA;QACjB,IAAI,IAAI,CAAC,cAAc,KAAK,iBAAc,CAAC,MAAM,EAAE;YACjD,aAAa,GAAG,mBAAmB,EAAE,CAAA;SACtC;QAED,OAAO,I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ors.js","sourceRoot":"","sources":["../src/integrations/accessors.ts"],"names":[],"mappings":";;;AAGA,sCAAsC;AACtC,4CAA8C;AAG9C,MAAa,oBAAoB;IAC/B,YAAoB,MAA4B;QAA5B,WAAM,GAAN,MAAM,CAAsB;IAAG,CAAC;IAEpD,KAAK,CAAC,IAAI,CAAC,KAA4B;QACrC,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,eAAe,EAAE,KAAK,CAAC,CAAA;IAChD,CAAC;CACF;AAND,oDAMC;AAED,MAAa,mBAAoB,SAAQ,2BAIxC;IAGC,YAAoB,MAA4B,EAAU,OAAe;QACvE,KAAK,CAAC;YACJ,MAAM;YACN,IAAI,EAAE,cAAc;YACpB,OAAO;SACR,CAAC,CAAA;QALgB,WAAM,GAAN,MAAM,CAAsB;QAAU,YAAO,GAAP,OAAO,CAAQ;IAMzE,CAAC;IAED,KAAK,CAAC,OAAO;QACX,MAAM,GAAG,GAAG,IAAI,CAAC,MAAM,CAAC,WAAW,CACjC,iBAAiB,IAAI,CAAC,OAAO,qBAAqB,CACnD,CAAA;QACD,OAAO,IAAI,OAAO,CAAa,CAAC,OAAO,EAAE,EAAE;YACzC,IAAA,mBAAU,EAAC,GAAG,EAAE;gBACd,OAAO,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC;gBAC5B,SAAS,EAAE,CAAC,UAAU,EAAE,EAAE,CAAC,OAAO,CAAC,UAAU,CAAC;aAC/C,CAAC,CAAA;QACJ,CAAC,CAAC,CAAA;IACJ,CAAC;CACF;AA1BD,kDA0BC"}
@@ -26,7 +26,7 @@ export declare type SchemaComparisonOptions = {
26
26
  };
27
27
  export declare function schemaDiff(first: JSONSchema, second: JSONSchema): JSONSchema;
28
28
  export declare function isScalar(schema: any): boolean;
29
- export declare function schemaTypeFromValue(value: any): "object" | "string" | "null" | "boolean" | "number" | "array";
29
+ export declare function schemaTypeFromValue(value: any): "object" | "string" | "number" | "null" | "boolean" | "array";
30
30
  export declare function getUserVisibleSchema(schema: any): any;
31
31
  export declare function getDefaultsFromSchema(schema: any): any;
32
32
  export declare function valueToSchema(value: any, schema: any, field?: string): any;
@@ -68,9 +68,9 @@ const DEFAULT_API_URI = 'https://engine-api.integration.app'
68
68
  const DEFAULT_UI_URI = 'https://ui.integration.app'
69
69
 
70
70
  export class IntegrationAppClient {
71
- public apiUri?: string
72
- public uiUri?: string
73
- public token: string
71
+ private apiUri?: string
72
+ private uiUri?: string
73
+ private token: string
74
74
  private pusher: Pusher | undefined
75
75
  private pusherChannels: Record<string, Channel> = {}
76
76
 
@@ -11,33 +11,7 @@ describe('data-builder/formulas/case', () => {
11
11
  })
12
12
 
13
13
  it('should find case formula in value', () => {
14
- // argument as object
15
14
  const formula = getFormula({
16
- $case: {
17
- cases: [
18
- {
19
- filter: null,
20
- value: 'foo',
21
- },
22
- ],
23
- default: 'bar',
24
- },
25
- })
26
- expect(formula).toBeDefined()
27
- expect(formula).not.toBeNull()
28
- expect(formula.type).toEqual(DataBuilderFormulaType.CASE)
29
- expect((formula as DataBuilderFormulaCase).value).toEqual({
30
- cases: [
31
- {
32
- filter: null,
33
- value: 'foo',
34
- },
35
- ],
36
- default: 'bar',
37
- })
38
-
39
- // argument as array
40
- const formula2 = getFormula({
41
15
  $case: [
42
16
  {
43
17
  filter: null,
@@ -45,18 +19,15 @@ describe('data-builder/formulas/case', () => {
45
19
  },
46
20
  ],
47
21
  })
48
- expect(formula2).toBeDefined()
49
- expect(formula2).not.toBeNull()
50
- expect(formula2.type).toEqual(DataBuilderFormulaType.CASE)
51
- expect((formula2 as DataBuilderFormulaCase).value).toEqual({
52
- cases: [
53
- {
54
- filter: null,
55
- value: 'foo',
56
- },
57
- ],
58
- default: undefined,
59
- })
22
+ expect(formula).toBeDefined()
23
+ expect(formula).not.toBeNull()
24
+ expect(formula.type).toEqual(DataBuilderFormulaType.CASE)
25
+ expect((formula as DataBuilderFormulaCase).value).toEqual([
26
+ {
27
+ filter: null,
28
+ value: 'foo',
29
+ },
30
+ ])
60
31
  })
61
32
 
62
33
  it('should work with undefined value', () => {
@@ -87,14 +58,6 @@ describe('data-builder/formulas/case', () => {
87
58
  },
88
59
  ])
89
60
  expect(formula.getValue(context)).toEqual('objValue')
90
-
91
- const formula2 = new DataBuilderFormulaCase({
92
- cases: [],
93
- default: {
94
- $var: '$.obj.objKey',
95
- },
96
- })
97
- expect(formula2.getValue(context)).toEqual('objValue')
98
61
  })
99
62
 
100
63
  it('should take filter in account', () => {
@@ -152,35 +115,6 @@ describe('data-builder/formulas/case', () => {
152
115
  expect(formula.getValue(context)).toEqual('elseValue')
153
116
  })
154
117
 
155
- it('should use default value correctly', () => {
156
- const formula = new DataBuilderFormulaCase({
157
- default: 'defaultValue',
158
- cases: [
159
- {
160
- filter: [
161
- {
162
- field: 'key',
163
- operator: 'is',
164
- value: 'notValue',
165
- },
166
- ],
167
- value: 'incorrectValue',
168
- },
169
- {
170
- filter: [
171
- {
172
- field: 'key',
173
- operator: 'is',
174
- value: 'anotherNotValue',
175
- },
176
- ],
177
- value: 'anotherIncorrectValue',
178
- },
179
- ],
180
- })
181
- expect(formula.getValue(context)).toEqual('defaultValue')
182
- })
183
-
184
118
  it('should combine schemas of all option', () => {
185
119
  const variablesSchema = {
186
120
  type: 'object',
@@ -197,45 +131,9 @@ describe('data-builder/formulas/case', () => {
197
131
  obj2Key: { type: 'string' },
198
132
  },
199
133
  },
200
- obj3: {
201
- type: 'object',
202
- properties: {
203
- obj3Key: { type: 'string' },
204
- },
205
- },
206
134
  },
207
135
  }
208
-
209
- const formula = new DataBuilderFormulaCase({
210
- cases: [
211
- {
212
- value: {
213
- $var: '$.obj',
214
- },
215
- filter: [],
216
- },
217
- {
218
- value: {
219
- $var: '$.obj2',
220
- },
221
- filter: [],
222
- },
223
- ],
224
- default: {
225
- $var: '$.obj3',
226
- },
227
- })
228
- expect(formula.getSchema(variablesSchema)).toEqual({
229
- type: 'object',
230
- properties: {
231
- objKey: { type: 'string' },
232
- obj2Key: { type: 'string' },
233
- obj3Key: { type: 'string' },
234
- },
235
- })
236
-
237
- // without default value
238
- const formula2 = new DataBuilderFormulaCase([
136
+ const formula = new DataBuilderFormulaCase([
239
137
  {
240
138
  value: {
241
139
  $var: '$.obj',
@@ -249,7 +147,7 @@ describe('data-builder/formulas/case', () => {
249
147
  filter: [],
250
148
  },
251
149
  ])
252
- expect(formula2.getSchema(variablesSchema)).toEqual({
150
+ expect(formula.getSchema(variablesSchema)).toEqual({
253
151
  type: 'object',
254
152
  properties: {
255
153
  objKey: { type: 'string' },
@@ -7,71 +7,47 @@ import { mergeSchemas } from '../../json-schema/schema-builder'
7
7
 
8
8
  export interface CaseFormulaValueItem {
9
9
  filter?: DataFilter
10
- value?: any
10
+ value: any
11
11
  }
12
12
 
13
- export type CaseFormulaValue = {
14
- cases: CaseFormulaValueItem[]
15
- default?: any
16
- }
13
+ export type CaseFormulaValue = CaseFormulaValueItem[]
17
14
 
18
15
  export class DataBuilderFormulaCase extends DataBuilderFormulaBase {
19
- public value: CaseFormulaValue
20
-
21
- constructor(value: CaseFormulaValueItem[] | CaseFormulaValue) {
16
+ constructor(public value: CaseFormulaValue) {
22
17
  super()
23
18
 
24
19
  this.type = DataBuilderFormulaType.CASE
25
20
 
26
- if (!value && !Array.isArray(value) && typeof value !== 'object') {
27
- this.value = {
28
- cases: [],
29
- default: undefined,
30
- }
31
- } else if (Array.isArray(value)) {
32
- this.value = {
33
- cases: value,
34
- default: undefined,
35
- }
36
- } else if (typeof value === 'object' && Array.isArray(value.cases)) {
37
- this.value = value
21
+ if (!Array.isArray(value)) {
22
+ this.value = []
38
23
  }
39
24
  }
40
25
 
41
26
  getValue(context: DataBuilderContext) {
42
- if (!this.isValueValid()) return undefined
43
-
44
- for (const item of this.value.cases) {
45
- if (!item || typeof item !== 'object') continue
46
-
27
+ if (!Array.isArray(this.value)) {
28
+ return undefined
29
+ }
30
+ for (const item of this.value) {
31
+ if (!item || typeof item !== 'object') {
32
+ continue
33
+ }
47
34
  if (doesMatchFilter(context.variables, item.filter)) {
48
35
  return processValue(item.value, context)
49
36
  }
50
37
  }
51
-
52
- return processValue(this.value.default, context) ?? undefined
53
38
  }
54
39
 
55
40
  getSchema(variablesSchema) {
56
- if (!this.isValueValid()) return undefined
57
-
58
- const schemas = this.value.cases
59
- .map((item) => item.value)
60
- .filter((value) => value !== undefined)
61
- .map((value) => buildDataSchema(value, variablesSchema))
62
-
63
- if (this.value.default) {
64
- schemas.push(buildDataSchema(this.value.default, variablesSchema))
41
+ if (Array.isArray(this.value)) {
42
+ const values = this.value
43
+ .map((item) => item.value)
44
+ .filter((value) => value !== undefined)
45
+ const schemas = values.map((value) =>
46
+ buildDataSchema(value, variablesSchema),
47
+ )
48
+ return mergeSchemas(schemas)
49
+ } else {
50
+ return undefined
65
51
  }
66
-
67
- return mergeSchemas(schemas)
68
- }
69
-
70
- isValueValid() {
71
- return (
72
- this.value &&
73
- typeof this.value === 'object' &&
74
- Array.isArray(this.value.cases)
75
- )
76
52
  }
77
53
  }