convert crlf to lf
This commit is contained in:
parent
ebe075e0c4
commit
4124bd21b3
13
.eslintrc.js
13
.eslintrc.js
@ -10,13 +10,12 @@ module.exports = {
|
||||
node: true,
|
||||
},
|
||||
extends: [
|
||||
'vuetify',
|
||||
'@vue/eslint-config-typescript',
|
||||
'./.eslintrc-auto-import.json',
|
||||
'plugin:prettier/recommended'
|
||||
"vuetify",
|
||||
"@vue/eslint-config-typescript",
|
||||
"./.eslintrc-auto-import.json",
|
||||
"plugin:prettier/recommended",
|
||||
],
|
||||
rules: {
|
||||
'vue/multi-word-component-names': 'off',
|
||||
"vue/multi-word-component-names": "off",
|
||||
},
|
||||
|
||||
}
|
||||
};
|
||||
|
13
README.md
13
README.md
@ -14,12 +14,12 @@ This is the official scaffolding tool for Vuetify, designed to give you a head s
|
||||
|
||||
Set up your project using your preferred package manager. Use the corresponding command to install the dependencies:
|
||||
|
||||
| Package Manager | Command |
|
||||
|---------------------------------------------------------------|----------------|
|
||||
| [yarn](https://yarnpkg.com/getting-started) | `yarn install` |
|
||||
| [npm](https://docs.npmjs.com/cli/v7/commands/npm-install) | `npm install` |
|
||||
| [pnpm](https://pnpm.io/installation) | `pnpm install` |
|
||||
| [bun](https://bun.sh/#getting-started) | `bun install` |
|
||||
| Package Manager | Command |
|
||||
| --------------------------------------------------------- | -------------- |
|
||||
| [yarn](https://yarnpkg.com/getting-started) | `yarn install` |
|
||||
| [npm](https://docs.npmjs.com/cli/v7/commands/npm-install) | `npm install` |
|
||||
| [pnpm](https://pnpm.io/installation) | `pnpm install` |
|
||||
| [bun](https://bun.sh/#getting-started) | `bun install` |
|
||||
|
||||
After completing the installation, your environment is ready for Vuetify development.
|
||||
|
||||
@ -76,6 +76,7 @@ This project is built with [Vuetify](https://vuetifyjs.com/en/), a UI Library wi
|
||||
- [Making a one-time donation with Paypal](https://paypal.me/vuetify)
|
||||
|
||||
## 📑 License
|
||||
|
||||
[MIT](http://opensource.org/licenses/MIT)
|
||||
|
||||
Copyright (c) 2016-present Vuetify, LLC
|
||||
|
572
api/swagger.yaml
572
api/swagger.yaml
@ -72,7 +72,7 @@ definitions:
|
||||
created_at:
|
||||
type: string
|
||||
data:
|
||||
$ref: '#/definitions/rag-new_internal_schema.ToolDiscoveryOutput'
|
||||
$ref: "#/definitions/rag-new_internal_schema.ToolDiscoveryOutput"
|
||||
description:
|
||||
type: string
|
||||
discovery_url:
|
||||
@ -97,8 +97,8 @@ definitions:
|
||||
prompt:
|
||||
type: string
|
||||
required:
|
||||
- description
|
||||
- name
|
||||
- description
|
||||
- name
|
||||
type: object
|
||||
rag-new_internal_schema.ChatCreateRequest:
|
||||
properties:
|
||||
@ -108,8 +108,8 @@ definitions:
|
||||
maxLength: 255
|
||||
type: string
|
||||
required:
|
||||
- assistant_id
|
||||
- name
|
||||
- assistant_id
|
||||
- name
|
||||
type: object
|
||||
rag-new_internal_schema.ChatMessageAddRequest:
|
||||
properties:
|
||||
@ -117,7 +117,7 @@ definitions:
|
||||
maxLength: 255
|
||||
type: string
|
||||
required:
|
||||
- message
|
||||
- message
|
||||
type: object
|
||||
rag-new_internal_schema.ChatMessageResponse:
|
||||
properties:
|
||||
@ -160,9 +160,9 @@ definitions:
|
||||
maxLength: 255
|
||||
type: string
|
||||
required:
|
||||
- description
|
||||
- name
|
||||
- url
|
||||
- description
|
||||
- name
|
||||
- url
|
||||
type: object
|
||||
rag-new_internal_schema.ToolDiscoveryOutput:
|
||||
properties:
|
||||
@ -172,7 +172,7 @@ definitions:
|
||||
type: string
|
||||
function:
|
||||
items:
|
||||
$ref: '#/definitions/rag-new_internal_schema.ToolDiscoveryOutputFunctions'
|
||||
$ref: "#/definitions/rag-new_internal_schema.ToolDiscoveryOutputFunctions"
|
||||
type: array
|
||||
homepage_url:
|
||||
type: string
|
||||
@ -195,7 +195,7 @@ definitions:
|
||||
properties:
|
||||
function:
|
||||
items:
|
||||
$ref: '#/definitions/rag-new_internal_schema.ToolDiscoveryOutputFunction'
|
||||
$ref: "#/definitions/rag-new_internal_schema.ToolDiscoveryOutputFunction"
|
||||
type: array
|
||||
type:
|
||||
type: string
|
||||
@ -208,594 +208,594 @@ paths:
|
||||
/api/v1/assistants:
|
||||
get:
|
||||
consumes:
|
||||
- application/json
|
||||
- application/json
|
||||
description: get string by ID
|
||||
produces:
|
||||
- application/json
|
||||
- application/json
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
schema:
|
||||
allOf:
|
||||
- $ref: '#/definitions/rag-new_internal_schema.ResponseBody'
|
||||
- properties:
|
||||
data:
|
||||
items:
|
||||
$ref: '#/definitions/rag-new_internal_entity.Assistant'
|
||||
type: array
|
||||
type: object
|
||||
- $ref: "#/definitions/rag-new_internal_schema.ResponseBody"
|
||||
- properties:
|
||||
data:
|
||||
items:
|
||||
$ref: "#/definitions/rag-new_internal_entity.Assistant"
|
||||
type: array
|
||||
type: object
|
||||
"400":
|
||||
description: Bad Request
|
||||
schema:
|
||||
$ref: '#/definitions/rag-new_internal_schema.ResponseBody'
|
||||
$ref: "#/definitions/rag-new_internal_schema.ResponseBody"
|
||||
security:
|
||||
- ApiKeyAuth: []
|
||||
- ApiKeyAuth: []
|
||||
summary: 获取 Assistant 列表
|
||||
tags:
|
||||
- assistant
|
||||
- assistant
|
||||
post:
|
||||
consumes:
|
||||
- application/json
|
||||
- application/json
|
||||
description: get string by ID
|
||||
parameters:
|
||||
- description: Assistant
|
||||
in: body
|
||||
name: assistant
|
||||
required: true
|
||||
schema:
|
||||
$ref: '#/definitions/rag-new_internal_schema.AssistantCreateRequest'
|
||||
- description: Assistant
|
||||
in: body
|
||||
name: assistant
|
||||
required: true
|
||||
schema:
|
||||
$ref: "#/definitions/rag-new_internal_schema.AssistantCreateRequest"
|
||||
produces:
|
||||
- application/json
|
||||
- application/json
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
schema:
|
||||
allOf:
|
||||
- $ref: '#/definitions/rag-new_internal_schema.ResponseBody'
|
||||
- properties:
|
||||
data:
|
||||
$ref: '#/definitions/rag-new_internal_entity.Assistant'
|
||||
type: object
|
||||
- $ref: "#/definitions/rag-new_internal_schema.ResponseBody"
|
||||
- properties:
|
||||
data:
|
||||
$ref: "#/definitions/rag-new_internal_entity.Assistant"
|
||||
type: object
|
||||
"400":
|
||||
description: Bad Request
|
||||
schema:
|
||||
$ref: '#/definitions/rag-new_internal_schema.ResponseBody'
|
||||
$ref: "#/definitions/rag-new_internal_schema.ResponseBody"
|
||||
security:
|
||||
- ApiKeyAuth: []
|
||||
- ApiKeyAuth: []
|
||||
summary: 创建 Assistant
|
||||
tags:
|
||||
- assistant
|
||||
- assistant
|
||||
/api/v1/assistants/{id}:
|
||||
delete:
|
||||
consumes:
|
||||
- application/json
|
||||
- application/json
|
||||
description: get string by ID
|
||||
parameters:
|
||||
- description: Assistant ID
|
||||
in: path
|
||||
name: id
|
||||
required: true
|
||||
type: integer
|
||||
- description: Assistant ID
|
||||
in: path
|
||||
name: id
|
||||
required: true
|
||||
type: integer
|
||||
produces:
|
||||
- application/json
|
||||
- application/json
|
||||
responses:
|
||||
"204":
|
||||
description: No Content
|
||||
"404":
|
||||
description: Not Found
|
||||
schema:
|
||||
$ref: '#/definitions/rag-new_internal_schema.ResponseBody'
|
||||
$ref: "#/definitions/rag-new_internal_schema.ResponseBody"
|
||||
"500":
|
||||
description: Internal Server Error
|
||||
schema:
|
||||
$ref: '#/definitions/rag-new_internal_schema.ResponseBody'
|
||||
$ref: "#/definitions/rag-new_internal_schema.ResponseBody"
|
||||
security:
|
||||
- ApiKeyAuth: []
|
||||
- ApiKeyAuth: []
|
||||
summary: 删除 Assistant
|
||||
tags:
|
||||
- assistant
|
||||
- assistant
|
||||
/api/v1/assistants/{id}/tools:
|
||||
get:
|
||||
consumes:
|
||||
- application/json
|
||||
- application/json
|
||||
description: get string by ID
|
||||
parameters:
|
||||
- description: Assistant ID
|
||||
in: path
|
||||
name: id
|
||||
required: true
|
||||
type: integer
|
||||
- description: Assistant ID
|
||||
in: path
|
||||
name: id
|
||||
required: true
|
||||
type: integer
|
||||
produces:
|
||||
- application/json
|
||||
- application/json
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
schema:
|
||||
allOf:
|
||||
- $ref: '#/definitions/rag-new_internal_schema.ResponseBody'
|
||||
- properties:
|
||||
data:
|
||||
items:
|
||||
$ref: '#/definitions/rag-new_internal_entity.AssistantTool'
|
||||
type: array
|
||||
type: object
|
||||
- $ref: "#/definitions/rag-new_internal_schema.ResponseBody"
|
||||
- properties:
|
||||
data:
|
||||
items:
|
||||
$ref: "#/definitions/rag-new_internal_entity.AssistantTool"
|
||||
type: array
|
||||
type: object
|
||||
"500":
|
||||
description: Internal Server Error
|
||||
schema:
|
||||
$ref: '#/definitions/rag-new_internal_schema.ResponseBody'
|
||||
$ref: "#/definitions/rag-new_internal_schema.ResponseBody"
|
||||
security:
|
||||
- ApiKeyAuth: []
|
||||
- ApiKeyAuth: []
|
||||
summary: 获取 Assistant 所绑定的 Tool
|
||||
tags:
|
||||
- assistant
|
||||
- assistant
|
||||
/api/v1/assistants/{id}/tools/{tool_id}:
|
||||
delete:
|
||||
consumes:
|
||||
- application/json
|
||||
- application/json
|
||||
description: get string by ID
|
||||
parameters:
|
||||
- description: Assistant ID
|
||||
in: path
|
||||
name: id
|
||||
required: true
|
||||
type: integer
|
||||
- description: Tool ID
|
||||
in: path
|
||||
name: tool_id
|
||||
required: true
|
||||
type: integer
|
||||
- description: Assistant ID
|
||||
in: path
|
||||
name: id
|
||||
required: true
|
||||
type: integer
|
||||
- description: Tool ID
|
||||
in: path
|
||||
name: tool_id
|
||||
required: true
|
||||
type: integer
|
||||
produces:
|
||||
- application/json
|
||||
- application/json
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
schema:
|
||||
allOf:
|
||||
- $ref: '#/definitions/rag-new_internal_schema.ResponseBody'
|
||||
- properties:
|
||||
data:
|
||||
$ref: '#/definitions/rag-new_internal_entity.AssistantTool'
|
||||
type: object
|
||||
- $ref: "#/definitions/rag-new_internal_schema.ResponseBody"
|
||||
- properties:
|
||||
data:
|
||||
$ref: "#/definitions/rag-new_internal_entity.AssistantTool"
|
||||
type: object
|
||||
"500":
|
||||
description: Internal Server Error
|
||||
schema:
|
||||
$ref: '#/definitions/rag-new_internal_schema.ResponseBody'
|
||||
$ref: "#/definitions/rag-new_internal_schema.ResponseBody"
|
||||
security:
|
||||
- ApiKeyAuth: []
|
||||
- ApiKeyAuth: []
|
||||
summary: 解绑 Tool
|
||||
tags:
|
||||
- assistant
|
||||
- assistant
|
||||
post:
|
||||
consumes:
|
||||
- application/json
|
||||
- application/json
|
||||
description: get string by ID
|
||||
parameters:
|
||||
- description: Assistant ID
|
||||
in: path
|
||||
name: id
|
||||
required: true
|
||||
type: integer
|
||||
- description: Tool ID
|
||||
in: path
|
||||
name: tool_id
|
||||
required: true
|
||||
type: integer
|
||||
- description: Assistant ID
|
||||
in: path
|
||||
name: id
|
||||
required: true
|
||||
type: integer
|
||||
- description: Tool ID
|
||||
in: path
|
||||
name: tool_id
|
||||
required: true
|
||||
type: integer
|
||||
produces:
|
||||
- application/json
|
||||
- application/json
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
schema:
|
||||
allOf:
|
||||
- $ref: '#/definitions/rag-new_internal_schema.ResponseBody'
|
||||
- properties:
|
||||
data:
|
||||
$ref: '#/definitions/rag-new_internal_entity.AssistantTool'
|
||||
type: object
|
||||
- $ref: "#/definitions/rag-new_internal_schema.ResponseBody"
|
||||
- properties:
|
||||
data:
|
||||
$ref: "#/definitions/rag-new_internal_entity.AssistantTool"
|
||||
type: object
|
||||
"500":
|
||||
description: Internal Server Error
|
||||
schema:
|
||||
$ref: '#/definitions/rag-new_internal_schema.ResponseBody'
|
||||
$ref: "#/definitions/rag-new_internal_schema.ResponseBody"
|
||||
security:
|
||||
- ApiKeyAuth: []
|
||||
- ApiKeyAuth: []
|
||||
summary: 绑定 Tool
|
||||
tags:
|
||||
- assistant
|
||||
- assistant
|
||||
/api/v1/chats:
|
||||
get:
|
||||
consumes:
|
||||
- application/json
|
||||
- application/json
|
||||
description: get string by ID
|
||||
produces:
|
||||
- application/json
|
||||
- application/json
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
schema:
|
||||
allOf:
|
||||
- $ref: '#/definitions/rag-new_internal_schema.ResponseBody'
|
||||
- properties:
|
||||
data:
|
||||
items:
|
||||
$ref: '#/definitions/rag-new_internal_entity.Chat'
|
||||
type: array
|
||||
type: object
|
||||
- $ref: "#/definitions/rag-new_internal_schema.ResponseBody"
|
||||
- properties:
|
||||
data:
|
||||
items:
|
||||
$ref: "#/definitions/rag-new_internal_entity.Chat"
|
||||
type: array
|
||||
type: object
|
||||
"400":
|
||||
description: Bad Request
|
||||
schema:
|
||||
$ref: '#/definitions/rag-new_internal_schema.ResponseBody'
|
||||
$ref: "#/definitions/rag-new_internal_schema.ResponseBody"
|
||||
summary: 获取所有 Chat
|
||||
tags:
|
||||
- chat
|
||||
- chat
|
||||
post:
|
||||
consumes:
|
||||
- application/json
|
||||
- application/json
|
||||
description: get string by ID
|
||||
parameters:
|
||||
- description: Chat
|
||||
in: body
|
||||
name: chat
|
||||
required: true
|
||||
schema:
|
||||
$ref: '#/definitions/rag-new_internal_schema.ChatCreateRequest'
|
||||
- description: Chat
|
||||
in: body
|
||||
name: chat
|
||||
required: true
|
||||
schema:
|
||||
$ref: "#/definitions/rag-new_internal_schema.ChatCreateRequest"
|
||||
produces:
|
||||
- application/json
|
||||
- application/json
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
schema:
|
||||
allOf:
|
||||
- $ref: '#/definitions/rag-new_internal_schema.ResponseBody'
|
||||
- properties:
|
||||
data:
|
||||
$ref: '#/definitions/rag-new_internal_entity.Chat'
|
||||
type: object
|
||||
- $ref: "#/definitions/rag-new_internal_schema.ResponseBody"
|
||||
- properties:
|
||||
data:
|
||||
$ref: "#/definitions/rag-new_internal_entity.Chat"
|
||||
type: object
|
||||
"400":
|
||||
description: Bad Request
|
||||
schema:
|
||||
$ref: '#/definitions/rag-new_internal_schema.ResponseBody'
|
||||
$ref: "#/definitions/rag-new_internal_schema.ResponseBody"
|
||||
"500":
|
||||
description: Internal Server Error
|
||||
schema:
|
||||
$ref: '#/definitions/rag-new_internal_schema.ResponseBody'
|
||||
$ref: "#/definitions/rag-new_internal_schema.ResponseBody"
|
||||
summary: Create Chat
|
||||
tags:
|
||||
- chat
|
||||
- chat
|
||||
/api/v1/chats/{id}:
|
||||
delete:
|
||||
consumes:
|
||||
- application/json
|
||||
- application/json
|
||||
description: get string by ID
|
||||
parameters:
|
||||
- description: Chat ID
|
||||
in: path
|
||||
name: id
|
||||
required: true
|
||||
type: integer
|
||||
- description: Chat ID
|
||||
in: path
|
||||
name: id
|
||||
required: true
|
||||
type: integer
|
||||
produces:
|
||||
- application/json
|
||||
- application/json
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
schema:
|
||||
$ref: '#/definitions/rag-new_internal_schema.ResponseBody'
|
||||
$ref: "#/definitions/rag-new_internal_schema.ResponseBody"
|
||||
"400":
|
||||
description: Bad Request
|
||||
schema:
|
||||
$ref: '#/definitions/rag-new_internal_schema.ResponseBody'
|
||||
$ref: "#/definitions/rag-new_internal_schema.ResponseBody"
|
||||
"404":
|
||||
description: Not Found
|
||||
schema:
|
||||
$ref: '#/definitions/rag-new_internal_schema.ResponseBody'
|
||||
$ref: "#/definitions/rag-new_internal_schema.ResponseBody"
|
||||
"500":
|
||||
description: Internal Server Error
|
||||
schema:
|
||||
$ref: '#/definitions/rag-new_internal_schema.ResponseBody'
|
||||
$ref: "#/definitions/rag-new_internal_schema.ResponseBody"
|
||||
security:
|
||||
- ApiKeyAuth: []
|
||||
- ApiKeyAuth: []
|
||||
summary: Delete Chat
|
||||
tags:
|
||||
- chat
|
||||
- chat
|
||||
/api/v1/chats/{id}/messages:
|
||||
get:
|
||||
consumes:
|
||||
- application/json
|
||||
- application/json
|
||||
description: get string by ID
|
||||
parameters:
|
||||
- description: Chat ID
|
||||
in: path
|
||||
name: id
|
||||
required: true
|
||||
type: integer
|
||||
- description: Chat ID
|
||||
in: path
|
||||
name: id
|
||||
required: true
|
||||
type: integer
|
||||
produces:
|
||||
- application/json
|
||||
- application/json
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
schema:
|
||||
allOf:
|
||||
- $ref: '#/definitions/rag-new_internal_schema.ResponseBody'
|
||||
- properties:
|
||||
data:
|
||||
items:
|
||||
$ref: '#/definitions/rag-new_internal_entity.ChatMessage'
|
||||
type: array
|
||||
type: object
|
||||
- $ref: "#/definitions/rag-new_internal_schema.ResponseBody"
|
||||
- properties:
|
||||
data:
|
||||
items:
|
||||
$ref: "#/definitions/rag-new_internal_entity.ChatMessage"
|
||||
type: array
|
||||
type: object
|
||||
"400":
|
||||
description: Bad Request
|
||||
schema:
|
||||
$ref: '#/definitions/rag-new_internal_schema.ResponseBody'
|
||||
$ref: "#/definitions/rag-new_internal_schema.ResponseBody"
|
||||
"404":
|
||||
description: Not Found
|
||||
schema:
|
||||
$ref: '#/definitions/rag-new_internal_schema.ResponseBody'
|
||||
$ref: "#/definitions/rag-new_internal_schema.ResponseBody"
|
||||
"500":
|
||||
description: Internal Server Error
|
||||
schema:
|
||||
$ref: '#/definitions/rag-new_internal_schema.ResponseBody'
|
||||
$ref: "#/definitions/rag-new_internal_schema.ResponseBody"
|
||||
security:
|
||||
- ApiKeyAuth: []
|
||||
- ApiKeyAuth: []
|
||||
summary: 查看聊天记录
|
||||
tags:
|
||||
- chat_message
|
||||
- chat_message
|
||||
post:
|
||||
consumes:
|
||||
- application/json
|
||||
- application/json
|
||||
description: get string by ID
|
||||
parameters:
|
||||
- description: Chat ID
|
||||
in: path
|
||||
name: id
|
||||
required: true
|
||||
type: integer
|
||||
- description: Message
|
||||
in: body
|
||||
name: message
|
||||
required: true
|
||||
schema:
|
||||
$ref: '#/definitions/rag-new_internal_schema.ChatMessageAddRequest'
|
||||
- description: Chat ID
|
||||
in: path
|
||||
name: id
|
||||
required: true
|
||||
type: integer
|
||||
- description: Message
|
||||
in: body
|
||||
name: message
|
||||
required: true
|
||||
schema:
|
||||
$ref: "#/definitions/rag-new_internal_schema.ChatMessageAddRequest"
|
||||
produces:
|
||||
- application/json
|
||||
- application/json
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
schema:
|
||||
allOf:
|
||||
- $ref: '#/definitions/rag-new_internal_schema.ResponseBody'
|
||||
- properties:
|
||||
data:
|
||||
$ref: '#/definitions/rag-new_internal_schema.ChatMessageResponse'
|
||||
type: object
|
||||
- $ref: "#/definitions/rag-new_internal_schema.ResponseBody"
|
||||
- properties:
|
||||
data:
|
||||
$ref: "#/definitions/rag-new_internal_schema.ChatMessageResponse"
|
||||
type: object
|
||||
"400":
|
||||
description: Bad Request
|
||||
schema:
|
||||
$ref: '#/definitions/rag-new_internal_schema.ResponseBody'
|
||||
$ref: "#/definitions/rag-new_internal_schema.ResponseBody"
|
||||
"404":
|
||||
description: Not Found
|
||||
schema:
|
||||
$ref: '#/definitions/rag-new_internal_schema.ResponseBody'
|
||||
$ref: "#/definitions/rag-new_internal_schema.ResponseBody"
|
||||
"409":
|
||||
description: Conflict
|
||||
schema:
|
||||
allOf:
|
||||
- $ref: '#/definitions/rag-new_internal_schema.ResponseBody'
|
||||
- properties:
|
||||
data:
|
||||
$ref: '#/definitions/rag-new_internal_schema.ChatMessageResponse'
|
||||
type: object
|
||||
- $ref: "#/definitions/rag-new_internal_schema.ResponseBody"
|
||||
- properties:
|
||||
data:
|
||||
$ref: "#/definitions/rag-new_internal_schema.ChatMessageResponse"
|
||||
type: object
|
||||
"500":
|
||||
description: Internal Server Error
|
||||
schema:
|
||||
$ref: '#/definitions/rag-new_internal_schema.ResponseBody'
|
||||
$ref: "#/definitions/rag-new_internal_schema.ResponseBody"
|
||||
security:
|
||||
- ApiKeyAuth: []
|
||||
- ApiKeyAuth: []
|
||||
summary: 添加聊天记录
|
||||
tags:
|
||||
- chat_message
|
||||
- chat_message
|
||||
/api/v1/ping:
|
||||
get:
|
||||
consumes:
|
||||
- application/json
|
||||
- application/json
|
||||
description: get string by ID
|
||||
produces:
|
||||
- application/json
|
||||
- application/json
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
schema:
|
||||
allOf:
|
||||
- $ref: '#/definitions/rag-new_internal_schema.ResponseBody'
|
||||
- properties:
|
||||
data:
|
||||
$ref: '#/definitions/rag-new_internal_schema.CurrentUserResponse'
|
||||
type: object
|
||||
- $ref: "#/definitions/rag-new_internal_schema.ResponseBody"
|
||||
- properties:
|
||||
data:
|
||||
$ref: "#/definitions/rag-new_internal_schema.CurrentUserResponse"
|
||||
type: object
|
||||
"400":
|
||||
description: Bad Request
|
||||
schema:
|
||||
$ref: '#/definitions/rag-new_internal_schema.ResponseBody'
|
||||
$ref: "#/definitions/rag-new_internal_schema.ResponseBody"
|
||||
security:
|
||||
- ApiKeyAuth: []
|
||||
- ApiKeyAuth: []
|
||||
summary: Greet
|
||||
tags:
|
||||
- ping
|
||||
- ping
|
||||
/api/v1/stream/{stream_id}:
|
||||
get:
|
||||
consumes:
|
||||
- application/json
|
||||
- application/json
|
||||
description: get string by ID
|
||||
parameters:
|
||||
- description: Chat ID
|
||||
in: path
|
||||
name: id
|
||||
required: true
|
||||
type: integer
|
||||
- description: Chat stream id
|
||||
in: path
|
||||
name: stream_id
|
||||
required: true
|
||||
type: string
|
||||
- description: Chat ID
|
||||
in: path
|
||||
name: id
|
||||
required: true
|
||||
type: integer
|
||||
- description: Chat stream id
|
||||
in: path
|
||||
name: stream_id
|
||||
required: true
|
||||
type: string
|
||||
produces:
|
||||
- application/json
|
||||
- application/json
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
schema:
|
||||
allOf:
|
||||
- $ref: '#/definitions/rag-new_internal_schema.ResponseBody'
|
||||
- properties:
|
||||
data:
|
||||
$ref: '#/definitions/rag-new_internal_schema.ChatMessageResponse'
|
||||
type: object
|
||||
- $ref: "#/definitions/rag-new_internal_schema.ResponseBody"
|
||||
- properties:
|
||||
data:
|
||||
$ref: "#/definitions/rag-new_internal_schema.ChatMessageResponse"
|
||||
type: object
|
||||
"400":
|
||||
description: Bad Request
|
||||
schema:
|
||||
$ref: '#/definitions/rag-new_internal_schema.ResponseBody'
|
||||
$ref: "#/definitions/rag-new_internal_schema.ResponseBody"
|
||||
"404":
|
||||
description: Not Found
|
||||
schema:
|
||||
$ref: '#/definitions/rag-new_internal_schema.ResponseBody'
|
||||
$ref: "#/definitions/rag-new_internal_schema.ResponseBody"
|
||||
"409":
|
||||
description: Conflict
|
||||
schema:
|
||||
allOf:
|
||||
- $ref: '#/definitions/rag-new_internal_schema.ResponseBody'
|
||||
- properties:
|
||||
data:
|
||||
$ref: '#/definitions/rag-new_internal_schema.ChatMessageResponse'
|
||||
type: object
|
||||
- $ref: "#/definitions/rag-new_internal_schema.ResponseBody"
|
||||
- properties:
|
||||
data:
|
||||
$ref: "#/definitions/rag-new_internal_schema.ChatMessageResponse"
|
||||
type: object
|
||||
"500":
|
||||
description: Internal Server Error
|
||||
schema:
|
||||
$ref: '#/definitions/rag-new_internal_schema.ResponseBody'
|
||||
$ref: "#/definitions/rag-new_internal_schema.ResponseBody"
|
||||
security:
|
||||
- none: []
|
||||
- none: []
|
||||
summary: 流式传输聊天内容
|
||||
tags:
|
||||
- chat_message
|
||||
- chat_message
|
||||
/api/v1/tools:
|
||||
get:
|
||||
consumes:
|
||||
- application/json
|
||||
- application/json
|
||||
description: List tools
|
||||
produces:
|
||||
- application/json
|
||||
- application/json
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
schema:
|
||||
allOf:
|
||||
- $ref: '#/definitions/rag-new_internal_schema.ResponseBody'
|
||||
- properties:
|
||||
data:
|
||||
$ref: '#/definitions/rag-new_internal_schema.CurrentUserResponse'
|
||||
type: object
|
||||
- $ref: "#/definitions/rag-new_internal_schema.ResponseBody"
|
||||
- properties:
|
||||
data:
|
||||
$ref: "#/definitions/rag-new_internal_schema.CurrentUserResponse"
|
||||
type: object
|
||||
"400":
|
||||
description: Bad Request
|
||||
schema:
|
||||
$ref: '#/definitions/rag-new_internal_schema.ResponseBody'
|
||||
$ref: "#/definitions/rag-new_internal_schema.ResponseBody"
|
||||
security:
|
||||
- ApiKeyAuth: []
|
||||
- ApiKeyAuth: []
|
||||
summary: List Tool
|
||||
tags:
|
||||
- tool
|
||||
- tool
|
||||
post:
|
||||
consumes:
|
||||
- application/json
|
||||
- application/json
|
||||
description: Create tool
|
||||
parameters:
|
||||
- description: Tool
|
||||
in: body
|
||||
name: tool
|
||||
required: true
|
||||
schema:
|
||||
$ref: '#/definitions/rag-new_internal_schema.ToolCreateRequest'
|
||||
- description: Tool
|
||||
in: body
|
||||
name: tool
|
||||
required: true
|
||||
schema:
|
||||
$ref: "#/definitions/rag-new_internal_schema.ToolCreateRequest"
|
||||
produces:
|
||||
- application/json
|
||||
- application/json
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
schema:
|
||||
allOf:
|
||||
- $ref: '#/definitions/rag-new_internal_schema.ResponseBody'
|
||||
- properties:
|
||||
data:
|
||||
items:
|
||||
$ref: '#/definitions/rag-new_internal_entity.Tool'
|
||||
type: array
|
||||
type: object
|
||||
- $ref: "#/definitions/rag-new_internal_schema.ResponseBody"
|
||||
- properties:
|
||||
data:
|
||||
items:
|
||||
$ref: "#/definitions/rag-new_internal_entity.Tool"
|
||||
type: array
|
||||
type: object
|
||||
"400":
|
||||
description: Bad Request
|
||||
schema:
|
||||
$ref: '#/definitions/rag-new_internal_schema.ResponseBody'
|
||||
$ref: "#/definitions/rag-new_internal_schema.ResponseBody"
|
||||
security:
|
||||
- ApiKeyAuth: []
|
||||
- ApiKeyAuth: []
|
||||
summary: Create Tool
|
||||
tags:
|
||||
- tool
|
||||
- tool
|
||||
/api/v1/tools/{id}:
|
||||
delete:
|
||||
consumes:
|
||||
- application/json
|
||||
- application/json
|
||||
description: DeleteTool
|
||||
parameters:
|
||||
- description: Tool ID
|
||||
in: path
|
||||
name: id
|
||||
required: true
|
||||
type: string
|
||||
- description: Tool ID
|
||||
in: path
|
||||
name: id
|
||||
required: true
|
||||
type: string
|
||||
produces:
|
||||
- application/json
|
||||
- application/json
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
"400":
|
||||
description: Bad Request
|
||||
schema:
|
||||
$ref: '#/definitions/rag-new_internal_schema.ResponseBody'
|
||||
$ref: "#/definitions/rag-new_internal_schema.ResponseBody"
|
||||
"404":
|
||||
description: Not Found
|
||||
schema:
|
||||
$ref: '#/definitions/rag-new_internal_schema.ResponseBody'
|
||||
$ref: "#/definitions/rag-new_internal_schema.ResponseBody"
|
||||
security:
|
||||
- ApiKeyAuth: []
|
||||
- ApiKeyAuth: []
|
||||
summary: DeleteTool
|
||||
tags:
|
||||
- tool
|
||||
- tool
|
||||
get:
|
||||
consumes:
|
||||
- application/json
|
||||
- application/json
|
||||
description: Get tool
|
||||
parameters:
|
||||
- description: Tool ID
|
||||
in: path
|
||||
name: id
|
||||
required: true
|
||||
type: string
|
||||
- description: Tool ID
|
||||
in: path
|
||||
name: id
|
||||
required: true
|
||||
type: string
|
||||
produces:
|
||||
- application/json
|
||||
- application/json
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
schema:
|
||||
allOf:
|
||||
- $ref: '#/definitions/rag-new_internal_schema.ResponseBody'
|
||||
- properties:
|
||||
data:
|
||||
$ref: '#/definitions/rag-new_internal_entity.Tool'
|
||||
type: object
|
||||
- $ref: "#/definitions/rag-new_internal_schema.ResponseBody"
|
||||
- properties:
|
||||
data:
|
||||
$ref: "#/definitions/rag-new_internal_entity.Tool"
|
||||
type: object
|
||||
"400":
|
||||
description: Bad Request
|
||||
schema:
|
||||
$ref: '#/definitions/rag-new_internal_schema.ResponseBody'
|
||||
$ref: "#/definitions/rag-new_internal_schema.ResponseBody"
|
||||
"404":
|
||||
description: Not Found
|
||||
schema:
|
||||
$ref: '#/definitions/rag-new_internal_schema.ResponseBody'
|
||||
$ref: "#/definitions/rag-new_internal_schema.ResponseBody"
|
||||
security:
|
||||
- ApiKeyAuth: []
|
||||
- ApiKeyAuth: []
|
||||
summary: Get Tool
|
||||
tags:
|
||||
- tool
|
||||
- tool
|
||||
securityDefinitions:
|
||||
ApiKeyAuth:
|
||||
in: header
|
||||
|
12
index.html
12
index.html
@ -1,16 +1,14 @@
|
||||
<!DOCTYPE html>
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<link rel="icon" href="/favicon.ico" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Welcome to Vuetify 3</title>
|
||||
</head>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
<script type="module" src="/src/main.ts"></script>
|
||||
</body>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
@ -24,6 +24,7 @@
|
||||
"@vitejs/plugin-vue": "^5.0.5",
|
||||
"@vue/eslint-config-typescript": "^13.0.0",
|
||||
"eslint": "^8.57.0",
|
||||
"eslint-config-prettier": "^9.1.0",
|
||||
"eslint-config-standard": "^17.1.0",
|
||||
"eslint-config-vuetify": "^1.0.0",
|
||||
"eslint-plugin-import": "^2.29.1",
|
||||
@ -32,6 +33,7 @@
|
||||
"eslint-plugin-promise": "^6.4.0",
|
||||
"eslint-plugin-vue": "^9.27.0",
|
||||
"pinia": "^2.1.7",
|
||||
"prettier": "^3.3.3",
|
||||
"sass": "1.77.6",
|
||||
"typescript": "^5.4.2",
|
||||
"unplugin-auto-import": "^0.17.6",
|
||||
|
@ -7,5 +7,5 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
//
|
||||
//
|
||||
</script>
|
||||
|
4544
src/api/api.ts
4544
src/api/api.ts
File diff suppressed because it is too large
Load Diff
@ -5,19 +5,18 @@
|
||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0
|
||||
*
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
import type { Configuration } from './configuration';
|
||||
import type { Configuration } from "./configuration";
|
||||
// Some imports not used depending on template conditions
|
||||
// @ts-ignore
|
||||
import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios';
|
||||
import globalAxios from 'axios';
|
||||
import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from "axios";
|
||||
import globalAxios from "axios";
|
||||
|
||||
export const BASE_PATH = "http://localhost".replace(/\/+$/, "");
|
||||
|
||||
@ -26,10 +25,10 @@ export const BASE_PATH = "http://localhost".replace(/\/+$/, "");
|
||||
* @export
|
||||
*/
|
||||
export const COLLECTION_FORMATS = {
|
||||
csv: ",",
|
||||
ssv: " ",
|
||||
tsv: "\t",
|
||||
pipes: "|",
|
||||
csv: ",",
|
||||
ssv: " ",
|
||||
tsv: "\t",
|
||||
pipes: "|",
|
||||
};
|
||||
|
||||
/**
|
||||
@ -38,8 +37,8 @@ export const COLLECTION_FORMATS = {
|
||||
* @interface RequestArgs
|
||||
*/
|
||||
export interface RequestArgs {
|
||||
url: string;
|
||||
options: RawAxiosRequestConfig;
|
||||
url: string;
|
||||
options: RawAxiosRequestConfig;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -48,15 +47,19 @@ export interface RequestArgs {
|
||||
* @class BaseAPI
|
||||
*/
|
||||
export class BaseAPI {
|
||||
protected configuration: Configuration | undefined;
|
||||
protected configuration: Configuration | undefined;
|
||||
|
||||
constructor(configuration?: Configuration, protected basePath: string = BASE_PATH, protected axios: AxiosInstance = globalAxios) {
|
||||
if (configuration) {
|
||||
this.configuration = configuration;
|
||||
this.basePath = configuration.basePath ?? basePath;
|
||||
}
|
||||
constructor(
|
||||
configuration?: Configuration,
|
||||
protected basePath: string = BASE_PATH,
|
||||
protected axios: AxiosInstance = globalAxios,
|
||||
) {
|
||||
if (configuration) {
|
||||
this.configuration = configuration;
|
||||
this.basePath = configuration.basePath ?? basePath;
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
@ -65,22 +68,24 @@ export class BaseAPI {
|
||||
* @extends {Error}
|
||||
*/
|
||||
export class RequiredError extends Error {
|
||||
constructor(public field: string, msg?: string) {
|
||||
super(msg);
|
||||
this.name = "RequiredError"
|
||||
}
|
||||
constructor(
|
||||
public field: string,
|
||||
msg?: string,
|
||||
) {
|
||||
super(msg);
|
||||
this.name = "RequiredError";
|
||||
}
|
||||
}
|
||||
|
||||
interface ServerMap {
|
||||
[key: string]: {
|
||||
url: string,
|
||||
description: string,
|
||||
}[];
|
||||
[key: string]: {
|
||||
url: string;
|
||||
description: string;
|
||||
}[];
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
*/
|
||||
export const operationServerMap: ServerMap = {
|
||||
}
|
||||
export const operationServerMap: ServerMap = {};
|
||||
|
@ -5,105 +5,139 @@
|
||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0
|
||||
*
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
import type { Configuration } from "./configuration";
|
||||
import type { RequestArgs } from "./base";
|
||||
import type { AxiosInstance, AxiosResponse } from 'axios';
|
||||
import type { AxiosInstance, AxiosResponse } from "axios";
|
||||
import { RequiredError } from "./base";
|
||||
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
*/
|
||||
export const DUMMY_BASE_URL = 'https://example.com'
|
||||
export const DUMMY_BASE_URL = "https://example.com";
|
||||
|
||||
/**
|
||||
*
|
||||
* @throws {RequiredError}
|
||||
* @export
|
||||
*/
|
||||
export const assertParamExists = function (functionName: string, paramName: string, paramValue: unknown) {
|
||||
if (paramValue === null || paramValue === undefined) {
|
||||
throw new RequiredError(paramName, `Required parameter ${paramName} was null or undefined when calling ${functionName}.`);
|
||||
}
|
||||
}
|
||||
export const assertParamExists = function (
|
||||
functionName: string,
|
||||
paramName: string,
|
||||
paramValue: unknown,
|
||||
) {
|
||||
if (paramValue === null || paramValue === undefined) {
|
||||
throw new RequiredError(
|
||||
paramName,
|
||||
`Required parameter ${paramName} was null or undefined when calling ${functionName}.`,
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
*/
|
||||
export const setApiKeyToObject = async function (object: any, keyParamName: string, configuration?: Configuration) {
|
||||
if (configuration && configuration.apiKey) {
|
||||
const localVarApiKeyValue = typeof configuration.apiKey === 'function'
|
||||
? await configuration.apiKey(keyParamName)
|
||||
: await configuration.apiKey;
|
||||
object[keyParamName] = localVarApiKeyValue;
|
||||
}
|
||||
}
|
||||
export const setApiKeyToObject = async function (
|
||||
object: any,
|
||||
keyParamName: string,
|
||||
configuration?: Configuration,
|
||||
) {
|
||||
if (configuration && configuration.apiKey) {
|
||||
const localVarApiKeyValue =
|
||||
typeof configuration.apiKey === "function"
|
||||
? await configuration.apiKey(keyParamName)
|
||||
: await configuration.apiKey;
|
||||
object[keyParamName] = localVarApiKeyValue;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
*/
|
||||
export const setBasicAuthToObject = function (object: any, configuration?: Configuration) {
|
||||
if (configuration && (configuration.username || configuration.password)) {
|
||||
object["auth"] = { username: configuration.username, password: configuration.password };
|
||||
}
|
||||
}
|
||||
export const setBasicAuthToObject = function (
|
||||
object: any,
|
||||
configuration?: Configuration,
|
||||
) {
|
||||
if (configuration && (configuration.username || configuration.password)) {
|
||||
object["auth"] = {
|
||||
username: configuration.username,
|
||||
password: configuration.password,
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
*/
|
||||
export const setBearerAuthToObject = async function (object: any, configuration?: Configuration) {
|
||||
if (configuration && configuration.accessToken) {
|
||||
const accessToken = typeof configuration.accessToken === 'function'
|
||||
? await configuration.accessToken()
|
||||
: await configuration.accessToken;
|
||||
object["Authorization"] = "Bearer " + accessToken;
|
||||
}
|
||||
}
|
||||
export const setBearerAuthToObject = async function (
|
||||
object: any,
|
||||
configuration?: Configuration,
|
||||
) {
|
||||
if (configuration && configuration.accessToken) {
|
||||
const accessToken =
|
||||
typeof configuration.accessToken === "function"
|
||||
? await configuration.accessToken()
|
||||
: await configuration.accessToken;
|
||||
object["Authorization"] = "Bearer " + accessToken;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
*/
|
||||
export const setOAuthToObject = async function (object: any, name: string, scopes: string[], configuration?: Configuration) {
|
||||
if (configuration && configuration.accessToken) {
|
||||
const localVarAccessTokenValue = typeof configuration.accessToken === 'function'
|
||||
? await configuration.accessToken(name, scopes)
|
||||
: await configuration.accessToken;
|
||||
object["Authorization"] = "Bearer " + localVarAccessTokenValue;
|
||||
}
|
||||
}
|
||||
export const setOAuthToObject = async function (
|
||||
object: any,
|
||||
name: string,
|
||||
scopes: string[],
|
||||
configuration?: Configuration,
|
||||
) {
|
||||
if (configuration && configuration.accessToken) {
|
||||
const localVarAccessTokenValue =
|
||||
typeof configuration.accessToken === "function"
|
||||
? await configuration.accessToken(name, scopes)
|
||||
: await configuration.accessToken;
|
||||
object["Authorization"] = "Bearer " + localVarAccessTokenValue;
|
||||
}
|
||||
};
|
||||
|
||||
function setFlattenedQueryParams(urlSearchParams: URLSearchParams, parameter: any, key: string = ""): void {
|
||||
if (parameter == null) return;
|
||||
if (typeof parameter === "object") {
|
||||
if (Array.isArray(parameter)) {
|
||||
(parameter as any[]).forEach(item => setFlattenedQueryParams(urlSearchParams, item, key));
|
||||
}
|
||||
else {
|
||||
Object.keys(parameter).forEach(currentKey =>
|
||||
setFlattenedQueryParams(urlSearchParams, parameter[currentKey], `${key}${key !== '' ? '.' : ''}${currentKey}`)
|
||||
);
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (urlSearchParams.has(key)) {
|
||||
urlSearchParams.append(key, parameter);
|
||||
}
|
||||
else {
|
||||
urlSearchParams.set(key, parameter);
|
||||
}
|
||||
function setFlattenedQueryParams(
|
||||
urlSearchParams: URLSearchParams,
|
||||
parameter: any,
|
||||
key: string = "",
|
||||
): void {
|
||||
if (parameter == null) return;
|
||||
if (typeof parameter === "object") {
|
||||
if (Array.isArray(parameter)) {
|
||||
(parameter as any[]).forEach((item) =>
|
||||
setFlattenedQueryParams(urlSearchParams, item, key),
|
||||
);
|
||||
} else {
|
||||
Object.keys(parameter).forEach((currentKey) =>
|
||||
setFlattenedQueryParams(
|
||||
urlSearchParams,
|
||||
parameter[currentKey],
|
||||
`${key}${key !== "" ? "." : ""}${currentKey}`,
|
||||
),
|
||||
);
|
||||
}
|
||||
} else {
|
||||
if (urlSearchParams.has(key)) {
|
||||
urlSearchParams.append(key, parameter);
|
||||
} else {
|
||||
urlSearchParams.set(key, parameter);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@ -111,40 +145,58 @@ function setFlattenedQueryParams(urlSearchParams: URLSearchParams, parameter: an
|
||||
* @export
|
||||
*/
|
||||
export const setSearchParams = function (url: URL, ...objects: any[]) {
|
||||
const searchParams = new URLSearchParams(url.search);
|
||||
setFlattenedQueryParams(searchParams, objects);
|
||||
url.search = searchParams.toString();
|
||||
}
|
||||
const searchParams = new URLSearchParams(url.search);
|
||||
setFlattenedQueryParams(searchParams, objects);
|
||||
url.search = searchParams.toString();
|
||||
};
|
||||
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
*/
|
||||
export const serializeDataIfNeeded = function (value: any, requestOptions: any, configuration?: Configuration) {
|
||||
const nonString = typeof value !== 'string';
|
||||
const needsSerialization = nonString && configuration && configuration.isJsonMime
|
||||
? configuration.isJsonMime(requestOptions.headers['Content-Type'])
|
||||
: nonString;
|
||||
return needsSerialization
|
||||
? JSON.stringify(value !== undefined ? value : {})
|
||||
: (value || "");
|
||||
}
|
||||
export const serializeDataIfNeeded = function (
|
||||
value: any,
|
||||
requestOptions: any,
|
||||
configuration?: Configuration,
|
||||
) {
|
||||
const nonString = typeof value !== "string";
|
||||
const needsSerialization =
|
||||
nonString && configuration && configuration.isJsonMime
|
||||
? configuration.isJsonMime(requestOptions.headers["Content-Type"])
|
||||
: nonString;
|
||||
return needsSerialization
|
||||
? JSON.stringify(value !== undefined ? value : {})
|
||||
: value || "";
|
||||
};
|
||||
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
*/
|
||||
export const toPathString = function (url: URL) {
|
||||
return url.pathname + url.search + url.hash
|
||||
}
|
||||
return url.pathname + url.search + url.hash;
|
||||
};
|
||||
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
*/
|
||||
export const createRequestFunction = function (axiosArgs: RequestArgs, globalAxios: AxiosInstance, BASE_PATH: string, configuration?: Configuration) {
|
||||
return <T = unknown, R = AxiosResponse<T>>(axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
|
||||
const axiosRequestArgs = {...axiosArgs.options, url: (axios.defaults.baseURL ? '' : configuration?.basePath ?? basePath) + axiosArgs.url};
|
||||
return axios.request<T, R>(axiosRequestArgs);
|
||||
export const createRequestFunction = function (
|
||||
axiosArgs: RequestArgs,
|
||||
globalAxios: AxiosInstance,
|
||||
BASE_PATH: string,
|
||||
configuration?: Configuration,
|
||||
) {
|
||||
return <T = unknown, R = AxiosResponse<T>>(
|
||||
axios: AxiosInstance = globalAxios,
|
||||
basePath: string = BASE_PATH,
|
||||
) => {
|
||||
const axiosRequestArgs = {
|
||||
...axiosArgs.options,
|
||||
url:
|
||||
(axios.defaults.baseURL ? "" : (configuration?.basePath ?? basePath)) +
|
||||
axiosArgs.url,
|
||||
};
|
||||
}
|
||||
return axios.request<T, R>(axiosRequestArgs);
|
||||
};
|
||||
};
|
||||
|
@ -5,106 +5,128 @@
|
||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0
|
||||
*
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
export interface ConfigurationParameters {
|
||||
apiKey?: string | Promise<string> | ((name: string) => string) | ((name: string) => Promise<string>);
|
||||
username?: string;
|
||||
password?: string;
|
||||
accessToken?: string | Promise<string> | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise<string>);
|
||||
basePath?: string;
|
||||
serverIndex?: number;
|
||||
baseOptions?: any;
|
||||
formDataCtor?: new () => any;
|
||||
apiKey?:
|
||||
| string
|
||||
| Promise<string>
|
||||
| ((name: string) => string)
|
||||
| ((name: string) => Promise<string>);
|
||||
username?: string;
|
||||
password?: string;
|
||||
accessToken?:
|
||||
| string
|
||||
| Promise<string>
|
||||
| ((name?: string, scopes?: string[]) => string)
|
||||
| ((name?: string, scopes?: string[]) => Promise<string>);
|
||||
basePath?: string;
|
||||
serverIndex?: number;
|
||||
baseOptions?: any;
|
||||
formDataCtor?: new () => any;
|
||||
}
|
||||
|
||||
export class Configuration {
|
||||
/**
|
||||
* parameter for apiKey security
|
||||
* @param name security name
|
||||
* @memberof Configuration
|
||||
*/
|
||||
apiKey?: string | Promise<string> | ((name: string) => string) | ((name: string) => Promise<string>);
|
||||
/**
|
||||
* parameter for basic security
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof Configuration
|
||||
*/
|
||||
username?: string;
|
||||
/**
|
||||
* parameter for basic security
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof Configuration
|
||||
*/
|
||||
password?: string;
|
||||
/**
|
||||
* parameter for oauth2 security
|
||||
* @param name security name
|
||||
* @param scopes oauth2 scope
|
||||
* @memberof Configuration
|
||||
*/
|
||||
accessToken?: string | Promise<string> | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise<string>);
|
||||
/**
|
||||
* override base path
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof Configuration
|
||||
*/
|
||||
basePath?: string;
|
||||
/**
|
||||
* override server index
|
||||
*
|
||||
* @type {number}
|
||||
* @memberof Configuration
|
||||
*/
|
||||
serverIndex?: number;
|
||||
/**
|
||||
* base options for axios calls
|
||||
*
|
||||
* @type {any}
|
||||
* @memberof Configuration
|
||||
*/
|
||||
baseOptions?: any;
|
||||
/**
|
||||
* The FormData constructor that will be used to create multipart form data
|
||||
* requests. You can inject this here so that execution environments that
|
||||
* do not support the FormData class can still run the generated client.
|
||||
*
|
||||
* @type {new () => FormData}
|
||||
*/
|
||||
formDataCtor?: new () => any;
|
||||
/**
|
||||
* parameter for apiKey security
|
||||
* @param name security name
|
||||
* @memberof Configuration
|
||||
*/
|
||||
apiKey?:
|
||||
| string
|
||||
| Promise<string>
|
||||
| ((name: string) => string)
|
||||
| ((name: string) => Promise<string>);
|
||||
/**
|
||||
* parameter for basic security
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof Configuration
|
||||
*/
|
||||
username?: string;
|
||||
/**
|
||||
* parameter for basic security
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof Configuration
|
||||
*/
|
||||
password?: string;
|
||||
/**
|
||||
* parameter for oauth2 security
|
||||
* @param name security name
|
||||
* @param scopes oauth2 scope
|
||||
* @memberof Configuration
|
||||
*/
|
||||
accessToken?:
|
||||
| string
|
||||
| Promise<string>
|
||||
| ((name?: string, scopes?: string[]) => string)
|
||||
| ((name?: string, scopes?: string[]) => Promise<string>);
|
||||
/**
|
||||
* override base path
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof Configuration
|
||||
*/
|
||||
basePath?: string;
|
||||
/**
|
||||
* override server index
|
||||
*
|
||||
* @type {number}
|
||||
* @memberof Configuration
|
||||
*/
|
||||
serverIndex?: number;
|
||||
/**
|
||||
* base options for axios calls
|
||||
*
|
||||
* @type {any}
|
||||
* @memberof Configuration
|
||||
*/
|
||||
baseOptions?: any;
|
||||
/**
|
||||
* The FormData constructor that will be used to create multipart form data
|
||||
* requests. You can inject this here so that execution environments that
|
||||
* do not support the FormData class can still run the generated client.
|
||||
*
|
||||
* @type {new () => FormData}
|
||||
*/
|
||||
formDataCtor?: new () => any;
|
||||
|
||||
constructor(param: ConfigurationParameters = {}) {
|
||||
this.apiKey = param.apiKey;
|
||||
this.username = param.username;
|
||||
this.password = param.password;
|
||||
this.accessToken = param.accessToken;
|
||||
this.basePath = param.basePath;
|
||||
this.serverIndex = param.serverIndex;
|
||||
this.baseOptions = param.baseOptions;
|
||||
this.formDataCtor = param.formDataCtor;
|
||||
}
|
||||
constructor(param: ConfigurationParameters = {}) {
|
||||
this.apiKey = param.apiKey;
|
||||
this.username = param.username;
|
||||
this.password = param.password;
|
||||
this.accessToken = param.accessToken;
|
||||
this.basePath = param.basePath;
|
||||
this.serverIndex = param.serverIndex;
|
||||
this.baseOptions = param.baseOptions;
|
||||
this.formDataCtor = param.formDataCtor;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if the given MIME is a JSON MIME.
|
||||
* JSON MIME examples:
|
||||
* application/json
|
||||
* application/json; charset=UTF8
|
||||
* APPLICATION/JSON
|
||||
* application/vnd.company+json
|
||||
* @param mime - MIME (Multipurpose Internet Mail Extensions)
|
||||
* @return True if the given MIME is JSON, false otherwise.
|
||||
*/
|
||||
public isJsonMime(mime: string): boolean {
|
||||
const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i');
|
||||
return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json');
|
||||
}
|
||||
/**
|
||||
* Check if the given MIME is a JSON MIME.
|
||||
* JSON MIME examples:
|
||||
* application/json
|
||||
* application/json; charset=UTF8
|
||||
* APPLICATION/JSON
|
||||
* application/vnd.company+json
|
||||
* @param mime - MIME (Multipurpose Internet Mail Extensions)
|
||||
* @return True if the given MIME is JSON, false otherwise.
|
||||
*/
|
||||
public isJsonMime(mime: string): boolean {
|
||||
const jsonMime: RegExp = new RegExp(
|
||||
"^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$",
|
||||
"i",
|
||||
);
|
||||
return (
|
||||
mime !== null &&
|
||||
(jsonMime.test(mime) ||
|
||||
mime.toLowerCase() === "application/json-patch+json")
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -5,14 +5,12 @@
|
||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0
|
||||
*
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
export * from "./api";
|
||||
export * from "./configuration";
|
||||
|
||||
|
424
src/auto-imports.d.ts
vendored
424
src/auto-imports.d.ts
vendored
@ -5,187 +5,271 @@
|
||||
// Generated by unplugin-auto-import
|
||||
export {}
|
||||
declare global {
|
||||
const EffectScope: typeof import('vue')['EffectScope']
|
||||
const computed: typeof import('vue')['computed']
|
||||
const createApp: typeof import('vue')['createApp']
|
||||
const customRef: typeof import('vue')['customRef']
|
||||
const defineAsyncComponent: typeof import('vue')['defineAsyncComponent']
|
||||
const defineComponent: typeof import('vue')['defineComponent']
|
||||
const effectScope: typeof import('vue')['effectScope']
|
||||
const getCurrentInstance: typeof import('vue')['getCurrentInstance']
|
||||
const getCurrentScope: typeof import('vue')['getCurrentScope']
|
||||
const h: typeof import('vue')['h']
|
||||
const inject: typeof import('vue')['inject']
|
||||
const isProxy: typeof import('vue')['isProxy']
|
||||
const isReactive: typeof import('vue')['isReactive']
|
||||
const isReadonly: typeof import('vue')['isReadonly']
|
||||
const isRef: typeof import('vue')['isRef']
|
||||
const markRaw: typeof import('vue')['markRaw']
|
||||
const nextTick: typeof import('vue')['nextTick']
|
||||
const onActivated: typeof import('vue')['onActivated']
|
||||
const onBeforeMount: typeof import('vue')['onBeforeMount']
|
||||
const onBeforeRouteLeave: typeof import('vue-router')['onBeforeRouteLeave']
|
||||
const onBeforeRouteUpdate: typeof import('vue-router')['onBeforeRouteUpdate']
|
||||
const onBeforeUnmount: typeof import('vue')['onBeforeUnmount']
|
||||
const onBeforeUpdate: typeof import('vue')['onBeforeUpdate']
|
||||
const onDeactivated: typeof import('vue')['onDeactivated']
|
||||
const onErrorCaptured: typeof import('vue')['onErrorCaptured']
|
||||
const onMounted: typeof import('vue')['onMounted']
|
||||
const onRenderTracked: typeof import('vue')['onRenderTracked']
|
||||
const onRenderTriggered: typeof import('vue')['onRenderTriggered']
|
||||
const onScopeDispose: typeof import('vue')['onScopeDispose']
|
||||
const onServerPrefetch: typeof import('vue')['onServerPrefetch']
|
||||
const onUnmounted: typeof import('vue')['onUnmounted']
|
||||
const onUpdated: typeof import('vue')['onUpdated']
|
||||
const provide: typeof import('vue')['provide']
|
||||
const reactive: typeof import('vue')['reactive']
|
||||
const readonly: typeof import('vue')['readonly']
|
||||
const ref: typeof import('vue')['ref']
|
||||
const resolveComponent: typeof import('vue')['resolveComponent']
|
||||
const shallowReactive: typeof import('vue')['shallowReactive']
|
||||
const shallowReadonly: typeof import('vue')['shallowReadonly']
|
||||
const shallowRef: typeof import('vue')['shallowRef']
|
||||
const toRaw: typeof import('vue')['toRaw']
|
||||
const toRef: typeof import('vue')['toRef']
|
||||
const toRefs: typeof import('vue')['toRefs']
|
||||
const toValue: typeof import('vue')['toValue']
|
||||
const triggerRef: typeof import('vue')['triggerRef']
|
||||
const unref: typeof import('vue')['unref']
|
||||
const useAttrs: typeof import('vue')['useAttrs']
|
||||
const useCssModule: typeof import('vue')['useCssModule']
|
||||
const useCssVars: typeof import('vue')['useCssVars']
|
||||
const useLink: typeof import('vue-router')['useLink']
|
||||
const useRoute: typeof import('vue-router/auto')['useRoute']
|
||||
const useRouter: typeof import('vue-router/auto')['useRouter']
|
||||
const useSlots: typeof import('vue')['useSlots']
|
||||
const watch: typeof import('vue')['watch']
|
||||
const watchEffect: typeof import('vue')['watchEffect']
|
||||
const watchPostEffect: typeof import('vue')['watchPostEffect']
|
||||
const watchSyncEffect: typeof import('vue')['watchSyncEffect']
|
||||
const EffectScope: (typeof import("vue"))["EffectScope"];
|
||||
const computed: (typeof import("vue"))["computed"];
|
||||
const createApp: (typeof import("vue"))["createApp"];
|
||||
const customRef: (typeof import("vue"))["customRef"];
|
||||
const defineAsyncComponent: (typeof import("vue"))["defineAsyncComponent"];
|
||||
const defineComponent: (typeof import("vue"))["defineComponent"];
|
||||
const effectScope: (typeof import("vue"))["effectScope"];
|
||||
const getCurrentInstance: (typeof import("vue"))["getCurrentInstance"];
|
||||
const getCurrentScope: (typeof import("vue"))["getCurrentScope"];
|
||||
const h: (typeof import("vue"))["h"];
|
||||
const inject: (typeof import("vue"))["inject"];
|
||||
const isProxy: (typeof import("vue"))["isProxy"];
|
||||
const isReactive: (typeof import("vue"))["isReactive"];
|
||||
const isReadonly: (typeof import("vue"))["isReadonly"];
|
||||
const isRef: (typeof import("vue"))["isRef"];
|
||||
const markRaw: (typeof import("vue"))["markRaw"];
|
||||
const nextTick: (typeof import("vue"))["nextTick"];
|
||||
const onActivated: (typeof import("vue"))["onActivated"];
|
||||
const onBeforeMount: (typeof import("vue"))["onBeforeMount"];
|
||||
const onBeforeRouteLeave: (typeof import("vue-router"))["onBeforeRouteLeave"];
|
||||
const onBeforeRouteUpdate: (typeof import("vue-router"))["onBeforeRouteUpdate"];
|
||||
const onBeforeUnmount: (typeof import("vue"))["onBeforeUnmount"];
|
||||
const onBeforeUpdate: (typeof import("vue"))["onBeforeUpdate"];
|
||||
const onDeactivated: (typeof import("vue"))["onDeactivated"];
|
||||
const onErrorCaptured: (typeof import("vue"))["onErrorCaptured"];
|
||||
const onMounted: (typeof import("vue"))["onMounted"];
|
||||
const onRenderTracked: (typeof import("vue"))["onRenderTracked"];
|
||||
const onRenderTriggered: (typeof import("vue"))["onRenderTriggered"];
|
||||
const onScopeDispose: (typeof import("vue"))["onScopeDispose"];
|
||||
const onServerPrefetch: (typeof import("vue"))["onServerPrefetch"];
|
||||
const onUnmounted: (typeof import("vue"))["onUnmounted"];
|
||||
const onUpdated: (typeof import("vue"))["onUpdated"];
|
||||
const provide: (typeof import("vue"))["provide"];
|
||||
const reactive: (typeof import("vue"))["reactive"];
|
||||
const readonly: (typeof import("vue"))["readonly"];
|
||||
const ref: (typeof import("vue"))["ref"];
|
||||
const resolveComponent: (typeof import("vue"))["resolveComponent"];
|
||||
const shallowReactive: (typeof import("vue"))["shallowReactive"];
|
||||
const shallowReadonly: (typeof import("vue"))["shallowReadonly"];
|
||||
const shallowRef: (typeof import("vue"))["shallowRef"];
|
||||
const toRaw: (typeof import("vue"))["toRaw"];
|
||||
const toRef: (typeof import("vue"))["toRef"];
|
||||
const toRefs: (typeof import("vue"))["toRefs"];
|
||||
const toValue: (typeof import("vue"))["toValue"];
|
||||
const triggerRef: (typeof import("vue"))["triggerRef"];
|
||||
const unref: (typeof import("vue"))["unref"];
|
||||
const useAttrs: (typeof import("vue"))["useAttrs"];
|
||||
const useCssModule: (typeof import("vue"))["useCssModule"];
|
||||
const useCssVars: (typeof import("vue"))["useCssVars"];
|
||||
const useLink: (typeof import("vue-router"))["useLink"];
|
||||
const useRoute: (typeof import("vue-router/auto"))["useRoute"];
|
||||
const useRouter: (typeof import("vue-router/auto"))["useRouter"];
|
||||
const useSlots: (typeof import("vue"))["useSlots"];
|
||||
const watch: (typeof import("vue"))["watch"];
|
||||
const watchEffect: (typeof import("vue"))["watchEffect"];
|
||||
const watchPostEffect: (typeof import("vue"))["watchPostEffect"];
|
||||
const watchSyncEffect: (typeof import("vue"))["watchSyncEffect"];
|
||||
}
|
||||
// for type re-export
|
||||
declare global {
|
||||
// @ts-ignore
|
||||
export type { Component, ComponentPublicInstance, ComputedRef, ExtractDefaultPropTypes, ExtractPropTypes, ExtractPublicPropTypes, InjectionKey, PropType, Ref, VNode, WritableComputedRef } from 'vue'
|
||||
import('vue')
|
||||
export type {
|
||||
Component,
|
||||
ComponentPublicInstance,
|
||||
ComputedRef,
|
||||
ExtractDefaultPropTypes,
|
||||
ExtractPropTypes,
|
||||
ExtractPublicPropTypes,
|
||||
InjectionKey,
|
||||
PropType,
|
||||
Ref,
|
||||
VNode,
|
||||
WritableComputedRef,
|
||||
} from "vue";
|
||||
import("vue");
|
||||
}
|
||||
// for vue template auto import
|
||||
import { UnwrapRef } from 'vue'
|
||||
declare module 'vue' {
|
||||
import { UnwrapRef } from "vue";
|
||||
declare module "vue" {
|
||||
interface GlobalComponents {}
|
||||
interface ComponentCustomProperties {
|
||||
readonly EffectScope: UnwrapRef<typeof import('vue')['EffectScope']>
|
||||
readonly computed: UnwrapRef<typeof import('vue')['computed']>
|
||||
readonly createApp: UnwrapRef<typeof import('vue')['createApp']>
|
||||
readonly customRef: UnwrapRef<typeof import('vue')['customRef']>
|
||||
readonly defineAsyncComponent: UnwrapRef<typeof import('vue')['defineAsyncComponent']>
|
||||
readonly defineComponent: UnwrapRef<typeof import('vue')['defineComponent']>
|
||||
readonly effectScope: UnwrapRef<typeof import('vue')['effectScope']>
|
||||
readonly getCurrentInstance: UnwrapRef<typeof import('vue')['getCurrentInstance']>
|
||||
readonly getCurrentScope: UnwrapRef<typeof import('vue')['getCurrentScope']>
|
||||
readonly h: UnwrapRef<typeof import('vue')['h']>
|
||||
readonly inject: UnwrapRef<typeof import('vue')['inject']>
|
||||
readonly isProxy: UnwrapRef<typeof import('vue')['isProxy']>
|
||||
readonly isReactive: UnwrapRef<typeof import('vue')['isReactive']>
|
||||
readonly isReadonly: UnwrapRef<typeof import('vue')['isReadonly']>
|
||||
readonly isRef: UnwrapRef<typeof import('vue')['isRef']>
|
||||
readonly markRaw: UnwrapRef<typeof import('vue')['markRaw']>
|
||||
readonly nextTick: UnwrapRef<typeof import('vue')['nextTick']>
|
||||
readonly onActivated: UnwrapRef<typeof import('vue')['onActivated']>
|
||||
readonly onBeforeMount: UnwrapRef<typeof import('vue')['onBeforeMount']>
|
||||
readonly onBeforeUnmount: UnwrapRef<typeof import('vue')['onBeforeUnmount']>
|
||||
readonly onBeforeUpdate: UnwrapRef<typeof import('vue')['onBeforeUpdate']>
|
||||
readonly onDeactivated: UnwrapRef<typeof import('vue')['onDeactivated']>
|
||||
readonly onErrorCaptured: UnwrapRef<typeof import('vue')['onErrorCaptured']>
|
||||
readonly onMounted: UnwrapRef<typeof import('vue')['onMounted']>
|
||||
readonly onRenderTracked: UnwrapRef<typeof import('vue')['onRenderTracked']>
|
||||
readonly onRenderTriggered: UnwrapRef<typeof import('vue')['onRenderTriggered']>
|
||||
readonly onScopeDispose: UnwrapRef<typeof import('vue')['onScopeDispose']>
|
||||
readonly onServerPrefetch: UnwrapRef<typeof import('vue')['onServerPrefetch']>
|
||||
readonly onUnmounted: UnwrapRef<typeof import('vue')['onUnmounted']>
|
||||
readonly onUpdated: UnwrapRef<typeof import('vue')['onUpdated']>
|
||||
readonly provide: UnwrapRef<typeof import('vue')['provide']>
|
||||
readonly reactive: UnwrapRef<typeof import('vue')['reactive']>
|
||||
readonly readonly: UnwrapRef<typeof import('vue')['readonly']>
|
||||
readonly ref: UnwrapRef<typeof import('vue')['ref']>
|
||||
readonly resolveComponent: UnwrapRef<typeof import('vue')['resolveComponent']>
|
||||
readonly shallowReactive: UnwrapRef<typeof import('vue')['shallowReactive']>
|
||||
readonly shallowReadonly: UnwrapRef<typeof import('vue')['shallowReadonly']>
|
||||
readonly shallowRef: UnwrapRef<typeof import('vue')['shallowRef']>
|
||||
readonly toRaw: UnwrapRef<typeof import('vue')['toRaw']>
|
||||
readonly toRef: UnwrapRef<typeof import('vue')['toRef']>
|
||||
readonly toRefs: UnwrapRef<typeof import('vue')['toRefs']>
|
||||
readonly toValue: UnwrapRef<typeof import('vue')['toValue']>
|
||||
readonly triggerRef: UnwrapRef<typeof import('vue')['triggerRef']>
|
||||
readonly unref: UnwrapRef<typeof import('vue')['unref']>
|
||||
readonly useAttrs: UnwrapRef<typeof import('vue')['useAttrs']>
|
||||
readonly useCssModule: UnwrapRef<typeof import('vue')['useCssModule']>
|
||||
readonly useCssVars: UnwrapRef<typeof import('vue')['useCssVars']>
|
||||
readonly useRoute: UnwrapRef<typeof import('vue-router/auto')['useRoute']>
|
||||
readonly useRouter: UnwrapRef<typeof import('vue-router/auto')['useRouter']>
|
||||
readonly useSlots: UnwrapRef<typeof import('vue')['useSlots']>
|
||||
readonly watch: UnwrapRef<typeof import('vue')['watch']>
|
||||
readonly watchEffect: UnwrapRef<typeof import('vue')['watchEffect']>
|
||||
readonly watchPostEffect: UnwrapRef<typeof import('vue')['watchPostEffect']>
|
||||
readonly watchSyncEffect: UnwrapRef<typeof import('vue')['watchSyncEffect']>
|
||||
readonly EffectScope: UnwrapRef<(typeof import("vue"))["EffectScope"]>;
|
||||
readonly computed: UnwrapRef<(typeof import("vue"))["computed"]>;
|
||||
readonly createApp: UnwrapRef<(typeof import("vue"))["createApp"]>;
|
||||
readonly customRef: UnwrapRef<(typeof import("vue"))["customRef"]>;
|
||||
readonly defineAsyncComponent: UnwrapRef<
|
||||
(typeof import("vue"))["defineAsyncComponent"]
|
||||
>;
|
||||
readonly defineComponent: UnwrapRef<
|
||||
(typeof import("vue"))["defineComponent"]
|
||||
>;
|
||||
readonly effectScope: UnwrapRef<(typeof import("vue"))["effectScope"]>;
|
||||
readonly getCurrentInstance: UnwrapRef<
|
||||
(typeof import("vue"))["getCurrentInstance"]
|
||||
>;
|
||||
readonly getCurrentScope: UnwrapRef<
|
||||
(typeof import("vue"))["getCurrentScope"]
|
||||
>;
|
||||
readonly h: UnwrapRef<(typeof import("vue"))["h"]>;
|
||||
readonly inject: UnwrapRef<(typeof import("vue"))["inject"]>;
|
||||
readonly isProxy: UnwrapRef<(typeof import("vue"))["isProxy"]>;
|
||||
readonly isReactive: UnwrapRef<(typeof import("vue"))["isReactive"]>;
|
||||
readonly isReadonly: UnwrapRef<(typeof import("vue"))["isReadonly"]>;
|
||||
readonly isRef: UnwrapRef<(typeof import("vue"))["isRef"]>;
|
||||
readonly markRaw: UnwrapRef<(typeof import("vue"))["markRaw"]>;
|
||||
readonly nextTick: UnwrapRef<(typeof import("vue"))["nextTick"]>;
|
||||
readonly onActivated: UnwrapRef<(typeof import("vue"))["onActivated"]>;
|
||||
readonly onBeforeMount: UnwrapRef<(typeof import("vue"))["onBeforeMount"]>;
|
||||
readonly onBeforeUnmount: UnwrapRef<
|
||||
(typeof import("vue"))["onBeforeUnmount"]
|
||||
>;
|
||||
readonly onBeforeUpdate: UnwrapRef<
|
||||
(typeof import("vue"))["onBeforeUpdate"]
|
||||
>;
|
||||
readonly onDeactivated: UnwrapRef<(typeof import("vue"))["onDeactivated"]>;
|
||||
readonly onErrorCaptured: UnwrapRef<
|
||||
(typeof import("vue"))["onErrorCaptured"]
|
||||
>;
|
||||
readonly onMounted: UnwrapRef<(typeof import("vue"))["onMounted"]>;
|
||||
readonly onRenderTracked: UnwrapRef<
|
||||
(typeof import("vue"))["onRenderTracked"]
|
||||
>;
|
||||
readonly onRenderTriggered: UnwrapRef<
|
||||
(typeof import("vue"))["onRenderTriggered"]
|
||||
>;
|
||||
readonly onScopeDispose: UnwrapRef<
|
||||
(typeof import("vue"))["onScopeDispose"]
|
||||
>;
|
||||
readonly onServerPrefetch: UnwrapRef<
|
||||
(typeof import("vue"))["onServerPrefetch"]
|
||||
>;
|
||||
readonly onUnmounted: UnwrapRef<(typeof import("vue"))["onUnmounted"]>;
|
||||
readonly onUpdated: UnwrapRef<(typeof import("vue"))["onUpdated"]>;
|
||||
readonly provide: UnwrapRef<(typeof import("vue"))["provide"]>;
|
||||
readonly reactive: UnwrapRef<(typeof import("vue"))["reactive"]>;
|
||||
readonly readonly: UnwrapRef<(typeof import("vue"))["readonly"]>;
|
||||
readonly ref: UnwrapRef<(typeof import("vue"))["ref"]>;
|
||||
readonly resolveComponent: UnwrapRef<
|
||||
(typeof import("vue"))["resolveComponent"]
|
||||
>;
|
||||
readonly shallowReactive: UnwrapRef<
|
||||
(typeof import("vue"))["shallowReactive"]
|
||||
>;
|
||||
readonly shallowReadonly: UnwrapRef<
|
||||
(typeof import("vue"))["shallowReadonly"]
|
||||
>;
|
||||
readonly shallowRef: UnwrapRef<(typeof import("vue"))["shallowRef"]>;
|
||||
readonly toRaw: UnwrapRef<(typeof import("vue"))["toRaw"]>;
|
||||
readonly toRef: UnwrapRef<(typeof import("vue"))["toRef"]>;
|
||||
readonly toRefs: UnwrapRef<(typeof import("vue"))["toRefs"]>;
|
||||
readonly toValue: UnwrapRef<(typeof import("vue"))["toValue"]>;
|
||||
readonly triggerRef: UnwrapRef<(typeof import("vue"))["triggerRef"]>;
|
||||
readonly unref: UnwrapRef<(typeof import("vue"))["unref"]>;
|
||||
readonly useAttrs: UnwrapRef<(typeof import("vue"))["useAttrs"]>;
|
||||
readonly useCssModule: UnwrapRef<(typeof import("vue"))["useCssModule"]>;
|
||||
readonly useCssVars: UnwrapRef<(typeof import("vue"))["useCssVars"]>;
|
||||
readonly useRoute: UnwrapRef<
|
||||
(typeof import("vue-router/auto"))["useRoute"]
|
||||
>;
|
||||
readonly useRouter: UnwrapRef<
|
||||
(typeof import("vue-router/auto"))["useRouter"]
|
||||
>;
|
||||
readonly useSlots: UnwrapRef<(typeof import("vue"))["useSlots"]>;
|
||||
readonly watch: UnwrapRef<(typeof import("vue"))["watch"]>;
|
||||
readonly watchEffect: UnwrapRef<(typeof import("vue"))["watchEffect"]>;
|
||||
readonly watchPostEffect: UnwrapRef<
|
||||
(typeof import("vue"))["watchPostEffect"]
|
||||
>;
|
||||
readonly watchSyncEffect: UnwrapRef<
|
||||
(typeof import("vue"))["watchSyncEffect"]
|
||||
>;
|
||||
}
|
||||
}
|
||||
declare module '@vue/runtime-core' {
|
||||
declare module "@vue/runtime-core" {
|
||||
interface GlobalComponents {}
|
||||
interface ComponentCustomProperties {
|
||||
readonly EffectScope: UnwrapRef<typeof import('vue')['EffectScope']>
|
||||
readonly computed: UnwrapRef<typeof import('vue')['computed']>
|
||||
readonly createApp: UnwrapRef<typeof import('vue')['createApp']>
|
||||
readonly customRef: UnwrapRef<typeof import('vue')['customRef']>
|
||||
readonly defineAsyncComponent: UnwrapRef<typeof import('vue')['defineAsyncComponent']>
|
||||
readonly defineComponent: UnwrapRef<typeof import('vue')['defineComponent']>
|
||||
readonly effectScope: UnwrapRef<typeof import('vue')['effectScope']>
|
||||
readonly getCurrentInstance: UnwrapRef<typeof import('vue')['getCurrentInstance']>
|
||||
readonly getCurrentScope: UnwrapRef<typeof import('vue')['getCurrentScope']>
|
||||
readonly h: UnwrapRef<typeof import('vue')['h']>
|
||||
readonly inject: UnwrapRef<typeof import('vue')['inject']>
|
||||
readonly isProxy: UnwrapRef<typeof import('vue')['isProxy']>
|
||||
readonly isReactive: UnwrapRef<typeof import('vue')['isReactive']>
|
||||
readonly isReadonly: UnwrapRef<typeof import('vue')['isReadonly']>
|
||||
readonly isRef: UnwrapRef<typeof import('vue')['isRef']>
|
||||
readonly markRaw: UnwrapRef<typeof import('vue')['markRaw']>
|
||||
readonly nextTick: UnwrapRef<typeof import('vue')['nextTick']>
|
||||
readonly onActivated: UnwrapRef<typeof import('vue')['onActivated']>
|
||||
readonly onBeforeMount: UnwrapRef<typeof import('vue')['onBeforeMount']>
|
||||
readonly onBeforeUnmount: UnwrapRef<typeof import('vue')['onBeforeUnmount']>
|
||||
readonly onBeforeUpdate: UnwrapRef<typeof import('vue')['onBeforeUpdate']>
|
||||
readonly onDeactivated: UnwrapRef<typeof import('vue')['onDeactivated']>
|
||||
readonly onErrorCaptured: UnwrapRef<typeof import('vue')['onErrorCaptured']>
|
||||
readonly onMounted: UnwrapRef<typeof import('vue')['onMounted']>
|
||||
readonly onRenderTracked: UnwrapRef<typeof import('vue')['onRenderTracked']>
|
||||
readonly onRenderTriggered: UnwrapRef<typeof import('vue')['onRenderTriggered']>
|
||||
readonly onScopeDispose: UnwrapRef<typeof import('vue')['onScopeDispose']>
|
||||
readonly onServerPrefetch: UnwrapRef<typeof import('vue')['onServerPrefetch']>
|
||||
readonly onUnmounted: UnwrapRef<typeof import('vue')['onUnmounted']>
|
||||
readonly onUpdated: UnwrapRef<typeof import('vue')['onUpdated']>
|
||||
readonly provide: UnwrapRef<typeof import('vue')['provide']>
|
||||
readonly reactive: UnwrapRef<typeof import('vue')['reactive']>
|
||||
readonly readonly: UnwrapRef<typeof import('vue')['readonly']>
|
||||
readonly ref: UnwrapRef<typeof import('vue')['ref']>
|
||||
readonly resolveComponent: UnwrapRef<typeof import('vue')['resolveComponent']>
|
||||
readonly shallowReactive: UnwrapRef<typeof import('vue')['shallowReactive']>
|
||||
readonly shallowReadonly: UnwrapRef<typeof import('vue')['shallowReadonly']>
|
||||
readonly shallowRef: UnwrapRef<typeof import('vue')['shallowRef']>
|
||||
readonly toRaw: UnwrapRef<typeof import('vue')['toRaw']>
|
||||
readonly toRef: UnwrapRef<typeof import('vue')['toRef']>
|
||||
readonly toRefs: UnwrapRef<typeof import('vue')['toRefs']>
|
||||
readonly toValue: UnwrapRef<typeof import('vue')['toValue']>
|
||||
readonly triggerRef: UnwrapRef<typeof import('vue')['triggerRef']>
|
||||
readonly unref: UnwrapRef<typeof import('vue')['unref']>
|
||||
readonly useAttrs: UnwrapRef<typeof import('vue')['useAttrs']>
|
||||
readonly useCssModule: UnwrapRef<typeof import('vue')['useCssModule']>
|
||||
readonly useCssVars: UnwrapRef<typeof import('vue')['useCssVars']>
|
||||
readonly useRoute: UnwrapRef<typeof import('vue-router/auto')['useRoute']>
|
||||
readonly useRouter: UnwrapRef<typeof import('vue-router/auto')['useRouter']>
|
||||
readonly useSlots: UnwrapRef<typeof import('vue')['useSlots']>
|
||||
readonly watch: UnwrapRef<typeof import('vue')['watch']>
|
||||
readonly watchEffect: UnwrapRef<typeof import('vue')['watchEffect']>
|
||||
readonly watchPostEffect: UnwrapRef<typeof import('vue')['watchPostEffect']>
|
||||
readonly watchSyncEffect: UnwrapRef<typeof import('vue')['watchSyncEffect']>
|
||||
readonly EffectScope: UnwrapRef<(typeof import("vue"))["EffectScope"]>;
|
||||
readonly computed: UnwrapRef<(typeof import("vue"))["computed"]>;
|
||||
readonly createApp: UnwrapRef<(typeof import("vue"))["createApp"]>;
|
||||
readonly customRef: UnwrapRef<(typeof import("vue"))["customRef"]>;
|
||||
readonly defineAsyncComponent: UnwrapRef<
|
||||
(typeof import("vue"))["defineAsyncComponent"]
|
||||
>;
|
||||
readonly defineComponent: UnwrapRef<
|
||||
(typeof import("vue"))["defineComponent"]
|
||||
>;
|
||||
readonly effectScope: UnwrapRef<(typeof import("vue"))["effectScope"]>;
|
||||
readonly getCurrentInstance: UnwrapRef<
|
||||
(typeof import("vue"))["getCurrentInstance"]
|
||||
>;
|
||||
readonly getCurrentScope: UnwrapRef<
|
||||
(typeof import("vue"))["getCurrentScope"]
|
||||
>;
|
||||
readonly h: UnwrapRef<(typeof import("vue"))["h"]>;
|
||||
readonly inject: UnwrapRef<(typeof import("vue"))["inject"]>;
|
||||
readonly isProxy: UnwrapRef<(typeof import("vue"))["isProxy"]>;
|
||||
readonly isReactive: UnwrapRef<(typeof import("vue"))["isReactive"]>;
|
||||
readonly isReadonly: UnwrapRef<(typeof import("vue"))["isReadonly"]>;
|
||||
readonly isRef: UnwrapRef<(typeof import("vue"))["isRef"]>;
|
||||
readonly markRaw: UnwrapRef<(typeof import("vue"))["markRaw"]>;
|
||||
readonly nextTick: UnwrapRef<(typeof import("vue"))["nextTick"]>;
|
||||
readonly onActivated: UnwrapRef<(typeof import("vue"))["onActivated"]>;
|
||||
readonly onBeforeMount: UnwrapRef<(typeof import("vue"))["onBeforeMount"]>;
|
||||
readonly onBeforeUnmount: UnwrapRef<
|
||||
(typeof import("vue"))["onBeforeUnmount"]
|
||||
>;
|
||||
readonly onBeforeUpdate: UnwrapRef<
|
||||
(typeof import("vue"))["onBeforeUpdate"]
|
||||
>;
|
||||
readonly onDeactivated: UnwrapRef<(typeof import("vue"))["onDeactivated"]>;
|
||||
readonly onErrorCaptured: UnwrapRef<
|
||||
(typeof import("vue"))["onErrorCaptured"]
|
||||
>;
|
||||
readonly onMounted: UnwrapRef<(typeof import("vue"))["onMounted"]>;
|
||||
readonly onRenderTracked: UnwrapRef<
|
||||
(typeof import("vue"))["onRenderTracked"]
|
||||
>;
|
||||
readonly onRenderTriggered: UnwrapRef<
|
||||
(typeof import("vue"))["onRenderTriggered"]
|
||||
>;
|
||||
readonly onScopeDispose: UnwrapRef<
|
||||
(typeof import("vue"))["onScopeDispose"]
|
||||
>;
|
||||
readonly onServerPrefetch: UnwrapRef<
|
||||
(typeof import("vue"))["onServerPrefetch"]
|
||||
>;
|
||||
readonly onUnmounted: UnwrapRef<(typeof import("vue"))["onUnmounted"]>;
|
||||
readonly onUpdated: UnwrapRef<(typeof import("vue"))["onUpdated"]>;
|
||||
readonly provide: UnwrapRef<(typeof import("vue"))["provide"]>;
|
||||
readonly reactive: UnwrapRef<(typeof import("vue"))["reactive"]>;
|
||||
readonly readonly: UnwrapRef<(typeof import("vue"))["readonly"]>;
|
||||
readonly ref: UnwrapRef<(typeof import("vue"))["ref"]>;
|
||||
readonly resolveComponent: UnwrapRef<
|
||||
(typeof import("vue"))["resolveComponent"]
|
||||
>;
|
||||
readonly shallowReactive: UnwrapRef<
|
||||
(typeof import("vue"))["shallowReactive"]
|
||||
>;
|
||||
readonly shallowReadonly: UnwrapRef<
|
||||
(typeof import("vue"))["shallowReadonly"]
|
||||
>;
|
||||
readonly shallowRef: UnwrapRef<(typeof import("vue"))["shallowRef"]>;
|
||||
readonly toRaw: UnwrapRef<(typeof import("vue"))["toRaw"]>;
|
||||
readonly toRef: UnwrapRef<(typeof import("vue"))["toRef"]>;
|
||||
readonly toRefs: UnwrapRef<(typeof import("vue"))["toRefs"]>;
|
||||
readonly toValue: UnwrapRef<(typeof import("vue"))["toValue"]>;
|
||||
readonly triggerRef: UnwrapRef<(typeof import("vue"))["triggerRef"]>;
|
||||
readonly unref: UnwrapRef<(typeof import("vue"))["unref"]>;
|
||||
readonly useAttrs: UnwrapRef<(typeof import("vue"))["useAttrs"]>;
|
||||
readonly useCssModule: UnwrapRef<(typeof import("vue"))["useCssModule"]>;
|
||||
readonly useCssVars: UnwrapRef<(typeof import("vue"))["useCssVars"]>;
|
||||
readonly useRoute: UnwrapRef<
|
||||
(typeof import("vue-router/auto"))["useRoute"]
|
||||
>;
|
||||
readonly useRouter: UnwrapRef<
|
||||
(typeof import("vue-router/auto"))["useRouter"]
|
||||
>;
|
||||
readonly useSlots: UnwrapRef<(typeof import("vue"))["useSlots"]>;
|
||||
readonly watch: UnwrapRef<(typeof import("vue"))["watch"]>;
|
||||
readonly watchEffect: UnwrapRef<(typeof import("vue"))["watchEffect"]>;
|
||||
readonly watchPostEffect: UnwrapRef<
|
||||
(typeof import("vue"))["watchPostEffect"]
|
||||
>;
|
||||
readonly watchSyncEffect: UnwrapRef<
|
||||
(typeof import("vue"))["watchSyncEffect"]
|
||||
>;
|
||||
}
|
||||
}
|
||||
|
2
src/components.d.ts
vendored
2
src/components.d.ts
vendored
@ -2,7 +2,7 @@
|
||||
// @ts-nocheck
|
||||
// Generated by unplugin-vue-components
|
||||
// Read more: https://github.com/vuejs/core/pull/3399
|
||||
export {}
|
||||
export {};
|
||||
|
||||
/* prettier-ignore */
|
||||
declare module 'vue' {
|
||||
|
@ -5,24 +5,14 @@
|
||||
<v-btn-group rounded="lg">
|
||||
<v-btn density="default" icon="mdi-close" @click="drawer = !drawer" />
|
||||
|
||||
<v-btn
|
||||
density="default"
|
||||
icon="mdi-plus"
|
||||
title="创建助理"
|
||||
/>
|
||||
<v-btn density="default" icon="mdi-plus" title="创建助理" />
|
||||
</v-btn-group>
|
||||
</div>
|
||||
|
||||
<!-- <v-divider></v-divider> -->
|
||||
|
||||
<v-list density="compact" nav>
|
||||
|
||||
<v-list-item
|
||||
prepend-icon="mdi-home"
|
||||
rounded="lg"
|
||||
title="首页"
|
||||
to="/"
|
||||
/>
|
||||
<v-list-item prepend-icon="mdi-home" rounded="lg" title="首页" to="/" />
|
||||
|
||||
<v-list-item
|
||||
prepend-icon="mdi-home"
|
||||
@ -38,7 +28,6 @@
|
||||
to="/ping"
|
||||
/>
|
||||
|
||||
|
||||
<v-list-item
|
||||
v-show="!userStore.logined"
|
||||
prepend-icon="mdi-account"
|
||||
@ -46,7 +35,6 @@
|
||||
title="登录"
|
||||
to="/auth/login"
|
||||
/>
|
||||
|
||||
</v-list>
|
||||
</v-navigation-drawer>
|
||||
|
||||
|
@ -16,7 +16,7 @@ The following example assumes a component located at `src/components/MyComponent
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
//
|
||||
//
|
||||
</script>
|
||||
```
|
||||
|
||||
@ -30,6 +30,6 @@ When your template is rendered, the component's import will automatically be inl
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import MyComponent from '@/components/MyComponent.vue'
|
||||
import MyComponent from "@/components/MyComponent.vue";
|
||||
</script>
|
||||
```
|
||||
|
@ -7,9 +7,19 @@
|
||||
// import { useConfigStore } from "@/stores/config";
|
||||
import AppBar from "@/components/AppBar.vue";
|
||||
import View from "@/components/View.vue";
|
||||
import { useTheme } from "vuetify";
|
||||
|
||||
// const configStore = useConfigStore();
|
||||
const theme = useTheme();
|
||||
|
||||
// const drawer = ref(false);
|
||||
// const logined = ref(false);
|
||||
// 创建一个函数来更新主题
|
||||
function updateTheme() {
|
||||
const prefersDark = window.matchMedia("(prefers-color-scheme: dark)").matches;
|
||||
|
||||
theme.global.name.value = prefersDark ? "dark" : "light";
|
||||
}
|
||||
|
||||
updateTheme();
|
||||
window
|
||||
.matchMedia("(prefers-color-scheme: dark)")
|
||||
.addEventListener("change", updateTheme);
|
||||
</script>
|
||||
|
12
src/main.ts
12
src/main.ts
@ -5,16 +5,16 @@
|
||||
*/
|
||||
|
||||
// Plugins
|
||||
import { registerPlugins } from '@/plugins'
|
||||
import { registerPlugins } from "@/plugins";
|
||||
|
||||
// Components
|
||||
import App from './App.vue'
|
||||
import App from "./App.vue";
|
||||
|
||||
// Composables
|
||||
import { createApp } from 'vue'
|
||||
import { createApp } from "vue";
|
||||
|
||||
const app = createApp(App)
|
||||
const app = createApp(App);
|
||||
|
||||
registerPlugins(app)
|
||||
registerPlugins(app);
|
||||
|
||||
app.mount('#app')
|
||||
app.mount("#app");
|
||||
|
@ -6,9 +6,21 @@
|
||||
<v-card-title class="headline">创建助理</v-card-title>
|
||||
<v-card-text>
|
||||
<v-form ref="form">
|
||||
<v-text-field v-model="name" label="助理名称" required></v-text-field>
|
||||
<v-text-field v-model="description" label="描述你的助理" required></v-text-field>
|
||||
<v-textarea v-model="prompt" label="助理提示语" required></v-textarea>
|
||||
<v-text-field
|
||||
v-model="name"
|
||||
label="助理名称"
|
||||
required
|
||||
></v-text-field>
|
||||
<v-text-field
|
||||
v-model="description"
|
||||
label="描述你的助理"
|
||||
required
|
||||
></v-text-field>
|
||||
<v-textarea
|
||||
v-model="prompt"
|
||||
label="助理提示语"
|
||||
required
|
||||
></v-textarea>
|
||||
<v-btn @click="createAssistant" color="primary">创建</v-btn>
|
||||
</v-form>
|
||||
</v-card-text>
|
||||
@ -16,35 +28,40 @@
|
||||
</v-col>
|
||||
<v-col cols="12" md="6">
|
||||
<div>
|
||||
<h3>创建你的助理</h3>
|
||||
<p>每个助理可以绑定工具,工具可以让你的助理具有访问外界或者操作一些装置的能力。</p>
|
||||
<p>能用成什么样,取决于你的想象。</p>
|
||||
<h3>创建你的助理</h3>
|
||||
<p>
|
||||
每个助理可以绑定工具,工具可以让你的助理具有访问外界或者操作一些装置的能力。
|
||||
</p>
|
||||
<p>能用成什么样,取决于你的想象。</p>
|
||||
</div>
|
||||
<div v-if="createdID != 0">
|
||||
<h3>你刚刚创建了一个助理!</h3>
|
||||
<p>你的助理ID是:{{ createdID }}</p>
|
||||
<p>回到助理页面,开始设置它!</p>
|
||||
<h3>你刚刚创建了一个助理!</h3>
|
||||
<p>你的助理ID是:{{ createdID }}</p>
|
||||
<p>回到助理页面,开始设置它!</p>
|
||||
</div>
|
||||
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-container>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref } from 'vue';
|
||||
import { api } from '@/plugins/api';
|
||||
import { ref } from "vue";
|
||||
import { api } from "@/plugins/api";
|
||||
|
||||
const name = ref('');
|
||||
const prompt = ref('');
|
||||
const description = ref('');
|
||||
const name = ref("");
|
||||
const prompt = ref("");
|
||||
const description = ref("");
|
||||
|
||||
const createdID = ref(0);
|
||||
|
||||
const createAssistant = async () => {
|
||||
try {
|
||||
let assistant = await api.Assistant.apiV1AssistantsPost({ name: name.value, prompt: prompt.value, description: description.value });
|
||||
prompt.value = '';
|
||||
let assistant = await api.Assistant.apiV1AssistantsPost({
|
||||
name: name.value,
|
||||
prompt: prompt.value,
|
||||
description: description.value,
|
||||
});
|
||||
prompt.value = "";
|
||||
createdID.value = assistant.data.data?.id ?? 0;
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
@ -55,4 +72,4 @@ const createAssistant = async () => {
|
||||
|
||||
<style scoped>
|
||||
/* 添加样式 */
|
||||
</style>
|
||||
</style>
|
||||
|
@ -37,9 +37,7 @@
|
||||
<v-dialog v-model="dialog" persistent max-width="290">
|
||||
<v-card>
|
||||
<v-card-title class="headline">确认删除</v-card-title>
|
||||
<v-card-text
|
||||
>您确定要删除这个助理吗?</v-card-text
|
||||
>
|
||||
<v-card-text>您确定要删除这个助理吗?</v-card-text>
|
||||
<v-card-actions>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn color="green darken-1" text @click="dialog = false">取消</v-btn>
|
||||
|
@ -14,37 +14,32 @@ const userStore = useUserStore();
|
||||
|
||||
let discovery = await axios.get(configStore.oauth_discovery_url);
|
||||
|
||||
let local_code_verifier = localStorage.getItem(configStore.oauth_storage_key)
|
||||
let local_code_verifier = localStorage.getItem(configStore.oauth_storage_key);
|
||||
|
||||
// 从当前页面请求中获取 code
|
||||
let code = new URLSearchParams(window.location.search).get("code");
|
||||
|
||||
|
||||
let q = new URLSearchParams({
|
||||
client_id: configStore.oauth_client_id,
|
||||
grant_type: 'authorization_code',
|
||||
grant_type: "authorization_code",
|
||||
redirect_uri: configStore.oauth_callback_url,
|
||||
code_verifier: local_code_verifier || '',
|
||||
code: code || '',
|
||||
})
|
||||
code_verifier: local_code_verifier || "",
|
||||
code: code || "",
|
||||
});
|
||||
|
||||
const tokenEndpoint = discovery.data.token_endpoint
|
||||
const r = await axios.post(tokenEndpoint, q)
|
||||
const tokenEndpoint = discovery.data.token_endpoint;
|
||||
const r = await axios.post(tokenEndpoint, q);
|
||||
|
||||
|
||||
userStore.access_token = r.data.access_token
|
||||
userStore.refresh_token = r.data.refresh_token
|
||||
userStore.access_token = r.data.access_token;
|
||||
userStore.refresh_token = r.data.refresh_token;
|
||||
|
||||
userStore.login(
|
||||
r.data.id_token,
|
||||
r.data.access_token,
|
||||
r.data.refresh_token,
|
||||
r.data.expires_in,
|
||||
)
|
||||
|
||||
);
|
||||
|
||||
// 跳转到 /
|
||||
router.push('/')
|
||||
|
||||
|
||||
router.push("/");
|
||||
</script>
|
||||
|
@ -9,12 +9,12 @@ import axios from "axios";
|
||||
import { useConfigStore } from "@/stores/config";
|
||||
const configStore = useConfigStore();
|
||||
|
||||
|
||||
let discovery = await axios.get(configStore.oauth_discovery_url);
|
||||
|
||||
function generateRandomString(length: number) {
|
||||
let text = "";
|
||||
let possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
|
||||
let possible =
|
||||
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
|
||||
|
||||
for (let i = 0; i < length; i++) {
|
||||
text += possible.charAt(Math.floor(Math.random() * possible.length));
|
||||
@ -24,11 +24,15 @@ function generateRandomString(length: number) {
|
||||
}
|
||||
|
||||
async function generateCodeChallenge(codeVerifier: string) {
|
||||
let digest = await crypto.subtle.digest("SHA-256",
|
||||
new TextEncoder().encode(codeVerifier));
|
||||
let digest = await crypto.subtle.digest(
|
||||
"SHA-256",
|
||||
new TextEncoder().encode(codeVerifier),
|
||||
);
|
||||
|
||||
return btoa(String.fromCharCode(...new Uint8Array(digest)))
|
||||
.replace(/=/g, '').replace(/\+/g, '-').replace(/\//g, '_')
|
||||
.replace(/=/g, "")
|
||||
.replace(/\+/g, "-")
|
||||
.replace(/\//g, "_");
|
||||
}
|
||||
|
||||
const codeVerifier = generateRandomString(128);
|
||||
@ -46,7 +50,5 @@ const query = new URLSearchParams({
|
||||
code_challenge_method: "S256",
|
||||
}).toString();
|
||||
|
||||
|
||||
window.location.href = discovery.data.authorization_endpoint + "?" + query;
|
||||
|
||||
</script>
|
||||
|
@ -24,19 +24,13 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
console.log("this is index");
|
||||
|
||||
|
||||
console.log("this is index")
|
||||
|
||||
import { useUserStore } from '@/stores/user';
|
||||
import { useUserStore } from "@/stores/user";
|
||||
const userStore = useUserStore();
|
||||
|
||||
|
||||
|
||||
|
||||
function refresh() {
|
||||
userStore.refresh()
|
||||
console.log('refresh')
|
||||
userStore.refresh();
|
||||
console.log("refresh");
|
||||
}
|
||||
|
||||
</script>
|
||||
|
@ -16,9 +16,8 @@ const conf = new Configuration();
|
||||
|
||||
conf.basePath = configStore.backend;
|
||||
conf.apiKey = () => {
|
||||
return "Bearer " + userStore.id_token;
|
||||
}
|
||||
|
||||
return "Bearer " + userStore.id_token;
|
||||
};
|
||||
|
||||
// userStore.$subscribe((mutation, state) => {
|
||||
// console.log(mutation);
|
||||
|
@ -5,16 +5,13 @@
|
||||
*/
|
||||
|
||||
// Plugins
|
||||
import vuetify from './vuetify'
|
||||
import pinia from '../stores'
|
||||
import router from '../router'
|
||||
import vuetify from "./vuetify";
|
||||
import pinia from "../stores";
|
||||
import router from "../router";
|
||||
|
||||
// Types
|
||||
import type { App } from 'vue'
|
||||
import type { App } from "vue";
|
||||
|
||||
export function registerPlugins (app: App) {
|
||||
app
|
||||
.use(vuetify)
|
||||
.use(router)
|
||||
.use(pinia)
|
||||
export function registerPlugins(app: App) {
|
||||
app.use(vuetify).use(router).use(pinia);
|
||||
}
|
||||
|
@ -5,15 +5,15 @@
|
||||
*/
|
||||
|
||||
// Styles
|
||||
import '@mdi/font/css/materialdesignicons.css'
|
||||
import 'vuetify/styles'
|
||||
import "@mdi/font/css/materialdesignicons.css";
|
||||
import "vuetify/styles";
|
||||
|
||||
// Composables
|
||||
import { createVuetify } from 'vuetify'
|
||||
import { createVuetify } from "vuetify";
|
||||
|
||||
// https://vuetifyjs.com/en/introduction/why-vuetify/#feature-guides
|
||||
export default createVuetify({
|
||||
theme: {
|
||||
defaultTheme: 'dark',
|
||||
defaultTheme: "dark",
|
||||
},
|
||||
})
|
||||
});
|
||||
|
@ -5,32 +5,32 @@
|
||||
*/
|
||||
|
||||
// Composables
|
||||
import { createRouter, createWebHistory } from 'vue-router/auto'
|
||||
import { setupLayouts } from 'virtual:generated-layouts'
|
||||
import { routes } from 'vue-router/auto-routes'
|
||||
import { createRouter, createWebHistory } from "vue-router/auto";
|
||||
import { setupLayouts } from "virtual:generated-layouts";
|
||||
import { routes } from "vue-router/auto-routes";
|
||||
|
||||
const router = createRouter({
|
||||
history: createWebHistory(import.meta.env.BASE_URL),
|
||||
routes: setupLayouts(routes),
|
||||
})
|
||||
});
|
||||
|
||||
// Workaround for https://github.com/vitejs/vite/issues/11804
|
||||
router.onError((err, to) => {
|
||||
if (err?.message?.includes?.('Failed to fetch dynamically imported module')) {
|
||||
if (!localStorage.getItem('vuetify:dynamic-reload')) {
|
||||
console.log('Reloading page to fix dynamic import error')
|
||||
localStorage.setItem('vuetify:dynamic-reload', 'true')
|
||||
location.assign(to.fullPath)
|
||||
if (err?.message?.includes?.("Failed to fetch dynamically imported module")) {
|
||||
if (!localStorage.getItem("vuetify:dynamic-reload")) {
|
||||
console.log("Reloading page to fix dynamic import error");
|
||||
localStorage.setItem("vuetify:dynamic-reload", "true");
|
||||
location.assign(to.fullPath);
|
||||
} else {
|
||||
console.error('Dynamic import error, reloading page did not fix it', err)
|
||||
console.error("Dynamic import error, reloading page did not fix it", err);
|
||||
}
|
||||
} else {
|
||||
console.error(err)
|
||||
console.error(err);
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
router.isReady().then(() => {
|
||||
localStorage.removeItem('vuetify:dynamic-reload')
|
||||
})
|
||||
localStorage.removeItem("vuetify:dynamic-reload");
|
||||
});
|
||||
|
||||
export default router
|
||||
export default router;
|
||||
|
@ -1,8 +1,8 @@
|
||||
// Utilities
|
||||
import { defineStore } from 'pinia'
|
||||
import { defineStore } from "pinia";
|
||||
|
||||
export const useAppStore = defineStore('app', {
|
||||
export const useAppStore = defineStore("app", {
|
||||
state: () => ({
|
||||
//
|
||||
}),
|
||||
})
|
||||
});
|
||||
|
@ -1,14 +1,15 @@
|
||||
// Utilities
|
||||
import { defineStore } from 'pinia'
|
||||
import { defineStore } from "pinia";
|
||||
|
||||
export const useConfigStore = defineStore('config', {
|
||||
export const useConfigStore = defineStore("config", {
|
||||
state: () => ({
|
||||
app_name: "Amber",
|
||||
oauth_discovery_url: "https://auth.leaflow.cn/.well-known/openid-configuration",
|
||||
oauth_discovery_url:
|
||||
"https://auth.leaflow.cn/.well-known/openid-configuration",
|
||||
oauth_client_id: "14",
|
||||
oauth_callback_url: "http://localhost:3000/auth/callback",
|
||||
oauth_storage_key: "code_verifier",
|
||||
oauth_scope: "openid profile",
|
||||
backend: "http://localhost:8080"
|
||||
backend: "http://localhost:8080",
|
||||
}),
|
||||
})
|
||||
});
|
||||
|
@ -1,10 +1,10 @@
|
||||
// Utilities
|
||||
import { createPinia } from 'pinia'
|
||||
import { createPinia } from "pinia";
|
||||
|
||||
import piniaPluginPersistedstate from 'pinia-plugin-persistedstate'
|
||||
import piniaPluginPersistedstate from "pinia-plugin-persistedstate";
|
||||
|
||||
const pinia = createPinia()
|
||||
const pinia = createPinia();
|
||||
|
||||
pinia.use(piniaPluginPersistedstate)
|
||||
pinia.use(piniaPluginPersistedstate);
|
||||
|
||||
export default pinia
|
||||
export default pinia;
|
||||
|
@ -24,7 +24,7 @@ export const useUserStore = defineStore("user", {
|
||||
id_token: string,
|
||||
access_token: string,
|
||||
refresh_token: string,
|
||||
expired_at: number
|
||||
expired_at: number,
|
||||
) {
|
||||
let id_token_parts = id_token.split(".");
|
||||
let id_token_payload = JSON.parse(atob(id_token_parts[1]));
|
||||
@ -77,7 +77,7 @@ export const useUserStore = defineStore("user", {
|
||||
response.data.id_token,
|
||||
response.data.access_token,
|
||||
response.data.refresh_token,
|
||||
response.data.expires_in
|
||||
response.data.expires_in,
|
||||
);
|
||||
})
|
||||
.catch((error) => {
|
||||
|
8
src/vite-env.d.ts
vendored
8
src/vite-env.d.ts
vendored
@ -1,7 +1,7 @@
|
||||
/// <reference types="vite/client" />
|
||||
|
||||
declare module '*.vue' {
|
||||
import type { DefineComponent } from 'vue'
|
||||
const component: DefineComponent<{}, {}, any>
|
||||
export default component
|
||||
declare module "*.vue" {
|
||||
import type { DefineComponent } from "vue";
|
||||
const component: DefineComponent<{}, {}, any>;
|
||||
export default component;
|
||||
}
|
||||
|
@ -24,10 +24,7 @@
|
||||
"isolatedModules": true,
|
||||
"skipLibCheck": true
|
||||
},
|
||||
"include": [
|
||||
"src/**/*",
|
||||
"src/**/*.vue"
|
||||
],
|
||||
"include": ["src/**/*", "src/**/*.vue"],
|
||||
"exclude": ["dist", "node_modules", "cypress"],
|
||||
"references": [{ "path": "./tsconfig.node.json" }],
|
||||
"references": [{ "path": "./tsconfig.node.json" }]
|
||||
}
|
||||
|
@ -1,38 +1,38 @@
|
||||
// Plugins
|
||||
import AutoImport from 'unplugin-auto-import/vite'
|
||||
import Components from 'unplugin-vue-components/vite'
|
||||
import Fonts from 'unplugin-fonts/vite'
|
||||
import Layouts from 'vite-plugin-vue-layouts'
|
||||
import Vue from '@vitejs/plugin-vue'
|
||||
import VueRouter from 'unplugin-vue-router/vite'
|
||||
import Vuetify, { transformAssetUrls } from 'vite-plugin-vuetify'
|
||||
import AutoImport from "unplugin-auto-import/vite";
|
||||
import Components from "unplugin-vue-components/vite";
|
||||
import Fonts from "unplugin-fonts/vite";
|
||||
import Layouts from "vite-plugin-vue-layouts";
|
||||
import Vue from "@vitejs/plugin-vue";
|
||||
import VueRouter from "unplugin-vue-router/vite";
|
||||
import Vuetify, { transformAssetUrls } from "vite-plugin-vuetify";
|
||||
|
||||
// Utilities
|
||||
import { defineConfig } from 'vite'
|
||||
import { fileURLToPath, URL } from 'node:url'
|
||||
import { defineConfig } from "vite";
|
||||
import { fileURLToPath, URL } from "node:url";
|
||||
|
||||
// https://vitejs.dev/config/
|
||||
export default defineConfig({
|
||||
plugins: [
|
||||
VueRouter({
|
||||
dts: 'src/typed-router.d.ts',
|
||||
dts: "src/typed-router.d.ts",
|
||||
}),
|
||||
Layouts(),
|
||||
AutoImport({
|
||||
imports: [
|
||||
'vue',
|
||||
"vue",
|
||||
{
|
||||
'vue-router/auto': ['useRoute', 'useRouter'],
|
||||
}
|
||||
"vue-router/auto": ["useRoute", "useRouter"],
|
||||
},
|
||||
],
|
||||
dts: 'src/auto-imports.d.ts',
|
||||
dts: "src/auto-imports.d.ts",
|
||||
eslintrc: {
|
||||
enabled: true,
|
||||
},
|
||||
vueTemplate: true,
|
||||
}),
|
||||
Components({
|
||||
dts: 'src/components.d.ts',
|
||||
dts: "src/components.d.ts",
|
||||
}),
|
||||
Vue({
|
||||
template: { transformAssetUrls },
|
||||
@ -41,34 +41,28 @@ export default defineConfig({
|
||||
Vuetify({
|
||||
autoImport: true,
|
||||
styles: {
|
||||
configFile: 'src/styles/settings.scss',
|
||||
configFile: "src/styles/settings.scss",
|
||||
},
|
||||
}),
|
||||
Fonts({
|
||||
google: {
|
||||
families: [ {
|
||||
name: 'Roboto',
|
||||
styles: 'wght@100;300;400;500;700;900',
|
||||
}],
|
||||
families: [
|
||||
{
|
||||
name: "Roboto",
|
||||
styles: "wght@100;300;400;500;700;900",
|
||||
},
|
||||
],
|
||||
},
|
||||
}),
|
||||
],
|
||||
define: { 'process.env': {} },
|
||||
define: { "process.env": {} },
|
||||
resolve: {
|
||||
alias: {
|
||||
'@': fileURLToPath(new URL('./src', import.meta.url)),
|
||||
"@": fileURLToPath(new URL("./src", import.meta.url)),
|
||||
},
|
||||
extensions: [
|
||||
'.js',
|
||||
'.json',
|
||||
'.jsx',
|
||||
'.mjs',
|
||||
'.ts',
|
||||
'.tsx',
|
||||
'.vue',
|
||||
],
|
||||
extensions: [".js", ".json", ".jsx", ".mjs", ".ts", ".tsx", ".vue"],
|
||||
},
|
||||
server: {
|
||||
port: 3000,
|
||||
},
|
||||
})
|
||||
});
|
||||
|
10
yarn.lock
10
yarn.lock
@ -1289,6 +1289,11 @@ eslint-compat-utils@^0.5.1:
|
||||
dependencies:
|
||||
semver "^7.5.4"
|
||||
|
||||
eslint-config-prettier@^9.1.0:
|
||||
version "9.1.0"
|
||||
resolved "https://mirrors.cloud.tencent.com/npm/eslint-config-prettier/-/eslint-config-prettier-9.1.0.tgz#31af3d94578645966c082fcb71a5846d3c94867f"
|
||||
integrity sha512-NSWl5BFQWEPi1j4TjVNItzYV7dZXZ+wP6I6ZhrBGpChQhZRUaElihE9uRRkcbRnNb76UMKDF3r+WTmNcGPKsqw==
|
||||
|
||||
eslint-config-standard@^17.1.0:
|
||||
version "17.1.0"
|
||||
resolved "https://mirrors.cloud.tencent.com/npm/eslint-config-standard/-/eslint-config-standard-17.1.0.tgz#40ffb8595d47a6b242e07cbfd49dc211ed128975"
|
||||
@ -2401,6 +2406,11 @@ prettier-linter-helpers@^1.0.0:
|
||||
dependencies:
|
||||
fast-diff "^1.1.2"
|
||||
|
||||
prettier@^3.3.3:
|
||||
version "3.3.3"
|
||||
resolved "https://mirrors.cloud.tencent.com/npm/prettier/-/prettier-3.3.3.tgz#30c54fe0be0d8d12e6ae61dbb10109ea00d53105"
|
||||
integrity sha512-i2tDNA0O5IrMO757lfrdQZCc2jPNDVntV0m/+4whiDfWaTKfMNgR7Qz0NAeGz/nRqF4m5/6CLzbP4/liHt12Ew==
|
||||
|
||||
proxy-from-env@^1.1.0:
|
||||
version "1.1.0"
|
||||
resolved "https://mirrors.cloud.tencent.com/npm/proxy-from-env/-/proxy-from-env-1.1.0.tgz#e102f16ca355424865755d2c9e8ea4f24d58c3e2"
|
||||
|
Loading…
Reference in New Issue
Block a user