@resolveio/server-lib 22.2.41 → 22.2.43

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.
@@ -45,7 +45,7 @@ export interface SupportTicketClientUserModel {
45
45
  email: string;
46
46
  }
47
47
  export type SupportTicketPriority = 'High' | 'Low';
48
- export type SupportTicketSubstatus = 'New' | 'Work In Progress' | 'Idle' | 'Awaiting Customer Interaction';
48
+ export type SupportTicketSubstatus = 'New' | 'Work In Progress' | 'Idle' | 'Awaiting Customer Interaction' | 'Awaiting Customer Response' | 'Awaiting Validation' | 'Awaiting Internal Review';
49
49
  export type SupportTicketType = 'System Impairment' | 'Request New Feature' | 'General Inquery';
50
50
  export type SupportTicketStatus = 'Active' | 'Review' | 'Closed' | 'Opened' | 'Resolved';
51
51
  export interface SupportTicketMessageModel {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/models/support-ticket.model.ts"],"names":[],"mappings":"","file":"support-ticket.model.js","sourcesContent":["import { CollectionDocument } from './collection-document.model';\n\nexport interface SupportTicketModel extends CollectionDocument {\n\ttype: SupportTicketType;\n\tpriority: SupportTicketPriority;\n\tissue: string;\n\tai_recommendations?: SupportTicketAiRecommendationsModel;\n\tsupport_ticket_number: number;\n\tsupport_ticket_number_string: string;\n\tstatus: SupportTicketStatus;\n\tsubstatus: SupportTicketSubstatus;\n\tclient: string;\n\tid_client: string;\n\turl_ticket?: string;\n\tmessages: SupportTicketMessageModel[];\n\tdate_created: Date;\n\tdate_created_string: string;\n\tid_user_created: string;\n\tuser_created: string;\n\tbillable: boolean;\n\tdate_investigation?: Date;\n\tdate_closed?: Date;\n\tfiles: string[];\n\tcurrent_watchers: SupportTicketWatchersModel[];\n\tclient_user: SupportTicketClientUserModel;\n\tusers_assigned: SupportTicketUserAssignedModel[];\n\testimated_billable_hours?: number;\n\tbillable_hours?: number;\n\tbill_description: string;\n\ttasks: SupportTicketTaskModel[];\n\tnotes: SupportTicketNoteModel[];\n\tdifficulty: number;\n}\n\nexport interface SupportTicketAiRecommendationsModel {\n\tsource?: string;\n\thidden_from_client?: boolean;\n\tcreated_at?: Date;\n\tsource_message_id?: string;\n\tsummary?: string;\n\tinternal_recommendations?: string;\n\tcode_change_recommendations?: string;\n}\n\nexport interface SupportTicketClientUserModel {\n\tid_user: string;\n\tuser: string;\n\temail: string;\n}\n\nexport type SupportTicketPriority = 'High' | 'Low';\n\nexport type SupportTicketSubstatus = 'New' | 'Work In Progress' | 'Idle' | 'Awaiting Customer Interaction';\nexport type SupportTicketType = 'System Impairment' | 'Request New Feature' | 'General Inquery';\nexport type SupportTicketStatus = 'Active' | 'Review' | 'Closed' | 'Opened' | 'Resolved';\n\nexport interface SupportTicketMessageModel {\n\tmessage: string;\n\tid_user: string;\n\tuser: string;\n\tdate: Date;\n\ttype: SupportTicketMessageType;\n\tinternal?: boolean;\n\tvisibility?: 'public' | 'internal';\n\tbadge?: string;\n\tsource?: string;\n}\n\ntype SupportTicketMessageType = 'ResolveIO' | 'Client';\n\nexport interface SupportTicketWatchersModel {\n\tuser: string;\n\tid_user: string;\n\temail: string;\n}\n\nexport interface SupportTicketTaskModel {\n\tdescription: string;\n\tcompleted: boolean;\n\tid_user?: string;\n\tuser?: string;\n\tdate_created: Date;\n\tdate_completed?: Date;\n}\n\nexport interface SupportTicketNoteModel {\n\tdescription: string;\n\tid_user: string;\n\tuser: string;\n\tdate_created: Date;\n}\n\nexport interface SupportTicketUserAssignedModel {\n\tid_user: string;\n\tuser: string;\n\tdate_created: Date;\n} \n"]}
1
+ {"version":3,"sources":["../../src/models/support-ticket.model.ts"],"names":[],"mappings":"","file":"support-ticket.model.js","sourcesContent":["import { CollectionDocument } from './collection-document.model';\n\nexport interface SupportTicketModel extends CollectionDocument {\n\ttype: SupportTicketType;\n\tpriority: SupportTicketPriority;\n\tissue: string;\n\tai_recommendations?: SupportTicketAiRecommendationsModel;\n\tsupport_ticket_number: number;\n\tsupport_ticket_number_string: string;\n\tstatus: SupportTicketStatus;\n\tsubstatus: SupportTicketSubstatus;\n\tclient: string;\n\tid_client: string;\n\turl_ticket?: string;\n\tmessages: SupportTicketMessageModel[];\n\tdate_created: Date;\n\tdate_created_string: string;\n\tid_user_created: string;\n\tuser_created: string;\n\tbillable: boolean;\n\tdate_investigation?: Date;\n\tdate_closed?: Date;\n\tfiles: string[];\n\tcurrent_watchers: SupportTicketWatchersModel[];\n\tclient_user: SupportTicketClientUserModel;\n\tusers_assigned: SupportTicketUserAssignedModel[];\n\testimated_billable_hours?: number;\n\tbillable_hours?: number;\n\tbill_description: string;\n\ttasks: SupportTicketTaskModel[];\n\tnotes: SupportTicketNoteModel[];\n\tdifficulty: number;\n}\n\nexport interface SupportTicketAiRecommendationsModel {\n\tsource?: string;\n\thidden_from_client?: boolean;\n\tcreated_at?: Date;\n\tsource_message_id?: string;\n\tsummary?: string;\n\tinternal_recommendations?: string;\n\tcode_change_recommendations?: string;\n}\n\nexport interface SupportTicketClientUserModel {\n\tid_user: string;\n\tuser: string;\n\temail: string;\n}\n\nexport type SupportTicketPriority = 'High' | 'Low';\n\nexport type SupportTicketSubstatus =\n\t| 'New'\n\t| 'Work In Progress'\n\t| 'Idle'\n\t| 'Awaiting Customer Interaction'\n\t| 'Awaiting Customer Response'\n\t| 'Awaiting Validation'\n\t| 'Awaiting Internal Review';\nexport type SupportTicketType = 'System Impairment' | 'Request New Feature' | 'General Inquery';\nexport type SupportTicketStatus = 'Active' | 'Review' | 'Closed' | 'Opened' | 'Resolved';\n\nexport interface SupportTicketMessageModel {\n\tmessage: string;\n\tid_user: string;\n\tuser: string;\n\tdate: Date;\n\ttype: SupportTicketMessageType;\n\tinternal?: boolean;\n\tvisibility?: 'public' | 'internal';\n\tbadge?: string;\n\tsource?: string;\n}\n\ntype SupportTicketMessageType = 'ResolveIO' | 'Client';\n\nexport interface SupportTicketWatchersModel {\n\tuser: string;\n\tid_user: string;\n\temail: string;\n}\n\nexport interface SupportTicketTaskModel {\n\tdescription: string;\n\tcompleted: boolean;\n\tid_user?: string;\n\tuser?: string;\n\tdate_created: Date;\n\tdate_completed?: Date;\n}\n\nexport interface SupportTicketNoteModel {\n\tdescription: string;\n\tid_user: string;\n\tuser: string;\n\tdate_created: Date;\n}\n\nexport interface SupportTicketUserAssignedModel {\n\tid_user: string;\n\tuser: string;\n\tdate_created: Date;\n} \n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@resolveio/server-lib",
3
- "version": "22.2.41",
3
+ "version": "22.2.43",
4
4
  "description": "",
5
5
  "scripts": {
6
6
  "package": "./build_package.sh",
package/server-app.js CHANGED
@@ -173,7 +173,7 @@ var ResolveIOMainServer = /** @class */ (function () {
173
173
  };
174
174
  ResolveIOMainServer.prototype.initialize = function () {
175
175
  return __awaiter(this, void 0, void 0, function () {
176
- var _a, workerRole, workerIndex, workerInstance;
176
+ var _a, workerRole, workerIndex, workerInstance, skipWorkerServerConnection, skipCronForProcessOnly;
177
177
  var _this = this;
178
178
  return __generator(this, function (_b) {
179
179
  switch (_b.label) {
@@ -422,8 +422,24 @@ var ResolveIOMainServer = /** @class */ (function () {
422
422
  console.log("Running as Worker: ".concat(workerRole), workerIndex, workerInstance);
423
423
  this._methodManager = method_manager_1.MethodManager.create(null, this._monitorManagerFunction, this._isWorkersEnabled, this._isWorkerInstance);
424
424
  this._subscriptionManager = subscription_manager_1.SubscriptionManager.createPublicationRegistry(resolveio_server_app_1.ResolveIOServer.getServerConfig());
425
- this._workerServerManager = worker_server_manager_1.WorkerServerManager.create(this._methodManager, this.getServerConfig());
426
- if (process.env.WORKER_INDEX === '0') {
425
+ skipWorkerServerConnection = this.parseDebugFlag(process.env.DISABLE_WORKER_SERVER_CONNECTION)
426
+ || this.parseDebugFlag(process.env.SUPPORT_CODEX_MANAGER_PROCESS_ONLY)
427
+ || this.parseDebugFlag(process.env.SUPPORT_AUTO_MANAGER_PROCESS_ONLY)
428
+ || this.parseDebugFlag(process.env.AI_ASSISTANT_CODEX_MANAGER_PROCESS_ONLY);
429
+ if (skipWorkerServerConnection) {
430
+ console.log(new Date(), 'Worker server connection disabled for process-only runtime', {
431
+ workerIndex: process.env.WORKER_INDEX || null,
432
+ workerInstance: process.env.NODE_APP_INSTANCE || null
433
+ });
434
+ this._workerServerManager = null;
435
+ }
436
+ else {
437
+ this._workerServerManager = worker_server_manager_1.WorkerServerManager.create(this._methodManager, this.getServerConfig());
438
+ }
439
+ skipCronForProcessOnly = this.parseDebugFlag(process.env.SUPPORT_CODEX_MANAGER_PROCESS_ONLY)
440
+ || this.parseDebugFlag(process.env.SUPPORT_AUTO_MANAGER_PROCESS_ONLY)
441
+ || this.parseDebugFlag(process.env.AI_ASSISTANT_CODEX_MANAGER_PROCESS_ONLY);
442
+ if (process.env.WORKER_INDEX === '0' && !skipCronForProcessOnly) {
427
443
  this._cronManager = cron_manager_1.CronManager.create();
428
444
  }
429
445
  }
@@ -1143,16 +1159,16 @@ var ResolveIOMainServer = /** @class */ (function () {
1143
1159
  return;
1144
1160
  }
1145
1161
  var workerToken = requestUrl.searchParams.get('workerToken') || '';
1146
- var workerIndex = requestUrl.searchParams.get('workerIndex');
1147
- var workerInstance = requestUrl.searchParams.get('workerInstance');
1162
+ var workerIndex = _this.normalizeWorkerSelectorValue(requestUrl.searchParams.get('workerIndex'));
1163
+ var workerInstance = _this.normalizeWorkerSelectorValue(requestUrl.searchParams.get('workerInstance'));
1148
1164
  var expectedWorkerToken = String(resolveio_server_app_1.ResolveIOServer.getServerConfig()['WORKER_TOKEN'] || '');
1165
+ if (!workerIndex || !workerInstance) {
1166
+ cb(false, 400, 'Missing worker identity');
1167
+ return;
1168
+ }
1149
1169
  if (workerToken === expectedWorkerToken) {
1150
- if (workerIndex) {
1151
- info.req['workerIndex'] = workerIndex;
1152
- }
1153
- if (workerInstance) {
1154
- info.req['workerInstance'] = workerInstance;
1155
- }
1170
+ info.req['workerIndex'] = workerIndex;
1171
+ info.req['workerInstance'] = workerInstance;
1156
1172
  cb(true);
1157
1173
  }
1158
1174
  else {
@@ -1263,12 +1279,19 @@ var ResolveIOMainServer = /** @class */ (function () {
1263
1279
  if (!workerInstance && req['workerInstance']) {
1264
1280
  workerInstance = req['workerInstance'];
1265
1281
  }
1266
- if (workerIndex !== null && workerIndex !== undefined) {
1267
- ws['workerIndex'] = workerIndex;
1268
- }
1269
- if (workerInstance !== null && workerInstance !== undefined) {
1270
- ws['workerInstance'] = workerInstance;
1282
+ workerIndex = this.normalizeWorkerSelectorValue(workerIndex);
1283
+ workerInstance = this.normalizeWorkerSelectorValue(workerInstance);
1284
+ if (!workerIndex || !workerInstance) {
1285
+ console.warn(new Date(), 'Rejected worker connection with missing identity', {
1286
+ workerId: workerId_1,
1287
+ workerIndex: workerIndex || null,
1288
+ workerInstance: workerInstance || null
1289
+ });
1290
+ ws.close(1008, 'Missing worker identity');
1291
+ return [2 /*return*/];
1271
1292
  }
1293
+ ws['workerIndex'] = workerIndex;
1294
+ ws['workerInstance'] = workerInstance;
1272
1295
  workerIndexForLog = ws['workerIndex'] || 'UNKNOWN';
1273
1296
  workerInstanceForLog = ws['workerInstance'] || 'UNKNOWN';
1274
1297
  console.log(new Date(), 'Worker Connected', workerIndexForLog, workerInstanceForLog);