@hlmr/sdk-js 1.5.7 → 1.6.1

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.
Files changed (45) hide show
  1. package/dist/cjs/client/HlmrClient.d.ts +2 -0
  2. package/dist/cjs/client/HlmrClient.d.ts.map +1 -1
  3. package/dist/cjs/client/HlmrClient.js +2 -0
  4. package/dist/cjs/client/HlmrClient.js.map +1 -1
  5. package/dist/cjs/index.d.ts +2 -0
  6. package/dist/cjs/index.d.ts.map +1 -1
  7. package/dist/cjs/index.js +3 -1
  8. package/dist/cjs/index.js.map +1 -1
  9. package/dist/cjs/modules/terms.d.ts +17 -0
  10. package/dist/cjs/modules/terms.d.ts.map +1 -0
  11. package/dist/cjs/modules/terms.js +72 -0
  12. package/dist/cjs/modules/terms.js.map +1 -0
  13. package/dist/cjs/types/terms.d.ts +175 -0
  14. package/dist/cjs/types/terms.d.ts.map +1 -0
  15. package/dist/cjs/types/terms.js +3 -0
  16. package/dist/cjs/types/terms.js.map +1 -0
  17. package/dist/esm/client/HlmrClient.d.ts +2 -0
  18. package/dist/esm/client/HlmrClient.d.ts.map +1 -1
  19. package/dist/esm/client/HlmrClient.js +2 -0
  20. package/dist/esm/client/HlmrClient.js.map +1 -1
  21. package/dist/esm/index.d.ts +2 -0
  22. package/dist/esm/index.d.ts.map +1 -1
  23. package/dist/esm/index.js +1 -0
  24. package/dist/esm/index.js.map +1 -1
  25. package/dist/esm/modules/terms.d.ts +17 -0
  26. package/dist/esm/modules/terms.d.ts.map +1 -0
  27. package/dist/esm/modules/terms.js +68 -0
  28. package/dist/esm/modules/terms.js.map +1 -0
  29. package/dist/esm/types/terms.d.ts +175 -0
  30. package/dist/esm/types/terms.d.ts.map +1 -0
  31. package/dist/esm/types/terms.js +2 -0
  32. package/dist/esm/types/terms.js.map +1 -0
  33. package/dist/types/client/HlmrClient.d.ts +2 -0
  34. package/dist/types/client/HlmrClient.d.ts.map +1 -1
  35. package/dist/types/index.d.ts +2 -0
  36. package/dist/types/index.d.ts.map +1 -1
  37. package/dist/types/modules/terms.d.ts +17 -0
  38. package/dist/types/modules/terms.d.ts.map +1 -0
  39. package/dist/types/types/terms.d.ts +175 -0
  40. package/dist/types/types/terms.d.ts.map +1 -0
  41. package/dist/umd/hlmr-sdk.js +84 -14
  42. package/dist/umd/hlmr-sdk.js.map +1 -1
  43. package/dist/umd/hlmr-sdk.min.js +1 -1
  44. package/dist/umd/hlmr-sdk.min.js.map +1 -1
  45. package/package.json +1 -1
@@ -876,13 +876,13 @@
876
876
  this.http = http;
877
877
  }
878
878
  async listOffers(params) {
879
- const query = buildQueryString$3(params);
879
+ const query = buildQueryString$4(params);
880
880
  const path = query ? `offers/public/offers?${query}` : 'offers/public/offers';
881
881
  const response = await this.http.get(path, { skipAuth: true });
882
882
  return response.data;
883
883
  }
884
884
  async searchOffers(params) {
885
- const query = buildQueryString$3(params);
885
+ const query = buildQueryString$4(params);
886
886
  const path = query ? `offers/public/offers/search?${query}` : 'offers/public/offers/search';
887
887
  const response = await this.http.get(path, { skipAuth: true });
888
888
  return response.data;
@@ -892,19 +892,19 @@
892
892
  return response.data;
893
893
  }
