@wix/echo 1.0.20 → 1.0.22
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/{index.typings.js → context.js} +7 -3
- package/build/cjs/context.js.map +1 -0
- package/build/cjs/index.d.ts +1 -1
- package/build/cjs/index.js +6 -2
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/meta.d.ts +1 -1
- package/build/cjs/meta.js +6 -2
- package/build/cjs/meta.js.map +1 -1
- package/build/es/context.d.ts +1 -0
- package/build/es/context.js +2 -0
- package/build/es/context.js.map +1 -0
- package/build/es/index.d.ts +1 -1
- package/build/es/index.js +1 -1
- package/build/es/index.js.map +1 -1
- package/build/es/meta.d.ts +1 -1
- package/build/es/meta.js +1 -1
- package/build/es/meta.js.map +1 -1
- package/context/package.json +7 -0
- package/meta/package.json +2 -1
- package/package.json +22 -8
- package/type-bundles/context.bundle.d.ts +145 -0
- package/type-bundles/index.bundle.d.ts +273 -0
- package/type-bundles/meta.bundle.d.ts +93 -0
- package/build/cjs/index.typings.d.ts +0 -1
- package/build/cjs/index.typings.js.map +0 -1
- package/build/cjs/src/metroinspector-v1-echo.http.d.ts +0 -4
- package/build/cjs/src/metroinspector-v1-echo.http.js +0 -79
- package/build/cjs/src/metroinspector-v1-echo.http.js.map +0 -1
- package/build/cjs/src/metroinspector-v1-echo.meta.d.ts +0 -15
- package/build/cjs/src/metroinspector-v1-echo.meta.js +0 -43
- package/build/cjs/src/metroinspector-v1-echo.meta.js.map +0 -1
- package/build/cjs/src/metroinspector-v1-echo.public.d.ts +0 -7
- package/build/cjs/src/metroinspector-v1-echo.public.js +0 -12
- package/build/cjs/src/metroinspector-v1-echo.public.js.map +0 -1
- package/build/cjs/src/metroinspector-v1-echo.types.d.ts +0 -41
- package/build/cjs/src/metroinspector-v1-echo.types.js +0 -3
- package/build/cjs/src/metroinspector-v1-echo.types.js.map +0 -1
- package/build/cjs/src/metroinspector-v1-echo.universal.d.ts +0 -65
- package/build/cjs/src/metroinspector-v1-echo.universal.js +0 -111
- package/build/cjs/src/metroinspector-v1-echo.universal.js.map +0 -1
- package/build/es/index.typings.d.ts +0 -1
- package/build/es/index.typings.js +0 -2
- package/build/es/index.typings.js.map +0 -1
- package/build/es/src/metroinspector-v1-echo.http.d.ts +0 -4
- package/build/es/src/metroinspector-v1-echo.http.js +0 -75
- package/build/es/src/metroinspector-v1-echo.http.js.map +0 -1
- package/build/es/src/metroinspector-v1-echo.meta.d.ts +0 -15
- package/build/es/src/metroinspector-v1-echo.meta.js +0 -20
- package/build/es/src/metroinspector-v1-echo.meta.js.map +0 -1
- package/build/es/src/metroinspector-v1-echo.public.d.ts +0 -7
- package/build/es/src/metroinspector-v1-echo.public.js +0 -8
- package/build/es/src/metroinspector-v1-echo.public.js.map +0 -1
- package/build/es/src/metroinspector-v1-echo.types.d.ts +0 -41
- package/build/es/src/metroinspector-v1-echo.types.js +0 -2
- package/build/es/src/metroinspector-v1-echo.types.js.map +0 -1
- package/build/es/src/metroinspector-v1-echo.universal.d.ts +0 -65
- package/build/es/src/metroinspector-v1-echo.universal.js +0 -88
- package/build/es/src/metroinspector-v1-echo.universal.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * as metroinspector from '@wix/echo_metroinspector/context';
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -20,5 +24,5 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
20
24
|
};
|
|
21
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
26
|
exports.metroinspector = void 0;
|
|
23
|
-
exports.metroinspector = __importStar(require("
|
|
24
|
-
//# sourceMappingURL=
|
|
27
|
+
exports.metroinspector = __importStar(require("@wix/echo_metroinspector/context"));
|
|
28
|
+
//# sourceMappingURL=context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../context.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,mFAAmE"}
|
package/build/cjs/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * as metroinspector from '
|
|
1
|
+
export * as metroinspector from '@wix/echo_metroinspector';
|
package/build/cjs/index.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -20,5 +24,5 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
20
24
|
};
|
|
21
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
26
|
exports.metroinspector = void 0;
|
|
23
|
-
exports.metroinspector = __importStar(require("
|
|
27
|
+
exports.metroinspector = __importStar(require("@wix/echo_metroinspector"));
|
|
24
28
|
//# sourceMappingURL=index.js.map
|
package/build/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2EAA2D"}
|
package/build/cjs/meta.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * as metroinspector from '
|
|
1
|
+
export * as metroinspector from '@wix/echo_metroinspector/meta';
|
package/build/cjs/meta.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -20,5 +24,5 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
20
24
|
};
|
|
21
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
26
|
exports.metroinspector = void 0;
|
|
23
|
-
exports.metroinspector = __importStar(require("
|
|
27
|
+
exports.metroinspector = __importStar(require("@wix/echo_metroinspector/meta"));
|
|
24
28
|
//# sourceMappingURL=meta.js.map
|
package/build/cjs/meta.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"meta.js","sourceRoot":"","sources":["../../meta.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"meta.js","sourceRoot":"","sources":["../../meta.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gFAAgE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * as metroinspector from '@wix/echo_metroinspector/context';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,cAAc,MAAM,kCAAkC,CAAC"}
|
package/build/es/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * as metroinspector from '
|
|
1
|
+
export * as metroinspector from '@wix/echo_metroinspector';
|
package/build/es/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * as metroinspector from '
|
|
1
|
+
export * as metroinspector from '@wix/echo_metroinspector';
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
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,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,cAAc,MAAM,0BAA0B,CAAC"}
|
package/build/es/meta.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * as metroinspector from '
|
|
1
|
+
export * as metroinspector from '@wix/echo_metroinspector/meta';
|
package/build/es/meta.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * as metroinspector from '
|
|
1
|
+
export * as metroinspector from '@wix/echo_metroinspector/meta';
|
|
2
2
|
//# sourceMappingURL=meta.js.map
|
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,
|
|
1
|
+
{"version":3,"file":"meta.js","sourceRoot":"","sources":["../../meta.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,cAAc,MAAM,+BAA+B,CAAC"}
|
package/meta/package.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wix/echo",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.22",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"registry": "https://registry.npmjs.org/",
|
|
6
6
|
"access": "public"
|
|
@@ -9,25 +9,39 @@
|
|
|
9
9
|
"module": "build/es/index.js",
|
|
10
10
|
"main": "build/cjs/index.js",
|
|
11
11
|
"typings": "./build/cjs/index.d.ts",
|
|
12
|
+
"typesBundle": "./type-bundles/index.bundle.d.ts",
|
|
12
13
|
"files": [
|
|
13
14
|
"build",
|
|
14
15
|
"frontend/package.json",
|
|
15
|
-
"meta"
|
|
16
|
+
"meta",
|
|
17
|
+
"context",
|
|
18
|
+
"type-bundles"
|
|
16
19
|
],
|
|
17
20
|
"dependencies": {
|
|
18
|
-
"@wix/
|
|
19
|
-
|
|
20
|
-
|
|
21
|
+
"@wix/echo_metroinspector": "1.0.1"
|
|
22
|
+
},
|
|
23
|
+
"devDependencies": {
|
|
24
|
+
"@wix/sdk": "https://cdn.dev.wixpress.com/@wix/sdk/02e8069ab2fd783e0e6a080fc7d590e76cb26ab93c8389574286305b.tar.gz",
|
|
25
|
+
"glob": "^10.4.1",
|
|
26
|
+
"rollup": "^4.18.0",
|
|
27
|
+
"rollup-plugin-dts": "^6.1.1",
|
|
28
|
+
"typescript": "^5.3.2"
|
|
21
29
|
},
|
|
22
30
|
"scripts": {
|
|
23
|
-
"build": "tsc -b tsconfig.json tsconfig.esm.json",
|
|
31
|
+
"build": "tsc -b tsconfig.json tsconfig.esm.json && npm run build:dts-bundles",
|
|
32
|
+
"build:dts-bundles": "test -f config/rollup-config.js && rollup --config config/rollup-config.js || echo 'Warning: config/rollup-config.js not found!'",
|
|
24
33
|
"test": ":"
|
|
25
34
|
},
|
|
26
35
|
"wix": {
|
|
27
36
|
"artifact": {
|
|
37
|
+
"groupId": "com.wixpress.public-sdk-autogen",
|
|
28
38
|
"artifactId": "echo-public-sdk-autogen",
|
|
29
|
-
"
|
|
39
|
+
"isRootPublicSdk": true
|
|
40
|
+
},
|
|
41
|
+
"sdkDependency": {
|
|
42
|
+
"fqdnNamespace": "",
|
|
43
|
+
"fqdn": ""
|
|
30
44
|
}
|
|
31
45
|
},
|
|
32
|
-
"falconPackageHash": "
|
|
46
|
+
"falconPackageHash": "ccc441413df9b1201de1a9f2b38f388740def639a035170674d25d85"
|
|
33
47
|
}
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
type RESTFunctionDescriptor<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient) => T;
|
|
2
|
+
interface HttpClient {
|
|
3
|
+
request<TResponse, TData = any>(req: RequestOptionsFactory<TResponse, TData>): Promise<HttpResponse<TResponse>>;
|
|
4
|
+
}
|
|
5
|
+
type RequestOptionsFactory<TResponse = any, TData = any> = (context: any) => RequestOptions<TResponse, TData>;
|
|
6
|
+
type HttpResponse<T = any> = {
|
|
7
|
+
data: T;
|
|
8
|
+
status: number;
|
|
9
|
+
statusText: string;
|
|
10
|
+
headers: any;
|
|
11
|
+
request?: any;
|
|
12
|
+
};
|
|
13
|
+
type RequestOptions<_TResponse = any, Data = any> = {
|
|
14
|
+
method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
|
|
15
|
+
url: string;
|
|
16
|
+
data?: Data;
|
|
17
|
+
params?: URLSearchParams;
|
|
18
|
+
} & APIMetadata;
|
|
19
|
+
type APIMetadata = {
|
|
20
|
+
methodFqn?: string;
|
|
21
|
+
entityFqdn?: string;
|
|
22
|
+
packageName?: string;
|
|
23
|
+
};
|
|
24
|
+
type BuildRESTFunction<T extends RESTFunctionDescriptor> = T extends RESTFunctionDescriptor<infer U> ? U : never;
|
|
25
|
+
type EventDefinition<Payload = unknown, Type extends string = string> = {
|
|
26
|
+
__type: 'event-definition';
|
|
27
|
+
type: Type;
|
|
28
|
+
isDomainEvent?: boolean;
|
|
29
|
+
transformations?: unknown;
|
|
30
|
+
__payload: Payload;
|
|
31
|
+
};
|
|
32
|
+
declare function EventDefinition<Type extends string>(type: Type, isDomainEvent?: boolean, _transformations?: unknown): <Payload = unknown>() => EventDefinition<Payload, Type>;
|
|
33
|
+
type EventHandler<T extends EventDefinition> = (payload: T['__payload']) => void | Promise<void>;
|
|
34
|
+
type BuildEventDefinition<T extends EventDefinition<any, string>> = (handler: EventHandler<T>) => void;
|
|
35
|
+
|
|
36
|
+
interface Dispatched {
|
|
37
|
+
/** the message someone says */
|
|
38
|
+
echo?: EchoMessage;
|
|
39
|
+
}
|
|
40
|
+
interface IdentificationData extends IdentificationDataIdOneOf {
|
|
41
|
+
/** ID of a site visitor that has not logged in to the site. */
|
|
42
|
+
anonymousVisitorId?: string;
|
|
43
|
+
/** ID of a site visitor that has logged in to the site. */
|
|
44
|
+
memberId?: string;
|
|
45
|
+
/** ID of a Wix user (site owner, contributor, etc.). */
|
|
46
|
+
wixUserId?: string;
|
|
47
|
+
/** ID of an app. */
|
|
48
|
+
appId?: string;
|
|
49
|
+
/** @readonly */
|
|
50
|
+
identityType?: WebhookIdentityType;
|
|
51
|
+
}
|
|
52
|
+
/** @oneof */
|
|
53
|
+
interface IdentificationDataIdOneOf {
|
|
54
|
+
/** ID of a site visitor that has not logged in to the site. */
|
|
55
|
+
anonymousVisitorId?: string;
|
|
56
|
+
/** ID of a site visitor that has logged in to the site. */
|
|
57
|
+
memberId?: string;
|
|
58
|
+
/** ID of a Wix user (site owner, contributor, etc.). */
|
|
59
|
+
wixUserId?: string;
|
|
60
|
+
/** ID of an app. */
|
|
61
|
+
appId?: string;
|
|
62
|
+
}
|
|
63
|
+
declare enum WebhookIdentityType {
|
|
64
|
+
UNKNOWN = "UNKNOWN",
|
|
65
|
+
ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR",
|
|
66
|
+
MEMBER = "MEMBER",
|
|
67
|
+
WIX_USER = "WIX_USER",
|
|
68
|
+
APP = "APP"
|
|
69
|
+
}
|
|
70
|
+
interface EchoMessage {
|
|
71
|
+
veloMessage: string;
|
|
72
|
+
id: string;
|
|
73
|
+
}
|
|
74
|
+
interface BaseEventMetadata {
|
|
75
|
+
/** App instance ID. */
|
|
76
|
+
instanceId?: string | null;
|
|
77
|
+
/** Event type. */
|
|
78
|
+
eventType?: string;
|
|
79
|
+
/** The identification type and identity data. */
|
|
80
|
+
identity?: IdentificationData;
|
|
81
|
+
}
|
|
82
|
+
interface EventMetadata extends BaseEventMetadata {
|
|
83
|
+
/**
|
|
84
|
+
* Unique event ID.
|
|
85
|
+
* Allows clients to ignore duplicate webhooks.
|
|
86
|
+
*/
|
|
87
|
+
_id?: string;
|
|
88
|
+
/**
|
|
89
|
+
* Assumes actions are also always typed to an entity_type
|
|
90
|
+
* Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction
|
|
91
|
+
*/
|
|
92
|
+
entityFqdn?: string;
|
|
93
|
+
/**
|
|
94
|
+
* This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug)
|
|
95
|
+
* This is although the created/updated/deleted notion is duplication of the oneof types
|
|
96
|
+
* Example: created/updated/deleted/started/completed/email_opened
|
|
97
|
+
*/
|
|
98
|
+
slug?: string;
|
|
99
|
+
/** ID of the entity associated with the event. */
|
|
100
|
+
entityId?: string;
|
|
101
|
+
/** Event timestamp. */
|
|
102
|
+
eventTime?: Date;
|
|
103
|
+
/**
|
|
104
|
+
* Whether the event was triggered as a result of a privacy regulation application
|
|
105
|
+
* (for example, GDPR).
|
|
106
|
+
*/
|
|
107
|
+
triggeredByAnonymizeRequest?: boolean | null;
|
|
108
|
+
/** If present, indicates the action that triggered the event. */
|
|
109
|
+
originatedFrom?: string | null;
|
|
110
|
+
/**
|
|
111
|
+
* A sequence number defining the order of updates to the underlying entity.
|
|
112
|
+
* For example, given that some entity was updated at 16:00 and than again at 16:01,
|
|
113
|
+
* it is guaranteed that the sequence number of the second update is strictly higher than the first.
|
|
114
|
+
* As the consumer, you can use this value to ensure that you handle messages in the correct order.
|
|
115
|
+
* To do so, you will need to persist this number on your end, and compare the sequence number from the
|
|
116
|
+
* message against the one you have stored. Given that the stored number is higher, you should ignore the message.
|
|
117
|
+
*/
|
|
118
|
+
entityEventSequence?: string | null;
|
|
119
|
+
}
|
|
120
|
+
interface EchoDispatchedEnvelope {
|
|
121
|
+
data: Dispatched;
|
|
122
|
+
metadata: EventMetadata;
|
|
123
|
+
}
|
|
124
|
+
interface EchoOptions {
|
|
125
|
+
/** 2nd part of the message */
|
|
126
|
+
arg2?: string;
|
|
127
|
+
/** this field test translatable annotation */
|
|
128
|
+
titleField?: string;
|
|
129
|
+
someInt32?: number;
|
|
130
|
+
someDate?: Date;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
declare function echo$1(httpClient: HttpClient): (arg1: string, options?: EchoOptions) => Promise<string>;
|
|
134
|
+
declare const onEchoDispatched$1: EventDefinition<EchoDispatchedEnvelope, "wix.metroinspector.v1.echo_dispatched">;
|
|
135
|
+
|
|
136
|
+
declare const echo: BuildRESTFunction<typeof echo$1>;
|
|
137
|
+
declare const onEchoDispatched: BuildEventDefinition<typeof onEchoDispatched$1>;
|
|
138
|
+
|
|
139
|
+
declare const context_echo: typeof echo;
|
|
140
|
+
declare const context_onEchoDispatched: typeof onEchoDispatched;
|
|
141
|
+
declare namespace context {
|
|
142
|
+
export { context_echo as echo, context_onEchoDispatched as onEchoDispatched };
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
export { context as metroinspector };
|
|
@@ -0,0 +1,273 @@
|
|
|
1
|
+
interface HttpClient {
|
|
2
|
+
request<TResponse, TData = any>(req: RequestOptionsFactory<TResponse, TData>): Promise<HttpResponse<TResponse>>;
|
|
3
|
+
}
|
|
4
|
+
type RequestOptionsFactory<TResponse = any, TData = any> = (context: any) => RequestOptions<TResponse, TData>;
|
|
5
|
+
type HttpResponse<T = any> = {
|
|
6
|
+
data: T;
|
|
7
|
+
status: number;
|
|
8
|
+
statusText: string;
|
|
9
|
+
headers: any;
|
|
10
|
+
request?: any;
|
|
11
|
+
};
|
|
12
|
+
type RequestOptions<_TResponse = any, Data = any> = {
|
|
13
|
+
method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
|
|
14
|
+
url: string;
|
|
15
|
+
data?: Data;
|
|
16
|
+
params?: URLSearchParams;
|
|
17
|
+
} & APIMetadata;
|
|
18
|
+
type APIMetadata = {
|
|
19
|
+
methodFqn?: string;
|
|
20
|
+
entityFqdn?: string;
|
|
21
|
+
packageName?: string;
|
|
22
|
+
};
|
|
23
|
+
type EventDefinition<Payload = unknown, Type extends string = string> = {
|
|
24
|
+
__type: 'event-definition';
|
|
25
|
+
type: Type;
|
|
26
|
+
isDomainEvent?: boolean;
|
|
27
|
+
transformations?: unknown;
|
|
28
|
+
__payload: Payload;
|
|
29
|
+
};
|
|
30
|
+
declare function EventDefinition<Type extends string>(type: Type, isDomainEvent?: boolean, _transformations?: unknown): <Payload = unknown>() => EventDefinition<Payload, Type>;
|
|
31
|
+
|
|
32
|
+
interface MessageItem {
|
|
33
|
+
/** inner_message comment from EchoMessage proto def */
|
|
34
|
+
innerMessage?: string;
|
|
35
|
+
}
|
|
36
|
+
interface EchoRequest {
|
|
37
|
+
/** 1st part of the message */
|
|
38
|
+
arg1: string;
|
|
39
|
+
/** 2nd part of the message */
|
|
40
|
+
arg2?: string;
|
|
41
|
+
/** this field test translatable annotation */
|
|
42
|
+
titleField?: string;
|
|
43
|
+
someInt32?: number;
|
|
44
|
+
someDate?: Date;
|
|
45
|
+
}
|
|
46
|
+
interface EchoResponse {
|
|
47
|
+
/**
|
|
48
|
+
* override EchoResponse.echoMessage
|
|
49
|
+
*
|
|
50
|
+
*/
|
|
51
|
+
echoMessage?: EchoMessage;
|
|
52
|
+
/** messge reseult as string */
|
|
53
|
+
message?: string;
|
|
54
|
+
}
|
|
55
|
+
interface Dispatched {
|
|
56
|
+
/** the message someone says */
|
|
57
|
+
echo?: EchoMessage;
|
|
58
|
+
}
|
|
59
|
+
interface DomainEvent extends DomainEventBodyOneOf {
|
|
60
|
+
createdEvent?: EntityCreatedEvent;
|
|
61
|
+
updatedEvent?: EntityUpdatedEvent;
|
|
62
|
+
deletedEvent?: EntityDeletedEvent;
|
|
63
|
+
actionEvent?: ActionEvent;
|
|
64
|
+
/**
|
|
65
|
+
* Unique event ID.
|
|
66
|
+
* Allows clients to ignore duplicate webhooks.
|
|
67
|
+
*/
|
|
68
|
+
_id?: string;
|
|
69
|
+
/**
|
|
70
|
+
* Assumes actions are also always typed to an entity_type
|
|
71
|
+
* Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction
|
|
72
|
+
*/
|
|
73
|
+
entityFqdn?: string;
|
|
74
|
+
/**
|
|
75
|
+
* This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug)
|
|
76
|
+
* This is although the created/updated/deleted notion is duplication of the oneof types
|
|
77
|
+
* Example: created/updated/deleted/started/completed/email_opened
|
|
78
|
+
*/
|
|
79
|
+
slug?: string;
|
|
80
|
+
/** ID of the entity associated with the event. */
|
|
81
|
+
entityId?: string;
|
|
82
|
+
/** Event timestamp. */
|
|
83
|
+
eventTime?: Date;
|
|
84
|
+
/**
|
|
85
|
+
* Whether the event was triggered as a result of a privacy regulation application
|
|
86
|
+
* (for example, GDPR).
|
|
87
|
+
*/
|
|
88
|
+
triggeredByAnonymizeRequest?: boolean | null;
|
|
89
|
+
/** If present, indicates the action that triggered the event. */
|
|
90
|
+
originatedFrom?: string | null;
|
|
91
|
+
/**
|
|
92
|
+
* A sequence number defining the order of updates to the underlying entity.
|
|
93
|
+
* For example, given that some entity was updated at 16:00 and than again at 16:01,
|
|
94
|
+
* it is guaranteed that the sequence number of the second update is strictly higher than the first.
|
|
95
|
+
* As the consumer, you can use this value to ensure that you handle messages in the correct order.
|
|
96
|
+
* To do so, you will need to persist this number on your end, and compare the sequence number from the
|
|
97
|
+
* message against the one you have stored. Given that the stored number is higher, you should ignore the message.
|
|
98
|
+
*/
|
|
99
|
+
entityEventSequence?: string | null;
|
|
100
|
+
}
|
|
101
|
+
/** @oneof */
|
|
102
|
+
interface DomainEventBodyOneOf {
|
|
103
|
+
createdEvent?: EntityCreatedEvent;
|
|
104
|
+
updatedEvent?: EntityUpdatedEvent;
|
|
105
|
+
deletedEvent?: EntityDeletedEvent;
|
|
106
|
+
actionEvent?: ActionEvent;
|
|
107
|
+
}
|
|
108
|
+
interface EntityCreatedEvent {
|
|
109
|
+
entity?: string;
|
|
110
|
+
}
|
|
111
|
+
interface EntityUpdatedEvent {
|
|
112
|
+
/**
|
|
113
|
+
* Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.
|
|
114
|
+
* This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.
|
|
115
|
+
* We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.
|
|
116
|
+
*/
|
|
117
|
+
currentEntity?: string;
|
|
118
|
+
}
|
|
119
|
+
interface EntityDeletedEvent {
|
|
120
|
+
/** Entity that was deleted */
|
|
121
|
+
deletedEntity?: string | null;
|
|
122
|
+
}
|
|
123
|
+
interface ActionEvent {
|
|
124
|
+
body?: string;
|
|
125
|
+
}
|
|
126
|
+
interface MessageEnvelope {
|
|
127
|
+
/** App instance ID. */
|
|
128
|
+
instanceId?: string | null;
|
|
129
|
+
/** Event type. */
|
|
130
|
+
eventType?: string;
|
|
131
|
+
/** The identification type and identity data. */
|
|
132
|
+
identity?: IdentificationData;
|
|
133
|
+
/** Stringify payload. */
|
|
134
|
+
data?: string;
|
|
135
|
+
}
|
|
136
|
+
interface IdentificationData extends IdentificationDataIdOneOf {
|
|
137
|
+
/** ID of a site visitor that has not logged in to the site. */
|
|
138
|
+
anonymousVisitorId?: string;
|
|
139
|
+
/** ID of a site visitor that has logged in to the site. */
|
|
140
|
+
memberId?: string;
|
|
141
|
+
/** ID of a Wix user (site owner, contributor, etc.). */
|
|
142
|
+
wixUserId?: string;
|
|
143
|
+
/** ID of an app. */
|
|
144
|
+
appId?: string;
|
|
145
|
+
/** @readonly */
|
|
146
|
+
identityType?: WebhookIdentityType;
|
|
147
|
+
}
|
|
148
|
+
/** @oneof */
|
|
149
|
+
interface IdentificationDataIdOneOf {
|
|
150
|
+
/** ID of a site visitor that has not logged in to the site. */
|
|
151
|
+
anonymousVisitorId?: string;
|
|
152
|
+
/** ID of a site visitor that has logged in to the site. */
|
|
153
|
+
memberId?: string;
|
|
154
|
+
/** ID of a Wix user (site owner, contributor, etc.). */
|
|
155
|
+
wixUserId?: string;
|
|
156
|
+
/** ID of an app. */
|
|
157
|
+
appId?: string;
|
|
158
|
+
}
|
|
159
|
+
declare enum WebhookIdentityType {
|
|
160
|
+
UNKNOWN = "UNKNOWN",
|
|
161
|
+
ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR",
|
|
162
|
+
MEMBER = "MEMBER",
|
|
163
|
+
WIX_USER = "WIX_USER",
|
|
164
|
+
APP = "APP"
|
|
165
|
+
}
|
|
166
|
+
interface EchoResponseNonNullableFields {
|
|
167
|
+
echoMessage?: {
|
|
168
|
+
message: string;
|
|
169
|
+
messagesList: {
|
|
170
|
+
innerMessage: string;
|
|
171
|
+
}[];
|
|
172
|
+
_id: string;
|
|
173
|
+
};
|
|
174
|
+
message: string;
|
|
175
|
+
}
|
|
176
|
+
interface EchoMessage {
|
|
177
|
+
veloMessage: string;
|
|
178
|
+
id: string;
|
|
179
|
+
}
|
|
180
|
+
interface BaseEventMetadata {
|
|
181
|
+
/** App instance ID. */
|
|
182
|
+
instanceId?: string | null;
|
|
183
|
+
/** Event type. */
|
|
184
|
+
eventType?: string;
|
|
185
|
+
/** The identification type and identity data. */
|
|
186
|
+
identity?: IdentificationData;
|
|
187
|
+
}
|
|
188
|
+
interface EventMetadata extends BaseEventMetadata {
|
|
189
|
+
/**
|
|
190
|
+
* Unique event ID.
|
|
191
|
+
* Allows clients to ignore duplicate webhooks.
|
|
192
|
+
*/
|
|
193
|
+
_id?: string;
|
|
194
|
+
/**
|
|
195
|
+
* Assumes actions are also always typed to an entity_type
|
|
196
|
+
* Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction
|
|
197
|
+
*/
|
|
198
|
+
entityFqdn?: string;
|
|
199
|
+
/**
|
|
200
|
+
* This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug)
|
|
201
|
+
* This is although the created/updated/deleted notion is duplication of the oneof types
|
|
202
|
+
* Example: created/updated/deleted/started/completed/email_opened
|
|
203
|
+
*/
|
|
204
|
+
slug?: string;
|
|
205
|
+
/** ID of the entity associated with the event. */
|
|
206
|
+
entityId?: string;
|
|
207
|
+
/** Event timestamp. */
|
|
208
|
+
eventTime?: Date;
|
|
209
|
+
/**
|
|
210
|
+
* Whether the event was triggered as a result of a privacy regulation application
|
|
211
|
+
* (for example, GDPR).
|
|
212
|
+
*/
|
|
213
|
+
triggeredByAnonymizeRequest?: boolean | null;
|
|
214
|
+
/** If present, indicates the action that triggered the event. */
|
|
215
|
+
originatedFrom?: string | null;
|
|
216
|
+
/**
|
|
217
|
+
* A sequence number defining the order of updates to the underlying entity.
|
|
218
|
+
* For example, given that some entity was updated at 16:00 and than again at 16:01,
|
|
219
|
+
* it is guaranteed that the sequence number of the second update is strictly higher than the first.
|
|
220
|
+
* As the consumer, you can use this value to ensure that you handle messages in the correct order.
|
|
221
|
+
* To do so, you will need to persist this number on your end, and compare the sequence number from the
|
|
222
|
+
* message against the one you have stored. Given that the stored number is higher, you should ignore the message.
|
|
223
|
+
*/
|
|
224
|
+
entityEventSequence?: string | null;
|
|
225
|
+
}
|
|
226
|
+
interface EchoDispatchedEnvelope {
|
|
227
|
+
data: Dispatched;
|
|
228
|
+
metadata: EventMetadata;
|
|
229
|
+
}
|
|
230
|
+
interface EchoOptions {
|
|
231
|
+
/** 2nd part of the message */
|
|
232
|
+
arg2?: string;
|
|
233
|
+
/** this field test translatable annotation */
|
|
234
|
+
titleField?: string;
|
|
235
|
+
someInt32?: number;
|
|
236
|
+
someDate?: Date;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
declare const __metadata: {
|
|
240
|
+
PACKAGE_NAME: string;
|
|
241
|
+
};
|
|
242
|
+
declare function echo(httpClient: HttpClient): (arg1: string, options?: EchoOptions) => Promise<string>;
|
|
243
|
+
declare const onEchoDispatched: EventDefinition<EchoDispatchedEnvelope, "wix.metroinspector.v1.echo_dispatched">;
|
|
244
|
+
|
|
245
|
+
type index_d_ActionEvent = ActionEvent;
|
|
246
|
+
type index_d_BaseEventMetadata = BaseEventMetadata;
|
|
247
|
+
type index_d_Dispatched = Dispatched;
|
|
248
|
+
type index_d_DomainEvent = DomainEvent;
|
|
249
|
+
type index_d_DomainEventBodyOneOf = DomainEventBodyOneOf;
|
|
250
|
+
type index_d_EchoDispatchedEnvelope = EchoDispatchedEnvelope;
|
|
251
|
+
type index_d_EchoMessage = EchoMessage;
|
|
252
|
+
type index_d_EchoOptions = EchoOptions;
|
|
253
|
+
type index_d_EchoRequest = EchoRequest;
|
|
254
|
+
type index_d_EchoResponse = EchoResponse;
|
|
255
|
+
type index_d_EchoResponseNonNullableFields = EchoResponseNonNullableFields;
|
|
256
|
+
type index_d_EntityCreatedEvent = EntityCreatedEvent;
|
|
257
|
+
type index_d_EntityDeletedEvent = EntityDeletedEvent;
|
|
258
|
+
type index_d_EntityUpdatedEvent = EntityUpdatedEvent;
|
|
259
|
+
type index_d_EventMetadata = EventMetadata;
|
|
260
|
+
type index_d_IdentificationData = IdentificationData;
|
|
261
|
+
type index_d_IdentificationDataIdOneOf = IdentificationDataIdOneOf;
|
|
262
|
+
type index_d_MessageEnvelope = MessageEnvelope;
|
|
263
|
+
type index_d_MessageItem = MessageItem;
|
|
264
|
+
type index_d_WebhookIdentityType = WebhookIdentityType;
|
|
265
|
+
declare const index_d_WebhookIdentityType: typeof WebhookIdentityType;
|
|
266
|
+
declare const index_d___metadata: typeof __metadata;
|
|
267
|
+
declare const index_d_echo: typeof echo;
|
|
268
|
+
declare const index_d_onEchoDispatched: typeof onEchoDispatched;
|
|
269
|
+
declare namespace index_d {
|
|
270
|
+
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, index_d_WebhookIdentityType as WebhookIdentityType, index_d___metadata as __metadata, index_d_echo as echo, index_d_onEchoDispatched as onEchoDispatched };
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
export { index_d as metroinspector };
|