@vertesia/client 0.54.0 → 0.56.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (216) hide show
  1. package/lib/cjs/AccountApi.js +84 -0
  2. package/lib/cjs/AccountApi.js.map +1 -0
  3. package/lib/cjs/AccountsApi.js +16 -0
  4. package/lib/cjs/AccountsApi.js.map +1 -0
  5. package/lib/cjs/AnalyticsApi.js +13 -0
  6. package/lib/cjs/AnalyticsApi.js.map +1 -0
  7. package/lib/cjs/ApiKeysApi.js +63 -0
  8. package/lib/cjs/ApiKeysApi.js.map +1 -0
  9. package/lib/cjs/CommandsApi.js +19 -0
  10. package/lib/cjs/CommandsApi.js.map +1 -0
  11. package/lib/cjs/EnvironmentsApi.js +58 -0
  12. package/lib/cjs/EnvironmentsApi.js.map +1 -0
  13. package/lib/cjs/IamApi.js +51 -0
  14. package/lib/cjs/IamApi.js.map +1 -0
  15. package/lib/cjs/InteractionBase.js +44 -0
  16. package/lib/cjs/InteractionBase.js.map +1 -0
  17. package/lib/cjs/InteractionsApi.js +209 -0
  18. package/lib/cjs/InteractionsApi.js.map +1 -0
  19. package/lib/cjs/PluginsApi.js +27 -0
  20. package/lib/cjs/PluginsApi.js.map +1 -0
  21. package/lib/cjs/ProjectsApi.js +54 -0
  22. package/lib/cjs/ProjectsApi.js.map +1 -0
  23. package/lib/cjs/PromptsApi.js +133 -0
  24. package/lib/cjs/PromptsApi.js.map +1 -0
  25. package/lib/cjs/RefsApi.js +14 -0
  26. package/lib/cjs/RefsApi.js.map +1 -0
  27. package/lib/cjs/RunsApi.js +105 -0
  28. package/lib/cjs/RunsApi.js.map +1 -0
  29. package/lib/cjs/StreamSource.js +17 -0
  30. package/lib/cjs/StreamSource.js.map +1 -0
  31. package/lib/cjs/TrainingApi.js +54 -0
  32. package/lib/cjs/TrainingApi.js.map +1 -0
  33. package/lib/cjs/UsersApi.js +13 -0
  34. package/lib/cjs/UsersApi.js.map +1 -0
  35. package/lib/cjs/client.js +218 -0
  36. package/lib/cjs/client.js.map +1 -0
  37. package/lib/cjs/execute.js +152 -0
  38. package/lib/cjs/execute.js.map +1 -0
  39. package/lib/cjs/index.js +21 -0
  40. package/lib/cjs/index.js.map +1 -0
  41. package/lib/cjs/nodejs/NodeStreamSource.js +45 -0
  42. package/lib/cjs/nodejs/NodeStreamSource.js.map +1 -0
  43. package/lib/cjs/nodejs/index.js +18 -0
  44. package/lib/cjs/nodejs/index.js.map +1 -0
  45. package/lib/cjs/package.json +3 -0
  46. package/lib/cjs/store/AgentsApi.js +16 -0
  47. package/lib/cjs/store/AgentsApi.js.map +1 -0
  48. package/lib/cjs/store/AnalyzeDocApi.js +56 -0
  49. package/lib/cjs/store/AnalyzeDocApi.js.map +1 -0
  50. package/lib/cjs/store/CollectionsApi.js +77 -0
  51. package/lib/cjs/store/CollectionsApi.js.map +1 -0
  52. package/lib/cjs/store/CommandsApi.js +17 -0
  53. package/lib/cjs/store/CommandsApi.js.map +1 -0
  54. package/lib/cjs/store/EmbeddingsApi.js +29 -0
  55. package/lib/cjs/store/EmbeddingsApi.js.map +1 -0
  56. package/lib/cjs/store/FilesApi.js +128 -0
  57. package/lib/cjs/store/FilesApi.js.map +1 -0
  58. package/lib/cjs/store/ObjectsApi.js +254 -0
  59. package/lib/cjs/store/ObjectsApi.js.map +1 -0
  60. package/lib/cjs/store/TypesApi.js +57 -0
  61. package/lib/cjs/store/TypesApi.js.map +1 -0
  62. package/lib/cjs/store/WorkflowsApi.js +179 -0
  63. package/lib/cjs/store/WorkflowsApi.js.map +1 -0
  64. package/lib/cjs/store/client.js +55 -0
  65. package/lib/cjs/store/client.js.map +1 -0
  66. package/lib/cjs/store/errors.js +11 -0
  67. package/lib/cjs/store/errors.js.map +1 -0
  68. package/lib/cjs/store/index.js +22 -0
  69. package/lib/cjs/store/index.js.map +1 -0
  70. package/lib/esm/AccountApi.js +81 -0
  71. package/lib/esm/AccountApi.js.map +1 -0
  72. package/lib/esm/AccountsApi.js +13 -0
  73. package/lib/esm/AccountsApi.js.map +1 -0
  74. package/lib/esm/AnalyticsApi.js +10 -0
  75. package/lib/esm/AnalyticsApi.js.map +1 -0
  76. package/lib/esm/ApiKeysApi.js +59 -0
  77. package/lib/esm/ApiKeysApi.js.map +1 -0
  78. package/lib/esm/CommandsApi.js +16 -0
  79. package/lib/esm/CommandsApi.js.map +1 -0
  80. package/lib/esm/EnvironmentsApi.js +55 -0
  81. package/lib/esm/EnvironmentsApi.js.map +1 -0
  82. package/lib/esm/IamApi.js +45 -0
  83. package/lib/esm/IamApi.js.map +1 -0
  84. package/lib/esm/InteractionBase.js +40 -0
  85. package/lib/esm/InteractionBase.js.map +1 -0
  86. package/lib/esm/InteractionsApi.js +206 -0
  87. package/lib/esm/InteractionsApi.js.map +1 -0
  88. package/lib/esm/PluginsApi.js +24 -0
  89. package/lib/esm/PluginsApi.js.map +1 -0
  90. package/lib/esm/ProjectsApi.js +51 -0
  91. package/lib/esm/ProjectsApi.js.map +1 -0
  92. package/lib/esm/PromptsApi.js +130 -0
  93. package/lib/esm/PromptsApi.js.map +1 -0
  94. package/lib/esm/RefsApi.js +10 -0
  95. package/lib/esm/RefsApi.js.map +1 -0
  96. package/lib/esm/RunsApi.js +101 -0
  97. package/lib/esm/RunsApi.js.map +1 -0
  98. package/lib/esm/StreamSource.js +13 -0
  99. package/lib/esm/StreamSource.js.map +1 -0
  100. package/lib/esm/TrainingApi.js +51 -0
  101. package/lib/esm/TrainingApi.js.map +1 -0
  102. package/lib/esm/UsersApi.js +10 -0
  103. package/lib/esm/UsersApi.js.map +1 -0
  104. package/lib/esm/client.js +211 -0
  105. package/lib/esm/client.js.map +1 -0
  106. package/lib/esm/execute.js +113 -0
  107. package/lib/esm/execute.js.map +1 -0
  108. package/lib/esm/index.js +5 -0
  109. package/lib/esm/index.js.map +1 -0
  110. package/lib/esm/nodejs/NodeStreamSource.js +41 -0
  111. package/lib/esm/nodejs/NodeStreamSource.js.map +1 -0
  112. package/lib/esm/nodejs/index.js +2 -0
  113. package/lib/esm/nodejs/index.js.map +1 -0
  114. package/lib/esm/store/AgentsApi.js +12 -0
  115. package/lib/esm/store/AgentsApi.js.map +1 -0
  116. package/lib/esm/store/AnalyzeDocApi.js +52 -0
  117. package/lib/esm/store/AnalyzeDocApi.js.map +1 -0
  118. package/lib/esm/store/CollectionsApi.js +73 -0
  119. package/lib/esm/store/CollectionsApi.js.map +1 -0
  120. package/lib/esm/store/CommandsApi.js +13 -0
  121. package/lib/esm/store/CommandsApi.js.map +1 -0
  122. package/lib/esm/store/EmbeddingsApi.js +25 -0
  123. package/lib/esm/store/EmbeddingsApi.js.map +1 -0
  124. package/lib/esm/store/FilesApi.js +123 -0
  125. package/lib/esm/store/FilesApi.js.map +1 -0
  126. package/lib/esm/store/ObjectsApi.js +250 -0
  127. package/lib/esm/store/ObjectsApi.js.map +1 -0
  128. package/lib/esm/store/TypesApi.js +53 -0
  129. package/lib/esm/store/TypesApi.js.map +1 -0
  130. package/lib/esm/store/WorkflowsApi.js +173 -0
  131. package/lib/esm/store/WorkflowsApi.js.map +1 -0
  132. package/lib/esm/store/client.js +51 -0
  133. package/lib/esm/store/client.js.map +1 -0
  134. package/lib/esm/store/errors.js +7 -0
  135. package/lib/esm/store/errors.js.map +1 -0
  136. package/lib/esm/store/index.js +6 -0
  137. package/lib/esm/store/index.js.map +1 -0
  138. package/lib/tsconfig.tsbuildinfo +1 -0
  139. package/lib/types/AccountApi.d.ts +58 -0
  140. package/lib/types/AccountApi.d.ts.map +1 -0
  141. package/lib/types/AccountsApi.d.ts +7 -0
  142. package/lib/types/AccountsApi.d.ts.map +1 -0
  143. package/lib/types/AnalyticsApi.d.ts +6 -0
  144. package/lib/types/AnalyticsApi.d.ts.map +1 -0
  145. package/lib/types/ApiKeysApi.d.ts +42 -0
  146. package/lib/types/ApiKeysApi.d.ts.map +1 -0
  147. package/lib/types/CommandsApi.d.ts +10 -0
  148. package/lib/types/CommandsApi.d.ts.map +1 -0
  149. package/lib/types/EnvironmentsApi.d.ts +30 -0
  150. package/lib/types/EnvironmentsApi.d.ts.map +1 -0
  151. package/lib/types/IamApi.d.ts +39 -0
  152. package/lib/types/IamApi.d.ts.map +1 -0
  153. package/lib/types/InteractionBase.d.ts +22 -0
  154. package/lib/types/InteractionBase.d.ts.map +1 -0
  155. package/lib/types/InteractionsApi.d.ts +150 -0
  156. package/lib/types/InteractionsApi.d.ts.map +1 -0
  157. package/lib/types/PluginsApi.d.ts +12 -0
  158. package/lib/types/PluginsApi.d.ts.map +1 -0
  159. package/lib/types/ProjectsApi.d.ts +21 -0
  160. package/lib/types/ProjectsApi.d.ts.map +1 -0
  161. package/lib/types/PromptsApi.d.ts +106 -0
  162. package/lib/types/PromptsApi.d.ts.map +1 -0
  163. package/lib/types/RefsApi.d.ts +6 -0
  164. package/lib/types/RefsApi.d.ts.map +1 -0
  165. package/lib/types/RunsApi.d.ts +77 -0
  166. package/lib/types/RunsApi.d.ts.map +1 -0
  167. package/lib/types/StreamSource.d.ts +7 -0
  168. package/lib/types/StreamSource.d.ts.map +1 -0
  169. package/lib/types/TrainingApi.d.ts +27 -0
  170. package/lib/types/TrainingApi.d.ts.map +1 -0
  171. package/lib/types/UsersApi.d.ts +6 -0
  172. package/lib/types/UsersApi.d.ts.map +1 -0
  173. package/lib/types/client.d.ts +103 -0
  174. package/lib/types/client.d.ts.map +1 -0
  175. package/lib/types/execute.d.ts +36 -0
  176. package/lib/types/execute.d.ts.map +1 -0
  177. package/lib/types/index.d.ts +7 -0
  178. package/lib/types/index.d.ts.map +1 -0
  179. package/lib/types/nodejs/NodeStreamSource.d.ts +9 -0
  180. package/lib/types/nodejs/NodeStreamSource.d.ts.map +1 -0
  181. package/lib/types/nodejs/index.d.ts +1 -0
  182. package/lib/types/nodejs/index.d.ts.map +1 -0
  183. package/lib/types/store/AgentsApi.d.ts +6 -0
  184. package/lib/types/store/AgentsApi.d.ts.map +1 -0
  185. package/lib/types/store/AnalyzeDocApi.d.ts +17 -0
  186. package/lib/types/store/AnalyzeDocApi.d.ts.map +1 -0
  187. package/lib/types/store/CollectionsApi.d.ts +37 -0
  188. package/lib/types/store/CollectionsApi.d.ts.map +1 -0
  189. package/lib/types/store/CommandsApi.d.ts +10 -0
  190. package/lib/types/store/CommandsApi.d.ts.map +1 -0
  191. package/lib/types/store/EmbeddingsApi.d.ts +12 -0
  192. package/lib/types/store/EmbeddingsApi.d.ts.map +1 -0
  193. package/lib/types/store/FilesApi.d.ts +41 -0
  194. package/lib/types/store/FilesApi.d.ts.map +1 -0
  195. package/lib/types/store/ObjectsApi.d.ts +113 -0
  196. package/lib/types/store/ObjectsApi.d.ts.map +1 -0
  197. package/lib/types/store/TypesApi.d.ts +23 -0
  198. package/lib/types/store/TypesApi.d.ts.map +1 -0
  199. package/lib/types/store/WorkflowsApi.d.ts +47 -0
  200. package/lib/types/store/WorkflowsApi.d.ts.map +1 -0
  201. package/lib/types/store/client.d.ts +29 -0
  202. package/lib/types/store/client.d.ts.map +1 -0
  203. package/lib/types/store/errors.d.ts +4 -0
  204. package/lib/types/store/errors.d.ts.map +1 -0
  205. package/lib/types/store/index.d.ts +5 -0
  206. package/lib/types/store/index.d.ts.map +1 -0
  207. package/lib/vertesia-client.js +2 -0
  208. package/lib/vertesia-client.js.map +1 -0
  209. package/package.json +10 -5
  210. package/src/EnvironmentsApi.ts +1 -1
  211. package/src/PluginsApi.ts +7 -5
  212. package/src/ProjectsApi.ts +2 -2
  213. package/src/RunsApi.ts +1 -1
  214. package/src/TrainingApi.ts +1 -1
  215. package/src/store/ObjectsApi.ts +7 -1
  216. package/src/store/WorkflowsApi.ts +73 -68
