@numen-crypto/contract 0.15.3 → 0.17.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.cjs CHANGED
@@ -75,7 +75,11 @@ var ERROR_CODE = {
75
75
  WHEEL_NO_PRIZES: "WHEEL_NO_PRIZES",
76
76
  LINK_PROVIDER_DISABLED: "LINK_PROVIDER_DISABLED",
77
77
  LINK_VERIFICATION_FAILED: "LINK_VERIFICATION_FAILED",
78
- LINK_ALREADY_USED: "LINK_ALREADY_USED"
78
+ LINK_ALREADY_USED: "LINK_ALREADY_USED",
79
+ TICKET_ALREADY_ASSIGNED: "TICKET_ALREADY_ASSIGNED",
80
+ TICKET_NOT_ASSIGNEE: "TICKET_NOT_ASSIGNEE",
81
+ TICKET_CLOSED: "TICKET_CLOSED",
82
+ SUPPORT_ROLE_REQUIRED: "SUPPORT_ROLE_REQUIRED"
79
83
  };
80
84
  var MONEY_REGEX = /^-?\d+(\.\d{1,18})?$/;
81
85
  var MoneyStringSchema = zod.z.string().regex(MONEY_REGEX, "invalid money string (max 18 fractional digits)");
@@ -105,9 +109,11 @@ function PaginatedSchema(item) {
105
109
  });
106
110
  }
107
111
  var UserStatusSchema = zod.z.enum(["pending", "active", "suspended", "deleted"]);
112
+ var UserRoleSchema = zod.z.enum(["user", "support"]);
108
113
  var UserProfileSchema = zod.z.object({
109
114
  id: zod.z.string().uuid(),
110
115
  email: zod.z.string().email(),
116
+ role: UserRoleSchema,
111
117
  displayName: zod.z.string().nullable(),
112
118
  avatarUrl: zod.z.string().url().nullable(),
113
119
  referrerId: zod.z.string().uuid().nullable(),
@@ -1097,10 +1103,23 @@ exports.UnlinkAccountCommand = void 0;
1097
1103
  UnlinkAccountCommand2.ParamsSchema = zod.z.object({ provider: LinkProviderSchema });
1098
1104
  UnlinkAccountCommand2.ResponseSchema = zod.z.void();
1099
1105
  })(exports.UnlinkAccountCommand || (exports.UnlinkAccountCommand = {}));
1106
+ exports.TelegramLinkCodeCommand = void 0;
1107
+ ((TelegramLinkCodeCommand2) => {
1108
+ TelegramLinkCodeCommand2.endpointDetails = endpoint(
1109
+ "POST",
1110
+ "/settings/link/telegram/code",
1111
+ "Issue a one-time deep-link code for linking via the Telegram bot"
1112
+ );
1113
+ TelegramLinkCodeCommand2.ResponseSchema = zod.z.object({
1114
+ code: zod.z.string(),
1115
+ url: zod.z.string().url(),
1116
+ expiresInSec: zod.z.number().int().positive()
1117
+ });
1118
+ })(exports.TelegramLinkCodeCommand || (exports.TelegramLinkCodeCommand = {}));
1100
1119
  var TICKET_CATEGORIES = ["account", "deposit", "withdrawal", "trading", "partners", "other"];
1101
1120
  var TicketCategorySchema = zod.z.enum(TICKET_CATEGORIES);
1102
- var TicketStatusSchema = zod.z.enum(["open", "pending", "answered", "resolved"]);
1103
- var TicketAuthorTypeSchema = zod.z.enum(["user", "support"]);
1121
+ var TicketStatusSchema = zod.z.enum(["open", "pending", "answered", "resolved", "closed"]);
1122
+ var TicketAuthorTypeSchema = zod.z.enum(["user", "support", "system"]);
1104
1123
  var TicketBodySchema = zod.z.string().min(1).max(2e4);
