@aitlabs/namkwong 0.0.92 → 0.0.103

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.
Files changed (88) hide show
  1. package/dist/admin/index.d.ts +2807 -797
  2. package/dist/app-version/admin/router.d.ts +13 -1
  3. package/dist/asset-convert-product/admin/dto.schemas.d.ts +8 -0
  4. package/dist/asset-convert-product/admin/router.d.ts +12 -12
  5. package/dist/asset-convert-product/admin/service.d.ts +12 -12
  6. package/dist/auth/better-auth.d.ts +19 -1
  7. package/dist/auth/i18n/zh.d.ts +100 -0
  8. package/dist/auth/permissions.d.ts +16 -1
  9. package/dist/auth/roles.d.ts +45 -0
  10. package/dist/check-in/admin/reward.dto.schemas.d.ts +321 -0
  11. package/dist/check-in/admin/reward.router.d.ts +1109 -0
  12. package/dist/check-in/admin/reward.service.d.ts +433 -0
  13. package/dist/check-in/admin/router.d.ts +662 -0
  14. package/dist/check-in/errors/index.d.ts +10 -0
  15. package/dist/check-in/errors/locales/zh.d.ts +10 -0
  16. package/dist/check-in/index.d.ts +5 -0
  17. package/dist/check-in/internal/reward-config.service.d.ts +97 -0
  18. package/dist/check-in/permissions.d.ts +2 -0
  19. package/dist/check-in/reward.db.schemas.d.ts +896 -0
  20. package/dist/check-in/reward.schema.d.ts +477 -0
  21. package/dist/content-video/admin/dto.schemas.d.ts +128 -0
  22. package/dist/content-video/admin/router.d.ts +861 -0
  23. package/dist/content-video/admin/service.d.ts +211 -0
  24. package/dist/content-video/db.schemas.d.ts +486 -0
  25. package/dist/content-video/errors/index.d.ts +17 -0
  26. package/dist/content-video/errors/locales/zh.d.ts +16 -0
  27. package/dist/content-video/index.d.ts +8 -0
  28. package/dist/content-video/internal/service.d.ts +106 -0
  29. package/dist/content-video/permissions.d.ts +4 -0
  30. package/dist/content-video/schema.d.ts +257 -0
  31. package/dist/content-video/user/dto.schemas.d.ts +52 -0
  32. package/dist/content-video/user/router.d.ts +482 -0
  33. package/dist/content-video/user/service.d.ts +36 -0
  34. package/dist/db/schemas.d.ts +4 -0
  35. package/dist/file-storage/admin/dto.schemas.d.ts +4 -0
  36. package/dist/file-storage/admin/router.d.ts +2 -2
  37. package/dist/file-storage/admin/service.d.ts +2 -2
  38. package/dist/file-storage/db.schemas.d.ts +4 -4
  39. package/dist/file-storage/internal/service.d.ts +1 -1
  40. package/dist/file-storage/s3.client.d.ts +22 -0
  41. package/dist/file-storage/schema.d.ts +3 -3
  42. package/dist/file-storage/share/dto.schemas.d.ts +1 -0
  43. package/dist/file-storage/share/router.d.ts +1 -1
  44. package/dist/file-storage/user/dto.schemas.d.ts +6 -4
  45. package/dist/file-storage/user/router.d.ts +3 -3
  46. package/dist/file-storage/user/service.d.ts +2 -2
  47. package/dist/index.d.ts +3131 -805
  48. package/dist/ledger/admin/dto.schemas.d.ts +8 -0
  49. package/dist/ledger/admin/router.d.ts +5 -17
  50. package/dist/ledger/db.schemas.d.ts +8 -8
  51. package/dist/ledger/schema.d.ts +6 -6
  52. package/dist/ledger/user/dto.schemas.d.ts +8 -8
  53. package/dist/ledger/user/router.d.ts +2 -2
  54. package/dist/ledger/user/service.d.ts +2 -2
  55. package/dist/lock-activity/admin/dto.schemas.d.ts +161 -0
  56. package/dist/lock-activity/admin/participation.dto.schemas.d.ts +200 -0
  57. package/dist/lock-activity/admin/participation.service.d.ts +144 -0
  58. package/dist/lock-activity/admin/reward.service.d.ts +48 -0
  59. package/dist/lock-activity/admin/router.d.ts +1399 -0
  60. package/dist/lock-activity/admin/service.d.ts +518 -0
  61. package/dist/lock-activity/constants.d.ts +2 -0
  62. package/dist/lock-activity/cron.d.ts +6 -0
  63. package/dist/lock-activity/db.schemas.d.ts +516 -0
  64. package/dist/lock-activity/errors/index.d.ts +32 -0
  65. package/dist/lock-activity/errors/locales/zh.d.ts +31 -0
  66. package/dist/lock-activity/index.d.ts +7 -0
  67. package/dist/lock-activity/internal/participation.service.d.ts +42 -0
  68. package/dist/lock-activity/internal/reward.service.d.ts +15 -0
  69. package/dist/lock-activity/internal/service.d.ts +66 -0
  70. package/dist/lock-activity/participation.db.schemas.d.ts +448 -0
  71. package/dist/lock-activity/participation.schema.d.ts +239 -0
  72. package/dist/lock-activity/permissions.d.ts +5 -0
  73. package/dist/lock-activity/schema.d.ts +273 -0
  74. package/dist/lock-activity/shared.dto.schemas.d.ts +7 -0
  75. package/dist/lock-activity/user/dto.schemas.d.ts +116 -0
  76. package/dist/lock-activity/user/participation.dto.schemas.d.ts +25 -0
  77. package/dist/lock-activity/user/participation.service.d.ts +24 -0
  78. package/dist/lock-activity/user/router.d.ts +624 -0
  79. package/dist/lock-activity/user/service.d.ts +86 -0
  80. package/dist/market-pricing/admin/router.d.ts +13 -1
  81. package/dist/news/admin/dto.schemas.d.ts +26 -26
  82. package/dist/news/admin/router.d.ts +25 -25
  83. package/dist/news/admin/service.d.ts +4 -1
  84. package/dist/news/user/service.d.ts +2 -2
  85. package/dist/referral/index.d.ts +1 -0
  86. package/dist/referral/user/router.d.ts +29 -1
  87. package/dist/wallet-type/admin/router.d.ts +1 -13
  88. package/package.json +1 -1
