@keboola/api-client 1.0.0 → 2.0.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 (221) hide show
  1. package/dist/ai/index.cjs +5 -201
  2. package/dist/ai/index.cjs.map +1 -1
  3. package/dist/ai/index.js +2 -201
  4. package/dist/ai/index.js.map +1 -1
  5. package/dist/assets/index.cjs +5 -180
  6. package/dist/assets/index.cjs.map +1 -1
  7. package/dist/assets/index.js +2 -180
  8. package/dist/assets/index.js.map +1 -1
  9. package/dist/chat/index.cjs +6 -422
  10. package/dist/chat/index.cjs.map +1 -1
  11. package/dist/chat/index.d.cts +1 -1
  12. package/dist/chat/index.d.ts +1 -1
  13. package/dist/chat/index.js +3 -422
  14. package/dist/chat/index.js.map +1 -1
  15. package/dist/chat/suggestions.cjs +70 -152
  16. package/dist/chat/suggestions.cjs.map +1 -1
  17. package/dist/chat/suggestions.js +1 -138
  18. package/dist/chat/suggestions.js.map +1 -1
  19. package/dist/chat/types.d.cts +1 -1
  20. package/dist/chat/types.d.ts +1 -1
  21. package/dist/chunk-345V46LR.cjs +934 -0
  22. package/dist/chunk-345V46LR.cjs.map +1 -0
  23. package/dist/chunk-3B7L6MCG.js +189 -0
  24. package/dist/chunk-3B7L6MCG.js.map +1 -0
  25. package/dist/chunk-3T54WH4X.cjs +42 -0
  26. package/dist/chunk-3T54WH4X.cjs.map +1 -0
  27. package/dist/chunk-3Y6NK7TC.js +34 -0
  28. package/dist/chunk-3Y6NK7TC.js.map +1 -0
  29. package/dist/chunk-4N7XBMWP.js +930 -0
  30. package/dist/chunk-4N7XBMWP.js.map +1 -0
  31. package/dist/chunk-4RC5E3SL.js +140 -0
  32. package/dist/chunk-4RC5E3SL.js.map +1 -0
  33. package/dist/chunk-633QJMHH.cjs +73 -0
  34. package/dist/chunk-633QJMHH.cjs.map +1 -0
  35. package/dist/chunk-6RQDX6JY.cjs +132 -0
  36. package/dist/chunk-6RQDX6JY.cjs.map +1 -0
  37. package/dist/chunk-76AHKXLC.cjs +29 -0
  38. package/dist/chunk-76AHKXLC.cjs.map +1 -0
  39. package/dist/chunk-7FY6COWG.js +71 -0
  40. package/dist/chunk-7FY6COWG.js.map +1 -0
  41. package/dist/chunk-7J2R6XHB.js +3 -0
  42. package/dist/chunk-7J2R6XHB.js.map +1 -0
  43. package/dist/chunk-BGLICNTG.cjs +33 -0
  44. package/dist/chunk-BGLICNTG.cjs.map +1 -0
  45. package/dist/chunk-BR3SBEFE.cjs +182 -0
  46. package/dist/chunk-BR3SBEFE.cjs.map +1 -0
  47. package/dist/chunk-CVV4HROS.cjs +37 -0
  48. package/dist/chunk-CVV4HROS.cjs.map +1 -0
  49. package/dist/chunk-DCTDH77P.cjs +277 -0
  50. package/dist/chunk-DCTDH77P.cjs.map +1 -0
  51. package/dist/chunk-EBCZUGUX.js +35 -0
  52. package/dist/chunk-EBCZUGUX.js.map +1 -0
  53. package/dist/chunk-EY5LALX2.cjs +26 -0
  54. package/dist/chunk-EY5LALX2.cjs.map +1 -0
  55. package/dist/chunk-FBQHHAL5.js +40 -0
  56. package/dist/chunk-FBQHHAL5.js.map +1 -0
  57. package/dist/chunk-GF4XZK5N.cjs +43 -0
  58. package/dist/chunk-GF4XZK5N.cjs.map +1 -0
  59. package/dist/chunk-GNPQB3MT.js +27 -0
  60. package/dist/chunk-GNPQB3MT.js.map +1 -0
  61. package/dist/chunk-GO6SOMGL.js +181 -0
  62. package/dist/chunk-GO6SOMGL.js.map +1 -0
  63. package/dist/chunk-HCNNMUTR.cjs +36 -0
  64. package/dist/chunk-HCNNMUTR.cjs.map +1 -0
  65. package/dist/chunk-HPVTVQBJ.cjs +238 -0
  66. package/dist/chunk-HPVTVQBJ.cjs.map +1 -0
  67. package/dist/chunk-HYUGRMCY.cjs +247 -0
  68. package/dist/chunk-HYUGRMCY.cjs.map +1 -0
  69. package/dist/chunk-IJMQCOBC.js +34 -0
  70. package/dist/chunk-IJMQCOBC.js.map +1 -0
  71. package/dist/chunk-IY3VNVXD.cjs +183 -0
  72. package/dist/chunk-IY3VNVXD.cjs.map +1 -0
  73. package/dist/chunk-JKFIB6SQ.cjs +685 -0
  74. package/dist/chunk-JKFIB6SQ.cjs.map +1 -0
  75. package/dist/chunk-JLNOESHX.cjs +47 -0
  76. package/dist/chunk-JLNOESHX.cjs.map +1 -0
  77. package/dist/chunk-JURD5MC3.js +178 -0
  78. package/dist/chunk-JURD5MC3.js.map +1 -0
  79. package/dist/chunk-LV3ZWNDC.js +75 -0
  80. package/dist/chunk-LV3ZWNDC.js.map +1 -0
  81. package/dist/chunk-LZ6A6J2E.cjs +77 -0
  82. package/dist/chunk-LZ6A6J2E.cjs.map +1 -0
  83. package/dist/chunk-OKVYLO6C.js +108 -0
  84. package/dist/chunk-OKVYLO6C.js.map +1 -0
  85. package/dist/chunk-PD3LJYS2.js +218 -0
  86. package/dist/chunk-PD3LJYS2.js.map +1 -0
  87. package/dist/chunk-PV4HIVW2.js +130 -0
  88. package/dist/chunk-PV4HIVW2.js.map +1 -0
  89. package/dist/chunk-R7PD3BRA.js +261 -0
  90. package/dist/chunk-R7PD3BRA.js.map +1 -0
  91. package/dist/chunk-SAEG42HW.js +64 -0
  92. package/dist/chunk-SAEG42HW.js.map +1 -0
  93. package/dist/chunk-TIIRBQUA.cjs +110 -0
  94. package/dist/chunk-TIIRBQUA.cjs.map +1 -0
  95. package/dist/chunk-TXFQ4YIK.js +31 -0
  96. package/dist/chunk-TXFQ4YIK.js.map +1 -0
  97. package/dist/chunk-U5SE6W5M.cjs +158 -0
  98. package/dist/chunk-U5SE6W5M.cjs.map +1 -0
  99. package/dist/chunk-UABYNGBZ.js +39 -0
  100. package/dist/chunk-UABYNGBZ.js.map +1 -0
  101. package/dist/chunk-UXF53ZOV.js +220 -0
  102. package/dist/chunk-UXF53ZOV.js.map +1 -0
  103. package/dist/chunk-VAOCYA6B.js +20 -0
  104. package/dist/chunk-VAOCYA6B.js.map +1 -0
  105. package/dist/chunk-VS5PM7KL.js +45 -0
  106. package/dist/chunk-VS5PM7KL.js.map +1 -0
  107. package/dist/chunk-WQ7EZWBF.js +24 -0
  108. package/dist/chunk-WQ7EZWBF.js.map +1 -0
  109. package/dist/chunk-XPDEQND7.cjs +4 -0
  110. package/dist/chunk-XPDEQND7.cjs.map +1 -0
  111. package/dist/chunk-XUDMML5C.cjs +211 -0
  112. package/dist/chunk-XUDMML5C.cjs.map +1 -0
  113. package/dist/chunk-YPCD7M2N.cjs +22 -0
  114. package/dist/chunk-YPCD7M2N.cjs.map +1 -0
  115. package/dist/chunk-YUEYMIMI.cjs +67 -0
  116. package/dist/chunk-YUEYMIMI.cjs.map +1 -0
  117. package/dist/chunk-YXCVNX2Q.cjs +36 -0
  118. package/dist/chunk-YXCVNX2Q.cjs.map +1 -0
  119. package/dist/chunk-ZEMKE6DI.js +681 -0
  120. package/dist/chunk-ZEMKE6DI.js.map +1 -0
  121. package/dist/dataScience/index.cjs +8 -412
  122. package/dist/dataScience/index.cjs.map +1 -1
  123. package/dist/dataScience/index.js +2 -391
  124. package/dist/dataScience/index.js.map +1 -1
  125. package/dist/domain/permissions/index.cjs +131 -2
  126. package/dist/domain/permissions/index.cjs.map +1 -1
  127. package/dist/domain/permissions/index.d.cts +108 -2
  128. package/dist/domain/permissions/index.d.ts +108 -2
  129. package/dist/domain/permissions/index.js +106 -3
  130. package/dist/domain/permissions/index.js.map +1 -1
  131. package/dist/editor/index.cjs +5 -264
  132. package/dist/editor/index.cjs.map +1 -1
  133. package/dist/editor/index.js +2 -264
  134. package/dist/editor/index.js.map +1 -1
  135. package/dist/encryption/index.cjs +5 -190
  136. package/dist/encryption/index.cjs.map +1 -1
  137. package/dist/encryption/index.js +2 -190
  138. package/dist/encryption/index.js.map +1 -1
  139. package/dist/import/index.cjs +5 -196
  140. package/dist/import/index.cjs.map +1 -1
  141. package/dist/import/index.js +2 -196
  142. package/dist/import/index.js.map +1 -1
  143. package/dist/index.cjs +314 -3569
  144. package/dist/index.cjs.map +1 -1
  145. package/dist/index.d.cts +2004 -105
  146. package/dist/index.d.ts +2004 -105
  147. package/dist/index.js +176 -3464
  148. package/dist/index.js.map +1 -1
  149. package/dist/management/index.cjs +10 -881
  150. package/dist/management/index.cjs.map +1 -1
  151. package/dist/management/index.js +3 -880
  152. package/dist/management/index.js.map +1 -1
  153. package/dist/metastore/index.cjs +5 -337
  154. package/dist/metastore/index.cjs.map +1 -1
  155. package/dist/metastore/index.js +2 -337
  156. package/dist/metastore/index.js.map +1 -1
  157. package/dist/oauth/index.cjs +5 -226
  158. package/dist/oauth/index.cjs.map +1 -1
  159. package/dist/oauth/index.js +2 -226
  160. package/dist/oauth/index.js.map +1 -1
  161. package/dist/project-Bzslbq4u.d.ts +16 -0
  162. package/dist/project-CYhB6rYN.d.cts +16 -0
  163. package/dist/queryService/index.cjs +5 -248
  164. package/dist/queryService/index.cjs.map +1 -1
  165. package/dist/queryService/index.js +2 -248
  166. package/dist/queryService/index.js.map +1 -1
  167. package/dist/queue/index.cjs +5 -190
  168. package/dist/queue/index.cjs.map +1 -1
  169. package/dist/queue/index.js +2 -190
  170. package/dist/queue/index.js.map +1 -1
  171. package/dist/sdk/configurations/index.d.cts +2 -12
  172. package/dist/sdk/configurations/index.d.ts +2 -12
  173. package/dist/sdk/storage/index.cjs +49 -248
  174. package/dist/sdk/storage/index.cjs.map +1 -1
  175. package/dist/sdk/storage/index.d.cts +2 -2
  176. package/dist/sdk/storage/index.d.ts +2 -2
  177. package/dist/sdk/storage/index.js +1 -240
  178. package/dist/sdk/storage/index.js.map +1 -1
  179. package/dist/sdk/tag/index.cjs +6 -203
  180. package/dist/sdk/tag/index.cjs.map +1 -1
  181. package/dist/sdk/tag/index.js +2 -206
  182. package/dist/sdk/tag/index.js.map +1 -1
  183. package/dist/status/index.cjs +6 -176
  184. package/dist/status/index.cjs.map +1 -1
  185. package/dist/status/index.js +3 -176
  186. package/dist/status/index.js.map +1 -1
  187. package/dist/status/types.cjs +2 -0
  188. package/dist/status/types.js +1 -1
  189. package/dist/storage/index.cjs +9 -1023
  190. package/dist/storage/index.cjs.map +1 -1
  191. package/dist/storage/index.d.cts +1 -1
  192. package/dist/storage/index.d.ts +1 -1
  193. package/dist/storage/index.js +3 -1023
  194. package/dist/storage/index.js.map +1 -1
  195. package/dist/storage/types.d.cts +68 -5
  196. package/dist/storage/types.d.ts +68 -5
  197. package/dist/{storageClient-C8LDO4gr.d.ts → storageClient-BicsbzZy.d.ts} +7 -1
  198. package/dist/{storageClient-D05fdGHW.d.cts → storageClient-CmK1LPHr.d.cts} +7 -1
  199. package/dist/storageSdk-BZ7ZW6_h.d.cts +143 -0
  200. package/dist/storageSdk-DCcD68FQ.d.ts +143 -0
  201. package/dist/syncActions/index.cjs +5 -364
  202. package/dist/syncActions/index.cjs.map +1 -1
  203. package/dist/syncActions/index.js +2 -345
  204. package/dist/syncActions/index.js.map +1 -1
  205. package/dist/telemetry/index.cjs +5 -187
  206. package/dist/telemetry/index.cjs.map +1 -1
  207. package/dist/telemetry/index.js +2 -187
  208. package/dist/telemetry/index.js.map +1 -1
  209. package/dist/{types-DJ6nbNq5.d.cts → types-CNkgmuhe.d.cts} +1 -1
  210. package/dist/{types-BjrNNn5I.d.ts → types-DzwzVgyG.d.ts} +1 -1
  211. package/dist/vault/index.cjs +5 -219
  212. package/dist/vault/index.cjs.map +1 -1
  213. package/dist/vault/index.js +2 -219
  214. package/dist/vault/index.js.map +1 -1
  215. package/dist/verify/index.cjs +5 -184
  216. package/dist/verify/index.cjs.map +1 -1
  217. package/dist/verify/index.js +2 -184
  218. package/dist/verify/index.js.map +1 -1
  219. package/package.json +1 -1
  220. package/dist/storageSdk-CX03lGn-.d.ts +0 -18
  221. package/dist/storageSdk-DZV4nB3o.d.cts +0 -18
