octopian-apis 1.0.26 → 1.0.27

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/README.md CHANGED
@@ -73,7 +73,7 @@ OctopianSDKConfig.Init('Your-API-Key',"Domain-Name")
73
73
 
74
74
  ## 🎈 Usage <a name="usage"></a>
75
75
 
76
- For detailed usage and services available in this SDK download our [documentation](https://in4ma-my.sharepoint.com/:u:/g/personal/mohammad_saeed_in4ma_onmicrosoft_com/Ee62SmLnu0ZIpPVi-Yxji0MBOj4f3TuEp_1vci4T0hDo0g?e=Z3i67j)
76
+ For detailed usage and services available in this SDK download our [documentation](https://in4ma-my.sharepoint.com/:u:/g/personal/mohammad_saeed_in4ma_onmicrosoft_com/EWPwDObJewFFtGjI32P5dWcBGQIVoGblICedbwx-wxmszw?e=ECvvnt)
77
77
 
78
78
  ```typescript
79
79
  import {AuthenticationServices} from 'octopian-apis';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "octopian-apis",
3
- "version": "1.0.26",
3
+ "version": "1.0.27",
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": {
@@ -170,3 +170,58 @@ export async function UploadAttachments(
170
170
  return attachmentsResponse;
171
171
  } else return writeSASResponse;
172
172
  }
173
+ /**
174
+ * @description
175
+ * Generates a Shared Access Signature (SAS) for reading from the storage.
176
+ *
177
+ * @param {string} AuthToken
178
+ * Authentication token for authorization purposes.
179
+ *
180
+ * @param {number} Timeout
181
+ * Optional timeout in milliseconds for the request.
182
+ *
183
+ * @returns
184
+ * An object containing the generated read SAS, including
185
+ * success message, status code, and any additional data returned by the API.
186
+ * {
187
+ * Message: Success,
188
+ * StatusCode: 200,
189
+ * Result: string
190
+ * }
191
+ */
192
+ export async function GetOnPremiseReadSAS(AuthToken = null, Timeout = 30000) {
193
+ let APIResponse = await apiHandler.GetMethod(
194
+ StorageAPIConstants.uriGetOnPremiseReadSAS(),
195
+ AuthToken,
196
+ Timeout
197
+ );
198
+ return APIResponse;
199
+ }
200
+ /**
201
+ * @description
202
+ * Generates a Shared Access Signature (SAS) for writing to the storage.
203
+ *
204
+ * @param {string} AuthToken
205
+ * Authentication token for authorization purposes.
206
+ *
207
+ * @param {number} Timeout
208
+ * Optional timeout in milliseconds for the request.
209
+ *
210
+ * @returns
211
+ * An object containing the generated write SAS, including
212
+ * success message, status code, and any additional data returned by the API.
213
+ * {
214
+ * Message: Success,
215
+ * StatusCode: 200,
216
+ * Result: string
217
+ * }
218
+ */
219
+ export async function GetOnPremiseWriteSAS(AuthToken = null, Timeout = 30000) {
220
+ let APIResponse = await apiHandler.GetMethod(
221
+ StorageAPIConstants.uriGetOnPremiseWriteSAS(),
222
+ AuthToken,
223
+ Timeout
224
+ );
225
+ return APIResponse;
226
+ }
227
+
@@ -4096,6 +4096,47 @@ export async function GetAssignbleRoleList(
4096
4096
  );
4097
4097
  return APIResponse;
4098
4098
  }
4099
+ /**
4100
+ * @description
4101
+ * Generates a document based on the provided input data.
4102
+ *
4103
+ * @param {object} GenerateDocumentInput
4104
+ * Data object containing fields necessary for generating the document.
4105
+ * ServiceId: number
4106
+ * TemplateAttributeAlias: string
4107
+ * ClientRequestAttributes: ClientRequestAttribute[]
4108
+ *
4109
+ * @param {string} AuthToken
4110
+ * Authentication token for authorization purposes.
4111
+ *
4112
+ * @param {number} Timeout
4113
+ * Time in milliseconds to wait before the request times out. Default is 30000.
4114
+ *
4115
+ * @param {string} RequiredHeaderValue
4116
+ * Value for any required header. Default is null.
4117
+ *
4118
+ * @returns
4119
+ * An object containing the response from the Generate Document API,
4120
+ * including success message, status code, and any additional data returned by the API.
4121
+ * Message: Success,
4122
+ * StatusCode: 200,
4123
+ * Result: string (document id)
4124
+ */
4125
+ export async function GenerateDocument(
4126
+ GenerateDocumentInput,
4127
+ AuthToken = null,
4128
+ Timeout = 30000,
4129
+ RequiredHeaderValue = null
4130
+ ) {
4131
+ let APIResponse = await apiHandler.PostMethod(
4132
+ TransactionsAPIConstants.uriGenerateDocument(),
4133
+ GenerateDocumentInput,
4134
+ AuthToken,
4135
+ Timeout,
4136
+ RequiredHeaderValue
4137
+ );
4138
+ return APIResponse;
4139
+ }
4099
4140
  //#endregion
4100
4141
 
4101
4142
  //#region Provider
package/src/index.d.ts CHANGED
@@ -256,6 +256,7 @@ import {
256
256
  } from "./modals/output-modals/transaction-catalog-modals/PaymentInvoiceOutput";
257
257
  import { GetMyCorrespondenceListDTO } from "./modals/input-modals/correspondence-modals/GetMyCorrespondenceListDTO";
258
258
  import { CorrespondenceSubmitDraftInput } from "./modals/input-modals/correspondence-modals/CorrespondenceSubmitDraftInput";
259
+ import { GenerateDocumentInput } from "./modals/input-modals/transaction-catalog-modals/GenerateDocumentInput";
259
260
  // Define each module with its specific functions
260
261
 
261
262
  interface AuthenticationServices {
@@ -3628,6 +3629,34 @@ interface TransactionCommonServices {
3628
3629
  Timeout?: number | null,
3629
3630
  RequiredHeaderValue?: string
3630
3631
  ) => BaseResponse<DocumentRecordTemplateOutput[] | BaseErrorResponse>;
3632
+
3633
+ /**
3634
+ * @description
3635
+ * Generates a document using the provided data object.
3636
+ *
3637
+ * @param {GenerateDocumentInput} GenerateDocumentDTO
3638
+ * Data object containing fields necessary for generating a document.
3639
+ *
3640
+ * @param {string} AuthToken
3641
+ * Authentication token for authorization purposes.
3642
+ *
3643
+ * @param {number} Timeout
3644
+ * Time in milliseconds to wait before the request times out. Default is 30000.
3645
+ *
3646
+ * @returns
3647
+ * An object containing the response from the Generate Document API,
3648
+ * including success message, status code, and any additional data returned by the API.
3649
+ * Message: Success,
3650
+ * StatusCode: 200,
3651
+ * Result: string (document id)
3652
+ * HeaderValue: string
3653
+ */
3654
+ GenerateDocument: (
3655
+ Input: GenerateDocumentInput,
3656
+ AuthToken?: string | null,
3657
+ Timeout?: number | null,
3658
+ RequiredHeaderValue?: string
3659
+ ) => BaseResponse<string | BaseErrorResponse>;
3631
3660
  }
3632
3661
 
3633
3662
  // Storage Services interface
@@ -3757,6 +3786,54 @@ interface StorageServices {
3757
3786
  AuthToken?: string | null,
3758
3787
  Timeout?: number | null
3759
3788
  ) => BaseResponse<boolean | BaseErrorResponse>;
3789
+
3790
+ /**
3791
+ * @description
3792
+ * Generates a Shared Access Signature (SAS) for reading from the storage.
3793
+ *
3794
+ * @param {string} AuthToken
3795
+ * Authentication token for authorization purposes.
3796
+ *
3797
+ * @param {number} Timeout
3798
+ * Optional Timeout in milliseconds for the request.
3799
+ *
3800
+ * @returns
3801
+ * An object containing the generated read SAS, including
3802
+ * success message, status code, and any additional data returned by the API.
3803
+ * {
3804
+ * Message: Success,
3805
+ * StatusCode: 200,
3806
+ * Result: string
3807
+ * }
3808
+ */
3809
+ GetOnPremiseReadSAS: (
3810
+ AuthToken?: string | null,
3811
+ Timeout?: number | null
3812
+ ) => BaseResponse<string | BaseErrorResponse>;
3813
+
3814
+ /**
3815
+ * @description
3816
+ * Generates a Shared Access Signature (SAS) for writing to the storage.
3817
+ *
3818
+ * @param {string} AuthToken
3819
+ * Authentication token for authorization purposes.
3820
+ *
3821
+ * @param {number} Timeout
3822
+ * Optional Timeout in milliseconds for the request.
3823
+ *
3824
+ * @returns
3825
+ * An object containing the generated write SAS, including
3826
+ * success message, status code, and any additional data returned by the API.
3827
+ * {
3828
+ * Message: Success,
3829
+ * StatusCode: 200,
3830
+ * Result: string
3831
+ * }
3832
+ */
3833
+ GetOnPremiseWriteSAS: (
3834
+ AuthToken?: string | null,
3835
+ Timeout?: number | null
3836
+ ) => BaseResponse<string | BaseErrorResponse>;
3760
3837
  }
3761
3838
 
3762
3839
  // Requests Agent Services interface
@@ -6447,6 +6524,7 @@ export {
6447
6524
  RequestsDispatchServices,
6448
6525
  TaxiServices,
6449
6526
  CorrespondenceServices,
6527
+ GenerateDocumentInput,
6450
6528
  ChangeAccountPasswordInput,
6451
6529
  ExecuteServiceSelectorListIntegrationInput,
6452
6530
  DomainAvailableInput,
package/src/index.js CHANGED
@@ -123,6 +123,7 @@ const {
123
123
  GetInvoiceDetails,
124
124
  ValidateAttributesWithIntegration,
125
125
  GetPaymentBatch,
126
+ GenerateDocument
126
127
  } = require("./CoreServices/transactionsServices");
127
128
  const TransactionRequesterServices = {
128
129
  GetCompanyLanguageList,
@@ -206,6 +207,7 @@ const TransactionCommonServices = {
206
207
  MaintainInteractorRoleDelegationList,
207
208
  GetDocumentRecordTemplate,
208
209
  GetCompanyCustomLabelList,
210
+ GenerateDocument
209
211
  };
210
212
 
211
213
  const {
@@ -213,14 +215,18 @@ const {
213
215
  CreateWriteSAS,
214
216
  DeleteFile,
215
217
  UploadAttachments,
216
- AIVisionCopyFile
218
+ AIVisionCopyFile,
219
+ GetOnPremiseReadSAS,
220
+ GetOnPremiseWriteSAS
217
221
  } = require("./CoreServices/storageServices");
218
222
  const StorageServices = {
219
223
  CreateReadSAS,
220
224
  CreateWriteSAS,
221
225
  DeleteFile,
222
226
  UploadAttachments,
223
- AIVisionCopyFile
227
+ AIVisionCopyFile,
228
+ GetOnPremiseReadSAS,
229
+ GetOnPremiseWriteSAS
224
230
  };
225
231
 
226
232
  const {
@@ -0,0 +1,16 @@
1
+ export interface GenerateDocumentInput {
2
+ serviceId: number
3
+ templateAttributeAlias: string
4
+ clientRequestAttributes: ClientRequestAttribute[]
5
+ }
6
+
7
+ export interface ClientRequestAttribute {
8
+ RequestAttributeId: number
9
+ Name: string
10
+ Value: string
11
+ AttributeGroupId: number
12
+ SourceServiceAttributeId: number
13
+ ExtendedValue: string
14
+ Alias: string
15
+ }
16
+
@@ -360,6 +360,9 @@ export class TransactionsAPIConstants {
360
360
  transactionCatalogURI + "/api/TransactionCommon/GetDocumentRecordTemplate"
361
361
  );
362
362
  }
363
+ static uriGenerateDocument() {
364
+ return transactionCatalogURI + "/api/TransactionCommon/GenerateDocument";
365
+ }
363
366
  //#endregion
364
367
 
365
368
  //#region Agent
@@ -633,6 +636,12 @@ export class StorageAPIConstants {
633
636
  static uriAIVisionCopyFile() {
634
637
  return storageURI + "/api/AIVision/CopyFile";
635
638
  }
639
+ static uriGetOnPremiseReadSAS() {
640
+ return storageURI + "/api/OnPremStorage/GenerateDownloadSas";
641
+ }
642
+ static uriGetOnPremiseWriteSAS() {
643
+ return storageURI + "/api/OnPremStorage/GenerateUploadSas";
644
+ }
636
645
  }
637
646
 
638
647
  export class TaxiAPIConstants {