894
894
  async listDestinations(params) {
895
- const query = buildQueryString$3(params);
895
+ const query = buildQueryString$4(params);
896
896
  const path = query ? `geo/public/destinations?${query}` : 'geo/public/destinations';
897
897
  const response = await this.http.get(path, { skipAuth: true });
898
898
  return response.data;
899
899
  }
900
900
  async listCities(params) {
901
- const query = buildQueryString$3(params);
901
+ const query = buildQueryString$4(params);
902
902
  const path = query ? `geo/public/cities?${query}` : 'geo/public/cities';
903
903
  const response = await this.http.get(path, { skipAuth: true });
904
904
  return response.data;
905
905
  }
906
906
  async listDocuments(params) {
907
- const query = buildQueryString$3(params);
907
+ const query = buildQueryString$4(params);
908
908
  const path = query ? `terms/public/documents?${query}` : 'terms/public/documents';
909
909
  const response = await this.http.get(path, { skipAuth: true });
910
910
  return response.data;
@@ -914,7 +914,7 @@
914
914
  return response.data;
915
915
  }
916
916
  }
917
- function buildQueryString$3(params) {
917
+ function buildQueryString$4(params) {
918
918
  if (!params)
919
919
  return '';
920
920
  const searchParams = new URLSearchParams();
@@ -931,13 +931,13 @@
931
931
  this.http = http;
932
932
  }
933
933
  async list(params) {
934
- const query = buildQueryString$2(params);
934
+ const query = buildQueryString$3(params);
935
935
  const path = query ? `offers/offers?${query}` : 'offers/offers';
936
936
  const response = await this.http.get(path);
937
937
  return response.data;
938
938
  }
939
939
  }
940
- function buildQueryString$2(params) {
940
+ function buildQueryString$3(params) {
941
941
  if (!params)
942
942
  return '';
943
943
  const searchParams = new URLSearchParams();
@@ -984,7 +984,7 @@
984
984
  return response.data.requirement;
985
985
  }
986
986
  async list(params) {
987
- const query = buildQueryString$1(params);
987
+ const query = buildQueryString$2(params);
988
988
  const path = query ? `booking/bookings?${query}` : 'booking/bookings';
989
989
  const response = await this.http.get(path);
990
990
  return response.data;
@@ -1050,7 +1050,7 @@
1050
1050
  return response.data.booking;
1051
1051
  }
1052
1052
  }
1053
- function buildQueryString$1(params) {
1053
+ function buildQueryString$2(params) {
1054
1054
  if (!params)
1055
1055
  return '';
1056
1056
  const searchParams = new URLSearchParams();
@@ -1067,7 +1067,7 @@
1067
1067
  this.http = http;
1068
1068
  }
1069
1069
  async getWallets(params) {
1070
- const query = buildQueryString(params);
1070
+ const query = buildQueryString$1(params);
1071
1071
  const path = query ? `ledger/wallets?${query}` : 'ledger/wallets';
1072
1072
  const response = await this.http.get(path);
1073
1073
  return response.data;
@@ -1077,7 +1077,7 @@
1077
1077
  return response.data.wallet;
1078
1078
  }
1079
1079
  async getBalanceHistory(walletId, params) {
1080
- const query = buildQueryString(params);
1080
+ const query = buildQueryString$1(params);
1081
1081
  const path = query
1082
1082
  ? `ledger/wallets/${walletId}/balance-history?${query}`
1083
1083
  : `ledger/wallets/${walletId}/balance-history`;
@@ -1085,7 +1085,7 @@
1085
1085
  return response.data;
1086
1086
  }
1087
1087
  async getTransactions(params) {
1088
- const query = buildQueryString(params);
1088
+ const query = buildQueryString$1(params);
1089
1089
  const path = query ? `ledger/transactions?${query}` : 'ledger/transactions';
1090
1090
  const response = await this.http.get(path);
1091
1091
  return response.data;
@@ -1095,7 +1095,7 @@
1095
1095
  return response.data.transaction;
1096
1096
  }
1097
1097
  }
1098
- function buildQueryString(params) {
1098
+ function buildQueryString$1(params) {
1099
1099
  if (!params)
1100
1100
  return '';
1101
1101
  const searchParams = new URLSearchParams();
@@ -1150,6 +1150,74 @@
1150
1150
  }
1151
1151
  }
