@wix/sdk-types 1.17.9 → 1.17.11
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/build/browser/index.d.mts +29 -4
- package/build/index.d.mts +29 -4
- package/build/index.d.ts +29 -4
- package/internal/build/browser/index.d.mts +29 -4
- package/internal/build/index.d.mts +29 -4
- package/internal/build/index.d.ts +29 -4
- package/package.json +2 -2
|
@@ -295,12 +295,24 @@ declare global {
|
|
|
295
295
|
}
|
|
296
296
|
}
|
|
297
297
|
/**
|
|
298
|
-
*
|
|
299
|
-
*
|
|
298
|
+
* Creates concrete types from SDK descriptors when a contextual client is
|
|
299
|
+
* available.
|
|
300
|
+
*
|
|
301
|
+
* For a REST descriptor the built (bound) API is intersected with the original
|
|
302
|
+
* descriptor, matching what `contextualizeRESTModuleV2` returns at runtime — a
|
|
303
|
+
* value callable as the bound API and still usable as a descriptor. Keeping the
|
|
304
|
+
* descriptor half lets contextual modules be passed to descriptor-constrained
|
|
305
|
+
* helpers such as `elevate` from `@wix/sdk/context` (FEDINF-14092).
|
|
306
|
+
*
|
|
307
|
+
* The `& T` is scoped to REST descriptors — the only shape codegen wraps in
|
|
308
|
+
* `MaybeContext` — so `BuildDescriptors` (used by `createClient().use`) is left
|
|
309
|
+
* unchanged and stays bound-only. The fix lives here rather than in `elevate`,
|
|
310
|
+
* which is kept strict on purpose (see #941) so it still rejects bound-only
|
|
311
|
+
* functions that are unsafe through `createRESTModule`.
|
|
300
312
|
*/
|
|
301
313
|
type MaybeContext<T extends Descriptors> = globalThis.ContextualClient extends {
|
|
302
314
|
host: Host;
|
|
303
|
-
} ? BuildDescriptors<T, globalThis.ContextualClient['host']> : T;
|
|
315
|
+
} ? T extends RESTFunctionDescriptor ? BuildDescriptors<T, globalThis.ContextualClient['host']> & T : BuildDescriptors<T, globalThis.ContextualClient['host']> : T;
|
|
304
316
|
|
|
305
317
|
/**
|
|
306
318
|
* Expose fields based on the current exposure toggle.
|
|
@@ -442,6 +454,14 @@ declare const SORT_CAPABILITIES: {
|
|
|
442
454
|
readonly ASC: "ASC";
|
|
443
455
|
readonly DESC: "DESC";
|
|
444
456
|
};
|
|
457
|
+
/**
|
|
458
|
+
* Origin point for geo-distance sorting on a GEO field.
|
|
459
|
+
* Results are ordered by distance from this point (ASC = nearest first, DESC = farthest first).
|
|
460
|
+
*/
|
|
461
|
+
type SortingOrigin = {
|
|
462
|
+
latitude?: number | null;
|
|
463
|
+
longitude?: number | null;
|
|
464
|
+
};
|
|
445
465
|
/**
|
|
446
466
|
* Helper type to get the fields from a WQL group
|
|
447
467
|
* @template WQLGroup The WQL group type
|
|
@@ -459,6 +479,7 @@ type Sorting<Spec extends WQLSpec> = Spec['wql'] extends {
|
|
|
459
479
|
fieldName?: string;
|
|
460
480
|
order?: SortOrder;
|
|
461
481
|
selectItemsBy?: Record<string, any>[] | null;
|
|
482
|
+
origin?: SortingOrigin | null;
|
|
462
483
|
} : {
|
|
463
484
|
[WQLGroupIndex in keyof Spec['wql']]: Spec['wql'][WQLGroupIndex] extends {
|
|
464
485
|
fields: readonly string[];
|
|
@@ -467,18 +488,22 @@ type Sorting<Spec extends WQLSpec> = Spec['wql'] extends {
|
|
|
467
488
|
fieldName: WQLFields<Spec['wql'][WQLGroupIndex]>;
|
|
468
489
|
order: typeof SORT_DIRECTIONS.ASC;
|
|
469
490
|
selectItemsBy?: Record<string, any>[] | null;
|
|
491
|
+
origin?: SortingOrigin | null;
|
|
470
492
|
} : GroupSortCapability extends typeof SORT_DIRECTIONS.DESC ? {
|
|
471
493
|
fieldName: WQLFields<Spec['wql'][WQLGroupIndex]>;
|
|
472
494
|
order: typeof SORT_DIRECTIONS.DESC;
|
|
473
495
|
selectItemsBy?: Record<string, any>[] | null;
|
|
496
|
+
origin?: SortingOrigin | null;
|
|
474
497
|
} : GroupSortCapability extends typeof SORT_CAPABILITIES.BOTH ? {
|
|
475
498
|
fieldName: WQLFields<Spec['wql'][WQLGroupIndex]>;
|
|
476
499
|
order: SortOrder;
|
|
477
500
|
selectItemsBy?: Record<string, any>[] | null;
|
|
501
|
+
origin?: SortingOrigin | null;
|
|
478
502
|
} : GroupSortCapability extends typeof SORT_CAPABILITIES.NONE ? {
|
|
479
503
|
fieldName?: never;
|
|
480
504
|
order?: never;
|
|
481
505
|
selectItemsBy?: Record<string, any>[] | null;
|
|
506
|
+
origin?: SortingOrigin | null;
|
|
482
507
|
} : never : never;
|
|
483
508
|
}[keyof Spec['wql']];
|
|
484
509
|
|
|
@@ -1288,4 +1313,4 @@ interface QueryHelpers<T, S extends QuerySpec, R = QueryRequest<T, S>> {
|
|
|
1288
1313
|
Sort: SortFactory<S>;
|
|
1289
1314
|
}
|
|
1290
1315
|
|
|
1291
|
-
export { type APIMetadata, type AccessToken, type AccountInfo, type AggregatableFields, type Aggregation, type AggregationBuilder, type AggregationExpression, type AggregationFactory, type AggregationType, type AmbassadorFactory, type AmbassadorFunctionDescriptor, type AmbassadorRequestOptions, type AuthenticationStrategy, type BaseEventMetadata, type BoundAuthenticationStrategy, type BuildAmbassadorFunction, type BuildDescriptors, type BuildEventDefinition, type BuildRESTFunction, type BuildServicePluginDefinition, type CursorPaging, type DateHistogramAggregationBuilder, type Descriptors, EventDefinition, type EventHandler, type EventIdentity, type ExposeFieldsBasedOnToggle, type FieldFilter, type FieldSort, type Filter, type FilterExpression, type FilterFactory, type FilterableFields, type GetNestedType, type HTTPMethod, type Host, type HostModule, type HostModuleAPI, type HttpClient, type HttpResponse, type IdentityProvider, type MaybeContext, type Method, type MigrationOptions, type NestedAggregationBuilder, type NonNullablePaths, type OffsetPaging, type PagingFor, type PublicMetadata, type Query, type QueryBuilder, type QueryHelpers, type QueryRequest, type QuerySpec, type RESTFunctionDescriptor, type RangeAggregationBuilder, type RefreshToken, type RequestContext, type RequestOptions, type RequestOptionsFactory, type RestModuleMeta, SERVICE_PLUGIN_ERROR_TYPE, SORT_CAPABILITIES, SORT_DIRECTIONS, type ScalarAggregationBuilder, type Search, type SearchBuilder, type SearchDetails, type SearchExpression, type SearchHelpers, type SearchParamsBuilder, type SearchParamsFactory, type SearchRequest, type SearchSpec, type SearchableFields, type ServicePluginContract, ServicePluginDefinition, type ServicePluginMethodInput, type ServicePluginMethodMetadata, type SortCapability, type SortExpression, type SortFactory, type SortOrder, type Sorting, type Token, type TokenStorage, type Tokens, type ValueAggregationBuilder, type ValueAggregationSort, type WQL, type WQLSpec };
|
|
1316
|
+
export { type APIMetadata, type AccessToken, type AccountInfo, type AggregatableFields, type Aggregation, type AggregationBuilder, type AggregationExpression, type AggregationFactory, type AggregationType, type AmbassadorFactory, type AmbassadorFunctionDescriptor, type AmbassadorRequestOptions, type AuthenticationStrategy, type BaseEventMetadata, type BoundAuthenticationStrategy, type BuildAmbassadorFunction, type BuildDescriptors, type BuildEventDefinition, type BuildRESTFunction, type BuildServicePluginDefinition, type CursorPaging, type DateHistogramAggregationBuilder, type Descriptors, EventDefinition, type EventHandler, type EventIdentity, type ExposeFieldsBasedOnToggle, type FieldFilter, type FieldSort, type Filter, type FilterExpression, type FilterFactory, type FilterableFields, type GetNestedType, type HTTPMethod, type Host, type HostModule, type HostModuleAPI, type HttpClient, type HttpResponse, type IdentityProvider, type MaybeContext, type Method, type MigrationOptions, type NestedAggregationBuilder, type NonNullablePaths, type OffsetPaging, type PagingFor, type PublicMetadata, type Query, type QueryBuilder, type QueryHelpers, type QueryRequest, type QuerySpec, type RESTFunctionDescriptor, type RangeAggregationBuilder, type RefreshToken, type RequestContext, type RequestOptions, type RequestOptionsFactory, type RestModuleMeta, SERVICE_PLUGIN_ERROR_TYPE, SORT_CAPABILITIES, SORT_DIRECTIONS, type ScalarAggregationBuilder, type Search, type SearchBuilder, type SearchDetails, type SearchExpression, type SearchHelpers, type SearchParamsBuilder, type SearchParamsFactory, type SearchRequest, type SearchSpec, type SearchableFields, type ServicePluginContract, ServicePluginDefinition, type ServicePluginMethodInput, type ServicePluginMethodMetadata, type SortCapability, type SortExpression, type SortFactory, type SortOrder, type Sorting, type SortingOrigin, type Token, type TokenStorage, type Tokens, type ValueAggregationBuilder, type ValueAggregationSort, type WQL, type WQLSpec };
|
package/build/index.d.mts
CHANGED
|
@@ -295,12 +295,24 @@ declare global {
|
|
|
295
295
|
}
|
|
296
296
|
}
|
|
297
297
|
/**
|
|
298
|
-
*
|
|
299
|
-
*
|
|
298
|
+
* Creates concrete types from SDK descriptors when a contextual client is
|
|
299
|
+
* available.
|
|
300
|
+
*
|
|
301
|
+
* For a REST descriptor the built (bound) API is intersected with the original
|
|
302
|
+
* descriptor, matching what `contextualizeRESTModuleV2` returns at runtime — a
|
|
303
|
+
* value callable as the bound API and still usable as a descriptor. Keeping the
|
|
304
|
+
* descriptor half lets contextual modules be passed to descriptor-constrained
|
|
305
|
+
* helpers such as `elevate` from `@wix/sdk/context` (FEDINF-14092).
|
|
306
|
+
*
|
|
307
|
+
* The `& T` is scoped to REST descriptors — the only shape codegen wraps in
|
|
308
|
+
* `MaybeContext` — so `BuildDescriptors` (used by `createClient().use`) is left
|
|
309
|
+
* unchanged and stays bound-only. The fix lives here rather than in `elevate`,
|
|
310
|
+
* which is kept strict on purpose (see #941) so it still rejects bound-only
|
|
311
|
+
* functions that are unsafe through `createRESTModule`.
|
|
300
312
|
*/
|
|
301
313
|
type MaybeContext<T extends Descriptors> = globalThis.ContextualClient extends {
|
|
302
314
|
host: Host;
|
|
303
|
-
} ? BuildDescriptors<T, globalThis.ContextualClient['host']> : T;
|
|
315
|
+
} ? T extends RESTFunctionDescriptor ? BuildDescriptors<T, globalThis.ContextualClient['host']> & T : BuildDescriptors<T, globalThis.ContextualClient['host']> : T;
|
|
304
316
|
|
|
305
317
|
/**
|
|
306
318
|
* Expose fields based on the current exposure toggle.
|
|
@@ -442,6 +454,14 @@ declare const SORT_CAPABILITIES: {
|
|
|
442
454
|
readonly ASC: "ASC";
|
|
443
455
|
readonly DESC: "DESC";
|
|
444
456
|
};
|
|
457
|
+
/**
|
|
458
|
+
* Origin point for geo-distance sorting on a GEO field.
|
|
459
|
+
* Results are ordered by distance from this point (ASC = nearest first, DESC = farthest first).
|
|
460
|
+
*/
|
|
461
|
+
type SortingOrigin = {
|
|
462
|
+
latitude?: number | null;
|
|
463
|
+
longitude?: number | null;
|
|
464
|
+
};
|
|
445
465
|
/**
|
|
446
466
|
* Helper type to get the fields from a WQL group
|
|
447
467
|
* @template WQLGroup The WQL group type
|
|
@@ -459,6 +479,7 @@ type Sorting<Spec extends WQLSpec> = Spec['wql'] extends {
|
|
|
459
479
|
fieldName?: string;
|
|
460
480
|
order?: SortOrder;
|
|
461
481
|
selectItemsBy?: Record<string, any>[] | null;
|
|
482
|
+
origin?: SortingOrigin | null;
|
|
462
483
|
} : {
|
|
463
484
|
[WQLGroupIndex in keyof Spec['wql']]: Spec['wql'][WQLGroupIndex] extends {
|
|
464
485
|
fields: readonly string[];
|
|
@@ -467,18 +488,22 @@ type Sorting<Spec extends WQLSpec> = Spec['wql'] extends {
|
|
|
467
488
|
fieldName: WQLFields<Spec['wql'][WQLGroupIndex]>;
|
|
468
489
|
order: typeof SORT_DIRECTIONS.ASC;
|
|
469
490
|
selectItemsBy?: Record<string, any>[] | null;
|
|
491
|
+
origin?: SortingOrigin | null;
|
|
470
492
|
} : GroupSortCapability extends typeof SORT_DIRECTIONS.DESC ? {
|
|
471
493
|
fieldName: WQLFields<Spec['wql'][WQLGroupIndex]>;
|
|
472
494
|
order: typeof SORT_DIRECTIONS.DESC;
|
|
473
495
|
selectItemsBy?: Record<string, any>[] | null;
|
|
496
|
+
origin?: SortingOrigin | null;
|
|
474
497
|
} : GroupSortCapability extends typeof SORT_CAPABILITIES.BOTH ? {
|
|
475
498
|
fieldName: WQLFields<Spec['wql'][WQLGroupIndex]>;
|
|
476
499
|
order: SortOrder;
|
|
477
500
|
selectItemsBy?: Record<string, any>[] | null;
|
|
501
|
+
origin?: SortingOrigin | null;
|
|
478
502
|
} : GroupSortCapability extends typeof SORT_CAPABILITIES.NONE ? {
|
|
479
503
|
fieldName?: never;
|
|
480
504
|
order?: never;
|
|
481
505
|
selectItemsBy?: Record<string, any>[] | null;
|
|
506
|
+
origin?: SortingOrigin | null;
|
|
482
507
|
} : never : never;
|
|
483
508
|
}[keyof Spec['wql']];
|
|
484
509
|
|
|
@@ -1288,4 +1313,4 @@ interface QueryHelpers<T, S extends QuerySpec, R = QueryRequest<T, S>> {
|
|
|
1288
1313
|
Sort: SortFactory<S>;
|
|
1289
1314
|
}
|
|
1290
1315
|
|
|
1291
|
-
export { type APIMetadata, type AccessToken, type AccountInfo, type AggregatableFields, type Aggregation, type AggregationBuilder, type AggregationExpression, type AggregationFactory, type AggregationType, type AmbassadorFactory, type AmbassadorFunctionDescriptor, type AmbassadorRequestOptions, type AuthenticationStrategy, type BaseEventMetadata, type BoundAuthenticationStrategy, type BuildAmbassadorFunction, type BuildDescriptors, type BuildEventDefinition, type BuildRESTFunction, type BuildServicePluginDefinition, type CursorPaging, type DateHistogramAggregationBuilder, type Descriptors, EventDefinition, type EventHandler, type EventIdentity, type ExposeFieldsBasedOnToggle, type FieldFilter, type FieldSort, type Filter, type FilterExpression, type FilterFactory, type FilterableFields, type GetNestedType, type HTTPMethod, type Host, type HostModule, type HostModuleAPI, type HttpClient, type HttpResponse, type IdentityProvider, type MaybeContext, type Method, type MigrationOptions, type NestedAggregationBuilder, type NonNullablePaths, type OffsetPaging, type PagingFor, type PublicMetadata, type Query, type QueryBuilder, type QueryHelpers, type QueryRequest, type QuerySpec, type RESTFunctionDescriptor, type RangeAggregationBuilder, type RefreshToken, type RequestContext, type RequestOptions, type RequestOptionsFactory, type RestModuleMeta, SERVICE_PLUGIN_ERROR_TYPE, SORT_CAPABILITIES, SORT_DIRECTIONS, type ScalarAggregationBuilder, type Search, type SearchBuilder, type SearchDetails, type SearchExpression, type SearchHelpers, type SearchParamsBuilder, type SearchParamsFactory, type SearchRequest, type SearchSpec, type SearchableFields, type ServicePluginContract, ServicePluginDefinition, type ServicePluginMethodInput, type ServicePluginMethodMetadata, type SortCapability, type SortExpression, type SortFactory, type SortOrder, type Sorting, type Token, type TokenStorage, type Tokens, type ValueAggregationBuilder, type ValueAggregationSort, type WQL, type WQLSpec };
|
|
1316
|
+
export { type APIMetadata, type AccessToken, type AccountInfo, type AggregatableFields, type Aggregation, type AggregationBuilder, type AggregationExpression, type AggregationFactory, type AggregationType, type AmbassadorFactory, type AmbassadorFunctionDescriptor, type AmbassadorRequestOptions, type AuthenticationStrategy, type BaseEventMetadata, type BoundAuthenticationStrategy, type BuildAmbassadorFunction, type BuildDescriptors, type BuildEventDefinition, type BuildRESTFunction, type BuildServicePluginDefinition, type CursorPaging, type DateHistogramAggregationBuilder, type Descriptors, EventDefinition, type EventHandler, type EventIdentity, type ExposeFieldsBasedOnToggle, type FieldFilter, type FieldSort, type Filter, type FilterExpression, type FilterFactory, type FilterableFields, type GetNestedType, type HTTPMethod, type Host, type HostModule, type HostModuleAPI, type HttpClient, type HttpResponse, type IdentityProvider, type MaybeContext, type Method, type MigrationOptions, type NestedAggregationBuilder, type NonNullablePaths, type OffsetPaging, type PagingFor, type PublicMetadata, type Query, type QueryBuilder, type QueryHelpers, type QueryRequest, type QuerySpec, type RESTFunctionDescriptor, type RangeAggregationBuilder, type RefreshToken, type RequestContext, type RequestOptions, type RequestOptionsFactory, type RestModuleMeta, SERVICE_PLUGIN_ERROR_TYPE, SORT_CAPABILITIES, SORT_DIRECTIONS, type ScalarAggregationBuilder, type Search, type SearchBuilder, type SearchDetails, type SearchExpression, type SearchHelpers, type SearchParamsBuilder, type SearchParamsFactory, type SearchRequest, type SearchSpec, type SearchableFields, type ServicePluginContract, ServicePluginDefinition, type ServicePluginMethodInput, type ServicePluginMethodMetadata, type SortCapability, type SortExpression, type SortFactory, type SortOrder, type Sorting, type SortingOrigin, type Token, type TokenStorage, type Tokens, type ValueAggregationBuilder, type ValueAggregationSort, type WQL, type WQLSpec };
|
package/build/index.d.ts
CHANGED
|
@@ -295,12 +295,24 @@ declare global {
|
|
|
295
295
|
}
|
|
296
296
|
}
|
|
297
297
|
/**
|
|
298
|
-
*
|
|
299
|
-
*
|
|
298
|
+
* Creates concrete types from SDK descriptors when a contextual client is
|
|
299
|
+
* available.
|
|
300
|
+
*
|
|
301
|
+
* For a REST descriptor the built (bound) API is intersected with the original
|
|
302
|
+
* descriptor, matching what `contextualizeRESTModuleV2` returns at runtime — a
|
|
303
|
+
* value callable as the bound API and still usable as a descriptor. Keeping the
|
|
304
|
+
* descriptor half lets contextual modules be passed to descriptor-constrained
|
|
305
|
+
* helpers such as `elevate` from `@wix/sdk/context` (FEDINF-14092).
|
|
306
|
+
*
|
|
307
|
+
* The `& T` is scoped to REST descriptors — the only shape codegen wraps in
|
|
308
|
+
* `MaybeContext` — so `BuildDescriptors` (used by `createClient().use`) is left
|
|
309
|
+
* unchanged and stays bound-only. The fix lives here rather than in `elevate`,
|
|
310
|
+
* which is kept strict on purpose (see #941) so it still rejects bound-only
|
|
311
|
+
* functions that are unsafe through `createRESTModule`.
|
|
300
312
|
*/
|
|
301
313
|
type MaybeContext<T extends Descriptors> = globalThis.ContextualClient extends {
|
|
302
314
|
host: Host;
|
|
303
|
-
} ? BuildDescriptors<T, globalThis.ContextualClient['host']> : T;
|
|
315
|
+
} ? T extends RESTFunctionDescriptor ? BuildDescriptors<T, globalThis.ContextualClient['host']> & T : BuildDescriptors<T, globalThis.ContextualClient['host']> : T;
|
|
304
316
|
|
|
305
317
|
/**
|
|
306
318
|
* Expose fields based on the current exposure toggle.
|
|
@@ -442,6 +454,14 @@ declare const SORT_CAPABILITIES: {
|
|
|
442
454
|
readonly ASC: "ASC";
|
|
443
455
|
readonly DESC: "DESC";
|
|
444
456
|
};
|
|
457
|
+
/**
|
|
458
|
+
* Origin point for geo-distance sorting on a GEO field.
|
|
459
|
+
* Results are ordered by distance from this point (ASC = nearest first, DESC = farthest first).
|
|
460
|
+
*/
|
|
461
|
+
type SortingOrigin = {
|
|
462
|
+
latitude?: number | null;
|
|
463
|
+
longitude?: number | null;
|
|
464
|
+
};
|
|
445
465
|
/**
|
|
446
466
|
* Helper type to get the fields from a WQL group
|
|
447
467
|
* @template WQLGroup The WQL group type
|
|
@@ -459,6 +479,7 @@ type Sorting<Spec extends WQLSpec> = Spec['wql'] extends {
|
|
|
459
479
|
fieldName?: string;
|
|
460
480
|
order?: SortOrder;
|
|
461
481
|
selectItemsBy?: Record<string, any>[] | null;
|
|
482
|
+
origin?: SortingOrigin | null;
|
|
462
483
|
} : {
|
|
463
484
|
[WQLGroupIndex in keyof Spec['wql']]: Spec['wql'][WQLGroupIndex] extends {
|
|
464
485
|
fields: readonly string[];
|
|
@@ -467,18 +488,22 @@ type Sorting<Spec extends WQLSpec> = Spec['wql'] extends {
|
|
|
467
488
|
fieldName: WQLFields<Spec['wql'][WQLGroupIndex]>;
|
|
468
489
|
order: typeof SORT_DIRECTIONS.ASC;
|
|
469
490
|
selectItemsBy?: Record<string, any>[] | null;
|
|
491
|
+
origin?: SortingOrigin | null;
|
|
470
492
|
} : GroupSortCapability extends typeof SORT_DIRECTIONS.DESC ? {
|
|
471
493
|
fieldName: WQLFields<Spec['wql'][WQLGroupIndex]>;
|
|
472
494
|
order: typeof SORT_DIRECTIONS.DESC;
|
|
473
495
|
selectItemsBy?: Record<string, any>[] | null;
|
|
496
|
+
origin?: SortingOrigin | null;
|
|
474
497
|
} : GroupSortCapability extends typeof SORT_CAPABILITIES.BOTH ? {
|
|
475
498
|
fieldName: WQLFields<Spec['wql'][WQLGroupIndex]>;
|
|
476
499
|
order: SortOrder;
|
|
477
500
|
selectItemsBy?: Record<string, any>[] | null;
|
|
501
|
+
origin?: SortingOrigin | null;
|
|
478
502
|
} : GroupSortCapability extends typeof SORT_CAPABILITIES.NONE ? {
|
|
479
503
|
fieldName?: never;
|
|
480
504
|
order?: never;
|
|
481
505
|
selectItemsBy?: Record<string, any>[] | null;
|
|
506
|
+
origin?: SortingOrigin | null;
|
|
482
507
|
} : never : never;
|
|
483
508
|
}[keyof Spec['wql']];
|
|
484
509
|
|
|
@@ -1288,4 +1313,4 @@ interface QueryHelpers<T, S extends QuerySpec, R = QueryRequest<T, S>> {
|
|
|
1288
1313
|
Sort: SortFactory<S>;
|
|
1289
1314
|
}
|
|
1290
1315
|
|
|
1291
|
-
export { type APIMetadata, type AccessToken, type AccountInfo, type AggregatableFields, type Aggregation, type AggregationBuilder, type AggregationExpression, type AggregationFactory, type AggregationType, type AmbassadorFactory, type AmbassadorFunctionDescriptor, type AmbassadorRequestOptions, type AuthenticationStrategy, type BaseEventMetadata, type BoundAuthenticationStrategy, type BuildAmbassadorFunction, type BuildDescriptors, type BuildEventDefinition, type BuildRESTFunction, type BuildServicePluginDefinition, type CursorPaging, type DateHistogramAggregationBuilder, type Descriptors, EventDefinition, type EventHandler, type EventIdentity, type ExposeFieldsBasedOnToggle, type FieldFilter, type FieldSort, type Filter, type FilterExpression, type FilterFactory, type FilterableFields, type GetNestedType, type HTTPMethod, type Host, type HostModule, type HostModuleAPI, type HttpClient, type HttpResponse, type IdentityProvider, type MaybeContext, type Method, type MigrationOptions, type NestedAggregationBuilder, type NonNullablePaths, type OffsetPaging, type PagingFor, type PublicMetadata, type Query, type QueryBuilder, type QueryHelpers, type QueryRequest, type QuerySpec, type RESTFunctionDescriptor, type RangeAggregationBuilder, type RefreshToken, type RequestContext, type RequestOptions, type RequestOptionsFactory, type RestModuleMeta, SERVICE_PLUGIN_ERROR_TYPE, SORT_CAPABILITIES, SORT_DIRECTIONS, type ScalarAggregationBuilder, type Search, type SearchBuilder, type SearchDetails, type SearchExpression, type SearchHelpers, type SearchParamsBuilder, type SearchParamsFactory, type SearchRequest, type SearchSpec, type SearchableFields, type ServicePluginContract, ServicePluginDefinition, type ServicePluginMethodInput, type ServicePluginMethodMetadata, type SortCapability, type SortExpression, type SortFactory, type SortOrder, type Sorting, type Token, type TokenStorage, type Tokens, type ValueAggregationBuilder, type ValueAggregationSort, type WQL, type WQLSpec };
|
|
1316
|
+
export { type APIMetadata, type AccessToken, type AccountInfo, type AggregatableFields, type Aggregation, type AggregationBuilder, type AggregationExpression, type AggregationFactory, type AggregationType, type AmbassadorFactory, type AmbassadorFunctionDescriptor, type AmbassadorRequestOptions, type AuthenticationStrategy, type BaseEventMetadata, type BoundAuthenticationStrategy, type BuildAmbassadorFunction, type BuildDescriptors, type BuildEventDefinition, type BuildRESTFunction, type BuildServicePluginDefinition, type CursorPaging, type DateHistogramAggregationBuilder, type Descriptors, EventDefinition, type EventHandler, type EventIdentity, type ExposeFieldsBasedOnToggle, type FieldFilter, type FieldSort, type Filter, type FilterExpression, type FilterFactory, type FilterableFields, type GetNestedType, type HTTPMethod, type Host, type HostModule, type HostModuleAPI, type HttpClient, type HttpResponse, type IdentityProvider, type MaybeContext, type Method, type MigrationOptions, type NestedAggregationBuilder, type NonNullablePaths, type OffsetPaging, type PagingFor, type PublicMetadata, type Query, type QueryBuilder, type QueryHelpers, type QueryRequest, type QuerySpec, type RESTFunctionDescriptor, type RangeAggregationBuilder, type RefreshToken, type RequestContext, type RequestOptions, type RequestOptionsFactory, type RestModuleMeta, SERVICE_PLUGIN_ERROR_TYPE, SORT_CAPABILITIES, SORT_DIRECTIONS, type ScalarAggregationBuilder, type Search, type SearchBuilder, type SearchDetails, type SearchExpression, type SearchHelpers, type SearchParamsBuilder, type SearchParamsFactory, type SearchRequest, type SearchSpec, type SearchableFields, type ServicePluginContract, ServicePluginDefinition, type ServicePluginMethodInput, type ServicePluginMethodMetadata, type SortCapability, type SortExpression, type SortFactory, type SortOrder, type Sorting, type SortingOrigin, type Token, type TokenStorage, type Tokens, type ValueAggregationBuilder, type ValueAggregationSort, type WQL, type WQLSpec };
|
|
@@ -353,12 +353,24 @@ declare global {
|
|
|
353
353
|
}
|
|
354
354
|
}
|
|
355
355
|
/**
|
|
356
|
-
*
|
|
357
|
-
*
|
|
356
|
+
* Creates concrete types from SDK descriptors when a contextual client is
|
|
357
|
+
* available.
|
|
358
|
+
*
|
|
359
|
+
* For a REST descriptor the built (bound) API is intersected with the original
|
|
360
|
+
* descriptor, matching what `contextualizeRESTModuleV2` returns at runtime — a
|
|
361
|
+
* value callable as the bound API and still usable as a descriptor. Keeping the
|
|
362
|
+
* descriptor half lets contextual modules be passed to descriptor-constrained
|
|
363
|
+
* helpers such as `elevate` from `@wix/sdk/context` (FEDINF-14092).
|
|
364
|
+
*
|
|
365
|
+
* The `& T` is scoped to REST descriptors — the only shape codegen wraps in
|
|
366
|
+
* `MaybeContext` — so `BuildDescriptors` (used by `createClient().use`) is left
|
|
367
|
+
* unchanged and stays bound-only. The fix lives here rather than in `elevate`,
|
|
368
|
+
* which is kept strict on purpose (see #941) so it still rejects bound-only
|
|
369
|
+
* functions that are unsafe through `createRESTModule`.
|
|
358
370
|
*/
|
|
359
371
|
type MaybeContext<T extends Descriptors> = globalThis.ContextualClient extends {
|
|
360
372
|
host: Host;
|
|
361
|
-
} ? BuildDescriptors<T, globalThis.ContextualClient['host']> : T;
|
|
373
|
+
} ? T extends RESTFunctionDescriptor ? BuildDescriptors<T, globalThis.ContextualClient['host']> & T : BuildDescriptors<T, globalThis.ContextualClient['host']> : T;
|
|
362
374
|
|
|
363
375
|
/**
|
|
364
376
|
* Expose fields based on the current exposure toggle.
|
|
@@ -500,6 +512,14 @@ declare const SORT_CAPABILITIES: {
|
|
|
500
512
|
readonly ASC: "ASC";
|
|
501
513
|
readonly DESC: "DESC";
|
|
502
514
|
};
|
|
515
|
+
/**
|
|
516
|
+
* Origin point for geo-distance sorting on a GEO field.
|
|
517
|
+
* Results are ordered by distance from this point (ASC = nearest first, DESC = farthest first).
|
|
518
|
+
*/
|
|
519
|
+
type SortingOrigin = {
|
|
520
|
+
latitude?: number | null;
|
|
521
|
+
longitude?: number | null;
|
|
522
|
+
};
|
|
503
523
|
/**
|
|
504
524
|
* Helper type to get the fields from a WQL group
|
|
505
525
|
* @template WQLGroup The WQL group type
|
|
@@ -517,6 +537,7 @@ type Sorting<Spec extends WQLSpec> = Spec['wql'] extends {
|
|
|
517
537
|
fieldName?: string;
|
|
518
538
|
order?: SortOrder;
|
|
519
539
|
selectItemsBy?: Record<string, any>[] | null;
|
|
540
|
+
origin?: SortingOrigin | null;
|
|
520
541
|
} : {
|
|
521
542
|
[WQLGroupIndex in keyof Spec['wql']]: Spec['wql'][WQLGroupIndex] extends {
|
|
522
543
|
fields: readonly string[];
|
|
@@ -525,18 +546,22 @@ type Sorting<Spec extends WQLSpec> = Spec['wql'] extends {
|
|
|
525
546
|
fieldName: WQLFields<Spec['wql'][WQLGroupIndex]>;
|
|
526
547
|
order: typeof SORT_DIRECTIONS.ASC;
|
|
527
548
|
selectItemsBy?: Record<string, any>[] | null;
|
|
549
|
+
origin?: SortingOrigin | null;
|
|
528
550
|
} : GroupSortCapability extends typeof SORT_DIRECTIONS.DESC ? {
|
|
529
551
|
fieldName: WQLFields<Spec['wql'][WQLGroupIndex]>;
|
|
530
552
|
order: typeof SORT_DIRECTIONS.DESC;
|
|
531
553
|
selectItemsBy?: Record<string, any>[] | null;
|
|
554
|
+
origin?: SortingOrigin | null;
|
|
532
555
|
} : GroupSortCapability extends typeof SORT_CAPABILITIES.BOTH ? {
|
|
533
556
|
fieldName: WQLFields<Spec['wql'][WQLGroupIndex]>;
|
|
534
557
|
order: SortOrder;
|
|
535
558
|
selectItemsBy?: Record<string, any>[] | null;
|
|
559
|
+
origin?: SortingOrigin | null;
|
|
536
560
|
} : GroupSortCapability extends typeof SORT_CAPABILITIES.NONE ? {
|
|
537
561
|
fieldName?: never;
|
|
538
562
|
order?: never;
|
|
539
563
|
selectItemsBy?: Record<string, any>[] | null;
|
|
564
|
+
origin?: SortingOrigin | null;
|
|
540
565
|
} : never : never;
|
|
541
566
|
}[keyof Spec['wql']];
|
|
542
567
|
|
|
@@ -1346,4 +1371,4 @@ interface QueryHelpers<T, S extends QuerySpec, R = QueryRequest<T, S>> {
|
|
|
1346
1371
|
Sort: SortFactory<S>;
|
|
1347
1372
|
}
|
|
1348
1373
|
|
|
1349
|
-
export { type APIMetadata, type AccessToken, type AccountInfo, type AggregatableFields, type Aggregation, type AggregationBuilder, type AggregationExpression, type AggregationFactory, type AggregationType, type AmbassadorFactory, type AmbassadorFunctionDescriptor, type AmbassadorRequestOptions, type AuthenticationStrategy, type BaseEventMetadata, type BoundAuthenticationStrategy, type BuildAmbassadorFunction, type BuildDescriptors, type BuildEventDefinition, type BuildRESTFunction, type BuildServicePluginDefinition, type CursorPaging, type DateHistogramAggregationBuilder, type Descriptors, EventDefinition, type EventHandler, type EventIdentity, type ExposeFieldsBasedOnToggle, type FieldFilter, type FieldSort, type Filter, type FilterExpression, type FilterFactory, type FilterableFields, type GetNestedType, type HTTPMethod, type Host, type HostModule, type HostModuleAPI, type HttpClient, type HttpResponse, type IdentityProvider, type MaybeContext, type Method, type MigrationOptions, type NestedAggregationBuilder, type NonNullablePaths, type OffsetPaging, type PagingFor, type PublicMetadata, type Query, type QueryBuilder, type QueryHelpers, type QueryRequest, type QuerySpec, type RESTFunctionDescriptor, type RangeAggregationBuilder, type RefreshToken, type RequestContext, type RequestOptions, type RequestOptionsFactory, type RestModuleMeta, SERVICE_PLUGIN_ERROR_TYPE, SORT_CAPABILITIES, SORT_DIRECTIONS, type ScalarAggregationBuilder, type Search, type SearchBuilder, type SearchDetails, type SearchExpression, type SearchHelpers, type SearchParamsBuilder, type SearchParamsFactory, type SearchRequest, type SearchSpec, type SearchableFields, type ServicePluginContract, ServicePluginDefinition, type ServicePluginMethodInput, type ServicePluginMethodMetadata, type SortCapability, type SortExpression, type SortFactory, type SortOrder, type Sorting, type Token, type TokenStorage, type Tokens, type ValueAggregationBuilder, type ValueAggregationSort, type WQL, type WQLSpec };
|
|
1374
|
+
export { type APIMetadata, type AccessToken, type AccountInfo, type AggregatableFields, type Aggregation, type AggregationBuilder, type AggregationExpression, type AggregationFactory, type AggregationType, type AmbassadorFactory, type AmbassadorFunctionDescriptor, type AmbassadorRequestOptions, type AuthenticationStrategy, type BaseEventMetadata, type BoundAuthenticationStrategy, type BuildAmbassadorFunction, type BuildDescriptors, type BuildEventDefinition, type BuildRESTFunction, type BuildServicePluginDefinition, type CursorPaging, type DateHistogramAggregationBuilder, type Descriptors, EventDefinition, type EventHandler, type EventIdentity, type ExposeFieldsBasedOnToggle, type FieldFilter, type FieldSort, type Filter, type FilterExpression, type FilterFactory, type FilterableFields, type GetNestedType, type HTTPMethod, type Host, type HostModule, type HostModuleAPI, type HttpClient, type HttpResponse, type IdentityProvider, type MaybeContext, type Method, type MigrationOptions, type NestedAggregationBuilder, type NonNullablePaths, type OffsetPaging, type PagingFor, type PublicMetadata, type Query, type QueryBuilder, type QueryHelpers, type QueryRequest, type QuerySpec, type RESTFunctionDescriptor, type RangeAggregationBuilder, type RefreshToken, type RequestContext, type RequestOptions, type RequestOptionsFactory, type RestModuleMeta, SERVICE_PLUGIN_ERROR_TYPE, SORT_CAPABILITIES, SORT_DIRECTIONS, type ScalarAggregationBuilder, type Search, type SearchBuilder, type SearchDetails, type SearchExpression, type SearchHelpers, type SearchParamsBuilder, type SearchParamsFactory, type SearchRequest, type SearchSpec, type SearchableFields, type ServicePluginContract, ServicePluginDefinition, type ServicePluginMethodInput, type ServicePluginMethodMetadata, type SortCapability, type SortExpression, type SortFactory, type SortOrder, type Sorting, type SortingOrigin, type Token, type TokenStorage, type Tokens, type ValueAggregationBuilder, type ValueAggregationSort, type WQL, type WQLSpec };
|
|
@@ -353,12 +353,24 @@ declare global {
|
|
|
353
353
|
}
|
|
354
354
|
}
|
|
355
355
|
/**
|
|
356
|
-
*
|
|
357
|
-
*
|
|
356
|
+
* Creates concrete types from SDK descriptors when a contextual client is
|
|
357
|
+
* available.
|
|
358
|
+
*
|
|
359
|
+
* For a REST descriptor the built (bound) API is intersected with the original
|
|
360
|
+
* descriptor, matching what `contextualizeRESTModuleV2` returns at runtime — a
|
|
361
|
+
* value callable as the bound API and still usable as a descriptor. Keeping the
|
|
362
|
+
* descriptor half lets contextual modules be passed to descriptor-constrained
|
|
363
|
+
* helpers such as `elevate` from `@wix/sdk/context` (FEDINF-14092).
|
|
364
|
+
*
|
|
365
|
+
* The `& T` is scoped to REST descriptors — the only shape codegen wraps in
|
|
366
|
+
* `MaybeContext` — so `BuildDescriptors` (used by `createClient().use`) is left
|
|
367
|
+
* unchanged and stays bound-only. The fix lives here rather than in `elevate`,
|
|
368
|
+
* which is kept strict on purpose (see #941) so it still rejects bound-only
|
|
369
|
+
* functions that are unsafe through `createRESTModule`.
|
|
358
370
|
*/
|
|
359
371
|
type MaybeContext<T extends Descriptors> = globalThis.ContextualClient extends {
|
|
360
372
|
host: Host;
|
|
361
|
-
} ? BuildDescriptors<T, globalThis.ContextualClient['host']> : T;
|
|
373
|
+
} ? T extends RESTFunctionDescriptor ? BuildDescriptors<T, globalThis.ContextualClient['host']> & T : BuildDescriptors<T, globalThis.ContextualClient['host']> : T;
|
|
362
374
|
|
|
363
375
|
/**
|
|
364
376
|
* Expose fields based on the current exposure toggle.
|
|
@@ -500,6 +512,14 @@ declare const SORT_CAPABILITIES: {
|
|
|
500
512
|
readonly ASC: "ASC";
|
|
501
513
|
readonly DESC: "DESC";
|
|
502
514
|
};
|
|
515
|
+
/**
|
|
516
|
+
* Origin point for geo-distance sorting on a GEO field.
|
|
517
|
+
* Results are ordered by distance from this point (ASC = nearest first, DESC = farthest first).
|
|
518
|
+
*/
|
|
519
|
+
type SortingOrigin = {
|
|
520
|
+
latitude?: number | null;
|
|
521
|
+
longitude?: number | null;
|
|
522
|
+
};
|
|
503
523
|
/**
|
|
504
524
|
* Helper type to get the fields from a WQL group
|
|
505
525
|
* @template WQLGroup The WQL group type
|
|
@@ -517,6 +537,7 @@ type Sorting<Spec extends WQLSpec> = Spec['wql'] extends {
|
|
|
517
537
|
fieldName?: string;
|
|
518
538
|
order?: SortOrder;
|
|
519
539
|
selectItemsBy?: Record<string, any>[] | null;
|
|
540
|
+
origin?: SortingOrigin | null;
|
|
520
541
|
} : {
|
|
521
542
|
[WQLGroupIndex in keyof Spec['wql']]: Spec['wql'][WQLGroupIndex] extends {
|
|
522
543
|
fields: readonly string[];
|
|
@@ -525,18 +546,22 @@ type Sorting<Spec extends WQLSpec> = Spec['wql'] extends {
|
|
|
525
546
|
fieldName: WQLFields<Spec['wql'][WQLGroupIndex]>;
|
|
526
547
|
order: typeof SORT_DIRECTIONS.ASC;
|
|
527
548
|
selectItemsBy?: Record<string, any>[] | null;
|
|
549
|
+
origin?: SortingOrigin | null;
|
|
528
550
|
} : GroupSortCapability extends typeof SORT_DIRECTIONS.DESC ? {
|
|
529
551
|
fieldName: WQLFields<Spec['wql'][WQLGroupIndex]>;
|
|
530
552
|
order: typeof SORT_DIRECTIONS.DESC;
|
|
531
553
|
selectItemsBy?: Record<string, any>[] | null;
|
|
554
|
+
origin?: SortingOrigin | null;
|
|
532
555
|
} : GroupSortCapability extends typeof SORT_CAPABILITIES.BOTH ? {
|
|
533
556
|
fieldName: WQLFields<Spec['wql'][WQLGroupIndex]>;
|
|
534
557
|
order: SortOrder;
|
|
535
558
|
selectItemsBy?: Record<string, any>[] | null;
|
|
559
|
+
origin?: SortingOrigin | null;
|
|
536
560
|
} : GroupSortCapability extends typeof SORT_CAPABILITIES.NONE ? {
|
|
537
561
|
fieldName?: never;
|
|
538
562
|
order?: never;
|
|
539
563
|
selectItemsBy?: Record<string, any>[] | null;
|
|
564
|
+
origin?: SortingOrigin | null;
|
|
540
565
|
} : never : never;
|
|
541
566
|
}[keyof Spec['wql']];
|
|
542
567
|
|
|
@@ -1346,4 +1371,4 @@ interface QueryHelpers<T, S extends QuerySpec, R = QueryRequest<T, S>> {
|
|
|
1346
1371
|
Sort: SortFactory<S>;
|
|
1347
1372
|
}
|
|
1348
1373
|
|
|
1349
|
-
export { type APIMetadata, type AccessToken, type AccountInfo, type AggregatableFields, type Aggregation, type AggregationBuilder, type AggregationExpression, type AggregationFactory, type AggregationType, type AmbassadorFactory, type AmbassadorFunctionDescriptor, type AmbassadorRequestOptions, type AuthenticationStrategy, type BaseEventMetadata, type BoundAuthenticationStrategy, type BuildAmbassadorFunction, type BuildDescriptors, type BuildEventDefinition, type BuildRESTFunction, type BuildServicePluginDefinition, type CursorPaging, type DateHistogramAggregationBuilder, type Descriptors, EventDefinition, type EventHandler, type EventIdentity, type ExposeFieldsBasedOnToggle, type FieldFilter, type FieldSort, type Filter, type FilterExpression, type FilterFactory, type FilterableFields, type GetNestedType, type HTTPMethod, type Host, type HostModule, type HostModuleAPI, type HttpClient, type HttpResponse, type IdentityProvider, type MaybeContext, type Method, type MigrationOptions, type NestedAggregationBuilder, type NonNullablePaths, type OffsetPaging, type PagingFor, type PublicMetadata, type Query, type QueryBuilder, type QueryHelpers, type QueryRequest, type QuerySpec, type RESTFunctionDescriptor, type RangeAggregationBuilder, type RefreshToken, type RequestContext, type RequestOptions, type RequestOptionsFactory, type RestModuleMeta, SERVICE_PLUGIN_ERROR_TYPE, SORT_CAPABILITIES, SORT_DIRECTIONS, type ScalarAggregationBuilder, type Search, type SearchBuilder, type SearchDetails, type SearchExpression, type SearchHelpers, type SearchParamsBuilder, type SearchParamsFactory, type SearchRequest, type SearchSpec, type SearchableFields, type ServicePluginContract, ServicePluginDefinition, type ServicePluginMethodInput, type ServicePluginMethodMetadata, type SortCapability, type SortExpression, type SortFactory, type SortOrder, type Sorting, type Token, type TokenStorage, type Tokens, type ValueAggregationBuilder, type ValueAggregationSort, type WQL, type WQLSpec };
|
|
1374
|
+
export { type APIMetadata, type AccessToken, type AccountInfo, type AggregatableFields, type Aggregation, type AggregationBuilder, type AggregationExpression, type AggregationFactory, type AggregationType, type AmbassadorFactory, type AmbassadorFunctionDescriptor, type AmbassadorRequestOptions, type AuthenticationStrategy, type BaseEventMetadata, type BoundAuthenticationStrategy, type BuildAmbassadorFunction, type BuildDescriptors, type BuildEventDefinition, type BuildRESTFunction, type BuildServicePluginDefinition, type CursorPaging, type DateHistogramAggregationBuilder, type Descriptors, EventDefinition, type EventHandler, type EventIdentity, type ExposeFieldsBasedOnToggle, type FieldFilter, type FieldSort, type Filter, type FilterExpression, type FilterFactory, type FilterableFields, type GetNestedType, type HTTPMethod, type Host, type HostModule, type HostModuleAPI, type HttpClient, type HttpResponse, type IdentityProvider, type MaybeContext, type Method, type MigrationOptions, type NestedAggregationBuilder, type NonNullablePaths, type OffsetPaging, type PagingFor, type PublicMetadata, type Query, type QueryBuilder, type QueryHelpers, type QueryRequest, type QuerySpec, type RESTFunctionDescriptor, type RangeAggregationBuilder, type RefreshToken, type RequestContext, type RequestOptions, type RequestOptionsFactory, type RestModuleMeta, SERVICE_PLUGIN_ERROR_TYPE, SORT_CAPABILITIES, SORT_DIRECTIONS, type ScalarAggregationBuilder, type Search, type SearchBuilder, type SearchDetails, type SearchExpression, type SearchHelpers, type SearchParamsBuilder, type SearchParamsFactory, type SearchRequest, type SearchSpec, type SearchableFields, type ServicePluginContract, ServicePluginDefinition, type ServicePluginMethodInput, type ServicePluginMethodMetadata, type SortCapability, type SortExpression, type SortFactory, type SortOrder, type Sorting, type SortingOrigin, type Token, type TokenStorage, type Tokens, type ValueAggregationBuilder, type ValueAggregationSort, type WQL, type WQLSpec };
|
|
@@ -353,12 +353,24 @@ declare global {
|
|
|
353
353
|
}
|
|
354
354
|
}
|
|
355
355
|
/**
|
|
356
|
-
*
|
|
357
|
-
*
|
|
356
|
+
* Creates concrete types from SDK descriptors when a contextual client is
|
|
357
|
+
* available.
|
|
358
|
+
*
|
|
359
|
+
* For a REST descriptor the built (bound) API is intersected with the original
|
|
360
|
+
* descriptor, matching what `contextualizeRESTModuleV2` returns at runtime — a
|
|
361
|
+
* value callable as the bound API and still usable as a descriptor. Keeping the
|
|
362
|
+
* descriptor half lets contextual modules be passed to descriptor-constrained
|
|
363
|
+
* helpers such as `elevate` from `@wix/sdk/context` (FEDINF-14092).
|
|
364
|
+
*
|
|
365
|
+
* The `& T` is scoped to REST descriptors — the only shape codegen wraps in
|
|
366
|
+
* `MaybeContext` — so `BuildDescriptors` (used by `createClient().use`) is left
|
|
367
|
+
* unchanged and stays bound-only. The fix lives here rather than in `elevate`,
|
|
368
|
+
* which is kept strict on purpose (see #941) so it still rejects bound-only
|
|
369
|
+
* functions that are unsafe through `createRESTModule`.
|
|
358
370
|
*/
|
|
359
371
|
type MaybeContext<T extends Descriptors> = globalThis.ContextualClient extends {
|
|
360
372
|
host: Host;
|
|
361
|
-
} ? BuildDescriptors<T, globalThis.ContextualClient['host']> : T;
|
|
373
|
+
} ? T extends RESTFunctionDescriptor ? BuildDescriptors<T, globalThis.ContextualClient['host']> & T : BuildDescriptors<T, globalThis.ContextualClient['host']> : T;
|
|
362
374
|
|
|
363
375
|
/**
|
|
364
376
|
* Expose fields based on the current exposure toggle.
|
|
@@ -500,6 +512,14 @@ declare const SORT_CAPABILITIES: {
|
|
|
500
512
|
readonly ASC: "ASC";
|
|
501
513
|
readonly DESC: "DESC";
|
|
502
514
|
};
|
|
515
|
+
/**
|
|
516
|
+
* Origin point for geo-distance sorting on a GEO field.
|
|
517
|
+
* Results are ordered by distance from this point (ASC = nearest first, DESC = farthest first).
|
|
518
|
+
*/
|
|
519
|
+
type SortingOrigin = {
|
|
520
|
+
latitude?: number | null;
|
|
521
|
+
longitude?: number | null;
|
|
522
|
+
};
|
|
503
523
|
/**
|
|
504
524
|
* Helper type to get the fields from a WQL group
|
|
505
525
|
* @template WQLGroup The WQL group type
|
|
@@ -517,6 +537,7 @@ type Sorting<Spec extends WQLSpec> = Spec['wql'] extends {
|
|
|
517
537
|
fieldName?: string;
|
|
518
538
|
order?: SortOrder;
|
|
519
539
|
selectItemsBy?: Record<string, any>[] | null;
|
|
540
|
+
origin?: SortingOrigin | null;
|
|
520
541
|
} : {
|
|
521
542
|
[WQLGroupIndex in keyof Spec['wql']]: Spec['wql'][WQLGroupIndex] extends {
|
|
522
543
|
fields: readonly string[];
|
|
@@ -525,18 +546,22 @@ type Sorting<Spec extends WQLSpec> = Spec['wql'] extends {
|
|
|
525
546
|
fieldName: WQLFields<Spec['wql'][WQLGroupIndex]>;
|
|
526
547
|
order: typeof SORT_DIRECTIONS.ASC;
|
|
527
548
|
selectItemsBy?: Record<string, any>[] | null;
|
|
549
|
+
origin?: SortingOrigin | null;
|
|
528
550
|
} : GroupSortCapability extends typeof SORT_DIRECTIONS.DESC ? {
|
|
529
551
|
fieldName: WQLFields<Spec['wql'][WQLGroupIndex]>;
|
|
530
552
|
order: typeof SORT_DIRECTIONS.DESC;
|
|
531
553
|
selectItemsBy?: Record<string, any>[] | null;
|
|
554
|
+
origin?: SortingOrigin | null;
|
|
532
555
|
} : GroupSortCapability extends typeof SORT_CAPABILITIES.BOTH ? {
|
|
533
556
|
fieldName: WQLFields<Spec['wql'][WQLGroupIndex]>;
|
|
534
557
|
order: SortOrder;
|
|
535
558
|
selectItemsBy?: Record<string, any>[] | null;
|
|
559
|
+
origin?: SortingOrigin | null;
|
|
536
560
|
} : GroupSortCapability extends typeof SORT_CAPABILITIES.NONE ? {
|
|
537
561
|
fieldName?: never;
|
|
538
562
|
order?: never;
|
|
539
563
|
selectItemsBy?: Record<string, any>[] | null;
|
|
564
|
+
origin?: SortingOrigin | null;
|
|
540
565
|
} : never : never;
|
|
541
566
|
}[keyof Spec['wql']];
|
|
542
567
|
|
|
@@ -1346,4 +1371,4 @@ interface QueryHelpers<T, S extends QuerySpec, R = QueryRequest<T, S>> {
|
|
|
1346
1371
|
Sort: SortFactory<S>;
|
|
1347
1372
|
}
|
|
1348
1373
|
|
|
1349
|
-
export { type APIMetadata, type AccessToken, type AccountInfo, type AggregatableFields, type Aggregation, type AggregationBuilder, type AggregationExpression, type AggregationFactory, type AggregationType, type AmbassadorFactory, type AmbassadorFunctionDescriptor, type AmbassadorRequestOptions, type AuthenticationStrategy, type BaseEventMetadata, type BoundAuthenticationStrategy, type BuildAmbassadorFunction, type BuildDescriptors, type BuildEventDefinition, type BuildRESTFunction, type BuildServicePluginDefinition, type CursorPaging, type DateHistogramAggregationBuilder, type Descriptors, EventDefinition, type EventHandler, type EventIdentity, type ExposeFieldsBasedOnToggle, type FieldFilter, type FieldSort, type Filter, type FilterExpression, type FilterFactory, type FilterableFields, type GetNestedType, type HTTPMethod, type Host, type HostModule, type HostModuleAPI, type HttpClient, type HttpResponse, type IdentityProvider, type MaybeContext, type Method, type MigrationOptions, type NestedAggregationBuilder, type NonNullablePaths, type OffsetPaging, type PagingFor, type PublicMetadata, type Query, type QueryBuilder, type QueryHelpers, type QueryRequest, type QuerySpec, type RESTFunctionDescriptor, type RangeAggregationBuilder, type RefreshToken, type RequestContext, type RequestOptions, type RequestOptionsFactory, type RestModuleMeta, SERVICE_PLUGIN_ERROR_TYPE, SORT_CAPABILITIES, SORT_DIRECTIONS, type ScalarAggregationBuilder, type Search, type SearchBuilder, type SearchDetails, type SearchExpression, type SearchHelpers, type SearchParamsBuilder, type SearchParamsFactory, type SearchRequest, type SearchSpec, type SearchableFields, type ServicePluginContract, ServicePluginDefinition, type ServicePluginMethodInput, type ServicePluginMethodMetadata, type SortCapability, type SortExpression, type SortFactory, type SortOrder, type Sorting, type Token, type TokenStorage, type Tokens, type ValueAggregationBuilder, type ValueAggregationSort, type WQL, type WQLSpec };
|
|
1374
|
+
export { type APIMetadata, type AccessToken, type AccountInfo, type AggregatableFields, type Aggregation, type AggregationBuilder, type AggregationExpression, type AggregationFactory, type AggregationType, type AmbassadorFactory, type AmbassadorFunctionDescriptor, type AmbassadorRequestOptions, type AuthenticationStrategy, type BaseEventMetadata, type BoundAuthenticationStrategy, type BuildAmbassadorFunction, type BuildDescriptors, type BuildEventDefinition, type BuildRESTFunction, type BuildServicePluginDefinition, type CursorPaging, type DateHistogramAggregationBuilder, type Descriptors, EventDefinition, type EventHandler, type EventIdentity, type ExposeFieldsBasedOnToggle, type FieldFilter, type FieldSort, type Filter, type FilterExpression, type FilterFactory, type FilterableFields, type GetNestedType, type HTTPMethod, type Host, type HostModule, type HostModuleAPI, type HttpClient, type HttpResponse, type IdentityProvider, type MaybeContext, type Method, type MigrationOptions, type NestedAggregationBuilder, type NonNullablePaths, type OffsetPaging, type PagingFor, type PublicMetadata, type Query, type QueryBuilder, type QueryHelpers, type QueryRequest, type QuerySpec, type RESTFunctionDescriptor, type RangeAggregationBuilder, type RefreshToken, type RequestContext, type RequestOptions, type RequestOptionsFactory, type RestModuleMeta, SERVICE_PLUGIN_ERROR_TYPE, SORT_CAPABILITIES, SORT_DIRECTIONS, type ScalarAggregationBuilder, type Search, type SearchBuilder, type SearchDetails, type SearchExpression, type SearchHelpers, type SearchParamsBuilder, type SearchParamsFactory, type SearchRequest, type SearchSpec, type SearchableFields, type ServicePluginContract, ServicePluginDefinition, type ServicePluginMethodInput, type ServicePluginMethodMetadata, type SortCapability, type SortExpression, type SortFactory, type SortOrder, type Sorting, type SortingOrigin, type Token, type TokenStorage, type Tokens, type ValueAggregationBuilder, type ValueAggregationSort, type WQL, type WQLSpec };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wix/sdk-types",
|
|
3
|
-
"version": "1.17.
|
|
3
|
+
"version": "1.17.11",
|
|
4
4
|
"author": {
|
|
5
5
|
"name": "Ronny Ringel",
|
|
6
6
|
"email": "ronnyr@wix.com"
|
|
@@ -62,5 +62,5 @@
|
|
|
62
62
|
]
|
|
63
63
|
}
|
|
64
64
|
},
|
|
65
|
-
"falconPackageHash": "
|
|
65
|
+
"falconPackageHash": "1da777a5d84bf4a8c619897e838f26d5fd1992d2ee20c0665485bce0"
|
|
66
66
|
}
|