@nirvana-labs/nirvana 2.1.2 → 2.2.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 (92) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/bin/migration-config.json +136 -0
  3. package/package.json +1 -1
  4. package/resources/compute/vms/volumes.d.mts +1 -1
  5. package/resources/compute/vms/volumes.d.mts.map +1 -1
  6. package/resources/compute/vms/volumes.d.ts +1 -1
  7. package/resources/compute/vms/volumes.d.ts.map +1 -1
  8. package/resources/compute/volumes/availability.d.mts +1 -1
  9. package/resources/compute/volumes/availability.d.ts +1 -1
  10. package/resources/compute/volumes/cost.d.mts +1 -1
  11. package/resources/compute/volumes/cost.d.ts +1 -1
  12. package/resources/compute/volumes/volumes.d.mts +3 -3
  13. package/resources/compute/volumes/volumes.d.mts.map +1 -1
  14. package/resources/compute/volumes/volumes.d.ts +3 -3
  15. package/resources/compute/volumes/volumes.d.ts.map +1 -1
  16. package/resources/organizations/billing/billing.d.mts +1 -1
  17. package/resources/organizations/billing/billing.d.ts +1 -1
  18. package/resources/organizations/index.d.mts +1 -1
  19. package/resources/organizations/index.d.mts.map +1 -1
  20. package/resources/organizations/index.d.ts +1 -1
  21. package/resources/organizations/index.d.ts.map +1 -1
  22. package/resources/organizations/index.js +2 -2
  23. package/resources/organizations/index.js.map +1 -1
  24. package/resources/organizations/index.mjs +1 -1
  25. package/resources/organizations/index.mjs.map +1 -1
  26. package/resources/organizations/memberships/index.d.mts +3 -0
  27. package/resources/organizations/memberships/index.d.mts.map +1 -0
  28. package/resources/organizations/memberships/index.d.ts +3 -0
  29. package/resources/organizations/memberships/index.d.ts.map +1 -0
  30. package/resources/organizations/memberships/index.js +9 -0
  31. package/resources/organizations/memberships/index.js.map +1 -0
  32. package/resources/organizations/memberships/index.mjs +4 -0
  33. package/resources/organizations/memberships/index.mjs.map +1 -0
  34. package/resources/organizations/memberships/invitations.d.mts +129 -0
  35. package/resources/organizations/memberships/invitations.d.mts.map +1 -0
  36. package/resources/organizations/memberships/invitations.d.ts +129 -0
  37. package/resources/organizations/memberships/invitations.d.ts.map +1 -0
  38. package/resources/organizations/memberships/invitations.js +80 -0
  39. package/resources/organizations/memberships/invitations.js.map +1 -0
  40. package/resources/organizations/memberships/invitations.mjs +76 -0
  41. package/resources/organizations/memberships/invitations.mjs.map +1 -0
  42. package/resources/organizations/memberships/memberships.d.mts +145 -0
  43. package/resources/organizations/memberships/memberships.d.mts.map +1 -0
  44. package/resources/organizations/memberships/memberships.d.ts +145 -0
  45. package/resources/organizations/memberships/memberships.d.ts.map +1 -0
  46. package/resources/organizations/memberships/memberships.js +93 -0
  47. package/resources/organizations/memberships/memberships.js.map +1 -0
  48. package/resources/organizations/memberships/memberships.mjs +88 -0
  49. package/resources/organizations/memberships/memberships.mjs.map +1 -0
  50. package/resources/organizations/memberships.d.mts +1 -95
  51. package/resources/organizations/memberships.d.mts.map +1 -1
  52. package/resources/organizations/memberships.d.ts +1 -95
  53. package/resources/organizations/memberships.d.ts.map +1 -1
  54. package/resources/organizations/memberships.js +2 -39
  55. package/resources/organizations/memberships.js.map +1 -1
  56. package/resources/organizations/memberships.mjs +1 -37
  57. package/resources/organizations/memberships.mjs.map +1 -1
  58. package/resources/organizations/organizations.d.mts +3 -3
  59. package/resources/organizations/organizations.d.mts.map +1 -1
  60. package/resources/organizations/organizations.d.ts +3 -3
  61. package/resources/organizations/organizations.d.ts.map +1 -1
  62. package/resources/organizations/organizations.js +2 -2
  63. package/resources/organizations/organizations.js.map +1 -1
  64. package/resources/organizations/organizations.mjs +2 -2
  65. package/resources/organizations/organizations.mjs.map +1 -1
  66. package/resources/quotas/quotas.d.mts +4 -0
  67. package/resources/quotas/quotas.d.mts.map +1 -1
  68. package/resources/quotas/quotas.d.ts +4 -0
  69. package/resources/quotas/quotas.d.ts.map +1 -1
  70. package/resources/regions/regions.d.mts +8 -0
  71. package/resources/regions/regions.d.mts.map +1 -1
  72. package/resources/regions/regions.d.ts +8 -0
  73. package/resources/regions/regions.d.ts.map +1 -1
  74. package/src/resources/compute/vms/volumes.ts +1 -1
  75. package/src/resources/compute/volumes/availability.ts +1 -1
  76. package/src/resources/compute/volumes/cost.ts +1 -1
  77. package/src/resources/compute/volumes/volumes.ts +3 -3
  78. package/src/resources/organizations/api.md +20 -4
  79. package/src/resources/organizations/billing/billing.ts +1 -1
  80. package/src/resources/organizations/index.ts +3 -1
  81. package/src/resources/organizations/memberships/index.ts +20 -0
  82. package/src/resources/organizations/memberships/invitations.ts +183 -0
  83. package/src/resources/organizations/memberships/memberships.ts +228 -0
  84. package/src/resources/organizations/memberships.ts +1 -135
  85. package/src/resources/organizations/organizations.ts +13 -9
  86. package/src/resources/quotas/quotas.ts +5 -0
  87. package/src/resources/regions/regions.ts +10 -0
  88. package/src/version.ts +1 -1
  89. package/version.d.mts +1 -1
  90. package/version.d.ts +1 -1
  91. package/version.js +1 -1
  92. package/version.mjs +1 -1
