@solidxai/core 0.1.8-beta.4 → 0.1.8-beta.6

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.
Files changed (26) hide show
  1. package/dist/entities/agent-event.entity.d.ts +3 -12
  2. package/dist/entities/agent-event.entity.d.ts.map +1 -1
  3. package/dist/entities/agent-event.entity.js +20 -45
  4. package/dist/entities/agent-event.entity.js.map +1 -1
  5. package/dist/entities/agent-session.entity.d.ts +2 -11
  6. package/dist/entities/agent-session.entity.d.ts.map +1 -1
  7. package/dist/entities/agent-session.entity.js +14 -39
  8. package/dist/entities/agent-session.entity.js.map +1 -1
  9. package/dist/entities/legacy-common.entity.d.ts +9 -9
  10. package/dist/entities/legacy-common.entity.d.ts.map +1 -1
  11. package/dist/entities/legacy-common.entity.js +7 -7
  12. package/dist/entities/legacy-common.entity.js.map +1 -1
  13. package/dist/helpers/typeorm-db-helper.d.ts.map +1 -1
  14. package/dist/helpers/typeorm-db-helper.js +9 -0
  15. package/dist/helpers/typeorm-db-helper.js.map +1 -1
  16. package/dist/seeders/seed-data/solid-core-metadata.json +0 -92
  17. package/dist/services/settings/default-settings-provider.service.d.ts.map +1 -1
  18. package/dist/services/settings/default-settings-provider.service.js +5 -2
  19. package/dist/services/settings/default-settings-provider.service.js.map +1 -1
  20. package/package.json +1 -1
  21. package/src/entities/agent-event.entity.ts +20 -54
  22. package/src/entities/agent-session.entity.ts +14 -46
  23. package/src/entities/legacy-common.entity.ts +15 -15
  24. package/src/helpers/typeorm-db-helper.ts +11 -0
  25. package/src/seeders/seed-data/solid-core-metadata.json +0 -92
  26. package/src/services/settings/default-settings-provider.service.ts +5 -2
