@purpleschool/gptbot 0.8.96 → 0.8.98
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/api/controllers/http/index.ts +1 -0
- package/api/controllers/http/interior-design.ts +14 -0
- package/api/controllers/http/product.ts +1 -0
- package/api/controllers/http/subscription.ts +1 -0
- package/api/routes.ts +36 -0
- package/build/api/controllers/http/index.js +1 -0
- package/build/api/controllers/http/interior-design.js +16 -0
- package/build/api/controllers/http/product.js +1 -0
- package/build/api/controllers/http/subscription.js +1 -0
- package/build/api/routes.js +24 -0
- package/build/commands/product/index.js +1 -0
- package/build/commands/product/refund-product.command.js +15 -0
- package/build/commands/subscription/index.js +1 -0
- package/build/commands/subscription/refund-subscription.command.js +15 -0
- package/build/commands/tools/index.js +1 -0
- package/build/commands/tools/interior-design/delete-all-interior-design-jobs.command.js +8 -0
- package/build/commands/tools/interior-design/delete-interior-design-job-by-uuid.command.js +11 -0
- package/build/commands/tools/interior-design/find-interior-design-job-by-uuid.command.js +14 -0
- package/build/commands/tools/interior-design/find-interior-design-jobs.command.js +18 -0
- package/build/commands/tools/interior-design/get-interior-design-tool-config.command.js +11 -0
- package/build/commands/tools/interior-design/index.js +25 -0
- package/build/commands/tools/interior-design/interior-design.command.js +20 -0
- package/build/commands/tools/interior-design/retry-interior-design-job.command.js +25 -0
- package/build/commands/tools/interior-design/set-reaction-to-interior-design-job.command.js +28 -0
- package/build/commands/tools/interior-design/update-interior-design-job-title.command.js +17 -0
- package/build/constants/errors/errors.js +4411 -2760
- package/build/constants/errors/index.js +1 -1
- package/build/constants/product/enums/product-status.enum.js +1 -0
- package/build/constants/subscription/enums/subscription-feature-type.enum.js +3 -0
- package/build/constants/subscription/enums/subscription-status.enum.js +1 -0
- package/build/constants/tool/enums/tool-type.enum.js +1 -0
- package/build/helpers/index.js +1 -0
- package/build/helpers/interior-design/calculate-interior-design-price.helper.js +13 -0
- package/build/helpers/interior-design/index.js +17 -0
- package/build/models/subscription-feature.schema.js +14 -1
- package/build/models/tools/index.js +1 -0
- package/build/models/tools/interior-design/index.js +19 -0
- package/build/models/tools/interior-design/interior-design-config.schema.js +23 -0
- package/build/models/tools/interior-design/interior-design-job.schema.js +27 -0
- package/build/models/tools/interior-design/interior-design-model.schema.js +33 -0
- package/commands/product/index.ts +1 -0
- package/commands/product/refund-product.command.ts +17 -0
- package/commands/subscription/index.ts +1 -0
- package/commands/subscription/refund-subscription.command.ts +17 -0
- package/commands/tools/index.ts +1 -0
- package/commands/tools/interior-design/delete-all-interior-design-jobs.command.ts +6 -0
- package/commands/tools/interior-design/delete-interior-design-job-by-uuid.command.ts +11 -0
- package/commands/tools/interior-design/find-interior-design-job-by-uuid.command.ts +16 -0
- package/commands/tools/interior-design/find-interior-design-jobs.command.ts +18 -0
- package/commands/tools/interior-design/get-interior-design-tool-config.command.ts +10 -0
- package/commands/tools/interior-design/index.ts +9 -0
- package/commands/tools/interior-design/interior-design.command.ts +21 -0
- package/commands/tools/interior-design/retry-interior-design-job.command.ts +27 -0
- package/commands/tools/interior-design/set-reaction-to-interior-design-job.command.ts +33 -0
- package/commands/tools/interior-design/update-interior-design-job-title.command.ts +19 -0
- package/constants/errors/errors.ts +4451 -2766
- package/constants/errors/index.ts +1 -1
- package/constants/product/enums/product-status.enum.ts +1 -0
- package/constants/subscription/enums/subscription-feature-type.enum.ts +3 -0
- package/constants/subscription/enums/subscription-status.enum.ts +1 -0
- package/constants/tool/enums/tool-type.enum.ts +1 -0
- package/helpers/index.ts +1 -0
- package/helpers/interior-design/calculate-interior-design-price.helper.ts +23 -0
- package/helpers/interior-design/index.ts +1 -0
- package/models/subscription-feature.schema.ts +19 -0
- package/models/tools/index.ts +1 -0
- package/models/tools/interior-design/index.ts +3 -0
- package/models/tools/interior-design/interior-design-config.schema.ts +29 -0
- package/models/tools/interior-design/interior-design-job.schema.ts +32 -0
- package/models/tools/interior-design/interior-design-model.schema.ts +44 -0
- package/package.json +1 -1
|
@@ -14,5 +14,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./errors"), exports);
|
|
18
17
|
__exportStar(require("./verbose"), exports);
|
|
18
|
+
__exportStar(require("./errors"), exports);
|
|
@@ -26,6 +26,8 @@ var SUBSCRIPTION_FEATURE_TYPE;
|
|
|
26
26
|
SUBSCRIPTION_FEATURE_TYPE["WRITER_MODEL_ACCESS"] = "writer_model_access";
|
|
27
27
|
SUBSCRIPTION_FEATURE_TYPE["IMAGE_EDITOR_QUOTA"] = "image_editor_quota";
|
|
28
28
|
SUBSCRIPTION_FEATURE_TYPE["IMAGE_EDITOR_MODEL_ACCESS"] = "image_editor_model_access";
|
|
29
|
+
SUBSCRIPTION_FEATURE_TYPE["INTERIOR_DESIGN_QUOTA"] = "interior_design_quota";
|
|
30
|
+
SUBSCRIPTION_FEATURE_TYPE["INTERIOR_DESIGN_MODEL_ACCESS"] = "interior_design_model_access";
|
|
29
31
|
})(SUBSCRIPTION_FEATURE_TYPE || (exports.SUBSCRIPTION_FEATURE_TYPE = SUBSCRIPTION_FEATURE_TYPE = {}));
|
|
30
32
|
var SUBSCRIPTION_FEATURE_KIND;
|
|
31
33
|
(function (SUBSCRIPTION_FEATURE_KIND) {
|
|
@@ -41,4 +43,5 @@ var SUBSCRIPTION_FEATURE_KIND;
|
|
|
41
43
|
SUBSCRIPTION_FEATURE_KIND["MUSIC"] = "music";
|
|
42
44
|
SUBSCRIPTION_FEATURE_KIND["WRITER"] = "writer";
|
|
43
45
|
SUBSCRIPTION_FEATURE_KIND["IMAGE_EDITOR"] = "image_editor";
|
|
46
|
+
SUBSCRIPTION_FEATURE_KIND["INTERIOR_DESIGN"] = "interior_design";
|
|
44
47
|
})(SUBSCRIPTION_FEATURE_KIND || (exports.SUBSCRIPTION_FEATURE_KIND = SUBSCRIPTION_FEATURE_KIND = {}));
|
|
@@ -14,4 +14,5 @@ var SUBSCRIPTION_STATUS;
|
|
|
14
14
|
SUBSCRIPTION_STATUS["awaiting_downgrade"] = "awaiting_downgrade";
|
|
15
15
|
SUBSCRIPTION_STATUS["downgrade_canceled"] = "downgrade_canceled";
|
|
16
16
|
SUBSCRIPTION_STATUS["deleted"] = "deleted";
|
|
17
|
+
SUBSCRIPTION_STATUS["refunded"] = "refunded";
|
|
17
18
|
})(SUBSCRIPTION_STATUS || (exports.SUBSCRIPTION_STATUS = SUBSCRIPTION_STATUS = {}));
|
package/build/helpers/index.js
CHANGED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.calculateInteriorDesignPrice = calculateInteriorDesignPrice;
|
|
4
|
+
function calculateInteriorDesignPrice({ basePrice, userHasActiveSubscriptionOrProduct, rules, }) {
|
|
5
|
+
let price = basePrice;
|
|
6
|
+
for (const rule of rules !== null && rules !== void 0 ? rules : []) {
|
|
7
|
+
const condition = rule.condition;
|
|
8
|
+
if (condition.withoutSub && userHasActiveSubscriptionOrProduct === false) {
|
|
9
|
+
price += rule.value;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
return price;
|
|
13
|
+
}
|
|
@@ -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("./calculate-interior-design-price.helper"), exports);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SubscriptionFeatureSchema = exports.ImageEditorModelAccessFeatureSchema = exports.ImageEditorQuotaFeatureSchema = exports.WriterModelAccessFeatureSchema = exports.WriterQuotaFeatureSchema = exports.MusicModelAccessFeatureSchema = exports.MusicQuotaFeatureSchema = exports.PresentationQuotaFeatureSchema = exports.VideoModelAccessFeatureSchema = exports.VideoQuotaFeatureSchema = exports.STTQuotaFeatureSchema = exports.STTModelAccessFeatureSchema = exports.TTSQuotaFeatureSchema = exports.ImageGenerationQuotaFeatureSchema = exports.TtsModelAccessFeatureSchema = exports.AdvancedToolsAccessFeatureSchema = exports.WebSearchFeatureSchema = exports.ExtendedContextFeatureSchema = exports.MaxInputLengthFeatureSchema = exports.RequestsQuotaFeatureSchema = exports.AiModelAccessFeatureSchema = exports.CarryoverBalanceFeatureSchema = exports.TokensFeatureSchema = exports.SubscriptionFeatureBaseSchema = void 0;
|
|
3
|
+
exports.SubscriptionFeatureSchema = exports.InteriorDesignModelAccessFeatureSchema = exports.InteriorDesignQuotaFeatureSchema = exports.ImageEditorModelAccessFeatureSchema = exports.ImageEditorQuotaFeatureSchema = exports.WriterModelAccessFeatureSchema = exports.WriterQuotaFeatureSchema = exports.MusicModelAccessFeatureSchema = exports.MusicQuotaFeatureSchema = exports.PresentationQuotaFeatureSchema = exports.VideoModelAccessFeatureSchema = exports.VideoQuotaFeatureSchema = exports.STTQuotaFeatureSchema = exports.STTModelAccessFeatureSchema = exports.TTSQuotaFeatureSchema = exports.ImageGenerationQuotaFeatureSchema = exports.TtsModelAccessFeatureSchema = exports.AdvancedToolsAccessFeatureSchema = exports.WebSearchFeatureSchema = exports.ExtendedContextFeatureSchema = exports.MaxInputLengthFeatureSchema = exports.RequestsQuotaFeatureSchema = exports.AiModelAccessFeatureSchema = exports.CarryoverBalanceFeatureSchema = exports.TokensFeatureSchema = exports.SubscriptionFeatureBaseSchema = void 0;
|
|
4
4
|
const constants_1 = require("../constants");
|
|
5
5
|
const zod_1 = require("zod");
|
|
6
6
|
exports.SubscriptionFeatureBaseSchema = zod_1.z.object({
|
|
@@ -143,6 +143,17 @@ exports.ImageEditorModelAccessFeatureSchema = exports.SubscriptionFeatureBaseSch
|
|
|
143
143
|
isAvailable: zod_1.z.boolean(),
|
|
144
144
|
modelId: zod_1.z.string(),
|
|
145
145
|
});
|
|
146
|
+
exports.InteriorDesignQuotaFeatureSchema = exports.SubscriptionFeatureBaseSchema.extend({
|
|
147
|
+
kind: zod_1.z.literal(constants_1.SUBSCRIPTION_FEATURE_KIND.INTERIOR_DESIGN),
|
|
148
|
+
type: zod_1.z.literal(constants_1.SUBSCRIPTION_FEATURE_TYPE.INTERIOR_DESIGN_QUOTA),
|
|
149
|
+
value: zod_1.z.number(),
|
|
150
|
+
});
|
|
151
|
+
exports.InteriorDesignModelAccessFeatureSchema = exports.SubscriptionFeatureBaseSchema.extend({
|
|
152
|
+
kind: zod_1.z.literal(constants_1.SUBSCRIPTION_FEATURE_KIND.INTERIOR_DESIGN),
|
|
153
|
+
type: zod_1.z.literal(constants_1.SUBSCRIPTION_FEATURE_TYPE.INTERIOR_DESIGN_MODEL_ACCESS),
|
|
154
|
+
isAvailable: zod_1.z.boolean(),
|
|
155
|
+
modelId: zod_1.z.string(),
|
|
156
|
+
});
|
|
146
157
|
exports.SubscriptionFeatureSchema = zod_1.z.union([
|
|
147
158
|
exports.AiModelAccessFeatureSchema,
|
|
148
159
|
exports.RequestsQuotaFeatureSchema,
|
|
@@ -166,4 +177,6 @@ exports.SubscriptionFeatureSchema = zod_1.z.union([
|
|
|
166
177
|
exports.WriterModelAccessFeatureSchema,
|
|
167
178
|
exports.ImageEditorQuotaFeatureSchema,
|
|
168
179
|
exports.ImageEditorModelAccessFeatureSchema,
|
|
180
|
+
exports.InteriorDesignQuotaFeatureSchema,
|
|
181
|
+
exports.InteriorDesignModelAccessFeatureSchema,
|
|
169
182
|
]);
|
|
@@ -0,0 +1,19 @@
|
|
|
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("./interior-design-config.schema"), exports);
|
|
18
|
+
__exportStar(require("./interior-design-job.schema"), exports);
|
|
19
|
+
__exportStar(require("./interior-design-model.schema"), exports);
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.InteriorDesignConfigSchema = exports.InteriorDesignRoomTypesSchema = exports.InteriorDesignStylesSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const interior_design_model_schema_1 = require("./interior-design-model.schema");
|
|
6
|
+
exports.InteriorDesignStylesSchema = zod_1.z.object({
|
|
7
|
+
uuid: zod_1.z.string(),
|
|
8
|
+
title: zod_1.z.string(),
|
|
9
|
+
prompt: zod_1.z.string(),
|
|
10
|
+
sample: zod_1.z.string(),
|
|
11
|
+
order: zod_1.z.number(),
|
|
12
|
+
});
|
|
13
|
+
exports.InteriorDesignRoomTypesSchema = zod_1.z.object({
|
|
14
|
+
uuid: zod_1.z.string(),
|
|
15
|
+
title: zod_1.z.string(),
|
|
16
|
+
prompt: zod_1.z.string(),
|
|
17
|
+
order: zod_1.z.number(),
|
|
18
|
+
});
|
|
19
|
+
exports.InteriorDesignConfigSchema = zod_1.z.object({
|
|
20
|
+
models: zod_1.z.array(interior_design_model_schema_1.InteriorDesignModelSchema),
|
|
21
|
+
styles: zod_1.z.array(exports.InteriorDesignStylesSchema),
|
|
22
|
+
roomTypes: zod_1.z.array(exports.InteriorDesignRoomTypesSchema),
|
|
23
|
+
});
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.InteriorDesignJobSchema = exports.InteriorDesignJobParamsSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const constants_1 = require("../../../constants");
|
|
6
|
+
const tool_job_schema_1 = require("../../tool-job.schema");
|
|
7
|
+
const file_schema_1 = require("../../file.schema");
|
|
8
|
+
const common_1 = require("../common");
|
|
9
|
+
exports.InteriorDesignJobParamsSchema = zod_1.z.object({
|
|
10
|
+
attachedFiles: zod_1.z.array(common_1.AttachedToolFileSchema),
|
|
11
|
+
styleId: zod_1.z.string().optional(),
|
|
12
|
+
roomTypeId: zod_1.z.string().optional(),
|
|
13
|
+
});
|
|
14
|
+
exports.InteriorDesignJobSchema = tool_job_schema_1.ToolJobSchema.extend({
|
|
15
|
+
title: zod_1.z.string(),
|
|
16
|
+
prompt: zod_1.z.string(),
|
|
17
|
+
reaction: zod_1.z.nativeEnum(constants_1.USER_REACTION).nullable(),
|
|
18
|
+
imageUrls: zod_1.z.string().array(),
|
|
19
|
+
images: zod_1.z
|
|
20
|
+
.array(file_schema_1.FileSchema.pick({
|
|
21
|
+
uuid: true,
|
|
22
|
+
url: true,
|
|
23
|
+
}))
|
|
24
|
+
.nullable(),
|
|
25
|
+
params: exports.InteriorDesignJobParamsSchema,
|
|
26
|
+
modelId: zod_1.z.string(),
|
|
27
|
+
});
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.InteriorDesignModelSchema = exports.InteriorDesignModelPricingRulesSchema = exports.InteriorDesignModelPricingRuleConditionSchema = exports.InteriorDesignModelParamsSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const icon_variants_schema_1 = require("../../icon-variants.schema");
|
|
6
|
+
const unlocked_by_subscription_schema_1 = require("../../unlocked-by-subscription.schema");
|
|
7
|
+
exports.InteriorDesignModelParamsSchema = zod_1.z.object({
|
|
8
|
+
imageAttachment: zod_1.z.object({
|
|
9
|
+
supported: zod_1.z.boolean(),
|
|
10
|
+
maxImages: zod_1.z.number(),
|
|
11
|
+
acceptedTypes: zod_1.z.array(zod_1.z.string()),
|
|
12
|
+
}),
|
|
13
|
+
});
|
|
14
|
+
exports.InteriorDesignModelPricingRuleConditionSchema = zod_1.z.object({
|
|
15
|
+
withoutSub: zod_1.z.boolean().optional(),
|
|
16
|
+
});
|
|
17
|
+
exports.InteriorDesignModelPricingRulesSchema = zod_1.z.array(zod_1.z.object({
|
|
18
|
+
condition: exports.InteriorDesignModelPricingRuleConditionSchema,
|
|
19
|
+
value: zod_1.z.number(),
|
|
20
|
+
}));
|
|
21
|
+
exports.InteriorDesignModelSchema = zod_1.z.object({
|
|
22
|
+
uuid: zod_1.z.string(),
|
|
23
|
+
title: zod_1.z.string(),
|
|
24
|
+
description: zod_1.z.string(),
|
|
25
|
+
price: zod_1.z.number(),
|
|
26
|
+
order: zod_1.z.number(),
|
|
27
|
+
icons: icon_variants_schema_1.IconVariantsSchema,
|
|
28
|
+
maxPromptLength: zod_1.z.number(),
|
|
29
|
+
params: exports.InteriorDesignModelParamsSchema,
|
|
30
|
+
pricingRules: exports.InteriorDesignModelPricingRulesSchema,
|
|
31
|
+
unlockedBy: unlocked_by_subscription_schema_1.UnlockedBySchema.nullable(),
|
|
32
|
+
canUse: zod_1.z.boolean(),
|
|
33
|
+
});
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
export namespace RefundProductCommand {
|
|
4
|
+
export const RequestSchema = z.object({
|
|
5
|
+
uuid: z.string().uuid(),
|
|
6
|
+
});
|
|
7
|
+
|
|
8
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
9
|
+
|
|
10
|
+
export const ResponseSchema = z.object({
|
|
11
|
+
data: z.object({
|
|
12
|
+
isSuccess: z.boolean(),
|
|
13
|
+
}),
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
17
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
export namespace RefundSubscriptionCommand {
|
|
4
|
+
export const RequestSchema = z.object({
|
|
5
|
+
uuid: z.string().uuid(),
|
|
6
|
+
});
|
|
7
|
+
|
|
8
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
9
|
+
|
|
10
|
+
export const ResponseSchema = z.object({
|
|
11
|
+
data: z.object({
|
|
12
|
+
isSuccess: z.boolean(),
|
|
13
|
+
}),
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
17
|
+
}
|
package/commands/tools/index.ts
CHANGED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
export namespace DeleteInteriorDesignJobByUuidCommand {
|
|
4
|
+
export const RequestParamsSchema = z.object({
|
|
5
|
+
uuid: z.string().uuid(),
|
|
6
|
+
});
|
|
7
|
+
export type RequestParams = z.infer<typeof RequestParamsSchema>;
|
|
8
|
+
|
|
9
|
+
export const ResponseSchema = z.void();
|
|
10
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { InteriorDesignJobSchema, ToolJobSchema } from '../../../models';
|
|
3
|
+
|
|
4
|
+
export namespace FindInteriorDesignJobByUUIDCommand {
|
|
5
|
+
export const RequestParamsSchema = ToolJobSchema.pick({
|
|
6
|
+
uuid: true,
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
export type Request = z.infer<typeof RequestParamsSchema>;
|
|
10
|
+
|
|
11
|
+
export const ResponseSchema = z.object({
|
|
12
|
+
data: InteriorDesignJobSchema,
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
16
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { InteriorDesignJobSchema } from '../../../models';
|
|
3
|
+
|
|
4
|
+
export namespace FindInteriorDesignJobsCommand {
|
|
5
|
+
export const RequestQuerySchema = z.object({
|
|
6
|
+
limit: z.coerce.number().min(1).optional(),
|
|
7
|
+
offset: z.coerce.number().min(0).default(0).optional(),
|
|
8
|
+
title: z.string().optional(),
|
|
9
|
+
});
|
|
10
|
+
export type RequestQuery = z.infer<typeof RequestQuerySchema>;
|
|
11
|
+
|
|
12
|
+
export const ResponseSchema = z.object({
|
|
13
|
+
data: z.array(InteriorDesignJobSchema),
|
|
14
|
+
totalPages: z.number(),
|
|
15
|
+
page: z.number(),
|
|
16
|
+
});
|
|
17
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
18
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { InteriorDesignConfigSchema } from '../../../models';
|
|
3
|
+
|
|
4
|
+
export namespace GetInteriorDesignToolConfigCommand {
|
|
5
|
+
export const ResponseSchema = z.object({
|
|
6
|
+
data: InteriorDesignConfigSchema,
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export * from './delete-interior-design-job-by-uuid.command';
|
|
2
|
+
export * from './delete-all-interior-design-jobs.command';
|
|
3
|
+
export * from './retry-interior-design-job.command';
|
|
4
|
+
export * from './set-reaction-to-interior-design-job.command';
|
|
5
|
+
export * from './interior-design.command';
|
|
6
|
+
export * from './update-interior-design-job-title.command';
|
|
7
|
+
export * from './find-interior-design-job-by-uuid.command';
|
|
8
|
+
export * from './find-interior-design-jobs.command';
|
|
9
|
+
export * from './get-interior-design-tool-config.command';
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { ToolJobSchema } from '../../../models';
|
|
3
|
+
|
|
4
|
+
export namespace InteriorDesignCommand {
|
|
5
|
+
export const RequestSchema = z.object({
|
|
6
|
+
modelId: z.string().uuid(),
|
|
7
|
+
prompt: z.string(),
|
|
8
|
+
params: z.object({
|
|
9
|
+
imageUrls: z.array(z.string()),
|
|
10
|
+
styleId: z.string().optional(),
|
|
11
|
+
roomTypeId: z.string().optional(),
|
|
12
|
+
}),
|
|
13
|
+
});
|
|
14
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
15
|
+
|
|
16
|
+
export const ResponseSchema = z.object({
|
|
17
|
+
data: ToolJobSchema,
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
21
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { InteriorDesignJobSchema } from '../../../models';
|
|
3
|
+
|
|
4
|
+
export namespace RetryInteriorDesignJobCommand {
|
|
5
|
+
export const RequestParamsSchema = z.object({
|
|
6
|
+
uuid: z.string().uuid(),
|
|
7
|
+
});
|
|
8
|
+
export type RequestParams = z.infer<typeof RequestParamsSchema>;
|
|
9
|
+
|
|
10
|
+
export const RequestBodySchema = z.object({
|
|
11
|
+
modelId: z.string().uuid().optional(),
|
|
12
|
+
prompt: z.string().optional(),
|
|
13
|
+
params: z
|
|
14
|
+
.object({
|
|
15
|
+
attachedFiles: z.string().array(),
|
|
16
|
+
styleId: z.string().optional(),
|
|
17
|
+
roomTypeId: z.string().optional(),
|
|
18
|
+
})
|
|
19
|
+
.optional(),
|
|
20
|
+
});
|
|
21
|
+
export type RequestBody = z.infer<typeof RequestBodySchema>;
|
|
22
|
+
|
|
23
|
+
export const ResponseSchema = z.object({
|
|
24
|
+
data: InteriorDesignJobSchema,
|
|
25
|
+
});
|
|
26
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
27
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { InteriorDesignJobSchema } from '../../../models';
|
|
3
|
+
import { USER_REACTION } from '../../../constants';
|
|
4
|
+
|
|
5
|
+
export namespace SetReactionToInteriorDesignJobCommand {
|
|
6
|
+
export const RequestSchema = z
|
|
7
|
+
.object({
|
|
8
|
+
reaction: z.nativeEnum(USER_REACTION).nullable(),
|
|
9
|
+
dislikeReason: z.string().nullable().default(null),
|
|
10
|
+
})
|
|
11
|
+
.refine(
|
|
12
|
+
(data) => {
|
|
13
|
+
if (data.reaction !== USER_REACTION.DISLIKED && data.dislikeReason) {
|
|
14
|
+
return false;
|
|
15
|
+
}
|
|
16
|
+
return true;
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
message: 'Dislike reason is not allowed when reaction is not DISLIKED',
|
|
20
|
+
},
|
|
21
|
+
);
|
|
22
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
23
|
+
|
|
24
|
+
export const RequestParamsSchema = z.object({
|
|
25
|
+
uuid: z.string().uuid(),
|
|
26
|
+
});
|
|
27
|
+
export type RequestParams = z.infer<typeof RequestParamsSchema>;
|
|
28
|
+
|
|
29
|
+
export const ResponseSchema = z.object({
|
|
30
|
+
data: InteriorDesignJobSchema,
|
|
31
|
+
});
|
|
32
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
33
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { InteriorDesignJobSchema } from '../../../models';
|
|
3
|
+
|
|
4
|
+
export namespace UpdateInteriorDesignJobTitleCommand {
|
|
5
|
+
export const RequestSchema = z.object({
|
|
6
|
+
title: z.string().min(1).max(40).trim(),
|
|
7
|
+
});
|
|
8
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
9
|
+
|
|
10
|
+
export const RequestParamsSchema = z.object({
|
|
11
|
+
uuid: z.string().uuid(),
|
|
12
|
+
});
|
|
13
|
+
export type RequestParams = z.infer<typeof RequestParamsSchema>;
|
|
14
|
+
|
|
15
|
+
export const ResponseSchema = z.object({
|
|
16
|
+
data: InteriorDesignJobSchema,
|
|
17
|
+
});
|
|
18
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
19
|
+
}
|