@purpleschool/rugpt-lib-common 0.0.28 → 0.0.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/common/command-response.schema.js +11 -0
- package/build/common/index.js +17 -0
- package/build/enums/index.js +1 -0
- package/build/enums/tools-api/commands/index.js +17 -0
- package/build/enums/tools-api/commands/save-file.command.js +20 -0
- package/build/enums/tools-api/index.js +18 -0
- package/build/enums/tools-api/tools-api.amqp.routes.js +6 -0
- package/build/index.js +1 -0
- package/common/command-response.schema.ts +9 -0
- package/common/index.ts +1 -0
- package/enums/index.ts +2 -1
- package/enums/tools-api/commands/index.ts +1 -0
- package/enums/tools-api/commands/save-file.command.ts +27 -0
- package/enums/tools-api/index.ts +2 -0
- package/enums/tools-api/tools-api.amqp.routes.ts +3 -0
- package/index.ts +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ICommandResponseSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const ICommandResponseSchema = (dataSchema) => zod_1.z.object({
|
|
6
|
+
isSuccess: zod_1.z.boolean(),
|
|
7
|
+
data: dataSchema.optional(),
|
|
8
|
+
code: zod_1.z.string().optional(),
|
|
9
|
+
message: zod_1.z.string().optional(),
|
|
10
|
+
});
|
|
11
|
+
exports.ICommandResponseSchema = ICommandResponseSchema;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./command-response.schema"), exports);
|
package/build/enums/index.js
CHANGED
|
@@ -17,3 +17,4 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
17
17
|
__exportStar(require("./ai-model-status.enum"), exports);
|
|
18
18
|
__exportStar(require("./locale.enum"), exports);
|
|
19
19
|
__exportStar(require("./statistics"), exports);
|
|
20
|
+
__exportStar(require("./tools-api"), exports);
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./save-file.command"), exports);
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SaveFileCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const common_1 = require("../../../common");
|
|
6
|
+
var SaveFileCommand;
|
|
7
|
+
(function (SaveFileCommand) {
|
|
8
|
+
SaveFileCommand.RequestSchema = zod_1.z.object({
|
|
9
|
+
userId: zod_1.z.string().uuid().nullable().optional(),
|
|
10
|
+
unregisteredUserId: zod_1.z.string().uuid().nullable().optional(),
|
|
11
|
+
fileUrls: zod_1.z.array(zod_1.z.string().url()).min(1),
|
|
12
|
+
});
|
|
13
|
+
const fileWithUuid = zod_1.z.object({
|
|
14
|
+
uuid: zod_1.z.string().uuid(),
|
|
15
|
+
url: zod_1.z.string().url(),
|
|
16
|
+
});
|
|
17
|
+
SaveFileCommand.ResponseSchema = (0, common_1.ICommandResponseSchema)(zod_1.z.object({
|
|
18
|
+
data: zod_1.z.array(fileWithUuid),
|
|
19
|
+
}));
|
|
20
|
+
})(SaveFileCommand || (exports.SaveFileCommand = SaveFileCommand = {}));
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./commands"), exports);
|
|
18
|
+
__exportStar(require("./tools-api.amqp.routes"), exports);
|
package/build/index.js
CHANGED
|
@@ -16,3 +16,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./enums"), exports);
|
|
18
18
|
__exportStar(require("./errors"), exports);
|
|
19
|
+
__exportStar(require("./common"), exports);
|
package/common/index.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './command-response.schema';
|
package/enums/index.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './save-file.command';
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { ICommandResponseSchema } from "../../../common";
|
|
3
|
+
|
|
4
|
+
export namespace SaveFileCommand {
|
|
5
|
+
export const RequestSchema = z.object({
|
|
6
|
+
userId: z.string().uuid().nullable().optional(),
|
|
7
|
+
unregisteredUserId: z.string().uuid().nullable().optional(),
|
|
8
|
+
fileUrls: z.array(z.string().url()).min(1),
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
12
|
+
|
|
13
|
+
const fileWithUuid = z.object({
|
|
14
|
+
uuid: z.string().uuid(),
|
|
15
|
+
url: z.string().url(),
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
export const ResponseSchema = ICommandResponseSchema(
|
|
19
|
+
z.object({
|
|
20
|
+
data: z.array(
|
|
21
|
+
fileWithUuid
|
|
22
|
+
),
|
|
23
|
+
}),
|
|
24
|
+
);
|
|
25
|
+
|
|
26
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
27
|
+
}
|
package/index.ts
CHANGED