@wix/echo 1.0.35 → 1.0.37

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/echo",
3
- "version": "1.0.35",
3
+ "version": "1.0.37",
4
4
  "publishConfig": {
5
5
  "registry": "https://registry.npmjs.org/",
6
6
  "access": "public"
@@ -18,7 +18,7 @@
18
18
  "type-bundles"
19
19
  ],
20
20
  "dependencies": {
21
- "@wix/echo_metroinspector": "1.0.11"
21
+ "@wix/echo_metroinspector": "1.0.13"
22
22
  },
23
23
  "devDependencies": {
24
24
  "glob": "^10.4.1",
@@ -43,5 +43,5 @@
43
43
  "fqdn": ""
44
44
  }
45
45
  },
46
- "falconPackageHash": "60970f48a468cbbc437e080e8077d7f7a80adaa4c92130d988230aca"
46
+ "falconPackageHash": "18909fdc83155489db6adbcbc9e5e0e868f98a648e7be28f1e8811c9"
47
47
  }
@@ -36,33 +36,33 @@ type Host<Environment = unknown> = {
36
36
  };
37
37
  };
38
38
 
39
- type RESTFunctionDescriptor$1<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient$1) => T;
40
- interface HttpClient$1 {
41
- request<TResponse, TData = any>(req: RequestOptionsFactory$1<TResponse, TData>): Promise<HttpResponse$1<TResponse>>;
39
+ type RESTFunctionDescriptor<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient) => T;
40
+ interface HttpClient {
41
+ request<TResponse, TData = any>(req: RequestOptionsFactory<TResponse, TData>): Promise<HttpResponse<TResponse>>;
42
42
  fetchWithAuth: typeof fetch;
43
43
  wixAPIFetch: (relativeUrl: string, options: RequestInit) => Promise<Response>;
44
44
  getActiveToken?: () => string | undefined;
45
45
  }