@@ -0,0 +1,143 @@
1
+ import { CreateTableAsyncBody, TableCreateJob, TableImportAsyncBody, TableImportJob, TableExportAsyncBody, TableExportJob, BucketListing, CreateBucketListingInput, UpdateBucketListingInput } from './storage/types.cjs';
2
+ import { c as createStorageClient } from './storageClient-CmK1LPHr.cjs';
3
+
4
+ type Options = {
5
+ interval?: number;
6
+ maxAttempts?: number;
7
+ abortSignal?: AbortSignal;
8
+ };
9
+ type StorageSdkOptions = {
10
+ storageClient: ReturnType<typeof createStorageClient>;
11
+ };
12
+ declare const createStorageSdk: ({ storageClient }: StorageSdkOptions) => {
13
+ createTable: (bucketId: string, body: CreateTableAsyncBody, options?: Options) => Promise<TableCreateJob>;
14
+ importFromFile: (tableId: string, body: TableImportAsyncBody, options?: Options) => Promise<TableImportJob>;
15
+ exportToFile: (tableId: string, body?: TableExportAsyncBody, options?: Options) => Promise<TableExportJob>;
16
+ getBucketListing: (bucketId: string, signal?: AbortSignal) => Promise<BucketListing | null>;
17
+ listBucketListings: (signal?: AbortSignal) => Promise<BucketListing[]>;
18
+ createBucketListing: (bucketId: string, input: CreateBucketListingInput, options?: Options) => Promise<{
19
+ id: number;
20
+ tableId: string | null;
21
+ runId: string;
22
+ url: string;
23
+ createdTime: string;
24
+ creatorToken: {
25
+ id: string;
26
+ description: string;
27
+ };
28
+ endTime: string | null;
29
+ startTime: string | null;
30
+ operationName: "bucketListingCreate";
31
+ operationParams: {
32
+ queue: string;
33
+ } & {
34
+ bucketId: string;
35
+ };
36
+ metrics: {
37
+ inCompressed: boolean;
38
+ inBytes: number;
39
+ inBytesUncompressed: number;
40
+ outCompressed: boolean;
41
+ outBytes: number;
42
+ outBytesUncompressed: number;
43
+ };
44
+ } & ({
45
+ status: Exclude<"error" | "success" | "warning" | "created" | "waiting" | "processing" | "terminating" | "terminated" | "cancelled", "success" | "error">;
46
+ results: null;
47
+ } | {
48
+ status: "error";
49
+ results: null;
50
+ error: {
51
+ code: string;
52
+ message: string;
53
+ exceptionId?: string;
54
+ };
55
+ } | {
56
+ status: "success";
57
+ results: null;
58
+ })>;
59
+ updateBucketListing: (bucketId: string, input: UpdateBucketListingInput, options?: Options) => Promise<{
60
+ id: number;
61
+ tableId: string | null;
62
+ runId: string;
63
+ url: string;
64
+ createdTime: string;
65
+ creatorToken: {
66
+ id: string;
67
+ description: string;
68
+ };
69
+ endTime: string | null;
70
+ startTime: string | null;
71
+ operationName: "bucketListingUpdate";
72
+ operationParams: {
73
+ queue: string;
74
+ } & {
75
+ bucketId: string;
76
+ };
77
+ metrics: {
78
+ inCompressed: boolean;
79
+ inBytes: number;
80
+ inBytesUncompressed: number;
81
+ outCompressed: boolean;
82
+ outBytes: number;
83
+ outBytesUncompressed: number;
84
+ };
85
+ } & ({
86
+ status: Exclude<"error" | "success" | "warning" | "created" | "waiting" | "processing" | "terminating" | "terminated" | "cancelled", "success" | "error">;
87
+ results: null;
88
+ } | {
89
+ status: "error";
90
+ results: null;
91
+ error: {
92
+ code: string;
93
+ message: string;
94
+ exceptionId?: string;
95
+ };
96
+ } | {
97
+ status: "success";
98
+ results: null;
99
+ })>;
100
+ deleteBucketListing: (bucketId: string, options?: Options) => Promise<{
101
+ id: number;
102
+ tableId: string | null;
103
+ runId: string;
104
+ url: string;
105
+ createdTime: string;
106
+ creatorToken: {
107
+ id: string;
108
+ description: string;
109
+ };
110
+ endTime: string | null;
111
+ startTime: string | null;
112
+ operationName: "bucketListingDelete";
113
+ operationParams: {
114
+ queue: string;
115
+ } & {
116
+ bucketId: string;
117
+ };
118
+ metrics: {
119
+ inCompressed: boolean;
120
+ inBytes: number;
121
+ inBytesUncompressed: number;
122
+ outCompressed: boolean;
123
+ outBytes: number;
124
+ outBytesUncompressed: number;
125
+ };
126
+ } & ({
127
+ status: Exclude<"error" | "success" | "warning" | "created" | "waiting" | "processing" | "terminating" | "terminated" | "cancelled", "success" | "error">;
128
+ results: null;
129
+ } | {
130
+ status: "error";
131
+ results: null;
132
+ error: {
133
+ code: string;
134
+ message: string;
135
+ exceptionId?: string;
136
+ };
137
+ } | {
138
+ status: "success";
139
+ results: null;
140
+ })>;
141
+ };
142
+
143
+ export { createStorageSdk as c };
@@ -0,0 +1,143 @@
1
+ import { CreateTableAsyncBody, TableCreateJob, TableImportAsyncBody, TableImportJob, TableExportAsyncBody, TableExportJob, BucketListing, CreateBucketListingInput, UpdateBucketListingInput } from './storage/types.js';
2
+ import { c as createStorageClient } from './storageClient-BicsbzZy.js';
3
+
4
+ type Options = {
5
+ interval?: number;
6
+ maxAttempts?: number;
7
+ abortSignal?: AbortSignal;
8
+ };
9
+ type StorageSdkOptions = {
10
+ storageClient: ReturnType<typeof createStorageClient>;
11
+ };
12
+ declare const createStorageSdk: ({ storageClient }: StorageSdkOptions) => {
13
+ createTable: (bucketId: string, body: CreateTableAsyncBody, options?: Options) => Promise<TableCreateJob>;
14
+ importFromFile: (tableId: string, body: TableImportAsyncBody, options?: Options) => Promise<TableImportJob>;
15
+ exportToFile: (tableId: string, body?: TableExportAsyncBody, options?: Options) => Promise<TableExportJob>;
16
+ getBucketListing: (bucketId: string, signal?: AbortSignal) => Promise<BucketListing | null>;
17
+ listBucketListings: (signal?: AbortSignal) => Promise<BucketListing[]>;
18
+ createBucketListing: (bucketId: string, input: CreateBucketListingInput, options?: Options) => Promise<{
19
+ id: number;
20
+ tableId: string | null;
21
+ runId: string;
22
+ url: string;
23
+ createdTime: string;
24
+ creatorToken: {
25
+ id: string;
26
+ description: string;
27
+ };
28
+ endTime: string | null;
29
+ startTime: string | null;
30
+ operationName: "bucketListingCreate";
31
+ operationParams: {
32
+ queue: string;
33
+ } & {
34
+ bucketId: string;
35
+ };
36
+ metrics: {
37
+ inCompressed: boolean;
38
+ inBytes: number;
39
+ inBytesUncompressed: number;
40
+ outCompressed: boolean;
41
+ outBytes: number;
42
+ outBytesUncompressed: number;
43
+ };
44
+ } & ({
45
+ status: Exclude<"error" | "success" | "warning" | "created" | "waiting" | "processing" | "terminating" | "terminated" | "cancelled", "success" | "error">;
46
+ results: null;
47
+ } | {
48
+ status: "error";
49
+ results: null;
50
+ error: {
51
+ code: string;
52
+ message: string;
53
+ exceptionId?: string;
54
+ };
55
+ } | {
56
+ status: "success";
57
+ results: null;
58
+ })>;
59
+ updateBucketListing: (bucketId: string, input: UpdateBucketListingInput, options?: Options) => Promise<{
60
+ id: number;
61
+ tableId: string | null;
62
+ runId: string;
63
+ url: string;
64
+ createdTime: string;
65
+ creatorToken: {
66
+ id: string;
67
+ description: string;
68
+ };
69
+ endTime: string | null;
70
+ startTime: string | null;
71
+ operationName: "bucketListingUpdate";
72
+ operationParams: {
73
+ queue: string;
74
+ } & {
75
+ bucketId: string;
76
+ };
77
+ metrics: {
78
+ inCompressed: boolean;
79
+ inBytes: number;
80
+ inBytesUncompressed: number;
81
+ outCompressed: boolean;
82
+ outBytes: number;
83
+ outBytesUncompressed: number;
84
+ };
85
+ } & ({
86
+ status: Exclude<"error" | "success" | "warning" | "created" | "waiting" | "processing" | "terminating" | "terminated" | "cancelled", "success" | "error">;
87
+ results: null;
88
+ } | {
89
+ status: "error";
90
+ results: null;
91
+ error: {
92
+ code: string;
93
+ message: string;
94
+ exceptionId?: string;
95
+ };
96
+ } | {
97
+ status: "success";
98
+ results: null;
99
+ })>;
100
+ deleteBucketListing: (bucketId: string, options?: Options) => Promise<{
101
+ id: number;
102
+ tableId: string | null;
103
+ runId: string;
104
+ url: string;
105
+ createdTime: string;
106
+ creatorToken: {
107
+ id: string;
108
+ description: string;
109
+ };
110
+ endTime: string | null;
111
+ startTime: string | null;
112
+ operationName: "bucketListingDelete";
113
+ operationParams: {
114
+ queue: string;
115
+ } & {
116
+ bucketId: string;
117
+ };
118
+ metrics: {
119
+ inCompressed: boolean;
120
+ inBytes: number;
121
+ inBytesUncompressed: number;
122
+ outCompressed: boolean;
123
+ outBytes: number;
124
+ outBytesUncompressed: number;
125
+ };
126
+ } & ({
127
+ status: Exclude<"error" | "success" | "warning" | "created" | "waiting" | "processing" | "terminating" | "terminated" | "cancelled", "success" | "error">;
128
+ results: null;
129
+ } | {
130
+ status: "error";
131
+ results: null;
132
+ error: {
133
+ code: string;
134
+ message: string;
135
+ exceptionId?: string;
136
+ };
137
+ } | {
138
+ status: "success";
139
+ results: null;
140
+ })>;
141
+ };
142
+
143
+ export { createStorageSdk as c };
@@ -1,372 +1,13 @@
1
1
  'use strict';
