Skip to content

Commit 175661f

Browse files
committed
Merge branch 'support/anybase' of ssh://github.com/apecloud/ApeRAG into support/anybase
2 parents cd16bd0 + ed09567 commit 175661f

File tree

13 files changed

+312
-218
lines changed

13 files changed

+312
-218
lines changed

web/src/api/apis/default-api.ts

Lines changed: 31 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,10 @@ import type { Collection } from '../models';
6262
// @ts-ignore
6363
import type { CollectionCreate } from '../models';
6464
// @ts-ignore
65+
import type { CollectionPublishRequest } from '../models';
66+
// @ts-ignore
67+
import type { CollectionSharingStatusResponse } from '../models';
68+
// @ts-ignore
6569
import type { CollectionUpdate } from '../models';
6670
// @ts-ignore
6771
import type { CollectionViewList } from '../models';
@@ -156,8 +160,6 @@ import type { SharedCollection } from '../models';
156160
// @ts-ignore
157161
import type { SharedCollectionList } from '../models';
158162
// @ts-ignore
159-
import type { SharingStatusResponse } from '../models';
160-
// @ts-ignore
161163
import type { TagFilterRequest } from '../models';
162164
// @ts-ignore
163165
import type { TitleGenerateRequest } from '../models';
@@ -1934,15 +1936,18 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati
19341936
};
19351937
},
19361938
/**
1937-
* Publish a collection to the public marketplace (owner only)
1939+
* Publish a collection to the marketplace with department scope (owner only)
19381940
* @summary Publish collection to marketplace
19391941
* @param {string} collectionId Collection ID
1942+
* @param {CollectionPublishRequest} collectionPublishRequest
19401943
* @param {*} [options] Override http request option.
19411944
* @throws {RequiredError}
19421945
*/
1943-
collectionsCollectionIdSharingPost: async (collectionId: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
1946+
collectionsCollectionIdSharingPost: async (collectionId: string, collectionPublishRequest: CollectionPublishRequest, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
19441947
// verify required parameter 'collectionId' is not null or undefined
19451948
assertParamExists('collectionsCollectionIdSharingPost', 'collectionId', collectionId)
1949+
// verify required parameter 'collectionPublishRequest' is not null or undefined
1950+
assertParamExists('collectionsCollectionIdSharingPost', 'collectionPublishRequest', collectionPublishRequest)
19461951
const localVarPath = `/collections/{collection_id}/sharing`
19471952
.replace(`{${"collection_id"}}`, encodeURIComponent(String(collectionId)));
19481953
// use dummy base URL string because the URL constructor only accepts absolute URLs.
@@ -1962,9 +1967,12 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati
19621967

19631968

19641969

1970+
localVarHeaderParameter['Content-Type'] = 'application/json';
1971+
19651972
setSearchParams(localVarUrlObj, localVarQueryParameter);
19661973
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
19671974
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
1975+
localVarRequestOptions.data = serializeDataIfNeeded(collectionPublishRequest, localVarRequestOptions, configuration)
19681976

19691977
return {
19701978
url: toPathString(localVarUrlObj),
@@ -4176,21 +4184,22 @@ export const DefaultApiFp = function(configuration?: Configuration) {
41764184
* @param {*} [options] Override http request option.
41774185
* @throws {RequiredError}
41784186
*/
4179-
async collectionsCollectionIdSharingGet(collectionId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<SharingStatusResponse>> {
4187+
async collectionsCollectionIdSharingGet(collectionId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CollectionSharingStatusResponse>> {
41804188
const localVarAxiosArgs = await localVarAxiosParamCreator.collectionsCollectionIdSharingGet(collectionId, options);
41814189
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
41824190
const localVarOperationServerBasePath = operationServerMap['DefaultApi.collectionsCollectionIdSharingGet']?.[localVarOperationServerIndex]?.url;
41834191
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
41844192
},
41854193
/**
4186-
* Publish a collection to the public marketplace (owner only)
4194+
* Publish a collection to the marketplace with department scope (owner only)
41874195
* @summary Publish collection to marketplace
41884196
* @param {string} collectionId Collection ID
4197+
* @param {CollectionPublishRequest} collectionPublishRequest
41894198
* @param {*} [options] Override http request option.
41904199
* @throws {RequiredError}
41914200
*/
4192-
async collectionsCollectionIdSharingPost(collectionId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
4193-
const localVarAxiosArgs = await localVarAxiosParamCreator.collectionsCollectionIdSharingPost(collectionId, options);
4201+
async collectionsCollectionIdSharingPost(collectionId: string, collectionPublishRequest: CollectionPublishRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
4202+
const localVarAxiosArgs = await localVarAxiosParamCreator.collectionsCollectionIdSharingPost(collectionId, collectionPublishRequest, options);
41944203
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
41954204
const localVarOperationServerBasePath = operationServerMap['DefaultApi.collectionsCollectionIdSharingPost']?.[localVarOperationServerIndex]?.url;
41964205
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
@@ -5199,18 +5208,18 @@ export const DefaultApiFactory = function (configuration?: Configuration, basePa
51995208
* @param {*} [options] Override http request option.
52005209
* @throws {RequiredError}
52015210
*/
5202-
collectionsCollectionIdSharingGet(requestParameters: DefaultApiCollectionsCollectionIdSharingGetRequest, options?: RawAxiosRequestConfig): AxiosPromise<SharingStatusResponse> {
5211+
collectionsCollectionIdSharingGet(requestParameters: DefaultApiCollectionsCollectionIdSharingGetRequest, options?: RawAxiosRequestConfig): AxiosPromise<CollectionSharingStatusResponse> {
52035212
return localVarFp.collectionsCollectionIdSharingGet(requestParameters.collectionId, options).then((request) => request(axios, basePath));
52045213
},
52055214
/**
5206-
* Publish a collection to the public marketplace (owner only)
5215+
* Publish a collection to the marketplace with department scope (owner only)
52075216
* @summary Publish collection to marketplace
52085217
* @param {DefaultApiCollectionsCollectionIdSharingPostRequest} requestParameters Request parameters.
52095218
* @param {*} [options] Override http request option.
52105219
* @throws {RequiredError}
52115220
*/
52125221
collectionsCollectionIdSharingPost(requestParameters: DefaultApiCollectionsCollectionIdSharingPostRequest, options?: RawAxiosRequestConfig): AxiosPromise<void> {
5213-
return localVarFp.collectionsCollectionIdSharingPost(requestParameters.collectionId, options).then((request) => request(axios, basePath));
5222+
return localVarFp.collectionsCollectionIdSharingPost(requestParameters.collectionId, requestParameters.collectionPublishRequest, options).then((request) => request(axios, basePath));
52145223
},
52155224
/**
52165225
* Trigger collection summary generation as background task
@@ -6059,10 +6068,10 @@ export interface DefaultApiInterface {
60596068
* @throws {RequiredError}
60606069
* @memberof DefaultApiInterface
60616070
*/
6062-
collectionsCollectionIdSharingGet(requestParameters: DefaultApiCollectionsCollectionIdSharingGetRequest, options?: RawAxiosRequestConfig): AxiosPromise<SharingStatusResponse>;
6071+
collectionsCollectionIdSharingGet(requestParameters: DefaultApiCollectionsCollectionIdSharingGetRequest, options?: RawAxiosRequestConfig): AxiosPromise<CollectionSharingStatusResponse>;
60636072

60646073
/**
6065-
* Publish a collection to the public marketplace (owner only)
6074+
* Publish a collection to the marketplace with department scope (owner only)
60666075
* @summary Publish collection to marketplace
60676076
* @param {DefaultApiCollectionsCollectionIdSharingPostRequest} requestParameters Request parameters.
60686077
* @param {*} [options] Override http request option.
@@ -7325,6 +7334,13 @@ export interface DefaultApiCollectionsCollectionIdSharingPostRequest {
73257334
* @memberof DefaultApiCollectionsCollectionIdSharingPost
73267335
*/
73277336
readonly collectionId: string
7337+
7338+
/**
7339+
*
7340+
* @type {CollectionPublishRequest}
7341+
* @memberof DefaultApiCollectionsCollectionIdSharingPost
7342+
*/
7343+
readonly collectionPublishRequest: CollectionPublishRequest
73287344
}
73297345

73307346
/**
@@ -8510,15 +8526,15 @@ export class DefaultApi extends BaseAPI implements DefaultApiInterface {
85108526
}
85118527

85128528
/**
8513-
* Publish a collection to the public marketplace (owner only)
8529+
* Publish a collection to the marketplace with department scope (owner only)
85148530
* @summary Publish collection to marketplace
85158531
* @param {DefaultApiCollectionsCollectionIdSharingPostRequest} requestParameters Request parameters.
85168532
* @param {*} [options] Override http request option.
85178533
* @throws {RequiredError}
85188534
* @memberof DefaultApi
85198535
*/
85208536
public collectionsCollectionIdSharingPost(requestParameters: DefaultApiCollectionsCollectionIdSharingPostRequest, options?: RawAxiosRequestConfig) {
8521-
return DefaultApiFp(this.configuration).collectionsCollectionIdSharingPost(requestParameters.collectionId, options).then((request) => request(this.axios, this.basePath));
8537+
return DefaultApiFp(this.configuration).collectionsCollectionIdSharingPost(requestParameters.collectionId, requestParameters.collectionPublishRequest, options).then((request) => request(this.axios, this.basePath));
85228538
}
85238539

85248540
/**
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/* tslint:disable */
2+
/* eslint-disable */
3+
/**
4+
* ApeRAG API
5+
* ApeRAG API Documentation
6+
*
7+
* The version of the OpenAPI document: 1.0.0
8+
*
9+
*
10+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11+
* https://openapi-generator.tech
12+
* Do not edit the class manually.
13+
*/
14+
15+
16+
17+
/**
18+
*
19+
* @export
20+
* @interface CollectionPublishRequest
21+
*/
22+
export interface CollectionPublishRequest {
23+
/**
24+
* List of department IDs to publish to, or [\"*\"] for global publishing
25+
* @type {Array<string>}
26+
* @memberof CollectionPublishRequest
27+
*/
28+
'group_ids': Array<string>;
29+
}
30+
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
/* tslint:disable */
2+
/* eslint-disable */
3+
/**
4+
* ApeRAG API
5+
* ApeRAG API Documentation
6+
*
7+
* The version of the OpenAPI document: 1.0.0
8+
*
9+
*
10+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11+
* https://openapi-generator.tech
12+
* Do not edit the class manually.
13+
*/
14+
15+
16+
17+
/**
18+
* Collection sharing status response
19+
* @export
20+
* @interface CollectionSharingStatusResponse
21+
*/
22+
export interface CollectionSharingStatusResponse {
23+
/**
24+
* Whether published to marketplace
25+
* @type {boolean}
26+
* @memberof CollectionSharingStatusResponse
27+
*/
28+
'is_published': boolean;
29+
/**
30+
* List of department IDs where the collection is published
31+
* @type {Array<string>}
32+
* @memberof CollectionSharingStatusResponse
33+
*/
34+
'group_ids'?: Array<string>;
35+
/**
36+
* Whether the collection is published globally
37+
* @type {boolean}
38+
* @memberof CollectionSharingStatusResponse
39+
*/
40+
'is_global'?: boolean;
41+
}
42+

web/src/api/models/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ export * from './collection-config';
2828
export * from './collection-config-anybase';
2929
export * from './collection-config-object-storage';
3030
export * from './collection-create';
31+
export * from './collection-publish-request';
32+
export * from './collection-sharing-status-response';
3133
export * from './collection-update';
3234
export * from './collection-view';
3335
export * from './collection-view-list';
@@ -159,7 +161,6 @@ export * from './shared-bot-list';
159161
export * from './shared-collection';
160162
export * from './shared-collection-config';
161163
export * from './shared-collection-list';
162-
export * from './sharing-status-response';
163164
export * from './suggestion-action-request';
164165
export * from './suggestion-action-response';
165166
export * from './summary-search-params';

web/src/api/models/sharing-status-response.ts

Lines changed: 0 additions & 36 deletions
This file was deleted.

web/src/api/openapi.merged.yaml

Lines changed: 32 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1873,7 +1873,7 @@ paths:
18731873
content:
18741874
application/json:
18751875
schema:
1876-
$ref: '#/components/schemas/SharingStatusResponse'
1876+
$ref: '#/components/schemas/CollectionSharingStatusResponse'
18771877
'401':
18781878
description: Unauthorized
18791879
content:
@@ -1900,7 +1900,7 @@ paths:
19001900
$ref: '#/components/schemas/failResponse'
19011901
post:
19021902
summary: Publish collection to marketplace
1903-
description: Publish a collection to the public marketplace (owner only)
1903+
description: Publish a collection to the marketplace with department scope (owner only)
19041904
security:
19051905
- BearerAuth: []
19061906
parameters:
@@ -1910,6 +1910,12 @@ paths:
19101910
schema:
19111911
type: string
19121912
description: Collection ID
1913+
requestBody:
1914+
required: true
1915+
content:
1916+
application/json:
1917+
schema:
1918+
$ref: '#/components/schemas/collectionPublishRequest'
19131919
responses:
19141920
'204':
19151921
description: Collection published successfully
@@ -6429,20 +6435,37 @@ components:
64296435
- message
64306436
- suggestion_id
64316437
- action
6432-
SharingStatusResponse:
6438+
CollectionSharingStatusResponse:
64336439
type: object
6434-
description: Simple sharing status response
6440+
description: Collection sharing status response
64356441
properties:
64366442
is_published:
64376443
type: boolean
64386444
description: Whether published to marketplace
6439-
published_at:
6440-
type: string
6441-
format: date-time
6442-
nullable: true
6443-
description: Publication time, null when not published
6445+
group_ids:
6446+
type: array
6447+
items:
6448+
type: string
6449+
description: List of department IDs where the collection is published
6450+
is_global:
6451+
type: boolean
6452+
description: Whether the collection is published globally
64446453
required:
64456454
- is_published
6455+
collectionPublishRequest:
6456+
type: object
6457+
properties:
6458+
group_ids:
6459+
type: array
6460+
items:
6461+
type: string
6462+
description: List of department IDs to publish to, or ["*"] for global publishing
6463+
example:
6464+
- '*'
6465+
- dp_1
6466+
- dp_2
6467+
required:
6468+
- group_ids
64466469
SharedCollectionConfig:
64476470
type: object
64486471
description: Configuration settings for shared collection features

web/src/app/auth/signin/signin-form.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,12 @@ export function SignInForm({
6767
);
6868

6969
useEffect(() => {
70-
if (top) {
70+
if (top && process.env.NODE_ENV === 'production') {
7171
top.window.location.href = `/login?redirect_url=${redirectTo}`;
7272
}
7373
}, [redirectTo]);
7474

75-
if (top) {
75+
if (process.env.NODE_ENV === 'production') {
7676
return;
7777
}
7878

0 commit comments

Comments
 (0)