@wix/auto_sdk_motion_metroinspector 1.0.0 → 1.0.1

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 (125) hide show
  1. package/build/cjs/index.d.ts +23 -1
  2. package/build/cjs/index.js +225 -15
  3. package/build/cjs/index.js.map +1 -1
  4. package/build/cjs/index.typings.d.ts +238 -1
  5. package/build/cjs/index.typings.js +189 -15
  6. package/build/cjs/index.typings.js.map +1 -1
  7. package/build/cjs/meta.d.ts +45 -1
  8. package/build/cjs/meta.js +158 -15
  9. package/build/cjs/meta.js.map +1 -1
  10. package/build/es/index.d.mts +23 -0
  11. package/build/es/index.mjs +202 -0
  12. package/build/es/index.mjs.map +1 -0
  13. package/build/{internal/cjs/src/metroinspector-v1-echo-metroinspector.universal.d.ts → es/index.typings.d.mts} +44 -72
  14. package/build/es/index.typings.mjs +167 -0
  15. package/build/es/index.typings.mjs.map +1 -0
  16. package/build/es/meta.d.mts +45 -0
  17. package/build/es/meta.mjs +134 -0
  18. package/build/es/meta.mjs.map +1 -0
  19. package/build/internal/cjs/index.d.ts +23 -1
  20. package/build/internal/cjs/index.js +225 -15
  21. package/build/internal/cjs/index.js.map +1 -1
  22. package/build/internal/cjs/index.typings.d.ts +238 -1
  23. package/build/internal/cjs/index.typings.js +189 -15
  24. package/build/internal/cjs/index.typings.js.map +1 -1
  25. package/build/internal/cjs/meta.d.ts +45 -1
  26. package/build/internal/cjs/meta.js +158 -15
  27. package/build/internal/cjs/meta.js.map +1 -1
  28. package/build/internal/es/index.d.mts +23 -0
  29. package/build/internal/es/index.mjs +202 -0
  30. package/build/internal/es/index.mjs.map +1 -0
  31. package/build/{cjs/src/metroinspector-v1-echo-metroinspector.universal.d.ts → internal/es/index.typings.d.mts} +44 -72
  32. package/build/internal/es/index.typings.mjs +167 -0
  33. package/build/internal/es/index.typings.mjs.map +1 -0
  34. package/build/internal/es/meta.d.mts +45 -0
  35. package/build/internal/es/meta.mjs +134 -0
  36. package/build/internal/es/meta.mjs.map +1 -0
  37. package/package.json +12 -10
  38. package/build/cjs/src/metroinspector-v1-echo-metroinspector.context.d.ts +0 -11
  39. package/build/cjs/src/metroinspector-v1-echo-metroinspector.context.js +0 -15
  40. package/build/cjs/src/metroinspector-v1-echo-metroinspector.context.js.map +0 -1
  41. package/build/cjs/src/metroinspector-v1-echo-metroinspector.http.d.ts +0 -3
  42. package/build/cjs/src/metroinspector-v1-echo-metroinspector.http.js +0 -115
  43. package/build/cjs/src/metroinspector-v1-echo-metroinspector.http.js.map +0 -1
  44. package/build/cjs/src/metroinspector-v1-echo-metroinspector.meta.d.ts +0 -15
  45. package/build/cjs/src/metroinspector-v1-echo-metroinspector.meta.js +0 -47
  46. package/build/cjs/src/metroinspector-v1-echo-metroinspector.meta.js.map +0 -1
  47. package/build/cjs/src/metroinspector-v1-echo-metroinspector.public.d.ts +0 -17
  48. package/build/cjs/src/metroinspector-v1-echo-metroinspector.public.js +0 -24
  49. package/build/cjs/src/metroinspector-v1-echo-metroinspector.public.js.map +0 -1
  50. package/build/cjs/src/metroinspector-v1-echo-metroinspector.types.d.ts +0 -189
  51. package/build/cjs/src/metroinspector-v1-echo-metroinspector.types.js +0 -12
  52. package/build/cjs/src/metroinspector-v1-echo-metroinspector.types.js.map +0 -1
  53. package/build/cjs/src/metroinspector-v1-echo-metroinspector.universal.js +0 -81
  54. package/build/cjs/src/metroinspector-v1-echo-metroinspector.universal.js.map +0 -1
  55. package/build/es/index.d.ts +0 -1
  56. package/build/es/index.js +0 -2
  57. package/build/es/index.js.map +0 -1
  58. package/build/es/index.typings.d.ts +0 -1
  59. package/build/es/index.typings.js +0 -2
  60. package/build/es/index.typings.js.map +0 -1
  61. package/build/es/meta.d.ts +0 -1
  62. package/build/es/meta.js +0 -2
  63. package/build/es/meta.js.map +0 -1
  64. package/build/es/src/metroinspector-v1-echo-metroinspector.context.d.ts +0 -11
  65. package/build/es/src/metroinspector-v1-echo-metroinspector.context.js +0 -11
  66. package/build/es/src/metroinspector-v1-echo-metroinspector.context.js.map +0 -1
  67. package/build/es/src/metroinspector-v1-echo-metroinspector.http.d.ts +0 -3
  68. package/build/es/src/metroinspector-v1-echo-metroinspector.http.js +0 -111
  69. package/build/es/src/metroinspector-v1-echo-metroinspector.http.js.map +0 -1
  70. package/build/es/src/metroinspector-v1-echo-metroinspector.meta.d.ts +0 -15
  71. package/build/es/src/metroinspector-v1-echo-metroinspector.meta.js +0 -20
  72. package/build/es/src/metroinspector-v1-echo-metroinspector.meta.js.map +0 -1
  73. package/build/es/src/metroinspector-v1-echo-metroinspector.public.d.ts +0 -17
  74. package/build/es/src/metroinspector-v1-echo-metroinspector.public.js +0 -19
  75. package/build/es/src/metroinspector-v1-echo-metroinspector.public.js.map +0 -1
  76. package/build/es/src/metroinspector-v1-echo-metroinspector.types.d.ts +0 -189
  77. package/build/es/src/metroinspector-v1-echo-metroinspector.types.js +0 -9
  78. package/build/es/src/metroinspector-v1-echo-metroinspector.types.js.map +0 -1
  79. package/build/es/src/metroinspector-v1-echo-metroinspector.universal.d.ts +0 -266
  80. package/build/es/src/metroinspector-v1-echo-metroinspector.universal.js +0 -54
  81. package/build/es/src/metroinspector-v1-echo-metroinspector.universal.js.map +0 -1
  82. package/build/internal/cjs/src/metroinspector-v1-echo-metroinspector.context.d.ts +0 -11
  83. package/build/internal/cjs/src/metroinspector-v1-echo-metroinspector.context.js +0 -15
  84. package/build/internal/cjs/src/metroinspector-v1-echo-metroinspector.context.js.map +0 -1
  85. package/build/internal/cjs/src/metroinspector-v1-echo-metroinspector.http.d.ts +0 -3
  86. package/build/internal/cjs/src/metroinspector-v1-echo-metroinspector.http.js +0 -115
  87. package/build/internal/cjs/src/metroinspector-v1-echo-metroinspector.http.js.map +0 -1
  88. package/build/internal/cjs/src/metroinspector-v1-echo-metroinspector.meta.d.ts +0 -15
  89. package/build/internal/cjs/src/metroinspector-v1-echo-metroinspector.meta.js +0 -47
  90. package/build/internal/cjs/src/metroinspector-v1-echo-metroinspector.meta.js.map +0 -1
  91. package/build/internal/cjs/src/metroinspector-v1-echo-metroinspector.public.d.ts +0 -17
  92. package/build/internal/cjs/src/metroinspector-v1-echo-metroinspector.public.js +0 -24
  93. package/build/internal/cjs/src/metroinspector-v1-echo-metroinspector.public.js.map +0 -1
  94. package/build/internal/cjs/src/metroinspector-v1-echo-metroinspector.types.d.ts +0 -189
  95. package/build/internal/cjs/src/metroinspector-v1-echo-metroinspector.types.js +0 -12
  96. package/build/internal/cjs/src/metroinspector-v1-echo-metroinspector.types.js.map +0 -1
  97. package/build/internal/cjs/src/metroinspector-v1-echo-metroinspector.universal.js +0 -81
  98. package/build/internal/cjs/src/metroinspector-v1-echo-metroinspector.universal.js.map +0 -1
  99. package/build/internal/es/index.d.ts +0 -1
  100. package/build/internal/es/index.js +0 -2
  101. package/build/internal/es/index.js.map +0 -1
  102. package/build/internal/es/index.typings.d.ts +0 -1
  103. package/build/internal/es/index.typings.js +0 -2
  104. package/build/internal/es/index.typings.js.map +0 -1
  105. package/build/internal/es/meta.d.ts +0 -1
  106. package/build/internal/es/meta.js +0 -2
  107. package/build/internal/es/meta.js.map +0 -1
  108. package/build/internal/es/src/metroinspector-v1-echo-metroinspector.context.d.ts +0 -11
  109. package/build/internal/es/src/metroinspector-v1-echo-metroinspector.context.js +0 -11
  110. package/build/internal/es/src/metroinspector-v1-echo-metroinspector.context.js.map +0 -1
  111. package/build/internal/es/src/metroinspector-v1-echo-metroinspector.http.d.ts +0 -3
  112. package/build/internal/es/src/metroinspector-v1-echo-metroinspector.http.js +0 -111
  113. package/build/internal/es/src/metroinspector-v1-echo-metroinspector.http.js.map +0 -1
  114. package/build/internal/es/src/metroinspector-v1-echo-metroinspector.meta.d.ts +0 -15
  115. package/build/internal/es/src/metroinspector-v1-echo-metroinspector.meta.js +0 -20
  116. package/build/internal/es/src/metroinspector-v1-echo-metroinspector.meta.js.map +0 -1
  117. package/build/internal/es/src/metroinspector-v1-echo-metroinspector.public.d.ts +0 -17
  118. package/build/internal/es/src/metroinspector-v1-echo-metroinspector.public.js +0 -19
  119. package/build/internal/es/src/metroinspector-v1-echo-metroinspector.public.js.map +0 -1
  120. package/build/internal/es/src/metroinspector-v1-echo-metroinspector.types.d.ts +0 -189
  121. package/build/internal/es/src/metroinspector-v1-echo-metroinspector.types.js +0 -9
  122. package/build/internal/es/src/metroinspector-v1-echo-metroinspector.types.js.map +0 -1
  123. package/build/internal/es/src/metroinspector-v1-echo-metroinspector.universal.d.ts +0 -266
  124. package/build/internal/es/src/metroinspector-v1-echo-metroinspector.universal.js +0 -54
  125. package/build/internal/es/src/metroinspector-v1-echo-metroinspector.universal.js.map +0 -1