2
2
 
3
- var qs = require('qs');
4
- var z = require('zod');
3
+ var chunkXUDMML5C_cjs = require('../chunk-XUDMML5C.cjs');
4
+ require('../chunk-HPVTVQBJ.cjs');
5
5
 
6
- function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
7
6
 
8
- function _interopNamespace(e) {
9
- if (e && e.__esModule) return e;
10
- var n = Object.create(null);
11
- if (e) {
12
- Object.keys(e).forEach(function (k) {
13
- if (k !== 'default') {
14
- var d = Object.getOwnPropertyDescriptor(e, k);
15
- Object.defineProperty(n, k, d.get ? d : {
16
- enumerable: true,
17
- get: function () { return e[k]; }
18
- });
19
- }
20
- });
21
- }
22
- n.default = e;
23
- return Object.freeze(n);
24
- }
25
7
 
26
- var qs__default = /*#__PURE__*/_interopDefault(qs);
27
- var z__namespace = /*#__PURE__*/_interopNamespace(z);
28
-
29
- // src/errors/ApiError.ts
30
- var ApiError = class extends Error {
31
- response;
32
- request;
33
- data;
34
- constructor({ response, request, data }) {
35
- super(response.statusText);
36
- this.response = response;
37
- this.request = request;
38
- this.data = data;
39
- }
40
- };
41
-
42
- // src/constants.ts
43
- var HttpStatus = {
44
- NO_CONTENT: 204};
45
-
46
- // src/fetchClient/createFetchClient/utils.ts
47
- var HttpHeader = {
48
- CONTENT_TYPE: "content-type"};
49
- var HttpContentType = {
50
- JSON: "application/json"};
51
- var defaultValidateStatus = ({ response }) => response.status >= 200 && response.status <= 299;
52
- function removeUndefined(obj) {
53
- const objCopy = { ...obj };
54
- for (const [key, value] of Object.entries(objCopy)) {
55
- if (value == null) delete objCopy[key];
56
- }
57
- return objCopy;
58
- }
59
- var parseData = async (response) => {
60
- if (response.status === HttpStatus.NO_CONTENT) return null;
61
- const contentType = response.headers.get(HttpHeader.CONTENT_TYPE);
62
- if (contentType && contentType == HttpContentType.JSON) {
63
- return response.json();
64
- }
65
- const text = await response.text();
66
- try {
67
- return JSON.parse(text);
68
- } catch {
69
- return text;
70
- }
71
- };
72
- var cleanHeadersInit = (headersInit) => {
73
- if (Array.isArray(headersInit)) return headersInit;
74
- if (headersInit instanceof Headers) return headersInit;
75
- if (headersInit == null) return headersInit;
76
- return removeUndefined(headersInit);
77
- };
78
- var createHeaders = (headersInitA, headersInitB) => {
79
- const headersA = new Headers(cleanHeadersInit(headersInitA));
80
- const headersB = new Headers(cleanHeadersInit(headersInitB));
81
- headersB.forEach((value, key) => {
82
- headersA.set(key, value);
83
- });
84
- return headersA;
85
- };
86
- var createPath = (path, pathParam = {}) => path.replace(/\{([^}]+)}/g, (_, key) => {
87
- if (!(key in pathParam))
88
- throw new Error(`Path parameter "${key}" is missing in the path "${path}"`);
89
- return encodeURIComponent(pathParam[key]);
90
- });
91
- var createSearch = (query, options = {}) => {
92
- return qs__default.default.stringify(query, {
93
- encodeValuesOnly: true,
94
- skipNulls: true,
95
- ...options
96
- });
97
- };
98
- var createBody = (body, headers) => {
99
- if (body == null) return null;
100
- if (body instanceof FormData) return body;
101
- if (typeof body === "string") return body;
102
- const stringifyBody = JSON.stringify(body);
103
- const stringBody = stringifyBody === "{}" ? null : stringifyBody;
104
- if (stringBody) headers.set(HttpHeader.CONTENT_TYPE, HttpContentType.JSON);
105
- return stringBody;
106
- };
107
- var createFetchRequest = ({
108
- url,
109
- method,
110
- params,
111
- options = {},
112
- defaultOptions
113
- }) => {
114
- const {
115
- baseUrl,
116
- validateStatus: defValidateStatus = defaultValidateStatus,
117
- headers: defaultHeaders,
118
- ...restDefaultOptions
119
- } = defaultOptions;
120
- const { validateStatus, queryArrayFormat, headers: endpointHeaders, ...restOptions } = options;
121
- const headers = createHeaders(defaultHeaders, endpointHeaders);
122
- const path = createPath(url, params.path);
123
- const search = createSearch(params.query ?? {}, { arrayFormat: queryArrayFormat });
124
- const body = createBody(params.body, headers);
125
- const urlInstance = new URL(baseUrl + path);
126
- urlInstance.search = search;
127
- const request = new Request(urlInstance, {
128
- ...restDefaultOptions,
129
- ...restOptions,
130
- headers,
131
- method: method.toUpperCase(),
132
- body
133
- });
134
- return { request, validateStatus: validateStatus ?? defValidateStatus };
135
- };
136
-
137
- // src/fetchClient/createFetchClient/createFetchClient.ts
138
- var isApiError = (error) => error instanceof ApiError;
139
- var createCoreFetch = (fetchFn) => async ({ request, validateStatus }) => {
140
- const response = await fetchFn(request);
141
- const data = await parseData(response);
142
- const apiResponse = {
143
- request,
144
- response,
145
- data
146
- };
147
- const boolOrError = validateStatus(apiResponse);
148
- if (isApiError(boolOrError)) throw boolOrError;
149
- if (!boolOrError) throw new ApiError(apiResponse);
150
- return apiResponse;
151
- };
152
- var createFetchClient = ({
153
- middlewares = [],
154
- ...defaultOptions
155
- }) => {
156
- const coreFetch = createCoreFetch(defaultOptions.fetchFn ?? fetch);
157
- const fetchWithMiddlewares = middlewares.reduceRight(
158
- (next, middleware) => middleware(next),
159
- coreFetch
160
- );
161
- const createFetchMethod = (method) => async (url, params, options = {}) => {
162
- const request = createFetchRequest({
163
- url,
164
- method,
165
- params,
166
- defaultOptions,
167
- options
168
- });
169
- const methodMiddlewares = options?.middlewares ?? [];
170
- return methodMiddlewares.reduceRight(
171
- (next, middleware) => middleware(next),
172
- fetchWithMiddlewares
173
- )(request);
174
- };
175
- return {
176
- get: createFetchMethod("get"),
177
- post: createFetchMethod("post"),
178
- put: createFetchMethod("put"),
179
- patch: createFetchMethod("patch"),
180
- delete: createFetchMethod("delete")
181
- };
182
- };
183
-
184
- // src/fetchClient/createOpenapiFetchClient.ts
185
- var createOpenapiFetchClient = (defaultOptions) => createFetchClient(defaultOptions);
186
-
187
- // src/clients/syncActions/constants.ts
188
- var SyncAction = {
189
- DATA_APP_GIT_REPOSITORY: "git-repository",
190
- GIT_REPOSITORY: "gitRepository",
191
- ENROLL_MFA: "enrollMFA"
192
- };
193
- var Component = {
194
- DATA_APP: "keboola.data-apps"
195
- };
196
- var Author = z__namespace.object({
197
- name: z__namespace.string(),
198
- email: z__namespace.email()
8
+ Object.defineProperty(exports, "createSyncActionsClient", {
9
+ enumerable: true,
10
+ get: function () { return chunkXUDMML5C_cjs.createSyncActionsClient; }
199
11
  });
200
- var RepositoryBranch = z__namespace.object({
201
- sha: z__namespace.string(),
202
- date: z__namespace.string(),
203
- comment: z__namespace.string(),
204
- branch: z__namespace.string(),
205
- author: Author
206
- });
207
- var Repository = z__namespace.object({
208
- repository: z__namespace.object({
209
- url: z__namespace.string()
210
- }),
211
- branches: z__namespace.array(RepositoryBranch)
212
- });
213
-
214
- // src/clients/syncActions/gitRepository/utils.ts
215
- var GitRepoConfigDataBuilder = class {
216
- repositoryUrl;
217
- config = {};
218
- constructor(repositoryUrl) {
219
- this.repositoryUrl = repositoryUrl;
220
- }
221
- withCredentials(username, password) {
222
- this.config.username = username;
223
- delete this.config["#sshKey"];
224
- this.config["#password"] = password;
225
- return this;
226
- }
227
- withSshKey(username, sshKey) {
228
- this.config.username = username;
229
- delete this.config["#password"];
230
- this.config["#sshKey"] = sshKey;
231
- return this;
232
- }
233
- build() {
234
- return {
235
- parameters: {
236
- git: {
237
- repo: this.repositoryUrl,
238
- ...this.config
239
- }
240
- }
241
- };
242
- }
243
- buildForDataApp() {
244
- return {
245
- parameters: {
246
- dataApp: {
247
- git: {
248
- repository: this.repositoryUrl,
249
- ...this.config
250
- }
251
- }
252
- }
253
- };
254
- }
255
- };
256
- var createGitRepoConfigDataBuilder = (repositoryUrl) => new GitRepoConfigDataBuilder(repositoryUrl);
257
-
258
- // src/clients/syncActions/gitRepository/gitRepository.ts
259
- var createGitRepository = (sendSyncAction) => {
260
- const getDataAppPublicGitRepository = async ({ repositoryUrl, ...other }, signal) => {
261
- const data = await sendSyncAction(
262
- {
263
- ...other,
264
- action: SyncAction.DATA_APP_GIT_REPOSITORY,
265
- componentId: Component.DATA_APP,
266
- configData: createGitRepoConfigDataBuilder(repositoryUrl).buildForDataApp()
267
- },
268
- signal
269
- );
270
- return Repository.parse(data);
271
- };
272
- const getDataAppPasswordPrivateGitRepository = async ({ repositoryUrl, username, password, ...other }, signal) => {
273
- const data = await sendSyncAction(
274
- {
275
- ...other,
276
- action: SyncAction.DATA_APP_GIT_REPOSITORY,
277
- componentId: Component.DATA_APP,
278
- configData: createGitRepoConfigDataBuilder(repositoryUrl).withCredentials(username, password).buildForDataApp()
279
- },
280
- signal
281
- );
282
- return Repository.parse(data);
283
- };
284
- const getDataAppSSHKeyPrivateGitRepository = async ({ repositoryUrl, username, sshKey, ...other }, signal) => {
285
- const data = await sendSyncAction(
286
- {
287
- ...other,
288
- action: SyncAction.DATA_APP_GIT_REPOSITORY,
289
- componentId: Component.DATA_APP,
290
- configData: createGitRepoConfigDataBuilder(repositoryUrl).withSshKey(username, sshKey).buildForDataApp()
291
- },
292
- signal
293
- );
294
- return Repository.parse(data);
295
- };
296
- const getPublicGitRepository = async ({ repositoryUrl, componentId, ...other }, signal) => {
297
- const data = await sendSyncAction(
298
- {
299
- ...other,
300
- action: SyncAction.GIT_REPOSITORY,
301
- componentId,
302
- configData: createGitRepoConfigDataBuilder(repositoryUrl).build()
303
- },
304
- signal
305
- );
306
- return Repository.parse(data);
307
- };
308
- const getPrivateGitRepository = async ({ repositoryUrl, username, password, componentId, ...other }, signal) => {
309
- const data = await sendSyncAction(
310
- {
311
- ...other,
312
- action: SyncAction.GIT_REPOSITORY,
313
- componentId,
314
- configData: createGitRepoConfigDataBuilder(repositoryUrl).withCredentials(username, password).build()
315
- },
316
- signal
317
- );
318
- return Repository.parse(data);
319
- };
320
- return {
321
- getDataAppPublicGitRepository,
322
- getDataAppPasswordPrivateGitRepository,
323
- getDataAppSSHKeyPrivateGitRepository,
324
- getPublicGitRepository,
325
- getPrivateGitRepository
326
- };
327
- };
328
-
329
- // src/clients/syncActions/syncActionsClient.ts
330
- var createSendSyncAction = (client) => {
331
- return async (body, signal) => {
332
- const { data } = await client.post(
333
- "/actions",
334
- {
335
- body
336
- },
337
- { signal }
338
- );
339
- return data;
340
- };
341
- };
342
- var createSyncActionsClient = ({ baseUrl, middlewares }) => {
343
- const client = createOpenapiFetchClient({
344
- baseUrl,
345
- middlewares
346
- });
347
- const sendSyncAction = createSendSyncAction(client);
348
- const enrollMFA = ({ email: email2, ...rest }, signal) => {
349
- return sendSyncAction(
350
- {
351
- ...rest,
352
- action: SyncAction.ENROLL_MFA,
353
- configData: {
354
- parameters: {
355
- user: {
356
- email: email2
357
- }
358
- }
359
- }
360
- },
361
- signal
362
- );
363
- };
364
- return {
365
- enrollMFA,
366
- gitRepository: createGitRepository(sendSyncAction)
367
- };
368
- };
369
-
370
- exports.createSyncActionsClient = createSyncActionsClient;
371
12
  //# sourceMappingURL=index.cjs.map
372
13
  //# sourceMappingURL=index.cjs.map