@wenex/sdk 1.0.16 → 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.
- package/common/core/interfaces/dto.interface.d.ts +3 -0
- package/common/core/utils/transform.util.js +1 -1
- package/common/core/utils/transform.util.js.map +1 -1
- package/common/interfaces/auth/grants/grant.interface.d.ts +3 -3
- package/common/interfaces/domain/apps/app.interface.d.ts +3 -3
- package/common/interfaces/domain/clients/client.interface.d.ts +3 -3
- package/common/interfaces/touch/emails/email.interface.d.ts +6 -4
- package/package.json +1 -1
|
@@ -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;
|
|
@@ -74,7 +74,7 @@ function toDate(val) {
|
|
|
74
74
|
* processing it with the `phone` function. If a valid phone number is found, it returns the
|
|
75
75
|
* `phoneNumber`, otherwise it returns `undefined`.
|
|
76
76
|
*/
|
|
77
|
-
function toPhone(val, country) {
|
|
77
|
+
function toPhone(val, country = process.env.REGION || 'IR') {
|
|
78
78
|
if (typeof val === 'string') {
|
|
79
79
|
const { phoneNumber } = (0, phone_1.phone)(val, { country });
|
|
80
80
|
return phoneNumber ? phoneNumber : undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transform.util.js","sourceRoot":"","sources":["../../../src/common/core/utils/transform.util.ts"],"names":[],"mappings":";;;AAoBA,wBAMC;AAWD,4BAMC;AAUD,wBAEC;AAcD,0BAKC;AA1ED,iCAA8B;AAEvB,MAAM,SAAS,GAAG,CAAC,GAAwB,EAAE,OAAqC,EAAE,EAAE;IAC3F,OAAO,UAAU,EAAE,KAAK,EAAkB;QACx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CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;AACpD,CAAC,CAAC;AAJS,QAAA,WAAW,eAIpB"}
|
|
@@ -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<
|
|
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<
|
|
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<
|
|
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 {
|
|
4
|
-
import {
|
|
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
|
-
|
|
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'>;
|