@triveria/wallet 0.0.49 → 0.0.50

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 (3) hide show
  1. package/api.d.ts +59 -15
  2. package/api.js +87 -25
  3. package/package.json +1 -1
package/api.d.ts CHANGED
@@ -1062,11 +1062,13 @@ export interface Wallet {
1062
1062
  */
1063
1063
  'name': string;
1064
1064
  /**
1065
- *
1066
- * @type {boolean}
1065
+ * Wallet metadata is a key value container for any custom data a client may want
1066
+ * @type {{ [key: string]: any; }}
1067
1067
  * @memberof Wallet
1068
1068
  */
1069
- 'canSign': boolean;
1069
+ 'metadata'?: {
1070
+ [key: string]: any;
1071
+ };
1070
1072
  /**
1071
1073
  *
1072
1074
  * @type {WalletConfig}
@@ -1093,6 +1095,19 @@ export interface WalletConfig {
1093
1095
  */
1094
1096
  'credentialVerifiers'?: Array<CredentialVerifierDefinition>;
1095
1097
  }
1098
+ /**
1099
+ *
1100
+ * @export
1101
+ * @interface WalletIdObject
1102
+ */
1103
+ export interface WalletIdObject {
1104
+ /**
1105
+ *
1106
+ * @type {string}
1107
+ * @memberof WalletIdObject
1108
+ */
1109
+ 'id': string;
1110
+ }
1096
1111
  /**
1097
1112
  *
1098
1113
  * @export
@@ -1318,6 +1333,13 @@ export declare const DefaultApiAxiosParamCreator: (configuration?: Configuration
1318
1333
  * @throws {RequiredError}
1319
1334
  */
1320
1335
  onboardLegalEntity: (walletId: string, options?: RawAxiosRequestConfig) => Promise<RequestArgs>;
1336
+ /**
1337
+ * The call will authenticate the client and create a new wallet that will be accessible only to the client.
1338
+ * @param {Wallet} [wallet]
1339
+ * @param {*} [options] Override http request option.
1340
+ * @throws {RequiredError}
1341
+ */
1342
+ walletCreate: (wallet?: Wallet, options?: RawAxiosRequestConfig) => Promise<RequestArgs>;
1321
1343
  /**
1322
1344
  * Provides wallet details
1323
1345
  * @param {string} walletId
@@ -1339,13 +1361,13 @@ export declare const DefaultApiAxiosParamCreator: (configuration?: Configuration
1339
1361
  */
1340
1362
  walletNotifications: (walletId: string, options?: RawAxiosRequestConfig) => Promise<RequestArgs>;
1341
1363
  /**
1342
- * The first call will authenticate the client and create a new wallet that will be accessible only to the client. Any further calls are meant to update the wallet configuration. Be careful when changing the configuration as it may result in the wallet malfunction.
1343
- * @param {string} [walletId] Has to be provided for updates.
1364
+ * Update wallet metadata and configuration.
1365
+ * @param {string} walletId
1344
1366
  * @param {Wallet} [wallet]
1345
1367
  * @param {*} [options] Override http request option.
1346
1368
  * @throws {RequiredError}
1347
1369
  */
1348
- walletSave: (walletId?: string, wallet?: Wallet, options?: RawAxiosRequestConfig) => Promise<RequestArgs>;
1370
+ walletPatch: (walletId: string, wallet?: Wallet, options?: RawAxiosRequestConfig) => Promise<RequestArgs>;
1349
1371
  };
1350
1372
  /**
1351
1373
  * DefaultApi - functional programming interface
@@ -1531,6 +1553,13 @@ export declare const DefaultApiFp: (configuration?: Configuration) => {
1531
1553
  * @throws {RequiredError}
1532
1554
  */
