@gooddata/sdk-ui 8.10.0-alpha.32 → 8.10.0-alpha.35
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/base/react/useCancelablePromise.d.ts +15 -11
- package/dist/base/react/useCancelablePromise.d.ts.map +1 -1
- package/dist/base/react/useCancelablePromise.js +6 -2
- package/dist/base/react/useCancelablePromise.js.map +1 -1
- package/dist/base/react/useCancelablePromiseUtils.d.ts +2 -2
- package/dist/base/react/useCancelablePromiseUtils.js +2 -2
- package/dist/base/results/internal/definitionMethods.d.ts +1 -1
- package/dist/base/results/internal/definitionMethods.js +1 -1
- package/dist/base/results/internal/resultDataMethods.d.ts +1 -1
- package/dist/base/results/internal/resultMetaMethods.d.ts +1 -1
- package/dist/base/results/internal/resultMetaMethods.js +1 -1
- package/dist/execution/ExecuteInsight.d.ts +19 -2
- package/dist/execution/ExecuteInsight.d.ts.map +1 -1
- package/dist/execution/ExecuteInsight.js +6 -4
- package/dist/execution/ExecuteInsight.js.map +1 -1
- package/dist/execution/useDataExport.d.ts +3 -3
- package/dist/execution/useDataExport.js +1 -1
- package/dist/execution/useDataView.d.ts +3 -0
- package/dist/execution/useDataView.d.ts.map +1 -1
- package/dist/execution/useDataView.js +1 -0
- package/dist/execution/useDataView.js.map +1 -1
- package/dist/execution/useExecution.d.ts +2 -0
- package/dist/execution/useExecution.d.ts.map +1 -1
- package/dist/execution/useExecution.js +1 -0
- package/dist/execution/useExecution.js.map +1 -1
- package/dist/execution/useExecutionDataView.d.ts +3 -3
- package/dist/execution/useExecutionDataView.js +1 -1
- package/dist/execution/useInsightDataView.d.ts +19 -2
- package/dist/execution/useInsightDataView.d.ts.map +1 -1
- package/dist/execution/useInsightDataView.js +5 -4
- package/dist/execution/useInsightDataView.js.map +1 -1
- package/dist/sdk-ui.d.ts +69 -26
- package/esm/base/react/useCancelablePromise.d.ts +15 -11
- package/esm/base/react/useCancelablePromise.d.ts.map +1 -1
- package/esm/base/react/useCancelablePromise.js +6 -2
- package/esm/base/react/useCancelablePromise.js.map +1 -1
- package/esm/base/react/useCancelablePromiseUtils.d.ts +2 -2
- package/esm/base/react/useCancelablePromiseUtils.js +2 -2
- package/esm/base/results/internal/definitionMethods.d.ts +1 -1
- package/esm/base/results/internal/definitionMethods.js +1 -1
- package/esm/base/results/internal/resultDataMethods.d.ts +1 -1
- package/esm/base/results/internal/resultMetaMethods.d.ts +1 -1
- package/esm/base/results/internal/resultMetaMethods.js +1 -1
- package/esm/execution/ExecuteInsight.d.ts +19 -2
- package/esm/execution/ExecuteInsight.d.ts.map +1 -1
- package/esm/execution/ExecuteInsight.js +6 -4
- package/esm/execution/ExecuteInsight.js.map +1 -1
- package/esm/execution/useDataExport.d.ts +3 -3
- package/esm/execution/useDataExport.js +1 -1
- package/esm/execution/useDataView.d.ts +3 -0
- package/esm/execution/useDataView.d.ts.map +1 -1
- package/esm/execution/useDataView.js +1 -0
- package/esm/execution/useDataView.js.map +1 -1
- package/esm/execution/useExecution.d.ts +2 -0
- package/esm/execution/useExecution.d.ts.map +1 -1
- package/esm/execution/useExecution.js +1 -0
- package/esm/execution/useExecution.js.map +1 -1
- package/esm/execution/useExecutionDataView.d.ts +3 -3
- package/esm/execution/useExecutionDataView.js +1 -1
- package/esm/execution/useInsightDataView.d.ts +19 -2
- package/esm/execution/useInsightDataView.d.ts.map +1 -1
- package/esm/execution/useInsightDataView.js +5 -4
- package/esm/execution/useInsightDataView.js.map +1 -1
- package/package.json +7 -7
package/dist/sdk-ui.d.ts
CHANGED
|
@@ -849,7 +849,7 @@ export declare const Execute: (props: IExecuteProps) => JSX.Element;
|
|
|
849
849
|
/**
|
|
850
850
|
* Gets data for a specific stored insight.
|
|
851
851
|
*
|
|
852
|
-
* @
|
|
852
|
+
* @public
|
|
853
853
|
*/
|
|
854
854
|
export declare const ExecuteInsight: React_2.ComponentType<IExecuteInsightProps>;
|
|
855
855
|
|
|
@@ -1724,7 +1724,7 @@ export declare interface IExecuteErrorComponentProps {
|
|
|
1724
1724
|
|
|
1725
1725
|
/**
|
|
1726
1726
|
* Props of the {@link ExecuteInsight} component.
|
|
1727
|
-
* @
|
|
1727
|
+
* @public
|
|
1728
1728
|
*/
|
|
1729
1729
|
export declare interface IExecuteInsightProps extends IWithLoadingEvents<IExecuteInsightProps> {
|
|
1730
1730
|
/**
|
|
@@ -1803,6 +1803,23 @@ export declare interface IExecuteInsightProps extends IWithLoadingEvents<IExecut
|
|
|
1803
1803
|
* If not specified, all data will be loaded.
|
|
1804
1804
|
*/
|
|
1805
1805
|
window?: DataViewWindow;
|
|
1806
|
+
/**
|
|
1807
|
+
* Indicates that the execution to obtain the data for the insight should be an 'execution by reference'.
|
|
1808
|
+
*
|
|
1809
|
+
* Execution by reference means that the ExecuteInsight will ask analytical backend to compute results for an insight
|
|
1810
|
+
* which is stored on the backend by specifying link to the insight, additional filters and description how
|
|
1811
|
+
* to organize the data.
|
|
1812
|
+
*
|
|
1813
|
+
* Otherwise, a freeform execution is done, in which the InsightView will send to backend the full execution
|
|
1814
|
+
* definition of what to compute.
|
|
1815
|
+
*
|
|
1816
|
+
* This distinction is in place because some backends MAY want to prohibit users from doing freeform executions
|
|
1817
|
+
* and only allow computing data for set of insights created by admins.
|
|
1818
|
+
*
|
|
1819
|
+
* Note: the need for execute by reference is rare. You will typically be notified by the solution admin to use
|
|
1820
|
+
* this mode.
|
|
1821
|
+
*/
|
|
1822
|
+
executeByReference?: boolean;
|
|
1806
1823
|
/**
|
|
1807
1824
|
* Child component to which rendering is delegated.
|
|
1808
1825
|
*
|
|
@@ -1950,7 +1967,7 @@ export declare interface IExecuteProps extends IWithLoadingEvents<IExecuteProps>
|
|
|
1950
1967
|
}
|
|
1951
1968
|
|
|
1952
1969
|
/**
|
|
1953
|
-
* @
|
|
1970
|
+
* @public
|
|
1954
1971
|
*/
|
|
1955
1972
|
export declare interface IExecutionConfiguration {
|
|
1956
1973
|
/**
|
|
@@ -1993,7 +2010,7 @@ export declare interface IExecutionConfiguration {
|
|
|
1993
2010
|
/**
|
|
1994
2011
|
* Methods to work with execution definition.
|
|
1995
2012
|
*
|
|
1996
|
-
* @
|
|
2013
|
+
* @public
|
|
1997
2014
|
*/
|
|
1998
2015
|
export declare interface IExecutionDefinitionMethods {
|
|
1999
2016
|
/**
|
|
@@ -2450,7 +2467,7 @@ export declare interface IRawExecuteProps extends IWithLoadingEvents<IRawExecute
|
|
|
2450
2467
|
/**
|
|
2451
2468
|
* Methods to access data and totals in a result.
|
|
2452
2469
|
*
|
|
2453
|
-
* @
|
|
2470
|
+
* @public
|
|
2454
2471
|
*/
|
|
2455
2472
|
export declare interface IResultDataMethods {
|
|
2456
2473
|
/**
|
|
@@ -2505,7 +2522,7 @@ export declare interface IResultDataMethods {
|
|
|
2505
2522
|
/**
|
|
2506
2523
|
* Methods to access result metadata - dimension descriptors and result headers.
|
|
2507
2524
|
*
|
|
2508
|
-
* @
|
|
2525
|
+
* @public
|
|
2509
2526
|
*/
|
|
2510
2527
|
export declare interface IResultMetaMethods {
|
|
2511
2528
|
/**
|
|
@@ -2830,6 +2847,7 @@ export declare type ITranslationsProviderProps = ITranslationsProviderOwnProps &
|
|
|
2830
2847
|
export declare type IUseComposedPlaceholderHook<T extends IComposedPlaceholder<any, any, any>> = (resolutionContext: ComposedPlaceholderResolutionContext<T>) => PlaceholderResolvedValue<T>;
|
|
2831
2848
|
|
|
2832
2849
|
/**
|
|
2850
|
+
* @deprecated use {@link useExecutionDataView} instead
|
|
2833
2851
|
* @beta
|
|
2834
2852
|
*/
|
|
2835
2853
|
export declare interface IUseExecutionConfig {
|
|
@@ -2887,7 +2905,7 @@ export declare interface IUseExecutionConfig {
|
|
|
2887
2905
|
}
|
|
2888
2906
|
|
|
2889
2907
|
/**
|
|
2890
|
-
* @
|
|
2908
|
+
* @public
|
|
2891
2909
|
*/
|
|
2892
2910
|
export declare interface IUseExecutionDataViewConfig {
|
|
2893
2911
|
/**
|
|
@@ -2920,7 +2938,7 @@ export declare interface IUseExecutionDataViewConfig {
|
|
|
2920
2938
|
}
|
|
2921
2939
|
|
|
2922
2940
|
/**
|
|
2923
|
-
* @
|
|
2941
|
+
* @public
|
|
2924
2942
|
*/
|
|
2925
2943
|
export declare interface IUseInsightDataViewConfig {
|
|
2926
2944
|
/**
|
|
@@ -2953,6 +2971,23 @@ export declare interface IUseInsightDataViewConfig {
|
|
|
2953
2971
|
* This is useful if you want to page data.
|
|
2954
2972
|
*/
|
|
2955
2973
|
window?: DataViewWindow;
|
|
2974
|
+
/**
|
|
2975
|
+
* Indicates that the execution to obtain the data for the insight should be an 'execution by reference'.
|
|
2976
|
+
*
|
|
2977
|
+
* Execution by reference means that the useInsightDataView will ask analytical backend to compute results for an insight
|
|
2978
|
+
* which is stored on the backend by specifying link to the insight, additional filters and description how
|
|
2979
|
+
* to organize the data.
|
|
2980
|
+
*
|
|
2981
|
+
* Otherwise, a freeform execution is done, in which the InsightView will send to backend the full execution
|
|
2982
|
+
* definition of what to compute.
|
|
2983
|
+
*
|
|
2984
|
+
* This distinction is in place because some backends MAY want to prohibit users from doing freeform executions
|
|
2985
|
+
* and only allow computing data for set of insights created by admins.
|
|
2986
|
+
*
|
|
2987
|
+
* Note: the need for execute by reference is rare. You will typically be notified by the solution admin to use
|
|
2988
|
+
* this mode.
|
|
2989
|
+
*/
|
|
2990
|
+
executeByReference?: boolean;
|
|
2956
2991
|
/**
|
|
2957
2992
|
* Backend to work with.
|
|
2958
2993
|
*
|
|
@@ -3618,7 +3653,7 @@ export declare function resolveLCMWorkspaceIdentifiers(backend: any, clientWorks
|
|
|
3618
3653
|
*
|
|
3619
3654
|
* @param states - cancelable promise states (useCancelablePromise return values)
|
|
3620
3655
|
* @returns first error
|
|
3621
|
-
* @
|
|
3656
|
+
* @public
|
|
3622
3657
|
*/
|
|
3623
3658
|
export declare function resolveUseCancelablePromisesError<TError>(states: UseCancelablePromiseState<unknown, TError>[]): TError | undefined;
|
|
3624
3659
|
|
|
@@ -3643,7 +3678,7 @@ export declare function resolveUseCancelablePromisesError<TError>(states: UseCan
|
|
|
3643
3678
|
* @param states - cancelable promise states (useCancelablePromise return values)
|
|
3644
3679
|
* @param options - optionally specify options for resolving the status
|
|
3645
3680
|
* @returns resolved status
|
|
3646
|
-
* @
|
|
3681
|
+
* @public
|
|
3647
3682
|
*/
|
|
3648
3683
|
export declare function resolveUseCancelablePromisesStatus(cancelablePromisesStates: UseCancelablePromiseState<unknown, unknown>[], options?: {
|
|
3649
3684
|
strategy?: "serial" | "parallel";
|
|
@@ -3799,7 +3834,7 @@ export declare const useBackend: (backend?: IAnalyticalBackend | undefined) => I
|
|
|
3799
3834
|
export declare const useBackendStrict: (backend?: IAnalyticalBackend | undefined, context?: string) => IAnalyticalBackend;
|
|
3800
3835
|
|
|
3801
3836
|
/**
|
|
3802
|
-
* This hook provides easy way to work with
|
|
3837
|
+
* This hook provides easy way to work with Promises in React components.
|
|
3803
3838
|
*
|
|
3804
3839
|
* @remarks
|
|
3805
3840
|
* You can:
|
|
@@ -3808,13 +3843,17 @@ export declare const useBackendStrict: (backend?: IAnalyticalBackend | undefined
|
|
|
3808
3843
|
* - attach convenient callbacks to it
|
|
3809
3844
|
* - be sure, that when the dependency list changes, result will be still relevant (if previous Promise is still running, it's "canceled").
|
|
3810
3845
|
*
|
|
3811
|
-
*
|
|
3846
|
+
* Note that it's not recommended to use this hook for storing data on the backend
|
|
3847
|
+
* as it does not cancel requests wrapped in these promises
|
|
3848
|
+
* and you have no guarantee about the resolution order of the fired requests.
|
|
3849
|
+
*
|
|
3850
|
+
* @public
|
|
3812
3851
|
*/
|
|
3813
3852
|
export declare function useCancelablePromise<TResult, TError = any>(options: UseCancelablePromiseOptions<TResult, TError>, deps?: DependencyList): UseCancelablePromiseState<TResult, TError>;
|
|
3814
3853
|
|
|
3815
3854
|
/**
|
|
3816
3855
|
* Callbacks for {@link useCancelablePromise} hook
|
|
3817
|
-
* @
|
|
3856
|
+
* @public
|
|
3818
3857
|
*/
|
|
3819
3858
|
export declare type UseCancelablePromiseCallbacks<TResult, TError> = {
|
|
3820
3859
|
/**
|
|
@@ -3830,7 +3869,7 @@ export declare type UseCancelablePromiseCallbacks<TResult, TError> = {
|
|
|
3830
3869
|
*/
|
|
3831
3870
|
onCancel?: () => void;
|
|
3832
3871
|
/**
|
|
3833
|
-
*
|
|
3872
|
+
* onSuccess is fired whenever the promise is fulfilled
|
|
3834
3873
|
*/
|
|
3835
3874
|
onSuccess?: (result: TResult) => void;
|
|
3836
3875
|
/**
|
|
@@ -3841,7 +3880,7 @@ export declare type UseCancelablePromiseCallbacks<TResult, TError> = {
|
|
|
3841
3880
|
|
|
3842
3881
|
/**
|
|
3843
3882
|
* Indicates error state for {@link useCancelablePromise} hook
|
|
3844
|
-
* @
|
|
3883
|
+
* @public
|
|
3845
3884
|
*/
|
|
3846
3885
|
export declare type UseCancelablePromiseErrorState<TError> = {
|
|
3847
3886
|
result: undefined;
|
|
@@ -3851,7 +3890,7 @@ export declare type UseCancelablePromiseErrorState<TError> = {
|
|
|
3851
3890
|
|
|
3852
3891
|
/**
|
|
3853
3892
|
* Indicates loading state for {@link useCancelablePromise} hook
|
|
3854
|
-
* @
|
|
3893
|
+
* @public
|
|
3855
3894
|
*/
|
|
3856
3895
|
export declare type UseCancelablePromiseLoadingState = {
|
|
3857
3896
|
result: undefined;
|
|
@@ -3862,7 +3901,7 @@ export declare type UseCancelablePromiseLoadingState = {
|
|
|
3862
3901
|
/**
|
|
3863
3902
|
* Options for the {@link useCancelablePromise} hook.
|
|
3864
3903
|
*
|
|
3865
|
-
* @
|
|
3904
|
+
* @public
|
|
3866
3905
|
*/
|
|
3867
3906
|
export declare type UseCancelablePromiseOptions<TResult, TError> = UseCancelablePromiseCallbacks<TResult, TError> & {
|
|
3868
3907
|
promise: (() => Promise<TResult>) | undefined | null;
|
|
@@ -3870,7 +3909,7 @@ export declare type UseCancelablePromiseOptions<TResult, TError> = UseCancelable
|
|
|
3870
3909
|
|
|
3871
3910
|
/**
|
|
3872
3911
|
* Indicates pending state for {@link useCancelablePromise} hook
|
|
3873
|
-
* @
|
|
3912
|
+
* @public
|
|
3874
3913
|
*/
|
|
3875
3914
|
export declare type UseCancelablePromisePendingState = {
|
|
3876
3915
|
result: undefined;
|
|
@@ -3880,19 +3919,19 @@ export declare type UseCancelablePromisePendingState = {
|
|
|
3880
3919
|
|
|
3881
3920
|
/**
|
|
3882
3921
|
* Indicates the current state of {@link useCancelablePromise} hook
|
|
3883
|
-
* @
|
|
3922
|
+
* @public
|
|
3884
3923
|
*/
|
|
3885
3924
|
export declare type UseCancelablePromiseState<TResult, TError> = UseCancelablePromisePendingState | UseCancelablePromiseLoadingState | UseCancelablePromiseErrorState<TError> | UseCancelablePromiseSuccessState<TResult>;
|
|
3886
3925
|
|
|
3887
3926
|
/**
|
|
3888
3927
|
* Indicates the current state of the promise inside {@link useCancelablePromise} hook
|
|
3889
|
-
* @
|
|
3928
|
+
* @public
|
|
3890
3929
|
*/
|
|
3891
3930
|
export declare type UseCancelablePromiseStatus = "success" | "error" | "loading" | "pending";
|
|
3892
3931
|
|
|
3893
3932
|
/**
|
|
3894
3933
|
* Indicates success state for {@link useCancelablePromise} hook
|
|
3895
|
-
* @
|
|
3934
|
+
* @public
|
|
3896
3935
|
*/
|
|
3897
3936
|
export declare type UseCancelablePromiseSuccessState<TResult> = {
|
|
3898
3937
|
result: TResult;
|
|
@@ -3934,7 +3973,7 @@ export declare function useComposedPlaceholder<TContext, TPlaceholder extends IC
|
|
|
3934
3973
|
* As a result, you will receive a string with uri, so you can easily create a download link.
|
|
3935
3974
|
* Be aware that execution is re-executed only on dependency list change, not on execution/exportConfig/callbacks change.
|
|
3936
3975
|
*
|
|
3937
|
-
* @
|
|
3976
|
+
* @public
|
|
3938
3977
|
*/
|
|
3939
3978
|
export declare function useDataExport({ execution, exportConfig, onCancel, onError, onLoading, onPending, onSuccess, }: {
|
|
3940
3979
|
execution: IPreparedExecution | undefined | null;
|
|
@@ -3943,13 +3982,13 @@ export declare function useDataExport({ execution, exportConfig, onCancel, onErr
|
|
|
3943
3982
|
|
|
3944
3983
|
/**
|
|
3945
3984
|
* Callbacks for useDataExport hook
|
|
3946
|
-
* @
|
|
3985
|
+
* @public
|
|
3947
3986
|
*/
|
|
3948
3987
|
export declare type UseDataExportCallbacks = UseCancelablePromiseCallbacks<string, GoodDataSdkError>;
|
|
3949
3988
|
|
|
3950
3989
|
/**
|
|
3951
3990
|
* Indicates current state of useDataExport hook
|
|
3952
|
-
* @
|
|
3991
|
+
* @public
|
|
3953
3992
|
*/
|
|
3954
3993
|
export declare type UseDataExportState = UseCancelablePromiseState<string, GoodDataSdkError>;
|
|
3955
3994
|
|
|
@@ -3960,6 +3999,7 @@ export declare type UseDataExportState = UseCancelablePromiseState<string, GoodD
|
|
|
3960
3999
|
* You can use it to create custom visualizations on top of GoodData platform.
|
|
3961
4000
|
* Be aware that execution is re-executed only on dependency list change, not on execution/window/callbacks change.
|
|
3962
4001
|
*
|
|
4002
|
+
* @deprecated use {@link useExecutionDataView} instead
|
|
3963
4003
|
* @beta
|
|
3964
4004
|
*/
|
|
3965
4005
|
export declare function useDataView({ execution, window, onCancel, onError, onLoading, onPending, onSuccess, }: {
|
|
@@ -3969,12 +4009,14 @@ export declare function useDataView({ execution, window, onCancel, onError, onLo
|
|
|
3969
4009
|
|
|
3970
4010
|
/**
|
|
3971
4011
|
* Callbacks for useDataView hook
|
|
4012
|
+
* @deprecated use {@link useExecutionDataView} instead
|
|
3972
4013
|
* @beta
|
|
3973
4014
|
*/
|
|
3974
4015
|
export declare type UseDataViewCallbacks = UseCancelablePromiseCallbacks<DataViewFacade, GoodDataSdkError>;
|
|
3975
4016
|
|
|
3976
4017
|
/**
|
|
3977
4018
|
* Indicates current state of useDataView hook
|
|
4019
|
+
* @deprecated use {@link useExecutionDataView} instead
|
|
3978
4020
|
* @beta
|
|
3979
4021
|
*/
|
|
3980
4022
|
export declare type UseDataViewState = UseCancelablePromiseState<DataViewFacade, GoodDataSdkError>;
|
|
@@ -3985,6 +4027,7 @@ export declare type UseDataViewState = UseCancelablePromiseState<DataViewFacade,
|
|
|
3985
4027
|
* @remarks
|
|
3986
4028
|
* It builds the execution on top of the backend passed to the BackendProvider, and workspace passed to the WorkspaceProvider.
|
|
3987
4029
|
*
|
|
4030
|
+
* @deprecated use {@link useExecutionDataView} instead
|
|
3988
4031
|
* @beta
|
|
3989
4032
|
*/
|
|
3990
4033
|
export declare function useExecution(config: IUseExecutionConfig): IPreparedExecution;
|
|
@@ -3992,14 +4035,14 @@ export declare function useExecution(config: IUseExecutionConfig): IPreparedExec
|
|
|
3992
4035
|
/**
|
|
3993
4036
|
* React hook to get data for a specific execution.
|
|
3994
4037
|
*
|
|
3995
|
-
* @
|
|
4038
|
+
* @public
|
|
3996
4039
|
*/
|
|
3997
4040
|
export declare function useExecutionDataView(config: IUseExecutionDataViewConfig, deps?: React.DependencyList): UseCancelablePromiseState<DataViewFacade, GoodDataSdkError>;
|
|
3998
4041
|
|
|
3999
4042
|
/**
|
|
4000
4043
|
* React hook to get data for a specific insight.
|
|
4001
4044
|
*
|
|
4002
|
-
* @
|
|
4045
|
+
* @public
|
|
4003
4046
|
*/
|
|
4004
4047
|
export declare function useInsightDataView(config: IUseInsightDataViewConfig, deps?: React.DependencyList): UseCancelablePromiseState<DataViewFacade, GoodDataSdkError>;
|
|
4005
4048
|
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { DependencyList } from "react";
|
|
2
2
|
/**
|
|
3
3
|
* Indicates the current state of the promise inside {@link useCancelablePromise} hook
|
|
4
|
-
* @
|
|
4
|
+
* @public
|
|
5
5
|
*/
|
|
6
6
|
export declare type UseCancelablePromiseStatus = "success" | "error" | "loading" | "pending";
|
|
7
7
|
/**
|
|
8
8
|
* Indicates pending state for {@link useCancelablePromise} hook
|
|
9
|
-
* @
|
|
9
|
+
* @public
|
|
10
10
|
*/
|
|
11
11
|
export declare type UseCancelablePromisePendingState = {
|
|
12
12
|
result: undefined;
|
|
@@ -15,7 +15,7 @@ export declare type UseCancelablePromisePendingState = {
|
|
|
15
15
|
};
|
|
16
16
|
/**
|
|
17
17
|
* Indicates loading state for {@link useCancelablePromise} hook
|
|
18
|
-
* @
|
|
18
|
+
* @public
|
|
19
19
|
*/
|
|
20
20
|
export declare type UseCancelablePromiseLoadingState = {
|
|
21
21
|
result: undefined;
|
|
@@ -24,7 +24,7 @@ export declare type UseCancelablePromiseLoadingState = {
|
|
|
24
24
|
};
|
|
25
25
|
/**
|
|
26
26
|
* Indicates error state for {@link useCancelablePromise} hook
|
|
27
|
-
* @
|
|
27
|
+
* @public
|
|
28
28
|
*/
|
|
29
29
|
export declare type UseCancelablePromiseErrorState<TError> = {
|
|
30
30
|
result: undefined;
|
|
@@ -33,7 +33,7 @@ export declare type UseCancelablePromiseErrorState<TError> = {
|
|
|
33
33
|
};
|
|
34
34
|
/**
|
|
35
35
|
* Indicates success state for {@link useCancelablePromise} hook
|
|
36
|
-
* @
|
|
36
|
+
* @public
|
|
37
37
|
*/
|
|
38
38
|
export declare type UseCancelablePromiseSuccessState<TResult> = {
|
|
39
39
|
result: TResult;
|
|
@@ -42,12 +42,12 @@ export declare type UseCancelablePromiseSuccessState<TResult> = {
|
|
|
42
42
|
};
|
|
43
43
|
/**
|
|
44
44
|
* Indicates the current state of {@link useCancelablePromise} hook
|
|
45
|
-
* @
|
|
45
|
+
* @public
|
|
46
46
|
*/
|
|
47
47
|
export declare type UseCancelablePromiseState<TResult, TError> = UseCancelablePromisePendingState | UseCancelablePromiseLoadingState | UseCancelablePromiseErrorState<TError> | UseCancelablePromiseSuccessState<TResult>;
|
|
48
48
|
/**
|
|
49
49
|
* Callbacks for {@link useCancelablePromise} hook
|
|
50
|
-
* @
|
|
50
|
+
* @public
|
|
51
51
|
*/
|
|
52
52
|
export declare type UseCancelablePromiseCallbacks<TResult, TError> = {
|
|
53
53
|
/**
|
|
@@ -63,7 +63,7 @@ export declare type UseCancelablePromiseCallbacks<TResult, TError> = {
|
|
|
63
63
|
*/
|
|
64
64
|
onCancel?: () => void;
|
|
65
65
|
/**
|
|
66
|
-
*
|
|
66
|
+
* onSuccess is fired whenever the promise is fulfilled
|
|
67
67
|
*/
|
|
68
68
|
onSuccess?: (result: TResult) => void;
|
|
69
69
|
/**
|
|
@@ -74,13 +74,13 @@ export declare type UseCancelablePromiseCallbacks<TResult, TError> = {
|
|
|
74
74
|
/**
|
|
75
75
|
* Options for the {@link useCancelablePromise} hook.
|
|
76
76
|
*
|
|
77
|
-
* @
|
|
77
|
+
* @public
|
|
78
78
|
*/
|
|
79
79
|
export declare type UseCancelablePromiseOptions<TResult, TError> = UseCancelablePromiseCallbacks<TResult, TError> & {
|
|
80
80
|
promise: (() => Promise<TResult>) | undefined | null;
|
|
81
81
|
};
|
|
82
82
|
/**
|
|
83
|
-
* This hook provides easy way to work with
|
|
83
|
+
* This hook provides easy way to work with Promises in React components.
|
|
84
84
|
*
|
|
85
85
|
* @remarks
|
|
86
86
|
* You can:
|
|
@@ -89,7 +89,11 @@ export declare type UseCancelablePromiseOptions<TResult, TError> = UseCancelable
|
|
|
89
89
|
* - attach convenient callbacks to it
|
|
90
90
|
* - be sure, that when the dependency list changes, result will be still relevant (if previous Promise is still running, it's "canceled").
|
|
91
91
|
*
|
|
92
|
-
*
|
|
92
|
+
* Note that it's not recommended to use this hook for storing data on the backend
|
|
93
|
+
* as it does not cancel requests wrapped in these promises
|
|
94
|
+
* and you have no guarantee about the resolution order of the fired requests.
|
|
95
|
+
*
|
|
96
|
+
* @public
|
|
93
97
|
*/
|
|
94
98
|
export declare function useCancelablePromise<TResult, TError = any>(options: UseCancelablePromiseOptions<TResult, TError>, deps?: DependencyList): UseCancelablePromiseState<TResult, TError>;
|
|
95
99
|
//# sourceMappingURL=useCancelablePromise.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useCancelablePromise.d.ts","sourceRoot":"","sources":["../../../src/base/react/useCancelablePromise.ts"],"names":[],"mappings":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AC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;CACnC,CAAC;AAEF;;;;GAIG;AACH,oBAAY,2BAA2B,CAAC,OAAO,EAAE,MAAM,IAAI,6BAA6B,CAAC,OAAO,EAAE,MAAM,CAAC,GAAG;IACxG,OAAO,EAAE,CAAC,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC,GAAG,SAAS,GAAG,IAAI,CAAC;CACxD,CAAC;AAEF
|
|
1
|
+
{"version":3,"file":"useCancelablePromise.d.ts","sourceRoot":"","sources":["../../../src/base/react/useCancelablePromise.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAuB,MAAM,OAAO,CAAC;AAM5D;;;GAGG;AACH,oBAAY,0BAA0B,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,GAAG,SAAS,CAAC;AAErF;;;GAGG;AACH,oBAAY,gCAAgC,GAAG;IAC3C,MAAM,EAAE,SAAS,CAAC;IAClB,KAAK,EAAE,SAAS,CAAC;IACjB,MAAM,EAAE,SAAS,CAAC;CACrB,CAAC;AAEF;;;GAGG;AACH,oBAAY,gCAAgC,GAAG;IAC3C,MAAM,EAAE,SAAS,CAAC;IAClB,KAAK,EAAE,SAAS,CAAC;IACjB,MAAM,EAAE,SAAS,CAAC;CACrB,CAAC;AAEF;;;GAGG;AACH,oBAAY,8BAA8B,CAAC,MAAM,IAAI;IACjD,MAAM,EAAE,SAAS,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF;;;GAGG;AACH,oBAAY,gCAAgC,CAAC,OAAO,IAAI;IACpD,MAAM,EAAE,OAAO,CAAC;IAChB,KAAK,EAAE,SAAS,CAAC;IACjB,MAAM,EAAE,SAAS,CAAC;CACrB,CAAC;AAEF;;;GAGG;AACH,oBAAY,yBAAyB,CAAC,OAAO,EAAE,MAAM,IAC/C,gCAAgC,GAChC,gCAAgC,GAChC,8BAA8B,CAAC,MAAM,CAAC,GACtC,gCAAgC,CAAC,OAAO,CAAC,CAAC;AAEhD;;;GAGG;AACH,oBAAY,6BAA6B,CAAC,OAAO,EAAE,MAAM,IAAI;IACzD;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB;;OAEG;IACH,SAAS,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;IACtC;;OAEG;IACH,OAAO,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;CACnC,CAAC;AAEF;;;;GAIG;AACH,oBAAY,2BAA2B,CAAC,OAAO,EAAE,MAAM,IAAI,6BAA6B,CAAC,OAAO,EAAE,MAAM,CAAC,GAAG;IACxG,OAAO,EAAE,CAAC,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC,GAAG,SAAS,GAAG,IAAI,CAAC;CACxD,CAAC;AAEF;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,GAAG,GAAG,EACtD,OAAO,EAAE,2BAA2B,CAAC,OAAO,EAAE,MAAM,CAAC,EACrD,IAAI,CAAC,EAAE,cAAc,GACtB,yBAAyB,CAAC,OAAO,EAAE,MAAM,CAAC,CAmG5C"}
|
|
@@ -6,7 +6,7 @@ import noop from "lodash/noop";
|
|
|
6
6
|
import { UnexpectedSdkError } from "../errors/GoodDataSdkError";
|
|
7
7
|
import { safeSerialize } from "./safeSerialize";
|
|
8
8
|
/**
|
|
9
|
-
* This hook provides easy way to work with
|
|
9
|
+
* This hook provides easy way to work with Promises in React components.
|
|
10
10
|
*
|
|
11
11
|
* @remarks
|
|
12
12
|
* You can:
|
|
@@ -15,7 +15,11 @@ import { safeSerialize } from "./safeSerialize";
|
|
|
15
15
|
* - attach convenient callbacks to it
|
|
16
16
|
* - be sure, that when the dependency list changes, result will be still relevant (if previous Promise is still running, it's "canceled").
|
|
17
17
|
*
|
|
18
|
-
*
|
|
18
|
+
* Note that it's not recommended to use this hook for storing data on the backend
|
|
19
|
+
* as it does not cancel requests wrapped in these promises
|
|
20
|
+
* and you have no guarantee about the resolution order of the fired requests.
|
|
21
|
+
*
|
|
22
|
+
* @public
|
|
19
23
|
*/
|
|
20
24
|
export function useCancelablePromise(options, deps) {
|
|
21
25
|
var promise = options.promise, _a = options.onLoading, onLoading = _a === void 0 ? noop : _a, _b = options.onPending, onPending = _b === void 0 ? noop : _b, _c = options.onCancel, onCancel = _c === void 0 ? noop : _c, _d = options.onSuccess, onSuccess = _d === void 0 ? noop : _d, _e = options.onError, onError = _e === void 0 ? noop : _e;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useCancelablePromise.js","sourceRoot":"","sources":["../../../src/base/react/useCancelablePromise.ts"],"names":[],"mappings":";AAAA,qCAAqC;AACrC,OAAO,EAAkB,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,IAAI,MAAM,aAAa,CAAC;AAC/B,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AA8FhD
|
|
1
|
+
{"version":3,"file":"useCancelablePromise.js","sourceRoot":"","sources":["../../../src/base/react/useCancelablePromise.ts"],"names":[],"mappings":";AAAA,qCAAqC;AACrC,OAAO,EAAkB,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,IAAI,MAAM,aAAa,CAAC;AAC/B,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AA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,CAAE,IAAI,CAAC,UAAC,GAAG,EAAE,CAAC,IAAK,OAAA,GAAG,MAAK,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAG,CAAC,EAAC,EAArB,CAAqB,GAAG;QAC/C,OAAO,CAAC,IAAI,CAAC,CAAC;QACd,IAAM,YAAY,GAAG,eAAe,EAAE,CAAC;QACvC,QAAQ,CAAC,YAAY,CAAC,CAAC;QACvB,OAAO,YAAY,CAAC;KACvB;IAED,OAAO,KAAK,CAAC;AACjB,CAAC"}
|
|
@@ -20,7 +20,7 @@ import { UseCancelablePromiseState, UseCancelablePromiseStatus } from "./useCanc
|
|
|
20
20
|
* @param states - cancelable promise states (useCancelablePromise return values)
|
|
21
21
|
* @param options - optionally specify options for resolving the status
|
|
22
22
|
* @returns resolved status
|
|
23
|
-
* @
|
|
23
|
+
* @public
|
|
24
24
|
*/
|
|
25
25
|
export declare function resolveUseCancelablePromisesStatus(cancelablePromisesStates: UseCancelablePromiseState<unknown, unknown>[], options?: {
|
|
26
26
|
strategy?: "serial" | "parallel";
|
|
@@ -34,7 +34,7 @@ export declare function resolveUseCancelablePromisesStatus(cancelablePromisesSta
|
|
|
34
34
|
*
|
|
35
35
|
* @param states - cancelable promise states (useCancelablePromise return values)
|
|
36
36
|
* @returns first error
|
|
37
|
-
* @
|
|
37
|
+
* @public
|
|
38
38
|
*/
|
|
39
39
|
export declare function resolveUseCancelablePromisesError<TError>(states: UseCancelablePromiseState<unknown, TError>[]): TError | undefined;
|
|
40
40
|
/**
|
|
@@ -23,7 +23,7 @@ import { UnexpectedSdkError } from "../errors/GoodDataSdkError";
|
|
|
23
23
|
* @param states - cancelable promise states (useCancelablePromise return values)
|
|
24
24
|
* @param options - optionally specify options for resolving the status
|
|
25
25
|
* @returns resolved status
|
|
26
|
-
* @
|
|
26
|
+
* @public
|
|
27
27
|
*/
|
|
28
28
|
export function resolveUseCancelablePromisesStatus(cancelablePromisesStates, options) {
|
|
29
29
|
var _a;
|
|
@@ -43,7 +43,7 @@ export function resolveUseCancelablePromisesStatus(cancelablePromisesStates, opt
|
|
|
43
43
|
*
|
|
44
44
|
* @param states - cancelable promise states (useCancelablePromise return values)
|
|
45
45
|
* @returns first error
|
|
46
|
-
* @
|
|
46
|
+
* @public
|
|
47
47
|
*/
|
|
48
48
|
export function resolveUseCancelablePromisesError(states) {
|
|
49
49
|
var errors = collectUseCancelablePromiseErrors(states);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// (C) 2019-
|
|
1
|
+
// (C) 2019-2022 GoodData Corporation
|
|
2
2
|
import { bucketIsEmpty, idMatchMeasure, measureMasterIdentifier, bucketMeasures, } from "@gooddata/sdk-model";
|
|
3
3
|
import findIndex from "lodash/findIndex";
|
|
4
4
|
function buildBucketIndex(definition) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// (C) 2019-
|
|
1
|
+
// (C) 2019-2022 GoodData Corporation
|
|
2
2
|
import flatMap from "lodash/flatMap";
|
|
3
3
|
import { isAttributeDescriptor, isMeasureGroupDescriptor, isResultAttributeHeader, } from "@gooddata/sdk-backend-spi";
|
|
4
4
|
import { attributeLocatorElement, attributeLocatorIdentifier, idMatchMeasure, isAttributeLocator, isAttributeSort, isPoPMeasure, isPreviousPeriodMeasure, sortMeasureLocators, } from "@gooddata/sdk-model";
|
|
@@ -5,7 +5,7 @@ import { IAnalyticalBackend } from "@gooddata/sdk-backend-spi";
|
|
|
5
5
|
import { IExecuteErrorComponent, IExecuteLoadingComponent } from "./interfaces";
|
|
6
6
|
/**
|
|
7
7
|
* Props of the {@link ExecuteInsight} component.
|
|
8
|
-
* @
|
|
8
|
+
* @public
|
|
9
9
|
*/
|
|
10
10
|
export interface IExecuteInsightProps extends IWithLoadingEvents<IExecuteInsightProps> {
|
|
11
11
|
/**
|
|
@@ -84,6 +84,23 @@ export interface IExecuteInsightProps extends IWithLoadingEvents<IExecuteInsight
|
|
|
84
84
|
* If not specified, all data will be loaded.
|
|
85
85
|
*/
|
|
86
86
|
window?: DataViewWindow;
|
|
87
|
+
/**
|
|
88
|
+
* Indicates that the execution to obtain the data for the insight should be an 'execution by reference'.
|
|
89
|
+
*
|
|
90
|
+
* Execution by reference means that the ExecuteInsight will ask analytical backend to compute results for an insight
|
|
91
|
+
* which is stored on the backend by specifying link to the insight, additional filters and description how
|
|
92
|
+
* to organize the data.
|
|
93
|
+
*
|
|
94
|
+
* Otherwise, a freeform execution is done, in which the InsightView will send to backend the full execution
|
|
95
|
+
* definition of what to compute.
|
|
96
|
+
*
|
|
97
|
+
* This distinction is in place because some backends MAY want to prohibit users from doing freeform executions
|
|
98
|
+
* and only allow computing data for set of insights created by admins.
|
|
99
|
+
*
|
|
100
|
+
* Note: the need for execute by reference is rare. You will typically be notified by the solution admin to use
|
|
101
|
+
* this mode.
|
|
102
|
+
*/
|
|
103
|
+
executeByReference?: boolean;
|
|
87
104
|
/**
|
|
88
105
|
* Child component to which rendering is delegated.
|
|
89
106
|
*
|
|
@@ -113,7 +130,7 @@ export interface IExecuteInsightProps extends IWithLoadingEvents<IExecuteInsight
|
|
|
113
130
|
/**
|
|
114
131
|
* Gets data for a specific stored insight.
|
|
115
132
|
*
|
|
116
|
-
* @
|
|
133
|
+
* @public
|
|
117
134
|
*/
|
|
118
135
|
export declare const ExecuteInsight: React.ComponentType<IExecuteInsightProps>;
|
|
119
136
|
//# sourceMappingURL=ExecuteInsight.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExecuteInsight.d.ts","sourceRoot":"","sources":["../../src/execution/ExecuteInsight.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC/F,OAAO,EAAE,UAAU,EAAE,oBAAoB,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC3G,OAAO,EAAE,kBAAkB,EA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C,EAAE,MAAM,CAAC;IAErB;;;;;;;;OAQG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB;;;;;;;;;OASG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IAEtB;;;;;;OAMG;IACH,MAAM,CAAC,EAAE,cAAc,CAAC;IAExB;;;;;;;;;;;;;;;OAeG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAE7B;;;;;;;OAOG;IACH,QAAQ,EAAE,CAAC,eAAe,EAAE,iBAAiB,KAAK,KAAK,CAAC,YAAY,GAAG,IAAI,CAAC;IAE5E;;;;;;OAMG;IACH,gBAAgB,CAAC,EAAE,wBAAwB,CAAC;IAE5C;;;;;;OAMG;IACH,cAAc,CAAC,EAAE,sBAAsB,CAAC;CAC3C;AAmCD;;;;GAIG;AACH,eAAO,MAAM,cAAc,2CA4F1B,CAAC"}
|
|
@@ -32,22 +32,24 @@ function exportTitle(props) {
|
|
|
32
32
|
/**
|
|
33
33
|
* Gets data for a specific stored insight.
|
|
34
34
|
*
|
|
35
|
-
* @
|
|
35
|
+
* @public
|
|
36
36
|
*/
|
|
37
37
|
export var ExecuteInsight = withContexts(withExecution({
|
|
38
38
|
exportTitle: exportTitle,
|
|
39
39
|
execution: function (props) { return __awaiter(void 0, void 0, void 0, function () {
|
|
40
|
-
var insightRef, filters, sorts, dimensions, dateFormat, backend, workspace, insight, insightExecution, resolvedSorts, resolvedDimensions, resolvedDateFormat;
|
|
40
|
+
var insightRef, filters, sorts, dimensions, dateFormat, backend, workspace, executeByReference, insight, executionFactory, executeFn, insightExecution, resolvedSorts, resolvedDimensions, resolvedDateFormat;
|
|
41
41
|
return __generator(this, function (_a) {
|
|
42
42
|
switch (_a.label) {
|
|
43
43
|
case 0:
|
|
44
|
-
insightRef = props.insight, filters = props.filters, sorts = props.sorts, dimensions = props.dimensions, dateFormat = props.dateFormat, backend = props.backend, workspace = props.workspace;
|
|
44
|
+
insightRef = props.insight, filters = props.filters, sorts = props.sorts, dimensions = props.dimensions, dateFormat = props.dateFormat, backend = props.backend, workspace = props.workspace, executeByReference = props.executeByReference;
|
|
45
45
|
invariant(backend, "The backend in ExecuteInsight must be defined. Either pass it as a prop or make sure there is a BackendProvider up the component tree.");
|
|
46
46
|
invariant(workspace, "The workspace in ExecuteInsight must be defined. Either pass it as a prop or make sure there is a WorkspaceProvider up the component tree.");
|
|
47
47
|
return [4 /*yield*/, backend.workspace(workspace).insights().getInsight(insightRef)];
|
|
48
48
|
case 1:
|
|
49
49
|
insight = _a.sent();
|
|
50
|
-
|
|
50
|
+
executionFactory = backend.workspace(workspace).execution();
|
|
51
|
+
executeFn = (executeByReference ? executionFactory.forInsightByRef : executionFactory.forInsight).bind(executionFactory);
|
|
52
|
+
insightExecution = executeFn(insight, filters);
|
|
51
53
|
if (sorts) {
|
|
52
54
|
resolvedSorts = typeof sorts === "function" ? sorts(insightExecution.definition, props) : sorts;
|
|
53
55
|
insightExecution = insightExecution.withSorting.apply(insightExecution, __spread(resolvedSorts));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExecuteInsight.js","sourceRoot":"","sources":["../../src/execution/ExecuteInsight.tsx"],"names":[],"mappings":";AAAA,qCAAqC;AACrC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAIhD,OAAO,OAAO,MAAM,gBAAgB,CAAC;AACrC,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEvC,OAAO,SAAS,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"ExecuteInsight.js","sourceRoot":"","sources":["../../src/execution/ExecuteInsight.tsx"],"names":[],"mappings":";AAAA,qCAAqC;AACrC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAIhD,OAAO,OAAO,MAAM,gBAAgB,CAAC;AACrC,OAAO,EAAE,YAAY,EAAE,MAA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