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