@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.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(),
@@ -1099,8 +1105,8 @@ exports.UnlinkAccountCommand = void 0;
1099
1105
  })(exports.UnlinkAccountCommand || (exports.UnlinkAccountCommand = {}));
1100
1106
  var TICKET_CATEGORIES = ["account", "deposit", "withdrawal", "trading", "partners", "other"];
1101
1107
  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"]);
1108
+ var TicketStatusSchema = zod.z.enum(["open", "pending", "answered", "resolved", "closed"]);
1109
+ var TicketAuthorTypeSchema = zod.z.enum(["user", "support", "system"]);
1104
1110
  var TicketBodySchema = zod.z.string().min(1).max(2e4);
1105
1111
  var TicketAttachmentSchema = zod.z.object({
1106
1112
  id: zod.z.string().uuid(),
@@ -1133,7 +1139,68 @@ var TicketAttachmentInputSchema = zod.z.object({
1133
1139
  contentType: zod.z.string().min(1).max(128),
1134
1140
  sizeBytes: zod.z.number().int().positive().max(50 * 1024 * 1024)
1135
1141
  });
1142
+ var SupportTicketScopeSchema = zod.z.enum(["pool", "mine", "closed"]);
1143
+ var SupportTicketSummarySchema = TicketSummarySchema.extend({
1144
+ userEmail: zod.z.string().email(),
1145
+ assignedTo: zod.z.string().uuid().nullable(),
1146
+ assignedEmail: zod.z.string().nullable()
1147
+ });
1148
+ var SupportTicketUserSchema = zod.z.object({
1149
+ id: zod.z.string().uuid(),
1150
+ email: zod.z.string().email(),
1151
+ displayName: zod.z.string().nullable(),
1152
+ memberSince: zod.z.string(),
1153
+ rankName: zod.z.string().nullable(),
1154
+ packageTier: zod.z.number().int().nullable(),
1155
+ ticketsTotal: zod.z.number().int().nonnegative()
1156
+ });
1157
+ var SupportTicketDetailSchema = TicketDetailSchema.extend({
1158
+ userEmail: zod.z.string().email(),
1159
+ assignedTo: zod.z.string().uuid().nullable(),
1160
+ assignedEmail: zod.z.string().nullable(),
1161
+ user: SupportTicketUserSchema
1162
+ });
1136
1163
  var AttachmentsSchema = zod.z.array(TicketAttachmentInputSchema).max(10).optional();
1164
+ exports.ListSupportTicketsCommand = void 0;
1165
+ ((ListSupportTicketsCommand2) => {
1166
+ ListSupportTicketsCommand2.endpointDetails = endpoint("GET", "/support/tickets", "List tickets visible to a support agent");
1167
+ ListSupportTicketsCommand2.QuerySchema = zod.z.object({
1168
+ scope: SupportTicketScopeSchema.default("pool"),
1169
+ page: zod.z.coerce.number().int().min(1).default(1),
1170
+ pageSize: zod.z.coerce.number().int().min(1).max(100).default(20)
1171
+ });
1172
+ ListSupportTicketsCommand2.ResponseSchema = zod.z.object({
1173
+ items: zod.z.array(SupportTicketSummarySchema),
1174
+ total: zod.z.number().int().nonnegative(),
1175
+ poolCount: zod.z.number().int().nonnegative(),
1176
+ mineCount: zod.z.number().int().nonnegative()
1177
+ });
1178
+ })(exports.ListSupportTicketsCommand || (exports.ListSupportTicketsCommand = {}));
1179
+ exports.GetSupportTicketCommand = void 0;
1180
+ ((GetSupportTicketCommand2) => {
1181
+ GetSupportTicketCommand2.endpointDetails = endpoint("GET", "/support/tickets/:id", "Get a ticket with thread and user info");
1182
+ GetSupportTicketCommand2.ResponseSchema = SupportTicketDetailSchema;
1183
+ })(exports.GetSupportTicketCommand || (exports.GetSupportTicketCommand = {}));
1184
+ exports.ClaimTicketCommand = void 0;
1185
+ ((ClaimTicketCommand2) => {
1186
+ ClaimTicketCommand2.endpointDetails = endpoint("POST", "/support/tickets/:id/claim", "Assign the ticket to this agent");
1187
+ ClaimTicketCommand2.ResponseSchema = SupportTicketDetailSchema;
1188
+ })(exports.ClaimTicketCommand || (exports.ClaimTicketCommand = {}));
1189
+ exports.SupportReplyTicketCommand = void 0;
1190
+ ((SupportReplyTicketCommand2) => {
1191
+ SupportReplyTicketCommand2.endpointDetails = endpoint("POST", "/support/tickets/:id/messages", "Reply to a ticket as support");
1192
+ SupportReplyTicketCommand2.RequestSchema = zod.z.object({
1193
+ body: TicketBodySchema,
1194
+ attachments: AttachmentsSchema
1195
+ });
1196
+ SupportReplyTicketCommand2.ResponseSchema = SupportTicketDetailSchema;
1197
+ })(exports.SupportReplyTicketCommand || (exports.SupportReplyTicketCommand = {}));
1198
+ exports.ResolveTicketCommand = void 0;
1199
+ ((ResolveTicketCommand2) => {
1200
+ ResolveTicketCommand2.endpointDetails = endpoint("POST", "/support/tickets/:id/resolve", "Close the ticket as resolved");
1201
+ ResolveTicketCommand2.ResponseSchema = SupportTicketDetailSchema;
1202
+ })(exports.ResolveTicketCommand || (exports.ResolveTicketCommand = {}));
1203
+ var AttachmentsSchema2 = zod.z.array(TicketAttachmentInputSchema).max(10).optional();
1137
1204
  exports.ListTicketsCommand = void 0;
1138
1205
  ((ListTicketsCommand2) => {
1139
1206
  ListTicketsCommand2.endpointDetails = endpoint("GET", "/tickets", "List the current user tickets");
@@ -1151,7 +1218,7 @@ exports.CreateTicketCommand = void 0;
1151
1218
  category: TicketCategorySchema,
1152
1219
  title: zod.z.string().min(3).max(160),
1153
1220
  body: TicketBodySchema,
1154
- attachments: AttachmentsSchema
1221
+ attachments: AttachmentsSchema2
1155
1222
  });
1156
1223
  CreateTicketCommand2.ResponseSchema = TicketDetailSchema;
1157
1224
  })(exports.CreateTicketCommand || (exports.CreateTicketCommand = {}));