1533
1555
  onboardLegalEntity(walletId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<string>>;
1556
+ /**
1557
+ * The call will authenticate the client and create a new wallet that will be accessible only to the client.
1558
+ * @param {Wallet} [wallet]
1559
+ * @param {*} [options] Override http request option.
1560
+ * @throws {RequiredError}
1561
+ */
1562
+ walletCreate(wallet?: Wallet, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<WalletIdObject>>;
1534
1563
  /**
1535
1564
  * Provides wallet details
1536
1565
  * @param {string} walletId
@@ -1552,13 +1581,13 @@ export declare const DefaultApiFp: (configuration?: Configuration) => {
1552
1581
  */
1553
1582
  walletNotifications(walletId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Array<WalletNotification>>>;
1554
1583
  /**
1555
- * The first call will authenticate the client and create a new wallet that will be accessible only to the client. Any further calls are meant to update the wallet configuration. Be careful when changing the configuration as it may result in the wallet malfunction.
1556
- * @param {string} [walletId] Has to be provided for updates.
1584
+ * Update wallet metadata and configuration.
1585
+ * @param {string} walletId
1557
1586
  * @param {Wallet} [wallet]
1558
1587
  * @param {*} [options] Override http request option.
1559
1588
  * @throws {RequiredError}
1560
1589
  */
1561
- walletSave(walletId?: string, wallet?: Wallet, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Wallet>>;
1590
+ walletPatch(walletId: string, wallet?: Wallet, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<WalletIdObject>>;
1562
1591
  };
1563
1592
  /**
1564
1593
  * DefaultApi - factory interface
@@ -1744,6 +1773,13 @@ export declare const DefaultApiFactory: (configuration?: Configuration, basePath
1744
1773
  * @throws {RequiredError}
1745
1774
  */
1746
1775
  onboardLegalEntity(walletId: string, options?: any): AxiosPromise<string>;
1776
+ /**
1777
+ * The call will authenticate the client and create a new wallet that will be accessible only to the client.
1778
+ * @param {Wallet} [wallet]
1779
+ * @param {*} [options] Override http request option.
1780
+ * @throws {RequiredError}
1781
+ */
1782
+ walletCreate(wallet?: Wallet, options?: any): AxiosPromise<WalletIdObject>;
1747
1783
  /**
1748
1784
  * Provides wallet details
1749
1785
  * @param {string} walletId
@@ -1765,13 +1801,13 @@ export declare const DefaultApiFactory: (configuration?: Configuration, basePath
1765
1801
  */
1766
1802
  walletNotifications(walletId: string, options?: any): AxiosPromise<Array<WalletNotification>>;
1767
1803
  /**
1768
- * The first call will authenticate the client and create a new wallet that will be accessible only to the client. Any further calls are meant to update the wallet configuration. Be careful when changing the configuration as it may result in the wallet malfunction.
1769
- * @param {string} [walletId] Has to be provided for updates.
1804
+ * Update wallet metadata and configuration.
1805
+ * @param {string} walletId
1770
1806
  * @param {Wallet} [wallet]
1771
1807
  * @param {*} [options] Override http request option.
1772
1808
  * @throws {RequiredError}
1773
1809
  */
1774
- walletSave(walletId?: string, wallet?: Wallet, options?: any): AxiosPromise<Wallet>;
1810
+ walletPatch(walletId: string, wallet?: Wallet, options?: any): AxiosPromise<WalletIdObject>;
1775
1811
  };
1776
1812
  /**
1777
1813
  * DefaultApi - object-oriented interface
@@ -1982,6 +2018,14 @@ export declare class DefaultApi extends BaseAPI {
1982
2018
  * @memberof DefaultApi
1983
2019
  */
1984
2020
  onboardLegalEntity(walletId: string, options?: RawAxiosRequestConfig): Promise<import("axios").AxiosResponse<string, any>>;
2021
+ /**
2022
+ * The call will authenticate the client and create a new wallet that will be accessible only to the client.
2023
+ * @param {Wallet} [wallet]
2024
+ * @param {*} [options] Override http request option.
2025
+ * @throws {RequiredError}
2026
+ * @memberof DefaultApi
2027
+ */
2028
+ walletCreate(wallet?: Wallet, options?: RawAxiosRequestConfig): Promise<import("axios").AxiosResponse<WalletIdObject, any>>;
1985
2029
  /**
1986
2030
  * Provides wallet details
1987
2031
  * @param {string} walletId
@@ -2006,12 +2050,12 @@ export declare class DefaultApi extends BaseAPI {
2006
2050
  */
2007
2051
  walletNotifications(walletId: string, options?: RawAxiosRequestConfig): Promise<import("axios").AxiosResponse<WalletNotification[], any>>;
2008
2052
  /**
2009
- * The first call will authenticate the client and create a new wallet that will be accessible only to the client. Any further calls are meant to update the wallet configuration. Be careful when changing the configuration as it may result in the wallet malfunction.
2010
- * @param {string} [walletId] Has to be provided for updates.
2053
+ * Update wallet metadata and configuration.
2054
+ * @param {string} walletId
2011
2055
  * @param {Wallet} [wallet]
2012
2056
  * @param {*} [options] Override http request option.
2013
2057
  * @throws {RequiredError}
2014
2058
  * @memberof DefaultApi
2015
2059
  */
2016
- walletSave(walletId?: string, wallet?: Wallet, options?: RawAxiosRequestConfig): Promise<import("axios").AxiosResponse<Wallet, any>>;
2060
+ walletPatch(walletId: string, wallet?: Wallet, options?: RawAxiosRequestConfig): Promise<import("axios").AxiosResponse<WalletIdObject, any>>;
2017
2061
  }
package/api.js CHANGED
@@ -869,6 +869,36 @@ const DefaultApiAxiosParamCreator = function (configuration) {
869
869
  options: localVarRequestOptions,
870
870
  };
871
871
  }),
