@owbase/node 1.0.0 → 2.0.0

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 (92) hide show
  1. package/README.md +1 -1
  2. package/dist/client.js +3 -3
  3. package/dist/client.js.map +1 -1
  4. package/dist/client.mjs +3 -3
  5. package/dist/client.mjs.map +1 -1
  6. package/dist/enums/databases-index-type.d.mts +2 -1
  7. package/dist/enums/databases-index-type.d.ts +2 -1
  8. package/dist/enums/databases-index-type.js +1 -0
  9. package/dist/enums/databases-index-type.js.map +1 -1
  10. package/dist/enums/databases-index-type.mjs +1 -0
  11. package/dist/enums/databases-index-type.mjs.map +1 -1
  12. package/dist/enums/project-policy-id.d.mts +1 -0
  13. package/dist/enums/project-policy-id.d.ts +1 -0
  14. package/dist/enums/project-policy-id.js +1 -0
  15. package/dist/enums/project-policy-id.js.map +1 -1
  16. package/dist/enums/project-policy-id.mjs +1 -0
  17. package/dist/enums/project-policy-id.mjs.map +1 -1
  18. package/dist/enums/tables-db-index-type.d.mts +2 -1
  19. package/dist/enums/tables-db-index-type.d.ts +2 -1
  20. package/dist/enums/tables-db-index-type.js +1 -0
  21. package/dist/enums/tables-db-index-type.js.map +1 -1
  22. package/dist/enums/tables-db-index-type.mjs +1 -0
  23. package/dist/enums/tables-db-index-type.mjs.map +1 -1
  24. package/dist/models.d.mts +236 -3
  25. package/dist/models.d.ts +236 -3
  26. package/dist/services/account.d.mts +32 -0
  27. package/dist/services/account.d.ts +32 -0
  28. package/dist/services/account.js +27 -0
  29. package/dist/services/account.js.map +1 -1
  30. package/dist/services/account.mjs +27 -0
  31. package/dist/services/account.mjs.map +1 -1
  32. package/dist/services/databases.d.mts +211 -47
  33. package/dist/services/databases.d.ts +211 -47
  34. package/dist/services/databases.js +301 -41
  35. package/dist/services/databases.js.map +1 -1
  36. package/dist/services/databases.mjs +301 -41
  37. package/dist/services/databases.mjs.map +1 -1
  38. package/dist/services/functions.d.mts +30 -12
  39. package/dist/services/functions.d.ts +30 -12
  40. package/dist/services/functions.js +34 -4
  41. package/dist/services/functions.js.map +1 -1
  42. package/dist/services/functions.mjs +34 -4
  43. package/dist/services/functions.mjs.map +1 -1
  44. package/dist/services/messaging.d.mts +56 -44
  45. package/dist/services/messaging.d.ts +56 -44
  46. package/dist/services/messaging.js +96 -76
  47. package/dist/services/messaging.js.map +1 -1
  48. package/dist/services/messaging.mjs +96 -76
  49. package/dist/services/messaging.mjs.map +1 -1
  50. package/dist/services/organization.d.mts +4 -1
  51. package/dist/services/organization.d.ts +4 -1
  52. package/dist/services/organization.js +6 -1
  53. package/dist/services/organization.js.map +1 -1
  54. package/dist/services/organization.mjs +6 -1
  55. package/dist/services/organization.mjs.map +1 -1
  56. package/dist/services/project.d.mts +115 -65
  57. package/dist/services/project.d.ts +115 -65
  58. package/dist/services/project.js +138 -77
  59. package/dist/services/project.js.map +1 -1
  60. package/dist/services/project.mjs +138 -77
  61. package/dist/services/project.mjs.map +1 -1
  62. package/dist/services/sites.d.mts +20 -8
  63. package/dist/services/sites.d.ts +20 -8
  64. package/dist/services/sites.js +24 -4
  65. package/dist/services/sites.js.map +1 -1
  66. package/dist/services/sites.mjs +24 -4
  67. package/dist/services/sites.mjs.map +1 -1
  68. package/dist/services/storage.d.mts +16 -4
  69. package/dist/services/storage.d.ts +16 -4
  70. package/dist/services/storage.js +22 -2
  71. package/dist/services/storage.js.map +1 -1
  72. package/dist/services/storage.mjs +22 -2
  73. package/dist/services/storage.mjs.map +1 -1
  74. package/dist/services/tables-db.d.mts +210 -47
  75. package/dist/services/tables-db.d.ts +210 -47
  76. package/dist/services/tables-db.js +296 -41
  77. package/dist/services/tables-db.js.map +1 -1
  78. package/dist/services/tables-db.mjs +296 -41
  79. package/dist/services/tables-db.mjs.map +1 -1
  80. package/dist/services/teams.d.mts +4 -1
  81. package/dist/services/teams.d.ts +4 -1
  82. package/dist/services/teams.js +6 -1
  83. package/dist/services/teams.js.map +1 -1
  84. package/dist/services/teams.mjs +6 -1
  85. package/dist/services/teams.mjs.map +1 -1
  86. package/dist/services/webhooks.d.mts +16 -10
  87. package/dist/services/webhooks.d.ts +16 -10
  88. package/dist/services/webhooks.js +12 -2
  89. package/dist/services/webhooks.js.map +1 -1
  90. package/dist/services/webhooks.mjs +12 -2
  91. package/dist/services/webhooks.mjs.map +1 -1
  92. package/package.json +1 -1
