@@ -204,14 +204,17 @@ const getPersonalAccessTokens = async () => {
204204}
205205
206206/**
207- * Create new User Personal Access Token
207+ * Create a new User Personal Access Token
208208 * See [routes/api/user.js](../../../forge/routes/api/user.js)
209209 * @param {string } name
210210 * @param {string } scope
211211 * @param {number } expiresAt
212+ * @param {boolean } readOnly
213+ * @param {boolean } adminOptIn
214+ * @param {Array<string> } teamIds
212215 */
213- const createPersonalAccessToken = async ( name , scope , expiresAt ) => {
214- return client . post ( '/api/v1/user/tokens' , { name, scope, expiresAt } ) . then ( res => res . data )
216+ const createPersonalAccessToken = async ( name , scope , expiresAt , { readOnly , adminOptIn , teamIds } = { } ) => {
217+ return client . post ( '/api/v1/user/tokens' , { name, scope, expiresAt, readOnly , adminOptIn , teamIds } ) . then ( res => res . data )
215218}
216219
217220/**
@@ -224,10 +227,18 @@ const deletePersonalAccessToken = async (id) => {
224227}
225228
226229/**
227- * Update User Personal Token
230+ * Update User Personal Access Token
231+ * See [routes/api/user.js](../../../forge/routes/api/user.js)
232+ * @param {string } id The token ID to update
233+ * @param {string } scope The token scope
234+ * @param {number } expiresAt Expiration timestamp
235+ * @param {Object } options Optional configuration
236+ * @param {boolean } options.readOnly Whether the token is read-only
237+ * @param {boolean } options.adminOptIn Whether admin opt-in is enabled
238+ * @param {Array<string> } options.teamIds Array of team IDs the token is scoped to
228239 */
229- const updatePersonalAccessToken = async ( id , scope , expiresAt ) => {
230- return client . put ( '/api/v1/user/tokens/' + id , { scope, expiresAt } )
240+ const updatePersonalAccessToken = async ( id , scope , expiresAt , { readOnly , adminOptIn , teamIds } = { } ) => {
241+ return client . put ( '/api/v1/user/tokens/' + id , { scope, expiresAt, readOnly , adminOptIn , teamIds } ) . then ( res => res . data )
231242}
232243
233244const enableMFA = async ( ) => {
0 commit comments