octopian-apis 1.0.56 → 1.0.58

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.56",
3
+ "version": "1.0.58",
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": {
@@ -920,14 +920,13 @@ export async function GetMyClosedCorrespondenceRequests(
920
920
  Timeout = 30000,
921
921
  RequiredHeaderValue = null
922
922
  ) {
923
- GetMyCorrespondenceListDTO["WithRequest"] = true;
924
- GetMyCorrespondenceListDTO["WithRequestStepAttributes"] = true;
925
- GetMyCorrespondenceListDTO["WithRequestAttributes"] = true;
926
- GetMyCorrespondenceListDTO["RequestStepStatus"] = "Archived";
927
- GetMyCorrespondenceListDTO["WithPreviousClosedRequestSteps"] = true;
923
+ GetMyCorrespondenceListDTO["RequestStatus"] = "Closed";
924
+ GetMyCorrespondenceListDTO["WithRequestStep"] = true;
925
+ GetMyCorrespondenceListDTO["WithRequestStepAttribute"] = true;
926
+ GetMyCorrespondenceListDTO["WithRequestAttribute"] = true;
928
927
 
929
928
  let APIResponse = await apiHandler.PostMethod(
930
- RequestStepsAPIConstants.uriGetMyRequestStepList(),
929
+ RequestsAPIConstants.uriGetMyRequestList(),
931
930
  GetMyCorrespondenceListDTO,
932
931
  AuthToken,
933
932
  Timeout,
@@ -937,15 +936,14 @@ export async function GetMyClosedCorrespondenceRequests(
937
936
  let ReadSASResult = await CreateReadSAS(AuthToken, Timeout);
938
937
  if (APIResponse.StatusCode === 200 && APIResponse.Result?.length > 0) {
939
938
  APIResponse.Result.forEach((element) => {
940
- let subject = element.Request.ServiceName;
939
+ let subject = element.ServiceName;
941
940
  let notes = "";
942
941
  let ImagePath = "";
943
- let ProcessFlow = [];
944
942
  let ToName = "";
945
943
  let GeneratedDocument = "";
946
944
  let Attachments = [];
947
- if (element.Request.RequestAttributeList?.length > 0) {
948
- element.Request.RequestAttributeList.forEach((attribute) => {
945
+ if (element.RequestAttributeList?.length > 0) {
946
+ element.RequestAttributeList.forEach((attribute) => {
949
947
  if (attribute.Alias === "Subject") {
950
948
  subject = attribute.Value;
951
949
  }
@@ -958,7 +956,7 @@ export async function GetMyClosedCorrespondenceRequests(
958
956
  if (attribute.Alias === "To") {
959
957
  ToName = attribute.Value;
960
958
  }
961
- if (attribute.Alias === element.Request.CustomField5 && attribute.Value) {
959
+ if (attribute.Alias === element.CustomField5 && attribute.Value) {
962
960
  GeneratedDocument = attribute.Value.includes('https') ? attribute.Value : (ReadSASResult?.Result
963
961
  ? ReadSASResult.Result.split("?")[0] +
964
962
  "/" +
@@ -967,30 +965,6 @@ export async function GetMyClosedCorrespondenceRequests(
967
965
  ReadSASResult.Result.split("?")[1]
968
966
  : "");
969
967
  }
970
- if (element.PreviousClosedRequestStepList?.length > 0) {
971
- let PreviousSteps = element.PreviousClosedRequestStepList.filter(
972
- (step) => step.IsNeutralEmotion
973
- );
974
- if (PreviousSteps.length > 0) {
975
- let PreviousStep = PreviousSteps.reduce((prev, current) =>
976
- +prev.RequestStepId > +current.RequestStepId ? prev : current
977
- );
978
-
979
- let PreviousStepDocumentAttachment =
980
- PreviousStep.RequestAttributeList.find(
981
- (PrevAttribute) => PrevAttribute.Alias === PreviousStep.ExtraLine1
982
- );
983
- if (PreviousStepDocumentAttachment && PreviousStepDocumentAttachment.Value) {
984
- GeneratedDocument =PreviousStepDocumentAttachment.Value.includes('https') ? PreviousStepDocumentAttachment.Value : (ReadSASResult?.Result
985
- ? ReadSASResult.Result.split("?")[0] +
986
- "/" +
987
- PreviousStepDocumentAttachment.Value +
988
- "?" +
989
- ReadSASResult.Result.split("?")[1]
990
- : "");
991
- }
992
- }
993
- }
994
968
  if (
995
969
  attribute.Alias === "Attachments" &&
996
970
  !attribute.IsRequesterVisible
@@ -1025,9 +999,6 @@ export async function GetMyClosedCorrespondenceRequests(
1025
999
  }
1026
1000
  });
1027
1001
  }
1028
- if (element.ProviderImagePath) {
1029
- ImagePath = element.ProviderImagePath;
1030
- }
1031
1002
  if (ImagePath && ReadSASResult.StatusCode === 200) {
1032
1003
  ImagePath =
1033
1004
  ReadSASResult.Result.split("?")[0] +
@@ -1036,45 +1007,19 @@ export async function GetMyClosedCorrespondenceRequests(
1036
1007
  "?" +
1037
1008
  ReadSASResult.Result.split("?")[1];
1038
1009
  }
1039
- if (element.PreviousClosedRequestStepList) {
1040
- element.PreviousClosedRequestStepList.forEach((step) => {
1041
- let ProviderImagePath = "";
1042
- if (step.ProviderImagePath) {
1043
- ProviderImagePath = step.ProviderImagePath;
1044
- }
1045
- if (ProviderImagePath && ReadSASResult.StatusCode === 200) {
1046
- ProviderImagePath =
1047
- ReadSASResult.Result.split("?")[0] +
1048
- "/" +
1049
- ProviderImagePath +
1050
- "?" +
1051
- ReadSASResult.Result.split("?")[1];
1052
- }
1053
- ProcessFlow.push({
1054
- Id: step.RequestStepId,
1055
- ImagePath: ProviderImagePath,
1056
- Name: step.ProviderName || step.ProviderRoleName,
1057
- Comment: step.ProviderComments,
1058
- SubmitDate: step.StartDate,
1059
- ParentRequestStepId: step.ParentRequestStepId || 0,
1060
- });
1061
- });
1062
- }
1063
1010
  MappedResult.push({
1064
1011
  RequestId: element.RequestId,
1065
- StepId: element.RequestStepId,
1012
+ StepId: 0,
1066
1013
  RequesterImagePath: ImagePath,
1067
- RequesterName: element.Request.InteractorName,
1014
+ RequesterName: element.InteractorName,
1068
1015
  ToName: ToName,
1069
- CategoryColor: element.Request.ExtraLine1
1070
- ? element.Request.ExtraLine1
1071
- : "#FB4C2F",
1072
- CategoryName: element.Request.ServiceSubCategoryName,
1073
- SubmitDate: element.StartDate,
1016
+ CategoryColor: element.ExtraLine1 ? element.ExtraLine1 : "#FB4C2F",
1017
+ CategoryName: element.ServiceSubCategoryName,
1018
+ SubmitDate: element.SubmitDate,
1074
1019
  Subject: subject,
1075
1020
  Notes: notes,
1076
1021
  IsRead: true,
1077
- ProcessFlow: ProcessFlow,
1022
+ ProcessFlow: [],
1078
1023
  GeneratedDocument: GeneratedDocument,
1079
1024
  Attachments: Attachments,
1080
1025
  });
@@ -4023,6 +4023,85 @@ export async function GetNotificationList(
4023
4023
  );
4024
4024
  return APIResponse;
4025
4025
  }
4026
+
4027
+ /**
4028
+ * @description
4029
+ * Updates a list of notifications.
4030
+ *
4031
+ * @param {object} UpdateNotificationListDTO
4032
+ * Data object containing fields necessary for updating the notification list.
4033
+ * --- notification data list---
4034
+ *
4035
+ * @param {string} AuthToken
4036
+ * Authentication token for authorization purposes.
4037
+ *
4038
+ * @param {number} Timeout
4039
+ * Time in milliseconds to wait before the request times out. Default is 30000.
4040
+ *
4041
+ * @param {string} RequiredHeaderValue
4042
+ * Value for any required header. Default is null.
4043
+ *
4044
+ * @returns
4045
+ * An object containing the response from the Update Notification List API,
4046
+ * including success message, status code, and any additional data returned by the API.
4047
+ * Message: Success,
4048
+ * StatusCode: 200,
4049
+ * Result: boolean,
4050
+ * HeaderValue: string
4051
+ */
4052
+ export async function UpdateNotificationList(
4053
+ UpdateNotificationListDTO,
4054
+ AuthToken = null,
4055
+ Timeout = 30000,
4056
+ RequiredHeaderValue = null
4057
+ ) {
4058
+ let APIResponse = await apiHandler.PostMethod(
4059
+ TransactionsAPIConstants.uriUpdateNotificationList(),
4060
+ UpdateNotificationListDTO,
4061
+ AuthToken,
4062
+ Timeout,
4063
+ RequiredHeaderValue
4064
+ );
4065
+ return APIResponse;
4066
+ }
4067
+
4068
+ /**
4069
+ * @description
4070
+ * Retrieves a list of step types.
4071
+ *
4072
+ * @param {string} AuthToken
4073
+ * Authentication token for authorization purposes.
4074
+ *
4075
+ * @param {number} Timeout
4076
+ * Time in milliseconds to wait before the request times out. Default is 30000.
4077
+ *
4078
+ * @param {string} RequiredHeaderValue
4079
+ * Value for any required header. Default is null.
4080
+ *
4081
+ * @returns
4082
+ * An object containing the response from the Get Step Type List API,
4083
+ * including success message, status code, and any additional data returned by the API.
4084
+ * Message: Success,
4085
+ * StatusCode: 200,
4086
+ * Result: [
4087
+ * --- step type data ---
4088
+ * ],
4089
+ * HeaderValue: string
4090
+ */
4091
+ export async function GetStepTypeList(
4092
+ AuthToken = null,
4093
+ Timeout = 30000,
4094
+ RequiredHeaderValue = null
4095
+ ) {
4096
+ let APIResponse = await apiHandler.PostMethod(
4097
+ TransactionsAPIConstants.uriGetStepTypeList(),
4098
+ null,
4099
+ AuthToken,
4100
+ Timeout,
4101
+ RequiredHeaderValue
4102
+ );
4103
+ return APIResponse;
4104
+ }
4026
4105
  //#endregion
4027
4106
 
4028
4107
  //#region Agent
package/src/index.d.ts CHANGED
@@ -272,6 +272,8 @@ import { MaintainAgentInteractorOutput } from "./modals/output-modals/transactio
272
272
  import { GetServiceManagementServiceListOutput } from "./modals/output-modals/request-modals/GetServiceManagementServiceListOutput";
273
273
  import { GetAppStyles } from "./modals/output-modals/correspondence-modals/GetAppStyles";
274
274
  import { NotificationListOutput } from "./modals/output-modals/transaction-catalog-modals/NotificationListOutput";
275
+ import { UpdateNotificationInput } from "./modals/input-modals/transaction-catalog-modals/UpdateNotificationInput";
276
+ import { GetStepTypeOutput } from "./modals/output-modals/transaction-catalog-modals/GetStepTypesOutput";
275
277
  // Define each module with its specific functions
276
278
 
277
279
  interface AuthenticationServices {
@@ -4148,6 +4150,66 @@ interface TransactionCommonServices {
4148
4150
  Timeout?: number | null,
4149
4151
  RequiredHeaderValue?: string
4150
4152
  ) => BaseResponse<NotificationListOutput[] | BaseErrorResponse>;
4153
+ /**
4154
+ * @description
4155
+ * Updates a list of notifications.
4156
+ *
4157
+ * @param {UpdateNotificationInput} UpdateNotificationListDTO
4158
+ * Data object containing fields necessary for updating the notification list.
4159
+ * --- notification data list---
4160
+ *
4161
+ * @param {string} AuthToken
4162
+ * Authentication token for authorization purposes.
4163
+ *
4164
+ * @param {number} Timeout
4165
+ * Time in milliseconds to wait before the request times out. Default is 30000.
4166
+ *
4167
+ * @param {string} RequiredHeaderValue
4168
+ * Value for any required header. Default is null.
4169
+ *
4170
+ * @returns
4171
+ * An object containing the response from the Update Notification List API,
4172
+ * including success message, status code, and any additional data returned by the API.
4173
+ * Message: Success,
4174
+ * StatusCode: 200,
4175
+ * Result: boolean,
4176
+ * HeaderValue: string
4177
+ */
4178
+ UpdateNotificationList: (
4179
+ Input: UpdateNotificationInput,
4180
+ AuthToken?: string | null,
4181
+ Timeout?: number | null,
4182
+ RequiredHeaderValue?: string
4183
+ ) => BaseResponse<boolean | BaseErrorResponse>;
4184
+
4185
+ /**
4186
+ * @description
4187
+ * Retrieves a list of step types.
4188
+ *
4189
+ * @param {string} AuthToken
4190
+ * Authentication token for authorization purposes.
4191
+ *
4192
+ * @param {number} Timeout
4193
+ * Time in milliseconds to wait before the request times out. Default is 30000.
4194
+ *
4195
+ * @param {string} RequiredHeaderValue
4196
+ * Value for any required header. Default is null.
4197
+ *
4198
+ * @returns
4199
+ * An object containing the response from the Get Step Type List API,
4200
+ * including success message, status code, and any additional data returned by the API.
4201
+ * Message: Success,
4202
+ * StatusCode: 200,
4203
+ * Result: [
4204
+ * --- step type data ---
4205
+ * ],
4206
+ * HeaderValue: string
4207
+ */
4208
+ GetStepTypeList: (
4209
+ AuthToken?: string | null,
4210
+ Timeout?: number | null,
4211
+ RequiredHeaderValue?: string
4212
+ ) => BaseResponse<GetStepTypeOutput[] | BaseErrorResponse>;
4151
4213
  }
4152
4214
 
4153
4215
  // Storage Services interface
@@ -7557,5 +7619,7 @@ export {
7557
7619
  DynamicStepList,
7558
7620
  GetAppStyles,
7559
7621
  GenerateStepDocumentInput,
7560
- NotificationListOutput
7622
+ NotificationListOutput,
7623
+ UpdateNotificationInput,
7624
+ GetStepTypeOutput
7561
7625
  };
package/src/index.js CHANGED
@@ -140,6 +140,8 @@ const {
140
140
  MaintainAgentUnitList,
141
141
  MaintainAgentInteractorList,
142
142
  GetNotificationList,
143
+ UpdateNotificationList,
144
+ GetStepTypeList,
143
145
  } = require("./CoreServices/transactionsServices");
144
146
  const TransactionRequesterServices = {
145
147
  GetCompanyLanguageList,
@@ -240,6 +242,8 @@ const TransactionCommonServices = {
240
242
  GetMyPersonalUnitMemberList,
241
243
  ConvertPersonalUnitMemberToRecord,
242
244
  GetNotificationList,
245
+ UpdateNotificationList,
246
+ GetStepTypeList,
243
247
  };
244
248
 
245
249
  const {
@@ -0,0 +1,4 @@
1
+ export interface UpdateNotificationInput {
2
+ RowKey: string;
3
+ PartitionKey: string;
4
+ }
@@ -0,0 +1,6 @@
1
+ export interface GetStepTypeOutput {
2
+ StepTypeId: number;
3
+ Name: string;
4
+ DtoState: number;
5
+ Translations: string;
6
+ }
@@ -387,6 +387,12 @@ export class TransactionsAPIConstants {
387
387
  static uriGetNotificationList(){
388
388
  return transactionCatalogURI + "/api/Notification/GetNotificationList";
389
389
  }
390
+ static uriUpdateNotificationList(){
391
+ return transactionCatalogURI + "/api/Notification/UpdateNotificationList";
392
+ }
393
+ static uriGetStepTypeList(){
394
+ return transactionCatalogURI + "/api/TransactionCommon/GetStepTypeList";
395
+ }
390
396
  //#endregion
391
397
 
392
398
  //#region Agent