46
- type RequestOptionsFactory$1<TResponse = any, TData = any> = (context: any) => RequestOptions$1<TResponse, TData>;
47
- type HttpResponse$1<T = any> = {
46
+ type RequestOptionsFactory<TResponse = any, TData = any> = (context: any) => RequestOptions<TResponse, TData>;
47
+ type HttpResponse<T = any> = {
48
48
  data: T;
49
49
  status: number;
50
50
  statusText: string;
51
51
  headers: any;
52
52
  request?: any;
53
53
  };
54
- type RequestOptions$1<_TResponse = any, Data = any> = {
54
+ type RequestOptions<_TResponse = any, Data = any> = {
55
55
  method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
56
56
  url: string;
57
57
  data?: Data;
58
58
  params?: URLSearchParams;
59
- } & APIMetadata$1;
60
- type APIMetadata$1 = {
59
+ } & APIMetadata;
60
+ type APIMetadata = {
61
61
  methodFqn?: string;
62
62
  entityFqdn?: string;
63
63
  packageName?: string;
64
64
  };
65
- type BuildRESTFunction$1<T extends RESTFunctionDescriptor$1> = T extends RESTFunctionDescriptor$1<infer U> ? U : never;
65
+ type BuildRESTFunction<T extends RESTFunctionDescriptor> = T extends RESTFunctionDescriptor<infer U> ? U : never;
66
66
  type EventDefinition$1<Payload = unknown, Type extends string = string> = {
67
67
  __type: 'event-definition';
68
68
  type: Type;
@@ -367,7 +367,7 @@ ConditionalKeys<Base, Condition>
367
367
  * can either be a REST module or a host module.
368
368
  * This type is recursive, so it can describe nested modules.
369
369
  */
370
- type Descriptors = RESTFunctionDescriptor$1 | AmbassadorFunctionDescriptor | HostModule<any, any> | EventDefinition$1<any> | ServicePluginDefinition<any> | {
370
+ type Descriptors = RESTFunctionDescriptor | AmbassadorFunctionDescriptor | HostModule<any, any> | EventDefinition$1<any> | ServicePluginDefinition<any> | {
371
371
  [key: string]: Descriptors | PublicMetadata | any;
372
372
  };
373
373
  /**
@@ -380,7 +380,7 @@ type BuildDescriptors<T extends Descriptors, H extends Host<any> | undefined, De
380
380
  done: T;
381
381
  recurse: T extends {
382
382
  __type: typeof SERVICE_PLUGIN_ERROR_TYPE;
383
- } ? never : T extends AmbassadorFunctionDescriptor ? BuildAmbassadorFunction<T> : T extends RESTFunctionDescriptor$1 ? BuildRESTFunction$1<T> : T extends EventDefinition$1<any> ? BuildEventDefinition$1<T> : T extends ServicePluginDefinition<any> ? BuildServicePluginDefinition<T> : T extends HostModule<any, any> ? HostModuleAPI<T> : ConditionalExcept<{
383
+ } ? never : T extends AmbassadorFunctionDescriptor ? BuildAmbassadorFunction<T> : T extends RESTFunctionDescriptor ? BuildRESTFunction<T> : T extends EventDefinition$1<any> ? BuildEventDefinition$1<T> : T extends ServicePluginDefinition<any> ? BuildServicePluginDefinition<T> : T extends HostModule<any, any> ? HostModuleAPI<T> : ConditionalExcept<{
384
384
  [Key in keyof T]: T[Key] extends Descriptors ? BuildDescriptors<T[Key], H, [
385
385
  -1,
386
386
  0,
@@ -620,7 +620,7 @@ interface EchoOptions {
620
620
  someDate?: Date;
621
621
  }
622
622
 
623
- declare function echo$1(httpClient: HttpClient$1): EchoSignature;
623
+ declare function echo$1(httpClient: HttpClient): EchoSignature;
624
624
  interface EchoSignature {
625
625
  /**
626
626
  * Another override description function 4
@@ -632,32 +632,6 @@ interface EchoSignature {
632
632
  }
633
633
  declare const onEchoDispatched$1: EventDefinition$1<EchoDispatchedEnvelope, "wix.metroinspector.v1.echo_dispatched">;
634
634
 
635
- type RESTFunctionDescriptor<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient) => T;
636
- interface HttpClient {
637
- request<TResponse, TData = any>(req: RequestOptionsFactory<TResponse, TData>): Promise<HttpResponse<TResponse>>;
638
- fetchWithAuth: typeof fetch;
639
- wixAPIFetch: (relativeUrl: string, options: RequestInit) => Promise<Response>;
640
- }
641
- type RequestOptionsFactory<TResponse = any, TData = any> = (context: any) => RequestOptions<TResponse, TData>;
642
- type HttpResponse<T = any> = {
643
- data: T;
644
- status: number;
645
- statusText: string;
646
- headers: any;
647
- request?: any;
648
- };
649
- type RequestOptions<_TResponse = any, Data = any> = {
650
- method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
651
- url: string;
652
- data?: Data;
653
- params?: URLSearchParams;
654
- } & APIMetadata;
655
- type APIMetadata = {
656
- methodFqn?: string;
657
- entityFqdn?: string;
658
- packageName?: string;
659
- };
660
- type BuildRESTFunction<T extends RESTFunctionDescriptor> = T extends RESTFunctionDescriptor<infer U> ? U : never;
661
635
  type EventDefinition<Payload = unknown, Type extends string = string> = {
662
636
  __type: 'event-definition';
663
637
  type: Type;
@@ -676,14 +650,14 @@ declare global {
676
650
  }
677
651
  }
678
652
 
679
- declare function createRESTModule<T extends RESTFunctionDescriptor>(descriptor: T, elevated?: boolean): BuildRESTFunction<T> & T;
680
-
681
653
  declare function createEventModule<T extends EventDefinition<any, string>>(eventDefinition: T): BuildEventDefinition<T> & T;
682
654
 
683
- type _publicEchoType = typeof echo$1;
684
- declare const echo: MaybeContext<ReturnType<typeof createRESTModule<_publicEchoType>>>;
655
+ declare const echo: MaybeContext<BuildRESTFunction<typeof echo$1> & typeof echo$1>;
685
656
 
686
657
  type _publicOnEchoDispatchedType = typeof onEchoDispatched$1;
658
+ /**
659
+ * echo event that might be consumed when somone says something!
660
+ */
687
661
  declare const onEchoDispatched: ReturnType<typeof createEventModule<_publicOnEchoDispatchedType>>;
688
662
 
689
663
  type context_ActionEvent = ActionEvent;
@@ -708,12 +682,11 @@ type context_MessageItem = MessageItem;
708
682
  type context_RestoreInfo = RestoreInfo;
709
683
  type context_WebhookIdentityType = WebhookIdentityType;
710
684
  declare const context_WebhookIdentityType: typeof WebhookIdentityType;
711
- type context__publicEchoType = _publicEchoType;
712
685
  type context__publicOnEchoDispatchedType = _publicOnEchoDispatchedType;
713
686
  declare const context_echo: typeof echo;
714
687
  declare const context_onEchoDispatched: typeof onEchoDispatched;
715
688
  declare namespace context {
716
- 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__publicEchoType as _publicEchoType, type context__publicOnEchoDispatchedType as _publicOnEchoDispatchedType, context_echo as echo, context_onEchoDispatched as onEchoDispatched, onEchoDispatched$1 as publicOnEchoDispatched };
689
+ 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 };
717
690
  }
718
691
 
719
692
  export { context as metroinspector };
@@ -36,33 +36,33 @@ type Host<Environment = unknown> = {
36
36
  };
37
37
  };
38
38
 
39
- type RESTFunctionDescriptor$1<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient$1) => T;
40
- interface HttpClient$1 {
41
- request<TResponse, TData = any>(req: RequestOptionsFactory$1<TResponse, TData>): Promise<HttpResponse$1<TResponse>>;
39
+ type RESTFunctionDescriptor<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient) => T;
40
+ interface HttpClient {
41
+ request<TResponse, TData = any>(req: RequestOptionsFactory<TResponse, TData>): Promise<HttpResponse<TResponse>>;
42
42
  fetchWithAuth: typeof fetch;
43
43
  wixAPIFetch: (relativeUrl: string, options: RequestInit) => Promise<Response>;
44
44
  getActiveToken?: () => string | undefined;
45
45
  }
