-
Notifications
You must be signed in to change notification settings - Fork 535
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(config-ui): unified API type definitions and exports
- Loading branch information
Showing
64 changed files
with
484 additions
and
555 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one or more | ||
* contributor license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright ownership. | ||
* The ASF licenses this file to You under the Apache License, Version 2.0 | ||
* (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* | ||
*/ | ||
|
||
import { request } from '@/utils'; | ||
|
||
import * as T from './types'; | ||
|
||
export const list = (data: Pagination & { type: string }): Promise<{ count: number; blueprints: T.Blueprint[] }> => | ||
request('/blueprints', { data }); | ||
|
||
export const get = (id: ID): Promise<T.Blueprint> => request(`/blueprints/${id}`); | ||
|
||
export const create = (data: any) => | ||
request('/blueprints', { | ||
method: 'post', | ||
data, | ||
}); | ||
|
||
export const remove = (id: ID) => request(`/blueprints/${id}`, { method: 'delete' }); | ||
|
||
export const update = (id: ID, data: T.Blueprint) => request(`/blueprints/${id}`, { method: 'patch', data }); | ||
|
||
export const pipelines = (id: ID) => request(`/blueprints/${id}/pipelines`); | ||
|
||
export const trigger = (id: ID, data: T.TriggerQuery) => request(`/blueprints/${id}/trigger`, { method: 'post', data }); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one or more | ||
* contributor license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright ownership. | ||
* The ASF licenses this file to You under the Apache License, Version 2.0 | ||
* (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* | ||
*/ | ||
|
||
export enum ModeEnum { | ||
advanced = 'ADVANCED', | ||
normal = 'NORMAL', | ||
} | ||
|
||
export type Blueprint = { | ||
projectName: string; | ||
id: ID; | ||
enable: boolean; | ||
name: string; | ||
mode: ModeEnum; | ||
isManual: boolean; | ||
cronConfig: string; | ||
skipOnFail: boolean; | ||
plan: any; | ||
timeAfter: null | string; | ||
connections: Array<{ | ||
pluginName: string; | ||
connectionId: ID; | ||
scopes?: Array<{ | ||
scopeId: string; | ||
}>; | ||
}>; | ||
}; | ||
|
||
export type TriggerQuery = { | ||
skipCollectors: boolean; | ||
fullSync: boolean; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one or more | ||
* contributor license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright ownership. | ||
* The ASF licenses this file to You under the Apache License, Version 2.0 | ||
* (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* | ||
*/ | ||
|
||
import { request } from '@/utils'; | ||
|
||
import * as apiKey from './api-key'; | ||
import * as blueprint from './blueprint'; | ||
import * as connection from './connection'; | ||
import * as pipeline from './pipeline'; | ||
import plugin from './plugin'; | ||
import * as project from './project'; | ||
import * as scope from './scope'; | ||
import * as scopeConfig from './scope-config'; | ||
import * as task from './task'; | ||
|
||
const migrate = () => request('/proceed-db-migration'); | ||
const ping = () => request('/ping'); | ||
const version = (signal?: AbortSignal): Promise<{ version: string }> => request('/version', { signal }); | ||
const userInfo = (signal?: AbortSignal): Promise<{ user: string; email: string; logoutURI: string }> => | ||
request('/userinfo', { signal }); | ||
|
||
export const API = { | ||
apiKey, | ||
blueprint, | ||
connection, | ||
pipeline, | ||
plugin, | ||
project, | ||
scopeConfig, | ||
scope, | ||
task, | ||
migrate, | ||
ping, | ||
version, | ||
userInfo, | ||
}; | ||
|
||
export default API; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.