@kl1/contracts 1.0.24 → 1.0.26

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/dist/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  // src/contract.ts
2
- import { initContract as initContract30 } from "@ts-rest/core";
2
+ import { initContract as initContract32 } from "@ts-rest/core";
3
3
 
4
4
  // src/attribute/index.ts
5
5
  import { initContract } from "@ts-rest/core";
@@ -2326,6 +2326,17 @@ var cxLogContract = initContract9().router({
2326
2326
  },
2327
2327
  query: GetAllCxLogQueryParamsSchema,
2328
2328
  summary: "Get all cx-logs"
2329
+ },
2330
+ export: {
2331
+ method: "GET",
2332
+ path: "/cx-logs/export",
2333
+ headers: DefaultHeaderSchema,
2334
+ responses: {
2335
+ 200: null,
2336
+ 401: DefaultUnauthorizedSchema
2337
+ },
2338
+ query: GetAllCxLogQueryParamsSchema,
2339
+ summary: "Export cx-logs"
2329
2340
  }
2330
2341
  });
2331
2342
 
@@ -4576,8 +4587,150 @@ var dashboardContract = initContract29().router(
4576
4587
  }
4577
4588
  );
4578
4589
 
4590
+ // src/comment/index.ts
4591
+ import { initContract as initContract30 } from "@ts-rest/core";
4592
+ import z79 from "zod";
4593
+
4594
+ // src/comment/validation.ts
4595
+ import { z as z76 } from "zod";
4596
+ var CreateCommentSchema = z76.object({
4597
+ ticketId: z76.string(),
4598
+ comment: z76.string(),
4599
+ mentions: z76.array(z76.string()).optional()
4600
+ });
4601
+ var UpdateCommentSchema = CreateCommentSchema;
4602
+ var GetCommentQuerySchema = z76.object({
4603
+ ticketId: z76.string().optional(),
4604
+ deleted: z76.enum(["true", "false"]).default("false").transform((v) => v === "true" ? true : false)
4605
+ }).optional();
4606
+
4607
+ // src/comment/schema.ts
4608
+ import z78 from "zod";
4609
+
4610
+ // src/activity-log/schema.ts
4611
+ import z77 from "zod";
4612
+ var EntitySchema = z77.object({
4613
+ id: z77.string().uuid(),
4614
+ createdAt: z77.date(),
4615
+ updatedAt: z77.date(),
4616
+ deletedAt: z77.date().nullable(),
4617
+ entity: z77.string(),
4618
+ description: z77.string()
4619
+ });
4620
+ var ActivityLogSchema = z77.object({
4621
+ id: z77.string().uuid(),
4622
+ createdAt: z77.date(),
4623
+ updatedAt: z77.date(),
4624
+ deletedAt: z77.date().nullable(),
4625
+ actor: UserSchema,
4626
+ entityId: z77.string(),
4627
+ description: z77.string(),
4628
+ entityType: EntitySchema
4629
+ });
4630
+
4631
+ // src/comment/schema.ts
4632
+ var CommentSchema = z78.object({
4633
+ id: z78.string().uuid(),
4634
+ createdAt: z78.date(),
4635
+ updatedAt: z78.date(),
4636
+ deletedAt: z78.date().nullable(),
4637
+ activityLogs: z78.array(ActivityLogSchema),
4638
+ comment: z78.string(),
4639
+ mentions: z78.array(z78.string()),
4640
+ ticket: TicketSchema,
4641
+ agent: UserSchema
4642
+ });
4643
+
4644
+ // src/comment/index.ts
4645
+ var commentContract = initContract30().router(
4646
+ {
4647
+ createComment: {
4648
+ method: "POST",
4649
+ path: "",
4650
+ headers: DefaultHeaderSchema,
4651
+ body: CreateCommentSchema,
4652
+ responses: {
4653
+ 201: DefaultSuccessResponseSchema.extend({
4654
+ comment: CommentSchema
4655
+ }),
4656
+ 400: z79.object({
4657
+ message: z79.string()
4658
+ }),
4659
+ 401: DefaultUnauthorizedSchema,
4660
+ 500: DefaultErrorResponseSchema
4661
+ },
4662
+ summary: "Create a comment."
4663
+ },
4664
+ getComments: {
4665
+ method: "GET",
4666
+ path: "",
4667
+ headers: DefaultHeaderSchema,
4668
+ query: GetCommentQuerySchema,
4669
+ responses: {
4670
+ 201: z79.array(CommentSchema),
4671
+ 400: z79.object({
4672
+ message: z79.string()
4673
+ }),
4674
+ 401: DefaultUnauthorizedSchema,
4675
+ 500: DefaultErrorResponseSchema
4676
+ },
4677
+ summary: "Get all comments."
4678
+ },
4679
+ updateComment: {
4680
+ method: "PATCH",
4681
+ path: "/:id",
4682
+ pathParams: z79.object({ id: z79.string() }),
4683
+ headers: DefaultHeaderSchema,
4684
+ body: UpdateCommentSchema,
4685
+ responses: {
4686
+ 200: DefaultSuccessResponseSchema.extend({
4687
+ comment: CommentSchema
4688
+ }),
4689
+ 500: DefaultErrorResponseSchema
4690
+ },
4691
+ summary: "Update a comment."
4692
+ },
4693
+ deleteComment: {
4694
+ method: "DELETE",
4695
+ path: "/:id",
4696
+ pathParams: z79.object({ id: z79.string() }),
4697
+ headers: DefaultHeaderSchema,
4698
+ body: null,
4699
+ responses: {
4700
+ 200: DefaultSuccessResponseSchema.extend({ message: z79.string() }),
4701
+ 500: DefaultErrorResponseSchema
4702
+ },
4703
+ summary: "Delete a comment."
4704
+ }
4705
+ },
4706
+ { pathPrefix: "comment" }
4707
+ );
4708
+
4709
+ // src/activity-log/index.ts
4710
+ import { initContract as initContract31 } from "@ts-rest/core";
4711
+ import z80 from "zod";
4712
+ var activityLogContract = initContract31().router(
4713
+ {
4714
+ getActivityLogs: {
4715
+ method: "GET",
4716
+ path: "",
4717
+ headers: DefaultHeaderSchema,
4718
+ responses: {
4719
+ 200: z80.array(ActivityLogSchema),
4720
+ 400: z80.object({
4721
+ message: z80.string()
4722
+ }),
4723
+ 401: DefaultUnauthorizedSchema,
4724
+ 500: DefaultErrorResponseSchema
4725
+ },
4726
+ summary: "Get all activity logs"
4727
+ }
4728
+ },
4729
+ { pathPrefix: "activity-log" }
4730
+ );
4731
+
4579
4732
  // src/contract.ts
4580
- var apiContract = initContract30().router({
4733
+ var apiContract = initContract32().router({
4581
4734
  auth: authContract,
4582
4735
  mail: mailContract,
4583
4736
  cxLog: cxLogContract,
@@ -4601,18 +4754,25 @@ var apiContract = initContract30().router({
4601
4754
  ticket: ticketContract,
4602
4755
  company: companyContract
4603
4756
  });
4604
- var platformContract = initContract30().router({
4757
+ var commentActivityContract = initContract32().router({
4758
+ comment: commentContract,
4759
+ activityLog: activityLogContract
4760
+ });
4761
+ var platformContract = initContract32().router({
4605
4762
  line: lineContract,
4606
4763
  messenger: messengerContract
4607
4764
  });
4608
- var chatContract = initContract30().router({
4765
+ var chatContract = initContract32().router({
4609
4766
  main: mainChatContract
4610
4767
  });
4611
4768
  export {
4769
+ activityLogContract,
4612
4770
  apiContract,
4613
4771
  attributeContract,
4614
4772
  categoryContract,
4615
4773
  chatContract,
4774
+ commentActivityContract,
4775
+ commentContract,
4616
4776
  cxLogContract,
4617
4777
  dashboardContract,
4618
4778
  platformContract,