@openfort/openfort-node 0.5.4 → 0.5.6

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 (77) hide show
  1. package/.eslintrc.json +9 -0
  2. package/dist/generated/api/apis.d.ts +1 -1
  3. package/dist/generated/model/assetType.d.ts +4 -4
  4. package/dist/generated/model/assetType.js.map +1 -1
  5. package/dist/generated/model/createAccountRequest.d.ts +4 -4
  6. package/dist/generated/model/createAccountRequest.js +5 -5
  7. package/dist/generated/model/createAccountRequest.js.map +1 -1
  8. package/dist/generated/model/dataAccountTypes.d.ts +3 -3
  9. package/dist/generated/model/dataAccountTypes.js +3 -3
  10. package/dist/generated/model/dataAccountTypes.js.map +1 -1
  11. package/dist/generated/model/nextActionType.d.ts +1 -1
  12. package/dist/generated/model/nextActionType.js +1 -1
  13. package/dist/generated/model/nextActionType.js.map +1 -1
  14. package/dist/generated/model/pKLocation.d.ts +3 -3
  15. package/dist/generated/model/pKLocation.js +3 -3
  16. package/dist/generated/model/pKLocation.js.map +1 -1
  17. package/dist/generated/model/pKPolicy.d.ts +2 -2
  18. package/dist/generated/model/pKPolicy.js +2 -2
  19. package/dist/generated/model/pKPolicy.js.map +1 -1
  20. package/dist/generated/model/policySchema.d.ts +2 -2
  21. package/dist/generated/model/policySchema.js +2 -2
  22. package/dist/generated/model/policySchema.js.map +1 -1
  23. package/dist/generated/model/sortOrder.d.ts +2 -2
  24. package/dist/generated/model/sortOrder.js +2 -2
  25. package/dist/generated/model/sortOrder.js.map +1 -1
  26. package/dist/generated/model/sponsorSchema.d.ts +2 -2
  27. package/dist/generated/model/sponsorSchema.js +2 -2
  28. package/dist/generated/model/sponsorSchema.js.map +1 -1
  29. package/dist/index.d.ts +5 -8
  30. package/dist/index.js +27 -31
  31. package/dist/index.js.map +1 -1
  32. package/dist/model/validationError.d.ts +4 -0
  33. package/dist/model/validationError.js +11 -0
  34. package/dist/model/validationError.js.map +1 -0
  35. package/dist/utility/httpErrorHandler.d.ts +1 -0
  36. package/dist/utility/httpErrorHandler.js +54 -0
  37. package/dist/utility/httpErrorHandler.js.map +1 -0
  38. package/dist/utility/observable.d.ts +5 -0
  39. package/dist/utility/observable.js +3 -0
  40. package/dist/utility/observable.js.map +1 -0
  41. package/dist/utility/observer.d.ts +19 -0
  42. package/dist/utility/observer.js +8 -0
  43. package/dist/utility/observer.js.map +1 -0
  44. package/dist/version.d.ts +1 -1
  45. package/dist/version.js +1 -1
  46. package/dist/wrapper/accountsApiWrapper.d.ts +4 -3
  47. package/dist/wrapper/accountsApiWrapper.js +15 -50
  48. package/dist/wrapper/accountsApiWrapper.js.map +1 -1
  49. package/dist/wrapper/baseApiWrapper.d.ts +14 -0
  50. package/dist/wrapper/baseApiWrapper.js +20 -0
  51. package/dist/wrapper/baseApiWrapper.js.map +1 -0
  52. package/dist/wrapper/contractsApiWrapper.d.ts +4 -3
  53. package/dist/wrapper/contractsApiWrapper.js +14 -43
  54. package/dist/wrapper/contractsApiWrapper.js.map +1 -1
  55. package/dist/wrapper/playersApiWrapper.d.ts +4 -3
  56. package/dist/wrapper/playersApiWrapper.js +19 -78
  57. package/dist/wrapper/playersApiWrapper.js.map +1 -1
  58. package/dist/wrapper/policiesApiWrapper.d.ts +4 -3
  59. package/dist/wrapper/policiesApiWrapper.js +18 -71
  60. package/dist/wrapper/policiesApiWrapper.js.map +1 -1
  61. package/dist/wrapper/policyRulesApiWrapper.d.ts +4 -3
  62. package/dist/wrapper/policyRulesApiWrapper.js +13 -36
  63. package/dist/wrapper/policyRulesApiWrapper.js.map +1 -1
  64. package/dist/wrapper/projectsApiWrapper.d.ts +4 -3
  65. package/dist/wrapper/projectsApiWrapper.js +13 -36
  66. package/dist/wrapper/projectsApiWrapper.js.map +1 -1
  67. package/dist/wrapper/sessionsApiWrapper.d.ts +4 -3
  68. package/dist/wrapper/sessionsApiWrapper.js +13 -36
  69. package/dist/wrapper/sessionsApiWrapper.js.map +1 -1
  70. package/dist/wrapper/transactionIntentsApiWrapper.d.ts +4 -3
  71. package/dist/wrapper/transactionIntentsApiWrapper.js +15 -50
  72. package/dist/wrapper/transactionIntentsApiWrapper.js.map +1 -1
  73. package/package.json +1 -1
  74. package/tsconfig.tsbuildinfo +1 -1
  75. package/dist/wrapper/httpErrorHandler.d.ts +0 -5
  76. package/dist/wrapper/httpErrorHandler.js +0 -46
  77. package/dist/wrapper/httpErrorHandler.js.map +0 -1
