instill-sdk 0.0.2 → 0.0.3
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.
- package/README.md +54 -34
- package/dist/chunk-375TLK3Q.mjs +0 -0
- package/dist/chunk-4BC7UGYC.mjs +114 -0
- package/dist/{chunk-JONZWFL5.mjs → chunk-4LUKB34H.mjs} +48 -52
- package/dist/chunk-5FTGMS4X.mjs +46 -0
- package/dist/chunk-6K6UDAWM.mjs +114 -0
- package/dist/{chunk-IPW3WQCQ.mjs → chunk-7VLTGUGU.mjs} +18 -1
- package/dist/chunk-DZXTDWWF.mjs +69 -0
- package/dist/{chunk-4VWYH26Q.mjs → chunk-EI3U4WOS.mjs} +1 -1
- package/dist/{chunk-KHFNAMT4.mjs → chunk-GEEYB6IX.mjs} +1 -1
- package/dist/{chunk-G5M7VUJT.mjs → chunk-GFLAFXAN.mjs} +1 -1
- package/dist/chunk-GX3ELROF.mjs +141 -0
- package/dist/{chunk-YK7RY2CG.mjs → chunk-I4VMGZBF.mjs} +104 -32
- package/dist/{chunk-YXNMG2RZ.mjs → chunk-JBSVFVPW.mjs} +1 -1
- package/dist/{chunk-NRP5M7FG.mjs → chunk-K7AV4FXF.mjs} +13 -11
- package/dist/{chunk-VIPORJ6H.mjs → chunk-KV3GJM6Q.mjs} +45 -3
- package/dist/{chunk-DIAPO2ML.mjs → chunk-L25EZQ5J.mjs} +16 -5
- package/dist/{chunk-EBWGEVUX.mjs → chunk-QG4SF5DT.mjs} +5 -1
- package/dist/{chunk-GPM5FDRS.mjs → chunk-SFKHRD33.mjs} +18 -18
- package/dist/chunk-UNJKVLJE.mjs +0 -0
- package/dist/{chunk-MS2EILMH.mjs → chunk-V2NMRJ2Y.mjs} +20 -16
- package/dist/connector/ConnectorClient.d.ts +32 -32
- package/dist/connector/ConnectorClient.js +90 -85
- package/dist/connector/ConnectorClient.mjs +5 -5
- package/dist/connector/action.d.ts +19 -9
- package/dist/connector/action.js +17 -17
- package/dist/connector/action.mjs +7 -7
- package/dist/connector/index.mjs +5 -5
- package/dist/connector/mutation.d.ts +13 -13
- package/dist/connector/mutation.js +35 -30
- package/dist/connector/mutation.mjs +9 -9
- package/dist/connector/queries.d.ts +11 -11
- package/dist/connector/queries.js +26 -22
- package/dist/connector/queries.mjs +10 -10
- package/dist/connector/types.d.ts +34 -48
- package/dist/helper/getQueryString.d.ts +3 -2
- package/dist/helper/getQueryString.js +5 -1
- package/dist/helper/getQueryString.mjs +1 -1
- package/dist/helper/getQueryString.test.js +5 -1
- package/dist/helper/getQueryString.test.mjs +1 -1
- package/dist/helper/index.js +5 -1
- package/dist/helper/index.mjs +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.js +566 -136
- package/dist/index.mjs +54 -17
- package/dist/metric/MetricClient.js +5 -1
- package/dist/metric/MetricClient.mjs +3 -3
- package/dist/metric/pipeline/queries.js +5 -1
- package/dist/metric/pipeline/queries.mjs +2 -2
- package/dist/mgmt/AuthClient.d.ts +7 -1
- package/dist/mgmt/AuthClient.js +44 -4
- package/dist/mgmt/AuthClient.mjs +4 -4
- package/dist/mgmt/action.d.ts +4 -0
- package/dist/mgmt/action.js +20 -2
- package/dist/mgmt/action.mjs +5 -3
- package/dist/mgmt/index.mjs +4 -4
- package/dist/mgmt/queries.d.ts +11 -2
- package/dist/mgmt/queries.js +52 -4
- package/dist/mgmt/queries.mjs +8 -4
- package/dist/mgmt/types.d.ts +12 -0
- package/dist/model/ModelClient.js +5 -1
- package/dist/model/ModelClient.mjs +3 -3
- package/dist/model/index.mjs +3 -3
- package/dist/model/queries.js +5 -1
- package/dist/model/queries.mjs +2 -2
- package/dist/organization/OrganizationClient.d.ts +43 -0
- package/dist/organization/OrganizationClient.js +378 -0
- package/dist/organization/OrganizationClient.mjs +15 -0
- package/dist/organization/index.d.ts +3 -0
- package/dist/organization/index.js +310 -0
- package/dist/organization/index.mjs +41 -0
- package/dist/organization/mutations.d.ts +32 -0
- package/dist/organization/mutations.js +144 -0
- package/dist/organization/mutations.mjs +19 -0
- package/dist/organization/queries.d.ts +34 -0
- package/dist/organization/queries.js +191 -0
- package/dist/organization/queries.mjs +23 -0
- package/dist/organization/types.d.ts +81 -0
- package/dist/organization/types.js +18 -0
- package/dist/organization/types.mjs +1 -0
- package/dist/pipeline/PipelineClient.d.ts +7 -5
- package/dist/pipeline/PipelineClient.js +81 -47
- package/dist/pipeline/PipelineClient.mjs +4 -4
- package/dist/pipeline/action.d.ts +13 -12
- package/dist/pipeline/action.js +13 -11
- package/dist/pipeline/action.mjs +1 -1
- package/dist/pipeline/index.mjs +5 -5
- package/dist/pipeline/queries.d.ts +37 -18
- package/dist/pipeline/queries.js +110 -32
- package/dist/pipeline/queries.mjs +8 -4
- package/dist/pipeline/types.d.ts +88 -16
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types.d.ts +2 -2
- package/package.json +2 -2
- package/dist/chunk-6M57XUNI.mjs +0 -64
- package/dist/chunk-YT6ZGA4J.mjs +0 -46
|
@@ -1,34 +1,35 @@
|
|
|
1
1
|
import { AxiosInstance } from "axios";
|
|
2
2
|
import { TriggerAsyncUserPipelinePayload, TriggerUserPipelinePayload, TriggerUserPipelineResponse } from "./types";
|
|
3
|
-
export declare function triggerUserPipelineAction({
|
|
4
|
-
axiosInstance: AxiosInstance;
|
|
3
|
+
export declare function triggerUserPipelineAction({ pipelineName, payload, axiosInstance, returnTraces, shareCode, }: {
|
|
5
4
|
pipelineName: string;
|
|
6
5
|
payload: TriggerUserPipelinePayload;
|
|
6
|
+
axiosInstance: AxiosInstance;
|
|
7
7
|
returnTraces?: boolean;
|
|
8
|
+
shareCode?: string;
|
|
8
9
|
}): Promise<TriggerUserPipelineResponse>;
|
|
9
|
-
export declare function triggerAsyncUserPipelineAction({
|
|
10
|
-
axiosInstance: AxiosInstance;
|
|
10
|
+
export declare function triggerAsyncUserPipelineAction({ pipelineName, payload, axiosInstance, returnTraces, }: {
|
|
11
11
|
pipelineName: string;
|
|
12
12
|
payload: TriggerAsyncUserPipelinePayload;
|
|
13
|
+
axiosInstance: AxiosInstance;
|
|
13
14
|
returnTraces?: boolean;
|
|
14
15
|
}): Promise<import("..").Operation>;
|
|
15
|
-
export declare function setDefaultUserPipelineReleaseMutation({
|
|
16
|
-
axiosInstance: AxiosInstance;
|
|
16
|
+
export declare function setDefaultUserPipelineReleaseMutation({ pipelineReleaseName, axiosInstance, }: {
|
|
17
17
|
pipelineReleaseName: string;
|
|
18
|
-
}): Promise<import("./types").PipelineRelease>;
|
|
19
|
-
export declare function restoreUserPipelineReleaseMutation({ axiosInstance, pipelineReleaseName, }: {
|
|
20
18
|
axiosInstance: AxiosInstance;
|
|
21
|
-
pipelineReleaseName: string;
|
|
22
19
|
}): Promise<import("./types").PipelineRelease>;
|
|
23
|
-
export declare function
|
|
20
|
+
export declare function restoreUserPipelineReleaseMutation({ pipelineReleaseName, axiosInstance, }: {
|
|
21
|
+
pipelineReleaseName: string;
|
|
24
22
|
axiosInstance: AxiosInstance;
|
|
23
|
+
}): Promise<import("./types").PipelineRelease>;
|
|
24
|
+
export declare function triggerUserPipelineReleaseAction({ pipelineReleaseName, payload, axiosInstance, returnTraces, }: {
|
|
25
25
|
pipelineReleaseName: string;
|
|
26
26
|
payload: TriggerUserPipelinePayload;
|
|
27
|
+
axiosInstance: AxiosInstance;
|
|
27
28
|
returnTraces?: boolean;
|
|
28
29
|
}): Promise<TriggerUserPipelineResponse>;
|
|
29
|
-
export declare function triggerAsyncUserPipelineReleaseAction({
|
|
30
|
-
axiosInstance: AxiosInstance;
|
|
30
|
+
export declare function triggerAsyncUserPipelineReleaseAction({ pipelineReleaseName, payload, axiosInstance, returnTraces, }: {
|
|
31
31
|
pipelineReleaseName: string;
|
|
32
32
|
payload: TriggerAsyncUserPipelinePayload;
|
|
33
|
+
axiosInstance: AxiosInstance;
|
|
33
34
|
returnTraces?: boolean;
|
|
34
35
|
}): Promise<import("..").Operation>;
|
package/dist/pipeline/action.js
CHANGED
|
@@ -29,10 +29,11 @@ __export(action_exports, {
|
|
|
29
29
|
});
|
|
30
30
|
module.exports = __toCommonJS(action_exports);
|
|
31
31
|
async function triggerUserPipelineAction({
|
|
32
|
-
axiosInstance,
|
|
33
32
|
pipelineName,
|
|
34
33
|
payload,
|
|
35
|
-
|
|
34
|
+
axiosInstance,
|
|
35
|
+
returnTraces,
|
|
36
|
+
shareCode
|
|
36
37
|
}) {
|
|
37
38
|
try {
|
|
38
39
|
const { data } = await axiosInstance.post(
|
|
@@ -41,7 +42,8 @@ async function triggerUserPipelineAction({
|
|
|
41
42
|
{
|
|
42
43
|
headers: {
|
|
43
44
|
"instill-return-traces": returnTraces ? "true" : "false",
|
|
44
|
-
"
|
|
45
|
+
"instill-share-code": shareCode,
|
|
46
|
+
"Access-Control-Allow-Headers": "instill-return-traces, instill-share-code",
|
|
45
47
|
"Content-Type": "application/json"
|
|
46
48
|
}
|
|
47
49
|
}
|
|
@@ -52,9 +54,9 @@ async function triggerUserPipelineAction({
|
|
|
52
54
|
}
|
|
53
55
|
}
|
|
54
56
|
async function triggerAsyncUserPipelineAction({
|
|
55
|
-
axiosInstance,
|
|
56
57
|
pipelineName,
|
|
57
58
|
payload,
|
|
59
|
+
axiosInstance,
|
|
58
60
|
returnTraces
|
|
59
61
|
}) {
|
|
60
62
|
try {
|
|
@@ -75,8 +77,8 @@ async function triggerAsyncUserPipelineAction({
|
|
|
75
77
|
}
|
|
76
78
|
}
|
|
77
79
|
async function setDefaultUserPipelineReleaseMutation({
|
|
78
|
-
|
|
79
|
-
|
|
80
|
+
pipelineReleaseName,
|
|
81
|
+
axiosInstance
|
|
80
82
|
}) {
|
|
81
83
|
try {
|
|
82
84
|
const { data } = await axiosInstance.post(
|
|
@@ -88,8 +90,8 @@ async function setDefaultUserPipelineReleaseMutation({
|
|
|
88
90
|
}
|
|
89
91
|
}
|
|
90
92
|
async function restoreUserPipelineReleaseMutation({
|
|
91
|
-
|
|
92
|
-
|
|
93
|
+
pipelineReleaseName,
|
|
94
|
+
axiosInstance
|
|
93
95
|
}) {
|
|
94
96
|
try {
|
|
95
97
|
const { data } = await axiosInstance.post(
|
|
@@ -101,9 +103,9 @@ async function restoreUserPipelineReleaseMutation({
|
|
|
101
103
|
}
|
|
102
104
|
}
|
|
103
105
|
async function triggerUserPipelineReleaseAction({
|
|
104
|
-
axiosInstance,
|
|
105
106
|
pipelineReleaseName,
|
|
106
107
|
payload,
|
|
108
|
+
axiosInstance,
|
|
107
109
|
returnTraces
|
|
108
110
|
}) {
|
|
109
111
|
try {
|
|
@@ -124,9 +126,9 @@ async function triggerUserPipelineReleaseAction({
|
|
|
124
126
|
}
|
|
125
127
|
}
|
|
126
128
|
async function triggerAsyncUserPipelineReleaseAction({
|
|
127
|
-
axiosInstance,
|
|
128
129
|
pipelineReleaseName,
|
|
129
130
|
payload,
|
|
131
|
+
axiosInstance,
|
|
130
132
|
returnTraces
|
|
131
133
|
}) {
|
|
132
134
|
try {
|
|
@@ -137,7 +139,7 @@ async function triggerAsyncUserPipelineReleaseAction({
|
|
|
137
139
|
headers: {
|
|
138
140
|
"instill-return-traces": returnTraces ? "true" : "false",
|
|
139
141
|
"Access-Control-Allow-Headers": "instill-return-traces",
|
|
140
|
-
"Content-Type": "application
|
|
142
|
+
"Content-Type": "application/json"
|
|
141
143
|
}
|
|
142
144
|
}
|
|
143
145
|
);
|
package/dist/pipeline/action.mjs
CHANGED
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
triggerAsyncUserPipelineReleaseAction,
|
|
6
6
|
triggerUserPipelineAction,
|
|
7
7
|
triggerUserPipelineReleaseAction
|
|
8
|
-
} from "../chunk-
|
|
8
|
+
} from "../chunk-K7AV4FXF.mjs";
|
|
9
9
|
import "../chunk-EXJ4UK7Q.mjs";
|
|
10
10
|
export {
|
|
11
11
|
restoreUserPipelineReleaseMutation,
|
package/dist/pipeline/index.mjs
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import "../chunk-KCKTAMXW.mjs";
|
|
2
|
-
import "../chunk-MS2EILMH.mjs";
|
|
3
|
-
import "../chunk-NRP5M7FG.mjs";
|
|
4
|
-
import "../chunk-QLWRKSUE.mjs";
|
|
5
|
-
import "../chunk-YK7RY2CG.mjs";
|
|
6
2
|
import "../chunk-42SCMPQP.mjs";
|
|
3
|
+
import "../chunk-V2NMRJ2Y.mjs";
|
|
4
|
+
import "../chunk-QLWRKSUE.mjs";
|
|
5
|
+
import "../chunk-I4VMGZBF.mjs";
|
|
6
|
+
import "../chunk-K7AV4FXF.mjs";
|
|
7
7
|
import "../chunk-6ZXT6X3H.mjs";
|
|
8
8
|
import "../chunk-JTTE7IZY.mjs";
|
|
9
9
|
import "../chunk-DXEIDDIA.mjs";
|
|
10
10
|
import "../chunk-RVRM4NPL.mjs";
|
|
11
11
|
import "../chunk-7KV3Y36U.mjs";
|
|
12
|
-
import "../chunk-
|
|
12
|
+
import "../chunk-QG4SF5DT.mjs";
|
|
13
13
|
import "../chunk-EXJ4UK7Q.mjs";
|
|
@@ -1,32 +1,51 @@
|
|
|
1
1
|
import { AxiosInstance } from "axios";
|
|
2
2
|
import { Nullable } from "../types";
|
|
3
|
-
import { Pipeline, PipelineRelease } from "./types";
|
|
4
|
-
export declare function listPipelinesQuery(
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
import { ListPipelinesResponse, ListUserPipelinesResponse, OperatorDefinition, Pipeline, PipelineRelease, listPipelinesQueryParams, listUserPipelinesQueryProps } from "./types";
|
|
4
|
+
export declare function listPipelinesQuery(props: listPipelinesQueryParams & {
|
|
5
|
+
enablePagination: true;
|
|
6
|
+
}): Promise<ListPipelinesResponse>;
|
|
7
|
+
export declare function listPipelinesQuery(props: listPipelinesQueryParams & {
|
|
8
|
+
enablePagination: false;
|
|
8
9
|
}): Promise<Pipeline[]>;
|
|
9
|
-
export declare function
|
|
10
|
-
|
|
11
|
-
pageSize: Nullable<number>;
|
|
12
|
-
nextPageToken: Nullable<string>;
|
|
13
|
-
userName: string;
|
|
10
|
+
export declare function listPipelinesQuery(props: listPipelinesQueryParams & {
|
|
11
|
+
enablePagination: undefined;
|
|
14
12
|
}): Promise<Pipeline[]>;
|
|
15
|
-
export declare function
|
|
16
|
-
|
|
13
|
+
export declare function listUserPipelinesQuery(props: listUserPipelinesQueryProps & {
|
|
14
|
+
enablePagination: true;
|
|
15
|
+
}): Promise<ListUserPipelinesResponse>;
|
|
16
|
+
export declare function listUserPipelinesQuery(props: listUserPipelinesQueryProps & {
|
|
17
|
+
enablePagination: false;
|
|
18
|
+
}): Promise<Pipeline[]>;
|
|
19
|
+
export declare function listUserPipelinesQuery(props: listUserPipelinesQueryProps & {
|
|
20
|
+
enablePagination: undefined;
|
|
21
|
+
}): Promise<Pipeline[]>;
|
|
22
|
+
export declare function getUserPipelineQuery({ pipelineName, axiosInstance, shareCode, }: {
|
|
17
23
|
pipelineName: string;
|
|
18
|
-
}): Promise<Pipeline>;
|
|
19
|
-
export declare function listUserPipelineReleasesQuery({ axiosInstance, pipelineName, pageSize, nextPageToken, }: {
|
|
20
24
|
axiosInstance: AxiosInstance;
|
|
25
|
+
shareCode?: string;
|
|
26
|
+
}): Promise<Pipeline>;
|
|
27
|
+
export declare function ListUserPipelineReleasesQuery({ pipelineName, pageSize, nextPageToken, axiosInstance, shareCode, }: {
|
|
21
28
|
pipelineName: string;
|
|
22
29
|
pageSize: Nullable<number>;
|
|
23
30
|
nextPageToken: Nullable<string>;
|
|
24
|
-
}): Promise<PipelineRelease[]>;
|
|
25
|
-
export declare function getUserPipelineReleaseQuery({ axiosInstance, pipelineReleaseName, }: {
|
|
26
31
|
axiosInstance: AxiosInstance;
|
|
32
|
+
shareCode?: string;
|
|
33
|
+
}): Promise<PipelineRelease[]>;
|
|
34
|
+
export declare function getUserPipelineReleaseQuery({ pipelineReleaseName, axiosInstance, }: {
|
|
27
35
|
pipelineReleaseName: string;
|
|
28
|
-
}): Promise<PipelineRelease>;
|
|
29
|
-
export declare function watchUserPipelineReleaseQuery({ axiosInstance, pipelineReleaseName, }: {
|
|
30
36
|
axiosInstance: AxiosInstance;
|
|
37
|
+
}): Promise<PipelineRelease>;
|
|
38
|
+
export declare function watchUserPipelineReleaseQuery({ pipelineReleaseName, axiosInstance, }: {
|
|
31
39
|
pipelineReleaseName: string;
|
|
40
|
+
axiosInstance: AxiosInstance;
|
|
32
41
|
}): Promise<import("./types").PipelineReleaseWatchState>;
|
|
42
|
+
export declare function listOperatorDefinitionsQuery({ pageSize, nextPageToken, axiosInstance, filter, }: {
|
|
43
|
+
pageSize: Nullable<number>;
|
|
44
|
+
nextPageToken: Nullable<string>;
|
|
45
|
+
axiosInstance: AxiosInstance;
|
|
46
|
+
filter: Nullable<string>;
|
|
47
|
+
}): Promise<OperatorDefinition[]>;
|
|
48
|
+
export declare function getOperatorDefinitionQuery({ operatorDefinitionName, axiosInstance, }: {
|
|
49
|
+
operatorDefinitionName: string;
|
|
50
|
+
axiosInstance: AxiosInstance;
|
|
51
|
+
}): Promise<OperatorDefinition>;
|
package/dist/pipeline/queries.js
CHANGED
|
@@ -30,10 +30,12 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
30
30
|
// src/pipeline/queries.ts
|
|
31
31
|
var queries_exports = {};
|
|
32
32
|
__export(queries_exports, {
|
|
33
|
+
ListUserPipelineReleasesQuery: () => ListUserPipelineReleasesQuery,
|
|
34
|
+
getOperatorDefinitionQuery: () => getOperatorDefinitionQuery,
|
|
33
35
|
getUserPipelineQuery: () => getUserPipelineQuery,
|
|
34
36
|
getUserPipelineReleaseQuery: () => getUserPipelineReleaseQuery,
|
|
37
|
+
listOperatorDefinitionsQuery: () => listOperatorDefinitionsQuery,
|
|
35
38
|
listPipelinesQuery: () => listPipelinesQuery,
|
|
36
|
-
listUserPipelineReleasesQuery: () => listUserPipelineReleasesQuery,
|
|
37
39
|
listUserPipelinesQuery: () => listUserPipelinesQuery,
|
|
38
40
|
watchUserPipelineReleaseQuery: () => watchUserPipelineReleaseQuery
|
|
39
41
|
});
|
|
@@ -47,7 +49,8 @@ var getQueryString = ({
|
|
|
47
49
|
baseURL,
|
|
48
50
|
pageSize,
|
|
49
51
|
nextPageToken,
|
|
50
|
-
filter
|
|
52
|
+
filter,
|
|
53
|
+
queryParams
|
|
51
54
|
}) => {
|
|
52
55
|
let url = baseURL;
|
|
53
56
|
if (pageSize || nextPageToken || filter) {
|
|
@@ -66,6 +69,9 @@ var getQueryString = ({
|
|
|
66
69
|
if (filter) {
|
|
67
70
|
url += `filter=${filter}&`;
|
|
68
71
|
}
|
|
72
|
+
if (queryParams) {
|
|
73
|
+
url += `${queryParams}&`;
|
|
74
|
+
}
|
|
69
75
|
if (url.endsWith("&")) {
|
|
70
76
|
url = url.slice(0, -1);
|
|
71
77
|
}
|
|
@@ -76,29 +82,36 @@ var getQueryString = ({
|
|
|
76
82
|
var import_axios2 = __toESM(require("axios"));
|
|
77
83
|
|
|
78
84
|
// src/pipeline/queries.ts
|
|
79
|
-
async function listPipelinesQuery({
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
85
|
+
async function listPipelinesQuery(props) {
|
|
86
|
+
const {
|
|
87
|
+
pageSize,
|
|
88
|
+
nextPageToken,
|
|
89
|
+
axiosInstance,
|
|
90
|
+
enablePagination,
|
|
91
|
+
visibility
|
|
92
|
+
} = props;
|
|
84
93
|
try {
|
|
85
94
|
const pipelines = [];
|
|
86
95
|
const queryString = getQueryString({
|
|
87
96
|
baseURL: "/pipelines?view=VIEW_FULL",
|
|
88
97
|
pageSize,
|
|
89
98
|
nextPageToken,
|
|
90
|
-
|
|
99
|
+
queryParams: visibility ? `visibility=${visibility}` : void 0
|
|
91
100
|
});
|
|
92
101
|
const { data } = await axiosInstance.get(
|
|
93
102
|
queryString
|
|
94
103
|
);
|
|
104
|
+
if (enablePagination) {
|
|
105
|
+
return Promise.resolve(data);
|
|
106
|
+
}
|
|
95
107
|
pipelines.push(...data.pipelines);
|
|
96
108
|
if (data.next_page_token) {
|
|
97
109
|
pipelines.push(
|
|
98
110
|
...await listPipelinesQuery({
|
|
99
|
-
axiosInstance,
|
|
100
111
|
pageSize,
|
|
101
|
-
nextPageToken: data.next_page_token
|
|
112
|
+
nextPageToken: data.next_page_token,
|
|
113
|
+
axiosInstance,
|
|
114
|
+
enablePagination: false
|
|
102
115
|
})
|
|
103
116
|
);
|
|
104
117
|
}
|
|
@@ -107,12 +120,8 @@ async function listPipelinesQuery({
|
|
|
107
120
|
return Promise.reject(err);
|
|
108
121
|
}
|
|
109
122
|
}
|
|
110
|
-
async function listUserPipelinesQuery({
|
|
111
|
-
axiosInstance,
|
|
112
|
-
pageSize,
|
|
113
|
-
nextPageToken,
|
|
114
|
-
userName
|
|
115
|
-
}) {
|
|
123
|
+
async function listUserPipelinesQuery(props) {
|
|
124
|
+
const { pageSize, nextPageToken, axiosInstance, userName, enablePagination } = props;
|
|
116
125
|
try {
|
|
117
126
|
const pipelines = [];
|
|
118
127
|
const queryString = getQueryString({
|
|
@@ -124,14 +133,18 @@ async function listUserPipelinesQuery({
|
|
|
124
133
|
const { data } = await axiosInstance.get(
|
|
125
134
|
queryString
|
|
126
135
|
);
|
|
136
|
+
if (enablePagination) {
|
|
137
|
+
return Promise.resolve(data);
|
|
138
|
+
}
|
|
127
139
|
pipelines.push(...data.pipelines);
|
|
128
140
|
if (data.next_page_token) {
|
|
129
141
|
pipelines.push(
|
|
130
142
|
...await listUserPipelinesQuery({
|
|
131
|
-
axiosInstance,
|
|
132
143
|
pageSize,
|
|
133
144
|
nextPageToken: data.next_page_token,
|
|
134
|
-
userName
|
|
145
|
+
userName,
|
|
146
|
+
axiosInstance,
|
|
147
|
+
enablePagination: false
|
|
135
148
|
})
|
|
136
149
|
);
|
|
137
150
|
}
|
|
@@ -141,23 +154,32 @@ async function listUserPipelinesQuery({
|
|
|
141
154
|
}
|
|
142
155
|
}
|
|
143
156
|
async function getUserPipelineQuery({
|
|
157
|
+
pipelineName,
|
|
144
158
|
axiosInstance,
|
|
145
|
-
|
|
159
|
+
shareCode
|
|
146
160
|
}) {
|
|
147
161
|
try {
|
|
148
162
|
const { data } = await axiosInstance.get(
|
|
149
|
-
`/${pipelineName}?view=VIEW_FULL
|
|
163
|
+
`/${pipelineName}?view=VIEW_FULL`,
|
|
164
|
+
{
|
|
165
|
+
headers: {
|
|
166
|
+
"instill-share-code": shareCode,
|
|
167
|
+
"Access-Control-Allow-Headers": shareCode ? "instill-share-code" : void 0,
|
|
168
|
+
"Content-Type": "application/json"
|
|
169
|
+
}
|
|
170
|
+
}
|
|
150
171
|
);
|
|
151
172
|
return Promise.resolve(data.pipeline);
|
|
152
173
|
} catch (err) {
|
|
153
174
|
return Promise.reject(err);
|
|
154
175
|
}
|
|
155
176
|
}
|
|
156
|
-
async function
|
|
157
|
-
axiosInstance,
|
|
177
|
+
async function ListUserPipelineReleasesQuery({
|
|
158
178
|
pipelineName,
|
|
159
179
|
pageSize,
|
|
160
|
-
nextPageToken
|
|
180
|
+
nextPageToken,
|
|
181
|
+
axiosInstance,
|
|
182
|
+
shareCode
|
|
161
183
|
}) {
|
|
162
184
|
try {
|
|
163
185
|
const releases = [];
|
|
@@ -168,16 +190,24 @@ async function listUserPipelineReleasesQuery({
|
|
|
168
190
|
filter: null
|
|
169
191
|
});
|
|
170
192
|
const { data } = await axiosInstance.get(
|
|
171
|
-
queryString
|
|
193
|
+
queryString,
|
|
194
|
+
{
|
|
195
|
+
headers: {
|
|
196
|
+
"instill-share-code": shareCode,
|
|
197
|
+
"Access-Control-Allow-Headers": shareCode ? "instill-share-code" : void 0,
|
|
198
|
+
"Content-Type": "application/json"
|
|
199
|
+
}
|
|
200
|
+
}
|
|
172
201
|
);
|
|
173
202
|
releases.push(...data.releases);
|
|
174
203
|
if (data.next_page_token) {
|
|
175
204
|
releases.push(
|
|
176
|
-
...await
|
|
177
|
-
axiosInstance,
|
|
205
|
+
...await ListUserPipelineReleasesQuery({
|
|
178
206
|
pipelineName,
|
|
179
207
|
pageSize,
|
|
180
|
-
nextPageToken: data.next_page_token
|
|
208
|
+
nextPageToken: data.next_page_token,
|
|
209
|
+
axiosInstance,
|
|
210
|
+
shareCode
|
|
181
211
|
})
|
|
182
212
|
);
|
|
183
213
|
}
|
|
@@ -187,8 +217,8 @@ async function listUserPipelineReleasesQuery({
|
|
|
187
217
|
}
|
|
188
218
|
}
|
|
189
219
|
async function getUserPipelineReleaseQuery({
|
|
190
|
-
|
|
191
|
-
|
|
220
|
+
pipelineReleaseName,
|
|
221
|
+
axiosInstance
|
|
192
222
|
}) {
|
|
193
223
|
try {
|
|
194
224
|
const { data } = await axiosInstance.get(
|
|
@@ -200,8 +230,8 @@ async function getUserPipelineReleaseQuery({
|
|
|
200
230
|
}
|
|
201
231
|
}
|
|
202
232
|
async function watchUserPipelineReleaseQuery({
|
|
203
|
-
|
|
204
|
-
|
|
233
|
+
pipelineReleaseName,
|
|
234
|
+
axiosInstance
|
|
205
235
|
}) {
|
|
206
236
|
try {
|
|
207
237
|
const { data } = await axiosInstance.get(
|
|
@@ -212,12 +242,60 @@ async function watchUserPipelineReleaseQuery({
|
|
|
212
242
|
return Promise.reject(err);
|
|
213
243
|
}
|
|
214
244
|
}
|
|
245
|
+
async function listOperatorDefinitionsQuery({
|
|
246
|
+
pageSize,
|
|
247
|
+
nextPageToken,
|
|
248
|
+
axiosInstance,
|
|
249
|
+
filter
|
|
250
|
+
}) {
|
|
251
|
+
try {
|
|
252
|
+
const operatorDefinitions = [];
|
|
253
|
+
const queryString = getQueryString({
|
|
254
|
+
baseURL: `/operator-definitions?view=VIEW_FULL`,
|
|
255
|
+
pageSize,
|
|
256
|
+
nextPageToken,
|
|
257
|
+
filter
|
|
258
|
+
});
|
|
259
|
+
const { data } = await axiosInstance.get(
|
|
260
|
+
queryString
|
|
261
|
+
);
|
|
262
|
+
operatorDefinitions.push(...data.operator_definitions);
|
|
263
|
+
if (data.next_page_token) {
|
|
264
|
+
operatorDefinitions.push(
|
|
265
|
+
...await listOperatorDefinitionsQuery({
|
|
266
|
+
pageSize,
|
|
267
|
+
axiosInstance,
|
|
268
|
+
nextPageToken: data.next_page_token,
|
|
269
|
+
filter
|
|
270
|
+
})
|
|
271
|
+
);
|
|
272
|
+
}
|
|
273
|
+
return Promise.resolve(operatorDefinitions);
|
|
274
|
+
} catch (err) {
|
|
275
|
+
return Promise.reject(err);
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
async function getOperatorDefinitionQuery({
|
|
279
|
+
operatorDefinitionName,
|
|
280
|
+
axiosInstance
|
|
281
|
+
}) {
|
|
282
|
+
try {
|
|
283
|
+
const { data } = await axiosInstance.get(
|
|
284
|
+
`/${operatorDefinitionName}?view=VIEW_FULL`
|
|
285
|
+
);
|
|
286
|
+
return Promise.resolve(data.operator_definition);
|
|
287
|
+
} catch (err) {
|
|
288
|
+
return Promise.reject(err);
|
|
289
|
+
}
|
|
290
|
+
}
|
|
215
291
|
// Annotate the CommonJS export names for ESM import in node:
|
|
216
292
|
0 && (module.exports = {
|
|
293
|
+
ListUserPipelineReleasesQuery,
|
|
294
|
+
getOperatorDefinitionQuery,
|
|
217
295
|
getUserPipelineQuery,
|
|
218
296
|
getUserPipelineReleaseQuery,
|
|
297
|
+
listOperatorDefinitionsQuery,
|
|
219
298
|
listPipelinesQuery,
|
|
220
|
-
listUserPipelineReleasesQuery,
|
|
221
299
|
listUserPipelinesQuery,
|
|
222
300
|
watchUserPipelineReleaseQuery
|
|
223
301
|
});
|
|
@@ -1,23 +1,27 @@
|
|
|
1
1
|
import {
|
|
2
|
+
ListUserPipelineReleasesQuery,
|
|
3
|
+
getOperatorDefinitionQuery,
|
|
2
4
|
getUserPipelineQuery,
|
|
3
5
|
getUserPipelineReleaseQuery,
|
|
6
|
+
listOperatorDefinitionsQuery,
|
|
4
7
|
listPipelinesQuery,
|
|
5
|
-
listUserPipelineReleasesQuery,
|
|
6
8
|
listUserPipelinesQuery,
|
|
7
9
|
watchUserPipelineReleaseQuery
|
|
8
|
-
} from "../chunk-
|
|
10
|
+
} from "../chunk-I4VMGZBF.mjs";
|
|
9
11
|
import "../chunk-6ZXT6X3H.mjs";
|
|
10
12
|
import "../chunk-JTTE7IZY.mjs";
|
|
11
13
|
import "../chunk-DXEIDDIA.mjs";
|
|
12
14
|
import "../chunk-RVRM4NPL.mjs";
|
|
13
15
|
import "../chunk-7KV3Y36U.mjs";
|
|
14
|
-
import "../chunk-
|
|
16
|
+
import "../chunk-QG4SF5DT.mjs";
|
|
15
17
|
import "../chunk-EXJ4UK7Q.mjs";
|
|
16
18
|
export {
|
|
19
|
+
ListUserPipelineReleasesQuery,
|
|
20
|
+
getOperatorDefinitionQuery,
|
|
17
21
|
getUserPipelineQuery,
|
|
18
22
|
getUserPipelineReleaseQuery,
|
|
23
|
+
listOperatorDefinitionsQuery,
|
|
19
24
|
listPipelinesQuery,
|
|
20
|
-
listUserPipelineReleasesQuery,
|
|
21
25
|
listUserPipelinesQuery,
|
|
22
26
|
watchUserPipelineReleaseQuery
|
|
23
27
|
};
|