@aitlabs/namkwong 0.0.112 → 0.0.113

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.
@@ -4800,7 +4800,7 @@ export declare const adminRouter: Elysia<"/admin", {
4800
4800
  200: {
4801
4801
  data: {
4802
4802
  baseAssetIdSnapshot: string;
4803
- control?: {
4803
+ control: {
4804
4804
  createdAt: Date;
4805
4805
  updatedAt: Date;
4806
4806
  id: string;
@@ -4817,7 +4817,7 @@ export declare const adminRouter: Elysia<"/admin", {
4817
4817
  failureCode: string | null;
4818
4818
  failureReason: string | null;
4819
4819
  appliedAt: Date | null;
4820
- } | undefined;
4820
+ } | null;
4821
4821
  createdAt: Date;
4822
4822
  direction: "down" | "up";
4823
4823
  durationConfig: {
@@ -15,6 +15,25 @@ export declare const auth: import("better-auth").Auth<{
15
15
  name: string;
16
16
  image?: string | null | undefined;
17
17
  } & Record<string, unknown>, context: import("better-auth").GenericEndpointContext | null) => Promise<void>;
18
+ readonly before: (user: {
19
+ id: string;
20
+ createdAt: Date;
21
+ updatedAt: Date;
22
+ email: string;
23
+ emailVerified: boolean;
24
+ name: string;
25
+ image?: string | null | undefined;
26
+ } & Record<string, unknown>, ctx: import("better-auth").GenericEndpointContext | null) => Promise<{
27
+ data: {
28
+ id: string;
29
+ createdAt: Date;
30
+ updatedAt: Date;
31
+ email: string;
32
+ emailVerified: boolean;
33
+ name: string;
34
+ image?: string | null | undefined;
35
+ } & Record<string, unknown>;
36
+ }>;
18
37
  };
19
38
  };
20
39
  };
@@ -51,6 +51,8 @@ export declare const authZhTranslations: {
51
51
  METHOD_NOT_ALLOWED_DEFER_SESSION_REQUIRED: string;
52
52
  BODY_MUST_BE_AN_OBJECT: string;
53
53
  PASSWORD_ALREADY_SET: string;
54
+ INVITE_CODE_REQUIRED: string;
55
+ INVITE_CODE_INVALID: string;
54
56
  INVALID_USERNAME_OR_PASSWORD: string;
55
57
  USERNAME_IS_ALREADY_TAKEN: string;
56
58
  USERNAME_TOO_SHORT: string;
@@ -35,19 +35,7 @@ export declare const bankAccountAdminRouter: Elysia<"/bank_account", {
35
35
  headers: import("elysia").HTTPHeaders;
36
36
  status?: number | keyof import("elysia").StatusMap;
37
37
  redirect?: string;
38
- cookie?: Record<string, {
39
- domain?: string | undefined;
40
- expires?: Date | undefined;
41
- httpOnly?: boolean | undefined;
42
- maxAge?: number | undefined;
43
- path?: string | undefined;
44
- priority?: 'low' | 'medium' | 'high' | undefined;
45
- partitioned?: boolean | undefined;
46
- sameSite?: true | false | 'lax' | 'strict' | 'none' | undefined;
47
- secure?: boolean | undefined;
48
- secrets?: string | null | (string | null)[];
49
- value?: unknown;
50
- }>;
38
+ cookie?: Record<string, import("elysia/cookies").ElysiaCookie>;
51
39
  };
52
40
  path: string;
53
41
  route: string;
@@ -962,7 +962,7 @@ export declare const binaryOptionAdminOrderListQuerySchema: import("@sinclair/ty
962
962
  export type BinaryOptionAdminOrderListQueryType = typeof binaryOptionAdminOrderListQuerySchema.static;
963
963
  export declare const binaryOptionAdminOrderItemSchema: import("@sinclair/typebox").TObject<{
964
964
  baseAssetIdSnapshot: import("@sinclair/typebox").TString;
965
- control: import("@sinclair/typebox").TOptional<import("drizzle-typebox").BuildSchema<"select", {
965
+ control: import("@sinclair/typebox").TUnion<[import("drizzle-typebox").BuildSchema<"select", {
966
966
  createdAt: import("drizzle-orm/pg-core").PgColumn<{
967
967
  name: "created_at";
968
968
  tableName: "binary_option_order_control";
@@ -1235,7 +1235,7 @@ export declare const binaryOptionAdminOrderItemSchema: import("@sinclair/typebox
1235
1235
  identity: undefined;
1236
1236
  generated: undefined;
1237
1237
  }, {}, {}>;
1238
- }, undefined>>;
1238
+ }, undefined>, import("@sinclair/typebox").TNull]>;
1239
1239
  createdAt: import("@sinclair/typebox").TDate;
1240
1240
  direction: import("@sinclair/typebox").TEnum<{
1241
1241
  down: "down";
@@ -1457,7 +1457,7 @@ export declare const binaryOptionAdminOrderItemSchema: import("@sinclair/typebox
1457
1457
  export declare const binaryOptionAdminOrderListResponseSchema: import("@sinclair/typebox").TObject<{
1458
1458
  data: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
1459
1459
  baseAssetIdSnapshot: import("@sinclair/typebox").TString;
1460
- control: import("@sinclair/typebox").TOptional<import("drizzle-typebox").BuildSchema<"select", {
1460
+ control: import("@sinclair/typebox").TUnion<[import("drizzle-typebox").BuildSchema<"select", {
1461
1461
  createdAt: import("drizzle-orm/pg-core").PgColumn<{
1462
1462
  name: "created_at";
1463
1463
  tableName: "binary_option_order_control";
@@ -1730,7 +1730,7 @@ export declare const binaryOptionAdminOrderListResponseSchema: import("@sinclair
1730
1730
  identity: undefined;
1731
1731
  generated: undefined;
1732
1732
  }, {}, {}>;
1733
- }, undefined>>;
1733
+ }, undefined>, import("@sinclair/typebox").TNull]>;
1734
1734
  createdAt: import("@sinclair/typebox").TDate;
1735
1735
  direction: import("@sinclair/typebox").TEnum<{
1736
1736
  down: "down";
@@ -1083,7 +1083,7 @@ export declare const binaryOptionAdminRouter: Elysia<"/binary_option", {
1083
1083
  200: {
1084
1084
  data: {
1085
1085
  baseAssetIdSnapshot: string;
1086
- control?: {
1086
+ control: {
1087
1087
  createdAt: Date;
1088
1088
  updatedAt: Date;
1089
1089
  id: string;
@@ -1100,7 +1100,7 @@ export declare const binaryOptionAdminRouter: Elysia<"/binary_option", {
1100
1100
  failureCode: string | null;
1101
1101
  failureReason: string | null;
1102
1102
  appliedAt: Date | null;
1103
- } | undefined;
1103
+ } | null;
1104
1104
  createdAt: Date;
1105
1105
  direction: "down" | "up";
1106
1106
  durationConfig: {
@@ -366,7 +366,7 @@ export declare abstract class AdminBinaryOptionService extends BaseBinaryOptionA
366
366
  sortOrder: number;
367
367
  }>;
368
368
  static listOrders(query?: BinaryOptionAdminOrderListQueryType): Promise<{
369
- items: {
369
+ items: ({
370
370
  baseAssetIdSnapshot: string;
371
371
  control: {
372
372
  appliedAssetPriceId: string | null;
@@ -437,7 +437,61 @@ export declare abstract class AdminBinaryOptionService extends BaseBinaryOptionA
437
437
  };
438
438
  userId: string;
439
439
  winPayoutMultiplierSnapshot: string;
440
- }[];
440
+ } | {
441
+ control: null;
442
+ baseAssetIdSnapshot: string;
443
+ createdAt: Date;
444
+ direction: "down" | "up";
445
+ durationConfig: {
446
+ createdAt: Date;
447
+ durationSeconds: number;
448
+ id: string;
449
+ isEnabled: boolean;
450
+ losePayoutMultiplier: string;
451
+ marketId: string;
452
+ sortOrder: number;
453
+ updatedAt: Date;
454
+ winPayoutMultiplier: string;
455
+ };
456
+ durationConfigId: string;
457
+ durationSeconds: number;
458
+ expireAt: Date;
459
+ failureCode: string | null;
460
+ failureReason: string | null;
461
+ id: string;
462
+ idempotencyKey: string;
463
+ losePayoutMultiplierSnapshot: string;
464
+ market: {
465
+ id: string;
466
+ name: string;
467
+ status: "active" | "draft" | "ended" | "paused";
468
+ symbolSnapshot: string;
469
+ };
470
+ marketId: string;
471
+ marketNameSnapshot: string;
472
+ openPrice: string;
473
+ openPriceAt: Date;
474
+ orderNo: string;
475
+ payoutAmount: string | null;
476
+ quoteAssetIdSnapshot: string;
477
+ result: "cancelled" | "draw" | "expired" | "failed" | "lose" | "win" | null;
478
+ settlementPrice: string | null;
479
+ settlementPriceAt: Date | null;
480
+ stakeAmount: string;
481
+ stakeLedgerEntryId: string | null;
482
+ status: "active" | "cancelled" | "created" | "expired" | "failed" | "settled";
483
+ symbolSnapshot: string;
484
+ updatedAt: Date;
485
+ user: {
486
+ displayUsername: string | null;
487
+ email: string;
488
+ id: string;
489
+ name: string;
490
+ username: string | null;
491
+ };
492
+ userId: string;
493
+ winPayoutMultiplierSnapshot: string;
494
+ })[];
441
495
  total: number;
442
496
  }>;
443
497
  static listSettlements(query?: BinaryOptionAdminSettlementListQueryType): Promise<{
@@ -30,6 +30,7 @@ export declare const BinaryOptionErrorCodes: {
30
30
  readonly BINARY_OPTION_STAKE_AMOUNT_INVALID: 'BINARY_OPTION_STAKE_AMOUNT_INVALID';
31
31
  readonly BINARY_OPTION_STAKE_AMOUNT_OUT_OF_RANGE: 'BINARY_OPTION_STAKE_AMOUNT_OUT_OF_RANGE';
32
32
  readonly BINARY_OPTION_TRANSACTION_PASSWORD_REQUIRED: 'BINARY_OPTION_TRANSACTION_PASSWORD_REQUIRED';
33
+ readonly BINARY_OPTION_SUPER_ADMIN_REQUIRED: 'BINARY_OPTION_SUPER_ADMIN_REQUIRED';
33
34
  };
34
35
  type BinaryOptionErrorCodesType = typeof BinaryOptionErrorCodes;
35
36
  export type BinaryOptionErrorCode = keyof BinaryOptionErrorCodesType;
@@ -29,6 +29,7 @@ export declare const zh: {
29
29
  BINARY_OPTION_STAKE_AMOUNT_INVALID: string;
30
30
  BINARY_OPTION_STAKE_AMOUNT_OUT_OF_RANGE: string;
31
31
  BINARY_OPTION_TRANSACTION_PASSWORD_REQUIRED: string;
32
+ BINARY_OPTION_SUPER_ADMIN_REQUIRED: string;
32
33
  };
33
34
  type ZHType = typeof zh;
34
35
  declare module '../../../error/messages' {
@@ -35,7 +35,19 @@ export declare const contentVideoAdminRouter: Elysia<"/content_videos", {
35
35
  headers: import("elysia").HTTPHeaders;
36
36
  status?: number | keyof import("elysia").StatusMap;
37
37
  redirect?: string;
38
- cookie?: Record<string, import("elysia/cookies").ElysiaCookie>;
38
+ cookie?: Record<string, {
39
+ domain?: string | undefined;
40
+ expires?: Date | undefined;
41
+ httpOnly?: boolean | undefined;
42
+ maxAge?: number | undefined;
43
+ path?: string | undefined;
44
+ priority?: 'low' | 'medium' | 'high' | undefined;
45
+ partitioned?: boolean | undefined;
46
+ sameSite?: true | false | 'lax' | 'strict' | 'none' | undefined;
47
+ secure?: boolean | undefined;
48
+ secrets?: string | null | (string | null)[];
49
+ value?: unknown;
50
+ }>;
39
51
  };
40
52
  path: string;
41
53
  route: string;
package/dist/index.d.ts CHANGED
@@ -5384,7 +5384,7 @@ declare const app: Elysia<"/api", {
5384
5384
  200: {
5385
5385
  data: {
5386
5386
  baseAssetIdSnapshot: string;
5387
- control?: {
5387
+ control: {
5388
5388
  createdAt: Date;
5389
5389
  updatedAt: Date;
5390
5390
  id: string;
@@ -5401,7 +5401,7 @@ declare const app: Elysia<"/api", {
5401
5401
  failureCode: string | null;
5402
5402
  failureReason: string | null;
5403
5403
  appliedAt: Date | null;
5404
- } | undefined;
5404
+ } | null;
5405
5405
  createdAt: Date;
5406
5406
  direction: "down" | "up";
5407
5407
  durationConfig: {
@@ -35,7 +35,19 @@ export declare const ledgerRouter: Elysia<"/ledger", {
35
35
  headers: import("elysia").HTTPHeaders;
36
36
  status?: number | keyof import("elysia").StatusMap;
37
37
  redirect?: string;
38
- cookie?: Record<string, import("elysia/cookies").ElysiaCookie>;
38
+ cookie?: Record<string, {
39
+ domain?: string | undefined;
40
+ expires?: Date | undefined;
41
+ httpOnly?: boolean | undefined;
42
+ maxAge?: number | undefined;
43
+ path?: string | undefined;
44
+ priority?: 'low' | 'medium' | 'high' | undefined;
45
+ partitioned?: boolean | undefined;
46
+ sameSite?: true | false | 'lax' | 'strict' | 'none' | undefined;
47
+ secure?: boolean | undefined;
48
+ secrets?: string | null | (string | null)[];
49
+ value?: unknown;
50
+ }>;
39
51
  };
40
52
  path: string;
41
53
  route: string;
@@ -1,6 +1,8 @@
1
1
  import type { AdminManualAdjustCnyBalanceByUsersBatchInputType, AdminManualAdjustLedgerAccountByUsersBatchInputType, AdminManualAdjustLedgerAccountBatchInputType, AdminManualAdjustLedgerAccountInputType, LedgerAccountStatusUpdateInputType } from './dto.schemas';
2
2
  import { BaseLedgerAccountService, type LedgerAccountListQueryOptions } from '../internal/service';
3
3
  export declare abstract class AdminLedgerAccountService extends BaseLedgerAccountService {
4
+ private static buildCnyBalanceAdjustNotificationTitle;
5
+ private static buildCnyBalanceAdjustNotificationContent;
4
6
  private static normalizePositiveAmount;
5
7
  private static resolveAdjustTargetAccount;
6
8
  private static buildCnyBalanceAdjustReferenceId;
@@ -212,7 +214,16 @@ export declare abstract class AdminLedgerAccountService extends BaseLedgerAccoun
212
214
  userId: string;
213
215
  version: number;
214
216
  }>;
215
- static manualAdjustLedgerAccount(operatorId: string, input: AdminManualAdjustLedgerAccountInputType): Promise<{
217
+ static manualAdjustLedgerAccount(operatorId: string, input: AdminManualAdjustLedgerAccountInputType, options?: {
218
+ notify?: {
219
+ userId: string;
220
+ type: 'system' | 'transaction' | 'activity' | 'security';
221
+ category: string;
222
+ title: string;
223
+ content: string;
224
+ priority?: 'low' | 'normal' | 'high' | 'urgent';
225
+ };
226
+ }): Promise<{
216
227
  accountId: string;
217
228
  userId: string;
218
229
  assetId: string;
@@ -35,7 +35,19 @@ export declare const marketSymbolAdminRouter: Elysia<"/market_symbol", {
35
35
  headers: import("elysia").HTTPHeaders;
36
36
  status?: number | keyof import("elysia").StatusMap;
37
37
  redirect?: string;
38
- cookie?: Record<string, import("elysia/cookies").ElysiaCookie>;
38
+ cookie?: Record<string, {
39
+ domain?: string | undefined;
40
+ expires?: Date | undefined;
41
+ httpOnly?: boolean | undefined;
42
+ maxAge?: number | undefined;
43
+ path?: string | undefined;
44
+ priority?: 'low' | 'medium' | 'high' | undefined;
45
+ partitioned?: boolean | undefined;
46
+ sameSite?: true | false | 'lax' | 'strict' | 'none' | undefined;
47
+ secure?: boolean | undefined;
48
+ secrets?: string | null | (string | null)[];
49
+ value?: unknown;
50
+ }>;
39
51
  };
40
52
  path: string;
41
53
  route: string;
@@ -1,2 +1,4 @@
1
1
  export declare const createNumericNanoid: (size?: number) => string;
2
2
  export default createNumericNanoid;
3
+ export declare const createClearUppercaseNanoid: (size?: number) => string;
4
+ export declare const createUppercaseNanoid: (size?: number) => string;
@@ -1,13 +1,19 @@
1
1
  import type { UserAdminBanSchemaType, UserAdminSearchQuerySchemaType, UserProfileAdminListQuerySchemaType, UserProfileAdminUpdateSchemaType } from './dto.schemas';
2
2
  import { InternalUserService } from '../internal/service';
3
+ type CurrentAdminUser = {
4
+ id: string;
5
+ role?: string | null;
6
+ };
3
7
  export declare abstract class AdminUserService extends InternalUserService {
4
- static banNormalUser(userId: string, input: UserAdminBanSchemaType, headers: Headers): Promise<{
8
+ private static isSuperAdmin;
9
+ private static assertUserInReferralScope;
10
+ static banNormalUser(currentUser: CurrentAdminUser, userId: string, input: UserAdminBanSchemaType, headers: Headers): Promise<{
5
11
  success: boolean;
6
12
  }>;
7
- static resetUserPassword(userId: string, headers: Headers): Promise<{
13
+ static resetUserPassword(currentUser: CurrentAdminUser, userId: string, headers: Headers): Promise<{
8
14
  password: string;
9
15
  }>;
10
- static searchUsers(query: UserAdminSearchQuerySchemaType): Promise<{
16
+ static searchUsers(currentUser: CurrentAdminUser, query: UserAdminSearchQuerySchemaType): Promise<{
11
17
  data: {
12
18
  id: string;
13
19
  name: string;
@@ -34,7 +40,7 @@ export declare abstract class AdminUserService extends InternalUserService {
34
40
  hasNextPage: boolean;
35
41
  };
36
42
  }>;
37
- static listProfiles(query: UserProfileAdminListQuerySchemaType): Promise<{
43
+ static listProfiles(currentUser: CurrentAdminUser, query: UserProfileAdminListQuerySchemaType): Promise<{
38
44
  data: {
39
45
  id: string;
40
46
  name: string;
@@ -94,7 +100,7 @@ export declare abstract class AdminUserService extends InternalUserService {
94
100
  hasNextPage: boolean;
95
101
  };
96
102
  }>;
97
- static getProfile(userId: string): Promise<{
103
+ static getProfile(currentUser: CurrentAdminUser, userId: string): Promise<{
98
104
  id: string;
99
105
  name: string;
100
106
  email: string;
@@ -126,7 +132,7 @@ export declare abstract class AdminUserService extends InternalUserService {
126
132
  referredBy: string | null;
127
133
  };
128
134
  }>;
129
- static getLatestSessionByUserId(userId: string): Promise<{
135
+ static getLatestSessionByUserId(currentUser: CurrentAdminUser, userId: string): Promise<{
130
136
  createdAt: Date;
131
137
  expiresAt: Date;
132
138
  id: string;
@@ -136,7 +142,7 @@ export declare abstract class AdminUserService extends InternalUserService {
136
142
  userAgent: string | null;
137
143
  userId: string;
138
144
  } | null>;
139
- static updateProfile(userId: string, payload: UserProfileAdminUpdateSchemaType): Promise<{
145
+ static updateProfile(currentUser: CurrentAdminUser, userId: string, payload: UserProfileAdminUpdateSchemaType): Promise<{
140
146
  id: string;
141
147
  name: string;
142
148
  email: string;
@@ -169,3 +175,4 @@ export declare abstract class AdminUserService extends InternalUserService {
169
175
  };
170
176
  }>;
171
177
  }
178
+ export {};
@@ -35,19 +35,7 @@ export declare const userKycAdminRouter: Elysia<"/kyc", {
35
35
  headers: import("elysia").HTTPHeaders;
36
36
  status?: number | keyof import("elysia").StatusMap;
37
37
  redirect?: string;
38
- cookie?: Record<string, {
39
- domain?: string | undefined;
40
- expires?: Date | undefined;
41
- httpOnly?: boolean | undefined;
42
- maxAge?: number | undefined;
43
- path?: string | undefined;
44
- priority?: 'low' | 'medium' | 'high' | undefined;
45
- partitioned?: boolean | undefined;
46
- sameSite?: true | false | 'lax' | 'strict' | 'none' | undefined;
47
- secure?: boolean | undefined;
48
- secrets?: string | null | (string | null)[];
49
- value?: unknown;
50
- }>;
38
+ cookie?: Record<string, import("elysia/cookies").ElysiaCookie>;
51
39
  };
52
40
  path: string;
53
41
  route: string;
@@ -35,19 +35,7 @@ export declare const userSecurityRouter: Elysia<"/user", {
35
35
  headers: import("elysia").HTTPHeaders;
36
36
  status?: number | keyof import("elysia").StatusMap;
37
37
  redirect?: string;
38
- cookie?: Record<string, {
39
- domain?: string | undefined;
40
- expires?: Date | undefined;
41
- httpOnly?: boolean | undefined;
42
- maxAge?: number | undefined;
43
- path?: string | undefined;
44
- priority?: 'low' | 'medium' | 'high' | undefined;
45
- partitioned?: boolean | undefined;
46
- sameSite?: true | false | 'lax' | 'strict' | 'none' | undefined;
47
- secure?: boolean | undefined;
48
- secrets?: string | null | (string | null)[];
49
- value?: unknown;
50
- }>;
38
+ cookie?: Record<string, import("elysia/cookies").ElysiaCookie>;
51
39
  };
52
40
  path: string;
53
41
  route: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aitlabs/namkwong",
3
- "version": "0.0.112",
3
+ "version": "0.0.113",
4
4
  "description": "Elysia API type definitions for Eden Treaty",
5
5
  "files": [
6
6
  "dist"