@wix/auto_sdk_duplexer_publisher 1.0.2 → 1.0.3

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.
@@ -31,7 +31,32 @@ var import_rename_all_nested_keys = require("@wix/sdk-runtime/rename-all-nested-
31
31
  // src/realtime-v4-message-publisher.http.ts
32
32
  var import_rest_modules = require("@wix/sdk-runtime/rest-modules");
33
33
  function resolveComWixRealtimeV4DuplexerApiV4Url(opts) {
34
- const domainToMappings = {};
34
+ const domainToMappings = {
35
+ "api._api_base_domain_": [
36
+ {
37
+ srcPath: "/wix-duplexer-api",
38
+ destPath: ""
39
+ }
40
+ ],
41
+ "www._base_domain_": [
42
+ {
43
+ srcPath: "/_api/wix-duplexer-api",
44
+ destPath: ""
45
+ }
46
+ ],
47
+ "manage._base_domain_": [
48
+ {
49
+ srcPath: "/_api/wix-duplexer-api",
50
+ destPath: ""
51
+ }
52
+ ],
53
+ "www.wixapis.com": [
54
+ {
55
+ srcPath: "/realtime/v4",
56
+ destPath: "/v4"
57
+ }
58
+ ]
59
+ };
35
60
  return (0, import_rest_modules.resolveUrl)(Object.assign(opts, { domainToMappings }));
36
61
  }
37
62
  var PACKAGE_NAME = "@wix/auto_sdk_duplexer_publisher";
@@ -1 +1 @@
1
- {"version":3,"sources":["../../index.ts","../../src/realtime-v4-message-publisher.universal.ts","../../src/realtime-v4-message-publisher.http.ts","../../src/realtime-v4-message-publisher.public.ts","../../src/realtime-v4-message-publisher.context.ts"],"sourcesContent":["export * from './src/realtime-v4-message-publisher.context.js';\n","import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport { renameKeysFromSDKRequestToRESTRequest } from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport * as ambassadorWixRealtimeV4Message from './realtime-v4-message-publisher.http.js';\n\nexport interface Message {\n /**\n * Unique message identifier\n * @readonly\n * @format GUID\n */\n _id?: string;\n /**\n * Event name, e.g \"product_added\"\n * @maxLength 1000\n */\n eventName?: string;\n /** Event payload, e.g { \"product_id\": \"123\", \"product_name\": \"Product 1\" } */\n payload?: Record<string, any> | null;\n /** Info regarding the publisher of the message */\n publisherInfo?: PublisherInfo;\n}\n\nexport interface PublisherInfo {\n /**\n * Arbitrary string identifier for the publisher, can be used by subscribers to identify the publisher\n * @maxLength 1000\n */\n uid?: string;\n}\n\nexport interface PublishRequest {\n message: Message;\n /**\n * Channel names to publish to, e.g [\"product_notifications\", \"site_notifications\"]\n * @maxSize 10\n * @maxLength 140\n */\n channels: string[];\n /**\n * Optional sub resource identifier, e.g \"important_notification\", only subscribers to this specific resource will receive the message\n * @maxLength 1000\n */\n resourceId?: string | null;\n}\n\nexport interface PublishResponse {}\n\nexport interface PublishToUserRequest\n extends PublishToUserRequestTargetingOneOf {\n /** list of user ids to receive the message */\n includeRecipients?: UserIdList;\n /** list of user ids to exclude from receiving the message */\n excludeRecipients?: UserIdList;\n message?: Message;\n /**\n * Optional sub resource identifier, e.g \"important_notification\", only subscribers to this specific resource will receive the message\n * @maxLength 1000\n */\n resourceId?: string | null;\n}\n\n/** @oneof */\nexport interface PublishToUserRequestTargetingOneOf {\n /** list of user ids to receive the message */\n includeRecipients?: UserIdList;\n /** list of user ids to exclude from receiving the message */\n excludeRecipients?: UserIdList;\n}\n\nexport interface UserIdList {\n /**\n * @maxSize 1000\n * @maxLength 1000\n */\n userId?: string[];\n}\n\nexport interface PublishToUserResponse {}\n\n/** @public\n * @requiredField message\n * @requiredField message.eventName\n * @requiredField message.payload\n * @requiredField options.channels\n * @permissionId realtime:v4:message:publish\n * @fqn com.wix.realtime.v4.DuplexerApiV4.Publish\n */\nexport async function publish(\n message: NonNullablePaths<Message, `eventName` | `payload`, 2>,\n options?: NonNullablePaths<PublishOptions, `channels`, 2>\n): Promise<void> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[2] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n message: message,\n channels: options?.channels,\n resourceId: options?.resourceId,\n });\n\n const reqOpts = ambassadorWixRealtimeV4Message.publish(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {\n message: '$[0]',\n channels: '$[1].channels',\n resourceId: '$[1].resourceId',\n },\n singleArgumentUnchanged: false,\n },\n ['message', 'options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface PublishOptions {\n /**\n * Channel names to publish to, e.g [\"product_notifications\", \"site_notifications\"]\n * @maxSize 10\n * @maxLength 140\n */\n channels: string[];\n /**\n * Optional sub resource identifier, e.g \"important_notification\", only subscribers to this specific resource will receive the message\n * @maxLength 1000\n */\n resourceId?: string | null;\n}\n","import { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveComWixRealtimeV4DuplexerApiV4Url(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {};\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_duplexer_publisher';\n\nexport function publish(payload: object): RequestOptionsFactory<any> {\n function __publish({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.realtime.v4.message',\n method: 'POST' as any,\n methodFqn: 'com.wix.realtime.v4.DuplexerApiV4.Publish',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveComWixRealtimeV4DuplexerApiV4Url({\n protoPath: '/publish',\n data: payload,\n host,\n }),\n data: payload,\n };\n\n return metadata;\n }\n\n return __publish;\n}\n","import { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport {\n Message,\n PublishOptions,\n publish as universalPublish,\n} from './realtime-v4-message-publisher.universal.js';\n\nexport const __metadata = { PACKAGE_NAME: '@wix/duplexer' };\n\nexport function publish(httpClient: HttpClient): PublishSignature {\n return (\n message: NonNullablePaths<Message, `eventName` | `payload`, 2>,\n options?: NonNullablePaths<PublishOptions, `channels`, 2>\n ) =>\n universalPublish(\n message,\n options,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface PublishSignature {\n /** */\n (\n message: NonNullablePaths<Message, `eventName` | `payload`, 2>,\n options?: NonNullablePaths<PublishOptions, `channels`, 2>\n ): Promise<void>;\n}\n\nexport {\n Message,\n PublishOptions,\n PublishRequest,\n PublishResponse,\n PublishToUserRequest,\n PublishToUserRequestTargetingOneOf,\n PublishToUserResponse,\n PublisherInfo,\n UserIdList,\n} from './realtime-v4-message-publisher.universal.js';\n","import { publish as publicPublish } from './realtime-v4-message-publisher.public.js';\nimport { createRESTModule } from '@wix/sdk-runtime/rest-modules';\nimport { BuildRESTFunction, MaybeContext } from '@wix/sdk-types';\n\nexport const publish: MaybeContext<\n BuildRESTFunction<typeof publicPublish> & typeof publicPublish\n> = /*#__PURE__*/ createRESTModule(publicPublish);\n\nexport {\n Message,\n PublisherInfo,\n PublishRequest,\n PublishResponse,\n PublishToUserRequest,\n PublishToUserRequestTargetingOneOf,\n UserIdList,\n PublishToUserResponse,\n PublishOptions,\n} from './realtime-v4-message-publisher.universal.js';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,iBAAAA;AAAA;AAAA;;;ACAA,6BAAoD;AACpD,oCAAsD;;;ACDtD,0BAA2B;AAI3B,SAAS,wCACP,MACA;AACA,QAAM,mBAAmB,CAAC;AAE1B,aAAO,gCAAW,OAAO,OAAO,MAAM,EAAE,iBAAiB,CAAC,CAAC;AAC7D;AAEA,IAAM,eAAe;AAEd,SAAS,QAAQ,SAA6C;AACnE,WAAS,UAAU,EAAE,KAAK,GAAQ;AAChC,UAAM,WAAW;AAAA,MACf,YAAY;AAAA,MACZ,QAAQ;AAAA,MACR,WAAW;AAAA,MACX,aAAa;AAAA,MACb,kBAAkB;AAAA,QAChB,wBAAwB;AAAA,MAC1B;AAAA,MACA,KAAK,wCAAwC;AAAA,QAC3C,WAAW;AAAA,QACX,MAAM;AAAA,QACN;AAAA,MACF,CAAC;AAAA,MACD,MAAM;AAAA,IACR;AAEA,WAAO;AAAA,EACT;AAEA,SAAO;AACT;;;ADoDA,eAAsBC,SACpB,SACA,SACe;AAEf,QAAM,EAAE,YAAY,YAAY,IAAI,UAAU,CAAC;AAK/C,QAAM,cAAU,qEAAsC;AAAA,IACpD;AAAA,IACA,UAAU,SAAS;AAAA,IACnB,YAAY,SAAS;AAAA,EACvB,CAAC;AAED,QAAM,UAAyC,QAAQ,OAAO;AAE9D,eAAa,aAAa;AAC1B,MAAI;AACF,UAAM,SAAS,MAAM,WAAW,QAAQ,OAAO;AAC/C,iBAAa,YAAY,MAAM;AAAA,EACjC,SAAS,KAAU;AACjB,UAAM,uBAAmB,uBAAAC;AAAA,MACvB;AAAA,MACA;AAAA,QACE,wBAAwB,CAAC;AAAA,QACzB,0BAA0B;AAAA,UACxB,SAAS;AAAA,UACT,UAAU;AAAA,UACV,YAAY;AAAA,QACd;AAAA,QACA,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC,WAAW,SAAS;AAAA,IACvB;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;;;AEvHO,SAASC,SAAQ,YAA0C;AAChE,SAAO,CACL,SACA,YAEAA;AAAA,IACE;AAAA,IACA;AAAA;AAAA,IAEA,EAAE,WAAW;AAAA,EACf;AACJ;;;ACnBA,IAAAC,uBAAiC;AAG1B,IAAMC,WAEK,2DAAiBA,QAAa;","names":["publish","publish","sdkTransformError","publish","import_rest_modules","publish"]}
1
+ {"version":3,"sources":["../../index.ts","../../src/realtime-v4-message-publisher.universal.ts","../../src/realtime-v4-message-publisher.http.ts","../../src/realtime-v4-message-publisher.public.ts","../../src/realtime-v4-message-publisher.context.ts"],"sourcesContent":["export * from './src/realtime-v4-message-publisher.context.js';\n","import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport { renameKeysFromSDKRequestToRESTRequest } from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport * as ambassadorWixRealtimeV4Message from './realtime-v4-message-publisher.http.js';\n\nexport interface Message {\n /**\n * Unique message identifier\n * @readonly\n * @format GUID\n */\n _id?: string;\n /**\n * Event name, e.g \"product_added\"\n * @maxLength 1000\n */\n eventName?: string;\n /** Event payload, e.g { \"product_id\": \"123\", \"product_name\": \"Product 1\" } */\n payload?: Record<string, any> | null;\n /** Info regarding the publisher of the message */\n publisherInfo?: PublisherInfo;\n}\n\nexport interface PublisherInfo {\n /**\n * Arbitrary string identifier for the publisher, can be used by subscribers to identify the publisher\n * @maxLength 1000\n */\n uid?: string;\n}\n\nexport interface PublishRequest {\n message: Message;\n /**\n * Channel names to publish to, e.g [\"product_notifications\", \"site_notifications\"]\n * @maxSize 10\n * @maxLength 140\n */\n channels: string[];\n /**\n * Optional sub resource identifier, e.g \"important_notification\", only subscribers to this specific resource will receive the message\n * @maxLength 1000\n */\n resourceId?: string | null;\n}\n\nexport interface PublishResponse {}\n\nexport interface PublishToUserRequest\n extends PublishToUserRequestTargetingOneOf {\n /** list of user ids to receive the message */\n includeRecipients?: UserIdList;\n /** list of user ids to exclude from receiving the message */\n excludeRecipients?: UserIdList;\n message?: Message;\n /**\n * Optional sub resource identifier, e.g \"important_notification\", only subscribers to this specific resource will receive the message\n * @maxLength 1000\n */\n resourceId?: string | null;\n}\n\n/** @oneof */\nexport interface PublishToUserRequestTargetingOneOf {\n /** list of user ids to receive the message */\n includeRecipients?: UserIdList;\n /** list of user ids to exclude from receiving the message */\n excludeRecipients?: UserIdList;\n}\n\nexport interface UserIdList {\n /**\n * @maxSize 1000\n * @maxLength 1000\n */\n userId?: string[];\n}\n\nexport interface PublishToUserResponse {}\n\n/** @public\n * @requiredField message\n * @requiredField message.eventName\n * @requiredField message.payload\n * @requiredField options.channels\n * @permissionId realtime:v4:message:publish\n * @fqn com.wix.realtime.v4.DuplexerApiV4.Publish\n */\nexport async function publish(\n message: NonNullablePaths<Message, `eventName` | `payload`, 2>,\n options?: NonNullablePaths<PublishOptions, `channels`, 2>\n): Promise<void> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[2] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n message: message,\n channels: options?.channels,\n resourceId: options?.resourceId,\n });\n\n const reqOpts = ambassadorWixRealtimeV4Message.publish(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {\n message: '$[0]',\n channels: '$[1].channels',\n resourceId: '$[1].resourceId',\n },\n singleArgumentUnchanged: false,\n },\n ['message', 'options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface PublishOptions {\n /**\n * Channel names to publish to, e.g [\"product_notifications\", \"site_notifications\"]\n * @maxSize 10\n * @maxLength 140\n */\n channels: string[];\n /**\n * Optional sub resource identifier, e.g \"important_notification\", only subscribers to this specific resource will receive the message\n * @maxLength 1000\n */\n resourceId?: string | null;\n}\n","import { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveComWixRealtimeV4DuplexerApiV4Url(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'api._api_base_domain_': [\n {\n srcPath: '/wix-duplexer-api',\n destPath: '',\n },\n ],\n 'www._base_domain_': [\n {\n srcPath: '/_api/wix-duplexer-api',\n destPath: '',\n },\n ],\n 'manage._base_domain_': [\n {\n srcPath: '/_api/wix-duplexer-api',\n destPath: '',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/realtime/v4',\n destPath: '/v4',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_duplexer_publisher';\n\nexport function publish(payload: object): RequestOptionsFactory<any> {\n function __publish({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.realtime.v4.message',\n method: 'POST' as any,\n methodFqn: 'com.wix.realtime.v4.DuplexerApiV4.Publish',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveComWixRealtimeV4DuplexerApiV4Url({\n protoPath: '/publish',\n data: payload,\n host,\n }),\n data: payload,\n };\n\n return metadata;\n }\n\n return __publish;\n}\n","import { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport {\n Message,\n PublishOptions,\n publish as universalPublish,\n} from './realtime-v4-message-publisher.universal.js';\n\nexport const __metadata = { PACKAGE_NAME: '@wix/duplexer' };\n\nexport function publish(httpClient: HttpClient): PublishSignature {\n return (\n message: NonNullablePaths<Message, `eventName` | `payload`, 2>,\n options?: NonNullablePaths<PublishOptions, `channels`, 2>\n ) =>\n universalPublish(\n message,\n options,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface PublishSignature {\n /** */\n (\n message: NonNullablePaths<Message, `eventName` | `payload`, 2>,\n options?: NonNullablePaths<PublishOptions, `channels`, 2>\n ): Promise<void>;\n}\n\nexport {\n Message,\n PublishOptions,\n PublishRequest,\n PublishResponse,\n PublishToUserRequest,\n PublishToUserRequestTargetingOneOf,\n PublishToUserResponse,\n PublisherInfo,\n UserIdList,\n} from './realtime-v4-message-publisher.universal.js';\n","import { publish as publicPublish } from './realtime-v4-message-publisher.public.js';\nimport { createRESTModule } from '@wix/sdk-runtime/rest-modules';\nimport { BuildRESTFunction, MaybeContext } from '@wix/sdk-types';\n\nexport const publish: MaybeContext<\n BuildRESTFunction<typeof publicPublish> & typeof publicPublish\n> = /*#__PURE__*/ createRESTModule(publicPublish);\n\nexport {\n Message,\n PublisherInfo,\n PublishRequest,\n PublishResponse,\n PublishToUserRequest,\n PublishToUserRequestTargetingOneOf,\n UserIdList,\n PublishToUserResponse,\n PublishOptions,\n} from './realtime-v4-message-publisher.universal.js';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,iBAAAA;AAAA;AAAA;;;ACAA,6BAAoD;AACpD,oCAAsD;;;ACDtD,0BAA2B;AAI3B,SAAS,wCACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,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,mBAAmB;AAAA,MACjB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,EACF;AAEA,aAAO,gCAAW,OAAO,OAAO,MAAM,EAAE,iBAAiB,CAAC,CAAC;AAC7D;AAEA,IAAM,eAAe;AAEd,SAAS,QAAQ,SAA6C;AACnE,WAAS,UAAU,EAAE,KAAK,GAAQ;AAChC,UAAM,WAAW;AAAA,MACf,YAAY;AAAA,MACZ,QAAQ;AAAA,MACR,WAAW;AAAA,MACX,aAAa;AAAA,MACb,kBAAkB;AAAA,QAChB,wBAAwB;AAAA,MAC1B;AAAA,MACA,KAAK,wCAAwC;AAAA,QAC3C,WAAW;AAAA,QACX,MAAM;AAAA,QACN;AAAA,MACF,CAAC;AAAA,MACD,MAAM;AAAA,IACR;AAEA,WAAO;AAAA,EACT;AAEA,SAAO;AACT;;;AD2BA,eAAsBC,SACpB,SACA,SACe;AAEf,QAAM,EAAE,YAAY,YAAY,IAAI,UAAU,CAAC;AAK/C,QAAM,cAAU,qEAAsC;AAAA,IACpD;AAAA,IACA,UAAU,SAAS;AAAA,IACnB,YAAY,SAAS;AAAA,EACvB,CAAC;AAED,QAAM,UAAyC,QAAQ,OAAO;AAE9D,eAAa,aAAa;AAC1B,MAAI;AACF,UAAM,SAAS,MAAM,WAAW,QAAQ,OAAO;AAC/C,iBAAa,YAAY,MAAM;AAAA,EACjC,SAAS,KAAU;AACjB,UAAM,uBAAmB,uBAAAC;AAAA,MACvB;AAAA,MACA;AAAA,QACE,wBAAwB,CAAC;AAAA,QACzB,0BAA0B;AAAA,UACxB,SAAS;AAAA,UACT,UAAU;AAAA,UACV,YAAY;AAAA,QACd;AAAA,QACA,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC,WAAW,SAAS;AAAA,IACvB;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;;;AEvHO,SAASC,SAAQ,YAA0C;AAChE,SAAO,CACL,SACA,YAEAA;AAAA,IACE;AAAA,IACA;AAAA;AAAA,IAEA,EAAE,WAAW;AAAA,EACf;AACJ;;;ACnBA,IAAAC,uBAAiC;AAG1B,IAAMC,WAEK,2DAAiBA,QAAa;","names":["publish","publish","sdkTransformError","publish","import_rest_modules","publish"]}
@@ -31,7 +31,32 @@ var import_rename_all_nested_keys = require("@wix/sdk-runtime/rename-all-nested-
31
31
  // src/realtime-v4-message-publisher.http.ts
32
32
  var import_rest_modules = require("@wix/sdk-runtime/rest-modules");
33
33
  function resolveComWixRealtimeV4DuplexerApiV4Url(opts) {
34
- const domainToMappings = {};
34
+ const domainToMappings = {
35
+ "api._api_base_domain_": [
36
+ {
37
+ srcPath: "/wix-duplexer-api",
38
+ destPath: ""
39
+ }
40
+ ],
41
+ "www._base_domain_": [
42
+ {
43
+ srcPath: "/_api/wix-duplexer-api",
44
+ destPath: ""
45
+ }
46
+ ],
47
+ "manage._base_domain_": [
48
+ {
49
+ srcPath: "/_api/wix-duplexer-api",
50
+ destPath: ""
51
+ }
52
+ ],
53
+ "www.wixapis.com": [
54
+ {
55
+ srcPath: "/realtime/v4",
56
+ destPath: "/v4"
57
+ }
58
+ ]
59
+ };
35
60
  return (0, import_rest_modules.resolveUrl)(Object.assign(opts, { domainToMappings }));
36
61
  }
37
62
  var PACKAGE_NAME = "@wix/auto_sdk_duplexer_publisher";
@@ -1 +1 @@
1
- {"version":3,"sources":["../../index.typings.ts","../../src/realtime-v4-message-publisher.universal.ts","../../src/realtime-v4-message-publisher.http.ts"],"sourcesContent":["export * from './src/realtime-v4-message-publisher.universal.js';\n","import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport { renameKeysFromSDKRequestToRESTRequest } from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport * as ambassadorWixRealtimeV4Message from './realtime-v4-message-publisher.http.js';\n\nexport interface Message {\n /**\n * Unique message identifier\n * @readonly\n * @format GUID\n */\n _id?: string;\n /**\n * Event name, e.g \"product_added\"\n * @maxLength 1000\n */\n eventName?: string;\n /** Event payload, e.g { \"product_id\": \"123\", \"product_name\": \"Product 1\" } */\n payload?: Record<string, any> | null;\n /** Info regarding the publisher of the message */\n publisherInfo?: PublisherInfo;\n}\n\nexport interface PublisherInfo {\n /**\n * Arbitrary string identifier for the publisher, can be used by subscribers to identify the publisher\n * @maxLength 1000\n */\n uid?: string;\n}\n\nexport interface PublishRequest {\n message: Message;\n /**\n * Channel names to publish to, e.g [\"product_notifications\", \"site_notifications\"]\n * @maxSize 10\n * @maxLength 140\n */\n channels: string[];\n /**\n * Optional sub resource identifier, e.g \"important_notification\", only subscribers to this specific resource will receive the message\n * @maxLength 1000\n */\n resourceId?: string | null;\n}\n\nexport interface PublishResponse {}\n\nexport interface PublishToUserRequest\n extends PublishToUserRequestTargetingOneOf {\n /** list of user ids to receive the message */\n includeRecipients?: UserIdList;\n /** list of user ids to exclude from receiving the message */\n excludeRecipients?: UserIdList;\n message?: Message;\n /**\n * Optional sub resource identifier, e.g \"important_notification\", only subscribers to this specific resource will receive the message\n * @maxLength 1000\n */\n resourceId?: string | null;\n}\n\n/** @oneof */\nexport interface PublishToUserRequestTargetingOneOf {\n /** list of user ids to receive the message */\n includeRecipients?: UserIdList;\n /** list of user ids to exclude from receiving the message */\n excludeRecipients?: UserIdList;\n}\n\nexport interface UserIdList {\n /**\n * @maxSize 1000\n * @maxLength 1000\n */\n userId?: string[];\n}\n\nexport interface PublishToUserResponse {}\n\n/** @public\n * @requiredField message\n * @requiredField message.eventName\n * @requiredField message.payload\n * @requiredField options.channels\n * @permissionId realtime:v4:message:publish\n * @fqn com.wix.realtime.v4.DuplexerApiV4.Publish\n */\nexport async function publish(\n message: NonNullablePaths<Message, `eventName` | `payload`, 2>,\n options?: NonNullablePaths<PublishOptions, `channels`, 2>\n): Promise<void> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[2] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n message: message,\n channels: options?.channels,\n resourceId: options?.resourceId,\n });\n\n const reqOpts = ambassadorWixRealtimeV4Message.publish(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {\n message: '$[0]',\n channels: '$[1].channels',\n resourceId: '$[1].resourceId',\n },\n singleArgumentUnchanged: false,\n },\n ['message', 'options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface PublishOptions {\n /**\n * Channel names to publish to, e.g [\"product_notifications\", \"site_notifications\"]\n * @maxSize 10\n * @maxLength 140\n */\n channels: string[];\n /**\n * Optional sub resource identifier, e.g \"important_notification\", only subscribers to this specific resource will receive the message\n * @maxLength 1000\n */\n resourceId?: string | null;\n}\n","import { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveComWixRealtimeV4DuplexerApiV4Url(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {};\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_duplexer_publisher';\n\nexport function publish(payload: object): RequestOptionsFactory<any> {\n function __publish({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.realtime.v4.message',\n method: 'POST' as any,\n methodFqn: 'com.wix.realtime.v4.DuplexerApiV4.Publish',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveComWixRealtimeV4DuplexerApiV4Url({\n protoPath: '/publish',\n data: payload,\n host,\n }),\n data: payload,\n };\n\n return metadata;\n }\n\n return __publish;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,iBAAAA;AAAA;AAAA;;;ACAA,6BAAoD;AACpD,oCAAsD;;;ACDtD,0BAA2B;AAI3B,SAAS,wCACP,MACA;AACA,QAAM,mBAAmB,CAAC;AAE1B,aAAO,gCAAW,OAAO,OAAO,MAAM,EAAE,iBAAiB,CAAC,CAAC;AAC7D;AAEA,IAAM,eAAe;AAEd,SAAS,QAAQ,SAA6C;AACnE,WAAS,UAAU,EAAE,KAAK,GAAQ;AAChC,UAAM,WAAW;AAAA,MACf,YAAY;AAAA,MACZ,QAAQ;AAAA,MACR,WAAW;AAAA,MACX,aAAa;AAAA,MACb,kBAAkB;AAAA,QAChB,wBAAwB;AAAA,MAC1B;AAAA,MACA,KAAK,wCAAwC;AAAA,QAC3C,WAAW;AAAA,QACX,MAAM;AAAA,QACN;AAAA,MACF,CAAC;AAAA,MACD,MAAM;AAAA,IACR;AAEA,WAAO;AAAA,EACT;AAEA,SAAO;AACT;;;ADoDA,eAAsBC,SACpB,SACA,SACe;AAEf,QAAM,EAAE,YAAY,YAAY,IAAI,UAAU,CAAC;AAK/C,QAAM,cAAU,qEAAsC;AAAA,IACpD;AAAA,IACA,UAAU,SAAS;AAAA,IACnB,YAAY,SAAS;AAAA,EACvB,CAAC;AAED,QAAM,UAAyC,QAAQ,OAAO;AAE9D,eAAa,aAAa;AAC1B,MAAI;AACF,UAAM,SAAS,MAAM,WAAW,QAAQ,OAAO;AAC/C,iBAAa,YAAY,MAAM;AAAA,EACjC,SAAS,KAAU;AACjB,UAAM,uBAAmB,uBAAAC;AAAA,MACvB;AAAA,MACA;AAAA,QACE,wBAAwB,CAAC;AAAA,QACzB,0BAA0B;AAAA,UACxB,SAAS;AAAA,UACT,UAAU;AAAA,UACV,YAAY;AAAA,QACd;AAAA,QACA,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC,WAAW,SAAS;AAAA,IACvB;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;","names":["publish","publish","sdkTransformError"]}
1
+ {"version":3,"sources":["../../index.typings.ts","../../src/realtime-v4-message-publisher.universal.ts","../../src/realtime-v4-message-publisher.http.ts"],"sourcesContent":["export * from './src/realtime-v4-message-publisher.universal.js';\n","import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport { renameKeysFromSDKRequestToRESTRequest } from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport * as ambassadorWixRealtimeV4Message from './realtime-v4-message-publisher.http.js';\n\nexport interface Message {\n /**\n * Unique message identifier\n * @readonly\n * @format GUID\n */\n _id?: string;\n /**\n * Event name, e.g \"product_added\"\n * @maxLength 1000\n */\n eventName?: string;\n /** Event payload, e.g { \"product_id\": \"123\", \"product_name\": \"Product 1\" } */\n payload?: Record<string, any> | null;\n /** Info regarding the publisher of the message */\n publisherInfo?: PublisherInfo;\n}\n\nexport interface PublisherInfo {\n /**\n * Arbitrary string identifier for the publisher, can be used by subscribers to identify the publisher\n * @maxLength 1000\n */\n uid?: string;\n}\n\nexport interface PublishRequest {\n message: Message;\n /**\n * Channel names to publish to, e.g [\"product_notifications\", \"site_notifications\"]\n * @maxSize 10\n * @maxLength 140\n */\n channels: string[];\n /**\n * Optional sub resource identifier, e.g \"important_notification\", only subscribers to this specific resource will receive the message\n * @maxLength 1000\n */\n resourceId?: string | null;\n}\n\nexport interface PublishResponse {}\n\nexport interface PublishToUserRequest\n extends PublishToUserRequestTargetingOneOf {\n /** list of user ids to receive the message */\n includeRecipients?: UserIdList;\n /** list of user ids to exclude from receiving the message */\n excludeRecipients?: UserIdList;\n message?: Message;\n /**\n * Optional sub resource identifier, e.g \"important_notification\", only subscribers to this specific resource will receive the message\n * @maxLength 1000\n */\n resourceId?: string | null;\n}\n\n/** @oneof */\nexport interface PublishToUserRequestTargetingOneOf {\n /** list of user ids to receive the message */\n includeRecipients?: UserIdList;\n /** list of user ids to exclude from receiving the message */\n excludeRecipients?: UserIdList;\n}\n\nexport interface UserIdList {\n /**\n * @maxSize 1000\n * @maxLength 1000\n */\n userId?: string[];\n}\n\nexport interface PublishToUserResponse {}\n\n/** @public\n * @requiredField message\n * @requiredField message.eventName\n * @requiredField message.payload\n * @requiredField options.channels\n * @permissionId realtime:v4:message:publish\n * @fqn com.wix.realtime.v4.DuplexerApiV4.Publish\n */\nexport async function publish(\n message: NonNullablePaths<Message, `eventName` | `payload`, 2>,\n options?: NonNullablePaths<PublishOptions, `channels`, 2>\n): Promise<void> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[2] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n message: message,\n channels: options?.channels,\n resourceId: options?.resourceId,\n });\n\n const reqOpts = ambassadorWixRealtimeV4Message.publish(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {\n message: '$[0]',\n channels: '$[1].channels',\n resourceId: '$[1].resourceId',\n },\n singleArgumentUnchanged: false,\n },\n ['message', 'options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface PublishOptions {\n /**\n * Channel names to publish to, e.g [\"product_notifications\", \"site_notifications\"]\n * @maxSize 10\n * @maxLength 140\n */\n channels: string[];\n /**\n * Optional sub resource identifier, e.g \"important_notification\", only subscribers to this specific resource will receive the message\n * @maxLength 1000\n */\n resourceId?: string | null;\n}\n","import { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveComWixRealtimeV4DuplexerApiV4Url(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'api._api_base_domain_': [\n {\n srcPath: '/wix-duplexer-api',\n destPath: '',\n },\n ],\n 'www._base_domain_': [\n {\n srcPath: '/_api/wix-duplexer-api',\n destPath: '',\n },\n ],\n 'manage._base_domain_': [\n {\n srcPath: '/_api/wix-duplexer-api',\n destPath: '',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/realtime/v4',\n destPath: '/v4',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_duplexer_publisher';\n\nexport function publish(payload: object): RequestOptionsFactory<any> {\n function __publish({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.realtime.v4.message',\n method: 'POST' as any,\n methodFqn: 'com.wix.realtime.v4.DuplexerApiV4.Publish',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveComWixRealtimeV4DuplexerApiV4Url({\n protoPath: '/publish',\n data: payload,\n host,\n }),\n data: payload,\n };\n\n return metadata;\n }\n\n return __publish;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,iBAAAA;AAAA;AAAA;;;ACAA,6BAAoD;AACpD,oCAAsD;;;ACDtD,0BAA2B;AAI3B,SAAS,wCACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,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,mBAAmB;AAAA,MACjB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,EACF;AAEA,aAAO,gCAAW,OAAO,OAAO,MAAM,EAAE,iBAAiB,CAAC,CAAC;AAC7D;AAEA,IAAM,eAAe;AAEd,SAAS,QAAQ,SAA6C;AACnE,WAAS,UAAU,EAAE,KAAK,GAAQ;AAChC,UAAM,WAAW;AAAA,MACf,YAAY;AAAA,MACZ,QAAQ;AAAA,MACR,WAAW;AAAA,MACX,aAAa;AAAA,MACb,kBAAkB;AAAA,QAChB,wBAAwB;AAAA,MAC1B;AAAA,MACA,KAAK,wCAAwC;AAAA,QAC3C,WAAW;AAAA,QACX,MAAM;AAAA,QACN;AAAA,MACF,CAAC;AAAA,MACD,MAAM;AAAA,IACR;AAEA,WAAO;AAAA,EACT;AAEA,SAAO;AACT;;;AD2BA,eAAsBC,SACpB,SACA,SACe;AAEf,QAAM,EAAE,YAAY,YAAY,IAAI,UAAU,CAAC;AAK/C,QAAM,cAAU,qEAAsC;AAAA,IACpD;AAAA,IACA,UAAU,SAAS;AAAA,IACnB,YAAY,SAAS;AAAA,EACvB,CAAC;AAED,QAAM,UAAyC,QAAQ,OAAO;AAE9D,eAAa,aAAa;AAC1B,MAAI;AACF,UAAM,SAAS,MAAM,WAAW,QAAQ,OAAO;AAC/C,iBAAa,YAAY,MAAM;AAAA,EACjC,SAAS,KAAU;AACjB,UAAM,uBAAmB,uBAAAC;AAAA,MACvB;AAAA,MACA;AAAA,QACE,wBAAwB,CAAC;AAAA,QACzB,0BAA0B;AAAA,UACxB,SAAS;AAAA,UACT,UAAU;AAAA,UACV,YAAY;AAAA,QACd;AAAA,QACA,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC,WAAW,SAAS;AAAA,IACvB;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;","names":["publish","publish","sdkTransformError"]}
package/build/cjs/meta.js CHANGED
@@ -27,7 +27,32 @@ module.exports = __toCommonJS(meta_exports);
27
27
  // src/realtime-v4-message-publisher.http.ts
28
28
  var import_rest_modules = require("@wix/sdk-runtime/rest-modules");
29
29
  function resolveComWixRealtimeV4DuplexerApiV4Url(opts) {
30
- const domainToMappings = {};
30
+ const domainToMappings = {
31
+ "api._api_base_domain_": [
32
+ {
33
+ srcPath: "/wix-duplexer-api",
34
+ destPath: ""
35
+ }
36
+ ],
37
+ "www._base_domain_": [
38
+ {
39
+ srcPath: "/_api/wix-duplexer-api",
40
+ destPath: ""
41
+ }
42
+ ],
43
+ "manage._base_domain_": [
44
+ {
45
+ srcPath: "/_api/wix-duplexer-api",
46
+ destPath: ""
47
+ }
48
+ ],
49
+ "www.wixapis.com": [
50
+ {
51
+ srcPath: "/realtime/v4",
52
+ destPath: "/v4"
53
+ }
54
+ ]
55
+ };
31
56
  return (0, import_rest_modules.resolveUrl)(Object.assign(opts, { domainToMappings }));
32
57
  }
33
58
  var PACKAGE_NAME = "@wix/auto_sdk_duplexer_publisher";
@@ -1 +1 @@
1
- {"version":3,"sources":["../../meta.ts","../../src/realtime-v4-message-publisher.http.ts","../../src/realtime-v4-message-publisher.meta.ts"],"sourcesContent":["export * from './src/realtime-v4-message-publisher.meta.js';\n","import { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveComWixRealtimeV4DuplexerApiV4Url(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {};\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_duplexer_publisher';\n\nexport function publish(payload: object): RequestOptionsFactory<any> {\n function __publish({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.realtime.v4.message',\n method: 'POST' as any,\n methodFqn: 'com.wix.realtime.v4.DuplexerApiV4.Publish',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveComWixRealtimeV4DuplexerApiV4Url({\n protoPath: '/publish',\n data: payload,\n host,\n }),\n data: payload,\n };\n\n return metadata;\n }\n\n return __publish;\n}\n","import * as ambassadorWixRealtimeV4Message from './realtime-v4-message-publisher.http.js';\nimport * as ambassadorWixRealtimeV4MessageTypes from './realtime-v4-message-publisher.types.js';\nimport * as ambassadorWixRealtimeV4MessageUniversalTypes from './realtime-v4-message-publisher.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 publish(): __PublicMethodMetaInfo<\n 'POST',\n {},\n ambassadorWixRealtimeV4MessageUniversalTypes.PublishRequest,\n ambassadorWixRealtimeV4MessageTypes.PublishRequest,\n ambassadorWixRealtimeV4MessageUniversalTypes.PublishResponse,\n ambassadorWixRealtimeV4MessageTypes.PublishResponse\n> {\n const payload = {} as any;\n\n const getRequestOptions = ambassadorWixRealtimeV4Message.publish(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: '/publish',\n pathParams: {},\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 Message as MessageOriginal,\n PublisherInfo as PublisherInfoOriginal,\n PublishRequest as PublishRequestOriginal,\n PublishResponse as PublishResponseOriginal,\n PublishToUserRequest as PublishToUserRequestOriginal,\n PublishToUserRequestTargetingOneOf as PublishToUserRequestTargetingOneOfOriginal,\n UserIdList as UserIdListOriginal,\n PublishToUserResponse as PublishToUserResponseOriginal,\n} from './realtime-v4-message-publisher.types.js';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,iBAAAA;AAAA;AAAA;;;ACAA,0BAA2B;AAI3B,SAAS,wCACP,MACA;AACA,QAAM,mBAAmB,CAAC;AAE1B,aAAO,gCAAW,OAAO,OAAO,MAAM,EAAE,iBAAiB,CAAC,CAAC;AAC7D;AAEA,IAAM,eAAe;AAEd,SAAS,QAAQ,SAA6C;AACnE,WAAS,UAAU,EAAE,KAAK,GAAQ;AAChC,UAAM,WAAW;AAAA,MACf,YAAY;AAAA,MACZ,QAAQ;AAAA,MACR,WAAW;AAAA,MACX,aAAa;AAAA,MACb,kBAAkB;AAAA,QAChB,wBAAwB;AAAA,MAC1B;AAAA,MACA,KAAK,wCAAwC;AAAA,QAC3C,WAAW;AAAA,QACX,MAAM;AAAA,QACN;AAAA,MACF,CAAC;AAAA,MACD,MAAM;AAAA,IACR;AAEA,WAAO;AAAA,EACT;AAEA,SAAO;AACT;;;ACdO,SAASC,WAOd;AACA,QAAM,UAAU,CAAC;AAEjB,QAAM,oBAAmD,QAAQ,OAAO;AAExE,QAAM,SAAS,CAAC,YAAyB;AACvC,UAAM,EAAE,IAAI,IAAI,kBAAkB,OAAO;AACzC,WAAO;AAAA,EACT;AAEA,SAAO;AAAA,IACL;AAAA,IACA,YAAY;AAAA,IACZ,MAAM;AAAA,IACN,YAAY,CAAC;AAAA,IACb,eAAe;AAAA,IACf,uBAAuB;AAAA,IACvB,gBAAgB;AAAA,IAChB,wBAAwB;AAAA,EAC1B;AACF;","names":["publish","publish"]}
1
+ {"version":3,"sources":["../../meta.ts","../../src/realtime-v4-message-publisher.http.ts","../../src/realtime-v4-message-publisher.meta.ts"],"sourcesContent":["export * from './src/realtime-v4-message-publisher.meta.js';\n","import { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveComWixRealtimeV4DuplexerApiV4Url(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'api._api_base_domain_': [\n {\n srcPath: '/wix-duplexer-api',\n destPath: '',\n },\n ],\n 'www._base_domain_': [\n {\n srcPath: '/_api/wix-duplexer-api',\n destPath: '',\n },\n ],\n 'manage._base_domain_': [\n {\n srcPath: '/_api/wix-duplexer-api',\n destPath: '',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/realtime/v4',\n destPath: '/v4',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_duplexer_publisher';\n\nexport function publish(payload: object): RequestOptionsFactory<any> {\n function __publish({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.realtime.v4.message',\n method: 'POST' as any,\n methodFqn: 'com.wix.realtime.v4.DuplexerApiV4.Publish',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveComWixRealtimeV4DuplexerApiV4Url({\n protoPath: '/publish',\n data: payload,\n host,\n }),\n data: payload,\n };\n\n return metadata;\n }\n\n return __publish;\n}\n","import * as ambassadorWixRealtimeV4Message from './realtime-v4-message-publisher.http.js';\nimport * as ambassadorWixRealtimeV4MessageTypes from './realtime-v4-message-publisher.types.js';\nimport * as ambassadorWixRealtimeV4MessageUniversalTypes from './realtime-v4-message-publisher.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 publish(): __PublicMethodMetaInfo<\n 'POST',\n {},\n ambassadorWixRealtimeV4MessageUniversalTypes.PublishRequest,\n ambassadorWixRealtimeV4MessageTypes.PublishRequest,\n ambassadorWixRealtimeV4MessageUniversalTypes.PublishResponse,\n ambassadorWixRealtimeV4MessageTypes.PublishResponse\n> {\n const payload = {} as any;\n\n const getRequestOptions = ambassadorWixRealtimeV4Message.publish(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: '/publish',\n pathParams: {},\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 Message as MessageOriginal,\n PublisherInfo as PublisherInfoOriginal,\n PublishRequest as PublishRequestOriginal,\n PublishResponse as PublishResponseOriginal,\n PublishToUserRequest as PublishToUserRequestOriginal,\n PublishToUserRequestTargetingOneOf as PublishToUserRequestTargetingOneOfOriginal,\n UserIdList as UserIdListOriginal,\n PublishToUserResponse as PublishToUserResponseOriginal,\n} from './realtime-v4-message-publisher.types.js';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,iBAAAA;AAAA;AAAA;;;ACAA,0BAA2B;AAI3B,SAAS,wCACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,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,mBAAmB;AAAA,MACjB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,EACF;AAEA,aAAO,gCAAW,OAAO,OAAO,MAAM,EAAE,iBAAiB,CAAC,CAAC;AAC7D;AAEA,IAAM,eAAe;AAEd,SAAS,QAAQ,SAA6C;AACnE,WAAS,UAAU,EAAE,KAAK,GAAQ;AAChC,UAAM,WAAW;AAAA,MACf,YAAY;AAAA,MACZ,QAAQ;AAAA,MACR,WAAW;AAAA,MACX,aAAa;AAAA,MACb,kBAAkB;AAAA,QAChB,wBAAwB;AAAA,MAC1B;AAAA,MACA,KAAK,wCAAwC;AAAA,QAC3C,WAAW;AAAA,QACX,MAAM;AAAA,QACN;AAAA,MACF,CAAC;AAAA,MACD,MAAM;AAAA,IACR;AAEA,WAAO;AAAA,EACT;AAEA,SAAO;AACT;;;ACvCO,SAASC,WAOd;AACA,QAAM,UAAU,CAAC;AAEjB,QAAM,oBAAmD,QAAQ,OAAO;AAExE,QAAM,SAAS,CAAC,YAAyB;AACvC,UAAM,EAAE,IAAI,IAAI,kBAAkB,OAAO;AACzC,WAAO;AAAA,EACT;AAEA,SAAO;AAAA,IACL;AAAA,IACA,YAAY;AAAA,IACZ,MAAM;AAAA,IACN,YAAY,CAAC;AAAA,IACb,eAAe;AAAA,IACf,uBAAuB;AAAA,IACvB,gBAAgB;AAAA,IAChB,wBAAwB;AAAA,EAC1B;AACF;","names":["publish","publish"]}
@@ -5,7 +5,32 @@ import { renameKeysFromSDKRequestToRESTRequest } from "@wix/sdk-runtime/rename-a
5
5
  // src/realtime-v4-message-publisher.http.ts
6
6
  import { resolveUrl } from "@wix/sdk-runtime/rest-modules";
7
7
  function resolveComWixRealtimeV4DuplexerApiV4Url(opts) {
8
- const domainToMappings = {};
8
+ const domainToMappings = {
9
+ "api._api_base_domain_": [
10
+ {
11
+ srcPath: "/wix-duplexer-api",
12
+ destPath: ""
13
+ }
14
+ ],
15
+ "www._base_domain_": [
16
+ {
17
+ srcPath: "/_api/wix-duplexer-api",
18
+ destPath: ""
19
+ }
20
+ ],
21
+ "manage._base_domain_": [
22
+ {
23
+ srcPath: "/_api/wix-duplexer-api",
24
+ destPath: ""
25
+ }
26
+ ],
27
+ "www.wixapis.com": [
28
+ {
29
+ srcPath: "/realtime/v4",
30
+ destPath: "/v4"
31
+ }
32
+ ]
33
+ };
9
34
  return resolveUrl(Object.assign(opts, { domainToMappings }));
10
35
  }
11
36
  var PACKAGE_NAME = "@wix/auto_sdk_duplexer_publisher";
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/realtime-v4-message-publisher.universal.ts","../../src/realtime-v4-message-publisher.http.ts","../../src/realtime-v4-message-publisher.public.ts","../../src/realtime-v4-message-publisher.context.ts"],"sourcesContent":["import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport { renameKeysFromSDKRequestToRESTRequest } from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport * as ambassadorWixRealtimeV4Message from './realtime-v4-message-publisher.http.js';\n\nexport interface Message {\n /**\n * Unique message identifier\n * @readonly\n * @format GUID\n */\n _id?: string;\n /**\n * Event name, e.g \"product_added\"\n * @maxLength 1000\n */\n eventName?: string;\n /** Event payload, e.g { \"product_id\": \"123\", \"product_name\": \"Product 1\" } */\n payload?: Record<string, any> | null;\n /** Info regarding the publisher of the message */\n publisherInfo?: PublisherInfo;\n}\n\nexport interface PublisherInfo {\n /**\n * Arbitrary string identifier for the publisher, can be used by subscribers to identify the publisher\n * @maxLength 1000\n */\n uid?: string;\n}\n\nexport interface PublishRequest {\n message: Message;\n /**\n * Channel names to publish to, e.g [\"product_notifications\", \"site_notifications\"]\n * @maxSize 10\n * @maxLength 140\n */\n channels: string[];\n /**\n * Optional sub resource identifier, e.g \"important_notification\", only subscribers to this specific resource will receive the message\n * @maxLength 1000\n */\n resourceId?: string | null;\n}\n\nexport interface PublishResponse {}\n\nexport interface PublishToUserRequest\n extends PublishToUserRequestTargetingOneOf {\n /** list of user ids to receive the message */\n includeRecipients?: UserIdList;\n /** list of user ids to exclude from receiving the message */\n excludeRecipients?: UserIdList;\n message?: Message;\n /**\n * Optional sub resource identifier, e.g \"important_notification\", only subscribers to this specific resource will receive the message\n * @maxLength 1000\n */\n resourceId?: string | null;\n}\n\n/** @oneof */\nexport interface PublishToUserRequestTargetingOneOf {\n /** list of user ids to receive the message */\n includeRecipients?: UserIdList;\n /** list of user ids to exclude from receiving the message */\n excludeRecipients?: UserIdList;\n}\n\nexport interface UserIdList {\n /**\n * @maxSize 1000\n * @maxLength 1000\n */\n userId?: string[];\n}\n\nexport interface PublishToUserResponse {}\n\n/** @public\n * @requiredField message\n * @requiredField message.eventName\n * @requiredField message.payload\n * @requiredField options.channels\n * @permissionId realtime:v4:message:publish\n * @fqn com.wix.realtime.v4.DuplexerApiV4.Publish\n */\nexport async function publish(\n message: NonNullablePaths<Message, `eventName` | `payload`, 2>,\n options?: NonNullablePaths<PublishOptions, `channels`, 2>\n): Promise<void> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[2] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n message: message,\n channels: options?.channels,\n resourceId: options?.resourceId,\n });\n\n const reqOpts = ambassadorWixRealtimeV4Message.publish(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {\n message: '$[0]',\n channels: '$[1].channels',\n resourceId: '$[1].resourceId',\n },\n singleArgumentUnchanged: false,\n },\n ['message', 'options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface PublishOptions {\n /**\n * Channel names to publish to, e.g [\"product_notifications\", \"site_notifications\"]\n * @maxSize 10\n * @maxLength 140\n */\n channels: string[];\n /**\n * Optional sub resource identifier, e.g \"important_notification\", only subscribers to this specific resource will receive the message\n * @maxLength 1000\n */\n resourceId?: string | null;\n}\n","import { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveComWixRealtimeV4DuplexerApiV4Url(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {};\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_duplexer_publisher';\n\nexport function publish(payload: object): RequestOptionsFactory<any> {\n function __publish({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.realtime.v4.message',\n method: 'POST' as any,\n methodFqn: 'com.wix.realtime.v4.DuplexerApiV4.Publish',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveComWixRealtimeV4DuplexerApiV4Url({\n protoPath: '/publish',\n data: payload,\n host,\n }),\n data: payload,\n };\n\n return metadata;\n }\n\n return __publish;\n}\n","import { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport {\n Message,\n PublishOptions,\n publish as universalPublish,\n} from './realtime-v4-message-publisher.universal.js';\n\nexport const __metadata = { PACKAGE_NAME: '@wix/duplexer' };\n\nexport function publish(httpClient: HttpClient): PublishSignature {\n return (\n message: NonNullablePaths<Message, `eventName` | `payload`, 2>,\n options?: NonNullablePaths<PublishOptions, `channels`, 2>\n ) =>\n universalPublish(\n message,\n options,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface PublishSignature {\n /** */\n (\n message: NonNullablePaths<Message, `eventName` | `payload`, 2>,\n options?: NonNullablePaths<PublishOptions, `channels`, 2>\n ): Promise<void>;\n}\n\nexport {\n Message,\n PublishOptions,\n PublishRequest,\n PublishResponse,\n PublishToUserRequest,\n PublishToUserRequestTargetingOneOf,\n PublishToUserResponse,\n PublisherInfo,\n UserIdList,\n} from './realtime-v4-message-publisher.universal.js';\n","import { publish as publicPublish } from './realtime-v4-message-publisher.public.js';\nimport { createRESTModule } from '@wix/sdk-runtime/rest-modules';\nimport { BuildRESTFunction, MaybeContext } from '@wix/sdk-types';\n\nexport const publish: MaybeContext<\n BuildRESTFunction<typeof publicPublish> & typeof publicPublish\n> = /*#__PURE__*/ createRESTModule(publicPublish);\n\nexport {\n Message,\n PublisherInfo,\n PublishRequest,\n PublishResponse,\n PublishToUserRequest,\n PublishToUserRequestTargetingOneOf,\n UserIdList,\n PublishToUserResponse,\n PublishOptions,\n} from './realtime-v4-message-publisher.universal.js';\n"],"mappings":";AAAA,SAAS,kBAAkB,yBAAyB;AACpD,SAAS,6CAA6C;;;ACDtD,SAAS,kBAAkB;AAI3B,SAAS,wCACP,MACA;AACA,QAAM,mBAAmB,CAAC;AAE1B,SAAO,WAAW,OAAO,OAAO,MAAM,EAAE,iBAAiB,CAAC,CAAC;AAC7D;AAEA,IAAM,eAAe;AAEd,SAAS,QAAQ,SAA6C;AACnE,WAAS,UAAU,EAAE,KAAK,GAAQ;AAChC,UAAM,WAAW;AAAA,MACf,YAAY;AAAA,MACZ,QAAQ;AAAA,MACR,WAAW;AAAA,MACX,aAAa;AAAA,MACb,kBAAkB;AAAA,QAChB,wBAAwB;AAAA,MAC1B;AAAA,MACA,KAAK,wCAAwC;AAAA,QAC3C,WAAW;AAAA,QACX,MAAM;AAAA,QACN;AAAA,MACF,CAAC;AAAA,MACD,MAAM;AAAA,IACR;AAEA,WAAO;AAAA,EACT;AAEA,SAAO;AACT;;;ADoDA,eAAsBA,SACpB,SACA,SACe;AAEf,QAAM,EAAE,YAAY,YAAY,IAAI,UAAU,CAAC;AAK/C,QAAM,UAAU,sCAAsC;AAAA,IACpD;AAAA,IACA,UAAU,SAAS;AAAA,IACnB,YAAY,SAAS;AAAA,EACvB,CAAC;AAED,QAAM,UAAyC,QAAQ,OAAO;AAE9D,eAAa,aAAa;AAC1B,MAAI;AACF,UAAM,SAAS,MAAM,WAAW,QAAQ,OAAO;AAC/C,iBAAa,YAAY,MAAM;AAAA,EACjC,SAAS,KAAU;AACjB,UAAM,mBAAmB;AAAA,MACvB;AAAA,MACA;AAAA,QACE,wBAAwB,CAAC;AAAA,QACzB,0BAA0B;AAAA,UACxB,SAAS;AAAA,UACT,UAAU;AAAA,UACV,YAAY;AAAA,QACd;AAAA,QACA,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC,WAAW,SAAS;AAAA,IACvB;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;;;AEvHO,SAASC,SAAQ,YAA0C;AAChE,SAAO,CACL,SACA,YAEAA;AAAA,IACE;AAAA,IACA;AAAA;AAAA,IAEA,EAAE,WAAW;AAAA,EACf;AACJ;;;ACnBA,SAAS,wBAAwB;AAG1B,IAAMC,WAEK,iCAAiBA,QAAa;","names":["publish","publish","publish"]}
1
+ {"version":3,"sources":["../../src/realtime-v4-message-publisher.universal.ts","../../src/realtime-v4-message-publisher.http.ts","../../src/realtime-v4-message-publisher.public.ts","../../src/realtime-v4-message-publisher.context.ts"],"sourcesContent":["import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport { renameKeysFromSDKRequestToRESTRequest } from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport * as ambassadorWixRealtimeV4Message from './realtime-v4-message-publisher.http.js';\n\nexport interface Message {\n /**\n * Unique message identifier\n * @readonly\n * @format GUID\n */\n _id?: string;\n /**\n * Event name, e.g \"product_added\"\n * @maxLength 1000\n */\n eventName?: string;\n /** Event payload, e.g { \"product_id\": \"123\", \"product_name\": \"Product 1\" } */\n payload?: Record<string, any> | null;\n /** Info regarding the publisher of the message */\n publisherInfo?: PublisherInfo;\n}\n\nexport interface PublisherInfo {\n /**\n * Arbitrary string identifier for the publisher, can be used by subscribers to identify the publisher\n * @maxLength 1000\n */\n uid?: string;\n}\n\nexport interface PublishRequest {\n message: Message;\n /**\n * Channel names to publish to, e.g [\"product_notifications\", \"site_notifications\"]\n * @maxSize 10\n * @maxLength 140\n */\n channels: string[];\n /**\n * Optional sub resource identifier, e.g \"important_notification\", only subscribers to this specific resource will receive the message\n * @maxLength 1000\n */\n resourceId?: string | null;\n}\n\nexport interface PublishResponse {}\n\nexport interface PublishToUserRequest\n extends PublishToUserRequestTargetingOneOf {\n /** list of user ids to receive the message */\n includeRecipients?: UserIdList;\n /** list of user ids to exclude from receiving the message */\n excludeRecipients?: UserIdList;\n message?: Message;\n /**\n * Optional sub resource identifier, e.g \"important_notification\", only subscribers to this specific resource will receive the message\n * @maxLength 1000\n */\n resourceId?: string | null;\n}\n\n/** @oneof */\nexport interface PublishToUserRequestTargetingOneOf {\n /** list of user ids to receive the message */\n includeRecipients?: UserIdList;\n /** list of user ids to exclude from receiving the message */\n excludeRecipients?: UserIdList;\n}\n\nexport interface UserIdList {\n /**\n * @maxSize 1000\n * @maxLength 1000\n */\n userId?: string[];\n}\n\nexport interface PublishToUserResponse {}\n\n/** @public\n * @requiredField message\n * @requiredField message.eventName\n * @requiredField message.payload\n * @requiredField options.channels\n * @permissionId realtime:v4:message:publish\n * @fqn com.wix.realtime.v4.DuplexerApiV4.Publish\n */\nexport async function publish(\n message: NonNullablePaths<Message, `eventName` | `payload`, 2>,\n options?: NonNullablePaths<PublishOptions, `channels`, 2>\n): Promise<void> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[2] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n message: message,\n channels: options?.channels,\n resourceId: options?.resourceId,\n });\n\n const reqOpts = ambassadorWixRealtimeV4Message.publish(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {\n message: '$[0]',\n channels: '$[1].channels',\n resourceId: '$[1].resourceId',\n },\n singleArgumentUnchanged: false,\n },\n ['message', 'options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface PublishOptions {\n /**\n * Channel names to publish to, e.g [\"product_notifications\", \"site_notifications\"]\n * @maxSize 10\n * @maxLength 140\n */\n channels: string[];\n /**\n * Optional sub resource identifier, e.g \"important_notification\", only subscribers to this specific resource will receive the message\n * @maxLength 1000\n */\n resourceId?: string | null;\n}\n","import { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveComWixRealtimeV4DuplexerApiV4Url(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'api._api_base_domain_': [\n {\n srcPath: '/wix-duplexer-api',\n destPath: '',\n },\n ],\n 'www._base_domain_': [\n {\n srcPath: '/_api/wix-duplexer-api',\n destPath: '',\n },\n ],\n 'manage._base_domain_': [\n {\n srcPath: '/_api/wix-duplexer-api',\n destPath: '',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/realtime/v4',\n destPath: '/v4',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_duplexer_publisher';\n\nexport function publish(payload: object): RequestOptionsFactory<any> {\n function __publish({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.realtime.v4.message',\n method: 'POST' as any,\n methodFqn: 'com.wix.realtime.v4.DuplexerApiV4.Publish',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveComWixRealtimeV4DuplexerApiV4Url({\n protoPath: '/publish',\n data: payload,\n host,\n }),\n data: payload,\n };\n\n return metadata;\n }\n\n return __publish;\n}\n","import { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport {\n Message,\n PublishOptions,\n publish as universalPublish,\n} from './realtime-v4-message-publisher.universal.js';\n\nexport const __metadata = { PACKAGE_NAME: '@wix/duplexer' };\n\nexport function publish(httpClient: HttpClient): PublishSignature {\n return (\n message: NonNullablePaths<Message, `eventName` | `payload`, 2>,\n options?: NonNullablePaths<PublishOptions, `channels`, 2>\n ) =>\n universalPublish(\n message,\n options,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface PublishSignature {\n /** */\n (\n message: NonNullablePaths<Message, `eventName` | `payload`, 2>,\n options?: NonNullablePaths<PublishOptions, `channels`, 2>\n ): Promise<void>;\n}\n\nexport {\n Message,\n PublishOptions,\n PublishRequest,\n PublishResponse,\n PublishToUserRequest,\n PublishToUserRequestTargetingOneOf,\n PublishToUserResponse,\n PublisherInfo,\n UserIdList,\n} from './realtime-v4-message-publisher.universal.js';\n","import { publish as publicPublish } from './realtime-v4-message-publisher.public.js';\nimport { createRESTModule } from '@wix/sdk-runtime/rest-modules';\nimport { BuildRESTFunction, MaybeContext } from '@wix/sdk-types';\n\nexport const publish: MaybeContext<\n BuildRESTFunction<typeof publicPublish> & typeof publicPublish\n> = /*#__PURE__*/ createRESTModule(publicPublish);\n\nexport {\n Message,\n PublisherInfo,\n PublishRequest,\n PublishResponse,\n PublishToUserRequest,\n PublishToUserRequestTargetingOneOf,\n UserIdList,\n PublishToUserResponse,\n PublishOptions,\n} from './realtime-v4-message-publisher.universal.js';\n"],"mappings":";AAAA,SAAS,kBAAkB,yBAAyB;AACpD,SAAS,6CAA6C;;;ACDtD,SAAS,kBAAkB;AAI3B,SAAS,wCACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,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,mBAAmB;AAAA,MACjB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,EACF;AAEA,SAAO,WAAW,OAAO,OAAO,MAAM,EAAE,iBAAiB,CAAC,CAAC;AAC7D;AAEA,IAAM,eAAe;AAEd,SAAS,QAAQ,SAA6C;AACnE,WAAS,UAAU,EAAE,KAAK,GAAQ;AAChC,UAAM,WAAW;AAAA,MACf,YAAY;AAAA,MACZ,QAAQ;AAAA,MACR,WAAW;AAAA,MACX,aAAa;AAAA,MACb,kBAAkB;AAAA,QAChB,wBAAwB;AAAA,MAC1B;AAAA,MACA,KAAK,wCAAwC;AAAA,QAC3C,WAAW;AAAA,QACX,MAAM;AAAA,QACN;AAAA,MACF,CAAC;AAAA,MACD,MAAM;AAAA,IACR;AAEA,WAAO;AAAA,EACT;AAEA,SAAO;AACT;;;AD2BA,eAAsBA,SACpB,SACA,SACe;AAEf,QAAM,EAAE,YAAY,YAAY,IAAI,UAAU,CAAC;AAK/C,QAAM,UAAU,sCAAsC;AAAA,IACpD;AAAA,IACA,UAAU,SAAS;AAAA,IACnB,YAAY,SAAS;AAAA,EACvB,CAAC;AAED,QAAM,UAAyC,QAAQ,OAAO;AAE9D,eAAa,aAAa;AAC1B,MAAI;AACF,UAAM,SAAS,MAAM,WAAW,QAAQ,OAAO;AAC/C,iBAAa,YAAY,MAAM;AAAA,EACjC,SAAS,KAAU;AACjB,UAAM,mBAAmB;AAAA,MACvB;AAAA,MACA;AAAA,QACE,wBAAwB,CAAC;AAAA,QACzB,0BAA0B;AAAA,UACxB,SAAS;AAAA,UACT,UAAU;AAAA,UACV,YAAY;AAAA,QACd;AAAA,QACA,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC,WAAW,SAAS;AAAA,IACvB;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;;;AEvHO,SAASC,SAAQ,YAA0C;AAChE,SAAO,CACL,SACA,YAEAA;AAAA,IACE;AAAA,IACA;AAAA;AAAA,IAEA,EAAE,WAAW;AAAA,EACf;AACJ;;;ACnBA,SAAS,wBAAwB;AAG1B,IAAMC,WAEK,iCAAiBA,QAAa;","names":["publish","publish","publish"]}
@@ -5,7 +5,32 @@ import { renameKeysFromSDKRequestToRESTRequest } from "@wix/sdk-runtime/rename-a
5
5
  // src/realtime-v4-message-publisher.http.ts
6
6
  import { resolveUrl } from "@wix/sdk-runtime/rest-modules";
7
7
  function resolveComWixRealtimeV4DuplexerApiV4Url(opts) {
8
- const domainToMappings = {};
8
+ const domainToMappings = {
9
+ "api._api_base_domain_": [
10
+ {
11
+ srcPath: "/wix-duplexer-api",
12
+ destPath: ""
13
+ }
14
+ ],
15
+ "www._base_domain_": [
16
+ {
17
+ srcPath: "/_api/wix-duplexer-api",
18
+ destPath: ""
19
+ }
20
+ ],
21
+ "manage._base_domain_": [
22
+ {
23
+ srcPath: "/_api/wix-duplexer-api",
24
+ destPath: ""
25
+ }
26
+ ],
27
+ "www.wixapis.com": [
28
+ {
29
+ srcPath: "/realtime/v4",
30
+ destPath: "/v4"
31
+ }
32
+ ]
33
+ };
9
34
  return resolveUrl(Object.assign(opts, { domainToMappings }));
10
35
  }
11
36
  var PACKAGE_NAME = "@wix/auto_sdk_duplexer_publisher";
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/realtime-v4-message-publisher.universal.ts","../../src/realtime-v4-message-publisher.http.ts"],"sourcesContent":["import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport { renameKeysFromSDKRequestToRESTRequest } from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport * as ambassadorWixRealtimeV4Message from './realtime-v4-message-publisher.http.js';\n\nexport interface Message {\n /**\n * Unique message identifier\n * @readonly\n * @format GUID\n */\n _id?: string;\n /**\n * Event name, e.g \"product_added\"\n * @maxLength 1000\n */\n eventName?: string;\n /** Event payload, e.g { \"product_id\": \"123\", \"product_name\": \"Product 1\" } */\n payload?: Record<string, any> | null;\n /** Info regarding the publisher of the message */\n publisherInfo?: PublisherInfo;\n}\n\nexport interface PublisherInfo {\n /**\n * Arbitrary string identifier for the publisher, can be used by subscribers to identify the publisher\n * @maxLength 1000\n */\n uid?: string;\n}\n\nexport interface PublishRequest {\n message: Message;\n /**\n * Channel names to publish to, e.g [\"product_notifications\", \"site_notifications\"]\n * @maxSize 10\n * @maxLength 140\n */\n channels: string[];\n /**\n * Optional sub resource identifier, e.g \"important_notification\", only subscribers to this specific resource will receive the message\n * @maxLength 1000\n */\n resourceId?: string | null;\n}\n\nexport interface PublishResponse {}\n\nexport interface PublishToUserRequest\n extends PublishToUserRequestTargetingOneOf {\n /** list of user ids to receive the message */\n includeRecipients?: UserIdList;\n /** list of user ids to exclude from receiving the message */\n excludeRecipients?: UserIdList;\n message?: Message;\n /**\n * Optional sub resource identifier, e.g \"important_notification\", only subscribers to this specific resource will receive the message\n * @maxLength 1000\n */\n resourceId?: string | null;\n}\n\n/** @oneof */\nexport interface PublishToUserRequestTargetingOneOf {\n /** list of user ids to receive the message */\n includeRecipients?: UserIdList;\n /** list of user ids to exclude from receiving the message */\n excludeRecipients?: UserIdList;\n}\n\nexport interface UserIdList {\n /**\n * @maxSize 1000\n * @maxLength 1000\n */\n userId?: string[];\n}\n\nexport interface PublishToUserResponse {}\n\n/** @public\n * @requiredField message\n * @requiredField message.eventName\n * @requiredField message.payload\n * @requiredField options.channels\n * @permissionId realtime:v4:message:publish\n * @fqn com.wix.realtime.v4.DuplexerApiV4.Publish\n */\nexport async function publish(\n message: NonNullablePaths<Message, `eventName` | `payload`, 2>,\n options?: NonNullablePaths<PublishOptions, `channels`, 2>\n): Promise<void> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[2] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n message: message,\n channels: options?.channels,\n resourceId: options?.resourceId,\n });\n\n const reqOpts = ambassadorWixRealtimeV4Message.publish(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {\n message: '$[0]',\n channels: '$[1].channels',\n resourceId: '$[1].resourceId',\n },\n singleArgumentUnchanged: false,\n },\n ['message', 'options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface PublishOptions {\n /**\n * Channel names to publish to, e.g [\"product_notifications\", \"site_notifications\"]\n * @maxSize 10\n * @maxLength 140\n */\n channels: string[];\n /**\n * Optional sub resource identifier, e.g \"important_notification\", only subscribers to this specific resource will receive the message\n * @maxLength 1000\n */\n resourceId?: string | null;\n}\n","import { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveComWixRealtimeV4DuplexerApiV4Url(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {};\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_duplexer_publisher';\n\nexport function publish(payload: object): RequestOptionsFactory<any> {\n function __publish({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.realtime.v4.message',\n method: 'POST' as any,\n methodFqn: 'com.wix.realtime.v4.DuplexerApiV4.Publish',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveComWixRealtimeV4DuplexerApiV4Url({\n protoPath: '/publish',\n data: payload,\n host,\n }),\n data: payload,\n };\n\n return metadata;\n }\n\n return __publish;\n}\n"],"mappings":";AAAA,SAAS,kBAAkB,yBAAyB;AACpD,SAAS,6CAA6C;;;ACDtD,SAAS,kBAAkB;AAI3B,SAAS,wCACP,MACA;AACA,QAAM,mBAAmB,CAAC;AAE1B,SAAO,WAAW,OAAO,OAAO,MAAM,EAAE,iBAAiB,CAAC,CAAC;AAC7D;AAEA,IAAM,eAAe;AAEd,SAAS,QAAQ,SAA6C;AACnE,WAAS,UAAU,EAAE,KAAK,GAAQ;AAChC,UAAM,WAAW;AAAA,MACf,YAAY;AAAA,MACZ,QAAQ;AAAA,MACR,WAAW;AAAA,MACX,aAAa;AAAA,MACb,kBAAkB;AAAA,QAChB,wBAAwB;AAAA,MAC1B;AAAA,MACA,KAAK,wCAAwC;AAAA,QAC3C,WAAW;AAAA,QACX,MAAM;AAAA,QACN;AAAA,MACF,CAAC;AAAA,MACD,MAAM;AAAA,IACR;AAEA,WAAO;AAAA,EACT;AAEA,SAAO;AACT;;;ADoDA,eAAsBA,SACpB,SACA,SACe;AAEf,QAAM,EAAE,YAAY,YAAY,IAAI,UAAU,CAAC;AAK/C,QAAM,UAAU,sCAAsC;AAAA,IACpD;AAAA,IACA,UAAU,SAAS;AAAA,IACnB,YAAY,SAAS;AAAA,EACvB,CAAC;AAED,QAAM,UAAyC,QAAQ,OAAO;AAE9D,eAAa,aAAa;AAC1B,MAAI;AACF,UAAM,SAAS,MAAM,WAAW,QAAQ,OAAO;AAC/C,iBAAa,YAAY,MAAM;AAAA,EACjC,SAAS,KAAU;AACjB,UAAM,mBAAmB;AAAA,MACvB;AAAA,MACA;AAAA,QACE,wBAAwB,CAAC;AAAA,QACzB,0BAA0B;AAAA,UACxB,SAAS;AAAA,UACT,UAAU;AAAA,UACV,YAAY;AAAA,QACd;AAAA,QACA,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC,WAAW,SAAS;AAAA,IACvB;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;","names":["publish"]}
1
+ {"version":3,"sources":["../../src/realtime-v4-message-publisher.universal.ts","../../src/realtime-v4-message-publisher.http.ts"],"sourcesContent":["import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport { renameKeysFromSDKRequestToRESTRequest } from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport * as ambassadorWixRealtimeV4Message from './realtime-v4-message-publisher.http.js';\n\nexport interface Message {\n /**\n * Unique message identifier\n * @readonly\n * @format GUID\n */\n _id?: string;\n /**\n * Event name, e.g \"product_added\"\n * @maxLength 1000\n */\n eventName?: string;\n /** Event payload, e.g { \"product_id\": \"123\", \"product_name\": \"Product 1\" } */\n payload?: Record<string, any> | null;\n /** Info regarding the publisher of the message */\n publisherInfo?: PublisherInfo;\n}\n\nexport interface PublisherInfo {\n /**\n * Arbitrary string identifier for the publisher, can be used by subscribers to identify the publisher\n * @maxLength 1000\n */\n uid?: string;\n}\n\nexport interface PublishRequest {\n message: Message;\n /**\n * Channel names to publish to, e.g [\"product_notifications\", \"site_notifications\"]\n * @maxSize 10\n * @maxLength 140\n */\n channels: string[];\n /**\n * Optional sub resource identifier, e.g \"important_notification\", only subscribers to this specific resource will receive the message\n * @maxLength 1000\n */\n resourceId?: string | null;\n}\n\nexport interface PublishResponse {}\n\nexport interface PublishToUserRequest\n extends PublishToUserRequestTargetingOneOf {\n /** list of user ids to receive the message */\n includeRecipients?: UserIdList;\n /** list of user ids to exclude from receiving the message */\n excludeRecipients?: UserIdList;\n message?: Message;\n /**\n * Optional sub resource identifier, e.g \"important_notification\", only subscribers to this specific resource will receive the message\n * @maxLength 1000\n */\n resourceId?: string | null;\n}\n\n/** @oneof */\nexport interface PublishToUserRequestTargetingOneOf {\n /** list of user ids to receive the message */\n includeRecipients?: UserIdList;\n /** list of user ids to exclude from receiving the message */\n excludeRecipients?: UserIdList;\n}\n\nexport interface UserIdList {\n /**\n * @maxSize 1000\n * @maxLength 1000\n */\n userId?: string[];\n}\n\nexport interface PublishToUserResponse {}\n\n/** @public\n * @requiredField message\n * @requiredField message.eventName\n * @requiredField message.payload\n * @requiredField options.channels\n * @permissionId realtime:v4:message:publish\n * @fqn com.wix.realtime.v4.DuplexerApiV4.Publish\n */\nexport async function publish(\n message: NonNullablePaths<Message, `eventName` | `payload`, 2>,\n options?: NonNullablePaths<PublishOptions, `channels`, 2>\n): Promise<void> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[2] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n message: message,\n channels: options?.channels,\n resourceId: options?.resourceId,\n });\n\n const reqOpts = ambassadorWixRealtimeV4Message.publish(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {\n message: '$[0]',\n channels: '$[1].channels',\n resourceId: '$[1].resourceId',\n },\n singleArgumentUnchanged: false,\n },\n ['message', 'options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface PublishOptions {\n /**\n * Channel names to publish to, e.g [\"product_notifications\", \"site_notifications\"]\n * @maxSize 10\n * @maxLength 140\n */\n channels: string[];\n /**\n * Optional sub resource identifier, e.g \"important_notification\", only subscribers to this specific resource will receive the message\n * @maxLength 1000\n */\n resourceId?: string | null;\n}\n","import { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveComWixRealtimeV4DuplexerApiV4Url(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'api._api_base_domain_': [\n {\n srcPath: '/wix-duplexer-api',\n destPath: '',\n },\n ],\n 'www._base_domain_': [\n {\n srcPath: '/_api/wix-duplexer-api',\n destPath: '',\n },\n ],\n 'manage._base_domain_': [\n {\n srcPath: '/_api/wix-duplexer-api',\n destPath: '',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/realtime/v4',\n destPath: '/v4',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_duplexer_publisher';\n\nexport function publish(payload: object): RequestOptionsFactory<any> {\n function __publish({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.realtime.v4.message',\n method: 'POST' as any,\n methodFqn: 'com.wix.realtime.v4.DuplexerApiV4.Publish',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveComWixRealtimeV4DuplexerApiV4Url({\n protoPath: '/publish',\n data: payload,\n host,\n }),\n data: payload,\n };\n\n return metadata;\n }\n\n return __publish;\n}\n"],"mappings":";AAAA,SAAS,kBAAkB,yBAAyB;AACpD,SAAS,6CAA6C;;;ACDtD,SAAS,kBAAkB;AAI3B,SAAS,wCACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,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,mBAAmB;AAAA,MACjB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,EACF;AAEA,SAAO,WAAW,OAAO,OAAO,MAAM,EAAE,iBAAiB,CAAC,CAAC;AAC7D;AAEA,IAAM,eAAe;AAEd,SAAS,QAAQ,SAA6C;AACnE,WAAS,UAAU,EAAE,KAAK,GAAQ;AAChC,UAAM,WAAW;AAAA,MACf,YAAY;AAAA,MACZ,QAAQ;AAAA,MACR,WAAW;AAAA,MACX,aAAa;AAAA,MACb,kBAAkB;AAAA,QAChB,wBAAwB;AAAA,MAC1B;AAAA,MACA,KAAK,wCAAwC;AAAA,QAC3C,WAAW;AAAA,QACX,MAAM;AAAA,QACN;AAAA,MACF,CAAC;AAAA,MACD,MAAM;AAAA,IACR;AAEA,WAAO;AAAA,EACT;AAEA,SAAO;AACT;;;AD2BA,eAAsBA,SACpB,SACA,SACe;AAEf,QAAM,EAAE,YAAY,YAAY,IAAI,UAAU,CAAC;AAK/C,QAAM,UAAU,sCAAsC;AAAA,IACpD;AAAA,IACA,UAAU,SAAS;AAAA,IACnB,YAAY,SAAS;AAAA,EACvB,CAAC;AAED,QAAM,UAAyC,QAAQ,OAAO;AAE9D,eAAa,aAAa;AAC1B,MAAI;AACF,UAAM,SAAS,MAAM,WAAW,QAAQ,OAAO;AAC/C,iBAAa,YAAY,MAAM;AAAA,EACjC,SAAS,KAAU;AACjB,UAAM,mBAAmB;AAAA,MACvB;AAAA,MACA;AAAA,QACE,wBAAwB,CAAC;AAAA,QACzB,0BAA0B;AAAA,UACxB,SAAS;AAAA,UACT,UAAU;AAAA,UACV,YAAY;AAAA,QACd;AAAA,QACA,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC,WAAW,SAAS;AAAA,IACvB;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;","names":["publish"]}
package/build/es/meta.mjs CHANGED
@@ -1,7 +1,32 @@
1
1
  // src/realtime-v4-message-publisher.http.ts
2
2
  import { resolveUrl } from "@wix/sdk-runtime/rest-modules";
3
3
  function resolveComWixRealtimeV4DuplexerApiV4Url(opts) {
4
- const domainToMappings = {};
4
+ const domainToMappings = {
5
+ "api._api_base_domain_": [
6
+ {
7
+ srcPath: "/wix-duplexer-api",
8
+ destPath: ""
9
+ }
10
+ ],
11
+ "www._base_domain_": [
12
+ {
13
+ srcPath: "/_api/wix-duplexer-api",
14
+ destPath: ""
15
+ }
16
+ ],
17
+ "manage._base_domain_": [
18
+ {
19
+ srcPath: "/_api/wix-duplexer-api",
20
+ destPath: ""
21
+ }
22
+ ],
23
+ "www.wixapis.com": [
24
+ {
25
+ srcPath: "/realtime/v4",
26
+ destPath: "/v4"
27
+ }
28
+ ]
29
+ };
5
30
  return resolveUrl(Object.assign(opts, { domainToMappings }));
6
31
  }
7
32
  var PACKAGE_NAME = "@wix/auto_sdk_duplexer_publisher";
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/realtime-v4-message-publisher.http.ts","../../src/realtime-v4-message-publisher.meta.ts"],"sourcesContent":["import { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveComWixRealtimeV4DuplexerApiV4Url(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {};\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_duplexer_publisher';\n\nexport function publish(payload: object): RequestOptionsFactory<any> {\n function __publish({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.realtime.v4.message',\n method: 'POST' as any,\n methodFqn: 'com.wix.realtime.v4.DuplexerApiV4.Publish',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveComWixRealtimeV4DuplexerApiV4Url({\n protoPath: '/publish',\n data: payload,\n host,\n }),\n data: payload,\n };\n\n return metadata;\n }\n\n return __publish;\n}\n","import * as ambassadorWixRealtimeV4Message from './realtime-v4-message-publisher.http.js';\nimport * as ambassadorWixRealtimeV4MessageTypes from './realtime-v4-message-publisher.types.js';\nimport * as ambassadorWixRealtimeV4MessageUniversalTypes from './realtime-v4-message-publisher.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 publish(): __PublicMethodMetaInfo<\n 'POST',\n {},\n ambassadorWixRealtimeV4MessageUniversalTypes.PublishRequest,\n ambassadorWixRealtimeV4MessageTypes.PublishRequest,\n ambassadorWixRealtimeV4MessageUniversalTypes.PublishResponse,\n ambassadorWixRealtimeV4MessageTypes.PublishResponse\n> {\n const payload = {} as any;\n\n const getRequestOptions = ambassadorWixRealtimeV4Message.publish(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: '/publish',\n pathParams: {},\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 Message as MessageOriginal,\n PublisherInfo as PublisherInfoOriginal,\n PublishRequest as PublishRequestOriginal,\n PublishResponse as PublishResponseOriginal,\n PublishToUserRequest as PublishToUserRequestOriginal,\n PublishToUserRequestTargetingOneOf as PublishToUserRequestTargetingOneOfOriginal,\n UserIdList as UserIdListOriginal,\n PublishToUserResponse as PublishToUserResponseOriginal,\n} from './realtime-v4-message-publisher.types.js';\n"],"mappings":";AAAA,SAAS,kBAAkB;AAI3B,SAAS,wCACP,MACA;AACA,QAAM,mBAAmB,CAAC;AAE1B,SAAO,WAAW,OAAO,OAAO,MAAM,EAAE,iBAAiB,CAAC,CAAC;AAC7D;AAEA,IAAM,eAAe;AAEd,SAAS,QAAQ,SAA6C;AACnE,WAAS,UAAU,EAAE,KAAK,GAAQ;AAChC,UAAM,WAAW;AAAA,MACf,YAAY;AAAA,MACZ,QAAQ;AAAA,MACR,WAAW;AAAA,MACX,aAAa;AAAA,MACb,kBAAkB;AAAA,QAChB,wBAAwB;AAAA,MAC1B;AAAA,MACA,KAAK,wCAAwC;AAAA,QAC3C,WAAW;AAAA,QACX,MAAM;AAAA,QACN;AAAA,MACF,CAAC;AAAA,MACD,MAAM;AAAA,IACR;AAEA,WAAO;AAAA,EACT;AAEA,SAAO;AACT;;;ACdO,SAASA,WAOd;AACA,QAAM,UAAU,CAAC;AAEjB,QAAM,oBAAmD,QAAQ,OAAO;AAExE,QAAM,SAAS,CAAC,YAAyB;AACvC,UAAM,EAAE,IAAI,IAAI,kBAAkB,OAAO;AACzC,WAAO;AAAA,EACT;AAEA,SAAO;AAAA,IACL;AAAA,IACA,YAAY;AAAA,IACZ,MAAM;AAAA,IACN,YAAY,CAAC;AAAA,IACb,eAAe;AAAA,IACf,uBAAuB;AAAA,IACvB,gBAAgB;AAAA,IAChB,wBAAwB;AAAA,EAC1B;AACF;","names":["publish"]}
1
+ {"version":3,"sources":["../../src/realtime-v4-message-publisher.http.ts","../../src/realtime-v4-message-publisher.meta.ts"],"sourcesContent":["import { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveComWixRealtimeV4DuplexerApiV4Url(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'api._api_base_domain_': [\n {\n srcPath: '/wix-duplexer-api',\n destPath: '',\n },\n ],\n 'www._base_domain_': [\n {\n srcPath: '/_api/wix-duplexer-api',\n destPath: '',\n },\n ],\n 'manage._base_domain_': [\n {\n srcPath: '/_api/wix-duplexer-api',\n destPath: '',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/realtime/v4',\n destPath: '/v4',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_duplexer_publisher';\n\nexport function publish(payload: object): RequestOptionsFactory<any> {\n function __publish({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.realtime.v4.message',\n method: 'POST' as any,\n methodFqn: 'com.wix.realtime.v4.DuplexerApiV4.Publish',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveComWixRealtimeV4DuplexerApiV4Url({\n protoPath: '/publish',\n data: payload,\n host,\n }),\n data: payload,\n };\n\n return metadata;\n }\n\n return __publish;\n}\n","import * as ambassadorWixRealtimeV4Message from './realtime-v4-message-publisher.http.js';\nimport * as ambassadorWixRealtimeV4MessageTypes from './realtime-v4-message-publisher.types.js';\nimport * as ambassadorWixRealtimeV4MessageUniversalTypes from './realtime-v4-message-publisher.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 publish(): __PublicMethodMetaInfo<\n 'POST',\n {},\n ambassadorWixRealtimeV4MessageUniversalTypes.PublishRequest,\n ambassadorWixRealtimeV4MessageTypes.PublishRequest,\n ambassadorWixRealtimeV4MessageUniversalTypes.PublishResponse,\n ambassadorWixRealtimeV4MessageTypes.PublishResponse\n> {\n const payload = {} as any;\n\n const getRequestOptions = ambassadorWixRealtimeV4Message.publish(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: '/publish',\n pathParams: {},\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 Message as MessageOriginal,\n PublisherInfo as PublisherInfoOriginal,\n PublishRequest as PublishRequestOriginal,\n PublishResponse as PublishResponseOriginal,\n PublishToUserRequest as PublishToUserRequestOriginal,\n PublishToUserRequestTargetingOneOf as PublishToUserRequestTargetingOneOfOriginal,\n UserIdList as UserIdListOriginal,\n PublishToUserResponse as PublishToUserResponseOriginal,\n} from './realtime-v4-message-publisher.types.js';\n"],"mappings":";AAAA,SAAS,kBAAkB;AAI3B,SAAS,wCACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,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,mBAAmB;AAAA,MACjB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,EACF;AAEA,SAAO,WAAW,OAAO,OAAO,MAAM,EAAE,iBAAiB,CAAC,CAAC;AAC7D;AAEA,IAAM,eAAe;AAEd,SAAS,QAAQ,SAA6C;AACnE,WAAS,UAAU,EAAE,KAAK,GAAQ;AAChC,UAAM,WAAW;AAAA,MACf,YAAY;AAAA,MACZ,QAAQ;AAAA,MACR,WAAW;AAAA,MACX,aAAa;AAAA,MACb,kBAAkB;AAAA,QAChB,wBAAwB;AAAA,MAC1B;AAAA,MACA,KAAK,wCAAwC;AAAA,QAC3C,WAAW;AAAA,QACX,MAAM;AAAA,QACN;AAAA,MACF,CAAC;AAAA,MACD,MAAM;AAAA,IACR;AAEA,WAAO;AAAA,EACT;AAEA,SAAO;AACT;;;ACvCO,SAASA,WAOd;AACA,QAAM,UAAU,CAAC;AAEjB,QAAM,oBAAmD,QAAQ,OAAO;AAExE,QAAM,SAAS,CAAC,YAAyB;AACvC,UAAM,EAAE,IAAI,IAAI,kBAAkB,OAAO;AACzC,WAAO;AAAA,EACT;AAEA,SAAO;AAAA,IACL;AAAA,IACA,YAAY;AAAA,IACZ,MAAM;AAAA,IACN,YAAY,CAAC;AAAA,IACb,eAAe;AAAA,IACf,uBAAuB;AAAA,IACvB,gBAAgB;AAAA,IAChB,wBAAwB;AAAA,EAC1B;AACF;","names":["publish"]}
@@ -31,7 +31,32 @@ var import_rename_all_nested_keys = require("@wix/sdk-runtime/rename-all-nested-
31
31
  // src/realtime-v4-message-publisher.http.ts
32
32
  var import_rest_modules = require("@wix/sdk-runtime/rest-modules");
33
33
  function resolveComWixRealtimeV4DuplexerApiV4Url(opts) {
34
- const domainToMappings = {};
34
+ const domainToMappings = {
35
+ "api._api_base_domain_": [
36
+ {
37
+ srcPath: "/wix-duplexer-api",
38
+ destPath: ""
39
+ }
40
+ ],
41
+ "www._base_domain_": [
42
+ {
43
+ srcPath: "/_api/wix-duplexer-api",
44
+ destPath: ""
45
+ }
46
+ ],
47
+ "manage._base_domain_": [
48
+ {
49
+ srcPath: "/_api/wix-duplexer-api",
50
+ destPath: ""
51
+ }
52
+ ],
53
+ "www.wixapis.com": [
54
+ {
55
+ srcPath: "/realtime/v4",
56
+ destPath: "/v4"
57
+ }
58
+ ]
59
+ };
35
60
  return (0, import_rest_modules.resolveUrl)(Object.assign(opts, { domainToMappings }));
36
61
  }
37
62
  var PACKAGE_NAME = "@wix/auto_sdk_duplexer_publisher";
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../index.ts","../../../src/realtime-v4-message-publisher.universal.ts","../../../src/realtime-v4-message-publisher.http.ts","../../../src/realtime-v4-message-publisher.public.ts","../../../src/realtime-v4-message-publisher.context.ts"],"sourcesContent":["export * from './src/realtime-v4-message-publisher.context.js';\n","import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport { renameKeysFromSDKRequestToRESTRequest } from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport * as ambassadorWixRealtimeV4Message from './realtime-v4-message-publisher.http.js';\n\nexport interface Message {\n /**\n * Unique message identifier\n * @readonly\n * @format GUID\n */\n _id?: string;\n /**\n * Event name, e.g \"product_added\"\n * @maxLength 1000\n */\n eventName?: string;\n /** Event payload, e.g { \"product_id\": \"123\", \"product_name\": \"Product 1\" } */\n payload?: Record<string, any> | null;\n /** Info regarding the publisher of the message */\n publisherInfo?: PublisherInfo;\n}\n\nexport interface PublisherInfo {\n /**\n * Arbitrary string identifier for the publisher, can be used by subscribers to identify the publisher\n * @maxLength 1000\n */\n uid?: string;\n}\n\nexport interface PublishRequest {\n message: Message;\n /**\n * Channel names to publish to, e.g [\"product_notifications\", \"site_notifications\"]\n * @maxSize 10\n * @maxLength 140\n */\n channels: string[];\n /**\n * Optional sub resource identifier, e.g \"important_notification\", only subscribers to this specific resource will receive the message\n * @maxLength 1000\n */\n resourceId?: string | null;\n}\n\nexport interface PublishResponse {}\n\nexport interface PublishToUserRequest\n extends PublishToUserRequestTargetingOneOf {\n /** list of user ids to receive the message */\n includeRecipients?: UserIdList;\n /** list of user ids to exclude from receiving the message */\n excludeRecipients?: UserIdList;\n message?: Message;\n /**\n * Optional sub resource identifier, e.g \"important_notification\", only subscribers to this specific resource will receive the message\n * @maxLength 1000\n */\n resourceId?: string | null;\n}\n\n/** @oneof */\nexport interface PublishToUserRequestTargetingOneOf {\n /** list of user ids to receive the message */\n includeRecipients?: UserIdList;\n /** list of user ids to exclude from receiving the message */\n excludeRecipients?: UserIdList;\n}\n\nexport interface UserIdList {\n /**\n * @maxSize 1000\n * @maxLength 1000\n */\n userId?: string[];\n}\n\nexport interface PublishToUserResponse {}\n\n/** @public\n * @requiredField message\n * @requiredField message.eventName\n * @requiredField message.payload\n * @requiredField options.channels\n * @permissionId realtime:v4:message:publish\n * @fqn com.wix.realtime.v4.DuplexerApiV4.Publish\n */\nexport async function publish(\n message: NonNullablePaths<Message, `eventName` | `payload`, 2>,\n options?: NonNullablePaths<PublishOptions, `channels`, 2>\n): Promise<void> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[2] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n message: message,\n channels: options?.channels,\n resourceId: options?.resourceId,\n });\n\n const reqOpts = ambassadorWixRealtimeV4Message.publish(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {\n message: '$[0]',\n channels: '$[1].channels',\n resourceId: '$[1].resourceId',\n },\n singleArgumentUnchanged: false,\n },\n ['message', 'options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface PublishOptions {\n /**\n * Channel names to publish to, e.g [\"product_notifications\", \"site_notifications\"]\n * @maxSize 10\n * @maxLength 140\n */\n channels: string[];\n /**\n * Optional sub resource identifier, e.g \"important_notification\", only subscribers to this specific resource will receive the message\n * @maxLength 1000\n */\n resourceId?: string | null;\n}\n","import { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveComWixRealtimeV4DuplexerApiV4Url(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {};\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_duplexer_publisher';\n\nexport function publish(payload: object): RequestOptionsFactory<any> {\n function __publish({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.realtime.v4.message',\n method: 'POST' as any,\n methodFqn: 'com.wix.realtime.v4.DuplexerApiV4.Publish',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveComWixRealtimeV4DuplexerApiV4Url({\n protoPath: '/publish',\n data: payload,\n host,\n }),\n data: payload,\n };\n\n return metadata;\n }\n\n return __publish;\n}\n","import { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport {\n Message,\n PublishOptions,\n publish as universalPublish,\n} from './realtime-v4-message-publisher.universal.js';\n\nexport const __metadata = { PACKAGE_NAME: '@wix/duplexer' };\n\nexport function publish(httpClient: HttpClient): PublishSignature {\n return (\n message: NonNullablePaths<Message, `eventName` | `payload`, 2>,\n options?: NonNullablePaths<PublishOptions, `channels`, 2>\n ) =>\n universalPublish(\n message,\n options,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface PublishSignature {\n /** */\n (\n message: NonNullablePaths<Message, `eventName` | `payload`, 2>,\n options?: NonNullablePaths<PublishOptions, `channels`, 2>\n ): Promise<void>;\n}\n\nexport {\n Message,\n PublishOptions,\n PublishRequest,\n PublishResponse,\n PublishToUserRequest,\n PublishToUserRequestTargetingOneOf,\n PublishToUserResponse,\n PublisherInfo,\n UserIdList,\n} from './realtime-v4-message-publisher.universal.js';\n","import { publish as publicPublish } from './realtime-v4-message-publisher.public.js';\nimport { createRESTModule } from '@wix/sdk-runtime/rest-modules';\nimport { BuildRESTFunction, MaybeContext } from '@wix/sdk-types';\n\nexport const publish: MaybeContext<\n BuildRESTFunction<typeof publicPublish> & typeof publicPublish\n> = /*#__PURE__*/ createRESTModule(publicPublish);\n\nexport {\n Message,\n PublisherInfo,\n PublishRequest,\n PublishResponse,\n PublishToUserRequest,\n PublishToUserRequestTargetingOneOf,\n UserIdList,\n PublishToUserResponse,\n PublishOptions,\n} from './realtime-v4-message-publisher.universal.js';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,iBAAAA;AAAA;AAAA;;;ACAA,6BAAoD;AACpD,oCAAsD;;;ACDtD,0BAA2B;AAI3B,SAAS,wCACP,MACA;AACA,QAAM,mBAAmB,CAAC;AAE1B,aAAO,gCAAW,OAAO,OAAO,MAAM,EAAE,iBAAiB,CAAC,CAAC;AAC7D;AAEA,IAAM,eAAe;AAEd,SAAS,QAAQ,SAA6C;AACnE,WAAS,UAAU,EAAE,KAAK,GAAQ;AAChC,UAAM,WAAW;AAAA,MACf,YAAY;AAAA,MACZ,QAAQ;AAAA,MACR,WAAW;AAAA,MACX,aAAa;AAAA,MACb,kBAAkB;AAAA,QAChB,wBAAwB;AAAA,MAC1B;AAAA,MACA,KAAK,wCAAwC;AAAA,QAC3C,WAAW;AAAA,QACX,MAAM;AAAA,QACN;AAAA,MACF,CAAC;AAAA,MACD,MAAM;AAAA,IACR;AAEA,WAAO;AAAA,EACT;AAEA,SAAO;AACT;;;ADoDA,eAAsBC,SACpB,SACA,SACe;AAEf,QAAM,EAAE,YAAY,YAAY,IAAI,UAAU,CAAC;AAK/C,QAAM,cAAU,qEAAsC;AAAA,IACpD;AAAA,IACA,UAAU,SAAS;AAAA,IACnB,YAAY,SAAS;AAAA,EACvB,CAAC;AAED,QAAM,UAAyC,QAAQ,OAAO;AAE9D,eAAa,aAAa;AAC1B,MAAI;AACF,UAAM,SAAS,MAAM,WAAW,QAAQ,OAAO;AAC/C,iBAAa,YAAY,MAAM;AAAA,EACjC,SAAS,KAAU;AACjB,UAAM,uBAAmB,uBAAAC;AAAA,MACvB;AAAA,MACA;AAAA,QACE,wBAAwB,CAAC;AAAA,QACzB,0BAA0B;AAAA,UACxB,SAAS;AAAA,UACT,UAAU;AAAA,UACV,YAAY;AAAA,QACd;AAAA,QACA,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC,WAAW,SAAS;AAAA,IACvB;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;;;AEvHO,SAASC,SAAQ,YAA0C;AAChE,SAAO,CACL,SACA,YAEAA;AAAA,IACE;AAAA,IACA;AAAA;AAAA,IAEA,EAAE,WAAW;AAAA,EACf;AACJ;;;ACnBA,IAAAC,uBAAiC;AAG1B,IAAMC,WAEK,2DAAiBA,QAAa;","names":["publish","publish","sdkTransformError","publish","import_rest_modules","publish"]}
1
+ {"version":3,"sources":["../../../index.ts","../../../src/realtime-v4-message-publisher.universal.ts","../../../src/realtime-v4-message-publisher.http.ts","../../../src/realtime-v4-message-publisher.public.ts","../../../src/realtime-v4-message-publisher.context.ts"],"sourcesContent":["export * from './src/realtime-v4-message-publisher.context.js';\n","import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport { renameKeysFromSDKRequestToRESTRequest } from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport * as ambassadorWixRealtimeV4Message from './realtime-v4-message-publisher.http.js';\n\nexport interface Message {\n /**\n * Unique message identifier\n * @readonly\n * @format GUID\n */\n _id?: string;\n /**\n * Event name, e.g \"product_added\"\n * @maxLength 1000\n */\n eventName?: string;\n /** Event payload, e.g { \"product_id\": \"123\", \"product_name\": \"Product 1\" } */\n payload?: Record<string, any> | null;\n /** Info regarding the publisher of the message */\n publisherInfo?: PublisherInfo;\n}\n\nexport interface PublisherInfo {\n /**\n * Arbitrary string identifier for the publisher, can be used by subscribers to identify the publisher\n * @maxLength 1000\n */\n uid?: string;\n}\n\nexport interface PublishRequest {\n message: Message;\n /**\n * Channel names to publish to, e.g [\"product_notifications\", \"site_notifications\"]\n * @maxSize 10\n * @maxLength 140\n */\n channels: string[];\n /**\n * Optional sub resource identifier, e.g \"important_notification\", only subscribers to this specific resource will receive the message\n * @maxLength 1000\n */\n resourceId?: string | null;\n}\n\nexport interface PublishResponse {}\n\nexport interface PublishToUserRequest\n extends PublishToUserRequestTargetingOneOf {\n /** list of user ids to receive the message */\n includeRecipients?: UserIdList;\n /** list of user ids to exclude from receiving the message */\n excludeRecipients?: UserIdList;\n message?: Message;\n /**\n * Optional sub resource identifier, e.g \"important_notification\", only subscribers to this specific resource will receive the message\n * @maxLength 1000\n */\n resourceId?: string | null;\n}\n\n/** @oneof */\nexport interface PublishToUserRequestTargetingOneOf {\n /** list of user ids to receive the message */\n includeRecipients?: UserIdList;\n /** list of user ids to exclude from receiving the message */\n excludeRecipients?: UserIdList;\n}\n\nexport interface UserIdList {\n /**\n * @maxSize 1000\n * @maxLength 1000\n */\n userId?: string[];\n}\n\nexport interface PublishToUserResponse {}\n\n/** @public\n * @requiredField message\n * @requiredField message.eventName\n * @requiredField message.payload\n * @requiredField options.channels\n * @permissionId realtime:v4:message:publish\n * @fqn com.wix.realtime.v4.DuplexerApiV4.Publish\n */\nexport async function publish(\n message: NonNullablePaths<Message, `eventName` | `payload`, 2>,\n options?: NonNullablePaths<PublishOptions, `channels`, 2>\n): Promise<void> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[2] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n message: message,\n channels: options?.channels,\n resourceId: options?.resourceId,\n });\n\n const reqOpts = ambassadorWixRealtimeV4Message.publish(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {\n message: '$[0]',\n channels: '$[1].channels',\n resourceId: '$[1].resourceId',\n },\n singleArgumentUnchanged: false,\n },\n ['message', 'options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface PublishOptions {\n /**\n * Channel names to publish to, e.g [\"product_notifications\", \"site_notifications\"]\n * @maxSize 10\n * @maxLength 140\n */\n channels: string[];\n /**\n * Optional sub resource identifier, e.g \"important_notification\", only subscribers to this specific resource will receive the message\n * @maxLength 1000\n */\n resourceId?: string | null;\n}\n","import { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveComWixRealtimeV4DuplexerApiV4Url(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'api._api_base_domain_': [\n {\n srcPath: '/wix-duplexer-api',\n destPath: '',\n },\n ],\n 'www._base_domain_': [\n {\n srcPath: '/_api/wix-duplexer-api',\n destPath: '',\n },\n ],\n 'manage._base_domain_': [\n {\n srcPath: '/_api/wix-duplexer-api',\n destPath: '',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/realtime/v4',\n destPath: '/v4',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_duplexer_publisher';\n\nexport function publish(payload: object): RequestOptionsFactory<any> {\n function __publish({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.realtime.v4.message',\n method: 'POST' as any,\n methodFqn: 'com.wix.realtime.v4.DuplexerApiV4.Publish',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveComWixRealtimeV4DuplexerApiV4Url({\n protoPath: '/publish',\n data: payload,\n host,\n }),\n data: payload,\n };\n\n return metadata;\n }\n\n return __publish;\n}\n","import { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport {\n Message,\n PublishOptions,\n publish as universalPublish,\n} from './realtime-v4-message-publisher.universal.js';\n\nexport const __metadata = { PACKAGE_NAME: '@wix/duplexer' };\n\nexport function publish(httpClient: HttpClient): PublishSignature {\n return (\n message: NonNullablePaths<Message, `eventName` | `payload`, 2>,\n options?: NonNullablePaths<PublishOptions, `channels`, 2>\n ) =>\n universalPublish(\n message,\n options,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface PublishSignature {\n /** */\n (\n message: NonNullablePaths<Message, `eventName` | `payload`, 2>,\n options?: NonNullablePaths<PublishOptions, `channels`, 2>\n ): Promise<void>;\n}\n\nexport {\n Message,\n PublishOptions,\n PublishRequest,\n PublishResponse,\n PublishToUserRequest,\n PublishToUserRequestTargetingOneOf,\n PublishToUserResponse,\n PublisherInfo,\n UserIdList,\n} from './realtime-v4-message-publisher.universal.js';\n","import { publish as publicPublish } from './realtime-v4-message-publisher.public.js';\nimport { createRESTModule } from '@wix/sdk-runtime/rest-modules';\nimport { BuildRESTFunction, MaybeContext } from '@wix/sdk-types';\n\nexport const publish: MaybeContext<\n BuildRESTFunction<typeof publicPublish> & typeof publicPublish\n> = /*#__PURE__*/ createRESTModule(publicPublish);\n\nexport {\n Message,\n PublisherInfo,\n PublishRequest,\n PublishResponse,\n PublishToUserRequest,\n PublishToUserRequestTargetingOneOf,\n UserIdList,\n PublishToUserResponse,\n PublishOptions,\n} from './realtime-v4-message-publisher.universal.js';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,iBAAAA;AAAA;AAAA;;;ACAA,6BAAoD;AACpD,oCAAsD;;;ACDtD,0BAA2B;AAI3B,SAAS,wCACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,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,mBAAmB;AAAA,MACjB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,EACF;AAEA,aAAO,gCAAW,OAAO,OAAO,MAAM,EAAE,iBAAiB,CAAC,CAAC;AAC7D;AAEA,IAAM,eAAe;AAEd,SAAS,QAAQ,SAA6C;AACnE,WAAS,UAAU,EAAE,KAAK,GAAQ;AAChC,UAAM,WAAW;AAAA,MACf,YAAY;AAAA,MACZ,QAAQ;AAAA,MACR,WAAW;AAAA,MACX,aAAa;AAAA,MACb,kBAAkB;AAAA,QAChB,wBAAwB;AAAA,MAC1B;AAAA,MACA,KAAK,wCAAwC;AAAA,QAC3C,WAAW;AAAA,QACX,MAAM;AAAA,QACN;AAAA,MACF,CAAC;AAAA,MACD,MAAM;AAAA,IACR;AAEA,WAAO;AAAA,EACT;AAEA,SAAO;AACT;;;AD2BA,eAAsBC,SACpB,SACA,SACe;AAEf,QAAM,EAAE,YAAY,YAAY,IAAI,UAAU,CAAC;AAK/C,QAAM,cAAU,qEAAsC;AAAA,IACpD;AAAA,IACA,UAAU,SAAS;AAAA,IACnB,YAAY,SAAS;AAAA,EACvB,CAAC;AAED,QAAM,UAAyC,QAAQ,OAAO;AAE9D,eAAa,aAAa;AAC1B,MAAI;AACF,UAAM,SAAS,MAAM,WAAW,QAAQ,OAAO;AAC/C,iBAAa,YAAY,MAAM;AAAA,EACjC,SAAS,KAAU;AACjB,UAAM,uBAAmB,uBAAAC;AAAA,MACvB;AAAA,MACA;AAAA,QACE,wBAAwB,CAAC;AAAA,QACzB,0BAA0B;AAAA,UACxB,SAAS;AAAA,UACT,UAAU;AAAA,UACV,YAAY;AAAA,QACd;AAAA,QACA,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC,WAAW,SAAS;AAAA,IACvB;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;;;AEvHO,SAASC,SAAQ,YAA0C;AAChE,SAAO,CACL,SACA,YAEAA;AAAA,IACE;AAAA,IACA;AAAA;AAAA,IAEA,EAAE,WAAW;AAAA,EACf;AACJ;;;ACnBA,IAAAC,uBAAiC;AAG1B,IAAMC,WAEK,2DAAiBA,QAAa;","names":["publish","publish","sdkTransformError","publish","import_rest_modules","publish"]}
@@ -31,7 +31,32 @@ var import_rename_all_nested_keys = require("@wix/sdk-runtime/rename-all-nested-
31
31
  // src/realtime-v4-message-publisher.http.ts
32
32
  var import_rest_modules = require("@wix/sdk-runtime/rest-modules");
33
33
  function resolveComWixRealtimeV4DuplexerApiV4Url(opts) {
34
- const domainToMappings = {};
34
+ const domainToMappings = {
35
+ "api._api_base_domain_": [
36
+ {
37
+ srcPath: "/wix-duplexer-api",
38
+ destPath: ""
39
+ }
40
+ ],
41
+ "www._base_domain_": [
42
+ {
43
+ srcPath: "/_api/wix-duplexer-api",
44
+ destPath: ""
45
+ }
46
+ ],
47
+ "manage._base_domain_": [
48
+ {
49
+ srcPath: "/_api/wix-duplexer-api",
50
+ destPath: ""
51
+ }
52
+ ],
53
+ "www.wixapis.com": [
54
+ {
55
+ srcPath: "/realtime/v4",
56
+ destPath: "/v4"
57
+ }
58
+ ]
59
+ };
35
60
  return (0, import_rest_modules.resolveUrl)(Object.assign(opts, { domainToMappings }));
36
61
  }
37
62
  var PACKAGE_NAME = "@wix/auto_sdk_duplexer_publisher";
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../index.typings.ts","../../../src/realtime-v4-message-publisher.universal.ts","../../../src/realtime-v4-message-publisher.http.ts"],"sourcesContent":["export * from './src/realtime-v4-message-publisher.universal.js';\n","import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport { renameKeysFromSDKRequestToRESTRequest } from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport * as ambassadorWixRealtimeV4Message from './realtime-v4-message-publisher.http.js';\n\nexport interface Message {\n /**\n * Unique message identifier\n * @readonly\n * @format GUID\n */\n _id?: string;\n /**\n * Event name, e.g \"product_added\"\n * @maxLength 1000\n */\n eventName?: string;\n /** Event payload, e.g { \"product_id\": \"123\", \"product_name\": \"Product 1\" } */\n payload?: Record<string, any> | null;\n /** Info regarding the publisher of the message */\n publisherInfo?: PublisherInfo;\n}\n\nexport interface PublisherInfo {\n /**\n * Arbitrary string identifier for the publisher, can be used by subscribers to identify the publisher\n * @maxLength 1000\n */\n uid?: string;\n}\n\nexport interface PublishRequest {\n message: Message;\n /**\n * Channel names to publish to, e.g [\"product_notifications\", \"site_notifications\"]\n * @maxSize 10\n * @maxLength 140\n */\n channels: string[];\n /**\n * Optional sub resource identifier, e.g \"important_notification\", only subscribers to this specific resource will receive the message\n * @maxLength 1000\n */\n resourceId?: string | null;\n}\n\nexport interface PublishResponse {}\n\nexport interface PublishToUserRequest\n extends PublishToUserRequestTargetingOneOf {\n /** list of user ids to receive the message */\n includeRecipients?: UserIdList;\n /** list of user ids to exclude from receiving the message */\n excludeRecipients?: UserIdList;\n message?: Message;\n /**\n * Optional sub resource identifier, e.g \"important_notification\", only subscribers to this specific resource will receive the message\n * @maxLength 1000\n */\n resourceId?: string | null;\n}\n\n/** @oneof */\nexport interface PublishToUserRequestTargetingOneOf {\n /** list of user ids to receive the message */\n includeRecipients?: UserIdList;\n /** list of user ids to exclude from receiving the message */\n excludeRecipients?: UserIdList;\n}\n\nexport interface UserIdList {\n /**\n * @maxSize 1000\n * @maxLength 1000\n */\n userId?: string[];\n}\n\nexport interface PublishToUserResponse {}\n\n/** @public\n * @requiredField message\n * @requiredField message.eventName\n * @requiredField message.payload\n * @requiredField options.channels\n * @permissionId realtime:v4:message:publish\n * @fqn com.wix.realtime.v4.DuplexerApiV4.Publish\n */\nexport async function publish(\n message: NonNullablePaths<Message, `eventName` | `payload`, 2>,\n options?: NonNullablePaths<PublishOptions, `channels`, 2>\n): Promise<void> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[2] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n message: message,\n channels: options?.channels,\n resourceId: options?.resourceId,\n });\n\n const reqOpts = ambassadorWixRealtimeV4Message.publish(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {\n message: '$[0]',\n channels: '$[1].channels',\n resourceId: '$[1].resourceId',\n },\n singleArgumentUnchanged: false,\n },\n ['message', 'options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface PublishOptions {\n /**\n * Channel names to publish to, e.g [\"product_notifications\", \"site_notifications\"]\n * @maxSize 10\n * @maxLength 140\n */\n channels: string[];\n /**\n * Optional sub resource identifier, e.g \"important_notification\", only subscribers to this specific resource will receive the message\n * @maxLength 1000\n */\n resourceId?: string | null;\n}\n","import { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveComWixRealtimeV4DuplexerApiV4Url(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {};\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_duplexer_publisher';\n\nexport function publish(payload: object): RequestOptionsFactory<any> {\n function __publish({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.realtime.v4.message',\n method: 'POST' as any,\n methodFqn: 'com.wix.realtime.v4.DuplexerApiV4.Publish',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveComWixRealtimeV4DuplexerApiV4Url({\n protoPath: '/publish',\n data: payload,\n host,\n }),\n data: payload,\n };\n\n return metadata;\n }\n\n return __publish;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,iBAAAA;AAAA;AAAA;;;ACAA,6BAAoD;AACpD,oCAAsD;;;ACDtD,0BAA2B;AAI3B,SAAS,wCACP,MACA;AACA,QAAM,mBAAmB,CAAC;AAE1B,aAAO,gCAAW,OAAO,OAAO,MAAM,EAAE,iBAAiB,CAAC,CAAC;AAC7D;AAEA,IAAM,eAAe;AAEd,SAAS,QAAQ,SAA6C;AACnE,WAAS,UAAU,EAAE,KAAK,GAAQ;AAChC,UAAM,WAAW;AAAA,MACf,YAAY;AAAA,MACZ,QAAQ;AAAA,MACR,WAAW;AAAA,MACX,aAAa;AAAA,MACb,kBAAkB;AAAA,QAChB,wBAAwB;AAAA,MAC1B;AAAA,MACA,KAAK,wCAAwC;AAAA,QAC3C,WAAW;AAAA,QACX,MAAM;AAAA,QACN;AAAA,MACF,CAAC;AAAA,MACD,MAAM;AAAA,IACR;AAEA,WAAO;AAAA,EACT;AAEA,SAAO;AACT;;;ADoDA,eAAsBC,SACpB,SACA,SACe;AAEf,QAAM,EAAE,YAAY,YAAY,IAAI,UAAU,CAAC;AAK/C,QAAM,cAAU,qEAAsC;AAAA,IACpD;AAAA,IACA,UAAU,SAAS;AAAA,IACnB,YAAY,SAAS;AAAA,EACvB,CAAC;AAED,QAAM,UAAyC,QAAQ,OAAO;AAE9D,eAAa,aAAa;AAC1B,MAAI;AACF,UAAM,SAAS,MAAM,WAAW,QAAQ,OAAO;AAC/C,iBAAa,YAAY,MAAM;AAAA,EACjC,SAAS,KAAU;AACjB,UAAM,uBAAmB,uBAAAC;AAAA,MACvB;AAAA,MACA;AAAA,QACE,wBAAwB,CAAC;AAAA,QACzB,0BAA0B;AAAA,UACxB,SAAS;AAAA,UACT,UAAU;AAAA,UACV,YAAY;AAAA,QACd;AAAA,QACA,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC,WAAW,SAAS;AAAA,IACvB;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;","names":["publish","publish","sdkTransformError"]}
1
+ {"version":3,"sources":["../../../index.typings.ts","../../../src/realtime-v4-message-publisher.universal.ts","../../../src/realtime-v4-message-publisher.http.ts"],"sourcesContent":["export * from './src/realtime-v4-message-publisher.universal.js';\n","import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport { renameKeysFromSDKRequestToRESTRequest } from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport * as ambassadorWixRealtimeV4Message from './realtime-v4-message-publisher.http.js';\n\nexport interface Message {\n /**\n * Unique message identifier\n * @readonly\n * @format GUID\n */\n _id?: string;\n /**\n * Event name, e.g \"product_added\"\n * @maxLength 1000\n */\n eventName?: string;\n /** Event payload, e.g { \"product_id\": \"123\", \"product_name\": \"Product 1\" } */\n payload?: Record<string, any> | null;\n /** Info regarding the publisher of the message */\n publisherInfo?: PublisherInfo;\n}\n\nexport interface PublisherInfo {\n /**\n * Arbitrary string identifier for the publisher, can be used by subscribers to identify the publisher\n * @maxLength 1000\n */\n uid?: string;\n}\n\nexport interface PublishRequest {\n message: Message;\n /**\n * Channel names to publish to, e.g [\"product_notifications\", \"site_notifications\"]\n * @maxSize 10\n * @maxLength 140\n */\n channels: string[];\n /**\n * Optional sub resource identifier, e.g \"important_notification\", only subscribers to this specific resource will receive the message\n * @maxLength 1000\n */\n resourceId?: string | null;\n}\n\nexport interface PublishResponse {}\n\nexport interface PublishToUserRequest\n extends PublishToUserRequestTargetingOneOf {\n /** list of user ids to receive the message */\n includeRecipients?: UserIdList;\n /** list of user ids to exclude from receiving the message */\n excludeRecipients?: UserIdList;\n message?: Message;\n /**\n * Optional sub resource identifier, e.g \"important_notification\", only subscribers to this specific resource will receive the message\n * @maxLength 1000\n */\n resourceId?: string | null;\n}\n\n/** @oneof */\nexport interface PublishToUserRequestTargetingOneOf {\n /** list of user ids to receive the message */\n includeRecipients?: UserIdList;\n /** list of user ids to exclude from receiving the message */\n excludeRecipients?: UserIdList;\n}\n\nexport interface UserIdList {\n /**\n * @maxSize 1000\n * @maxLength 1000\n */\n userId?: string[];\n}\n\nexport interface PublishToUserResponse {}\n\n/** @public\n * @requiredField message\n * @requiredField message.eventName\n * @requiredField message.payload\n * @requiredField options.channels\n * @permissionId realtime:v4:message:publish\n * @fqn com.wix.realtime.v4.DuplexerApiV4.Publish\n */\nexport async function publish(\n message: NonNullablePaths<Message, `eventName` | `payload`, 2>,\n options?: NonNullablePaths<PublishOptions, `channels`, 2>\n): Promise<void> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[2] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n message: message,\n channels: options?.channels,\n resourceId: options?.resourceId,\n });\n\n const reqOpts = ambassadorWixRealtimeV4Message.publish(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {\n message: '$[0]',\n channels: '$[1].channels',\n resourceId: '$[1].resourceId',\n },\n singleArgumentUnchanged: false,\n },\n ['message', 'options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface PublishOptions {\n /**\n * Channel names to publish to, e.g [\"product_notifications\", \"site_notifications\"]\n * @maxSize 10\n * @maxLength 140\n */\n channels: string[];\n /**\n * Optional sub resource identifier, e.g \"important_notification\", only subscribers to this specific resource will receive the message\n * @maxLength 1000\n */\n resourceId?: string | null;\n}\n","import { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveComWixRealtimeV4DuplexerApiV4Url(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'api._api_base_domain_': [\n {\n srcPath: '/wix-duplexer-api',\n destPath: '',\n },\n ],\n 'www._base_domain_': [\n {\n srcPath: '/_api/wix-duplexer-api',\n destPath: '',\n },\n ],\n 'manage._base_domain_': [\n {\n srcPath: '/_api/wix-duplexer-api',\n destPath: '',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/realtime/v4',\n destPath: '/v4',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_duplexer_publisher';\n\nexport function publish(payload: object): RequestOptionsFactory<any> {\n function __publish({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.realtime.v4.message',\n method: 'POST' as any,\n methodFqn: 'com.wix.realtime.v4.DuplexerApiV4.Publish',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveComWixRealtimeV4DuplexerApiV4Url({\n protoPath: '/publish',\n data: payload,\n host,\n }),\n data: payload,\n };\n\n return metadata;\n }\n\n return __publish;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,iBAAAA;AAAA;AAAA;;;ACAA,6BAAoD;AACpD,oCAAsD;;;ACDtD,0BAA2B;AAI3B,SAAS,wCACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,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,mBAAmB;AAAA,MACjB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,EACF;AAEA,aAAO,gCAAW,OAAO,OAAO,MAAM,EAAE,iBAAiB,CAAC,CAAC;AAC7D;AAEA,IAAM,eAAe;AAEd,SAAS,QAAQ,SAA6C;AACnE,WAAS,UAAU,EAAE,KAAK,GAAQ;AAChC,UAAM,WAAW;AAAA,MACf,YAAY;AAAA,MACZ,QAAQ;AAAA,MACR,WAAW;AAAA,MACX,aAAa;AAAA,MACb,kBAAkB;AAAA,QAChB,wBAAwB;AAAA,MAC1B;AAAA,MACA,KAAK,wCAAwC;AAAA,QAC3C,WAAW;AAAA,QACX,MAAM;AAAA,QACN;AAAA,MACF,CAAC;AAAA,MACD,MAAM;AAAA,IACR;AAEA,WAAO;AAAA,EACT;AAEA,SAAO;AACT;;;AD2BA,eAAsBC,SACpB,SACA,SACe;AAEf,QAAM,EAAE,YAAY,YAAY,IAAI,UAAU,CAAC;AAK/C,QAAM,cAAU,qEAAsC;AAAA,IACpD;AAAA,IACA,UAAU,SAAS;AAAA,IACnB,YAAY,SAAS;AAAA,EACvB,CAAC;AAED,QAAM,UAAyC,QAAQ,OAAO;AAE9D,eAAa,aAAa;AAC1B,MAAI;AACF,UAAM,SAAS,MAAM,WAAW,QAAQ,OAAO;AAC/C,iBAAa,YAAY,MAAM;AAAA,EACjC,SAAS,KAAU;AACjB,UAAM,uBAAmB,uBAAAC;AAAA,MACvB;AAAA,MACA;AAAA,QACE,wBAAwB,CAAC;AAAA,QACzB,0BAA0B;AAAA,UACxB,SAAS;AAAA,UACT,UAAU;AAAA,UACV,YAAY;AAAA,QACd;AAAA,QACA,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC,WAAW,SAAS;AAAA,IACvB;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;","names":["publish","publish","sdkTransformError"]}
@@ -27,7 +27,32 @@ module.exports = __toCommonJS(meta_exports);
27
27
  // src/realtime-v4-message-publisher.http.ts
28
28
  var import_rest_modules = require("@wix/sdk-runtime/rest-modules");
29
29
  function resolveComWixRealtimeV4DuplexerApiV4Url(opts) {
30
- const domainToMappings = {};
30
+ const domainToMappings = {
31
+ "api._api_base_domain_": [
32
+ {
33
+ srcPath: "/wix-duplexer-api",
34
+ destPath: ""
35
+ }
36
+ ],
37
+ "www._base_domain_": [
38
+ {
39
+ srcPath: "/_api/wix-duplexer-api",
40
+ destPath: ""
41
+ }
42
+ ],
43
+ "manage._base_domain_": [
44
+ {
45
+ srcPath: "/_api/wix-duplexer-api",
46
+ destPath: ""
47
+ }
48
+ ],
49
+ "www.wixapis.com": [
50
+ {
51
+ srcPath: "/realtime/v4",
52
+ destPath: "/v4"
53
+ }
54
+ ]
55
+ };
31
56
  return (0, import_rest_modules.resolveUrl)(Object.assign(opts, { domainToMappings }));
32
57
  }
33
58
  var PACKAGE_NAME = "@wix/auto_sdk_duplexer_publisher";
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../meta.ts","../../../src/realtime-v4-message-publisher.http.ts","../../../src/realtime-v4-message-publisher.meta.ts"],"sourcesContent":["export * from './src/realtime-v4-message-publisher.meta.js';\n","import { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveComWixRealtimeV4DuplexerApiV4Url(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {};\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_duplexer_publisher';\n\nexport function publish(payload: object): RequestOptionsFactory<any> {\n function __publish({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.realtime.v4.message',\n method: 'POST' as any,\n methodFqn: 'com.wix.realtime.v4.DuplexerApiV4.Publish',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveComWixRealtimeV4DuplexerApiV4Url({\n protoPath: '/publish',\n data: payload,\n host,\n }),\n data: payload,\n };\n\n return metadata;\n }\n\n return __publish;\n}\n","import * as ambassadorWixRealtimeV4Message from './realtime-v4-message-publisher.http.js';\nimport * as ambassadorWixRealtimeV4MessageTypes from './realtime-v4-message-publisher.types.js';\nimport * as ambassadorWixRealtimeV4MessageUniversalTypes from './realtime-v4-message-publisher.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 publish(): __PublicMethodMetaInfo<\n 'POST',\n {},\n ambassadorWixRealtimeV4MessageUniversalTypes.PublishRequest,\n ambassadorWixRealtimeV4MessageTypes.PublishRequest,\n ambassadorWixRealtimeV4MessageUniversalTypes.PublishResponse,\n ambassadorWixRealtimeV4MessageTypes.PublishResponse\n> {\n const payload = {} as any;\n\n const getRequestOptions = ambassadorWixRealtimeV4Message.publish(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: '/publish',\n pathParams: {},\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 Message as MessageOriginal,\n PublisherInfo as PublisherInfoOriginal,\n PublishRequest as PublishRequestOriginal,\n PublishResponse as PublishResponseOriginal,\n PublishToUserRequest as PublishToUserRequestOriginal,\n PublishToUserRequestTargetingOneOf as PublishToUserRequestTargetingOneOfOriginal,\n UserIdList as UserIdListOriginal,\n PublishToUserResponse as PublishToUserResponseOriginal,\n} from './realtime-v4-message-publisher.types.js';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,iBAAAA;AAAA;AAAA;;;ACAA,0BAA2B;AAI3B,SAAS,wCACP,MACA;AACA,QAAM,mBAAmB,CAAC;AAE1B,aAAO,gCAAW,OAAO,OAAO,MAAM,EAAE,iBAAiB,CAAC,CAAC;AAC7D;AAEA,IAAM,eAAe;AAEd,SAAS,QAAQ,SAA6C;AACnE,WAAS,UAAU,EAAE,KAAK,GAAQ;AAChC,UAAM,WAAW;AAAA,MACf,YAAY;AAAA,MACZ,QAAQ;AAAA,MACR,WAAW;AAAA,MACX,aAAa;AAAA,MACb,kBAAkB;AAAA,QAChB,wBAAwB;AAAA,MAC1B;AAAA,MACA,KAAK,wCAAwC;AAAA,QAC3C,WAAW;AAAA,QACX,MAAM;AAAA,QACN;AAAA,MACF,CAAC;AAAA,MACD,MAAM;AAAA,IACR;AAEA,WAAO;AAAA,EACT;AAEA,SAAO;AACT;;;ACdO,SAASC,WAOd;AACA,QAAM,UAAU,CAAC;AAEjB,QAAM,oBAAmD,QAAQ,OAAO;AAExE,QAAM,SAAS,CAAC,YAAyB;AACvC,UAAM,EAAE,IAAI,IAAI,kBAAkB,OAAO;AACzC,WAAO;AAAA,EACT;AAEA,SAAO;AAAA,IACL;AAAA,IACA,YAAY;AAAA,IACZ,MAAM;AAAA,IACN,YAAY,CAAC;AAAA,IACb,eAAe;AAAA,IACf,uBAAuB;AAAA,IACvB,gBAAgB;AAAA,IAChB,wBAAwB;AAAA,EAC1B;AACF;","names":["publish","publish"]}
1
+ {"version":3,"sources":["../../../meta.ts","../../../src/realtime-v4-message-publisher.http.ts","../../../src/realtime-v4-message-publisher.meta.ts"],"sourcesContent":["export * from './src/realtime-v4-message-publisher.meta.js';\n","import { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveComWixRealtimeV4DuplexerApiV4Url(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'api._api_base_domain_': [\n {\n srcPath: '/wix-duplexer-api',\n destPath: '',\n },\n ],\n 'www._base_domain_': [\n {\n srcPath: '/_api/wix-duplexer-api',\n destPath: '',\n },\n ],\n 'manage._base_domain_': [\n {\n srcPath: '/_api/wix-duplexer-api',\n destPath: '',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/realtime/v4',\n destPath: '/v4',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_duplexer_publisher';\n\nexport function publish(payload: object): RequestOptionsFactory<any> {\n function __publish({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.realtime.v4.message',\n method: 'POST' as any,\n methodFqn: 'com.wix.realtime.v4.DuplexerApiV4.Publish',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveComWixRealtimeV4DuplexerApiV4Url({\n protoPath: '/publish',\n data: payload,\n host,\n }),\n data: payload,\n };\n\n return metadata;\n }\n\n return __publish;\n}\n","import * as ambassadorWixRealtimeV4Message from './realtime-v4-message-publisher.http.js';\nimport * as ambassadorWixRealtimeV4MessageTypes from './realtime-v4-message-publisher.types.js';\nimport * as ambassadorWixRealtimeV4MessageUniversalTypes from './realtime-v4-message-publisher.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 publish(): __PublicMethodMetaInfo<\n 'POST',\n {},\n ambassadorWixRealtimeV4MessageUniversalTypes.PublishRequest,\n ambassadorWixRealtimeV4MessageTypes.PublishRequest,\n ambassadorWixRealtimeV4MessageUniversalTypes.PublishResponse,\n ambassadorWixRealtimeV4MessageTypes.PublishResponse\n> {\n const payload = {} as any;\n\n const getRequestOptions = ambassadorWixRealtimeV4Message.publish(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: '/publish',\n pathParams: {},\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 Message as MessageOriginal,\n PublisherInfo as PublisherInfoOriginal,\n PublishRequest as PublishRequestOriginal,\n PublishResponse as PublishResponseOriginal,\n PublishToUserRequest as PublishToUserRequestOriginal,\n PublishToUserRequestTargetingOneOf as PublishToUserRequestTargetingOneOfOriginal,\n UserIdList as UserIdListOriginal,\n PublishToUserResponse as PublishToUserResponseOriginal,\n} from './realtime-v4-message-publisher.types.js';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,iBAAAA;AAAA;AAAA;;;ACAA,0BAA2B;AAI3B,SAAS,wCACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,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,mBAAmB;AAAA,MACjB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,EACF;AAEA,aAAO,gCAAW,OAAO,OAAO,MAAM,EAAE,iBAAiB,CAAC,CAAC;AAC7D;AAEA,IAAM,eAAe;AAEd,SAAS,QAAQ,SAA6C;AACnE,WAAS,UAAU,EAAE,KAAK,GAAQ;AAChC,UAAM,WAAW;AAAA,MACf,YAAY;AAAA,MACZ,QAAQ;AAAA,MACR,WAAW;AAAA,MACX,aAAa;AAAA,MACb,kBAAkB;AAAA,QAChB,wBAAwB;AAAA,MAC1B;AAAA,MACA,KAAK,wCAAwC;AAAA,QAC3C,WAAW;AAAA,QACX,MAAM;AAAA,QACN;AAAA,MACF,CAAC;AAAA,MACD,MAAM;AAAA,IACR;AAEA,WAAO;AAAA,EACT;AAEA,SAAO;AACT;;;ACvCO,SAASC,WAOd;AACA,QAAM,UAAU,CAAC;AAEjB,QAAM,oBAAmD,QAAQ,OAAO;AAExE,QAAM,SAAS,CAAC,YAAyB;AACvC,UAAM,EAAE,IAAI,IAAI,kBAAkB,OAAO;AACzC,WAAO;AAAA,EACT;AAEA,SAAO;AAAA,IACL;AAAA,IACA,YAAY;AAAA,IACZ,MAAM;AAAA,IACN,YAAY,CAAC;AAAA,IACb,eAAe;AAAA,IACf,uBAAuB;AAAA,IACvB,gBAAgB;AAAA,IAChB,wBAAwB;AAAA,EAC1B;AACF;","names":["publish","publish"]}
@@ -5,7 +5,32 @@ import { renameKeysFromSDKRequestToRESTRequest } from "@wix/sdk-runtime/rename-a
5
5
  // src/realtime-v4-message-publisher.http.ts
6
6
  import { resolveUrl } from "@wix/sdk-runtime/rest-modules";
7
7
  function resolveComWixRealtimeV4DuplexerApiV4Url(opts) {
8
- const domainToMappings = {};
8
+ const domainToMappings = {
9
+ "api._api_base_domain_": [
10
+ {
11
+ srcPath: "/wix-duplexer-api",
12
+ destPath: ""
13
+ }
14
+ ],
15
+ "www._base_domain_": [
16
+ {
17
+ srcPath: "/_api/wix-duplexer-api",
18
+ destPath: ""
19
+ }
20
+ ],
21
+ "manage._base_domain_": [
22
+ {
23
+ srcPath: "/_api/wix-duplexer-api",
24
+ destPath: ""
25
+ }
26
+ ],
27
+ "www.wixapis.com": [
28
+ {
29
+ srcPath: "/realtime/v4",
30
+ destPath: "/v4"
31
+ }
32
+ ]
33
+ };
9
34
  return resolveUrl(Object.assign(opts, { domainToMappings }));
10
35
  }
11
36
  var PACKAGE_NAME = "@wix/auto_sdk_duplexer_publisher";
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/realtime-v4-message-publisher.universal.ts","../../../src/realtime-v4-message-publisher.http.ts","../../../src/realtime-v4-message-publisher.public.ts","../../../src/realtime-v4-message-publisher.context.ts"],"sourcesContent":["import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport { renameKeysFromSDKRequestToRESTRequest } from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport * as ambassadorWixRealtimeV4Message from './realtime-v4-message-publisher.http.js';\n\nexport interface Message {\n /**\n * Unique message identifier\n * @readonly\n * @format GUID\n */\n _id?: string;\n /**\n * Event name, e.g \"product_added\"\n * @maxLength 1000\n */\n eventName?: string;\n /** Event payload, e.g { \"product_id\": \"123\", \"product_name\": \"Product 1\" } */\n payload?: Record<string, any> | null;\n /** Info regarding the publisher of the message */\n publisherInfo?: PublisherInfo;\n}\n\nexport interface PublisherInfo {\n /**\n * Arbitrary string identifier for the publisher, can be used by subscribers to identify the publisher\n * @maxLength 1000\n */\n uid?: string;\n}\n\nexport interface PublishRequest {\n message: Message;\n /**\n * Channel names to publish to, e.g [\"product_notifications\", \"site_notifications\"]\n * @maxSize 10\n * @maxLength 140\n */\n channels: string[];\n /**\n * Optional sub resource identifier, e.g \"important_notification\", only subscribers to this specific resource will receive the message\n * @maxLength 1000\n */\n resourceId?: string | null;\n}\n\nexport interface PublishResponse {}\n\nexport interface PublishToUserRequest\n extends PublishToUserRequestTargetingOneOf {\n /** list of user ids to receive the message */\n includeRecipients?: UserIdList;\n /** list of user ids to exclude from receiving the message */\n excludeRecipients?: UserIdList;\n message?: Message;\n /**\n * Optional sub resource identifier, e.g \"important_notification\", only subscribers to this specific resource will receive the message\n * @maxLength 1000\n */\n resourceId?: string | null;\n}\n\n/** @oneof */\nexport interface PublishToUserRequestTargetingOneOf {\n /** list of user ids to receive the message */\n includeRecipients?: UserIdList;\n /** list of user ids to exclude from receiving the message */\n excludeRecipients?: UserIdList;\n}\n\nexport interface UserIdList {\n /**\n * @maxSize 1000\n * @maxLength 1000\n */\n userId?: string[];\n}\n\nexport interface PublishToUserResponse {}\n\n/** @public\n * @requiredField message\n * @requiredField message.eventName\n * @requiredField message.payload\n * @requiredField options.channels\n * @permissionId realtime:v4:message:publish\n * @fqn com.wix.realtime.v4.DuplexerApiV4.Publish\n */\nexport async function publish(\n message: NonNullablePaths<Message, `eventName` | `payload`, 2>,\n options?: NonNullablePaths<PublishOptions, `channels`, 2>\n): Promise<void> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[2] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n message: message,\n channels: options?.channels,\n resourceId: options?.resourceId,\n });\n\n const reqOpts = ambassadorWixRealtimeV4Message.publish(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {\n message: '$[0]',\n channels: '$[1].channels',\n resourceId: '$[1].resourceId',\n },\n singleArgumentUnchanged: false,\n },\n ['message', 'options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface PublishOptions {\n /**\n * Channel names to publish to, e.g [\"product_notifications\", \"site_notifications\"]\n * @maxSize 10\n * @maxLength 140\n */\n channels: string[];\n /**\n * Optional sub resource identifier, e.g \"important_notification\", only subscribers to this specific resource will receive the message\n * @maxLength 1000\n */\n resourceId?: string | null;\n}\n","import { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveComWixRealtimeV4DuplexerApiV4Url(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {};\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_duplexer_publisher';\n\nexport function publish(payload: object): RequestOptionsFactory<any> {\n function __publish({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.realtime.v4.message',\n method: 'POST' as any,\n methodFqn: 'com.wix.realtime.v4.DuplexerApiV4.Publish',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveComWixRealtimeV4DuplexerApiV4Url({\n protoPath: '/publish',\n data: payload,\n host,\n }),\n data: payload,\n };\n\n return metadata;\n }\n\n return __publish;\n}\n","import { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport {\n Message,\n PublishOptions,\n publish as universalPublish,\n} from './realtime-v4-message-publisher.universal.js';\n\nexport const __metadata = { PACKAGE_NAME: '@wix/duplexer' };\n\nexport function publish(httpClient: HttpClient): PublishSignature {\n return (\n message: NonNullablePaths<Message, `eventName` | `payload`, 2>,\n options?: NonNullablePaths<PublishOptions, `channels`, 2>\n ) =>\n universalPublish(\n message,\n options,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface PublishSignature {\n /** */\n (\n message: NonNullablePaths<Message, `eventName` | `payload`, 2>,\n options?: NonNullablePaths<PublishOptions, `channels`, 2>\n ): Promise<void>;\n}\n\nexport {\n Message,\n PublishOptions,\n PublishRequest,\n PublishResponse,\n PublishToUserRequest,\n PublishToUserRequestTargetingOneOf,\n PublishToUserResponse,\n PublisherInfo,\n UserIdList,\n} from './realtime-v4-message-publisher.universal.js';\n","import { publish as publicPublish } from './realtime-v4-message-publisher.public.js';\nimport { createRESTModule } from '@wix/sdk-runtime/rest-modules';\nimport { BuildRESTFunction, MaybeContext } from '@wix/sdk-types';\n\nexport const publish: MaybeContext<\n BuildRESTFunction<typeof publicPublish> & typeof publicPublish\n> = /*#__PURE__*/ createRESTModule(publicPublish);\n\nexport {\n Message,\n PublisherInfo,\n PublishRequest,\n PublishResponse,\n PublishToUserRequest,\n PublishToUserRequestTargetingOneOf,\n UserIdList,\n PublishToUserResponse,\n PublishOptions,\n} from './realtime-v4-message-publisher.universal.js';\n"],"mappings":";AAAA,SAAS,kBAAkB,yBAAyB;AACpD,SAAS,6CAA6C;;;ACDtD,SAAS,kBAAkB;AAI3B,SAAS,wCACP,MACA;AACA,QAAM,mBAAmB,CAAC;AAE1B,SAAO,WAAW,OAAO,OAAO,MAAM,EAAE,iBAAiB,CAAC,CAAC;AAC7D;AAEA,IAAM,eAAe;AAEd,SAAS,QAAQ,SAA6C;AACnE,WAAS,UAAU,EAAE,KAAK,GAAQ;AAChC,UAAM,WAAW;AAAA,MACf,YAAY;AAAA,MACZ,QAAQ;AAAA,MACR,WAAW;AAAA,MACX,aAAa;AAAA,MACb,kBAAkB;AAAA,QAChB,wBAAwB;AAAA,MAC1B;AAAA,MACA,KAAK,wCAAwC;AAAA,QAC3C,WAAW;AAAA,QACX,MAAM;AAAA,QACN;AAAA,MACF,CAAC;AAAA,MACD,MAAM;AAAA,IACR;AAEA,WAAO;AAAA,EACT;AAEA,SAAO;AACT;;;ADoDA,eAAsBA,SACpB,SACA,SACe;AAEf,QAAM,EAAE,YAAY,YAAY,IAAI,UAAU,CAAC;AAK/C,QAAM,UAAU,sCAAsC;AAAA,IACpD;AAAA,IACA,UAAU,SAAS;AAAA,IACnB,YAAY,SAAS;AAAA,EACvB,CAAC;AAED,QAAM,UAAyC,QAAQ,OAAO;AAE9D,eAAa,aAAa;AAC1B,MAAI;AACF,UAAM,SAAS,MAAM,WAAW,QAAQ,OAAO;AAC/C,iBAAa,YAAY,MAAM;AAAA,EACjC,SAAS,KAAU;AACjB,UAAM,mBAAmB;AAAA,MACvB;AAAA,MACA;AAAA,QACE,wBAAwB,CAAC;AAAA,QACzB,0BAA0B;AAAA,UACxB,SAAS;AAAA,UACT,UAAU;AAAA,UACV,YAAY;AAAA,QACd;AAAA,QACA,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC,WAAW,SAAS;AAAA,IACvB;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;;;AEvHO,SAASC,SAAQ,YAA0C;AAChE,SAAO,CACL,SACA,YAEAA;AAAA,IACE;AAAA,IACA;AAAA;AAAA,IAEA,EAAE,WAAW;AAAA,EACf;AACJ;;;ACnBA,SAAS,wBAAwB;AAG1B,IAAMC,WAEK,iCAAiBA,QAAa;","names":["publish","publish","publish"]}
1
+ {"version":3,"sources":["../../../src/realtime-v4-message-publisher.universal.ts","../../../src/realtime-v4-message-publisher.http.ts","../../../src/realtime-v4-message-publisher.public.ts","../../../src/realtime-v4-message-publisher.context.ts"],"sourcesContent":["import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport { renameKeysFromSDKRequestToRESTRequest } from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport * as ambassadorWixRealtimeV4Message from './realtime-v4-message-publisher.http.js';\n\nexport interface Message {\n /**\n * Unique message identifier\n * @readonly\n * @format GUID\n */\n _id?: string;\n /**\n * Event name, e.g \"product_added\"\n * @maxLength 1000\n */\n eventName?: string;\n /** Event payload, e.g { \"product_id\": \"123\", \"product_name\": \"Product 1\" } */\n payload?: Record<string, any> | null;\n /** Info regarding the publisher of the message */\n publisherInfo?: PublisherInfo;\n}\n\nexport interface PublisherInfo {\n /**\n * Arbitrary string identifier for the publisher, can be used by subscribers to identify the publisher\n * @maxLength 1000\n */\n uid?: string;\n}\n\nexport interface PublishRequest {\n message: Message;\n /**\n * Channel names to publish to, e.g [\"product_notifications\", \"site_notifications\"]\n * @maxSize 10\n * @maxLength 140\n */\n channels: string[];\n /**\n * Optional sub resource identifier, e.g \"important_notification\", only subscribers to this specific resource will receive the message\n * @maxLength 1000\n */\n resourceId?: string | null;\n}\n\nexport interface PublishResponse {}\n\nexport interface PublishToUserRequest\n extends PublishToUserRequestTargetingOneOf {\n /** list of user ids to receive the message */\n includeRecipients?: UserIdList;\n /** list of user ids to exclude from receiving the message */\n excludeRecipients?: UserIdList;\n message?: Message;\n /**\n * Optional sub resource identifier, e.g \"important_notification\", only subscribers to this specific resource will receive the message\n * @maxLength 1000\n */\n resourceId?: string | null;\n}\n\n/** @oneof */\nexport interface PublishToUserRequestTargetingOneOf {\n /** list of user ids to receive the message */\n includeRecipients?: UserIdList;\n /** list of user ids to exclude from receiving the message */\n excludeRecipients?: UserIdList;\n}\n\nexport interface UserIdList {\n /**\n * @maxSize 1000\n * @maxLength 1000\n */\n userId?: string[];\n}\n\nexport interface PublishToUserResponse {}\n\n/** @public\n * @requiredField message\n * @requiredField message.eventName\n * @requiredField message.payload\n * @requiredField options.channels\n * @permissionId realtime:v4:message:publish\n * @fqn com.wix.realtime.v4.DuplexerApiV4.Publish\n */\nexport async function publish(\n message: NonNullablePaths<Message, `eventName` | `payload`, 2>,\n options?: NonNullablePaths<PublishOptions, `channels`, 2>\n): Promise<void> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[2] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n message: message,\n channels: options?.channels,\n resourceId: options?.resourceId,\n });\n\n const reqOpts = ambassadorWixRealtimeV4Message.publish(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {\n message: '$[0]',\n channels: '$[1].channels',\n resourceId: '$[1].resourceId',\n },\n singleArgumentUnchanged: false,\n },\n ['message', 'options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface PublishOptions {\n /**\n * Channel names to publish to, e.g [\"product_notifications\", \"site_notifications\"]\n * @maxSize 10\n * @maxLength 140\n */\n channels: string[];\n /**\n * Optional sub resource identifier, e.g \"important_notification\", only subscribers to this specific resource will receive the message\n * @maxLength 1000\n */\n resourceId?: string | null;\n}\n","import { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveComWixRealtimeV4DuplexerApiV4Url(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'api._api_base_domain_': [\n {\n srcPath: '/wix-duplexer-api',\n destPath: '',\n },\n ],\n 'www._base_domain_': [\n {\n srcPath: '/_api/wix-duplexer-api',\n destPath: '',\n },\n ],\n 'manage._base_domain_': [\n {\n srcPath: '/_api/wix-duplexer-api',\n destPath: '',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/realtime/v4',\n destPath: '/v4',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_duplexer_publisher';\n\nexport function publish(payload: object): RequestOptionsFactory<any> {\n function __publish({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.realtime.v4.message',\n method: 'POST' as any,\n methodFqn: 'com.wix.realtime.v4.DuplexerApiV4.Publish',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveComWixRealtimeV4DuplexerApiV4Url({\n protoPath: '/publish',\n data: payload,\n host,\n }),\n data: payload,\n };\n\n return metadata;\n }\n\n return __publish;\n}\n","import { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport {\n Message,\n PublishOptions,\n publish as universalPublish,\n} from './realtime-v4-message-publisher.universal.js';\n\nexport const __metadata = { PACKAGE_NAME: '@wix/duplexer' };\n\nexport function publish(httpClient: HttpClient): PublishSignature {\n return (\n message: NonNullablePaths<Message, `eventName` | `payload`, 2>,\n options?: NonNullablePaths<PublishOptions, `channels`, 2>\n ) =>\n universalPublish(\n message,\n options,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface PublishSignature {\n /** */\n (\n message: NonNullablePaths<Message, `eventName` | `payload`, 2>,\n options?: NonNullablePaths<PublishOptions, `channels`, 2>\n ): Promise<void>;\n}\n\nexport {\n Message,\n PublishOptions,\n PublishRequest,\n PublishResponse,\n PublishToUserRequest,\n PublishToUserRequestTargetingOneOf,\n PublishToUserResponse,\n PublisherInfo,\n UserIdList,\n} from './realtime-v4-message-publisher.universal.js';\n","import { publish as publicPublish } from './realtime-v4-message-publisher.public.js';\nimport { createRESTModule } from '@wix/sdk-runtime/rest-modules';\nimport { BuildRESTFunction, MaybeContext } from '@wix/sdk-types';\n\nexport const publish: MaybeContext<\n BuildRESTFunction<typeof publicPublish> & typeof publicPublish\n> = /*#__PURE__*/ createRESTModule(publicPublish);\n\nexport {\n Message,\n PublisherInfo,\n PublishRequest,\n PublishResponse,\n PublishToUserRequest,\n PublishToUserRequestTargetingOneOf,\n UserIdList,\n PublishToUserResponse,\n PublishOptions,\n} from './realtime-v4-message-publisher.universal.js';\n"],"mappings":";AAAA,SAAS,kBAAkB,yBAAyB;AACpD,SAAS,6CAA6C;;;ACDtD,SAAS,kBAAkB;AAI3B,SAAS,wCACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,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,mBAAmB;AAAA,MACjB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,EACF;AAEA,SAAO,WAAW,OAAO,OAAO,MAAM,EAAE,iBAAiB,CAAC,CAAC;AAC7D;AAEA,IAAM,eAAe;AAEd,SAAS,QAAQ,SAA6C;AACnE,WAAS,UAAU,EAAE,KAAK,GAAQ;AAChC,UAAM,WAAW;AAAA,MACf,YAAY;AAAA,MACZ,QAAQ;AAAA,MACR,WAAW;AAAA,MACX,aAAa;AAAA,MACb,kBAAkB;AAAA,QAChB,wBAAwB;AAAA,MAC1B;AAAA,MACA,KAAK,wCAAwC;AAAA,QAC3C,WAAW;AAAA,QACX,MAAM;AAAA,QACN;AAAA,MACF,CAAC;AAAA,MACD,MAAM;AAAA,IACR;AAEA,WAAO;AAAA,EACT;AAEA,SAAO;AACT;;;AD2BA,eAAsBA,SACpB,SACA,SACe;AAEf,QAAM,EAAE,YAAY,YAAY,IAAI,UAAU,CAAC;AAK/C,QAAM,UAAU,sCAAsC;AAAA,IACpD;AAAA,IACA,UAAU,SAAS;AAAA,IACnB,YAAY,SAAS;AAAA,EACvB,CAAC;AAED,QAAM,UAAyC,QAAQ,OAAO;AAE9D,eAAa,aAAa;AAC1B,MAAI;AACF,UAAM,SAAS,MAAM,WAAW,QAAQ,OAAO;AAC/C,iBAAa,YAAY,MAAM;AAAA,EACjC,SAAS,KAAU;AACjB,UAAM,mBAAmB;AAAA,MACvB;AAAA,MACA;AAAA,QACE,wBAAwB,CAAC;AAAA,QACzB,0BAA0B;AAAA,UACxB,SAAS;AAAA,UACT,UAAU;AAAA,UACV,YAAY;AAAA,QACd;AAAA,QACA,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC,WAAW,SAAS;AAAA,IACvB;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;;;AEvHO,SAASC,SAAQ,YAA0C;AAChE,SAAO,CACL,SACA,YAEAA;AAAA,IACE;AAAA,IACA;AAAA;AAAA,IAEA,EAAE,WAAW;AAAA,EACf;AACJ;;;ACnBA,SAAS,wBAAwB;AAG1B,IAAMC,WAEK,iCAAiBA,QAAa;","names":["publish","publish","publish"]}
@@ -5,7 +5,32 @@ import { renameKeysFromSDKRequestToRESTRequest } from "@wix/sdk-runtime/rename-a
5
5
  // src/realtime-v4-message-publisher.http.ts
6
6
  import { resolveUrl } from "@wix/sdk-runtime/rest-modules";
7
7
  function resolveComWixRealtimeV4DuplexerApiV4Url(opts) {
8
- const domainToMappings = {};
8
+ const domainToMappings = {
9
+ "api._api_base_domain_": [
10
+ {
11
+ srcPath: "/wix-duplexer-api",
12
+ destPath: ""
13
+ }
14
+ ],
15
+ "www._base_domain_": [
16
+ {
17
+ srcPath: "/_api/wix-duplexer-api",
18
+ destPath: ""
19
+ }
20
+ ],
21
+ "manage._base_domain_": [
22
+ {
23
+ srcPath: "/_api/wix-duplexer-api",
24
+ destPath: ""
25
+ }
26
+ ],
27
+ "www.wixapis.com": [
28
+ {
29
+ srcPath: "/realtime/v4",
30
+ destPath: "/v4"
31
+ }
32
+ ]
33
+ };
9
34
  return resolveUrl(Object.assign(opts, { domainToMappings }));
10
35
  }
11
36
  var PACKAGE_NAME = "@wix/auto_sdk_duplexer_publisher";
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/realtime-v4-message-publisher.universal.ts","../../../src/realtime-v4-message-publisher.http.ts"],"sourcesContent":["import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport { renameKeysFromSDKRequestToRESTRequest } from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport * as ambassadorWixRealtimeV4Message from './realtime-v4-message-publisher.http.js';\n\nexport interface Message {\n /**\n * Unique message identifier\n * @readonly\n * @format GUID\n */\n _id?: string;\n /**\n * Event name, e.g \"product_added\"\n * @maxLength 1000\n */\n eventName?: string;\n /** Event payload, e.g { \"product_id\": \"123\", \"product_name\": \"Product 1\" } */\n payload?: Record<string, any> | null;\n /** Info regarding the publisher of the message */\n publisherInfo?: PublisherInfo;\n}\n\nexport interface PublisherInfo {\n /**\n * Arbitrary string identifier for the publisher, can be used by subscribers to identify the publisher\n * @maxLength 1000\n */\n uid?: string;\n}\n\nexport interface PublishRequest {\n message: Message;\n /**\n * Channel names to publish to, e.g [\"product_notifications\", \"site_notifications\"]\n * @maxSize 10\n * @maxLength 140\n */\n channels: string[];\n /**\n * Optional sub resource identifier, e.g \"important_notification\", only subscribers to this specific resource will receive the message\n * @maxLength 1000\n */\n resourceId?: string | null;\n}\n\nexport interface PublishResponse {}\n\nexport interface PublishToUserRequest\n extends PublishToUserRequestTargetingOneOf {\n /** list of user ids to receive the message */\n includeRecipients?: UserIdList;\n /** list of user ids to exclude from receiving the message */\n excludeRecipients?: UserIdList;\n message?: Message;\n /**\n * Optional sub resource identifier, e.g \"important_notification\", only subscribers to this specific resource will receive the message\n * @maxLength 1000\n */\n resourceId?: string | null;\n}\n\n/** @oneof */\nexport interface PublishToUserRequestTargetingOneOf {\n /** list of user ids to receive the message */\n includeRecipients?: UserIdList;\n /** list of user ids to exclude from receiving the message */\n excludeRecipients?: UserIdList;\n}\n\nexport interface UserIdList {\n /**\n * @maxSize 1000\n * @maxLength 1000\n */\n userId?: string[];\n}\n\nexport interface PublishToUserResponse {}\n\n/** @public\n * @requiredField message\n * @requiredField message.eventName\n * @requiredField message.payload\n * @requiredField options.channels\n * @permissionId realtime:v4:message:publish\n * @fqn com.wix.realtime.v4.DuplexerApiV4.Publish\n */\nexport async function publish(\n message: NonNullablePaths<Message, `eventName` | `payload`, 2>,\n options?: NonNullablePaths<PublishOptions, `channels`, 2>\n): Promise<void> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[2] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n message: message,\n channels: options?.channels,\n resourceId: options?.resourceId,\n });\n\n const reqOpts = ambassadorWixRealtimeV4Message.publish(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {\n message: '$[0]',\n channels: '$[1].channels',\n resourceId: '$[1].resourceId',\n },\n singleArgumentUnchanged: false,\n },\n ['message', 'options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface PublishOptions {\n /**\n * Channel names to publish to, e.g [\"product_notifications\", \"site_notifications\"]\n * @maxSize 10\n * @maxLength 140\n */\n channels: string[];\n /**\n * Optional sub resource identifier, e.g \"important_notification\", only subscribers to this specific resource will receive the message\n * @maxLength 1000\n */\n resourceId?: string | null;\n}\n","import { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveComWixRealtimeV4DuplexerApiV4Url(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {};\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_duplexer_publisher';\n\nexport function publish(payload: object): RequestOptionsFactory<any> {\n function __publish({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.realtime.v4.message',\n method: 'POST' as any,\n methodFqn: 'com.wix.realtime.v4.DuplexerApiV4.Publish',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveComWixRealtimeV4DuplexerApiV4Url({\n protoPath: '/publish',\n data: payload,\n host,\n }),\n data: payload,\n };\n\n return metadata;\n }\n\n return __publish;\n}\n"],"mappings":";AAAA,SAAS,kBAAkB,yBAAyB;AACpD,SAAS,6CAA6C;;;ACDtD,SAAS,kBAAkB;AAI3B,SAAS,wCACP,MACA;AACA,QAAM,mBAAmB,CAAC;AAE1B,SAAO,WAAW,OAAO,OAAO,MAAM,EAAE,iBAAiB,CAAC,CAAC;AAC7D;AAEA,IAAM,eAAe;AAEd,SAAS,QAAQ,SAA6C;AACnE,WAAS,UAAU,EAAE,KAAK,GAAQ;AAChC,UAAM,WAAW;AAAA,MACf,YAAY;AAAA,MACZ,QAAQ;AAAA,MACR,WAAW;AAAA,MACX,aAAa;AAAA,MACb,kBAAkB;AAAA,QAChB,wBAAwB;AAAA,MAC1B;AAAA,MACA,KAAK,wCAAwC;AAAA,QAC3C,WAAW;AAAA,QACX,MAAM;AAAA,QACN;AAAA,MACF,CAAC;AAAA,MACD,MAAM;AAAA,IACR;AAEA,WAAO;AAAA,EACT;AAEA,SAAO;AACT;;;ADoDA,eAAsBA,SACpB,SACA,SACe;AAEf,QAAM,EAAE,YAAY,YAAY,IAAI,UAAU,CAAC;AAK/C,QAAM,UAAU,sCAAsC;AAAA,IACpD;AAAA,IACA,UAAU,SAAS;AAAA,IACnB,YAAY,SAAS;AAAA,EACvB,CAAC;AAED,QAAM,UAAyC,QAAQ,OAAO;AAE9D,eAAa,aAAa;AAC1B,MAAI;AACF,UAAM,SAAS,MAAM,WAAW,QAAQ,OAAO;AAC/C,iBAAa,YAAY,MAAM;AAAA,EACjC,SAAS,KAAU;AACjB,UAAM,mBAAmB;AAAA,MACvB;AAAA,MACA;AAAA,QACE,wBAAwB,CAAC;AAAA,QACzB,0BAA0B;AAAA,UACxB,SAAS;AAAA,UACT,UAAU;AAAA,UACV,YAAY;AAAA,QACd;AAAA,QACA,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC,WAAW,SAAS;AAAA,IACvB;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;","names":["publish"]}
1
+ {"version":3,"sources":["../../../src/realtime-v4-message-publisher.universal.ts","../../../src/realtime-v4-message-publisher.http.ts"],"sourcesContent":["import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport { renameKeysFromSDKRequestToRESTRequest } from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport * as ambassadorWixRealtimeV4Message from './realtime-v4-message-publisher.http.js';\n\nexport interface Message {\n /**\n * Unique message identifier\n * @readonly\n * @format GUID\n */\n _id?: string;\n /**\n * Event name, e.g \"product_added\"\n * @maxLength 1000\n */\n eventName?: string;\n /** Event payload, e.g { \"product_id\": \"123\", \"product_name\": \"Product 1\" } */\n payload?: Record<string, any> | null;\n /** Info regarding the publisher of the message */\n publisherInfo?: PublisherInfo;\n}\n\nexport interface PublisherInfo {\n /**\n * Arbitrary string identifier for the publisher, can be used by subscribers to identify the publisher\n * @maxLength 1000\n */\n uid?: string;\n}\n\nexport interface PublishRequest {\n message: Message;\n /**\n * Channel names to publish to, e.g [\"product_notifications\", \"site_notifications\"]\n * @maxSize 10\n * @maxLength 140\n */\n channels: string[];\n /**\n * Optional sub resource identifier, e.g \"important_notification\", only subscribers to this specific resource will receive the message\n * @maxLength 1000\n */\n resourceId?: string | null;\n}\n\nexport interface PublishResponse {}\n\nexport interface PublishToUserRequest\n extends PublishToUserRequestTargetingOneOf {\n /** list of user ids to receive the message */\n includeRecipients?: UserIdList;\n /** list of user ids to exclude from receiving the message */\n excludeRecipients?: UserIdList;\n message?: Message;\n /**\n * Optional sub resource identifier, e.g \"important_notification\", only subscribers to this specific resource will receive the message\n * @maxLength 1000\n */\n resourceId?: string | null;\n}\n\n/** @oneof */\nexport interface PublishToUserRequestTargetingOneOf {\n /** list of user ids to receive the message */\n includeRecipients?: UserIdList;\n /** list of user ids to exclude from receiving the message */\n excludeRecipients?: UserIdList;\n}\n\nexport interface UserIdList {\n /**\n * @maxSize 1000\n * @maxLength 1000\n */\n userId?: string[];\n}\n\nexport interface PublishToUserResponse {}\n\n/** @public\n * @requiredField message\n * @requiredField message.eventName\n * @requiredField message.payload\n * @requiredField options.channels\n * @permissionId realtime:v4:message:publish\n * @fqn com.wix.realtime.v4.DuplexerApiV4.Publish\n */\nexport async function publish(\n message: NonNullablePaths<Message, `eventName` | `payload`, 2>,\n options?: NonNullablePaths<PublishOptions, `channels`, 2>\n): Promise<void> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[2] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n message: message,\n channels: options?.channels,\n resourceId: options?.resourceId,\n });\n\n const reqOpts = ambassadorWixRealtimeV4Message.publish(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {\n message: '$[0]',\n channels: '$[1].channels',\n resourceId: '$[1].resourceId',\n },\n singleArgumentUnchanged: false,\n },\n ['message', 'options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface PublishOptions {\n /**\n * Channel names to publish to, e.g [\"product_notifications\", \"site_notifications\"]\n * @maxSize 10\n * @maxLength 140\n */\n channels: string[];\n /**\n * Optional sub resource identifier, e.g \"important_notification\", only subscribers to this specific resource will receive the message\n * @maxLength 1000\n */\n resourceId?: string | null;\n}\n","import { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveComWixRealtimeV4DuplexerApiV4Url(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'api._api_base_domain_': [\n {\n srcPath: '/wix-duplexer-api',\n destPath: '',\n },\n ],\n 'www._base_domain_': [\n {\n srcPath: '/_api/wix-duplexer-api',\n destPath: '',\n },\n ],\n 'manage._base_domain_': [\n {\n srcPath: '/_api/wix-duplexer-api',\n destPath: '',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/realtime/v4',\n destPath: '/v4',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_duplexer_publisher';\n\nexport function publish(payload: object): RequestOptionsFactory<any> {\n function __publish({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.realtime.v4.message',\n method: 'POST' as any,\n methodFqn: 'com.wix.realtime.v4.DuplexerApiV4.Publish',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveComWixRealtimeV4DuplexerApiV4Url({\n protoPath: '/publish',\n data: payload,\n host,\n }),\n data: payload,\n };\n\n return metadata;\n }\n\n return __publish;\n}\n"],"mappings":";AAAA,SAAS,kBAAkB,yBAAyB;AACpD,SAAS,6CAA6C;;;ACDtD,SAAS,kBAAkB;AAI3B,SAAS,wCACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,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,mBAAmB;AAAA,MACjB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,EACF;AAEA,SAAO,WAAW,OAAO,OAAO,MAAM,EAAE,iBAAiB,CAAC,CAAC;AAC7D;AAEA,IAAM,eAAe;AAEd,SAAS,QAAQ,SAA6C;AACnE,WAAS,UAAU,EAAE,KAAK,GAAQ;AAChC,UAAM,WAAW;AAAA,MACf,YAAY;AAAA,MACZ,QAAQ;AAAA,MACR,WAAW;AAAA,MACX,aAAa;AAAA,MACb,kBAAkB;AAAA,QAChB,wBAAwB;AAAA,MAC1B;AAAA,MACA,KAAK,wCAAwC;AAAA,QAC3C,WAAW;AAAA,QACX,MAAM;AAAA,QACN;AAAA,MACF,CAAC;AAAA,MACD,MAAM;AAAA,IACR;AAEA,WAAO;AAAA,EACT;AAEA,SAAO;AACT;;;AD2BA,eAAsBA,SACpB,SACA,SACe;AAEf,QAAM,EAAE,YAAY,YAAY,IAAI,UAAU,CAAC;AAK/C,QAAM,UAAU,sCAAsC;AAAA,IACpD;AAAA,IACA,UAAU,SAAS;AAAA,IACnB,YAAY,SAAS;AAAA,EACvB,CAAC;AAED,QAAM,UAAyC,QAAQ,OAAO;AAE9D,eAAa,aAAa;AAC1B,MAAI;AACF,UAAM,SAAS,MAAM,WAAW,QAAQ,OAAO;AAC/C,iBAAa,YAAY,MAAM;AAAA,EACjC,SAAS,KAAU;AACjB,UAAM,mBAAmB;AAAA,MACvB;AAAA,MACA;AAAA,QACE,wBAAwB,CAAC;AAAA,QACzB,0BAA0B;AAAA,UACxB,SAAS;AAAA,UACT,UAAU;AAAA,UACV,YAAY;AAAA,QACd;AAAA,QACA,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC,WAAW,SAAS;AAAA,IACvB;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;","names":["publish"]}
@@ -1,7 +1,32 @@
1
1
  // src/realtime-v4-message-publisher.http.ts
2
2
  import { resolveUrl } from "@wix/sdk-runtime/rest-modules";
3
3
  function resolveComWixRealtimeV4DuplexerApiV4Url(opts) {
4
- const domainToMappings = {};
4
+ const domainToMappings = {
5
+ "api._api_base_domain_": [
6
+ {
7
+ srcPath: "/wix-duplexer-api",
8
+ destPath: ""
9
+ }
10
+ ],
11
+ "www._base_domain_": [
12
+ {
13
+ srcPath: "/_api/wix-duplexer-api",
14
+ destPath: ""
15
+ }
16
+ ],
17
+ "manage._base_domain_": [
18
+ {
19
+ srcPath: "/_api/wix-duplexer-api",
20
+ destPath: ""
21
+ }
22
+ ],
23
+ "www.wixapis.com": [
24
+ {
25
+ srcPath: "/realtime/v4",
26
+ destPath: "/v4"
27
+ }
28
+ ]
29
+ };
5
30
  return resolveUrl(Object.assign(opts, { domainToMappings }));
6
31
  }
7
32
  var PACKAGE_NAME = "@wix/auto_sdk_duplexer_publisher";
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/realtime-v4-message-publisher.http.ts","../../../src/realtime-v4-message-publisher.meta.ts"],"sourcesContent":["import { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveComWixRealtimeV4DuplexerApiV4Url(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {};\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_duplexer_publisher';\n\nexport function publish(payload: object): RequestOptionsFactory<any> {\n function __publish({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.realtime.v4.message',\n method: 'POST' as any,\n methodFqn: 'com.wix.realtime.v4.DuplexerApiV4.Publish',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveComWixRealtimeV4DuplexerApiV4Url({\n protoPath: '/publish',\n data: payload,\n host,\n }),\n data: payload,\n };\n\n return metadata;\n }\n\n return __publish;\n}\n","import * as ambassadorWixRealtimeV4Message from './realtime-v4-message-publisher.http.js';\nimport * as ambassadorWixRealtimeV4MessageTypes from './realtime-v4-message-publisher.types.js';\nimport * as ambassadorWixRealtimeV4MessageUniversalTypes from './realtime-v4-message-publisher.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 publish(): __PublicMethodMetaInfo<\n 'POST',\n {},\n ambassadorWixRealtimeV4MessageUniversalTypes.PublishRequest,\n ambassadorWixRealtimeV4MessageTypes.PublishRequest,\n ambassadorWixRealtimeV4MessageUniversalTypes.PublishResponse,\n ambassadorWixRealtimeV4MessageTypes.PublishResponse\n> {\n const payload = {} as any;\n\n const getRequestOptions = ambassadorWixRealtimeV4Message.publish(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: '/publish',\n pathParams: {},\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 Message as MessageOriginal,\n PublisherInfo as PublisherInfoOriginal,\n PublishRequest as PublishRequestOriginal,\n PublishResponse as PublishResponseOriginal,\n PublishToUserRequest as PublishToUserRequestOriginal,\n PublishToUserRequestTargetingOneOf as PublishToUserRequestTargetingOneOfOriginal,\n UserIdList as UserIdListOriginal,\n PublishToUserResponse as PublishToUserResponseOriginal,\n} from './realtime-v4-message-publisher.types.js';\n"],"mappings":";AAAA,SAAS,kBAAkB;AAI3B,SAAS,wCACP,MACA;AACA,QAAM,mBAAmB,CAAC;AAE1B,SAAO,WAAW,OAAO,OAAO,MAAM,EAAE,iBAAiB,CAAC,CAAC;AAC7D;AAEA,IAAM,eAAe;AAEd,SAAS,QAAQ,SAA6C;AACnE,WAAS,UAAU,EAAE,KAAK,GAAQ;AAChC,UAAM,WAAW;AAAA,MACf,YAAY;AAAA,MACZ,QAAQ;AAAA,MACR,WAAW;AAAA,MACX,aAAa;AAAA,MACb,kBAAkB;AAAA,QAChB,wBAAwB;AAAA,MAC1B;AAAA,MACA,KAAK,wCAAwC;AAAA,QAC3C,WAAW;AAAA,QACX,MAAM;AAAA,QACN;AAAA,MACF,CAAC;AAAA,MACD,MAAM;AAAA,IACR;AAEA,WAAO;AAAA,EACT;AAEA,SAAO;AACT;;;ACdO,SAASA,WAOd;AACA,QAAM,UAAU,CAAC;AAEjB,QAAM,oBAAmD,QAAQ,OAAO;AAExE,QAAM,SAAS,CAAC,YAAyB;AACvC,UAAM,EAAE,IAAI,IAAI,kBAAkB,OAAO;AACzC,WAAO;AAAA,EACT;AAEA,SAAO;AAAA,IACL;AAAA,IACA,YAAY;AAAA,IACZ,MAAM;AAAA,IACN,YAAY,CAAC;AAAA,IACb,eAAe;AAAA,IACf,uBAAuB;AAAA,IACvB,gBAAgB;AAAA,IAChB,wBAAwB;AAAA,EAC1B;AACF;","names":["publish"]}
1
+ {"version":3,"sources":["../../../src/realtime-v4-message-publisher.http.ts","../../../src/realtime-v4-message-publisher.meta.ts"],"sourcesContent":["import { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveComWixRealtimeV4DuplexerApiV4Url(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'api._api_base_domain_': [\n {\n srcPath: '/wix-duplexer-api',\n destPath: '',\n },\n ],\n 'www._base_domain_': [\n {\n srcPath: '/_api/wix-duplexer-api',\n destPath: '',\n },\n ],\n 'manage._base_domain_': [\n {\n srcPath: '/_api/wix-duplexer-api',\n destPath: '',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/realtime/v4',\n destPath: '/v4',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_duplexer_publisher';\n\nexport function publish(payload: object): RequestOptionsFactory<any> {\n function __publish({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.realtime.v4.message',\n method: 'POST' as any,\n methodFqn: 'com.wix.realtime.v4.DuplexerApiV4.Publish',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveComWixRealtimeV4DuplexerApiV4Url({\n protoPath: '/publish',\n data: payload,\n host,\n }),\n data: payload,\n };\n\n return metadata;\n }\n\n return __publish;\n}\n","import * as ambassadorWixRealtimeV4Message from './realtime-v4-message-publisher.http.js';\nimport * as ambassadorWixRealtimeV4MessageTypes from './realtime-v4-message-publisher.types.js';\nimport * as ambassadorWixRealtimeV4MessageUniversalTypes from './realtime-v4-message-publisher.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 publish(): __PublicMethodMetaInfo<\n 'POST',\n {},\n ambassadorWixRealtimeV4MessageUniversalTypes.PublishRequest,\n ambassadorWixRealtimeV4MessageTypes.PublishRequest,\n ambassadorWixRealtimeV4MessageUniversalTypes.PublishResponse,\n ambassadorWixRealtimeV4MessageTypes.PublishResponse\n> {\n const payload = {} as any;\n\n const getRequestOptions = ambassadorWixRealtimeV4Message.publish(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: '/publish',\n pathParams: {},\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 Message as MessageOriginal,\n PublisherInfo as PublisherInfoOriginal,\n PublishRequest as PublishRequestOriginal,\n PublishResponse as PublishResponseOriginal,\n PublishToUserRequest as PublishToUserRequestOriginal,\n PublishToUserRequestTargetingOneOf as PublishToUserRequestTargetingOneOfOriginal,\n UserIdList as UserIdListOriginal,\n PublishToUserResponse as PublishToUserResponseOriginal,\n} from './realtime-v4-message-publisher.types.js';\n"],"mappings":";AAAA,SAAS,kBAAkB;AAI3B,SAAS,wCACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,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,mBAAmB;AAAA,MACjB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,EACF;AAEA,SAAO,WAAW,OAAO,OAAO,MAAM,EAAE,iBAAiB,CAAC,CAAC;AAC7D;AAEA,IAAM,eAAe;AAEd,SAAS,QAAQ,SAA6C;AACnE,WAAS,UAAU,EAAE,KAAK,GAAQ;AAChC,UAAM,WAAW;AAAA,MACf,YAAY;AAAA,MACZ,QAAQ;AAAA,MACR,WAAW;AAAA,MACX,aAAa;AAAA,MACb,kBAAkB;AAAA,QAChB,wBAAwB;AAAA,MAC1B;AAAA,MACA,KAAK,wCAAwC;AAAA,QAC3C,WAAW;AAAA,QACX,MAAM;AAAA,QACN;AAAA,MACF,CAAC;AAAA,MACD,MAAM;AAAA,IACR;AAEA,WAAO;AAAA,EACT;AAEA,SAAO;AACT;;;ACvCO,SAASA,WAOd;AACA,QAAM,UAAU,CAAC;AAEjB,QAAM,oBAAmD,QAAQ,OAAO;AAExE,QAAM,SAAS,CAAC,YAAyB;AACvC,UAAM,EAAE,IAAI,IAAI,kBAAkB,OAAO;AACzC,WAAO;AAAA,EACT;AAEA,SAAO;AAAA,IACL;AAAA,IACA,YAAY;AAAA,IACZ,MAAM;AAAA,IACN,YAAY,CAAC;AAAA,IACb,eAAe;AAAA,IACf,uBAAuB;AAAA,IACvB,gBAAgB;AAAA,IAChB,wBAAwB;AAAA,EAC1B;AACF;","names":["publish"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/auto_sdk_duplexer_publisher",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "license": "MIT",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/",
@@ -50,5 +50,5 @@
50
50
  "fqdn": "wix.realtime.v4.message"
51
51
  }
52
52
  },
53
- "falconPackageHash": "5af66bc355af9c78e018ef06c80f2cf3319e6c3b586c4675e6f43eeb"
53
+ "falconPackageHash": "ce06caa0e9fb2c4d814339967fccbc31e76c7f7afd09f08d9463a7a1"
54
54
  }