package/.eslintrc.json CHANGED
@@ -52,6 +52,15 @@
52
52
  "modifiers": ["public"],
53
53
  "format": ["camelCase"]
54
54
  }
55
+ ],
56
+ "sort-imports": [
57
+ "error", {
58
+ "ignoreCase": false,
59
+ "ignoreDeclarationSort": false,
60
+ "ignoreMemberSort": false,
61
+ "memberSyntaxSortOrder": ["none", "all", "multiple", "single"],
62
+ "allowSeparatedGroups": false
63
+ }
55
64
  ]
56
65
  }
57
66
  }
@@ -23,4 +23,4 @@ export declare class HttpError extends Error {
23
23
  constructor(response: http.IncomingMessage, body: any, statusCode?: number | undefined);
24
24
  }
25
25
  export { RequestFile } from '../model/models';
26
- export declare const APIS: (typeof AccountsApi | typeof ContractsApi | typeof PlayersApi | typeof PoliciesApi | typeof PolicyRulesApi | typeof ProjectsApi | typeof SessionsApi | typeof TransactionIntentsApi)[];
26
+ export declare const APIS: (typeof ContractsApi | typeof PlayersApi | typeof PoliciesApi | typeof PolicyRulesApi | typeof ProjectsApi | typeof SessionsApi | typeof TransactionIntentsApi | typeof AccountsApi)[];
@@ -10,8 +10,8 @@
10
10
  * Do not edit the class manually.
11
11
  */
12
12
  export declare enum AssetType {
13
- NUMBER_1,
14
- NUMBER_2,
15
- NUMBER_3,
16
- NUMBER_4
13
+ NUMBER_1 = 1,
14
+ NUMBER_2 = 2,
15
+ NUMBER_3 = 3,
16
+ NUMBER_4 = 4
17
17
  }
