@numen-crypto/contract 0.15.3 → 0.16.0

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/dist/index.js CHANGED
@@ -73,7 +73,11 @@ var ERROR_CODE = {
73
73
  WHEEL_NO_PRIZES: "WHEEL_NO_PRIZES",
74
74
  LINK_PROVIDER_DISABLED: "LINK_PROVIDER_DISABLED",
75
75
  LINK_VERIFICATION_FAILED: "LINK_VERIFICATION_FAILED",
76
- LINK_ALREADY_USED: "LINK_ALREADY_USED"
76
+ LINK_ALREADY_USED: "LINK_ALREADY_USED",
77
+ TICKET_ALREADY_ASSIGNED: "TICKET_ALREADY_ASSIGNED",
78
+ TICKET_NOT_ASSIGNEE: "TICKET_NOT_ASSIGNEE",
79
+ TICKET_CLOSED: "TICKET_CLOSED",
80
+ SUPPORT_ROLE_REQUIRED: "SUPPORT_ROLE_REQUIRED"
77
81
  };
78
82
  var MONEY_REGEX = /^-?\d+(\.\d{1,18})?$/;
79
83
  var MoneyStringSchema = z.string().regex(MONEY_REGEX, "invalid money string (max 18 fractional digits)");
@@ -103,9 +107,11 @@ function PaginatedSchema(item) {
103
107
  });
104
108
  }
105
109
  var UserStatusSchema = z.enum(["pending", "active", "suspended", "deleted"]);
110
+ var UserRoleSchema = z.enum(["user", "support"]);
106
111
  var UserProfileSchema = z.object({
107
112
  id: z.string().uuid(),
108
113
  email: z.string().email(),
114
+ role: UserRoleSchema,
109
115
  displayName: z.string().nullable(),
110
116
  avatarUrl: z.string().url().nullable(),
111
117
  referrerId: z.string().uuid().nullable(),
@@ -1097,8 +1103,8 @@ var UnlinkAccountCommand;
1097
1103
  })(UnlinkAccountCommand || (UnlinkAccountCommand = {}));
1098
1104
  var TICKET_CATEGORIES = ["account", "deposit", "withdrawal", "trading", "partners", "other"];
1099
1105
  var TicketCategorySchema = z.enum(TICKET_CATEGORIES);
1100
- var TicketStatusSchema = z.enum(["open", "pending", "answered", "resolved"]);
1101
- var TicketAuthorTypeSchema = z.enum(["user", "support"]);
1106
+ var TicketStatusSchema = z.enum(["open", "pending", "answered", "resolved", "closed"]);
1107
+ var TicketAuthorTypeSchema = z.enum(["user", "support", "system"]);
1102
1108
  var TicketBodySchema = z.string().min(1).max(2e4);
