@kl1/contracts 1.1.47 → 1.1.48

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
@@ -8129,6 +8129,26 @@ var MailAccountSchema = z109.object({
8129
8129
  z109.literal("unset")
8130
8130
  ])
8131
8131
  });
8132
+ var OAuth2AppSchema = z109.object({
8133
+ id: z109.string(),
8134
+ name: z109.string(),
8135
+ description: z109.string(),
8136
+ title: z109.string(),
8137
+ provider: z109.string(),
8138
+ enabled: z109.boolean(),
8139
+ legacy: z109.boolean(),
8140
+ created: z109.string(),
8141
+ updated: z109.string(),
8142
+ includeInListing: z109.boolean(),
8143
+ clientId: z109.string(),
8144
+ clientSecret: z109.string(),
8145
+ authority: z109.string(),
8146
+ redirectUrl: z109.string(),
8147
+ serviceClient: z109.string(),
8148
+ googleProjectId: z109.string(),
8149
+ serviceClientEmail: z109.string(),
8150
+ serviceKey: z109.string()
8151
+ });
8132
8152
 
8133
8153
  // src/mail/schemas/message.schema.ts
8134
8154
  import z110 from "zod";
@@ -8503,7 +8523,30 @@ var AccountContractsValidationSchemas = {
8503
8523
  input: z114.object({
8504
8524
  id: z114.string()
8505
8525
  }),
8526
+ output: z114.string()
8527
+ },
8528
+ deleteEmailEngineAcc: {
8529
+ input: z114.object({
8530
+ account: z114.string()
8531
+ }),
8506
8532
  output: MailAccountSchema
8533
+ },
8534
+ generateOAuth2AuthenticationLink: {
8535
+ body: z114.object({
8536
+ oAuth2AppId: z114.string(),
8537
+ mailServerId: z114.string()
8538
+ }),
8539
+ response: z114.object({
8540
+ url: z114.string(),
8541
+ account: z114.string()
8542
+ })
8543
+ },
8544
+ createOAuth2Acc: {
8545
+ body: z114.object({
8546
+ account: z114.string(),
8547
+ name: z114.string()
8548
+ }),
8549
+ response: MailAccountSchema
8507
8550
  }
8508
8551
  };
8509
8552
 
@@ -8534,6 +8577,29 @@ var accountContract = initContract43().router(
8534
8577
  summary: "Register a new mail account"
8535
8578
  },
8536
8579
  //#endregion register account
8580
+ //#region ........register account
8581
+ generateOAuth2AuthenticationLink: {
8582
+ method: "POST",
8583
+ path: "/oauth2_authentication_form_link",
8584
+ responses: {
8585
+ 201: DefaultSuccessResponseSchema.extend({
8586
+ data: AccountContractsValidationSchemas.generateOAuth2AuthenticationLink.response
8587
+ }),
8588
+ 400: z115.object({
8589
+ message: z115.string()
8590
+ }),
8591
+ 409: z115.object({
8592
+ message: z115.string()
8593
+ }),
8594
+ 500: z115.object({
8595
+ message: z115.string()
8596
+ }),
8597
+ ...DefaultResponses
8598
+ },
8599
+ body: AccountContractsValidationSchemas.generateOAuth2AuthenticationLink.body,
8600
+ summary: "Generate oauth2 authentication form link"
8601
+ },
8602
+ //#endregion register account
8537
8603
  //#region ........sync all accounts
8538
8604
  sync: {
8539
8605
  method: "GET",
@@ -8638,12 +8704,39 @@ var accountContract = initContract43().router(
8638
8704
  },
8639
8705
  body: null,
8640
8706
  summary: "Delete an account by id"
8641
- }
8707
+ },
8708
+ //#endregion delete account
8709
+ //#region ........delete account
8710
+ deleteEmailEngineAcc: {
8711
+ method: "DELETE",
8712
+ path: "/email-engine/:account",
8713
+ pathParams: AccountContractsValidationSchemas.deleteEmailEngineAcc.input,
8714
+ responses: {
8715
+ 200: DefaultSuccessResponseSchema.extend({
8716
+ message: z115.string()
8717
+ }),
8718
+ ...DefaultResponses
8719
+ },
8720
+ body: null,
8721
+ summary: "Delete an account by id"
8722
+ },
8642
8723
  //#endregion delete account
8724
+ //#region ........createOAuth2Acc
8725
+ createOAuth2Acc: {
8726
+ method: "POST",
8727
+ path: "/oauth2",
8728
+ responses: {
8729
+ 201: AccountContractsValidationSchemas.createOAuth2Acc.response,
8730
+ ...DefaultResponses
8731
+ },
8732
+ body: AccountContractsValidationSchemas.createOAuth2Acc.body,
8733
+ summary: "Register OAuth2 account."
8734
+ }
8735
+ //#endregion createOAuth2Acc
8643
8736
  },
8644
8737
  {
8645
8738
  baseHeaders: DefaultHeaderSchema,
8646
- pathPrefix: "mail/account"
8739
+ pathPrefix: "email-service/mail/account"
8647
8740
  }
8648
8741
  );
8649
8742
 
@@ -8680,6 +8773,22 @@ var serverContract = initContract44().router(
8680
8773
  body: CreateMailServerSchema,
8681
8774
  summary: "Register a new mail server"
8682
8775
  },
8776
+ getOAuth2Apps: {
8777
+ method: "GET",
8778
+ path: "/oauth2/apps",
8779
+ responses: {
8780
+ 200: DefaultSuccessResponseSchema.extend({
8781
+ data: z117.object({
8782
+ total: z117.number(),
8783
+ pages: z117.number(),
8784
+ page: z117.number(),
8785
+ apps: z117.array(OAuth2AppSchema)
8786
+ })
8787
+ }),
8788
+ ...DefaultResponses
8789
+ },
8790
+ summary: "Get all oauth2 apps"
8791
+ },
8683
8792
  getById: {
8684
8793
  method: "GET",
8685
8794
  path: "/:id",
@@ -8737,7 +8846,7 @@ var serverContract = initContract44().router(
8737
8846
  }
8738
8847
  },
8739
8848
  {
8740
- pathPrefix: "mail/server"
8849
+ pathPrefix: "email-service/mail/server"
8741
8850
  }
8742
8851
  );
8743
8852