Update FE API
This commit is contained in:
1 parent
78555be89d
commit
b1f5a5fafc
4 files changed
+78
-1062
No files matched your search
+42
-1
@@ -2231,8 +2231,26 @@
|
||||
"tags": [
|
||||
"Repository"
|
||||
],
|
||||
"description": "connect POST requests to sync of Repository",
|
||||
"description": "Sync from repository into Grafana",
|
||||
"operationId": "createRepositorySync",
|
||||
"requestBody": {
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"complete": {
|
||||
"description": "Complete forces the sync to overwrite",
|
||||
"type": "boolean"
|
||||
}
|
||||
}
|
||||
},
|
||||
"example": {
|
||||
"complete": true
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
@@ -3855,6 +3873,14 @@
|
||||
"description": "The the repository reference (for now also in labels)",
|
||||
"type": "string",
|
||||
"default": ""
|
||||
},
|
||||
"sync": {
|
||||
"description": "Required when the action is `sync`",
|
||||
"allOf": [
|
||||
{
|
||||
"$ref": "#/components/schemas/com.github.grafana.grafana.pkg.apis.provisioning.v0alpha1.SyncOptions"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -4067,9 +4093,15 @@
|
||||
"required": [
|
||||
"title",
|
||||
"editing",
|
||||
"deletePolicy",
|
||||
"type"
|
||||
],
|
||||
"properties": {
|
||||
"deletePolicy": {
|
||||
"description": "DeletePolicy options within the repository",
|
||||
"type": "string",
|
||||
"default": ""
|
||||
},
|
||||
"description": {
|
||||
"description": "Describe the feature toggle",
|
||||
"type": "string"
|
||||
@@ -4468,6 +4500,15 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"com.github.grafana.grafana.pkg.apis.provisioning.v0alpha1.SyncOptions": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"complete": {
|
||||
"description": "Complete forces the sync to overwrite",
|
||||
"type": "boolean"
|
||||
}
|
||||
}
|
||||
},
|
||||
"com.github.grafana.grafana.pkg.apis.provisioning.v0alpha1.SyncStatus": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -201,6 +201,7 @@ const injectedRtkApi = api
|
||||
query: (queryArg) => ({
|
||||
url: `/repositories/${queryArg.name}/sync`,
|
||||
method: 'POST',
|
||||
body: queryArg.body,
|
||||
}),
|
||||
invalidatesTags: ['Repository'],
|
||||
}),
|
||||
@@ -235,19 +236,16 @@ const injectedRtkApi = api
|
||||
overrideExisting: false,
|
||||
});
|
||||
export { injectedRtkApi as generatedAPI };
|
||||
export type ListJobResponse = JobList;
|
||||
export type ListJobArg = {
|
||||
};
|
||||
export type GetJobResponse = Job;
|
||||
export type ListJobResponse = JobList;
|
||||
export type ListJobArg = {};
|
||||
export type GetJobResponse = Job;
|
||||
export type GetJobArg = {
|
||||
name: string;
|
||||
pretty?: string;
|
||||
};
|
||||
export type ListRepositoryResponse =
|
||||
RepositoryList;
|
||||
export type ListRepositoryArg = {
|
||||
};
|
||||
export type CreateRepositoryResponse = | Repository;
|
||||
export type ListRepositoryResponse = RepositoryList;
|
||||
export type ListRepositoryArg = {};
|
||||
export type CreateRepositoryResponse = Repository;
|
||||
export type CreateRepositoryArg = {
|
||||
pretty?: string;
|
||||
dryRun?: string;
|
||||
@@ -255,12 +253,12 @@ export type CreateRepositoryArg = {
|
||||
fieldValidation?: string;
|
||||
body: Repository;
|
||||
};
|
||||
export type GetRepositoryResponse = Repository;
|
||||
export type GetRepositoryResponse = Repository;
|
||||
export type GetRepositoryArg = {
|
||||
name: string;
|
||||
pretty?: string;
|
||||
};
|
||||
export type ReplaceRepositoryResponse = | Repository;
|
||||
export type ReplaceRepositoryResponse = Repository;
|
||||
export type ReplaceRepositoryArg = {
|
||||
name: string;
|
||||
pretty?: string;
|
||||
@@ -269,7 +267,7 @@ export type ReplaceRepositoryArg = {
|
||||
fieldValidation?: string;
|
||||
body: Repository;
|
||||
};
|
||||
export type DeleteRepositoryResponse = | Status;
|
||||
export type DeleteRepositoryResponse = Status;
|
||||
export type DeleteRepositoryArg = {
|
||||
name: string;
|
||||
pretty?: string;
|
||||
@@ -280,7 +278,7 @@ export type DeleteRepositoryArg = {
|
||||
propagationPolicy?: string;
|
||||
body: DeleteOptions;
|
||||
};
|
||||
export type CreateRepositoryExportResponse = Job;
|
||||
export type CreateRepositoryExportResponse = Job;
|
||||
export type CreateRepositoryExportArg = {
|
||||
name: string;
|
||||
body: {
|
||||
@@ -290,7 +288,7 @@ export type CreateRepositoryExportArg = {
|
||||
prefix?: string;
|
||||
};
|
||||
};
|
||||
export type GetRepositoryFilesResponse = {
|
||||
export type GetRepositoryFilesResponse = {
|
||||
apiVersion?: string;
|
||||
items?: any[];
|
||||
kind?: string;
|
||||
@@ -300,15 +298,13 @@ export type GetRepositoryFilesArg = {
|
||||
name: string;
|
||||
ref?: string;
|
||||
};
|
||||
export type GetRepositoryFilesWithPathResponse =
|
||||
ResourceWrapper;
|
||||
export type GetRepositoryFilesWithPathResponse = ResourceWrapper;
|
||||
export type GetRepositoryFilesWithPathArg = {
|
||||
name: string;
|
||||
path: string;
|
||||
ref?: string;
|
||||
};
|
||||
export type ReplaceRepositoryFilesWithPathResponse =
|
||||
ResourceWrapper;
|
||||
export type ReplaceRepositoryFilesWithPathResponse = ResourceWrapper;
|
||||
export type ReplaceRepositoryFilesWithPathArg = {
|
||||
name: string;
|
||||
path: string;
|
||||
@@ -318,8 +314,7 @@ export type ReplaceRepositoryFilesWithPathArg = {
|
||||
[key: string]: any;
|
||||
};
|
||||
};
|
||||
export type CreateRepositoryFilesWithPathResponse =
|
||||
ResourceWrapper;
|
||||
export type CreateRepositoryFilesWithPathResponse = ResourceWrapper;
|
||||
export type CreateRepositoryFilesWithPathArg = {
|
||||
name: string;
|
||||
path: string;
|
||||
@@ -329,37 +324,34 @@ export type CreateRepositoryFilesWithPathArg = {
|
||||
[key: string]: any;
|
||||
};
|
||||
};
|
||||
export type DeleteRepositoryFilesWithPathResponse =
|
||||
ResourceWrapper;
|
||||
export type DeleteRepositoryFilesWithPathResponse = ResourceWrapper;
|
||||
export type DeleteRepositoryFilesWithPathArg = {
|
||||
name: string;
|
||||
path: string;
|
||||
ref?: string;
|
||||
message?: string;
|
||||
};
|
||||
export type GetRepositoryHistoryResponse = string;
|
||||
export type GetRepositoryHistoryResponse = string;
|
||||
export type GetRepositoryHistoryArg = {
|
||||
name: string;
|
||||
ref?: string;
|
||||
};
|
||||
export type GetRepositoryHistoryWithPathResponse = string;
|
||||
export type GetRepositoryHistoryWithPathResponse = string;
|
||||
export type GetRepositoryHistoryWithPathArg = {
|
||||
name: string;
|
||||
path: string;
|
||||
ref?: string;
|
||||
};
|
||||
export type GetRepositoryResourcesResponse =
|
||||
ResourceList;
|
||||
export type GetRepositoryResourcesResponse = ResourceList;
|
||||
export type GetRepositoryResourcesArg = {
|
||||
name: string;
|
||||
};
|
||||
export type GetRepositoryStatusResponse =
|
||||
Repository;
|
||||
export type GetRepositoryStatusResponse = Repository;
|
||||
export type GetRepositoryStatusArg = {
|
||||
name: string;
|
||||
pretty?: string;
|
||||
};
|
||||
export type ReplaceRepositoryStatusResponse = | Repository;
|
||||
export type ReplaceRepositoryStatusResponse = Repository;
|
||||
export type ReplaceRepositoryStatusArg = {
|
||||
name: string;
|
||||
pretty?: string;
|
||||
@@ -368,12 +360,14 @@ export type ReplaceRepositoryStatusArg = {
|
||||
fieldValidation?: string;
|
||||
body: Repository;
|
||||
};
|
||||
export type CreateRepositorySyncResponse = Job;
|
||||
export type CreateRepositorySyncResponse = Job;
|
||||
export type CreateRepositorySyncArg = {
|
||||
name: string;
|
||||
body: {
|
||||
complete?: boolean;
|
||||
};
|
||||
};
|
||||
export type CreateRepositoryTestResponse =
|
||||
TestResults;
|
||||
export type CreateRepositoryTestResponse = TestResults;
|
||||
export type CreateRepositoryTestArg = {
|
||||
name: string;
|
||||
body: {
|
||||
@@ -384,24 +378,21 @@ export type CreateRepositoryTestArg = {
|
||||
status?: any;
|
||||
};
|
||||
};
|
||||
export type GetRepositoryWebhookResponse =
|
||||
WebhookResponse;
|
||||
export type GetRepositoryWebhookResponse = WebhookResponse;
|
||||
export type GetRepositoryWebhookArg = {
|
||||
name: string;
|
||||
};
|
||||
export type CreateRepositoryWebhookResponse =
|
||||
WebhookResponse;
|
||||
export type CreateRepositoryWebhookResponse = WebhookResponse;
|
||||
export type CreateRepositoryWebhookArg = {
|
||||
name: string;
|
||||
};
|
||||
export type GetResourceStatsResponse = {
|
||||
export type GetResourceStatsResponse = {
|
||||
apiVersion?: string;
|
||||
items?: any[];
|
||||
kind?: string;
|
||||
metadata?: any;
|
||||
};
|
||||
export type GetResourceStatsArg = {
|
||||
};
|
||||
export type GetResourceStatsArg = {};
|
||||
export type Time = string;
|
||||
export type FieldsV1 = object;
|
||||
export type ManagedFieldsEntry = {
|
||||
@@ -454,11 +445,15 @@ export type PullRequestOptions = {
|
||||
ref?: string;
|
||||
url?: string;
|
||||
};
|
||||
export type SyncOptions = {
|
||||
complete?: boolean;
|
||||
};
|
||||
export type JobSpec = {
|
||||
action: 'export' | 'pr' | 'sync';
|
||||
export?: ExportOptions;
|
||||
pr?: PullRequestOptions;
|
||||
repository: string;
|
||||
sync?: SyncOptions;
|
||||
};
|
||||
export type JobResourceSummary = {
|
||||
create?: number;
|
||||
@@ -519,6 +514,7 @@ export type S3RepositoryConfig = {
|
||||
region?: string;
|
||||
};
|
||||
export type RepositorySpec = {
|
||||
deletePolicy: string;
|
||||
description?: string;
|
||||
editing: EditingOptions;
|
||||
folder?: string;
|
||||
|
||||
@@ -8,6 +8,7 @@ export const dataToSpec = (data: RepositoryFormData): RepositorySpec => {
|
||||
title: data.title || '',
|
||||
editing: data.editing,
|
||||
linting: data.linting,
|
||||
deletePolicy: 'retain',
|
||||
};
|
||||
switch (data.type) {
|
||||
case 'github':
|
||||
|
||||
Reference in new issue
Block a user