@wix/echo 1.0.45 → 1.0.47

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.
Files changed (45) hide show
  1. package/anotherComponents/package.json +3 -0
  2. package/build/cjs/index.d.ts +5 -3
  3. package/build/cjs/index.js +41 -28
  4. package/build/cjs/index.js.map +1 -1
  5. package/build/cjs/meta.d.ts +2 -2
  6. package/build/cjs/meta.js +38 -26
  7. package/build/cjs/meta.js.map +1 -1
  8. package/build/es/index.d.mts +5 -0
  9. package/build/es/index.mjs +8 -0
  10. package/build/es/index.mjs.map +1 -0
  11. package/build/es/meta.d.mts +2 -0
  12. package/build/es/meta.mjs +6 -0
  13. package/build/es/meta.mjs.map +1 -0
  14. package/build/es/package.json +3 -0
  15. package/build/internal/cjs/index.d.ts +5 -0
  16. package/build/internal/cjs/index.js +44 -0
  17. package/build/internal/cjs/index.js.map +1 -0
  18. package/build/internal/cjs/meta.d.ts +2 -0
  19. package/build/internal/cjs/meta.js +41 -0
  20. package/build/internal/cjs/meta.js.map +1 -0
  21. package/build/internal/es/index.d.mts +5 -0
  22. package/build/internal/es/index.mjs +8 -0
  23. package/build/internal/es/index.mjs.map +1 -0
  24. package/build/internal/es/meta.d.mts +2 -0
  25. package/build/internal/es/meta.mjs +6 -0
  26. package/build/internal/es/meta.mjs.map +1 -0
  27. package/components/package.json +3 -0
  28. package/meta/package.json +1 -5
  29. package/package.json +38 -18
  30. package/build/cjs/context.d.ts +0 -2
  31. package/build/cjs/context.js +0 -29
  32. package/build/cjs/context.js.map +0 -1
  33. package/build/es/context.d.ts +0 -2
  34. package/build/es/context.js +0 -3
  35. package/build/es/context.js.map +0 -1
  36. package/build/es/index.d.ts +0 -3
  37. package/build/es/index.js +0 -4
  38. package/build/es/index.js.map +0 -1
  39. package/build/es/meta.d.ts +0 -2
  40. package/build/es/meta.js +0 -3
  41. package/build/es/meta.js.map +0 -1
  42. package/context/package.json +0 -7
  43. package/type-bundles/context.bundle.d.ts +0 -803
  44. package/type-bundles/index.bundle.d.ts +0 -803
  45. package/type-bundles/meta.bundle.d.ts +0 -184