@@ -1160,7 +1227,7 @@ exports.ReplyTicketCommand = void 0;
1160
1227
  ReplyTicketCommand2.endpointDetails = endpoint("POST", "/tickets/:id/messages", "Reply to a ticket");
1161
1228
  ReplyTicketCommand2.RequestSchema = zod.z.object({
1162
1229
  body: TicketBodySchema,
1163
- attachments: AttachmentsSchema
1230
+ attachments: AttachmentsSchema2
1164
1231
  });
1165
1232
  ReplyTicketCommand2.ResponseSchema = TicketDetailSchema;
1166
1233
  })(exports.ReplyTicketCommand || (exports.ReplyTicketCommand = {}));
@@ -1281,6 +1348,14 @@ var REST_API = {
1281
1348
  GET: "/tickets/:id",
1282
1349
  REPLY: "/tickets/:id/messages",
1283
1350
  ATTACHMENT_UPLOAD_URL: "/tickets/attachments/upload-url"
1351
+ },
1352
+ SUPPORT_TICKETS: {
1353
+ LIST: "/support/tickets",
1354
+ STREAM: "/support/tickets/stream",
1355
+ GET: "/support/tickets/:id",
1356
+ CLAIM: "/support/tickets/:id/claim",
1357
+ REPLY: "/support/tickets/:id/messages",
1358
+ RESOLVE: "/support/tickets/:id/resolve"
1284
1359
  }
1285
1360
  };
1286
1361
  var API_PREFIX = "/api";
@@ -1352,6 +1427,10 @@ exports.SlideKindSchema = SlideKindSchema;
1352
1427
  exports.SlideLinkTargetSchema = SlideLinkTargetSchema;
1353
1428
  exports.SlideSchema = SlideSchema;
1354
1429
  exports.SlidesResponseSchema = SlidesResponseSchema;
1430
+ exports.SupportTicketDetailSchema = SupportTicketDetailSchema;
1431
+ exports.SupportTicketScopeSchema = SupportTicketScopeSchema;
1432
+ exports.SupportTicketSummarySchema = SupportTicketSummarySchema;
1433
+ exports.SupportTicketUserSchema = SupportTicketUserSchema;
1355
1434
  exports.SwapSideSchema = SwapSideSchema;
1356
1435
  exports.TICKET_CATEGORIES = TICKET_CATEGORIES;
1357
1436
  exports.TOKEN_ASSET = TOKEN_ASSET;
@@ -1373,6 +1452,7 @@ exports.TransactionStatusSchema = TransactionStatusSchema;
1373
1452
  exports.TransactionTypeSchema = TransactionTypeSchema;
1374
1453
  exports.UserProfileSchema = UserProfileSchema;
1375
1454
  exports.UserRankSchema = UserRankSchema;
1455
+ exports.UserRoleSchema = UserRoleSchema;
1376
1456
  exports.UserSettingsSchema = UserSettingsSchema;
1377
1457
  exports.UserStatusSchema = UserStatusSchema;
1378
1458
  exports.UuidSchema = UuidSchema;