@wix/echo 1.0.36 → 1.0.38
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/cjs/context.d.ts +1 -0
- package/build/cjs/context.js +3 -1
- package/build/cjs/context.js.map +1 -0
- package/build/cjs/index.d.ts +2 -1
- package/build/cjs/index.js +4 -1
- package/build/cjs/index.js.map +1 -0
- package/build/cjs/meta.d.ts +1 -0
- package/build/cjs/meta.js +3 -1
- package/build/cjs/meta.js.map +1 -0
- package/build/es/context.d.ts +1 -0
- package/build/es/context.js +1 -0
- package/build/es/context.js.map +1 -1
- package/build/es/index.d.ts +2 -1
- package/build/es/index.js +2 -1
- package/build/es/index.js.map +1 -1
- package/build/es/meta.d.ts +1 -0
- package/build/es/meta.js +1 -0
- package/build/es/meta.js.map +1 -1
- package/package.json +4 -3
- package/type-bundles/context.bundle.d.ts +79 -45
- package/type-bundles/index.bundle.d.ts +79 -45
- package/type-bundles/meta.bundle.d.ts +88 -1
package/build/cjs/context.d.ts
CHANGED
package/build/cjs/context.js
CHANGED
|
@@ -23,5 +23,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.metroinspector = void 0;
|
|
26
|
+
exports.metroinspector = exports.calculator = void 0;
|
|
27
|
+
exports.calculator = __importStar(require("@wix/echo_calculator/context"));
|
|
27
28
|
exports.metroinspector = __importStar(require("@wix/echo_metroinspector/context"));
|
|
29
|
+
//# sourceMappingURL=context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../context.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2EAA2D;AAC3D,mFAAmE"}
|
package/build/cjs/index.d.ts
CHANGED
package/build/cjs/index.js
CHANGED
|
@@ -23,6 +23,9 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.metroinspector = void 0;
|
|
26
|
+
exports.metroinspector = exports.calculator = void 0;
|
|
27
|
+
const calculator = __importStar(require("@wix/echo_calculator"));
|
|
28
|
+
exports.calculator = calculator;
|
|
27
29
|
const metroinspector = __importStar(require("@wix/echo_metroinspector"));
|
|
28
30
|
exports.metroinspector = metroinspector;
|
|
31
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iEAAmD;AAG1C,gCAAU;AAFnB,yEAA2D;AAEtC,wCAAc"}
|
package/build/cjs/meta.d.ts
CHANGED
package/build/cjs/meta.js
CHANGED
|
@@ -23,5 +23,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.metroinspector = void 0;
|
|
26
|
+
exports.metroinspector = exports.calculator = void 0;
|
|
27
|
+
exports.calculator = __importStar(require("@wix/echo_calculator/meta"));
|
|
27
28
|
exports.metroinspector = __importStar(require("@wix/echo_metroinspector/meta"));
|
|
29
|
+
//# sourceMappingURL=meta.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"meta.js","sourceRoot":"","sources":["../../meta.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,wEAAwD;AACxD,gFAAgE"}
|
package/build/es/context.d.ts
CHANGED
package/build/es/context.js
CHANGED
package/build/es/context.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,cAAc,MAAM,kCAAkC,CAAC"}
|
|
1
|
+
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,UAAU,MAAM,8BAA8B,CAAC;AAC3D,OAAO,KAAK,cAAc,MAAM,kCAAkC,CAAC"}
|
package/build/es/index.d.ts
CHANGED
package/build/es/index.js
CHANGED
package/build/es/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,cAAc,MAAM,0BAA0B,CAAC;AAE3D,OAAO,EAAE,cAAc,EAAE,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,UAAU,MAAM,sBAAsB,CAAC;AACnD,OAAO,KAAK,cAAc,MAAM,0BAA0B,CAAC;AAE3D,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,CAAC"}
|
package/build/es/meta.d.ts
CHANGED
package/build/es/meta.js
CHANGED
package/build/es/meta.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"meta.js","sourceRoot":"","sources":["../../meta.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,cAAc,MAAM,+BAA+B,CAAC"}
|
|
1
|
+
{"version":3,"file":"meta.js","sourceRoot":"","sources":["../../meta.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,UAAU,MAAM,2BAA2B,CAAC;AACxD,OAAO,KAAK,cAAc,MAAM,+BAA+B,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wix/echo",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.38",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"registry": "https://registry.npmjs.org/",
|
|
6
6
|
"access": "public"
|
|
@@ -18,7 +18,8 @@
|
|
|
18
18
|
"type-bundles"
|
|
19
19
|
],
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@wix/
|
|
21
|
+
"@wix/echo_calculator": "1.0.0",
|
|
22
|
+
"@wix/echo_metroinspector": "1.0.13"
|
|
22
23
|
},
|
|
23
24
|
"devDependencies": {
|
|
24
25
|
"glob": "^10.4.1",
|
|
@@ -43,5 +44,5 @@
|
|
|
43
44
|
"fqdn": ""
|
|
44
45
|
}
|
|
45
46
|
},
|
|
46
|
-
"falconPackageHash": "
|
|
47
|
+
"falconPackageHash": "b2ad249bc03d4358dc100e620b2df8774c80da392f1f47f90ff59443"
|
|
47
48
|
}
|
|
@@ -36,33 +36,33 @@ type Host<Environment = unknown> = {
|
|
|
36
36
|
};
|
|
37
37
|
};
|
|
38
38
|
|
|
39
|
-
type RESTFunctionDescriptor
|
|
40
|
-
interface HttpClient
|
|
41
|
-
request<TResponse, TData = any>(req: RequestOptionsFactory
|
|
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
|
|
47
|
-
type HttpResponse
|
|
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
|
|
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
|
|
60
|
-
type APIMetadata
|
|
59
|
+
} & APIMetadata;
|
|
60
|
+
type APIMetadata = {
|
|
61
61
|
methodFqn?: string;
|
|
62
62
|
entityFqdn?: string;
|
|
63
63
|
packageName?: string;
|
|
64
64
|
};
|
|
65
|
-
type BuildRESTFunction
|
|
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
|
|
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
|
|
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,
|
|
@@ -408,6 +408,67 @@ type MaybeContext<T extends Descriptors> = globalThis.ContextualClient extends {
|
|
|
408
408
|
host: Host;
|
|
409
409
|
} ? BuildDescriptors<T, globalThis.ContextualClient['host']> : T;
|
|
410
410
|
|
|
411
|
+
interface CalculateMessage {
|
|
412
|
+
/** result of the calculation */
|
|
413
|
+
number?: number;
|
|
414
|
+
/** message comment from the operation */
|
|
415
|
+
message?: string;
|
|
416
|
+
/** fake entity id */
|
|
417
|
+
_id?: string;
|
|
418
|
+
}
|
|
419
|
+
interface CalculateRequest {
|
|
420
|
+
/** 1st number to calculate */
|
|
421
|
+
arg1: number;
|
|
422
|
+
/** 2nd number to calculate */
|
|
423
|
+
arg2: number;
|
|
424
|
+
/** operation to perform */
|
|
425
|
+
operation: CalculateOperation;
|
|
426
|
+
}
|
|
427
|
+
declare enum CalculateOperation {
|
|
428
|
+
UNDEFINED = "UNDEFINED",
|
|
429
|
+
ADD = "ADD",
|
|
430
|
+
SUBTRACT = "SUBTRACT"
|
|
431
|
+
}
|
|
432
|
+
interface CalculateResponse {
|
|
433
|
+
result?: CalculateMessage;
|
|
434
|
+
}
|
|
435
|
+
interface CalculateMessageNonNullableFields {
|
|
436
|
+
number: number;
|
|
437
|
+
message: string;
|
|
438
|
+
_id: string;
|
|
439
|
+
}
|
|
440
|
+
interface CalculateResponseNonNullableFields {
|
|
441
|
+
result?: CalculateMessageNonNullableFields;
|
|
442
|
+
}
|
|
443
|
+
interface CalculateIdentifiers {
|
|
444
|
+
/** 1st number to calculate */
|
|
445
|
+
arg1: number;
|
|
446
|
+
/** 2nd number to calculate */
|
|
447
|
+
arg2: number;
|
|
448
|
+
/** operation to perform */
|
|
449
|
+
operation: CalculateOperation;
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
declare function calculate$1(httpClient: HttpClient): CalculateSignature;
|
|
453
|
+
interface CalculateSignature {
|
|
454
|
+
/** */
|
|
455
|
+
(identifiers: CalculateIdentifiers): Promise<CalculateResponse & CalculateResponseNonNullableFields>;
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
declare const calculate: MaybeContext<BuildRESTFunction<typeof calculate$1> & typeof calculate$1>;
|
|
459
|
+
|
|
460
|
+
type context$1_CalculateIdentifiers = CalculateIdentifiers;
|
|
461
|
+
type context$1_CalculateMessage = CalculateMessage;
|
|
462
|
+
type context$1_CalculateOperation = CalculateOperation;
|
|
463
|
+
declare const context$1_CalculateOperation: typeof CalculateOperation;
|
|
464
|
+
type context$1_CalculateRequest = CalculateRequest;
|
|
465
|
+
type context$1_CalculateResponse = CalculateResponse;
|
|
466
|
+
type context$1_CalculateResponseNonNullableFields = CalculateResponseNonNullableFields;
|
|
467
|
+
declare const context$1_calculate: typeof calculate;
|
|
468
|
+
declare namespace context$1 {
|
|
469
|
+
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 };
|
|
470
|
+
}
|
|
471
|
+
|
|
411
472
|
interface MessageItem {
|
|
412
473
|
/** inner_message comment from EchoMessage proto def */
|
|
413
474
|
innerMessage?: string;
|
|
@@ -620,7 +681,7 @@ interface EchoOptions {
|
|
|
620
681
|
someDate?: Date;
|
|
621
682
|
}
|
|
622
683
|
|
|
623
|
-
declare function echo$1(httpClient: HttpClient
|
|
684
|
+
declare function echo$1(httpClient: HttpClient): EchoSignature;
|
|
624
685
|
interface EchoSignature {
|
|
625
686
|
/**
|
|
626
687
|
* Another override description function 4
|
|
@@ -632,32 +693,6 @@ interface EchoSignature {
|
|
|
632
693
|
}
|
|
633
694
|
declare const onEchoDispatched$1: EventDefinition$1<EchoDispatchedEnvelope, "wix.metroinspector.v1.echo_dispatched">;
|
|
634
695
|
|
|
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
696
|
type EventDefinition<Payload = unknown, Type extends string = string> = {
|
|
662
697
|
__type: 'event-definition';
|
|
663
698
|
type: Type;
|
|
@@ -676,14 +711,14 @@ declare global {
|
|
|
676
711
|
}
|
|
677
712
|
}
|
|
678
713
|
|
|
679
|
-
declare function createRESTModule<T extends RESTFunctionDescriptor>(descriptor: T, elevated?: boolean): BuildRESTFunction<T> & T;
|
|
680
|
-
|
|
681
714
|
declare function createEventModule<T extends EventDefinition<any, string>>(eventDefinition: T): BuildEventDefinition<T> & T;
|
|
682
715
|
|
|
683
|
-
|
|
684
|
-
declare const echo: MaybeContext<ReturnType<typeof createRESTModule<_publicEchoType>>>;
|
|
716
|
+
declare const echo: MaybeContext<BuildRESTFunction<typeof echo$1> & typeof echo$1>;
|
|
685
717
|
|
|
686
718
|
type _publicOnEchoDispatchedType = typeof onEchoDispatched$1;
|
|
719
|
+
/**
|
|
720
|
+
* echo event that might be consumed when somone says something!
|
|
721
|
+
*/
|
|
687
722
|
declare const onEchoDispatched: ReturnType<typeof createEventModule<_publicOnEchoDispatchedType>>;
|
|
688
723
|
|
|
689
724
|
type context_ActionEvent = ActionEvent;
|
|
@@ -708,12 +743,11 @@ type context_MessageItem = MessageItem;
|
|
|
708
743
|
type context_RestoreInfo = RestoreInfo;
|
|
709
744
|
type context_WebhookIdentityType = WebhookIdentityType;
|
|
710
745
|
declare const context_WebhookIdentityType: typeof WebhookIdentityType;
|
|
711
|
-
type context__publicEchoType = _publicEchoType;
|
|
712
746
|
type context__publicOnEchoDispatchedType = _publicOnEchoDispatchedType;
|
|
713
747
|
declare const context_echo: typeof echo;
|
|
714
748
|
declare const context_onEchoDispatched: typeof onEchoDispatched;
|
|
715
749
|
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
|
|
750
|
+
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
751
|
}
|
|
718
752
|
|
|
719
|
-
export { context as metroinspector };
|
|
753
|
+
export { context$1 as calculator, context as metroinspector };
|
|
@@ -36,33 +36,33 @@ type Host<Environment = unknown> = {
|
|
|
36
36
|
};
|
|
37
37
|
};
|
|
38
38
|
|
|
39
|
-
type RESTFunctionDescriptor
|
|
40
|
-
interface HttpClient
|
|
41
|
-
request<TResponse, TData = any>(req: RequestOptionsFactory
|
|
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
|
|
47
|
-
type HttpResponse
|
|
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
|
|
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
|
|
60
|
-
type APIMetadata
|
|
59
|
+
} & APIMetadata;
|
|
60
|
+
type APIMetadata = {
|
|
61
61
|
methodFqn?: string;
|
|
62
62
|
entityFqdn?: string;
|
|
63
63
|
packageName?: string;
|
|
64
64
|
};
|
|
65
|
-
type BuildRESTFunction
|
|
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
|
|
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
|
|
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,
|
|
@@ -408,6 +408,67 @@ type MaybeContext<T extends Descriptors> = globalThis.ContextualClient extends {
|
|
|
408
408
|
host: Host;
|
|
409
409
|
} ? BuildDescriptors<T, globalThis.ContextualClient['host']> : T;
|
|
410
410
|
|
|
411
|
+
interface CalculateMessage {
|
|
412
|
+
/** result of the calculation */
|
|
413
|
+
number?: number;
|
|
414
|
+
/** message comment from the operation */
|
|
415
|
+
message?: string;
|
|
416
|
+
/** fake entity id */
|
|
417
|
+
_id?: string;
|
|
418
|
+
}
|
|
419
|
+
interface CalculateRequest {
|
|
420
|
+
/** 1st number to calculate */
|
|
421
|
+
arg1: number;
|
|
422
|
+
/** 2nd number to calculate */
|
|
423
|
+
arg2: number;
|
|
424
|
+
/** operation to perform */
|
|
425
|
+
operation: CalculateOperation;
|
|
426
|
+
}
|
|
427
|
+
declare enum CalculateOperation {
|
|
428
|
+
UNDEFINED = "UNDEFINED",
|
|
429
|
+
ADD = "ADD",
|
|
430
|
+
SUBTRACT = "SUBTRACT"
|
|
431
|
+
}
|
|
432
|
+
interface CalculateResponse {
|
|
433
|
+
result?: CalculateMessage;
|
|
434
|
+
}
|
|
435
|
+
interface CalculateMessageNonNullableFields {
|
|
436
|
+
number: number;
|
|
437
|
+
message: string;
|
|
438
|
+
_id: string;
|
|
439
|
+
}
|
|
440
|
+
interface CalculateResponseNonNullableFields {
|
|
441
|
+
result?: CalculateMessageNonNullableFields;
|
|
442
|
+
}
|
|
443
|
+
interface CalculateIdentifiers {
|
|
444
|
+
/** 1st number to calculate */
|
|
445
|
+
arg1: number;
|
|
446
|
+
/** 2nd number to calculate */
|
|
447
|
+
arg2: number;
|
|
448
|
+
/** operation to perform */
|
|
449
|
+
operation: CalculateOperation;
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
declare function calculate$1(httpClient: HttpClient): CalculateSignature;
|
|
453
|
+
interface CalculateSignature {
|
|
454
|
+
/** */
|
|
455
|
+
(identifiers: CalculateIdentifiers): Promise<CalculateResponse & CalculateResponseNonNullableFields>;
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
declare const calculate: MaybeContext<BuildRESTFunction<typeof calculate$1> & typeof calculate$1>;
|
|
459
|
+
|
|
460
|
+
type index_d$1_CalculateIdentifiers = CalculateIdentifiers;
|
|
461
|
+
type index_d$1_CalculateMessage = CalculateMessage;
|
|
462
|
+
type index_d$1_CalculateOperation = CalculateOperation;
|
|
463
|
+
declare const index_d$1_CalculateOperation: typeof CalculateOperation;
|
|
464
|
+
type index_d$1_CalculateRequest = CalculateRequest;
|
|
465
|
+
type index_d$1_CalculateResponse = CalculateResponse;
|
|
466
|
+
type index_d$1_CalculateResponseNonNullableFields = CalculateResponseNonNullableFields;
|
|
467
|
+
declare const index_d$1_calculate: typeof calculate;
|
|
468
|
+
declare namespace index_d$1 {
|
|
469
|
+
export { type index_d$1_CalculateIdentifiers as CalculateIdentifiers, type index_d$1_CalculateMessage as CalculateMessage, index_d$1_CalculateOperation as CalculateOperation, type index_d$1_CalculateRequest as CalculateRequest, type index_d$1_CalculateResponse as CalculateResponse, type index_d$1_CalculateResponseNonNullableFields as CalculateResponseNonNullableFields, index_d$1_calculate as calculate };
|
|
470
|
+
}
|
|
471
|
+
|
|
411
472
|
interface MessageItem {
|
|
412
473
|
/** inner_message comment from EchoMessage proto def */
|
|
413
474
|
innerMessage?: string;
|
|
@@ -620,7 +681,7 @@ interface EchoOptions {
|
|
|
620
681
|
someDate?: Date;
|
|
621
682
|
}
|
|
622
683
|
|
|
623
|
-
declare function echo$1(httpClient: HttpClient
|
|
684
|
+
declare function echo$1(httpClient: HttpClient): EchoSignature;
|
|
624
685
|
interface EchoSignature {
|
|
625
686
|
/**
|
|
626
687
|
* Another override description function 4
|
|
@@ -632,32 +693,6 @@ interface EchoSignature {
|
|
|
632
693
|
}
|
|
633
694
|
declare const onEchoDispatched$1: EventDefinition$1<EchoDispatchedEnvelope, "wix.metroinspector.v1.echo_dispatched">;
|
|
634
695
|
|
|
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
696
|
type EventDefinition<Payload = unknown, Type extends string = string> = {
|
|
662
697
|
__type: 'event-definition';
|
|
663
698
|
type: Type;
|
|
@@ -676,14 +711,14 @@ declare global {
|
|
|
676
711
|
}
|
|
677
712
|
}
|
|
678
713
|
|
|
679
|
-
declare function createRESTModule<T extends RESTFunctionDescriptor>(descriptor: T, elevated?: boolean): BuildRESTFunction<T> & T;
|
|
680
|
-
|
|
681
714
|
declare function createEventModule<T extends EventDefinition<any, string>>(eventDefinition: T): BuildEventDefinition<T> & T;
|
|
682
715
|
|
|
683
|
-
|
|
684
|
-
declare const echo: MaybeContext<ReturnType<typeof createRESTModule<_publicEchoType>>>;
|
|
716
|
+
declare const echo: MaybeContext<BuildRESTFunction<typeof echo$1> & typeof echo$1>;
|
|
685
717
|
|
|
686
718
|
type _publicOnEchoDispatchedType = typeof onEchoDispatched$1;
|
|
719
|
+
/**
|
|
720
|
+
* echo event that might be consumed when somone says something!
|
|
721
|
+
*/
|
|
687
722
|
declare const onEchoDispatched: ReturnType<typeof createEventModule<_publicOnEchoDispatchedType>>;
|
|
688
723
|
|
|
689
724
|
type index_d_ActionEvent = ActionEvent;
|
|
@@ -708,12 +743,11 @@ type index_d_MessageItem = MessageItem;
|
|
|
708
743
|
type index_d_RestoreInfo = RestoreInfo;
|
|
709
744
|
type index_d_WebhookIdentityType = WebhookIdentityType;
|
|
710
745
|
declare const index_d_WebhookIdentityType: typeof WebhookIdentityType;
|
|
711
|
-
type index_d__publicEchoType = _publicEchoType;
|
|
712
746
|
type index_d__publicOnEchoDispatchedType = _publicOnEchoDispatchedType;
|
|
713
747
|
declare const index_d_echo: typeof echo;
|
|
714
748
|
declare const index_d_onEchoDispatched: typeof onEchoDispatched;
|
|
715
749
|
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
|
|
750
|
+
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
751
|
}
|
|
718
752
|
|
|
719
|
-
export { index_d as metroinspector };
|
|
753
|
+
export { index_d$1 as calculator, index_d as metroinspector };
|
|
@@ -1,3 +1,90 @@
|
|
|
1
|
+
interface CalculateMessage$1 {
|
|
2
|
+
/** result of the calculation */
|
|
3
|
+
number?: number;
|
|
4
|
+
/** message comment from the operation */
|
|
5
|
+
message?: string;
|
|
6
|
+
/** fake entity id */
|
|
7
|
+
id?: string;
|
|
8
|
+
}
|
|
9
|
+
interface CalculateRequest$1 {
|
|
10
|
+
/** 1st number to calculate */
|
|
11
|
+
arg1: number;
|
|
12
|
+
/** 2nd number to calculate */
|
|
13
|
+
arg2: number;
|
|
14
|
+
/** operation to perform */
|
|
15
|
+
operation: CalculateOperation$1;
|
|
16
|
+
}
|
|
17
|
+
declare enum CalculateOperation$1 {
|
|
18
|
+
UNDEFINED = "UNDEFINED",
|
|
19
|
+
ADD = "ADD",
|
|
20
|
+
SUBTRACT = "SUBTRACT"
|
|
21
|
+
}
|
|
22
|
+
interface CalculateResponse$1 {
|
|
23
|
+
result?: CalculateMessage$1;
|
|
24
|
+
}
|
|
25
|
+
interface CalculateMessageNonNullableFields$1 {
|
|
26
|
+
number: number;
|
|
27
|
+
message: string;
|
|
28
|
+
id: string;
|
|
29
|
+
}
|
|
30
|
+
interface CalculateResponseNonNullableFields$1 {
|
|
31
|
+
result?: CalculateMessageNonNullableFields$1;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
interface CalculateMessage {
|
|
35
|
+
/** result of the calculation */
|
|
36
|
+
number?: number;
|
|
37
|
+
/** message comment from the operation */
|
|
38
|
+
message?: string;
|
|
39
|
+
/** fake entity id */
|
|
40
|
+
_id?: string;
|
|
41
|
+
}
|
|
42
|
+
interface CalculateRequest {
|
|
43
|
+
/** 1st number to calculate */
|
|
44
|
+
arg1: number;
|
|
45
|
+
/** 2nd number to calculate */
|
|
46
|
+
arg2: number;
|
|
47
|
+
/** operation to perform */
|
|
48
|
+
operation: CalculateOperation;
|
|
49
|
+
}
|
|
50
|
+
declare enum CalculateOperation {
|
|
51
|
+
UNDEFINED = "UNDEFINED",
|
|
52
|
+
ADD = "ADD",
|
|
53
|
+
SUBTRACT = "SUBTRACT"
|
|
54
|
+
}
|
|
55
|
+
interface CalculateResponse {
|
|
56
|
+
result?: CalculateMessage;
|
|
57
|
+
}
|
|
58
|
+
interface CalculateMessageNonNullableFields {
|
|
59
|
+
number: number;
|
|
60
|
+
message: string;
|
|
61
|
+
_id: string;
|
|
62
|
+
}
|
|
63
|
+
interface CalculateResponseNonNullableFields {
|
|
64
|
+
result?: CalculateMessageNonNullableFields;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
type __PublicMethodMetaInfo$1<K = string, M = unknown, T = unknown, S = unknown, Q = unknown, R = unknown> = {
|
|
68
|
+
getUrl: (context: any) => string;
|
|
69
|
+
httpMethod: K;
|
|
70
|
+
path: string;
|
|
71
|
+
pathParams: M;
|
|
72
|
+
__requestType: T;
|
|
73
|
+
__originalRequestType: S;
|
|
74
|
+
__responseType: Q;
|
|
75
|
+
__originalResponseType: R;
|
|
76
|
+
};
|
|
77
|
+
declare function calculate(): __PublicMethodMetaInfo$1<'POST', {
|
|
78
|
+
arg1: string;
|
|
79
|
+
arg2: string;
|
|
80
|
+
operation: string;
|
|
81
|
+
}, CalculateRequest, CalculateRequest$1, CalculateResponse & CalculateResponseNonNullableFields, CalculateResponse$1 & CalculateResponseNonNullableFields$1>;
|
|
82
|
+
|
|
83
|
+
declare const meta$1_calculate: typeof calculate;
|
|
84
|
+
declare namespace meta$1 {
|
|
85
|
+
export { type __PublicMethodMetaInfo$1 as __PublicMethodMetaInfo, meta$1_calculate as calculate };
|
|
86
|
+
}
|
|
87
|
+
|
|
1
88
|
interface EchoMessage$1 {
|
|
2
89
|
/** message comment from EchoMessage proto def, with special comment */
|
|
3
90
|
message?: string;
|
|
@@ -94,4 +181,4 @@ declare namespace meta {
|
|
|
94
181
|
export { type meta___PublicMethodMetaInfo as __PublicMethodMetaInfo, meta_echo as echo };
|
|
95
182
|
}
|
|
96
183
|
|
|
97
|
-
export { meta as metroinspector };
|
|
184
|
+
export { meta$1 as calculator, meta as metroinspector };
|