1105
1124
  var TicketAttachmentSchema = zod.z.object({
1106
1125
  id: zod.z.string().uuid(),
@@ -1133,7 +1152,68 @@ var TicketAttachmentInputSchema = zod.z.object({
1133
1152
  contentType: zod.z.string().min(1).max(128),
1134
1153
  sizeBytes: zod.z.number().int().positive().max(50 * 1024 * 1024)
1135
1154
  });
1155
+ var SupportTicketScopeSchema = zod.z.enum(["pool", "mine", "closed"]);
1156
+ var SupportTicketSummarySchema = TicketSummarySchema.extend({
1157
+ userEmail: zod.z.string().email(),
1158
+ assignedTo: zod.z.string().uuid().nullable(),
1159
+ assignedEmail: zod.z.string().nullable()
1160
+ });
1161
+ var SupportTicketUserSchema = zod.z.object({
1162
+ id: zod.z.string().uuid(),
1163
+ email: zod.z.string().email(),
1164
+ displayName: zod.z.string().nullable(),
1165
+ memberSince: zod.z.string(),
1166
+ rankName: zod.z.string().nullable(),
1167
+ packageTier: zod.z.number().int().nullable(),
1168
+ ticketsTotal: zod.z.number().int().nonnegative()
1169
+ });
1170
+ var SupportTicketDetailSchema = TicketDetailSchema.extend({
1171
+ userEmail: zod.z.string().email(),
1172
+ assignedTo: zod.z.string().uuid().nullable(),
1173
+ assignedEmail: zod.z.string().nullable(),
1174
+ user: SupportTicketUserSchema
1175
+ });
1136
1176
  var AttachmentsSchema = zod.z.array(TicketAttachmentInputSchema).max(10).optional();
1177
+ exports.ListSupportTicketsCommand = void 0;
1178
+ ((ListSupportTicketsCommand2) => {
1179
+ ListSupportTicketsCommand2.endpointDetails = endpoint("GET", "/support/tickets", "List tickets visible to a support agent");
1180
+ ListSupportTicketsCommand2.QuerySchema = zod.z.object({
1181
+ scope: SupportTicketScopeSchema.default("pool"),
1182
+ page: zod.z.coerce.number().int().min(1).default(1),
1183
+ pageSize: zod.z.coerce.number().int().min(1).max(100).default(20)
1184
+ });
1185
+ ListSupportTicketsCommand2.ResponseSchema = zod.z.object({
1186
+ items: zod.z.array(SupportTicketSummarySchema),
1187
+ total: zod.z.number().int().nonnegative(),
1188
+ poolCount: zod.z.number().int().nonnegative(),
1189
+ mineCount: zod.z.number().int().nonnegative()
1190
+ });
1191
+ })(exports.ListSupportTicketsCommand || (exports.ListSupportTicketsCommand = {}));
1192
+ exports.GetSupportTicketCommand = void 0;
1193
+ ((GetSupportTicketCommand2) => {
1194
+ GetSupportTicketCommand2.endpointDetails = endpoint("GET", "/support/tickets/:id", "Get a ticket with thread and user info");
1195
+ GetSupportTicketCommand2.ResponseSchema = SupportTicketDetailSchema;
1196
+ })(exports.GetSupportTicketCommand || (exports.GetSupportTicketCommand = {}));
1197
+ exports.ClaimTicketCommand = void 0;
1198
+ ((ClaimTicketCommand2) => {
1199
+ ClaimTicketCommand2.endpointDetails = endpoint("POST", "/support/tickets/:id/claim", "Assign the ticket to this agent");
1200
+ ClaimTicketCommand2.ResponseSchema = SupportTicketDetailSchema;
1201
+ })(exports.ClaimTicketCommand || (exports.ClaimTicketCommand = {}));
1202
+ exports.SupportReplyTicketCommand = void 0;
1203
+ ((SupportReplyTicketCommand2) => {
1204
+ SupportReplyTicketCommand2.endpointDetails = endpoint("POST", "/support/tickets/:id/messages", "Reply to a ticket as support");
1205
+ SupportReplyTicketCommand2.RequestSchema = zod.z.object({
1206
+ body: TicketBodySchema,
1207
+ attachments: AttachmentsSchema
1208
+ });
1209
+ SupportReplyTicketCommand2.ResponseSchema = SupportTicketDetailSchema;
1210
+ })(exports.SupportReplyTicketCommand || (exports.SupportReplyTicketCommand = {}));
1211
+ exports.ResolveTicketCommand = void 0;
1212
+ ((ResolveTicketCommand2) => {
1213
+ ResolveTicketCommand2.endpointDetails = endpoint("POST", "/support/tickets/:id/resolve", "Close the ticket as resolved");
1214
+ ResolveTicketCommand2.ResponseSchema = SupportTicketDetailSchema;
1215
+ })(exports.ResolveTicketCommand || (exports.ResolveTicketCommand = {}));
1216
+ var AttachmentsSchema2 = zod.z.array(TicketAttachmentInputSchema).max(10).optional();
1137
1217
  exports.ListTicketsCommand = void 0;
1138
1218
  ((ListTicketsCommand2) => {
1139
1219
  ListTicketsCommand2.endpointDetails = endpoint("GET", "/tickets", "List the current user tickets");
@@ -1151,7 +1231,7 @@ exports.CreateTicketCommand = void 0;
1151
1231
  category: TicketCategorySchema,
1152
1232
  title: zod.z.string().min(3).max(160),
1153
1233
  body: TicketBodySchema,
1154
- attachments: AttachmentsSchema
1234
+ attachments: AttachmentsSchema2
1155
1235
  });
1156
1236
  CreateTicketCommand2.ResponseSchema = TicketDetailSchema;
1157
1237
  })(exports.CreateTicketCommand || (exports.CreateTicketCommand = {}));
