@flowcore/sdk 1.4.2

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 (298) hide show
  1. package/README.md +41 -0
  2. package/esm/commands/api-key/api-key.create.d.ts +34 -0
  3. package/esm/commands/api-key/api-key.create.d.ts.map +1 -0
  4. package/esm/commands/api-key/api-key.create.js +74 -0
  5. package/esm/commands/api-key/api-key.delete.d.ts +28 -0
  6. package/esm/commands/api-key/api-key.delete.d.ts.map +1 -0
  7. package/esm/commands/api-key/api-key.delete.js +60 -0
  8. package/esm/commands/api-key/api-key.list.d.ts +27 -0
  9. package/esm/commands/api-key/api-key.list.d.ts.map +1 -0
  10. package/esm/commands/api-key/api-key.list.js +58 -0
  11. package/esm/commands/data-core/data-core.create.d.ts +39 -0
  12. package/esm/commands/data-core/data-core.create.d.ts.map +1 -0
  13. package/esm/commands/data-core/data-core.create.js +32 -0
  14. package/esm/commands/data-core/data-core.delete-request.d.ts +37 -0
  15. package/esm/commands/data-core/data-core.delete-request.d.ts.map +1 -0
  16. package/esm/commands/data-core/data-core.delete-request.js +94 -0
  17. package/esm/commands/data-core/data-core.exists.d.ts +37 -0
  18. package/esm/commands/data-core/data-core.exists.d.ts.map +1 -0
  19. package/esm/commands/data-core/data-core.exists.js +33 -0
  20. package/esm/commands/data-core/data-core.fetch.d.ts +51 -0
  21. package/esm/commands/data-core/data-core.fetch.d.ts.map +1 -0
  22. package/esm/commands/data-core/data-core.fetch.js +48 -0
  23. package/esm/commands/data-core/data-core.list.d.ts +33 -0
  24. package/esm/commands/data-core/data-core.list.d.ts.map +1 -0
  25. package/esm/commands/data-core/data-core.list.js +40 -0
  26. package/esm/commands/data-core/data-core.update.d.ts +41 -0
  27. package/esm/commands/data-core/data-core.update.d.ts.map +1 -0
  28. package/esm/commands/data-core/data-core.update.js +43 -0
  29. package/esm/commands/event-type/event-type.create.d.ts +35 -0
  30. package/esm/commands/event-type/event-type.create.d.ts.map +1 -0
  31. package/esm/commands/event-type/event-type.create.js +32 -0
  32. package/esm/commands/event-type/event-type.delete-request.d.ts +37 -0
  33. package/esm/commands/event-type/event-type.delete-request.d.ts.map +1 -0
  34. package/esm/commands/event-type/event-type.delete-request.js +98 -0
  35. package/esm/commands/event-type/event-type.exists.d.ts +37 -0
  36. package/esm/commands/event-type/event-type.exists.d.ts.map +1 -0
  37. package/esm/commands/event-type/event-type.exists.js +33 -0
  38. package/esm/commands/event-type/event-type.fetch.d.ts +45 -0
  39. package/esm/commands/event-type/event-type.fetch.d.ts.map +1 -0
  40. package/esm/commands/event-type/event-type.fetch.js +48 -0
  41. package/esm/commands/event-type/event-type.list.d.ts +31 -0
  42. package/esm/commands/event-type/event-type.list.d.ts.map +1 -0
  43. package/esm/commands/event-type/event-type.list.js +36 -0
  44. package/esm/commands/event-type/event-type.update.d.ts +37 -0
  45. package/esm/commands/event-type/event-type.update.d.ts.map +1 -0
  46. package/esm/commands/event-type/event-type.update.js +39 -0
  47. package/esm/commands/events/events.fetch-time-buckets-by-names.d.ts +53 -0
  48. package/esm/commands/events/events.fetch-time-buckets-by-names.d.ts.map +1 -0
  49. package/esm/commands/events/events.fetch-time-buckets-by-names.js +40 -0
  50. package/esm/commands/events/events.fetch.d.ts +58 -0
  51. package/esm/commands/events/events.fetch.d.ts.map +1 -0
  52. package/esm/commands/events/events.fetch.js +54 -0
  53. package/esm/commands/flow-type/flow-type.create.d.ts +35 -0
  54. package/esm/commands/flow-type/flow-type.create.d.ts.map +1 -0
  55. package/esm/commands/flow-type/flow-type.create.js +32 -0
  56. package/esm/commands/flow-type/flow-type.delete-request.d.ts +47 -0
  57. package/esm/commands/flow-type/flow-type.delete-request.d.ts.map +1 -0
  58. package/esm/commands/flow-type/flow-type.delete-request.js +118 -0
  59. package/esm/commands/flow-type/flow-type.exists.d.ts +39 -0
  60. package/esm/commands/flow-type/flow-type.exists.d.ts.map +1 -0
  61. package/esm/commands/flow-type/flow-type.exists.js +33 -0
  62. package/esm/commands/flow-type/flow-type.fetch.d.ts +51 -0
  63. package/esm/commands/flow-type/flow-type.fetch.d.ts.map +1 -0
  64. package/esm/commands/flow-type/flow-type.fetch.js +48 -0
  65. package/esm/commands/flow-type/flow-type.list.d.ts +31 -0
  66. package/esm/commands/flow-type/flow-type.list.d.ts.map +1 -0
  67. package/esm/commands/flow-type/flow-type.list.js +36 -0
  68. package/esm/commands/flow-type/flow-type.update.d.ts +37 -0
  69. package/esm/commands/flow-type/flow-type.update.d.ts.map +1 -0
  70. package/esm/commands/flow-type/flow-type.update.js +39 -0
  71. package/esm/commands/index.d.ts +32 -0
  72. package/esm/commands/index.d.ts.map +1 -0
  73. package/esm/commands/index.js +39 -0
  74. package/esm/commands/secret/secret.create.d.ts +30 -0
  75. package/esm/commands/secret/secret.create.d.ts.map +1 -0
  76. package/esm/commands/secret/secret.create.js +60 -0
  77. package/esm/commands/secret/secret.delete.d.ts +28 -0
  78. package/esm/commands/secret/secret.delete.d.ts.map +1 -0
  79. package/esm/commands/secret/secret.delete.js +61 -0
  80. package/esm/commands/secret/secret.list.d.ts +26 -0
  81. package/esm/commands/secret/secret.list.d.ts.map +1 -0
  82. package/esm/commands/secret/secret.list.js +63 -0
  83. package/esm/commands/tenant/tenant.fetch.d.ts +43 -0
  84. package/esm/commands/tenant/tenant.fetch.d.ts.map +1 -0
  85. package/esm/commands/tenant/tenant.fetch.js +77 -0
  86. package/esm/commands/tenant/tenant.list.d.ts +20 -0
  87. package/esm/commands/tenant/tenant.list.d.ts.map +1 -0
  88. package/esm/commands/tenant/tenant.list.js +65 -0
  89. package/esm/commands/variable/variable.create.d.ts +31 -0
  90. package/esm/commands/variable/variable.create.d.ts.map +1 -0
  91. package/esm/commands/variable/variable.create.js +66 -0
  92. package/esm/commands/variable/variable.delete.d.ts +28 -0
  93. package/esm/commands/variable/variable.delete.d.ts.map +1 -0
  94. package/esm/commands/variable/variable.delete.js +63 -0
  95. package/esm/commands/variable/variable.list.d.ts +27 -0
  96. package/esm/commands/variable/variable.list.d.ts.map +1 -0
  97. package/esm/commands/variable/variable.list.js +69 -0
  98. package/esm/common/command.d.ts +63 -0
  99. package/esm/common/command.d.ts.map +1 -0
  100. package/esm/common/command.js +91 -0
  101. package/esm/common/flowcore-client.d.ts +39 -0
  102. package/esm/common/flowcore-client.d.ts.map +1 -0
  103. package/esm/common/flowcore-client.js +72 -0
  104. package/esm/contracts/api-key.d.ts +14 -0
  105. package/esm/contracts/api-key.d.ts.map +1 -0
  106. package/esm/contracts/api-key.js +9 -0
  107. package/esm/contracts/data-core.d.ts +38 -0
  108. package/esm/contracts/data-core.d.ts.map +1 -0
  109. package/esm/contracts/data-core.js +38 -0
  110. package/esm/contracts/event-type.d.ts +33 -0
  111. package/esm/contracts/event-type.d.ts.map +1 -0
  112. package/esm/contracts/event-type.js +33 -0
  113. package/esm/contracts/event.d.ts +20 -0
  114. package/esm/contracts/event.d.ts.map +1 -0
  115. package/esm/contracts/event.js +15 -0
  116. package/esm/contracts/flow-type.d.ts +32 -0
  117. package/esm/contracts/flow-type.d.ts.map +1 -0
  118. package/esm/contracts/flow-type.js +31 -0
  119. package/esm/contracts/index.d.ts +4 -0
  120. package/esm/contracts/index.d.ts.map +1 -0
  121. package/esm/contracts/index.js +1 -0
  122. package/esm/contracts/tenant.d.ts +50 -0
  123. package/esm/contracts/tenant.d.ts.map +1 -0
  124. package/esm/contracts/tenant.js +33 -0
  125. package/esm/contracts/variable.d.ts +13 -0
  126. package/esm/contracts/variable.d.ts.map +1 -0
  127. package/esm/contracts/variable.js +8 -0
  128. package/esm/exceptions/client-error.d.ts +9 -0
  129. package/esm/exceptions/client-error.d.ts.map +1 -0
  130. package/esm/exceptions/client-error.js +20 -0
  131. package/esm/exceptions/command-error.d.ts +7 -0
  132. package/esm/exceptions/command-error.d.ts.map +1 -0
  133. package/esm/exceptions/command-error.js +8 -0
  134. package/esm/exceptions/index.d.ts +4 -0
  135. package/esm/exceptions/index.d.ts.map +1 -0
  136. package/esm/exceptions/index.js +3 -0
  137. package/esm/exceptions/invalid-response.d.ts +8 -0
  138. package/esm/exceptions/invalid-response.d.ts.map +1 -0
  139. package/esm/exceptions/invalid-response.js +15 -0
  140. package/esm/exceptions/not-found.d.ts +7 -0
  141. package/esm/exceptions/not-found.d.ts.map +1 -0
  142. package/esm/exceptions/not-found.js +8 -0
  143. package/esm/mod.d.ts +6 -0
  144. package/esm/mod.d.ts.map +1 -0
  145. package/esm/mod.js +5 -0
  146. package/esm/package.json +3 -0
  147. package/esm/utils/parse-response-helper.d.ts +6 -0
  148. package/esm/utils/parse-response-helper.d.ts.map +1 -0
  149. package/esm/utils/parse-response-helper.js +16 -0
  150. package/package.json +28 -0
  151. package/script/commands/api-key/api-key.create.d.ts +34 -0
  152. package/script/commands/api-key/api-key.create.d.ts.map +1 -0
  153. package/script/commands/api-key/api-key.create.js +78 -0
  154. package/script/commands/api-key/api-key.delete.d.ts +28 -0
  155. package/script/commands/api-key/api-key.delete.d.ts.map +1 -0
  156. package/script/commands/api-key/api-key.delete.js +64 -0
  157. package/script/commands/api-key/api-key.list.d.ts +27 -0
  158. package/script/commands/api-key/api-key.list.d.ts.map +1 -0
  159. package/script/commands/api-key/api-key.list.js +62 -0
  160. package/script/commands/data-core/data-core.create.d.ts +39 -0
  161. package/script/commands/data-core/data-core.create.d.ts.map +1 -0
  162. package/script/commands/data-core/data-core.create.js +36 -0
  163. package/script/commands/data-core/data-core.delete-request.d.ts +37 -0
  164. package/script/commands/data-core/data-core.delete-request.d.ts.map +1 -0
  165. package/script/commands/data-core/data-core.delete-request.js +98 -0
  166. package/script/commands/data-core/data-core.exists.d.ts +37 -0
  167. package/script/commands/data-core/data-core.exists.d.ts.map +1 -0
  168. package/script/commands/data-core/data-core.exists.js +37 -0
  169. package/script/commands/data-core/data-core.fetch.d.ts +51 -0
  170. package/script/commands/data-core/data-core.fetch.d.ts.map +1 -0
  171. package/script/commands/data-core/data-core.fetch.js +52 -0
  172. package/script/commands/data-core/data-core.list.d.ts +33 -0
  173. package/script/commands/data-core/data-core.list.d.ts.map +1 -0
  174. package/script/commands/data-core/data-core.list.js +44 -0
  175. package/script/commands/data-core/data-core.update.d.ts +41 -0
  176. package/script/commands/data-core/data-core.update.d.ts.map +1 -0
  177. package/script/commands/data-core/data-core.update.js +47 -0
  178. package/script/commands/event-type/event-type.create.d.ts +35 -0
  179. package/script/commands/event-type/event-type.create.d.ts.map +1 -0
  180. package/script/commands/event-type/event-type.create.js +36 -0
  181. package/script/commands/event-type/event-type.delete-request.d.ts +37 -0
  182. package/script/commands/event-type/event-type.delete-request.d.ts.map +1 -0
  183. package/script/commands/event-type/event-type.delete-request.js +102 -0
  184. package/script/commands/event-type/event-type.exists.d.ts +37 -0
  185. package/script/commands/event-type/event-type.exists.d.ts.map +1 -0
  186. package/script/commands/event-type/event-type.exists.js +37 -0
  187. package/script/commands/event-type/event-type.fetch.d.ts +45 -0
  188. package/script/commands/event-type/event-type.fetch.d.ts.map +1 -0
  189. package/script/commands/event-type/event-type.fetch.js +52 -0
  190. package/script/commands/event-type/event-type.list.d.ts +31 -0
  191. package/script/commands/event-type/event-type.list.d.ts.map +1 -0
  192. package/script/commands/event-type/event-type.list.js +40 -0
  193. package/script/commands/event-type/event-type.update.d.ts +37 -0
  194. package/script/commands/event-type/event-type.update.d.ts.map +1 -0
  195. package/script/commands/event-type/event-type.update.js +43 -0
  196. package/script/commands/events/events.fetch-time-buckets-by-names.d.ts +53 -0
  197. package/script/commands/events/events.fetch-time-buckets-by-names.d.ts.map +1 -0
  198. package/script/commands/events/events.fetch-time-buckets-by-names.js +44 -0
  199. package/script/commands/events/events.fetch.d.ts +58 -0
  200. package/script/commands/events/events.fetch.d.ts.map +1 -0
  201. package/script/commands/events/events.fetch.js +58 -0
  202. package/script/commands/flow-type/flow-type.create.d.ts +35 -0
  203. package/script/commands/flow-type/flow-type.create.d.ts.map +1 -0
  204. package/script/commands/flow-type/flow-type.create.js +36 -0
  205. package/script/commands/flow-type/flow-type.delete-request.d.ts +47 -0
  206. package/script/commands/flow-type/flow-type.delete-request.d.ts.map +1 -0
  207. package/script/commands/flow-type/flow-type.delete-request.js +122 -0
  208. package/script/commands/flow-type/flow-type.exists.d.ts +39 -0
  209. package/script/commands/flow-type/flow-type.exists.d.ts.map +1 -0
  210. package/script/commands/flow-type/flow-type.exists.js +37 -0
  211. package/script/commands/flow-type/flow-type.fetch.d.ts +51 -0
  212. package/script/commands/flow-type/flow-type.fetch.d.ts.map +1 -0
  213. package/script/commands/flow-type/flow-type.fetch.js +52 -0
  214. package/script/commands/flow-type/flow-type.list.d.ts +31 -0
  215. package/script/commands/flow-type/flow-type.list.d.ts.map +1 -0
  216. package/script/commands/flow-type/flow-type.list.js +40 -0
  217. package/script/commands/flow-type/flow-type.update.d.ts +37 -0
  218. package/script/commands/flow-type/flow-type.update.d.ts.map +1 -0
  219. package/script/commands/flow-type/flow-type.update.js +43 -0
  220. package/script/commands/index.d.ts +32 -0
  221. package/script/commands/index.d.ts.map +1 -0
  222. package/script/commands/index.js +55 -0
  223. package/script/commands/secret/secret.create.d.ts +30 -0
  224. package/script/commands/secret/secret.create.d.ts.map +1 -0
  225. package/script/commands/secret/secret.create.js +64 -0
  226. package/script/commands/secret/secret.delete.d.ts +28 -0
  227. package/script/commands/secret/secret.delete.d.ts.map +1 -0
  228. package/script/commands/secret/secret.delete.js +65 -0
  229. package/script/commands/secret/secret.list.d.ts +26 -0
  230. package/script/commands/secret/secret.list.d.ts.map +1 -0
  231. package/script/commands/secret/secret.list.js +67 -0
  232. package/script/commands/tenant/tenant.fetch.d.ts +43 -0
  233. package/script/commands/tenant/tenant.fetch.d.ts.map +1 -0
  234. package/script/commands/tenant/tenant.fetch.js +81 -0
  235. package/script/commands/tenant/tenant.list.d.ts +20 -0
  236. package/script/commands/tenant/tenant.list.d.ts.map +1 -0
  237. package/script/commands/tenant/tenant.list.js +69 -0
  238. package/script/commands/variable/variable.create.d.ts +31 -0
  239. package/script/commands/variable/variable.create.d.ts.map +1 -0
  240. package/script/commands/variable/variable.create.js +70 -0
  241. package/script/commands/variable/variable.delete.d.ts +28 -0
  242. package/script/commands/variable/variable.delete.d.ts.map +1 -0
  243. package/script/commands/variable/variable.delete.js +67 -0
  244. package/script/commands/variable/variable.list.d.ts +27 -0
  245. package/script/commands/variable/variable.list.d.ts.map +1 -0
  246. package/script/commands/variable/variable.list.js +73 -0
  247. package/script/common/command.d.ts +63 -0
  248. package/script/common/command.d.ts.map +1 -0
  249. package/script/common/command.js +96 -0
  250. package/script/common/flowcore-client.d.ts +39 -0
  251. package/script/common/flowcore-client.d.ts.map +1 -0
  252. package/script/common/flowcore-client.js +76 -0
  253. package/script/contracts/api-key.d.ts +14 -0
  254. package/script/contracts/api-key.d.ts.map +1 -0
  255. package/script/contracts/api-key.js +12 -0
  256. package/script/contracts/data-core.d.ts +38 -0
  257. package/script/contracts/data-core.d.ts.map +1 -0
  258. package/script/contracts/data-core.js +42 -0
  259. package/script/contracts/event-type.d.ts +33 -0
  260. package/script/contracts/event-type.d.ts.map +1 -0
  261. package/script/contracts/event-type.js +37 -0
  262. package/script/contracts/event.d.ts +20 -0
  263. package/script/contracts/event.d.ts.map +1 -0
  264. package/script/contracts/event.js +18 -0
  265. package/script/contracts/flow-type.d.ts +32 -0
  266. package/script/contracts/flow-type.d.ts.map +1 -0
  267. package/script/contracts/flow-type.js +35 -0
  268. package/script/contracts/index.d.ts +4 -0
  269. package/script/contracts/index.d.ts.map +1 -0
  270. package/script/contracts/index.js +2 -0
  271. package/script/contracts/tenant.d.ts +50 -0
  272. package/script/contracts/tenant.d.ts.map +1 -0
  273. package/script/contracts/tenant.js +37 -0
  274. package/script/contracts/variable.d.ts +13 -0
  275. package/script/contracts/variable.d.ts.map +1 -0
  276. package/script/contracts/variable.js +11 -0
  277. package/script/exceptions/client-error.d.ts +9 -0
  278. package/script/exceptions/client-error.d.ts.map +1 -0
  279. package/script/exceptions/client-error.js +24 -0
  280. package/script/exceptions/command-error.d.ts +7 -0
  281. package/script/exceptions/command-error.d.ts.map +1 -0
  282. package/script/exceptions/command-error.js +12 -0
  283. package/script/exceptions/index.d.ts +4 -0
  284. package/script/exceptions/index.d.ts.map +1 -0
  285. package/script/exceptions/index.js +19 -0
  286. package/script/exceptions/invalid-response.d.ts +8 -0
  287. package/script/exceptions/invalid-response.d.ts.map +1 -0
  288. package/script/exceptions/invalid-response.js +19 -0
  289. package/script/exceptions/not-found.d.ts +7 -0
  290. package/script/exceptions/not-found.d.ts.map +1 -0
  291. package/script/exceptions/not-found.js +12 -0
  292. package/script/mod.d.ts +6 -0
  293. package/script/mod.d.ts.map +1 -0
  294. package/script/mod.js +21 -0
  295. package/script/package.json +3 -0
  296. package/script/utils/parse-response-helper.d.ts +6 -0
  297. package/script/utils/parse-response-helper.d.ts.map +1 -0
  298. package/script/utils/parse-response-helper.js +20 -0