@@ -4,6 +4,16 @@ export declare const zh: {
4
4
  CHECK_IN_TIMEZONE_INVALID: string;
5
5
  CHECK_IN_TIMEZONE_CHANGE_TOO_FREQUENT: string;
6
6
  CHECK_IN_TIMEZONE_CHANGE_PENDING_EXISTS: string;
7
+ CHECK_IN_REWARD_PLAN_NOT_FOUND: string;
8
+ CHECK_IN_REWARD_PLAN_ALREADY_EXISTS: string;
9
+ CHECK_IN_REWARD_RULE_NOT_FOUND: string;
10
+ CHECK_IN_REWARD_RULE_ALREADY_EXISTS: string;
11
+ CHECK_IN_REWARD_AMOUNT_INVALID: string;
12
+ CHECK_IN_REWARD_THRESHOLD_DAYS_INVALID: string;
13
+ CHECK_IN_REWARD_ASSET_NOT_FOUND: string;
14
+ CHECK_IN_REWARD_ASSET_INACTIVE: string;
15
+ CHECK_IN_REWARD_ACCOUNT_TYPE_NOT_FOUND: string;
16
+ CHECK_IN_REWARD_ACCOUNT_TYPE_INACTIVE: string;
7
17
  };
8
18
  type ZHType = typeof zh;
9
19
  declare module '../../../error/messages' {
@@ -1,5 +1,10 @@
1
1
  export * from './admin/service';
2
+ export * from './admin/reward.service';
3
+ export * from './admin/reward.dto.schemas';
4
+ export { checkInRewardPlanAdminRouter } from './admin/reward.router';
2
5
  export * from './db.schemas';
6
+ export * from './reward.db.schemas';
7
+ export * from './reward.schema';
3
8
  export * from './internal/service';
4
9
  export * from './permissions';
5
10
  export * from './schema';
@@ -0,0 +1,97 @@
1
+ import type { TransactionTx } from '../../db/transaction';
2
+ import { CheckInErrorCodes } from '../errors';
3
+ import { checkInRewardRule } from '../reward.schema';
4
+ export declare abstract class InternalCheckInRewardConfigService {
5
+ static assertPositiveAmount(value: string, invalidCode: typeof CheckInErrorCodes.CHECK_IN_REWARD_AMOUNT_INVALID): string;
6
+ static assertPositiveThresholdDays(thresholdDays: number): void;
7
+ static ensureRewardAssetValid(tx: TransactionTx, rewardAssetId: string): Promise<{
8
+ category: "CRYPTO" | "FIAT" | "POINT" | "RWA";
9
+ code: string;
10
+ createdAt: Date;
11
+ iconUrl: string;
12
+ id: string;
13
+ isActive: boolean;
14
+ name: string;
15
+ precision: number;
16
+ symbol: string | null;
17
+ typeId: string | null;
18
+ updatedAt: Date;
19
+ }>;
20
+ static ensurePayoutAccountTypeValid(tx: TransactionTx, accountTypeId: string): Promise<{
21
+ allowDeposit: boolean;
22
+ allowInternalReceiveTransfer: boolean;
23
+ allowInternalTransfer: boolean;
24
+ allowTransaction: boolean;
25
+ allowTransfer: boolean;
26
+ allowWithdraw: boolean;
27
+ createdAt: Date;
28
+ description: string | null;
29
+ expiryDays: number | null;
30
+ hasExpiry: boolean;
31
+ id: string;
32
+ internalTransferRatio: string;
33
+ isActive: boolean;
34
+ key: string;
35
+ maxInternalTransferAmount: string;
36
+ maxTransferAmount: string;
37
+ maxWithdrawAmount: string;
38
+ minInternalTransferAmount: string;
39
+ minTransferAmount: string;
40
+ minWithdrawAmount: string;
41
+ name: string;
42
+ sortOrder: number;
43
+ updatedAt: Date;
44
+ }>;
45
+ static ensurePlanExists(tx: TransactionTx, planId: string): Promise<{
46
+ checkInType: "app" | "meeting";
47
+ createdAt: Date;
48
+ createdBy: string;
49
+ dailyPayoutAccountTypeId: string;
50
+ dailyRewardAmount: string;
51
+ dailyRewardCategory: string;
52
+ id: string;
53
+ isEnabled: boolean;
54
+ name: string;
55
+ rewardAssetId: string;
56
+ sortOrder: number;
57
+ updatedAt: Date;
58
+ updatedBy: string | null;
59
+ }>;
60
+ static findSingletonPlan(tx: TransactionTx): Promise<{
61
+ checkInType: "app" | "meeting";
62
+ createdAt: Date;
63
+ createdBy: string;
64
+ dailyPayoutAccountTypeId: string;
65
+ dailyRewardAmount: string;
66
+ dailyRewardCategory: string;
67
+ id: string;
68
+ isEnabled: boolean;
69
+ name: string;
70
+ rewardAssetId: string;
71
+ sortOrder: number;
72
+ updatedAt: Date;
73
+ updatedBy: string | null;
74
+ } | undefined>;
75
+ static ensureSingletonPlan(tx: TransactionTx): Promise<{
76
+ checkInType: "app" | "meeting";
77
+ createdAt: Date;
78
+ createdBy: string;
79
+ dailyPayoutAccountTypeId: string;
80
+ dailyRewardAmount: string;
81
+ dailyRewardCategory: string;
82
+ id: string;
83
+ isEnabled: boolean;
84
+ name: string;
85
+ rewardAssetId: string;
86
+ sortOrder: number;
87
+ updatedAt: Date;
88
+ updatedBy: string | null;
89
+ }>;
90
+ static assertNoSingletonPlan(tx: TransactionTx): Promise<void>;
91
+ static assertRuleUnique(tx: TransactionTx, input: {
92
+ planId: string;
93
+ ruleType: typeof checkInRewardRule.$inferSelect.ruleType;
94
+ thresholdDays: number;
95
+ excludeRuleId?: string;
96
+ }): Promise<void>;
97
+ }
@@ -2,5 +2,7 @@
2
2
  export declare const checkInPermissions: {
3
3
  readonly 'checkIn:checkIn': readonly ['create', 'read', 'list'];
4
4
  readonly 'checkIn:admin': readonly ['read', 'list'];
5
+ readonly 'checkIn:rewardPlan': readonly ['create', 'read', 'update', 'delete'];
6
+ readonly 'checkIn:rewardRule': readonly ['create', 'read', 'update', 'delete', 'list'];
5
7
  };
6
8
  export type CheckInPermission = keyof typeof checkInPermissions;