872
+ /**
873
+ * The call will authenticate the client and create a new wallet that will be accessible only to the client.
874
+ * @param {Wallet} [wallet]
875
+ * @param {*} [options] Override http request option.
876
+ * @throws {RequiredError}
877
+ */
878
+ walletCreate: (wallet, options = {}) => __awaiter(this, void 0, void 0, function* () {
879
+ const localVarPath = `/wallets`;
880
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
881
+ const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
882
+ let baseOptions;
883
+ if (configuration) {
884
+ baseOptions = configuration.baseOptions;
885
+ }
886
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
887
+ const localVarHeaderParameter = {};
888
+ const localVarQueryParameter = {};
889
+ // authentication accessToken required
890
+ // http bearer authentication required
891
+ yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration);
892
+ localVarHeaderParameter['Content-Type'] = 'application/json';
893
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
894
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
895
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
896
+ localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(wallet, localVarRequestOptions, configuration);
897
+ return {
898
+ url: (0, common_1.toPathString)(localVarUrlObj),
899
+ options: localVarRequestOptions,
900
+ };
901
+ }),
872
902
  /**
873
903
  * Provides wallet details
874
904
  * @param {string} walletId
@@ -878,7 +908,8 @@ const DefaultApiAxiosParamCreator = function (configuration) {
878
908
  walletGet: (walletId, options = {}) => __awaiter(this, void 0, void 0, function* () {
879
909
  // verify required parameter 'walletId' is not null or undefined
880
910
  (0, common_1.assertParamExists)('walletGet', 'walletId', walletId);
881
- const localVarPath = `/wallets/current`;
911
+ const localVarPath = `/wallets/{wallet_id}`
912
+ .replace(`{${"wallet_id"}}`, encodeURIComponent(String(walletId)));
882
913
  // use dummy base URL string because the URL constructor only accepts absolute URLs.
883
914
  const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
884
915
  let baseOptions;
@@ -891,9 +922,6 @@ const DefaultApiAxiosParamCreator = function (configuration) {
891
922
  // authentication accessToken required
892
923
  // http bearer authentication required
893
924
  yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration);
894
- if (walletId != null) {
895
- localVarHeaderParameter['wallet-id'] = String(walletId);
896
- }
897
925
  (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
898
926
  let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
899
927
  localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
@@ -961,29 +989,29 @@ const DefaultApiAxiosParamCreator = function (configuration) {
961
989
  };
962
990
  }),
963
991
  /**
964
- * The first call will authenticate the client and create a new wallet that will be accessible only to the client. Any further calls are meant to update the wallet configuration. Be careful when changing the configuration as it may result in the wallet malfunction.
965
- * @param {string} [walletId] Has to be provided for updates.
992
+ * Update wallet metadata and configuration.
993
+ * @param {string} walletId
966
994
  * @param {Wallet} [wallet]
967
995
  * @param {*} [options] Override http request option.
968
996
  * @throws {RequiredError}
969
997
  */
