Skip to content

Commit d627aad

Browse files
fix: fix eslint config (#79)
Because - eslint config is not correctly configured This commit - fix eslint config --------- Co-authored-by: Naman Anand <[email protected]>
1 parent c3a4448 commit d627aad

20 files changed

+47
-33
lines changed

.eslintrc.cjs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
module.exports = {
2+
root: true,
3+
extends: ["@instill-ai/eslint-config-cortex"],
4+
ignorePatterns: [
5+
".eslintrc.cjs",
6+
"tsup.config.ts",
7+
"vitest.config.ts",
8+
"dist/",
9+
"examples/",
10+
"setupTests.ts",
11+
"turbo.json",
12+
],
13+
};

src/connector/ConnectorClient.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class ConnectorClient {
2929
private axiosInstance: AxiosInstance;
3030

3131
constructor(baseUrl: string, appVersion: string, apiToken: string) {
32-
let URL: Nullable<string> = `${baseUrl}/vdp/${appVersion}`;
32+
const URL: Nullable<string> = `${baseUrl}/vdp/${appVersion}`;
3333

3434
this.axiosInstance = axios.create({
3535
baseURL: URL,

src/connector/index.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
export * from "./types";
2-
export * from "./ConnectorClient";
3-
2+
export { default } from "./ConnectorClient";

src/helper/axiosInstance.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const createAxiosInstance = (
77
appVersion: string,
88
product: string
99
): AxiosInstance => {
10-
let URL: Nullable<string> = `${baseUrl}/${product}/${appVersion}`;
10+
const URL: Nullable<string> = `${baseUrl}/${product}/${appVersion}`;
1111

1212
return axios.create({
1313
baseURL: URL,

src/helper/createClient.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@ export function createClient(
2525
}
2626
}
2727

28-
if (!process.env.API_GATEWAY_URL && !env("API_GATEWAY_URL")) {
28+
if (!env("API_GATEWAY_URL")) {
2929
throw new Error("API_GATEWAY_URL or API_GATEWAY_URL is not defined");
3030
}
3131

32-
let baseURL: Nullable<string> = `${
33-
process.env.API_GATEWAY_URL ?? env("API_GATEWAY_URL")
34-
}/${product}/${env("API_VERSION")}`;
32+
const baseURL: Nullable<string> = `${env("API_GATEWAY_URL")}/${product}/${env(
33+
"API_VERSION"
34+
)}`;
3535

3636
return axios.create({
3737
baseURL,

src/helper/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ export { createClient } from "./createClient";
22
export { getQueryString } from "./getQueryString";
33
export { getInstillApiErrorMessage } from "./getInstillApiErrorMessage";
44
export * from "./config";
5-
export * from "./axiosInstance";
5+
export { default } from "./axiosInstance";

src/index.ts

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
import ConnectorClient from "./connector/ConnectorClient";
2-
import MetricClient from "./metric/MetricClient";
3-
import AuthClient from "./mgmt/AuthClient";
4-
import ModelClient from "./model/ModelClient";
5-
import OperationClient from "./operation/OperationClient";
6-
import PipelineClient from "./pipeline/PipelineClient";
7-
import OrganizationClient from "./organization/OrganizationClient";
1+
import ConnectorClient from "./connector";
2+
import MetricClient from "./metric";
3+
import AuthClient from "./mgmt";
4+
import ModelClient from "./model";
5+
import OperationClient from "./operation";
6+
import OrganizationClient from "./organization";
7+
import PipelineClient from "./pipeline";
88

99
class InstillClient {
1010
public Pipeline: PipelineClient;
@@ -30,7 +30,6 @@ export * from "./types";
3030
export * from "./connector";
3131
export * from "./helper";
3232
export * from "./metric";
33-
export * from "./mgmt";
3433
export * from "./model";
3534
export * from "./operation";
3635
export * from "./pipeline";

src/metric/MetricClient.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class MetricClient {
1010
private axiosInstance: AxiosInstance;
1111

1212
constructor(baseUrl: string, appVersion: string, apiToken: string) {
13-
let URL: Nullable<string> = `${baseUrl}/core/${appVersion}`;
13+
const URL: Nullable<string> = `${baseUrl}/core/${appVersion}`;
1414

1515
this.axiosInstance = axios.create({
1616
baseURL: URL,

src/metric/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
export * from "./pipeline";
2+
export { default } from "./MetricClient";

src/mgmt/AuthClient.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class AuthClient {
3030
private axiosInstance: AxiosInstance;
3131

3232
constructor(baseUrl: string, appVersion: string, apiToken: string) {
33-
let URL: Nullable<string> = `${baseUrl}/core/${appVersion}`;
33+
const URL: Nullable<string> = `${baseUrl}/core/${appVersion}`;
3434

3535
this.axiosInstance = axios.create({
3636
baseURL: URL,
@@ -84,7 +84,11 @@ class AuthClient {
8484
* MGMT Mutation
8585
* -----------------------------------------------------------------------*/
8686

87-
async updateAuthenticatedUserMutation({ payload }: { payload: Partial<User> }) {
87+
async updateAuthenticatedUserMutation({
88+
payload,
89+
}: {
90+
payload: Partial<User>;
91+
}) {
8892
return updateAuthenticatedUserMutation({
8993
axiosInstance: this.axiosInstance,
9094
payload: payload,

src/mgmt/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export * from "./AuthClient";
1+
export { default } from "./AuthClient";

src/mgmt/mutation.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import {
55
CreateApiTokenPayload,
66
CreateApiTokenResponse,
77
UpdateUserResponse,
8-
User,
98
} from "./types";
109

1110
export async function updateAuthenticatedUserMutation({

src/model/ModelClient.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class ModelClient {
2020
private axiosInstance: AxiosInstance;
2121

2222
constructor(baseUrl: string, appVersion: string, apiToken: string) {
23-
let URL: Nullable<string> = `${baseUrl}/model/${appVersion}`;
23+
const URL: Nullable<string> = `${baseUrl}/model/${appVersion}`;
2424

2525
this.axiosInstance = axios.create({
2626
baseURL: URL,

src/model/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
export * from "./types";
2-
export * from "./ModelClient";
2+
export { default } from "./ModelClient";

src/operation/OperationClient.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ class OperationClient {
66
private axiosInstance: AxiosInstance;
77

88
constructor(baseUrl: string, appVersion: string, apiToken: string) {
9-
let URL: Nullable<string> = `${baseUrl}/model/${appVersion}`;
9+
const URL: Nullable<string> = `${baseUrl}/model/${appVersion}`;
1010

1111
this.axiosInstance = axios.create({
1212
baseURL: URL,

src/operation/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
export * from "./types";
2-
export * from "./OperationClient";
2+
export { default } from "./OperationClient";

src/organization/OrganizationClient.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class OrganizationClient {
2626
private axiosInstance: AxiosInstance;
2727

2828
constructor(baseUrl: string, appVersion: string, apiToken: string) {
29-
let URL: Nullable<string> = `${baseUrl}/core/${appVersion}`;
29+
const URL: Nullable<string> = `${baseUrl}/core/${appVersion}`;
3030

3131
this.axiosInstance = axios.create({
3232
baseURL: URL,

src/organization/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
export * from "./mutations";
2-
export * from "./queries";
2+
export * from "./queries";
3+
export { default } from "./OrganizationClient";

src/pipeline/PipelineClient.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,13 @@ import {
3535
triggerUserPipelineReleaseAction,
3636
} from "./action";
3737

38-
class PipelineClient {
38+
export class PipelineClient {
3939
// Define your specific API methods here
4040

4141
private axiosInstance: AxiosInstance;
4242

4343
constructor(baseUrl: string, appVersion: string, apiToken: string) {
44-
let URL: Nullable<string> = `${baseUrl}/vdp/${appVersion}`;
44+
const URL: Nullable<string> = `${baseUrl}/vdp/${appVersion}`;
4545

4646
this.axiosInstance = axios.create({
4747
baseURL: URL,
@@ -58,7 +58,6 @@ class PipelineClient {
5858
async listPipelinesQuery({
5959
pageSize,
6060
nextPageToken,
61-
enablePagination,
6261
}: {
6362
pageSize: Nullable<number>;
6463
nextPageToken: Nullable<string>;
@@ -76,7 +75,6 @@ class PipelineClient {
7675
pageSize,
7776
nextPageToken,
7877
userName,
79-
enablePagination,
8078
}: {
8179
pageSize: Nullable<number>;
8280
nextPageToken: Nullable<string>;

src/pipeline/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
export * from "./types";
2-
export * from "./PipelineClient";
2+
export { default } from "./PipelineClient";

0 commit comments

Comments
 (0)