@wix/auto_sdk_echo_metroinspector 1.0.4 → 1.0.6
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/index.d.ts +1 -1
- package/build/cjs/index.js +9 -0
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/index.typings.js +9 -0
- package/build/cjs/index.typings.js.map +1 -1
- package/build/cjs/meta.d.ts +141 -1
- package/build/cjs/meta.js +21 -0
- package/build/cjs/meta.js.map +1 -1
- package/build/es/index.d.mts +1 -1
- package/build/es/index.mjs +9 -0
- package/build/es/index.mjs.map +1 -1
- package/build/es/index.typings.mjs +9 -0
- package/build/es/index.typings.mjs.map +1 -1
- package/build/es/meta.d.mts +141 -1
- package/build/es/meta.mjs +20 -0
- package/build/es/meta.mjs.map +1 -1
- package/build/internal/cjs/index.d.ts +1 -1
- package/build/internal/cjs/index.js +9 -0
- package/build/internal/cjs/index.js.map +1 -1
- package/build/internal/cjs/index.typings.js +9 -0
- package/build/internal/cjs/index.typings.js.map +1 -1
- package/build/internal/cjs/meta.d.ts +141 -1
- package/build/internal/cjs/meta.js +21 -0
- package/build/internal/cjs/meta.js.map +1 -1
- package/build/internal/es/index.d.mts +1 -1
- package/build/internal/es/index.mjs +9 -0
- package/build/internal/es/index.mjs.map +1 -1
- package/build/internal/es/index.typings.mjs +9 -0
- package/build/internal/es/index.typings.mjs.map +1 -1
- package/build/internal/es/meta.d.mts +141 -1
- package/build/internal/es/meta.mjs +20 -0
- package/build/internal/es/meta.mjs.map +1 -1
- package/package.json +3 -3
package/build/cjs/index.d.ts
CHANGED
|
@@ -18,6 +18,6 @@ declare const echo: MaybeContext<BuildRESTFunction<typeof echo$1> & typeof echo$
|
|
|
18
18
|
/**
|
|
19
19
|
* echo event that might be consumed when somone says something!
|
|
20
20
|
*/
|
|
21
|
-
declare const onEchoDispatched: BuildEventDefinition<typeof onEchoDispatched$1
|
|
21
|
+
declare const onEchoDispatched: BuildEventDefinition<typeof onEchoDispatched$1> & typeof onEchoDispatched$1;
|
|
22
22
|
|
|
23
23
|
export { EchoDispatchedEnvelope, EchoOptions, echo, onEchoDispatched };
|
package/build/cjs/index.js
CHANGED
|
@@ -117,6 +117,12 @@ function resolveWixCoreservicesMetroinspectorV1MetroInspectorServiceUrl(opts) {
|
|
|
117
117
|
srcPath: "/_api/metro-inspector",
|
|
118
118
|
destPath: "/api"
|
|
119
119
|
}
|
|
120
|
+
],
|
|
121
|
+
"dev._base_domain_": [
|
|
122
|
+
{
|
|
123
|
+
srcPath: "/_api/metro-inspector",
|
|
124
|
+
destPath: ""
|
|
125
|
+
}
|
|
120
126
|
]
|
|
121
127
|
};
|
|
122
128
|
return (0, import_rest_modules.resolveUrl)(Object.assign(opts, { domainToMappings }));
|
|
@@ -135,6 +141,9 @@ function echo(payload) {
|
|
|
135
141
|
method: "POST",
|
|
136
142
|
methodFqn: "wix.coreservices.metroinspector.v1.MetroInspectorService.Echo",
|
|
137
143
|
packageName: PACKAGE_NAME,
|
|
144
|
+
migrationOptions: {
|
|
145
|
+
optInTransformResponse: true
|
|
146
|
+
},
|
|
138
147
|
url: resolveWixCoreservicesMetroinspectorV1MetroInspectorServiceUrl({
|
|
139
148
|
protoPath: "/api/v1/echo/{arg1}",
|
|
140
149
|
data: serializedData,
|
package/build/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../index.ts","../../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":["export * from './src/metroinspector-v1-echo-metroinspector.context.js';\n","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/echo' };\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 * Another override description function 4\n * @param - 1st part of the message\n * @param - modified comment for arg2 el hovav\n * @returns ## override return 4\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 /**\n * override EchoResponse.echoMessage\n *\n */\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 * Another override description function 4\n * @param arg1 - 1st part of the message\n * @public\n * @requiredField arg1\n * @param arg2 - modified comment for arg2 el hovav\n * @returns ## override return 4\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_echo_metroinspector';\n\n/** Another override description function 4 */\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":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA,cAAAA;AAAA,EAAA,wBAAAC;AAAA;AAAA;;;ACAA,IAAAC,iCAAwD;AACxD,IAAAC,oBAAqD;AACrD,IAAAC,0BAA+B;AAC/B,uBAA4C;;;ACH5C,6BAAoD;AACpD,oCAGO;;;ACJP,uBAAqD;AACrD,6BAA+B;AAC/B,0BAA2B;AAI3B,SAAS,+DACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,sBAAsB;AAAA,MACpB;AAAA,QAC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MACA,CAAC,QAAQ,SAAS;AAAA,IACpB;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;;;AD7SO,SAASC,MAAK,YAAuC;AAC1D,SAAO,CAAC,MAAc,YACpBA;AAAA,IACE;AAAA,IACA;AAAA;AAAA,IAEA,EAAE,WAAW;AAAA,EACf;AACJ;AAYO,IAAM,uBAAmB;AAAA,EAC9B;AAAA,EACA;AAAA,EACA,CAAC,cACC;AAAA,QACE,wCAAe,OAAO;AAAA,MACpB;AAAA,QACE,aAAa;AAAA,QACb,OAAO,CAAC,EAAE,MAAM,qBAAqB,CAAC;AAAA,MACxC;AAAA,IACF,CAAC;AAAA,EACH;AACJ,EAA0B;;;AG3C1B,IAAAC,uBAAiC;AACjC,sCAAkC;AAQ3B,IAAMC,QAEK,2DAAiBA,KAAU;AAItC,IAAMC,wBAET,mDAAkB,gBAAsB;","names":["echo","onEchoDispatched","import_rename_all_nested_keys","import_timestamp","import_transform_paths","WebhookIdentityType","echo","sdkTransformError","echo","import_rest_modules","echo","onEchoDispatched"]}
|
|
1
|
+
{"version":3,"sources":["../../index.ts","../../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":["export * from './src/metroinspector-v1-echo-metroinspector.context.js';\n","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/echo' };\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 * Another override description function 4\n * @param - 1st part of the message\n * @param - modified comment for arg2 el hovav\n * @returns ## override return 4\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 /**\n * override EchoResponse.echoMessage\n *\n */\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 * Another override description function 4\n * @param arg1 - 1st part of the message\n * @public\n * @requiredField arg1\n * @param arg2 - modified comment for arg2 el hovav\n * @returns ## override return 4\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 'dev._base_domain_': [\n {\n srcPath: '/_api/metro-inspector',\n destPath: '',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_echo_metroinspector';\n\n/** Another override description function 4 */\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 migrationOptions: {\n optInTransformResponse: true,\n },\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> &\n typeof publicOnEchoDispatched = 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":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA,cAAAA;AAAA,EAAA,wBAAAC;AAAA;AAAA;;;ACAA,IAAAC,iCAAwD;AACxD,IAAAC,oBAAqD;AACrD,IAAAC,0BAA+B;AAC/B,uBAA4C;;;ACH5C,6BAAoD;AACpD,oCAGO;;;ACJP,uBAAqD;AACrD,6BAA+B;AAC/B,0BAA2B;AAI3B,SAAS,+DACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,sBAAsB;AAAA,MACpB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,yBAAyB;AAAA,MACvB;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UACX,UAAU;AAAA,QACZ;AAAA,QACA,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC,QAAQ,SAAS;AAAA,IACpB;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;;;AD7SO,SAASC,MAAK,YAAuC;AAC1D,SAAO,CAAC,MAAc,YACpBA;AAAA,IACE;AAAA,IACA;AAAA;AAAA,IAEA,EAAE,WAAW;AAAA,EACf;AACJ;AAYO,IAAM,uBAAmB;AAAA,EAC9B;AAAA,EACA;AAAA,EACA,CAAC,cACC;AAAA,QACE,wCAAe,OAAO;AAAA,MACpB;AAAA,QACE,aAAa;AAAA,QACb,OAAO,CAAC,EAAE,MAAM,qBAAqB,CAAC;AAAA,MACxC;AAAA,IACF,CAAC;AAAA,EACH;AACJ,EAA0B;;;AG3C1B,IAAAC,uBAAiC;AACjC,sCAAkC;AAQ3B,IAAMC,QAEK,2DAAiBA,KAAU;AAItC,IAAMC,wBAGqB,mDAAkB,gBAAsB;","names":["echo","onEchoDispatched","import_rename_all_nested_keys","import_timestamp","import_transform_paths","WebhookIdentityType","echo","sdkTransformError","echo","import_rest_modules","echo","onEchoDispatched"]}
|
|
@@ -110,6 +110,12 @@ function resolveWixCoreservicesMetroinspectorV1MetroInspectorServiceUrl(opts) {
|
|
|
110
110
|
srcPath: "/_api/metro-inspector",
|
|
111
111
|
destPath: "/api"
|
|
112
112
|
}
|
|
113
|
+
],
|
|
114
|
+
"dev._base_domain_": [
|
|
115
|
+
{
|
|
116
|
+
srcPath: "/_api/metro-inspector",
|
|
117
|
+
destPath: ""
|
|
118
|
+
}
|
|
113
119
|
]
|
|
114
120
|
};
|
|
115
121
|
return (0, import_rest_modules.resolveUrl)(Object.assign(opts, { domainToMappings }));
|
|
@@ -128,6 +134,9 @@ function echo(payload) {
|
|
|
128
134
|
method: "POST",
|
|
129
135
|
methodFqn: "wix.coreservices.metroinspector.v1.MetroInspectorService.Echo",
|
|
130
136
|
packageName: PACKAGE_NAME,
|
|
137
|
+
migrationOptions: {
|
|
138
|
+
optInTransformResponse: true
|
|
139
|
+
},
|
|
131
140
|
url: resolveWixCoreservicesMetroinspectorV1MetroInspectorServiceUrl({
|
|
132
141
|
protoPath: "/api/v1/echo/{arg1}",
|
|
133
142
|
data: serializedData,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../index.typings.ts","../../src/metroinspector-v1-echo-metroinspector.universal.ts","../../src/metroinspector-v1-echo-metroinspector.http.ts"],"sourcesContent":["export * from './src/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 /**\n * override EchoResponse.echoMessage\n *\n */\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 * Another override description function 4\n * @param arg1 - 1st part of the message\n * @public\n * @requiredField arg1\n * @param arg2 - modified comment for arg2 el hovav\n * @returns ## override return 4\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_echo_metroinspector';\n\n/** Another override description function 4 */\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"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA,cAAAA;AAAA;AAAA;;;ACAA,6BAAoD;AACpD,oCAGO;;;ACJP,uBAAqD;AACrD,6BAA+B;AAC/B,0BAA2B;AAI3B,SAAS,+DACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,sBAAsB;AAAA,MACpB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,yBAAyB;AAAA,MACvB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,qBAAqB;AAAA,MACnB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,wBAAwB;AAAA,MACtB;AAAA,QACE,SAAS;AAAA,QACT,U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,QACN;AAAA,MACF,CAAC;AAAA,MACD,MAAM;AAAA,IACR;AAEA,WAAO;AAAA,EACT;AAEA,SAAO;AACT;;;ADsDO,IAAK,sBAAL,kBAAKC,yBAAL;AACL,EAAAA,qBAAA,aAAU;AACV,EAAAA,qBAAA,uBAAoB;AACpB,EAAAA,qBAAA,YAAS;AACT,EAAAA,qBAAA,cAAW;AACX,EAAAA,qBAAA,SAAM;AALI,SAAAA;AAAA,GAAA;AA6FZ,eAAsBC,MACpB,MACA,SACiB;AAEjB,QAAM,EAAE,YAAY,YAAY,IAAI,UAAU,CAAC;AAK/C,QAAM,cAAU,qEAAsC;AAAA,IACpD;AAAA,IACA,MAAM,SAAS;AAAA,IACf,YAAY,SAAS;AAAA,IACrB,WAAW,SAAS;AAAA,IACpB,UAAU,SAAS;AAAA,EACrB,CAAC;AAED,QAAM,UAA4C,KAAK,OAAO;AAE9D,eAAa,aAAa;AAC1B,MAAI;AACF,UAAM,SAAS,MAAM,WAAW,QAAQ,OAAO;AAC/C,iBAAa,YAAY,MAAM;AAE/B,eAAO,uEAAwC,OAAO,IAAI,GAAG;AAAA,EAC/D,SAAS,KAAU;AACjB,UAAM,uBAAmB,uBAAAC;AAAA,MACvB;AAAA,MACA;AAAA,QACE,wBAAwB,CAAC;AAAA,QACzB,0BAA0B;AAAA,UACxB,MAAM;AAAA,UACN,MAAM;AAAA,UACN,YAAY;AAAA,UACZ,WAAW;AAAA,UACX,UAAU;AAAA,QACZ;AAAA,QACA,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC,QAAQ,SAAS;AAAA,IACpB;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;","names":["echo","WebhookIdentityType","echo","sdkTransformError"]}
|
|
1
|
+
{"version":3,"sources":["../../index.typings.ts","../../src/metroinspector-v1-echo-metroinspector.universal.ts","../../src/metroinspector-v1-echo-metroinspector.http.ts"],"sourcesContent":["export * from './src/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 /**\n * override EchoResponse.echoMessage\n *\n */\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 * Another override description function 4\n * @param arg1 - 1st part of the message\n * @public\n * @requiredField arg1\n * @param arg2 - modified comment for arg2 el hovav\n * @returns ## override return 4\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 'dev._base_domain_': [\n {\n srcPath: '/_api/metro-inspector',\n destPath: '',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_echo_metroinspector';\n\n/** Another override description function 4 */\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 migrationOptions: {\n optInTransformResponse: true,\n },\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"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA,cAAAA;AAAA;AAAA;;;ACAA,6BAAoD;AACpD,oCAGO;;;ACJP,uBAAqD;AACrD,6BAA+B;AAC/B,0BAA2B;AAI3B,SAAS,+DACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,sBAAsB;AAAA,MACpB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,yBAAyB;AAAA,MACvB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,qBAAqB;AAAA,MACnB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,wBAAwB;AAAA,MACtB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,sBAAsB;AAAA,MACpB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,GAAG;AAAA,MACD;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,mBAAmB;AAAA,MACjB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;A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AL;AACL,EAAAA,qBAAA,aAAU;AACV,EAAAA,qBAAA,uBAAoB;AACpB,EAAAA,qBAAA,YAAS;AACT,EAAAA,qBAAA,cAAW;AACX,EAAAA,qBAAA,SAAM;AALI,SAAAA;AAAA,GAAA;AA6FZ,eAAsBC,MACpB,MACA,SACiB;AAEjB,QAAM,EAAE,YAAY,YAAY,IAAI,UAAU,CAAC;AAK/C,QAAM,cAAU,qEAAsC;AAAA,IACpD;AAAA,IACA,MAAM,SAAS;AAAA,IACf,YAAY,SAAS;AAAA,IACrB,WAAW,SAAS;AAAA,IACpB,UAAU,SAAS;AAAA,EACrB,CAAC;AAED,QAAM,UAA4C,KAAK,OAAO;AAE9D,eAAa,aAAa;AAC1B,MAAI;AACF,UAAM,SAAS,MAAM,WAAW,QAAQ,OAAO;AAC/C,iBAAa,YAAY,MAAM;AAE/B,eAAO,uEAAwC,OAAO,IAAI,GAAG;AAAA,EAC/D,SAAS,KAAU;AACjB,UAAM,uBAAmB,uBAAAC;AAAA,MACvB;AAAA,MACA;AAAA,QACE,wBAAwB,CAAC;AAAA,QACzB,0BAA0B;AAAA,UACxB,MAAM;AAAA,UACN,MAAM;AAAA,UACN,YAAY;AAAA,UACZ,WAAW;AAAA,UACX,UAAU;AAAA,QACZ;AAAA,QACA,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC,QAAQ,SAAS;AAAA,IACpB;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;","names":["echo","WebhookIdentityType","echo","sdkTransformError"]}
|
package/build/cjs/meta.d.ts
CHANGED
|
@@ -27,6 +27,146 @@ interface EchoResponse {
|
|
|
27
27
|
/** messge reseult as string */
|
|
28
28
|
message?: string;
|
|
29
29
|
}
|
|
30
|
+
interface Dispatched {
|
|
31
|
+
/** the message someone says */
|
|
32
|
+
echo?: EchoMessage;
|
|
33
|
+
}
|
|
34
|
+
interface DomainEvent extends DomainEventBodyOneOf {
|
|
35
|
+
createdEvent?: EntityCreatedEvent;
|
|
36
|
+
updatedEvent?: EntityUpdatedEvent;
|
|
37
|
+
deletedEvent?: EntityDeletedEvent;
|
|
38
|
+
actionEvent?: ActionEvent;
|
|
39
|
+
/** Event ID. With this ID you can easily spot duplicated events and ignore them. */
|
|
40
|
+
id?: string;
|
|
41
|
+
/**
|
|
42
|
+
* Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities.
|
|
43
|
+
* For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`.
|
|
44
|
+
*/
|
|
45
|
+
entityFqdn?: string;
|
|
46
|
+
/**
|
|
47
|
+
* Event action name, placed at the top level to make it easier for users to dispatch messages.
|
|
48
|
+
* For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`.
|
|
49
|
+
*/
|
|
50
|
+
slug?: string;
|
|
51
|
+
/** ID of the entity associated with the event. */
|
|
52
|
+
entityId?: string;
|
|
53
|
+
/** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */
|
|
54
|
+
eventTime?: Date | null;
|
|
55
|
+
/**
|
|
56
|
+
* Whether the event was triggered as a result of a privacy regulation application
|
|
57
|
+
* (for example, GDPR).
|
|
58
|
+
*/
|
|
59
|
+
triggeredByAnonymizeRequest?: boolean | null;
|
|
60
|
+
/** If present, indicates the action that triggered the event. */
|
|
61
|
+
originatedFrom?: string | null;
|
|
62
|
+
/**
|
|
63
|
+
* 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.
|
|
64
|
+
* 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.
|
|
65
|
+
*/
|
|
66
|
+
entityEventSequence?: string | null;
|
|
67
|
+
}
|
|
68
|
+
/** @oneof */
|
|
69
|
+
interface DomainEventBodyOneOf {
|
|
70
|
+
createdEvent?: EntityCreatedEvent;
|
|
71
|
+
updatedEvent?: EntityUpdatedEvent;
|
|
72
|
+
deletedEvent?: EntityDeletedEvent;
|
|
73
|
+
actionEvent?: ActionEvent;
|
|
74
|
+
}
|
|
75
|
+
interface EntityCreatedEvent {
|
|
76
|
+
entityAsJson?: string;
|
|
77
|
+
/** Indicates the event was triggered by a restore-from-trashbin operation for a previously deleted entity */
|
|
78
|
+
restoreInfo?: RestoreInfo;
|
|
79
|
+
}
|
|
80
|
+
interface RestoreInfo {
|
|
81
|
+
deletedDate?: Date | null;
|
|
82
|
+
}
|
|
83
|
+
interface EntityUpdatedEvent {
|
|
84
|
+
/**
|
|
85
|
+
* Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.
|
|
86
|
+
* This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.
|
|
87
|
+
* We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.
|
|
88
|
+
*/
|
|
89
|
+
currentEntityAsJson?: string;
|
|
90
|
+
}
|
|
91
|
+
interface EntityDeletedEvent {
|
|
92
|
+
/** Entity that was deleted. */
|
|
93
|
+
deletedEntityAsJson?: string | null;
|
|
94
|
+
}
|
|
95
|
+
interface ActionEvent {
|
|
96
|
+
bodyAsJson?: string;
|
|
97
|
+
}
|
|
98
|
+
interface MessageEnvelope {
|
|
99
|
+
/**
|
|
100
|
+
* App instance ID.
|
|
101
|
+
* @format GUID
|
|
102
|
+
*/
|
|
103
|
+
instanceId?: string | null;
|
|
104
|
+
/**
|
|
105
|
+
* Event type.
|
|
106
|
+
* @maxLength 150
|
|
107
|
+
*/
|
|
108
|
+
eventType?: string;
|
|
109
|
+
/** The identification type and identity data. */
|
|
110
|
+
identity?: IdentificationData;
|
|
111
|
+
/** Stringify payload. */
|
|
112
|
+
data?: string;
|
|
113
|
+
}
|
|
114
|
+
interface IdentificationData extends IdentificationDataIdOneOf {
|
|
115
|
+
/**
|
|
116
|
+
* ID of a site visitor that has not logged in to the site.
|
|
117
|
+
* @format GUID
|
|
118
|
+
*/
|
|
119
|
+
anonymousVisitorId?: string;
|
|
120
|
+
/**
|
|
121
|
+
* ID of a site visitor that has logged in to the site.
|
|
122
|
+
* @format GUID
|
|
123
|
+
*/
|
|
124
|
+
memberId?: string;
|
|
125
|
+
/**
|
|
126
|
+
* ID of a Wix user (site owner, contributor, etc.).
|
|
127
|
+
* @format GUID
|
|
128
|
+
*/
|
|
129
|
+
wixUserId?: string;
|
|
130
|
+
/**
|
|
131
|
+
* ID of an app.
|
|
132
|
+
* @format GUID
|
|
133
|
+
*/
|
|
134
|
+
appId?: string;
|
|
135
|
+
/** @readonly */
|
|
136
|
+
identityType?: WebhookIdentityTypeWithLiterals;
|
|
137
|
+
}
|
|
138
|
+
/** @oneof */
|
|
139
|
+
interface IdentificationDataIdOneOf {
|
|
140
|
+
/**
|
|
141
|
+
* ID of a site visitor that has not logged in to the site.
|
|
142
|
+
* @format GUID
|
|
143
|
+
*/
|
|
144
|
+
anonymousVisitorId?: string;
|
|
145
|
+
/**
|
|
146
|
+
* ID of a site visitor that has logged in to the site.
|
|
147
|
+
* @format GUID
|
|
148
|
+
*/
|
|
149
|
+
memberId?: string;
|
|
150
|
+
/**
|
|
151
|
+
* ID of a Wix user (site owner, contributor, etc.).
|
|
152
|
+
* @format GUID
|
|
153
|
+
*/
|
|
154
|
+
wixUserId?: string;
|
|
155
|
+
/**
|
|
156
|
+
* ID of an app.
|
|
157
|
+
* @format GUID
|
|
158
|
+
*/
|
|
159
|
+
appId?: string;
|
|
160
|
+
}
|
|
161
|
+
declare enum WebhookIdentityType {
|
|
162
|
+
UNKNOWN = "UNKNOWN",
|
|
163
|
+
ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR",
|
|
164
|
+
MEMBER = "MEMBER",
|
|
165
|
+
WIX_USER = "WIX_USER",
|
|
166
|
+
APP = "APP"
|
|
167
|
+
}
|
|
168
|
+
/** @enumType */
|
|
169
|
+
type WebhookIdentityTypeWithLiterals = WebhookIdentityType | 'UNKNOWN' | 'ANONYMOUS_VISITOR' | 'MEMBER' | 'WIX_USER' | 'APP';
|
|
30
170
|
|
|
31
171
|
type __PublicMethodMetaInfo<K = string, M = unknown, T = unknown, S = unknown, Q = unknown, R = unknown> = {
|
|
32
172
|
getUrl: (context: any) => string;
|
|
@@ -42,4 +182,4 @@ declare function echo(): __PublicMethodMetaInfo<'POST', {
|
|
|
42
182
|
arg1: string;
|
|
43
183
|
}, EchoRequest$1, EchoRequest, EchoResponse$1, EchoResponse>;
|
|
44
184
|
|
|
45
|
-
export { type __PublicMethodMetaInfo, echo };
|
|
185
|
+
export { type ActionEvent as ActionEventOriginal, type Dispatched as DispatchedOriginal, type DomainEventBodyOneOf as DomainEventBodyOneOfOriginal, type DomainEvent as DomainEventOriginal, type EchoMessage as EchoMessageOriginal, type EchoRequest as EchoRequestOriginal, type EchoResponse as EchoResponseOriginal, type EntityCreatedEvent as EntityCreatedEventOriginal, type EntityDeletedEvent as EntityDeletedEventOriginal, type EntityUpdatedEvent as EntityUpdatedEventOriginal, type IdentificationDataIdOneOf as IdentificationDataIdOneOfOriginal, type IdentificationData as IdentificationDataOriginal, type MessageEnvelope as MessageEnvelopeOriginal, type MessageItem as MessageItemOriginal, type RestoreInfo as RestoreInfoOriginal, WebhookIdentityType as WebhookIdentityTypeOriginal, type WebhookIdentityTypeWithLiterals as WebhookIdentityTypeWithLiteralsOriginal, type __PublicMethodMetaInfo, echo };
|
package/build/cjs/meta.js
CHANGED
|
@@ -20,6 +20,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
20
20
|
// meta.ts
|
|
21
21
|
var meta_exports = {};
|
|
22
22
|
__export(meta_exports, {
|
|
23
|
+
WebhookIdentityTypeOriginal: () => WebhookIdentityType,
|
|
23
24
|
echo: () => echo2
|
|
24
25
|
});
|
|
25
26
|
module.exports = __toCommonJS(meta_exports);
|
|
@@ -105,6 +106,12 @@ function resolveWixCoreservicesMetroinspectorV1MetroInspectorServiceUrl(opts) {
|
|
|
105
106
|
srcPath: "/_api/metro-inspector",
|
|
106
107
|
destPath: "/api"
|
|
107
108
|
}
|
|
109
|
+
],
|
|
110
|
+
"dev._base_domain_": [
|
|
111
|
+
{
|
|
112
|
+
srcPath: "/_api/metro-inspector",
|
|
113
|
+
destPath: ""
|
|
114
|
+
}
|
|
108
115
|
]
|
|
109
116
|
};
|
|
110
117
|
return (0, import_rest_modules.resolveUrl)(Object.assign(opts, { domainToMappings }));
|
|
@@ -123,6 +130,9 @@ function echo(payload) {
|
|
|
123
130
|
method: "POST",
|
|
124
131
|
methodFqn: "wix.coreservices.metroinspector.v1.MetroInspectorService.Echo",
|
|
125
132
|
packageName: PACKAGE_NAME,
|
|
133
|
+
migrationOptions: {
|
|
134
|
+
optInTransformResponse: true
|
|
135
|
+
},
|
|
126
136
|
url: resolveWixCoreservicesMetroinspectorV1MetroInspectorServiceUrl({
|
|
127
137
|
protoPath: "/api/v1/echo/{arg1}",
|
|
128
138
|
data: serializedData,
|
|
@@ -135,6 +145,16 @@ function echo(payload) {
|
|
|
135
145
|
return __echo;
|
|
136
146
|
}
|
|
137
147
|
|
|
148
|
+
// src/metroinspector-v1-echo-metroinspector.types.ts
|
|
149
|
+
var WebhookIdentityType = /* @__PURE__ */ ((WebhookIdentityType2) => {
|
|
150
|
+
WebhookIdentityType2["UNKNOWN"] = "UNKNOWN";
|
|
151
|
+
WebhookIdentityType2["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
|
|
152
|
+
WebhookIdentityType2["MEMBER"] = "MEMBER";
|
|
153
|
+
WebhookIdentityType2["WIX_USER"] = "WIX_USER";
|
|
154
|
+
WebhookIdentityType2["APP"] = "APP";
|
|
155
|
+
return WebhookIdentityType2;
|
|
156
|
+
})(WebhookIdentityType || {});
|
|
157
|
+
|
|
138
158
|
// src/metroinspector-v1-echo-metroinspector.meta.ts
|
|
139
159
|
function echo2() {
|
|
140
160
|
const payload = { arg1: ":arg1" };
|
|
@@ -156,6 +176,7 @@ function echo2() {
|
|
|
156
176
|
}
|
|
157
177
|
// Annotate the CommonJS export names for ESM import in node:
|
|
158
178
|
0 && (module.exports = {
|
|
179
|
+
WebhookIdentityTypeOriginal,
|
|
159
180
|
echo
|
|
160
181
|
});
|
|
161
182
|
//# sourceMappingURL=meta.js.map
|
package/build/cjs/meta.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../meta.ts","../../src/metroinspector-v1-echo-metroinspector.http.ts","../../src/metroinspector-v1-echo-metroinspector.meta.ts"],"sourcesContent":["export * from './src/metroinspector-v1-echo-metroinspector.meta.js';\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_echo_metroinspector';\n\n/** Another override description function 4 */\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 * as ambassadorWixMetroinspectorV1Echo from './metroinspector-v1-echo-metroinspector.http.js';\nimport * as ambassadorWixMetroinspectorV1EchoTypes from './metroinspector-v1-echo-metroinspector.types.js';\nimport * as ambassadorWixMetroinspectorV1EchoUniversalTypes from './metroinspector-v1-echo-metroinspector.universal.js';\n\nexport type __PublicMethodMetaInfo<\n K = string,\n M = unknown,\n T = unknown,\n S = unknown,\n Q = unknown,\n R = unknown\n> = {\n getUrl: (context: any) => string;\n httpMethod: K;\n path: string;\n pathParams: M;\n __requestType: T;\n __originalRequestType: S;\n __responseType: Q;\n __originalResponseType: R;\n};\n\nexport function echo(): __PublicMethodMetaInfo<\n 'POST',\n { arg1: string },\n ambassadorWixMetroinspectorV1EchoUniversalTypes.EchoRequest,\n ambassadorWixMetroinspectorV1EchoTypes.EchoRequest,\n ambassadorWixMetroinspectorV1EchoUniversalTypes.EchoResponse,\n ambassadorWixMetroinspectorV1EchoTypes.EchoResponse\n> {\n const payload = { arg1: ':arg1' } as any;\n\n const getRequestOptions = ambassadorWixMetroinspectorV1Echo.echo(payload);\n\n const getUrl = (context: any): string => {\n const { url } = getRequestOptions(context);\n return url!;\n };\n\n return {\n getUrl,\n httpMethod: 'POST',\n path: '/api/v1/echo/{arg1}',\n pathParams: { arg1: 'arg1' },\n __requestType: null as any,\n __originalRequestType: null as any,\n __responseType: null as any,\n __originalResponseType: null as any,\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,cAAAA;AAAA;AAAA;;;ACAA,uBAAqD;AACrD,6BAA+B;AAC/B,0BAA2B;AAI3B,SAAS,+DACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,sBAAsB;AAAA,MACpB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,yBAAyB;AAAA,MACvB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,qBAAqB;AAAA,MACnB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,wBAAwB;AAAA,MACtB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,sBAAsB;AAAA,MACpB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,GAAG;AAAA,MACD;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,mBAAmB;AAAA,MACjB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,wBAAwB;AAAA,MACtB;AAAA,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3B,eAAe;AAAA,IACf,uBAAuB;AAAA,IACvB,gBAAgB;AAAA,IAChB,wBAAwB;AAAA,EAC1B;AACF;","names":["echo","echo"]}
|
|
1
|
+
{"version":3,"sources":["../../meta.ts","../../src/metroinspector-v1-echo-metroinspector.http.ts","../../src/metroinspector-v1-echo-metroinspector.types.ts","../../src/metroinspector-v1-echo-metroinspector.meta.ts"],"sourcesContent":["export * from './src/metroinspector-v1-echo-metroinspector.meta.js';\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 'dev._base_domain_': [\n {\n srcPath: '/_api/metro-inspector',\n destPath: '',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_echo_metroinspector';\n\n/** Another override description function 4 */\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 migrationOptions: {\n optInTransformResponse: true,\n },\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","export interface EchoMessage {\n /** message comment from EchoMessage proto def, with special comment */\n message?: string;\n /** messages_list comment from EchoMessage proto def */\n messagesList?: MessageItem[];\n id?: string;\n}\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 entityAsJson?: string;\n /** Indicates the event was triggered by a restore-from-trashbin operation for a previously deleted entity */\n restoreInfo?: RestoreInfo;\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 currentEntityAsJson?: string;\n}\n\nexport interface EntityDeletedEvent {\n /** Entity that was deleted. */\n deletedEntityAsJson?: string | null;\n}\n\nexport interface ActionEvent {\n bodyAsJson?: 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","import * as ambassadorWixMetroinspectorV1Echo from './metroinspector-v1-echo-metroinspector.http.js';\nimport * as ambassadorWixMetroinspectorV1EchoTypes from './metroinspector-v1-echo-metroinspector.types.js';\nimport * as ambassadorWixMetroinspectorV1EchoUniversalTypes from './metroinspector-v1-echo-metroinspector.universal.js';\n\nexport type __PublicMethodMetaInfo<\n K = string,\n M = unknown,\n T = unknown,\n S = unknown,\n Q = unknown,\n R = unknown\n> = {\n getUrl: (context: any) => string;\n httpMethod: K;\n path: string;\n pathParams: M;\n __requestType: T;\n __originalRequestType: S;\n __responseType: Q;\n __originalResponseType: R;\n};\n\nexport function echo(): __PublicMethodMetaInfo<\n 'POST',\n { arg1: string },\n ambassadorWixMetroinspectorV1EchoUniversalTypes.EchoRequest,\n ambassadorWixMetroinspectorV1EchoTypes.EchoRequest,\n ambassadorWixMetroinspectorV1EchoUniversalTypes.EchoResponse,\n ambassadorWixMetroinspectorV1EchoTypes.EchoResponse\n> {\n const payload = { arg1: ':arg1' } as any;\n\n const getRequestOptions = ambassadorWixMetroinspectorV1Echo.echo(payload);\n\n const getUrl = (context: any): string => {\n const { url } = getRequestOptions(context);\n return url!;\n };\n\n return {\n getUrl,\n httpMethod: 'POST',\n path: '/api/v1/echo/{arg1}',\n pathParams: { arg1: 'arg1' },\n __requestType: null as any,\n __originalRequestType: null as any,\n __responseType: null as any,\n __originalResponseType: null as any,\n };\n}\n\nexport {\n EchoMessage as EchoMessageOriginal,\n MessageItem as MessageItemOriginal,\n EchoRequest as EchoRequestOriginal,\n EchoResponse as EchoResponseOriginal,\n Dispatched as DispatchedOriginal,\n DomainEvent as DomainEventOriginal,\n DomainEventBodyOneOf as DomainEventBodyOneOfOriginal,\n EntityCreatedEvent as EntityCreatedEventOriginal,\n RestoreInfo as RestoreInfoOriginal,\n EntityUpdatedEvent as EntityUpdatedEventOriginal,\n EntityDeletedEvent as EntityDeletedEventOriginal,\n ActionEvent as ActionEventOriginal,\n MessageEnvelope as MessageEnvelopeOriginal,\n IdentificationData as IdentificationDataOriginal,\n IdentificationDataIdOneOf as IdentificationDataIdOneOfOriginal,\n WebhookIdentityType as WebhookIdentityTypeOriginal,\n WebhookIdentityTypeWithLiterals as WebhookIdentityTypeWithLiteralsOriginal,\n} from './metroinspector-v1-echo-metroinspector.types.js';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA,cAAAA;AAAA;AAAA;;;ACAA,uBAAqD;AACrD,6BAA+B;AAC/B,0BAA2B;AAI3B,SAAS,+DACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,sBAAsB;AAAA,MACpB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,yBAAyB;AAAA,MACvB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,qBAAqB;AAAA,MACnB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,wBAAwB;AAAA,MACtB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,sBAAsB;AAAA,MACpB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,GAAG;AAAA,MACD;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,mBAAmB;AAAA,MACjB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,wBAAwB;AAAA,MACtB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,wBAAwB;AAAA,MACtB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,kBAAkB;AAAA,MAChB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AA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OAAO;AAAA,IAC3B,eAAe;AAAA,IACf,uBAAuB;AAAA,IACvB,gBAAgB;AAAA,IAChB,wBAAwB;AAAA,EAC1B;AACF;","names":["echo","WebhookIdentityType","echo"]}
|
package/build/es/index.d.mts
CHANGED
|
@@ -18,6 +18,6 @@ declare const echo: MaybeContext<BuildRESTFunction<typeof echo$1> & typeof echo$
|
|
|
18
18
|
/**
|
|
19
19
|
* echo event that might be consumed when somone says something!
|
|
20
20
|
*/
|
|
21
|
-
declare const onEchoDispatched: BuildEventDefinition<typeof onEchoDispatched$1
|
|
21
|
+
declare const onEchoDispatched: BuildEventDefinition<typeof onEchoDispatched$1> & typeof onEchoDispatched$1;
|
|
22
22
|
|
|
23
23
|
export { EchoDispatchedEnvelope, EchoOptions, echo, onEchoDispatched };
|
package/build/es/index.mjs
CHANGED
|
@@ -92,6 +92,12 @@ function resolveWixCoreservicesMetroinspectorV1MetroInspectorServiceUrl(opts) {
|
|
|
92
92
|
srcPath: "/_api/metro-inspector",
|
|
93
93
|
destPath: "/api"
|
|
94
94
|
}
|
|
95
|
+
],
|
|
96
|
+
"dev._base_domain_": [
|
|
97
|
+
{
|
|
98
|
+
srcPath: "/_api/metro-inspector",
|
|
99
|
+
destPath: ""
|
|
100
|
+
}
|
|
95
101
|
]
|
|
96
102
|
};
|
|
97
103
|
return resolveUrl(Object.assign(opts, { domainToMappings }));
|
|
@@ -110,6 +116,9 @@ function echo(payload) {
|
|
|
110
116
|
method: "POST",
|
|
111
117
|
methodFqn: "wix.coreservices.metroinspector.v1.MetroInspectorService.Echo",
|
|
112
118
|
packageName: PACKAGE_NAME,
|
|
119
|
+
migrationOptions: {
|
|
120
|
+
optInTransformResponse: true
|
|
121
|
+
},
|
|
113
122
|
url: resolveWixCoreservicesMetroinspectorV1MetroInspectorServiceUrl({
|
|
114
123
|
protoPath: "/api/v1/echo/{arg1}",
|
|
115
124
|
data: serializedData,
|