@xoxno/types 1.0.30 → 1.0.31

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.
@@ -1,9 +1,34 @@
1
+ import { ChatDataType } from './chat-data-type.enum';
1
2
  import { ChatMessageContentType } from './chat-message-content-type.enum';
2
- export declare class ChatMessageDoc {
3
- dataType: string;
3
+ import { OwnerDto } from '../../../common/owner.dto';
4
+ interface IType {
5
+ dataType: ChatDataType;
4
6
  chatId: string;
7
+ isGroupChat: boolean;
8
+ message: ChatMessage;
9
+ pk: string;
10
+ id: string;
11
+ ttl?: number;
12
+ _ts?: number;
13
+ }
14
+ export declare class ChatMessageDoc implements IType {
5
15
  sender: string;
6
16
  receiver: string;
17
+ dataType: ChatDataType;
18
+ chatId: string;
19
+ isGroupChat: boolean;
20
+ message: ChatMessage;
21
+ pk: string;
22
+ id: string;
23
+ ttl?: number;
24
+ _ts?: number;
25
+ constructor(props: Partial<ChatMessageDoc>);
26
+ }
27
+ export declare class ChatMessageDocHyrated implements IType {
28
+ sender: OwnerDto;
29
+ receiver: OwnerDto;
30
+ dataType: ChatDataType;
31
+ chatId: string;
7
32
  isGroupChat: boolean;
8
33
  message: ChatMessage;
9
34
  pk: string;
@@ -42,3 +67,4 @@ export interface ChatMessageDetails {
42
67
  chatName: string;
43
68
  id: string;
44
69
  }
70
+ export {};
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ChatMessageDoc = void 0;
3
+ exports.ChatMessageDocHyrated = exports.ChatMessageDoc = void 0;
4
4
  const uuid_1 = require("uuid");
5
5
  const chat_data_type_enum_1 = require("./chat-data-type.enum");
6
6
  class ChatMessageDoc {
@@ -15,3 +15,15 @@ class ChatMessageDoc {
15
15
  }
16
16
  }
17
17
  exports.ChatMessageDoc = ChatMessageDoc;
18
+ class ChatMessageDocHyrated {
19
+ constructor(props) {
20
+ this.dataType = chat_data_type_enum_1.ChatDataType.MESSAGE;
21
+ Object.assign(this, props);
22
+ this.id = (0, uuid_1.v4)();
23
+ this.pk = props.chatId;
24
+ if (this.isGroupChat) {
25
+ this.ttl = Math.floor(Date.now() / 1000) + 60 * 60 * 24 * 7; // 7 days
26
+ }
27
+ }
28
+ }
29
+ exports.ChatMessageDocHyrated = ChatMessageDocHyrated;
@@ -1,10 +1,30 @@
1
- export declare class UserBlockDoc {
2
- dataType: string;
1
+ import { OwnerDto } from '../../../common/owner.dto';
2
+ import { ChatDataType } from './chat-data-type.enum';
3
+ interface IType {
4
+ dataType: ChatDataType;
5
+ timestamp: number;
6
+ id: string;
7
+ pk: string;
8
+ _ts: number;
9
+ }
10
+ export declare class UserBlockDoc implements IType {
3
11
  sender: string;
4
12
  receiver: string;
13
+ dataType: ChatDataType;
14
+ timestamp: number;
15
+ id: string;
16
+ pk: string;
17
+ _ts: number;
18
+ constructor(props: Partial<UserBlockDoc>);
19
+ }
20
+ export declare class UserBlockDocHydrated implements IType {
21
+ sender: OwnerDto;
22
+ receiver: OwnerDto;
23
+ dataType: ChatDataType;
5
24
  timestamp: number;
6
25
  id: string;
7
26
  pk: string;
8
27
  _ts: number;
9
28
  constructor(props: Partial<UserBlockDoc>);
10
29
  }
30
+ export {};
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.UserBlockDoc = void 0;
3
+ exports.UserBlockDocHydrated = exports.UserBlockDoc = void 0;
4
4
  const chat_data_type_enum_1 = require("./chat-data-type.enum");
5
5
  class UserBlockDoc {
6
6
  constructor(props) {
@@ -12,3 +12,13 @@ class UserBlockDoc {
12
12
  }
13
13
  }
14
14
  exports.UserBlockDoc = UserBlockDoc;
15
+ class UserBlockDocHydrated {
16
+ constructor(props) {
17
+ this.dataType = chat_data_type_enum_1.ChatDataType.BLOCKED_USER;
18
+ this.timestamp = Math.floor(Date.now() / 1000);
19
+ Object.assign(this, props);
20
+ this.id = props.sender;
21
+ this.pk = props.receiver;
22
+ }
23
+ }
24
+ exports.UserBlockDocHydrated = UserBlockDocHydrated;
@@ -1,10 +1,10 @@
1
+ import { OwnerDto } from '../../../common/owner.dto';
2
+ import { ChatDataType } from './chat-data-type.enum';
1
3
  import { ChatMessage } from './chat-message.doc';
2
- export declare class UserConversationDoc {
3
- dataType: string;
4
+ interface IType {
5
+ dataType: ChatDataType;
4
6
  chatName?: string;
5
7
  isGroupChat: boolean;
6
- sender: string;
7
- receiver: string;
8
8
  chatId: string;
9
9
  message: ChatMessage;
10
10
  deleteTimestamp?: number;
@@ -12,5 +12,35 @@ export declare class UserConversationDoc {
12
12
  id: string;
13
13
  pk: string;
14
14
  _ts: number;
15
+ }
16
+ export declare class UserConversationDoc implements IType {
17
+ sender: string;
18
+ receiver: string;
19
+ dataType: ChatDataType;
20
+ chatName?: string | undefined;
21
+ isGroupChat: boolean;
22
+ chatId: string;
23
+ message: ChatMessage;
24
+ deleteTimestamp?: number | undefined;
25
+ unreadCount?: number | undefined;
26
+ id: string;
27
+ pk: string;
28
+ _ts: number;
15
29
  constructor(props: Partial<UserConversationDoc>);
16
30
  }
31
+ export declare class UserConversationDocHydrated implements IType {
32
+ sender: OwnerDto;
33
+ receiver: OwnerDto;
34
+ dataType: ChatDataType;
35
+ chatName?: string | undefined;
36
+ isGroupChat: boolean;
37
+ chatId: string;
38
+ message: ChatMessage;
39
+ deleteTimestamp?: number | undefined;
40
+ unreadCount?: number | undefined;
41
+ id: string;
42
+ pk: string;
43
+ _ts: number;
44
+ constructor(props: Partial<UserConversationDocHydrated>);
45
+ }
46
+ export {};
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.UserConversationDoc = void 0;
3
+ exports.UserConversationDocHydrated = exports.UserConversationDoc = void 0;
4
4
  const chat_data_type_enum_1 = require("./chat-data-type.enum");
5
5
  class UserConversationDoc {
6
6
  constructor(props) {
@@ -11,3 +11,10 @@ class UserConversationDoc {
11
11
  }
12
12
  }
13
13
  exports.UserConversationDoc = UserConversationDoc;
14
+ class UserConversationDocHydrated {
15
+ constructor(props) {
16
+ this.dataType = chat_data_type_enum_1.ChatDataType.CONVERSATION;
17
+ Object.assign(this, props);
18
+ }
19
+ }
20
+ exports.UserConversationDocHydrated = UserConversationDocHydrated;
@@ -1,27 +1,29 @@
1
- import { ActivityChain } from '../../common/enums';
2
- declare class AirdropRawClass {
1
+ import { Wallet } from '../../utils/types';
2
+ interface IType {
3
3
  tokenAllocation: number;
4
4
  totalScore: number;
5
5
  rank: number;
6
6
  isClaimed?: boolean;
7
- signature?: {
7
+ signature: {
8
8
  signature: string;
9
9
  data: string;
10
10
  };
11
11
  amount?: string;
12
12
  }
13
- export type AirdropRaw = AirdropRawClass & {
13
+ export type AirdropDto = IType & {
14
14
  wallet: string;
15
15
  };
16
- export interface Wallet {
17
- address: string;
18
- addressTrimmed: string;
19
- profile: string;
20
- username: string;
21
- isVerified: boolean;
22
- chain?: ActivityChain;
23
- }
24
- export declare class AirdropDto extends AirdropRawClass {
16
+ export declare class AirdropDtoHydrated implements IType {
25
17
  wallet: Wallet;
18
+ tokenAllocation: number;
19
+ totalScore: number;
20
+ rank: number;
21
+ isClaimed?: boolean | undefined;
22
+ signature: {
23
+ signature: string;
24
+ data: string;
25
+ };
26
+ amount?: string | undefined;
27
+ constructor(args: Partial<AirdropDtoHydrated>);
26
28
  }
27
29
  export {};
@@ -1,8 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.AirdropDto = void 0;
4
- class AirdropRawClass {
3
+ exports.AirdropDtoHydrated = void 0;
4
+ class AirdropDtoHydrated {
5
+ constructor(args) {
6
+ Object.assign(this, args);
7
+ }
5
8
  }
6
- class AirdropDto extends AirdropRawClass {
7
- }
8
- exports.AirdropDto = AirdropDto;
9
+ exports.AirdropDtoHydrated = AirdropDtoHydrated;
@@ -1,4 +1,4 @@
1
- import { Wallet } from '../../entities/airdrop/airdrop.dto';
1
+ import { Wallet } from '../../utils/types';
2
2
  export declare class BoberBattleLeaderboardDto {
3
3
  GamesCreated: number;
4
4
  GamesCreatedHead: number;
@@ -26,6 +26,6 @@ export declare class BoberBattleUserDto extends BoberBattleLeaderboardDto {
26
26
  WinRate: number;
27
27
  constructor(data: Partial<BoberBattleUserDto>);
28
28
  }
29
- export declare class BoberBattleUserFullDto extends BoberBattleLeaderboardDto {
29
+ export declare class BoberBattleUserDtoHydrated extends BoberBattleLeaderboardDto {
30
30
  wallet: Wallet;
31
31
  }
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.BoberBattleUserFullDto = exports.BoberBattleUserDto = exports.BoberBattleLeaderboardDto = void 0;
3
+ exports.BoberBattleUserDtoHydrated = exports.BoberBattleUserDto = exports.BoberBattleLeaderboardDto = void 0;
4
4
  class BoberBattleLeaderboardDto {
5
5
  constructor(data) {
6
6
  Object.assign(this, data);
@@ -14,6 +14,6 @@ class BoberBattleUserDto extends BoberBattleLeaderboardDto {
14
14
  }
15
15
  }
16
16
  exports.BoberBattleUserDto = BoberBattleUserDto;
17
- class BoberBattleUserFullDto extends BoberBattleLeaderboardDto {
17
+ class BoberBattleUserDtoHydrated extends BoberBattleLeaderboardDto {
18
18
  }
19
- exports.BoberBattleUserFullDto = BoberBattleUserFullDto;
19
+ exports.BoberBattleUserDtoHydrated = BoberBattleUserDtoHydrated;
@@ -1,3 +1,12 @@
1
+ import { ActivityChain } from '../common/enums';
1
2
  export type PublicOnly<T> = {
2
3
  [K in keyof T as T[K] extends Function ? never : K]: T[K];
3
4
  };
5
+ export interface Wallet {
6
+ address: string;
7
+ addressTrimmed: string;
8
+ profile: string;
9
+ username: string;
10
+ isVerified: boolean;
11
+ chain?: ActivityChain;
12
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xoxno/types",
3
- "version": "1.0.30",
3
+ "version": "1.0.31",
4
4
  "description": "Shared types and utilities for XOXNO API.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",