970
- walletSave: (walletId, wallet, options = {}) => __awaiter(this, void 0, void 0, function* () {
971
- const localVarPath = `/wallets`;
998
+ walletPatch: (walletId, wallet, options = {}) => __awaiter(this, void 0, void 0, function* () {
999
+ // verify required parameter 'walletId' is not null or undefined
1000
+ (0, common_1.assertParamExists)('walletPatch', 'walletId', walletId);
1001
+ const localVarPath = `/wallets/{wallet_id}`
1002
+ .replace(`{${"wallet_id"}}`, encodeURIComponent(String(walletId)));
972
1003
  // use dummy base URL string because the URL constructor only accepts absolute URLs.
973
1004
  const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
974
1005
  let baseOptions;
975
1006
  if (configuration) {
976
1007
  baseOptions = configuration.baseOptions;
977
1008
  }
978
- const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
1009
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'PATCH' }, baseOptions), options);
979
1010
  const localVarHeaderParameter = {};
980
1011
  const localVarQueryParameter = {};
981
1012
  // authentication accessToken required
982
1013
  // http bearer authentication required
983
1014
  yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration);
984
- if (walletId != null) {
985
- localVarHeaderParameter['wallet-id'] = String(walletId);
986
- }
987
1015
  localVarHeaderParameter['Content-Type'] = 'application/json';
988
1016
  (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
989
1017
  let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
@@ -1367,6 +1395,21 @@ const DefaultApiFp = function (configuration) {
1367
1395
  return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, operationBasePath || basePath);
1368
1396
  });
1369
1397
  },
1398
+ /**
1399
+ * The call will authenticate the client and create a new wallet that will be accessible only to the client.
1400
+ * @param {Wallet} [wallet]
1401
+ * @param {*} [options] Override http request option.
1402
+ * @throws {RequiredError}
1403
+ */
1404
+ walletCreate(wallet, options) {
1405
+ var _a, _b, _c;
1406
+ return __awaiter(this, void 0, void 0, function* () {
1407
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.walletCreate(wallet, options);
1408
+ const index = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
1409
+ const operationBasePath = (_c = (_b = base_1.operationServerMap['DefaultApi.walletCreate']) === null || _b === void 0 ? void 0 : _b[index]) === null || _c === void 0 ? void 0 : _c.url;
1410
+ return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, operationBasePath || basePath);
1411
+ });
1412
+ },
1370
1413
  /**
1371
1414
  * Provides wallet details
1372
1415
  * @param {string} walletId
@@ -1412,18 +1455,18 @@ const DefaultApiFp = function (configuration) {
1412
1455
  });
1413
1456
  },
1414
1457
  /**
1415
- * The first call will authenticate the client and create a new wallet that will be accessible only to the client. Any further calls are meant to update the wallet configuration. Be careful when changing the configuration as it may result in the wallet malfunction.
1416
- * @param {string} [walletId] Has to be provided for updates.
1458
+ * Update wallet metadata and configuration.
1459
+ * @param {string} walletId
1417
1460
  * @param {Wallet} [wallet]
1418
1461
  * @param {*} [options] Override http request option.
1419
1462
  * @throws {RequiredError}
1420
1463
  */
1421
- walletSave(walletId, wallet, options) {
1464
+ walletPatch(walletId, wallet, options) {
1422
1465
  var _a, _b, _c;
1423
1466
  return __awaiter(this, void 0, void 0, function* () {
1424
- const localVarAxiosArgs = yield localVarAxiosParamCreator.walletSave(walletId, wallet, options);
1467
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.walletPatch(walletId, wallet, options);
1425
1468
  const index = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
1426
- const operationBasePath = (_c = (_b = base_1.operationServerMap['DefaultApi.walletSave']) === null || _b === void 0 ? void 0 : _b[index]) === null || _c === void 0 ? void 0 : _c.url;
1469
+ const operationBasePath = (_c = (_b = base_1.operationServerMap['DefaultApi.walletPatch']) === null || _b === void 0 ? void 0 : _b[index]) === null || _c === void 0 ? void 0 : _c.url;
1427
1470
  return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, operationBasePath || basePath);
1428
1471
  });
1429
1472
  },