1103
1109
  var TicketAttachmentSchema = z.object({
1104
1110
  id: z.string().uuid(),
@@ -1131,7 +1137,68 @@ var TicketAttachmentInputSchema = z.object({
1131
1137
  contentType: z.string().min(1).max(128),
1132
1138
  sizeBytes: z.number().int().positive().max(50 * 1024 * 1024)
1133
1139
  });
1140
+ var SupportTicketScopeSchema = z.enum(["pool", "mine", "closed"]);
1141
+ var SupportTicketSummarySchema = TicketSummarySchema.extend({
1142
+ userEmail: z.string().email(),
1143
+ assignedTo: z.string().uuid().nullable(),
1144
+ assignedEmail: z.string().nullable()
1145
+ });
1146
+ var SupportTicketUserSchema = z.object({
1147
+ id: z.string().uuid(),
1148
+ email: z.string().email(),
1149
+ displayName: z.string().nullable(),
1150
+ memberSince: z.string(),
1151
+ rankName: z.string().nullable(),
1152
+ packageTier: z.number().int().nullable(),
1153
+ ticketsTotal: z.number().int().nonnegative()
1154
+ });
1155
+ var SupportTicketDetailSchema = TicketDetailSchema.extend({
1156
+ userEmail: z.string().email(),
1157
+ assignedTo: z.string().uuid().nullable(),
1158
+ assignedEmail: z.string().nullable(),
1159
+ user: SupportTicketUserSchema
1160
+ });
1134
1161
  var AttachmentsSchema = z.array(TicketAttachmentInputSchema).max(10).optional();
1162
+ var ListSupportTicketsCommand;
1163
+ ((ListSupportTicketsCommand2) => {
1164
+ ListSupportTicketsCommand2.endpointDetails = endpoint("GET", "/support/tickets", "List tickets visible to a support agent");
1165
+ ListSupportTicketsCommand2.QuerySchema = z.object({
1166
+ scope: SupportTicketScopeSchema.default("pool"),
1167
+ page: z.coerce.number().int().min(1).default(1),
1168
+ pageSize: z.coerce.number().int().min(1).max(100).default(20)
1169
+ });
1170
+ ListSupportTicketsCommand2.ResponseSchema = z.object({
1171
+ items: z.array(SupportTicketSummarySchema),
1172
+ total: z.number().int().nonnegative(),
1173
+ poolCount: z.number().int().nonnegative(),
1174
+ mineCount: z.number().int().nonnegative()
1175
+ });
1176
+ })(ListSupportTicketsCommand || (ListSupportTicketsCommand = {}));
1177
+ var GetSupportTicketCommand;
1178
+ ((GetSupportTicketCommand2) => {
1179
+ GetSupportTicketCommand2.endpointDetails = endpoint("GET", "/support/tickets/:id", "Get a ticket with thread and user info");
1180
+ GetSupportTicketCommand2.ResponseSchema = SupportTicketDetailSchema;
1181
+ })(GetSupportTicketCommand || (GetSupportTicketCommand = {}));
1182
+ var ClaimTicketCommand;
1183
+ ((ClaimTicketCommand2) => {
1184
+ ClaimTicketCommand2.endpointDetails = endpoint("POST", "/support/tickets/:id/claim", "Assign the ticket to this agent");
1185
+ ClaimTicketCommand2.ResponseSchema = SupportTicketDetailSchema;
1186
+ })(ClaimTicketCommand || (ClaimTicketCommand = {}));
1187
+ var SupportReplyTicketCommand;
1188
+ ((SupportReplyTicketCommand2) => {
1189
+ SupportReplyTicketCommand2.endpointDetails = endpoint("POST", "/support/tickets/:id/messages", "Reply to a ticket as support");
1190
+ SupportReplyTicketCommand2.RequestSchema = z.object({
1191
+ body: TicketBodySchema,
1192
+ attachments: AttachmentsSchema
1193
+ });
1194
+ SupportReplyTicketCommand2.ResponseSchema = SupportTicketDetailSchema;
1195
+ })(SupportReplyTicketCommand || (SupportReplyTicketCommand = {}));
1196
+ var ResolveTicketCommand;
1197
+ ((ResolveTicketCommand2) => {
1198
+ ResolveTicketCommand2.endpointDetails = endpoint("POST", "/support/tickets/:id/resolve", "Close the ticket as resolved");
1199
+ ResolveTicketCommand2.ResponseSchema = SupportTicketDetailSchema;
1200
+ })(ResolveTicketCommand || (ResolveTicketCommand = {}));
1201
+ var AttachmentsSchema2 = z.array(TicketAttachmentInputSchema).max(10).optional();
1135
1202
  var ListTicketsCommand;
1136
1203
  ((ListTicketsCommand2) => {
1137
1204
  ListTicketsCommand2.endpointDetails = endpoint("GET", "/tickets", "List the current user tickets");
@@ -1149,7 +1216,7 @@ var CreateTicketCommand;
1149
1216
  category: TicketCategorySchema,
1150
1217
  title: z.string().min(3).max(160),
1151
1218
  body: TicketBodySchema,
1152
- attachments: AttachmentsSchema
1219
+ attachments: AttachmentsSchema2
1153
1220
  });
1154
1221
  CreateTicketCommand2.ResponseSchema = TicketDetailSchema;
1155
1222
  })(CreateTicketCommand || (CreateTicketCommand = {}));
@@ -1158,7 +1225,7 @@ var ReplyTicketCommand;
1158
1225
  ReplyTicketCommand2.endpointDetails = endpoint("POST", "/tickets/:id/messages", "Reply to a ticket");
1159
1226
  ReplyTicketCommand2.RequestSchema = z.object({
1160
1227
  body: TicketBodySchema,
1161
- attachments: AttachmentsSchema
1228
+ attachments: AttachmentsSchema2
1162
1229
  });
1163
1230
  ReplyTicketCommand2.ResponseSchema = TicketDetailSchema;
1164
1231
  })(ReplyTicketCommand || (ReplyTicketCommand = {}));
@@ -1279,11 +1346,19 @@ var REST_API = {
1279
1346
  GET: "/tickets/:id",
1280
1347
  REPLY: "/tickets/:id/messages",
1281
1348
  ATTACHMENT_UPLOAD_URL: "/tickets/attachments/upload-url"
1349
+ },
1350
+ SUPPORT_TICKETS: {
1351
+ LIST: "/support/tickets",
1352
+ STREAM: "/support/tickets/stream",
1353
+ GET: "/support/tickets/:id",
1354
+ CLAIM: "/support/tickets/:id/claim",
1355
+ REPLY: "/support/tickets/:id/messages",
1356
+ RESOLVE: "/support/tickets/:id/resolve"
1282
1357
  }
1283
1358
  };
1284
1359
  var API_PREFIX = "/api";
1285
1360
  var API_VERSION = "v1";
