instill-sdk 0.0.1

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 (226) hide show
  1. package/README.md +369 -0
  2. package/dist/chunk-2VZRNT6D.mjs +0 -0
  3. package/dist/chunk-3VVR3XHW.mjs +56 -0
  4. package/dist/chunk-42SCMPQP.mjs +0 -0
  5. package/dist/chunk-4KLHN5HK.mjs +0 -0
  6. package/dist/chunk-4TKUHGUZ.mjs +244 -0
  7. package/dist/chunk-4VWYH26Q.mjs +145 -0
  8. package/dist/chunk-6M57XUNI.mjs +64 -0
  9. package/dist/chunk-6NTCWRRC.mjs +0 -0
  10. package/dist/chunk-6ZXT6X3H.mjs +0 -0
  11. package/dist/chunk-73EPIL2R.mjs +0 -0
  12. package/dist/chunk-7KV3Y36U.mjs +17 -0
  13. package/dist/chunk-D5OKZ665.mjs +32 -0
  14. package/dist/chunk-DXEIDDIA.mjs +32 -0
  15. package/dist/chunk-EBWGEVUX.mjs +33 -0
  16. package/dist/chunk-ECC5KF6S.mjs +150 -0
  17. package/dist/chunk-EHG2FVLQ.mjs +0 -0
  18. package/dist/chunk-EXJ4UK7Q.mjs +49 -0
  19. package/dist/chunk-FAXYADOP.mjs +0 -0
  20. package/dist/chunk-FNCXOA62.mjs +0 -0
  21. package/dist/chunk-GPM5FDRS.mjs +154 -0
  22. package/dist/chunk-IB43VC55.mjs +41 -0
  23. package/dist/chunk-IPW3WQCQ.mjs +35 -0
  24. package/dist/chunk-IWAQMUMR.mjs +42 -0
  25. package/dist/chunk-JONZWFL5.mjs +168 -0
  26. package/dist/chunk-JTTE7IZY.mjs +14 -0
  27. package/dist/chunk-JY37AKV6.mjs +0 -0
  28. package/dist/chunk-KCKTAMXW.mjs +0 -0
  29. package/dist/chunk-KHFNAMT4.mjs +160 -0
  30. package/dist/chunk-NRP5M7FG.mjs +128 -0
  31. package/dist/chunk-QLWRKSUE.mjs +104 -0
  32. package/dist/chunk-QV7PYP7E.mjs +0 -0
  33. package/dist/chunk-QZOKJQTL.mjs +102 -0
  34. package/dist/chunk-RVRM4NPL.mjs +29 -0
  35. package/dist/chunk-VASX6R4R.mjs +0 -0
  36. package/dist/chunk-VIPORJ6H.mjs +77 -0
  37. package/dist/chunk-WBQAMGXK.mjs +0 -0
  38. package/dist/chunk-WL54JNC6.mjs +64 -0
  39. package/dist/chunk-WLPBUHMI.mjs +0 -0
  40. package/dist/chunk-YT6ZGA4J.mjs +46 -0
  41. package/dist/chunk-YXNMG2RZ.mjs +98 -0
  42. package/dist/chunk-ZRC43MN3.mjs +111 -0
  43. package/dist/chunk-magic-string.3a794426-OWTMMGNR.mjs +1253 -0
  44. package/dist/connector/ConnectorClient.d.ts +54 -0
  45. package/dist/connector/ConnectorClient.js +457 -0
  46. package/dist/connector/ConnectorClient.mjs +16 -0
  47. package/dist/connector/action.d.ts +13 -0
  48. package/dist/connector/action.js +72 -0
  49. package/dist/connector/action.mjs +11 -0
  50. package/dist/connector/index.d.ts +2 -0
  51. package/dist/connector/index.js +37 -0
  52. package/dist/connector/index.mjs +13 -0
  53. package/dist/connector/mutation.d.ts +19 -0
  54. package/dist/connector/mutation.js +91 -0
  55. package/dist/connector/mutation.mjs +13 -0
  56. package/dist/connector/queries.d.ts +34 -0
  57. package/dist/connector/queries.js +227 -0
  58. package/dist/connector/queries.mjs +23 -0
  59. package/dist/connector/types.d.ts +102 -0
  60. package/dist/connector/types.js +18 -0
  61. package/dist/connector/types.mjs +1 -0
  62. package/dist/helper/axiosInstance.d.ts +3 -0
  63. package/dist/helper/axiosInstance.js +44 -0
  64. package/dist/helper/axiosInstance.mjs +7 -0
  65. package/dist/helper/config.d.ts +1 -0
  66. package/dist/helper/config.js +53 -0
  67. package/dist/helper/config.mjs +7 -0
  68. package/dist/helper/createClient.d.ts +2 -0
  69. package/dist/helper/createClient.js +90 -0
  70. package/dist/helper/createClient.mjs +8 -0
  71. package/dist/helper/getInstillApiErrorMessage.d.ts +2 -0
  72. package/dist/helper/getInstillApiErrorMessage.js +41 -0
  73. package/dist/helper/getInstillApiErrorMessage.mjs +7 -0
  74. package/dist/helper/getQueryString.d.ts +7 -0
  75. package/dist/helper/getQueryString.js +57 -0
  76. package/dist/helper/getQueryString.mjs +7 -0
  77. package/dist/helper/getQueryString.test.d.ts +1 -0
  78. package/dist/helper/getQueryString.test.js +15769 -0
  79. package/dist/helper/getQueryString.test.mjs +14458 -0
  80. package/dist/helper/index.d.ts +5 -0
  81. package/dist/helper/index.js +145 -0
  82. package/dist/helper/index.mjs +21 -0
  83. package/dist/index.d.ts +24 -0
  84. package/dist/index.js +1978 -0
  85. package/dist/index.mjs +87 -0
  86. package/dist/metric/MetricClient.d.ts +21 -0
  87. package/dist/metric/MetricClient.js +215 -0
  88. package/dist/metric/MetricClient.mjs +14 -0
  89. package/dist/metric/index.d.ts +1 -0
  90. package/dist/metric/index.js +18 -0
  91. package/dist/metric/index.mjs +3 -0
  92. package/dist/metric/pipeline/index.d.ts +1 -0
  93. package/dist/metric/pipeline/index.js +18 -0
  94. package/dist/metric/pipeline/index.mjs +2 -0
  95. package/dist/metric/pipeline/queries.d.ts +21 -0
  96. package/dist/metric/pipeline/queries.js +168 -0
  97. package/dist/metric/pipeline/queries.mjs +17 -0
  98. package/dist/metric/pipeline/types.d.ts +63 -0
  99. package/dist/metric/pipeline/types.js +18 -0
  100. package/dist/metric/pipeline/types.mjs +1 -0
  101. package/dist/mgmt/AuthClient.d.ts +35 -0
  102. package/dist/mgmt/AuthClient.js +308 -0
  103. package/dist/mgmt/AuthClient.mjs +16 -0
  104. package/dist/mgmt/action.d.ts +8 -0
  105. package/dist/mgmt/action.js +61 -0
  106. package/dist/mgmt/action.mjs +11 -0
  107. package/dist/mgmt/index.d.ts +2 -0
  108. package/dist/mgmt/index.js +37 -0
  109. package/dist/mgmt/index.mjs +13 -0
  110. package/dist/mgmt/mutation.d.ts +18 -0
  111. package/dist/mgmt/mutation.js +83 -0
  112. package/dist/mgmt/mutation.mjs +13 -0
  113. package/dist/mgmt/queries.d.ts +17 -0
  114. package/dist/mgmt/queries.js +148 -0
  115. package/dist/mgmt/queries.mjs +19 -0
  116. package/dist/mgmt/types.d.ts +62 -0
  117. package/dist/mgmt/types.js +18 -0
  118. package/dist/mgmt/types.mjs +1 -0
  119. package/dist/model/ModelClient.d.ts +48 -0
  120. package/dist/model/ModelClient.js +466 -0
  121. package/dist/model/ModelClient.mjs +16 -0
  122. package/dist/model/action.d.ts +9 -0
  123. package/dist/model/action.js +57 -0
  124. package/dist/model/action.mjs +9 -0
  125. package/dist/model/index.d.ts +2 -0
  126. package/dist/model/index.js +37 -0
  127. package/dist/model/index.mjs +13 -0
  128. package/dist/model/mutation.d.ts +15 -0
  129. package/dist/model/mutation.js +128 -0
  130. package/dist/model/mutation.mjs +11 -0
  131. package/dist/model/queries.d.ts +35 -0
  132. package/dist/model/queries.js +234 -0
  133. package/dist/model/queries.mjs +25 -0
  134. package/dist/model/types.d.ts +141 -0
  135. package/dist/model/types.js +18 -0
  136. package/dist/model/types.mjs +1 -0
  137. package/dist/operation/OperationClient.d.ts +11 -0
  138. package/dist/operation/OperationClient.js +106 -0
  139. package/dist/operation/OperationClient.mjs +8 -0
  140. package/dist/operation/index.d.ts +2 -0
  141. package/dist/operation/index.js +31 -0
  142. package/dist/operation/index.mjs +5 -0
  143. package/dist/operation/queries.d.ts +9 -0
  144. package/dist/operation/queries.js +67 -0
  145. package/dist/operation/queries.mjs +9 -0
  146. package/dist/operation/types.d.ts +9 -0
  147. package/dist/operation/types.js +18 -0
  148. package/dist/operation/types.mjs +1 -0
  149. package/dist/pipeline/PipelineClient.d.ts +80 -0
  150. package/dist/pipeline/PipelineClient.js +639 -0
  151. package/dist/pipeline/PipelineClient.mjs +16 -0
  152. package/dist/pipeline/action.d.ts +34 -0
  153. package/dist/pipeline/action.js +157 -0
  154. package/dist/pipeline/action.mjs +17 -0
  155. package/dist/pipeline/index.d.ts +2 -0
  156. package/dist/pipeline/index.js +37 -0
  157. package/dist/pipeline/index.mjs +13 -0
  158. package/dist/pipeline/mutation.d.ts +33 -0
  159. package/dist/pipeline/mutation.js +134 -0
  160. package/dist/pipeline/mutation.mjs +19 -0
  161. package/dist/pipeline/queries.d.ts +32 -0
  162. package/dist/pipeline/queries.js +223 -0
  163. package/dist/pipeline/queries.mjs +23 -0
  164. package/dist/pipeline/types.d.ts +204 -0
  165. package/dist/pipeline/types.js +18 -0
  166. package/dist/pipeline/types.mjs +1 -0
  167. package/dist/protogen-ts/base/metric/v1alpha/metric.ts +4522 -0
  168. package/dist/protogen-ts/base/metric/v1alpha/metric_service.ts +314 -0
  169. package/dist/protogen-ts/base/mgmt/v1alpha/metric.ts +2486 -0
  170. package/dist/protogen-ts/base/mgmt/v1alpha/mgmt.ts +3787 -0
  171. package/dist/protogen-ts/base/mgmt/v1alpha/mgmt_private_service.ts +107 -0
  172. package/dist/protogen-ts/base/mgmt/v1alpha/mgmt_public_service.ts +326 -0
  173. package/dist/protogen-ts/base/usage/v1alpha/usage.ts +2185 -0
  174. package/dist/protogen-ts/base/usage/v1alpha/usage_service.ts +81 -0
  175. package/dist/protogen-ts/common/healthcheck/v1alpha/healthcheck.ts +188 -0
  176. package/dist/protogen-ts/common/task/v1alpha/task.ts +109 -0
  177. package/dist/protogen-ts/google/api/annotations.ts +3 -0
  178. package/dist/protogen-ts/google/api/client.ts +2073 -0
  179. package/dist/protogen-ts/google/api/field_behavior.ts +119 -0
  180. package/dist/protogen-ts/google/api/http.ts +745 -0
  181. package/dist/protogen-ts/google/api/launch_stage.ts +115 -0
  182. package/dist/protogen-ts/google/api/resource.ts +529 -0
  183. package/dist/protogen-ts/google/longrunning/operations.ts +890 -0
  184. package/dist/protogen-ts/google/protobuf/any.ts +259 -0
  185. package/dist/protogen-ts/google/protobuf/descriptor.ts +4831 -0
  186. package/dist/protogen-ts/google/protobuf/duration.ts +203 -0
  187. package/dist/protogen-ts/google/protobuf/empty.ts +70 -0
  188. package/dist/protogen-ts/google/protobuf/field_mask.ts +289 -0
  189. package/dist/protogen-ts/google/protobuf/struct.ts +543 -0
  190. package/dist/protogen-ts/google/protobuf/timestamp.ts +232 -0
  191. package/dist/protogen-ts/google/rpc/status.ts +138 -0
  192. package/dist/protogen-ts/model/controller/v1alpha/controller.ts +823 -0
  193. package/dist/protogen-ts/model/controller/v1alpha/controller_service.ts +95 -0
  194. package/dist/protogen-ts/model/model/v1alpha/common.ts +135 -0
  195. package/dist/protogen-ts/model/model/v1alpha/model.ts +5682 -0
  196. package/dist/protogen-ts/model/model/v1alpha/model_definition.ts +775 -0
  197. package/dist/protogen-ts/model/model/v1alpha/model_private_service.ts +87 -0
  198. package/dist/protogen-ts/model/model/v1alpha/model_public_service.ts +383 -0
  199. package/dist/protogen-ts/model/model/v1alpha/task_classification.ts +326 -0
  200. package/dist/protogen-ts/model/model/v1alpha/task_detection.ts +411 -0
  201. package/dist/protogen-ts/model/model/v1alpha/task_instance_segmentation.ts +435 -0
  202. package/dist/protogen-ts/model/model/v1alpha/task_keypoint.ts +510 -0
  203. package/dist/protogen-ts/model/model/v1alpha/task_ocr.ts +406 -0
  204. package/dist/protogen-ts/model/model/v1alpha/task_semantic_segmentation.ts +396 -0
  205. package/dist/protogen-ts/model/model/v1alpha/task_text_generation.ts +247 -0
  206. package/dist/protogen-ts/model/model/v1alpha/task_text_to_image.ts +221 -0
  207. package/dist/protogen-ts/model/model/v1alpha/task_unspecified.ts +142 -0
  208. package/dist/protogen-ts/protoc-gen-openapiv2/options/annotations.ts +3 -0
  209. package/dist/protogen-ts/protoc-gen-openapiv2/options/openapiv2.ts +5095 -0
  210. package/dist/protogen-ts/vdp/connector/v1alpha/connector.ts +3637 -0
  211. package/dist/protogen-ts/vdp/connector/v1alpha/connector_definition.ts +1043 -0
  212. package/dist/protogen-ts/vdp/connector/v1alpha/connector_private_service.ts +92 -0
  213. package/dist/protogen-ts/vdp/connector/v1alpha/connector_public_service.ts +310 -0
  214. package/dist/protogen-ts/vdp/connector/v1alpha/spec.ts +126 -0
  215. package/dist/protogen-ts/vdp/controller/v1alpha/controller.ts +853 -0
  216. package/dist/protogen-ts/vdp/controller/v1alpha/controller_service.ts +95 -0
  217. package/dist/protogen-ts/vdp/pipeline/v1alpha/common.ts +498 -0
  218. package/dist/protogen-ts/vdp/pipeline/v1alpha/operator_definition.ts +948 -0
  219. package/dist/protogen-ts/vdp/pipeline/v1alpha/pipeline.ts +6006 -0
  220. package/dist/protogen-ts/vdp/pipeline/v1alpha/pipeline_private_service.ts +83 -0
  221. package/dist/protogen-ts/vdp/pipeline/v1alpha/pipeline_public_service.ts +413 -0
  222. package/dist/tsconfig.tsbuildinfo +1 -0
  223. package/dist/types.d.ts +23 -0
  224. package/dist/types.js +18 -0
  225. package/dist/types.mjs +1 -0
  226. package/package.json +50 -0
