diff --git a/README.md b/README.md index 03eb61e9..4809d983 100644 --- a/README.md +++ b/README.md @@ -249,6 +249,16 @@ Removes the Assembly identified by the given `assemblyId` from the memory of the Replays the Assembly identified by the given `assemblyId` (required argument). Optionally you can also provide a `notify_url` key inside `params` if you want to change the notification target. See [API documentation](https://transloadit.com/docs/api/#assemblies-assembly-id-replay-post) for more info about `params`. +The response from the `replayAssembly` is minimal and does not contain much information about the replayed assembly. Please call `getAssembly` or `awaitAssemblyCompletion` after replay to get more information: + +```js +const replayAssemblyResponse = await transloadit.replayAssembly(failedAssemblyId) + +const assembly = await transloadit.getAssembly(replayAssemblyResponse.assembly_id) +// Or +const completedAssembly = await transloadit.awaitAssemblyCompletion(replayAssemblyResponse.assembly_id) +``` + #### async awaitAssemblyCompletion(assemblyId, opts) This function will continously poll the specified Assembly `assemblyId` and resolve when it is done uploading and executing (until `result.ok` is no longer `ASSEMBLY_UPLOADING`, `ASSEMBLY_EXECUTING` or `ASSEMBLY_REPLAYING`). It resolves with the same value as `getAssembly`. diff --git a/test/integration/__tests__/live-api.js b/test/integration/__tests__/live-api.js index 24148198..a32d67c8 100644 --- a/test/integration/__tests__/live-api.js +++ b/test/integration/__tests__/live-api.js @@ -454,8 +454,7 @@ describe('API integration', function () { expect(replayedAssembly.ok).toBe('ASSEMBLY_REPLAYING') expect(replayedAssembly.assembly_id).not.toEqual(createdAssembly.assembly_id) expect(replayedAssembly.assembly_url).toBeDefined() - // TODO bug? - // expect(replayedAssembly.assembly_ssl_url).toBeDefined() + expect(replayedAssembly.assembly_ssl_url).toBeDefined() const result2 = await client.awaitAssemblyCompletion(replayedAssembly.assembly_id) expect(result2.ok).toBe('ASSEMBLY_COMPLETED') diff --git a/types/index.d.ts b/types/index.d.ts index a24f9540..85a3eaaa 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -159,8 +159,7 @@ export interface ReplayedAssembly { success: boolean, assembly_id: string, assembly_url: string, - // TODO - // assembly_ssl_url: string, + assembly_ssl_url: string, notify_url?: string, }