@@ -0,0 +1,81 @@
1
+ import { ApiTopic } from "@vertesia/api-fetch-client";
2
+ export default class AccountApi extends ApiTopic {
3
+ constructor(parent) {
4
+ super(parent, "/api/v1/account");
5
+ }
6
+ /**
7
+ * Retrieve all account information for current account
8
+ * @returns Account[]
9
+ */
10
+ info() {
11
+ return this.get('/');
12
+ }
13
+ /**
14
+ * Update account information
15
+ * @returns Account
16
+ */
17
+ update(payload) {
18
+ return this.put('/', { payload });
19
+ }
20
+ /**
21
+ * Get all projects for account
22
+ */
23
+ projects() {
24
+ return this.get('/projects').then(res => res.data);
25
+ }
26
+ members() {
27
+ return this.get('/members');
28
+ }
29
+ /**
30
+ * Invite User to account
31
+ */
32
+ inviteUser(payload) {
33
+ return this.post('/invites', { payload });
34
+ }
35
+ /**
36
+ * Fetch Invites for Principal
37
+ * @returns UserInviteTokenData[]
38
+ * */
39
+ listInvites() {
40
+ return this.get('/invites');
41
+ }
42
+ /**
43
+ * Fetch Invites for Account
44
+ * @returns UserInviteTokenData[]
45
+ * */
46
+ listAccountInvitation(id) {
47
+ return this.get(`/invites/${id}`);
48
+ }
49
+ /**
50
+ * Accept Invite for account
51
+ * @returns UserInviteTokenData
52
+ * */
53
+ acceptInvite(id) {
54
+ return this.put(`/invites/${id}`);
55
+ }
56
+ /**
57
+ * Delete Invite for account
58
+ * @returns UserInviteTokenData
59
+ * */
60
+ rejectInvite(id) {
61
+ return this.delete(`/invites/${id}`);
62
+ }
63
+ /**
64
+ * Get Onboarding Progress for account
65
+ */
66
+ onboardingProgress() {
67
+ return this.get('/onboarding');
68
+ }
69
+ /**
70
+ * Get a google auth token for the current project.
71
+ * This token can be used to access exposed google cloud services
72
+ * @returns
73
+ */
74
+ getGoogleToken() {
75
+ return this.get('/google-token');
76
+ }
77
+ getStripeBillingStatus() {
78
+ return this.get('/stripe-billing-status');
79
+ }
80
+ }
81
+ //# sourceMappingURL=AccountApi.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AccountApi.js","sourceRoot":"","sources":["../../src/AccountApi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAc,MAAM,4BAA4B,CAAC;AAGlE,MAAM,CAAC,OAAO,OAAO,UAAW,SAAQ,QAAQ;IAE5C,YAAY,MAAkB;QAC1B,KAAK,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAA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,IAAI,CAAC,GAAG,CAAC,wBAAwB,CAAC,CAAA;IAC7C,CAAC;CAEJ"}
@@ -0,0 +1,13 @@
1
+ import { ApiTopic } from "@vertesia/api-fetch-client";
2
+ export default class AccountsApi extends ApiTopic {
3
+ constructor(parent) {
4
+ super(parent, "/api/v1/accounts");
5
+ }
6
+ create(name) {
7
+ return this.post('/', { payload: { name } });
8
+ }
9
+ list() {
10
+ return this.get('/');
11
+ }
12
+ }
13
+ //# sourceMappingURL=AccountsApi.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AccountsApi.js","sourceRoot":"","sources":["../../src/AccountsApi.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAc,MAAM,4BAA4B,CAAC;AAElE,MAAM,CAAC,OAAO,OAAO,WAAY,SAAQ,QAAQ;IAE7C,YAAY,MAAkB;QAC1B,KAAK,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAAA;IACrC,CAAC;IAED,MAAM,CAAC,IAAY;QACf,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC;IACjD,CAAC;IAED,IAAI;QACA,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACzB,CAAC;CAMJ"}
@@ -0,0 +1,10 @@
1
+ import { ApiTopic } from "@vertesia/api-fetch-client";
2
+ export default class AnalyticsApi extends ApiTopic {
3
+ constructor(parent) {
4
+ super(parent, "/api/v1/analytics");
5
+ }
6
+ runs(params) {
7
+ return this.post('/runs', { payload: params });
8
+ }
9
+ }
10
+ //# sourceMappingURL=AnalyticsApi.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AnalyticsApi.js","sourceRoot":"","sources":["../../src/AnalyticsApi.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAc,MAAM,4BAA4B,CAAC;AAKlE,MAAM,CAAC,OAAO,OAAO,YAAa,SAAQ,QAAQ;IAE9C,YAAY,MAAkB;QAC1B,KAAK,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAAA;IACtC,CAAC;IAED,IAAI,CAAC,MAAyB;QAE1B,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC,CAAC;IAEnD,CAAC;CAGJ"}
@@ -0,0 +1,59 @@
1
+ import { ApiTopic } from "@vertesia/api-fetch-client";
2
+ export class ApiKeysApi extends ApiTopic {
3
+ constructor(parent) {
4
+ super(parent, "/api/v1/apikeys");
5
+ }
6
+ /**
7
+ * List all keys for account without values
8
+ * @returns ApiKey[]
9
+ */
10
+ list() {
11
+ return this.get('/');
12
+ }
13
+ /**
14
+ * Create an new ApiKey for account
15
+ * BE VERY CAREFUL USING THIS API
16
+ * ALL REQUESTS ARE LOGGED IN SECURITY AUDIT LOG
17
+ * @returns ApiKeyWithValue
18
+ */
19
+ create(payload) {
20
+ return this.post('/', { payload });
21
+ }
22
+ /**
23
+ * Update an existing ApiKey for account
24
+ * @returns ApiKey
25
+ */
26
+ update(id, payload) {
27
+ return this.put(`/${id}`, { payload });
28
+ }
29
+ /**
30
+ * Retrieve an ApiKey and its value
31
+ * BE VERY CAREFUL USING THIS API AS IT EXPOSE THE API KEY VALUE
32
+ * ALL REQUESTS ARE LOGGED IN SECURITY AUDIT LOG
33
+ * @returns ApiKeyWithValue
34
+ * */
35
+ retrieve(id, withValue = false) {
36
+ if (withValue) {
37
+ return this.get(`/${id}`, { query: { withValue: true } });
38
+ }
39
+ else {
40
+ return this.get(`/${id}`);
41
+ }
42
+ }
43
+ /**
44
+ * get or create a temporary public key which can be used from browser to browse and execute interactions.
45
+ * If a public key already exists for the given project (or for the current organization) then it is returned, otherwise a new one is created.
46
+ * The payload object can contain the following properties:
47
+ * - name: the name of the public key. If not specified a random name is generated.
48
+ * - projectId: the id of the project to which the public key will be associated.
49
+ * If not specified the key is associated with the current organization. (i.e. account).
50
+ * - ttl: the time to live of the public key in seconds.
51
+ * The ttl defaults to 1h.
52
+ * @param opts
53
+ * @returns
54
+ */
55
+ requestPublicKey(payload = {}) {
56
+ return this.get('/pk', { query: payload });
57
+ }
58
+ }
59
+ //# sourceMappingURL=ApiKeysApi.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ApiKeysApi.js","sourceRoot":"","sources":["../../src/ApiKeysApi.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAc,MAAM,4BAA4B,CAAC;AAElE,MAAM,OAAO,UAAW,SAAQ,QAAQ;IAGpC,YAAY,MAAkB;QAC1B,KAAK,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAA;IACpC,CAAC;IAGD;;;OAGG;IACH,IAAI;QACA,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACzB,CAAC;IAED;;;;;OAKG;IACH,MAAM,CAAC,OAAoC;QACvC,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC;IACvC,CAAC;IAED;;;OAGG;IACH,MAAM,CAAC,EAAU,EAAE,OAAoC;QACnD,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,EAAE,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC;IAC3C,CAAC;IAED;;;;;SAKK;IACL,QAAQ,CAAC,EAAU,EAAE,YAAqB,KAAK;QAC3C,IAAI,SAAS,EAAE,CAAC;YACZ,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC;QAC9D,CAAC;aAAM,CAAC;YACJ,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;QAC9B,CAAC;IACL,CAAC;IAED;;;;;;;;;;;OAWG;IACH,gBAAgB,CAAC,UAAkC,EAAE;QACjD,OAAO,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,OAA0C,EAAE,CAAC,CAAC;IAClF,CAAC;CACJ"}
@@ -0,0 +1,16 @@
1
+ import { ApiTopic } from "@vertesia/api-fetch-client";
2
+ /**
3
+ * Various utility commands
4
+ */
5
+ export default class CommandsApi extends ApiTopic {
6
+ constructor(parent) {
7
+ super(parent, "/api/v1/commands");
8
+ }
9
+ async isNamespaceAvailable(name) {
10
+ return this.get(`/namespaces/${name}/is_available`).then((response) => response.available);
11
+ }
12
+ async initSamples() {
13
+ return this.post("/onboarding/init-samples");
14
+ }
15
+ }
16
+ //# sourceMappingURL=CommandsApi.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CommandsApi.js","sourceRoot":"","sources":["../../src/CommandsApi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAc,MAAM,4BAA4B,CAAC;AAIlE;;GAEG;AAEH,MAAM,CAAC,OAAO,OAAO,WAAY,SAAQ,QAAQ;IAE7C,YAAY,MAAkB;QAC1B,KAAK,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAAA;IACrC,CAAC;IAED,KAAK,CAAC,oBAAoB,CAAC,IAAY;QACnC,OAAO,IAAI,CAAC,GAAG,CAAC,eAAe,IAAI,eAAe,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;IAC/F,CAAC;IAED,KAAK,CAAC,WAAW;QACb,OAAO,IAAI,CAAC,IAAI,CAAC,0BAA0B,CAAC,CAAC;IACjD,CAAC;CAEJ"}
@@ -0,0 +1,55 @@
1
+ import { ApiTopic } from "@vertesia/api-fetch-client";
2
+ export default class EnvironmentsApi extends ApiTopic {
3
+ constructor(parent) {
4
+ super(parent, "/api/v1/environments");
5
+ }
6
+ /**
7
+ * List all environments for the current project
8
+ * @param all if true, list all environments, otherwise only the ones for the current project
9
+ */
10
+ list(all = false) {
11
+ const query = all ? { all: true } : undefined;
12
+ return this.get('/', { query });
13
+ }
14
+ create(payload) {
15
+ return this.post('/', {
16
+ payload
17
+ });
18
+ }
19
+ retrieve(id) {
20
+ return this.get('/' + id);
21
+ }
22
+ update(id, payload) {
23
+ return this.put('/' + id, {
24
+ payload
25
+ });
26
+ }
27
+ /**
28
+ * Update enabled models and / or config. If enabled_models is not provided, the existing enabled models will not change.
29
+ * Same, if config is not provided the exiting config is not changed.
30
+ * If the config is provided then it will be updated without removing fields that are not provided.
31
+ *
32
+ * @param id
33
+ * @param payload
34
+ * @returns
35
+ */
36
+ updateConfig(id, payload) {
37
+ return this.put('/' + id + '/config', {
38
+ payload
39
+ });
40
+ }
41
+ listModels(id, payload) {
42
+ return this.get('/' + id + '/models', {
43
+ query: payload ? { ...payload } : undefined
44
+ });
45
+ }
46
+ listTrainableModels(id) {
47
+ return this.get(`/${id}/trainable-models`);
48
+ }
49
+ embeddings(id, payload) {
50
+ return this.post('/' + id + '/embeddings', {
51
+ payload
52
+ });
53
+ }
54
+ }
55
+ //# sourceMappingURL=EnvironmentsApi.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EnvironmentsApi.js","sourceRoot":"","sources":["../../src/EnvironmentsApi.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAc,MAAM,4BAA4B,CAAC;AAElE,MAAM,CAAC,OAAO,OAAO,eAAgB,SAAQ,QAAQ;IACjD,YAAY,MAAkB;QAC1B,KAAK,CAAC,MAAM,EAAE,sBAAsB,CAAC,CAAC;IAC1C,CAAC;IAED;;;OAGG;IACH,IAAI,CAAC,MAAe,KAAK;QACrB,MAAM,KAAK,GAAG,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;QAE9C,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC;IACpC,CAAC;IAED,MAAM,CAAC,OAA0C;QAC7C,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE;YAClB,OAAO;SACV,CAAC,CAAC;IACP,CAAC;IAED,QAAQ,CAAC,EAAU;QACf,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,GAAG,EAAE,CAAC,CAAC;IAC9B,CAAC;IAED,MAAM,CAAC,EAAU,EAAE,OAA0C;QACzD,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,GAAG,EAAE,EAAE;YACtB,OAAO;SACV,CAAC,CAAC;IACP,CAAC;IAED;;;;;;;;OAQG;IACH,YAAY,CAAC,EAAU,EAAE,OAGxB;QACG,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,GAAG,EAAE,GAAG,SAAS,EAAE;YAClC,OAAO;SACV,CAAC,CAAC;IACP,CAAC;IAED,UAAU,CAAC,EAAU,EAAE,OAA4B;QAC/C,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,GAAG,EAAE,GAAG,SAAS,EAAE;YAClC,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC,CAAC,SAAS;SAC9C,CAAC,CAAC;IACP,CAAC;IAED,mBAAmB,CAAC,EAAU;QAC1B,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,mBAAmB,CAAC,CAAC;IAC/C,CAAC;IAED,UAAU,CAAC,EAAU,EAAE,OAA2B;QAC9C,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,GAAG,EAAE,GAAG,aAAa,EAAE;YACvC,OAAO;SACV,CAAC,CAAC;IACP,CAAC;CAEJ"}
@@ -0,0 +1,45 @@
1
+ import { ApiTopic } from "@vertesia/api-fetch-client";
2
+ export class IamApi extends ApiTopic {
3
+ constructor(parent) {
4
+ super(parent, "/api/v1/iam");
5
+ }
6
+ aces = new AcesApi(this);
7
+ roles = new RolesApi(this);
8
+ }
9
+ export class RolesApi extends ApiTopic {
10
+ constructor(parent) {
11
+ super(parent, "/roles");
12
+ }
13
+ list() {
14
+ return this.get('/');
15
+ }
16
+ }
17
+ export class AcesApi extends ApiTopic {
18
+ constructor(parent) {
19
+ super(parent, "/aces");
20
+ }
21
+ /**
22
+ * Get the list of all runs
23
+ * @param project optional project id to filter by
24
+ * @param interaction optional interaction id to filter by
25
+ * @returns InteractionResult[]
26
+ **/
27
+ list(options) {
28
+ return this.get('/', { query: { ...options } });
29
+ }
30
+ /**
31
+ * Get an ACE by its Id
32
+ * @param id
33
+ * @returns InteractionResult
34
+ **/
35
+ retrieve(id) {
36
+ return this.get('/' + id);
37
+ }
38
+ create(payload) {
39
+ return this.post('/', { payload });
40
+ }
41
+ delete(id) {
42
+ return this.del('/' + id);
43
+ }
44
+ }
45
+ //# sourceMappingURL=IamApi.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IamApi.js","sourceRoot":"","sources":["../../src/IamApi.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAc,MAAM,4BAA4B,CAAC;AAUlE,MAAM,OAAO,MAAO,SAAQ,QAAQ;IAEhC,YAAY,MAAkB;QAC1B,KAAK,CAAC,MAAM,EAAE,aAAa,CAAC,CAAA;IAChC,CAAC;IAED,IAAI,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;IACxB,KAAK,GAAG,IAAI,QAAQ,CAAC,IAAI,CAAC,CAAA;CAC7B;AAED,MAAM,OAAO,QAAS,SAAQ,QAAQ;IAElC,YAAY,MAAkB;QAC1B,KAAK,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAA;IAC3B,CAAC;IAED,IAAI;QACA,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACzB,CAAC;CAEJ;AAGD,MAAM,OAAO,OAAQ,SAAQ,QAAQ;IAEjC,YAAY,MAAkB;QAC1B,KAAK,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC1B,CAAC;IAED;;;;;QAKI;IACJ,IAAI,CAAC,OAAyB;QAC1B,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,EAAE,KAAK,EAAE,EAAE,GAAG,OAAO,EAAE,EAAE,CAAC,CAAC;IACpD,CAAC;IAED;;;;QAII;IACJ,QAAQ,CAAC,EAAU;QACf,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,GAAG,EAAE,CAAC,CAAC;IAC9B,CAAC;IAED,MAAM,CAAC,OAAyB;QAC5B,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,EAAE,OAAO,EAAE,CAAC,CAAA;IACtC,CAAC;IAED,MAAM,CAAC,EAAU;QACb,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,GAAG,EAAE,CAAC,CAAA;IAC7B,CAAC;CAEJ"}
@@ -0,0 +1,40 @@
1
+ import { VertesiaClient } from "./client.js";
2
+ import { executeInteraction } from "./execute.js";
3
+ export class InteractionBase {
4
+ id;
5
+ client;
6
+ constructor(id, clientOrOpts) {
7
+ this.id = id;
8
+ if (clientOrOpts instanceof VertesiaClient) {
9
+ this.client = clientOrOpts;
10
+ }
11
+ else {
12
+ this.client = new VertesiaClient(clientOrOpts);
13
+ }
14
+ }
15
+ retrieve() {
16
+ return this.client.interactions.retrieve(this.id);
17
+ }
18
+ update(payload) {
19
+ return this.client.interactions.update(this.id, payload);
20
+ }
21
+ render(data) {
22
+ data;
23
+ //TODO
24
+ }
25
+ /**
26
+ * Execute an interaction and return a promise which will be resolved with the executed run when
27
+ * the run completes or fails.
28
+ * If the onChunk callback is passed then the streaming of the result is enabled.
29
+ * The onChunk callback with be called with the next chunk of the result as soon as it is available.
30
+ * When all chunks are received the function will return the resolved promise
31
+ * @param id of the interaction to execute
32
+ * @param payload InteractionExecutionPayload
33
+ * @param onChunk callback to be called when the next chunk of the response is available
34
+ * @returns the resolved execution run as Promise<ExecutionRun>
35
+ */
36
+ async execute(payload = {}, onChunk) {
37
+ return executeInteraction(this.client, this.id, payload, onChunk);
38
+ }
39
+ }
40
+ //# sourceMappingURL=InteractionBase.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InteractionBase.js","sourceRoot":"","sources":["../../src/InteractionBase.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAuB,MAAM,aAAa,CAAC;AAClE,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAElD,MAAM,OAAO,eAAe;IAGL;IAFnB,MAAM,CAAiB;IAEvB,YAAmB,EAAU,EAAE,YAAkD;QAA9D,OAAE,GAAF,EAAE,CAAQ;QACzB,IAAI,YAAY,YAAY,cAAc,EAAE,CAAC;YACzC,IAAI,CAAC,MAAM,GAAG,YAAY,CAAC;QAC/B,CAAC;aAAM,CAAC;YACJ,IAAI,CAAC,MAAM,GAAG,IAAI,cAAc,CAAC,YAAY,CAAC,CAAC;QACnD,CAAC;IACL,CAAC;IAED,QAAQ;QACJ,OAAO,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACtD,CAAC;IAED,MAAM,CAAC,OAAiC;QACpC,OAAO,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC;IAC7D,CAAC;IAED,MAAM,CAAC,IAAO;QACV,IAAI,CAAC;QACL,MAAM;IACV,CAAC;IAED;;;;;;;;;;OAUG;IACH,KAAK,CAAC,OAAO,CAAC,UAAuC,EAAE,EACnD,OAAiC;QACjC,OAAO,kBAAkB,CAAO,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;IAC5E,CAAC;CACJ"}
@@ -0,0 +1,206 @@
1
+ import { ApiTopic, ServerError } from "@vertesia/api-fetch-client";
2
+ import { executeInteraction, executeInteractionAsync, executeInteractionByName } from "./execute.js";
3
+ export default class InteractionsApi extends ApiTopic {
4
+ constructor(parent) {
5
+ super(parent, "/api/v1/interactions");
6
+ }
7
+ /**
8
+ * Get the list of all interactions in the current project
9
+ * @returns InteractionRef[]
10
+ **/
11
+ list(payload = {}) {
12
+ const query = payload.query || {};
13
+ return this.get("/", {
14
+ query: {
15
+ ...query
16
+ }
17
+ });
18
+ }
19
+ /**
20
+ * Find interactions given a mongo match query.
21
+ * You can also specify if prompts schemas are included in the result
22
+ */
23
+ listEndpoints(payload) {
24
+ return this.post("/endpoints", {
25
+ payload
26
+ });
27
+ }
28
+ /**
29
+ * List all interaction versions in the project having the given endpoint name.
30
+ * This is useful to list orphaned versions
31
+ * @param name
32
+ */
33
+ listVersionsByName(name) {
34
+ return this.get(`/versions/${name}`);
35
+ }
36
+ /**
37
+ * Get the list of all interactions facets
38
+ * @param payload query payload to filter facet search
39
+ * @returns ComputeInteractionFacetsResponse[]
40
+ **/
41
+ computeFacets(query) {
42
+ return this.post("/facets", {
43
+ payload: query
44
+ });
45
+ }
46
+ /**
47
+ * List interaction names in the current project
48
+ * @returns
49
+ */
50
+ listNames() {
51
+ return this.get('/names');
52
+ }
53
+ /**
54
+ * Get the list of all interactions in the current project. Schemas will be returned too.
55
+ * @returns InteractionRefWithSchema[]
56
+ **/
57
+ export(payload) {
58
+ return this.post('/export', { payload });
59
+ }
60
+ /**
61
+ * Create a new interaction
62
+ * @param payload InteractionCreatePayload
63
+ * @returns Interaction
64
+ * @throws ApiError
65
+ * @throws 400 if payload is invalid
66
+ * @throws 500 if interaction creation fails
67
+ **/
68
+ create(payload) {
69
+ return this.post('/', {
70
+ payload
71
+ });
72
+ }
73
+ /**
74
+ * Retrieve an existing interaction definition
75
+ * @param id of the interaction to retrieve
76
+ * @returns Interaction
77
+ **/
78
+ retrieve(id) {
79
+ return this.get(`/${id}`);
80
+ }
81
+ /**
82
+ * Update an existing interaction definition
83
+ * @param id of the interaction to update
84
+ * @param payload InteractionUpdatePayload
85
+ * @returns Interaction
86
+ * @throws ApiError
87
+ * @throws 400 if payload is invalid
88
+ * @throws 500 if interaction update fails
89
+ * @throws 404 if interaction not found
90
+ **/
91
+ update(id, payload) {
92
+ return this.put(`/${id}`, {
93
+ payload
94
+ });
95
+ }
96
+ /**
97
+ * Execute an interaction and return a promise which will be resolved with the executed run when
98
+ * the run completes or fails.
99
+ * If the onChunk callback is passed then the streaming of the result is enabled.
100
+ * The onChunk callback with be called with the next chunk of the result as soon as it is available.
101
+ * When all chunks are received the function will return the resolved promise
102
+ * @param id of the interaction to execute
103
+ * @param payload InteractionExecutionPayload
104
+ * @param onChunk callback to be called when the next chunk of the response is available
105
+ * @returns Promise<ExecutionRun>
106
+ * @throws ApiError
107
+ * @throws 404 if interaction not found
108
+ * @throws 400 if payload is invalid
109
+ * @throws 500 if interaction execution fails
110
+ * @throws 500 if interaction execution times out
111
+ **/
112
+ execute(id, payload = {}, onChunk) {
113
+ return executeInteraction(this.client, id, payload, onChunk).catch(err => {
114
+ if (err instanceof ServerError && err.payload?.id) {
115
+ throw err.updateDetails({ run_id: err.payload.id });
116
+ }
117
+ else {
118
+ throw err;
119
+ }
120
+ });
121
+ }
122
+ /**
123
+ * Same as execute but uses the interaction name selector instead of the id.
124
+ *
125
+ * A name selector is the interaction endpoint name suffixed with an optional tag or version which is starting with a `@` character.
126
+ * The special `draft` tag is used to select the draft version of the interaction. If no tag or version is specified then the latest version is selected.
127
+ * Examples of selectors:
128
+ * - `ReviewContract` - select the latest version of the ReviewContract interaction
129
+ * - `ReviewContract@1` - select the version 1 of the ReviewContract interaction
130
+ * - `ReviewContract@draft` - select the draft version of the ReviewContract interaction
131
+ * - `ReviewContract@fixed` - select the ReviewContract interaction which is tagged with 'fixed' tag.
132
+ * @param nameWithTag
133
+ * @param payload
134
+ * @param onChunk
135
+ * @returns
136
+ */
137
+ executeByName(nameWithTag, payload = {}, onChunk) {
138
+ return executeInteractionByName(this.client, nameWithTag, payload, onChunk).catch(err => {
139
+ if (err instanceof ServerError && err.payload?.id) {
140
+ throw err.updateDetails({ run_id: err.payload.id });
141
+ }
142
+ else {
143
+ throw err;
144
+ }
145
+ });
146
+ }
147
+ /**
148
+ * Execute an interaction in an workflow
149
+ * @param payload
150
+ * @returns
151
+ */
152
+ executeAsync(payload) {
153
+ return executeInteractionAsync(this.client, payload);
154
+ }
155
+ publish(id, payload) {
156
+ return this.post(`/${id}/publish`, {
157
+ payload
158
+ });
159
+ }
160
+ fork(id, payload) {
161
+ return this.post(`/${id}/fork`, {
162
+ payload
163
+ });
164
+ }
165
+ /**
166
+ * Generate Composable definition of an interaction
167
+ **/
168
+ generateInteraction(id, payload) {
169
+ return this.post(`${id}/generate-interaction`, {
170
+ payload
171
+ });
172
+ }
173
+ /**
174
+ * Generate Test Data for an interaction
175
+ **/
176
+ generateTestData(id, payload) {
177
+ return this.post(`${id}/generate-test-data`, {
178
+ payload
179
+ });
180
+ }
181
+ /**
182
+ * Suggest Improvement for a prompt
183
+ */
184
+ suggestImprovements(id, payload) {
185
+ return this.post(`${id}/suggest-prompt-improvements`, {
186
+ payload
187
+ });
188
+ }
189
+ /**
190
+ * List the versions of the interaction. Returns an empty array if no versions are found
191
+ * @param id
192
+ * @returns the versions list or an empty array if no versions are found
193
+ */
194
+ listVersions(id) {
195
+ return this.get(`/${id}/versions`);
196
+ }
197
+ /**
198
+ * List the forks of the interaction. Returns an empty array if no forks are found
199
+ * @param id
200
+ * @returns the versions list or an empty array if no forks are found
201
+ */
202
+ listForks(id) {
203
+ return this.get(`/${id}/forks`);
204
+ }
205
+ }
206
+ //# sourceMappingURL=InteractionsApi.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InteractionsApi.js","sourceRoot":"","sources":["../../src/InteractionsApi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAc,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAG/E,OAAO,EAAE,kBAAkB,EAAE,uBAAuB,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC;AAYrG,MAAM,CAAC,OAAO,OAAO,eAAgB,SAAQ,QAAQ;IACjD,YAAY,MAAkB;QAC1B,KAAK,CAAC,MAAM,EAAE,sBAAsB,CAAC,CAAC;IAC1C,CAAC;IAED;;;QAGI;IAC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,CAAC,EAAU,EAAE,OAA+B;QAC5C,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,OAAO,EAAE;YAC5B,OAAO;SACV,CAAC,CAAC;IACP,CAAC;IAED;;QAEI;IACJ,mBAAmB,CAAC,EAAU,EAAE,OAAmC;QAE/D,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,uBAAuB,EAAE;YAC3C,OAAO;SACV,CAAC,CAAC;IAEP,CAAC;IAED;;QAEI;IACJ,gBAAgB,CAAC,EAAU,EAAE,OAAgC;QAEzD,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,qBAAqB,EAAE;YACzC,OAAO;SACV,CAAC,CAAC;IACP,CAAC;IAED;;OAEG;IACH,mBAAmB,CAAC,EAAU,EAAE,OAA6B;QACzD,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,8BAA8B,EAAE;YAClD,OAAO;SACV,CAAC,CAAC;IACP,CAAC;IAED;;;;OAIG;IACH,YAAY,CAAC,EAAU;QACnB,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;IACvC,CAAC;IAED;;;;OAIG;IACH,SAAS,CAAC,EAAU;QAChB,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;IACpC,CAAC;CAEJ"}
@@ -0,0 +1,24 @@
1
+ import { ApiTopic } from "@vertesia/api-fetch-client";
2
+ export default class PluginsApi extends ApiTopic {
3
+ constructor(parent) {
4
+ super(parent, "/api/v1/plugins");
5
+ }
6
+ create(manifest) {
7
+ return this.post('/', { payload: manifest });
8
+ }
9
+ update(manifest) {
10
+ return this.put(`/${manifest.id}`, { payload: manifest });
11
+ }
12
+ /**
13
+ * @param ids - ids to filter by
14
+ * @returns
15
+ */
16
+ list(ids) {
17
+ return this.get('/', {
18
+ query: {
19
+ ids: ids ? ids.join(',') : undefined,
20
+ }
21
+ });
22
+ }
23
+ }
24
+ //# sourceMappingURL=PluginsApi.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PluginsApi.js","sourceRoot":"","sources":["../../src/PluginsApi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAc,MAAM,4BAA4B,CAAC;AAGlE,MAAM,CAAC,OAAO,OAAO,UAAW,SAAQ,QAAQ;IAE5C,YAAY,MAAkB;QAC1B,KAAK,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAA;IACpC,CAAC;IAED,MAAM,CAAC,QAAoC;QACvC,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC,CAAC;IACjD,CAAC;IAED,MAAM,CAAC,QAAwB;QAC3B,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,QAAQ,CAAC,EAAE,EAAE,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC,CAAC;IAC9D,CAAC;IAED;;;OAGG;IACH,IAAI,CAAC,GAAc;QACf,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE;YACjB,KAAK,EAAE;gBACH,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS;aACvC;SACJ,CAAC,CAAC;IACP,CAAC;CAEJ"}
@@ -0,0 +1,51 @@
1
+ import { ApiTopic } from "@vertesia/api-fetch-client";
2
+ export default class ProjectsApi extends ApiTopic {
3
+ constructor(parent) {
4
+ super(parent, "/api/v1/projects");
5
+ }
6
+ list(account) {
7
+ return this.get('/', { query: { account } });
8
+ }
9
+ retrieve(projectId) {
10
+ return this.get(`/${projectId}`);
11
+ }
12
+ create(payload) {
13
+ return this.post('/', {
14
+ payload
15
+ });
16
+ }
17
+ update(projectId, payload) {
18
+ return this.put(`/${projectId}`, {
19
+ payload
20
+ });
21
+ }
22
+ listPlugins(projectId) {
23
+ return this.get(`/${projectId}/plugins`);
24
+ }
25
+ setPlugins(projectId, pluginIds) {
26
+ return this.post(`/${projectId}/plugins`, { payload: { plugins: pluginIds } });
27
+ }
28
+ integrations = new IntegrationsConfigurationApi(this);
29
+ }
30
+ class IntegrationsConfigurationApi extends ApiTopic {
31
+ constructor(parent) {
32
+ super(parent, "/");
33
+ }
34
+ list(projectId) {
35
+ return this.get(`/${projectId}/integrations`).then(res => res.integrations);
36
+ }
37
+ retrieve(projectId, integrationId) {
38
+ return this.get(`/${projectId}/integrations/${integrationId}`).catch(err => {
39
+ if (err.status === 404) {
40
+ return undefined;
41
+ }
42
+ throw err;
43
+ });
44
+ }
45
+ update(projectId, integrationId, payload) {
46
+ return this.put(`/${projectId}/integrations/${integrationId}`, {
47
+ payload
48
+ });
49
+ }
50
+ }
51
+ //# sourceMappingURL=ProjectsApi.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ProjectsApi.js","sourceRoot":"","sources":["../../src/ProjectsApi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAc,MAAM,4BAA4B,CAAC;AAGlE,MAAM,CAAC,OAAO,OAAO,WAAY,SAAQ,QAAQ;IAC7C,YAAY,MAAkB;QAC1B,KAAK,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAAC;IACtC,CAAC;IAED,IAAI,CAAC,OAAkB;QACnB,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,EAAE,CAAC,CAAC;IACjD,CAAC;IAED,QAAQ,CAAC,SAAiB;QACtB,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,SAAS,EAAE,CAAC,CAAC;IACrC,CAAC;IAED,MAAM,CAAC,OAA8B;QACjC,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE;YAClB,OAAO;SACV,CAAC,CAAC;IACP,CAAC;IAED,MAAM,CAAC,SAAiB,EAAE,OAAyB;QAC/C,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,SAAS,EAAE,EAAE;YAC7B,OA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