1152
1152
 
1153
+ const DOCS = 'terms/documents';
1154
+ const SIGS = 'terms/signatures';
1155
+ class TermsModule {
1156
+ constructor(http) {
1157
+ this.http = http;
1158
+ }
1159
+ async getDocument(documentId) {
1160
+ const response = await this.http.get(`${DOCS}/${documentId}`);
1161
+ return response.data.document;
1162
+ }
1163
+ async getDocumentByGroup(groupId, lang) {
1164
+ const query = lang ? `?lang=${lang}` : '';
1165
+ const response = await this.http.get(`${DOCS}/by-group/${groupId}${query}`);
1166
+ return response.data;
1167
+ }
1168
+ async getDiffSummary(documentId, fromVersionId, lang) {
1169
+ const params = new URLSearchParams({ from_version_id: fromVersionId });
1170
+ if (lang)
1171
+ params.append('lang', lang);
1172
+ const response = await this.http.get(`${DOCS}/${documentId}/diff-summary?${params}`);
1173
+ return response.data;
1174
+ }
1175
+ async sign(params) {
1176
+ const response = await this.http.post(SIGS, params);
1177
+ return response.data.signature;
1178
+ }
1179
+ async listSignatures(params) {
1180
+ const query = buildQueryString(params);
1181
+ const path = query ? `${SIGS}?${query}` : SIGS;
1182
+ const response = await this.http.get(path);
1183
+ return response.data;
1184
+ }
1185
+ async getSignature(signatureId) {
1186
+ const response = await this.http.get(`${SIGS}/${signatureId}`);
1187
+ return response.data.signature;
1188
+ }
1189
+ async getPendingDocuments(params) {
1190
+ const query = buildQueryString(params);
1191
+ const path = query ? `${SIGS}/pending?${query}` : `${SIGS}/pending`;
1192
+ const response = await this.http.get(path);
1193
+ return response.data;
1194
+ }
1195
+ async getCompliance(geoZone) {
1196
+ const query = geoZone ? `?geo_zone=${geoZone}` : '';
1197
+ const response = await this.http.get(`${SIGS}/compliance${query}`);
1198
+ return response.data;
1199
+ }
1200
+ async checkSignature(documentId) {
1201
+ const response = await this.http.get(`${SIGS}/check/${documentId}`);
1202
+ return response.data;
1203
+ }
1204
+ async getDocumentSignatureHistory(documentId) {
1205
+ const response = await this.http.get(`${SIGS}/document/${documentId}/history`);
1206
+ return response.data;
1207
+ }
1208
+ }
1209
+ function buildQueryString(params) {
1210
+ if (!params)
1211
+ return '';
1212
+ const searchParams = new URLSearchParams();
1213
+ for (const [key, value] of Object.entries(params)) {
1214
+ if (value !== undefined && value !== null) {
1215
+ searchParams.append(key, String(value));
1216
+ }
1217
+ }
1218
+ return searchParams.toString();
1219
+ }
1220
+
1153
1221
  class HlmrClient {
1154
1222
  constructor(options) {
1155
1223
  const config = this.buildConfig(options);
@@ -1165,6 +1233,7 @@
1165
1233
  this.booking = new BookingModule(this.httpClient);
1166
1234
  this.ledger = new LedgerModule(this.httpClient);
1167
1235
  this.payment = new PaymentModule(this.httpClient);
1236
+ this.terms = new TermsModule(this.httpClient);
1168
1237
  }
1169
1238
  buildConfig(options) {
1170
1239
  var _a, _b, _c;
@@ -14638,6 +14707,7 @@
14638
14707
  exports.PublicModule = PublicModule;
14639
14708
  exports.SDK_NAME = SDK_NAME;
14640
14709
  exports.SDK_VERSION = SDK_VERSION;
14710
+ exports.TermsModule = TermsModule;
14641
14711
  exports.clearAllCache = clearAllCache;
14642
14712
  exports.getSupabaseClient = getSupabaseClient;
14643
14713
  exports.getSupabaseClientConfig = getSupabaseClientConfig;