@@ -0,0 +1,4 @@
1
+ export type { DataCore } from "./data-core.js";
2
+ export type { EventType } from "./event-type.js";
3
+ export type { FlowType } from "./flow-type.js";
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/contracts/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AAC9C,YAAY,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAChD,YAAY,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA"}
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,50 @@
1
+ import { type Static, type TObject, type TString } from "@sinclair/typebox";
2
+ interface TenantById {
3
+ tenantId: string;
4
+ tenant?: never;
5
+ }
6
+ interface TenantByName {
7
+ tenant: string;
8
+ tenantId?: never;
9
+ }
10
+ export type TenantFetchInput = TenantById | TenantByName;
11
+ /**
12
+ * The schema for a tenant
13
+ */
14
+ export declare const TenantSchema: TObject<{
15
+ id: TString;
16
+ name: TString;
17
+ displayName: TString;
18
+ description: TString;
19
+ website: TString;
20
+ }>;
21
+ /**
22
+ * The type for a tenant
23
+ */
24
+ export type Tenant = Static<typeof TenantSchema>;
25
+ /**
26
+ * The type for a tenant with a link type
27
+ */
28
+ export type TenantWithLinkType = Tenant & {
29
+ linkType: "OWNER" | "COLLABORATOR";
30
+ };
31
+ /**
32
+ * The schema for a tenant v0
33
+ */
34
+ export declare const TenantV0Schema: TObject<{
35
+ id: TString;
36
+ org: TString;
37
+ displayName: TString;
38
+ description: TString;
39
+ website: TString;
40
+ }>;
41
+ /**
42
+ * The type for a tenant v0
43
+ */
44
+ export type TenantV0 = Static<typeof TenantV0Schema>;
45
+ /**
46
+ * Convert a data core v0 to a data core
47
+ */
48
+ export declare const tenantV0ToTenant: (tenantV0: TenantV0) => Tenant;
49
+ export {};
50
+ //# sourceMappingURL=tenant.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tenant.d.ts","sourceRoot":"","sources":["../../src/contracts/tenant.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,MAAM,EAAE,KAAK,OAAO,EAAE,KAAK,OAAO,EAAQ,MAAM,mBAAmB,CAAA;AAEjF,UAAU,UAAU;IAClB,QAAQ,EAAE,MAAM,CAAA;IAChB,MAAM,CAAC,EAAE,KAAK,CAAA;CACf;AAED,UAAU,YAAY;IACpB,MAAM,EAAE,MAAM,CAAA;IACd,QAAQ,CAAC,EAAE,KAAK,CAAA;CACjB;AAED,MAAM,MAAM,gBAAgB,GAAG,UAAU,GAAG,YAAY,CAAA;AAExD;;GAEG;AACH,eAAO,MAAM,YAAY,EAAE,OAAO,CAAC;IACjC,EAAE,EAAE,OAAO,CAAA;IACX,IAAI,EAAE,OAAO,CAAA;IACb,WAAW,EAAE,OAAO,CAAA;IACpB,WAAW,EAAE,OAAO,CAAA;IACpB,OAAO,EAAE,OAAO,CAAA;CACjB,CAMC,CAAA;AACF;;GAEG;AACH,MAAM,MAAM,MAAM,GAAG,MAAM,CAAC,OAAO,YAAY,CAAC,CAAA;AAEhD;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG,MAAM,GAAG;IACxC,QAAQ,EAAE,OAAO,GAAG,cAAc,CAAA;CACnC,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,cAAc,EAAE,OAAO,CAAC;IACnC,EAAE,EAAE,OAAO,CAAA;IACX,GAAG,EAAE,OAAO,CAAA;IACZ,WAAW,EAAE,OAAO,CAAA;IACpB,WAAW,EAAE,OAAO,CAAA;IACpB,OAAO,EAAE,OAAO,CAAA;CACjB,CAMC,CAAA;AAEF;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG,MAAM,CAAC,OAAO,cAAc,CAAC,CAAA;AAEpD;;GAEG;AACH,eAAO,MAAM,gBAAgB,aACjB,QAAQ,KACjB,MAQF,CAAA"}
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.tenantV0ToTenant = exports.TenantV0Schema = exports.TenantSchema = void 0;
4
+ const typebox_1 = require("@sinclair/typebox");
5
+ /**
6
+ * The schema for a tenant
7
+ */
8
+ exports.TenantSchema = typebox_1.Type.Object({
9
+ id: typebox_1.Type.String(),
10
+ name: typebox_1.Type.String(),
11
+ displayName: typebox_1.Type.String(),
12
+ description: typebox_1.Type.String(),
13
+ website: typebox_1.Type.String(),
14
+ });
15
+ /**
16
+ * The schema for a tenant v0
17
+ */
18
+ exports.TenantV0Schema = typebox_1.Type.Object({
19
+ id: typebox_1.Type.String(),
20
+ org: typebox_1.Type.String(),
21
+ displayName: typebox_1.Type.String(),
22
+ description: typebox_1.Type.String(),
23
+ website: typebox_1.Type.String(),
24
+ });
25
+ /**
26
+ * Convert a data core v0 to a data core
27
+ */
28
+ const tenantV0ToTenant = (tenantV0) => {
29
+ return {
30
+ id: tenantV0.id,
31
+ name: tenantV0.org,
32
+ displayName: tenantV0.displayName,
33
+ description: tenantV0.description,
34
+ website: tenantV0.website,
35
+ };
36
+ };
37
+ exports.tenantV0ToTenant = tenantV0ToTenant;
@@ -0,0 +1,13 @@
1
+ import { type Static, type TObject, type TString } from "@sinclair/typebox";
2
+ /**
3
+ * The schema for a variable
4
+ */
5
+ export declare const VariableSchema: TObject<{
6
+ key: TString;
7
+ value: TString;
8
+ }>;
9
+ /**
10
+ * The type for a variable
11
+ */
12
+ export type Variable = Static<typeof VariableSchema>;
13
+ //# sourceMappingURL=variable.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"variable.d.ts","sourceRoot":"","sources":["../../src/contracts/variable.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,MAAM,EAAE,KAAK,OAAO,EAAE,KAAK,OAAO,EAAQ,MAAM,mBAAmB,CAAA;AAEjF;;GAEG;AACH,eAAO,MAAM,cAAc,EAAE,OAAO,CAAC;IACnC,GAAG,EAAE,OAAO,CAAA;IACZ,KAAK,EAAE,OAAO,CAAA;CACf,CAGC,CAAA;AACF;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG,MAAM,CAAC,OAAO,cAAc,CAAC,CAAA"}
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.VariableSchema = void 0;
4
+ const typebox_1 = require("@sinclair/typebox");
5
+ /**
6
+ * The schema for a variable
7
+ */
8
+ exports.VariableSchema = typebox_1.Type.Object({
9
+ key: typebox_1.Type.String(),
10
+ value: typebox_1.Type.String(),
11
+ });
@@ -0,0 +1,9 @@
1
+ /**
2
+ * An error thrown when the client request fails
3
+ */
4
+ export declare class ClientError extends Error {
5
+ readonly status: number;
6
+ readonly body?: unknown | undefined;
7
+ constructor(message: string, status: number, body?: unknown | undefined);
8
+ }
9
+ //# sourceMappingURL=client-error.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client-error.d.ts","sourceRoot":"","sources":["../../src/exceptions/client-error.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,qBAAa,WAAY,SAAQ,KAAK;aACS,MAAM,EAAE,MAAM;aAAkB,IAAI,CAAC,EAAE,OAAO;gBAA/E,OAAO,EAAE,MAAM,EAAkB,MAAM,EAAE,MAAM,EAAkB,IAAI,CAAC,EAAE,OAAO,YAAA;CAG5F"}
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ClientError = void 0;
4
+ /**
5
+ * An error thrown when the client request fails
6
+ */
7
+ class ClientError extends Error {
8
+ constructor(message, status, body) {
9
+ super(`Client failed with ${status}: ${message}`);
10
+ Object.defineProperty(this, "status", {
11
+ enumerable: true,
12
+ configurable: true,
13
+ writable: true,
14
+ value: status
15
+ });
16
+ Object.defineProperty(this, "body", {
17
+ enumerable: true,
18
+ configurable: true,
19
+ writable: true,
20
+ value: body
21
+ });
22
+ }
23
+ }
24
+ exports.ClientError = ClientError;
@@ -0,0 +1,7 @@
1
+ /**
2
+ * An error thrown when the command fails
3
+ */
4
+ export declare class CommandError extends Error {
5
+ constructor(commandName: string, message: string);
6
+ }
7
+ //# sourceMappingURL=command-error.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"command-error.d.ts","sourceRoot":"","sources":["../../src/exceptions/command-error.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,qBAAa,YAAa,SAAQ,KAAK;gBACzB,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM;CAGjD"}
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CommandError = void 0;
4
+ /**
5
+ * An error thrown when the command fails
6
+ */
7
+ class CommandError extends Error {
8
+ constructor(commandName, message) {
9
+ super(`Command "${commandName}" failed with: ${message}`);
10
+ }
11
+ }
12
+ exports.CommandError = CommandError;
@@ -0,0 +1,4 @@
1
+ export * from "./client-error.js";
2
+ export * from "./invalid-response.js";
3
+ export * from "./not-found.js";
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/exceptions/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAA;AACjC,cAAc,uBAAuB,CAAA;AACrC,cAAc,gBAAgB,CAAA"}
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./client-error.js"), exports);
18
+ __exportStar(require("./invalid-response.js"), exports);
19
+ __exportStar(require("./not-found.js"), exports);
@@ -0,0 +1,8 @@
1
+ /**
2
+ * An error thrown when the response from the server is invalid
3
+ */
4
+ export declare class InvalidResponseException extends Error {
5
+ readonly errors: Record<string, string>;
6
+ constructor(message: string, errors: Record<string, string>);
7
+ }
8
+ //# sourceMappingURL=invalid-response.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"invalid-response.d.ts","sourceRoot":"","sources":["../../src/exceptions/invalid-response.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,qBAAa,wBAAyB,SAAQ,KAAK;aACJ,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;gBAA/D,OAAO,EAAE,MAAM,EAAkB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;CAI5E"}
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.InvalidResponseException = void 0;
4
+ /**
5
+ * An error thrown when the response from the server is invalid
6
+ */
7
+ class InvalidResponseException extends Error {
8
+ constructor(message, errors) {
9
+ super(message);
10
+ Object.defineProperty(this, "errors", {
11
+ enumerable: true,
12
+ configurable: true,
13
+ writable: true,
14
+ value: errors
15
+ });
16
+ this.errors = errors;
17
+ }
18
+ }
19
+ exports.InvalidResponseException = InvalidResponseException;
@@ -0,0 +1,7 @@
1
+ /**
2
+ * An error thrown when a resource is not found
3
+ */
4
+ export declare class NotFoundException extends Error {
5
+ constructor(resource: string, id: string);
6
+ }
7
+ //# sourceMappingURL=not-found.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"not-found.d.ts","sourceRoot":"","sources":["../../src/exceptions/not-found.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,qBAAa,iBAAkB,SAAQ,KAAK;gBAC9B,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM;CAGzC"}
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.NotFoundException = void 0;
4
+ /**
5
+ * An error thrown when a resource is not found
6
+ */
7
+ class NotFoundException extends Error {
8
+ constructor(resource, id) {
9
+ super(`${resource} with id ${id} not found`);
10
+ }
11
+ }
12
+ exports.NotFoundException = NotFoundException;
@@ -0,0 +1,6 @@
1
+ export * from "./commands/index.js";
2
+ export * from "./common/flowcore-client.js";
3
+ export * from "./common/command.js";
4
+ export * from "./contracts/index.js";
5
+ export * from "./exceptions/index.js";
6
+ //# sourceMappingURL=mod.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../src/mod.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAA;AACnC,cAAc,6BAA6B,CAAA;AAC3C,cAAc,qBAAqB,CAAA;AACnC,cAAc,sBAAsB,CAAA;AACpC,cAAc,uBAAuB,CAAA"}
package/script/mod.js ADDED
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./commands/index.js"), exports);
18
+ __exportStar(require("./common/flowcore-client.js"), exports);
19
+ __exportStar(require("./common/command.js"), exports);
20
+ __exportStar(require("./contracts/index.js"), exports);
21
+ __exportStar(require("./exceptions/index.js"), exports);
@@ -0,0 +1,3 @@
1
+ {
2
+ "type": "commonjs"
3
+ }
@@ -0,0 +1,6 @@
1
+ import type { Static, TSchema } from "@sinclair/typebox";
2
+ /**
3
+ * Helper method for parsing the response
4
+ */
5
+ export declare const parseResponseHelper: <T extends TSchema>(schema: T, response: unknown) => Static<T>;
6
+ //# sourceMappingURL=parse-response-helper.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parse-response-helper.d.ts","sourceRoot":"","sources":["../../src/utils/parse-response-helper.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAA;AAGxD;;GAEG;AACH,eAAO,MAAM,mBAAmB,GAAI,CAAC,SAAS,OAAO,UAAU,CAAC,YAAY,OAAO,KAAG,MAAM,CAAC,CAAC,CAU7F,CAAA"}
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.parseResponseHelper = void 0;
4
+ const value_1 = require("@sinclair/typebox/value");
5
+ const invalid_response_js_1 = require("../exceptions/invalid-response.js");
6
+ /**
7
+ * Helper method for parsing the response
8
+ */
9
+ const parseResponseHelper = (schema, response) => {
10
+ if (!value_1.Value.Check(schema, response)) {
11
+ const parseErrors = value_1.Value.Errors(schema, response);
12
+ const errors = {};
13
+ for (const error of parseErrors) {
14
+ errors[error.path] = error.message;
15
+ }
16
+ throw new invalid_response_js_1.InvalidResponseException("Invalid response", errors);
17
+ }
18
+ return response;
19
+ };
20
+ exports.parseResponseHelper = parseResponseHelper;