@dynamic-labs/sdk-api-core 0.151.0 → 0.152.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 (32) hide show
  1. package/package.json +1 -1
  2. package/src/apis/SDKApi.cjs +121 -0
  3. package/src/apis/SDKApi.cjs.map +1 -1
  4. package/src/apis/SDKApi.d.ts +51 -1
  5. package/src/apis/SDKApi.js +121 -0
  6. package/src/apis/SDKApi.js.map +1 -1
  7. package/src/apis/WaasApi.cjs +1 -0
  8. package/src/apis/WaasApi.cjs.map +1 -1
  9. package/src/apis/WaasApi.js +1 -0
  10. package/src/apis/WaasApi.js.map +1 -1
  11. package/src/index.cjs +20 -0
  12. package/src/index.cjs.map +1 -1
  13. package/src/index.js +3 -0
  14. package/src/index.js.map +1 -1
  15. package/src/models/AcceptBusinessAccountInviteResponse.cjs +36 -0
  16. package/src/models/AcceptBusinessAccountInviteResponse.cjs.map +1 -0
  17. package/src/models/AcceptBusinessAccountInviteResponse.d.ts +35 -0
  18. package/src/models/AcceptBusinessAccountInviteResponse.js +30 -0
  19. package/src/models/AcceptBusinessAccountInviteResponse.js.map +1 -0
  20. package/src/models/BusinessAccountInvite.cjs +70 -0
  21. package/src/models/BusinessAccountInvite.cjs.map +1 -0
  22. package/src/models/BusinessAccountInvite.d.ts +103 -0
  23. package/src/models/BusinessAccountInvite.js +64 -0
  24. package/src/models/BusinessAccountInvite.js.map +1 -0
  25. package/src/models/BusinessAccountInviteListResponse.cjs +33 -0
  26. package/src/models/BusinessAccountInviteListResponse.cjs.map +1 -0
  27. package/src/models/BusinessAccountInviteListResponse.d.ts +28 -0
  28. package/src/models/BusinessAccountInviteListResponse.js +27 -0
  29. package/src/models/BusinessAccountInviteListResponse.js.map +1 -0
  30. package/src/models/index.d.ts +3 -0
  31. package/src/version.cjs +1 -1
  32. package/src/version.js +1 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dynamic-labs/sdk-api-core",
3
- "version": "0.151.0",
3
+ "version": "0.152.0",
4
4
  "author": "Dynamic Labs",
5
5
  "license": "Apache-2.0",