@@ -0,0 +1,202 @@
1
+ // src/metroinspector-v1-echo-metroinspector.public.ts
2
+ import { renameKeysFromRESTResponseToSDKResponse as renameKeysFromRESTResponseToSDKResponse2 } from "@wix/sdk-runtime/rename-all-nested-keys";
3
+ import { transformRESTTimestampToSDKTimestamp } from "@wix/sdk-runtime/transformations/timestamp";
4
+ import { transformPaths as transformPaths2 } from "@wix/sdk-runtime/transformations/transform-paths";
5
+ import { EventDefinition } from "@wix/sdk-types";
6
+
7
+ // src/metroinspector-v1-echo-metroinspector.universal.ts
8
+ import { transformError as sdkTransformError } from "@wix/sdk-runtime/transform-error";
9
+ import {
10
+ renameKeysFromSDKRequestToRESTRequest,
11
+ renameKeysFromRESTResponseToSDKResponse
12
+ } from "@wix/sdk-runtime/rename-all-nested-keys";
13
+
14
+ // src/metroinspector-v1-echo-metroinspector.http.ts
15
+ import { transformSDKTimestampToRESTTimestamp } from "@wix/sdk-runtime/transformations/timestamp";
16
+ import { transformPaths } from "@wix/sdk-runtime/transformations/transform-paths";
17
+ import { resolveUrl } from "@wix/sdk-runtime/rest-modules";
18
+ function resolveWixCoreservicesMetroinspectorV1MetroInspectorServiceUrl(opts) {
19
+ const domainToMappings = {
20
+ "apps._base_domain_": [
21
+ {
22
+ srcPath: "/_api/metro-inspector",
23
+ destPath: "/api"
24
+ }
25
+ ],
26
+ "api._api_base_domain_": [
27
+ {
28
+ srcPath: "/metro-inspector",
29
+ destPath: ""
30
+ }
31
+ ],
32
+ "www._base_domain_": [
33
+ {
34
+ srcPath: "/metro-inspector",
35
+ destPath: "/api"
36
+ }
37
+ ],
38
+ "manage._base_domain_": [
39
+ {
40
+ srcPath: "/metro-inspector",
41
+ destPath: ""
42
+ }
43
+ ],
44
+ "www.wixgateway.com": [
45
+ {
46
+ srcPath: "/_api/metro-inspector",
47
+ destPath: "/api"
48
+ }
49
+ ],
50
+ _: [
51
+ {
52
+ srcPath: "/_api/metro-inspector",
53
+ destPath: "/api"
54
+ }
55
+ ],
56
+ "www.wixapis.com": [
57
+ {
58
+ srcPath: "/_api/metro-inspector",
59
+ destPath: "/api"
60
+ },
61
+ {
62
+ srcPath: "/metro-inspector",
63
+ destPath: ""
64
+ }
65
+ ],
66
+ "editor._base_domain_": [
67
+ {
68
+ srcPath: "/metro-insepctor",
69
+ destPath: ""
70
+ },
71
+ {
72
+ srcPath: "/_api/metro-inspector",
73
+ destPath: "/api"
74
+ }
75
+ ],
76
+ "blocks._base_domain_": [
77
+ {
78
+ srcPath: "/metro-insepctor",
79
+ destPath: ""
80
+ },
81
+ {
82
+ srcPath: "/_api/metro-inspector",
83
+ destPath: "/api"
84
+ }
85
+ ],
86
+ "create.editorx": [
87
+ {
88
+ srcPath: "/metro-insepctor",
89
+ destPath: ""
90
+ },
91
+ {
92
+ srcPath: "/_api/metro-inspector",
93
+ destPath: "/api"
94
+ }
95
+ ]
96
+ };
97
+ return resolveUrl(Object.assign(opts, { domainToMappings }));
98
+ }
99
+ var PACKAGE_NAME = "@wix/auto_sdk_motion_metroinspector";
100
+ function echo(payload) {
101
+ function __echo({ host }) {
102
+ const serializedData = transformPaths(payload, [
103
+ {
104
+ transformFn: transformSDKTimestampToRESTTimestamp,
105
+ paths: [{ path: "someDate" }]
106
+ }
107
+ ]);
108
+ const metadata = {
109
+ entityFqdn: "wix.metroinspector.v1.echo",
110
+ method: "POST",
111
+ methodFqn: "wix.coreservices.metroinspector.v1.MetroInspectorService.Echo",
112
+ packageName: PACKAGE_NAME,
113
+ url: resolveWixCoreservicesMetroinspectorV1MetroInspectorServiceUrl({
114
+ protoPath: "/api/v1/echo/{arg1}",
115
+ data: serializedData,
116
+ host
117
+ }),
118
+ data: serializedData
119
+ };
120
+ return metadata;
121
+ }
122
+ return __echo;
123
+ }
124
+
125
+ // src/metroinspector-v1-echo-metroinspector.universal.ts
126
+ var WebhookIdentityType = /* @__PURE__ */ ((WebhookIdentityType2) => {
127
+ WebhookIdentityType2["UNKNOWN"] = "UNKNOWN";
128
+ WebhookIdentityType2["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
129
+ WebhookIdentityType2["MEMBER"] = "MEMBER";
130
+ WebhookIdentityType2["WIX_USER"] = "WIX_USER";
131
+ WebhookIdentityType2["APP"] = "APP";
132
+ return WebhookIdentityType2;
133
+ })(WebhookIdentityType || {});
134
+ async function echo2(arg1, options) {
135
+ const { httpClient, sideEffects } = arguments[2];
136
+ const payload = renameKeysFromSDKRequestToRESTRequest({
137
+ arg1,
138
+ arg2: options?.arg2,
139
+ titleField: options?.titleField,
140
+ someInt32: options?.someInt32,
141
+ someDate: options?.someDate
142
+ });
143
+ const reqOpts = echo(payload);
144
+ sideEffects?.onSiteCall?.();
145
+ try {
146
+ const result = await httpClient.request(reqOpts);
147
+ sideEffects?.onSuccess?.(result);
148
+ return renameKeysFromRESTResponseToSDKResponse(result.data)?.message;
149
+ } catch (err) {
150
+ const transformedError = sdkTransformError(
151
+ err,
152
+ {
153
+ spreadPathsToArguments: {},
154
+ explicitPathsToArguments: {
155
+ arg1: "$[0]",
156
+ arg2: "$[1].arg2",
157
+ titleField: "$[1].titleField",
158
+ someInt32: "$[1].someInt32",
159
+ someDate: "$[1].someDate"
160
+ },
161
+ singleArgumentUnchanged: false
162
+ },
163
+ ["arg1", "options"]
164
+ );
165
+ sideEffects?.onError?.(err);
166
+ throw transformedError;
167
+ }
168
+ }
169
+
170
+ // src/metroinspector-v1-echo-metroinspector.public.ts
171
+ function echo3(httpClient) {
172
+ return (arg1, options) => echo2(
173
+ arg1,
174
+ options,
175
+ // @ts-ignore
176
+ { httpClient }
177
+ );
178
+ }
179
+ var onEchoDispatched = EventDefinition(
180
+ "wix.metroinspector.v1.echo_dispatched",
181
+ true,
182
+ (event) => renameKeysFromRESTResponseToSDKResponse2(
183
+ transformPaths2(event, [
184
+ {
185
+ transformFn: transformRESTTimestampToSDKTimestamp,
186
+ paths: [{ path: "metadata.eventTime" }]
187
+ }
188
+ ])
189
+ )
190
+ )();
191
+
192
+ // src/metroinspector-v1-echo-metroinspector.context.ts
193
+ import { createRESTModule } from "@wix/sdk-runtime/rest-modules";
194
+ import { createEventModule } from "@wix/sdk-runtime/event-definition-modules";
195
+ var echo4 = /* @__PURE__ */ createRESTModule(echo3);
196
+ var onEchoDispatched2 = createEventModule(onEchoDispatched);
197
+ export {
198
+ WebhookIdentityType,
199
+ echo4 as echo,
200
+ onEchoDispatched2 as onEchoDispatched
201
+ };
202
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/metroinspector-v1-echo-metroinspector.public.ts","../../src/metroinspector-v1-echo-metroinspector.universal.ts","../../src/metroinspector-v1-echo-metroinspector.http.ts","../../src/metroinspector-v1-echo-metroinspector.context.ts"],"sourcesContent":["import { renameKeysFromRESTResponseToSDKResponse } from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { transformRESTTimestampToSDKTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport { EventDefinition, HttpClient } from '@wix/sdk-types';\nimport {\n EchoDispatchedEnvelope,\n EchoOptions,\n echo as universalEcho,\n} from './metroinspector-v1-echo-metroinspector.universal.js';\n\nexport const __metadata = { PACKAGE_NAME: '@wix/motion' };\n\nexport function echo(httpClient: HttpClient): EchoSignature {\n return (arg1: string, options?: EchoOptions) =>\n universalEcho(\n arg1,\n options,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface EchoSignature {\n /**\n * echo given arg1 and arg2\n * @param - 1st part of the message\n * @param - modified comment for arg2 el hovav\n * @returns messge reseult as string\n */\n (arg1: string, options?: EchoOptions): Promise<string>;\n}\n\nexport const onEchoDispatched = EventDefinition(\n 'wix.metroinspector.v1.echo_dispatched',\n true,\n (event: EchoDispatchedEnvelope) =>\n renameKeysFromRESTResponseToSDKResponse(\n transformPaths(event, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [{ path: 'metadata.eventTime' }],\n },\n ])\n )\n)<EchoDispatchedEnvelope>();\n\nexport {\n ActionEvent,\n BaseEventMetadata,\n Dispatched,\n DomainEvent,\n DomainEventBodyOneOf,\n EchoDispatchedEnvelope,\n EchoMessage,\n EchoOptions,\n EchoRequest,\n EchoResponse,\n EntityCreatedEvent,\n EntityDeletedEvent,\n EntityUpdatedEvent,\n EventMetadata,\n IdentificationData,\n IdentificationDataIdOneOf,\n MessageEnvelope,\n MessageItem,\n RestoreInfo,\n WebhookIdentityType,\n} from './metroinspector-v1-echo-metroinspector.universal.js';\n","import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport {\n renameKeysFromSDKRequestToRESTRequest,\n renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { HttpClient } from '@wix/sdk-types';\nimport * as ambassadorWixMetroinspectorV1Echo from './metroinspector-v1-echo-metroinspector.http.js';\n\nexport interface MessageItem {\n /** inner_message comment from EchoMessage proto def */\n innerMessage?: string;\n}\n\nexport interface EchoRequest {\n /** 1st part of the message */\n arg1: string;\n /** 2nd part of the message */\n arg2?: string;\n /** this field test translatable annotation */\n titleField?: string;\n someInt32?: number;\n someDate?: Date | null;\n}\n\nexport interface EchoResponse {\n /** message result as EchoMessage */\n echoMessage?: EchoMessage;\n /** messge reseult as string */\n message?: string;\n}\n\nexport interface Dispatched {\n /** the message someone says */\n echo?: EchoMessage;\n}\n\nexport interface DomainEvent extends DomainEventBodyOneOf {\n createdEvent?: EntityCreatedEvent;\n updatedEvent?: EntityUpdatedEvent;\n deletedEvent?: EntityDeletedEvent;\n actionEvent?: ActionEvent;\n /** Event ID. With this ID you can easily spot duplicated events and ignore them. */\n _id?: string;\n /**\n * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities.\n * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`.\n */\n entityFqdn?: string;\n /**\n * Event action name, placed at the top level to make it easier for users to dispatch messages.\n * For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`.\n */\n slug?: string;\n /** ID of the entity associated with the event. */\n entityId?: string;\n /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */\n eventTime?: Date | null;\n /**\n * Whether the event was triggered as a result of a privacy regulation application\n * (for example, GDPR).\n */\n triggeredByAnonymizeRequest?: boolean | null;\n /** If present, indicates the action that triggered the event. */\n originatedFrom?: string | null;\n /**\n * A sequence number that indicates the order of updates to an entity. For example, if an entity was updated at 16:00 and then again at 16:01, the second update will always have a higher sequence number.\n * You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it.\n */\n entityEventSequence?: string | null;\n}\n\n/** @oneof */\nexport interface DomainEventBodyOneOf {\n createdEvent?: EntityCreatedEvent;\n updatedEvent?: EntityUpdatedEvent;\n deletedEvent?: EntityDeletedEvent;\n actionEvent?: ActionEvent;\n}\n\nexport interface EntityCreatedEvent {\n entity?: string;\n}\n\nexport interface RestoreInfo {\n deletedDate?: Date | null;\n}\n\nexport interface EntityUpdatedEvent {\n /**\n * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.\n * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.\n * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.\n */\n currentEntity?: string;\n}\n\nexport interface EntityDeletedEvent {\n /** Entity that was deleted. */\n deletedEntity?: string | null;\n}\n\nexport interface ActionEvent {\n body?: string;\n}\n\nexport interface MessageEnvelope {\n /**\n * App instance ID.\n * @format GUID\n */\n instanceId?: string | null;\n /**\n * Event type.\n * @maxLength 150\n */\n eventType?: string;\n /** The identification type and identity data. */\n identity?: IdentificationData;\n /** Stringify payload. */\n data?: string;\n}\n\nexport interface IdentificationData extends IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n /** @readonly */\n identityType?: WebhookIdentityTypeWithLiterals;\n}\n\n/** @oneof */\nexport interface IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n}\n\nexport enum WebhookIdentityType {\n UNKNOWN = 'UNKNOWN',\n ANONYMOUS_VISITOR = 'ANONYMOUS_VISITOR',\n MEMBER = 'MEMBER',\n WIX_USER = 'WIX_USER',\n APP = 'APP',\n}\n\n/** @enumType */\nexport type WebhookIdentityTypeWithLiterals =\n | WebhookIdentityType\n | 'UNKNOWN'\n | 'ANONYMOUS_VISITOR'\n | 'MEMBER'\n | 'WIX_USER'\n | 'APP';\n\nexport interface EchoMessage {\n veloMessage: string;\n id: string;\n}\n\nexport interface BaseEventMetadata {\n /**\n * App instance ID.\n * @format GUID\n */\n instanceId?: string | null;\n /**\n * Event type.\n * @maxLength 150\n */\n eventType?: string;\n /** The identification type and identity data. */\n identity?: IdentificationData;\n}\n\nexport interface EventMetadata extends BaseEventMetadata {\n /** Event ID. With this ID you can easily spot duplicated events and ignore them. */\n _id?: string;\n /**\n * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities.\n * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`.\n */\n entityFqdn?: string;\n /**\n * Event action name, placed at the top level to make it easier for users to dispatch messages.\n * For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`.\n */\n slug?: string;\n /** ID of the entity associated with the event. */\n entityId?: string;\n /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */\n eventTime?: Date | null;\n /**\n * Whether the event was triggered as a result of a privacy regulation application\n * (for example, GDPR).\n */\n triggeredByAnonymizeRequest?: boolean | null;\n /** If present, indicates the action that triggered the event. */\n originatedFrom?: string | null;\n /**\n * A sequence number that indicates the order of updates to an entity. For example, if an entity was updated at 16:00 and then again at 16:01, the second update will always have a higher sequence number.\n * You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it.\n */\n entityEventSequence?: string | null;\n}\n\nexport interface EchoDispatchedEnvelope {\n data: Dispatched;\n metadata: EventMetadata;\n}\n\n/**\n * echo event that might be consumed when somone says something!\n * @webhook\n * @eventType wix.metroinspector.v1.echo_dispatched\n * @serviceIdentifier wix.coreservices.metroinspector.v1.MetroInspectorService\n * @slug dispatched\n */\nexport declare function onEchoDispatched(\n handler: (event: EchoDispatchedEnvelope) => void | Promise<void>\n): void;\n\n/**\n * echo given arg1 and arg2\n * @param arg1 - 1st part of the message\n * @public\n * @requiredField arg1\n * @param arg2 - modified comment for arg2 el hovav\n * @returns messge reseult as string\n * @fqn wix.coreservices.metroinspector.v1.MetroInspectorService.Echo\n */\nexport async function echo(\n arg1: string,\n options?: EchoOptions\n): Promise<string> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[2] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n arg1: arg1,\n arg2: options?.arg2,\n titleField: options?.titleField,\n someInt32: options?.someInt32,\n someDate: options?.someDate,\n });\n\n const reqOpts = ambassadorWixMetroinspectorV1Echo.echo(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)?.message!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {\n arg1: '$[0]',\n arg2: '$[1].arg2',\n titleField: '$[1].titleField',\n someInt32: '$[1].someInt32',\n someDate: '$[1].someDate',\n },\n singleArgumentUnchanged: false,\n },\n ['arg1', 'options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface EchoOptions {\n /** 2nd part of the message */\n arg2?: string;\n /** this field test translatable annotation */\n titleField?: string;\n someInt32?: number;\n someDate?: Date | null;\n}\n","import { transformSDKTimestampToRESTTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveWixCoreservicesMetroinspectorV1MetroInspectorServiceUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'apps._base_domain_': [\n {\n srcPath: '/_api/metro-inspector',\n destPath: '/api',\n },\n ],\n 'api._api_base_domain_': [\n {\n srcPath: '/metro-inspector',\n destPath: '',\n },\n ],\n 'www._base_domain_': [\n {\n srcPath: '/metro-inspector',\n destPath: '/api',\n },\n ],\n 'manage._base_domain_': [\n {\n srcPath: '/metro-inspector',\n destPath: '',\n },\n ],\n 'www.wixgateway.com': [\n {\n srcPath: '/_api/metro-inspector',\n destPath: '/api',\n },\n ],\n _: [\n {\n srcPath: '/_api/metro-inspector',\n destPath: '/api',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/_api/metro-inspector',\n destPath: '/api',\n },\n {\n srcPath: '/metro-inspector',\n destPath: '',\n },\n ],\n 'editor._base_domain_': [\n {\n srcPath: '/metro-insepctor',\n destPath: '',\n },\n {\n srcPath: '/_api/metro-inspector',\n destPath: '/api',\n },\n ],\n 'blocks._base_domain_': [\n {\n srcPath: '/metro-insepctor',\n destPath: '',\n },\n {\n srcPath: '/_api/metro-inspector',\n destPath: '/api',\n },\n ],\n 'create.editorx': [\n {\n srcPath: '/metro-insepctor',\n destPath: '',\n },\n {\n srcPath: '/_api/metro-inspector',\n destPath: '/api',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_motion_metroinspector';\n\n/** echo given arg1 and arg2 */\nexport function echo(payload: object): RequestOptionsFactory<any> {\n function __echo({ host }: any) {\n const serializedData = transformPaths(payload, [\n {\n transformFn: transformSDKTimestampToRESTTimestamp,\n paths: [{ path: 'someDate' }],\n },\n ]);\n const metadata = {\n entityFqdn: 'wix.metroinspector.v1.echo',\n method: 'POST' as any,\n methodFqn:\n 'wix.coreservices.metroinspector.v1.MetroInspectorService.Echo',\n packageName: PACKAGE_NAME,\n url: resolveWixCoreservicesMetroinspectorV1MetroInspectorServiceUrl({\n protoPath: '/api/v1/echo/{arg1}',\n data: serializedData,\n host,\n }),\n data: serializedData,\n };\n\n return metadata;\n }\n\n return __echo;\n}\n","import { echo as publicEcho } from './metroinspector-v1-echo-metroinspector.public.js';\nimport { createRESTModule } from '@wix/sdk-runtime/rest-modules';\nimport { createEventModule } from '@wix/sdk-runtime/event-definition-modules';\nimport {\n BuildRESTFunction,\n MaybeContext,\n BuildEventDefinition,\n} from '@wix/sdk-types';\nimport { onEchoDispatched as publicOnEchoDispatched } from './metroinspector-v1-echo-metroinspector.public.js';\n\nexport const echo: MaybeContext<\n BuildRESTFunction<typeof publicEcho> & typeof publicEcho\n> = /*#__PURE__*/ createRESTModule(publicEcho);\n/**\n * echo event that might be consumed when somone says something!\n */\nexport const onEchoDispatched: BuildEventDefinition<\n typeof publicOnEchoDispatched\n> = createEventModule(publicOnEchoDispatched);\n\nexport { WebhookIdentityType } from './metroinspector-v1-echo-metroinspector.universal.js';\nexport {\n MessageItem,\n EchoRequest,\n EchoResponse,\n Dispatched,\n DomainEvent,\n DomainEventBodyOneOf,\n EntityCreatedEvent,\n RestoreInfo,\n EntityUpdatedEvent,\n EntityDeletedEvent,\n ActionEvent,\n MessageEnvelope,\n IdentificationData,\n IdentificationDataIdOneOf,\n EchoMessage,\n BaseEventMetadata,\n EventMetadata,\n EchoDispatchedEnvelope,\n EchoOptions,\n} from './metroinspector-v1-echo-metroinspector.universal.js';\nexport { WebhookIdentityTypeWithLiterals } from './metroinspector-v1-echo-metroinspector.universal.js';\n"],"mappings":"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","names":["renameKeysFromRESTResponseToSDKResponse","transformPaths","WebhookIdentityType","echo","echo","renameKeysFromRESTResponseToSDKResponse","transformPaths","echo","onEchoDispatched"]}
@@ -1,8 +1,8 @@
1
- export interface MessageItem {
1
+ interface MessageItem {
2
2
  /** inner_message comment from EchoMessage proto def */
3
3
  innerMessage?: string;
4
4
  }
5
- export interface EchoRequest {
5
+ interface EchoRequest {
6
6
  /** 1st part of the message */
7
7
  arg1: string;
8
8
  /** 2nd part of the message */
@@ -12,40 +12,36 @@ export interface EchoRequest {
12
12
  someInt32?: number;
13
13
  someDate?: Date | null;
14
14
  }
15
- export interface EchoResponse {
15
+ interface EchoResponse {
16
16
  /** message result as EchoMessage */
17
17
  echoMessage?: EchoMessage;
18
18
  /** messge reseult as string */
19
19
  message?: string;
20
20
  }
21
- export interface Dispatched {
21
+ interface Dispatched {
22
22
  /** the message someone says */
23
23
  echo?: EchoMessage;
24
24
  }
25
- export interface DomainEvent extends DomainEventBodyOneOf {
25
+ interface DomainEvent extends DomainEventBodyOneOf {
26
26
  createdEvent?: EntityCreatedEvent;
27
27
  updatedEvent?: EntityUpdatedEvent;
28
28
  deletedEvent?: EntityDeletedEvent;
29
29
  actionEvent?: ActionEvent;
30
- /**
31
- * Unique event ID.
32
- * Allows clients to ignore duplicate webhooks.
33
- */
30
+ /** Event ID. With this ID you can easily spot duplicated events and ignore them. */
34
31
  _id?: string;
35
32
  /**
36
- * Assumes actions are also always typed to an entity_type
37
- * Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction
33
+ * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities.
34
+ * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`.
38
35
  */
39
36
  entityFqdn?: string;
40
37
  /**
41
- * This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug)
42
- * This is although the created/updated/deleted notion is duplication of the oneof types
43
- * Example: created/updated/deleted/started/completed/email_opened
38
+ * Event action name, placed at the top level to make it easier for users to dispatch messages.
39
+ * For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`.
44
40
  */
45
41
  slug?: string;
46
42
  /** ID of the entity associated with the event. */
47
43
  entityId?: string;
48
- /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example: 2020-04-26T13:57:50.699Z */
44
+ /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */
49
45
  eventTime?: Date | null;
50
46
  /**
51
47
  * Whether the event was triggered as a result of a privacy regulation application
@@ -55,29 +51,25 @@ export interface DomainEvent extends DomainEventBodyOneOf {
55
51
  /** If present, indicates the action that triggered the event. */
56
52
  originatedFrom?: string | null;
57
53
  /**
58
- * A sequence number defining the order of updates to the underlying entity.
59
- * For example, given that some entity was updated at 16:00 and than again at 16:01,
60
- * it is guaranteed that the sequence number of the second update is strictly higher than the first.
61
- * As the consumer, you can use this value to ensure that you handle messages in the correct order.
62
- * To do so, you will need to persist this number on your end, and compare the sequence number from the
63
- * message against the one you have stored. Given that the stored number is higher, you should ignore the message.
54
+ * A sequence number that indicates the order of updates to an entity. For example, if an entity was updated at 16:00 and then again at 16:01, the second update will always have a higher sequence number.
55
+ * You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it.
64
56
  */
65
57
  entityEventSequence?: string | null;
66
58
  }
67
59
  /** @oneof */
68
- export interface DomainEventBodyOneOf {
60
+ interface DomainEventBodyOneOf {
69
61
  createdEvent?: EntityCreatedEvent;
70
62
  updatedEvent?: EntityUpdatedEvent;
71
63
  deletedEvent?: EntityDeletedEvent;
72
64
  actionEvent?: ActionEvent;
73
65
  }
74
- export interface EntityCreatedEvent {
66
+ interface EntityCreatedEvent {
75
67
  entity?: string;
76
68
  }
77
- export interface RestoreInfo {
69
+ interface RestoreInfo {
78
70
  deletedDate?: Date | null;
79
71
  }
80
- export interface EntityUpdatedEvent {
72
+ interface EntityUpdatedEvent {
81
73
  /**
82
74
  * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.
83
75
  * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.
@@ -85,14 +77,14 @@ export interface EntityUpdatedEvent {
85
77
  */
86
78
  currentEntity?: string;
87
79
  }
88
- export interface EntityDeletedEvent {
89
- /** Entity that was deleted */
80
+ interface EntityDeletedEvent {
81
+ /** Entity that was deleted. */
90
82
  deletedEntity?: string | null;
91
83
  }
92
- export interface ActionEvent {
84
+ interface ActionEvent {
93
85
  body?: string;
94
86
  }
95
- export interface MessageEnvelope {
87
+ interface MessageEnvelope {
96
88
  /**
97
89
  * App instance ID.
98
90
  * @format GUID
@@ -108,7 +100,7 @@ export interface MessageEnvelope {
108
100
  /** Stringify payload. */
109
101
  data?: string;
110
102
  }
111
- export interface IdentificationData extends IdentificationDataIdOneOf {
103
+ interface IdentificationData extends IdentificationDataIdOneOf {
112
104
  /**
113
105
  * ID of a site visitor that has not logged in to the site.
114
106
  * @format GUID
@@ -130,10 +122,10 @@ export interface IdentificationData extends IdentificationDataIdOneOf {
130
122
  */
131
123
  appId?: string;
132
124
  /** @readonly */
133
- identityType?: WebhookIdentityType;
125
+ identityType?: WebhookIdentityTypeWithLiterals;
134
126
  }
135
127
  /** @oneof */
136
- export interface IdentificationDataIdOneOf {
128
+ interface IdentificationDataIdOneOf {
137
129
  /**
138
130
  * ID of a site visitor that has not logged in to the site.
139
131
  * @format GUID
@@ -155,33 +147,20 @@ export interface IdentificationDataIdOneOf {
155
147
  */
156
148
  appId?: string;
157
149
  }
158
- export declare enum WebhookIdentityType {
150
+ declare enum WebhookIdentityType {
159
151
  UNKNOWN = "UNKNOWN",
160
152
  ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR",
161
153
  MEMBER = "MEMBER",
162
154
  WIX_USER = "WIX_USER",
163
155
  APP = "APP"
164
156
  }
165
- export interface EchoRequestRequiredFields {
166
- arg1: string;
167
- }
168
- interface MessageItemNonNullableFields {
169
- innerMessage: string;
170
- }
171
- interface EchoMessageNonNullableFields {
172
- message: string;
173
- messagesList: MessageItemNonNullableFields[];
174
- _id: string;
175
- }
176
- export interface EchoResponseNonNullableFields {
177
- echoMessage?: EchoMessageNonNullableFields;
178
- message: string;
179
- }
180
- export interface EchoMessage {
157
+ /** @enumType */
158
+ type WebhookIdentityTypeWithLiterals = WebhookIdentityType | 'UNKNOWN' | 'ANONYMOUS_VISITOR' | 'MEMBER' | 'WIX_USER' | 'APP';
159
+ interface EchoMessage {
181
160
  veloMessage: string;
182
161
  id: string;
183
162
  }
184
- export interface BaseEventMetadata {
163
+ interface BaseEventMetadata {
185
164
  /**
186
165
  * App instance ID.
187
166
  * @format GUID
@@ -195,26 +174,22 @@ export interface BaseEventMetadata {
195
174
  /** The identification type and identity data. */
196
175
  identity?: IdentificationData;
197
176
  }
198
- export interface EventMetadata extends BaseEventMetadata {
199
- /**
200
- * Unique event ID.
201
- * Allows clients to ignore duplicate webhooks.
202
- */
177
+ interface EventMetadata extends BaseEventMetadata {
178
+ /** Event ID. With this ID you can easily spot duplicated events and ignore them. */
203
179
  _id?: string;
204
180
  /**
205
- * Assumes actions are also always typed to an entity_type
206
- * Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction
181
+ * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities.
182
+ * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`.
207
183
  */
208
184
  entityFqdn?: string;
209
185
  /**
210
- * This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug)
211
- * This is although the created/updated/deleted notion is duplication of the oneof types
212
- * Example: created/updated/deleted/started/completed/email_opened
186
+ * Event action name, placed at the top level to make it easier for users to dispatch messages.
187
+ * For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`.
213
188
  */
214
189
  slug?: string;
215
190
  /** ID of the entity associated with the event. */
216
191
  entityId?: string;
217
- /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example: 2020-04-26T13:57:50.699Z */
192
+ /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */
218
193
  eventTime?: Date | null;
219
194
  /**
220
195
  * Whether the event was triggered as a result of a privacy regulation application
@@ -224,16 +199,12 @@ export interface EventMetadata extends BaseEventMetadata {
224
199
  /** If present, indicates the action that triggered the event. */
225
200
  originatedFrom?: string | null;
226
201
  /**
227
- * A sequence number defining the order of updates to the underlying entity.
228
- * For example, given that some entity was updated at 16:00 and than again at 16:01,
229
- * it is guaranteed that the sequence number of the second update is strictly higher than the first.
230
- * As the consumer, you can use this value to ensure that you handle messages in the correct order.
231
- * To do so, you will need to persist this number on your end, and compare the sequence number from the
232
- * message against the one you have stored. Given that the stored number is higher, you should ignore the message.
202
+ * A sequence number that indicates the order of updates to an entity. For example, if an entity was updated at 16:00 and then again at 16:01, the second update will always have a higher sequence number.
203
+ * You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it.
233
204
  */
234
205
  entityEventSequence?: string | null;
235
206
  }
236
- export interface EchoDispatchedEnvelope {
207
+ interface EchoDispatchedEnvelope {
237
208
  data: Dispatched;
238
209
  metadata: EventMetadata;
239
210
  }
@@ -244,7 +215,7 @@ export interface EchoDispatchedEnvelope {
244
215
  * @serviceIdentifier wix.coreservices.metroinspector.v1.MetroInspectorService
245
216
  * @slug dispatched
246
217
  */
247
- export declare function onEchoDispatched(handler: (event: EchoDispatchedEnvelope) => void | Promise<void>): void;
218
+ declare function onEchoDispatched(handler: (event: EchoDispatchedEnvelope) => void | Promise<void>): void;
248
219
  /**
249
220
  * echo given arg1 and arg2
250
221
  * @param arg1 - 1st part of the message
@@ -254,8 +225,8 @@ export declare function onEchoDispatched(handler: (event: EchoDispatchedEnvelope
254
225
  * @returns messge reseult as string
255
226
  * @fqn wix.coreservices.metroinspector.v1.MetroInspectorService.Echo
256
227
  */
257
- export declare function echo(arg1: string, options?: EchoOptions): Promise<string>;
258
- export interface EchoOptions {
228
+ declare function echo(arg1: string, options?: EchoOptions): Promise<string>;
229
+ interface EchoOptions {
259
230
  /** 2nd part of the message */
260
231
  arg2?: string;
261
232
  /** this field test translatable annotation */
@@ -263,4 +234,5 @@ export interface EchoOptions {
263
234
  someInt32?: number;
264
235
  someDate?: Date | null;
265
236
  }
266
- export {};
237
+
238
+ export { type ActionEvent, type BaseEventMetadata, type Dispatched, type DomainEvent, type DomainEventBodyOneOf, type EchoDispatchedEnvelope, type EchoMessage, type EchoOptions, type EchoRequest, type EchoResponse, type EntityCreatedEvent, type EntityDeletedEvent, type EntityUpdatedEvent, type EventMetadata, type IdentificationData, type IdentificationDataIdOneOf, type MessageEnvelope, type MessageItem, type RestoreInfo, WebhookIdentityType, type WebhookIdentityTypeWithLiterals, echo, onEchoDispatched };
@@ -0,0 +1,167 @@
1
+ // src/metroinspector-v1-echo-metroinspector.universal.ts
2
+ import { transformError as sdkTransformError } from "@wix/sdk-runtime/transform-error";
3
+ import {
4
+ renameKeysFromSDKRequestToRESTRequest,
5
+ renameKeysFromRESTResponseToSDKResponse
6
+ } from "@wix/sdk-runtime/rename-all-nested-keys";
7
+
8
+ // src/metroinspector-v1-echo-metroinspector.http.ts
9
+ import { transformSDKTimestampToRESTTimestamp } from "@wix/sdk-runtime/transformations/timestamp";
10
+ import { transformPaths } from "@wix/sdk-runtime/transformations/transform-paths";
11
+ import { resolveUrl } from "@wix/sdk-runtime/rest-modules";
12
+ function resolveWixCoreservicesMetroinspectorV1MetroInspectorServiceUrl(opts) {
13
+ const domainToMappings = {
14
+ "apps._base_domain_": [
15
+ {
16
+ srcPath: "/_api/metro-inspector",
17
+ destPath: "/api"
18
+ }
19
+ ],
20
+ "api._api_base_domain_": [
21
+ {
22
+ srcPath: "/metro-inspector",
23
+ destPath: ""
24
+ }
25
+ ],
26
+ "www._base_domain_": [
27
+ {
28
+ srcPath: "/metro-inspector",
29
+ destPath: "/api"
30
+ }
31
+ ],
32
+ "manage._base_domain_": [
33
+ {
34
+ srcPath: "/metro-inspector",
35
+ destPath: ""
36
+ }
37
+ ],
38
+ "www.wixgateway.com": [
39
+ {
40
+ srcPath: "/_api/metro-inspector",
41
+ destPath: "/api"
42
+ }
43
+ ],
44
+ _: [
45
+ {
46
+ srcPath: "/_api/metro-inspector",
47
+ destPath: "/api"
48
+ }
49
+ ],
50
+ "www.wixapis.com": [
51
+ {
52
+ srcPath: "/_api/metro-inspector",
53
+ destPath: "/api"
54
+ },
55
+ {
56
+ srcPath: "/metro-inspector",
57
+ destPath: ""
58
+ }
59
+ ],
60
+ "editor._base_domain_": [
61
+ {
62
+ srcPath: "/metro-insepctor",
63
+ destPath: ""
64
+ },
65
+ {
66
+ srcPath: "/_api/metro-inspector",
67
+ destPath: "/api"
68
+ }
69
+ ],
70
+ "blocks._base_domain_": [
71
+ {
72
+ srcPath: "/metro-insepctor",
73
+ destPath: ""
74
+ },
75
+ {
76
+ srcPath: "/_api/metro-inspector",
77
+ destPath: "/api"
78
+ }
79
+ ],
80
+ "create.editorx": [
81
+ {
82
+ srcPath: "/metro-insepctor",
83
+ destPath: ""
84
+ },
85
+ {
86
+ srcPath: "/_api/metro-inspector",
87
+ destPath: "/api"
88
+ }
89
+ ]
90
+ };
91
+ return resolveUrl(Object.assign(opts, { domainToMappings }));
92
+ }
93
+ var PACKAGE_NAME = "@wix/auto_sdk_motion_metroinspector";
94
+ function echo(payload) {
95
+ function __echo({ host }) {
96
+ const serializedData = transformPaths(payload, [
97
+ {
98
+ transformFn: transformSDKTimestampToRESTTimestamp,
99
+ paths: [{ path: "someDate" }]
100
+ }
101
+ ]);
102
+ const metadata = {
103
+ entityFqdn: "wix.metroinspector.v1.echo",
104
+ method: "POST",
105
+ methodFqn: "wix.coreservices.metroinspector.v1.MetroInspectorService.Echo",
106
+ packageName: PACKAGE_NAME,
107
+ url: resolveWixCoreservicesMetroinspectorV1MetroInspectorServiceUrl({
108
+ protoPath: "/api/v1/echo/{arg1}",
109
+ data: serializedData,
110
+ host
111
+ }),
112
+ data: serializedData
113
+ };
114
+ return metadata;
115
+ }
116
+ return __echo;
117
+ }
118
+
119
+ // src/metroinspector-v1-echo-metroinspector.universal.ts
120
+ var WebhookIdentityType = /* @__PURE__ */ ((WebhookIdentityType2) => {
121
+ WebhookIdentityType2["UNKNOWN"] = "UNKNOWN";
122
+ WebhookIdentityType2["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
123
+ WebhookIdentityType2["MEMBER"] = "MEMBER";
124
+ WebhookIdentityType2["WIX_USER"] = "WIX_USER";
125
+ WebhookIdentityType2["APP"] = "APP";
126
+ return WebhookIdentityType2;
127
+ })(WebhookIdentityType || {});
128
+ async function echo2(arg1, options) {
129
+ const { httpClient, sideEffects } = arguments[2];
130
+ const payload = renameKeysFromSDKRequestToRESTRequest({
131
+ arg1,
132
+ arg2: options?.arg2,
133
+ titleField: options?.titleField,
134
+ someInt32: options?.someInt32,
135
+ someDate: options?.someDate
136
+ });
137
+ const reqOpts = echo(payload);
138
+ sideEffects?.onSiteCall?.();
139
+ try {
140
+ const result = await httpClient.request(reqOpts);
141
+ sideEffects?.onSuccess?.(result);
142
+ return renameKeysFromRESTResponseToSDKResponse(result.data)?.message;
143
+ } catch (err) {
144
+ const transformedError = sdkTransformError(
145
+ err,
146
+ {
147
+ spreadPathsToArguments: {},
148
+ explicitPathsToArguments: {
149
+ arg1: "$[0]",
150
+ arg2: "$[1].arg2",
151
+ titleField: "$[1].titleField",
152
+ someInt32: "$[1].someInt32",
153
+ someDate: "$[1].someDate"
154
+ },
155
+ singleArgumentUnchanged: false
156
+ },
157
+ ["arg1", "options"]
158
+ );
159
+ sideEffects?.onError?.(err);
160
+ throw transformedError;
161
+ }
162
+ }
163
+ export {
164
+ WebhookIdentityType,
165
+ echo2 as echo
166
+ };
167
+ //# sourceMappingURL=index.typings.mjs.map