Base of API - still needs pro implementation.
This commit is contained in:
parent
85887d0371
commit
cf24d90f4b
|
@ -2163,6 +2163,48 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"/applications/{appId}/import": {
|
||||||
|
"post": {
|
||||||
|
"operationId": "appImport",
|
||||||
|
"summary": "Import an app to an existing app",
|
||||||
|
"tags": [
|
||||||
|
"applications"
|
||||||
|
],
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"$ref": "#/components/parameters/appIdUrl"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"requestBody": {
|
||||||
|
"content": {
|
||||||
|
"multipart/form-data": {
|
||||||
|
"schema": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"encryptedPassword": {
|
||||||
|
"description": "Password for the export if it is encrypted.",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"appExport": {
|
||||||
|
"description": "The app export to import.",
|
||||||
|
"type": "string",
|
||||||
|
"format": "binary"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"appExport"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"responses": {
|
||||||
|
"204": {
|
||||||
|
"description": "Application has been updated."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"/applications/search": {
|
"/applications/search": {
|
||||||
"post": {
|
"post": {
|
||||||
"operationId": "appSearch",
|
"operationId": "appSearch",
|
||||||
|
|
|
@ -1763,6 +1763,32 @@ paths:
|
||||||
examples:
|
examples:
|
||||||
deployment:
|
deployment:
|
||||||
$ref: "#/components/examples/deploymentOutput"
|
$ref: "#/components/examples/deploymentOutput"
|
||||||
|
"/applications/{appId}/import":
|
||||||
|
post:
|
||||||
|
operationId: appImport
|
||||||
|
summary: Import an app to an existing app
|
||||||
|
tags:
|
||||||
|
- applications
|
||||||
|
parameters:
|
||||||
|
- $ref: "#/components/parameters/appIdUrl"
|
||||||
|
requestBody:
|
||||||
|
content:
|
||||||
|
multipart/form-data:
|
||||||
|
schema:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
encryptedPassword:
|
||||||
|
description: Password for the export if it is encrypted.
|
||||||
|
type: string
|
||||||
|
appExport:
|
||||||
|
description: The app export to import.
|
||||||
|
type: string
|
||||||
|
format: binary
|
||||||
|
required:
|
||||||
|
- appExport
|
||||||
|
responses:
|
||||||
|
"204":
|
||||||
|
description: Application has been updated.
|
||||||
/applications/search:
|
/applications/search:
|
||||||
post:
|
post:
|
||||||
operationId: appSearch
|
operationId: appSearch
|
||||||
|
|
|
@ -80,6 +80,8 @@ export async function destroy(ctx: UserCtx, next: Next) {
|
||||||
export async function unpublish(ctx: UserCtx, next: Next) {
|
export async function unpublish(ctx: UserCtx, next: Next) {
|
||||||
await context.doInAppContext(ctx.params.appId, async () => {
|
await context.doInAppContext(ctx.params.appId, async () => {
|
||||||
await controller.unpublish(ctx)
|
await controller.unpublish(ctx)
|
||||||
|
ctx.body = undefined
|
||||||
|
ctx.status = 204
|
||||||
await next()
|
await next()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -91,12 +93,23 @@ export async function publish(ctx: UserCtx, next: Next) {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export async function importToApp(ctx: UserCtx, next: Next) {
|
||||||
|
await context.doInAppContext(ctx.params.appId, async () => {
|
||||||
|
// TODO: paid control
|
||||||
|
await controller.importToApp(ctx)
|
||||||
|
ctx.body = undefined
|
||||||
|
ctx.status = 204
|
||||||
|
await next()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
create,
|
create,
|
||||||
update,
|
update,
|
||||||
read,
|
read,
|
||||||
destroy,
|
destroy,
|
||||||
search,
|
search,
|
||||||
publish,
|
|
||||||
unpublish,
|
unpublish,
|
||||||
|
publish,
|
||||||
|
importToApp,
|
||||||
}
|
}
|
||||||
|
|
|
@ -137,6 +137,39 @@ write.push(
|
||||||
new Endpoint("post", "/applications/:appId/publish", controller.publish)
|
new Endpoint("post", "/applications/:appId/publish", controller.publish)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @openapi
|
||||||
|
* /applications/{appId}/import:
|
||||||
|
* post:
|
||||||
|
* operationId: appImport
|
||||||
|
* summary: Import an app to an existing app
|
||||||
|
* tags:
|
||||||
|
* - applications
|
||||||
|
* parameters:
|
||||||
|
* - $ref: '#/components/parameters/appIdUrl'
|
||||||
|
* requestBody:
|
||||||
|
* content:
|
||||||
|
* multipart/form-data:
|
||||||
|
* schema:
|
||||||
|
* type: object
|
||||||
|
* properties:
|
||||||
|
* encryptedPassword:
|
||||||
|
* description: Password for the export if it is encrypted.
|
||||||
|
* type: string
|
||||||
|
* appExport:
|
||||||
|
* description: The app export to import.
|
||||||
|
* type: string
|
||||||
|
* format: binary
|
||||||
|
* required:
|
||||||
|
* - appExport
|
||||||
|
* responses:
|
||||||
|
* 204:
|
||||||
|
* description: Application has been updated.
|
||||||
|
*/
|
||||||
|
write.push(
|
||||||
|
new Endpoint("post", "/applications/:appId/import", controller.importToApp)
|
||||||
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @openapi
|
* @openapi
|
||||||
* /applications/{appId}:
|
* /applications/{appId}:
|
||||||
|
|
|
@ -18,6 +18,9 @@ export interface paths {
|
||||||
"/applications/{appId}/publish": {
|
"/applications/{appId}/publish": {
|
||||||
post: operations["appPublish"];
|
post: operations["appPublish"];
|
||||||
};
|
};
|
||||||
|
"/applications/{appId}/import": {
|
||||||
|
post: operations["appImport"];
|
||||||
|
};
|
||||||
"/applications/search": {
|
"/applications/search": {
|
||||||
/** Based on application properties (currently only name) search for applications. */
|
/** Based on application properties (currently only name) search for applications. */
|
||||||
post: operations["appSearch"];
|
post: operations["appSearch"];
|
||||||
|
@ -889,6 +892,31 @@ export interface operations {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
appImport: {
|
||||||
|
parameters: {
|
||||||
|
path: {
|
||||||
|
/** The ID of the app which this request is targeting. */
|
||||||
|
appId: components["parameters"]["appIdUrl"];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
responses: {
|
||||||
|
/** Application has been updated. */
|
||||||
|
204: never;
|
||||||
|
};
|
||||||
|
requestBody: {
|
||||||
|
content: {
|
||||||
|
"multipart/form-data": {
|
||||||
|
/** @description Password for the export if it is encrypted. */
|
||||||
|
encryptedPassword?: string;
|
||||||
|
/**
|
||||||
|
* Format: binary
|
||||||
|
* @description The app export to import.
|
||||||
|
*/
|
||||||
|
appExport: string;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
/** Based on application properties (currently only name) search for applications. */
|
/** Based on application properties (currently only name) search for applications. */
|
||||||
appSearch: {
|
appSearch: {
|
||||||
responses: {
|
responses: {
|
||||||
|
|
Loading…
Reference in New Issue