@wix/papyrus 1.0.13 → 1.0.15
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wix/papyrus",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.15",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"registry": "https://registry.npmjs.org/",
|
|
6
6
|
"access": "public"
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"schemas"
|
|
23
23
|
],
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@wix/auto_sdk_papyrus_templates": "1.0.
|
|
25
|
+
"@wix/auto_sdk_papyrus_templates": "1.0.1",
|
|
26
26
|
"@wix/papyrus_documents": "^1.0.0"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
@@ -54,5 +54,5 @@
|
|
|
54
54
|
"types": "./build/es/schemas.d.mts"
|
|
55
55
|
}
|
|
56
56
|
},
|
|
57
|
-
"falconPackageHash": "
|
|
57
|
+
"falconPackageHash": "ebc2759f58cd053f3068c41527bd096831923e2c4b3f171db30fd3a0"
|
|
58
58
|
}
|
|
@@ -754,12 +754,19 @@ declare global {
|
|
|
754
754
|
}
|
|
755
755
|
|
|
756
756
|
type HTTPMethod = 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
|
|
757
|
-
type RESTFunctionDescriptor<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient
|
|
757
|
+
type RESTFunctionDescriptor<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient, options?: {
|
|
758
|
+
validateRequestSchema?: boolean;
|
|
759
|
+
}) => T;
|
|
758
760
|
interface HttpClient {
|
|
759
761
|
request<TResponse, TData = any>(req: RequestOptionsFactory<TResponse, TData>): Promise<HttpResponse<TResponse>>;
|
|
760
762
|
fetchWithAuth: typeof fetch;
|
|
761
763
|
wixAPIFetch: (relativeUrl: string, options: RequestInit) => Promise<Response>;
|
|
764
|
+
/** Returns the current access token synchronously, if available. */
|
|
762
765
|
getActiveToken?: () => string | undefined;
|
|
766
|
+
/** Returns auth headers (may trigger token refresh). Prefer this over getActiveToken when making authenticated requests. */
|
|
767
|
+
getAuthHeaders?: () => Promise<{
|
|
768
|
+
headers: Record<string, string>;
|
|
769
|
+
}>;
|
|
763
770
|
}
|
|
764
771
|
type RequestOptionsFactory<TResponse = any, TData = any> = (context: any) => RequestOptions<TResponse, TData>;
|
|
765
772
|
type HttpResponse<T = any> = {
|
|
@@ -956,12 +956,12 @@ type Host<Environment = unknown> = {
|
|
|
956
956
|
} | undefined;
|
|
957
957
|
};
|
|
958
958
|
|
|
959
|
-
type HTTPMethod
|
|
960
|
-
type RESTFunctionDescriptor
|
|
959
|
+
type HTTPMethod = 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
|
|
960
|
+
type RESTFunctionDescriptor<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient, options?: {
|
|
961
961
|
validateRequestSchema?: boolean;
|
|
962
962
|
}) => T;
|
|
963
|
-
interface HttpClient
|
|
964
|
-
request<TResponse, TData = any>(req: RequestOptionsFactory
|
|
963
|
+
interface HttpClient {
|
|
964
|
+
request<TResponse, TData = any>(req: RequestOptionsFactory<TResponse, TData>): Promise<HttpResponse<TResponse>>;
|
|
965
965
|
fetchWithAuth: typeof fetch;
|
|
966
966
|
wixAPIFetch: (relativeUrl: string, options: RequestInit) => Promise<Response>;
|
|
967
967
|
/** Returns the current access token synchronously, if available. */
|
|
@@ -971,47 +971,47 @@ interface HttpClient$1 {
|
|
|
971
971
|
headers: Record<string, string>;
|
|
972
972
|
}>;
|
|
973
973
|
}
|
|
974
|
-
type RequestOptionsFactory
|
|
975
|
-
type HttpResponse
|
|
974
|
+
type RequestOptionsFactory<TResponse = any, TData = any> = (context: any) => RequestOptions<TResponse, TData>;
|
|
975
|
+
type HttpResponse<T = any> = {
|
|
976
976
|
data: T;
|
|
977
977
|
status: number;
|
|
978
978
|
statusText: string;
|
|
979
979
|
headers: any;
|
|
980
980
|
request?: any;
|
|
981
981
|
};
|
|
982
|
-
type ResponseTransformer$1
|
|
983
|
-
type RequestOptions
|
|
984
|
-
method: HTTPMethod
|
|
982
|
+
type ResponseTransformer$1 = (data: any) => any;
|
|
983
|
+
type RequestOptions<_TResponse = any, Data = any> = {
|
|
984
|
+
method: HTTPMethod;
|
|
985
985
|
url: string;
|
|
986
986
|
data?: Data;
|
|
987
987
|
params?: URLSearchParams;
|
|
988
|
-
fallback?: RequestOptions
|
|
988
|
+
fallback?: RequestOptions<any, any>[];
|
|
989
989
|
/**
|
|
990
990
|
* The array option is for interoperability, defacto only the first function is used
|
|
991
991
|
* if an array is provided
|
|
992
992
|
*/
|
|
993
|
-
transformResponse?: ResponseTransformer$1
|
|
994
|
-
} & APIMetadata
|
|
995
|
-
type APIMetadata
|
|
993
|
+
transformResponse?: ResponseTransformer$1 | ResponseTransformer$1[];
|
|
994
|
+
} & APIMetadata;
|
|
995
|
+
type APIMetadata = {
|
|
996
996
|
methodFqn?: string;
|
|
997
997
|
entityFqdn?: string;
|
|
998
998
|
packageName?: string;
|
|
999
|
-
migrationOptions?: MigrationOptions
|
|
999
|
+
migrationOptions?: MigrationOptions;
|
|
1000
1000
|
};
|
|
1001
|
-
type MigrationOptions
|
|
1001
|
+
type MigrationOptions = {
|
|
1002
1002
|
optInTransformResponse?: boolean;
|
|
1003
1003
|
};
|
|
1004
|
-
type BuildRESTFunction
|
|
1005
|
-
type EventDefinition
|
|
1004
|
+
type BuildRESTFunction<T extends RESTFunctionDescriptor> = T extends RESTFunctionDescriptor<infer U> ? U : never;
|
|
1005
|
+
type EventDefinition<Payload = unknown, Type extends string = string> = {
|
|
1006
1006
|
__type: 'event-definition';
|
|
1007
1007
|
type: Type;
|
|
1008
1008
|
isDomainEvent?: boolean;
|
|
1009
1009
|
transformations?: (envelope: unknown) => Payload;
|
|
1010
1010
|
__payload: Payload;
|
|
1011
1011
|
};
|
|
1012
|
-
declare function EventDefinition
|
|
1013
|
-
type EventHandler
|
|
1014
|
-
type BuildEventDefinition
|
|
1012
|
+
declare function EventDefinition<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition<Payload, Type>;
|
|
1013
|
+
type EventHandler<T extends EventDefinition> = (payload: T['__payload']) => void | Promise<void>;
|
|
1014
|
+
type BuildEventDefinition<T extends EventDefinition<any, string>> = (handler: EventHandler<T>) => void;
|
|
1015
1015
|
|
|
1016
1016
|
type ServicePluginMethodInput = {
|
|
1017
1017
|
request: any;
|
|
@@ -1067,7 +1067,7 @@ type BuildAmbassadorFunction<T extends AmbassadorFunctionDescriptor> = T extends
|
|
|
1067
1067
|
* can either be a REST module or a host module.
|
|
1068
1068
|
* This type is recursive, so it can describe nested modules.
|
|
1069
1069
|
*/
|
|
1070
|
-
type Descriptors = RESTFunctionDescriptor
|
|
1070
|
+
type Descriptors = RESTFunctionDescriptor | AmbassadorFunctionDescriptor | HostModule<any, any> | EventDefinition<any> | ServicePluginDefinition<any> | {
|
|
1071
1071
|
[key: string]: Descriptors | PublicMetadata | any;
|
|
1072
1072
|
};
|
|
1073
1073
|
/**
|
|
@@ -1080,7 +1080,7 @@ type BuildDescriptors<T extends Descriptors, H extends Host<any> | undefined, De
|
|
|
1080
1080
|
done: T;
|
|
1081
1081
|
recurse: T extends {
|
|
1082
1082
|
__type: typeof SERVICE_PLUGIN_ERROR_TYPE;
|
|
1083
|
-
} ? never : T extends AmbassadorFunctionDescriptor ? BuildAmbassadorFunction<T> : T extends RESTFunctionDescriptor
|
|
1083
|
+
} ? never : T extends AmbassadorFunctionDescriptor ? BuildAmbassadorFunction<T> : T extends RESTFunctionDescriptor ? BuildRESTFunction<T> : T extends EventDefinition<any> ? BuildEventDefinition<T> : T extends ServicePluginDefinition<any> ? BuildServicePluginDefinition<T> : T extends HostModule<any, any> ? HostModuleAPI<T> : ConditionalExcept<{
|
|
1084
1084
|
[Key in keyof T]: T[Key] extends Descriptors ? BuildDescriptors<T[Key], H, [
|
|
1085
1085
|
-1,
|
|
1086
1086
|
0,
|
|
@@ -1101,12 +1101,24 @@ declare global {
|
|
|
1101
1101
|
}
|
|
1102
1102
|
}
|
|
1103
1103
|
/**
|
|
1104
|
-
*
|
|
1105
|
-
*
|
|
1104
|
+
* Creates concrete types from SDK descriptors when a contextual client is
|
|
1105
|
+
* available.
|
|
1106
|
+
*
|
|
1107
|
+
* For a REST descriptor the built (bound) API is intersected with the original
|
|
1108
|
+
* descriptor, matching what `contextualizeRESTModuleV2` returns at runtime — a
|
|
1109
|
+
* value callable as the bound API and still usable as a descriptor. Keeping the
|
|
1110
|
+
* descriptor half lets contextual modules be passed to descriptor-constrained
|
|
1111
|
+
* helpers such as `elevate` from `@wix/sdk/context` (FEDINF-14092).
|
|
1112
|
+
*
|
|
1113
|
+
* The `& T` is scoped to REST descriptors — the only shape codegen wraps in
|
|
1114
|
+
* `MaybeContext` — so `BuildDescriptors` (used by `createClient().use`) is left
|
|
1115
|
+
* unchanged and stays bound-only. The fix lives here rather than in `elevate`,
|
|
1116
|
+
* which is kept strict on purpose (see #941) so it still rejects bound-only
|
|
1117
|
+
* functions that are unsafe through `createRESTModule`.
|
|
1106
1118
|
*/
|
|
1107
1119
|
type MaybeContext<T extends Descriptors> = globalThis.ContextualClient extends {
|
|
1108
1120
|
host: Host;
|
|
1109
|
-
} ? BuildDescriptors<T, globalThis.ContextualClient['host']> : T;
|
|
1121
|
+
} ? T extends RESTFunctionDescriptor ? BuildDescriptors<T, globalThis.ContextualClient['host']> & T : BuildDescriptors<T, globalThis.ContextualClient['host']> : T;
|
|
1110
1122
|
declare global {
|
|
1111
1123
|
/**
|
|
1112
1124
|
* A global interface to set the exposure toggle for the SDK.
|
|
@@ -1205,6 +1217,14 @@ declare const SORT_CAPABILITIES: {
|
|
|
1205
1217
|
readonly ASC: "ASC";
|
|
1206
1218
|
readonly DESC: "DESC";
|
|
1207
1219
|
};
|
|
1220
|
+
/**
|
|
1221
|
+
* Origin point for geo-distance sorting on a GEO field.
|
|
1222
|
+
* Results are ordered by distance from this point (ASC = nearest first, DESC = farthest first).
|
|
1223
|
+
*/
|
|
1224
|
+
type SortingOrigin = {
|
|
1225
|
+
latitude?: number | null;
|
|
1226
|
+
longitude?: number | null;
|
|
1227
|
+
};
|
|
1208
1228
|
/**
|
|
1209
1229
|
* Helper type to get the fields from a WQL group
|
|
1210
1230
|
* @template WQLGroup The WQL group type
|
|
@@ -1222,6 +1242,7 @@ type Sorting$2<Spec extends WQLSpec> = Spec['wql'] extends {
|
|
|
1222
1242
|
fieldName?: string;
|
|
1223
1243
|
order?: SortOrder$2;
|
|
1224
1244
|
selectItemsBy?: Record<string, any>[] | null;
|
|
1245
|
+
origin?: SortingOrigin | null;
|
|
1225
1246
|
} : {
|
|
1226
1247
|
[WQLGroupIndex in keyof Spec['wql']]: Spec['wql'][WQLGroupIndex] extends {
|
|
1227
1248
|
fields: readonly string[];
|
|
@@ -1230,18 +1251,22 @@ type Sorting$2<Spec extends WQLSpec> = Spec['wql'] extends {
|
|
|
1230
1251
|
fieldName: WQLFields<Spec['wql'][WQLGroupIndex]>;
|
|
1231
1252
|
order: typeof SORT_DIRECTIONS.ASC;
|
|
1232
1253
|
selectItemsBy?: Record<string, any>[] | null;
|
|
1254
|
+
origin?: SortingOrigin | null;
|
|
1233
1255
|
} : GroupSortCapability extends typeof SORT_DIRECTIONS.DESC ? {
|
|
1234
1256
|
fieldName: WQLFields<Spec['wql'][WQLGroupIndex]>;
|
|
1235
1257
|
order: typeof SORT_DIRECTIONS.DESC;
|
|
1236
1258
|
selectItemsBy?: Record<string, any>[] | null;
|
|
1259
|
+
origin?: SortingOrigin | null;
|
|
1237
1260
|
} : GroupSortCapability extends typeof SORT_CAPABILITIES.BOTH ? {
|
|
1238
1261
|
fieldName: WQLFields<Spec['wql'][WQLGroupIndex]>;
|
|
1239
1262
|
order: SortOrder$2;
|
|
1240
1263
|
selectItemsBy?: Record<string, any>[] | null;
|
|
1264
|
+
origin?: SortingOrigin | null;
|
|
1241
1265
|
} : GroupSortCapability extends typeof SORT_CAPABILITIES.NONE ? {
|
|
1242
1266
|
fieldName?: never;
|
|
1243
1267
|
order?: never;
|
|
1244
1268
|
selectItemsBy?: Record<string, any>[] | null;
|
|
1269
|
+
origin?: SortingOrigin | null;
|
|
1245
1270
|
} : never : never;
|
|
1246
1271
|
}[keyof Spec['wql']];
|
|
1247
1272
|
|
|
@@ -2334,7 +2359,7 @@ interface DomainEvent$1 extends DomainEventBodyOneOf$1 {
|
|
|
2334
2359
|
/** If present, indicates the action that triggered the event. */
|
|
2335
2360
|
originatedFrom?: string | null;
|
|
2336
2361
|
/**
|
|
2337
|
-
* A sequence number that indicates the order of updates to an entity. For example, if an entity was updated at 16:00 and then again at 16:01
|
|
2362
|
+
* A sequence number that indicates the order of updates to an entity. For example, if an entity was updated at `16:00` and then again at `16:01`, the second update will always have a higher sequence number.
|
|
2338
2363
|
* You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it.
|
|
2339
2364
|
*/
|
|
2340
2365
|
entityEventSequence?: string | null;
|
|
@@ -2511,7 +2536,7 @@ interface EventMetadata$1 extends BaseEventMetadata$1 {
|
|
|
2511
2536
|
/** If present, indicates the action that triggered the event. */
|
|
2512
2537
|
originatedFrom?: string | null;
|
|
2513
2538
|
/**
|
|
2514
|
-
* A sequence number that indicates the order of updates to an entity. For example, if an entity was updated at 16:00 and then again at 16:01
|
|
2539
|
+
* A sequence number that indicates the order of updates to an entity. For example, if an entity was updated at `16:00` and then again at `16:01`, the second update will always have a higher sequence number.
|
|
2515
2540
|
* You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it.
|
|
2516
2541
|
*/
|
|
2517
2542
|
entityEventSequence?: string | null;
|
|
@@ -2653,7 +2678,7 @@ interface ResolveTemplateSettingsOptions {
|
|
|
2653
2678
|
templateId?: string | null;
|
|
2654
2679
|
}
|
|
2655
2680
|
|
|
2656
|
-
declare function upsertTemplateSettings$1(httpClient: HttpClient
|
|
2681
|
+
declare function upsertTemplateSettings$1(httpClient: HttpClient): UpsertTemplateSettingsSignature;
|
|
2657
2682
|
interface UpsertTemplateSettingsSignature {
|
|
2658
2683
|
/**
|
|
2659
2684
|
* Upsert Template Settings.
|
|
@@ -2662,7 +2687,7 @@ interface UpsertTemplateSettingsSignature {
|
|
|
2662
2687
|
__applicationErrorsType?: UpsertTemplateSettingsApplicationErrors;
|
|
2663
2688
|
}>;
|
|
2664
2689
|
}
|
|
2665
|
-
declare function resolveTemplateSettings$1(httpClient: HttpClient
|
|
2690
|
+
declare function resolveTemplateSettings$1(httpClient: HttpClient): ResolveTemplateSettingsSignature;
|
|
2666
2691
|
interface ResolveTemplateSettingsSignature {
|
|
2667
2692
|
/**
|
|
2668
2693
|
* Resolve Template Settings. Returns default Template Settings if it does not exist.
|
|
@@ -2671,20 +2696,20 @@ interface ResolveTemplateSettingsSignature {
|
|
|
2671
2696
|
__applicationErrorsType?: ResolveTemplateSettingsApplicationErrors;
|
|
2672
2697
|
}>;
|
|
2673
2698
|
}
|
|
2674
|
-
declare const onTemplateSettingsCreated$1: EventDefinition
|
|
2675
|
-
declare const onTemplateSettingsUpdated$1: EventDefinition
|
|
2699
|
+
declare const onTemplateSettingsCreated$1: EventDefinition<TemplateSettingsCreatedEnvelope, "wix.papyrus.v1.template_settings_created">;
|
|
2700
|
+
declare const onTemplateSettingsUpdated$1: EventDefinition<TemplateSettingsUpdatedEnvelope, "wix.papyrus.v1.template_settings_updated">;
|
|
2676
2701
|
|
|
2677
|
-
declare function customQueryTemplateSettings(httpClient: HttpClient
|
|
2702
|
+
declare function customQueryTemplateSettings(httpClient: HttpClient): {
|
|
2678
2703
|
(): SettingsQueryBuilder;
|
|
2679
2704
|
(query: TemplateSettingsQuery): ReturnType<typeof typedQueryTemplateSettings>;
|
|
2680
2705
|
};
|
|
2681
|
-
declare const upsertTemplateSettings: MaybeContext<BuildRESTFunction
|
|
2682
|
-
declare const resolveTemplateSettings: MaybeContext<BuildRESTFunction
|
|
2683
|
-
declare const queryTemplateSettings: MaybeContext<BuildRESTFunction
|
|
2706
|
+
declare const upsertTemplateSettings: MaybeContext<BuildRESTFunction<typeof upsertTemplateSettings$1> & typeof upsertTemplateSettings$1>;
|
|
2707
|
+
declare const resolveTemplateSettings: MaybeContext<BuildRESTFunction<typeof resolveTemplateSettings$1> & typeof resolveTemplateSettings$1>;
|
|
2708
|
+
declare const queryTemplateSettings: MaybeContext<BuildRESTFunction<typeof customQueryTemplateSettings> & typeof customQueryTemplateSettings>;
|
|
2684
2709
|
/** */
|
|
2685
|
-
declare const onTemplateSettingsCreated: BuildEventDefinition
|
|
2710
|
+
declare const onTemplateSettingsCreated: BuildEventDefinition<typeof onTemplateSettingsCreated$1> & typeof onTemplateSettingsCreated$1;
|
|
2686
2711
|
/** */
|
|
2687
|
-
declare const onTemplateSettingsUpdated: BuildEventDefinition
|
|
2712
|
+
declare const onTemplateSettingsUpdated: BuildEventDefinition<typeof onTemplateSettingsUpdated$1> & typeof onTemplateSettingsUpdated$1;
|
|
2688
2713
|
|
|
2689
2714
|
type index_d$1_AccountInfo = AccountInfo;
|
|
2690
2715
|
type index_d$1_AccountInfoMetadata = AccountInfoMetadata;
|
|
@@ -3499,90 +3524,6 @@ interface GetDownloadUrlOptions extends GetDownloadUrlRequestDocumentOneOf {
|
|
|
3499
3524
|
urlExpirationInSeconds?: number | null;
|
|
3500
3525
|
}
|
|
3501
3526
|
|
|
3502
|
-
type HTTPMethod = 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
|
|
3503
|
-
type RESTFunctionDescriptor<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient) => T;
|
|
3504
|
-
interface HttpClient {
|
|
3505
|
-
request<TResponse, TData = any>(req: RequestOptionsFactory<TResponse, TData>): Promise<HttpResponse<TResponse>>;
|
|
3506
|
-
fetchWithAuth: typeof fetch;
|
|
3507
|
-
wixAPIFetch: (relativeUrl: string, options: RequestInit) => Promise<Response>;
|
|
3508
|
-
getActiveToken?: () => string | undefined;
|
|
3509
|
-
}
|
|
3510
|
-
type RequestOptionsFactory<TResponse = any, TData = any> = (context: any) => RequestOptions<TResponse, TData>;
|
|
3511
|
-
type HttpResponse<T = any> = {
|
|
3512
|
-
data: T;
|
|
3513
|
-
status: number;
|
|
3514
|
-
statusText: string;
|
|
3515
|
-
headers: any;
|
|
3516
|
-
request?: any;
|
|
3517
|
-
};
|
|
3518
|
-
type ResponseTransformer$1 = (data: any) => any;
|
|
3519
|
-
type RequestOptions<_TResponse = any, Data = any> = {
|
|
3520
|
-
method: HTTPMethod;
|
|
3521
|
-
url: string;
|
|
3522
|
-
data?: Data;
|
|
3523
|
-
params?: URLSearchParams;
|
|
3524
|
-
fallback?: RequestOptions<any, any>[];
|
|
3525
|
-
/**
|
|
3526
|
-
* The array option is for interoperability, defacto only the first function is used
|
|
3527
|
-
* if an array is provided
|
|
3528
|
-
*/
|
|
3529
|
-
transformResponse?: ResponseTransformer$1 | ResponseTransformer$1[];
|
|
3530
|
-
} & APIMetadata;
|
|
3531
|
-
type APIMetadata = {
|
|
3532
|
-
methodFqn?: string;
|
|
3533
|
-
entityFqdn?: string;
|
|
3534
|
-
packageName?: string;
|
|
3535
|
-
migrationOptions?: MigrationOptions;
|
|
3536
|
-
};
|
|
3537
|
-
type MigrationOptions = {
|
|
3538
|
-
optInTransformResponse?: boolean;
|
|
3539
|
-
};
|
|
3540
|
-
type BuildRESTFunction<T extends RESTFunctionDescriptor> = T extends RESTFunctionDescriptor<infer U> ? U : never;
|
|
3541
|
-
type EventDefinition<Payload = unknown, Type extends string = string> = {
|
|
3542
|
-
__type: 'event-definition';
|
|
3543
|
-
type: Type;
|
|
3544
|
-
isDomainEvent?: boolean;
|
|
3545
|
-
transformations?: (envelope: unknown) => Payload;
|
|
3546
|
-
__payload: Payload;
|
|
3547
|
-
};
|
|
3548
|
-
declare function EventDefinition<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition<Payload, Type>;
|
|
3549
|
-
type EventHandler<T extends EventDefinition> = (payload: T['__payload']) => void | Promise<void>;
|
|
3550
|
-
type BuildEventDefinition<T extends EventDefinition<any, string>> = (handler: EventHandler<T>) => void;
|
|
3551
|
-
|
|
3552
|
-
declare global {
|
|
3553
|
-
interface ContextualClient {
|
|
3554
|
-
}
|
|
3555
|
-
}
|
|
3556
|
-
declare global {
|
|
3557
|
-
/**
|
|
3558
|
-
* A global interface to set the exposure toggle for the SDK.
|
|
3559
|
-
* @example
|
|
3560
|
-
* ```ts
|
|
3561
|
-
* declare global {
|
|
3562
|
-
* interface SDKExposureToggle {
|
|
3563
|
-
* alpha: true;
|
|
3564
|
-
* }
|
|
3565
|
-
* }
|
|
3566
|
-
*/
|
|
3567
|
-
interface SDKExposureToggle {
|
|
3568
|
-
}
|
|
3569
|
-
}
|
|
3570
|
-
|
|
3571
|
-
declare global {
|
|
3572
|
-
/**
|
|
3573
|
-
* A global interface to set the type mode for the SDK.
|
|
3574
|
-
* @example
|
|
3575
|
-
* ```ts
|
|
3576
|
-
* declare global {
|
|
3577
|
-
* interface SDKTypeMode {
|
|
3578
|
-
* strict: true;
|
|
3579
|
-
* }
|
|
3580
|
-
* }
|
|
3581
|
-
*/
|
|
3582
|
-
interface SDKTypeMode {
|
|
3583
|
-
}
|
|
3584
|
-
}
|
|
3585
|
-
|
|
3586
3527
|
declare function createRESTModule<T extends RESTFunctionDescriptor>(descriptor: T, elevated?: boolean): BuildRESTFunction<T> & T;
|
|
3587
3528
|
|
|
3588
3529
|
declare function createEventModule<T extends EventDefinition<any, string>>(eventDefinition: T): BuildEventDefinition<T> & T;
|
|
@@ -1512,7 +1512,7 @@ interface DomainEvent extends DomainEventBodyOneOf {
|
|
|
1512
1512
|
/** If present, indicates the action that triggered the event. */
|
|
1513
1513
|
originatedFrom?: string | null;
|
|
1514
1514
|
/**
|
|
1515
|
-
* A sequence number that indicates the order of updates to an entity. For example, if an entity was updated at 16:00 and then again at 16:01
|
|
1515
|
+
* A sequence number that indicates the order of updates to an entity. For example, if an entity was updated at `16:00` and then again at `16:01`, the second update will always have a higher sequence number.
|
|
1516
1516
|
* You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it.
|
|
1517
1517
|
*/
|
|
1518
1518
|
entityEventSequence?: string | null;
|