@@ -1,803 +0,0 @@
1
- type HostModule<T, H extends Host> = {
2
- __type: 'host';
3
- create(host: H): T;
4
- };
5
- type HostModuleAPI<T extends HostModule<any, any>> = T extends HostModule<infer U, any> ? U : never;
6
- type Host<Environment = unknown> = {
7
- channel: {
8
- observeState(callback: (props: unknown, environment: Environment) => unknown): {
9
- disconnect: () => void;
10
- } | Promise<{
11
- disconnect: () => void;
12
- }>;
13
- };
14
- environment?: Environment;
15
- /**
16
- * Optional name of the environment, use for logging
17
- */
18
- name?: string;
19
- /**
20
- * Optional bast url to use for API requests, for example `www.wixapis.com`
21
- */
22
- apiBaseUrl?: string;
23
- /**
24
- * Possible data to be provided by every host, for cross cutting concerns
25
- * like internationalization, billing, etc.
26
- */
27
- essentials?: {
28
- /**
29
- * The language of the currently viewed session
30
- */
31
- language?: string;
32
- /**
33
- * The locale of the currently viewed session
34
- */
35
- locale?: string;
36
- /**
37
- * Any headers that should be passed through to the API requests
38
- */
39
- passThroughHeaders?: Record<string, string>;
40
- };
41
- };
42
-
43
- type RESTFunctionDescriptor<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient) => T;
44
- interface HttpClient {
45
- request<TResponse, TData = any>(req: RequestOptionsFactory<TResponse, TData>): Promise<HttpResponse<TResponse>>;
46
- fetchWithAuth: typeof fetch;
47
- wixAPIFetch: (relativeUrl: string, options: RequestInit) => Promise<Response>;
48
- getActiveToken?: () => string | undefined;
49
- }
50
- type RequestOptionsFactory<TResponse = any, TData = any> = (context: any) => RequestOptions<TResponse, TData>;
51
- type HttpResponse<T = any> = {
52
- data: T;
53
- status: number;
54
- statusText: string;
55
- headers: any;
56
- request?: any;
57
- };
58
- type RequestOptions<_TResponse = any, Data = any> = {
59
- method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
60
- url: string;
61
- data?: Data;
62
- params?: URLSearchParams;
63
- } & APIMetadata;
64
- type APIMetadata = {
65
- methodFqn?: string;
66
- entityFqdn?: string;
67
- packageName?: string;
68
- };
69
- type BuildRESTFunction<T extends RESTFunctionDescriptor> = T extends RESTFunctionDescriptor<infer U> ? U : never;
70
- type EventDefinition<Payload = unknown, Type extends string = string> = {
71
- __type: 'event-definition';
72
- type: Type;
73
- isDomainEvent?: boolean;
74
- transformations?: (envelope: unknown) => Payload;
75
- __payload: Payload;
76
- };
77
- declare function EventDefinition<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition<Payload, Type>;
78
- type EventHandler<T extends EventDefinition> = (payload: T['__payload']) => void | Promise<void>;
79
- type BuildEventDefinition<T extends EventDefinition<any, string>> = (handler: EventHandler<T>) => void;
80
-
81
- type ServicePluginMethodInput = {
82
- request: any;
83
- metadata: any;
84
- };
85
- type ServicePluginContract = Record<string, (payload: ServicePluginMethodInput) => unknown | Promise<unknown>>;
86
- type ServicePluginMethodMetadata = {
87
- name: string;
88
- primaryHttpMappingPath: string;
89
- transformations: {
90
- fromREST: (...args: unknown[]) => ServicePluginMethodInput;
91
- toREST: (...args: unknown[]) => unknown;
92
- };
93
- };
94
- type ServicePluginDefinition<Contract extends ServicePluginContract> = {
95
- __type: 'service-plugin-definition';
96
- componentType: string;
97
- methods: ServicePluginMethodMetadata[];
98
- __contract: Contract;
99
- };
100
- declare function ServicePluginDefinition<Contract extends ServicePluginContract>(componentType: string, methods: ServicePluginMethodMetadata[]): ServicePluginDefinition<Contract>;
101
- type BuildServicePluginDefinition<T extends ServicePluginDefinition<any>> = (implementation: T['__contract']) => void;
102
- declare const SERVICE_PLUGIN_ERROR_TYPE = "wix_spi_error";
103
-
104
- type RequestContext = {
105
- isSSR: boolean;
106
- host: string;
107
- protocol?: string;
108
- };
109
- type ResponseTransformer = (data: any, headers?: any) => any;
110
- /**
111
- * Ambassador request options types are copied mostly from AxiosRequestConfig.
112
- * They are copied and not imported to reduce the amount of dependencies (to reduce install time).
113
- * https://github.com/axios/axios/blob/3f53eb6960f05a1f88409c4b731a40de595cb825/index.d.ts#L307-L315
114
- */
115
- type Method = 'get' | 'GET' | 'delete' | 'DELETE' | 'head' | 'HEAD' | 'options' | 'OPTIONS' | 'post' | 'POST' | 'put' | 'PUT' | 'patch' | 'PATCH' | 'purge' | 'PURGE' | 'link' | 'LINK' | 'unlink' | 'UNLINK';
116
- type AmbassadorRequestOptions<T = any> = {
117
- _?: T;
118
- url?: string;
119
- method?: Method;
120
- params?: any;
121
- data?: any;
122
- transformResponse?: ResponseTransformer | ResponseTransformer[];
123
- };
124
- type AmbassadorFactory<Request, Response> = (payload: Request) => ((context: RequestContext) => AmbassadorRequestOptions<Response>) & {
125
- __isAmbassador: boolean;
126
- };
127
- type AmbassadorFunctionDescriptor<Request = any, Response = any> = AmbassadorFactory<Request, Response>;
128
- type BuildAmbassadorFunction<T extends AmbassadorFunctionDescriptor> = T extends AmbassadorFunctionDescriptor<infer Request, infer Response> ? (req: Request) => Promise<Response> : never;
129
-
130
- declare global {
131
- // eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
132
- interface SymbolConstructor {
133
- readonly observable: symbol;
134
- }
135
- }
136
-
137
- declare const emptyObjectSymbol: unique symbol;
138
-
139
- /**
140
- Represents a strictly empty plain object, the `{}` value.
141
-
142
- When you annotate something as the type `{}`, it can be anything except `null` and `undefined`. This means that you cannot use `{}` to represent an empty plain object ([read more](https://stackoverflow.com/questions/47339869/typescript-empty-object-and-any-difference/52193484#52193484)).
143
-
144
- @example
145
- ```
146
- import type {EmptyObject} from 'type-fest';
147
-
148
- // The following illustrates the problem with `{}`.
149
- const foo1: {} = {}; // Pass
150
- const foo2: {} = []; // Pass
151
- const foo3: {} = 42; // Pass
152
- const foo4: {} = {a: 1}; // Pass
153
-
154
- // With `EmptyObject` only the first case is valid.
155
- const bar1: EmptyObject = {}; // Pass
156
- const bar2: EmptyObject = 42; // Fail
157
- const bar3: EmptyObject = []; // Fail
158
- const bar4: EmptyObject = {a: 1}; // Fail
159
- ```
160
-
161
- Unfortunately, `Record<string, never>`, `Record<keyof any, never>` and `Record<never, never>` do not work. See {@link https://github.com/sindresorhus/type-fest/issues/395 #395}.
162
-
163
- @category Object
164
- */
165
- type EmptyObject = {[emptyObjectSymbol]?: never};
166
-
167
- /**
168
- Returns a boolean for whether the two given types are equal.
169
-
170
- @link https://github.com/microsoft/TypeScript/issues/27024#issuecomment-421529650
171
- @link https://stackoverflow.com/questions/68961864/how-does-the-equals-work-in-typescript/68963796#68963796
172
-
173
- Use-cases:
174
- - If you want to make a conditional branch based on the result of a comparison of two types.
175
-
176
- @example
177
- ```
178
- import type {IsEqual} from 'type-fest';
179
-
180
- // This type returns a boolean for whether the given array includes the given item.
181
- // `IsEqual` is used to compare the given array at position 0 and the given item and then return true if they are equal.
182
- type Includes<Value extends readonly any[], Item> =
183
- Value extends readonly [Value[0], ...infer rest]
184
- ? IsEqual<Value[0], Item> extends true
185
- ? true
186
- : Includes<rest, Item>
187
- : false;
188
- ```
189
-
190
- @category Type Guard
191
- @category Utilities
192
- */
193
- type IsEqual<A, B> =
194
- (<G>() => G extends A ? 1 : 2) extends
195
- (<G>() => G extends B ? 1 : 2)
196
- ? true
197
- : false;
198
-
199
- /**
200
- Filter out keys from an object.
201
-
202
- Returns `never` if `Exclude` is strictly equal to `Key`.
203
- Returns `never` if `Key` extends `Exclude`.
204
- Returns `Key` otherwise.
205
-
206
- @example
207
- ```
208
- type Filtered = Filter<'foo', 'foo'>;
209
- //=> never
210
- ```
211
-
212
- @example
213
- ```
214
- type Filtered = Filter<'bar', string>;
215
- //=> never
216
- ```
217
-
218
- @example
219
- ```
220
- type Filtered = Filter<'bar', 'foo'>;
221
- //=> 'bar'
222
- ```
223
-
224
- @see {Except}
225
- */
226
- type Filter<KeyType, ExcludeType> = IsEqual<KeyType, ExcludeType> extends true ? never : (KeyType extends ExcludeType ? never : KeyType);
227
-
228
- type ExceptOptions = {
229
- /**
230
- Disallow assigning non-specified properties.
231
-
232
- Note that any omitted properties in the resulting type will be present in autocomplete as `undefined`.
233
-
234
- @default false
235
- */
236
- requireExactProps?: boolean;
237
- };
238
-
239
- /**
240
- Create a type from an object type without certain keys.
241
-
242
- We recommend setting the `requireExactProps` option to `true`.
243
-
244
- This type is a stricter version of [`Omit`](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-5.html#the-omit-helper-type). The `Omit` type does not restrict the omitted keys to be keys present on the given type, while `Except` does. The benefits of a stricter type are avoiding typos and allowing the compiler to pick up on rename refactors automatically.
245
-
246
- This type was proposed to the TypeScript team, which declined it, saying they prefer that libraries implement stricter versions of the built-in types ([microsoft/TypeScript#30825](https://github.com/microsoft/TypeScript/issues/30825#issuecomment-523668235)).
247
-
248
- @example
249
- ```
250
- import type {Except} from 'type-fest';
251
-
252
- type Foo = {
253
- a: number;
254
- b: string;
255
- };
256
-
257
- type FooWithoutA = Except<Foo, 'a'>;
258
- //=> {b: string}
259
-
260
- const fooWithoutA: FooWithoutA = {a: 1, b: '2'};
261
- //=> errors: 'a' does not exist in type '{ b: string; }'
262
-
263
- type FooWithoutB = Except<Foo, 'b', {requireExactProps: true}>;
264
- //=> {a: number} & Partial<Record<"b", never>>
265
-
266
- const fooWithoutB: FooWithoutB = {a: 1, b: '2'};
267
- //=> errors at 'b': Type 'string' is not assignable to type 'undefined'.
268
- ```
269
-
270
- @category Object
271
- */
272
- type Except<ObjectType, KeysType extends keyof ObjectType, Options extends ExceptOptions = {requireExactProps: false}> = {
273
- [KeyType in keyof ObjectType as Filter<KeyType, KeysType>]: ObjectType[KeyType];
274
- } & (Options['requireExactProps'] extends true
275
- ? Partial<Record<KeysType, never>>
276
- : {});
277
-
278
- /**
279
- Returns a boolean for whether the given type is `never`.
280
-
281
- @link https://github.com/microsoft/TypeScript/issues/31751#issuecomment-498526919
282
- @link https://stackoverflow.com/a/53984913/10292952
283
- @link https://www.zhenghao.io/posts/ts-never
284
-
285
- Useful in type utilities, such as checking if something does not occur.
286
-
287
- @example
288
- ```
289
- import type {IsNever, And} from 'type-fest';
290
-
291
- // https://github.com/andnp/SimplyTyped/blob/master/src/types/strings.ts
292
- type AreStringsEqual<A extends string, B extends string> =
293
- And<
294
- IsNever<Exclude<A, B>> extends true ? true : false,
295
- IsNever<Exclude<B, A>> extends true ? true : false
296
- >;
297
-
298
- type EndIfEqual<I extends string, O extends string> =
299
- AreStringsEqual<I, O> extends true
300
- ? never
301
- : void;
302
-
303
- function endIfEqual<I extends string, O extends string>(input: I, output: O): EndIfEqual<I, O> {
304
- if (input === output) {
305
- process.exit(0);
306
- }
307
- }
308
-
309
- endIfEqual('abc', 'abc');
310
- //=> never
311
-
312
- endIfEqual('abc', '123');
313
- //=> void
314
- ```
315
-
316
- @category Type Guard
317
- @category Utilities
318
- */
319
- type IsNever<T> = [T] extends [never] ? true : false;
320
-
321
- /**
322
- An if-else-like type that resolves depending on whether the given type is `never`.
323
-
324
- @see {@link IsNever}
325
-
326
- @example
327
- ```
328
- import type {IfNever} from 'type-fest';
329
-
330
- type ShouldBeTrue = IfNever<never>;
331
- //=> true
332
-
333
- type ShouldBeBar = IfNever<'not never', 'foo', 'bar'>;
334
- //=> 'bar'
335
- ```
336
-
337
- @category Type Guard
338
- @category Utilities
339
- */
340
- type IfNever<T, TypeIfNever = true, TypeIfNotNever = false> = (
341
- IsNever<T> extends true ? TypeIfNever : TypeIfNotNever
342
- );
343
-
344
- /**
345
- Extract the keys from a type where the value type of the key extends the given `Condition`.
346
-
347
- Internally this is used for the `ConditionalPick` and `ConditionalExcept` types.
348
-
349
- @example
350
- ```
351
- import type {ConditionalKeys} from 'type-fest';
352
-
353
- interface Example {
354
- a: string;
355
- b: string | number;
356
- c?: string;
357
- d: {};
358
- }
359
-
360
- type StringKeysOnly = ConditionalKeys<Example, string>;
361
- //=> 'a'
362
- ```
363
-
364
- To support partial types, make sure your `Condition` is a union of undefined (for example, `string | undefined`) as demonstrated below.
365
-
366
- @example
367
- ```
368
- import type {ConditionalKeys} from 'type-fest';
369
-
370
- type StringKeysAndUndefined = ConditionalKeys<Example, string | undefined>;
371
- //=> 'a' | 'c'
372
- ```
373
-
374
- @category Object
375
- */
376
- type ConditionalKeys<Base, Condition> =
377
- {
378
- // Map through all the keys of the given base type.
379
- [Key in keyof Base]-?:
380
- // Pick only keys with types extending the given `Condition` type.
381
- Base[Key] extends Condition
382
- // Retain this key
383
- // If the value for the key extends never, only include it if `Condition` also extends never
384
- ? IfNever<Base[Key], IfNever<Condition, Key, never>, Key>
385
- // Discard this key since the condition fails.
386
- : never;
387
- // Convert the produced object into a union type of the keys which passed the conditional test.
388
- }[keyof Base];
389
-
390
- /**
391
- Exclude keys from a shape that matches the given `Condition`.
392
-
393
- This is useful when you want to create a new type with a specific set of keys from a shape. For example, you might want to exclude all the primitive properties from a class and form a new shape containing everything but the primitive properties.
394
-
395
- @example
396
- ```
397
- import type {Primitive, ConditionalExcept} from 'type-fest';
398
-
399
- class Awesome {
400
- name: string;
401
- successes: number;
402
- failures: bigint;
403
-
404
- run() {}
405
- }
406
-
407
- type ExceptPrimitivesFromAwesome = ConditionalExcept<Awesome, Primitive>;
408
- //=> {run: () => void}
409
- ```
410
-
411
- @example
412
- ```
413
- import type {ConditionalExcept} from 'type-fest';
414
-
415
- interface Example {
416
- a: string;
417
- b: string | number;
418
- c: () => void;
419
- d: {};
420
- }
421
-
422
- type NonStringKeysOnly = ConditionalExcept<Example, string>;
423
- //=> {b: string | number; c: () => void; d: {}}
424
- ```
425
-
426
- @category Object
427
- */
428
- type ConditionalExcept<Base, Condition> = Except<
429
- Base,
430
- ConditionalKeys<Base, Condition>
431
- >;
432
-
433
- /**
434
- * Descriptors are objects that describe the API of a module, and the module
435
- * can either be a REST module or a host module.
436
- * This type is recursive, so it can describe nested modules.
437
- */
438
- type Descriptors = RESTFunctionDescriptor | AmbassadorFunctionDescriptor | HostModule<any, any> | EventDefinition<any> | ServicePluginDefinition<any> | {
439
- [key: string]: Descriptors | PublicMetadata | any;
440
- };
441
- /**
442
- * This type takes in a descriptors object of a certain Host (including an `unknown` host)
443
- * and returns an object with the same structure, but with all descriptors replaced with their API.
444
- * Any non-descriptor properties are removed from the returned object, including descriptors that
445
- * do not match the given host (as they will not work with the given host).
446
- */
447
- type BuildDescriptors<T extends Descriptors, H extends Host<any> | undefined, Depth extends number = 5> = {
448
- done: T;
449
- recurse: T extends {
450
- __type: typeof SERVICE_PLUGIN_ERROR_TYPE;
451
- } ? 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<{
452
- [Key in keyof T]: T[Key] extends Descriptors ? BuildDescriptors<T[Key], H, [
453
- -1,
454
- 0,
455
- 1,
456
- 2,
457
- 3,
458
- 4,
459
- 5
460
- ][Depth]> : never;
461
- }, EmptyObject>;
462
- }[Depth extends -1 ? 'done' : 'recurse'];
463
- type PublicMetadata = {
464
- PACKAGE_NAME?: string;
465
- };
466
-
467
- declare global {
468
- interface ContextualClient {
469
- }
470
- }
471
- /**
472
- * A type used to create concerete types from SDK descriptors in
473
- * case a contextual client is available.
474
- */
475
- type MaybeContext<T extends Descriptors> = globalThis.ContextualClient extends {
476
- host: Host;
477
- } ? BuildDescriptors<T, globalThis.ContextualClient['host']> : T;
478
-
479
- interface CalculateMessage {
480
- /** result of the calculation */
481
- number?: number;
482
- /** message comment from the operation */
483
- message?: string;
484
- /** fake entity id */
485
- _id?: string;
486
- }
487
- interface CalculateRequest {
488
- /** 1st number to calculate */
489
- arg1: number;
490
- /** 2nd number to calculate */
491
- arg2: number;
492
- /** operation to perform */
493
- operation: CalculateOperation;
494
- }
495
- declare enum CalculateOperation {
496
- UNDEFINED = "UNDEFINED",
497
- ADD = "ADD",
498
- SUBTRACT = "SUBTRACT"
499
- }
500
- interface CalculateResponse {
501
- result?: CalculateMessage;
502
- }
503
- interface CalculateMessageNonNullableFields {
504
- number: number;
505
- message: string;
506
- _id: string;
507
- }
508
- interface CalculateResponseNonNullableFields {
509
- result?: CalculateMessageNonNullableFields;
510
- }
511
- interface CalculateIdentifiers {
512
- /** 1st number to calculate */
513
- arg1: number;
514
- /** 2nd number to calculate */
515
- arg2: number;
516
- /** operation to perform */
517
- operation: CalculateOperation;
518
- }
519
-
520
- declare function calculate$1(httpClient: HttpClient): CalculateSignature;
521
- interface CalculateSignature {
522
- /** */
523
- (identifiers: CalculateIdentifiers): Promise<CalculateResponse & CalculateResponseNonNullableFields>;
524
- }
525
-
526
- declare const calculate: MaybeContext<BuildRESTFunction<typeof calculate$1> & typeof calculate$1>;
527
-
528
- type context$1_CalculateIdentifiers = CalculateIdentifiers;
529
- type context$1_CalculateMessage = CalculateMessage;
530
- type context$1_CalculateOperation = CalculateOperation;
531
- declare const context$1_CalculateOperation: typeof CalculateOperation;
532
- type context$1_CalculateRequest = CalculateRequest;
533
- type context$1_CalculateResponse = CalculateResponse;
534
- type context$1_CalculateResponseNonNullableFields = CalculateResponseNonNullableFields;
535
- declare const context$1_calculate: typeof calculate;
536
- declare namespace context$1 {
537
- export { type context$1_CalculateIdentifiers as CalculateIdentifiers, type context$1_CalculateMessage as CalculateMessage, context$1_CalculateOperation as CalculateOperation, type context$1_CalculateRequest as CalculateRequest, type context$1_CalculateResponse as CalculateResponse, type context$1_CalculateResponseNonNullableFields as CalculateResponseNonNullableFields, context$1_calculate as calculate };
538
- }
539
-
540
- interface MessageItem {
541
- /** inner_message comment from EchoMessage proto def */
542
- innerMessage?: string;
543
- }
544
- interface EchoRequest {
545
- /** 1st part of the message */
546
- arg1: string;
547
- /** 2nd part of the message */
548
- arg2?: string;
549
- /** this field test translatable annotation */
550
- titleField?: string;
551
- someInt32?: number;
552
- someDate?: Date | null;
553
- }
554
- interface EchoResponse {
555
- /**
556
- * override EchoResponse.echoMessage
557
- *
558
- */
559
- echoMessage?: EchoMessage;
560
- /** messge reseult as string */
561
- message?: string;
562
- }
563
- interface Dispatched {
564
- /** the message someone says */
565
- echo?: EchoMessage;
566
- }
567
- interface DomainEvent extends DomainEventBodyOneOf {
568
- createdEvent?: EntityCreatedEvent;
569
- updatedEvent?: EntityUpdatedEvent;
570
- deletedEvent?: EntityDeletedEvent;
571
- actionEvent?: ActionEvent;
572
- /**
573
- * Unique event ID.
574
- * Allows clients to ignore duplicate webhooks.
575
- */
576
- _id?: string;
577
- /**
578
- * Assumes actions are also always typed to an entity_type
579
- * Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction
580
- */
581
- entityFqdn?: string;
582
- /**
583
- * This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug)
584
- * This is although the created/updated/deleted notion is duplication of the oneof types
585
- * Example: created/updated/deleted/started/completed/email_opened
586
- */
587
- slug?: string;
588
- /** ID of the entity associated with the event. */
589
- entityId?: string;
590
- /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example: 2020-04-26T13:57:50.699Z */
591
- eventTime?: Date | null;
592
- /**
593
- * Whether the event was triggered as a result of a privacy regulation application
594
- * (for example, GDPR).
595
- */
596
- triggeredByAnonymizeRequest?: boolean | null;
597
- /** If present, indicates the action that triggered the event. */
598
- originatedFrom?: string | null;
599
- /**
600
- * A sequence number defining the order of updates to the underlying entity.
601
- * For example, given that some entity was updated at 16:00 and than again at 16:01,
602
- * it is guaranteed that the sequence number of the second update is strictly higher than the first.
603
- * As the consumer, you can use this value to ensure that you handle messages in the correct order.
604
- * To do so, you will need to persist this number on your end, and compare the sequence number from the
605
- * message against the one you have stored. Given that the stored number is higher, you should ignore the message.
606
- */
607
- entityEventSequence?: string | null;
608
- }
609
- /** @oneof */
610
- interface DomainEventBodyOneOf {
611
- createdEvent?: EntityCreatedEvent;
612
- updatedEvent?: EntityUpdatedEvent;
613
- deletedEvent?: EntityDeletedEvent;
614
- actionEvent?: ActionEvent;
615
- }
616
- interface EntityCreatedEvent {
617
- entity?: string;
618
- }
619
- interface RestoreInfo {
620
- deletedDate?: Date | null;
621
- }
622
- interface EntityUpdatedEvent {
623
- /**
624
- * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.
625
- * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.
626
- * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.
627
- */
628
- currentEntity?: string;
629
- }
630
- interface EntityDeletedEvent {
631
- /** Entity that was deleted */
632
- deletedEntity?: string | null;
633
- }
634
- interface ActionEvent {
635
- body?: string;
636
- }
637
- interface MessageEnvelope {
638
- /** App instance ID. */
639
- instanceId?: string | null;
640
- /** Event type. */
641
- eventType?: string;
642
- /** The identification type and identity data. */
643
- identity?: IdentificationData;
644
- /** Stringify payload. */
645
- data?: string;
646
- }
647
- interface IdentificationData extends IdentificationDataIdOneOf {
648
- /** ID of a site visitor that has not logged in to the site. */
649
- anonymousVisitorId?: string;
650
- /** ID of a site visitor that has logged in to the site. */
651
- memberId?: string;
652
- /** ID of a Wix user (site owner, contributor, etc.). */
653
- wixUserId?: string;
654
- /** ID of an app. */
655
- appId?: string;
656
- /** @readonly */
657
- identityType?: WebhookIdentityType;
658
- }
659
- /** @oneof */
660
- interface IdentificationDataIdOneOf {
661
- /** ID of a site visitor that has not logged in to the site. */
662
- anonymousVisitorId?: string;
663
- /** ID of a site visitor that has logged in to the site. */
664
- memberId?: string;
665
- /** ID of a Wix user (site owner, contributor, etc.). */
666
- wixUserId?: string;
667
- /** ID of an app. */
668
- appId?: string;
669
- }
670
- declare enum WebhookIdentityType {
671
- UNKNOWN = "UNKNOWN",
672
- ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR",
673
- MEMBER = "MEMBER",
674
- WIX_USER = "WIX_USER",
675
- APP = "APP"
676
- }
677
- interface MessageItemNonNullableFields {
678
- innerMessage: string;
679
- }
680
- interface EchoMessageNonNullableFields {
681
- message: string;
682
- messagesList: MessageItemNonNullableFields[];
683
- _id: string;
684
- }
685
- interface EchoResponseNonNullableFields {
686
- echoMessage?: EchoMessageNonNullableFields;
687
- message: string;
688
- }
689
- interface EchoMessage {
690
- veloMessage: string;
691
- id: string;
692
- }
693
- interface BaseEventMetadata {
694
- /** App instance ID. */
695
- instanceId?: string | null;
696
- /** Event type. */
697
- eventType?: string;
698
- /** The identification type and identity data. */
699
- identity?: IdentificationData;
700
- }
701
- interface EventMetadata extends BaseEventMetadata {
702
- /**
703
- * Unique event ID.
704
- * Allows clients to ignore duplicate webhooks.
705
- */
706
- _id?: string;
707
- /**
708
- * Assumes actions are also always typed to an entity_type
709
- * Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction
710
- */
711
- entityFqdn?: string;
712
- /**
713
- * This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug)
714
- * This is although the created/updated/deleted notion is duplication of the oneof types
715
- * Example: created/updated/deleted/started/completed/email_opened
716
- */
717
- slug?: string;
718
- /** ID of the entity associated with the event. */
719
- entityId?: string;
720
- /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example: 2020-04-26T13:57:50.699Z */
721
- eventTime?: Date | null;
722
- /**
723
- * Whether the event was triggered as a result of a privacy regulation application
724
- * (for example, GDPR).
725
- */
726
- triggeredByAnonymizeRequest?: boolean | null;
727
- /** If present, indicates the action that triggered the event. */
728
- originatedFrom?: string | null;
729
- /**
730
- * A sequence number defining the order of updates to the underlying entity.
731
- * For example, given that some entity was updated at 16:00 and than again at 16:01,
732
- * it is guaranteed that the sequence number of the second update is strictly higher than the first.
733
- * As the consumer, you can use this value to ensure that you handle messages in the correct order.
734
- * To do so, you will need to persist this number on your end, and compare the sequence number from the
735
- * message against the one you have stored. Given that the stored number is higher, you should ignore the message.
736
- */
737
- entityEventSequence?: string | null;
738
- }
739
- interface EchoDispatchedEnvelope {
740
- data: Dispatched;
741
- metadata: EventMetadata;
742
- }
743
- interface EchoOptions {
744
- /** 2nd part of the message */
745
- arg2?: string;
746
- /** this field test translatable annotation */
747
- titleField?: string;
748
- someInt32?: number;
749
- someDate?: Date | null;
750
- }
751
-
752
- declare function echo$1(httpClient: HttpClient): EchoSignature;
753
- interface EchoSignature {
754
- /**
755
- * Another override description function 4
756
- * @param - 1st part of the message
757
- * @param - modified comment for arg2 el hovav
758
- * @returns ## override return 4
759
- */
760
- (arg1: string, options?: EchoOptions | undefined): Promise<string>;
761
- }
762
- declare const onEchoDispatched$1: EventDefinition<EchoDispatchedEnvelope, "wix.metroinspector.v1.echo_dispatched">;
763
-
764
- declare function createEventModule<T extends EventDefinition<any, string>>(eventDefinition: T): BuildEventDefinition<T> & T;
765
-
766
- declare const echo: MaybeContext<BuildRESTFunction<typeof echo$1> & typeof echo$1>;
767
-
768
- type _publicOnEchoDispatchedType = typeof onEchoDispatched$1;
769
- /**
770
- * echo event that might be consumed when somone says something!
771
- */
772
- declare const onEchoDispatched: ReturnType<typeof createEventModule<_publicOnEchoDispatchedType>>;
773
-
774
- type context_ActionEvent = ActionEvent;
775
- type context_BaseEventMetadata = BaseEventMetadata;
776
- type context_Dispatched = Dispatched;
777
- type context_DomainEvent = DomainEvent;
778
- type context_DomainEventBodyOneOf = DomainEventBodyOneOf;
779
- type context_EchoDispatchedEnvelope = EchoDispatchedEnvelope;
780
- type context_EchoMessage = EchoMessage;
781
- type context_EchoOptions = EchoOptions;
782
- type context_EchoRequest = EchoRequest;
783
- type context_EchoResponse = EchoResponse;
784
- type context_EchoResponseNonNullableFields = EchoResponseNonNullableFields;
785
- type context_EntityCreatedEvent = EntityCreatedEvent;
786
- type context_EntityDeletedEvent = EntityDeletedEvent;
787
- type context_EntityUpdatedEvent = EntityUpdatedEvent;
788
- type context_EventMetadata = EventMetadata;
789
- type context_IdentificationData = IdentificationData;
790
- type context_IdentificationDataIdOneOf = IdentificationDataIdOneOf;
791
- type context_MessageEnvelope = MessageEnvelope;
792
- type context_MessageItem = MessageItem;
793
- type context_RestoreInfo = RestoreInfo;
794
- type context_WebhookIdentityType = WebhookIdentityType;
795
- declare const context_WebhookIdentityType: typeof WebhookIdentityType;
796
- type context__publicOnEchoDispatchedType = _publicOnEchoDispatchedType;
797
- declare const context_echo: typeof echo;
798
- declare const context_onEchoDispatched: typeof onEchoDispatched;
799
- declare namespace context {
800
- export { type context_ActionEvent as ActionEvent, type context_BaseEventMetadata as BaseEventMetadata, type context_Dispatched as Dispatched, type context_DomainEvent as DomainEvent, type context_DomainEventBodyOneOf as DomainEventBodyOneOf, type context_EchoDispatchedEnvelope as EchoDispatchedEnvelope, type context_EchoMessage as EchoMessage, type context_EchoOptions as EchoOptions, type context_EchoRequest as EchoRequest, type context_EchoResponse as EchoResponse, type context_EchoResponseNonNullableFields as EchoResponseNonNullableFields, type context_EntityCreatedEvent as EntityCreatedEvent, type context_EntityDeletedEvent as EntityDeletedEvent, type context_EntityUpdatedEvent as EntityUpdatedEvent, type context_EventMetadata as EventMetadata, type context_IdentificationData as IdentificationData, type context_IdentificationDataIdOneOf as IdentificationDataIdOneOf, type context_MessageEnvelope as MessageEnvelope, type context_MessageItem as MessageItem, type context_RestoreInfo as RestoreInfo, context_WebhookIdentityType as WebhookIdentityType, type context__publicOnEchoDispatchedType as _publicOnEchoDispatchedType, context_echo as echo, context_onEchoDispatched as onEchoDispatched, onEchoDispatched$1 as publicOnEchoDispatched };
801
- }
802
-
803
- export { context$1 as calculator, context as metroinspector };