@sonoransoftware/sonoran.js 1.0.65 → 1.0.67

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.
@@ -363,6 +363,11 @@ export interface CMSChangeFormStagePromiseResult {
363
363
  reason?: string;
364
364
  data?: unknown;
365
365
  }
366
+ export interface CMSGetFormSubmissionPromiseResult {
367
+ success: boolean;
368
+ reason?: string;
369
+ data?: unknown;
370
+ }
366
371
  export interface CMSGetFormLockStatusPromiseResult {
367
372
  success: boolean;
368
373
  reason?: string;
@@ -356,10 +356,16 @@ class REST extends events_1.EventEmitter {
356
356
  accId: args[0],
357
357
  formId: args[1],
358
358
  newStageId: args[2],
359
- apiId: args[3],
360
- username: args[4],
361
- discord: args[5],
362
- uniqueId: args[6],
359
+ optionalReason: args[3],
360
+ apiId: args[4],
361
+ username: args[5],
362
+ discord: args[6],
363
+ uniqueId: args[7],
364
+ };
365
+ }
366
+ case 'GET_FORM_SUBMISSION': {
367
+ return {
368
+ id: args[0]
363
369
  };
364
370
  }
365
371
  case 'BAN_ACCOUNT': {
@@ -38,7 +38,7 @@ export declare const CommunitiesCMSAPITypes: APITypeData[];
38
38
  export declare const ERLCMSAPITypes: APITypeData[];
39
39
  export declare const RadioAPITypes: APITypeData[];
40
40
  export declare const AllAPITypes: AllAPITypeData[];
41
- export type AllAPITypesType = 'GET_SERVERS' | 'SET_SERVERS' | 'GET_VERSION' | 'SET_PENAL_CODES' | 'SET_API_ID' | 'GET_TEMPLATES' | 'NEW_RECORD' | 'SEND_DRAFT' | 'EDIT_RECORD' | 'REMOVE_RECORD' | 'LOOKUP_INT' | 'LOOKUP' | 'GET_ACCOUNT' | 'CHECK_APIID' | 'APPLY_PERMISSION_KEY' | 'SET_ACCOUNT_PERMISSIONS' | 'BAN_USER' | 'VERIFY_SECRET' | 'AUTH_STREETSIGNS' | 'SET_POSTALS' | 'SEND_PHOTO' | 'SET_CLOCK' | 'JOIN_COMMUNITY' | 'LEAVE_COMMUNITY' | 'GET_CHARACTERS' | 'NEW_CHARACTER' | 'EDIT_CHARACTER' | 'REMOVE_CHARACTER' | 'GET_IDENTIFIERS' | 'MODIFY_IDENTIFIER' | 'SET_IDENTIFIER' | 'IDENTS_TO_GROUP' | 'UNIT_PANIC' | 'UNIT_STATUS' | 'GET_BLIPS' | 'ADD_BLIP' | 'MODIFY_BLIP' | 'REMOVE_BLIP' | '911_CALL' | 'REMOVE_911' | 'GET_CALLS' | 'GET_MY_CALL' | 'GET_ACTIVE_UNITS' | 'KICK_UNIT' | 'NEW_DISPATCH' | 'ATTACH_UNIT' | 'DETACH_UNIT' | 'SET_CALL_POSTAL' | 'SET_CALL_PRIMARY' | 'ADD_CALL_NOTE' | 'CLOSE_CALL' | 'UNIT_LOCATION' | 'SET_STREETSIGN_CONFIG' | 'UPDATE_STREETSIGN' | 'GET_COM_ACCOUNT' | 'GET_DEPARTMENTS' | 'GET_SUB_VERSION' | 'GET_CURRENT_CLOCK_IN' | 'GET_CLOCKIN_TYPES' | 'GET_LATEST_ACTIVITY' | 'GET_ACCOUNTS' | 'GET_PROFILE_FIELDS' | 'CHECK_COM_APIID' | 'VERIFY_WHITELIST' | 'CLOCK_IN_OUT' | 'FULL_WHITELIST' | 'GET_ACCOUNT_RANKS' | 'SET_ACCOUNT_RANKS' | 'RSVP' | 'CHANGE_FORM_STAGE' | 'GET_FORM_TEMPLATE_SUBMISSIONS' | 'GET_FORM_LOCK_STATUS' | 'SET_FORM_LOCK_STATUS' | 'GET_CURRENT_SESSION' | 'START_SESSION' | 'STOP_SESSION' | 'CANCEL_SESSION' | 'KICK_ACCOUNT' | 'BAN_ACCOUNT' | 'LOOKUP' | 'EDIT_ACC_PROFLIE_FIELDS' | 'SET_ACCOUNT_NAME' | 'FORCE_SYNC' | 'TRIGGER_PROMOTION_FLOWS' | 'GET_PROMOTION_FLOWS' | 'GET_CUSTOM_LOG_TYPES' | 'SET_GAME_SERVERS' | 'ERLC_GET_ONLINE_PLAYERS' | 'ERLC_GET_PLAYER_QUEUE' | 'ERLC_ADD_NEW_RECORD' | 'ERLC_EXECUTE_COMMAND' | 'ERLC_TEAMS_LOCK' | 'ERLC_TEAMS_UNLOCK' | 'RADIO_GET_COMMUNITY_CHANNELS' | 'RADIO_GET_CONNECTED_USERS' | 'RADIO_GET_CONNECTED_USER' | 'RADIO_SET_USER_CHANNELS' | 'RADIO_SET_USER_DISPLAY_NAME' | 'RADIO_GET_SERVER_SUBSCRIPTION_FROM_IP' | 'RADIO_SET_SERVER_IP' | 'RADIO_SET_IN_GAME_SPEAKER_LOCATIONS' | 'PLAY_TONE';
41
+ export type AllAPITypesType = 'GET_SERVERS' | 'SET_SERVERS' | 'GET_VERSION' | 'SET_PENAL_CODES' | 'SET_API_ID' | 'GET_TEMPLATES' | 'NEW_RECORD' | 'SEND_DRAFT' | 'EDIT_RECORD' | 'REMOVE_RECORD' | 'LOOKUP_INT' | 'LOOKUP' | 'GET_ACCOUNT' | 'CHECK_APIID' | 'APPLY_PERMISSION_KEY' | 'SET_ACCOUNT_PERMISSIONS' | 'BAN_USER' | 'VERIFY_SECRET' | 'AUTH_STREETSIGNS' | 'SET_POSTALS' | 'SEND_PHOTO' | 'SET_CLOCK' | 'JOIN_COMMUNITY' | 'LEAVE_COMMUNITY' | 'GET_CHARACTERS' | 'NEW_CHARACTER' | 'EDIT_CHARACTER' | 'REMOVE_CHARACTER' | 'GET_IDENTIFIERS' | 'MODIFY_IDENTIFIER' | 'SET_IDENTIFIER' | 'IDENTS_TO_GROUP' | 'UNIT_PANIC' | 'UNIT_STATUS' | 'GET_BLIPS' | 'ADD_BLIP' | 'MODIFY_BLIP' | 'REMOVE_BLIP' | '911_CALL' | 'REMOVE_911' | 'GET_CALLS' | 'GET_MY_CALL' | 'GET_ACTIVE_UNITS' | 'KICK_UNIT' | 'NEW_DISPATCH' | 'ATTACH_UNIT' | 'DETACH_UNIT' | 'SET_CALL_POSTAL' | 'SET_CALL_PRIMARY' | 'ADD_CALL_NOTE' | 'CLOSE_CALL' | 'UNIT_LOCATION' | 'SET_STREETSIGN_CONFIG' | 'UPDATE_STREETSIGN' | 'GET_COM_ACCOUNT' | 'GET_DEPARTMENTS' | 'GET_SUB_VERSION' | 'GET_CURRENT_CLOCK_IN' | 'GET_CLOCKIN_TYPES' | 'GET_LATEST_ACTIVITY' | 'GET_ACCOUNTS' | 'GET_PROFILE_FIELDS' | 'CHECK_COM_APIID' | 'VERIFY_WHITELIST' | 'CLOCK_IN_OUT' | 'FULL_WHITELIST' | 'GET_ACCOUNT_RANKS' | 'SET_ACCOUNT_RANKS' | 'RSVP' | 'CHANGE_FORM_STAGE' | 'GET_SUBMISSION' | 'GET_FORM_TEMPLATE_SUBMISSIONS' | 'GET_FORM_LOCK_STATUS' | 'SET_FORM_LOCK_STATUS' | 'GET_CURRENT_SESSION' | 'START_SESSION' | 'STOP_SESSION' | 'CANCEL_SESSION' | 'KICK_ACCOUNT' | 'BAN_ACCOUNT' | 'LOOKUP' | 'EDIT_ACC_PROFLIE_FIELDS' | 'SET_ACCOUNT_NAME' | 'FORCE_SYNC' | 'TRIGGER_PROMOTION_FLOWS' | 'GET_PROMOTION_FLOWS' | 'GET_CUSTOM_LOG_TYPES' | 'SET_GAME_SERVERS' | 'ERLC_GET_ONLINE_PLAYERS' | 'ERLC_GET_PLAYER_QUEUE' | 'ERLC_ADD_NEW_RECORD' | 'ERLC_EXECUTE_COMMAND' | 'ERLC_TEAMS_LOCK' | 'ERLC_TEAMS_UNLOCK' | 'RADIO_GET_COMMUNITY_CHANNELS' | 'RADIO_GET_CONNECTED_USERS' | 'RADIO_GET_CONNECTED_USER' | 'RADIO_SET_USER_CHANNELS' | 'RADIO_SET_USER_DISPLAY_NAME' | 'RADIO_GET_SERVER_SUBSCRIPTION_FROM_IP' | 'RADIO_SET_SERVER_IP' | 'RADIO_SET_IN_GAME_SPEAKER_LOCATIONS' | 'PLAY_TONE';
42
42
  export interface CMSServerAPIStruct {
43
43
  id: number;
44
44
  name: string;
@@ -619,11 +619,15 @@ export interface RESTTypedAPIDataStructs {
619
619
  accId: string | undefined,
620
620
  formId: number,
621
621
  newStageId: string,
622
+ optionalReason: string | null,
622
623
  apiId: string | undefined,
623
624
  username: string | undefined,
624
625
  discord: string | undefined,
625
626
  uniqueId: number
626
627
  ];
628
+ GET_FORM_SUBMISSION: [
629
+ id: number
630
+ ];
627
631
  GET_FORM_TEMPLATE_SUBMISSIONS: [
628
632
  templateId: number,
629
633
  skip?: number,
@@ -555,6 +555,12 @@ exports.FormsCMSAPITypes = [
555
555
  path: 'forms/set_form_lock_status',
556
556
  method: 'POST',
557
557
  minVersion: 0
558
+ },
559
+ {
560
+ type: 'GET_FORM_SUBMISSION',
561
+ path: 'forms/get_submission',
562
+ method: 'POST',
563
+ minVersion: 0
558
564
  }
559
565
  ];
560
566
  exports.CommunitiesCMSAPITypes = [
@@ -206,11 +206,16 @@ export declare class CMSManager extends BaseManager {
206
206
  accId?: string;
207
207
  formId: number;
208
208
  newStageId: string;
209
+ optionalReason: string | null;
209
210
  apiId?: string;
210
211
  username?: string;
211
212
  discord?: string;
212
213
  uniqueId: number;
213
214
  }): Promise<globalTypes.CMSChangeFormStagePromiseResult>;
215
+ /**
216
+ * Gets the form submission object for the given ID
217
+ */
218
+ getFormSubmission(formId: number): Promise<globalTypes.CMSGetFormSubmissionPromiseResult>;
214
219
  /**
215
220
  * Retrieves the lock status for a form template.
216
221
  */
@@ -506,7 +506,30 @@ class CMSManager extends BaseManager_1.BaseManager {
506
506
  return new Promise(async (resolve, reject) => {
507
507
  var _a;
508
508
  try {
509
- const response = await ((_a = this.rest) === null || _a === void 0 ? void 0 : _a.request('CHANGE_FORM_STAGE', params.accId, params.formId, params.newStageId, params.apiId, params.username, params.discord, params.uniqueId));
509
+ const response = await ((_a = this.rest) === null || _a === void 0 ? void 0 : _a.request('CHANGE_FORM_STAGE', params.accId, params.formId, params.newStageId, params.optionalReason, params.apiId, params.username, params.discord, params.uniqueId));
510
+ resolve({ success: true, data: response });
511
+ }
512
+ catch (err) {
513
+ if (err instanceof src_1.APIError) {
514
+ resolve({ success: false, reason: err.response });
515
+ }
516
+ else {
517
+ reject(err);
518
+ }
519
+ }
520
+ });
521
+ }
522
+ /**
523
+ * Gets the form submission object for the given ID
524
+ */
525
+ async getFormSubmission(formId) {
526
+ if (!formId) {
527
+ throw new Error('formId is required to fetch submission');
528
+ }
529
+ return new Promise(async (resolve, reject) => {
530
+ var _a;
531
+ try {
532
+ const response = await ((_a = this.rest) === null || _a === void 0 ? void 0 : _a.request('GET_FORM_SUBMISSION', formId));
510
533
  resolve({ success: true, data: response });
511
534
  }
512
535
  catch (err) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sonoransoftware/sonoran.js",
3
- "version": "1.0.65",
3
+ "version": "1.0.67",
4
4
  "description": "Sonoran.js is a library that allows you to interact with the Sonoran CAD and Sonoran CMS API. Based off of and utilizes several Discord.js library techniques for ease of use.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/src/constants.ts CHANGED
@@ -406,6 +406,12 @@ export interface CMSChangeFormStagePromiseResult {
406
406
  data?: unknown;
407
407
  }
408
408
 
409
+ export interface CMSGetFormSubmissionPromiseResult {
410
+ success: boolean;
411
+ reason?: string;
412
+ data?: unknown;
413
+ }
414
+
409
415
  export interface CMSGetFormLockStatusPromiseResult {
410
416
  success: boolean;
411
417
  reason?: string;
@@ -466,10 +466,16 @@ export class REST extends EventEmitter {
466
466
  accId: args[0],
467
467
  formId: args[1],
468
468
  newStageId: args[2],
469
- apiId: args[3],
470
- username: args[4],
471
- discord: args[5],
472
- uniqueId: args[6],
469
+ optionalReason: args[3],
470
+ apiId: args[4],
471
+ username: args[5],
472
+ discord: args[6],
473
+ uniqueId: args[7],
474
+ };
475
+ }
476
+ case 'GET_FORM_SUBMISSION': {
477
+ return {
478
+ id: args[0]
473
479
  };
474
480
  }
475
481
  case 'BAN_ACCOUNT': {
@@ -590,6 +590,12 @@ export const FormsCMSAPITypes: APITypeData[] = [
590
590
  path: 'forms/set_form_lock_status',
591
591
  method: 'POST',
592
592
  minVersion: 0
593
+ },
594
+ {
595
+ type: 'GET_FORM_SUBMISSION',
596
+ path: 'forms/get_submission',
597
+ method: 'POST',
598
+ minVersion: 0
593
599
  }
594
600
  ];
595
601
 
@@ -709,7 +715,7 @@ function formatForAll(array: APITypeData[], product: productEnums): AllAPITypeDa
709
715
 
710
716
  export const AllAPITypes: AllAPITypeData[] = [ ...formatForAll(GeneralCADAPITypes, productEnums.CAD), ...formatForAll(CivilianCADAPITypes, productEnums.CAD), ...formatForAll(EmergencyCADAPITypes, productEnums.CAD), ...formatForAll(GeneralCMSAPITypes, productEnums.CMS), ...formatForAll(ServersCMSAPITypes, productEnums.CMS), ...formatForAll(EventsCMSAPITypes, productEnums.CMS), ...formatForAll(FormsCMSAPITypes, productEnums.CMS), ...formatForAll(CommunitiesCMSAPITypes, productEnums.CMS), ...formatForAll(ERLCMSAPITypes, productEnums.CMS), ...formatForAll(RadioAPITypes, productEnums.RADIO) ];
711
717
 
712
- export type AllAPITypesType = 'GET_SERVERS' | 'SET_SERVERS' | 'GET_VERSION' | 'SET_PENAL_CODES' | 'SET_API_ID' | 'GET_TEMPLATES' | 'NEW_RECORD' | 'SEND_DRAFT' | 'EDIT_RECORD' | 'REMOVE_RECORD' | 'LOOKUP_INT' | 'LOOKUP' | 'GET_ACCOUNT' | 'CHECK_APIID' | 'APPLY_PERMISSION_KEY' | 'SET_ACCOUNT_PERMISSIONS' | 'BAN_USER' | 'VERIFY_SECRET' | 'AUTH_STREETSIGNS' | 'SET_POSTALS' | 'SEND_PHOTO' | 'SET_CLOCK' | 'JOIN_COMMUNITY' | 'LEAVE_COMMUNITY' | 'GET_CHARACTERS' | 'NEW_CHARACTER' | 'EDIT_CHARACTER' | 'REMOVE_CHARACTER' | 'GET_IDENTIFIERS' | 'MODIFY_IDENTIFIER' | 'SET_IDENTIFIER' | 'IDENTS_TO_GROUP' | 'UNIT_PANIC' | 'UNIT_STATUS' | 'GET_BLIPS' | 'ADD_BLIP' | 'MODIFY_BLIP' | 'REMOVE_BLIP' | '911_CALL' | 'REMOVE_911' | 'GET_CALLS' | 'GET_MY_CALL' | 'GET_ACTIVE_UNITS' | 'KICK_UNIT' | 'NEW_DISPATCH' | 'ATTACH_UNIT' | 'DETACH_UNIT' | 'SET_CALL_POSTAL' | 'SET_CALL_PRIMARY' | 'ADD_CALL_NOTE' | 'CLOSE_CALL' | 'UNIT_LOCATION' | 'SET_STREETSIGN_CONFIG' | 'UPDATE_STREETSIGN' | 'GET_COM_ACCOUNT' | 'GET_DEPARTMENTS' | 'GET_SUB_VERSION' | 'GET_CURRENT_CLOCK_IN' | 'GET_CLOCKIN_TYPES' | 'GET_LATEST_ACTIVITY' | 'GET_ACCOUNTS' | 'GET_PROFILE_FIELDS' | 'CHECK_COM_APIID' | 'VERIFY_WHITELIST' | 'CLOCK_IN_OUT' | 'FULL_WHITELIST' | 'GET_ACCOUNT_RANKS' | 'SET_ACCOUNT_RANKS' | 'RSVP' | 'CHANGE_FORM_STAGE' | 'GET_FORM_TEMPLATE_SUBMISSIONS' | 'GET_FORM_LOCK_STATUS' | 'SET_FORM_LOCK_STATUS' | 'GET_CURRENT_SESSION' | 'START_SESSION' | 'STOP_SESSION' | 'CANCEL_SESSION' | 'KICK_ACCOUNT' | 'BAN_ACCOUNT' | 'LOOKUP' | 'EDIT_ACC_PROFLIE_FIELDS' | 'SET_ACCOUNT_NAME' | 'FORCE_SYNC' | 'TRIGGER_PROMOTION_FLOWS' | 'GET_PROMOTION_FLOWS' | 'GET_CUSTOM_LOG_TYPES' | 'SET_GAME_SERVERS' | 'ERLC_GET_ONLINE_PLAYERS' | 'ERLC_GET_PLAYER_QUEUE' | 'ERLC_ADD_NEW_RECORD' | 'ERLC_EXECUTE_COMMAND' | 'ERLC_TEAMS_LOCK' | 'ERLC_TEAMS_UNLOCK' | 'RADIO_GET_COMMUNITY_CHANNELS' | 'RADIO_GET_CONNECTED_USERS' | 'RADIO_GET_CONNECTED_USER' | 'RADIO_SET_USER_CHANNELS' | 'RADIO_SET_USER_DISPLAY_NAME' | 'RADIO_GET_SERVER_SUBSCRIPTION_FROM_IP' | 'RADIO_SET_SERVER_IP' | 'RADIO_SET_IN_GAME_SPEAKER_LOCATIONS' | 'PLAY_TONE';
718
+ export type AllAPITypesType = 'GET_SERVERS' | 'SET_SERVERS' | 'GET_VERSION' | 'SET_PENAL_CODES' | 'SET_API_ID' | 'GET_TEMPLATES' | 'NEW_RECORD' | 'SEND_DRAFT' | 'EDIT_RECORD' | 'REMOVE_RECORD' | 'LOOKUP_INT' | 'LOOKUP' | 'GET_ACCOUNT' | 'CHECK_APIID' | 'APPLY_PERMISSION_KEY' | 'SET_ACCOUNT_PERMISSIONS' | 'BAN_USER' | 'VERIFY_SECRET' | 'AUTH_STREETSIGNS' | 'SET_POSTALS' | 'SEND_PHOTO' | 'SET_CLOCK' | 'JOIN_COMMUNITY' | 'LEAVE_COMMUNITY' | 'GET_CHARACTERS' | 'NEW_CHARACTER' | 'EDIT_CHARACTER' | 'REMOVE_CHARACTER' | 'GET_IDENTIFIERS' | 'MODIFY_IDENTIFIER' | 'SET_IDENTIFIER' | 'IDENTS_TO_GROUP' | 'UNIT_PANIC' | 'UNIT_STATUS' | 'GET_BLIPS' | 'ADD_BLIP' | 'MODIFY_BLIP' | 'REMOVE_BLIP' | '911_CALL' | 'REMOVE_911' | 'GET_CALLS' | 'GET_MY_CALL' | 'GET_ACTIVE_UNITS' | 'KICK_UNIT' | 'NEW_DISPATCH' | 'ATTACH_UNIT' | 'DETACH_UNIT' | 'SET_CALL_POSTAL' | 'SET_CALL_PRIMARY' | 'ADD_CALL_NOTE' | 'CLOSE_CALL' | 'UNIT_LOCATION' | 'SET_STREETSIGN_CONFIG' | 'UPDATE_STREETSIGN' | 'GET_COM_ACCOUNT' | 'GET_DEPARTMENTS' | 'GET_SUB_VERSION' | 'GET_CURRENT_CLOCK_IN' | 'GET_CLOCKIN_TYPES' | 'GET_LATEST_ACTIVITY' | 'GET_ACCOUNTS' | 'GET_PROFILE_FIELDS' | 'CHECK_COM_APIID' | 'VERIFY_WHITELIST' | 'CLOCK_IN_OUT' | 'FULL_WHITELIST' | 'GET_ACCOUNT_RANKS' | 'SET_ACCOUNT_RANKS' | 'RSVP' | 'CHANGE_FORM_STAGE' | 'GET_SUBMISSION' | 'GET_FORM_TEMPLATE_SUBMISSIONS' | 'GET_FORM_LOCK_STATUS' | 'SET_FORM_LOCK_STATUS' | 'GET_CURRENT_SESSION' | 'START_SESSION' | 'STOP_SESSION' | 'CANCEL_SESSION' | 'KICK_ACCOUNT' | 'BAN_ACCOUNT' | 'LOOKUP' | 'EDIT_ACC_PROFLIE_FIELDS' | 'SET_ACCOUNT_NAME' | 'FORCE_SYNC' | 'TRIGGER_PROMOTION_FLOWS' | 'GET_PROMOTION_FLOWS' | 'GET_CUSTOM_LOG_TYPES' | 'SET_GAME_SERVERS' | 'ERLC_GET_ONLINE_PLAYERS' | 'ERLC_GET_PLAYER_QUEUE' | 'ERLC_ADD_NEW_RECORD' | 'ERLC_EXECUTE_COMMAND' | 'ERLC_TEAMS_LOCK' | 'ERLC_TEAMS_UNLOCK' | 'RADIO_GET_COMMUNITY_CHANNELS' | 'RADIO_GET_CONNECTED_USERS' | 'RADIO_GET_CONNECTED_USER' | 'RADIO_SET_USER_CHANNELS' | 'RADIO_SET_USER_DISPLAY_NAME' | 'RADIO_GET_SERVER_SUBSCRIPTION_FROM_IP' | 'RADIO_SET_SERVER_IP' | 'RADIO_SET_IN_GAME_SPEAKER_LOCATIONS' | 'PLAY_TONE';
713
719
 
714
720
  export interface CMSServerAPIStruct {
715
721
  id: number;
@@ -1329,11 +1335,15 @@ export interface RESTTypedAPIDataStructs {
1329
1335
  accId: string | undefined,
1330
1336
  formId: number,
1331
1337
  newStageId: string,
1338
+ optionalReason: string | null,
1332
1339
  apiId: string | undefined,
1333
1340
  username: string | undefined,
1334
1341
  discord: string | undefined,
1335
1342
  uniqueId: number,
1336
1343
  ]
1344
+ GET_FORM_SUBMISSION: [
1345
+ id: number,
1346
+ ]
1337
1347
  GET_FORM_TEMPLATE_SUBMISSIONS: [
1338
1348
  templateId: number,
1339
1349
  skip?: number,
@@ -442,7 +442,7 @@ export class CMSManager extends BaseManager {
442
442
  /**
443
443
  * Updates the stage of a form for the specified account.
444
444
  */
445
- public async changeFormStage(params: { accId?: string, formId: number, newStageId: string, apiId?: string, username?: string, discord?: string, uniqueId: number }): Promise<globalTypes.CMSChangeFormStagePromiseResult> {
445
+ public async changeFormStage(params: { accId?: string, formId: number, newStageId: string, optionalReason: string | null, apiId?: string, username?: string, discord?: string, uniqueId: number }): Promise<globalTypes.CMSChangeFormStagePromiseResult> {
446
446
  if (!params.formId || !params.newStageId) {
447
447
  throw new Error('formId and newStageId are required to change a form stage.');
448
448
  }
@@ -452,7 +452,29 @@ export class CMSManager extends BaseManager {
452
452
 
453
453
  return new Promise(async (resolve, reject) => {
454
454
  try {
455
- const response: any = await this.rest?.request('CHANGE_FORM_STAGE', params.accId, params.formId, params.newStageId, params.apiId, params.username, params.discord, params.uniqueId);
455
+ const response: any = await this.rest?.request('CHANGE_FORM_STAGE', params.accId, params.formId, params.newStageId, params.optionalReason, params.apiId, params.username, params.discord, params.uniqueId);
456
+ resolve({ success: true, data: response });
457
+ } catch (err) {
458
+ if (err instanceof APIError) {
459
+ resolve({ success: false, reason: err.response });
460
+ } else {
461
+ reject(err);
462
+ }
463
+ }
464
+ });
465
+ }
466
+
467
+ /**
468
+ * Gets the form submission object for the given ID
469
+ */
470
+ public async getFormSubmission(formId: number): Promise<globalTypes.CMSGetFormSubmissionPromiseResult> {
471
+ if (!formId) {
472
+ throw new Error('formId is required to fetch submission');
473
+ }
474
+
475
+ return new Promise(async (resolve, reject) => {
476
+ try {
477
+ const response: any = await this.rest?.request('GET_FORM_SUBMISSION', formId);
456
478
  resolve({ success: true, data: response });
457
479
  } catch (err) {
458
480
  if (err instanceof APIError) {