@@ -1 +1 @@
1
- {"version":3,"file":"assetType.js","sourceRoot":"","sources":["../../../src/generated/model/assetType.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;;AAIH,IAAY,SAKX;AALD,WAAY,SAAS;IACjB,kCAAiB,CAAC,cAAA,CAAA;IAClB,kCAAiB,CAAC,cAAA,CAAA;IAClB,kCAAiB,CAAC,cAAA,CAAA;IAClB,kCAAiB,CAAC,cAAA,CAAA;AACtB,CAAC,EALW,SAAS,GAAT,iBAAS,KAAT,iBAAS,QAKpB"}
1
+ {"version":3,"file":"assetType.js","sourceRoot":"","sources":["../../../src/generated/model/assetType.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;;AAIH,IAAY,SAKX;AALD,WAAY,SAAS;IACjB,iDAAY,CAAA;IACZ,iDAAY,CAAA;IACZ,iDAAY,CAAA;IACZ,iDAAY,CAAA;AAChB,CAAC,EALW,SAAS,GAAT,iBAAS,KAAT,iBAAS,QAKpB"}
@@ -16,10 +16,6 @@ export declare class CreateAccountRequest {
16
16
  */
17
17
  'chainId': number;
18
18
  /**
19
- * The player ID
20
- */
21
- 'player': string;
22
- /**
23
19
  * The address of the external owner
24
20
  */
25
21
  'externalOwnerAddress'?: string;
@@ -32,6 +28,10 @@ export declare class CreateAccountRequest {
32
28
  * If ERC6551, the tokenID to serve as owner
33
29
  */
34
30
  'tokenId'?: number;
31
+ /**
32
+ * The player ID
33
+ */
34
+ 'player': string;
35
35
  static discriminator: string | undefined;
36
36
  static attributeTypeMap: Array<{
37
37
  name: string;
@@ -25,11 +25,6 @@ CreateAccountRequest.attributeTypeMap = [
25
25
  "baseName": "chainId",
26
26
  "type": "number"
27
27
  },
28
- {
29
- "name": "player",
30
- "baseName": "player",
31
- "type": "string"
32
- },
33
28
  {
34
29
  "name": "externalOwnerAddress",
35
30
  "baseName": "externalOwnerAddress",
@@ -49,6 +44,11 @@ CreateAccountRequest.attributeTypeMap = [
49
44
  "name": "tokenId",
50
45
  "baseName": "tokenId",
51
46
  "type": "number"
47
+ },
48
+ {
49
+ "name": "player",
50
+ "baseName": "player",
51
+ "type": "string"
52
52
  }
53
53
  ];
54
54
  //# sourceMappingURL=createAccountRequest.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"createAccountRequest.js","sourceRoot":"","sources":["../../../src/generated/model/createAccountRequest.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;;AAKH,MAAa,oBAAoB;IAyD7B,MAAM,CAAC,mBAAmB;QACtB,OAAO,oBAAoB,CAAC,gBAAgB,CAAC;IACjD,CAAC;;AA3DL,oDA4DC;AArCU,kCAAa,GAAuB,SAAS,CAAC;AAE9C,qCAAgB,GAA0D;IAC7E;QACI,MAAM,EAAE,SAAS;QACjB,UAAU,EAAE,SAAS;QACrB,MAAM,EAAE,QAAQ;KACnB;IACD;QACI,MAAM,EAAE,QAAQ;QAChB,UAAU,EAAE,QAAQ;QACpB,MAAM,EAAE,QAAQ;KACnB;IACD;QACI,MAAM,EAAE,sBAAsB;QAC9B,UAAU,EAAE,sBAAsB;QAClC,MAAM,EAAE,QAAQ;KACnB;IACD;QACI,MAAM,EAAE,aAAa;QACrB,UAAU,EAAE,aAAa;QACzB,MAAM,EAAE,kBAAkB;KAC7B;IACD;QACI,MAAM,EAAE,eAAe;QACvB,UAAU,EAAE,eAAe;QAC3B,MAAM,EAAE,QAAQ;KACnB;IACD;QACI,MAAM,EAAE,SAAS;QACjB,UAAU,EAAE,SAAS;QACrB,MAAM,EAAE,QAAQ;KACnB;CAAK,CAAC"}
1
+ {"version":3,"file":"createAccountRequest.js","sourceRoot":"","sources":["../../../src/generated/model/createAccountRequest.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;;AAKH,MAAa,oBAAoB;IAyD7B,MAAM,CAAC,mBAAmB;QACtB,OAAO,oBAAoB,CAAC,gBAAgB,CAAC;IACjD,CAAC;;AA3DL,oDA4DC;AArCU,kCAAa,GAAuB,SAAS,CAAC;AAE9C,qCAAgB,GAA0D;IAC7E;QACI,MAAM,EAAE,SAAS;QACjB,UAAU,EAAE,SAAS;QACrB,MAAM,EAAE,QAAQ;KACnB;IACD;QACI,MAAM,EAAE,sBAAsB;QAC9B,UAAU,EAAE,sBAAsB;QAClC,MAAM,EAAE,QAAQ;KACnB;IACD;QACI,MAAM,EAAE,aAAa;QACrB,UAAU,EAAE,aAAa;QACzB,MAAM,EAAE,kBAAkB;KAC7B;IACD;QACI,MAAM,EAAE,eAAe;QACvB,UAAU,EAAE,eAAe;QAC3B,MAAM,EAAE,QAAQ;KACnB;IACD;QACI,MAAM,EAAE,SAAS;QACjB,UAAU,EAAE,SAAS;QACrB,MAAM,EAAE,QAAQ;KACnB;IACD;QACI,MAAM,EAAE,QAAQ;QAChB,UAAU,EAAE,QAAQ;QACpB,MAAM,EAAE,QAAQ;KACnB;CAAK,CAAC"}
@@ -10,7 +10,7 @@
10
10
  * Do not edit the class manually.
11
11
  */
12
12
  export declare enum DataAccountTypes {
13
- Upgradeable,
14
- Managed,
15
- Erc6551
13
+ Upgradeable = "Upgradeable",
14
+ Managed = "Managed",
15
+ Erc6551 = "ERC6551"
16
16
  }
@@ -14,8 +14,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
14
14
  exports.DataAccountTypes = void 0;
15
15
  var DataAccountTypes;
16
16
  (function (DataAccountTypes) {
17
- DataAccountTypes[DataAccountTypes["Upgradeable"] = 'Upgradeable'] = "Upgradeable";
18
- DataAccountTypes[DataAccountTypes["Managed"] = 'Managed'] = "Managed";
19
- DataAccountTypes[DataAccountTypes["Erc6551"] = 'ERC6551'] = "Erc6551";
17
+ DataAccountTypes["Upgradeable"] = "Upgradeable";
18
+ DataAccountTypes["Managed"] = "Managed";
19
+ DataAccountTypes["Erc6551"] = "ERC6551";
20
20
  })(DataAccountTypes = exports.DataAccountTypes || (exports.DataAccountTypes = {}));
21
21
  //# sourceMappingURL=dataAccountTypes.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"dataAccountTypes.js","sourceRoot":"","sources":["../../../src/generated/model/dataAccountTypes.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;;AAIH,IAAY,gBAIX;AAJD,WAAY,gBAAgB;IACxB,mDAAoB,aAAa,iBAAA,CAAA;IACjC,+CAAgB,SAAS,aAAA,CAAA;IACzB,+CAAgB,SAAS,aAAA,CAAA;AAC7B,CAAC,EAJW,gBAAgB,GAAhB,wBAAgB,KAAhB,wBAAgB,QAI3B"}
1
+ {"version":3,"file":"dataAccountTypes.js","sourceRoot":"","sources":["../../../src/generated/model/dataAccountTypes.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;;AAIH,IAAY,gBAIX;AAJD,WAAY,gBAAgB;IACxB,+CAA2B,CAAA;IAC3B,uCAAmB,CAAA;IACnB,uCAAmB,CAAA;AACvB,CAAC,EAJW,gBAAgB,GAAhB,wBAAgB,KAAhB,wBAAgB,QAI3B"}
@@ -10,5 +10,5 @@
10
10
  * Do not edit the class manually.
11
11
  */
12
12
  export declare enum NextActionType {
13
- SignWithWallet
13
+ SignWithWallet = "sign_with_wallet"
14
14
  }
@@ -14,6 +14,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
14
14
  exports.NextActionType = void 0;
15
15
  var NextActionType;
16
16
  (function (NextActionType) {
17
- NextActionType[NextActionType["SignWithWallet"] = 'sign_with_wallet'] = "SignWithWallet";
17
+ NextActionType["SignWithWallet"] = "sign_with_wallet";
18
18
  })(NextActionType = exports.NextActionType || (exports.NextActionType = {}));
19
19
  //# sourceMappingURL=nextActionType.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"nextActionType.js","sourceRoot":"","sources":["../../../src/generated/model/nextActionType.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;;AAIH,IAAY,cAEX;AAFD,WAAY,cAAc;IACtB,kDAAuB,kBAAkB,oBAAA,CAAA;AAC7C,CAAC,EAFW,cAAc,GAAd,sBAAc,KAAd,sBAAc,QAEzB"}
1
+ {"version":3,"file":"nextActionType.js","sourceRoot":"","sources":["../../../src/generated/model/nextActionType.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;;AAIH,IAAY,cAEX;AAFD,WAAY,cAAc;IACtB,qDAAmC,CAAA;AACvC,CAAC,EAFW,cAAc,GAAd,sBAAc,KAAd,sBAAc,QAEzB"}
@@ -10,7 +10,7 @@
10
10
  * Do not edit the class manually.
11
11
  */
12
12
  export declare enum PKLocation {
13
- Db,
14
- GcpKms,
15
- User
13
+ Db = "DB",
14
+ GcpKms = "GCP_KMS",
15
+ User = "USER"
16
16
  }
@@ -14,8 +14,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
14
14
  exports.PKLocation = void 0;
15
15
  var PKLocation;
16
16
  (function (PKLocation) {
17
- PKLocation[PKLocation["Db"] = 'DB'] = "Db";
18
- PKLocation[PKLocation["GcpKms"] = 'GCP_KMS'] = "GcpKms";
19
- PKLocation[PKLocation["User"] = 'USER'] = "User";
17
+ PKLocation["Db"] = "DB";
18
+ PKLocation["GcpKms"] = "GCP_KMS";
19
+ PKLocation["User"] = "USER";
20
20
  })(PKLocation = exports.PKLocation || (exports.PKLocation = {}));
21
21
  //# sourceMappingURL=pKLocation.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"pKLocation.js","sourceRoot":"","sources":["../../../src/generated/model/pKLocation.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;;AAIH,IAAY,UAIX;AAJD,WAAY,UAAU;IAClB,8BAAW,IAAI,QAAA,CAAA;IACf,kCAAe,SAAS,YAAA,CAAA;IACxB,gCAAa,MAAM,UAAA,CAAA;AACvB,CAAC,EAJW,UAAU,GAAV,kBAAU,KAAV,kBAAU,QAIrB"}
1
+ {"version":3,"file":"pKLocation.js","sourceRoot":"","sources":["../../../src/generated/model/pKLocation.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;;AAIH,IAAY,UAIX;AAJD,WAAY,UAAU;IAClB,uBAAS,CAAA;IACT,gCAAkB,CAAA;IAClB,2BAAa,CAAA;AACjB,CAAC,EAJW,UAAU,GAAV,kBAAU,KAAV,kBAAU,QAIrB"}
@@ -10,6 +10,6 @@
10
10
  * Do not edit the class manually.
11
11
  */
12
12
  export declare enum PKPolicy {
13
- Individual,
14
- Project
13
+ Individual = "INDIVIDUAL",
14
+ Project = "PROJECT"
15
15
  }
@@ -14,7 +14,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
14
14
  exports.PKPolicy = void 0;
15
15
  var PKPolicy;
16
16
  (function (PKPolicy) {
17
- PKPolicy[PKPolicy["Individual"] = 'INDIVIDUAL'] = "Individual";
18
- PKPolicy[PKPolicy["Project"] = 'PROJECT'] = "Project";
17
+ PKPolicy["Individual"] = "INDIVIDUAL";
18
+ PKPolicy["Project"] = "PROJECT";
19
19
  })(PKPolicy = exports.PKPolicy || (exports.PKPolicy = {}));
20
20
  //# sourceMappingURL=pKPolicy.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"pKPolicy.js","sourceRoot":"","sources":["../../../src/generated/model/pKPolicy.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;;AAIH,IAAY,QAGX;AAHD,WAAY,QAAQ;IAChB,kCAAmB,YAAY,gBAAA,CAAA;IAC/B,+BAAgB,SAAS,aAAA,CAAA;AAC7B,CAAC,EAHW,QAAQ,GAAR,gBAAQ,KAAR,gBAAQ,QAGnB"}
1
+ {"version":3,"file":"pKPolicy.js","sourceRoot":"","sources":["../../../src/generated/model/pKPolicy.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;;AAIH,IAAY,QAGX;AAHD,WAAY,QAAQ;IAChB,qCAAyB,CAAA;IACzB,+BAAmB,CAAA;AACvB,CAAC,EAHW,QAAQ,GAAR,gBAAQ,KAAR,gBAAQ,QAGnB"}
@@ -10,6 +10,6 @@
10
10
  * Do not edit the class manually.
11
11
  */
12
12
  export declare enum PolicySchema {
13
- ContractFunctions,
14
- AccountFunctions
13
+ ContractFunctions = "contract_functions",
14
+ AccountFunctions = "account_functions"
15
15
  }
@@ -14,7 +14,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
14
14
  exports.PolicySchema = void 0;
15
15
  var PolicySchema;
16
16
  (function (PolicySchema) {
17
- PolicySchema[PolicySchema["ContractFunctions"] = 'contract_functions'] = "ContractFunctions";
18
- PolicySchema[PolicySchema["AccountFunctions"] = 'account_functions'] = "AccountFunctions";
17
+ PolicySchema["ContractFunctions"] = "contract_functions";
18
+ PolicySchema["AccountFunctions"] = "account_functions";
19
19
  })(PolicySchema = exports.PolicySchema || (exports.PolicySchema = {}));
20
20
  //# sourceMappingURL=policySchema.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"policySchema.js","sourceRoot":"","sources":["../../../src/generated/model/policySchema.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;;AAIH,IAAY,YAGX;AAHD,WAAY,YAAY;IACpB,iDAA0B,oBAAoB,uBAAA,CAAA;IAC9C,gDAAyB,mBAAmB,sBAAA,CAAA;AAChD,CAAC,EAHW,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QAGvB"}
1
+ {"version":3,"file":"policySchema.js","sourceRoot":"","sources":["../../../src/generated/model/policySchema.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;;AAIH,IAAY,YAGX;AAHD,WAAY,YAAY;IACpB,wDAAwC,CAAA;IACxC,sDAAsC,CAAA;AAC1C,CAAC,EAHW,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QAGvB"}
@@ -10,6 +10,6 @@
10
10
  * Do not edit the class manually.
11
11
  */
12
12
  export declare enum SortOrder {
13
- Asc,
14
- Desc
13
+ Asc = "asc",
14
+ Desc = "desc"
15
15
  }
@@ -14,7 +14,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
14
14
  exports.SortOrder = void 0;
15
15
  var SortOrder;
16
16
  (function (SortOrder) {
17
- SortOrder[SortOrder["Asc"] = 'asc'] = "Asc";
18
- SortOrder[SortOrder["Desc"] = 'desc'] = "Desc";
17
+ SortOrder["Asc"] = "asc";
18
+ SortOrder["Desc"] = "desc";
19
19
  })(SortOrder = exports.SortOrder || (exports.SortOrder = {}));
20
20
  //# sourceMappingURL=sortOrder.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"sortOrder.js","sourceRoot":"","sources":["../../../src/generated/model/sortOrder.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;;AAIH,IAAY,SAGX;AAHD,WAAY,SAAS;IACjB,6BAAY,KAAK,SAAA,CAAA;IACjB,8BAAa,MAAM,UAAA,CAAA;AACvB,CAAC,EAHW,SAAS,GAAT,iBAAS,KAAT,iBAAS,QAGpB"}
1
+ {"version":3,"file":"sortOrder.js","sourceRoot":"","sources":["../../../src/generated/model/sortOrder.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;;AAIH,IAAY,SAGX;AAHD,WAAY,SAAS;IACjB,wBAAW,CAAA;IACX,0BAAa,CAAA;AACjB,CAAC,EAHW,SAAS,GAAT,iBAAS,KAAT,iBAAS,QAGpB"}
@@ -10,6 +10,6 @@
10
10
  * Do not edit the class manually.
11
11
  */
12
12
  export declare enum SponsorSchema {
13
- PayForUser,
14
- ChargeCustomTokens
13
+ PayForUser = "pay_for_user",
14
+ ChargeCustomTokens = "charge_custom_tokens"
15
15
  }
@@ -14,7 +14,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
14
14
  exports.SponsorSchema = void 0;
15
15
  var SponsorSchema;
16
16
  (function (SponsorSchema) {
17
- SponsorSchema[SponsorSchema["PayForUser"] = 'pay_for_user'] = "PayForUser";
18
- SponsorSchema[SponsorSchema["ChargeCustomTokens"] = 'charge_custom_tokens'] = "ChargeCustomTokens";
17
+ SponsorSchema["PayForUser"] = "pay_for_user";
18
+ SponsorSchema["ChargeCustomTokens"] = "charge_custom_tokens";
19
19
  })(SponsorSchema = exports.SponsorSchema || (exports.SponsorSchema = {}));
20
20
  //# sourceMappingURL=sponsorSchema.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"sponsorSchema.js","sourceRoot":"","sources":["../../../src/generated/model/sponsorSchema.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;;AAIH,IAAY,aAGX;AAHD,WAAY,aAAa;IACrB,4CAAmB,cAAc,gBAAA,CAAA;IACjC,oDAA2B,sBAAsB,wBAAA,CAAA;AACrD,CAAC,EAHW,aAAa,GAAb,qBAAa,KAAb,qBAAa,QAGxB"}
1
+ {"version":3,"file":"sponsorSchema.js","sourceRoot":"","sources":["../../../src/generated/model/sponsorSchema.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;;AAIH,IAAY,aAGX;AAHD,WAAY,aAAa;IACrB,4CAA2B,CAAA;IAC3B,4DAA2C,CAAA;AAC/C,CAAC,EAHW,aAAa,GAAb,qBAAa,KAAb,qBAAa,QAGxB"}
package/dist/index.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import { AccountsApiWrapper } from "./wrapper/accountsApiWrapper";
2
2
  import { ContractsApiWrapper } from "./wrapper/contractsApiWrapper";
3
+ import { Observer } from "./utility/observer";
3
4
  import { PlayersApiWrapper } from "./wrapper/playersApiWrapper";
4
5
  import { PoliciesApiWrapper } from "./wrapper/policiesApiWrapper";
5
6
  import { PolicyRulesApiWrapper } from "./wrapper/policyRulesApiWrapper";
@@ -9,14 +10,8 @@ import { TransactionIntentsApiWrapper } from "./wrapper/transactionIntentsApiWra
9
10
  export default class Openfort {
10
11
  private readonly apiKey;
11
12
  private readonly basePath?;
12
- private _accountsApi?;
13
- private _contractsApi?;
14
- private _playersApi?;
15
- private _policiesApi?;
16
- private _policyRulesApi?;
17
- private _projectsApi?;
18
- private _sessionsApi?;
19
- private _transactionIntentsApi?;
13
+ private readonly apiWrappers;
14
+ private readonly observers;
20
15
  constructor(apiKey: string, basePath?: string | undefined);
21
16
  get accounts(): AccountsApiWrapper;
22
17
  get contracts(): ContractsApiWrapper;
@@ -26,5 +21,7 @@ export default class Openfort {
26
21
  get projects(): ProjectsApiWrapper;
27
22
  get sessions(): SessionsApiWrapper;
28
23
  get transactionIntents(): TransactionIntentsApiWrapper;
24
+ subscribe(observer: Observer): void;
25
+ private getOrCreateWrapper;
29
26
  }
30
27
  export * from "./model";
package/dist/index.js CHANGED
@@ -26,54 +26,50 @@ class Openfort {
26
26
  constructor(apiKey, basePath) {
27
27
  this.apiKey = apiKey;
28
28
  this.basePath = basePath;
29
+ this.apiWrappers = {};
30
+ this.observers = [];
29
31
  }
30
32
  get accounts() {
31
- if (!this._accountsApi) {
32
- this._accountsApi = new accountsApiWrapper_1.AccountsApiWrapper(this.apiKey, this.basePath);
33
- }
34
- return this._accountsApi;
33
+ return this.getOrCreateWrapper(accountsApiWrapper_1.AccountsApiWrapper);
35
34
  }
36
35
  get contracts() {
37
- if (!this._contractsApi) {
38
- this._contractsApi = new contractsApiWrapper_1.ContractsApiWrapper(this.apiKey, this.basePath);
39
- }
40
- return this._contractsApi;
36
+ return this.getOrCreateWrapper(contractsApiWrapper_1.ContractsApiWrapper);
41
37
  }
42
38
  get players() {
43
- if (!this._playersApi) {
44
- this._playersApi = new playersApiWrapper_1.PlayersApiWrapper(this.apiKey, this.basePath);
45
- }
46
- return this._playersApi;
39
+ return this.getOrCreateWrapper(playersApiWrapper_1.PlayersApiWrapper);
47
40
  }
48
41
  get policies() {
49
- if (!this._policiesApi) {
50
- this._policiesApi = new policiesApiWrapper_1.PoliciesApiWrapper(this.apiKey, this.basePath);
51
- }
52
- return this._policiesApi;
42
+ return this.getOrCreateWrapper(policiesApiWrapper_1.PoliciesApiWrapper);
53
43
  }
54
44
  get policyRules() {
55
- if (!this._policyRulesApi) {
56
- this._policyRulesApi = new policyRulesApiWrapper_1.PolicyRulesApiWrapper(this.apiKey, this.basePath);
57
- }
58
- return this._policyRulesApi;
45
+ return this.getOrCreateWrapper(policyRulesApiWrapper_1.PolicyRulesApiWrapper);
59
46
  }
60
47
  get projects() {
61
- if (!this._projectsApi) {
62
- this._projectsApi = new projectsApiWrapper_1.ProjectsApiWrapper(this.apiKey, this.basePath);
63
- }
64
- return this._projectsApi;
48
+ return this.getOrCreateWrapper(projectsApiWrapper_1.ProjectsApiWrapper);
65
49
  }
66
50
  get sessions() {
67
- if (!this._sessionsApi) {
68
- this._sessionsApi = new sessionsApiWrapper_1.SessionsApiWrapper(this.apiKey, this.basePath);
69
- }
70
- return this._sessionsApi;
51
+ return this.getOrCreateWrapper(sessionsApiWrapper_1.SessionsApiWrapper);
71
52
  }
72
53
  get transactionIntents() {
73
- if (!this._transactionIntentsApi) {
74
- this._transactionIntentsApi = new transactionIntentsApiWrapper_1.TransactionIntentsApiWrapper(this.apiKey, this.basePath);
54
+ return this.getOrCreateWrapper(transactionIntentsApiWrapper_1.TransactionIntentsApiWrapper);
55
+ }
56
+ subscribe(observer) {
57
+ this.observers.push(observer);
58
+ for (const apiWrapper of Object.values(this.apiWrappers)) {
59
+ apiWrapper.observers?.push(observer);
60
+ }
61
+ }
62
+ getOrCreateWrapper(type) {
63
+ const wrapper = this.apiWrappers[type.name];
64
+ if (wrapper) {
65
+ return wrapper;
66
+ }
67
+ const result = new type(this.apiKey, this.basePath);
68
+ for (const observer of this.observers) {
69
+ result.subscribe?.(observer);
75
70
  }
76
- return this._transactionIntentsApi;
71
+ this.apiWrappers[type.name] = result;
72
+ return result;
77
73
  }
78
74
  }
79
75
  exports.default = Openfort;
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,qEAAgE;AAChE,uEAAkE;AAClE,mEAA8D;AAC9D,qEAAgE;AAChE,2EAAsE;AACtE,qEAAgE;AAChE,qEAAgE;AAChE,yFAAoF;AAEpF,MAAqB,QAAQ;IAUzB,YAA6B,MAAc,EAAmB,QAAiB;QAAlD,WAAM,GAAN,MAAM,CAAQ;QAAmB,aAAQ,GAAR,QAAQ,CAAS;IAAG,CAAC;IAEnF,IAAW,QAAQ;QACf,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE;YACpB,IAAI,CAAC,YAAY,GAAG,IAAI,uCAAkB,CAAC,IAAI,CAAC,MAA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C,kBAAkB,CAAC,6CAAqB,CAAC,CAAC;IAC1D,CAAC;IAED,IAAW,QAAQ;QACf,OAAO,IAAI,CAAC,kBAAkB,CAAC,uCAAkB,CAAC,CAAC;IACvD,CAAC;IAED,IAAW,QAAQ;QACf,OAAO,IAAI,CAAC,kBAAkB,CAAC,uCAAkB,CAAC,CAAC;IACvD,CAAC;IAED,IAAW,kBAAkB;QACzB,OAAO,IAAI,CAAC,kBAAkB,CAAC,2DAA4B,CAAC,CAAC;IACjE,CAAC;IAEM,SAAS,CAAC,QAAkB;QAC/B,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAC9B,KAAK,MAAM,UAAU,IAAI,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE;YACrD,UAAyB,CAAC,SAAS,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;SACxD;IACL,CAAC;IAEO,kBAAkB,CAAI,IAAuD;QACjF,MAAM,OAAO,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC5C,IAAI,OAAO,EAAE;YACT,OAAO,OAAO,CAAC;SAClB;QAED,MAAM,MAAM,GAAG,IAAI,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;QACpD,KAAK,MAAM,QAAQ,IAAI,IAAI,CAAC,SAAS,EAAE;YAClC,MAAqB,CAAC,SAAS,EAAE,CAAC,QAAQ,CAAC,CAAC;SAChD;QACD,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;QACrC,OAAO,MAAM,CAAC;IAClB,CAAC;CACJ;AA1DD,2BA0DC;AAED,0CAAwB"}
@@ -0,0 +1,4 @@
1
+ export declare class ValidationError extends Error {
2
+ readonly details?: string | undefined;
3
+ constructor(message: string, details?: string | undefined);
4
+ }
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ValidationError = void 0;
4
+ class ValidationError extends Error {
5
+ constructor(message, details) {
6
+ super(message);
7
+ this.details = details;
8
+ }
9
+ }
10
+ exports.ValidationError = ValidationError;
11
+ //# sourceMappingURL=validationError.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validationError.js","sourceRoot":"","sources":["../../src/model/validationError.ts"],"names":[],"mappings":";;;AAAA,MAAa,eAAgB,SAAQ,KAAK;IACtC,YAAmB,OAAe,EAAkB,OAAgB;QAChE,KAAK,CAAC,OAAO,CAAC,CAAC;QADiC,YAAO,GAAP,OAAO,CAAS;IAEpE,CAAC;CACJ;AAJD,0CAIC"}
@@ -0,0 +1 @@
1
+ export declare function httpErrorHandler(target: Function): void;
@@ -0,0 +1,54 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.httpErrorHandler = void 0;
4
+ const apis_1 = require("../generated/api/apis");
5
+ const validationError_1 = require("../model/validationError");
6
+ function parseAndPrepareHttpError(error) {
7
+ if (error instanceof apis_1.HttpError) {
8
+ const bareError = error.body?.error ?? error.body;
9
+ if (bareError?.details) {
10
+ return new validationError_1.ValidationError(bareError.message, bareError.details);
11
+ }
12
+ if (bareError?.message) {
13
+ return new Error(bareError.message);
14
+ }
15
+ }
16
+ return error;
17
+ }
18
+ function processError(error, observers, methodName) {
19
+ const parsedError = parseAndPrepareHttpError(error);
20
+ if (observers?.length) {
21
+ Promise.all(observers.map((observer) => observer.onError?.(error)));
22
+ if (parsedError instanceof validationError_1.ValidationError) {
23
+ Promise.all(observers.map((observer) => observer.onValidationError?.({ ...parsedError, methodName })));
24
+ }
25
+ }
26
+ return parsedError;
27
+ }
28
+ // eslint-disable-next-line @typescript-eslint/ban-types
29
+ function httpErrorHandler(target) {
30
+ const descriptors = Object.getOwnPropertyDescriptors(target.prototype);
31
+ for (const [propertyName, descriptor] of Object.entries(descriptors)) {
32
+ const isMethod = descriptor.value instanceof Function;
33
+ if (!isMethod)
34
+ continue;
35
+ const targetMethod = descriptor.value;
36
+ descriptor.value = function (...args) {
37
+ try {
38
+ const result = targetMethod.apply(this, args);
39
+ if (result instanceof Promise) {
40
+ return result.catch((error) => {
41
+ throw processError(error, this.observers, propertyName);
42
+ });
43
+ }
44
+ return result;
45
+ }
46
+ catch (error) {
47
+ throw processError(error, this.observers, propertyName);
48
+ }
49
+ };
50
+ Object.defineProperty(target.prototype, propertyName, descriptor);
51
+ }
52
+ }
53
+ exports.httpErrorHandler = httpErrorHandler;
54
+ //# sourceMappingURL=httpErrorHandler.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"httpErrorHandler.js","sourceRoot":"","sources":["../../src/utility/httpErrorHandler.ts"],"names":[],"mappings":";;;AAAA,gDAAgD;AAGhD,8DAAyD;AAEzD,SAAS,wBAAwB,CAAI,KAAQ;IACzC,IAAI,KAAK,YAAY,gBAAS,EAAE;QAC5B,MAAM,SAAS,GAAG,KAAK,CAAC,IAAI,EAAE,KAAK,IAAI,KAAK,CAAC,IAAI,CAAC;QAElD,IAAI,SAAS,EAAE,OAAO,EAAE;YACpB,OAAO,IAAI,iCAAe,CAAC,SAAS,CAAC,OAAO,EAAE,SAAS,CAAC,OAAO,CAAC,CAAC;SACpE;QACD,IAAI,SAAS,EAAE,OAAO,EAAE;YACpB,OAAO,IAAI,KAAK,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;SACvC;KACJ;IAED,OAAO,KAAK,CAAC;AACjB,CAAC;AAED,SAAS,YAAY,CAAC,KAAc,EAAE,SAAiC,EAAE,UAAkB;IACvF,MAAM,WAAW,GAAG,wBAAwB,CAAC,KAAK,CAAC,CAAC;IACpD,IAAI,SAAS,EAAE,MAAM,EAAE;QACnB,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QACpE,IAAI,WAAW,Y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AAvBD,4CAuBC"}
@@ -0,0 +1,5 @@
1
+ import { Observer } from "./observer";
2
+ export interface Observable {
3
+ subscribe(observer: Observer): void;
4
+ get observers(): Observer[];
5
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=observable.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"observable.js","sourceRoot":"","sources":["../../src/utility/observable.ts"],"names":[],"mappings":""}
@@ -0,0 +1,19 @@
1
+ import { ValidationError } from "../model/validationError";
2
+ /**
3
+ * Interface introduce the ability to observe the messages from the observable class
4
+ */
5
+ export interface Observer {
6
+ /**
7
+ * Triggers when any error is happening on sending request to the server.
8
+ * @param error Error object with the all details of the request
9
+ */
10
+ onError?(error: unknown): Promise<void>;
11
+ /**
12
+ * Triggers when any validation request error is occuring
13
+ * @param error Contains information about calling method and happened error
14
+ */
15
+ onValidationError?(error: ValidationErrorMessage): Promise<void>;
16
+ }
17
+ export declare class ValidationErrorMessage extends ValidationError {
18
+ methodName?: string;
19
+ }
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ValidationErrorMessage = void 0;
4
+ const validationError_1 = require("../model/validationError");
5
+ class ValidationErrorMessage extends validationError_1.ValidationError {
6
+ }
7
+ exports.ValidationErrorMessage = ValidationErrorMessage;
8
+ //# sourceMappingURL=observer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"observer.js","sourceRoot":"","sources":["../../src/utility/observer.ts"],"names":[],"mappings":";;;AAAA,8DAAyD;AAkBzD,MAAa,sBAAuB,SAAQ,iCAAe;CAE1D;AAFD,wDAEC"}
package/dist/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.5.4";
1
+ export declare const VERSION = "0.5.6";
2
2
  export declare const PACKAGE = "@openfort/openfort-node";
package/dist/version.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.PACKAGE = exports.VERSION = void 0;
4
- exports.VERSION = "0.5.4";
4
+ exports.VERSION = "0.5.6";
5
5
  exports.PACKAGE = "@openfort/openfort-node";
6
6
  //# sourceMappingURL=version.js.map
@@ -1,6 +1,7 @@
1
- import { AccountResponse, AccountsResponse, InventoryResponse, TransactionIntentResponse, GetAccountRequest, GetAccountInventoryRequest, ListAccountsRequest, TransferAccountOwnershipRequest, CreateAccountRequest, SignPayloadResponse, SignPayloadRequest } from "../model";
2
- export declare class AccountsApiWrapper {
3
- private readonly _api;
1
+ import { AccountResponse, AccountsResponse, CreateAccountRequest, GetAccountInventoryRequest, GetAccountRequest, InventoryResponse, ListAccountsRequest, SignPayloadRequest, SignPayloadResponse, TransactionIntentResponse, TransferAccountOwnershipRequest } from "../model";
2
+ import { AccountsApi } from "../generated/api/accountsApi";
3
+ import { BaseApiWrapper } from "./baseApiWrapper";
4
+ export declare class AccountsApiWrapper extends BaseApiWrapper<AccountsApi> {
4
5
  constructor(accessToken: string, basePath?: string);
5
6
  /**
6
7
  * Creates an account object.