@@ -1160,7 +1240,7 @@ exports.ReplyTicketCommand = void 0;
1160
1240
  ReplyTicketCommand2.endpointDetails = endpoint("POST", "/tickets/:id/messages", "Reply to a ticket");
1161
1241
  ReplyTicketCommand2.RequestSchema = zod.z.object({
1162
1242
  body: TicketBodySchema,
1163
- attachments: AttachmentsSchema
1243
+ attachments: AttachmentsSchema2
1164
1244
  });
1165
1245
  ReplyTicketCommand2.ResponseSchema = TicketDetailSchema;
1166
1246
  })(exports.ReplyTicketCommand || (exports.ReplyTicketCommand = {}));
@@ -1254,6 +1334,7 @@ var REST_API = {
1254
1334
  PREFERENCES: "/settings",
1255
1335
  LINKS: "/settings/links",
1256
1336
  LINK_TELEGRAM: "/settings/link/telegram",
1337
+ LINK_TELEGRAM_CODE: "/settings/link/telegram/code",
1257
1338
  LINK_GOOGLE: "/settings/link/google",
1258
1339
  UNLINK: "/settings/link/:provider"
1259
1340
  },
@@ -1281,6 +1362,14 @@ var REST_API = {
1281
1362
  GET: "/tickets/:id",
1282
1363
  REPLY: "/tickets/:id/messages",
1283
1364
  ATTACHMENT_UPLOAD_URL: "/tickets/attachments/upload-url"
1365
+ },
1366
+ SUPPORT_TICKETS: {
1367
+ LIST: "/support/tickets",
1368
+ STREAM: "/support/tickets/stream",
1369
+ GET: "/support/tickets/:id",
1370
+ CLAIM: "/support/tickets/:id/claim",
1371
+ REPLY: "/support/tickets/:id/messages",
1372
+ RESOLVE: "/support/tickets/:id/resolve"
1284
1373
  }
1285
1374
  };
1286
1375
  var API_PREFIX = "/api";
@@ -1352,6 +1441,10 @@ exports.SlideKindSchema = SlideKindSchema;
1352
1441
  exports.SlideLinkTargetSchema = SlideLinkTargetSchema;
1353
1442
  exports.SlideSchema = SlideSchema;
1354
1443
  exports.SlidesResponseSchema = SlidesResponseSchema;
1444
+ exports.SupportTicketDetailSchema = SupportTicketDetailSchema;
1445
+ exports.SupportTicketScopeSchema = SupportTicketScopeSchema;
1446
+ exports.SupportTicketSummarySchema = SupportTicketSummarySchema;
1447
+ exports.SupportTicketUserSchema = SupportTicketUserSchema;
1355
1448
  exports.SwapSideSchema = SwapSideSchema;
1356
1449
  exports.TICKET_CATEGORIES = TICKET_CATEGORIES;
1357
1450
  exports.TOKEN_ASSET = TOKEN_ASSET;
@@ -1373,6 +1466,7 @@ exports.TransactionStatusSchema = TransactionStatusSchema;
1373
1466
  exports.TransactionTypeSchema = TransactionTypeSchema;
1374
1467
  exports.UserProfileSchema = UserProfileSchema;
1375
1468
  exports.UserRankSchema = UserRankSchema;
1469
+ exports.UserRoleSchema = UserRoleSchema;
1376
1470
  exports.UserSettingsSchema = UserSettingsSchema;
1377
1471
  exports.UserStatusSchema = UserStatusSchema;
1378
1472
  exports.UuidSchema = UuidSchema;