octopian-apis 1.0.44 → 1.0.46

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "octopian-apis",
3
- "version": "1.0.44",
3
+ "version": "1.0.46",
4
4
  "description": "Transaction APIs SDK that implements Octopian Services which will be used for any node project typescript or javascript",
5
5
  "main": "./src/index.js",
6
6
  "scripts": {
@@ -2,9 +2,14 @@ import {
2
2
  RequestsAPIConstants,
3
3
  RequestStepsAPIConstants,
4
4
  StorageAPIConstants,
5
+ TransactionsAPIConstants,
5
6
  } from "../web-services/apiConstants";
6
7
  import * as apiHandler from "../web-services/apiHandler";
7
- import { CreateReadSAS, GetOnPremiseReadSAS, GetOnPremiseWriteSAS } from "./storageServices";
8
+ import {
9
+ CreateReadSAS,
10
+ GetOnPremiseReadSAS,
11
+ GetOnPremiseWriteSAS,
12
+ } from "./storageServices";
8
13
  import { SetStorageType, GetConfig, decodeBase64ToJson } from "../sdkUtilities";
9
14
  /**
10
15
  * @description
@@ -81,7 +86,10 @@ export async function GetMyApprovedCorrespondenceRequests(
81
86
  if (attribute.Alias === "To") {
82
87
  ToName = attribute.Value;
83
88
  }
84
- if (attribute.AttributeTypeValueTypeName === "Attachment" && !attribute.IsRequesterVisible) {
89
+ if (
90
+ attribute.AttributeTypeValueTypeName === "Attachment" &&
91
+ !attribute.IsRequesterVisible
92
+ ) {
85
93
  // if(attribute.Value && ReadSASResult?.Result)
86
94
  // {
87
95
  // GeneratedDocument = ReadSASResult.Result.split("?")[0] +
@@ -90,30 +98,31 @@ export async function GetMyApprovedCorrespondenceRequests(
90
98
  // "?" +
91
99
  // ReadSASResult.Result.split("?")[1];
92
100
  // }
93
- GeneratedDocument = attribute.Value;
101
+ GeneratedDocument = attribute.Value;
94
102
  }
95
- if(attribute.Alias === "Attachments" && !attribute.IsRequesterVisible)
96
- {
97
- if(attribute.Value)
98
- {
103
+ if (
104
+ attribute.Alias === "Attachments" &&
105
+ !attribute.IsRequesterVisible
106
+ ) {
107
+ if (attribute.Value) {
99
108
  let DecodedAttachmentsRecordList = decodeBase64ToJson(
100
109
  attribute.Value
101
110
  );
102
111
  for (let attributeGroup of DecodedAttachmentsRecordList) {
103
112
  for (let group of attributeGroup) {
104
- for (let attribute of group.RequestAttributeDtos) {
105
- if (
106
- attribute.AttributeTypeValueTypeName === "Attachment"
107
- ) {
113
+ for (let attributeDTO of group.RequestAttributeDtos) {
114
+ if (attributeDTO.AttributeTypeValueTypeName === "Attachment") {
108
115
  Attachments.push({
109
- id: attribute.RequestAttributeId || 0,
110
- name: attribute.Name || "",
111
- type: attribute.Value?.split(".").pop() || "",
112
- url: ReadSASResult?.Result? (ReadSASResult.Result.split("?")[0] +
113
- "/" +
114
- attribute.Value +
115
- "?" +
116
- ReadSASResult.Result.split("?")[1]): "",
116
+ id: attributeDTO.RequestAttributeId || 0,
117
+ name: attributeDTO.ExtendedValue || "",
118
+ type: attributeDTO.Value?.split(".").pop() || "",
119
+ url: ReadSASResult?.Result
120
+ ? ReadSASResult.Result.split("?")[0] +
121
+ "/" +
122
+ attributeDTO.Value +
123
+ "?" +
124
+ ReadSASResult.Result.split("?")[1]
125
+ : "",
117
126
  });
118
127
  }
119
128
  }
@@ -266,7 +275,10 @@ export async function GetMyRejectedCorrespondenceRequests(
266
275
  if (attribute.Alias === "To") {
267
276
  ToName = attribute.Value;
268
277
  }
269
- if (attribute.AttributeTypeValueTypeName === "Attachment" && !attribute.IsRequesterVisible) {
278
+ if (
279
+ attribute.AttributeTypeValueTypeName === "Attachment" &&
280
+ !attribute.IsRequesterVisible
281
+ ) {
270
282
  // if(attribute.Value && ReadSASResult?.Result)
271
283
  // {
272
284
  // GeneratedDocument = ReadSASResult.Result.split("?")[0] +
@@ -275,31 +287,31 @@ export async function GetMyRejectedCorrespondenceRequests(
275
287
  // "?" +
276
288
  // ReadSASResult.Result.split("?")[1];
277
289
  // }
278
- GeneratedDocument = attribute.Value;
279
-
290
+ GeneratedDocument = attribute.Value;
280
291
  }
281
- if(attribute.Alias === "Attachments" && !attribute.IsRequesterVisible)
282
- {
283
- if(attribute.Value)
284
- {
292
+ if (
293
+ attribute.Alias === "Attachments" &&
294
+ !attribute.IsRequesterVisible
295
+ ) {
296
+ if (attribute.Value) {
285
297
  let DecodedAttachmentsRecordList = decodeBase64ToJson(
286
298
  attribute.Value
287
299
  );
288
300
  for (let attributeGroup of DecodedAttachmentsRecordList) {
289
301
  for (let group of attributeGroup) {
290
- for (let attribute of group.RequestAttributeDtos) {
291
- if (
292
- attribute.AttributeTypeValueTypeName === "Attachment"
293
- ) {
302
+ for (let attributeDTO of group.RequestAttributeDtos) {
303
+ if (attributeDTO.AttributeTypeValueTypeName === "Attachment") {
294
304
  Attachments.push({
295
- id: attribute.RequestAttributeId || 0,
296
- name: attribute.Name || "",
297
- type: attribute.Value?.split(".").pop() || "",
298
- url: ReadSASResult?.Result? (ReadSASResult.Result.split("?")[0] +
299
- "/" +
300
- attribute.Value +
301
- "?" +
302
- ReadSASResult.Result.split("?")[1]): "",
305
+ id: attributeDTO.RequestAttributeId || 0,
306
+ name: attributeDTO.ExtendedValue || "",
307
+ type: attributeDTO.Value?.split(".").pop() || "",
308
+ url: ReadSASResult?.Result
309
+ ? ReadSASResult.Result.split("?")[0] +
310
+ "/" +
311
+ attributeDTO.Value +
312
+ "?" +
313
+ ReadSASResult.Result.split("?")[1]
314
+ : "",
303
315
  });
304
316
  }
305
317
  }
@@ -440,7 +452,10 @@ export async function GetMyDraftCorrespondenceRequests(
440
452
  if (attribute.Alias === "To") {
441
453
  ToName = attribute.Value;
442
454
  }
443
- if (attribute.AttributeTypeValueTypeName === "Attachment" && !attribute.IsRequesterVisible) {
455
+ if (
456
+ attribute.AttributeTypeValueTypeName === "Attachment" &&
457
+ !attribute.IsRequesterVisible
458
+ ) {
444
459
  // if(attribute.Value && ReadSASResult?.Result)
445
460
  // {
446
461
  // GeneratedDocument = ReadSASResult.Result.split("?")[0] +
@@ -449,36 +464,37 @@ export async function GetMyDraftCorrespondenceRequests(
449
464
  // "?" +
450
465
  // ReadSASResult.Result.split("?")[1];
451
466
  // }
452
- GeneratedDocument = attribute.Value;
467
+ GeneratedDocument = attribute.Value;
453
468
  }
454
- if(attribute.Alias === "Attachments" && !attribute.IsRequesterVisible)
455
- {
456
- if(attribute.Value)
457
- {
469
+ if (
470
+ attribute.Alias === "Attachments" &&
471
+ !attribute.IsRequesterVisible
472
+ ) {
473
+ if (attribute.Value) {
458
474
  let DecodedAttachmentsRecordList = decodeBase64ToJson(
459
475
  attribute.Value
460
476
  );
461
477
  for (let attributeGroup of DecodedAttachmentsRecordList) {
462
478
  for (let group of attributeGroup) {
463
- for (let attribute of group.RequestAttributeDtos) {
464
- if (
465
- attribute.AttributeTypeValueTypeName === "Attachment"
466
- ) {
479
+ for (let attributeDTO of group.RequestAttributeDtos) {
480
+ if (attributeDTO.AttributeTypeValueTypeName === "Attachment") {
467
481
  Attachments.push({
468
- id: attribute.RequestAttributeId || 0,
469
- name: attribute.Name || "",
470
- type: attribute.Value?.split(".").pop() || "",
471
- url: ReadSASResult?.Result? (ReadSASResult.Result.split("?")[0] +
472
- "/" +
473
- attribute.Value +
474
- "?" +
475
- ReadSASResult.Result.split("?")[1]): "",
482
+ id: attributeDTO.RequestAttributeId || 0,
483
+ name: attributeDTO.ExtendedValue || "",
484
+ type: attributeDTO.Value?.split(".").pop() || "",
485
+ url: ReadSASResult?.Result
486
+ ? ReadSASResult.Result.split("?")[0] +
487
+ "/" +
488
+ attributeDTO.Value +
489
+ "?" +
490
+ ReadSASResult.Result.split("?")[1]
491
+ : "",
476
492
  });
477
493
  }
478
494
  }
479
- }
480
495
  }
481
496
  }
497
+ }
482
498
  }
483
499
  });
484
500
  }
@@ -543,7 +559,7 @@ export async function GetMyDraftCorrespondenceRequests(
543
559
  * }
544
560
  * }
545
561
  */
546
- export async function GetInProcessCorrespondenceRequests(
562
+ export async function GetSentCorrespondenceRequests(
547
563
  GetMyCorrespondenceListDTO,
548
564
  AuthToken = null,
549
565
  Timeout = 30000,
@@ -571,7 +587,7 @@ export async function GetInProcessCorrespondenceRequests(
571
587
  let ToName = "";
572
588
  let GeneratedDocument = "";
573
589
  let Attachments = [];
574
- if (element.RequestAttributeList?.length > 0) {
590
+ if (element.RequestAttributeList?.length > 0) {
575
591
  element.RequestAttributeList.forEach((attribute) => {
576
592
  if (attribute.Alias === "Subject") {
577
593
  subject = attribute.Value;
@@ -585,7 +601,10 @@ export async function GetInProcessCorrespondenceRequests(
585
601
  if (attribute.Alias === "To") {
586
602
  ToName = attribute.Value;
587
603
  }
588
- if (attribute.AttributeTypeValueTypeName === "Attachment" && !attribute.IsRequesterVisible) {
604
+ if (
605
+ attribute.AttributeTypeValueTypeName === "Attachment" &&
606
+ !attribute.IsRequesterVisible
607
+ ) {
589
608
  // if(attribute.Value && ReadSASResult?.Result)
590
609
  // {
591
610
  // GeneratedDocument = ReadSASResult.Result.split("?")[0] +
@@ -594,30 +613,31 @@ export async function GetInProcessCorrespondenceRequests(
594
613
  // "?" +
595
614
  // ReadSASResult.Result.split("?")[1];
596
615
  // }
597
- GeneratedDocument = attribute.Value;
616
+ GeneratedDocument = attribute.Value;
598
617
  }
599
- if(attribute.Alias === "Attachments" && !attribute.IsRequesterVisible)
600
- {
601
- if(attribute.Value)
602
- {
618
+ if (
619
+ attribute.Alias === "Attachments" &&
620
+ !attribute.IsRequesterVisible
621
+ ) {
622
+ if (attribute.Value) {
603
623
  let DecodedAttachmentsRecordList = decodeBase64ToJson(
604
624
  attribute.Value
605
625
  );
606
626
  for (let attributeGroup of DecodedAttachmentsRecordList) {
607
627
  for (let group of attributeGroup) {
608
628
  for (let attribute of group.RequestAttributeDtos) {
609
- if (
610
- attribute.AttributeTypeValueTypeName === "Attachment"
611
- ) {
629
+ if (attribute.AttributeTypeValueTypeName === "Attachment") {
612
630
  Attachments.push({
613
631
  id: attribute.RequestAttributeId || 0,
614
632
  name: attribute.Name || "",
615
633
  type: attribute.Value?.split(".").pop() || "",
616
- url: ReadSASResult?.Result? (ReadSASResult.Result.split("?")[0] +
617
- "/" +
618
- attribute.Value +
619
- "?" +
620
- ReadSASResult.Result.split("?")[1]): "",
634
+ url: ReadSASResult?.Result
635
+ ? ReadSASResult.Result.split("?")[0] +
636
+ "/" +
637
+ attribute.Value +
638
+ "?" +
639
+ ReadSASResult.Result.split("?")[1]
640
+ : "",
621
641
  });
622
642
  }
623
643
  }
@@ -657,6 +677,154 @@ export async function GetInProcessCorrespondenceRequests(
657
677
  return APIResponse;
658
678
  }
659
679
 
680
+ /**
681
+ * @description
682
+ * Retrieves the list of Correspondences for the current user.
683
+ *
684
+ * @param {object} getMyCorrespondenceListDTO
685
+ * Data object containing fields necessary for retrieving the list of requests.
686
+ * PageSize: number
687
+ * PageIndex: number
688
+ * IsAscendingOrder?: boolean (Optional)
689
+ * FromFinishDate?: string (Optional)
690
+ * ToFinishDate?: string (Optional)
691
+ * FromStartDate?: string (Optional)
692
+ * ToStartDate?: string (Optional)
693
+ *
694
+ * @param {string} AuthToken
695
+ * Authentication token for authorization purposes.
696
+ *
697
+ * @param {number} Timeout
698
+ * Time in milliseconds to wait before the request times out. Default is 30000.
699
+ *
700
+ * @returns
701
+ * An object containing the response from the Get My Request List request, including
702
+ * success message, status code, and any additional data returned by the API.
703
+ * {
704
+ * Message: string,
705
+ * StatusCode: number,
706
+ * Result: {
707
+ * -- request data based on selection criteria wether grouped or not--
708
+ * }
709
+ * }
710
+ */
711
+ export async function GetCancelledCorrespondenceRequests(
712
+ GetMyCorrespondenceListDTO,
713
+ AuthToken = null,
714
+ Timeout = 30000,
715
+ RequiredHeaderValue = null
716
+ ) {
717
+ GetMyCorrespondenceListDTO["RequestStatus"] = "Cancelled";
718
+ GetMyCorrespondenceListDTO["WithRequestStep"] = true;
719
+ GetMyCorrespondenceListDTO["WithRequestStepAttribute"] = true;
720
+ GetMyCorrespondenceListDTO["WithRequestAttribute"] = true;
721
+
722
+ let APIResponse = await apiHandler.PostMethod(
723
+ RequestsAPIConstants.uriGetMyRequestList(),
724
+ GetMyCorrespondenceListDTO,
725
+ AuthToken,
726
+ Timeout,
727
+ RequiredHeaderValue
728
+ );
729
+ let MappedResult = [];
730
+ let ReadSASResult = await CreateReadSAS(AuthToken, Timeout);
731
+ if (APIResponse.StatusCode === 200 && APIResponse.Result?.length > 0) {
732
+ APIResponse.Result.forEach((element) => {
733
+ let subject = element.ServiceName;
734
+ let notes = "";
735
+ let ImagePath = "";
736
+ let ToName = "";
737
+ let GeneratedDocument = "";
738
+ let Attachments = [];
739
+ if (element.RequestAttributeList?.length > 0) {
740
+ element.RequestAttributeList.forEach((attribute) => {
741
+ if (attribute.Alias === "Subject") {
742
+ subject = attribute.Value;
743
+ }
744
+ if (attribute.Alias === "Notes") {
745
+ notes = attribute.Value;
746
+ }
747
+ if (attribute.Alias === "InteractorImagePath") {
748
+ ImagePath = attribute.Value;
749
+ }
750
+ if (attribute.Alias === "To") {
751
+ ToName = attribute.Value;
752
+ }
753
+ if (
754
+ attribute.AttributeTypeValueTypeName === "Attachment" &&
755
+ !attribute.IsRequesterVisible
756
+ ) {
757
+ // if(attribute.Value && ReadSASResult?.Result)
758
+ // {
759
+ // GeneratedDocument = ReadSASResult.Result.split("?")[0] +
760
+ // "/" +
761
+ // attribute.Value +
762
+ // "?" +
763
+ // ReadSASResult.Result.split("?")[1];
764
+ // }
765
+ GeneratedDocument = attribute.Value;
766
+ }
767
+ if (
768
+ attribute.Alias === "Attachments" &&
769
+ !attribute.IsRequesterVisible
770
+ ) {
771
+ if (attribute.Value) {
772
+ let DecodedAttachmentsRecordList = decodeBase64ToJson(
773
+ attribute.Value
774
+ );
775
+ for (let attributeGroup of DecodedAttachmentsRecordList) {
776
+ for (let group of attributeGroup) {
777
+ for (let attributeDTO of group.RequestAttributeDtos) {
778
+ if (attributeDTO.AttributeTypeValueTypeName === "Attachment") {
779
+ Attachments.push({
780
+ id: attributeDTO.RequestAttributeId || 0,
781
+ name: attributeDTO.ExtendedValue || "",
782
+ type: attributeDTO.Value?.split(".").pop() || "",
783
+ url: ReadSASResult?.Result
784
+ ? ReadSASResult.Result.split("?")[0] +
785
+ "/" +
786
+ attributeDTO.Value +
787
+ "?" +
788
+ ReadSASResult.Result.split("?")[1]
789
+ : "",
790
+ });
791
+ }
792
+ }
793
+ }
794
+ }
795
+ }
796
+ }
797
+ });
798
+ }
799
+ if (ImagePath && ReadSASResult.StatusCode === 200) {
800
+ ImagePath =
801
+ ReadSASResult.Result.split("?")[0] +
802
+ "/" +
803
+ ImagePath +
804
+ "?" +
805
+ ReadSASResult.Result.split("?")[1];
806
+ }
807
+ MappedResult.push({
808
+ RequestId: element.RequestId,
809
+ StepId: 0,
810
+ RequesterImagePath: ImagePath,
811
+ RequesterName: element.InteractorName,
812
+ ToName: ToName,
813
+ CategoryColor: element.ExtraLine1 ? element.ExtraLine1 : "#FB4C2F",
814
+ CategoryName: element.ServiceSubCategoryName,
815
+ SubmitDate: element.SubmitDate,
816
+ Subject: subject,
817
+ Notes: notes,
818
+ IsRead: true,
819
+ ProcessFlow: [],
820
+ GeneratedDocument: GeneratedDocument,
821
+ Attachments: Attachments,
822
+ });
823
+ });
824
+ APIResponse.Result = MappedResult;
825
+ }
826
+ return APIResponse;
827
+ }
660
828
  /**
661
829
  * @description
662
830
  * Retrieves the list of Correspondences for the current user.
@@ -732,7 +900,10 @@ export async function GetMyClosedCorrespondenceRequests(
732
900
  if (attribute.Alias === "To") {
733
901
  ToName = attribute.Value;
734
902
  }
735
- if (attribute.AttributeTypeValueTypeName === "Attachment" && !attribute.IsRequesterVisible) {
903
+ if (
904
+ attribute.AttributeTypeValueTypeName === "Attachment" &&
905
+ !attribute.IsRequesterVisible
906
+ ) {
736
907
  // if(attribute.Value && ReadSASResult?.Result)
737
908
  // {
738
909
  // GeneratedDocument = ReadSASResult.Result.split("?")[0] +
@@ -741,30 +912,31 @@ export async function GetMyClosedCorrespondenceRequests(
741
912
  // "?" +
742
913
  // ReadSASResult.Result.split("?")[1];
743
914
  // }
744
- GeneratedDocument = attribute.Value;
915
+ GeneratedDocument = attribute.Value;
745
916
  }
746
- if(attribute.Alias === "Attachments" && !attribute.IsRequesterVisible)
747
- {
748
- if(attribute.Value)
749
- {
917
+ if (
918
+ attribute.Alias === "Attachments" &&
919
+ !attribute.IsRequesterVisible
920
+ ) {
921
+ if (attribute.Value) {
750
922
  let DecodedAttachmentsRecordList = decodeBase64ToJson(
751
923
  attribute.Value
752
924
  );
753
925
  for (let attributeGroup of DecodedAttachmentsRecordList) {
754
926
  for (let group of attributeGroup) {
755
- for (let attribute of group.RequestAttributeDtos) {
756
- if (
757
- attribute.AttributeTypeValueTypeName === "Attachment"
758
- ) {
927
+ for (let attributeDTO of group.RequestAttributeDtos) {
928
+ if (attributeDTO.AttributeTypeValueTypeName === "Attachment") {
759
929
  Attachments.push({
760
- id: attribute.RequestAttributeId || 0,
761
- name: attribute.Name || "",
762
- type: attribute.Value?.split(".").pop() || "",
763
- url: ReadSASResult?.Result? (ReadSASResult.Result.split("?")[0] +
764
- "/" +
765
- attribute.Value +
766
- "?" +
767
- ReadSASResult.Result.split("?")[1]): "",
930
+ id: attributeDTO.RequestAttributeId || 0,
931
+ name: attributeDTO.ExtendedValue || "",
932
+ type: attributeDTO.Value?.split(".").pop() || "",
933
+ url: ReadSASResult?.Result
934
+ ? ReadSASResult.Result.split("?")[0] +
935
+ "/" +
936
+ attributeDTO.Value +
937
+ "?" +
938
+ ReadSASResult.Result.split("?")[1]
939
+ : "",
768
940
  });
769
941
  }
770
942
  }
@@ -999,7 +1171,7 @@ export async function GetMyInboxCorrespondenceRequests(
999
1171
  GetMyCorrespondenceListDTO["WithRequest"] = true;
1000
1172
  GetMyCorrespondenceListDTO["WithRequestStepAttributes"] = true;
1001
1173
  GetMyCorrespondenceListDTO["WithRequestAttributes"] = true;
1002
- GetMyCorrespondenceListDTO["RequestStepStatus"] = "Active";
1174
+ GetMyCorrespondenceListDTO["RequestStepStatus"] = "InProcess";
1003
1175
  GetMyCorrespondenceListDTO["WithPreviousClosedRequestSteps"] = true;
1004
1176
 
1005
1177
  let APIResponse = await apiHandler.PostMethod(
@@ -1019,6 +1191,7 @@ export async function GetMyInboxCorrespondenceRequests(
1019
1191
  let ProcessFlow = [];
1020
1192
  let GeneratedDocument = "";
1021
1193
  let Attachments = [];
1194
+ let StepStatusName = element.StepStatusName;
1022
1195
  if (element.Request?.RequestAttributeList?.length > 0) {
1023
1196
  element.Request.RequestAttributeList.forEach((attribute) => {
1024
1197
  if (attribute.Alias === "Subject") {
@@ -1030,7 +1203,10 @@ export async function GetMyInboxCorrespondenceRequests(
1030
1203
  if (attribute.Alias === "InteractorImagePath") {
1031
1204
  ImagePath = attribute.Value;
1032
1205
  }
1033
- if (attribute.AttributeTypeValueTypeName === "Attachment" && !attribute.IsRequesterVisible) {
1206
+ if (
1207
+ attribute.AttributeTypeValueTypeName === "Attachment" &&
1208
+ !attribute.IsRequesterVisible
1209
+ ) {
1034
1210
  // if(attribute.Value && ReadSASResult?.Result)
1035
1211
  // {
1036
1212
  // GeneratedDocument = ReadSASResult.Result.split("?")[0] +
@@ -1039,30 +1215,31 @@ export async function GetMyInboxCorrespondenceRequests(
1039
1215
  // "?" +
1040
1216
  // ReadSASResult.Result.split("?")[1];
1041
1217
  // }
1042
- GeneratedDocument = attribute.Value;
1218
+ GeneratedDocument = attribute.Value;
1043
1219
  }
1044
- if(attribute.Alias === "Attachments" && !attribute.IsRequesterVisible)
1045
- {
1046
- if(attribute.Value)
1047
- {
1220
+ if (
1221
+ attribute.Alias === "Attachments" &&
1222
+ !attribute.IsRequesterVisible
1223
+ ) {
1224
+ if (attribute.Value) {
1048
1225
  let DecodedAttachmentsRecordList = decodeBase64ToJson(
1049
1226
  attribute.Value
1050
1227
  );
1051
1228
  for (let attributeGroup of DecodedAttachmentsRecordList) {
1052
1229
  for (let group of attributeGroup) {
1053
- for (let attribute of group.RequestAttributeDtos) {
1054
- if (
1055
- attribute.AttributeTypeValueTypeName === "Attachment"
1056
- ) {
1230
+ for (let attributeDTO of group.RequestAttributeDtos) {
1231
+ if (attributeDTO.AttributeTypeValueTypeName === "Attachment") {
1057
1232
  Attachments.push({
1058
- id: attribute.RequestAttributeId || 0,
1059
- name: attribute.Name || "",
1060
- type: attribute.Value?.split(".").pop() || "",
1061
- url: ReadSASResult?.Result? (ReadSASResult.Result.split("?")[0] +
1062
- "/" +
1063
- attribute.Value +
1064
- "?" +
1065
- ReadSASResult.Result.split("?")[1]): "",
1233
+ id: attributeDTO.RequestAttributeId || 0,
1234
+ name: attributeDTO.ExtendedValue || "",
1235
+ type: attributeDTO.Value?.split(".").pop() || "",
1236
+ url: ReadSASResult?.Result
1237
+ ? ReadSASResult.Result.split("?")[0] +
1238
+ "/" +
1239
+ attributeDTO.Value +
1240
+ "?" +
1241
+ ReadSASResult.Result.split("?")[1]
1242
+ : "",
1066
1243
  });
1067
1244
  }
1068
1245
  }
@@ -1107,6 +1284,7 @@ export async function GetMyInboxCorrespondenceRequests(
1107
1284
  });
1108
1285
  }
1109
1286
  MappedResult.push({
1287
+ Status: StepStatusName,
1110
1288
  RequestId: element.RequestId,
1111
1289
  StepId: element.RequestStepId,
1112
1290
  RequesterImagePath: ImagePath,
@@ -1179,7 +1357,10 @@ export async function GetStorageType(AuthToken = null, Timeout = 30000) {
1179
1357
  return 0;
1180
1358
  }
1181
1359
  }
1182
- export async function CreateCorrespondenceReadSAS(AuthToken = null, Timeout = 30000) {
1360
+ export async function CreateCorrespondenceReadSAS(
1361
+ AuthToken = null,
1362
+ Timeout = 30000
1363
+ ) {
1183
1364
  let StorageType = await GetStorageType(AuthToken, Timeout);
1184
1365
  if (StorageType === 0) {
1185
1366
  let APIResponse = await apiHandler.GetMethod(
@@ -1198,7 +1379,10 @@ export async function CreateCorrespondenceReadSAS(AuthToken = null, Timeout = 30
1198
1379
  }
1199
1380
  }
1200
1381
 
1201
- export async function CreateCorrespondenceWriteSAS(AuthToken = null, Timeout = 30000) {
1382
+ export async function CreateCorrespondenceWriteSAS(
1383
+ AuthToken = null,
1384
+ Timeout = 30000
1385
+ ) {
1202
1386
  let StorageType = await GetStorageType(AuthToken, Timeout);
1203
1387
  if (StorageType === 0) {
1204
1388
  let APIResponse = await apiHandler.GetMethod(
@@ -1216,3 +1400,82 @@ export async function CreateCorrespondenceWriteSAS(AuthToken = null, Timeout = 3
1216
1400
  return APIResponse;
1217
1401
  }
1218
1402
  }
1403
+
1404
+ /**
1405
+ * @description
1406
+ * Retrieves the app styles and custom keywords.
1407
+ *
1408
+ * @param {string} AuthToken
1409
+ * Authentication token for authorization purposes.
1410
+ *
1411
+ * @param {number} Timeout
1412
+ * Time in milliseconds to wait before the request times out. Default is 30000.
1413
+ *
1414
+ * @returns
1415
+ * An object containing the API response from the Get App Styles request,
1416
+ * including a success message, status code, and any additional data returned by the API.
1417
+ * {
1418
+ * Message: string,
1419
+ * StatusCode: number,
1420
+ * Result: {
1421
+ * ContainerColor: string,
1422
+ * ExtendedColor: string,
1423
+ * ExtendedTextColor: string,
1424
+ * HeaderColor: string,
1425
+ * PrimaryColor: string,
1426
+ * SecondaryColor: string,
1427
+ * SloganColor: string,
1428
+ * ThemeColor: string,
1429
+ * ThemeTextColor: string,
1430
+ * ThirdColor: string,
1431
+ * CustomKeywords: string[],
1432
+ * LogoImagePath: string
1433
+ * }
1434
+ * }
1435
+ */
1436
+ export async function GetAppStyles(
1437
+ AuthToken = null,
1438
+ Timeout = 30000,
1439
+ RequiredHeaderValue = null
1440
+ ) {
1441
+ let APIResponse = await apiHandler.GetMethod(
1442
+ TransactionsAPIConstants.uriGetStyle(),
1443
+ AuthToken,
1444
+ Timeout,
1445
+ RequiredHeaderValue
1446
+ );
1447
+ let CustomLabelResponse = await apiHandler.PostMethod(
1448
+ TransactionsAPIConstants.uriGetCompanyCustomLabelList(),
1449
+ {},
1450
+ AuthToken,
1451
+ Timeout,
1452
+ RequiredHeaderValue
1453
+ );
1454
+ let MappedResults = null;
1455
+ if (APIResponse.StatusCode === 200) {
1456
+ MappedResults = {
1457
+ ContainerColor: APIResponse.Result.ContainerColor,
1458
+ ExtendedColor: APIResponse.Result.ExtendedColor,
1459
+ ExtendedTextColor: APIResponse.Result.ExtendedTextColor,
1460
+ HeaderColor: APIResponse.Result.HeaderColor,
1461
+ PrimaryColor: APIResponse.Result.PrimaryColor,
1462
+ SecondaryColor: APIResponse.Result.SecondaryColor,
1463
+ SloganColor: APIResponse.Result.SloganColor,
1464
+ ThemeColor: APIResponse.Result.ThemeColor,
1465
+ ThemeTextColor: APIResponse.Result.ThemeTextColor,
1466
+ ThirdColor: APIResponse.Result.ThirdColor,
1467
+ };
1468
+ }
1469
+ if (CustomLabelResponse.StatusCode === 200) {
1470
+ MappedResults.CustomKeywords = CustomLabelResponse.Result;
1471
+ CustomLabelResponse.Result.find((element) => {
1472
+ if (element.Name === "AppLogo") {
1473
+ MappedResults.LogoImagePath = element.FullImagePath;
1474
+ }
1475
+ });
1476
+ }
1477
+ if (MappedResults) {
1478
+ APIResponse.Result = MappedResults;
1479
+ }
1480
+ return APIResponse;
1481
+ }
package/src/index.d.ts CHANGED
@@ -63,7 +63,7 @@ import { AgentMaintainInteractorOutput } from "./modals/output-modals/request-mo
63
63
  import { AgentSubmitCartInput } from "./modals/input-modals/request-modals/AgentSubmitCartInput";
64
64
  import { AgentGetInteractorRoleInput } from "./modals/input-modals/request-modals/AgentGetInteractorRoleInput";
65
65
  import { AIVisionCopyFileInput } from "./modals/input-modals/storage-modals/AIVisionCopyFileInput";
66
- import { RequesterAddRequestInput } from "./modals/input-modals/request-modals/RequesterAddRequestInput";
66
+ import { RequesterAddRequestInput, DynamicStepList } from "./modals/input-modals/request-modals/RequesterAddRequestInput";
67
67
  import { AddRequestOutput } from "./modals/output-modals/request-modals/AddRequestOutput";
68
68
  import { GetCommentListOutput } from "./modals/output-modals/request-modals/GetCommentListOutput";
69
69
  import { GetRequestCommentListInput } from "./modals/input-modals/request-modals/GetRequestCommentListInput";
@@ -270,6 +270,7 @@ import { MaintainAgentUnitInput } from "./modals/input-modals/transaction-catalo
270
270
  import { MaintainAgentInteractorInput } from "./modals/input-modals/transaction-catalog-modals/MaintainAgentInteractorInput";
271
271
  import { MaintainAgentInteractorOutput } from "./modals/output-modals/transaction-catalog-modals/MaintainAgentInteractorOutput";
272
272
  import { GetServiceManagementServiceListOutput } from "./modals/output-modals/request-modals/GetServiceManagementServiceListOutput";
273
+ import { GetAppStyles } from "./modals/output-modals/correspondence-modals/GetAppStyles";
273
274
  // Define each module with its specific functions
274
275
 
275
276
  interface AuthenticationServices {
@@ -6904,12 +6905,48 @@ interface CorrespondenceServices {
6904
6905
  * }
6905
6906
  * }
6906
6907
  */
6907
- GetInProcessCorrespondenceRequests: (
6908
+ GetSentCorrespondenceRequests: (
6908
6909
  Input: GetMyCorrespondenceListDTO,
6909
6910
  AuthToken?: string | null,
6910
6911
  Timeout?: number | null
6911
6912
  ) => BaseResponse<GetMyCorrespondenceOutput[] | BaseErrorResponse>;
6912
6913
 
6914
+ /**
6915
+ * @description
6916
+ * Retrieves the list of Correspondences for the current user.
6917
+ *
6918
+ * @param {object} getMyCorrespondenceListDTO
6919
+ * Data object containing fields necessary for retrieving the list of requests.
6920
+ * PageSize: number
6921
+ * PageIndex: number
6922
+ * IsAscendingOrder?: boolean (Optional)
6923
+ * FromFinishDate?: string (Optional)
6924
+ * ToFinishDate?: string (Optional)
6925
+ * FromStartDate?: string (Optional)
6926
+ * ToStartDate?: string (Optional)
6927
+ *
6928
+ * @param {string} AuthToken
6929
+ * Authentication token for authorization purposes.
6930
+ *
6931
+ * @param {number} Timeout
6932
+ * Time in milliseconds to wait before the request times out. Default is 30000.
6933
+ *
6934
+ * @returns
6935
+ * An object containing the response from the Get My Correspondence List request, including
6936
+ * success message, status code, and any additional data returned by the API.
6937
+ * {
6938
+ * Message: string,
6939
+ * StatusCode: number,
6940
+ * Result: {
6941
+ * -- request data based on selection criteria wether grouped or not--
6942
+ * }
6943
+ * }
6944
+ */
6945
+ GetCancelledCorrespondenceRequests: (
6946
+ Input: GetMyCorrespondenceListDTO,
6947
+ AuthToken?: string | null,
6948
+ Timeout?: number | null
6949
+ ) => BaseResponse<GetMyCorrespondenceOutput[] | BaseErrorResponse>;
6913
6950
  /**
6914
6951
  * @description
6915
6952
  * Retrieves the list of Correspondences for the current user.
@@ -7114,7 +7151,7 @@ interface CorrespondenceServices {
7114
7151
  * @param {string} AuthToken
7115
7152
  * Authentication token for authorization purposes.
7116
7153
  *
7117
- * @param {number} Timeout
7154
+ * @param {number} Timeout
7118
7155
  * Optional Timeout in milliseconds for the request.
7119
7156
  *
7120
7157
  * @returns
@@ -7153,6 +7190,30 @@ interface CorrespondenceServices {
7153
7190
  AuthToken?: string | null,
7154
7191
  Timeout?: number | null
7155
7192
  ) => BaseResponse<string | BaseErrorResponse>;
7193
+
7194
+ /**
7195
+ * @description
7196
+ * Retrieves the app styles and custom keywords.
7197
+ *
7198
+ * @param {string} AuthToken
7199
+ * Authentication token for authorization purposes.
7200
+ *
7201
+ * @param {number} Timeout
7202
+ * Optional Timeout in milliseconds for the request.
7203
+ *
7204
+ * @returns
7205
+ * An object containing the API response from the Get App Styles request,
7206
+ * including a success message, status code, and any additional data returned by the API.
7207
+ * {
7208
+ * Message: string,
7209
+ * StatusCode: number,
7210
+ * Result: GetAppStyles
7211
+ * }
7212
+ */
7213
+ GetAppStyles: (
7214
+ AuthToken?: string | null,
7215
+ Timeout?: number | null
7216
+ ) => BaseResponse<GetAppStyles | BaseErrorResponse>;
7156
7217
  }
7157
7218
  interface OctopianSDKConfig {
7158
7219
  /**
@@ -7454,5 +7515,7 @@ export {
7454
7515
  MaintainAgentUnitInput,
7455
7516
  MaintainAgentInteractorInput,
7456
7517
  MaintainAgentInteractorOutput,
7457
- GetServiceManagementServiceListOutput
7518
+ GetServiceManagementServiceListOutput,
7519
+ DynamicStepList,
7520
+ GetAppStyles
7458
7521
  };
package/src/index.js CHANGED
@@ -436,10 +436,12 @@ const {
436
436
  GetMyInboxCorrespondenceRequests,
437
437
  GetMyRejectedCorrespondenceRequests,
438
438
  GetMyInboxCategoryWithCounts,
439
- GetInProcessCorrespondenceRequests,
440
439
  CreateCorrespondenceReadSAS,
441
440
  CreateCorrespondenceWriteSAS,
442
441
  GetStorageType,
442
+ GetCancelledCorrespondenceRequests,
443
+ GetSentCorrespondenceRequests,
444
+ GetAppStyles
443
445
  } = require('./CoreServices/correspondenceServices')
444
446
 
445
447
  const CorrespondenceServices = {
@@ -452,10 +454,12 @@ const CorrespondenceServices = {
452
454
  GetMyInboxCorrespondenceRequests,
453
455
  GetMyRejectedCorrespondenceRequests,
454
456
  GetMyInboxCategoryWithCounts,
455
- GetInProcessCorrespondenceRequests,
456
457
  CreateCorrespondenceReadSAS,
457
458
  CreateCorrespondenceWriteSAS,
458
459
  GetStorageType,
460
+ GetCancelledCorrespondenceRequests,
461
+ GetSentCorrespondenceRequests,
462
+ GetAppStyles
459
463
  }
460
464
  //#region DarAlBer
461
465
  const {
@@ -9,8 +9,19 @@ export interface RequesterAddRequestInput {
9
9
  IsSync?: boolean
10
10
  ClientRequestAttributeDtos?: ClientRequestAttributeDto[]
11
11
  RequestLanguageCode?: string
12
+ DynamicStepList?: DynamicStepList[]
12
13
  }
13
14
 
15
+ export interface DynamicStepList {
16
+ StepTypeName: string
17
+ StepName: string
18
+ SequenceNo: number
19
+ ProviderRoleId: number
20
+ PrivilegeLevel?: number
21
+ UiviewAlias?: string
22
+ IsRequesterVisible: boolean
23
+ IsProviderVisible: boolean
24
+ }
14
25
  export interface ClientRequestAttributeDto {
15
26
  IsSystemGenerated: boolean
16
27
  DtoState: number
@@ -0,0 +1,14 @@
1
+ export interface GetAppStyles {
2
+ ContainerColor: string;
3
+ ExtendedColor: string;
4
+ ExtendedTextColor: string;
5
+ HeaderColor: string;
6
+ PrimaryColor: string;
7
+ SecondaryColor: string;
8
+ SloganColor: string;
9
+ ThemeColor: string;
10
+ ThemeTextColor: string;
11
+ ThirdColor: string;
12
+ CustomKeywords: string[];
13
+ LogoImagePath: string;
14
+ }
@@ -1,6 +1,7 @@
1
1
  export interface GetMyCorrespondenceOutput {
2
2
  RequestId: number
3
3
  StepId: number
4
+ Status: string
4
5
  RequesterImagePath: string
5
6
  RequesterName: string
6
7
  ToName: string