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
package/dist/index.mjs ADDED
@@ -0,0 +1,87 @@
1
+ import "./chunk-KCKTAMXW.mjs";
2
+ import {
3
+ PipelineClient_default
4
+ } from "./chunk-4TKUHGUZ.mjs";
5
+ import "./chunk-NRP5M7FG.mjs";
6
+ import "./chunk-QLWRKSUE.mjs";
7
+ import "./chunk-ECC5KF6S.mjs";
8
+ import "./chunk-42SCMPQP.mjs";
9
+ import "./chunk-FNCXOA62.mjs";
10
+ import "./chunk-2VZRNT6D.mjs";
11
+ import "./chunk-6NTCWRRC.mjs";
12
+ import "./chunk-4KLHN5HK.mjs";
13
+ import {
14
+ OperationClient_default
15
+ } from "./chunk-IB43VC55.mjs";
16
+ import "./chunk-IWAQMUMR.mjs";
17
+ import "./chunk-QV7PYP7E.mjs";
18
+ import "./chunk-EHG2FVLQ.mjs";
19
+ import "./chunk-73EPIL2R.mjs";
20
+ import "./chunk-VASX6R4R.mjs";
21
+ import {
22
+ AuthClient_default
23
+ } from "./chunk-ZRC43MN3.mjs";
24
+ import "./chunk-IPW3WQCQ.mjs";
25
+ import "./chunk-3VVR3XHW.mjs";
26
+ import "./chunk-VIPORJ6H.mjs";
27
+ import "./chunk-JY37AKV6.mjs";
28
+ import {
29
+ ModelClient_default
30
+ } from "./chunk-4VWYH26Q.mjs";
31
+ import "./chunk-D5OKZ665.mjs";
32
+ import "./chunk-QZOKJQTL.mjs";
33
+ import "./chunk-KHFNAMT4.mjs";
34
+ import {
35
+ MetricClient_default
36
+ } from "./chunk-WL54JNC6.mjs";
37
+ import "./chunk-YXNMG2RZ.mjs";
38
+ import "./chunk-WBQAMGXK.mjs";
39
+ import "./chunk-WLPBUHMI.mjs";
40
+ import {
41
+ ConnectorClient_default
42
+ } from "./chunk-JONZWFL5.mjs";
43
+ import "./chunk-YT6ZGA4J.mjs";
44
+ import "./chunk-6M57XUNI.mjs";
45
+ import "./chunk-GPM5FDRS.mjs";
46
+ import "./chunk-6ZXT6X3H.mjs";
47
+ import "./chunk-JTTE7IZY.mjs";
48
+ import {
49
+ createClient
50
+ } from "./chunk-DXEIDDIA.mjs";
51
+ import {
52
+ env
53
+ } from "./chunk-RVRM4NPL.mjs";
54
+ import {
55
+ getInstillApiErrorMessage
56
+ } from "./chunk-7KV3Y36U.mjs";
57
+ import {
58
+ getQueryString
59
+ } from "./chunk-EBWGEVUX.mjs";
60
+ import "./chunk-EXJ4UK7Q.mjs";
61
+ import "./chunk-FAXYADOP.mjs";
62
+
63
+ // src/index.ts
64
+ var InstillClient = class {
65
+ Pipeline;
66
+ Auth;
67
+ Connector;
68
+ Metric;
69
+ Model;
70
+ Operation;
71
+ constructor(baseUrl, appVersion, apiToken) {
72
+ this.Pipeline = new PipelineClient_default(baseUrl, appVersion, apiToken);
73
+ this.Auth = new AuthClient_default(baseUrl, appVersion, apiToken);
74
+ this.Connector = new ConnectorClient_default(baseUrl, appVersion, apiToken);
75
+ this.Metric = new MetricClient_default(baseUrl, appVersion, apiToken);
76
+ this.Model = new ModelClient_default(baseUrl, appVersion, apiToken);
77
+ this.Operation = new OperationClient_default(baseUrl, appVersion, apiToken);
78
+ }
79
+ };
80
+ var src_default = InstillClient;
81
+ export {
82
+ createClient,
83
+ src_default as default,
84
+ env,
85
+ getInstillApiErrorMessage,
86
+ getQueryString
87
+ };
@@ -0,0 +1,21 @@
1
+ import { Nullable } from "../types";
2
+ declare class MetricClient {
3
+ private axiosInstance;
4
+ constructor(baseUrl: string, appVersion: string, apiToken: string);
5
+ listPipelineTriggerRecordsQuery({ pageSize, nextPageToken, filter, }: {
6
+ pageSize: Nullable<number>;
7
+ nextPageToken: Nullable<string>;
8
+ filter: Nullable<string>;
9
+ }): Promise<import("./pipeline").PipelineTriggerRecord[]>;
10
+ listTriggeredPipelineQuery({ pageSize, nextPageToken, filter, }: {
11
+ pageSize: Nullable<number>;
12
+ nextPageToken: Nullable<string>;
13
+ filter: Nullable<string>;
14
+ }): Promise<import("./pipeline").TriggeredPipeline[]>;
15
+ listTriggeredPipelineChartQuery({ pageSize, nextPageToken, filter, }: {
16
+ pageSize: Nullable<number>;
17
+ nextPageToken: Nullable<string>;
18
+ filter: Nullable<string>;
19
+ }): Promise<import("./pipeline").PipelinesChart[]>;
20
+ }
21
+ export default MetricClient;
@@ -0,0 +1,215 @@
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/metric/MetricClient.ts
31
+ var MetricClient_exports = {};
32
+ __export(MetricClient_exports, {
33
+ default: () => MetricClient_default
34
+ });
35
+ module.exports = __toCommonJS(MetricClient_exports);
36
+ var import_axios3 = __toESM(require("axios"));
37
+
38
+ // src/helper/createClient.ts
39
+ var import_axios = __toESM(require("axios"));
40
+
41
+ // src/helper/getQueryString.ts
42
+ var getQueryString = ({
43
+ baseURL,
44
+ pageSize,
45
+ nextPageToken,
46
+ filter
47
+ }) => {
48
+ let url = baseURL;
49
+ if (pageSize || nextPageToken || filter) {
50
+ if (baseURL.includes("?")) {
51
+ url += "&";
52
+ } else {
53
+ url += "?";
54
+ }
55
+ }
56
+ if (pageSize) {
57
+ url += `page_size=${pageSize}&`;
58
+ }
59
+ if (nextPageToken) {
60
+ url += `page_token=${nextPageToken}&`;
61
+ }
62
+ if (filter) {
63
+ url += `filter=${filter}&`;
64
+ }
65
+ if (url.endsWith("&")) {
66
+ url = url.slice(0, -1);
67
+ }
68
+ return url;
69
+ };
70
+
71
+ // src/helper/axiosInstance.ts
72
+ var import_axios2 = __toESM(require("axios"));
73
+
74
+ // src/metric/pipeline/queries.ts
75
+ async function listPipelineTriggerRecordsQuery({
76
+ axiosInstance,
77
+ pageSize,
78
+ nextPageToken,
79
+ filter
80
+ }) {
81
+ try {
82
+ const triggers = [];
83
+ const queryString = getQueryString({
84
+ baseURL: `/metrics/vdp/pipeline/triggers`,
85
+ pageSize,
86
+ nextPageToken,
87
+ filter
88
+ });
89
+ const { data } = await axiosInstance.get(queryString);
90
+ triggers.push(...data.pipeline_trigger_records);
91
+ if (data.next_page_token) {
92
+ triggers.push(
93
+ ...await listPipelineTriggerRecordsQuery({
94
+ axiosInstance,
95
+ pageSize,
96
+ nextPageToken: data.next_page_token,
97
+ filter
98
+ })
99
+ );
100
+ }
101
+ return Promise.resolve(triggers);
102
+ } catch (err) {
103
+ return Promise.reject(err);
104
+ }
105
+ }
106
+ async function listTriggeredPipelineQuery({
107
+ axiosInstance,
108
+ pageSize,
109
+ nextPageToken,
110
+ filter
111
+ }) {
112
+ try {
113
+ const pipelines = [];
114
+ const queryString = getQueryString({
115
+ baseURL: `/metrics/vdp/pipeline/tables`,
116
+ pageSize,
117
+ nextPageToken,
118
+ filter
119
+ });
120
+ const { data } = await axiosInstance.get(
121
+ queryString
122
+ );
123
+ pipelines.push(...data.pipeline_trigger_table_records);
124
+ if (data.next_page_token) {
125
+ pipelines.push(
126
+ ...await listTriggeredPipelineQuery({
127
+ axiosInstance,
128
+ pageSize,
129
+ nextPageToken: data.next_page_token,
130
+ filter
131
+ })
132
+ );
133
+ }
134
+ return Promise.resolve(pipelines);
135
+ } catch (err) {
136
+ return Promise.reject(err);
137
+ }
138
+ }
139
+ async function listTriggeredPipelineChartQuery({
140
+ axiosInstance,
141
+ pageSize,
142
+ nextPageToken,
143
+ filter
144
+ }) {
145
+ try {
146
+ const pipelinesChart = [];
147
+ const queryString = getQueryString({
148
+ baseURL: `/metrics/vdp/pipeline/charts`,
149
+ pageSize,
150
+ nextPageToken,
151
+ filter
152
+ });
153
+ const { data } = await axiosInstance.get(
154
+ queryString
155
+ );
156
+ pipelinesChart.push(...data.pipeline_trigger_chart_records);
157
+ return Promise.resolve(pipelinesChart);
158
+ } catch (err) {
159
+ return Promise.reject(err);
160
+ }
161
+ }
162
+
163
+ // src/metric/MetricClient.ts
164
+ var MetricClient = class {
165
+ axiosInstance;
166
+ constructor(baseUrl, appVersion, apiToken) {
167
+ let URL = `${baseUrl}/base/${appVersion}`;
168
+ this.axiosInstance = import_axios3.default.create({
169
+ baseURL: URL,
170
+ headers: {
171
+ Authorization: `Bearer ${apiToken}`
172
+ }
173
+ });
174
+ }
175
+ /* -------------------------------------------------------------------------
176
+ * Metric Queries
177
+ * -----------------------------------------------------------------------*/
178
+ async listPipelineTriggerRecordsQuery({
179
+ pageSize,
180
+ nextPageToken,
181
+ filter
182
+ }) {
183
+ return listPipelineTriggerRecordsQuery({
184
+ axiosInstance: this.axiosInstance,
185
+ pageSize,
186
+ nextPageToken,
187
+ filter
188
+ });
189
+ }
190
+ async listTriggeredPipelineQuery({
191
+ pageSize,
192
+ nextPageToken,
193
+ filter
194
+ }) {
195
+ return listTriggeredPipelineQuery({
196
+ axiosInstance: this.axiosInstance,
197
+ pageSize,
198
+ nextPageToken,
199
+ filter
200
+ });
201
+ }
202
+ async listTriggeredPipelineChartQuery({
203
+ pageSize,
204
+ nextPageToken,
205
+ filter
206
+ }) {
207
+ return listTriggeredPipelineChartQuery({
208
+ axiosInstance: this.axiosInstance,
209
+ pageSize,
210
+ nextPageToken,
211
+ filter
212
+ });
213
+ }
214
+ };
215
+ var MetricClient_default = MetricClient;
@@ -0,0 +1,14 @@
1
+ import {
2
+ MetricClient_default
3
+ } from "../chunk-WL54JNC6.mjs";
4
+ import "../chunk-YXNMG2RZ.mjs";
5
+ import "../chunk-6ZXT6X3H.mjs";
6
+ import "../chunk-JTTE7IZY.mjs";
7
+ import "../chunk-DXEIDDIA.mjs";
8
+ import "../chunk-RVRM4NPL.mjs";
9
+ import "../chunk-7KV3Y36U.mjs";
10
+ import "../chunk-EBWGEVUX.mjs";
11
+ import "../chunk-EXJ4UK7Q.mjs";
12
+ export {
13
+ MetricClient_default as default
14
+ };
@@ -0,0 +1 @@
1
+ export * from "./pipeline";
@@ -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/metric/index.ts
17
+ var metric_exports = {};
18
+ module.exports = __toCommonJS(metric_exports);
@@ -0,0 +1,3 @@
1
+ import "../chunk-QV7PYP7E.mjs";
2
+ import "../chunk-EHG2FVLQ.mjs";
3
+ import "../chunk-73EPIL2R.mjs";
@@ -0,0 +1 @@
1
+ export * from "./types";
@@ -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/metric/pipeline/index.ts
17
+ var pipeline_exports = {};
18
+ module.exports = __toCommonJS(pipeline_exports);
@@ -0,0 +1,2 @@
1
+ import "../../chunk-EHG2FVLQ.mjs";
2
+ import "../../chunk-73EPIL2R.mjs";
@@ -0,0 +1,21 @@
1
+ import { AxiosInstance } from "axios";
2
+ import { Nullable } from "../../types";
3
+ import { PipelineTriggerRecord, PipelinesChart, TriggeredPipeline } from "./types";
4
+ export declare function listPipelineTriggerRecordsQuery({ axiosInstance, pageSize, nextPageToken, filter, }: {
5
+ axiosInstance: AxiosInstance;
6
+ pageSize: Nullable<number>;
7
+ nextPageToken: Nullable<string>;
8
+ filter: Nullable<string>;
9
+ }): Promise<PipelineTriggerRecord[]>;
10
+ export declare function listTriggeredPipelineQuery({ axiosInstance, pageSize, nextPageToken, filter, }: {
11
+ axiosInstance: AxiosInstance;
12
+ pageSize: Nullable<number>;
13
+ nextPageToken: Nullable<string>;
14
+ filter: Nullable<string>;
15
+ }): Promise<TriggeredPipeline[]>;
16
+ export declare function listTriggeredPipelineChartQuery({ axiosInstance, pageSize, nextPageToken, filter, }: {
17
+ axiosInstance: AxiosInstance;
18
+ pageSize: Nullable<number>;
19
+ nextPageToken: Nullable<string>;
20
+ filter: Nullable<string>;
21
+ }): Promise<PipelinesChart[]>;
@@ -0,0 +1,168 @@
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/metric/pipeline/queries.ts
31
+ var queries_exports = {};
32
+ __export(queries_exports, {
33
+ listPipelineTriggerRecordsQuery: () => listPipelineTriggerRecordsQuery,
34
+ listTriggeredPipelineChartQuery: () => listTriggeredPipelineChartQuery,
35
+ listTriggeredPipelineQuery: () => listTriggeredPipelineQuery
36
+ });
37
+ module.exports = __toCommonJS(queries_exports);
38
+
39
+ // src/helper/createClient.ts
40
+ var import_axios = __toESM(require("axios"));
41
+
42
+ // src/helper/getQueryString.ts
43
+ var getQueryString = ({
44
+ baseURL,
45
+ pageSize,
46
+ nextPageToken,
47
+ filter
48
+ }) => {
49
+ let url = baseURL;
50
+ if (pageSize || nextPageToken || filter) {
51
+ if (baseURL.includes("?")) {
52
+ url += "&";
53
+ } else {
54
+ url += "?";
55
+ }
56
+ }
57
+ if (pageSize) {
58
+ url += `page_size=${pageSize}&`;
59
+ }
60
+ if (nextPageToken) {
61
+ url += `page_token=${nextPageToken}&`;
62
+ }
63
+ if (filter) {
64
+ url += `filter=${filter}&`;
65
+ }
66
+ if (url.endsWith("&")) {
67
+ url = url.slice(0, -1);
68
+ }
69
+ return url;
70
+ };
71
+
72
+ // src/helper/axiosInstance.ts
73
+ var import_axios2 = __toESM(require("axios"));
74
+
75
+ // src/metric/pipeline/queries.ts
76
+ async function listPipelineTriggerRecordsQuery({
77
+ axiosInstance,
78
+ pageSize,
79
+ nextPageToken,
80
+ filter
81
+ }) {
82
+ try {
83
+ const triggers = [];
84
+ const queryString = getQueryString({
85
+ baseURL: `/metrics/vdp/pipeline/triggers`,
86
+ pageSize,
87
+ nextPageToken,
88
+ filter
89
+ });
90
+ const { data } = await axiosInstance.get(queryString);
91
+ triggers.push(...data.pipeline_trigger_records);
92
+ if (data.next_page_token) {
93
+ triggers.push(
94
+ ...await listPipelineTriggerRecordsQuery({
95
+ axiosInstance,
96
+ pageSize,
97
+ nextPageToken: data.next_page_token,
98
+ filter
99
+ })
100
+ );
101
+ }
102
+ return Promise.resolve(triggers);
103
+ } catch (err) {
104
+ return Promise.reject(err);
105
+ }
106
+ }
107
+ async function listTriggeredPipelineQuery({
108
+ axiosInstance,
109
+ pageSize,
110
+ nextPageToken,
111
+ filter
112
+ }) {
113
+ try {
114
+ const pipelines = [];
115
+ const queryString = getQueryString({
116
+ baseURL: `/metrics/vdp/pipeline/tables`,
117
+ pageSize,
118
+ nextPageToken,
119
+ filter
120
+ });
121
+ const { data } = await axiosInstance.get(
122
+ queryString
123
+ );
124
+ pipelines.push(...data.pipeline_trigger_table_records);
125
+ if (data.next_page_token) {
126
+ pipelines.push(
127
+ ...await listTriggeredPipelineQuery({
128
+ axiosInstance,
129
+ pageSize,
130
+ nextPageToken: data.next_page_token,
131
+ filter
132
+ })
133
+ );
134
+ }
135
+ return Promise.resolve(pipelines);
136
+ } catch (err) {
137
+ return Promise.reject(err);
138
+ }
139
+ }
140
+ async function listTriggeredPipelineChartQuery({
141
+ axiosInstance,
142
+ pageSize,
143
+ nextPageToken,
144
+ filter
145
+ }) {
146
+ try {
147
+ const pipelinesChart = [];
148
+ const queryString = getQueryString({
149
+ baseURL: `/metrics/vdp/pipeline/charts`,
150
+ pageSize,
151
+ nextPageToken,
152
+ filter
153
+ });
154
+ const { data } = await axiosInstance.get(
155
+ queryString
156
+ );
157
+ pipelinesChart.push(...data.pipeline_trigger_chart_records);
158
+ return Promise.resolve(pipelinesChart);
159
+ } catch (err) {
160
+ return Promise.reject(err);
161
+ }
162
+ }
163
+ // Annotate the CommonJS export names for ESM import in node:
164
+ 0 && (module.exports = {
165
+ listPipelineTriggerRecordsQuery,
166
+ listTriggeredPipelineChartQuery,
167
+ listTriggeredPipelineQuery
168
+ });
@@ -0,0 +1,17 @@
1
+ import {
2
+ listPipelineTriggerRecordsQuery,
3
+ listTriggeredPipelineChartQuery,
4
+ listTriggeredPipelineQuery
5
+ } from "../../chunk-YXNMG2RZ.mjs";
6
+ import "../../chunk-6ZXT6X3H.mjs";
7
+ import "../../chunk-JTTE7IZY.mjs";
8
+ import "../../chunk-DXEIDDIA.mjs";
9
+ import "../../chunk-RVRM4NPL.mjs";
10
+ import "../../chunk-7KV3Y36U.mjs";
11
+ import "../../chunk-EBWGEVUX.mjs";
12
+ import "../../chunk-EXJ4UK7Q.mjs";
13
+ export {
14
+ listPipelineTriggerRecordsQuery,
15
+ listTriggeredPipelineChartQuery,
16
+ listTriggeredPipelineQuery
17
+ };
@@ -0,0 +1,63 @@
1
+ import { PipelineMode, PipelineReleaseState } from "../../pipeline";
2
+ export type PipelineTriggerCount = {
3
+ pipeline_id: string;
4
+ pipeline_uid: string;
5
+ pipeline_completed: number;
6
+ pipeline_errored: number;
7
+ watchState: PipelineReleaseState;
8
+ counts: Count[];
9
+ };
10
+ export type TriggeredPipeline = {
11
+ pipeline_id: string;
12
+ pipeline_uid: string;
13
+ trigger_count_completed: string;
14
+ trigger_count_errored: string;
15
+ watchState?: PipelineReleaseState;
16
+ };
17
+ export type PipelinesChart = {
18
+ pipeline_id: string;
19
+ pipeline_uid: string;
20
+ trigger_mode: "MODE_SYNC" | "MODE_ASYNC";
21
+ status: PipelineReleaseState;
22
+ time_buckets: string[];
23
+ trigger_counts: number[] | string[];
24
+ compute_time_duration: number[] | string[];
25
+ watchState?: PipelineReleaseState;
26
+ };
27
+ export type PipelineTriggerStatus = "STATUS_UNSPECIFIED" | "STATUS_COMPLETED" | "STATUS_ERRORED";
28
+ export type Count = {
29
+ trigger_time: string | Date;
30
+ count: number;
31
+ };
32
+ export type PipelineTriggerRecord = {
33
+ trigger_time: string;
34
+ pipeline_trigger_id: string;
35
+ pipeline_id: string;
36
+ pipeline_uid: string;
37
+ pipeline_mode: PipelineMode;
38
+ compute_time_duration: number;
39
+ status: PipelineTriggerStatus;
40
+ };
41
+ export type PipelineTriggersStatusSummaryItem = {
42
+ statusType: PipelineTriggerStatus;
43
+ amount: number;
44
+ type: "pipeline" | "model";
45
+ delta: number;
46
+ };
47
+ export type PipelineTriggersStatusSummary = {
48
+ completed: PipelineTriggersStatusSummaryItem;
49
+ errored: PipelineTriggersStatusSummaryItem;
50
+ };
51
+ export type ListPipelineTriggerRecordsResponse = {
52
+ pipeline_trigger_records: PipelineTriggerRecord[];
53
+ next_page_token: string;
54
+ total_size: number;
55
+ };
56
+ export type ListTriggeredPipelinesResponse = {
57
+ pipeline_trigger_table_records: TriggeredPipeline[];
58
+ next_page_token: string;
59
+ total_size: number;
60
+ };
61
+ export type ListPipelinesChartResponse = {
62
+ pipeline_trigger_chart_records: PipelinesChart[];
63
+ };
@@ -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/metric/pipeline/types.ts
17
+ var types_exports = {};
18
+ module.exports = __toCommonJS(types_exports);
@@ -0,0 +1 @@
1
+ import "../../chunk-73EPIL2R.mjs";