@@ -0,0 +1,91 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/connector/mutation.ts
21
+ var mutation_exports = {};
22
+ __export(mutation_exports, {
23
+ createUserConnectorResourceMutation: () => createUserConnectorResourceMutation,
24
+ deleteUserConnectorResourceMutation: () => deleteUserConnectorResourceMutation,
25
+ renameUserConnectorResource: () => renameUserConnectorResource,
26
+ updateUserConnectorResourceMutation: () => updateUserConnectorResourceMutation
27
+ });
28
+ module.exports = __toCommonJS(mutation_exports);
29
+ async function createUserConnectorResourceMutation({
30
+ axiosInstance,
31
+ userName,
32
+ payload
33
+ }) {
34
+ try {
35
+ const res = await axiosInstance.post(
36
+ `${userName}/connector-resources`,
37
+ payload
38
+ );
39
+ return Promise.resolve(res.data.connector_resource);
40
+ } catch (err) {
41
+ return Promise.reject(err);
42
+ }
43
+ }
44
+ async function deleteUserConnectorResourceMutation({
45
+ axiosInstance,
46
+ connectorResourceName
47
+ }) {
48
+ try {
49
+ await axiosInstance.delete(`/${connectorResourceName}`);
50
+ } catch (err) {
51
+ return Promise.reject(err);
52
+ }
53
+ }
54
+ async function updateUserConnectorResourceMutation({
55
+ axiosInstance,
56
+ payload
57
+ }) {
58
+ try {
59
+ const res = await axiosInstance.patch(
60
+ `/${payload.connectorResourceName}`,
61
+ {
62
+ ...payload,
63
+ connectorResourceName: void 0
64
+ }
65
+ );
66
+ return Promise.resolve(res.data.connector_resource);
67
+ } catch (err) {
68
+ return Promise.reject(err);
69
+ }
70
+ }
71
+ async function renameUserConnectorResource({
72
+ axiosInstance,
73
+ payload
74
+ }) {
75
+ try {
76
+ const { data } = await axiosInstance.post(
77
+ `/${payload.name}/rename`,
78
+ payload
79
+ );
80
+ return Promise.resolve(data.connector_resource);
81
+ } catch (err) {
82
+ return Promise.reject(err);
83
+ }
84
+ }
85
+ // Annotate the CommonJS export names for ESM import in node:
86
+ 0 && (module.exports = {
87
+ createUserConnectorResourceMutation,
88
+ deleteUserConnectorResourceMutation,
89
+ renameUserConnectorResource,
90
+ updateUserConnectorResourceMutation
91
+ });
@@ -0,0 +1,13 @@
1
+ import {
2
+ createUserConnectorResourceMutation,
3
+ deleteUserConnectorResourceMutation,
4
+ renameUserConnectorResource,
5
+ updateUserConnectorResourceMutation
6
+ } from "../chunk-6M57XUNI.mjs";
7
+ import "../chunk-EXJ4UK7Q.mjs";
8
+ export {
9
+ createUserConnectorResourceMutation,
10
+ deleteUserConnectorResourceMutation,
11
+ renameUserConnectorResource,
12
+ updateUserConnectorResourceMutation
13
+ };
@@ -0,0 +1,34 @@
1
+ import { AxiosInstance } from "axios";
2
+ import { Nullable } from "../types";
3
+ import { ConnectorDefinition, ConnectorResourceWatchState, ConnectorResourceWithDefinition } from "./types";
4
+ export declare function listConnectorResourcesQuery({ axiosInstance, pageSize, nextPageToken, filter, }: {
5
+ axiosInstance: AxiosInstance;
6
+ pageSize: Nullable<number>;
7
+ nextPageToken: Nullable<string>;
8
+ filter: Nullable<string>;
9
+ }): Promise<ConnectorResourceWithDefinition[]>;
10
+ export declare function listUserConnectorResourcesQuery({ axiosInstance, userName, pageSize, nextPageToken, filter, }: {
11
+ axiosInstance: AxiosInstance;
12
+ userName: string;
13
+ pageSize: Nullable<number>;
14
+ nextPageToken: Nullable<string>;
15
+ filter: Nullable<string>;
16
+ }): Promise<ConnectorResourceWithDefinition[]>;
17
+ export declare function listConnectorDefinitionsQuery({ axiosInstance, pageSize, nextPageToken, filter, }: {
18
+ axiosInstance: AxiosInstance;
19
+ pageSize: Nullable<number>;
20
+ nextPageToken: Nullable<string>;
21
+ filter: Nullable<string>;
22
+ }): Promise<ConnectorDefinition[]>;
23
+ export declare function getConnectorDefinitionQuery({ axiosInstance, connectorDefinitionName, }: {
24
+ axiosInstance: AxiosInstance;
25
+ connectorDefinitionName: string;
26
+ }): Promise<ConnectorDefinition>;
27
+ export declare function getUserConnectorResourceQuery({ axiosInstance, connectorResourceName, }: {
28
+ axiosInstance: AxiosInstance;
29
+ connectorResourceName: string;
30
+ }): Promise<ConnectorResourceWithDefinition>;
31
+ export declare function watchUserConnectorResource({ axiosInstance, connectorResourceName, }: {
32
+ axiosInstance: AxiosInstance;
33
+ connectorResourceName: string;
34
+ }): Promise<ConnectorResourceWatchState>;
@@ -0,0 +1,227 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+
30
+ // src/connector/queries.ts
31
+ var queries_exports = {};
32
+ __export(queries_exports, {
33
+ getConnectorDefinitionQuery: () => getConnectorDefinitionQuery,
34
+ getUserConnectorResourceQuery: () => getUserConnectorResourceQuery,
35
+ listConnectorDefinitionsQuery: () => listConnectorDefinitionsQuery,
36
+ listConnectorResourcesQuery: () => listConnectorResourcesQuery,
37
+ listUserConnectorResourcesQuery: () => listUserConnectorResourcesQuery,
38
+ watchUserConnectorResource: () => watchUserConnectorResource
39
+ });
40
+ module.exports = __toCommonJS(queries_exports);
41
+
42
+ // src/helper/createClient.ts
43
+ var import_axios = __toESM(require("axios"));
44
+
45
+ // src/helper/getQueryString.ts
46
+ var getQueryString = ({
47
+ baseURL,
48
+ pageSize,
49
+ nextPageToken,
50
+ filter
51
+ }) => {
52
+ let url = baseURL;
53
+ if (pageSize || nextPageToken || filter) {
54
+ if (baseURL.includes("?")) {
55
+ url += "&";
56
+ } else {
57
+ url += "?";
58
+ }
59
+ }
60
+ if (pageSize) {
61
+ url += `page_size=${pageSize}&`;
62
+ }
63
+ if (nextPageToken) {
64
+ url += `page_token=${nextPageToken}&`;
65
+ }
66
+ if (filter) {
67
+ url += `filter=${filter}&`;
68
+ }
69
+ if (url.endsWith("&")) {
70
+ url = url.slice(0, -1);
71
+ }
72
+ return url;
73
+ };
74
+
75
+ // src/helper/axiosInstance.ts
76
+ var import_axios2 = __toESM(require("axios"));
77
+
78
+ // src/connector/queries.ts
79
+ async function listConnectorResourcesQuery({
80
+ axiosInstance,
81
+ pageSize,
82
+ nextPageToken,
83
+ filter
84
+ }) {
85
+ try {
86
+ const connectors = [];
87
+ const queryString = getQueryString({
88
+ baseURL: `/connector-resources?view=VIEW_FULL`,
89
+ pageSize,
90
+ nextPageToken,
91
+ filter
92
+ });
93
+ const { data } = await axiosInstance.get(
94
+ queryString
95
+ );
96
+ connectors.push(...data.connector_resources);
97
+ if (data.next_page_token) {
98
+ connectors.push(
99
+ ...await listConnectorResourcesQuery({
100
+ axiosInstance,
101
+ pageSize,
102
+ nextPageToken: data.next_page_token,
103
+ filter
104
+ })
105
+ );
106
+ }
107
+ return Promise.resolve(connectors);
108
+ } catch (err) {
109
+ return Promise.reject(err);
110
+ }
111
+ }
112
+ async function listUserConnectorResourcesQuery({
113
+ axiosInstance,
114
+ userName,
115
+ pageSize,
116
+ nextPageToken,
117
+ filter
118
+ }) {
119
+ try {
120
+ const connectors = [];
121
+ const queryString = getQueryString({
122
+ baseURL: `${userName}/connector-resources?view=VIEW_FULL`,
123
+ pageSize,
124
+ nextPageToken,
125
+ filter
126
+ });
127
+ const { data } = await axiosInstance.get(
128
+ queryString
129
+ );
130
+ connectors.push(...data.connector_resources);
131
+ if (data.next_page_token) {
132
+ connectors.push(
133
+ ...await listUserConnectorResourcesQuery({
134
+ axiosInstance,
135
+ userName,
136
+ pageSize,
137
+ nextPageToken: data.next_page_token,
138
+ filter
139
+ })
140
+ );
141
+ }
142
+ return Promise.resolve(connectors);
143
+ } catch (err) {
144
+ return Promise.reject(err);
145
+ }
146
+ }
147
+ async function listConnectorDefinitionsQuery({
148
+ axiosInstance,
149
+ pageSize,
150
+ nextPageToken,
151
+ filter
152
+ }) {
153
+ try {
154
+ const connectorDefinitions = [];
155
+ const queryString = getQueryString({
156
+ baseURL: `/connector-definitions?view=VIEW_FULL`,
157
+ pageSize,
158
+ nextPageToken,
159
+ filter
160
+ });
161
+ const { data } = await axiosInstance.get(
162
+ queryString
163
+ );
164
+ connectorDefinitions.push(...data.connector_definitions);
165
+ if (data.next_page_token) {
166
+ connectorDefinitions.push(
167
+ ...await listConnectorDefinitionsQuery({
168
+ axiosInstance,
169
+ pageSize,
170
+ nextPageToken: data.next_page_token,
171
+ filter
172
+ })
173
+ );
174
+ }
175
+ return Promise.resolve(connectorDefinitions);
176
+ } catch (err) {
177
+ return Promise.reject(err);
178
+ }
179
+ }
180
+ async function getConnectorDefinitionQuery({
181
+ axiosInstance,
182
+ connectorDefinitionName
183
+ }) {
184
+ try {
185
+ const { data } = await axiosInstance.get(
186
+ `/${connectorDefinitionName}?view=VIEW_FULL`
187
+ );
188
+ return Promise.resolve(data.connector_definition);
189
+ } catch (err) {
190
+ return Promise.reject(err);
191
+ }
192
+ }
193
+ async function getUserConnectorResourceQuery({
194
+ axiosInstance,
195
+ connectorResourceName
196
+ }) {
197
+ try {
198
+ const { data } = await axiosInstance.get(
199
+ `/${connectorResourceName}?view=VIEW_FULL`
200
+ );
201
+ return Promise.resolve(data.connector_resource);
202
+ } catch (err) {
203
+ return Promise.reject(err);
204
+ }
205
+ }
206
+ async function watchUserConnectorResource({
207
+ axiosInstance,
208
+ connectorResourceName
209
+ }) {
210
+ try {
211
+ const { data } = await axiosInstance.get(
212
+ `/${connectorResourceName}/watch`
213
+ );
214
+ return Promise.resolve(data);
215
+ } catch (err) {
216
+ return Promise.reject(err);
217
+ }
218
+ }
219
+ // Annotate the CommonJS export names for ESM import in node:
220
+ 0 && (module.exports = {
221
+ getConnectorDefinitionQuery,
222
+ getUserConnectorResourceQuery,
223
+ listConnectorDefinitionsQuery,
224
+ listConnectorResourcesQuery,
225
+ listUserConnectorResourcesQuery,
226
+ watchUserConnectorResource
227
+ });
@@ -0,0 +1,23 @@
1
+ import {
2
+ getConnectorDefinitionQuery,
3
+ getUserConnectorResourceQuery,
4
+ listConnectorDefinitionsQuery,
5
+ listConnectorResourcesQuery,
6
+ listUserConnectorResourcesQuery,
7
+ watchUserConnectorResource
8
+ } from "../chunk-GPM5FDRS.mjs";
9
+ import "../chunk-6ZXT6X3H.mjs";
10
+ import "../chunk-JTTE7IZY.mjs";
11
+ import "../chunk-DXEIDDIA.mjs";
12
+ import "../chunk-RVRM4NPL.mjs";
13
+ import "../chunk-7KV3Y36U.mjs";
14
+ import "../chunk-EBWGEVUX.mjs";
15
+ import "../chunk-EXJ4UK7Q.mjs";
16
+ export {
17
+ getConnectorDefinitionQuery,
18
+ getUserConnectorResourceQuery,
19
+ listConnectorDefinitionsQuery,
20
+ listConnectorResourcesQuery,
21
+ listUserConnectorResourcesQuery,
22
+ watchUserConnectorResource
23
+ };
@@ -0,0 +1,102 @@
1
+ import { AirbyteFieldValues } from "@instill-ai/toolkit";
2
+ import { Spec } from "../types";
3
+ export type ConnectorResourceState = "STATE_CONNECTED" | "STATE_DISCONNECTED" | "STATE_ERROR" | "STATE_UNSPECIFIED";
4
+ export type ConnectorResourceVisibility = "VISIBILITY_UNSPECIFIED" | "VISIBILITY_PRIVATE" | "VISIBILITY_PUBLIC";
5
+ export type ConnectorResourceType = "CONNECTOR_TYPE_UNSPECIFIED" | "CONNECTOR_TYPE_OPERATOR" | "CONNECTOR_TYPE_DATA" | "CONNECTOR_TYPE_AI" | "CONNECTOR_TYPE_BLOCKCHAIN";
6
+ export type ConnectorResource = {
7
+ name: string;
8
+ uid: string;
9
+ id: string;
10
+ connector_definition: null;
11
+ connector_definition_name: string;
12
+ type: ConnectorResourceType;
13
+ task: string;
14
+ description: string;
15
+ configuration: Record<string, any> | Record<string, never>;
16
+ state: ConnectorResourceState;
17
+ tombstone: boolean;
18
+ user: string;
19
+ create_time: string;
20
+ update_time: string;
21
+ visibility: ConnectorResourceVisibility;
22
+ };
23
+ export type ConnectorResourceWithDefinition = Omit<ConnectorResource, "connector_definition"> & {
24
+ connector_definition: ConnectorDefinition;
25
+ };
26
+ export type ConnectorDefinition = {
27
+ name: string;
28
+ uid: string;
29
+ id: string;
30
+ title: string;
31
+ documentation_url: string;
32
+ icon: string;
33
+ icon_url: string;
34
+ connector_type: ConnectorResourceType;
35
+ spec: Spec;
36
+ tombstone: boolean;
37
+ public: boolean;
38
+ custom: boolean;
39
+ vendor: string;
40
+ vendor_attributes: Record<string, any>;
41
+ };
42
+ export type ConnectorResourceWatchState = {
43
+ state: ConnectorResourceState;
44
+ };
45
+ export type ConnectorResourcesWatchState = Record<string, ConnectorResourceWatchState>;
46
+ export type ConnectorResourceWithWatchState = {
47
+ watchState: ConnectorResourceState;
48
+ } & ConnectorResourceWithDefinition;
49
+ export type TestUserConnectorResourceConnectionResponse = {
50
+ state: ConnectorResourceState;
51
+ };
52
+ export type ConnectUserConnectorResourceResponse = {
53
+ connector_resource: ConnectorResource;
54
+ };
55
+ export type DisconnectUserConnectorResourceResponse = {
56
+ connector_resource: ConnectorResource;
57
+ };
58
+ export type CreateUserConnectorResourcePayload = {
59
+ id: string;
60
+ connector_definition_name: string;
61
+ description?: string;
62
+ configuration: Record<string, any> | Record<string, never>;
63
+ };
64
+ export type CreateUserConnectorResourceResponse = {
65
+ connector_resource: ConnectorResource;
66
+ };
67
+ export type UpdateUserConnectorResourcePayload = {
68
+ connectorResourceName: string;
69
+ description?: string;
70
+ configuration: /* eslint-disable-next-line @typescript-eslint/no-explicit-any */ Record<string, any> | AirbyteFieldValues | Record<string, never>;
71
+ };
72
+ export type UpdateUserConnectorResourceResponse = {
73
+ connector_resource: ConnectorResource;
74
+ };
75
+ export type RenameUserConnectorResourcePayload = {
76
+ name: string;
77
+ new_connector_id: string;
78
+ };
79
+ export type RenameUserConnectorResourceResponse = {
80
+ connector_resource: ConnectorResource;
81
+ };
82
+ export type ListConnectorResourcesResponse = {
83
+ connector_resources: ConnectorResourceWithDefinition[];
84
+ next_page_token: string;
85
+ total_size: number;
86
+ };
87
+ export type ListUserConnectorResourcesResponse = {
88
+ connector_resources: ConnectorResourceWithDefinition[];
89
+ next_page_token: string;
90
+ total_size: number;
91
+ };
92
+ export type ListConnectorDefinitionsResponse = {
93
+ connector_definitions: ConnectorDefinition[];
94
+ next_page_token: string;
95
+ total_size: number;
96
+ };
97
+ export type GetConnectorDefinitionResponse = {
98
+ connector_definition: ConnectorDefinition;
99
+ };
100
+ export type GetUserConnectorResourceResponse = {
101
+ connector_resource: ConnectorResourceWithDefinition;
102
+ };
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __copyProps = (to, from, except, desc) => {
7
+ if (from && typeof from === "object" || typeof from === "function") {
8
+ for (let key of __getOwnPropNames(from))
9
+ if (!__hasOwnProp.call(to, key) && key !== except)
10
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
+ }
12
+ return to;
13
+ };
14
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
+
16
+ // src/connector/types.ts
17
+ var types_exports = {};
18
+ module.exports = __toCommonJS(types_exports);
@@ -0,0 +1 @@
1
+ import "../chunk-FAXYADOP.mjs";
@@ -0,0 +1,3 @@
1
+ import { AxiosInstance } from "axios";
2
+ declare const createAxiosInstance: (baseUrl: string, appVersion: string, product: string) => AxiosInstance;
3
+ export default createAxiosInstance;
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+
30
+ // src/helper/axiosInstance.ts
31
+ var axiosInstance_exports = {};
32
+ __export(axiosInstance_exports, {
33
+ default: () => axiosInstance_default
34
+ });
35
+ module.exports = __toCommonJS(axiosInstance_exports);
36
+ var import_axios = __toESM(require("axios"));
37
+ var createAxiosInstance = (baseUrl, appVersion, product) => {
38
+ let URL = `${baseUrl}/${product}/${appVersion}`;
39
+ return import_axios.default.create({
40
+ baseURL: URL,
41
+ headers: {}
42
+ });
43
+ };
44
+ var axiosInstance_default = createAxiosInstance;
@@ -0,0 +1,7 @@
1
+ import {
2
+ axiosInstance_default
3
+ } from "../chunk-JTTE7IZY.mjs";
4
+ import "../chunk-EXJ4UK7Q.mjs";
5
+ export {
6
+ axiosInstance_default as default
7
+ };
@@ -0,0 +1 @@
1
+ export declare function env(key?: string): any;
@@ -0,0 +1,53 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/helper/config.ts
21
+ var config_exports = {};
22
+ __export(config_exports, {
23
+ env: () => env
24
+ });
25
+ module.exports = __toCommonJS(config_exports);
26
+ var isBrowser = () => {
27
+ return Boolean(typeof window !== "undefined");
28
+ };
29
+ function env(key = "") {
30
+ if (!key.length) {
31
+ throw new Error("No env key provided");
32
+ }
33
+ if (isBrowser() && window.__env) {
34
+ return window.__env[key] === "''" ? "" : parseString(window.__env[key]);
35
+ }
36
+ return process.env[key] === "''" ? "" : parseString(process.env[key]);
37
+ }
38
+ var parseString = (value) => {
39
+ if (value === "true") {
40
+ return true;
41
+ }
42
+ if (value === "false") {
43
+ return false;
44
+ }
45
+ if (/^\d+$/.test(value)) {
46
+ return parseInt(value);
47
+ }
48
+ return value;
49
+ };
50
+ // Annotate the CommonJS export names for ESM import in node:
51
+ 0 && (module.exports = {
52
+ env
53
+ });
@@ -0,0 +1,7 @@
1
+ import {
2
+ env
3
+ } from "../chunk-RVRM4NPL.mjs";
4
+ import "../chunk-EXJ4UK7Q.mjs";
5
+ export {
6
+ env
7
+ };
@@ -0,0 +1,2 @@
1
+ import { AxiosHeaders } from "axios";
2
+ export declare function createClient(apiToken: string, product: "base" | "model" | "vdp", headers?: AxiosHeaders): import("axios").AxiosInstance;