46
- type RequestOptionsFactory$1<TResponse = any, TData = any> = (context: any) => RequestOptions$1<TResponse, TData>;
47
- type HttpResponse$1<T = any> = {
46
+ type RequestOptionsFactory<TResponse = any, TData = any> = (context: any) => RequestOptions<TResponse, TData>;
47
+ type HttpResponse<T = any> = {
48
48
  data: T;
49
49
  status: number;
50
50
  statusText: string;
51
51
  headers: any;
52
52
  request?: any;
53
53
  };
54
- type RequestOptions$1<_TResponse = any, Data = any> = {
54
+ type RequestOptions<_TResponse = any, Data = any> = {
55
55
  method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
56
56
  url: string;
57
57
  data?: Data;
58
58
  params?: URLSearchParams;
59
- } & APIMetadata$1;
60
- type APIMetadata$1 = {
59
+ } & APIMetadata;
60
+ type APIMetadata = {
61
61
  methodFqn?: string;
62
62
  entityFqdn?: string;
63
63
  packageName?: string;
64
64
  };
65
- type BuildRESTFunction$1<T extends RESTFunctionDescriptor$1> = T extends RESTFunctionDescriptor$1<infer U> ? U : never;
65
+ type BuildRESTFunction<T extends RESTFunctionDescriptor> = T extends RESTFunctionDescriptor<infer U> ? U : never;
66
66
  type EventDefinition$1<Payload = unknown, Type extends string = string> = {
67
67
  __type: 'event-definition';
68
68
  type: Type;
@@ -367,7 +367,7 @@ ConditionalKeys<Base, Condition>
367
367
  * can either be a REST module or a host module.
368
368
  * This type is recursive, so it can describe nested modules.
369
369
  */
370
- type Descriptors = RESTFunctionDescriptor$1 | AmbassadorFunctionDescriptor | HostModule<any, any> | EventDefinition$1<any> | ServicePluginDefinition<any> | {
370
+ type Descriptors = RESTFunctionDescriptor | AmbassadorFunctionDescriptor | HostModule<any, any> | EventDefinition$1<any> | ServicePluginDefinition<any> | {
371
371
  [key: string]: Descriptors | PublicMetadata | any;
372
372
  };
373
373
  /**
@@ -380,7 +380,7 @@ type BuildDescriptors<T extends Descriptors, H extends Host<any> | undefined, De
380
380
  done: T;
381
381
  recurse: T extends {
382
382
  __type: typeof SERVICE_PLUGIN_ERROR_TYPE;
383
- } ? never : T extends AmbassadorFunctionDescriptor ? BuildAmbassadorFunction<T> : T extends RESTFunctionDescriptor$1 ? BuildRESTFunction$1<T> : T extends EventDefinition$1<any> ? BuildEventDefinition$1<T> : T extends ServicePluginDefinition<any> ? BuildServicePluginDefinition<T> : T extends HostModule<any, any> ? HostModuleAPI<T> : ConditionalExcept<{
383
+ } ? never : T extends AmbassadorFunctionDescriptor ? BuildAmbassadorFunction<T> : T extends RESTFunctionDescriptor ? BuildRESTFunction<T> : T extends EventDefinition$1<any> ? BuildEventDefinition$1<T> : T extends ServicePluginDefinition<any> ? BuildServicePluginDefinition<T> : T extends HostModule<any, any> ? HostModuleAPI<T> : ConditionalExcept<{
384
384
  [Key in keyof T]: T[Key] extends Descriptors ? BuildDescriptors<T[Key], H, [
385
385
  -1,
386
386
  0,
@@ -620,7 +620,7 @@ interface EchoOptions {
620
620
  someDate?: Date;
621
621
  }
622
622
 
623
- declare function echo$1(httpClient: HttpClient$1): EchoSignature;
623
+ declare function echo$1(httpClient: HttpClient): EchoSignature;
624
624
  interface EchoSignature {
625
625
  /**
626
626
  * Another override description function 4
@@ -632,32 +632,6 @@ interface EchoSignature {
632
632
  }
633
633
  declare const onEchoDispatched$1: EventDefinition$1<EchoDispatchedEnvelope, "wix.metroinspector.v1.echo_dispatched">;
634
634
 
635
- type RESTFunctionDescriptor<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient) => T;
636
- interface HttpClient {
637
- request<TResponse, TData = any>(req: RequestOptionsFactory<TResponse, TData>): Promise<HttpResponse<TResponse>>;
638
- fetchWithAuth: typeof fetch;
639
- wixAPIFetch: (relativeUrl: string, options: RequestInit) => Promise<Response>;
640
- }
641
- type RequestOptionsFactory<TResponse = any, TData = any> = (context: any) => RequestOptions<TResponse, TData>;
642
- type HttpResponse<T = any> = {
643
- data: T;
644
- status: number;
645
- statusText: string;
646
- headers: any;
647
- request?: any;
648
- };
649
- type RequestOptions<_TResponse = any, Data = any> = {
650
- method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
651
- url: string;
652
- data?: Data;
653
- params?: URLSearchParams;
654
- } & APIMetadata;
655
- type APIMetadata = {
656
- methodFqn?: string;
657
- entityFqdn?: string;
658
- packageName?: string;
659
- };
660
- type BuildRESTFunction<T extends RESTFunctionDescriptor> = T extends RESTFunctionDescriptor<infer U> ? U : never;
661
635
  type EventDefinition<Payload = unknown, Type extends string = string> = {
662
636
  __type: 'event-definition';
663
637
  type: Type;
@@ -676,14 +650,14 @@ declare global {
676
650
  }
677
651
  }
678
652
 
679
- declare function createRESTModule<T extends RESTFunctionDescriptor>(descriptor: T, elevated?: boolean): BuildRESTFunction<T> & T;
680
-
681
653
  declare function createEventModule<T extends EventDefinition<any, string>>(eventDefinition: T): BuildEventDefinition<T> & T;
682
654
 
683
- type _publicEchoType = typeof echo$1;
684
- declare const echo: MaybeContext<ReturnType<typeof createRESTModule<_publicEchoType>>>;
655
+ declare const echo: MaybeContext<BuildRESTFunction<typeof echo$1> & typeof echo$1>;
685
656
 
686
657
  type _publicOnEchoDispatchedType = typeof onEchoDispatched$1;
658
+ /**
659
+ * echo event that might be consumed when somone says something!
660
+ */
687
661
  declare const onEchoDispatched: ReturnType<typeof createEventModule<_publicOnEchoDispatchedType>>;
688
662
 
689
663
  type index_d_ActionEvent = ActionEvent;
@@ -708,12 +682,11 @@ type index_d_MessageItem = MessageItem;
708
682
  type index_d_RestoreInfo = RestoreInfo;
709
683
  type index_d_WebhookIdentityType = WebhookIdentityType;
710
684
  declare const index_d_WebhookIdentityType: typeof WebhookIdentityType;
711
- type index_d__publicEchoType = _publicEchoType;
712
685
  type index_d__publicOnEchoDispatchedType = _publicOnEchoDispatchedType;
713
686
  declare const index_d_echo: typeof echo;
714
687
  declare const index_d_onEchoDispatched: typeof onEchoDispatched;
715
688
  declare namespace index_d {
716
- export { type index_d_ActionEvent as ActionEvent, type index_d_BaseEventMetadata as BaseEventMetadata, type index_d_Dispatched as Dispatched, type index_d_DomainEvent as DomainEvent, type index_d_DomainEventBodyOneOf as DomainEventBodyOneOf, type index_d_EchoDispatchedEnvelope as EchoDispatchedEnvelope, type index_d_EchoMessage as EchoMessage, type index_d_EchoOptions as EchoOptions, type index_d_EchoRequest as EchoRequest, type index_d_EchoResponse as EchoResponse, type index_d_EchoResponseNonNullableFields as EchoResponseNonNullableFields, type index_d_EntityCreatedEvent as EntityCreatedEvent, type index_d_EntityDeletedEvent as EntityDeletedEvent, type index_d_EntityUpdatedEvent as EntityUpdatedEvent, type index_d_EventMetadata as EventMetadata, type index_d_IdentificationData as IdentificationData, type index_d_IdentificationDataIdOneOf as IdentificationDataIdOneOf, type index_d_MessageEnvelope as MessageEnvelope, type index_d_MessageItem as MessageItem, type index_d_RestoreInfo as RestoreInfo, index_d_WebhookIdentityType as WebhookIdentityType, type index_d__publicEchoType as _publicEchoType, type index_d__publicOnEchoDispatchedType as _publicOnEchoDispatchedType, index_d_echo as echo, index_d_onEchoDispatched as onEchoDispatched, onEchoDispatched$1 as publicOnEchoDispatched };
689
+ export { type index_d_ActionEvent as ActionEvent, type index_d_BaseEventMetadata as BaseEventMetadata, type index_d_Dispatched as Dispatched, type index_d_DomainEvent as DomainEvent, type index_d_DomainEventBodyOneOf as DomainEventBodyOneOf, type index_d_EchoDispatchedEnvelope as EchoDispatchedEnvelope, type index_d_EchoMessage as EchoMessage, type index_d_EchoOptions as EchoOptions, type index_d_EchoRequest as EchoRequest, type index_d_EchoResponse as EchoResponse, type index_d_EchoResponseNonNullableFields as EchoResponseNonNullableFields, type index_d_EntityCreatedEvent as EntityCreatedEvent, type index_d_EntityDeletedEvent as EntityDeletedEvent, type index_d_EntityUpdatedEvent as EntityUpdatedEvent, type index_d_EventMetadata as EventMetadata, type index_d_IdentificationData as IdentificationData, type index_d_IdentificationDataIdOneOf as IdentificationDataIdOneOf, type index_d_MessageEnvelope as MessageEnvelope, type index_d_MessageItem as MessageItem, type index_d_RestoreInfo as RestoreInfo, index_d_WebhookIdentityType as WebhookIdentityType, type index_d__publicOnEchoDispatchedType as _publicOnEchoDispatchedType, index_d_echo as echo, index_d_onEchoDispatched as onEchoDispatched, onEchoDispatched$1 as publicOnEchoDispatched };
717
690
  }
718
691
 
719
692
  export { index_d as metroinspector };