@wenex/sdk 1.0.17 → 1.0.18

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.
@@ -4,3 +4,6 @@ import { MakeOptional } from './helper.interface';
4
4
  export type Dto<T extends Core = Core, K extends keyof T = keyof Core> = MakeOptional<T, keyof Core | K> & {
5
5
  _id?: Types.ObjectId;
6
6
  };
7
+ export type NesteDto<T extends Dto<Core>, R extends {
8
+ [K in keyof T]?: any;
9
+ }> = Omit<T, keyof R> & R;
@@ -1,7 +1,7 @@
1
1
  import type { Document } from 'mongoose';
2
2
  import { Action, Resource } from '../../../core';
3
- import { Core, Dto } from '../../../core/interfaces';
4
3
  import { GrantTime, GrantTimeDto } from './time.interface';
4
+ import { Core, Dto, NesteDto } from '../../../core/interfaces';
5
5
  export interface Grant<Properties extends object = object> extends Core<Properties> {
6
6
  subject: string;
7
7
  action: Action;
@@ -12,6 +12,6 @@ export interface Grant<Properties extends object = object> extends Core<Properti
12
12
  time?: GrantTime[];
13
13
  }
14
14
  export type GrantDoc<Properties extends object = object> = Grant<Properties> & Document;
15
- export type GrantDto<Properties extends object = object> = Dto<Omit<Grant<Properties>, 'time'>> & {
15
+ export type GrantDto<Properties extends object = object> = NesteDto<Dto<Grant<Properties>>, {
16
16
  time?: GrantTimeDto[];
17
- };
17
+ }>;
@@ -1,8 +1,8 @@
1
1
  import type { Document } from 'mongoose';
2
2
  import { Scope } from '../../../core';
3
3
  import { AppType } from '../../../enums/domain';
4
- import { Core, Dto } from '../../../core/interfaces';
5
4
  import { GrantType, Status } from '../../../core/enums';
5
+ import { Core, Dto, NesteDto } from '../../../core/interfaces';
6
6
  import { AppChangeLog, AppChangeLogDto } from './change-log.interface';
7
7
  export interface App<Properties extends object = object> extends Core<Properties> {
8
8
  type: AppType;
@@ -20,6 +20,6 @@ export interface App<Properties extends object = object> extends Core<Properties
20
20
  change_logs?: AppChangeLog[];
21
21
  }
22
22
  export type AppDoc<Properties extends object = object> = App<Properties> & Document;
23
- export type AppDto<Properties extends object = object> = Dto<Omit<App<Properties>, 'change_logs'>> & {
23
+ export type AppDto<Properties extends object = object> = NesteDto<Dto<App<Properties>>, {
24
24
  change_logs?: AppChangeLogDto[];
25
- };
25
+ }>;
@@ -1,7 +1,7 @@
1
1
  import type { Document } from 'mongoose';
2
2
  import { Scope } from '../../../core';
3
3
  import { ClientPlan } from '../../../enums/domain';
4
- import { Core, Dto } from '../../../core/interfaces';
4
+ import { Core, Dto, NesteDto } from '../../../core/interfaces';
5
5
  import { GrantType, State, Status } from '../../../core/enums';
6
6
  import { ClientDomain, ClientDomainDto } from './domain.interface';
7
7
  import { ClientService, ClientServiceDto } from './service.interface';
@@ -28,7 +28,7 @@ export interface Client<Properties extends object = object> extends Core<Propert
28
28
  services?: ClientService[];
29
29
  }
30
30
  export type ClientDoc<Properties extends object = object> = Client<Properties> & Document;
31
- export type ClientDto<Properties extends object = object> = Dto<Omit<Client<Properties>, 'domains' | 'services'>, 'state' | 'api_key' | 'client_id' | 'expiration_date'> & {
31
+ export type ClientDto<Properties extends object = object> = NesteDto<Dto<Client<Properties>, 'state' | 'api_key' | 'client_id' | 'expiration_date'>, {
32
32
  domains: ClientDomainDto[];
33
33
  services?: ClientServiceDto[];
34
- };
34
+ }>;
@@ -1,7 +1,7 @@
1
1
  import type { Document } from 'mongoose';
2
2
  import { EmailProvider } from '../../../enums/touch';
3
- import { Core, Dto, MakeOptional } from '../../../core/interfaces';
4
- import { EmailSmtp } from './smtp.interface';
3
+ import { EmailSmtp, EmailSmtpDto } from './smtp.interface';
4
+ import { Core, Dto, NesteDto } from '../../../core/interfaces';
5
5
  export interface Email<Properties extends object = object> extends Core<Properties> {
6
6
  provider: EmailProvider;
7
7
  to: string[];
@@ -18,5 +18,7 @@ export interface Email<Properties extends object = object> extends Core<Properti
18
18
  smtp?: EmailSmtp;
19
19
  }
20
20
  export type EmailDoc<Properties extends object = object> = Email<Properties> & Document;
21
- export type EmailDto<Properties extends object = object> = Dto<Email<Properties>>;
22
- export type EmailSendDto<Properties extends object = object> = MakeOptional<Omit<EmailDto<Properties>, 'smtp'>, 'provider'>;
21
+ export type EmailDto<Properties extends object = object> = NesteDto<Dto<Email<Properties>>, {
22
+ smtp?: EmailSmtpDto;
23
+ }>;
24
+ export type EmailSendDto<Properties extends object = object> = Dto<Omit<Email<Properties>, 'smtp'>, 'provider'>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wenex/sdk",
3
- "version": "1.0.17",
3
+ "version": "1.0.18",
4
4
  "description": "Wenex SDK",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",