Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The preview pr is merged here: #29311. GA core-lro v3: - api view: [diff compared with v3](https://apiview.dev/Assemblies/Review/2c2e6c39be9f4efcb7dcb5812ec03caa?revisionId=aca67bf30ec540e6a93f093521d13b56&diffOnly=False&doc=False&diffRevisionId=c2c407f93624426090afa05dfb58d7c1) - migration guide: [here](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/core/core-lro/docs/MIGRATION.md) - design doc: [gist](https://gist.github.com/joheredi/09b81c192e8c7c4ee3581ac0b9f76c12#option-3-behavior-based-on-invocation), [loop 1](https://microsoft.sharepoint.com/:fl:/s/61554b56-c90b-4961-ba7c-61caae235335/ERp0F2QPyX9ElPkeL2U5pioB7_ar6uwHWYiTa7roChsHVw?e=FcS0YL&nav=cz0lMkZzaXRlcyUyRjYxNTU0YjU2LWM5MGItNDk2MS1iYTdjLTYxY2FhZTIzNTMzNSZkPWIhWkhjMnhhbl9nVXVNc3RET0NHaTNKMjZEQ09nVk5FRkxtTDg4UUNsZUpwaklYajhzTWlFSFRZVC02bTRGV2JkNSZmPTAxREdGMk9FWTJPUUxXSUQ2SlA1Q0pKNkk2RjVTVFRKUksmYz0lMkYmZmx1aWQ9MSZhPUxvb3BBcHAmcD0lNDBmbHVpZHglMkZsb29wLXBhZ2UtY29udGFpbmVyJng9JTdCJTIydyUyMiUzQSUyMlQwUlRVSHh0YVdOeWIzTnZablF1YzJoaGNtVndiMmx1ZEM1amIyMThZaUZhU0dNeWVHRnVYMmRWZFUxemRFUlBRMGRwTTBveU5rUkRUMmRXVGtWR1RHMU1PRGhSUTJ4bFNuQnFTVmhxT0hOTmFVVklWRmxVTFRadE5FWlhZbVExZkRBeFJFZEdNazlGTkZSRlRWRTBOMUpHUVRkYVJUSlBSazVEUkRSV1dEWTBNa1UlM0QlMjIlMkMlMjJpJTIyJTNBJTIyYjA3OTYyZWQtMWM4Ni00Zjg3LWE3OTctYjE0MDg1ZmEwYzY4JTIyJTdE), [loop 2](https://microsoft.sharepoint.com/:fl:/s/61554b56-c90b-4961-ba7c-61caae235335/EdO7c7zhNQ5PouqkX5YbPZ4BXAnvlDCvW9SiARuN8gMcww?e=LufGPM&nav=cz0lMkZzaXRlcyUyRjYxNTU0YjU2LWM5MGItNDk2MS1iYTdjLTYxY2FhZTIzNTMzNSZkPWIhWkhjMnhhbl9nVXVNc3RET0NHaTNKMjZEQ09nVk5FRkxtTDg4UUNsZUpwaklYajhzTWlFSFRZVC02bTRGV2JkNSZmPTAxREdGMk9FNlRYTlozWllKVkJaSDJGMlZFTDZMQldQTTYmYz0lMkYmZmx1aWQ9MSZhPUxvb3BBcHAmcD0lNDBmbHVpZHglMkZsb29wLXBhZ2UtY29udGFpbmVyJng9JTdCJTIydyUyMiUzQSUyMlQwUlRVSHh0YVdOeWIzTnZablF1YzJoaGNtVndiMmx1ZEM1amIyMThZaUZhU0dNeWVHRnVYMmRWZFUxemRFUlBRMGRwTTBveU5rUkRUMmRXVGtWR1RHMU1PRGhSUTJ4bFNuQnFTVmhxT0hOTmFVVklWRmxVTFRadE5FWlhZbVExZkRBeFJFZEdNazlGTkZSRlRWRTBOMUpHUVRkYVJUSlBSazVEUkRSV1dEWTBNa1UlM0QlMjIlMkMlMjJpJTIyJTNBJTIyYjA3OTYyZWQtMWM4Ni00Zjg3LWE3OTctYjE0MDg1ZmEwYzVjJTIyJTdE) Impacted SDKs: - Currently I think no SDKs would be impacted. - Existing HLC SDKs would use v2, no impact; - RLC LRO wrapped its interface with v3 and without any breakings([see pr detail](Azure/autorest.typescript#2443)), no impact; - Modular would use v3. The only modular SDK that is OpenAI without LRO operations, so no impact. - In future there would be breaking when migrating HLC to Modular. Main changes: ```diff - export function createHttpPoller<TResult, TState extends OperationState<TResult>>(lro: LongRunningOperation, options?: CreateHttpPollerOptions<TResult, TState>): Promise<SimplePollerLike<TState, TResult>>; + export function createHttpPoller<TResult, TState extends OperationState<TResult>>(lro: RunningOperation, options?: CreateHttpPollerOptions<TResult, TState>): PollerLike<TState, TResult>; - export interface SimplePollerLike<TState extends OperationState<TResult>, TResult> { + export interface PollerLike<TState extends OperationState<TResult>, TResult> extends Promise<TResult> { - getOperationState(): TState; + readonly operationState: TState | undefined; - getResult(): TResult | undefined; + readonly result: TResult | undefined; - isDone(): boolean; + readonly isDone: boolean; - isStopped(): boolean; - stopPolling(): void; - toString(): string; + serialize(): Promise<string>; + submitted(): Promise<void>; onProgress(callback: (state: TState) => void): CancelOnProgress; poll(options?: { abortSignal?: AbortSignalLike; - }): Promise<void>; + }): Promise<TState>; pollUntilDone(pollOptions?: { abortSignal?: AbortSignalLike; }): Promise<TResult>; } ```
- Loading branch information