@@ -138,6 +138,53 @@ function listTokens(
138138 return apiClient . listWaitpointTokens ( params , $requestOptions ) ;
139139}
140140
141+ /**
142+ * Retrieves a waitpoint token by its ID.
143+ *
144+ * @example
145+ * ```ts
146+ * const token = await wait.retrieveToken("waitpoint_12345678910");
147+ * console.log("Token status:", token.status);
148+ * console.log("Token tags:", token.tags);
149+ * ```
150+ *
151+ * @param token - The token to retrieve.
152+ * This can be a string token ID or an object with an `id` property.
153+ * @param requestOptions - Optional API request options.
154+ * @returns The waitpoint token details.
155+ */
156+ function retrieveToken (
157+ token : string | { id : string } ,
158+ requestOptions ?: ApiRequestOptions
159+ ) : ApiPromise < WaitpointTokenItem > {
160+ const apiClient = apiClientManager . clientOrThrow ( ) ;
161+
162+ const $tokenId = typeof token === "string" ? token : token . id ;
163+
164+ const $requestOptions = mergeRequestOptions (
165+ {
166+ tracer,
167+ name : "wait.retrieveToken()" ,
168+ icon : "wait-token" ,
169+ attributes : {
170+ id : $tokenId ,
171+ ...accessoryAttributes ( {
172+ items : [
173+ {
174+ text : $tokenId ,
175+ variant : "normal" ,
176+ } ,
177+ ] ,
178+ style : "codepath" ,
179+ } ) ,
180+ } ,
181+ } ,
182+ requestOptions
183+ ) ;
184+
185+ return apiClient . retrieveWaitpointToken ( $tokenId , $requestOptions ) ;
186+ }
187+
141188/**
142189 * This completes a waitpoint token.
143190 * You can use this to complete a waitpoint token that you created earlier.
@@ -338,6 +385,7 @@ export const wait = {
338385 createToken,
339386 listTokens,
340387 completeToken,
388+ retrieveToken,
341389 /**
342390 * This waits for a waitpoint token to be completed.
343391 * It can only be used inside a task.run() block.
0 commit comments