@@ -1,10 +1,10 @@
1
- export declare class AgentEvent {
2
- id: number;
1
+ import { CommonEntity } from 'src/entities/common.entity';
2
+ export declare class AgentEvent extends CommonEntity {
3
3
  sessionId: string;
4
4
  turnNumber: number;
5
5
  stepNumber: number;
6
6
  eventType: string;
7
- eventData: string;
7
+ eventData: any;
8
8
  content: string;
9
9
  toolName: string;
10
10
  toolArguments: string;
@@ -15,14 +15,5 @@ export declare class AgentEvent {
15
15
  inputTokens: number;
16
16
  outputTokens: number;
17
17
  modelUsed: string;
18
- createdAt: Date;
19
- updatedAt: Date;
20
- deletedAt: Date;
21
- deletedTracker: string;
22
- publishedAt: Date;
23
- localeName: string;
24
- defaultEntityLocaleId: number;
25
- createdBy: number;
26
- updatedBy: number;
27
18
  }
28
19
  //# sourceMappingURL=agent-event.entity.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"agent-event.entity.d.ts","sourceRoot":"","sources":["../../src/entities/agent-event.entity.ts"],"names":[],"mappings":"AAGA,qBAEa,UAAU;IAGrB,EAAE,EAAE,MAAM,CAAC;IAKX,SAAS,EAAE,MAAM,CAAC;IAIlB,UAAU,EAAE,MAAM,CAAC;IAInB,UAAU,EAAE,MAAM,CAAC;IAKnB,SAAS,EAAE,MAAM,CAAC;IAIlB,SAAS,EAAE,MAAM,CAAC;IAIlB,OAAO,EAAE,MAAM,CAAC;IAKhB,QAAQ,EAAE,MAAM,CAAC;IAIjB,aAAa,EAAE,MAAM,CAAC;IAItB,UAAU,EAAE,MAAM,CAAC;IAInB,cAAc,EAAE,MAAM,CAAC;IAIvB,UAAU,EAAE,MAAM,CAAC;IAInB,IAAI,EAAE,MAAM,CAAC;IAIb,WAAW,EAAE,MAAM,CAAC;IAIpB,YAAY,EAAE,MAAM,CAAC;IAIrB,SAAS,EAAE,MAAM,CAAC;IAIlB,SAAS,EAAE,IAAI,CAAC;IAIhB,SAAS,EAAE,IAAI,CAAC;IAChB,SAAS,EAAE,IAAI,CAAC;IAChB,cAAc,EAAE,MAAM,CAAC;IACvB,WAAW,EAAE,IAAI,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,qBAAqB,EAAE,MAAM,CAAC;IAC9B,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACnB"}
1
+ {"version":3,"file":"agent-event.entity.d.ts","sourceRoot":"","sources":["../../src/entities/agent-event.entity.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAG1D,qBACa,UAAW,SAAQ,YAAY;IAG1C,SAAS,EAAE,MAAM,CAAC;IAGlB,UAAU,EAAE,MAAM,CAAC;IAGnB,UAAU,EAAE,MAAM,CAAC;IAInB,SAAS,EAAE,MAAM,CAAC;IAGlB,SAAS,EAAE,GAAG,CAAC;IAGf,OAAO,EAAE,MAAM,CAAC;IAIhB,QAAQ,EAAE,MAAM,CAAC;IAGjB,aAAa,EAAE,MAAM,CAAC;IAGtB,UAAU,EAAE,MAAM,CAAC;IAGnB,cAAc,EAAE,MAAM,CAAC;IAGvB,UAAU,EAAE,MAAM,CAAC;IAGnB,IAAI,EAAE,MAAM,CAAC;IAGb,WAAW,EAAE,MAAM,CAAC;IAGpB,YAAY,EAAE,MAAM,CAAC;IAGrB,SAAS,EAAE,MAAM,CAAC;CACnB"}
@@ -12,103 +12,78 @@ Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.AgentEvent = void 0;
13
13
  const openapi = require("@nestjs/swagger");
14
14
  const typeorm_1 = require("typeorm");
15
- const class_transformer_1 = require("class-transformer");
16
- let AgentEvent = class AgentEvent {
15
+ const common_entity_1 = require("./common.entity");
16
+ const typeorm_db_helper_1 = require("../helpers/typeorm-db-helper");
17
+ let AgentEvent = class AgentEvent extends common_entity_1.CommonEntity {
17
18
  static _OPENAPI_METADATA_FACTORY() {
18
- return { id: { required: true, type: () => Number }, sessionId: { required: true, type: () => String }, turnNumber: { required: true, type: () => Number }, stepNumber: { required: true, type: () => Number }, eventType: { required: true, type: () => String }, eventData: { required: true, type: () => String }, content: { required: true, type: () => String }, toolName: { required: true, type: () => String }, toolArguments: { required: true, type: () => String }, toolOutput: { required: true, type: () => String }, toolReturncode: { required: true, type: () => Number }, durationMs: { required: true, type: () => Number }, cost: { required: true, type: () => Number }, inputTokens: { required: true, type: () => Number }, outputTokens: { required: true, type: () => Number }, modelUsed: { required: true, type: () => String }, createdAt: { required: true, type: () => Date }, updatedAt: { required: true, type: () => Date }, deletedAt: { required: true, type: () => Date }, deletedTracker: { required: true, type: () => String }, publishedAt: { required: true, type: () => Date }, localeName: { required: true, type: () => String }, defaultEntityLocaleId: { required: true, type: () => Number }, createdBy: { required: true, type: () => Number }, updatedBy: { required: true, type: () => Number } };
19
+ return { sessionId: { required: true, type: () => String }, turnNumber: { required: true, type: () => Number }, stepNumber: { required: true, type: () => Number }, eventType: { required: true, type: () => String }, eventData: { required: true, type: () => Object }, content: { required: true, type: () => String }, toolName: { required: true, type: () => String }, toolArguments: { required: true, type: () => String }, toolOutput: { required: true, type: () => String }, toolReturncode: { required: true, type: () => Number }, durationMs: { required: true, type: () => Number }, cost: { required: true, type: () => Number }, inputTokens: { required: true, type: () => Number }, outputTokens: { required: true, type: () => Number }, modelUsed: { required: true, type: () => String } };
19
20
  }
20
21
  };
21
22
  exports.AgentEvent = AgentEvent;
22
23
  __decorate([
23
- (0, class_transformer_1.Expose)(),
24
- (0, typeorm_1.PrimaryGeneratedColumn)({ type: 'integer' }),
25
- __metadata("design:type", Number)
26
- ], AgentEvent.prototype, "id", void 0);
27
- __decorate([
28
- (0, class_transformer_1.Expose)(),
29
24
  (0, typeorm_1.Index)(),
30
- (0, typeorm_1.Column)({ type: 'varchar', length: 36, name: 'session_id' }),
25
+ (0, typeorm_1.Column)({}),
31
26
  __metadata("design:type", String)
32
27
  ], AgentEvent.prototype, "sessionId", void 0);
33
28
  __decorate([
34
- (0, class_transformer_1.Expose)(),
35
- (0, typeorm_1.Column)({ type: 'integer', name: 'turn_number' }),
29
+ (0, typeorm_1.Column)({}),
36
30
  __metadata("design:type", Number)
37
31
  ], AgentEvent.prototype, "turnNumber", void 0);
38
32
  __decorate([
39
- (0, class_transformer_1.Expose)(),
40
- (0, typeorm_1.Column)({ type: 'integer', nullable: true, name: 'step_number' }),
33
+ (0, typeorm_1.Column)({ nullable: true }),
41
34
  __metadata("design:type", Number)
42
35
  ], AgentEvent.prototype, "stepNumber", void 0);
43
36
  __decorate([
44
- (0, class_transformer_1.Expose)(),
45
37
  (0, typeorm_1.Index)(),
46
- (0, typeorm_1.Column)({ type: 'varchar', length: 64, name: 'event_type' }),
38
+ (0, typeorm_1.Column)({}),
47
39
  __metadata("design:type", String)
48
40
  ], AgentEvent.prototype, "eventType", void 0);
49
41
  __decorate([
50
- (0, class_transformer_1.Expose)(),
51
- (0, typeorm_1.Column)({ type: 'text', nullable: true, name: 'event_data' }),
52
- __metadata("design:type", String)
42
+ (0, typeorm_1.Column)({ type: "simple-json", nullable: true, ...(0, typeorm_db_helper_1.getColumnType)('simpleJsonLargeText') }),
43
+ __metadata("design:type", Object)
53
44
  ], AgentEvent.prototype, "eventData", void 0);
54
45
  __decorate([
55
- (0, class_transformer_1.Expose)(),
56
- (0, typeorm_1.Column)({ type: 'text', nullable: true, name: 'content' }),
46
+ (0, typeorm_1.Column)({ nullable: true, ...(0, typeorm_db_helper_1.getColumnType)('longText') }),
57
47
  __metadata("design:type", String)
58
48
  ], AgentEvent.prototype, "content", void 0);
59
49
  __decorate([
60
- (0, class_transformer_1.Expose)(),
61
50
  (0, typeorm_1.Index)(),
62
- (0, typeorm_1.Column)({ type: 'varchar', length: 128, nullable: true, name: 'tool_name' }),
51
+ (0, typeorm_1.Column)({ nullable: true }),
63
52
  __metadata("design:type", String)
64
53
  ], AgentEvent.prototype, "toolName", void 0);
65
54
  __decorate([
66
- (0, class_transformer_1.Expose)(),
67
- (0, typeorm_1.Column)({ type: 'text', nullable: true, name: 'tool_arguments' }),
55
+ (0, typeorm_1.Column)({ type: "simple-json", nullable: true, ...(0, typeorm_db_helper_1.getColumnType)('simpleJsonLargeText') }),
68
56
  __metadata("design:type", String)
69
57
  ], AgentEvent.prototype, "toolArguments", void 0);
70
58
  __decorate([
71
- (0, class_transformer_1.Expose)(),
72
- (0, typeorm_1.Column)({ type: 'text', nullable: true, name: 'tool_output' }),
59
+ (0, typeorm_1.Column)({ nullable: true, ...(0, typeorm_db_helper_1.getColumnType)('longText') }),
73
60
  __metadata("design:type", String)
74
61
  ], AgentEvent.prototype, "toolOutput", void 0);
75
62
  __decorate([
76
- (0, class_transformer_1.Expose)(),
77
- (0, typeorm_1.Column)({ type: 'integer', nullable: true, name: 'tool_returncode' }),
63
+ (0, typeorm_1.Column)({ nullable: true }),
78
64
  __metadata("design:type", Number)
79
65
  ], AgentEvent.prototype, "toolReturncode", void 0);
80
66
  __decorate([
81
- (0, class_transformer_1.Expose)(),
82
- (0, typeorm_1.Column)({ type: 'double precision', nullable: true, name: 'duration_ms' }),
67
+ (0, typeorm_1.Column)({ nullable: true, ...(0, typeorm_db_helper_1.getColumnType)('decimal') }),
83
68
  __metadata("design:type", Number)
84
69
  ], AgentEvent.prototype, "durationMs", void 0);
85
70
  __decorate([
86
- (0, class_transformer_1.Expose)(),
87
- (0, typeorm_1.Column)({ type: 'double precision', nullable: true, name: 'cost' }),
71
+ (0, typeorm_1.Column)({ nullable: true, ...(0, typeorm_db_helper_1.getColumnType)('decimal') }),
88
72
  __metadata("design:type", Number)
89
73
  ], AgentEvent.prototype, "cost", void 0);
90
74
  __decorate([
91
- (0, class_transformer_1.Expose)(),
92
- (0, typeorm_1.Column)({ type: 'integer', nullable: true, name: 'input_tokens' }),
75
+ (0, typeorm_1.Column)({ nullable: true }),
93
76
  __metadata("design:type", Number)
94
77
  ], AgentEvent.prototype, "inputTokens", void 0);
95
78
  __decorate([
96
- (0, class_transformer_1.Expose)(),
97
- (0, typeorm_1.Column)({ type: 'integer', nullable: true, name: 'output_tokens' }),
79
+ (0, typeorm_1.Column)({ nullable: true }),
98
80
  __metadata("design:type", Number)
99
81
  ], AgentEvent.prototype, "outputTokens", void 0);
100
82
  __decorate([
101
- (0, class_transformer_1.Expose)(),
102
- (0, typeorm_1.Column)({ type: 'varchar', length: 255, nullable: true, name: 'model_used' }),
83
+ (0, typeorm_1.Column)({ nullable: true }),
103
84
  __metadata("design:type", String)
104
85
  ], AgentEvent.prototype, "modelUsed", void 0);
105
- __decorate([
106
- (0, class_transformer_1.Expose)(),
107
- (0, typeorm_1.Column)({ type: 'timestamp without time zone', name: 'created_at' }),
108
- __metadata("design:type", Date)
109
- ], AgentEvent.prototype, "createdAt", void 0);
110
86
  exports.AgentEvent = AgentEvent = __decorate([
111
- (0, class_transformer_1.Exclude)(),
112
87
  (0, typeorm_1.Entity)({ name: 'ss_agent_events', synchronize: false })
113
88
  ], AgentEvent);
114
89
  //# sourceMappingURL=agent-event.entity.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"agent-event.entity.js","sourceRoot":"","sources":["../../src/entities/agent-event.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,qCAAwE;AACxE,yDAAoD;AAI7C,IAAM,UAAU,GAAhB,MAAM,UAAU;;;;CAkFtB,CAAA;AAlFY,gCAAU;AAGrB;IAFC,IAAA,0BAAM,GAAE;IACR,IAAA,gCAAsB,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;;sCACjC;AAKX;IAHC,IAAA,0BAAM,GAAE;IACR,IAAA,eAAK,GAAE;IACP,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC;;6CAC1C;AAIlB;IAFC,IAAA,0BAAM,GAAE;IACR,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,aAAa,EAAE,CAAC;;8CAC9B;AAInB;IAFC,IAAA,0BAAM,GAAE;IACR,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,aAAa,EAAE,CAAC;;8CAC9C;AAKnB;IAHC,IAAA,0BAAM,GAAE;IACR,IAAA,eAAK,GAAE;IACP,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAA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,EAAE,IAAI,EAAE,kBAAkB,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;wCACtD;AAIb;IAFC,IAAA,0BAAM,GAAE;IACR,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,cAAc,EAAE,CAAC;;+CAC9C;AAIpB;IAFC,IAAA,0BAAM,GAAE;IACR,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,eAAe,EAAE,CAAC;;gDAC9C;AAIrB;IAFC,IAAA,0BAAM,GAAE;IACR,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC;;6CAC3D;AAIlB;IAFC,IAAA,0BAAM,GAAE;IACR,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,6BAA6B,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC;8BACzD,IAAI;6CAAC;qBAtEL,UAAU;IAFtB,IAAA,2BAAO,GAAE;IACT,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,iBAAiB,EAAE,WAAW,EAAE,KAAK,EAAE,CAAC;GAC3C,UAAU,CAkFtB","sourcesContent":["import { Column, Entity, Index, PrimaryGeneratedColumn } from 'typeorm';\nimport { Expose, Exclude } from 'class-transformer';\n\n@Exclude()\n@Entity({ name: 'ss_agent_events', synchronize: false })\nexport class AgentEvent {\n @Expose()\n @PrimaryGeneratedColumn({ type: 'integer' })\n id: number;\n\n @Expose()\n @Index()\n @Column({ type: 'varchar', length: 36, name: 'session_id' })\n sessionId: string;\n\n @Expose()\n @Column({ type: 'integer', name: 'turn_number' })\n turnNumber: number;\n\n @Expose()\n @Column({ type: 'integer', nullable: true, name: 'step_number' })\n stepNumber: number;\n\n @Expose()\n @Index()\n @Column({ type: 'varchar', length: 64, name: 'event_type' })\n eventType: string;\n\n @Expose()\n @Column({ type: 'text', nullable: true, name: 'event_data' })\n eventData: string;\n\n @Expose()\n @Column({ type: 'text', nullable: true, name: 'content' })\n content: string;\n\n @Expose()\n @Index()\n @Column({ type: 'varchar', length: 128, nullable: true, name: 'tool_name' })\n toolName: string;\n\n @Expose()\n @Column({ type: 'text', nullable: true, name: 'tool_arguments' })\n toolArguments: string;\n\n @Expose()\n @Column({ type: 'text', nullable: true, name: 'tool_output' })\n toolOutput: string;\n\n @Expose()\n @Column({ type: 'integer', nullable: true, name: 'tool_returncode' })\n toolReturncode: number;\n\n @Expose()\n @Column({ type: 'double precision', nullable: true, name: 'duration_ms' })\n durationMs: number;\n\n @Expose()\n @Column({ type: 'double precision', nullable: true, name: 'cost' })\n cost: number;\n\n @Expose()\n @Column({ type: 'integer', nullable: true, name: 'input_tokens' })\n inputTokens: number;\n\n @Expose()\n @Column({ type: 'integer', nullable: true, name: 'output_tokens' })\n outputTokens: number;\n\n @Expose()\n @Column({ type: 'varchar', length: 255, nullable: true, name: 'model_used' })\n modelUsed: string;\n\n @Expose()\n @Column({ type: 'timestamp without time zone', name: 'created_at' })\n createdAt: Date;\n\n // The following properties satisfy CRUDService<T extends CommonEntity> structural typing\n // They are not mapped to DB columns (synchronize: false ensures no schema changes)\n updatedAt: Date;\n deletedAt: Date;\n deletedTracker: string;\n publishedAt: Date;\n localeName: string;\n defaultEntityLocaleId: number;\n createdBy: number;\n updatedBy: number;\n}\n"]}
1
+ {"version":3,"file":"agent-event.entity.js","sourceRoot":"","sources":["../../src/entities/agent-event.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,qCAAgD;AAChD,mDAA0D;AAC1D,oEAA8D;AAGvD,IAAM,UAAU,GAAhB,MAAM,UAAW,SAAQ,4BAAY;;;;CAgD3C,CAAA;AAhDY,gCAAU;AAGrB;IAFC,IAAA,eAAK,GAAE;IACP,IAAA,gBAAM,EA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AAE,CAAC;;+CACP;AAGpB;IADC,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;gDACN;AAGrB;IADC,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;6CACT;qBA/CP,UAAU;IADtB,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,iBAAiB,EAAE,WAAW,EAAE,KAAK,EAAE,CAAC;GAC3C,UAAU,CAgDtB","sourcesContent":["import { Column, Entity, Index } from 'typeorm';\nimport { CommonEntity } from 'src/entities/common.entity';\nimport { getColumnType } from 'src/helpers/typeorm-db-helper';\n\n@Entity({ name: 'ss_agent_events', synchronize: false })\nexport class AgentEvent extends CommonEntity {\n @Index()\n @Column({ })\n sessionId: string;\n\n @Column({ })\n turnNumber: number;\n\n @Column({ nullable: true })\n stepNumber: number;\n\n @Index()\n @Column({ })\n eventType: string;\n\n @Column({ type: \"simple-json\", nullable: true, ...getColumnType('simpleJsonLargeText') })\n eventData: any;\n\n @Column({ nullable: true, ...getColumnType('longText') })\n content: string;\n\n @Index()\n @Column({ nullable: true })\n toolName: string;\n\n @Column({ type: \"simple-json\", nullable: true, ...getColumnType('simpleJsonLargeText') })\n toolArguments: string;\n\n @Column({ nullable: true, ...getColumnType('longText') })\n toolOutput: string;\n\n @Column({ nullable: true })\n toolReturncode: number;\n\n @Column({ nullable: true, ...getColumnType('decimal') })\n durationMs: number;\n\n @Column({ nullable: true, ...getColumnType('decimal') })\n cost: number;\n\n @Column({ nullable: true })\n inputTokens: number;\n\n @Column({ nullable: true })\n outputTokens: number;\n\n @Column({ nullable: true })\n modelUsed: string;\n}\n"]}
@@ -1,5 +1,5 @@
1
- export declare class AgentSession {
2
- id: number;
1
+ import { CommonEntity } from 'src/entities/common.entity';
2
+ export declare class AgentSession extends CommonEntity {
3
3
  sessionId: string;
4
4
  userId: number;
5
5
  projectRoot: string;
@@ -10,14 +10,5 @@ export declare class AgentSession {
10
10
  totalInputTokens: number;
11
11
  totalOutputTokens: number;
12
12
  summary: string;
13
- createdAt: Date;
14
- updatedAt: Date;
15
- deletedAt: Date;
16
- deletedTracker: string;
17
- publishedAt: Date;
18
- localeName: string;
19
- defaultEntityLocaleId: number;
20
- createdBy: number;
21
- updatedBy: number;
22
13
  }
23
14
  //# sourceMappingURL=agent-session.entity.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"agent-session.entity.d.ts","sourceRoot":"","sources":["../../src/entities/agent-session.entity.ts"],"names":[],"mappings":"AAGA,qBAEa,YAAY;IAGvB,EAAE,EAAE,MAAM,CAAC;IAKX,SAAS,EAAE,MAAM,CAAC;IAKlB,MAAM,EAAE,MAAM,CAAC;IAIf,WAAW,EAAE,MAAM,CAAC;IAIpB,SAAS,EAAE,MAAM,CAAC;IAKlB,MAAM,EAAE,MAAM,CAAC;IAIf,SAAS,EAAE,MAAM,CAAC;IAIlB,UAAU,EAAE,MAAM,CAAC;IAInB,gBAAgB,EAAE,MAAM,CAAC;IAIzB,iBAAiB,EAAE,MAAM,CAAC;IAI1B,OAAO,EAAE,MAAM,CAAC;IAIhB,SAAS,EAAE,IAAI,CAAC;IAIhB,SAAS,EAAE,IAAI,CAAC;IAIhB,SAAS,EAAE,IAAI,CAAC;IAChB,cAAc,EAAE,MAAM,CAAC;IACvB,WAAW,EAAE,IAAI,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,qBAAqB,EAAE,MAAM,CAAC;IAC9B,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACnB"}
1
+ {"version":3,"file":"agent-session.entity.d.ts","sourceRoot":"","sources":["../../src/entities/agent-session.entity.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAG1D,qBACa,YAAa,SAAQ,YAAY;IAG5C,SAAS,EAAE,MAAM,CAAC;IAIlB,MAAM,EAAE,MAAM,CAAC;IAGf,WAAW,EAAE,MAAM,CAAC;IAGpB,SAAS,EAAE,MAAM,CAAC;IAIlB,MAAM,EAAE,MAAM,CAAC;IAGf,SAAS,EAAE,MAAM,CAAC;IAGlB,UAAU,EAAE,MAAM,CAAC;IAGnB,gBAAgB,EAAE,MAAM,CAAC;IAGzB,iBAAiB,EAAE,MAAM,CAAC;IAG1B,OAAO,EAAE,MAAM,CAAC;CACjB"}
@@ -12,83 +12,58 @@ Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.AgentSession = void 0;
13
13
  const openapi = require("@nestjs/swagger");
14
14
  const typeorm_1 = require("typeorm");
15
- const class_transformer_1 = require("class-transformer");
16
- let AgentSession = class AgentSession {
15
+ const common_entity_1 = require("./common.entity");
16
+ const typeorm_db_helper_1 = require("../helpers/typeorm-db-helper");
17
+ let AgentSession = class AgentSession extends common_entity_1.CommonEntity {
17
18
  static _OPENAPI_METADATA_FACTORY() {
18
- return { id: { required: true, type: () => Number }, sessionId: { required: true, type: () => String }, userId: { required: true, type: () => Number }, projectRoot: { required: true, type: () => String }, modelName: { required: true, type: () => String }, status: { required: true, type: () => String }, totalCost: { required: true, type: () => Number }, totalSteps: { required: true, type: () => Number }, totalInputTokens: { required: true, type: () => Number }, totalOutputTokens: { required: true, type: () => Number }, summary: { required: true, type: () => String }, createdAt: { required: true, type: () => Date }, updatedAt: { required: true, type: () => Date }, deletedAt: { required: true, type: () => Date }, deletedTracker: { required: true, type: () => String }, publishedAt: { required: true, type: () => Date }, localeName: { required: true, type: () => String }, defaultEntityLocaleId: { required: true, type: () => Number }, createdBy: { required: true, type: () => Number }, updatedBy: { required: true, type: () => Number } };
19
+ return { sessionId: { required: true, type: () => String }, userId: { required: true, type: () => Number }, projectRoot: { required: true, type: () => String }, modelName: { required: true, type: () => String }, status: { required: true, type: () => String }, totalCost: { required: true, type: () => Number }, totalSteps: { required: true, type: () => Number }, totalInputTokens: { required: true, type: () => Number }, totalOutputTokens: { required: true, type: () => Number }, summary: { required: true, type: () => String } };
19
20
  }
20
21
  };
21
22
  exports.AgentSession = AgentSession;
22
23
  __decorate([
23
- (0, class_transformer_1.Expose)(),
24
- (0, typeorm_1.PrimaryGeneratedColumn)({ type: 'integer' }),
25
- __metadata("design:type", Number)
26
- ], AgentSession.prototype, "id", void 0);
27
- __decorate([
28
- (0, class_transformer_1.Expose)(),
29
24
  (0, typeorm_1.Index)({ unique: true }),
30
- (0, typeorm_1.Column)({ type: 'varchar', length: 36, name: 'session_id' }),
25
+ (0, typeorm_1.Column)({}),
31
26
  __metadata("design:type", String)
32
27
  ], AgentSession.prototype, "sessionId", void 0);
33
28
  __decorate([
34
- (0, class_transformer_1.Expose)(),
35
29
  (0, typeorm_1.Index)(),
36
- (0, typeorm_1.Column)({ type: 'integer', nullable: true, name: 'user_id' }),
30
+ (0, typeorm_1.Column)({ nullable: true }),
37
31
  __metadata("design:type", Number)
38
32
  ], AgentSession.prototype, "userId", void 0);
39
33
  __decorate([
40
- (0, class_transformer_1.Expose)(),
41
- (0, typeorm_1.Column)({ type: 'text', nullable: true, name: 'project_root' }),
34
+ (0, typeorm_1.Column)({ nullable: true, ...(0, typeorm_db_helper_1.getColumnType)('longText') }),
42
35
  __metadata("design:type", String)
43
36
  ], AgentSession.prototype, "projectRoot", void 0);
44
37
  __decorate([
45
- (0, class_transformer_1.Expose)(),
46
- (0, typeorm_1.Column)({ type: 'varchar', length: 255, name: 'model_name' }),
38
+ (0, typeorm_1.Column)({}),
47
39
  __metadata("design:type", String)
48
40
  ], AgentSession.prototype, "modelName", void 0);
49
41
  __decorate([
50
- (0, class_transformer_1.Expose)(),
51
42
  (0, typeorm_1.Index)(),
52
- (0, typeorm_1.Column)({ type: 'varchar', length: 32, name: 'status' }),
43
+ (0, typeorm_1.Column)({}),
53
44
  __metadata("design:type", String)
54
45
  ], AgentSession.prototype, "status", void 0);
55
46
  __decorate([
56
- (0, class_transformer_1.Expose)(),
57
- (0, typeorm_1.Column)({ type: 'double precision', name: 'total_cost', default: 0 }),
47
+ (0, typeorm_1.Column)({ default: 0, ...(0, typeorm_db_helper_1.getColumnType)('decimal') }),
58
48
  __metadata("design:type", Number)
59
49
  ], AgentSession.prototype, "totalCost", void 0);
60
50
  __decorate([
61
- (0, class_transformer_1.Expose)(),
62
- (0, typeorm_1.Column)({ type: 'integer', name: 'total_steps', default: 0 }),
51
+ (0, typeorm_1.Column)({ default: 0 }),
63
52
  __metadata("design:type", Number)
64
53
  ], AgentSession.prototype, "totalSteps", void 0);
65
54
  __decorate([
66
- (0, class_transformer_1.Expose)(),
67
- (0, typeorm_1.Column)({ type: 'integer', name: 'total_input_tokens', default: 0 }),
55
+ (0, typeorm_1.Column)({ default: 0 }),
68
56
  __metadata("design:type", Number)
69
57
  ], AgentSession.prototype, "totalInputTokens", void 0);
70
58
  __decorate([
71
- (0, class_transformer_1.Expose)(),
72
- (0, typeorm_1.Column)({ type: 'integer', name: 'total_output_tokens', default: 0 }),
59
+ (0, typeorm_1.Column)({ default: 0 }),
73
60
  __metadata("design:type", Number)
74
61
  ], AgentSession.prototype, "totalOutputTokens", void 0);
75
62
  __decorate([
76
- (0, class_transformer_1.Expose)(),
77
- (0, typeorm_1.Column)({ type: 'text', nullable: true, name: 'summary' }),
63
+ (0, typeorm_1.Column)({ nullable: true, ...(0, typeorm_db_helper_1.getColumnType)('longText') }),
78
64
  __metadata("design:type", String)
79
65
  ], AgentSession.prototype, "summary", void 0);
80
- __decorate([
81
- (0, class_transformer_1.Expose)(),
82
- (0, typeorm_1.Column)({ type: 'timestamp without time zone', name: 'created_at' }),
83
- __metadata("design:type", Date)
84
- ], AgentSession.prototype, "createdAt", void 0);
85
- __decorate([
86
- (0, class_transformer_1.Expose)(),
87
- (0, typeorm_1.Column)({ type: 'timestamp without time zone', name: 'updated_at' }),
88
- __metadata("design:type", Date)
89
- ], AgentSession.prototype, "updatedAt", void 0);
90
66
  exports.AgentSession = AgentSession = __decorate([
91
- (0, class_transformer_1.Exclude)(),
92
67
  (0, typeorm_1.Entity)({ name: 'ss_agent_sessions', synchronize: false })
93
68
  ], AgentSession);
94
69
  //# sourceMappingURL=agent-session.entity.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"agent-session.entity.js","sourceRoot":"","sources":["../../src/entities/agent-session.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,qCAAwE;AACxE,yDAAoD;AAI7C,IAAM,YAAY,GAAlB,MAAM,YAAY;;;;CAiExB,CAAA;AAjEY,oCAAY;AAGvB;IAFC,IAAA,0BAAM,GAAE;IACR,IAAA,gCAAsB,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;;wCACjC;AAKX;IAHC,IAAA,0BAAM,GAAE;IACR,IAAA,eAAK,EAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IACvB,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC;;+CAC1C;AAKlB;IAHC,IAAA,0BAAM,GAAE;IACR,IAAA,eAAK,GAAE;IACP,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;;4CAC9C;AAIf;IAFC,IAAA,0BAAM,GAAE;IACR,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,cAAc,EAAE,CAAC;;iDAC3C;AAIpB;IAFC,IAAA,0BAAM,GAAE;IACR,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC;;+CAC3C;AAKlB;IAHC,IAAA,0BAAM,GAAE;IACR,IAAA,eAAK,GAAE;IACP,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;;4CACzC;AAIf;IAFC,IAAA,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} from 'class-transformer';\n\n@Exclude()\n@Entity({ name: 'ss_agent_sessions', synchronize: false })\nexport class AgentSession {\n @Expose()\n @PrimaryGeneratedColumn({ type: 'integer' })\n id: number;\n\n @Expose()\n @Index({ unique: true })\n @Column({ type: 'varchar', length: 36, name: 'session_id' })\n sessionId: string;\n\n @Expose()\n @Index()\n @Column({ type: 'integer', nullable: true, name: 'user_id' })\n userId: number;\n\n @Expose()\n @Column({ type: 'text', nullable: true, name: 'project_root' })\n projectRoot: string;\n\n @Expose()\n @Column({ type: 'varchar', length: 255, name: 'model_name' })\n modelName: string;\n\n @Expose()\n @Index()\n @Column({ type: 'varchar', length: 32, name: 'status' })\n status: string;\n\n @Expose()\n @Column({ type: 'double precision', name: 'total_cost', default: 0 })\n totalCost: number;\n\n @Expose()\n @Column({ type: 'integer', name: 'total_steps', default: 0 })\n totalSteps: number;\n\n @Expose()\n @Column({ type: 'integer', name: 'total_input_tokens', default: 0 })\n totalInputTokens: number;\n\n @Expose()\n @Column({ type: 'integer', name: 'total_output_tokens', default: 0 })\n totalOutputTokens: number;\n\n @Expose()\n @Column({ type: 'text', nullable: true, name: 'summary' })\n summary: string;\n\n @Expose()\n @Column({ type: 'timestamp without time zone', name: 'created_at' })\n createdAt: Date;\n\n @Expose()\n @Column({ type: 'timestamp without time zone', name: 'updated_at' })\n updatedAt: Date;\n\n // The following properties satisfy CRUDService<T extends CommonEntity> structural typing\n // They are not mapped to DB columns (synchronize: false ensures no schema changes)\n deletedAt: Date;\n deletedTracker: string;\n publishedAt: Date;\n localeName: string;\n defaultEntityLocaleId: number;\n createdBy: number;\n updatedBy: number;\n}\n"]}
1
+ {"version":3,"file":"agent-session.entity.js","sourceRoot":"","sources":["../../src/entities/agent-session.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,qCAAgD;AAChD,mDAA0D;AAC1D,oEAA8D;AAGvD,IAAM,YAAY,GAAlB,MAAM,YAAa,SAAQ,4BAAY;;;;CAiC7C,CAAA;AAjCY,oCAAY;AAGvB;IAFC,IAAA,eAAK,EAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IACvB,IAAA,gBAAM,EAAC,EAAG,CAAC;;+CACM;AAIlB;IAFC,IAAA,eAAK,GAAE;IACP,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;4CACZ;AAGf;IADC,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,IAAA,iCAAa,EAAC,UAAU,CAAC,EAAE,CAAC;;iDACrC;AAGpB;IADC,IAAA,gBAAM,EAAC,EAAG,CAAC;;+CACM;AAIlB;IAFC,IAAA,eAAK,GAAE;IACP,IAAA,gBAAM,EAAC,EAAG,CAAC;;4CACG;AAGf;IADC,IAAA,gBAAM,EAAC,EAAE,OAAO,EAAE,CAAC,EAAE,GAAG,IAAA,iCAAa,EAAC,SAAS,CAAC,EAAE,CAAC;;+CAClC;AAGlB;IADC,IAAA,gBAAM,EAAC,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;gDACJ;AAGnB;IADC,IAAA,gBAAM,EAAC,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;sDACE;AAGzB;IADC,IAAA,gBAAM,EAAC,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;uDACG;AAG1B;IADC,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,IAAA,iCAAa,EAAC,UAAU,CAAC,EAAE,CAAC;;6CACzC;uBAhCL,YAAY;IADxB,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,mBAAmB,EAAE,WAAW,EAAE,KAAK,EAAE,CAAC;GAC7C,YAAY,CAiCxB","sourcesContent":["import { Column, Entity, Index } from 'typeorm';\nimport { CommonEntity } from 'src/entities/common.entity';\nimport { getColumnType } from 'src/helpers/typeorm-db-helper';\n\n@Entity({ name: 'ss_agent_sessions', synchronize: false })\nexport class AgentSession extends CommonEntity {\n @Index({ unique: true })\n @Column({ })\n sessionId: string;\n\n @Index()\n @Column({ nullable: true })\n userId: number;\n\n @Column({ nullable: true, ...getColumnType('longText') })\n projectRoot: string;\n\n @Column({ })\n modelName: string;\n\n @Index()\n @Column({ })\n status: string;\n\n @Column({ default: 0, ...getColumnType('decimal') })\n totalCost: number;\n\n @Column({ default: 0 })\n totalSteps: number;\n\n @Column({ default: 0 })\n totalInputTokens: number;\n\n @Column({ default: 0 })\n totalOutputTokens: number;\n\n @Column({ nullable: true, ...getColumnType('longText') })\n summary: string;\n}\n"]}
@@ -1,13 +1,13 @@
1
1
  export declare const LEGACY_TABLE_FIELDS_PREFIX = "ss";
2
2
  export declare abstract class LegacyCommonEntity {
3
- createdAt: Date | null;
4
- updatedAt: Date | null;
5
- deletedAt: Date | null;
6
- deletedTracker: string | null;
7
- publishedAt: Date | null;
8
- localeName: string | null;
9
- defaultEntityLocaleId: number | null;
10
- createdBy: number | null;
11
- updatedBy: number | null;
3
+ createdAt: Date;
4
+ updatedAt: Date;
5
+ deletedAt: Date;
6
+ deletedTracker: string;
7
+ publishedAt: Date;
8
+ localeName: string;
9
+ defaultEntityLocaleId: number;
10
+ createdBy: number;
11
+ updatedBy: number;
12
12
  }
13
13
  //# sourceMappingURL=legacy-common.entity.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"legacy-common.entity.d.ts","sourceRoot":"","sources":["../../src/entities/legacy-common.entity.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,0BAA0B,OAAO,CAAC;AAE/C,8BACsB,kBAAkB;IAOpC,SAAS,EAAE,IAAI,GAAG,IAAI,CAAC;IAGvB,SAAS,EAAE,IAAI,GAAG,IAAI,CAAC;IAIvB,SAAS,EAAE,IAAI,GAAG,IAAI,CAAC;IAGvB,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAI9B,WAAW,EAAE,IAAI,GAAG,IAAI,CAAC;IAIzB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAI1B,qBAAqB,EAAE,MAAM,GAAG,IAAI,CAAC;IAgBrC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IAIzB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B"}
1
+ {"version":3,"file":"legacy-common.entity.d.ts","sourceRoot":"","sources":["../../src/entities/legacy-common.entity.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,0BAA0B,OAAO,CAAC;AAE/C,8BACsB,kBAAkB;IAOpC,SAAS,EAAE,IAAI,CAAC;IAGhB,SAAS,EAAE,IAAI,CAAC;IAIhB,SAAS,EAAE,IAAI,CAAC;IAGhB,cAAc,EAAE,MAAM,CAAC;IAIvB,WAAW,EAAE,IAAI,CAAC;IAIlB,UAAU,EAAE,MAAM,CAAC;IAInB,qBAAqB,EAAE,MAAM,CAAC;IAgB9B,SAAS,EAAE,MAAM,CAAC;IAIlB,SAAS,EAAE,MAAM,CAAC;CACrB"}
@@ -17,25 +17,25 @@ const typeorm_1 = require("typeorm");
17
17
  exports.LEGACY_TABLE_FIELDS_PREFIX = 'ss';
18
18
  let LegacyCommonEntity = class LegacyCommonEntity {
19
19
  static _OPENAPI_METADATA_FACTORY() {
20
- return { createdAt: { required: true, type: () => Date, nullable: true }, updatedAt: { required: true, type: () => Date, nullable: true }, deletedAt: { required: true, type: () => Date, nullable: true }, deletedTracker: { required: true, type: () => String, nullable: true }, publishedAt: { required: true, type: () => Date, nullable: true }, localeName: { required: true, type: () => String, nullable: true }, defaultEntityLocaleId: { required: true, type: () => Number, nullable: true }, createdBy: { required: true, type: () => Number, nullable: true }, updatedBy: { required: true, type: () => Number, nullable: true } };
20
+ return { createdAt: { required: true, type: () => Date }, updatedAt: { required: true, type: () => Date }, deletedAt: { required: true, type: () => Date }, deletedTracker: { required: true, type: () => String }, publishedAt: { required: true, type: () => Date }, localeName: { required: true, type: () => String }, defaultEntityLocaleId: { required: true, type: () => Number }, createdBy: { required: true, type: () => Number }, updatedBy: { required: true, type: () => Number } };
21
21
  }
22
22
  };
23
23
  exports.LegacyCommonEntity = LegacyCommonEntity;
24
24
  __decorate([
25
- (0, typeorm_1.CreateDateColumn)({ name: `${exports.LEGACY_TABLE_FIELDS_PREFIX}_created_at`, transformer: local_date_time_transformer_1.LocalDateTimeTransformer, nullable: true }),
25
+ (0, typeorm_1.CreateDateColumn)({ name: `${exports.LEGACY_TABLE_FIELDS_PREFIX}_created_at`, transformer: local_date_time_transformer_1.LocalDateTimeTransformer }),
26
26
  __metadata("design:type", Date)
27
27
  ], LegacyCommonEntity.prototype, "createdAt", void 0);
28
28
  __decorate([
29
- (0, typeorm_1.UpdateDateColumn)({ name: `${exports.LEGACY_TABLE_FIELDS_PREFIX}_updated_at`, transformer: local_date_time_transformer_1.LocalDateTimeTransformer, nullable: true }),
29
+ (0, typeorm_1.UpdateDateColumn)({ name: `${exports.LEGACY_TABLE_FIELDS_PREFIX}_updated_at`, transformer: local_date_time_transformer_1.LocalDateTimeTransformer }),
30
30
  __metadata("design:type", Date)
31
31
  ], LegacyCommonEntity.prototype, "updatedAt", void 0);
32
32
  __decorate([
33
- (0, typeorm_1.DeleteDateColumn)({ name: `${exports.LEGACY_TABLE_FIELDS_PREFIX}_deleted_at`, transformer: local_date_time_transformer_1.LocalDateTimeTransformer, nullable: true }),
33
+ (0, typeorm_1.DeleteDateColumn)({ name: `${exports.LEGACY_TABLE_FIELDS_PREFIX}_deleted_at`, transformer: local_date_time_transformer_1.LocalDateTimeTransformer }),
34
34
  (0, typeorm_1.Index)(),
35
35
  __metadata("design:type", Date)
36
36
  ], LegacyCommonEntity.prototype, "deletedAt", void 0);
37
37
  __decorate([
38
- (0, typeorm_1.Column)({ name: `${exports.LEGACY_TABLE_FIELDS_PREFIX}_deleted_tracker`, default: "not-deleted", nullable: true }),
38
+ (0, typeorm_1.Column)({ name: `${exports.LEGACY_TABLE_FIELDS_PREFIX}_deleted_tracker`, default: "not-deleted" }),
39
39
  __metadata("design:type", String)
40
40
  ], LegacyCommonEntity.prototype, "deletedTracker", void 0);
41
41
  __decorate([
@@ -45,12 +45,12 @@ __decorate([
45
45
  ], LegacyCommonEntity.prototype, "publishedAt", void 0);
46
46
  __decorate([
47
47
  (0, class_transformer_1.Expose)(),
48
- (0, typeorm_1.Column)({ type: "varchar", name: `${exports.LEGACY_TABLE_FIELDS_PREFIX}_locale_name`, default: null, nullable: true }),
48
+ (0, typeorm_1.Column)({ type: "varchar", name: `${exports.LEGACY_TABLE_FIELDS_PREFIX}_locale_name`, default: null }),
49
49
  __metadata("design:type", String)
50
50
  ], LegacyCommonEntity.prototype, "localeName", void 0);
51
51
  __decorate([
52
52
  (0, class_transformer_1.Expose)(),
53
- (0, typeorm_1.Column)({ type: "int", name: `${exports.LEGACY_TABLE_FIELDS_PREFIX}_default_entity_locale_id`, default: null, nullable: true }),
53
+ (0, typeorm_1.Column)({ type: "int", name: `${exports.LEGACY_TABLE_FIELDS_PREFIX}_default_entity_locale_id`, default: null }),
54
54
  __metadata("design:type", Number)
55
55
  ], LegacyCommonEntity.prototype, "defaultEntityLocaleId", void 0);
56
56
  __decorate([
@@ -1 +1 @@
1
- {"version":3,"file":"legacy-common.entity.js","sourceRoot":"","sources":["../../src/entities/legacy-common.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,yDAAoD;AACpD,qGAAgG;AAChG,qCAA8F;AAEjF,QAAA,0BAA0B,GAAG,IAAI,CAAC;AAGxC,IAAe,kBAAkB,GAAjC,MAAe,kBAAkB;;;;CAkDvC,CAAA;AAlDqB,gDAAkB;AAOpC;IADC,IAAA,0BAAgB,EAAC,EAAE,IAAI,EAAE,GAAG,kCAA0B,aAAa,EAAE,WAAW,EAAE,sDAAwB,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;8BACnH,IAAI;qDAAQ;AAGvB;IADC,IAAA,0BAAgB,EAAC,EAAE,IAAI,EAAE,GAAG,kCAA0B,aAAa,EAAE,WAAW,EAAE,sDAAwB,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;8BACnH,IAAI;qDAAQ;AAIv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E;GACY,kBAAkB,CAkDvC","sourcesContent":["import { Exclude, Expose } from \"class-transformer\";\nimport { LocalDateTimeTransformer } from \"src/transformers/typeorm/local-date-time-transformer\";\nimport { Column, CreateDateColumn, DeleteDateColumn, Index, UpdateDateColumn } from \"typeorm\";\n\nexport const LEGACY_TABLE_FIELDS_PREFIX = 'ss';\n\n@Exclude()\nexport abstract class LegacyCommonEntity {\n // @Expose()\n // @Column({ type: 'integer', name: `${LEGACY_TABLE_FIELDS_PREFIX}_id`, unique: true })\n // @Generated(\"increment\")\n // id: number\n\n @CreateDateColumn({ name: `${LEGACY_TABLE_FIELDS_PREFIX}_created_at`, transformer: LocalDateTimeTransformer, nullable: true })\n createdAt: Date | null;\n\n @UpdateDateColumn({ name: `${LEGACY_TABLE_FIELDS_PREFIX}_updated_at`, transformer: LocalDateTimeTransformer, nullable: true })\n updatedAt: Date | null;\n\n @DeleteDateColumn({ name: `${LEGACY_TABLE_FIELDS_PREFIX}_deleted_at`, transformer: LocalDateTimeTransformer, nullable: true })\n @Index()\n deletedAt: Date | null;\n\n @Column({ name: `${LEGACY_TABLE_FIELDS_PREFIX}_deleted_tracker`, default: \"not-deleted\", nullable: true })\n deletedTracker: string | null;\n\n @Expose()\n @Column({ name: `${LEGACY_TABLE_FIELDS_PREFIX}_published_at`, default: null, nullable: true, transformer: LocalDateTimeTransformer })\n publishedAt: Date | null;\n\n @Expose()\n @Column({ type: \"varchar\", name: `${LEGACY_TABLE_FIELDS_PREFIX}_locale_name`, default: null, nullable: true })\n localeName: string | null;\n\n @Expose()\n @Column({ type: \"int\", name: `${LEGACY_TABLE_FIELDS_PREFIX}_default_entity_locale_id`, default: null, nullable: true })\n defaultEntityLocaleId: number | null;\n\n // @Expose()\n // @Type( () => require('./user.entity').User?.default ?? require('./user.entity').User )\n // @ManyToOne(() => require('./user.entity').User?.default ?? require('./user.entity').User, { nullable: true })\n // @JoinColumn({ name: `${LEGACY_TABLE_FIELDS_PREFIX}_created_by_id` })\n // createdBy: User;\n\n // @Expose()\n // @Type( () => require('./user.entity').User?.default ?? require('./user.entity').User )\n // @ManyToOne(() => require('./user.entity').User?.default ?? require('./user.entity').User, { nullable: true })\n // @JoinColumn({ name: `${LEGACY_TABLE_FIELDS_PREFIX}_updated_by_id` })\n // updatedBy: User; \n\n @Expose()\n @Column({ name: `${LEGACY_TABLE_FIELDS_PREFIX}_created_by_id`, nullable: true })\n createdBy: number | null;\n\n @Expose()\n @Column({ name: `${LEGACY_TABLE_FIELDS_PREFIX}_updated_by_id`, nullable: true })\n updatedBy: number | null;\n}\n"]}
1
+ {"version":3,"file":"legacy-common.entity.js","sourceRoot":"","sources":["../../src/entities/legacy-common.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,yDAAoD;AACpD,qGAAgG;AAChG,qCAA8F;AAEjF,QAAA,0BAA0B,GAAG,IAAI,CAAC;AAGxC,IAAe,kBAAkB,GAAjC,MAAe,kBAAkB;;;;CAkDvC,CAAA;AAlDqB,gDAAkB;AAOpC;IADC,IAAA,0BAAgB,EAAC,EAAE,IAAI,EAAE,GAAG,kCAA0B,aAAa,EAAE,WAAW,EAAE,sDAAwB,EAAE,CAAC;8BACnG,IAAI;qDAAC;AAGhB;IADC,IAAA,0BAAgB,EAAC,EAAE,IAAI,EAAE,GAAG,kCAA0B,aAAa,EAAE,WAAW,EAAE,sDAAwB,EAAE,CAAC;8BACnG,IAAI;qDAAC;AAIhB;IAFC,IAAA,0BAAgB,EAAC,EAAE,IAAI,EAAE,GAAG,kCAA0B,aAAa,EAAE,WAAW,EAAE,sDAAwB,EAAE,CAAC;IAC7G,IAAA,eAAK,GAAE;8BACG,IAAI;qDAAC;AAGhB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,GAAG,kCAA0B,kBAAkB,EAAE,OAAO,EAAE,aAAa,EAAE,CAAC;;0DACnE;AAIvB;IAFC,IAAA,0BAAM,GAAE;IACR,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,GAAG,kCAA0B,eAAe,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,sDAAwB,EAAE,CAAC;8BACxH,IAAI;uDAAC;AAIlB;IAFC,IAAA,0BAAM,GAAE;IACR,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,GAAG,kCAA0B,cAAc,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;sDAC3E;AAInB;IAFC,IAAA,0BAAM,GAAE;IACR,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,kCAA0B,2BAA2B,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;iEACzE;AAgB9B;IAFC,IAAA,0BAAM,GAAE;IACR,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,GAAG,kCAA0B,gBAAgB,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;qDAC9D;AAIlB;IAFC,IAAA,0BAAM,GAAE;IACR,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,GAAG,kCAA0B,gBAAgB,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;qDAC9D;6BAjDA,kBAAkB;IADvC,IAAA,2BAAO,GAAE;GACY,kBAAkB,CAkDvC","sourcesContent":["import { Exclude, Expose } from \"class-transformer\";\nimport { LocalDateTimeTransformer } from \"src/transformers/typeorm/local-date-time-transformer\";\nimport { Column, CreateDateColumn, DeleteDateColumn, Index, UpdateDateColumn } from \"typeorm\";\n\nexport const LEGACY_TABLE_FIELDS_PREFIX = 'ss';\n\n@Exclude()\nexport abstract class LegacyCommonEntity {\n // @Expose()\n // @Column({ type: 'integer', name: `${LEGACY_TABLE_FIELDS_PREFIX}_id`, unique: true })\n // @Generated(\"increment\")\n // id: number\n\n @CreateDateColumn({ name: `${LEGACY_TABLE_FIELDS_PREFIX}_created_at`, transformer: LocalDateTimeTransformer })\n createdAt: Date;\n\n @UpdateDateColumn({ name: `${LEGACY_TABLE_FIELDS_PREFIX}_updated_at`, transformer: LocalDateTimeTransformer })\n updatedAt: Date;\n\n @DeleteDateColumn({ name: `${LEGACY_TABLE_FIELDS_PREFIX}_deleted_at`, transformer: LocalDateTimeTransformer })\n @Index()\n deletedAt: Date;\n\n @Column({ name: `${LEGACY_TABLE_FIELDS_PREFIX}_deleted_tracker`, default: \"not-deleted\" })\n deletedTracker: string;\n\n @Expose()\n @Column({ name: `${LEGACY_TABLE_FIELDS_PREFIX}_published_at`, default: null, nullable: true, transformer: LocalDateTimeTransformer })\n publishedAt: Date;\n\n @Expose()\n @Column({ type: \"varchar\", name: `${LEGACY_TABLE_FIELDS_PREFIX}_locale_name`, default: null })\n localeName: string;\n\n @Expose()\n @Column({ type: \"int\", name: `${LEGACY_TABLE_FIELDS_PREFIX}_default_entity_locale_id`, default: null })\n defaultEntityLocaleId: number;\n\n // @Expose()\n // @Type( () => require('./user.entity').User?.default ?? require('./user.entity').User )\n // @ManyToOne(() => require('./user.entity').User?.default ?? require('./user.entity').User, { nullable: true })\n // @JoinColumn({ name: `${LEGACY_TABLE_FIELDS_PREFIX}_created_by_id` })\n // createdBy: User;\n\n // @Expose()\n // @Type( () => require('./user.entity').User?.default ?? require('./user.entity').User )\n // @ManyToOne(() => require('./user.entity').User?.default ?? require('./user.entity').User, { nullable: true })\n // @JoinColumn({ name: `${LEGACY_TABLE_FIELDS_PREFIX}_updated_by_id` })\n // updatedBy: User; \n\n @Expose()\n @Column({ name: `${LEGACY_TABLE_FIELDS_PREFIX}_created_by_id`, nullable: true })\n createdBy: number;\n\n @Expose()\n @Column({ name: `${LEGACY_TABLE_FIELDS_PREFIX}_updated_by_id`, nullable: true })\n updatedBy: number;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"typeorm-db-helper.d.ts","sourceRoot":"","sources":["../../src/helpers/typeorm-db-helper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAuCxC,wBAAgB,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG,aAAa,CAY9D"}
1
+ {"version":3,"file":"typeorm-db-helper.d.ts","sourceRoot":"","sources":["../../src/helpers/typeorm-db-helper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AA+CxC,wBAAgB,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG,aAAa,CAe9D"}
@@ -28,6 +28,13 @@ const SIMPLE_JSON_LARGE_TEXT_MAP = {
28
28
  },
29
29
  [create_model_metadata_dto_1.DatasourceType.oracle]: { type: "clob" },
30
30
  };
31
+ const DECIMAL_MAP = {
32
+ [create_model_metadata_dto_1.DatasourceType.postgres]: { type: "float4" },
33
+ [create_model_metadata_dto_1.DatasourceType.mssql]: { type: "float" },
34
+ [create_model_metadata_dto_1.DatasourceType.mysql]: { type: "float" },
35
+ [create_model_metadata_dto_1.DatasourceType.mariadb]: { type: "float" },
36
+ [create_model_metadata_dto_1.DatasourceType.oracle]: { type: "float" },
37
+ };
31
38
  const solidCoreDbType = Object.values(create_model_metadata_dto_1.DatasourceType).includes(process.env.SOLID_CORE_DB_TYPE)
32
39
  ? process.env.SOLID_CORE_DB_TYPE
33
40
  : create_model_metadata_dto_1.DatasourceType.postgres;
@@ -38,6 +45,8 @@ function getColumnType(solidType) {
38
45
  return LONG_TEXT_MAP[solidCoreDbType];
39
46
  case "simpleJsonLargeText":
40
47
  return SIMPLE_JSON_LARGE_TEXT_MAP[solidCoreDbType];
48
+ case "decimal":
49
+ return DECIMAL_MAP[solidCoreDbType];
41
50
  default:
42
51
  return {};
43
52
  }
@@ -1 +1 @@
1
- {"version":3,"file":"typeorm-db-helper.js","sourceRoot":"","sources":["../../src/helpers/typeorm-db-helper.ts"],"names":[],"mappings":";;AAuCA,sCAYC;AAlDD,iFAAoE;AAEpE,MAAM,aAAa,GAA0C;IACzD,CAAC,0CAAc,CAAC,QAAQ,CAAC,EAAE,EAAE,IAAI,EAAE,MA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AE,EAAE,CAAC,CAAC,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;SAC5F;KACJ;IACD,CAAC,0CAAc,CAAC,MAAM,CAAC,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE;CAC5C,CAAC;AAEF,MAAM,eAAe,GACjB,MAAM,CAAC,MAAM,CAAC,0CAAc,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,kBAAoC,CAAC;IACpF,CAAC,CAAE,OAAO,CAAC,GAAG,CAAC,kBAAqC;IACpD,CAAC,CAAC,0CAAc,CAAC,QAAQ,CAAC;AAElC,SAAgB,aAAa,CAAC,SAAiB;IAC3C,QAAQ,SAAS,EAAE,CAAC;QAChB,KAAK,UAAU,CAAC;QAChB,KAAK,UAAU;YACX,OAAO,aAAa,CAAC,eAAe,CAAC,CAAC;QAE1C,KAAK,qBAAqB;YACtB,OAAO,0BAA0B,CAAC,eAAe,CAAC,CAAC;QAEvD;YACI,OAAO,EAAE,CAAC;IAClB,CAAC;AACL,CAAC","sourcesContent":["import { ColumnOptions } from \"typeorm\";\nimport { DatasourceType } from \"src/dtos/create-model-metadata.dto\";\n\nconst LONG_TEXT_MAP: Record<DatasourceType, ColumnOptions> = {\n [DatasourceType.postgres]: { type: \"text\" },\n [DatasourceType.mssql]: { type: \"nvarchar\", length: \"max\" },\n [DatasourceType.mysql]: { type: \"longtext\" },\n [DatasourceType.mariadb]: { type: \"longtext\" },\n [DatasourceType.oracle]: { type: \"clob\" },\n};\n\n// For simple-json columns that may contain large payloads: on MySQL/MariaDB the default\n// TEXT backing store is limited to 64 KB, so we override the type to longtext and supply\n// an explicit JSON transformer so TypeORM still serialises/deserialises correctly.\nconst SIMPLE_JSON_LARGE_TEXT_MAP: Record<DatasourceType, ColumnOptions> = {\n [DatasourceType.postgres]: {},\n [DatasourceType.mssql]: {},\n [DatasourceType.mysql]: {\n type: \"longtext\",\n transformer: {\n to: (value: any) => (value !== undefined && value !== null ? JSON.stringify(value) : value),\n from: (value: any) => (value !== null && value !== undefined ? JSON.parse(value) : value),\n },\n },\n [DatasourceType.mariadb]: {\n type: \"longtext\",\n transformer: {\n to: (value: any) => (value !== undefined && value !== null ? JSON.stringify(value) : value),\n from: (value: any) => (value !== null && value !== undefined ? JSON.parse(value) : value),\n },\n },\n [DatasourceType.oracle]: { type: \"clob\" },\n};\n\nconst solidCoreDbType: DatasourceType =\n Object.values(DatasourceType).includes(process.env.SOLID_CORE_DB_TYPE as DatasourceType)\n ? (process.env.SOLID_CORE_DB_TYPE as DatasourceType)\n : DatasourceType.postgres;\n\nexport function getColumnType(solidType: string): ColumnOptions {\n switch (solidType) {\n case \"longText\":\n case \"richText\":\n return LONG_TEXT_MAP[solidCoreDbType];\n\n case \"simpleJsonLargeText\":\n return SIMPLE_JSON_LARGE_TEXT_MAP[solidCoreDbType];\n\n default:\n return {};\n }\n}"]}
1
+ {"version":3,"file":"typeorm-db-helper.js","sourceRoot":"","sources":["../../src/helpers/typeorm-db-helper.ts"],"names":[],"mappings":";;AA+CA,sCAeC;AA7DD,iFAAoE;AAEpE,MAAM,aAAa,GAA0C;IACzD,CAAC,0CAAc,CAAC,QAAQ,CAAC,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE;IAC3C,CAAC,0CAAc,CAAC,KAAK,CAAC,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE;IAC3D,CAAC,0CAAc,CAAC,KAAK,CAAC,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE;IAC5C,CAAC,0CAAc,CAAC,OAAO,CAAC,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE;IAC9C,CAAC,0CAAc,CAAC,MAAM,CAAC,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE;CAC5C,CAAC;AAKF,MAAM,0BAA0B,GAA0C;IACtE,CAAC,0CA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AE,EAAE,IAAI,EAAE,OAAO,EAAE;IACzC,CAAC,0CAAc,CAAC,KAAK,CAAC,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE;IACzC,CAAC,0CAAc,CAAC,OAAO,CAAC,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE;IAC3C,CAAC,0CAAc,CAAC,MAAM,CAAC,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE;CAC7C,CAAC;AAEF,MAAM,eAAe,GACjB,MAAM,CAAC,MAAM,CAAC,0CAAc,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,kBAAoC,CAAC;IACpF,CAAC,CAAE,OAAO,CAAC,GAAG,CAAC,kBAAqC;IACpD,CAAC,CAAC,0CAAc,CAAC,QAAQ,CAAC;AAElC,SAAgB,aAAa,CAAC,SAAiB;IAC3C,QAAQ,SAAS,EAAE,CAAC;QAChB,KAAK,UAAU,CAAC;QAChB,KAAK,UAAU;YACX,OAAO,aAAa,CAAC,eAAe,CAAC,CAAC;QAE1C,KAAK,qBAAqB;YACtB,OAAO,0BAA0B,CAAC,eAAe,CAAC,CAAC;QAEvD,KAAK,SAAS;YACV,OAAO,WAAW,CAAC,eAAe,CAAC,CAAC;QAExC;YACI,OAAO,EAAE,CAAC;IAClB,CAAC;AACL,CAAC","sourcesContent":["import { ColumnOptions } from \"typeorm\";\nimport { DatasourceType } from \"src/dtos/create-model-metadata.dto\";\n\nconst LONG_TEXT_MAP: Record<DatasourceType, ColumnOptions> = {\n [DatasourceType.postgres]: { type: \"text\" },\n [DatasourceType.mssql]: { type: \"nvarchar\", length: \"max\" },\n [DatasourceType.mysql]: { type: \"longtext\" },\n [DatasourceType.mariadb]: { type: \"longtext\" },\n [DatasourceType.oracle]: { type: \"clob\" },\n};\n\n// For simple-json columns that may contain large payloads: on MySQL/MariaDB the default\n// TEXT backing store is limited to 64 KB, so we override the type to longtext and supply\n// an explicit JSON transformer so TypeORM still serialises/deserialises correctly.\nconst SIMPLE_JSON_LARGE_TEXT_MAP: Record<DatasourceType, ColumnOptions> = {\n [DatasourceType.postgres]: {},\n [DatasourceType.mssql]: {},\n [DatasourceType.mysql]: {\n type: \"longtext\",\n transformer: {\n to: (value: any) => (value !== undefined && value !== null ? JSON.stringify(value) : value),\n from: (value: any) => (value !== null && value !== undefined ? JSON.parse(value) : value),\n },\n },\n [DatasourceType.mariadb]: {\n type: \"longtext\",\n transformer: {\n to: (value: any) => (value !== undefined && value !== null ? JSON.stringify(value) : value),\n from: (value: any) => (value !== null && value !== undefined ? JSON.parse(value) : value),\n },\n },\n [DatasourceType.oracle]: { type: \"clob\" },\n};\n\nconst DECIMAL_MAP: Record<DatasourceType, ColumnOptions> = {\n [DatasourceType.postgres]: { type: \"float4\" },\n [DatasourceType.mssql]: { type: \"float\" },\n [DatasourceType.mysql]: { type: \"float\" },\n [DatasourceType.mariadb]: { type: \"float\" },\n [DatasourceType.oracle]: { type: \"float\" },\n};\n\nconst solidCoreDbType: DatasourceType =\n Object.values(DatasourceType).includes(process.env.SOLID_CORE_DB_TYPE as DatasourceType)\n ? (process.env.SOLID_CORE_DB_TYPE as DatasourceType)\n : DatasourceType.postgres;\n\nexport function getColumnType(solidType: string): ColumnOptions {\n switch (solidType) {\n case \"longText\":\n case \"richText\":\n return LONG_TEXT_MAP[solidCoreDbType];\n\n case \"simpleJsonLargeText\":\n return SIMPLE_JSON_LARGE_TEXT_MAP[solidCoreDbType];\n\n case \"decimal\":\n return DECIMAL_MAP[solidCoreDbType];\n\n default:\n return {};\n }\n}"]}