@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.
- package/dist/cjs/.tsbuildinfo +1 -1
- package/dist/cjs/mixins/OxyServices.accounts.js +36 -0
- package/dist/esm/.tsbuildinfo +1 -1
- package/dist/esm/mixins/OxyServices.accounts.js +36 -0
- package/dist/types/.tsbuildinfo +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/mixins/OxyServices.accounts.d.ts +65 -2
- package/dist/types/models/interfaces.d.ts +17 -1
- package/package.json +2 -2
- package/src/index.ts +4 -0
- package/src/mixins/OxyServices.accounts.ts +107 -4
- package/src/models/interfaces.ts +17 -0
|
@@ -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.
|