6
6
  "publishConfig": {
@@ -3,6 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var runtime = require('../runtime.cjs');
6
+ var AcceptBusinessAccountInviteResponse = require('../models/AcceptBusinessAccountInviteResponse.cjs');
6
7
  var Account = require('../models/Account.cjs');
7
8
  require('../models/ProviderEnum.cjs');
8
9
  require('../models/UserIdentifierTypeEnum.cjs');
@@ -57,6 +58,8 @@ var BusinessAccountMember = require('../models/BusinessAccountMember.cjs');
57
58
  require('../models/ChainEnum.cjs');
58
59
  var BusinessAccountGovernanceResponse = require('../models/BusinessAccountGovernanceResponse.cjs');
59
60
  require('../models/BusinessAccountGovernedAction.cjs');
61
+ require('../models/BusinessAccountInvite.cjs');
62
+ var BusinessAccountInviteListResponse = require('../models/BusinessAccountInviteListResponse.cjs');
60
63
  var BusinessAccountList = require('../models/BusinessAccountList.cjs');
61
64
  var BusinessAccountMemberCreationResult = require('../models/BusinessAccountMemberCreationResult.cjs');
62
65
  require('../models/BusinessAccountMemberInviteReceipt.cjs');
@@ -376,6 +379,68 @@ var YieldVaultRewardsResponse = require('../models/YieldVaultRewardsResponse.cjs
376
379
  *
377
380
  */
378
381
  class SDKApi extends runtime.BaseAPI {
382
+ /**
383
+ * Activates the authenticated user\'s pending RBAC membership and creates their business account member record atomically. The target user is always the authenticated JWT subject. Repeating a successful acceptance returns the same accepted invitation and active member.
384
+ * Accept a pending business account invitation
385
+ */
386
+ async acceptBusinessAccountInviteRaw(requestParameters, initOverrides) {
387
+ if (requestParameters.environmentId === null || requestParameters.environmentId === undefined) {
388
+ throw new runtime.RequiredError('environmentId', 'Required parameter requestParameters.environmentId was null or undefined when calling acceptBusinessAccountInvite.');
389
+ }
390
+ if (requestParameters.inviteId === null || requestParameters.inviteId === undefined) {
391
+ throw new runtime.RequiredError('inviteId', 'Required parameter requestParameters.inviteId was null or undefined when calling acceptBusinessAccountInvite.');
392
+ }
393
+ const queryParameters = {};
394
+ const headerParameters = {};
395
+ if (this.configuration && this.configuration.accessToken) {
396
+ const token = this.configuration.accessToken;
397
+ const tokenString = await token("bearerAuth", []);
398
+ if (tokenString) {
399
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
400
+ }
401
+ }
402
+ const response = await this.request({
403
+ path: `/sdk/{environmentId}/businessAccounts/invites/{inviteId}/accept`.replace(`{${"environmentId"}}`, encodeURIComponent(String(requestParameters.environmentId))).replace(`{${"inviteId"}}`, encodeURIComponent(String(requestParameters.inviteId))),
404
+ method: 'POST',
405
+ headers: headerParameters,
406
+ query: queryParameters,
407
+ }, initOverrides);
408
+ return new runtime.JSONApiResponse(response, (jsonValue) => AcceptBusinessAccountInviteResponse.AcceptBusinessAccountInviteResponseFromJSON(jsonValue));
409
+ }
410
+ /**
411
+ * Activates the authenticated user\'s pending RBAC membership and creates their business account member record atomically. The target user is always the authenticated JWT subject. Repeating a successful acceptance returns the same accepted invitation and active member.
412
+ * Accept a pending business account invitation
413
+ */
414
+ async acceptBusinessAccountInvite(requestParameters, initOverrides) {
415
+ const response = await this.acceptBusinessAccountInviteRaw(requestParameters, initOverrides);
416
+ return await response.value();
417
+ }
418
+ /**
419
+ * Options call for this endpoint
420
+ */
421
+ async acceptBusinessAccountInviteOptionsRaw(requestParameters, initOverrides) {
422
+ if (requestParameters.environmentId === null || requestParameters.environmentId === undefined) {
423
+ throw new runtime.RequiredError('environmentId', 'Required parameter requestParameters.environmentId was null or undefined when calling acceptBusinessAccountInviteOptions.');
424
+ }
425
+ if (requestParameters.inviteId === null || requestParameters.inviteId === undefined) {
426
+ throw new runtime.RequiredError('inviteId', 'Required parameter requestParameters.inviteId was null or undefined when calling acceptBusinessAccountInviteOptions.');
427
+ }
428
+ const queryParameters = {};
429
+ const headerParameters = {};
430
+ const response = await this.request({
431
+ path: `/sdk/{environmentId}/businessAccounts/invites/{inviteId}/accept`.replace(`{${"environmentId"}}`, encodeURIComponent(String(requestParameters.environmentId))).replace(`{${"inviteId"}}`, encodeURIComponent(String(requestParameters.inviteId))),
432
+ method: 'OPTIONS',
433
+ headers: headerParameters,
434
+ query: queryParameters,
435
+ }, initOverrides);
436
+ return new runtime.VoidApiResponse(response);
437
+ }
438
+ /**
439
+ * Options call for this endpoint
440
+ */
441
+ async acceptBusinessAccountInviteOptions(requestParameters, initOverrides) {
442
+ await this.acceptBusinessAccountInviteOptionsRaw(requestParameters, initOverrides);
443
+ }
379
444
  /**
380
445
  * Sets the source wallet address and chain on a flow and mints the capability sessionToken used to drive the rest of the lifecycle. No API key or token is required (the browser has neither at this point) — the endpoint is gated by the flow\'s state and by CORS. A source can be attached while the flow is initiated, source_attached, quoted or signing, so a payer can switch source before broadcasting. Unlike quote, prepare, broadcast and cancel, which always require the session token, attach needs no token for the first attach or while the flow is source_attached or quoted. From signing, the current session token must be supplied (X-Dynamic-Flow-Session-Token) to prove the caller is the original signer; otherwise the request is rejected with 403 session_token_invalid. Once the flow has been broadcasted or source_detected, or has reached a terminal state, the request is rejected with 409 flow_invalid_transition. Each attach mints a new session token and invalidates the previous one, so at most one live token exists per flow at a time.
381
446
  * Attach a source to a flow and mint a session token
@@ -3822,6 +3887,62 @@ class SDKApi extends runtime.BaseAPI {
3822
3887
  async getBackupTokenOptions(requestParameters, initOverrides) {
3823
3888
  await this.getBackupTokenOptionsRaw(requestParameters, initOverrides);
3824
3889
  }
3890
+ /**
3891
+ * Returns unexpired invitations sent to the authenticated user in this environment. Invitee identity comes exclusively from the authenticated JWT and cannot be supplied in the request.
3892
+ * List the authenticated user\'s pending business account invitations
3893
+ */
3894
+ async getBusinessAccountInvitesRaw(requestParameters, initOverrides) {
3895
+ if (requestParameters.environmentId === null || requestParameters.environmentId === undefined) {
3896
+ throw new runtime.RequiredError('environmentId', 'Required parameter requestParameters.environmentId was null or undefined when calling getBusinessAccountInvites.');
3897
+ }
3898
+ const queryParameters = {};
3899
+ const headerParameters = {};
3900
+ if (this.configuration && this.configuration.accessToken) {
3901
+ const token = this.configuration.accessToken;
3902
+ const tokenString = await token("bearerAuth", []);
3903
+ if (tokenString) {
3904
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
3905
+ }
3906
+ }
3907
+ const response = await this.request({
3908
+ path: `/sdk/{environmentId}/businessAccounts/invites`.replace(`{${"environmentId"}}`, encodeURIComponent(String(requestParameters.environmentId))),
3909
+ method: 'GET',
3910
+ headers: headerParameters,
3911
+ query: queryParameters,
3912
+ }, initOverrides);
3913
+ return new runtime.JSONApiResponse(response, (jsonValue) => BusinessAccountInviteListResponse.BusinessAccountInviteListResponseFromJSON(jsonValue));
3914
+ }
3915
+ /**
3916
+ * Returns unexpired invitations sent to the authenticated user in this environment. Invitee identity comes exclusively from the authenticated JWT and cannot be supplied in the request.
3917
+ * List the authenticated user\'s pending business account invitations
3918
+ */
3919
+ async getBusinessAccountInvites(requestParameters, initOverrides) {
3920
+ const response = await this.getBusinessAccountInvitesRaw(requestParameters, initOverrides);
3921
+ return await response.value();
3922
+ }
3923
+ /**
3924
+ * Options call for this endpoint
3925
+ */
3926
+ async getBusinessAccountInvitesOptionsRaw(requestParameters, initOverrides) {
3927
+ if (requestParameters.environmentId === null || requestParameters.environmentId === undefined) {
3928
+ throw new runtime.RequiredError('environmentId', 'Required parameter requestParameters.environmentId was null or undefined when calling getBusinessAccountInvitesOptions.');
3929
+ }
3930
+ const queryParameters = {};
3931
+ const headerParameters = {};
3932
+ const response = await this.request({
3933
+ path: `/sdk/{environmentId}/businessAccounts/invites`.replace(`{${"environmentId"}}`, encodeURIComponent(String(requestParameters.environmentId))),
3934
+ method: 'OPTIONS',
3935
+ headers: headerParameters,
3936
+ query: queryParameters,
3937
+ }, initOverrides);
3938
+ return new runtime.VoidApiResponse(response);
3939
+ }
3940
+ /**
3941
+ * Options call for this endpoint
3942
+ */
3943
+ async getBusinessAccountInvitesOptions(requestParameters, initOverrides) {
3944
+ await this.getBusinessAccountInvitesOptionsRaw(requestParameters, initOverrides);
3945
+ }
3825
3946
  /**
3826
3947
  * Returns the Composition account-Layer content for the business account — the Rules that apply to every wallet in the business account. BA owner/admin only. Returns 404 if the caller is not a qualifying owner/admin of the business account, or if the account-Layer has not been minted yet (it\'s created by the first PATCH to this path, or the first time a signer is added to a wallet in this business account with Composition enabled — see the PATCH docs on this same path).
3827
3948
  * Get the business account\'s account-Layer Rules