@@ -1662,6 +1705,15 @@ const DefaultApiFactory = function (configuration, basePath, axios) {
1662
1705
  onboardLegalEntity(walletId, options) {
1663
1706
  return localVarFp.onboardLegalEntity(walletId, options).then((request) => request(axios, basePath));
1664
1707
  },
1708
+ /**
1709
+ * The call will authenticate the client and create a new wallet that will be accessible only to the client.
1710
+ * @param {Wallet} [wallet]
1711
+ * @param {*} [options] Override http request option.
1712
+ * @throws {RequiredError}
1713
+ */
1714
+ walletCreate(wallet, options) {
1715
+ return localVarFp.walletCreate(wallet, options).then((request) => request(axios, basePath));
1716
+ },
1665
1717
  /**
1666
1718
  * Provides wallet details
1667
1719
  * @param {string} walletId
@@ -1689,14 +1741,14 @@ const DefaultApiFactory = function (configuration, basePath, axios) {
1689
1741
  return localVarFp.walletNotifications(walletId, options).then((request) => request(axios, basePath));
1690
1742
  },
1691
1743
  /**
1692
- * The first call will authenticate the client and create a new wallet that will be accessible only to the client. Any further calls are meant to update the wallet configuration. Be careful when changing the configuration as it may result in the wallet malfunction.
1693
- * @param {string} [walletId] Has to be provided for updates.
1744
+ * Update wallet metadata and configuration.
1745
+ * @param {string} walletId
1694
1746
  * @param {Wallet} [wallet]
1695
1747
  * @param {*} [options] Override http request option.
1696
1748
  * @throws {RequiredError}
1697
1749
  */
1698
- walletSave(walletId, wallet, options) {
1699
- return localVarFp.walletSave(walletId, wallet, options).then((request) => request(axios, basePath));
1750
+ walletPatch(walletId, wallet, options) {
1751
+ return localVarFp.walletPatch(walletId, wallet, options).then((request) => request(axios, basePath));
1700
1752
  },
1701
1753
  };
1702
1754
  };
@@ -1956,6 +2008,16 @@ class DefaultApi extends base_1.BaseAPI {
1956
2008
  onboardLegalEntity(walletId, options) {
1957
2009
  return (0, exports.DefaultApiFp)(this.configuration).onboardLegalEntity(walletId, options).then((request) => request(this.axios, this.basePath));
1958
2010
  }
2011
+ /**
2012
+ * The call will authenticate the client and create a new wallet that will be accessible only to the client.
2013
+ * @param {Wallet} [wallet]
2014
+ * @param {*} [options] Override http request option.
2015
+ * @throws {RequiredError}
2016
+ * @memberof DefaultApi
2017
+ */
2018
+ walletCreate(wallet, options) {
2019
+ return (0, exports.DefaultApiFp)(this.configuration).walletCreate(wallet, options).then((request) => request(this.axios, this.basePath));
2020
+ }
1959
2021
  /**
1960
2022
  * Provides wallet details
1961
2023
  * @param {string} walletId
@@ -1986,15 +2048,15 @@ class DefaultApi extends base_1.BaseAPI {
1986
2048
  return (0, exports.DefaultApiFp)(this.configuration).walletNotifications(walletId, options).then((request) => request(this.axios, this.basePath));
1987
2049
  }
1988
2050
  /**
1989
- * The first call will authenticate the client and create a new wallet that will be accessible only to the client. Any further calls are meant to update the wallet configuration. Be careful when changing the configuration as it may result in the wallet malfunction.
1990
- * @param {string} [walletId] Has to be provided for updates.
2051
+ * Update wallet metadata and configuration.
2052
+ * @param {string} walletId
1991
2053
  * @param {Wallet} [wallet]
1992
2054
  * @param {*} [options] Override http request option.
1993
2055
  * @throws {RequiredError}
1994
2056
  * @memberof DefaultApi
1995
2057
  */
1996
- walletSave(walletId, wallet, options) {
1997
- return (0, exports.DefaultApiFp)(this.configuration).walletSave(walletId, wallet, options).then((request) => request(this.axios, this.basePath));
2058
+ walletPatch(walletId, wallet, options) {
2059
+ return (0, exports.DefaultApiFp)(this.configuration).walletPatch(walletId, wallet, options).then((request) => request(this.axios, this.basePath));
1998
2060
  }
1999
2061
  }
2000
2062
  exports.DefaultApi = DefaultApi;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@triveria/wallet",
3
3
  "private": false,
4
- "version": "0.0.49",
4
+ "version": "0.0.50",
5
5
  "description": "",
6
6
  "main": "index.js",
7
7
  "scripts": {