@@ -0,0 +1,129 @@
1
+ import { APIResource } from "../../../core/resource.js";
2
+ import * as Shared from "../../shared.js";
3
+ import { APIPromise } from "../../../core/api-promise.js";
4
+ import { RequestOptions } from "../../../internal/request-options.js";
5
+ export declare class Invitations extends APIResource {
6
+ /**
7
+ * Invite an email address to join an organization with a role. The membership is
8
+ * created when the invitee accepts. Owners may invite with any role; admins may
9
+ * invite with admin, billing or member.
10
+ *
11
+ * @example
12
+ * ```ts
13
+ * const organizationInvitation =
14
+ * await client.organizations.memberships.invitations.create(
15
+ * 'organization_id',
16
+ * { email: 'jane@example.com', role: 'owner' },
17
+ * );
18
+ * ```
19
+ */
20
+ create(organizationID: string, body: InvitationCreateParams, options?: RequestOptions): APIPromise<OrganizationInvitation>;
21
+ /**
22
+ * List the invitations to an organization that are still pending: not yet
23
+ * accepted, revoked or expired. Only owners and admins may list invitations.
24
+ *
25
+ * @example
26
+ * ```ts
27
+ * const organizationInvitationList =
28
+ * await client.organizations.memberships.invitations.list(
29
+ * 'organization_id',
30
+ * );
31
+ * ```
32
+ */
33
+ list(organizationID: string, options?: RequestOptions): APIPromise<OrganizationInvitationList>;
34
+ /**
35
+ * Send a pending invitation's email again. Owners may resend any invitation;
36
+ * admins may resend invitations with the admin, billing or member role.
37
+ *
38
+ * @example
39
+ * ```ts
40
+ * const organizationInvitation =
41
+ * await client.organizations.memberships.invitations.resend(
42
+ * 'invitation_id',
43
+ * { organization_id: 'organization_id' },
44
+ * );
45
+ * ```
46
+ */
47
+ resend(invitationID: string, params: InvitationResendParams, options?: RequestOptions): APIPromise<OrganizationInvitation>;
48
+ /**
49
+ * Revoke a pending invitation so it can no longer be accepted. Owners may revoke
50
+ * any invitation; admins may revoke invitations with the admin, billing or member
51
+ * role.
52
+ *
53
+ * @example
54
+ * ```ts
55
+ * await client.organizations.memberships.invitations.delete(
56
+ * 'invitation_id',
57
+ * { organization_id: 'organization_id' },
58
+ * );
59
+ * ```
60
+ */
61
+ delete(invitationID: string, params: InvitationDeleteParams, options?: RequestOptions): APIPromise<void>;
62
+ }
63
+ /**
64
+ * Organization invitation details.
65
+ */
66
+ export interface OrganizationInvitation {
67
+ /**
68
+ * Invitation ID.
69
+ */
70
+ id: string;
71
+ /**
72
+ * When the invitation was created.
73
+ */
74
+ created_at: string;
75
+ /**
76
+ * Email address the invitation was sent to.
77
+ */
78
+ email: string;
79
+ /**
80
+ * When the invitation expires.
81
+ */
82
+ expires_at: string;
83
+ /**
84
+ * ID of the user who sent the invitation, or null when the sender is not known.
85
+ */
86
+ inviter_user_id: string | null;
87
+ /**
88
+ * Organization ID.
89
+ */
90
+ organization_id: string;
91
+ /**
92
+ * Role of the user in the organization.
93
+ */
94
+ role: 'owner' | 'admin' | 'billing' | 'member';
95
+ }
96
+ export interface OrganizationInvitationList {
97
+ items: Array<OrganizationInvitation>;
98
+ /**
99
+ * Pagination response details.
100
+ */
101
+ pagination: Shared.Pagination;
102
+ }
103
+ export interface InvitationCreateParams {
104
+ /**
105
+ * Email address to invite. Inviting an address that already belongs to a member of
106
+ * the organization fails.
107
+ */
108
+ email: string;
109
+ /**
110
+ * Role of the user in the organization.
111
+ */
112
+ role: 'owner' | 'admin' | 'billing' | 'member';
113
+ }
114
+ export interface InvitationResendParams {
115
+ /**
116
+ * Organization ID
117
+ */
118
+ organization_id: string;
119
+ }
120
+ export interface InvitationDeleteParams {
121
+ /**
122
+ * Organization ID
123
+ */
124
+ organization_id: string;
125
+ }
126
+ export declare namespace Invitations {
127
+ export { type OrganizationInvitation as OrganizationInvitation, type OrganizationInvitationList as OrganizationInvitationList, type InvitationCreateParams as InvitationCreateParams, type InvitationResendParams as InvitationResendParams, type InvitationDeleteParams as InvitationDeleteParams, };
128
+ }
129
+ //# sourceMappingURL=invitations.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"invitations.d.ts","sourceRoot":"","sources":["../../../src/resources/organizations/memberships/invitations.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,kCAA+B;AACrD,OAAO,KAAK,MAAM,wBAAqB;AACvC,OAAO,EAAE,UAAU,EAAE,qCAAkC;AAEvD,OAAO,EAAE,cAAc,EAAE,6CAA0C;AAGnE,qBAAa,WAAY,SAAQ,WAAW;IAC1C;;;;;;;;;;;;;OAaG;IACH,MAAM,CACJ,cAAc,EAAE,MAAM,EACtB,IAAI,EAAE,sBAAsB,EAC5B,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,sBAAsB,CAAC;IAOrC;;;;;;;;;;;OAWG;IACH,IAAI,CAAC,cAAc,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,0BAA0B,CAAC;IAI9F;;;;;;;;;;;;OAYG;IACH,MAAM,CACJ,YAAY,EAAE,MAAM,EACpB,MAAM,EAAE,sBAAsB,EAC9B,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,sBAAsB,CAAC;IAQrC;;;;;;;;;;;;OAYG;IACH,MAAM,CAAC,YAAY,EAAE,MAAM,EAAE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BUTING.md for details.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.Invitations = void 0;
5
+ const resource_1 = require("../../../core/resource.js");
6
+ const headers_1 = require("../../../internal/headers.js");
7
+ const path_1 = require("../../../internal/utils/path.js");
8
+ class Invitations extends resource_1.APIResource {
9
+ /**
10
+ * Invite an email address to join an organization with a role. The membership is
11
+ * created when the invitee accepts. Owners may invite with any role; admins may
12
+ * invite with admin, billing or member.
13
+ *
14
+ * @example
15
+ * ```ts
16
+ * const organizationInvitation =
17
+ * await client.organizations.memberships.invitations.create(
18
+ * 'organization_id',
19
+ * { email: 'jane@example.com', role: 'owner' },
20
+ * );
21
+ * ```
22
+ */
23
+ create(organizationID, body, options) {
24
+ return this._client.post((0, path_1.path) `/v1/organizations/${organizationID}/memberships/invitations`, {
25
+ body,
26
+ ...options,
27
+ });
28
+ }
29
+ /**
30
+ * List the invitations to an organization that are still pending: not yet
31
+ * accepted, revoked or expired. Only owners and admins may list invitations.
32
+ *
33
+ * @example
34
+ * ```ts
35
+ * const organizationInvitationList =
36
+ * await client.organizations.memberships.invitations.list(
37
+ * 'organization_id',
38
+ * );
39
+ * ```
40
+ */
41
+ list(organizationID, options) {
42
+ return this._client.get((0, path_1.path) `/v1/organizations/${organizationID}/memberships/invitations`, options);
43
+ }
44
+ /**
45
+ * Send a pending invitation's email again. Owners may resend any invitation;
46
+ * admins may resend invitations with the admin, billing or member role.
47
+ *
48
+ * @example
49
+ * ```ts
50
+ * const organizationInvitation =
51
+ * await client.organizations.memberships.invitations.resend(
52
+ * 'invitation_id',
53
+ * { organization_id: 'organization_id' },
54
+ * );
55
+ * ```
56
+ */
57
+ resend(invitationID, params, options) {
58
+ const { organization_id } = params;
59
+ return this._client.post((0, path_1.path) `/v1/organizations/${organization_id}/memberships/invitations/${invitationID}/resend`, options);
60
+ }
61
+ /**
62
+ * Revoke a pending invitation so it can no longer be accepted. Owners may revoke
63
+ * any invitation; admins may revoke invitations with the admin, billing or member
64
+ * role.
65
+ *
66
+ * @example
67
+ * ```ts
68
+ * await client.organizations.memberships.invitations.delete(
69
+ * 'invitation_id',
70
+ * { organization_id: 'organization_id' },
71
+ * );
72
+ * ```
73
+ */
74
+ delete(invitationID, params, options) {
75
+ const { organization_id } = params;
76
+ return this._client.delete((0, path_1.path) `/v1/organizations/${organization_id}/memberships/invitations/${invitationID}`, { ...options, headers: (0, headers_1.buildHeaders)([{ Accept: '*/*' }, options?.headers]) });
77
+ }
78
+ }
79
+ exports.Invitations = Invitations;
80
+ //# sourceMappingURL=invitations.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"invitations.js","sourceRoot":"","sources":["../../../src/resources/organizations/memberships/invitations.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,wDAAqD;AAGrD,0DAAyD;AAEzD,0DAAoD;AAEpD,MAAa,WAAY,SAAQ,sBAAW;IAC1C;;;;;;;;;;;;;OAaG;IACH,MAAM,CACJ,cAAsB,EACtB,IAA4B,EAC5B,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAA,WAAI,EAAA,qBAAqB,cAAc,0BAA0B,EAAE;YAC1F,IAAI;YACJ,GAAG,OAAO;SACX,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;OAWG;IACH,IAAI,CAAC,cAAsB,EAAE,OAAwB;QACnD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,qBAAqB,cAAc,0BAA0B,EAAE,OAAO,CAAC,CAAC;IACtG,CAAC;IAED;;;;;;;;;;;;OAYG;IACH,MAAM,CACJ,YAAoB,EACpB,MAA8B,EAC9B,OAAwB;QAExB,MAAM,EAAE,eAAe,EAAE,GAAG,MAAM,CAAC;QACnC,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CACtB,IAAA,WAAI,EAAA,qBAAqB,eAAe,4BAA4B,YAAY,SAAS,EACzF,OAAO,CACR,CAAC;IACJ,CAAC;IAED;;;;;;;;;;;;OAYG;IACH,MAAM,CAAC,YAAoB,EAAE,MAA8B,EAAE,OAAwB;QACnF,MAAM,EAAE,eAAe,EAAE,GAAG,MAAM,CAAC;QACnC,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CACxB,IAAA,WAAI,EAAA,qBAAqB,eAAe,4BAA4B,YAAY,EAAE,EAClF,EAAE,GAAG,OAAO,EAAE,OAAO,EAAE,IAAA,sBAAY,EAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,EAAE,CAC7E,CAAC;IACJ,CAAC;CACF;AAvFD,kCAuFC"}
@@ -0,0 +1,76 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+ import { APIResource } from "../../../core/resource.mjs";
3
+ import { buildHeaders } from "../../../internal/headers.mjs";
4
+ import { path } from "../../../internal/utils/path.mjs";
5
+ export class Invitations extends APIResource {
6
+ /**
7
+ * Invite an email address to join an organization with a role. The membership is
8
+ * created when the invitee accepts. Owners may invite with any role; admins may
9
+ * invite with admin, billing or member.
10
+ *
11
+ * @example
12
+ * ```ts
13
+ * const organizationInvitation =
14
+ * await client.organizations.memberships.invitations.create(
15
+ * 'organization_id',
16
+ * { email: 'jane@example.com', role: 'owner' },
17
+ * );
18
+ * ```
19
+ */
20
+ create(organizationID, body, options) {
21
+ return this._client.post(path `/v1/organizations/${organizationID}/memberships/invitations`, {
22
+ body,
23
+ ...options,
24
+ });
25
+ }
26
+ /**
27
+ * List the invitations to an organization that are still pending: not yet
28
+ * accepted, revoked or expired. Only owners and admins may list invitations.
29
+ *
30
+ * @example
31
+ * ```ts
32
+ * const organizationInvitationList =
33
+ * await client.organizations.memberships.invitations.list(
34
+ * 'organization_id',
35
+ * );
36
+ * ```
37
+ */
38
+ list(organizationID, options) {
39
+ return this._client.get(path `/v1/organizations/${organizationID}/memberships/invitations`, options);
40
+ }
41
+ /**
42
+ * Send a pending invitation's email again. Owners may resend any invitation;
43
+ * admins may resend invitations with the admin, billing or member role.
44
+ *
45
+ * @example
46
+ * ```ts
47
+ * const organizationInvitation =
48
+ * await client.organizations.memberships.invitations.resend(
49
+ * 'invitation_id',
50
+ * { organization_id: 'organization_id' },
51
+ * );
52
+ * ```
53
+ */
54
+ resend(invitationID, params, options) {
55
+ const { organization_id } = params;
56
+ return this._client.post(path `/v1/organizations/${organization_id}/memberships/invitations/${invitationID}/resend`, options);
57
+ }
58
+ /**
59
+ * Revoke a pending invitation so it can no longer be accepted. Owners may revoke
60
+ * any invitation; admins may revoke invitations with the admin, billing or member
61
+ * role.
62
+ *
63
+ * @example
64
+ * ```ts
65
+ * await client.organizations.memberships.invitations.delete(
66
+ * 'invitation_id',
67
+ * { organization_id: 'organization_id' },
68
+ * );
69
+ * ```
70
+ */
71
+ delete(invitationID, params, options) {
72
+ const { organization_id } = params;
73
+ return this._client.delete(path `/v1/organizations/${organization_id}/memberships/invitations/${invitationID}`, { ...options, headers: buildHeaders([{ Accept: '*/*' }, options?.headers]) });
74
+ }
75
+ }
76
+ //# sourceMappingURL=invitations.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"invitations.mjs","sourceRoot":"","sources":["../../../src/resources/organizations/memberships/invitations.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,WAAW,EAAE,mCAA+B;AAGrD,OAAO,EAAE,YAAY,EAAE,sCAAkC;AAEzD,OAAO,EAAE,IAAI,EAAE,yCAAqC;AAEpD,MAAM,OAAO,WAAY,SAAQ,WAAW;IAC1C;;;;;;;;;;;;;OAaG;IACH,MAAM,CACJ,cAAsB,EACtB,IAA4B,EAC5B,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAA,qBAAqB,cAAc,0BAA0B,EAAE;YAC1F,IAAI;YACJ,GAAG,OAAO;SACX,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;OAWG;IACH,IAAI,CAAC,cAAsB,EAAE,OAAwB;QACnD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,qBAAqB,cAAc,0BAA0B,EAAE,OAAO,CAAC,CAAC;IACtG,CAAC;IAED;;;;;;;;;;;;OAYG;IACH,MAAM,CACJ,YAAoB,EACpB,MAA8B,EAC9B,OAAwB;QAExB,MAAM,EAAE,eAAe,EAAE,GAAG,MAAM,CAAC;QACnC,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CACtB,IAAI,CAAA,qBAAqB,eAAe,4BAA4B,YAAY,SAAS,EACzF,OAAO,CACR,CAAC;IACJ,CAAC;IAED;;;;;;;;;;;;OAYG;IACH,MAAM,CAAC,YAAoB,EAAE,MAA8B,EAAE,OAAwB;QACnF,MAAM,EAAE,eAAe,EAAE,GAAG,MAAM,CAAC;QACnC,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CACxB,IAAI,CAAA,qBAAqB,eAAe,4BAA4B,YAAY,EAAE,EAClF,EAAE,GAAG,OAAO,EAAE,OAAO,EAAE,YAAY,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,EAAE,CAC7E,CAAC;IACJ,CAAC;CACF"}
@@ -0,0 +1,145 @@
1
+ import { APIResource } from "../../../core/resource.mjs";
2
+ import * as Shared from "../../shared.mjs";
3
+ import * as InvitationsAPI from "./invitations.mjs";
4
+ import { InvitationCreateParams, InvitationDeleteParams, InvitationResendParams, Invitations, OrganizationInvitation, OrganizationInvitationList } from "./invitations.mjs";
5
+ import { APIPromise } from "../../../core/api-promise.mjs";
6
+ import { Cursor, type CursorParams, PagePromise } from "../../../core/pagination.mjs";
7
+ import { RequestOptions } from "../../../internal/request-options.mjs";
8
+ export declare class Memberships extends APIResource {
9
+ invitations: InvitationsAPI.Invitations;
10
+ /**
11
+ * Get details about an organization membership
12
+ *
13
+ * @example
14
+ * ```ts
15
+ * const organizationMembership =
16
+ * await client.organizations.memberships.get(
17
+ * 'membership_id',
18
+ * { organization_id: 'organization_id' },
19
+ * );
20
+ * ```
21
+ */
22
+ get(membershipID: string, params: MembershipGetParams, options?: RequestOptions): APIPromise<OrganizationMembership>;
23
+ /**
24
+ * List all memberships for an organization
25
+ *
26
+ * @example
27
+ * ```ts
28
+ * // Automatically fetches more pages as needed.
29
+ * for await (const organizationMembership of client.organizations.memberships.list(
30
+ * 'organization_id',
31
+ * )) {
32
+ * // ...
33
+ * }
34
+ * ```
35
+ */
36
+ list(organizationID: string, query?: MembershipListParams | null | undefined, options?: RequestOptions): PagePromise<OrganizationMembershipsCursor, OrganizationMembership>;
37
+ /**
38
+ * Change the role of a member of an organization. Owners may assign any role.
39
+ * Admins may assign admin, billing or member, and cannot change the role of an
40
+ * owner. The last owner cannot be demoted, and members cannot change their own
41
+ * role except for an owner stepping down while another owner remains.
42
+ *
43
+ * @example
44
+ * ```ts
45
+ * const organizationMembership =
46
+ * await client.organizations.memberships.update(
47
+ * 'membership_id',
48
+ * { organization_id: 'organization_id', role: 'owner' },
49
+ * );
50
+ * ```
51
+ */
52
+ update(membershipID: string, params: MembershipUpdateParams, options?: RequestOptions): APIPromise<OrganizationMembership>;
53
+ /**
54
+ * Remove a member from an organization. Admins cannot remove an owner, and the
55
+ * last owner cannot be removed.
56
+ *
57
+ * @example
58
+ * ```ts
59
+ * await client.organizations.memberships.delete(
60
+ * 'membership_id',
61
+ * { organization_id: 'organization_id' },
62
+ * );
63
+ * ```
64
+ */
65
+ delete(membershipID: string, params: MembershipDeleteParams, options?: RequestOptions): APIPromise<void>;
66
+ }
67
+ export type OrganizationMembershipsCursor = Cursor<OrganizationMembership>;
68
+ /**
69
+ * Organization membership details.
70
+ */
71
+ export interface OrganizationMembership {
72
+ /**
73
+ * Membership ID.
74
+ */
75
+ id: string;
76
+ /**
77
+ * When the membership was created.
78
+ */
79
+ created_at: string;
80
+ /**
81
+ * Organization ID.
82
+ */
83
+ organization_id: string;
84
+ /**
85
+ * Role of the user in the organization.
86
+ */
87
+ role: 'owner' | 'admin' | 'billing' | 'member';
88
+ /**
89
+ * When the membership was updated.
90
+ */
91
+ updated_at: string;
92
+ /**
93
+ * User ID.
94
+ */
95
+ user_id: string;
96
+ }
97
+ export interface OrganizationMembershipList {
98
+ items: Array<OrganizationMembership>;
99
+ /**
100
+ * Pagination response details.
101
+ */
102
+ pagination: Shared.Pagination;
103
+ }
104
+ export interface MembershipGetParams {
105
+ /**
106
+ * Organization ID
107
+ */
108
+ organization_id: string;
109
+ }
110
+ export interface MembershipListParams extends CursorParams {
111
+ /**
112
+ * Filter by membership role
113
+ */
114
+ role?: 'owner' | 'admin' | 'billing' | 'member';
115
+ /**
116
+ * Comma-separated sort terms in precedence order, each field:asc or field:desc.
117
+ * Fields: created_at, updated_at, role
118
+ */
119
+ sort?: string;
120
+ /**
121
+ * Filter by the member's user ID
122
+ */
123
+ user_id?: string;
124
+ }
125
+ export interface MembershipUpdateParams {
126
+ /**
127
+ * Path param: Organization ID
128
+ */
129
+ organization_id: string;
130
+ /**
131
+ * Body param: Role of the user in the organization.
132
+ */
133
+ role: 'owner' | 'admin' | 'billing' | 'member';
134
+ }
135
+ export interface MembershipDeleteParams {
136
+ /**
137
+ * Organization ID
138
+ */
139
+ organization_id: string;
140
+ }
141
+ export declare namespace Memberships {
142
+ export { type OrganizationMembership as OrganizationMembership, type OrganizationMembershipList as OrganizationMembershipList, type OrganizationMembershipsCursor as OrganizationMembershipsCursor, type MembershipGetParams as MembershipGetParams, type MembershipListParams as MembershipListParams, type MembershipUpdateParams as MembershipUpdateParams, type MembershipDeleteParams as MembershipDeleteParams, };
143
+ export { Invitations as Invitations, type OrganizationInvitation as OrganizationInvitation, type OrganizationInvitationList as OrganizationInvitationList, type InvitationCreateParams as InvitationCreateParams, type InvitationResendParams as InvitationResendParams, type InvitationDeleteParams as InvitationDeleteParams, };
144
+ }
145
+ //# sourceMappingURL=memberships.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"memberships.d.mts","source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sB,EACrD,KAAK,sBAAsB,IAAI,sBAAsB,GACtD,CAAC;IAEF,OAAO,EACL,WAAW,IAAI,WAAW,EAC1B,KAAK,sBAAsB,IAAI,sBAAsB,EACrD,KAAK,0BAA0B,IAAI,0BAA0B,EAC7D,KAAK,sBAAsB,IAAI,sBAAsB,EACrD,KAAK,sBAAsB,IAAI,sBAAsB,EACrD,KAAK,sBAAsB,IAAI,sBAAsB,GACtD,CAAC;CACH"}
@@ -0,0 +1,145 @@
1
+ import { APIResource } from "../../../core/resource.js";
2
+ import * as Shared from "../../shared.js";
3
+ import * as InvitationsAPI from "./invitations.js";
4
+ import { InvitationCreateParams, InvitationDeleteParams, InvitationResendParams, Invitations, OrganizationInvitation, OrganizationInvitationList } from "./invitations.js";
5
+ import { APIPromise } from "../../../core/api-promise.js";
6
+ import { Cursor, type CursorParams, PagePromise } from "../../../core/pagination.js";
7
+ import { RequestOptions } from "../../../internal/request-options.js";
8
+ export declare class Memberships extends APIResource {
9
+ invitations: InvitationsAPI.Invitations;
10
+ /**
11
+ * Get details about an organization membership
12
+ *
13
+ * @example
14
+ * ```ts
15
+ * const organizationMembership =
16
+ * await client.organizations.memberships.get(
17
+ * 'membership_id',
18
+ * { organization_id: 'organization_id' },
19
+ * );
20
+ * ```
21
+ */
22
+ get(membershipID: string, params: MembershipGetParams, options?: RequestOptions): APIPromise<OrganizationMembership>;
23
+ /**
24
+ * List all memberships for an organization
25
+ *
26
+ * @example
27
+ * ```ts
28
+ * // Automatically fetches more pages as needed.
29
+ * for await (const organizationMembership of client.organizations.memberships.list(
30
+ * 'organization_id',
31
+ * )) {
32
+ * // ...
33
+ * }
34
+ * ```
35
+ */
36
+ list(organizationID: string, query?: MembershipListParams | null | undefined, options?: RequestOptions): PagePromise<OrganizationMembershipsCursor, OrganizationMembership>;
37
+ /**
38
+ * Change the role of a member of an organization. Owners may assign any role.
39
+ * Admins may assign admin, billing or member, and cannot change the role of an
40
+ * owner. The last owner cannot be demoted, and members cannot change their own
41
+ * role except for an owner stepping down while another owner remains.
42
+ *
43
+ * @example
44
+ * ```ts
45
+ * const organizationMembership =
46
+ * await client.organizations.memberships.update(
47
+ * 'membership_id',
48
+ * { organization_id: 'organization_id', role: 'owner' },
49
+ * );
50
+ * ```
51
+ */
52
+ update(membershipID: string, params: MembershipUpdateParams, options?: RequestOptions): APIPromise<OrganizationMembership>;
53
+ /**
54
+ * Remove a member from an organization. Admins cannot remove an owner, and the
55
+ * last owner cannot be removed.
56
+ *
57
+ * @example
58
+ * ```ts
59
+ * await client.organizations.memberships.delete(
60
+ * 'membership_id',
61
+ * { organization_id: 'organization_id' },
62
+ * );
63
+ * ```
64
+ */
65
+ delete(membershipID: string, params: MembershipDeleteParams, options?: RequestOptions): APIPromise<void>;
66
+ }
67
+ export type OrganizationMembershipsCursor = Cursor<OrganizationMembership>;
68
+ /**
69
+ * Organization membership details.
70
+ */
71
+ export interface OrganizationMembership {
72
+ /**
73
+ * Membership ID.
74
+ */
75
+ id: string;
76
+ /**
77
+ * When the membership was created.
78
+ */
79
+ created_at: string;
80
+ /**
81
+ * Organization ID.
82
+ */
83
+ organization_id: string;
84
+ /**
85
+ * Role of the user in the organization.
86
+ */
87
+ role: 'owner' | 'admin' | 'billing' | 'member';
88
+ /**
89
+ * When the membership was updated.
90
+ */
91
+ updated_at: string;
92
+ /**
93
+ * User ID.
94
+ */
95
+ user_id: string;
96
+ }
97
+ export interface OrganizationMembershipList {
98
+ items: Array<OrganizationMembership>;
99
+ /**
100
+ * Pagination response details.
101
+ */
102
+ pagination: Shared.Pagination;
103
+ }
104
+ export interface MembershipGetParams {
105
+ /**
106
+ * Organization ID
107
+ */
108
+ organization_id: string;
109
+ }
110
+ export interface MembershipListParams extends CursorParams {
111
+ /**
112
+ * Filter by membership role
113
+ */
114
+ role?: 'owner' | 'admin' | 'billing' | 'member';
115
+ /**
116
+ * Comma-separated sort terms in precedence order, each field:asc or field:desc.
117
+ * Fields: created_at, updated_at, role
118
+ */
119
+ sort?: string;
120
+ /**
121
+ * Filter by the member's user ID
122
+ */
123
+ user_id?: string;
124
+ }
125
+ export interface MembershipUpdateParams {
126
+ /**
127
+ * Path param: Organization ID
128
+ */
129
+ organization_id: string;
130
+ /**
131
+ * Body param: Role of the user in the organization.
132
+ */
133
+ role: 'owner' | 'admin' | 'billing' | 'member';
134
+ }
135
+ export interface MembershipDeleteParams {
136
+ /**
137
+ * Organization ID
138
+ */
139
+ organization_id: string;
140
+ }
141
+ export declare namespace Memberships {
142
+ export { type OrganizationMembership as OrganizationMembership, type OrganizationMembershipList as OrganizationMembershipList, type OrganizationMembershipsCursor as OrganizationMembershipsCursor, type MembershipGetParams as MembershipGetParams, type MembershipListParams as MembershipListParams, type MembershipUpdateParams as MembershipUpdateParams, type MembershipDeleteParams as MembershipDeleteParams, };
143
+ export { Invitations as Invitations, type OrganizationInvitation as OrganizationInvitation, type OrganizationInvitationList as OrganizationInvitationList, type InvitationCreateParams as InvitationCreateParams, type InvitationResendParams as InvitationResendParams, type InvitationDeleteParams as InvitationDeleteParams, };
144
+ }
145
+ //# sourceMappingURL=memberships.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"memberships.d.ts","sourceRoot":"","sources":["../../../src/resources/organizations/memberships/memberships.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,kCAA+B;AACrD,OAAO,KAAK,MAAM,wBAAqB;AACvC,OAAO,KAAK,cAAc,yBAAsB;AAChD,OAAO,EACL,sBAAsB,EACtB,sBAAsB,EACtB,sBAAsB,EACtB,WAAW,EACX,sBAAsB,EACtB,0BAA0B,EAC3B,yBAAsB;AACvB,OAAO,EAAE,UAAU,EAAE,qCAAkC;AACvD,OAAO,EAAE,MAAM,EAAE,KAAK,YAAY,EAAE,WAAW,EAAE,oCAAiC;AAElF,OAAO,EAAE,cAAc,EAAE,6CAA0C;AAGnE,qBAAa,WAAY,SAAQ,WAAW;IAC1C,WAAW,EAAE,cAAc,CAAC,WAAW,CAAgD;IAEvF;;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