@@ -138,6 +138,28 @@ declare class Account {
138
138
  * @deprecated Use the object parameter style method for a better developer experience.
139
139
  */
140
140
  deleteIdentity(identityId: string): Promise<{}>;
141
+ /**
142
+ * Get the team memberships of the currently logged in user.
143
+ *
144
+ * @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://docs.owbase.dev/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, teamId, invited, joined, confirm, roles
145
+ * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated.
146
+ * @throws {OwbaseException}
147
+ * @returns {Promise<Models.MembershipList>}
148
+ */
149
+ listMemberships(params?: {
150
+ queries?: string[];
151
+ total?: boolean;
152
+ }): Promise<Models.MembershipList>;
153
+ /**
154
+ * Get the team memberships of the currently logged in user.
155
+ *
156
+ * @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://docs.owbase.dev/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, teamId, invited, joined, confirm, roles
157
+ * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated.
158
+ * @throws {OwbaseException}
159
+ * @returns {Promise<Models.MembershipList>}
160
+ * @deprecated Use the object parameter style method for a better developer experience.
161
+ */
162
+ listMemberships(queries?: string[], total?: boolean): Promise<Models.MembershipList>;
141
163
  /**
142
164
  * Enable or disable MFA on an account.
143
165
  *
@@ -666,6 +688,9 @@ declare class Account {
666
688
  *
667
689
  * Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface.
668
690
  *
691
+ * The new password must satisfy the project's enabled password policies, including custom deny lists. Dictionary entries match the entire password case-sensitively; personal-data terms match substrings case-insensitively. Personal-data validation runs after token verification against the recovered user's ID, name, email, and phone, closing the previous recovery gap for profile-based checks. A rejected password leaves the existing credentials unchanged and the recovery token usable.
692
+ *
693
+ *
669
694
  * @param {string} params.userId - User ID.
670
695
  * @param {string} params.secret - Valid reset token.
671
696
  * @param {string} params.password - New user password. Must be between 8 and 256 chars.
@@ -682,6 +707,9 @@ declare class Account {
682
707
  *
683
708
  * Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface.
684
709
  *
710
+ * The new password must satisfy the project's enabled password policies, including custom deny lists. Dictionary entries match the entire password case-sensitively; personal-data terms match substrings case-insensitively. Personal-data validation runs after token verification against the recovered user's ID, name, email, and phone, closing the previous recovery gap for profile-based checks. A rejected password leaves the existing credentials unchanged and the recovery token usable.
711
+ *
712
+ *
685
713
  * @param {string} userId - User ID.
686
714
  * @param {string} secret - Valid reset token.
687
715
  * @param {string} password - New user password. Must be between 8 and 256 chars.
@@ -721,6 +749,8 @@ declare class Account {
721
749
  /**
722
750
  * Use this endpoint to complete the user password recovery process using the 6-digit code that was emailed by [createRecoveryOTP](https://docs.owbase.dev/references/cloud/client-web/account#createRecoveryOTP). Pass the **userId** of the user along with the **secret** code from the email and the new **password** to set. If confirmed, this route will return a 200 status code, the code is consumed and the user's password is updated.
723
751
  *
752
+ * The new password must satisfy the project's enabled password policies, including custom deny lists. Dictionary entries match the entire password case-sensitively; personal-data terms match substrings case-insensitively. Personal-data validation runs after token verification against the recovered user's ID, name, email, and phone, closing the previous recovery gap for profile-based checks. A rejected password leaves the existing credentials unchanged and the recovery token usable.
753
+ *
724
754
  *
725
755
  * @param {string} params.userId - User ID.
726
756
  * @param {string} params.secret - Valid recovery OTP code.
@@ -736,6 +766,8 @@ declare class Account {
736
766
  /**
737
767
  * Use this endpoint to complete the user password recovery process using the 6-digit code that was emailed by [createRecoveryOTP](https://docs.owbase.dev/references/cloud/client-web/account#createRecoveryOTP). Pass the **userId** of the user along with the **secret** code from the email and the new **password** to set. If confirmed, this route will return a 200 status code, the code is consumed and the user's password is updated.
738
768
  *
769
+ * The new password must satisfy the project's enabled password policies, including custom deny lists. Dictionary entries match the entire password case-sensitively; personal-data terms match substrings case-insensitively. Personal-data validation runs after token verification against the recovered user's ID, name, email, and phone, closing the previous recovery gap for profile-based checks. A rejected password leaves the existing credentials unchanged and the recovery token usable.
770
+ *
739
771
  *
740
772
  * @param {string} userId - User ID.
741
773
  * @param {string} secret - Valid recovery OTP code.
@@ -158,6 +158,33 @@ class Account {
158
158
  };
159
159
  return this.client.call("delete", uri, apiHeaders, apiPayload);
160
160
  }
161
+ listMemberships(paramsOrFirst, ...rest) {
162
+ let params;
163
+ if (typeof paramsOrFirst === "undefined" && rest.length === 0 || paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
164
+ params = paramsOrFirst || {};
165
+ } else {
166
+ params = {
167
+ queries: paramsOrFirst,
168
+ total: rest[0]
169
+ };
170
+ }
171
+ const queries = params.queries;
172
+ const total = params.total;
173
+ const apiPath = "/account/memberships";
174
+ const apiPayload = {};
175
+ if (typeof queries !== "undefined") {
176
+ apiPayload["queries"] = queries;
177
+ }
178
+ if (typeof total !== "undefined") {
179
+ apiPayload["total"] = total;
180
+ }
181
+ const uri = new URL(this.client.config.endpoint + apiPath);
182
+ const apiHeaders = {
183
+ "X-Owbase-Project": this.client.config.project,
184
+ accept: "application/json"
185
+ };
186
+ return this.client.call("get", uri, apiHeaders, apiPayload);
187
+ }
161
188
  updateMFA(paramsOrFirst) {
162
189
  let params;
163
190
  if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {