@oxyhq/core 17.0.3 → 17.1.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.
@@ -119,6 +119,42 @@ export function OxyServicesAccountsMixin(Base) {
119
119
  throw this.handleError(error);
120
120
  }
121
121
  }
122
+ /**
123
+ * Mint a `channel` account under `ownerUserId` via service auth
124
+ * (`accounts:provision` scope). Requires `configureServiceAuth` first.
125
+ */
126
+ async provisionChannelAccount(data) {
127
+ try {
128
+ return await this.makeServiceRequest('POST', '/accounts/service/channels', data);
129
+ }
130
+ catch (error) {
131
+ throw this.handleError(error);
132
+ }
133
+ }
134
+ /**
135
+ * Grant membership on a channel account via service auth
136
+ * (`accounts:provision` scope).
137
+ */
138
+ async provisionChannelMember(channelAccountId, data) {
139
+ try {
140
+ return await this.makeServiceRequest('POST', `/accounts/service/channels/${encodeURIComponent(channelAccountId)}/members`, data);
141
+ }
142
+ catch (error) {
143
+ throw this.handleError(error);
144
+ }
145
+ }
146
+ /**
147
+ * Revoke membership on a channel account via service auth
148
+ * (`accounts:provision` scope).
149
+ */
150
+ async revokeChannelMember(channelAccountId, memberUserId) {
151
+ try {
152
+ return await this.makeServiceRequest('DELETE', `/accounts/service/channels/${encodeURIComponent(channelAccountId)}/members/${encodeURIComponent(memberUserId)}`);
153
+ }
154
+ catch (error) {
155
+ throw this.handleError(error);
156
+ }
157
+ }
122
158
  /**
123
159
  * Update an account's mutable profile fields. Tree placement changes
124
160
  * (reparenting) go through the dedicated move endpoint, not here.