1286
1361
 
1287
- export { API_PREFIX, API_VERSION, ASSET_DECIMALS, ASSET_SYMBOLS, AVATAR_CONTENT_TYPES, AssetBalanceSchema, AssetSymbolSchema, AvatarContentTypeSchema, AvatarUploadUrlCommand, BrowsePartnersCommand, BuyPackageCommand, CONTENT_LOCALES, CancelOrderCommand, CancelWithdrawalCommand, CaptchaPolicyCommand, ChangePasswordCommand, ChartPeriodSchema, ChartPointSchema, ClaimDailyBonusCommand, ClaimTutorialRewardCommand, ConfirmEmailChangeCommand, ConfirmTotpCommand, ConfirmWithdrawalCommand, ContentLocaleSchema, CreateTicketCommand, DEFAULT_CONTENT_LOCALE, DEPOSITABLE_ASSETS, DailyBonusClaimResultSchema, DailyBonusDaySchema, DailyBonusStatusSchema, DepositAddressCommand, DepositAddressSchema, DepositEntrySchema, DepositStatusSchema, DepositableAssetSchema, DisableTotpCommand, ERROR_CODE, EarningsOverviewSchema, ErrorResponseSchema, FUNDING_ASSET, ForgotPasswordCommand, GetDailyBonusCommand, GetEarningsCommand, GetIncomeCommand, GetLeaderboardCommand, GetOrderBookCommand, GetPackagesCommand, GetPartnersCommand, GetRanksCommand, GetSettingsCommand, GetSlidesCommand, GetTicketCommand, GetTokenChartCommand, GetTokenPriceCommand, GetTransactionsCommand, GetTutorialRewardCommand, GetWalletCommand, GetWheelCommand, IncomeOverviewSchema, IncomePeriodSchema, LeaderboardEntrySchema, LeaderboardPeriodSchema, LeaderboardSchema, LinkGoogleCommand, LinkProviderSchema, LinkTelegramCommand, LinkedAccountSchema, ListDepositsCommand, ListLinkedAccountsCommand, ListMyOrdersCommand, ListNotificationsCommand, ListTicketsCommand, ListTradesCommand, ListWithdrawalsCommand, LoginCommand, LogoutCommand, MONEY_REGEX, MarkNotificationsReadCommand, MeCommand, MoneyStringSchema, MonthlyPricePointSchema, NMN_PRICE_DECIMALS, NotificationSchema, NotificationTypeSchema, OrderBookLevelSchema, OrderBookSchema, OrderSchema, OrderSideSchema, OrderStatusSchema, OrderTypeSchema, PackageSchema, PackageStatusSchema, PackagesOverviewSchema, PaginatedSchema, PaginationQuerySchema, PartnerAccrualSchema, PartnerBranchRootSchema, PartnerBranchSchema, PartnerLevelSchema, PartnerNodeSchema, PartnersOverviewSchema, PeriodSchema, PlaceOrderCommand, PositiveMoneyStringSchema, PublicTradeSchema, REST_API, RankDefSchema, RegisterCommand, ReplyTicketCommand, RequestEmailChangeCommand, RequestPasswordChangeCommand, RequestWithdrawalCommand, ResendVerificationCommand, ResetPasswordCommand, SessionInfoSchema, SetupTotpCommand, SlideButtonStyleSchema, SlideKindSchema, SlideLinkTargetSchema, SlideSchema, SlidesResponseSchema, SpinWheelCommand, SwapCommand, SwapSideSchema, TICKET_CATEGORIES, TOKEN_ASSET, ThreatLevelSchema, TicketAttachmentInputSchema, TicketAttachmentSchema, TicketAttachmentUploadCommand, TicketAuthorTypeSchema, TicketBodySchema, TicketCategorySchema, TicketDetailSchema, TicketMessageSchema, TicketStatusSchema, TicketSummarySchema, TokenPriceSchema, TradeLimitsSchema, TradeResultSchema, TransactionSchema, TransactionStatusSchema, TransactionTypeSchema, UnlinkAccountCommand, UpdateProfileCommand, UpdateSettingsCommand, UpgradePackageCommand, UserProfileSchema, UserRankSchema, UserSettingsSchema, UserStatusSchema, UuidSchema, VerifyEmailCommand, WHEEL_SLOT_COUNT, WalletOverviewSchema, WheelAmountModeSchema, WheelPrizeSchema, WheelSlotSchema, WheelSpinKindSchema, WheelSpinResultSchema, WheelStatusSchema, WheelWinSchema, WithdrawalSchema, WithdrawalStatusSchema, assetDecimals, endpoint, isContentLocale };
1362
+ export { API_PREFIX, API_VERSION, ASSET_DECIMALS, ASSET_SYMBOLS, AVATAR_CONTENT_TYPES, AssetBalanceSchema, AssetSymbolSchema, AvatarContentTypeSchema, AvatarUploadUrlCommand, BrowsePartnersCommand, BuyPackageCommand, CONTENT_LOCALES, CancelOrderCommand, CancelWithdrawalCommand, CaptchaPolicyCommand, ChangePasswordCommand, ChartPeriodSchema, ChartPointSchema, ClaimDailyBonusCommand, ClaimTicketCommand, ClaimTutorialRewardCommand, ConfirmEmailChangeCommand, ConfirmTotpCommand, ConfirmWithdrawalCommand, ContentLocaleSchema, CreateTicketCommand, DEFAULT_CONTENT_LOCALE, DEPOSITABLE_ASSETS, DailyBonusClaimResultSchema, DailyBonusDaySchema, DailyBonusStatusSchema, DepositAddressCommand, DepositAddressSchema, DepositEntrySchema, DepositStatusSchema, DepositableAssetSchema, DisableTotpCommand, ERROR_CODE, EarningsOverviewSchema, ErrorResponseSchema, FUNDING_ASSET, ForgotPasswordCommand, GetDailyBonusCommand, GetEarningsCommand, GetIncomeCommand, GetLeaderboardCommand, GetOrderBookCommand, GetPackagesCommand, GetPartnersCommand, GetRanksCommand, GetSettingsCommand, GetSlidesCommand, GetSupportTicketCommand, GetTicketCommand, GetTokenChartCommand, GetTokenPriceCommand, GetTransactionsCommand, GetTutorialRewardCommand, GetWalletCommand, GetWheelCommand, IncomeOverviewSchema, IncomePeriodSchema, LeaderboardEntrySchema, LeaderboardPeriodSchema, LeaderboardSchema, LinkGoogleCommand, LinkProviderSchema, LinkTelegramCommand, LinkedAccountSchema, ListDepositsCommand, ListLinkedAccountsCommand, ListMyOrdersCommand, ListNotificationsCommand, ListSupportTicketsCommand, ListTicketsCommand, ListTradesCommand, ListWithdrawalsCommand, LoginCommand, LogoutCommand, MONEY_REGEX, MarkNotificationsReadCommand, MeCommand, MoneyStringSchema, MonthlyPricePointSchema, NMN_PRICE_DECIMALS, NotificationSchema, NotificationTypeSchema, OrderBookLevelSchema, OrderBookSchema, OrderSchema, OrderSideSchema, OrderStatusSchema, OrderTypeSchema, PackageSchema, PackageStatusSchema, PackagesOverviewSchema, PaginatedSchema, PaginationQuerySchema, PartnerAccrualSchema, PartnerBranchRootSchema, PartnerBranchSchema, PartnerLevelSchema, PartnerNodeSchema, PartnersOverviewSchema, PeriodSchema, PlaceOrderCommand, PositiveMoneyStringSchema, PublicTradeSchema, REST_API, RankDefSchema, RegisterCommand, ReplyTicketCommand, RequestEmailChangeCommand, RequestPasswordChangeCommand, RequestWithdrawalCommand, ResendVerificationCommand, ResetPasswordCommand, ResolveTicketCommand, SessionInfoSchema, SetupTotpCommand, SlideButtonStyleSchema, SlideKindSchema, SlideLinkTargetSchema, SlideSchema, SlidesResponseSchema, SpinWheelCommand, SupportReplyTicketCommand, SupportTicketDetailSchema, SupportTicketScopeSchema, SupportTicketSummarySchema, SupportTicketUserSchema, SwapCommand, SwapSideSchema, TICKET_CATEGORIES, TOKEN_ASSET, ThreatLevelSchema, TicketAttachmentInputSchema, TicketAttachmentSchema, TicketAttachmentUploadCommand, TicketAuthorTypeSchema, TicketBodySchema, TicketCategorySchema, TicketDetailSchema, TicketMessageSchema, TicketStatusSchema, TicketSummarySchema, TokenPriceSchema, TradeLimitsSchema, TradeResultSchema, TransactionSchema, TransactionStatusSchema, TransactionTypeSchema, UnlinkAccountCommand, UpdateProfileCommand, UpdateSettingsCommand, UpgradePackageCommand, UserProfileSchema, UserRankSchema, UserRoleSchema, UserSettingsSchema, UserStatusSchema, UuidSchema, VerifyEmailCommand, WHEEL_SLOT_COUNT, WalletOverviewSchema, WheelAmountModeSchema, WheelPrizeSchema, WheelSlotSchema, WheelSpinKindSchema, WheelSpinResultSchema, WheelStatusSchema, WheelWinSchema, WithdrawalSchema, WithdrawalStatusSchema, assetDecimals, endpoint, isContentLocale };
1288
1363
  //# sourceMappingURL=index.js.map
1289
1364
  //# sourceMappingURL=index.js.map