biz-slide-core 1.2.131 → 1.2.132

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.
@@ -19,4 +19,5 @@ export * from "./cron.entity";
19
19
  export * from "./prompt.entity";
20
20
  export * from "./ppt-ftp.entity";
21
21
  export * from "./ppt-system.entity";
22
+ export * from "./slidev2.entity";
22
23
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/entity/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC;AAC7B,cAAc,uBAAuB,CAAC;AACtC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,wBAAwB,CAAC;AACvC,cAAc,eAAe,CAAC;AAC9B,cAAc,yBAAyB,CAAC;AACxC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,0BAA0B,CAAC;AACzC,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/entity/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC;AAC7B,cAAc,uBAAuB,CAAC;AACtC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,wBAAwB,CAAC;AACvC,cAAc,eAAe,CAAC;AAC9B,cAAc,yBAAyB,CAAC;AACxC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,0BAA0B,CAAC;AACzC,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAA"}
@@ -35,3 +35,4 @@ __exportStar(require("./cron.entity"), exports);
35
35
  __exportStar(require("./prompt.entity"), exports);
36
36
  __exportStar(require("./ppt-ftp.entity"), exports);
37
37
  __exportStar(require("./ppt-system.entity"), exports);
38
+ __exportStar(require("./slidev2.entity"), exports);
@@ -0,0 +1,54 @@
1
+ /// <reference types="mongoose/types/aggregate" />
2
+ /// <reference types="mongoose/types/callback" />
3
+ /// <reference types="mongoose/types/collection" />
4
+ /// <reference types="mongoose/types/connection" />
5
+ /// <reference types="mongoose/types/cursor" />
6
+ /// <reference types="mongoose/types/document" />
7
+ /// <reference types="mongoose/types/error" />
8
+ /// <reference types="mongoose/types/expressions" />
9
+ /// <reference types="mongoose/types/helpers" />
10
+ /// <reference types="mongoose/types/middlewares" />
11
+ /// <reference types="mongoose/types/indexes" />
12
+ /// <reference types="mongoose/types/models" />
13
+ /// <reference types="mongoose/types/mongooseoptions" />
14
+ /// <reference types="mongoose/types/pipelinestage" />
15
+ /// <reference types="mongoose/types/populate" />
16
+ /// <reference types="mongoose/types/query" />
17
+ /// <reference types="mongoose/types/schemaoptions" />
18
+ /// <reference types="mongoose/types/schematypes" />
19
+ /// <reference types="mongoose/types/session" />
20
+ /// <reference types="mongoose/types/types" />
21
+ /// <reference types="mongoose/types/utility" />
22
+ /// <reference types="mongoose/types/validation" />
23
+ /// <reference types="mongoose/types/virtuals" />
24
+ /// <reference types="mongoose/types/inferschematype" />
25
+ import { Types } from "mongoose";
26
+ export type MetaType = "text" | "image" | "shape" | "table" | "chart" | "gradient" | "list";
27
+ interface ILayer {
28
+ id: string;
29
+ metaType: MetaType;
30
+ optionsMeta: any;
31
+ chatMeta: any;
32
+ layers?: ILayer[];
33
+ }
34
+ export interface ISlideV2Schema {
35
+ name: string;
36
+ postfix: string;
37
+ rules: string;
38
+ slideLayoutId: Types.ObjectId;
39
+ templateId: Types.ObjectId;
40
+ layers: ILayer[];
41
+ deletedAt: Date;
42
+ isDelete: boolean;
43
+ createdAt: Date;
44
+ updatedAt: Date;
45
+ published: boolean;
46
+ stage: string;
47
+ isDefault: boolean;
48
+ category: string;
49
+ }
50
+ export declare const SlideV2Model: import("mongoose").Model<ISlideV2Schema, {}, {}, {}, import("mongoose").Document<unknown, {}, ISlideV2Schema> & ISlideV2Schema & {
51
+ _id: Types.ObjectId;
52
+ }, any>;
53
+ export {};
54
+ //# sourceMappingURL=slidev2.entity.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"slidev2.entity.d.ts","sourceRoot":"","sources":["../../src/entity/slidev2.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAiB,KAAK,EAAE,MAAM,UAAU,CAAC;AAEhD,MAAM,MAAM,QAAQ,GAChB,MAAM,GACN,OAAO,GACP,OAAO,GACP,OAAO,GACP,OAAO,GACP,UAAU,GACV,MAAM,CAAC;AAEX,UAAU,MAAM;IACd,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,QAAQ,CAAC;IACnB,WAAW,EAAE,GAAG,CAAC;IACjB,QAAQ,EAAE,GAAG,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;CACnB;AAqCD,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,aAAa,EAAE,KAAK,CAAC,QAAQ,CAAC;IAC9B,UAAU,EAAE,KAAK,CAAC,QAAQ,CAAC;IAC3B,MAAM,EAAE,MAAM,EAAE,CAAC;IAEjB,SAAS,EAAE,IAAI,CAAC;IAChB,QAAQ,EAAE,OAAO,CAAC;IAElB,SAAS,EAAE,IAAI,CAAC;IAChB,SAAS,EAAE,IAAI,CAAC;IAEhB,SAAS,EAAE,OAAO,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,OAAO,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;CAClB;AA4BD,eAAO,MAAM,YAAY;;OAAgD,CAAC"}
@@ -0,0 +1,53 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SlideV2Model = void 0;
4
+ const mongoose_1 = require("mongoose");
5
+ const LayerSchemaFields = {
6
+ id: { type: String, required: true },
7
+ metaType: {
8
+ type: String,
9
+ required: true,
10
+ enum: ["text", "image", "shape", "table", "chart", "gradient", "list"],
11
+ },
12
+ optionsMeta: { type: mongoose_1.Schema.Types.Mixed, default: {} },
13
+ chatMeta: { type: mongoose_1.Schema.Types.Mixed, default: {} },
14
+ };
15
+ const LayerSchema = new mongoose_1.Schema(LayerSchemaFields, {
16
+ _id: false,
17
+ timestamps: false,
18
+ });
19
+ LayerSchema.add({
20
+ layers: { type: [LayerSchema], default: undefined },
21
+ });
22
+ LayerSchema.pre("validate", function (next) {
23
+ const hasNested = Array.isArray(this.layers) && this.layers.length > 0;
24
+ if (hasNested && this.metaType !== "list") {
25
+ return next(new Error(`Only metaType "list" may have nested layers. Found "${this.metaType}".`));
26
+ }
27
+ if (this.metaType === "list" && this.layers && !Array.isArray(this.layers)) {
28
+ return next(new Error(`Layer.layers must be an array when metaType is "list".`));
29
+ }
30
+ next();
31
+ });
32
+ const SlideSchema = new mongoose_1.Schema({
33
+ name: { type: String, default: "", required: true },
34
+ published: { type: Boolean, default: false },
35
+ postfix: { type: String, default: "" },
36
+ rules: { type: String, default: "" },
37
+ layers: { type: [LayerSchema], default: [] },
38
+ slideLayoutId: { type: mongoose_1.Schema.Types.ObjectId, ref: "slide-layout" },
39
+ templateId: { type: mongoose_1.Schema.Types.ObjectId, ref: "template" },
40
+ deletedAt: { type: Date, default: null },
41
+ isDelete: { type: Boolean, default: false },
42
+ stage: { type: String, default: "" },
43
+ isDefault: { type: Boolean, default: false },
44
+ category: { type: String, default: "Default" }
45
+ }, {
46
+ timestamps: true,
47
+ });
48
+ SlideSchema.index({ name: 1, slideLayoutId: 1, templateId: 1 });
49
+ SlideSchema.index({ slideLayoutId: 1, templateId: 1 });
50
+ SlideSchema.index({ templateId: 1 });
51
+ SlideSchema.index({ name: 1, templateId: 1, slideLayoutId: 1, published: 1 });
52
+ SlideSchema.index({ slideLayoutId: 1, templateId: 1, published: 1, isDelete: 1 });
53
+ exports.SlideV2Model = (0, mongoose_1.model)("slidev2", SlideSchema);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "biz-slide-core",
3
- "version": "1.2.131",
3
+ "version": "1.2.132",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",